@realsee/five 6.3.0-alpha.10 → 6.3.0-alpha.11
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/docs/classes/five.Five.html +18 -18
- package/five/index.js +5 -5
- package/five/index.mjs +10 -8
- package/gltf-loader/index.js +3 -3
- package/gltf-loader/index.mjs +3 -3
- package/line/index.js +3 -3
- package/line/index.mjs +3 -3
- package/package.json +1 -1
- package/plugins/index.js +2 -2
- package/plugins/index.mjs +2 -2
- package/react/index.js +2 -2
- package/react/index.mjs +2 -2
- package/shader-lib/index.js +2 -2
- package/shader-lib/index.mjs +2 -2
- package/sticker/index.js +3 -3
- package/sticker/index.mjs +3 -3
- package/umd/five-gltf-loader.js +3 -3
- package/umd/five-line.js +3 -3
- package/umd/five-plugins.js +2 -2
- package/umd/five-react.js +2 -2
- package/umd/five-shader-lib.js +2 -2
- package/umd/five-sticker.js +3 -3
- package/umd/five-vfx.js +2 -2
- package/umd/five-vue.js +2 -2
- package/umd/five.js +21 -21
- package/vfx/index.js +2 -2
- package/vfx/index.mjs +2 -2
- package/vue/index.js +2 -2
- package/vue/index.mjs +2 -2
package/five/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five
|
|
4
|
-
* Generated: 2024/11/
|
|
5
|
-
* Version: 6.3.0-alpha.
|
|
4
|
+
* Generated: 2024/11/26
|
|
5
|
+
* Version: 6.3.0-alpha.11
|
|
6
6
|
* Terms:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
* Update: July 28, 2021
|
|
@@ -414,7 +414,7 @@ varying vec2 vUv;
|
|
|
414
414
|
void main() {
|
|
415
415
|
gl_FragColor = texture2D(map, vUv);
|
|
416
416
|
}
|
|
417
|
-
`,N0=[],Yn=new d.PerspectiveCamera(90,1,.1,2);Yn.up.set(0,-1,0);Yn.lookAt(new d.Vector3(1,0,0));Yn.updateMatrix();Yn.matrixAutoUpdate=!1;var $n=new d.PerspectiveCamera(90,1,.1,2);$n.up.set(0,-1,0);$n.lookAt(new d.Vector3(-1,0,0));$n.updateMatrix();$n.matrixAutoUpdate=!1;var ei=new d.PerspectiveCamera(90,1,.1,2);ei.up.set(0,0,1);ei.lookAt(new d.Vector3(0,1,0));ei.updateMatrix();ei.matrixAutoUpdate=!1;var ti=new d.PerspectiveCamera(90,1,.1,2);ti.up.set(0,0,-1);ti.lookAt(new d.Vector3(0,-1,0));ti.updateMatrix();ti.matrixAutoUpdate=!1;var ri=new d.PerspectiveCamera(90,1,.1,2);ri.up.set(0,-1,0);ri.lookAt(new d.Vector3(0,0,1));ri.updateMatrix();ri.matrixAutoUpdate=!1;var ni=new d.PerspectiveCamera(90,1,.1,2);ni.up.set(0,-1,0);ni.lookAt(new d.Vector3(0,0,-1));ni.updateMatrix();ni.matrixAutoUpdate=!1;var $o={front:{camera:ri,index:4},back:{camera:ni,index:5},up:{camera:ei,index:2},down:{camera:ti,index:3},left:{camera:$n,index:1},right:{camera:Yn,index:0}};function dd(){var n=N0.pop();return n||new d.ShaderMaterial({uniforms:{map:{value:null},flipY:{value:0}},vertexShader:ld,fragmentShader:cd,depthTest:!1,depthWrite:!1,stencilWrite:!1,blending:d.NoBlending,lights:!1,toneMapped:!1,fog:!1})}function fd(n){n.uniforms.map.value=null,N0.push(n)}function hd(n,t,e){var r=new d.Scene;r.matrixAutoUpdate=!1;var i=new d.Group;i.scale.set(1,1,-1),r.add(i);for(var a=[],o=new Set,s=0,l=n;s<l.length;s++){var u=l[s];o.add(u.face);var c=dd();a.push(c),c.uniforms.map.value=u.texture,c.uniforms.flipY.value=u.flipY?1:0;var f=new d.Group,m=new d.Mesh(ud,c);m.position.set(u.position.x+u.size.x/2-.5,1-(u.position.y+u.size.y/2)-.5,-.5),m.scale.set(u.size.x,u.size.y,1),f.quaternion.copy(sd[u.face]),f.add(m),i.add(f)}var A=e.autoClear,h=e.sortObjects,p=e.xr.enabled,g=t.texture.generateMipmaps;e.autoClear=!1,e.sortObjects=!1,e.xr.enabled=!1,t.texture.generateMipmaps=!1;var v=e.getRenderTarget(),y=0;o.forEach(function(w){++y===o.size&&(t.texture.generateMipmaps=g),e.setRenderTarget(t,$o[w].index),e.render(r,$o[w].camera)}),e.setRenderTarget(v),e.autoClear=A,e.sortObjects=h,e.xr.enabled=p;for(var b=0,x=a;b<x.length;b++){var c=x[b];fd(c)}}var pd=function(){return!1}();function Ri(n){n===void 0&&(n={});var t=Object.assign(document.createElementNS("http://www.w3.org/1999/xhtml","img"),{crossOrigin:"",close:function(){n.onClose&&n.onClose.call(this),this.onerror=this.onload=this.close=Q,this.removeAttribute("src")}});return t}function Ua(n){return new Promise(function(t,e){var r=URL.createObjectURL(n),i=Ri({onClose:function(){this.src===r&&URL.revokeObjectURL(r)}});i.onload=function(){i.src===r&&URL.revokeObjectURL(r),i.onload=i.onerror=Q,setTimeout(function(){t(i)},10)},i.onerror=function(){var a=i.src;i.onload=i.onerror=Q,i.close(),e(new Error("image load error: ".concat(a)))},i.decoding="async",i.src=r})}var es=[];function vd(n,t){var e=es.shift();if(e)return e.width=n,e.height=t,e;var r=Object.assign(document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),{close:function(){r.close=Q,es.push(r)}});return r}function ts(n,t){if(t&&(n.width>t.width||n.height>t.height)){var e=vd(Math.min(n.width,t.width),Math.min(n.height,t.height)),r=e.getContext("2d");r.clearRect(0,0,e.width,e.height),r.drawImage(n,0,0,e.width,e.height),n.close();var i=new d.Texture(e);i.needsUpdate=!0,i.flipY=!0;var a=i.dispose;return i.dispose=function(){e.close(),a.call(i),i.dispose=a},i}else{var o=new d.Texture(n);o.needsUpdate=!0,typeof ImageBitmap!="undefined"&&n instanceof ImageBitmap?o.flipY=!1:o.flipY=!0;var s=o.dispose;return o.dispose=function(){n.close(),s.call(o),o.dispose=s},o}}function md(n){var t=new d.CubeTexture(n);t.needsUpdate=!0,t.flipY=!1;var e=t.dispose;return t.dispose=function(){for(var r=0,i=n;r<i.length;r++){var a=i[r];a.close()}e.call(t),t.dispose=e},t}var rs=new d.Vector3,en=["right","left","up","down","front","back"],Ne=function(){function n(t,e,r,i,a){this.tileTree=e,this.tileSources=r,this.options=i,this.renderer=a,this.name="",this.needsRender=!1,this.maxRequest=n.DEFAULT_MAX_REQUEST,this.disposed=!1,this.loadedCubeNodes=new Set,this.loadingCubeNodes=new Set,this.drawedCubeNodes=new Set,this.baseCubeTexture=null,this._cubeRenderTarget=null,this.prepareToRender=[],this.baseCubeTexture=t}return Object.defineProperty(n.prototype,"cubeRenderTarget",{get:function(){return this._cubeRenderTarget},set:function(t){var e,r,i,a,o,s;if(t===null)throw new Error("cannot set cubeRenderTarget to null.");t.width!==this.options.textureSize&&t.setSize(this.options.textureSize,this.options.textureSize),t.texture.format=(e=this.options.format)!==null&&e!==void 0?e:d.RGBAFormat,t.texture.minFilter=(r=this.options.minFilter)!==null&&r!==void 0?r:d.LinearFilter,t.texture.magFilter=(i=this.options.magFilter)!==null&&i!==void 0?i:d.LinearFilter,t.texture.wrapS=(a=this.options.wrapS)!==null&&a!==void 0?a:d.ClampToEdgeWrapping,t.texture.wrapT=(o=this.options.wrapT)!==null&&o!==void 0?o:d.ClampToEdgeWrapping,t.texture.generateMipmaps=(s=this.options.generateMipmaps)!==null&&s!==void 0?s:!0,this.baseCubeTexture&&(Qa(this.baseCubeTexture,t,this.renderer),this.baseCubeTexture.dispose(),this.baseCubeTexture=null),this._cubeRenderTarget&&Qa(this._cubeRenderTarget.texture,t,this.renderer),this._cubeRenderTarget=t},enumerable:!1,configurable:!0}),n.prototype.requestTile=function(t){var e=this,r,i,a,o,s,l,u=this.tileSources.filter(function(p){return p.level===t.level})[0];if(!u)return this.loadedCubeNodes.add(t),this.prepareToRender.push({node:t,texture:null}),!1;var c=u.size,f=Math.pow(2,t.level)*t.position.y,m=Math.pow(2,t.level)*t.position.x,A="".concat(((a=(i=(r=this.options.imageURL)===null||r===void 0?void 0:r.options)===null||i===void 0?void 0:i.key)!==null&&a!==void 0?a:"pano.0").replace(/^pano/,"pano_tile"),".").concat(t.face,".").concat(t.level,".").concat(f,".").concat(m),h=k(k({},(s=(o=this.options.imageURL)===null||o===void 0?void 0:o.options)!==null&&s!==void 0?s:{key:"unknown"}),{key:A,size:u.scale>=1?void 0:c*t.size*u.scale,quality:void 0,cut:[c*t.position.x,c*t.position.y,c*t.size,c*t.size]});return this.loadingCubeNodes.add(t),this.options.textureLoader.loadTexture(u[t.face],{imageURL:{transform:(l=this.options.imageURL)===null||l===void 0?void 0:l.transform,options:k({},h)},format:d.RGBAFormat,timeout:this.options.timeout,magFilter:this.options.magFilter,minFilter:this.options.minFilter,fetcher:this.options.fetcher}).then(function(p){if(e.disposed){p.body.dispose();return}e.prepareToRender.push({node:t,texture:p.body}),e.loadedCubeNodes.add(t)}).catch(Q).then(function(){e.disposed||e.loadingCubeNodes.delete(t)}),!0},n.prototype.update=function(t,e){var r=this;if(!this.disposed){var i=t.planes[5].normal,a=Math.max(this.maxRequest-this.loadingCubeNodes.size,0),o=[];fo(this.tileTree,function(p){if(p.level>e||!t.intersectsBox(p.box))return!1;!r.loadedCubeNodes.has(p)&&!r.loadingCubeNodes.has(p)&&o.push(p)}),o.sort(function(p,g){return p.level!==g.level?p.level-g.level:p.box.getCenter(rs).angleTo(i)-g.box.getCenter(rs).angleTo(i)});for(var s=0,l=o;s<l.length;s++){var u=l[s];if(a<=0)break;var c=this.requestTile(u);c&&a--}if(this.cubeRenderTarget&&this.prepareToRender.length){this.prepareToRender.sort(function(p,g){return p.node.level-g.node.level});for(var f=[],m=0;m<this.prepareToRender.length;m++){var A=this.prepareToRender[m],u=A.node,h=A.texture;(u.parent===null||this.drawedCubeNodes.has(u.parent))&&(this.drawedCubeNodes.add(u),h&&f.push({face:u.face,position:u.position,size:new d.Vector2(u.size,u.size),texture:h,flipY:!h.flipY}),this.prepareToRender.splice(m,1),m--)}f.length&&(hd(f,this.cubeRenderTarget,this.renderer),this.needsRender=!0)}}},Object.defineProperty(n.prototype,"tilePending",{get:function(){return this.loadingCubeNodes.size},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"texture",{get:function(){if(!this._cubeRenderTarget)throw new Error("cubeRenderTarget never set.");return this._cubeRenderTarget.texture},enumerable:!1,configurable:!0}),n.prototype.dispose=function(){if(!this.disposed){this.disposed=!0,this.baseCubeTexture&&(this.baseCubeTexture.dispose(),this.baseCubeTexture=null),this.loadingCubeNodes.clear(),this.loadedCubeNodes.clear();for(var t=0,e=this.prepareToRender;t<e.length;t++){var r=e[t];r.texture&&r.texture.dispose()}this.prepareToRender.length=0}},n.DEFAULT_MAX_REQUEST=3,n}(),Bn=function(){function n(){}return n.prototype.loadTexture=function(t,e,r,i,a,o){var s,l,u,c,f,m,A;r===void 0&&(r=Q),i===void 0&&(i=Q),a===void 0&&(a=Q);var h={};typeof e.flipY!="undefined"&&(h.flipY=e.flipY),typeof e.format!="undefined"&&(h.format=e.format),typeof e.encoding!="undefined"&&(h.encoding=e.encoding),h.generateMipmaps=(s=e.generateMipmaps)!==null&&s!==void 0?s:!1,h.minFilter=(l=e.minFilter)!==null&&l!==void 0?l:d.LinearFilter,h.magFilter=(u=e.magFilter)!==null&&u!==void 0?u:d.LinearFilter;var p=(f=(c=e.imageURL)===null||c===void 0?void 0:c.options)!==null&&f!==void 0?f:{key:"unknown"};t=sn(t,(m=e.imageURL)===null||m===void 0?void 0:m.transform,p);var g=Wo(t),v=(A=e.viaAjax)!==null&&A!==void 0?A:pd,y=Xo(t),b=/^https?:/.test(g);if(y?v=!0:b||(v=!1),v){var x=null,w="blob";return e.fetcher.ajax(t,{timeout:e.timeout,responseType:w},void 0,void 0,a).then(function(M){return Ua(M.body)}).then(function(M){return ts(M,e.maxSize)}).then(function(M){return Object.assign(M,h),M}).then(function(M){var R={meta:x,body:M};return r(R),R}).catch(function(M){return i(M),Promise.reject(M)})}else{var E=null,C;return Promise.resolve().then(function(){return Ri()}).then(function(M){return C=M,e.fetcher.loadImage(t,{timeout:e.timeout},void 0,void 0,a,M)}).then(function(M){return E=M.meta,ts(M.body,e.maxSize)}).then(function(M){return Object.assign(M,h),M}).then(function(M){var R={meta:E,body:M};return r(R),R}).catch(function(M){return C&&C.close(),i(M),Promise.reject(M)})}},n.prototype.loadCubeTexture=function(t,e,r,i,a,o){var s,l,u,c,f,m,A;r===void 0&&(r=Q),i===void 0&&(i=Q),a===void 0&&(a=Q);var h={};typeof e.format!="undefined"&&(h.format=e.format),h.generateMipmaps=(s=e.generateMipmaps)!==null&&s!==void 0?s:!1,h.minFilter=(l=e.minFilter)!==null&&l!==void 0?l:d.LinearFilter,h.magFilter=(u=e.magFilter)!==null&&u!==void 0?u:d.LinearFilter;for(var p=[t[en[0]],t[en[1]],t[en[2]],t[en[3]],t[en[4]],t[en[5]]],g=[],v=[0,0,0,0,0,0],y=[],b=function(w){var E=(f=(c=e.imageURL)===null||c===void 0?void 0:c.options)!==null&&f!==void 0?f:{key:"unknown"},C=sn(p[w],(m=e.imageURL)===null||m===void 0?void 0:m.transform,k(k({},E),{key:E.key+"."+en[w]})),M=Wo(C),R=function(V){v[w]=V,a(v.reduce(function(D,z){return D+z},0)/6)},L=(A=e.viaAjax)!==null&&A!==void 0?A:!1,S=/^https?:$/.test(M),I=Xo(C);if(I?L=!0:S||(L=!1),L){var O="blob",P=e.fetcher.ajax(C,{timeout:e.timeout,responseType:O},void 0,void 0,R).then(function(V){return y[w]=V.meta,Ua(V.body)});g.push(P)}else{var F,P=Promise.resolve().then(function(){return Ri()}).then(function(D){return F=D,e.fetcher.loadImage(C,{timeout:e.timeout},void 0,void 0,R,D)}).then(function(D){return y[w]=D.meta,D.body}).catch(function(D){return F&&F.close(),Promise.reject(D)});g.push(P)}},x=0;x<6;x++)b(x);return Promise.all(g).then(function(w){return md(w)}).then(function(w){return Object.assign(w,k({encoding:d.sRGBEncoding},h)),w}).then(function(w){var E={body:w,meta:y};return r(E),E}).catch(function(w){for(var E=0,C=g;E<C.length;E++){var M=C[E];M.then(function(R){return R.close()}).catch(Q)}return i(w),Promise.reject(w)})},n.prototype.loadTiledCubeTexture=function(t,e,r,i,a,o,s){var l=this;return i===void 0&&(i=Q),a===void 0&&(a=Q),o===void 0&&(o=Q),new Promise(function(u,c){var f,m;l.loadCubeTexture(t,{imageURL:{transform:(f=r.imageURL)===null||f===void 0?void 0:f.transform,options:(m=r.imageURL)===null||m===void 0?void 0:m.options},format:d.RGBAFormat,viaAjax:r.viaAjax,timeout:r.timeout,fetcher:r.fetcher,magFilter:r.magFilter,minFilter:r.minFilter,generateMipmaps:r.generateMipmaps},function(A){var h,p=A.meta,g=A.body,v=(h=r.tileMaxLevel)!==null&&h!==void 0?h:2,y=Math.max(1024*v,512),b=Da(v),x=new Ne(g,b,e,{textureSize:y,textureLoader:l,imageURL:r.imageURL,magFilter:r.magFilter,minFilter:r.minFilter,generateMipmaps:r.generateMipmaps,timeout:r.timeout,fetcher:r.fetcher},s),w={meta:p,body:x};i(w),u(w)},function(A){a(A),c(A)},o,s).catch(Q)})},n}();const Ad=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("n\bv{t-rpA-d|yq]|vv|{Hn\bv{t-rp@-PnzrnQvrpv|{H0v{pyqr-Ip|zz|{K0v{pyqr-Iz|}untrl}nlrr\x07K0v{pyqr-Ixv{{v{tl}nlrr\x07K0v{pyqr-Iy|tqr}uosl}nlrr\x07K0v{pyqr-Ipyv}}v{tl}yn{rl}nlrr\x07KZNV[lORS\\_R|vq-znv{56-\n--ZNV[l`aN_a--0v{pyqr-Ixv{onrlrr\x07K--0v{pyqr-Iortv{lrr\x07K--0v{pyqr-Iz|}untrlrr\x07K--0v{pyqr-Ixv{{v{tlrr\x07K--0v{pyqr-I}|wrplrr\x07K--0v{pyqr-Iy|tqr}uoslrr\x07K--0v{pyqr-Ipyv}}v{tl}yn{rlrr\x07K--d|yq]|vv|{-J-rpA5n{s|zrq9->;=6H--0vsqrs-b`RlV[`aN[PV[T----d|yq]|vv|{-J-v{n{prZnv\x07-7-d|yq]|vv|{H--0r{qvs--d|yq]|vv|{-J-z|qryZnv\x07-7-d|yq]|vv|{H--zn@-pnzrn_|nv|{Znv\x07-J-zn@5vrZnv\x07h=jh=j9-vrZnv\x07h>jh=j9-vrZnv\x07h?jh=j9-vrZnv\x07h=jh>j9-vrZnv\x07h>jh>j9-vrZnv\x07h?jh>j9-vrZnv\x07h=jh?j9-vrZnv\x07h>jh?j9-vrZnv\x07h?jh?j6H--PnzrnQvrpv|{-J-{|znyv r5pnzrn_|nv|{Znv\x07-7-rp@5=;=9-=;=9-:>;=66H--0v{pyqr-I|yq}|lrr\x07K--0v{pyqr-Is|tlrr\x07K--ZNV[lR[Q\f"),gd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("0qrsv{r-OYNPXlP\\Y\\_-rpA5=;=EC9-=;>=C9-=;>AF9->;=6{vs|z-nz}yrPor-}n{|=lzn}H{vs|z-znA-}n{|=lznv\x07H{vs|z-sy|n-}n{|=l ||zH0vs-qrsv{rq5b`RlYbZV[N[PR6--{vs|z-nz}yrPor-}n{|=lyzv{n{prZn}H0r{qvs{vs|z-nz}yrPor-}n{|>lzn}H{vs|z-znA-}n{|>lznv\x07H{vs|z-sy|n-}n{|>l ||zH0vs-qrsv{rq5b`RlYbZV[N[PR6--{vs|z-nz}yrPor-}n{|>lyzv{n{prZn}H0r{qvs{vs|z-sy|n-z|qryNy}unH{vs|z-sy|n-}|trHn\bv{t-rpA-d|yq]|vv|{Hn\bv{t-rp@-PnzrnQvrpv|{H{vs|z-sy|n-u|{Sy||V{qr\x07H{vs|z-rp?-r|yv|{H{vs|z-sy|n-}v\x07ry_nv|H0vs{qrs-SYNal`UNQRQ--n\bv{t-rp@-[|znyH0r{qvs0v{pyqr-Ip|zz|{K0v{pyqr-Iqvurv{tl}nlsntzr{K0v{pyqr-Is|tl}nlsntzr{K0v{pyqr-I}rpynzn}l}nlsntzr{K0v{pyqr-Iy|tqr}uosl}nlsntzr{K0v{pyqr-Ipyv}}v{tl}yn{rl}nlsntzr{Krp@- ||zcrp|5rp@-qvrpv|{9-rp@-rp|9-sy|n- ||z6-\n--sy|n-urn-J-q|5qvrpv|{9-rp|6H--rp@-q-J-qvrpv|{-7-urnH--rp@-}-J-rp|-:-qH--rp@-\0-J-}-7- ||zH--r{-{|znyv r5q-8-\x006H\fZNV[lORS\\_R|vq-znv{56-\n--ZNV[l`aN_a--0v{pyqr-Ipyv}}v{tl}yn{rlsntzr{K--<<-JJJ-全景图-JJJ--rp@-}n{|=a|crr\x07-J-{|znyv r5d|yq]|vv|{;\x07\b -:-}n{|=lznv\x07h@j;\x07\b 6H--}n{|=a|crr\x07-J- ||zcrp|5PnzrnQvrpv|{9-}n{|=a|crr\x079-}n{|=l ||z6H--}n{|=a|crr\x07-J-}n{|=a|crr\x07-7-zn@5}n{|=lznv\x076H--rp@-}n{|>a|crr\x07-J-{|znyv r5d|yq]|vv|{;\x07\b -:-}n{|>lznv\x07h@j;\x07\b 6H--}n{|>a|crr\x07-J- ||zcrp|5PnzrnQvrpv|{9-}n{|>a|crr\x079-}n{|>l ||z6H--}n{|>a|crr\x07-J-}n{|>a|crr\x07-7-zn@5}n{|>lznv\x076H--rpA-}n{|P|y|H--rpA-}n{|=P|y|-J-r\x07rPor5}n{|=lzn}9-}n{|=a|crr\x076H--rpA-}n{|>P|y|-J-r\x07rPor5}n{|>lzn}9-}n{|>a|crr\x076H--0vs-qrsv{rq5b`RlYbZV[N[PR6----}n{|=P|y|;n-J->;=-:-r\x07rPor5}n{|=lyzv{n{prZn}9-}n{|=a|crr\x076;H----}n{|>P|y|;n-J->;=-:-r\x07rPor5}n{|>lyzv{n{prZn}9-}n{|>a|crr\x076;H--0r{qvs--0vs-qrsv{rq5b`RlOYNPXla_N[`VaV\\[6----sy|n-oynpx]|tr-J-np|5:?;=-7-}|tr-8->;=6H----}n{|P|y|-J-zv\x075}n{|=P|y|9-OYNPXlP\\Y\\_9-zv{5>;=9-oynpx]|tr66H----}n{|P|y|-J-zv\x075}n{|P|y|9-}n{|>P|y|9-zn\x075=;=9-oynpx]|tr-:-]V-8->;=66H--0ryvs-qrsv{rq5b`Rl`]_RNQla_N[`VaV\\[6----rp?-prr{Pr{rP||q-J-r|yv|{-7-}v\x07ry_nv|-<-?;=H----sy|n-n{vv|{_nqv-J-qvn{pr5rp?5=;=9-=;=69-prr{Pr{rP||q6-7->;?H----sy|n-n{vv|{]|tr-J--qvn{pr5tylSntP||q;\x07\b9-prr{Pr{rP||q6-<-n{vv|{_nqvH----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-z||ur}5=;=9-=;?9-}|tr-:-n{vv|{]|tr66H--0ryr----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-}|tr6H--0r{qvs--tylSntP|y|-J-zv\x075}n{|P|y|9-rpA5}n{|P|y|;to9-=;=69-\05z|qryNy}un66H--<<-JJJJJJJJJJJJJJJJ--ZNV[lZ\\QRYlP\\Y\\_--0v{pyqr-Is|tlsntzr{K--0v{pyqr-I}rzyv}yvrqlny}unlsntzr{K--0v{pyqr-Iqvurv{tlsntzr{K--ZNV[lR[Q\f"),yd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("0vs-qrsv{rq5b`RlRQY6--n\bv{t-sy|n-Y|tQr}uH0r{qvs0vs-qrsv{rq5b`RlcR_aRelZN_X6--nvor-sy|n-znxH0r{qvsn\bv{t-sy|n-V_||sZnxHn\bv{t-rpA-d|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zrnQvrpv|{-J-{|znyv r5pnzrn_|nv|{Znv\x07-7-rp@5=;=9-=;=9-:>;=66H--0vs-qrsv{rq5b`RlRQY6----Y|tQr}u-J-y|t?5:z]|vv|{; 6H--0r{qvs--V_||sZnx-J-=;=H--0vs-qrsv{rq5b`RlcR_aRelZN_X6----V_||sZnx-J-r}5no5znx-:->;=69-=;>6H--0r{qvs--0v{pyqr-I|yq}|lrr\x07K--0v{pyqr-Ir{zn}lrr\x07K--0v{pyqr-Is|tlrr\x07K--ZNV[lR[Q\f"),bd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("0qrsv{r-OYNPXlP\\Y\\_-rpA5=;=EC9-=;>=C9-=;>AF9->;=6{vs|z-sy|n-sy||H{vs|z-nz}yrPor-}n{|=lzn}H{vs|z-znA-}n{|=lznv\x07H{vs|z-sy|n-}n{|=l ||zH0vs-qrsv{rq5b`RlYbZV[N[PR6--{vs|z-nz}yrPor-}n{|=lyzv{n{prZn}H0r{qvs{vs|z-nz}yrPor-}n{|>lzn}H{vs|z-znA-}n{|>lznv\x07H{vs|z-sy|n-}n{|>l ||zH0vs-qrsv{rq5b`RlYbZV[N[PR6--{vs|z-nz}yrPor-}n{|>lyzv{n{prZn}H0r{qvs{vs|z-sy|n-z|qryNy}unH{vs|z-sy|n-}|trH0vs-qrsv{rq5b`RlP\\[`aN[alP\\Y\\_6--{vs|z-rp@-p|{n{P|y|H0r{qvsp-Pyv}}r-\n--znA-znv\x07V{rrH--sy|n-sy||V{qr\x07H\fH0vs-[bZlPYV]]R_`-K-=--{vs|z-Pyv}}r-pyv}}rh[bZlPYV]]R_`jH0r{qvs0vs-qrsv{rq5b`RlRQY6--n\bv{t-sy|n-Y|tQr}uH0r{qvsn\bv{t-rpA-d|yq]|vv|{Hn\bv{t-rp@-PnzrnQvrpv|{H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0;\x07-:-zv{5\0;9-\0;\b6H----sy|n-r-J->;=r:>=H----r{-rp@5no5\0; -8-5\0;-:-\0;\b6-<-5C;=-7-q-8-r669-q-<-5\0;\x07-8-r69-\0;\x076H\frp@-u?to5rp@-p6-\n----rpA-X-J-rpA5>;=9-?;=-<-@;=9->;=-<-@;=9-@;=6H----rp@-}-J-no5snp5p;\x07\x07\x07-8-X;\x07\b 6-7-C;=-:-X;6H----r{-p; -7-zv\x075X;\x07\x07\x079-pynz}5}-:-X;\x07\x07\x079-=;=9->;=69-p;\b6H\fZNV[lORS\\_R|vq-znv{56-\n--ZNV[l`aN_a--<<-JJJ-顶部裁切-JJJ--sy|n-||sP]|tr-J-}|5pynz}5:PnzrnQvrpv|{;\b9-=;=9->;=69-@;=6H--vs-5----V_||sZnx-K-=;B-33----d|yq]|vv|{;\b-K-z|qryO|{qv{tZn\x07;\b-:-||sP]|tr-7-5z|qryO|{qv{tZn\x07;\b-:-z|qryO|{qv{tZv{;\b6--6-\n----qvpnqH--\f--<<-JJJJJJJJJJJJJJ--<<-JJJ-前置裁切计算-JJJ--0vs-[bZlPYV]]R_`-K-=----o||y-pyv}}rqH----rpA-pyv}}r]|vv|{H----0}ntzn-{|yyly||}ln----s|-5-v{-v-J-=H-v-I-[bZlPYV]]R_`H-v-88-6-\n------pyv}}r]|vv|{-J-pyv}}rh-v-j;znv\x07V{rr-7-d|yq]|vv|{H------pyv}}rq-J-5pyv}}rh-v-j;sy||V{qr\x07-I-=;=-\v\v-no5sy||-:-pyv}}rh-v-j;sy||V{qr\x076-I->;=6H------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\x07-K-:=;B-33-pyv}}r]|vv|{;\x07-I-=;BH------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\b-K-:=;B-33-pyv}}r]|vv|{;\b-I-=;BH------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{; -K-:=;B-33-pyv}}r]|vv|{; -I-=;BH------vs-5pyv}}rq6-\n--------qvpnqH------\f----\f----0}ntzn-{|yyly||}lr{q--0r{qvs--<<-JJJJJJJJJJJJJJJJJJ--0v{pyqr-Ipyv}}v{tl}yn{rlsntzr{K--rpA-qvssrP|y|-J-rpA5-qvssr9-|}npv\b-6H--0v{pyqr-Iy|tqr}uoslsntzr{K--0v{pyqr-Izn}lsntzr{K--0v{pyqr-Ip|y|lsntzr{K--0v{pyqr-Iny}unzn}lsntzr{K--0v{pyqr-Iny}unrlsntzr{K--0v{pyqr-I}rpynzn}lsntzr{K--_rsyrprqYvtu-rsyrprqYvtu-J-_rsyrprqYvtu5-rp@5-=;=-69-rp@5-=;=-69-rp@5-=;=-69-rp@5-=;=-6-6H--<<-nppzynv|{-5onxrq-v{qvrp-yvtuv{t-|{y\b6--0vsqrs-b`RlYVTUaZN]----rpA-yvtuZn}ar\x07ryJ-r\x07r?Q5-yvtuZn}9-b?-6H----rsyrprqYvtu;v{qvrpQvssr-8J-yvtuZn}ar\x07rya|Yv{rn5-yvtuZn}ar\x07ry-6;to-7-yvtuZn}V{r{v\bH--0ryr----rsyrprqYvtu;v{qvrpQvssr-8J-rp@5->;=-6H--0r{qvs--<<-z|qynv|{--0v{pyqr-In|zn}lsntzr{K--rsyrprqYvtu;v{qvrpQvssr-7J-qvssrP|y|;toH--rp@-|t|v{tYvtu-J-rsyrprqYvtu;v{qvrpQvssrH--0v{pyqr-Ir{zn}lsntzr{K--tylSntP|y|-J-rpA5-|t|v{tYvtu9-qvssrP|y|;n-6H--<<-JJJ-纯色-JJJ--0vs-qrsv{rq5b`RlP\\[`aN[alP\\Y\\_6----tylSntP|y|-J-rpA5p|{n{P|y|;9-p|{n{P|y|;t9-p|{n{P|y|;o9-|}npv\b6H--0r{qvs--<<-JJJJJJJJJJJ--<<-JJJ-楼层显示-JJJ--sy|n-sy||\\}npv\b-J->;=H--vs-5u|{Sy||V{qr\x07-K-:=;=>-33-no5sy||-:-u|{Sy||V{qr\x076-K-=;FF6-\n----sy||\\}npv\b-J-=;?-7-zv{55>;=-8-PnzrnQvrpv|{;\b69->;=6H--\f--tylSntP|y|;n-J-tylSntP|y|;n-7-sy||\\}npv\b-7-ovtu{rH--<<-JJJJJJJJJJJJJJ--<<-颜色增益调整,在色调映射前--rp@-toP|y|-J-tylSntP|y|;toH--rp@-uP|y|-J-to?u5toP|y|6H--rp@-sv{nyU`c-J-rp@5uP|y|;\x079-uP|y|;\b-8-p|y|`nnv|{9-uP|y|; -8-p|y|Ovtu{r6H--tylSntP|y|;to-J-u?to5sv{nyU`c6H---ZNV[lZ\\QRYlP\\Y\\_--<<色调映射-色彩空间转换--0v{pyqr-I|{rzn}}v{tlsntzr{K--0v{pyqr-Ir{p|qv{tlsntzr{K--<<-JJJ-全景图-JJJ--rp@-}n{|=a|crr\x07-J-{|znyv r5d|yq]|vv|{;\x07\b -:-}n{|=lznv\x07h@j;\x07\b 6H--}n{|=a|crr\x07-J- ||zcrp|5PnzrnQvrpv|{9-}n{|=a|crr\x079-}n{|=l ||z6H--}n{|=a|crr\x07-J-}n{|=a|crr\x07-7-zn@5}n{|=lznv\x076H--rp@-}n{|>a|crr\x07-J-{|znyv r5d|yq]|vv|{;\x07\b -:-}n{|>lznv\x07h@j;\x07\b 6H--}n{|>a|crr\x07-J- ||zcrp|5PnzrnQvrpv|{9-}n{|>a|crr\x079-}n{|>l ||z6H--}n{|>a|crr\x07-J-}n{|>a|crr\x07-7-zn@5}n{|>lznv\x076H--rpA-}n{|P|y|H--rpA-}n{|=P|y|-J-r\x07rPor5}n{|=lzn}9-}n{|=a|crr\x076H--rpA-}n{|>P|y|-J-r\x07rPor5}n{|>lzn}9-}n{|>a|crr\x076H--0vs-qrsv{rq5b`RlYbZV[N[PR6----}n{|=P|y|;n-J->;=-:-r\x07rPor5}n{|=lyzv{n{prZn}9-}n{|=a|crr\x076;H----}n{|>P|y|;n-J->;=-:-r\x07rPor5}n{|>lyzv{n{prZn}9-}n{|>a|crr\x076;H--0r{qvs--0vs-qrsv{rq5b`RlOYNPXla_N[`VaV\\[6----sy|n-oynpx]|tr-J-np|5:?;=-7-}|tr-8->;=6H----}n{|P|y|-J-zv\x075}n{|=P|y|9-OYNPXlP\\Y\\_9-zv{5>;=9-oynpx]|tr66H----}n{|P|y|-J-zv\x075}n{|P|y|9-}n{|>P|y|9-zn\x075=;=9-oynpx]|tr-:-]V-8->;=66H--0ryvs-qrsv{rq5b`Rl`]_RNQla_N[`VaV\\[6----rp?-prr{Pr{rP||q-J-r|yv|{-7-}v\x07ry_nv|-<-?;=H----sy|n-n{vv|{_nqv-J-qvn{pr5rp?5=;=9-=;=69-prr{Pr{rP||q6-7->;?H----sy|n-n{vv|{]|tr-J-qvn{pr5tylSntP||q;\x07\b9-prr{Pr{rP||q6-<-n{vv|{_nqvH----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-z||ur}5=;=9-=;?9-}|tr-:-n{vv|{]|tr66H--0ryr----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-}|tr6H--0r{qvs--tylSntP|y|-J-zv\x075}n{|P|y|9-tylSntP|y|9-z|qryNy}un6H--<<-JJJJJJJJJJJJJ--0v{pyqr-Is|tlsntzr{K--0v{pyqr-I}rzyv}yvrqlny}unlsntzr{K--0v{pyqr-Iqvurv{tlsntzr{K--0vs-qrsv{rq5b`RlRQY6----tylSntP|y|;n-J-Y|tQr}uH--0r{qvs--ZNV[lR[Q\f"),xd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("0qrsv{r-]U\\[T0vs-qrsv{rq5b`RlRQY6--n\bv{t-sy|n-Y|tQr}uH0r{qvs0vs-qrsv{rq5b`RlcR_aRelZN_X6--nvor-sy|n-znxH0r{qvsn\bv{t-sy|n-V_||sZnxHn\bv{t-rpA-d|yq]|vv|{Hn\bv{t-rp@-PnzrnQvrpv|{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zrn_|nv|{Znv\x07-J-zn@5vrZnv\x07h=jh=j9-vrZnv\x07h>jh=j9-vrZnv\x07h?jh=j9-vrZnv\x07h=jh>j9-vrZnv\x07h>jh>j9-vrZnv\x07h?jh>j9-vrZnv\x07h=jh?j9-vrZnv\x07h>jh?j9-vrZnv\x07h?jh?j6H--PnzrnQvrpv|{-J-{|znyv r5pnzrn_|nv|{Znv\x07-7-rp@5=;=9-=;=9-:>;=66H--0vs-qrsv{rq5b`RlRQY6----Y|tQr}u-J-y|t?5:z]|vv|{; 6H--0r{qvs--V_||sZnx-J-=;=H--0vs-qrsv{rq5b`RlcR_aRelZN_X6----V_||sZnx-J-r}5no5znx-:->;=69-=;>6H--0r{qvs--0v{pyqr-I|yq}|lrr\x07K--0v{pyqr-Ir{zn}lrr\x07K--0v{pyqr-Iunq|zn}lrr\x07K--0v{pyqr-Is|tlrr\x07K--ZNV[lR[Q\f"),wd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("0qrsv{r-]U\\[T0qrsv{r-OYNPXlP\\Y\\_-rpA5=;=EC9-=;>=C9-=;>AF9->;=6{vs|z-sy|n-sy||H{vs|z-nz}yrPor-}n{|=lzn}H{vs|z-znA-}n{|=lznv\x07H{vs|z-sy|n-}n{|=l ||zH0vs-qrsv{rq5b`RlYbZV[N[PR6--{vs|z-nz}yrPor-}n{|=lyzv{n{prZn}H0r{qvs{vs|z-nz}yrPor-}n{|>lzn}H{vs|z-znA-}n{|>lznv\x07H{vs|z-sy|n-}n{|>l ||zH0vs-qrsv{rq5b`RlYbZV[N[PR6--{vs|z-nz}yrPor-}n{|>lyzv{n{prZn}H0r{qvs{vs|z-sy|n-z|qryNy}unH{vs|z-sy|n-}|trH0vs-qrsv{rq5b`RlP\\[`aN[alP\\Y\\_6--{vs|z-rp@-p|{n{P|y|H0r{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iy|tqr}uosl}nlsntzr{K0v{pyqr-Ipyv}}v{tl}yn{rl}nlsntzr{Krp@- ||zcrp|5rp@-qvrpv|{9-rp@-rp|9-sy|n- ||z6-\n--sy|n-urn-J-q|5qvrpv|{9-rp|6H--rp@-q-J-qvrpv|{-7-urnH--rp@-}-J-rp|-:-qH--rp@-\0-J-}-7- ||zH--r{-{|znyv r5q-8-\x006H\frp@-to?u5rp@-p6-\n----rpA-X-J-rpA5=;=9-:>;=-<-@;=9-?;=-<-@;=9-:>;=6H----rpA-}-J-zv\x075rpA5p;ot9-X; 69-rpA5p;to9-X;\x07\b69-r}5p;o9-p;t66H----rpA-\0-J-zv\x075rpA5};\x07\b9-p;69-rpA5p;9-};\b \x0769-r}5};\x079-p;66H----sy|n-q-J-\0;\x07-:-zv{5\0;9-\0;\b6H----sy|n-r-J->;=r:>=H----r{-rp@5no5\0; -8-5\0;-:-\0;\b6-<-5C;=-7-q-8-r669-q-<-5\0;\x07-8-r69-\0;\x076H\frp@-u?to5rp@-p6-\n----rpA-X-J-rpA5>;=9-?;=-<-@;=9->;=-<-@;=9-@;=6H----rp@-}-J-no5snp5p;\x07\x07\x07-8-X;\x07\b 6-7-C;=-:-X;6H----r{-p; -7-zv\x075X;\x07\x07\x079-pynz}5}-:-X;\x07\x07\x079-=;=9->;=69-p;\b6H\fZNV[lORS\\_R|vq-znv{56-\n--ZNV[l`aN_a--<<-JJJ-顶部裁切-JJJ--sy|n-||sP]|tr-J-}|5pynz}5:PnzrnQvrpv|{;\b9-=;=9->;=69-@;=6H--vs-5----V_||sZnx-K-=;B-33----d|yq]|vv|{;\b-K-z|qryO|{qv{tZn\x07;\b-:-||sP]|tr-7-5z|qryO|{qv{tZn\x07;\b-:-z|qryO|{qv{tZv{;\b6--6-\n----qvpnqH--\f--<<-JJJJJJJJJJJJJJ--<<-JJJ-前置裁切计算-JJJ--0vs-[bZlPYV]]R_`-K-=----o||y-pyv}}rqH----rpA-pyv}}r]|vv|{H----0}ntzn-{|yyly||}ln----s|-5-v{-v-J-=H-v-I-[bZlPYV]]R_`H-v-88-6-\n------pyv}}r]|vv|{-J-pyv}}rh-v-j;znv\x07V{rr-7-d|yq]|vv|{H------pyv}}rq-J-5pyv}}rh-v-j;sy||V{qr\x07-I-=;=-\v\v-no5sy||-:-pyv}}rh-v-j;sy||V{qr\x076-I->;=6H------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\x07-K-:=;B-33-pyv}}r]|vv|{;\x07-I-=;BH------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\b-K-:=;B-33-pyv}}r]|vv|{;\b-I-=;BH------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{; -K-:=;B-33-pyv}}r]|vv|{; -I-=;BH------vs-5pyv}}rq6-\n--------qvpnqH------\f----\f----0}ntzn-{|yyly||}lr{q--0r{qvs--<<-JJJJJJJJJJJJJJJJ--0v{pyqr-Ipyv}}v{tl}yn{rlsntzr{K--rpA-qvssrP|y|-J-rpA5-qvssr9-|}npv\b-6H--_rsyrprqYvtu-rsyrprqYvtu-J-_rsyrprqYvtu5-rp@5-=;=-69-rp@5-=;=-69-rp@5-=;=-69-rp@5-=;=-6-6H--rp@-|nyRzvvr_nqvn{pr-J-rzvvrH--0v{pyqr-Iy|tqr}uoslsntzr{K--0v{pyqr-Izn}lsntzr{K--0v{pyqr-Ip|y|lsntzr{K--0v{pyqr-Iny}unzn}lsntzr{K--0v{pyqr-Iny}unrlsntzr{K--0v{pyqr-I}rpynzn}lsntzr{K--0v{pyqr-I{|znylsntzr{lortv{K--0v{pyqr-I{|znylsntzr{lzn}K--0v{pyqr-Irzvvrzn}lsntzr{K--<<-nppzynv|{--0v{pyqr-Iyvtul}u|{tlsntzr{K--0v{pyqr-Iyvtulsntzr{lortv{K--0v{pyqr-Iyvtulsntzr{lzn}K--0v{pyqr-Iyvtulsntzr{lr{qK--<<-z|qynv|{--0v{pyqr-In|zn}lsntzr{K--rp@-|t|v{tYvtu-J-rsyrprqYvtu;qvrpQvssr-8-rsyrprqYvtu;v{qvrpQvssr-8-rsyrprqYvtu;qvrp`}rpyn-8-rsyrprqYvtu;v{qvrp`}rpyn-8-|nyRzvvr_nqvn{prH--0v{pyqr-Ir{zn}lsntzr{K--tylSntP|y|-J-rpA5-|t|v{tYvtu9-qvssrP|y|;n-6H--<<-JJJ-纯色-JJJ--0vs-qrsv{rq5b`RlP\\[`aN[alP\\Y\\_6----tylSntP|y|-J-rpA5p|{n{P|y|;9-p|{n{P|y|;t9-p|{n{P|y|;o9-|}npv\b6H--0r{qvs--<<-JJJJJJJJJJJ--<<-JJJ-楼层显示-JJJ--sy|n-sy||\\}npv\b-J->;=H--vs-5u|{Sy||V{qr\x07-K-:=;=>-33-no5sy||-:-u|{Sy||V{qr\x076-K-=;FF6-\n----sy||\\}npv\b-J-=;?-7-zv{55>;=-8-PnzrnQvrpv|{;\b69->;=6H--\f--tylSntP|y|;n-J-tylSntP|y|;n-7-sy||\\}npv\b-7-ovtu{rH--<<-JJJJJJJJJJJJJJ--<<-颜色增益调整,在色调映射前--rp@-toP|y|-J-tylSntP|y|;toH--rp@-uP|y|-J-to?u5toP|y|6H--rp@-sv{nyU`c-J-rp@5uP|y|;\x079-uP|y|;\b-8-p|y|`nnv|{9-uP|y|; -8-p|y|Ovtu{r6H--tylSntP|y|;to-J-u?to5sv{nyU`c6H---ZNV[lZ\\QRYlP\\Y\\_--<<色调映射-色彩空间转换--0v{pyqr-I|{rzn}}v{tlsntzr{K--0v{pyqr-Ir{p|qv{tlsntzr{K--<<-JJJ-全景图-JJJ--rp@-}n{|=a|crr\x07-J-{|znyv r5d|yq]|vv|{;\x07\b -:-}n{|=lznv\x07h@j;\x07\b 6H--}n{|=a|crr\x07-J- ||zcrp|5PnzrnQvrpv|{9-}n{|=a|crr\x079-}n{|=l ||z6H--}n{|=a|crr\x07-J-}n{|=a|crr\x07-7-zn@5}n{|=lznv\x076H--rp@-}n{|>a|crr\x07-J-{|znyv r5d|yq]|vv|{;\x07\b -:-}n{|>lznv\x07h@j;\x07\b 6H--}n{|>a|crr\x07-J- ||zcrp|5PnzrnQvrpv|{9-}n{|>a|crr\x079-}n{|>l ||z6H--}n{|>a|crr\x07-J-}n{|>a|crr\x07-7-zn@5}n{|>lznv\x076H--rpA-}n{|P|y|H--rpA-}n{|=P|y|-J-r\x07rPor5}n{|=lzn}9-}n{|=a|crr\x076H--rpA-}n{|>P|y|-J-r\x07rPor5}n{|>lzn}9-}n{|>a|crr\x076H--0vs-qrsv{rq5b`RlYbZV[N[PR6----}n{|=P|y|;n-J->;=-:-r\x07rPor5}n{|=lyzv{n{prZn}9-}n{|=a|crr\x076;H----}n{|>P|y|;n-J->;=-:-r\x07rPor5}n{|>lyzv{n{prZn}9-}n{|>a|crr\x076;H--0r{qvs--0vs-qrsv{rq5b`RlOYNPXla_N[`VaV\\[6----sy|n-oynpx]|tr-J-np|5:?;=-7-}|tr-8->;=6H----}n{|P|y|-J-zv\x075}n{|=P|y|9-OYNPXlP\\Y\\_9-zv{5>;=9-oynpx]|tr66H----}n{|P|y|-J-zv\x075}n{|P|y|9-}n{|>P|y|9-zn\x075=;=9-oynpx]|tr-:-]V-8->;=66H--0ryvs-qrsv{rq5b`Rl`]_RNQla_N[`VaV\\[6----rp?-prr{Pr{rP||q-J-r|yv|{-7-}v\x07ry_nv|-<-?;=H----sy|n-n{vv|{_nqv-J-qvn{pr5rp?5=;=9-=;=69-prr{Pr{rP||q6-7->;?H----sy|n-n{vv|{]|tr-J-qvn{pr5tylSntP||q;\x07\b9-prr{Pr{rP||q6-<-n{vv|{_nqvH----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-z||ur}5=;=9-=;?9-}|tr-:-n{vv|{]|tr66H--0ryr----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-}|tr6H--0r{qvs--tylSntP|y|-J-zv\x075}n{|P|y|9-tylSntP|y|9-z|qryNy}un6H--<<-JJJJJJJJJJJJJJ--0v{pyqr-Is|tlsntzr{K--0v{pyqr-I}rzyv}yvrqlny}unlsntzr{K--0v{pyqr-Iqvurv{tlsntzr{K--0vs-qrsv{rq5b`RlRQY6----tylSntP|y|;n-J-Y|tQr}uH--0r{qvs--ZNV[lR[Q\f");new d.Vector4;var ra={modelAlpha:new d.Uniform(0),progress:new d.Uniform(0),pano0_map:new d.Uniform(null),pano0_luminanceMap:new d.Uniform(null),pano0_matrix:new d.Uniform(new d.Matrix4),pano0_zoom:new d.Uniform(1),pano1_map:new d.Uniform(null),pano1_luminanceMap:new d.Uniform(null),pano1_matrix:new d.Uniform(new d.Matrix4),pano1_zoom:new d.Uniform(1),clippers:new d.Uniform([]),shownFloorIndex:new d.Uniform(-1),constantColor:new d.Uniform(null),geometricError:new d.Uniform(0),pixelRatio:new d.Uniform(1),resolution:new d.Uniform(new d.Vector2(512,512)),floor:new d.Uniform(0),brightness:new d.Uniform(1),modelBoundingMin:new d.Uniform(new d.Vector3),modelBoundingMax:new d.Uniform(new d.Vector3),colorSaturation:new d.Uniform(0),colorBrightness:new d.Uniform(0)},Ed={none:{vertexShader:Ad,fragmentShader:gd,uniforms:d.UniformsUtils.merge([ra,{opacity:{value:1}},d.UniformsLib.fog]),lights:!1,clipping:!1},basic:{vertexShader:yd,fragmentShader:bd,uniforms:d.UniformsUtils.merge([ra,d.ShaderLib.basic.uniforms]),lights:!1,clipping:!0},phong:{vertexShader:xd,fragmentShader:wd,uniforms:d.UniformsUtils.merge([ra,d.ShaderLib.phong.uniforms]),lights:!0,clipping:!0}},Jr=function(n){se(t,n);function t(e,r){e===void 0&&(e="basic"),r===void 0&&(r={});var i=this,a,o,s,l,u,c,f,m,A,h,p,g,v,y,b,x,w,E,C,M,R,L,S,I,O,P=Ed[e];i=n.call(this,{vertexShader:P.vertexShader,fragmentShader:P.fragmentShader,uniforms:d.UniformsUtils.clone(P.uniforms),lights:P.lights,clipping:P.clipping,defines:{USE_CONSTANT_COLOR:!1,USE_EDL:!1,USE_HQ_WEIGHT:!1,USE_HQ_DEPTH:!1,NUM_CLIPPING_BOX:!1,USE_CLIPFLOOR:!1,USE_VERTEX_MARK:!1,USE_LUMINANCE:!1,USE_PANO_OPACITY:!1,USE_BLACK_TRANSITION:!1,USE_SPREAD_TRANSITION:!1,USE_POINT_NORMAL:!1,USE_POINT_CIRCLE:!1,USE_POINT_ADAPTIVE_SIZE:!1,USE_POINT_COLOR_ALTITUDE:!1}})||this,i.shaderType=e,i.color=new d.Color(16777215),i.map=null,i.lightMap=null,i.lightMapIntensity=1,i.aoMap=null,i.aoMapIntensity=1,i.specularMap=null,i.specular=new d.Color(1118481),i.alphaMap=null,i.envMap=null,i.reflectivity=1,i.refractionRatio=.98,i.emissiveMap=null,i.emissive=new d.Color(0),i.emissiveIntensity=1,i.bumpMap=null,i.bumpScale=1,i.normalMap=null,i.normalMapType=d.TangentSpaceNormalMap,i.normalScale=new d.Vector2(1,1),i.displacementMap=null,i.displacementScale=1,i.displacementBias=0,i.shininess=30;var F,V=null,D=null;return Object.defineProperties(i,{pano0:{get:function(){return V},set:function(z){if(V!==z){V=z,z===null?(this.uniforms.pano0_map.value=null,this.uniforms.pano0_luminanceMap.value=null,this.uniforms.pano0_matrix.value.identity(),this.uniforms.pano0_zoom.value=1):(this.uniforms.pano0_map.value=z.map instanceof Ne?z.map.texture:z.map,this.uniforms.pano0_luminanceMap.value=z.luminanceMap instanceof Ne?z.luminanceMap.texture:z.luminanceMap,this.uniforms.pano0_matrix.value.copy(z.matrix),this.uniforms.pano0_zoom.value=z.zoom);var U=this.uniforms.pano0_luminanceMap.value!==null&&this.uniforms.pano1_luminanceMap.value!==null,H=this.defines.USE_LUMINANCE;H!==U&&(this.defines.USE_LUMINANCE=U,this.needsUpdate=!0)}}},pano1:{get:function(){return D},set:function(z){if(D!==z){D=z,z===null?(this.uniforms.pano1_map.value=null,this.uniforms.pano1_luminanceMap.value=null,this.uniforms.pano1_matrix.value.identity(),this.uniforms.pano1_zoom.value=1):(this.uniforms.pano1_map.value=z.map instanceof Ne?z.map.texture:z.map,this.uniforms.pano1_luminanceMap.value=z.luminanceMap instanceof Ne?z.luminanceMap.texture:z.luminanceMap,this.uniforms.pano1_matrix.value.copy(z.matrix),this.uniforms.pano1_zoom.value=z.zoom);var U=this.uniforms.pano0_luminanceMap.value!==null&&this.uniforms.pano1_luminanceMap.value!==null,H=this.defines.USE_LUMINANCE;H!==U&&(this.defines.USE_LUMINANCE=U,this.needsUpdate=!0)}}},modelAlpha:{get:function(){return this.uniforms.modelAlpha.value},set:function(z){this.uniforms.modelAlpha.value=z}},progress:{get:function(){return this.uniforms.progress.value},set:function(z){this.uniforms.progress.value=z}},transition:{get:function(){return this.defines.USE_BLACK_TRANSITION?"BLACK":this.defines.USE_SPREAD_TRANSITION?"SPREAD":"FADE"},set:function(z){var U=this.defines.USE_BLACK_TRANSITION,H=this.defines.USE_SPREAD_TRANSITION;this.defines.USE_BLACK_TRANSITION=!1,this.defines.USE_SPREAD_TRANSITION=!1,this.defines["USE_".concat(z,"_TRANSITION")]=!0;var K=!1;U!==this.defines.USE_BLACK_TRANSITION&&(K=!0),H!==this.defines.USE_SPREAD_TRANSITION&&(K=!0),K&&(this.needsUpdate=!0)}},constantColor:{get:function(){return this.uniforms.constantColor.value},set:function(z){this.uniforms.constantColor.value=z;var U=this.defines.USE_CONSTANT_COLOR,H=z!==null;U!==H&&(this.defines.USE_CONSTANT_COLOR=H,this.needsUpdate=!0)}},opacity:{get:function(){return this.uniforms.opacity.value},set:function(z){this.uniforms.opacity.value=z}},shownFloorIndex:{get:function(){return this.uniforms.shownFloorIndex.value},set:function(z){this.uniforms.shownFloorIndex.value=z}},brightness:{get:function(){return this.uniforms.brightness.value},set:function(z){this.uniforms.brightness.value=z}},clippers:{get:function(){return F},set:function(z){F!==z&&(F=z,this.uniforms.clippers.value=(F||[]).map(function(U){var H=typeof U.floorIndex=="number"?U.floorIndex:-1,K=new d.Matrix4().getInverse(U.clippingBoxMatrix);return{matrixInverse:K,floorIndex:H}}),this.needsUpdate=!0)}},useEDL:{get:function(){return this.defines.USE_EDL},set:function(z){z!==this.defines.USE_EDL&&(this.defines.USE_EDL=z,this.needsUpdate=!0)}},useHQWeight:{get:function(){return this.defines.USE_HQ_WEIGHT},set:function(z){z!==this.defines.USE_HQ_WEIGHT&&(this.defines.USE_HQ_WEIGHT=z,this.needsUpdate=!0)}},useHQDepth:{get:function(){return this.defines.USE_HQ_DEPTH},set:function(z){z!==this.defines.USE_HQ_DEPTH&&(this.defines.USE_HQ_DEPTH=z,this.needsUpdate=!0)}},floor:{get:function(){return this.uniforms.floor.value},set:function(z){this.uniforms.floor.value=z}},colorSaturation:{get:function(){return this.uniforms.colorSaturation.value},set:function(z){this.uniforms.colorSaturation.value=z}},colorBrightness:{get:function(){return this.uniforms.colorBrightness.value},set:function(z){this.uniforms.colorBrightness.value=z}}}),i.pano0=(a=r.pano0)!==null&&a!==void 0?a:me.pano0,i.pano1=(o=r.pano1)!==null&&o!==void 0?o:me.pano1,i.modelAlpha=(s=r.modelAlpha)!==null&&s!==void 0?s:me.modelAlpha,i.progress=(l=r.progress)!==null&&l!==void 0?l:me.progress,i.transition=(u=r.transition)!==null&&u!==void 0?u:me.transition,i.constantColor=(c=r.constantColor)!==null&&c!==void 0?c:me.constantColor,i.opacity=(f=r.opacity)!==null&&f!==void 0?f:me.opacity,i.floorStyle=(m=r.floorStyle)!==null&&m!==void 0?m:me.floorStyle,i.shownFloorIndex=(A=r.shownFloorIndex)!==null&&A!==void 0?A:me.shownFloorIndex,i.clippers=(h=r.clippers)!==null&&h!==void 0?h:me.clippers,i.useEDL=(p=r.useEDL)!==null&&p!==void 0?p:me.useEDL,i.useHQWeight=(g=r.useHQWeight)!==null&&g!==void 0?g:me.useHQWeight,i.useHQDepth=(v=r.useHQDepth)!==null&&v!==void 0?v:me.useHQDepth,i.pointSize=(y=r.pointSize)!==null&&y!==void 0?y:me.pointSize,i.pointColor=(b=r.pointColor)!==null&&b!==void 0?b:me.pointColor,i.pointShape=(x=r.pointShape)!==null&&x!==void 0?x:me.pointShape,i.pointScale=(w=r.pointScale)!==null&&w!==void 0?w:me.pointScale,i.pointBack=(E=r.pointBack)!==null&&E!==void 0?E:me.pointBack,i.pointMinPixel=(C=r.pointMinPixel)!==null&&C!==void 0?C:me.pointMinPixel,i.pointMaxPixel=(M=r.pointMaxPixel)!==null&&M!==void 0?M:me.pointMaxPixel,i.gradientTexture=(R=r.gradientTexture)!==null&&R!==void 0?R:me.gradientTexture,i.brightness=(L=r.brightness)!==null&&L!==void 0?L:me.brightness,i.colorSaturation=(S=r.colorSaturation)!==null&&S!==void 0?S:me.colorSaturation,i.colorBrightness=(I=r.colorBrightness)!==null&&I!==void 0?I:me.colorBrightness,i.customShaders=(O=r.customShaders)!==null&&O!==void 0?O:me.customShaders,i.customShaderHash="",i.customShaderUniforms={},i.customShaderDefines={},i.floor=0,i.transparent=!0,i}return t.prototype.onBeforeCompile=function(e,r){var i=this,a,o,s=this.customShaders.filter(function(g){return g.type.includes(i.shaderType)}),l=s.reduce(function(g,v){return g+v.vertex.mainBefore},""),u=s.reduce(function(g,v){return g+v.vertex.mainStart},""),c=s.reduce(function(g,v){return g+v.vertex.mainEnd},""),f=s.reduce(function(g,v){return g+v.fragment.mainBefore},""),m=s.reduce(function(g,v){return g+v.fragment.mainStart},""),A=s.reduce(function(g,v){return g+v.fragment.mainModelColor},""),h=s.reduce(function(g,v){return g+v.fragment.mainEnd},"");e.vertexShader=e.vertexShader.replace(/MAIN_BEFORE/g,l),e.fragmentShader=e.fragmentShader.replace(/MAIN_BEFORE/g,f),e.vertexShader=e.vertexShader.replace(/MAIN_START/g,u),e.fragmentShader=e.fragmentShader.replace(/MAIN_START/g,m),e.vertexShader=e.vertexShader.replace(/MAIN_END/g,c),e.fragmentShader=e.fragmentShader.replace(/MAIN_END/g,h),e.fragmentShader=e.fragmentShader.replace(/MAIN_MODEL_COLOR/g,A);var p=String((o=(a=this.clippers)===null||a===void 0?void 0:a.length)!==null&&o!==void 0?o:0);e.vertexShader=e.vertexShader.replace(/NUM_CLIPPERS/g,p),e.fragmentShader=e.fragmentShader.replace(/NUM_CLIPPERS/g,p),s.forEach(function(g){g.onBeforeCompile(e,r)})},t.prototype.refreshUniforms=function(e){var r,i,a=this.uniforms;a.diffuse&&a.diffuse.value.copy(this.color),a.opacity&&(a.opacity.value=this.opacity),a.color&&a.diffuse.value.copy(this.color),a.emissive&&a.emissive.value.copy(this.emissive).multiplyScalar(this.emissiveIntensity),a.map&&(a.map.value=this.map),a.alphaMap&&(a.alphaMap.value=this.alphaMap),a.specularMap&&(a.specularMap.value=this.specularMap),a.envMap&&(a.envMap.value=this.envMap,a.flipEnvMap.value=!((r=this.envMap)===null||r===void 0)&&r.isCubeTexture?-1:1,a.reflectivity.value=this.reflectivity,a.refractionRatio.value=this.refractionRatio,a.maxMipLevel.value=this.envMap&&(i=e==null?void 0:e.properties.get(this.envMap).__maxMipLevel)!==null&&i!==void 0?i:0),a.lightMap&&(a.lightMap.value=this.lightMap,a.lightMapIntensity.value=this.lightMapIntensity),a.aoMap&&(a.aoMap.value=this.aoMap,a.aoMapIntensity.value=this.aoMapIntensity),a.specular&&a.specular.value.copy(this.specular),a.shininess&&(a.shininess.value=Math.max(this.shininess,1e-4)),a.emissiveMap&&(a.emissiveMap.value=this.emissiveMap),a.bumpMap&&(a.bumpMap.value=this.bumpMap,a.bumpScale.value=this.bumpScale,this.side===d.BackSide&&(a.bumpScale.value*=-1)),a.normalMap&&(a.normalMap.value=this.normalMap,a.normalScale.value.copy(this.normalScale),this.side===d.BackSide&&a.normalScale.value.negate()),a.displacementMap&&(a.displacementMap.value=this.displacementMap,a.displacementScale.value=this.displacementScale,a.displacementBias.value=this.displacementBias);var o;this.map?o=this.map:this.specularMap?o=this.specularMap:this.displacementMap?o=this.displacementMap:this.normalMap?o=this.normalMap:this.bumpMap?o=this.bumpMap:this.alphaMap?o=this.alphaMap:this.emissiveMap&&(o=this.emissiveMap),o!==void 0&&(o.matrixAutoUpdate===!0&&o.updateMatrix(),a.uvTransform.value.copy(o.matrix));var s;this.aoMap?s=this.aoMap:this.lightMap&&(s=this.lightMap),s!==void 0&&(s.matrixAutoUpdate===!0&&s.updateMatrix(),a.uv2Transform.value.copy(s.matrix))},t.prototype.update=function(e,r,i){var a="".concat(i.id,":").concat(i.materialVersion);a!==this.syncModelVersion&&(Object.assign(this,i.getMaterial()),this.syncModelVersion=a);var o=this.customShaders.map(function(v){return v.getHash()}).join("");this.customShaderHash!==o&&(this.customShaderHash=o,this.needsUpdate=!0);for(var s=this.customShaders.reduce(function(v,y){return Object.assign(v,y.defines)},{}),l=Object.keys(this.customShaderDefines),u=0,c=l;u<c.length;u++){var f=c[u];delete this.defines[f]}this.customShaderDefines=s,Object.assign(this.defines,this.customShaderDefines);for(var m=this.customShaders.reduce(function(v,y){return Object.assign(v,y.uniforms)},{}),A=Object.keys(this.customShaderUniforms),h=0,p=A;h<p.length;h++){var g=p[h];delete this.uniforms[g]}this.customShaderUniforms=m,Object.assign(this.uniforms,this.customShaderUniforms),this.visible=!0,this.refreshUniforms(e),this.shaderType==="none"?(this.depthWrite=!1,this.transparent=!0):(this.transparent=!1,this.depthWrite=!0,this.shownFloorIndex>-1&&(this.transparent=this.shownFloorIndex!==this.floor),this.opacity<1&&(this.transparent=!0),this.alphaMap&&(this.transparent=!0),this.brightness<1&&(this.transparent=!0),this.transparent&&(this.depthWrite=!1),this.floorStyle==="VISIBILITY"&&this.shownFloorIndex!==-1&&this.floor!==this.shownFloorIndex&&(this.visible=!1)),this.uniforms.pixelRatio.value=r.pixelRatio,this.uniforms.resolution.value.copy(r.resolution),this.uniforms.modelBoundingMax.value.copy(i.bounding.max),this.uniforms.modelBoundingMin.value.copy(i.bounding.min)},t.prototype.copy=function(e){return n.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.specular.copy(e.specular),this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.emissiveMap=e.emissiveMap,this.emissive.copy(e.emissive),this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.shininess=e.shininess,this.customShaders=e.customShaders,this.pano0=e.pano0,this.pano1=e.pano1,this.modelAlpha=e.modelAlpha,this.progress=e.progress,this.transition=e.transition,this.opacity=e.opacity,this.constantColor=e.constantColor,this.shownFloorIndex=e.shownFloorIndex,this.brightness=e.brightness,this.clippers=e.clippers,this.useEDL=e.useEDL,this.useHQWeight=e.useHQWeight,this.useHQDepth=e.useHQDepth,this.pointColor=e.pointColor,this.pointSize=e.pointSize,this.pointShape=e.pointShape,this.pointScale=e.pointScale,this.pointBack=e.pointBack,this.pointMinPixel=e.pointMinPixel,this.pointMaxPixel=e.pointMaxPixel,this.gradientTexture=e.gradientTexture,this.floor=e.floor,this.colorSaturation=e.colorSaturation,this.colorBrightness=e.colorBrightness,this},t}(d.ShaderMaterial);const Sd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("{vs|z-sy|n-sy||H0vs-qrsv{rq5b`RlP\\[`aN[alP\\Y\\_6--{vs|z-rp@-p|{n{P|y|H0r{qvs0vs-qrsv{rq5b`Rl]\\V[al[\\_ZNY6--n\bv{t-rp@-[|znyH0r{qvs0vs-qrsv{rq5b`RlRQY6--n\bv{t-sy|n-Y|tQr}uH0r{qvsp-Pyv}}r-\n--znA-znv\x07V{rrH--sy|n-sy||V{qr\x07H\fH0vs-[bZlPYV]]R_`-K-=--{vs|z-Pyv}}r-pyv}}rh[bZlPYV]]R_`jH0r{qvsn\bv{t-rpA-d|yq]|vv|{Hn\bv{t-rp@-PnzrnQvrpv|{Hn\bv{t-rp@-P|y|Hn\bv{t-sy|n-]|v{`v rH{vs|z-sy|n-|}npv\bH{vs|z-sy|n-z|qryNy}unH{vs|z-sy|n-u|{Sy||V{qr\x07H<<u调整{vs|z-sy|n-p|y|`nnv|{H{vs|z-sy|n-p|y|Ovtu{rH0v{pyqr-Ip|zz|{K0v{pyqr-Is|tl}nlsntzr{K0v{pyqr-Iy|tqr}uosl}nlsntzr{K0v{pyqr-Ipyv}}v{tl}yn{rl}nlsntzr{Krp@-nqwP|y|arz}rnr5rp@-p|y|9-sy|n-rz}rnr6\n----<<-将色温范围从-:>;=-到->;=-映射到实际的色温范围----sy|n-rz}-J-5rz}rnr-8->;=6-7-B===;=H-<<-范围从-=-到->====----<<-计算色温系数----sy|n-lsnp|9-tlsnp|9-olsnp|H----vs-5rz}-IJ-CC==;=6-\n--------lsnp|-J->;=H--------tlsnp|-J-=;@F==E>BDEDCF=>FC=DEA-7-y|t5rz}-<->==;=6-:-=;C@>EA>AA@DEEC?DAB=FEH--------olsnp|-J-rz}-IJ->F==;=-L-=;=-G-=;BA@?=CDEF>>=>FC=DEA@-7-y|t5rz}-<->==;=-:->=;=6-:->;>FC?BA=EF>AH----\f-ryr-\n--------lsnp|-J->;?F?F@C>EC=C?DAB=FE=A-7-}|5rz}-<->==;=-:-C=;=9-:=;>@@?=ADBF?6H--------tlsnp|-J->;>?FEF=EC=EFB?FA>>DCB-7-}|5rz}-<->==;=-:-C=;=9-:=;=DBB>AEAF?6H--------olsnp|-J->;=H----\f----<<-调整颜色----rp@-nqwrqP|y|H----nqwrqP|y|;-J-pynz}5p|y|;-7-lsnp|9-=;=9->;=6H----nqwrqP|y|;t-J-pynz}5p|y|;t-7-tlsnp|9-=;=9->;=6H----nqwrqP|y|;o-J-pynz}5p|y|;o-7-olsnp|9-=;=9->;=6H----r{-nqwrqP|y|H\frp@-to?u5rp@-p6-\n----rpA-X-J-rpA5=;=9-:>;=-<-@;=9-?;=-<-@;=9-:>;=6H----rpA-}-J-zv\x075rpA5p;ot9-X; 69-rpA5p;to9-X;\x07\b69-r}5p;o9-p;t66H----rpA-\0-J-zv\x075rpA5};\x07\b9-p;69-rpA5p;9-};\b \x0769-r}5};\x079-p;66H----sy|n-q-J-\0;\x07-:-zv{5\0;9-\0;\b6H----sy|n-r-J->;=r:>=H----r{-rp@5no5\0; -8-5\0;-:-\0;\b6-<-5C;=-7-q-8-r669-q-<-5\0;\x07-8-r69-\0;\x076H\frp@-u?to5rp@-p6-\n----rpA-X-J-rpA5>;=9-?;=-<-@;=9->;=-<-@;=9-@;=6H----rp@-}-J-no5snp5p;\x07\x07\x07-8-X;\x07\b 6-7-C;=-:-X;6H----r{-p; -7-zv\x075X;\x07\x07\x079-pynz}5}-:-X;\x07\x07\x079-=;=9->;=69-p;\b6H\fZNV[lORS\\_R|vq-znv{56-\n--ZNV[l`aN_a--<<-JJJ-点大小剔除-JJJ--vs-5]|v{`v r-I-=;==>6-\n----qvpnqH--\f--<<-JJJ-前置裁切计算-JJJ--0vs-[bZlPYV]]R_`-K-=----o||y-pyv}}rqH----rpA-pyv}}r]|vv|{H----0}ntzn-{|yyly||}ln----s|-5-v{-v-J-=H-v-I-[bZlPYV]]R_`H-v-88-6-\n------pyv}}r]|vv|{-J-pyv}}rh-v-j;znv\x07V{rr-7-d|yq]|vv|{H------pyv}}rq-J-5pyv}}rh-v-j;sy||V{qr\x07-I-=;=-\v\v-no5sy||-:-pyv}}rh-v-j;sy||V{qr\x076-I->;=6H------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\x07-K-:=;B-33-pyv}}r]|vv|{;\x07-I-=;BH------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\b-K-:=;B-33-pyv}}r]|vv|{;\b-I-=;BH------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{; -K-:=;B-33-pyv}}r]|vv|{; -I-=;BH------vs-5pyv}}rq6-\n--------qvpnqH------\f----\f----0}ntzn-{|yyly||}lr{q--0r{qvs--<<-JJJJJJJJJJJJJJJJ--<<-JJJ-形状裁切-JJJ--0vs-qrsv{rq5b`Rl]\\V[al`UN]RlPV_PYR6----sy|n--J-?;=-7-tyl]|v{P||q;\x07-:->;=H----sy|n--J-?;=-7-tyl]|v{P||q;\b-:->;=H----sy|n-pp-J-7-8-7H----vs-5]|v{`v r-K-@;=-33-pp-K->;=6-\n------qvpnqH----\f--0r{qvs--<<-JJJJJJJJJJJJJ--0v{pyqr-Ipyv}}v{tl}yn{rlsntzr{K--0v{pyqr-Iy|tqr}uoslsntzr{K--<<-JJJ-颜色-JJJ--rpA-sv{nyP|y|-J-_TOa|Yv{rn5rpA5P|y|9-|}npv\b66H--0vs-qrsv{rq5b`Rl]\\V[al[\\_ZNY6----0vs-qrsv{rq5b`Rl]\\V[alONPXlUVQQR[6------rp@-pnzrnQvrpv|{-J-{|znyv r5pnzrn]|vv|{-:-d|yq]|vv|{;\x07\b 6H------vs-5q|5pnzrnQvrpv|{9-[|zny6-I-=;=6-\n--------qvpnqH------\f----0ryvs-qrsv{rq5b`Rl]\\V[alONPXlQN_X6------rp@-pnzrnQvrpv|{-J-{|znyv r5pnzrn]|vv|{-:-d|yq]|vv|{;\x07\b 6H------vs-5q|5pnzrnQvrpv|{9-[|zny6-I-=;=6-\n--------sv{nyP|y|;\x07\b -J-sv{nyP|y|;\x07\b -7-=;EH------\f----0r{qvs--0r{qvs--tylSntP|y|-J-sv{nyP|y|H--<<-JJJJJJJJJJJ--<<-JJJ-纯色-JJJ--0vs-qrsv{rq5b`RlP\\[`aN[alP\\Y\\_6----tylSntP|y|-J-rpA5p|{n{P|y|;9-p|{n{P|y|;t9-p|{n{P|y|;o9-|}npv\b6H--0r{qvs--<<-JJJJJJJJJJJ--<<-JJJ-楼层显示-JJJ--sy|n-sy||\\}npv\b-J->;=H--vs-5u|{Sy||V{qr\x07-K-:=;=>-33-no5sy||-:-u|{Sy||V{qr\x076-K-=;FF6-\n----sy||\\}npv\b-J-=;>-7-zv{55>;=-8-PnzrnQvrpv|{;\b69->;=6H--\f--tylSntP|y|;n-J-tylSntP|y|;n-7-sy||\\}npv\bH--<<-JJJJJJJJJJJJJJ--tylSntP|y|;n-J-tylSntP|y|;n-7-z|qryNy}unH--<<提取亮度--rp@-toP|y|-J-tylSntP|y|;toH--rp@-uP|y|-J-to?u5toP|y|6H--rp@-sv{nyU`c-J-rp@5uP|y|;\x079-uP|y|;\b-8-p|y|`nnv|{9-uP|y|; -8-p|y|Ovtu{r6H--tylSntP|y|;to-J-u?to5sv{nyU`c6H--ZNV[lZ\\QRYlP\\Y\\_--0v{pyqr-I|{rzn}}v{tlsntzr{K--0v{pyqr-Ir{p|qv{tlsntzr{K--0v{pyqr-Is|tlsntzr{K--0v{pyqr-I}rzyv}yvrqlny}unlsntzr{K--0vs-qrsv{rq5b`RlRQY6----tylSntP|y|;n-J-Y|tQr}uH--0r{qvs--0vs-qrsv{rq5b`RlU^ldRVTUa6----sy|n-qvn{pr-J-?;=-7-yr{tu5tyl]|v{P||q;\x07\b-:-=;B6H----sy|n-rvtu-J-zn\x075=;=9->;=-:-qvn{pr6H----rvtu-J-}|5rvtu9->;B6H----tylSntP|y|;n-J-rvtuH----tylSntP|y|;\x07\b -J-tylSntP|y|;\x07\b -7-rvtuH--0r{qvs--ZNV[lR[Q\f"),Cd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("nvor-rp@-p|y|H0vs-qrsv{rq5b`Rl]\\V[alP\\Y\\_lNYaVabQR6--{vs|z-nz}yr?Q-tnqvr{ar\x07rH0r{qvs0vs-qrsv{rq5b`RlRQY6--n\bv{t-sy|n-Y|tQr}uH0r{qvs{v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-zn@5vrZnv\x07h=jh=j9-vrZnv\x07h>jh=j9-vrZnv\x07h?jh=j9-vrZnv\x07h=jh>j9-vrZnv\x07h>jh>j9-vrZnv\x07h?jh>j9-vrZnv\x07h=jh?j9-vrZnv\x07h>jh?j9-vrZnv\x07h?jh?j6H--PnzrnQvrpv|{-J-{|znyv r5pnzrn_|nv|{Znv\x07-7-rp@5=;=9-=;=9-:>;=66H--<<传递nvor的p|y|到s里使用--<<动态调整}|v{`v r--sy|n-rny]|v{`v r-J-}|v{`pnyr-7-}v\x07ry_nv|H--0vs-qrsv{rq5b`Rl]\\V[al`VgRlTR\\ZRa_VP6----rny]|v{`v r-7J-tr|zrvpR|H----sy|n-urvtu-J->;=-<-}|wrpv|{Znv\x07h>jh>j-7-zv\x075>;=9-:z]|vv|{; 9-:}|wrpv|{Znv\x07h?jh@j6-7-?;=H----rny]|v{`v r-J-r|yv|{;\b-7-rny]|v{`v r-<-urvtuH--0ryvs-qrsv{rq5b`Rl]\\V[al`VgRlNaaR[bNaV\\[6----sy|n-urvtu-J->;=-<-}|wrpv|{Znv\x07h>jh>j-7-zv\x075>;=9-:z]|vv|{; 9-:}|wrpv|{Znv\x07h?jh@j6-7-?;=H----rny]|v{`v r-J-r|yv|{;\b-7-rny]|v{`v r-<-urvtuH--0r{qvs--tyl]|v{`v r-J-pynz}5rny]|v{`v r9-}|v{Zv{]v\x07ry-7-}v\x07ry_nv|9-}|v{Zn\x07]v\x07ry-7-}v\x07ry_nv|6H--]|v{`v r-J-tyl]|v{`v rH--0vs-qrsv{rq5b`Rl]\\V[alP\\Y\\_lNYaVabQR6----P|y|-J-trP|y|O\bUrvtu5tnqvr{ar\x07r9-d|yq]|vv|{6H--0ryr----P|y|-J-p|y|H--0r{qvs--0vs-qrsv{rq5b`Rl]\\V[al[\\_ZNY6----[|zny-J-{|znyv r5zn@5z|qryZnv\x076-7-{|zny6H--0r{qvs--0vs-qrsv{rq5b`RlRQY6----Y|tQr}u-J-y|t?5:z]|vv|{; 6H--0r{qvs--0vs-qrsv{rq5b`RlU^lQR]aU6----<<-sy|n-}|wSnp|-J-:=;B-7-r|yv|{;\b-<-5n{5s|-<-?;=6-7-z]|vv|{; 6H----<<-sy|n-_nqv-J-rny]|v{`v r-<-}|wSnp|H----sy|n-|vtv{nyQr}u-J-tyl]|vv|{;H----sy|n-nqwrqQr}u-J-|vtv{nyQr}u-8-=;>H----sy|n-nqw-J-nqwrqQr}u-<-|vtv{nyQr}uH----z]|vv|{;\x07\b -J-z]|vv|{;\x07\b -7-nqwH----tyl]|vv|{-J-}|wrpv|{Znv\x07-7-z]|vv|{H--0r{qvs--0v{pyqr-I|yq}|lrr\x07K--0v{pyqr-Is|tlrr\x07K--ZNV[lR[Q\f");var Md=Object.assign({pointScale:new d.Uniform(1),pointMinPixel:new d.Uniform(1),pointMaxPixel:new d.Uniform(1),opacity:new d.Uniform(1),gradientTexture:new d.Uniform(null),modelAlpha:new d.Uniform(0),clippers:new d.Uniform([]),shownFloorIndex:new d.Uniform(-1),constantColor:new d.Uniform(null),geometricError:new d.Uniform(0),pixelRatio:new d.Uniform(1),resolution:new d.Uniform(new d.Vector2(512,512)),floor:new d.Uniform(0),brightness:new d.Uniform(1),modelBoundingMin:new d.Uniform(new d.Vector3),modelBoundingMax:new d.Uniform(new d.Vector3),colorSaturation:new d.Uniform(0),colorBrightness:new d.Uniform(0)},d.UniformsUtils.clone(d.UniformsLib.fog)),ii=function(n){se(t,n);function t(e){e===void 0&&(e={});var r,i,a,o,s,l,u,c,f,m,A,h,p,g,v,y,b,x,w,E,C,M,R,L,S,I=n.call(this,{vertexShader:Cd,fragmentShader:Sd,uniforms:d.UniformsUtils.clone(Md),lights:!1,clipping:!0,defines:{USE_CONSTANT_COLOR:!1,USE_EDL:!1,USE_HQ_WEIGHT:!1,USE_HQ_DEPTH:!1,NUM_CLIPPING_BOX:!1,USE_CLIPFLOOR:!1,USE_VERTEX_MARK:!1,USE_MAP:!0,USE_UV:!0,USE_LUMINANCE:!1,USE_PANO_OPACITY:!1,USE_BLACK_TRANSITION:!1,USE_POINT_NORMAL:!1,USE_POINT_SHAPE_CIRCLE:!1,USE_POINT_SIZE_ATTENUATION:!1,USE_POINT_SIZE_GEOMETRIC:!1,USE_POINT_BACK_HIDDEN:!1,USE_POINT_BACK_DARK:!1}})||this,O;return I.customShaderHash="",I.customShaderUniforms={},I.customShaderDefines={},Object.defineProperties(I,{constantColor:{get:function(){return this.uniforms.constantColor.value},set:function(P){this.uniforms.constantColor.value=P;var F=this.defines.USE_CONSTANT_COLOR,V=P!==null;F!==V&&(this.defines.USE_CONSTANT_COLOR=V,this.needsUpdate=!0)}},opacity:{get:function(){return this.uniforms.opacity.value},set:function(P){this.uniforms.opacity.value=P}},modelAlpha:{get:function(){return this.uniforms.modelAlpha.value},set:function(P){this.uniforms.modelAlpha.value=P}},shownFloorIndex:{get:function(){return this.uniforms.shownFloorIndex.value},set:function(P){this.uniforms.shownFloorIndex.value=P}},clippers:{get:function(){return O},set:function(P){O!==P&&(O=P,this.uniforms.clippers.value=(O||[]).map(function(F){var V=typeof F.floorIndex=="number"?F.floorIndex:-1,D=new d.Matrix4().getInverse(F.clippingBoxMatrix);return{matrixInverse:D,floorIndex:V}}),this.needsUpdate=!0)}},pointColor:{get:function(){return this.defines.USE_POINT_COLOR_ALTITUDE===!0?"ALTITUDE":"RGB"},set:function(P){var F=P==="ALTITUDE";this.defines.USE_POINT_COLOR_ALTITUDE!==F&&(this.defines.USE_POINT_COLOR_ALTITUDE=F,this.needsUpdate=!0)}},pointSize:{get:function(){return this.defines.USE_POINT_SIZE_GEOMETRIC===!0?"GEOMETRIC":this.defines.USE_POINT_SIZE_ATTENUATION===!0?"ATTENUATION":"FIXED"},set:function(P){var F=P==="ATTENUATION",V=P==="GEOMETRIC";this.defines.USE_POINT_SIZE_GEOMETRIC!==V&&(this.defines.USE_POINT_SIZE_GEOMETRIC=V,this.needsUpdate=!0),this.defines.USE_POINT_SIZE_ATTENUATION!==F&&(this.defines.USE_POINT_SIZE_ATTENUATION=F,this.needsUpdate=!0)}},pointShape:{get:function(){return this.defines.USE_POINT_SHAPE_CIRCLE===!0?"CIRCLE":"SQUARE"},set:function(P){var F=P==="CIRCLE";this.defines.USE_POINT_SHAPE_CIRCLE!==F&&(this.defines.USE_POINT_SHAPE_CIRCLE=F,this.needsUpdate=!0)}},pointScale:{get:function(){return this.uniforms.pointScale.value},set:function(P){this.uniforms.pointScale.value=P}},pointBack:{get:function(){return this.defines.USE_POINT_BACK_HIDDEN===!0?"HIDDEN":this.defines.USE_POINT_BACK_DARK===!0?"DARK":"VISIBLE"},set:function(P){var F=P==="HIDDEN",V=P==="DARK";this.defines.USE_POINT_BACK_HIDDEN!==F&&(this.defines.USE_POINT_BACK_HIDDEN=F,this.needsUpdate=!0),this.defines.USE_POINT_BACK_DARK!==V&&(this.defines.USE_POINT_BACK_DARK=V,this.needsUpdate=!0)}},pointMinPixel:{get:function(){return this.uniforms.pointMinPixel.value},set:function(P){this.uniforms.pointMinPixel.value=P}},pointMaxPixel:{get:function(){return this.uniforms.pointMaxPixel.value},set:function(P){this.uniforms.pointMaxPixel.value=P}},useEDL:{get:function(){return this.defines.USE_EDL},set:function(P){P!==this.defines.USE_EDL&&(this.defines.USE_EDL=P,this.needsUpdate=!0)}},useHQWeight:{get:function(){return this.defines.USE_HQ_WEIGHT},set:function(P){P!==this.defines.USE_HQ_WEIGHT&&(this.defines.USE_HQ_WEIGHT=P,this.needsUpdate=!0)}},useHQDepth:{get:function(){return this.defines.USE_HQ_DEPTH},set:function(P){P!==this.defines.USE_HQ_DEPTH&&(this.defines.USE_HQ_DEPTH=P,this.needsUpdate=!0)}},gradientTexture:{get:function(){return this.uniforms.gradientTexture.value},set:function(P){this.uniforms.gradientTexture.value=P}},floor:{get:function(){return this.uniforms.floor.value},set:function(P){this.uniforms.floor.value=P}},brightness:{get:function(){return this.uniforms.brightness.value},set:function(P){this.uniforms.brightness.value=P}},colorSaturation:{get:function(){return this.uniforms.colorSaturation.value},set:function(P){this.uniforms.colorSaturation.value=P}},colorBrightness:{get:function(){return this.uniforms.colorBrightness.value},set:function(P){this.uniforms.colorBrightness.value=P}}}),I.pano0=(r=e.pano0)!==null&&r!==void 0?r:me.pano0,I.pano1=(i=e.pano1)!==null&&i!==void 0?i:me.pano1,I.modelAlpha=(a=e.modelAlpha)!==null&&a!==void 0?a:me.modelAlpha,I.progress=(o=e.progress)!==null&&o!==void 0?o:me.progress,I.transition=(s=e.transition)!==null&&s!==void 0?s:me.transition,I.constantColor=(l=e.constantColor)!==null&&l!==void 0?l:me.constantColor,I.opacity=(u=e.opacity)!==null&&u!==void 0?u:me.opacity,I.floorStyle=(c=e.floorStyle)!==null&&c!==void 0?c:me.floorStyle,I.shownFloorIndex=(f=e.shownFloorIndex)!==null&&f!==void 0?f:me.shownFloorIndex,I.clippers=(m=e.clippers)!==null&&m!==void 0?m:me.clippers,I.useEDL=(A=e.useEDL)!==null&&A!==void 0?A:me.useEDL,I.useHQWeight=(h=e.useHQWeight)!==null&&h!==void 0?h:me.useHQWeight,I.useHQDepth=(p=e.useHQDepth)!==null&&p!==void 0?p:me.useHQDepth,I.pointColor=(g=e.pointColor)!==null&&g!==void 0?g:me.pointColor,I.pointShape=(v=e.pointShape)!==null&&v!==void 0?v:me.pointShape,I.pointSize=(y=e.pointSize)!==null&&y!==void 0?y:me.pointSize,I.pointScale=(b=e.pointScale)!==null&&b!==void 0?b:me.pointScale,I.pointBack=(x=e.pointBack)!==null&&x!==void 0?x:me.pointBack,I.pointMinPixel=(w=e.pointMinPixel)!==null&&w!==void 0?w:me.pointMinPixel,I.pointMaxPixel=(E=e.pointMaxPixel)!==null&&E!==void 0?E:me.pointMaxPixel,I.gradientTexture=(C=e.gradientTexture)!==null&&C!==void 0?C:me.gradientTexture,I.brightness=(M=e.brightness)!==null&&M!==void 0?M:me.brightness,I.colorSaturation=(R=e.colorSaturation)!==null&&R!==void 0?R:me.colorSaturation,I.colorBrightness=(L=e.colorBrightness)!==null&&L!==void 0?L:me.colorBrightness,I.customShaders=(S=e.customShaders)!==null&&S!==void 0?S:me.customShaders,I.customShaderHash="",I.floor=0,I.transparent=!0,I}return t.prototype.onBeforeCompile=function(e,r){var i,a,o=this.customShaders.filter(function(p){return p.type.includes("pointcloud")}),s=o.reduce(function(p,g){return p+g.vertex.mainBefore},""),l=o.reduce(function(p,g){return p+g.vertex.mainStart},""),u=o.reduce(function(p,g){return p+g.vertex.mainEnd},""),c=o.reduce(function(p,g){return p+g.fragment.mainBefore},""),f=o.reduce(function(p,g){return p+g.fragment.mainStart},""),m=o.reduce(function(p,g){return p+g.fragment.mainModelColor},""),A=o.reduce(function(p,g){return p+g.fragment.mainEnd},"");e.vertexShader=e.vertexShader.replace(/MAIN_BEFORE/g,s),e.fragmentShader=e.fragmentShader.replace(/MAIN_BEFORE/g,c),e.vertexShader=e.vertexShader.replace(/MAIN_START/g,l),e.fragmentShader=e.fragmentShader.replace(/MAIN_START/g,f),e.vertexShader=e.vertexShader.replace(/MAIN_END/g,u),e.fragmentShader=e.fragmentShader.replace(/MAIN_END/g,A),e.fragmentShader=e.fragmentShader.replace(/MAIN_MODEL_COLOR/g,m);var h=String((a=(i=this.clippers)===null||i===void 0?void 0:i.length)!==null&&a!==void 0?a:0);e.vertexShader=e.vertexShader.replace(/NUM_CLIPPERS/g,h),e.fragmentShader=e.fragmentShader.replace(/NUM_CLIPPERS/g,h),o.forEach(function(p){p.onBeforeCompile(e,r)})},t.prototype.update=function(e,r,i){var a="".concat(i.id,":").concat(i.materialVersion);a!==this.syncModelVersion&&(Object.assign(this,i.getMaterial()),this.syncModelVersion=a);var o=this.customShaders.map(function(v){return v.getHash()}).join("");this.customShaderHash!==o&&(this.customShaderHash=o,this.needsUpdate=!0);for(var s=this.customShaders.reduce(function(v,y){return Object.assign(v,y.defines)},{}),l=Object.keys(this.customShaderDefines),u=0,c=l;u<c.length;u++){var f=c[u];delete this.defines[f]}this.customShaderDefines=s,Object.assign(this.defines,this.customShaderDefines);for(var m=this.customShaders.reduce(function(v,y){return Object.assign(v,y.uniforms)},{}),A=Object.keys(this.customShaderUniforms),h=0,p=A;h<p.length;h++){var g=p[h];delete this.uniforms[g]}this.customShaderUniforms=m,Object.assign(this.uniforms,this.customShaderUniforms),this.visible=!0,this.transparent=!1,this.shownFloorIndex>-1&&(this.transparent=this.shownFloorIndex!==this.floor),this.modelAlpha<1&&(this.transparent=!0),this.opacity<1&&(this.transparent=!0),this.brightness<1&&(this.transparent=!0),this.depthWrite=!0,this.depthTest=!0,this.useEDL&&(this.transparent=!1),this.useHQWeight?(this.depthWrite=!1,this.blending=d.CustomBlending,this.blendSrc=d.SrcAlphaFactor,this.blendSrcAlpha=d.SrcAlphaFactor,this.blendDst=d.OneFactor,this.blendDstAlpha=d.OneFactor):(this.blending=d.NormalBlending,this.blendDst=d.OneMinusSrcAlphaFactor,this.blendEquation=d.AddEquation,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null),this.floorStyle==="VISIBILITY"&&this.shownFloorIndex!==-1&&this.floor!==this.shownFloorIndex&&(this.visible=!1),this.uniforms.pixelRatio.value=r.pixelRatio,this.uniforms.resolution.value.copy(r.resolution),this.uniforms.modelBoundingMax.value.copy(i.bounding.max),this.uniforms.modelBoundingMin.value.copy(i.bounding.min)},t.prototype.copy=function(e){return n.prototype.copy.call(this,this),this.customShaders=e.customShaders,this.pano0=e.pano0,this.pano1=e.pano1,this.progress=e.progress,this.transition=e.transition,this.shownFloorIndex=e.shownFloorIndex,this.brightness=e.brightness,this.clippers=e.clippers,this.constantColor=e.constantColor,this.modelAlpha=e.modelAlpha,this.useEDL=e.useEDL,this.useHQWeight=e.useHQWeight,this.useHQDepth=e.useHQDepth,this.pointColor=e.pointColor,this.pointSize=e.pointSize,this.pointShape=e.pointShape,this.pointScale=e.pointScale,this.pointBack=e.pointBack,this.pointMinPixel=e.pointMinPixel,this.pointMaxPixel=e.pointMaxPixel,this.gradientTexture=e.gradientTexture,this.colorSaturation=e.colorSaturation,this.colorBrightness=e.colorBrightness,this},t}(d.ShaderMaterial),nn=function(n){se(t,n);function t(e){var r=e.preserveDrawingBuffer,i=r===void 0?!0:r,a=e.premultipliedAlpha,o=a===void 0?!0:a,s=e.stencil,l=s===void 0?!0:s,u=e.backgroundColor,c=u===void 0?1579548:u,f=e.backgroundAlpha,m=f===void 0?1:f,A=e.pixelRatio,h=A===void 0?1:A,p=e.antialias,g=e.webgl2,v=e.logarithmicDepthBuffer,y=e.precision,b=this,x={antialias:p,alpha:!0,depth:!0,preserveDrawingBuffer:i,stencil:l,premultipliedAlpha:o,powerPreference:"high-performance"},w={logarithmicDepthBuffer:v,precision:y};if(g){var E=document.createElement("canvas"),C=E.getContext("webgl2",x);C?b=n.call(this,k(k(k({},x),w),{antialias:!0,canvas:E,context:C}))||this:(console.error("error occurred when getting webgl2 canvas context, mybe webgl2 not support, fallback to webgl."),b=n.call(this,k(k({},x),w))||this)}else b=n.call(this,k(k({},x),w))||this;return b.setPixelRatio(h),b.setClearColor(c,m),b.outputEncoding=d.sRGBEncoding,b.autoClear=!0,b}return t}(d.WebGLRenderer),D0=function(n){se(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.add=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return n.prototype.add.apply(this,e)},t.prototype.remove=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return n.prototype.remove.apply(this,e)},t}(d.Scene);function Nt(n,t){var e=Math.abs(Math.cos(n.latitude)),r=-Math.sin(n.longitude)*e,i=-Math.sin(n.latitude),a=-Math.cos(n.longitude)*e;return t?t.set(r,i,a):new d.Vector3(r,i,a)}var Id=1,Td=.1,Pd=2e3,di=Math.PI*2,ns=Math.PI/2;function na(n){return n>0&&n<=di?n:(n%di+di)%di}function Bd(n,t,e,r){e=Math.pow(e,4);for(var i=0;i<16;i++)r.elements[i]=n.elements[i]+(t.elements[i]-n.elements[i])*e;return r}var z0=function(n){se(t,n);function t(e,r,i,a,o,s,l){r===void 0&&(r=Id),i===void 0&&(i=Td),a===void 0&&(a=Pd),o===void 0&&(o=new d.Vector2),s===void 0&&(s=new d.Vector2(512,512)),l===void 0&&(l=1);var u=n.call(this)||this;u.fov=e,u.aspect=r,u.near=i,u.far=a,u.perspToOrtho=o,u.resolution=s,u.pixelRatio=l,u.time=0,u.needsRender=!0,u.refineModel=!0,u.pose={longitude:0,latitude:0,fov:e,distance:0,offset:new d.Vector3},u.computePose(),u.perspectiveCamera=new d.PerspectiveCamera(u.fov,u.aspect,.001,u.far);var c=Math.max(u.orthoDistance,.01)*Math.tan(.5*u.fov/180*Math.PI),f=-.5*u.aspect*2*c;return u.orthographicCamera=new d.OrthographicCamera(f,-f,c,-c,.001,u.far),u.computeProjectionMatrix(),u.lastValues={position:u.position.clone(),quaternion:u.quaternion.clone(),scale:u.scale.clone(),fov:u.fov,aspect:u.aspect,near:u.near,far:u.far,orthoDistance:u.orthoDistance,perspToOrtho:u.perspToOrtho.clone()},u.type=u.perspToOrtho.x<1?"PerspectiveCamera":"OrthographicCamera",u}return Object.defineProperty(t.prototype,"orthoDistance",{get:function(){return this.pose.distance>1?this.pose.distance:1+(this.pose.distance-1)*this.perspToOrtho.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"zoom",{get:function(){return this.type==="OrthographicCamera"?this.orthographicCamera.zoom:this.type==="PerspectiveCamera"?this.perspectiveCamera.zoom:1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.type==="OrthographicCamera"?this.orthographicCamera.top:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.type==="OrthographicCamera"?this.orthographicCamera.bottom:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){return this.type==="OrthographicCamera"?this.orthographicCamera.left:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.type==="OrthographicCamera"?this.orthographicCamera.right:0},enumerable:!1,configurable:!0}),t.prototype.getDirection=function(e){return Nt(this.pose,e)},t.prototype.computePose=function(e){e===void 0&&(e=0),this.updateMatrix();var r=this.matrix.elements;return this.pose.latitude=Math.asin(fe(r[9],-1,1)),Math.abs(r[9])<.9999999?this.pose.longitude=na(Math.atan2(r[8],r[10])):this.pose.longitude=na(Math.atan2(-r[2],r[0])),this.pose.fov=this.fov,this.pose.distance=e,this.pose.offset=new d.Vector3(-r[8],-r[9],-r[10]).setLength(this.pose.distance).add(this.position),this},t.prototype.setFromPose=function(e){var r,i,a,o,s,l=na((r=e.longitude)!==null&&r!==void 0?r:this.pose.longitude),u=Math.max(-ns+1e-4,Math.min(ns-1e-4,(i=e.latitude)!==null&&i!==void 0?i:this.pose.latitude)),c=(a=e.fov)!==null&&a!==void 0?a:this.pose.fov,f=(o=e.distance)!==null&&o!==void 0?o:this.pose.distance,m=(s=e.offset)!==null&&s!==void 0?s:this.pose.offset,A=Nt({longitude:l,latitude:u}).normalize();return this.position.set(0,0,0),this.lookAt(A),this.position.add(m).sub(A.clone().setLength(f)),this.fov!==c&&(this.fov=c,this.updateProjectionMatrix()),this.updateMatrixWorld(),this.pose.longitude=l,this.pose.latitude=u,this.pose.fov=c,this.pose.distance=f,this.pose.offset.copy(m),this.needsRender=!0,this},t.prototype.copyPose=function(){return{longitude:this.pose.longitude,latitude:this.pose.latitude,fov:this.pose.fov,distance:this.pose.distance,offset:this.pose.offset.clone()}},t.prototype.computeProjectionMatrix=function(){Bd(this.orthographicCamera.projectionMatrix,this.perspectiveCamera.projectionMatrix,1-this.perspToOrtho.x,this.projectionMatrix),this.projectionMatrixInverse.getInverse(this.projectionMatrix),this.needsRender=!0},t.prototype.setViewOffset=function(e,r,i,a,o,s){this.perspectiveCamera.setViewOffset(e,r,i,a,o,s),this.orthographicCamera.setViewOffset(e,r,i,a,o,s),this.computeProjectionMatrix()},t.prototype.clearViewOffset=function(){this.perspectiveCamera.clearViewOffset(),this.orthographicCamera.clearViewOffset(),this.computeProjectionMatrix()},t.prototype.updateProjectionMatrix=function(){this.perspectiveCamera.updateProjectionMatrix(),this.orthographicCamera.updateProjectionMatrix(),this.computeProjectionMatrix()},Object.defineProperty(t.prototype,"perspectiveProjectionMatrix",{get:function(){return this.perspectiveCamera.projectionMatrix},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"perspectiveProjectionMatrixInverse",{get:function(){return this.perspectiveCamera.projectionMatrixInverse},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"orthographicProjectionMatrix",{get:function(){return this.orthographicCamera.projectionMatrix},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"orthographicProjectionMatrixInverse",{get:function(){return this.orthographicCamera.projectionMatrixInverse},enumerable:!1,configurable:!0}),t.prototype.updateTime=function(e,r){this.time=e;var i=!1;if((this.lastValues.fov!==this.fov||this.lastValues.near!==this.near||this.lastValues.far!==this.far||this.lastValues.aspect!==this.aspect)&&(this.perspectiveCamera.fov=this.fov,this.perspectiveCamera.near=this.near,this.perspectiveCamera.far=this.far,this.perspectiveCamera.aspect=this.aspect,this.perspectiveCamera.updateProjectionMatrix(),i=!0),!this.lastValues.position.equals(this.position)||!this.lastValues.quaternion.equals(this.quaternion)||!this.lastValues.scale.equals(this.scale)||!this.lastValues.perspToOrtho.equals(this.perspToOrtho)||this.lastValues.fov!==this.fov||this.lastValues.near!==this.near||this.lastValues.far!==this.far||this.lastValues.orthoDistance!==this.orthoDistance||this.lastValues.aspect!==this.aspect){var a=Math.max(this.orthoDistance,.01)*Math.tan(.5*this.fov/180*Math.PI),o=-.5*this.aspect*2*a;this.orthographicCamera.left=o,this.orthographicCamera.right=-o,this.orthographicCamera.top=a,this.orthographicCamera.bottom=-a,this.orthographicCamera.near=this.near,this.orthographicCamera.far=this.far,this.orthographicCamera.updateProjectionMatrix(),i=!0}i&&this.computeProjectionMatrix(),this.lastValues.position.copy(this.position),this.lastValues.quaternion.copy(this.quaternion),this.lastValues.scale.copy(this.scale),this.lastValues.fov=this.fov,this.lastValues.aspect=this.aspect,this.lastValues.near=this.near,this.lastValues.far=this.far,this.lastValues.orthoDistance=this.orthoDistance,this.lastValues.perspToOrtho.copy(this.perspToOrtho),this.type=this.perspToOrtho.x<1?"PerspectiveCamera":"OrthographicCamera"},Object.defineProperty(t.prototype,"isPerspectiveCamera",{get:function(){return this.perspToOrtho.x<1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isOrthographicCamera",{get:function(){return this.perspToOrtho.x>=1},enumerable:!1,configurable:!0}),t.prototype.copy=function(e,r){return n.prototype.copy.call(this,e,r),this.fov=e.fov,this.aspect=e.aspect,this.near=e.near,this.far=e.far,this.perspToOrtho.copy(e.perspToOrtho),this.updateTime(Ee(),0),this},t}(d.Camera),mt;(function(n){n[n.Outside=-1]="Outside",n[n.Intersecting=0]="Intersecting",n[n.Inside=1]="Inside"})(mt||(mt={}));var Q0=1e-6,ze=new d.Vector3,Ur=new d.Matrix4,Rr=new d.Vector3,Fr=new d.Vector3,kr=new d.Vector3,Ha=new d.Vector3,ia=new d.Box3,aa=new d.Sphere,is=new d.Matrix4,oa=new d.Ray,pt=new d.Object3D,as=new d.Frustum;function U0(n,t){var e=n.elements;return t.setFromRotationMatrix(Ur.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1)),t}var qn=function(){function n(t){t===void 0&&(t=[]),this.planes=t}return Object.defineProperty(n,"MASK_OUTSIDE",{get:function(){return 4294967295},enumerable:!1,configurable:!0}),Object.defineProperty(n,"MASK_INSIDE",{get:function(){return 0},enumerable:!1,configurable:!0}),Object.defineProperty(n,"MASK_INDETERMINATE",{get:function(){return 2147483647},enumerable:!1,configurable:!0}),n.prototype.setFromFrustum=function(t){return this.planes=t.planes.map(function(e){return e.clone()}),this},n.prototype.setFromCamera=function(t){return Ur.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),as.setFromProjectionMatrix(Ur),this.setFromFrustum(as),this},n.prototype.applyMatrix4=function(t){for(var e=0,r=this.planes;e<r.length;e++){var i=r[e];i.applyMatrix4(t)}},n.prototype.copy=function(t){return this.planes=t.planes.map(function(e){return e.clone()}),this},n.prototype.clone=function(){return new n().copy(this)},n.prototype.computeVisibility=function(t){for(var e=mt.Inside,r=0,i=this.planes;r<i.length;r++){var a=i[r],o=t.intersectPlane(a);switch(o){case mt.Outside:return mt.Outside;case mt.Intersecting:e=mt.Intersecting;break}}return e},n.prototype.computeVisibilityWithPlaneMask=function(t,e){if(e===n.MASK_OUTSIDE||e===n.MASK_INSIDE)return e;for(var r=n.MASK_INSIDE,i=Math.min(32,this.planes.length),a=0;a<i;++a){var o=1<<a;if(e&o){var s=this.planes[a],l=t.intersectPlane(s);if(l===mt.Outside)return n.MASK_OUTSIDE;l===mt.Intersecting&&(r|=o)}}return r},n}(),H0=function(){function n(){this.type="box",this.center=new d.Vector3,this.halfSize=new d.Vector3,this.rotation=new d.Matrix3}return n.prototype.fromJson=function(t){var e=t.box;this.center.set(e[0],e[1],e[2]);var r=e[3],i=e[4],a=e[5],o=e[6],s=e[7],l=e[8],u=e[9],c=e[10],f=e[11],m=Math.sqrt(r*r+i*i+a*a),A=Math.sqrt(o*o+s*s+l*l),h=Math.sqrt(u*u+c*c+f*f);this.halfSize.set(m,A,h);var p=this.halfSize.toArray().reduce(function(g,v){return g+v},0);return(isNaN(p)||p<=0)&&this.halfSize.setScalar(Q0),this.rotation.fromArray([r/m,i/m,a/m,o/A,s/A,l/A,u/h,c/h,f/h]),isNaN(this.rotation.toArray().reduce(function(g,v){return g+v},0))&&this.rotation.identity(),this},n.prototype.toJson=function(){return this.rotation.extractBasis(Rr,Fr,kr),{box:Et(Et(Et(Et([],this.center.toArray(),!0),Rr.multiplyScalar(this.halfSize.x).toArray(),!0),Fr.multiplyScalar(this.halfSize.y).toArray(),!0),kr.multiplyScalar(this.halfSize.z).toArray(),!0)}},n.prototype.copy=function(t){return this.center.copy(t.center),this.halfSize.copy(t.halfSize),this.rotation.copy(t.rotation),this},n.prototype.clone=function(){return new n().copy(this)},n.prototype.applyMatrix4=function(t){return pt.position.copy(this.center),U0(this.rotation,pt.quaternion),pt.scale.copy(this.halfSize),pt.matrix.compose(pt.position,pt.quaternion,pt.scale),pt.matrix.premultiply(t),pt.matrix.decompose(pt.position,pt.quaternion,pt.scale),this.center.copy(pt.position),this.rotation.setFromMatrix4(Ur.makeRotationFromQuaternion(pt.quaternion)),this.halfSize.copy(pt.scale),this},n.prototype.getCenter=function(t){return t.copy(this.center)},n.prototype.distanceSquaredToPoint=function(t){var e=this.rotation.elements,r=t.x-this.center.x,i=t.y-this.center.y,a=t.z-this.center.z,o=0,s;return s=r*e[0]+i*e[1]+a*e[2],s<0&&(s=-s),s-=this.halfSize.x,s>0&&(o+=s*s),s=r*e[3]+i*e[4]+a*e[5],s<0&&(s=-s),s-=this.halfSize.y,s>0&&(o+=s*s),s=r*e[6]+i*e[7]+a*e[8],s<0&&(s=-s),s-=this.halfSize.z,s>0&&(o+=s*s),o},n.prototype.distanceToPoint=function(t){return Math.sqrt(this.distanceSquaredToPoint(t))},n.prototype.distanceToPlane=function(t){var e=t.projectPoint(this.center,new d.Vector3);return this.distanceToPoint(e)},n.prototype.getBoundingBox=function(t){return t.makeEmpty(),this.rotation.extractBasis(Rr,Fr,kr),Rr.setLength(this.halfSize.x),Fr.setLength(this.halfSize.y),kr.setLength(this.halfSize.z),t.expandByPoint(ze.copy(this.center).add(Rr)),t.expandByPoint(ze.copy(this.center).sub(Rr)),t.expandByPoint(ze.copy(this.center).add(Fr)),t.expandByPoint(ze.copy(this.center).sub(Fr)),t.expandByPoint(ze.copy(this.center).add(kr)),t.expandByPoint(ze.copy(this.center).sub(kr)),t},n.prototype.toGeometry=function(){var t=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),e=new Float32Array(8*3);ze.set(this.halfSize.x,this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,0),ze.set(-this.halfSize.x,this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,3),ze.set(-this.halfSize.x,-this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,6),ze.set(this.halfSize.x,-this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,9),ze.set(this.halfSize.x,this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,12),ze.set(-this.halfSize.x,this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,15),ze.set(-this.halfSize.x,-this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,18),ze.set(this.halfSize.x,-this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,21);var r=new d.BufferGeometry;return r.setIndex(new d.BufferAttribute(t,1)),r.setAttribute("position",new d.BufferAttribute(e,3)),r.computeBoundingBox(),r.computeBoundingSphere(),r},n.prototype.intersectPlane=function(t){var e=this.center,r=t.normal,i=this.rotation.elements,a=this.halfSize,o=r.x,s=r.y,l=r.z,u=Math.abs(o*i[0]*a.x+s*i[1]*a.x+l*i[2]*a.x)+Math.abs(o*i[3]*a.y+s*i[4]*a.y+l*i[5]*a.y)+Math.abs(o*i[6]*a.z+s*i[7]*a.z+l*i[8]*a.z),c=r.dot(e)+t.constant;return c<=-u?mt.Outside:c>=u?mt.Inside:mt.Intersecting},n.prototype.intersectRay=function(t,e){if(Ha.copy(this.halfSize).multiplyScalar(2),ia.setFromCenterAndSize(ze.set(0,0,0),Ha),this.rotation.extractBasis(Rr,Fr,kr),Ur.makeBasis(Rr,Fr,kr),Ur.setPosition(this.center),is.getInverse(Ur),oa.copy(t).applyMatrix4(is),ia.containsPoint(oa.origin))return!0;var r=oa.intersectBox(ia,ze);return r?e!==void 0?r.applyMatrix4(Ur).distanceTo(t.origin)<e:!0:!1},n}(),q0=function(){function n(){this.type="sphere",this.center=new d.Vector3,this.radius=-1}return n.prototype.fromJson=function(t){var e=t.sphere;return this.center.set(e[0],e[1],e[2]),this.radius=Math.max(e[3],Q0),this},n.prototype.toJson=function(){return{sphere:Et(Et([],this.center.toArray(),!0),[this.radius],!1)}},n.prototype.copy=function(t){return this.center.copy(t.center),this.radius=t.radius,this},n.prototype.clone=function(){return new n().copy(this)},n.prototype.getBoundingBox=function(t){return t.setFromCenterAndSize(this.center,Ha.set(1,1,1).multiplyScalar(this.radius*2)),t},n.prototype.toGeometry=function(){for(var t=32,e=new Float32Array(t*3*2*2),r=0;r<=t;r++){var i=0;i=r/t*Math.PI*2,e[r*6+0]=this.center.x+Math.cos(i)*this.radius,e[r*6+1]=this.center.y+Math.sin(i)*this.radius,e[r*6+2]=this.center.z+0,i=(r+1)/t*Math.PI*2,e[r*6+3]=this.center.x+Math.cos(i)*this.radius,e[r*6+4]=this.center.y+Math.sin(i)*this.radius,e[r*6+5]=this.center.z+0}for(var r=t;r<=t*2;r++){var i=0;i=r/t*Math.PI*2,e[r*6+0]=this.center.x+Math.cos(i)*this.radius,e[r*6+1]=this.center.y+0,e[r*6+2]=this.center.z+Math.sin(i)*this.radius,i=(r+1)/t*Math.PI*2,e[r*6+3]=this.center.x+Math.cos(i)*this.radius,e[r*6+4]=this.center.y+0,e[r*6+5]=this.center.z+Math.sin(i)*this.radius}var a=new d.BufferGeometry;return a.setAttribute("position",new d.BufferAttribute(e,3)),a.computeBoundingBox(),a.computeBoundingSphere(),a},n.prototype.applyMatrix4=function(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this},n.prototype.getCenter=function(t){return t.copy(this.center)},n.prototype.distanceSquaredToPoint=function(t){var e=this.distanceToPoint(t);return e*e},n.prototype.distanceToPoint=function(t){var e=this.center.distanceTo(t)-this.radius;return e<=0?0:e},n.prototype.distanceToPlane=function(t){var e=Math.abs(t.distanceToPoint(this.center));return Math.max(0,e-this.radius)},n.prototype.intersectPlane=function(t){var e=this.center,r=this.radius,i=t.normal,a=i.dot(e)+t.constant;return a<-r?mt.Outside:a<r?mt.Intersecting:mt.Inside},n.prototype.intersectRay=function(t,e){if(aa.set(this.center,this.radius),aa.containsPoint(t.origin))return!0;var r=t.intersectSphere(aa,ze);return r?e!==void 0?t.origin.distanceTo(r)<e:!0:!1},n}(),Rd=function(){function n(){throw this.type="regin",this.west=0,this.south=0,this.east=0,this.north=0,this.minHeight=0,this.maxHeight=0,new Error("Region bounding volume not supported.")}return n.prototype.fromJson=function(t){var e=t.region;return this.west=e[0],this.south=e[1],this.east=e[2],this.north=e[3],this.minHeight=e[4],this.maxHeight=e[5],this},n.prototype.toJson=function(){return{region:[this.west,this.south,this.east,this.north,this.minHeight,this.maxHeight]}},n.prototype.copy=function(t){return this.west=t.west,this.south=t.south,this.east=t.east,this.north=t.north,this.minHeight=t.minHeight,this.maxHeight=t.maxHeight,this},n.prototype.clone=function(){return new n().copy(this)},n.prototype.getBoundingBox=function(t){throw new Error("not implemented")},n.prototype.toGeometry=function(){throw new Error("not implemented")},n.prototype.applyMatrix4=function(t){throw new Error("not implemented")},n.prototype.getCenter=function(t){throw new Error("not implemented")},n.prototype.distanceToPoint=function(t){throw new Error("not implemented")},n.prototype.distanceSquaredToPoint=function(t){throw new Error("not implemented")},n.prototype.distanceToPlane=function(t){throw new Error("not implemented")},n.prototype.intersectPlane=function(t){throw new Error("not implemented")},n.prototype.intersectRay=function(t){throw new Error("not implemented")},n}();function bi(n){if("box"in n)return new H0().fromJson(n);if("sphere"in n)return new q0().fromJson(n);if("region"in n)return new Rd().fromJson(n);throw new Error("BoundingVolume ".concat(JSON.stringify(n)," never suppored."))}var fi=[4821759,8191922,16637280,16739958,5822969,376977,16747077,9259235,14514687].map(function(n){return new d.LineBasicMaterial({color:n,depthWrite:!1,depthTest:!1,transparent:!0})}),Fd=function(){var n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),t=new Float32Array(8*3);ze.set(1,1,1).toArray(t,0),ze.set(-1,1,1).toArray(t,3),ze.set(-1,-1,1).toArray(t,6),ze.set(1,-1,1).toArray(t,9),ze.set(1,1,-1).toArray(t,12),ze.set(-1,1,-1).toArray(t,15),ze.set(-1,-1,-1).toArray(t,18),ze.set(1,-1,-1).toArray(t,21);var e=new d.BufferGeometry;return e.setIndex(new d.BufferAttribute(n,1)),e.setAttribute("position",new d.BufferAttribute(t,3)),e.computeBoundingBox(),e.computeBoundingSphere(),e}(),kd=function(){for(var n=32,t=new Float32Array(n*3*2*2),e=0;e<=n;e++){var r=0;r=e/n*Math.PI*2,t[e*6+0]=Math.cos(r),t[e*6+1]=Math.sin(r),t[e*6+2]=0,r=(e+1)/n*Math.PI*2,t[e*6+3]=Math.cos(r),t[e*6+4]=Math.sin(r),t[e*6+5]=0}for(var e=n;e<=n*2;e++){var r=0;r=e/n*Math.PI*2,t[e*6+0]=Math.cos(r),t[e*6+1]=0,t[e*6+2]=Math.sin(r),r=(e+1)/n*Math.PI*2,t[e*6+3]=Math.cos(r),t[e*6+4]=0,t[e*6+5]=Math.sin(r)}var i=new d.BufferGeometry;return i.setAttribute("position",new d.BufferAttribute(t,3)),i.computeBoundingBox(),i.computeBoundingSphere(),i}();function Ld(n,t){if(n instanceof H0){var e=new d.LineSegments(Fd,fi[Math.min(t,fi.length-1)]);return e.position.copy(n.center),U0(n.rotation,e.quaternion),e.scale.set(n.halfSize.x,n.halfSize.y,n.halfSize.z),e.matrix.compose(e.position,e.quaternion,e.scale),e}else if(n instanceof q0){var e=new d.LineSegments(kd,fi[Math.min(t,fi.length-1)]);return e.position.copy(n.center),e.scale.set(n.radius,n.radius,n.radius),e.matrix.compose(e.position,e.quaternion,e.scale),e}throw new Error("never")}var Od=new d.Vector3,po=function(){function n(t,e,r,i){var a=this,o,s,l,u;this.parent=null,this.floor=0,this.id=t,this.state={visible:!1,frameNumber:0,selectedFrameNumber:0,requestedFrameNumber:0,touchedFrameNumber:0,distanceToCamera:0,centerZDepth:0,centerScreenY:0,screenSpaceError:0,visibilityPlaneMask:0,inRequestVolume:!1,shouldRefine:!1,stackLength:0,finalResolution:!0,selectionDepth:0,shouldSelect:!1,lastSelect:!1,ancestorWithContent:null,ancestorWithContentAvailable:null},this.parent=i!=null?i:null,this.level=this.parent?this.parent.level+1:0,this.tileset=r,this.refine=(o=e.refine)!==null&&o!==void 0?o:this.parent?this.parent.refine:"REPLACE",this.transform=new d.Matrix4,e.transform&&this.transform.fromArray(e.transform),this.parent&&this.transform.premultiply(this.parent.transform),typeof e.geometricError=="number"?this.geometricError=e.geometricError*this.transform.getMaxScaleOnAxis():this.geometricError=(l=(s=this.parent)===null||s===void 0?void 0:s.geometricError)!==null&&l!==void 0?l:0,e.content&&e.content.uri?(this.content={uri:e.content.uri,loadState:"UNLOADED",byteLength:0},e.content.group!==void 0&&(this.content.group=e.content.group),e.content.boundingVolume&&(this.content.boundingVolume=bi(e.content.boundingVolume).applyMatrix4(this.transform)),/\.json$/.test(this.content.uri)?this.type="TILESET":this.type="SCENEGRAPH"):(this.content=null,this.type="EMPTY"),this.levelOfContent=this.parent?this.parent.levelOfContent:-1,this.type==="SCENEGRAPH"&&(this.levelOfContent=this.levelOfContent+1),e.boundingVolume&&(this.boundingVolume=bi(e.boundingVolume).applyMatrix4(this.transform)),e.viewerRequestVolume&&(this.viewerRequestVolume=bi(e.viewerRequestVolume).applyMatrix4(this.transform)),this.extras=(u=e.extras)!==null&&u!==void 0?u:{},typeof this.extras.floor!="number"&&i&&typeof i.extras.floor=="number"&&(this.extras.floor=i.extras.floor),typeof this.extras.floor=="number"&&(this.floor=this.extras.floor,this.tileset.floorLength=Math.max(this.tileset.floorLength,this.floor+1)),this.boundingVolume&&(this.boundingVolumeDebugObject=Ld(this.boundingVolume,this.levelOfContent)),e.children?this.children=e.children.map(function(c,f){return new n("".concat(a.id,".").concat(f),c,r,a)}):this.children=[]}return n.prototype.traverse=function(t){t(this);for(var e=0,r=this.children;e<r.length;e++){var i=r[e];i.traverse(t)}},n.prototype.updateState=function(t){this.state.frameNumber=t.frameNumber;var e=this.tileset.transformIsIdentity?null:this.tileset.transform;if(this.boundingVolume){var r=e?this.boundingVolume.clone().applyMatrix4(e):this.boundingVolume;if(t.camera.type==="OrthographicCamera"){var i=new d.Plane().setFromNormalAndCoplanarPoint(t.camera.direction,t.camera.position);this.state.distanceToCamera=r.distanceToPlane(i)}else this.state.distanceToCamera=r.distanceToPoint(t.camera.position);var a=r.getCenter(Od).sub(t.camera.position);this.state.centerZDepth=t.camera.direction.dot(a),this.state.centerScreenY=t.camera.up.dot(a);var o=this.parent?this.parent.state.visibilityPlaneMask:qn.MASK_INDETERMINATE;this.state.visibilityPlaneMask=t.cullingVolume.computeVisibilityWithPlaneMask(r,o),this.state.visible=this.state.visibilityPlaneMask!==qn.MASK_OUTSIDE}else this.state.distanceToCamera=0,this.state.centerZDepth=0,this.state.visibilityPlaneMask=qn.MASK_INDETERMINATE,this.state.visible=!0;if(this.levelOfContent<=0&&(this.state.visible=!0),this.viewerRequestVolume){var s=e?this.viewerRequestVolume.clone().applyMatrix4(e):this.viewerRequestVolume;this.state.inRequestVolume=s.distanceSquaredToPoint(t.camera.position)<=0}else this.state.inRequestVolume=!0;this.state.screenSpaceError=this.getScreenSpaceError(t,this.state.distanceToCamera,!1)},Object.defineProperty(n.prototype,"selected",{get:function(){return this.state.selectedFrameNumber===this.tileset.frameNumber},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasChildren",{get:function(){return this.children.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"siblingIndex",{get:function(){var t,e;return(e=(t=this.parent)===null||t===void 0?void 0:t.children.indexOf(this))!==null&&e!==void 0?e:0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasTilesetContent",{get:function(){return this.children.length>0&&this.type==="TILESET"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasRenderContent",{get:function(){return this.type==="SCENEGRAPH"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"contentAvailable",{get:function(){var t;return this.hasRenderContent&&((t=this.content)===null||t===void 0?void 0:t.loadState)==="READY"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasUnloadedContent",{get:function(){var t;return((t=this.content)===null||t===void 0?void 0:t.loadState)==="UNLOADED"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasEmptyContent",{get:function(){return this.type==="EMPTY"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"contentReady",{get:function(){var t;return((t=this.content)===null||t===void 0?void 0:t.loadState)==="READY"||this.hasEmptyContent},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"contentByteLength",{get:function(){return this.content?this.content.byteLength:0},enumerable:!1,configurable:!0}),n.prototype.getScreenSpaceError=function(t,e,r){var i=this.tileset.transformIsIdentity?1:this.tileset.transform.getMaxScaleOnAxis(),a=this.parent?this.parent.geometricError:this.tileset.geometricError,o=i*(r?a:this.geometricError);if(o===0)return 0;var s=Math.max(e,.001),l=o*t.height/(s*t.sseDenominator);return l},n.prototype.getPriority=function(){var t=this.refine==="ADD"||this.tileset.skipLevelOfDetail;if(t&&!this.state.visible||this.tileset.frameNumber-this.state.touchedFrameNumber>=1)return-1;var e=this.parent,r=e&&(!t||this.state.screenSpaceError===0),i=r?e.state.screenSpaceError:this.state.screenSpaceError,a=this.tileset.root?this.tileset.root.state.screenSpaceError:0,o=Math.max(a-i,0);return o},n}();function os(n){var t=n.refine==="ADD"||n.tileset.skipLevelOfDetail,e=n.parent,r=e&&(!t||n.state.screenSpaceError===0),i=r?e.state.screenSpaceError:n.state.screenSpaceError,a=n.tileset.root?n.tileset.root.state.screenSpaceError:0,o=Math.max(a-i,0);return o}var G0=function(){function n(t,e){this.tileset=t,this.options=e,this.activeRequests=0,this.requestQueue=[]}return n.prototype.reset=function(){for(var t=0,e=this.requestQueue;t<e.length;t++){var r=e[t];this.options.onTileSkip&&this.options.onTileSkip(r.tile)}this.requestQueue.length=0},n.prototype.update=function(t,e,r){for(var i=this,a=r.time,o=this.requestQueue,s=new Set(t),l=0;l<o.length;l++){var u=o[l];if(s.has(u.tile)){s.delete(u.tile);continue}u.status==="WAITING"&&(o.splice(l,1),l--,this.options.onTileSkip&&this.options.onTileSkip(u.tile))}s.size>0&&(s.forEach(function(h){o.push({tile:h,status:"WAITING",time:a,error:null})}),s.clear());for(var c=this.tileset.maxRequests,l=0;l<o.length&&c>0;l++){var u=o[l];if(u.status==="DONE")u.error!==null?this.options.onTileError&&this.options.onTileError(u.tile,u.error):(c--,u.tile.content&&(u.tile.content.loadState="READY"),this.options.onTileLoad&&this.options.onTileLoad(u.tile)),o.splice(l,1),l--;else if(u.status==="PENDING"&&a-u.time<1e3)break}switch(e){case"SCREEN_SPACE_ERROR":{var f=new Map;o.sort(function(h,p){if(h.tile.state.requestedFrameNumber!==p.tile.state.requestedFrameNumber)return p.tile.state.requestedFrameNumber-h.tile.state.requestedFrameNumber;if(h.tile.state.requestedFrameNumber===r.frameNumber){var g=f.get(h.tile.id);g===void 0&&(g=os(h.tile),f.set(h.tile.id,g));var v=f.get(p.tile.id);return v===void 0&&(v=os(p.tile),f.set(p.tile.id,v)),g-v}else return h.tile.level!==p.tile.level?h.tile.level-p.tile.level:h.tile.state.distanceToCamera-p.tile.state.distanceToCamera});break}case"SCREEN_VERTICAL":{o.sort(function(h,p){return h.tile.state.requestedFrameNumber!==p.tile.state.requestedFrameNumber?p.tile.state.requestedFrameNumber-h.tile.state.requestedFrameNumber:h.tile.state.requestedFrameNumber===r.frameNumber?h.tile.state.centerScreenY!==p.tile.state.centerScreenY?h.tile.state.centerScreenY-p.tile.state.centerScreenY:h.tile.state.centerZDepth!==p.tile.state.centerZDepth?h.tile.state.centerZDepth-p.tile.state.centerZDepth:h.tile.level!==p.tile.level?h.tile.level-p.tile.level:h.tile.state.distanceToCamera-p.tile.state.distanceToCamera:h.tile.level!==p.tile.level?h.tile.level-p.tile.level:h.tile.state.distanceToCamera-p.tile.state.distanceToCamera});break}case"SCREEN_LEVEL_VERTICAL":{o.sort(function(h,p){return h.tile.state.requestedFrameNumber!==p.tile.state.requestedFrameNumber?p.tile.state.requestedFrameNumber-h.tile.state.requestedFrameNumber:h.tile.state.requestedFrameNumber===r.frameNumber?h.tile.level!==p.tile.level?h.tile.level-p.tile.level:h.tile.state.centerScreenY!==p.tile.state.centerScreenY?h.tile.state.centerScreenY-p.tile.state.centerScreenY:h.tile.state.centerZDepth!==p.tile.state.centerZDepth?h.tile.state.centerZDepth-p.tile.state.centerZDepth:h.tile.state.distanceToCamera-p.tile.state.distanceToCamera:h.tile.level!==p.tile.level?h.tile.level-p.tile.level:h.tile.state.distanceToCamera-p.tile.state.distanceToCamera});break}}c=Math.max(this.tileset.maxRequests-this.activeRequests,0);for(var m=function(h){var p=o[h];p.status==="WAITING"&&(c--,p.status="PENDING",p.time=a,A.activeRequests++,A.tileset.options.tileLoader(p.tile).catch(function(g){p.error=g}).then(function(){p.status="DONE",p.tile.content&&p.tile.content.loadState==="READY"&&(p.tile.content.loadState="LOADING"),i.activeRequests--}))},A=this,l=0;l<o.length&&c>0;l++)m(l)},n}(),Vd=function(){function n(t,e,r){this.item=t,this.previous=e,this.next=r}return n}(),Nd=function(){function n(){this.head=null,this.tail=null,this._length=0}return Object.defineProperty(n.prototype,"length",{get:function(){return this._length},enumerable:!1,configurable:!0}),n.prototype.add=function(t){var e=new Vd(t,this.tail,null);return this.tail?(this.tail.next=e,this.tail=e):(this.head=e,this.tail=e),this._length++,e},n.prototype.remove=function(t){t.previous&&t.next?(t.previous.next=t.next,t.next.previous=t.previous):t.previous?(t.previous.next=null,this.tail=t.previous):t.next?(t.next.previous=null,this.head=t.next):(this.head=null,this.tail=null),t.next=null,t.previous=null,this._length--},n.prototype.splice=function(t,e){t!==e&&(this.remove(e),this.insert(t,e))},n.prototype.insert=function(t,e){var r=t.next;t.next=e,this.tail===t?this.tail=e:r.previous=e,e.next=r,e.previous=t,this._length++},n.prototype.toArray=function(){for(var t=[],e=this.head;e;)t.push(e),e=e.next;return t},n}(),K0=function(){function n(t){t===void 0&&(t={}),this.options=t,this.cacheNodeMap=new Map,this.list=new Nd,this.sentinel=this.list.add("sentinel")}return n.prototype.reset=function(){this.list.tail&&this.list.splice(this.list.tail,this.sentinel)},n.prototype.touchTile=function(t){var e=this.cacheNodeMap.get(t);e&&this.list.splice(this.sentinel,e)},n.prototype.loadTile=function(t){if(!this.cacheNodeMap.has(t)){var e=this.list.add(t);this.cacheNodeMap.set(t,e),this.options.onTileLoad&&this.options.onTileLoad(t)}},n.prototype.unloadTile=function(t){var e=this.cacheNodeMap.get(t);e&&(this.list.remove(e),this.cacheNodeMap.delete(t),this.options.onTileUnload&&this.options.onTileUnload(t))},n.prototype.unloadTiles=function(t){for(var e=this.list.head;e!==this.sentinel&&t();){var r=e.item;e=e.next,this.unloadTile(r)}},n.prototype.toArray=function(){for(var t=[],e=0,r=this.list.toArray();e<r.length;e++){var i=r[e];i.item!=="sentinel"&&t.push(i.item)}return t},n}(),Hr=function(){function n(){this.map=new Map,this.array=[],this._length=0}return Object.defineProperty(n.prototype,"length",{get:function(){return this._length},enumerable:!1,configurable:!0}),n.prototype.get=function(t){return this.array[t]},n.prototype.set=function(t,e){t>=this.length&&(this._length=t+1),this.map.has(this.array[t])&&this.map.delete(this.array[t]),this.array[t]=e,this.map.set(e,t)},n.prototype.delete=function(t){var e=this.map.get(t);e!==void 0&&e>=0&&(this.array.splice(e,1),this.map.delete(t),this._length--)},n.prototype.push=function(t){if(!this.map.has(t)){var e=this._length++;this.array[e]=t,this.map.set(t,e)}},n.prototype.pop=function(){var t=this.array[--this._length];return this.map.delete(t),this.array[this._length]=void 0,t},n.prototype.reset=function(){this.array=[],this.map=new Map,this._length=0},n.prototype.find=function(t){return this.map.has(t)},n.prototype.peek=function(){return this.array[this._length-1]},n}(),vo=function(){function n(t){this.tileset=t,this._canSelectTile=!0,this._loadAllTilesTraversalStack=new Hr,this.root=null}return n.prototype.traverse=function(t,e,r){this.root=t,this.reset()},n.prototype.reset=function(){this._loadAllTilesTraversalStack.reset(),this.tileset.hasMixedContent=!1,this.tileset.needsRefinedTiles.clear(),this.tileset.requestedTiles.length=0,this.tileset.selectedTiles.length=0},n.prototype.updateTile=function(t,e){this.updateTileVisibility(t,e),t.state.shouldSelect=!1,t.state.finalResolution=!0},n.prototype.selectTile=function(t,e){var r=t.contentAvailable&&this._canSelectTile;r&&t.state.selectedFrameNumber<e.frameNumber&&(t.state.selectedFrameNumber=e.frameNumber,this.tileset.selectedTiles.push(t),this.tileset.needsRefinedTiles.add(t))},n.prototype.loadTile=function(t,e){t.state.requestedFrameNumber<e.frameNumber&&(t.state.requestedFrameNumber=e.frameNumber,t.hasUnloadedContent&&this.tileset.requestedTiles.push(t)),this.tileset.needsRefinedTiles.add(t)},n.prototype.touchTile=function(t,e){this.tileset.cache.touchTile(t),t.state.touchedFrameNumber=e.frameNumber},n.prototype.canTraverse=function(t,e){return t.levelOfContent>=e.maxLevelOfDetail||t.children.length===0?!1:t.levelOfContent<=e.minLevelOfDetail||t.hasTilesetContent?!0:t.state.screenSpaceError>this.tileset.maxScreenSpaceError},n.prototype.updateTileVisibility=function(t,e){if(t.updateState(e),!(!t.state.visible||!t.state.inRequestVolume)){var r=t.children.length>0;if(t.hasTilesetContent&&r){var i=t.children[0];this.updateTileVisibility(i,e),t.state.visible=i.state.visible;return}if(this.meetsScreenSpaceErrorEarly(t,e)){t.state.visible=!1;return}var a=t.refine==="REPLACE";if(a&&r&&!this.anyChildrenVisible(t,e)){t.state.visible=!1;return}}},n.prototype.anyChildrenVisible=function(t,e){for(var r=!1,i=t.children,a=0,o=i;a<o.length;a++){var s=o[a];s.updateState(e),r=r||s.state.visible}return r},n.prototype.meetsScreenSpaceErrorEarly=function(t,e){var r=t.parent;return!r||r.refine!=="ADD"||r.levelOfContent<e.minLevelOfDetail?!1:r.levelOfContent>e.maxLevelOfDetail?!0:t.getScreenSpaceError(e,t.state.distanceToCamera,!0)<this.tileset.maxScreenSpaceError},n.prototype.sortTilesByDistanceToCamera=function(t){t.sort(function(e,r){return r.state.distanceToCamera===0&&e.state.distanceToCamera===0?r.state.centerZDepth-e.state.centerZDepth:r.state.distanceToCamera-e.state.distanceToCamera})},n.prototype.loadAllTiles=function(t,e){var r=this._loadAllTilesTraversalStack;for(r.push(t);r.length>0;){var i=r.pop();i.hasUnloadedContent&&i.state.requestedFrameNumber<e.frameNumber&&this.tileset.requestedTiles.push(i),this.touchTile(i,e);for(var a=0,o=i.children;a<o.length;a++){var s=o[a];r.push(s)}}},n}(),Dd=function(n){se(t,n);function t(e){var r=n.call(this,e)||this;return r.tileset=e,r._traversalStack=new Hr,r._emptyTraversalStack=new Hr,r}return t.prototype.traverse=function(e,r,i){i===void 0&&(i=[]),n.prototype.traverse.call(this,e,r,i);for(var a=0,o=i;a<o.length;a++){var s=o[a];this._traversalStack.reset(),this._emptyTraversalStack.reset(),s.camera.refine&&(this._canSelectTile=s.camera.visible,this.updateTile(e,s),this.executeTraversal(e,s))}this._traversalStack.reset(),this._emptyTraversalStack.reset(),r.camera.refine&&(this._canSelectTile=r.camera.visible,this.updateTile(e,r),this.executeTraversal(e,r)),this.tileset.loadAll&&this.loadAllTiles(e,r)},t.prototype.reset=function(){n.prototype.reset.call(this),this._traversalStack.reset(),this._emptyTraversalStack.reset()},t.prototype.executeTraversal=function(e,r){var i=this._traversalStack;for(e.state.visible&&e.state.inRequestVolume&&i.push(e);i.length>0;){var a=i.pop(),o=a.parent,s=!o||o.state.shouldRefine,l=!1;this.canTraverse(a,r)&&(l=this.updateAndPushChildren(a,r,i)&&s);var u=!l&&s;a.hasRenderContent?a.refine==="ADD"?(this.loadTile(a,r),this.selectDesiredTile(a,r)):a.refine==="REPLACE"&&(this.loadTile(a,r),u&&this.selectDesiredTile(a,r)):(this.loadTile(a,r),u&&this.selectDesiredTile(a,r)),this.touchTile(a,r),a.state.shouldRefine=l}},t.prototype.updateAndPushChildren=function(e,r,i){for(var a=e.children,o=0,s=a;o<s.length;o++){var l=s[o];this.updateTile(l,r)}this.sortTilesByDistanceToCamera(a);for(var u=e.refine==="REPLACE"&&e.hasRenderContent,c=!1,f=!0,m=0,A=a;m<A.length;m++){var l=A[m];if(l.state.visible&&l.state.inRequestVolume?(i.find(l)&&i.delete(l),i.push(l),c===!1&&(c=!0)):(u||this.tileset.loadSiblings)&&(this.loadTile(l,r),this.touchTile(l,r)),u){var h=void 0;l.state.inRequestVolume?l.hasRenderContent?h=l.contentAvailable:h=this.executeEmptyTraversal(l,r):h=!1,f=f&&h}}return c||(f=!1),f},t.prototype.selectDesiredTile=function(e,r){e.contentAvailable&&n.prototype.selectTile.call(this,e,r)},t.prototype.executeEmptyTraversal=function(e,r){var i=!0,a=this._emptyTraversalStack;for(a.push(e);a.length>0&&i;){var o=a.pop(),s=!o.hasRenderContent&&this.canTraverse(o,r);if(!s&&!o.contentAvailable&&(i=!1),this.updateTile(o,r),o.state.visible||(this.loadTile(o,r),this.touchTile(o,r)),s)for(var l=o.children,u=0,c=l;u<c.length;u++){var f=c[u];a.find(f)&&a.delete(f),a.push(f)}}return i},t}(vo),zd=function(n){se(t,n);function t(e){var r=n.call(this,e)||this;return r.tileset=e,r.baseScreenSpaceError=1024,r.skipScreenSpaceErrorFactor=16,r.skipLevels=1,r._traversalStack=new Hr,r._descendantTraversalStack=new Hr,r._selectionTraversalStack=new Hr,r._selectionTraversalancestorStack=new Hr,r}return t.prototype.traverse=function(e,r,i){i===void 0&&(i=[]),n.prototype.traverse.call(this,e,r,i);for(var a=0,o=i;a<o.length;a++){var s=o[a];this._traversalStack.reset(),s.camera.refine&&(this._canSelectTile=s.camera.visible,this.updateTile(e,s),this.executeTraversal(e,s),this.traverseAndSelect(e,s))}this.tileset.hasMixedContent=!1,this._traversalStack.reset(),this._descendantTraversalStack.reset(),this._selectionTraversalStack.reset(),this._selectionTraversalancestorStack.reset(),r.camera.refine&&(this._canSelectTile=r.camera.visible,this.updateTile(e,r),this.executeTraversal(e,r),this.traverseAndSelect(e,r)),this.tileset.loadAll&&this.loadAllTiles(e,r)},t.prototype.reset=function(){n.prototype.reset.call(this),this._traversalStack.reset(),this._descendantTraversalStack.reset(),this._selectionTraversalStack.reset(),this._selectionTraversalancestorStack.reset()},t.prototype.executeTraversal=function(e,r){var i=this._traversalStack;for(e.state.visible&&e.state.inRequestVolume&&i.push(e);i.length>0;){var a=i.pop();this.updateTileAncestorContentLinks(a,r);var o=a.parent,s=!o||o.state.shouldRefine,l=!1;this.canTraverse(a,r)&&(l=this.updateAndPushChildren(a,r,i)&&s);var u=!l&&s;a.hasRenderContent?a.refine==="ADD"?(this.loadTile(a,r),this.selectDesiredTile(a,r)):a.refine==="REPLACE"&&(this.inBaseTraversal(a,this.baseScreenSpaceError)?(this.loadTile(a,r),u&&this.selectDesiredTile(a,r)):u?(this.loadTile(a,r),this.selectDesiredTile(a,r)):this.reachedSkippingThreshold(a)&&this.loadTile(a,r)):(this.loadTile(a,r),u&&this.selectDesiredTile(a,r)),this.touchTile(a,r),a.state.shouldRefine=l}},t.prototype.updateAndPushChildren=function(e,r,i){for(var a=e.children,o=0,s=a;o<s.length;o++){var l=s[o];this.updateTile(l,r)}this.sortTilesByDistanceToCamera(a);for(var u=!1,c=0,f=a;c<f.length;c++){var l=f[c];l.state.visible&&l.state.inRequestVolume?(i.push(l),u===!1&&(u=!0)):this.tileset.loadSiblings&&(this.loadTile(l,r),this.touchTile(l,r))}return u},t.prototype.selectDesiredTile=function(e,r){var i=e.contentAvailable?e:e.state.ancestorWithContentAvailable;i&&(i.state.shouldSelect=!0),e.contentAvailable||this.selectDescendants(e,r)},t.prototype.selectDescendants=function(e,r){var i=this._descendantTraversalStack;for(i.push(e);i.length>0;)for(var a=i.pop(),o=a.children,s=0,l=o;s<l.length;s++){var u=l[s];u.state.visible&&(u.contentAvailable?(this.updateTile(u,r),this.touchTile(u,r),this.selectTile(u,r)):i.push(u))}},t.prototype.reachedSkippingThreshold=function(e){var r=e.state.ancestorWithContent,i=r!==null&&e.state.screenSpaceError<r.state.screenSpaceError/this.skipScreenSpaceErrorFactor&&e.levelOfContent>r.levelOfContent+this.skipLevels;return i},t.prototype.updateTileAncestorContentLinks=function(e,r){e.state.ancestorWithContent=null,e.state.ancestorWithContentAvailable=null;var i=e.parent;if(i){var a=!(i.hasRenderContent&&i.hasUnloadedContent)||i.state.requestedFrameNumber===r.frameNumber;e.state.ancestorWithContent=a?i:i.state.ancestorWithContent,e.state.ancestorWithContentAvailable=i.contentAvailable?i:i.state.ancestorWithContentAvailable}},t.prototype.inBaseTraversal=function(e,r){return e.state.ancestorWithContent?e.parent&&e.state.screenSpaceError===0?e.parent.state.screenSpaceError>r:e.state.screenSpaceError>r:!0},t.prototype.traverseAndSelect=function(e,r){var i=this._selectionTraversalStack,a=this._selectionTraversalancestorStack,o;for(i.push(e);i.length>0||a.length>0;){if(a.length>0){var s=a.peek();if(s.state.stackLength===i.length){a.pop(),s!==o&&(s.state.finalResolution=!1),this.selectTile(s,r);continue}}var l=i.pop();if(l){var u=this.canTraverse(l,r);if(l.state.shouldSelect)if(l.refine==="ADD")this.selectTile(l,r);else{if(l.state.selectionDepth=a.length,l.state.selectionDepth>0&&(l.tileset.hasMixedContent=!0),o=l,!u){this.selectTile(l,r);continue}a.push(l),l.state.stackLength=i.length}if(u)for(var c=0,f=l.children;c<f.length;c++){var m=f[c];m.state.visible&&i.push(m)}}}},t}(vo),Qd=function(n){se(t,n);function t(e){var r=n.call(this,e)||this;return r.tileset=e,r._traversalStack=new Hr,r}return t.prototype.canTraverse=function(e,r){return!(e.levelOfContent>=r.maxLevelOfDetail||e.children.length===0)},t.prototype.traverse=function(e,r,i){n.prototype.traverse.call(this,e,r,[]),this._traversalStack.reset(),e.updateState(r);for(var a=0,o=i;a<o.length;a++){var s=o[a];this._traversalStack.reset(),s.camera.refine&&(this._canSelectTile=s.camera.visible,e.updateState(s),this.executeTraversal(e,s))}this._traversalStack.reset(),r.camera.refine&&(this._canSelectTile=r.camera.visible,e.updateState(r),this.executeTraversal(e,r)),this.tileset.loadAll&&this.loadAllTiles(e,r)},t.prototype.reset=function(){n.prototype.reset.call(this),this._traversalStack.reset()},t.prototype.executeTraversal=function(e,r){var i=this._traversalStack;for(i.push(e);i.length>0;){var a=i.pop(),o=a.refine==="ADD",s=a.refine==="REPLACE",l=this.canTraverse(a,r);l&&this.updateAndPushChildren(a,r,i),(o||s&&!l)&&(this.loadTile(a,r),this.touchTile(a,r),this.selectDesiredTile(a,r))}},t.prototype.updateAndPushChildren=function(e,r,i){for(var a=e.children,o=0;o<a.length;++o){var s=a[o];s.updateState(r),s.state.visible&&i.push(s)}},t.prototype.selectDesiredTile=function(e,r){e.contentAvailable&&n.prototype.selectTile.call(this,e,r)},t}(vo),ss=[5635925,5592575,16733525],j0=function(){function n(t,e,r){var i;this.index=t,this.name=e.name,this.visible=!1,this.tileset=r,this.transform=new d.Matrix4,e.transform&&this.transform.fromArray(e.transform),this.transform.premultiply(this.tileset.root.transform),this.content={uri:e.file,color:new d.Color((i=e.color)!==null&&i!==void 0?i:ss[t%ss.length]),byteLength:0,loadState:"UNLOADED",data:void 0}}return n}(),Ud=new d.Matrix4,br=function(){function n(t,e,r){var i=this,a,o,s,l,u,c,f,m,A;if(this.id=t,this.transform=new d.Matrix4,this.transformIsIdentity=!0,this.hasMixedContent=!1,this.url=(a=r.url)!==null&&a!==void 0?a:"",this.referer=(o=r.referer)!==null&&o!==void 0?o:"",this.asset={version:e.asset.version,tilesetVersion:e.asset.tilesetVersion||"",gltfUpAxis:(s=e.asset.gltfUpAxis)!==null&&s!==void 0?s:"Y",overview:e.asset.overview,trajectories:(u=(l=e.asset.trajectories)===null||l===void 0?void 0:l.list)!==null&&u!==void 0?u:[]},this.rootMeta=(c=e.rootMeta)!==null&&c!==void 0?c:{},this.pointLength=(f=this.rootMeta.numTotalPoints)!==null&&f!==void 0?f:1/0,this.floorLength=(m=this.rootMeta.numFloors)!==null&&m!==void 0?m:1,this.properties=(A=e.properties)!==null&&A!==void 0?A:{},this.options=r,this.maxMemoryUsage=n.DEFAULT_MAX_MEMORY_USAGE,this.maxScreenSpaceError=n.DEFAULT_MAX_SCREEN_SPACE_ERROR,this.skipLevelOfDetail=n.DEFAULT_SKIP_LEVEL_OF_DETAIL,this.mostDetail=n.DEFAULT_MOST_DETAIL,this.loadSiblings=n.DEFAULT_LOAD_SIBLINGS,this.loadAll=n.DEFAULT_LOAD_ALL,this.maxRequests=n.DEFAULT_MAX_REQUESTS,this.tileRequestOrder=n.DEFAULT_REQUEST_ORDER,this.requestedTiles=[],this.selectedTiles=[],this.unloadTiles=[],this.needsRefinedTiles=new Set,this.selectedTrajectories=[],this.normalTraverser=new Dd(this),this.skipTraverser=new zd(this),this.mostDetailTraverser=new Qd(this),this.cache=new K0({onTileLoad:function(g){i.memoryUsageInBytes+=g.contentByteLength},onTileUnload:function(g){i.memoryUsageInBytes-=g.contentByteLength,i.unloadTiles.push(g)}}),this.requestScheduler=new G0(this,{onTileSkip:function(g){},onTileLoad:function(g){var v;!((v=g.content)===null||v===void 0)&&v.data&&(i.loadedTiles.add(g),i.cache.loadTile(g)),i.options.onTileLoad(g)},onTileError:function(g,v){i.options.onTileError(g,v)}}),this.frameNumber=0,this.maxLevelOfDetail=0,this.minLevelOfDetail=0,this.loadedTiles=new Set,this.memoryUsageInBytes=0,this.root=new po("".concat(this.id,".0"),e.root,this),this.geometricError=e.geometricError,this.trajectories=[],this.asset.trajectories)for(var h=0;h<this.asset.trajectories.length;h++){var p=new j0(h,this.asset.trajectories[h],this);this.trajectories.push(p)}}return Object.defineProperty(n.prototype,"traverser",{get:function(){return this.mostDetail?this.mostDetailTraverser:this.skipLevelOfDetail?this.skipTraverser:this.normalTraverser},enumerable:!1,configurable:!0}),n.prototype.reset=function(){for(var t=this,e=[this.root],r;r=e.pop();){for(var i=0,a=r.children.length;i<a;i++)e.push(r.children[i]);this.cache.unloadTile(r)}for(var o=function(){var c=s.unloadTiles.pop();c&&(s.loadedTiles.delete(c),s.memoryUsageInBytes-=c.contentByteLength,s.options.tileUnloader(c).catch(function(){}).then(function(){t.options.onTileUnload&&t.options.onTileUnload(c)}))},s=this;this.unloadTiles.length;)o();this.cache.reset(),this.traverser.reset(),this.requestScheduler.reset(),this.loadedTiles.clear();for(var l=function(){var c=u.trajectories.pop();c&&u.options.trajectoryUnloader(c).catch(function(){}).then(function(){t.options.onTrajectoryUnload&&t.options.onTrajectoryUnload(c)})},u=this;this.trajectories.length;)l()},n.prototype.update=function(t,e){var r=this,i;e===void 0&&(e=[]),this.frameNumber=t.frameNumber,this.minLevelOfDetail=t.minLevelOfDetail,this.maxLevelOfDetail=t.maxLevelOfDetail,this.transformIsIdentity=this.transform.equals(Ud),this.traverser.traverse(this.root,t,e),this.cache.unloadTiles(function(){var m=r.memoryUsageInBytes>r.maxMemoryUsage*1024*1024;return m}),this.requestScheduler.update(this.requestedTiles,this.tileRequestOrder,t);for(var a=function(){var m=o.unloadTiles.pop();m&&(o.loadedTiles.delete(m),o.options.tileUnloader(m).catch(function(){}).then(function(){r.options.onTileUnload&&r.options.onTileUnload(m)}))},o=this;this.unloadTiles.length;)a();this.selectedTrajectories.length=0;for(var s=function(m){m.visible===!0&&m.content.loadState==="READY"&&(!((i=m.content.data)===null||i===void 0)&&i.object)?l.selectedTrajectories.push(m):m.visible===!0&&m.content.loadState==="UNLOADED"&&l.options.trajectoryLoader(m).then(function(){r.options.onTrajectoryLoad(m)}).catch(function(A){r.options.onTrajectoryError(m,A)})},l=this,u=0,c=this.trajectories;u<c.length;u++){var f=c[u];s(f)}},n.DEFAULT_MAX_MEMORY_USAGE=16,n.DEFAULT_MAX_SCREEN_SPACE_ERROR=4,n.DEFAULT_SKIP_LEVEL_OF_DETAIL=!1,n.DEFAULT_MOST_DETAIL=!1,n.DEFAULT_LOAD_SIBLINGS=!1,n.DEFAULT_LOAD_ALL=!1,n.DEFAULT_MAX_REQUESTS=6,n.DEFAULT_REQUEST_ORDER="SCREEN_SPACE_ERROR",n}(),_0=function(){function n(t,e){this.position=t,this.indices=e}return n.prototype.getPositionCount=function(){var t,e,r=this.indices,i=this.position;return r?r.array.length/((t=r.stride)!==null&&t!==void 0?t:1):i.array.length/((e=i.stride)!==null&&e!==void 0?e:3)},n.prototype.getPositionByIndex=function(t,e){var r,i,a,o,s=this.indices,l=this.position,u=t;if(s){var c=s.array,f=(r=s.stride)!==null&&r!==void 0?r:1,m=(i=s.offset)!==null&&i!==void 0?i:0;u=c[t*f+m]}var A=l.array,h=(a=l.stride)!==null&&a!==void 0?a:3,p=(o=l.offset)!==null&&o!==void 0?o:0;return u=u*h+p,e.x=A[u],e.y=A[u+1],e.z=A[u+2],e},n.prototype.createTree=function(t,e,r){throw new Error("not implemented")},n.prototype.trianglesInSphere=function(t,e){throw new Error("not implemented")},n.prototype.intersectRay=function(t,e,r,i){throw new Error("not implemented")},n}(),Cn=function(){function n(t,e,r,i,a){this.id=t,this.extents=e,this.startIndex=r,this.endIndex=i,this.deepth=a}return n}(),Er=6*4+4+4+2+2;function J0(n,t){for(var e=new ArrayBuffer(t*Er),r=new Float32Array(e),i=new Uint32Array(e),a=new Uint16Array(e),o=[n],s,l;s=o.pop();)l=s.id*Er/4,r[l]=s.extents[0],r[l+1]=s.extents[1],r[l+2]=s.extents[2],r[l+3]=s.extents[3],r[l+4]=s.extents[4],r[l+5]=s.extents[5],i[l+6]=s.startIndex,i[l+7]=s.endIndex,l=s.id*Er/2,s.node0&&(a[l+16]=s.node0.id,o.push(s.node0)),s.node1&&(a[l+17]=s.node1.id,o.push(s.node1));return e}function X0(n,t,e,r,i,a,o,s,l){l===void 0&&(l=0),e=e-l,r=r-l,i=i-l,a=a+l,o=o+l,s=s+l;var u=0,c=0,f=0,m=0,A=0,h=0;return t.x>=0?(u=(e-n.x)*t.x,c=(a-n.x)*t.x):(u=(a-n.x)*t.x,c=(e-n.x)*t.x),t.y>=0?(f=(r-n.y)*t.y,m=(o-n.y)*t.y):(f=(o-n.y)*t.y,m=(r-n.y)*t.y),!(u>m||f>c||(f>u&&(u=f),m<c&&(c=m),t.z>=0?(A=(i-n.z)*t.z,h=(s-n.z)*t.z):(A=(s-n.z)*t.z,h=(i-n.z)*t.z),u>h||A>c)||(A>u&&(u=A),h<c&&(c=h),c<0))}var dn=function(){function n(t,e,r){this.x=t,this.y=e,this.z=r}return n.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},n.prototype.set=function(t,e,r){return this.x=t,this.y=e,this.z=r,this},n.prototype.fromArray=function(t,e){return e===void 0&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},n.prototype.toArray=function(t,e){return t===void 0&&(t=[]),e===void 0&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},n.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this},n.prototype.multiplyScalar=function(t){return this.x*=t,this.y*=t,this.z*=t,this},n.prototype.subVectors=function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},n.prototype.addScaledVector=function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},n.prototype.dot=function(t){return this.x*t.x+this.y*t.y+this.z*t.z},n.prototype.cross=function(t){var e=this.x,r=this.y,i=this.z;return this.x=r*t.z-i*t.y,this.y=i*t.x-e*t.z,this.z=e*t.y-r*t.x,this},n.prototype.crossVectors=function(t,e){var r=t.x,i=t.y,a=t.z,o=e.x,s=e.y,l=e.z;return this.x=i*l-a*s,this.y=a*o-r*l,this.z=r*s-i*o,this},n.prototype.distanceTo=function(t){return Math.sqrt(this.distanceToSquared(t))},n.prototype.distanceToSquared=function(t){var e=this.x-t.x,r=this.y-t.y,i=this.z-t.z;return e*e+r*r+i*i},n.prototype.clone=function(){return new n(this.x,this.y,this.z)},n}(),W0=function(){function n(t,e,r){this.triangle=t,this.intersectionPoint=e,this.index=r}return n}(),us=1e-6,Ue=new dn(0,0,0),Lr=new dn(0,0,0),Or=new dn(0,0,0),Vr=new dn(0,0,0),Z0=function(n){se(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.createTree=function(e,r,i){r=Math.min(r,16);var a=this.getPositionCount()/3,o=a>65535?new Uint32Array(a):new Uint16Array(a),s=new Float32Array(a*6),l=[],u=0,c=-1;if(i)for(var f=0,m=0,A=0,h=void 0,p=void 0,g=void 0,v=void 0,y=void 0,b=void 0,x=void 0;f<a;f+=1,m+=3,A+=6)o[f]=f,this.getPositionByIndex(m,Lr),this.getPositionByIndex(m+1,Or),this.getPositionByIndex(m+2,Vr),h=v=Lr.x,x=Or.x,x<h&&(h=x),x>v&&(v=x),x=Vr.x,x<h&&(h=x),x>v&&(v=x),p=y=Lr.y,x=Or.y,x<p&&(p=x),x>y&&(y=x),x=Vr.y,x<p&&(p=x),x>y&&(y=x),g=b=Lr.z,x=Or.z,x<g&&(g=x),x>b&&(b=x),x=Vr.z,x<g&&(g=x),x>b&&(b=x),s[A]=h,s[A+1]=p,s[A+2]=g,s[A+3]=v,s[A+4]=y,s[A+5]=b;else{for(var w=1/0,E=1/0,C=1/0,M=-1/0,R=-1/0,L=-1/0,f=0,m=0,A=0,h=void 0,p=void 0,g=void 0,v=void 0,y=void 0,b=void 0,x=void 0;f<a;f+=1,m+=3,A+=6)o[f]=f,this.getPositionByIndex(m,Lr),this.getPositionByIndex(m+1,Or),this.getPositionByIndex(m+2,Vr),h=v=Lr.x,x=Or.x,x<h&&(h=x),x>v&&(v=x),x=Vr.x,x<h&&(h=x),x>v&&(v=x),p=y=Lr.y,x=Or.y,x<p&&(p=x),x>y&&(y=x),x=Vr.y,x<p&&(p=x),x>y&&(y=x),g=b=Lr.z,x=Or.z,x<g&&(g=x),x>b&&(b=x),x=Vr.z,x<g&&(g=x),x>b&&(b=x),s[A]=h,s[A+1]=p,s[A+2]=g,s[A+3]=v,s[A+4]=y,s[A+5]=b,h<w&&(w=h),v>M&&(M=v),p<E&&(E=p),y>R&&(R=y),g<C&&(C=g),b>L&&(L=b);i=[w,E,C,M,R,L]}var S=new Cn(++c,i,0,a,0);l[u++]=S;var I=[],O=[0,1,2],P=function(V,D){return I[D]-I[V]};function F(V){var D=V.startIndex,z=V.endIndex,U=V.extents;I[0]=U[3]-U[0],I[1]=U[4]-U[1],I[2]=U[5]-U[2],O.sort(P);for(var H=0;H<3;H++){for(var K=O[H],j=U[K]+U[K+3],J=D,X=z-1,W=-1,Z=void 0;J<=X;)W===-1?(Z=o[J],s[Z*6+K]+s[Z*6+K+3]<j?J++:W=Z):(Z=o[X],s[Z*6+K]+s[Z*6+K+3]>=j||(o[J]=Z,o[X]=W,W=-1,J++),X--);if(J>D&&J<z){var ee=new Cn(++c,ls(o,s,D,J,us),D,J,V.deepth+1);ee.deepth<r&&ee.endIndex-ee.startIndex>e&&(l[u++]=ee);var Y=new Cn(++c,ls(o,s,J,z,us),J,z,V.deepth+1);Y.deepth<r&&Y.endIndex-Y.startIndex>e&&(l[u++]=Y),V.node0=ee,V.node1=Y,V.startIndex=0,V.endIndex=0;break}}}for(;u;)F(l[--u]);return this.offsetArray=o,this.rootNodePacked=J0(S,c+1),l.length=0,this},t.prototype.trianglesInSphere=function(e,r){for(var i=this.offsetArray,a=this.rootNodePacked,o=new Float32Array(a),s=new Uint32Array(a),l=new Uint16Array(a),u=[0],c=[],f,m,A,h;(f=u.pop())!==void 0;){h=f*Er/4;var p=sa(e.x,o[h],o[h+3])-e.x,g=sa(e.y,o[h+1],o[h+4])-e.y,v=sa(e.z,o[h+2],o[h+5])-e.z;if(p*p+g*g+v*v<=r*r){for(var y=s[h+6];y<s[h+7];y++)c.push(i[y]);h=f*Er/2,m=l[h+16],A=l[h+17],m&&u.push(m),A&&u.push(A)}}for(var b=c.length,x=new Float32Array(b*9),y=0;y<b;y++){var w=c[y];this.getPositionByIndex(w,Ue),x[y*9]=Ue.x,x[y*9+1]=Ue.y,x[y*9+2]=Ue.z,this.getPositionByIndex(w+1,Ue),x[y*9+3]=Ue.x,x[y*9+4]=Ue.y,x[y*9+5]=Ue.z,this.getPositionByIndex(w+2,Ue),x[y*9+6]=Ue.x,x[y*9+7]=Ue.y,x[y*9+8]=Ue.z}return x},t.prototype.intersectRay=function(e,r,i,a){for(var o=this.offsetArray,s=this.rootNodePacked,l=new Float32Array(s),u=new Uint32Array(s),c=new Uint16Array(s),f=new dn(1/r.x,1/r.y,1/r.z),m=[0],A,h,p,g;(A=m.pop())!==void 0;)if(g=A*Er/4,X0(e,f,l[g],l[g+1],l[g+2],l[g+3],l[g+4],l[g+5])){for(var v=u[g+6],y=u[g+7],b=void 0,x=void 0,w=void 0,E=e.x,C=e.y,M=e.z,R=r.x,L=r.y,S=r.z,I=void 0,O=void 0,P=void 0,F=void 0,V=void 0,D=void 0,z=void 0,U=void 0,H=void 0,K=void 0,j=void 0,J=void 0,X=void 0,W=void 0,Z=void 0,ee=void 0,Y=void 0,ie=void 0,te=void 0,le=void 0,oe=void 0,xe=void 0,he=void 0,Ae=void 0,Re=void 0,Se=void 0,Te=void 0;v<y;v++){if(b=o[v],x=b*3,this.getPositionByIndex(x,Ue),I=Ue.x,O=Ue.y,P=Ue.z,this.getPositionByIndex(x+1,Ue),F=Ue.x,V=Ue.y,D=Ue.z,this.getPositionByIndex(x+2,Ue),z=Ue.x,U=Ue.y,H=Ue.z,K=F-I,j=V-O,J=D-P,X=z-I,W=U-O,Z=H-P,ee=j*Z-J*W,Y=J*X-K*Z,ie=K*W-j*X,he=R*ee+L*Y+S*ie,he>0)xe=1;else if(he<0)xe=-1,he=-he;else continue;te=E-I,le=C-O,oe=M-P,Ae=xe*(R*(le*Z-oe*W)+L*(oe*X-te*Z)+S*(te*W-le*X)),!(Ae<0)&&(Re=xe*(R*(j*oe-J*le)+L*(J*te-K*oe)+S*(K*le-j*te)),!(Re<0)&&(Ae+Re>he||(Se=-xe*(te*ee+le*Y+oe*ie),!(Se<0)&&(Te=Se/he,a.push(new W0([I,O,P,F,V,D,z,U,H],[E+R*Te,C+L*Te,M+S*Te],b))))))}g=A*Er/2,h=c[g+16],p=c[g+17],h&&m.push(h),p&&m.push(p)}return a},t}(_0);function sa(n,t,e){return n<t?t:n>e?e:n}function ls(n,t,e,r,i){if(e>=r)return[0,0,0,0,0,0];for(var a=1/0,o=1/0,s=1/0,l=-1/0,u=-1/0,c=-1/0,f=e,m=void 0,A=void 0;f<r;f++)m=n[f]*6,A=t[m],A<a&&(a=A),A=t[m+1],A<o&&(o=A),A=t[m+2],A<s&&(s=A),A=t[m+3],A>l&&(l=A),A=t[m+4],A>u&&(u=A),A=t[m+5],A>c&&(c=A);return[a-i,o-i,s-i,l+i,u+i,c+i]}var cs=1e-6,Hd=["x","y","z"],ut=new dn(0,0,0),Y0=function(n){se(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.createTree=function(e,r,i){r=Math.min(r,16);var a=this.getPositionByIndex.bind(this),o=this.getPositionCount(),s=o>65535?new Uint32Array(o):new Uint16Array(o),l=[],u=0,c=-1;if(i)for(var f=0;f<o;f+=1)s[f]=f;else{a(0,ut);for(var m=ut.x,A=ut.y,h=ut.z,p=m,g=A,v=h,f=0,y=void 0,b=void 0,x=void 0;f<o;f+=1)s[f]=f,a(f,ut),y=ut.x,b=ut.y,x=ut.z,y<m?m=y:y>p&&(p=y),b<A?A=b:b>g&&(g=b),x<h?h=x:x>v&&(v=x);i=[m,A,h,p,g,v]}var w=new Cn(++c,i,0,o,0);l[u++]=w;var E=[],C=[0,1,2],M=function(L,S){return E[S]-E[L]};function R(L){var S=L.startIndex,I=L.endIndex,O=L.extents;E[0]=O[3]-O[0],E[1]=O[4]-O[1],E[2]=O[5]-O[2];for(var P=C.sort(M)[0],F=Hd[P],V=(O[P]+O[P+3])/2,D=S,z=I-1,U=-1,H;D<=z;)U===-1?(H=s[D],a(H,ut),ut[F]<V?D++:U=H):(H=s[z],a(H,ut),ut[F]>=V||(s[D]=H,s[z]=U,U=-1,D++),z--);if(D>S){var K=O.slice();K[P+3]=V+cs;var j=new Cn(++c,K,S,D,L.deepth+1);j.deepth<r&&j.endIndex-j.startIndex>e&&(l[u++]=j),L.node0=j}if(I>D){var J=O.slice();J[P]=V-cs;var X=new Cn(++c,J,D,I,L.deepth+1);X.deepth<r&&X.endIndex-X.startIndex>e&&(l[u++]=X),L.node1=X}L.startIndex=0,L.endIndex=0}for(;u;)R(l[--u]);return this.offsetArray=s,this.rootNodePacked=J0(w,c+1),l.length=0,this},t.prototype.intersectRay=function(e,r,i,a){for(var o=this.offsetArray,s=this.rootNodePacked,l=new Float32Array(s),u=new Uint32Array(s),c=new Uint16Array(s),f=i*i,m=new dn(1/r.x,1/r.y,1/r.z),A=[0],h,p,g,v;(h=A.pop())!==void 0;)if(v=h*Er/4,X0(e,m,l[v],l[v+1],l[v+2],l[v+3],l[v+4],l[v+5],i)){for(var y=u[v+6],b=u[v+7],x=void 0,w=void 0,E=void 0,C=void 0,M=void 0,R=void 0,L=void 0,S=void 0,I=void 0,O=void 0,P=void 0,F=void 0;y<b;y++)x=o[y],this.getPositionByIndex(x,ut),w=ut.x,E=ut.y,C=ut.z,M=e.x,R=e.y,L=e.z,S=r.x,I=r.y,O=r.z,P=S*(w-M)+I*(E-R)+O*(C-L),P>0&&(M+=S*P,R+=I*P,L+=O*P),S=w-M,I=E-R,O=C-L,P=S*S+I*I+O*O,P<=f&&a.push(new W0([w,E,C,w,E,C,w,E,C],[M,R,L],x));v=h*Er/2,p=c[v+16],g=c[v+17],p&&A.push(p),g&&A.push(g)}return a},t}(_0);const $0="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO3ZhciBlcj1mdW5jdGlvbihlLHIpe3JldHVybiBlcj1PYmplY3Quc2V0UHJvdG90eXBlT2Z8fHtfX3Byb3RvX186W119aW5zdGFuY2VvZiBBcnJheSYmZnVuY3Rpb24odCxvKXt0Ll9fcHJvdG9fXz1vfXx8ZnVuY3Rpb24odCxvKXtmb3IodmFyIGYgaW4gbylPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwobyxmKSYmKHRbZl09b1tmX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ZGUwLmlkLHYucHVzaChuLm5vZGUwKSksbi5ub2RlMSYmKGRbcysxN109bi5ub2RlMS5pZCx2LnB1c2gobi5ub2RlMSkpO3JldHVybiB0fWZ1bmN0aW9uIGNyKGUscix0LG8sZixkLHYsbixzKXtzPT09dm9pZCAwJiYocz0wKSx0PXQtcyxvPW8tcyxmPWYtcyxkPWQrcyx2PXYrcyxuPW4rczt2YXIgdT0wLHc9MCx5PTAscD0wLGE9MCxoPTA7cmV0dXJuIHIueD49MD8odT0odC1lLngpKnIueCx3PShkLWUueCkqci54KToodT0oZC1lLngpKnIueCx3PSh0LWUueCkqci54KSxyLnk+PTA/KHk9KG8tZS55KSpyLnkscD0odi1lLnkpKnIueSk6KHk9KHYtZS55KSpyLnkscD0oby1lLnkpKnIueSksISh1PnB8fHk+d3x8KHk+dSYmKHU9eSkscDx3JiYodz1wKSxyLno+PTA/KGE9KGYtZS56KSpyLnosaD0obi1lLnopKnIueik6KGE9KG4tZS56KSpyLnosaD0oZi1lLnopKnIueiksdT5ofHxhPncpfHwoYT51JiYodT1hKSxoPHcmJih3PWgpLHc8MCkpfXZhciBZPWZ1bmN0aW9uKCl7ZnVuY3Rpb24gZShyLHQsbyl7dGhpcy54PXIsdGhpcy55PXQsdGhpcy56PW99cmV0dXJuIGUucHJvdG90eXBlLmNvcHk9ZnVuY3Rpb24ocil7cmV0dXJuIHRoaXMueD1yLngsdGhpcy55PXIueSx0aGlzLno9ci56LHRoaXN9LGUucHJvdG90eXBlLnNldD1mdW5jdGlvbihyLHQsbyl7cmV0dXJuIHRoaXMueD1yLHRoaXMueT10LHRoaXMuej1vLHRoaXN9LGUucHJvdG90eXBlLmZyb21BcnJheT1mdW5jdGlvbihyLHQpe3JldHVybiB0PT09dm9pZCAwJiYodD0wKSx0aGlzLng9clt0XSx0aGlzLnk9clt0KzFdLHRoaXMuej1yW3QrMl0sdGhpc30sZS5wcm90b3R5cGUudG9BcnJheT1mdW5jdGlvbihyLHQpe3JldHVybiByPT09dm9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aW4gcy5hdHRyaWJ1dGVzKXt2YXIgeT1zLmF0dHJpYnV0ZXNbd107eSYmeS5idWZmZXIgaW5zdGFuY2VvZiBBcnJheUJ1ZmZlciYmby5hZGQoeS5idWZmZXIpfXU9cy5pbmRpY2VzLHUmJnUuYnVmZmVyIGluc3RhbmNlb2YgQXJyYXlCdWZmZXImJm8uYWRkKHUuYnVmZmVyKSx1PXMub2Zmc2V0QXJyYXksdSYmdS5idWZmZXIgaW5zdGFuY2VvZiBBcnJheUJ1ZmZlciYmby5hZGQodS5idWZmZXIpLG8uYWRkKHMucm9vdE5vZGVQYWNrZWQpfXJldHVybntvdXRwdXQ6dCx0cmFuc2ZlcjpBcnJheS5mcm9tKG8pfX0pfSl9KSgpOwo=",qd=n=>Uint8Array.from(atob(n),t=>t.charCodeAt(0)),ds=typeof self!="undefined"&&self.Blob&&new Blob([qd($0)],{type:"text/javascript;charset=utf-8"});function Gd(n){let t;try{if(t=ds&&(self.URL||self.webkitURL).createObjectURL(ds),!t)throw"";const e=new Worker(t,{name:n==null?void 0:n.name});return e.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),e}catch(e){return new Worker("data:text/javascript;base64,"+$0,{name:n==null?void 0:n.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var eu=function(){function n(t,e){this.pool=e,this.workerCreator=t,this.queue=[],this.workers=[],this.workersResolver=[],this.workerStatus=0}return n.prototype.initWorker=function(t){if(this.workerCreator&&!this.workers[t]){var e=this.workerCreator();e.addEventListener("message",this.onMessage.bind(this,t)),this.workers[t]=e}},n.prototype.getIdleWorker=function(){for(var t=0;t<this.pool;t++)if(!(this.workerStatus&1<<t))return t;return-1},n.prototype.onMessage=function(t,e){var r=this.workersResolver[t],i=r.resolve,a=r.reject;if(e.data&&"$$error"in e.data?a(e.data.$$error):i(e.data),this.queue.length){var o=this.queue.shift(),s=o.resolve,l=o.reject,u=o.input,c=o.transfer;this.workersResolver[t]={resolve:s,reject:l},this.workers[t].postMessage(u,c)}else this.workerStatus^=1<<t},n.prototype.postMessage=function(t,e){var r=this;return e===void 0&&(e=[]),new Promise(function(i,a){var o=r.getIdleWorker();o!==-1?(r.initWorker(o),r.workerStatus|=1<<o,r.workersResolver[o]={resolve:i,reject:a},r.workers[o].postMessage(t,e)):r.queue.push({resolve:i,reject:a,input:t,transfer:e})})},n.prototype.dispose=function(){this.workers.forEach(function(t){return t.terminate()}),this.workersResolver.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0},n}(),Kd=new eu(function(){return new Gd},4),jd=new Map,Mn=new d.Ray,fs=new d.Matrix3,Gn=new d.Matrix4,tu=new d.Vector3,_d=new d.Vector3,Jd=new d.Vector3,Xd=new d.Triangle;function Wd(n,t,e,r){var i,a=n.matrixWorld;Gn.getInverse(a),Mn.copy(e.ray).applyMatrix4(Gn);for(var o=t.intersectRay(Mn.origin,Mn.direction,0,[]),s=n.geometry,l=n.material,u=s.groups,c=s.index,f=0,m=o.length;f<m;f++){var A=o[f],h=A.triangle,p=A.index,g=A.intersectionPoint,v=new d.Vector3(g[0],g[1],g[2]).applyMatrix4(a),y=e.ray.origin.distanceTo(v);if(!(y<e.near||y>e.far)){var b=void 0;if(Array.isArray(l)){if(u)for(var x=p*3,w=0,E=u;w<E.length;w++){var C=E[w];if(x>=C.start&&x-C.start<C.count){b=l[(i=C.materialIndex)!==null&&i!==void 0?i:0];break}}}else b=l;if(b){var M=Xd.set(tu.set(h[0],h[1],h[2]).applyMatrix4(a),_d.set(h[3],h[4],h[5]).applyMatrix4(a),Jd.set(h[6],h[7],h[8]).applyMatrix4(a)).getNormal(new d.Vector3),R=p*3,L=new d.Face3(c?c.array[R]:R,c?c.array[R+1]:R+1,c?c.array[R+2]:R+2,M),S=e.ray.direction.dot(M);b.side===d.FrontSide&&S>=0||b.side===d.BackSide&&S<=0||r.push({distance:y,object:n,face:L,point:v,distanceToRay:0,faceIndex:p})}}}}function Zd(n,t,e,r){var i,a,o=n.matrixWorld;fs.getNormalMatrix(o),Gn.getInverse(o);var s=((a=(i=e.params.Points)===null||i===void 0?void 0:i.threshold)!==null&&a!==void 0?a:1)*Gn.getMaxScaleOnAxis();Mn.copy(e.ray).applyMatrix4(Gn);for(var l=t.intersectRay(Mn.origin,Mn.direction,s,[]),u=n.geometry,c=u.index,f=u.getAttribute("normal"),m=0,A=l.length;m<A;m++){var h=l[m],p=h.triangle,g=h.index,v=h.intersectionPoint,y=new d.Vector3(v[0],v[1],v[2]).applyMatrix4(o),b=e.ray.origin.distanceTo(y);if(!(b<e.near||b>e.far)){var x=tu.set(p[0],p[1],p[2]).applyMatrix4(o),w=c?c.array[g]:g,E=void 0;if(f instanceof d.BufferAttribute){var C=new d.Vector3().fromBufferAttribute(f,w).applyNormalMatrix(fs);E=new d.Face3(w,w,w,C)}r.push({distance:b,object:n,face:E,point:y,distanceToRay:y.distanceTo(x),index:g})}}}var ru="__bvh_mesh__",Yd=d.Mesh.prototype.raycast;function $d(n,t){var e=ef(this);e?Wd(this,e,n,t):Yd.call(this,n,t)}function ef(n){var t=n[ru];return t instanceof Z0,t}function tf(n,t){var e;Object.assign(n,(e={},e[ru]=t,e.raycast=$d,e))}var nu="__bvh_points__",rf=d.Points.prototype.raycast;function nf(n,t){var e=af(this);e?Zd(this,e,n,t):rf.call(this,n,t)}function af(n){var t=n[nu];return t instanceof Y0,t}function of(n,t){var e;Object.assign(n,(e={},e[nu]=t,e.raycast=nf,e))}function sf(n,t,e,r){var i=[];return n.traverse(function(a){(a instanceof d.Mesh||a instanceof d.Points)&&a.geometry instanceof d.BufferGeometry&&i.push(a)}),Promise.resolve().then(function(){for(var a=[],o=new Set,s=null,l=0;l<i.length;l++){var u=i[l],c=u.geometry;if(c instanceof d.BufferGeometry){var f=void 0;if(u instanceof d.Mesh?f="mesh":u instanceof d.Points&&(f="points"),!!f){var m=c.boundingBox,A=m?[m.min.x,m.min.y,m.min.z,m.max.x,m.max.y,m.max.z]:void 0,h={};for(var p in c.attributes){var g=c.attributes[p];g instanceof d.InterleavedBufferAttribute?(h[p]={array:g.data.array,stride:g.data.stride,offset:g.offset},s=g.data.array,s&&s.buffer instanceof ArrayBuffer&&o.add(s.buffer)):(h[p]={array:g.array},s=g.array,s&&s.buffer instanceof ArrayBuffer&&o.add(s.buffer))}var v=void 0,y=c.getIndex();y&&(y instanceof d.InterleavedBufferAttribute?(v={array:y.data.array,stride:y.data.stride,offset:y.offset},s=y.data.array,s&&s.buffer instanceof ArrayBuffer&&o.add(s.buffer)):(v={array:y.array},s=y.array,s&&s.buffer instanceof ArrayBuffer&&o.add(s.buffer)));var b={type:f,attributes:h,indices:v,maxItemPerNode:e,maxTreeDepth:r,extents:A};a.push(b)}}}return Kd.postMessage(a,Array.from(o))}).then(function(a){for(var o=0;o<i.length;o++){var s=i[o],l=s.geometry,u=a[o];if(l instanceof d.BufferGeometry){for(var c in u.attributes){var f=u.attributes[c].array,m=l.attributes[c];m instanceof d.InterleavedBufferAttribute?m.data.array=f:m.array=f}var A=l.getIndex();if(A&&u.indices){var f=u.indices.array;A instanceof d.InterleavedBufferAttribute?A.data.array=f:A.array=f}if(s instanceof d.Mesh){var h=new Z0(u.attributes.position,u.indices);h.offsetArray=u.offsetArray,h.rootNodePacked=u.rootNodePacked,tf(s,h)}else if(s instanceof d.Points){var h=new Y0(u.attributes.position,u.indices);h.offsetArray=u.offsetArray,h.rootNodePacked=u.rootNodePacked,of(s,h)}}}return n})}var iu=function(n){se(t,n);function t(e,r,i){i===void 0&&(i=Q);var a=n.call(this)||this;return a.contentObject=r,a.disposer=i,a.name=e,a.materials=[],a.pbmObjects=[],a.disposers=[i],a.add(r),r.traverse(function(o){var s;if(o instanceof d.Mesh||o instanceof d.Points){var l=o.material;Array.isArray(l)?(s=a.materials).push.apply(s,l):a.materials.push(l)}(o instanceof Tt||o instanceof er)&&a.pbmObjects.push(o)}),a}return t.prototype.generateBvhTree=function(){return sf(this,!0,200,10)},t.prototype.intersectRaycaster=function(e,r,i){r===void 0&&(r=!0),i===void 0&&(i=[]);for(var a=this.children.slice(),o,s=[];o=a.pop();)if(o.visible){o.raycast(e,s);for(var l=0,u=o.children.length;l<u;l++)a.push(o.children[l])}return s.forEach(function(c){var f=0;if((c.object instanceof Tt||c.object instanceof er)&&c.face){var m=Array.isArray(c.object.material)?c.object.material[c.face.materialIndex]:c.object.material;m&&(f=m.floor)}c.floor=f}),r&&s.sort(function(c,f){return c.distance-f.distance}),i.push.apply(i,s),i},t.prototype.update=function(e,r,i,a){for(var o=0,s=this.pbmObjects;o<s.length;o++){var l=s[o];l.update(e,r,i,a)}},t.prototype.dispose=function(){for(var e=0,r=this.disposers;e<r.length;e++){var i=r[e];i()}this.disposers.length=0,this.pbmObjects.length=0},t.prototype.clone=function(){return new t(this.name,this.contentObject,this.disposer)},t}(d.Object3D);function at(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=[];n=n.map(function(s){return(s!=null?s:"").trim()}).filter(function(s){return s.length>0&&!/^\/+$/.test(s)});for(var r=0;r<n.length;r++){var i=r===0,a=r===n.length-1,o=n[r];i||(o=o.replace(/^\.\//,"").replace(/^\/+/,"")),a||(o=o.replace(/\/+$/,"")),e.push(o)}return e.join("/")}function xi(n){var t,e=/^(http\:|https\:|file\:)?\/\/[^/]/.exec(n);if(!e)return n;var r=e[1]||"",i=n.slice(r.length+2),a=i.indexOf("#");a>=0&&(n.slice(a),i=n.slice(0,a));var o=i.indexOf("?");o>=0&&(n.slice(o),i=n.slice(0,o));for(var s=i.split("/"),l=s.shift(),u=(t=s.pop())!==null&&t!==void 0?t:"",c=[],f=0,m=s;f<m.length;f++){var A=m[f];if(!(A===""||A===".")){if(A===".."){c.pop();continue}c.push(A)}}return r+"//"+l+"/"+c.join("/")+"/"+u}function Cr(n){return n.indexOf("//")===0||/^[0-9a-z]+\:/i.test(n)}function au(n,t,e){if(n.content&&n.content.uri&&(Cr(n.content.uri)||(n.content.uri=xi(at(t,n.content.uri)))),n.transform){for(var r=!1,i=0;i<16;i++){var a=n.transform[i];if(typeof a!="number"||isNaN(a)||!isFinite(a)){r=!0;break}}if(n.transform[15]===0&&(r=!0),r)throw new Error("Invalid Tile Transform: "+JSON.stringify(n.transform))}if(n.children)for(var o=0,s=n.children;o<s.length;o++){var l=s[o];au(l,t)}return n}function wi(n,t){if(n.asset||(n.asset={}),n.rootMeta||(n.rootMeta={}),n.asset.overview){var e=n.asset.overview;Cr(e.imageFile)||(e.imageFile=xi(at(t,e.imageFile))),Cr(e.worldFile)||(e.worldFile=xi(at(t,e.worldFile)))}if(n.asset.trajectories)for(var r=0;r<n.asset.trajectories.list.length;r++){var i=n.asset.trajectories.list[r];i.file=xi(at(t,i.file))}return au(n.root,t),n}function uf(n,t,e){for(var r,i,a=Promise.resolve(),o=n.slice(),s=function(){for(var l=[],u=0,c=void 0;c=o.shift();){l.push(c);var f=((r=c.image)===null||r===void 0?void 0:r.width)*((i=c.image)===null||i===void 0?void 0:i.height);if(!isNaN(f)&&isFinite(f)&&(u+=f),u>=e)break}a=a.then(function(){return new Promise(function(m){dt.shared.add(function(){for(var A=0,h=l;A<h.length;A++){var p=h[A];t.initTexture(p)}m()},!0)})}).catch(function(){})};o.length>0;)s();return a}function mo(n,t){if(t===void 0&&(t=""),(t[0]==="?"||t[0]==="&")&&(t=t.slice(1)),!t)return n;var e=n.indexOf("#"),r="";return e>=0&&(r=n.slice(e),n=n.slice(0,e)),(n[n.length-1]==="?"||n[n.length-1]==="&")&&(n=n.slice(0,-1)),n.indexOf("?")>=0?"".concat(n,"&").concat(t).concat(r):"".concat(n,"?").concat(t).concat(r)}var ua=4;function ou(n,t,e){var r=new DataView(t);if(n.magic=r.getUint32(e,!0),e+=ua,n.version=r.getUint32(e,!0),e+=ua,n.byteLength=r.getUint32(e,!0),e+=ua,n.version!==1)throw new Error("3D Tile Version ".concat(n.version," not supported"));return e}var sr,We;(function(n){n[n.BYTE=5120]="BYTE",n[n.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",n[n.SHORT=5122]="SHORT",n[n.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",n[n.INT=5124]="INT",n[n.UNSIGNED_INT=5125]="UNSIGNED_INT",n[n.FLOAT=5126]="FLOAT",n[n.DOUBLE=5130]="DOUBLE"})(We||(We={}));var lf=(sr={},sr[We.DOUBLE]=Float64Array,sr[We.FLOAT]=Float32Array,sr[We.UNSIGNED_SHORT]=Uint16Array,sr[We.UNSIGNED_INT]=Uint32Array,sr[We.UNSIGNED_BYTE]=Uint8Array,sr[We.BYTE]=Int8Array,sr[We.SHORT]=Int16Array,sr[We.INT]=Int32Array,sr),cf={DOUBLE:We.DOUBLE,FLOAT:We.FLOAT,UNSIGNED_SHORT:We.UNSIGNED_SHORT,UNSIGNED_INT:We.UNSIGNED_INT,UNSIGNED_BYTE:We.UNSIGNED_BYTE,BYTE:We.BYTE,SHORT:We.SHORT,INT:We.INT};function Fi(n){var t=lf[n];if(!t)throw new Error("Failed to convert GL type");return t}function la(n){var t=Fi(n);return t.BYTES_PER_ELEMENT}function hs(n,t,e,r){e===void 0&&(e=0);var i=Fi(n);if(e%la(n)!==0){var a=r?t.slice(e,e+r*la(n)):t.slice(e);return new i(a)}else return new i(t,e,r!=null?r:(t.byteLength-e)/la(n))}function df(n){var t=cf[n];if(!t)throw new Error("Failed to convert GL type");return t}var su=function(){function n(t,e){this.featuresLength=0,this.cachedTypedArrays={},this.json=t,this.buffer=e;var r=this.getGlobalProperty("POINTS_LENGTH",We.UNSIGNED_INT,1);r&&r.length&&(this.featuresLength=r[0])}return n.prototype.getExtension=function(t){return this.json.extensions&&this.json.extensions[t]},n.prototype.hasProperty=function(t){return!!this.json[t]},n.prototype.getGlobalProperty=function(t,e,r){var i=this.json[t];if(typeof i=="number"){var a=Fi(e);return new a([i])}else if(Array.isArray(i)){var a=Fi(e);return new a(i)}else if(i&&Number.isFinite(i.byteOffset))return this.getTypedArrayFromBinary(t,e,r,1,i.byteOffset);return null},n.prototype.getPropertyArray=function(t,e,r){var i=this.json[t];return i&&Number.isFinite(i.byteOffset)?("componentType"in i&&(e=df(i.componentType)),this.getTypedArrayFromBinary(t,e,r,this.featuresLength,i.byteOffset)):this.getTypedArrayFromArray(t,e,i)},n.prototype.getProperty=function(t,e,r,i,a){var o=this.json[t];if(!o)return null;var s=this.getPropertyArray(t,e,r);if(r===1)return a[0]=s[i],a;for(var l=0;l<r;++l)a[l]=s[r*i+l];return a},n.prototype.getTypedArrayFromBinary=function(t,e,r,i,a){var o=this.cachedTypedArrays,s=o[t];return s||(s=hs(e,this.buffer.buffer,this.buffer.byteOffset+a,i*r),o[t]=s),s},n.prototype.getTypedArrayFromArray=function(t,e,r){var i=this.cachedTypedArrays,a=i[t];return a||(a=hs(e,r),i[t]=a),a},n}(),yn=4,ps="b3dm tile in legacy format.";function uu(n,t,e){var r=new TextDecoder("utf8"),i=new Uint8Array(n,t,e),a=r.decode(i);return a}function lu(n,t,e){return e=ff(n,t,e),e=hf(n,t,e),e=pf(n,t,e),e}function ff(n,t,e){var r=new DataView(t),i=0;n.header=n.header||{};var a=r.getUint32(e,!0);e+=yn;var o=r.getUint32(e,!0);e+=yn;var s=r.getUint32(e,!0);e+=yn;var l=r.getUint32(e,!0);return e+=yn,s>=570425344?(e-=yn*2,i=a,s=o,l=0,a=0,o=0,console.warn(ps)):l>=570425344&&(e-=yn,i=s,s=a,l=o,a=0,o=0,console.warn(ps)),n.header.featureTableJsonByteLength=a,n.header.featureTableBinaryByteLength=o,n.header.batchTableJsonByteLength=s,n.header.batchTableBinaryByteLength=l,n.header.batchLength=i,e}function hf(n,t,e){var r=n.header||{},i=r.featureTableJsonByteLength,a=r.featureTableBinaryByteLength,o=r.batchLength;if(n.featureTableJson={BATCH_LENGTH:o||0},i&&i>0){var s=uu(t,e,i);n.featureTableJson=JSON.parse(s)}e+=i||0,n.featureTableBinary=new Uint8Array(t,e,a),e+=a||0,n.rtcCenter=[0,0,0];var l=new su(n.featureTableJson,n.featureTableBinary);if(Array.isArray(l.json.RTC_CENTER)){var u=l.json.RTC_CENTER;n.rtcCenter[0]=u[0],n.rtcCenter[1]=u[1],n.rtcCenter[2]=u[2]}else{var u=l.getGlobalProperty("RTC_CENTER",We.FLOAT,3);u&&(n.rtcCenter[0]=u[0],n.rtcCenter[1]=u[1],n.rtcCenter[2]=u[2])}return e}function pf(n,t,e){var r=n.header||{},i=r.batchTableJsonByteLength,a=r.batchTableBinaryByteLength;if(i&&i>0){var o=uu(t,e,i);n.batchTableJson=JSON.parse(o),e+=i,a&&a>0&&(n.batchTableBinary=new Uint8Array(t,e,a),n.batchTableBinary=new Uint8Array(n.batchTableBinary),e+=a)}return e}function vf(n,t,e){var r=e!==void 0?new Uint8Array(n).subarray(t,t+e):new Uint8Array(n).subarray(t),i=new Uint8Array(r);return i.buffer}function mf(n,t,e){var r=n.byteLength-e;if(r===0)throw new Error("glTF byte length must be greater than 0.");return e%4!==0&&console.warn("".concat(n.type,": embedded glb is not aligned to a 4-byte boundary.")),n.gltfArrayBuffer=vf(t,e,r),n.byteLength}function qa(n){if(typeof TextDecoder!="undefined")return new TextDecoder().decode(n);for(var t="",e=0,r=n.length;e<r;e++)t+=String.fromCharCode(n[e]);try{return decodeURIComponent(escape(t))}catch(i){return t}}var Oe={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},Vn={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},ki={9728:d.NearestFilter,9729:d.LinearFilter,9984:d.NearestMipmapNearestFilter,9985:d.LinearMipmapNearestFilter,9986:d.NearestMipmapLinearFilter,9987:d.LinearMipmapLinearFilter},Li={33071:d.ClampToEdgeWrapping,33648:d.MirroredRepeatWrapping,10497:d.RepeatWrapping},vs={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},kt={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Nr={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},Af={CUBICSPLINE:void 0,LINEAR:d.InterpolateLinear,STEP:d.InterpolateDiscrete},yr={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function vt(n){var t=[];for(var e in n)t.push(n[e]);return t}function gf(n){var t=Array.from(n);return function(){for(var e=0,r=t;e<r.length;e++){var i=r[e];typeof i.dispose=="function"&&i.dispose(),typeof i.close=="function"&&i.close()}}}var yf=function(){function n(t,e,r){this.json=t,this.extensions=e,this.options=r,this.cache=new Map,this.disposeSet=new Set,this.textureSet=new Set,this.nodeNamesUsed={}}return n.prototype.dispose=function(){this.cache.clear(),this.disposeSet.forEach(function(t){typeof t.dispose=="function"&&t.dispose(),typeof t.close=="function"&&t.close()}),this.disposeSet.clear(),this.textureSet.clear(),this.extensions={},this.json={asset:{version:"unknown"}}},n.prototype.markDefs=function(){for(var t=this.json.nodes||[],e=this.json.skins||[],r=this.json.meshes||[],i=0,a=e.length;i<a;i++)for(var o=e[i].joints,s=0,l=o.length;s<l;s++)t[o[s]].isBone=!0;for(var u=0,c=t.length;u<c;u++){var f=t[u];f.mesh!==void 0&&f.skin!==void 0&&(r[f.mesh].isSkinnedMesh=!0)}},n.prototype.parse=function(){var t=this,e=this.json,r=this.extensions;this.markDefs();for(var i=0,a=vt(r);i<a.length;i++){var o=a[i];o.markDefs(this)}return Promise.all(vt(r).map(function(s){return s.prepare(t)})).then(function(){var s,l,u;return Promise.all([Promise.all(((s=e.scenes)!==null&&s!==void 0?s:[]).map(function(c,f){return t.loadScene(f)})),Promise.all(((l=e.animations)!==null&&l!==void 0?l:[]).map(function(c,f){return t.loadAnimation(f)})),Promise.all(((u=e.cameras)!==null&&u!==void 0?u:[]).map(function(c,f){return t.loadCamera(f)}))])}).then(function(s){var l=s[0],u=s[1],c=s[2],f={json:e,scene:l[e.scene||0],scenes:l,animations:u,cameras:c,textures:[],dispose:Q};return f}).then(function(s){return Promise.all(vt(r).map(function(l){return l.emitResult(s,t)})).then(function(){return s})}).then(function(s){var l=Array.from(t.textureSet),u=gf(t.disposeSet);return Object.assign(s,{textures:l,dispose:u}),t.textureSet.clear(),t.disposeSet.clear(),t.dispose(),s})},n.prototype.loadCamera=function(t){var e="camera:"+t,r=this.cache.get(e);if(r)return r;for(var i=null,a=0,o=vt(this.extensions);a<o.length;a++){var s=o[a];if(i=s.loadCamera(t,this),i)break}if(!i){var l=void 0,u=this.json.cameras[t],c=u[u.type];c?u.type==="perspective"?l=new d.PerspectiveCamera(d.MathUtils.radToDeg(c.yfov),c.aspectRatio||1,c.znear||1,c.zfar||2e6):u.type==="orthographic"?l=new d.OrthographicCamera(-c.xmag,c.xmag,c.ymag,-c.ymag,c.znear,c.zfar):(console.warn("glTF: Invalid camera type ".concat(u.type,".")),l=new d.Camera):(console.warn("glTF: Missing camera parameters."),l=new d.Camera),u.name&&(l.name=this.createUniqueName(u.name)),i=Promise.resolve(l)}return this.cache.set(e,i),i},n.prototype.loadSkin=function(t){var e="animation:"+t,r=this.cache.get(e);if(r)return r;var i,a=this.json.skins[t],o={joints:a.joints};return a.inverseBindMatrices===void 0?i=Promise.resolve(o):i=this.loadAccessor(a.inverseBindMatrices).then(function(s){return s&&(o.inverseBindMatrices=s),o}),this.cache.set(e,i),i},n.prototype.loadAnimation=function(t){var e="animation:"+t,r=this.cache.get(e);if(r)return r;for(var i=null,a=0,o=vt(this.extensions);a<o.length;a++){var s=o[a];if(i=s.loadAnimation(t,this),i)break}if(!i){for(var l=this.json,u=l.animations[t],c=[],f=[],m=[],A=[],h=[],p=0,g=u.channels.length;p<g;p++){var v=u.channels[p],y=u.samplers[v.sampler],b=v.target,x=b.node!==void 0?b.node:b.id,w=u.parameters!==void 0?u.parameters[y.input]:y.input,E=u.parameters!==void 0?u.parameters[y.output]:y.output;c.push(this.loadNode(x)),f.push(this.loadAccessor(w)),m.push(this.loadAccessor(E)),A.push(y),h.push(b)}i=Promise.all([Promise.all(c),Promise.all(f),Promise.all(m),Promise.all(A),Promise.all(h)]).then(function(C){for(var M=C[0],R=C[1],L=C[2],S=C[3],I=C[4],O=[],P=function(z,U){var H=M[z],K=R[z],j=L[z],J=S[z],X=I[z];if(H===void 0)return"continue";H.updateMatrix(),H.matrixAutoUpdate=!0;var W=void 0;switch(Nr[X.path]){case Nr.weights:W=d.NumberKeyframeTrack;break;case Nr.rotation:W=d.QuaternionKeyframeTrack;break;case Nr.position:case Nr.scale:default:W=d.VectorKeyframeTrack;break}var Z=H.name?H.name:H.uuid,ee=J.interpolation!==void 0?Af[J.interpolation]:d.InterpolateLinear,Y=[];Nr[X.path]===Nr.weights?H.traverse(function(Ae){Ae.morphTargetInfluences&&Y.push(Ae.name?Ae.name:Ae.uuid)}):Y.push(Z);var ie=j.array;if(j.normalized){for(var te=ca(ie.constructor),le=new Float32Array(ie.length),oe=0,xe=ie.length;oe<xe;oe++)le[oe]=ie[oe]*te;ie=le}for(var oe=0,xe=Y.length;oe<xe;oe++){var he=new W(Y[oe]+"."+Nr[X.path],K.array,ie,ee);O.push(he)}},F=0,V=M.length;F<V;F++)P(F);var D=u.name?u.name:"animation_"+t;return new d.AnimationClip(D,void 0,O)})}return this.cache.set(e,i),i},n.prototype.loadBuffer=function(t){var e=this.json.buffers[t];if(e.type&&e.type!=="arraybuffer")throw new Error("glTF: "+e.type+" buffer type is not supported.");var r="buffer:"+t,i=this.cache.get(r);if(i)return i;for(var a=null,o=0,s=vt(this.extensions);o<s.length;o++){var l=s[o];if(a=l.loadBuffer(t,this),a)break}if(!a){var u=this.json.buffers[t];a=this.options.fetcher.ajax(this.resolveResouce(u.uri),{responseType:"arraybuffer"}).then(function(c){return c.body})}return this.cache.set(r,a),a},n.prototype.loadBufferView=function(t){var e="bufferView:"+t,r=this.cache.get(e);if(r)return r;for(var i=null,a=0,o=vt(this.extensions);a<o.length;a++){var s=o[a];if(i=s.loadBufferView(t,this),i)break}if(!i){var l=this.json.bufferViews[t];i=this.loadBuffer(l.buffer).then(function(u){var c=l.byteLength||0,f=l.byteOffset||0;return u.slice(f,f+c)})}return this.cache.set(e,i),i},n.prototype.loadAccessor=function(t){var e=this,r="accessor:"+t,i=this.cache.get(r);if(i)return i;var a=null;if(!a){var o=this.json.accessors[t];if(o.bufferView===void 0&&o.sparse===void 0)a=Promise.resolve(null);else{var s=[];o.bufferView!==void 0?s.push(this.loadBufferView(o.bufferView)):s.push(Promise.resolve(null)),o.sparse!==void 0&&(s.push(this.loadBufferView(o.sparse.indices.bufferView)),s.push(this.loadBufferView(o.sparse.values.bufferView))),a=Promise.all(s).then(function(l){var u=l[0],c=vs[o.type],f=Vn[o.componentType],m=f.BYTES_PER_ELEMENT,A=m*c,h=o.byteOffset||0,p=o.bufferView!==void 0?e.json.bufferViews[o.bufferView].byteStride:void 0,g=o.normalized===!0,v,y;if(p&&p!==A){var b=Math.floor(h/p),x="InterleavedBuffer:"+o.bufferView+":"+o.componentType+":"+b+":"+o.count,w=e.cache.get(x);w||(v=new f(u,b*p,o.count*p/m),w=new d.InterleavedBuffer(v,p/m),e.cache.set(x,w)),y=new d.InterleavedBufferAttribute(w,c,h%p/m,g)}else u===null?v=new f(o.count*c):v=new f(u,h,o.count*c),y=new d.BufferAttribute(v,c,g);if(o.sparse!==void 0){var E=vs.SCALAR,C=Vn[o.sparse.indices.componentType],M=o.sparse.indices.byteOffset||0,R=o.sparse.values.byteOffset||0,L=new C(l[1],M,o.sparse.count*E),S=new f(l[2],R,o.sparse.count*c);u!==null&&(y=new d.BufferAttribute(y.array.slice(),y.itemSize,y.normalized));for(var I=0,O=L.length;I<O;I++){var P=L[I];if(y.setX(P,S[I*c]),c>=2&&y.setY(P,S[I*c+1]),c>=3&&y.setZ(P,S[I*c+2]),c>=4&&y.setW(P,S[I*c+3]),c>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return y})}}return this.cache.set(r,a),a},n.prototype.createPrimitiveKey=function(t){for(var e=0,r=vt(this.extensions);e<r.length;e++){var i=r[e],a=i.createPrimitiveKey(t,this);if(a)return a}for(var o="",s=Object.keys(t.attributes).sort(),l=0,u=s.length;l<u;l++)o+=s[l]+":"+t.attributes[s[l]]+";";return t.indices+":"+o+":"+t.mode},n.prototype.loadGeometry=function(t){for(var e=this,r=null,i=0,a=vt(this.extensions);i<a.length;i++){var o=a[i];if(r=o.loadGeometry(t,this),r)break}return r||(r=this.addGeometryPrimitiveAttributes(new d.BufferGeometry,t)),r=r.then(function(s){return e.disposeSet.add(s),s}),r},n.prototype.loadImage=function(t){for(var e=this,r=null,i=0,a=vt(this.extensions);i<a.length;i++){var o=a[i];if(r=o.loadImage(t,this),r)break}if(!r){var s=this.json.images[t];if(s.bufferView!==void 0){var l=this.json.bufferViews[s.bufferView];r=this.loadBuffer(l.buffer).then(function(c){var f=l.byteOffset||0,m=l.byteLength||0,A=new Uint8Array(c,f,m),h=new Blob([A],{type:s.mimeType});return Ua(h)})}else if(s.uri){var u=this.resolveResouce(s.uri);r=this.options.fetcher.loadImage(u,{},void 0,void 0,void 0,Ri()).then(function(c){return c.body})}else throw new Error("glTF: Invalid image defs.")}return r=r.then(function(c){return e.disposeSet.add(c),c}),r},n.prototype.loadMaterialAsMeshStandardMaterial=function(t){var e=this,r=[],i=new d.MeshStandardMaterial;if(i.color=new d.Color(1,1,1),i.opacity=1,Object.keys(t.attributes).filter(function(c){return kt[c]==="color"}).length>0&&(i.vertexColors=!0),Object.keys(t.attributes).filter(function(c){return kt[c]==="normal"}).length===0&&(i.flatShading=!0),Object.keys(t.attributes).filter(function(c){return kt[c]==="tangent"}).length===0&&(i.normalScale&&(i.normalScale.y*=-1),i.clearcoatNormalScale&&(i.clearcoatNormalScale.y*=-1)),t.material!==void 0){var a=this.json.materials[t.material];a.name&&(i.name=a.name);var o=a.pbrMetallicRoughness||{};if(Array.isArray(o.baseColorFactor)){var s=o.baseColorFactor;i.color.fromArray(s),i.opacity=s[3]}o.baseColorTexture!==void 0&&r.push(this.createMaterialTexture(o.baseColorTexture).then(function(c){c.encoding=d.sRGBEncoding,i.map=c,e.disposeSet.add(c)})),i.metalness=o.metallicFactor!==void 0?o.metallicFactor:1,i.roughness=o.roughnessFactor!==void 0?o.roughnessFactor:1,o.metallicRoughnessTexture!==void 0&&r.push(this.createMaterialTexture(o.metallicRoughnessTexture).then(function(c){c.encoding=d.sRGBEncoding,i.metalnessMap=c,i.roughnessMap=c,e.disposeSet.add(c)})),a.doubleSided===!0&&(i.side=d.DoubleSide);var l=a.alphaMode||yr.OPAQUE;if(l===yr.BLEND?(i.transparent=!0,i.depthWrite=!1):(i.transparent=!1,l===yr.MASK&&(i.alphaTest=a.alphaCutoff!==void 0?a.alphaCutoff:.5)),a.normalTexture!==void 0&&(r.push(this.createMaterialTexture(a.normalTexture).then(function(c){i.normalMap=c,e.disposeSet.add(c)})),i.normalScale=new d.Vector2(1,1),a.normalTexture.scale!==void 0)){var u=a.normalTexture.scale;i.normalScale.set(u,u)}a.occlusionTexture!==void 0&&(r.push(this.createMaterialTexture(a.occlusionTexture).then(function(c){i.aoMap=c,e.disposeSet.add(c)})),a.occlusionTexture.strength!==void 0&&(i.aoMapIntensity=a.occlusionTexture.strength)),a.emissiveFactor!==void 0&&(i.emissive=new d.Color().fromArray(a.emissiveFactor)),a.emissiveTexture!==void 0&&r.push(this.createMaterialTexture(a.emissiveTexture).then(function(c){i.emissiveMap=c,e.disposeSet.add(c)}))}return this.disposeSet.add(i),Promise.all(r).then(function(){return i})},n.prototype.loadMaterialAsLineBasicMaterial=function(t){var e=[],r=new d.LineBasicMaterial;if(r.color=new d.Color(1,1,1),r.opacity=1,Object.keys(t.attributes).filter(function(l){return kt[l]==="color"}).length>0&&(r.vertexColors=!0),Object.keys(t.attributes).filter(function(l){return kt[l]==="tangent"}).length===0&&(r.normalScale&&(r.normalScale.y*=-1),r.clearcoatNormalScale&&(r.clearcoatNormalScale.y*=-1)),t.material!==void 0){var i=this.json.materials[t.material];i.name&&(r.name=i.name);var a=i.pbrMetallicRoughness||{};if(Array.isArray(a.baseColorFactor)){var o=a.baseColorFactor;r.color.fromArray(o),r.opacity=o[3]}i.doubleSided===!0&&(r.side=d.DoubleSide);var s=i.alphaMode||yr.OPAQUE;s===yr.BLEND?(r.transparent=!0,r.depthWrite=!1):(r.transparent=!1,s===yr.MASK&&(r.alphaTest=i.alphaCutoff!==void 0?i.alphaCutoff:.5))}return this.disposeSet.add(r),Promise.all(e).then(function(){return r})},n.prototype.loadMaterialAsPointsMaterial=function(t){var e=this,r=[],i=new d.PointsMaterial;if(i.color=new d.Color(1,1,1),i.opacity=1,i.sizeAttenuation=!1,Object.keys(t.attributes).filter(function(u){return kt[u]==="color"}).length>0&&(i.vertexColors=!0),Object.keys(t.attributes).filter(function(u){return kt[u]==="tangent"}).length===0&&(i.normalScale&&(i.normalScale.y*=-1),i.clearcoatNormalScale&&(i.clearcoatNormalScale.y*=-1)),t.material!==void 0){var a=this.json.materials[t.material];a.name&&(i.name=a.name);var o=a.pbrMetallicRoughness||{};if(Array.isArray(o.baseColorFactor)){var s=o.baseColorFactor;i.color.fromArray(s),i.opacity=s[3]}o.baseColorTexture!==void 0&&r.push(this.createMaterialTexture(o.baseColorTexture).then(function(u){u.encoding=d.sRGBEncoding,i.map=u,e.disposeSet.add(u)})),a.doubleSided===!0&&(i.side=d.DoubleSide);var l=a.alphaMode||yr.OPAQUE;l===yr.BLEND?(i.transparent=!0,i.depthWrite=!1):(i.transparent=!1,l===yr.MASK&&(i.alphaTest=a.alphaCutoff!==void 0?a.alphaCutoff:.5))}return this.disposeSet.add(i),Promise.all(r).then(function(){return i})},n.prototype.loadMaterial=function(t){var e,r=(e=t.mode)!==null&&e!==void 0?e:Oe.TRIANGLES,i="material:"+this.createPrimitiveKey(t),a=this.cache.get(i);if(a)return a;for(var o=null,s=0,l=vt(this.extensions);s<l.length;s++){var u=l[s];if(o=u.loadMaterial(t,this),o)break}if(r===Oe.TRIANGLES||r===Oe.TRIANGLE_STRIP||r===Oe.TRIANGLE_FAN)o=this.loadMaterialAsMeshStandardMaterial(t);else if(r===Oe.LINES||r===Oe.LINE_STRIP||r===Oe.LINE_LOOP)o=this.loadMaterialAsLineBasicMaterial(t);else if(r===Oe.POINTS)o=this.loadMaterialAsPointsMaterial(t);else throw new Error("glTF: Primitive mode unsupported: "+r);return this.cache.set(i,o),o},n.prototype.loadTexture=function(t){var e=this,r="texture:"+t,i=this.cache.get(r);if(i)return i;for(var a=null,o=0,s=vt(this.extensions);o<s.length;o++){var l=s[o];if(a=l.loadTexture(t,this),a)break}if(!a){var u=this.json.textures[t];a=this.loadImage(u.source).then(function(c){var f=new d.Texture(c);f.needsUpdate=!0,f.flipY=!1,u.name&&(f.name=u.name);var m=e.json.samplers||{},A=m[u.sampler]||{};return f.magFilter=ki[A.magFilter]||d.LinearFilter,f.minFilter=ki[A.minFilter]||d.LinearMipmapLinearFilter,f.wrapS=Li[A.wrapS]||d.RepeatWrapping,f.wrapT=Li[A.wrapT]||d.RepeatWrapping,f.onUpdate=function(){c.close()},f})}return a=a.then(function(c){return e.disposeSet.add(c),c}),this.cache.set(r,a),a},n.prototype.loadMesh=function(t){for(var e=this,r=null,i=0,a=vt(this.extensions);i<a.length;i++){var o=a[i];if(r=o.loadMesh(t,this),r)break}if(!r){var s=this.json.meshes[t],l=s.primitives,u=Promise.all(l.map(function(f){return e.loadGeometry(f)})),c=Promise.all(l.map(function(f){return e.loadMaterial(f)}));r=Promise.all([u,c]).then(function(f){for(var m=f[0],A=f[1],h=[],p=0;p<l.length;p++){var g=l[p],v=m[p],y=A[p],b=g.mode||Oe.TRIANGLES,x=void 0;if(b===Oe.TRIANGLES||b===Oe.TRIANGLE_STRIP||b===Oe.TRIANGLE_FAN)if(b===Oe.TRIANGLE_STRIP?v=e.toGeometryTrianglesDrawMode(v,d.TriangleStripDrawMode):b===Oe.TRIANGLE_FAN&&(v=e.toGeometryTrianglesDrawMode(v,d.TriangleFanDrawMode)),e.disposeSet.add(v),s.isSkinnedMesh){var w=new d.SkinnedMesh(v,y);v.attributes.skinWeight.normalized||w.normalizeSkinWeights(),x=w}else x=new d.Mesh(v,y);else if(b===Oe.POINTS)x=new d.Points(v,y);else if(b===Oe.LINES)x=new d.LineSegments(v,y);else if(b===Oe.LINE_STRIP)x=new d.Line(v,y);else if(b===Oe.LINE_LOOP)x=new d.LineLoop(v,y);else throw new Error("glTF: Primitive mode unsupported: "+b);if(Object.keys(v.morphAttributes).length>0){if(s.weights!==void 0)for(var E=0,C=s.weights.length;E<C;E++)x.morphTargetInfluences[E]=s.weights[E];if(s.extras&&Array.isArray(s.extras.targetNames)){var M=s.extras.targetNames;if(x.morphTargetInfluences.length===M.length){x.morphTargetDictionary={};for(var E=0,C=M.length;E<C;E++)x.morphTargetDictionary[M[E]]=E}else console.warn("glTF: Invalid extras.targetNames length. Ignoring names.")}}x.name=e.createUniqueName(s.name||"mesh_"+t),h.push(x)}if(h.length===1)return h[0];for(var R=new d.Group,L=0,S=h;L<S.length;L++){var x=S[L];R.add(x)}return R})}return r},n.prototype.loadNodeAttachments=function(t){for(var e=[],r=0,i=vt(this.extensions);r<i.length;r++){var a=i[r],o=a.loadNodeAttachments(t,this);o&&e.push(o)}return e},n.prototype.loadNode=function(t){var e="node:"+t,r=this.cache.get(e);if(r)return r;var i=this.json,a=i.nodes[t],o=a.name?this.createUniqueName(a.name):"",s=[];a.mesh!==void 0&&s.push(this.loadMesh(a.mesh).then(function(m){if(a.weights!==void 0){var A=a.weights;m.traverse(function(h){if(h instanceof d.Mesh||h instanceof d.Line||h instanceof d.Points)for(var p=0,g=A.length;p<g;p++)h.morphTargetInfluences[p]=A[p]})}return m})),a.camera!==void 0&&s.push(this.loadCamera(a.camera));for(var l=this.loadNodeAttachments(t),u=0,c=l;u<c.length;u++){var f=c[u];s.push(f)}return Promise.all(s).then(function(m){var A;if(a.isBone===!0?A=new d.Bone:m.length>1?A=new d.Group:m.length===1?A=m[0]:A=new d.Object3D,A!==m[0])for(var h=0,p=m.length;h<p;h++)A.add(m[h]);if(a.name&&(A.name=o),a.matrix!==void 0){var g=new d.Matrix4;g.fromArray(a.matrix),A.applyMatrix4(g)}else a.translation!==void 0&&A.position.fromArray(a.translation),a.rotation!==void 0&&A.quaternion.fromArray(a.rotation),a.scale!==void 0&&A.scale.fromArray(a.scale);return A})},n.prototype.loadScene=function(t){var e=this.json,r=e.scenes[t],i=new d.Group;r.name&&(i.name=this.createUniqueName(r.name));for(var a=r.nodes||[],o=[],s=0,l=a.length;s<l;s++)o.push(this.buildNodeHierarchy(a[s],i));return Promise.all(o).then(function(){return i})},n.prototype.createMaterialTexture=function(t){var e=this;return this.loadTexture(t.index).then(function(r){for(var i=0,a=vt(e.extensions);i<a.length;i++){var o=a[i],s=o.extendTexture(r,t,e);s&&(r=s,e.disposeSet.add(r))}return e.textureSet.add(r),r})},n.prototype.addGeometryPrimitiveAttributes=function(t,e){var r=this,i=e.attributes,a=[],o=function(w){var E=kt[w]||w.toLowerCase();if(E in t.attributes)return"continue";a.push(s.loadAccessor(i[w]).then(function(C){C&&t.setAttribute(E,C)}))},s=this;for(var l in i)o(l);e.indices!==void 0&&!t.index&&a.push(this.loadAccessor(e.indices).then(function(w){w&&t.setIndex(w)}));var u=new d.Box3;if(i.POSITION!==void 0){var c=this.json.accessors[i.POSITION],f=c.min,m=c.max;if(f!==void 0&&m!==void 0){if(u.set(new d.Vector3(f[0],f[1],f[2]),new d.Vector3(m[0],m[1],m[2])),c.normalized){var A=ca(Vn[c.componentType]);u.min.multiplyScalar(A),u.max.multiplyScalar(A)}}else console.warn("glTF: Missing min/max properties for accessor POSITION.")}var h=e.targets;if(h!==void 0){for(var p=new d.Vector3,g=new d.Vector3,v=0,y=h.length;v<y;v++){var b=h[v];if(b.POSITION!==void 0){var c=this.json.accessors[b.POSITION],f=c.min,m=c.max;if(f!==void 0&&m!==void 0){if(g.setX(Math.max(Math.abs(f[0]),Math.abs(m[0]))),g.setY(Math.max(Math.abs(f[1]),Math.abs(m[1]))),g.setZ(Math.max(Math.abs(f[2]),Math.abs(m[2]))),c.normalized){var A=ca(Vn[c.componentType]);g.multiplyScalar(A)}p.max(g)}else console.warn("glTF: Missing min/max properties for accessor POSITION.")}}u.expandByVector(p)}t.boundingBox=u;var x=new d.Sphere;return u.getCenter(x.center),x.radius=u.min.distanceTo(u.max)/2,t.boundingSphere=x,Promise.all(a).then(function(){if(t.attributes.uv&&!t.attributes.uv2&&r.options.copyUV2&&t.setAttribute("uv2",t.attributes.uv),e.targets){for(var w=!1,E=!1,C=0,M=e.targets.length;C<M;C++){var R=e.targets[C];if(R.POSITION!==void 0&&(w=!0),R.NORMAL!==void 0&&(E=!0),w&&E)break}if(!w&&!E)return t;var L=[];t.morphTargetsRelative=!0;for(var S=function(I,O){var P=e.targets[I];w?L.push(r.loadAccessor(P.POSITION).then(function(F){F&&(t.morphAttributes.position[I]=F)})):t.morphAttributes.position[I]=t.attributes.position,E?L.push(r.loadAccessor(P.NORMAL).then(function(F){F&&(t.morphAttributes.normal[I]=F)})):t.morphAttributes.normal[I]=t.attributes.normal},C=0,M=e.targets.length;C<M;C++)S(C,M);return Promise.all(L).then(function(){return t})}else return t})},n.prototype.buildNodeHierarchy=function(t,e){var r=this,i=this.json.nodes[t];return this.loadNode(t).then(function(a){if(i.skin===void 0)return a;var o;return r.loadSkin(i.skin).then(function(s){o=s;for(var l=[],u=0,c=o.joints.length;u<c;u++)l.push(r.loadNode(o.joints[u]));return Promise.all(l)}).then(function(s){return a.traverse(function(l){if(l instanceof d.SkinnedMesh){for(var u=[],c=[],f=0,m=s.length;f<m;f++){var A=s[f];if(A instanceof d.Bone){u.push(A);var h=new d.Matrix4;o.inverseBindMatrices!==void 0&&h.fromArray(o.inverseBindMatrices.array,f*16),c.push(h)}else console.warn('glTF: Joint "%s" could not be found.',o.joints[f])}l.bind(new d.Skeleton(u,c),l.matrixWorld)}}),a})}).then(function(a){e.add(a);var o=[];if(i.children)for(var s=i.children,l=0,u=s.length;l<u;l++){var c=s[l];o.push(r.buildNodeHierarchy(c,a))}return Promise.all(o).then(function(){return a})})},n.prototype.createUniqueName=function(t){for(var e=d.PropertyBinding.sanitizeNodeName(t||""),r=e,i=1;this.nodeNamesUsed[r];++i)r=e+"_"+i;return this.nodeNamesUsed[r]=!0,r},n.prototype.resolveResouce=function(t){return at(this.options.resourcePath,mo(t,this.options.search))},n.prototype.toGeometryTrianglesDrawMode=function(t,e){var r=t.getIndex();if(r===null){var i=[],a=t.getAttribute("position");if(a!==void 0){for(var o=0;o<a.count;o++)i.push(o);t.setIndex(i),r=t.getIndex()}}if(r===null)return console.error("glTF: Undefined position attribute. Processing not possible."),t;var s=r.count-2,l=[];if(e===d.TriangleFanDrawMode)for(var o=1;o<=s;o++)l.push(r.getX(0)),l.push(r.getX(o)),l.push(r.getX(o+1));else for(var o=0;o<s;o++)o%2===0?(l.push(r.getX(o)),l.push(r.getX(o+1)),l.push(r.getX(o+2))):(l.push(r.getX(o+2)),l.push(r.getX(o+1)),l.push(r.getX(o)));l.length/3!==s&&console.error("glTF: Unable to generate correct amount of triangles.");var u=t.clone();return u.setIndex(l),this.disposeSet.add(u),u},n}();function ca(n){switch(n){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("glTF: Unsupported normalized accessor component type.")}}var fr=function(){function n(){}return n.prototype.markDefs=function(t){},n.prototype.prepare=function(t){},n.prototype.emitResult=function(t,e){},n.prototype.createPrimitiveKey=function(t,e){},n.prototype.extendTexture=function(t,e,r){return null},n.prototype.loadBuffer=function(t,e){return null},n.prototype.loadBufferView=function(t,e){return null},n.prototype.loadImage=function(t,e){return null},n.prototype.loadTexture=function(t,e){return null},n.prototype.loadGeometry=function(t,e){return null},n.prototype.loadMaterial=function(t,e){return null},n.prototype.loadMesh=function(t,e){return null},n.prototype.loadNodeAttachments=function(t,e){return null},n.prototype.loadCamera=function(t,e){return null},n.prototype.loadAnimation=function(t,e){return null},n}(),bf=function(n){se(t,n);function t(){var e=n.call(this)||this;return e.header={magic:"",version:0,length:0},e.content="",e.body=null,e}return t.getMagic=function(e){return qa(new Uint8Array(e.slice(0,4)))},t.prototype.loadGlbBinary=function(e){var r=new DataView(e,0,t.HEADER_LENGTH);if(this.header={magic:t.getMagic(e),version:r.getUint32(4,!0),length:r.getUint32(8,!0)},this.header.magic!==t.HEADER_MAGIC)throw new Error("glTF:KHR_binary_glTF: Unsupported.");if(this.header.version<2)throw new Error("glTF:KHR_binary_glTF: Legacy binary file detected.");for(var i=new DataView(e,t.HEADER_LENGTH),a=0,o=null,s=null;a<i.byteLength;){var l=i.getUint32(a,!0);if(a+=4,l!==0){var u=i.getUint32(a,!0);if(a+=4,u===t.CHUNK_TYPES.JSON){var c=new Uint8Array(e,t.HEADER_LENGTH+a,l);o=qa(c)}else if(u===t.CHUNK_TYPES.BIN){var f=t.HEADER_LENGTH+a;s=e.slice(f,f+l)}a+=l}}if(o===null)throw new Error("glTF:KHR_binary_glTF: JSON content not found.");this.content=o,this.body=s},t.prototype.loadBuffer=function(e,r){var i=r.json.buffers[e];return i.uri===void 0&&e===0&&this.body?Promise.resolve(this.body):null},t.prototype.clear=function(){this.body=null,this.content=""},t.HEADER_MAGIC="glTF",t.HEADER_LENGTH=12,t.CHUNK_TYPES={JSON:1313821514,BIN:5130562},t}(fr),xf="https://vr-public.realsee-cdn.cn/release/static/image/release/five/resource/draco/1.5.6/",ms={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},As={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"},wf=function(){function n(){this.decoderPath=xf,this.decoderConfig={},this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL=""}return n.prototype.setDecoderPath=function(t){this.decoderPath=t},n.prototype.setDecoderConfig=function(t){return this.decoderConfig=t,this},n.prototype.setWorkerLimit=function(t){return this.workerLimit=t,this},n.prototype.decodeDracoFile=function(t,e,r,i){var a={attributeIDs:r||ms,attributeTypes:i||As,useUniqueIDs:!!r};this.decodeGeometry(t,a).then(e)},n.prototype.decodeGeometry=function(t,e){var r=this;e===void 0&&(e={attributeIDs:ms,attributeTypes:As,useUniqueIDs:!1});for(var i in e.attributeTypes){var a=e.attributeTypes[i];a.BYTES_PER_ELEMENT!==void 0&&(e.attributeTypes[i]=a.name)}var o,s=this.workerNextTaskID++,l=t.byteLength,u=this._getWorker(s,l).then(function(c){return o=c,new Promise(function(f,m){o._callbacks[s]={resolve:f,reject:m},o.postMessage({type:"decode",id:s,taskConfig:e,buffer:t},[t])})}).then(function(c){return r._createGeometry(c.geometry)});return u.catch(function(){return!0}).then(function(){o&&s&&r._releaseTask(o,s)}),u},n.prototype._createGeometry=function(t){var e=new d.BufferGeometry;t.index&&e.setIndex(new d.BufferAttribute(t.index.array,1));for(var r=0;r<t.attributes.length;r++){var i=t.attributes[r],a=i.name,o=i.array,s=i.itemSize;e.setAttribute(a,new d.BufferAttribute(o,s))}return e},n.prototype._initDecoder=function(){var t=this;if(this.decoderPending)return this.decoderPending;var e=typeof WebAssembly!="object"||this.decoderConfig.type==="js";if(e){var r=Sn(this.decoderPath+"draco_decoder.js",{responseType:"text"}).then(function(a){return a.body});this.decoderPending=r.then(function(a){var o=["/* draco decoder */",a,"","/* worker */",gs].join(`
|
|
417
|
+
`,N0=[],Yn=new d.PerspectiveCamera(90,1,.1,2);Yn.up.set(0,-1,0);Yn.lookAt(new d.Vector3(1,0,0));Yn.updateMatrix();Yn.matrixAutoUpdate=!1;var $n=new d.PerspectiveCamera(90,1,.1,2);$n.up.set(0,-1,0);$n.lookAt(new d.Vector3(-1,0,0));$n.updateMatrix();$n.matrixAutoUpdate=!1;var ei=new d.PerspectiveCamera(90,1,.1,2);ei.up.set(0,0,1);ei.lookAt(new d.Vector3(0,1,0));ei.updateMatrix();ei.matrixAutoUpdate=!1;var ti=new d.PerspectiveCamera(90,1,.1,2);ti.up.set(0,0,-1);ti.lookAt(new d.Vector3(0,-1,0));ti.updateMatrix();ti.matrixAutoUpdate=!1;var ri=new d.PerspectiveCamera(90,1,.1,2);ri.up.set(0,-1,0);ri.lookAt(new d.Vector3(0,0,1));ri.updateMatrix();ri.matrixAutoUpdate=!1;var ni=new d.PerspectiveCamera(90,1,.1,2);ni.up.set(0,-1,0);ni.lookAt(new d.Vector3(0,0,-1));ni.updateMatrix();ni.matrixAutoUpdate=!1;var $o={front:{camera:ri,index:4},back:{camera:ni,index:5},up:{camera:ei,index:2},down:{camera:ti,index:3},left:{camera:$n,index:1},right:{camera:Yn,index:0}};function dd(){var n=N0.pop();return n||new d.ShaderMaterial({uniforms:{map:{value:null},flipY:{value:0}},vertexShader:ld,fragmentShader:cd,depthTest:!1,depthWrite:!1,stencilWrite:!1,blending:d.NoBlending,lights:!1,toneMapped:!1,fog:!1})}function fd(n){n.uniforms.map.value=null,N0.push(n)}function hd(n,t,e){var r=new d.Scene;r.matrixAutoUpdate=!1;var i=new d.Group;i.scale.set(1,1,-1),r.add(i);for(var a=[],o=new Set,s=0,l=n;s<l.length;s++){var u=l[s];o.add(u.face);var c=dd();a.push(c),c.uniforms.map.value=u.texture,c.uniforms.flipY.value=u.flipY?1:0;var f=new d.Group,m=new d.Mesh(ud,c);m.position.set(u.position.x+u.size.x/2-.5,1-(u.position.y+u.size.y/2)-.5,-.5),m.scale.set(u.size.x,u.size.y,1),f.quaternion.copy(sd[u.face]),f.add(m),i.add(f)}var A=e.autoClear,h=e.sortObjects,p=e.xr.enabled,g=t.texture.generateMipmaps;e.autoClear=!1,e.sortObjects=!1,e.xr.enabled=!1,t.texture.generateMipmaps=!1;var v=e.getRenderTarget(),y=0;o.forEach(function(w){++y===o.size&&(t.texture.generateMipmaps=g),e.setRenderTarget(t,$o[w].index),e.render(r,$o[w].camera)}),e.setRenderTarget(v),e.autoClear=A,e.sortObjects=h,e.xr.enabled=p;for(var b=0,x=a;b<x.length;b++){var c=x[b];fd(c)}}var pd=function(){return!1}();function Ri(n){n===void 0&&(n={});var t=Object.assign(document.createElementNS("http://www.w3.org/1999/xhtml","img"),{crossOrigin:"",close:function(){n.onClose&&n.onClose.call(this),this.onerror=this.onload=this.close=Q,this.removeAttribute("src")}});return t}function Ua(n){return new Promise(function(t,e){var r=URL.createObjectURL(n),i=Ri({onClose:function(){this.src===r&&URL.revokeObjectURL(r)}});i.onload=function(){i.src===r&&URL.revokeObjectURL(r),i.onload=i.onerror=Q,setTimeout(function(){t(i)},10)},i.onerror=function(){var a=i.src;i.onload=i.onerror=Q,i.close(),e(new Error("image load error: ".concat(a)))},i.decoding="async",i.src=r})}var es=[];function vd(n,t){var e=es.shift();if(e)return e.width=n,e.height=t,e;var r=Object.assign(document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),{close:function(){r.close=Q,es.push(r)}});return r}function ts(n,t){if(t&&(n.width>t.width||n.height>t.height)){var e=vd(Math.min(n.width,t.width),Math.min(n.height,t.height)),r=e.getContext("2d");r.clearRect(0,0,e.width,e.height),r.drawImage(n,0,0,e.width,e.height),n.close();var i=new d.Texture(e);i.needsUpdate=!0,i.flipY=!0;var a=i.dispose;return i.dispose=function(){e.close(),a.call(i),i.dispose=a},i}else{var o=new d.Texture(n);o.needsUpdate=!0,typeof ImageBitmap!="undefined"&&n instanceof ImageBitmap?o.flipY=!1:o.flipY=!0;var s=o.dispose;return o.dispose=function(){n.close(),s.call(o),o.dispose=s},o}}function md(n){var t=new d.CubeTexture(n);t.needsUpdate=!0,t.flipY=!1;var e=t.dispose;return t.dispose=function(){for(var r=0,i=n;r<i.length;r++){var a=i[r];a.close()}e.call(t),t.dispose=e},t}var rs=new d.Vector3,en=["right","left","up","down","front","back"],Ne=function(){function n(t,e,r,i,a){this.tileTree=e,this.tileSources=r,this.options=i,this.renderer=a,this.name="",this.needsRender=!1,this.maxRequest=n.DEFAULT_MAX_REQUEST,this.disposed=!1,this.loadedCubeNodes=new Set,this.loadingCubeNodes=new Set,this.drawedCubeNodes=new Set,this.baseCubeTexture=null,this._cubeRenderTarget=null,this.prepareToRender=[],this.baseCubeTexture=t}return Object.defineProperty(n.prototype,"cubeRenderTarget",{get:function(){return this._cubeRenderTarget},set:function(t){var e,r,i,a,o,s;if(t===null)throw new Error("cannot set cubeRenderTarget to null.");t.width!==this.options.textureSize&&t.setSize(this.options.textureSize,this.options.textureSize),t.texture.format=(e=this.options.format)!==null&&e!==void 0?e:d.RGBAFormat,t.texture.minFilter=(r=this.options.minFilter)!==null&&r!==void 0?r:d.LinearFilter,t.texture.magFilter=(i=this.options.magFilter)!==null&&i!==void 0?i:d.LinearFilter,t.texture.wrapS=(a=this.options.wrapS)!==null&&a!==void 0?a:d.ClampToEdgeWrapping,t.texture.wrapT=(o=this.options.wrapT)!==null&&o!==void 0?o:d.ClampToEdgeWrapping,t.texture.generateMipmaps=(s=this.options.generateMipmaps)!==null&&s!==void 0?s:!0,this.baseCubeTexture&&(Qa(this.baseCubeTexture,t,this.renderer),this.baseCubeTexture.dispose(),this.baseCubeTexture=null),this._cubeRenderTarget&&Qa(this._cubeRenderTarget.texture,t,this.renderer),this._cubeRenderTarget=t},enumerable:!1,configurable:!0}),n.prototype.requestTile=function(t){var e=this,r,i,a,o,s,l,u=this.tileSources.filter(function(p){return p.level===t.level})[0];if(!u)return this.loadedCubeNodes.add(t),this.prepareToRender.push({node:t,texture:null}),!1;var c=u.size,f=Math.pow(2,t.level)*t.position.y,m=Math.pow(2,t.level)*t.position.x,A="".concat(((a=(i=(r=this.options.imageURL)===null||r===void 0?void 0:r.options)===null||i===void 0?void 0:i.key)!==null&&a!==void 0?a:"pano.0").replace(/^pano/,"pano_tile"),".").concat(t.face,".").concat(t.level,".").concat(f,".").concat(m),h=k(k({},(s=(o=this.options.imageURL)===null||o===void 0?void 0:o.options)!==null&&s!==void 0?s:{key:"unknown"}),{key:A,size:u.scale>=1?void 0:c*t.size*u.scale,quality:void 0,cut:[c*t.position.x,c*t.position.y,c*t.size,c*t.size]});return this.loadingCubeNodes.add(t),this.options.textureLoader.loadTexture(u[t.face],{imageURL:{transform:(l=this.options.imageURL)===null||l===void 0?void 0:l.transform,options:k({},h)},format:d.RGBAFormat,timeout:this.options.timeout,magFilter:this.options.magFilter,minFilter:this.options.minFilter,fetcher:this.options.fetcher}).then(function(p){if(e.disposed){p.body.dispose();return}e.prepareToRender.push({node:t,texture:p.body}),e.loadedCubeNodes.add(t)}).catch(Q).then(function(){e.disposed||e.loadingCubeNodes.delete(t)}),!0},n.prototype.update=function(t,e){var r=this;if(!this.disposed){var i=t.planes[5].normal,a=Math.max(this.maxRequest-this.loadingCubeNodes.size,0),o=[];fo(this.tileTree,function(p){if(p.level>e||!t.intersectsBox(p.box))return!1;!r.loadedCubeNodes.has(p)&&!r.loadingCubeNodes.has(p)&&o.push(p)}),o.sort(function(p,g){return p.level!==g.level?p.level-g.level:p.box.getCenter(rs).angleTo(i)-g.box.getCenter(rs).angleTo(i)});for(var s=0,l=o;s<l.length;s++){var u=l[s];if(a<=0)break;var c=this.requestTile(u);c&&a--}if(this.cubeRenderTarget&&this.prepareToRender.length){this.prepareToRender.sort(function(p,g){return p.node.level-g.node.level});for(var f=[],m=0;m<this.prepareToRender.length;m++){var A=this.prepareToRender[m],u=A.node,h=A.texture;(u.parent===null||this.drawedCubeNodes.has(u.parent))&&(this.drawedCubeNodes.add(u),h&&f.push({face:u.face,position:u.position,size:new d.Vector2(u.size,u.size),texture:h,flipY:!h.flipY}),this.prepareToRender.splice(m,1),m--)}f.length&&(hd(f,this.cubeRenderTarget,this.renderer),this.needsRender=!0)}}},Object.defineProperty(n.prototype,"tilePending",{get:function(){return this.loadingCubeNodes.size},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"texture",{get:function(){if(!this._cubeRenderTarget)throw new Error("cubeRenderTarget never set.");return this._cubeRenderTarget.texture},enumerable:!1,configurable:!0}),n.prototype.dispose=function(){if(!this.disposed){this.disposed=!0,this.baseCubeTexture&&(this.baseCubeTexture.dispose(),this.baseCubeTexture=null),this.loadingCubeNodes.clear(),this.loadedCubeNodes.clear();for(var t=0,e=this.prepareToRender;t<e.length;t++){var r=e[t];r.texture&&r.texture.dispose()}this.prepareToRender.length=0}},n.DEFAULT_MAX_REQUEST=3,n}(),Bn=function(){function n(){}return n.prototype.loadTexture=function(t,e,r,i,a,o){var s,l,u,c,f,m,A;r===void 0&&(r=Q),i===void 0&&(i=Q),a===void 0&&(a=Q);var h={};typeof e.flipY!="undefined"&&(h.flipY=e.flipY),typeof e.format!="undefined"&&(h.format=e.format),typeof e.encoding!="undefined"&&(h.encoding=e.encoding),h.generateMipmaps=(s=e.generateMipmaps)!==null&&s!==void 0?s:!1,h.minFilter=(l=e.minFilter)!==null&&l!==void 0?l:d.LinearFilter,h.magFilter=(u=e.magFilter)!==null&&u!==void 0?u:d.LinearFilter;var p=(f=(c=e.imageURL)===null||c===void 0?void 0:c.options)!==null&&f!==void 0?f:{key:"unknown"};t=sn(t,(m=e.imageURL)===null||m===void 0?void 0:m.transform,p);var g=Wo(t),v=(A=e.viaAjax)!==null&&A!==void 0?A:pd,y=Xo(t),b=/^https?:/.test(g);if(y?v=!0:b||(v=!1),v){var x=null,w="blob";return e.fetcher.ajax(t,{timeout:e.timeout,responseType:w},void 0,void 0,a).then(function(M){return Ua(M.body)}).then(function(M){return ts(M,e.maxSize)}).then(function(M){return Object.assign(M,h),M}).then(function(M){var R={meta:x,body:M};return r(R),R}).catch(function(M){return i(M),Promise.reject(M)})}else{var E=null,C;return Promise.resolve().then(function(){return Ri()}).then(function(M){return C=M,e.fetcher.loadImage(t,{timeout:e.timeout},void 0,void 0,a,M)}).then(function(M){return E=M.meta,ts(M.body,e.maxSize)}).then(function(M){return Object.assign(M,h),M}).then(function(M){var R={meta:E,body:M};return r(R),R}).catch(function(M){return C&&C.close(),i(M),Promise.reject(M)})}},n.prototype.loadCubeTexture=function(t,e,r,i,a,o){var s,l,u,c,f,m,A;r===void 0&&(r=Q),i===void 0&&(i=Q),a===void 0&&(a=Q);var h={};typeof e.format!="undefined"&&(h.format=e.format),h.generateMipmaps=(s=e.generateMipmaps)!==null&&s!==void 0?s:!1,h.minFilter=(l=e.minFilter)!==null&&l!==void 0?l:d.LinearFilter,h.magFilter=(u=e.magFilter)!==null&&u!==void 0?u:d.LinearFilter;for(var p=[t[en[0]],t[en[1]],t[en[2]],t[en[3]],t[en[4]],t[en[5]]],g=[],v=[0,0,0,0,0,0],y=[],b=function(w){var E=(f=(c=e.imageURL)===null||c===void 0?void 0:c.options)!==null&&f!==void 0?f:{key:"unknown"},C=sn(p[w],(m=e.imageURL)===null||m===void 0?void 0:m.transform,k(k({},E),{key:E.key+"."+en[w]})),M=Wo(C),R=function(V){v[w]=V,a(v.reduce(function(D,z){return D+z},0)/6)},L=(A=e.viaAjax)!==null&&A!==void 0?A:!1,S=/^https?:$/.test(M),I=Xo(C);if(I?L=!0:S||(L=!1),L){var O="blob",P=e.fetcher.ajax(C,{timeout:e.timeout,responseType:O},void 0,void 0,R).then(function(V){return y[w]=V.meta,Ua(V.body)});g.push(P)}else{var F,P=Promise.resolve().then(function(){return Ri()}).then(function(D){return F=D,e.fetcher.loadImage(C,{timeout:e.timeout},void 0,void 0,R,D)}).then(function(D){return y[w]=D.meta,D.body}).catch(function(D){return F&&F.close(),Promise.reject(D)});g.push(P)}},x=0;x<6;x++)b(x);return Promise.all(g).then(function(w){return md(w)}).then(function(w){return Object.assign(w,k({encoding:d.sRGBEncoding},h)),w}).then(function(w){var E={body:w,meta:y};return r(E),E}).catch(function(w){for(var E=0,C=g;E<C.length;E++){var M=C[E];M.then(function(R){return R.close()}).catch(Q)}return i(w),Promise.reject(w)})},n.prototype.loadTiledCubeTexture=function(t,e,r,i,a,o,s){var l=this;return i===void 0&&(i=Q),a===void 0&&(a=Q),o===void 0&&(o=Q),new Promise(function(u,c){var f,m;l.loadCubeTexture(t,{imageURL:{transform:(f=r.imageURL)===null||f===void 0?void 0:f.transform,options:(m=r.imageURL)===null||m===void 0?void 0:m.options},format:d.RGBAFormat,viaAjax:r.viaAjax,timeout:r.timeout,fetcher:r.fetcher,magFilter:r.magFilter,minFilter:r.minFilter,generateMipmaps:r.generateMipmaps},function(A){var h,p=A.meta,g=A.body,v=(h=r.tileMaxLevel)!==null&&h!==void 0?h:2,y=Math.max(1024*v,512),b=Da(v),x=new Ne(g,b,e,{textureSize:y,textureLoader:l,imageURL:r.imageURL,magFilter:r.magFilter,minFilter:r.minFilter,generateMipmaps:r.generateMipmaps,timeout:r.timeout,fetcher:r.fetcher},s),w={meta:p,body:x};i(w),u(w)},function(A){a(A),c(A)},o,s).catch(Q)})},n}();const Ad=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("n\bv{t-rpA-d|yq]|vv|{Hn\bv{t-rp@-PnzrnQvrpv|{H0v{pyqr-Ip|zz|{K0v{pyqr-Iz|}untrl}nlrr\x07K0v{pyqr-Ixv{{v{tl}nlrr\x07K0v{pyqr-Iy|tqr}uosl}nlrr\x07K0v{pyqr-Ipyv}}v{tl}yn{rl}nlrr\x07KZNV[lORS\\_R|vq-znv{56-\n--ZNV[l`aN_a--0v{pyqr-Ixv{onrlrr\x07K--0v{pyqr-Iortv{lrr\x07K--0v{pyqr-Iz|}untrlrr\x07K--0v{pyqr-Ixv{{v{tlrr\x07K--0v{pyqr-I}|wrplrr\x07K--0v{pyqr-Iy|tqr}uoslrr\x07K--0v{pyqr-Ipyv}}v{tl}yn{rlrr\x07K--d|yq]|vv|{-J-rpA5n{s|zrq9->;=6H--0vsqrs-b`RlV[`aN[PV[T----d|yq]|vv|{-J-v{n{prZnv\x07-7-d|yq]|vv|{H--0r{qvs--d|yq]|vv|{-J-z|qryZnv\x07-7-d|yq]|vv|{H--zn@-pnzrn_|nv|{Znv\x07-J-zn@5vrZnv\x07h=jh=j9-vrZnv\x07h>jh=j9-vrZnv\x07h?jh=j9-vrZnv\x07h=jh>j9-vrZnv\x07h>jh>j9-vrZnv\x07h?jh>j9-vrZnv\x07h=jh?j9-vrZnv\x07h>jh?j9-vrZnv\x07h?jh?j6H--PnzrnQvrpv|{-J-{|znyv r5pnzrn_|nv|{Znv\x07-7-rp@5=;=9-=;=9-:>;=66H--0v{pyqr-I|yq}|lrr\x07K--0v{pyqr-Is|tlrr\x07K--ZNV[lR[Q\f"),gd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("0qrsv{r-OYNPXlP\\Y\\_-rpA5=;=EC9-=;>=C9-=;>AF9->;=6{vs|z-nz}yrPor-}n{|=lzn}H{vs|z-znA-}n{|=lznv\x07H{vs|z-sy|n-}n{|=l ||zH0vs-qrsv{rq5b`RlYbZV[N[PR6--{vs|z-nz}yrPor-}n{|=lyzv{n{prZn}H0r{qvs{vs|z-nz}yrPor-}n{|>lzn}H{vs|z-znA-}n{|>lznv\x07H{vs|z-sy|n-}n{|>l ||zH0vs-qrsv{rq5b`RlYbZV[N[PR6--{vs|z-nz}yrPor-}n{|>lyzv{n{prZn}H0r{qvs{vs|z-sy|n-z|qryNy}unH{vs|z-sy|n-}|trHn\bv{t-rpA-d|yq]|vv|{Hn\bv{t-rp@-PnzrnQvrpv|{H{vs|z-sy|n-u|{Sy||V{qr\x07H{vs|z-rp?-r|yv|{H{vs|z-sy|n-}v\x07ry_nv|H0vs{qrs-SYNal`UNQRQ--n\bv{t-rp@-[|znyH0r{qvs0v{pyqr-Ip|zz|{K0v{pyqr-Iqvurv{tl}nlsntzr{K0v{pyqr-Is|tl}nlsntzr{K0v{pyqr-I}rpynzn}l}nlsntzr{K0v{pyqr-Iy|tqr}uosl}nlsntzr{K0v{pyqr-Ipyv}}v{tl}yn{rl}nlsntzr{Krp@- ||zcrp|5rp@-qvrpv|{9-rp@-rp|9-sy|n- ||z6-\n--sy|n-urn-J-q|5qvrpv|{9-rp|6H--rp@-q-J-qvrpv|{-7-urnH--rp@-}-J-rp|-:-qH--rp@-\0-J-}-7- ||zH--r{-{|znyv r5q-8-\x006H\fZNV[lORS\\_R|vq-znv{56-\n--ZNV[l`aN_a--0v{pyqr-Ipyv}}v{tl}yn{rlsntzr{K--<<-JJJ-全景图-JJJ--rp@-}n{|=a|crr\x07-J-{|znyv r5d|yq]|vv|{;\x07\b -:-}n{|=lznv\x07h@j;\x07\b 6H--}n{|=a|crr\x07-J- ||zcrp|5PnzrnQvrpv|{9-}n{|=a|crr\x079-}n{|=l ||z6H--}n{|=a|crr\x07-J-}n{|=a|crr\x07-7-zn@5}n{|=lznv\x076H--rp@-}n{|>a|crr\x07-J-{|znyv r5d|yq]|vv|{;\x07\b -:-}n{|>lznv\x07h@j;\x07\b 6H--}n{|>a|crr\x07-J- ||zcrp|5PnzrnQvrpv|{9-}n{|>a|crr\x079-}n{|>l ||z6H--}n{|>a|crr\x07-J-}n{|>a|crr\x07-7-zn@5}n{|>lznv\x076H--rpA-}n{|P|y|H--rpA-}n{|=P|y|-J-r\x07rPor5}n{|=lzn}9-}n{|=a|crr\x076H--rpA-}n{|>P|y|-J-r\x07rPor5}n{|>lzn}9-}n{|>a|crr\x076H--0vs-qrsv{rq5b`RlYbZV[N[PR6----}n{|=P|y|;n-J->;=-:-r\x07rPor5}n{|=lyzv{n{prZn}9-}n{|=a|crr\x076;H----}n{|>P|y|;n-J->;=-:-r\x07rPor5}n{|>lyzv{n{prZn}9-}n{|>a|crr\x076;H--0r{qvs--0vs-qrsv{rq5b`RlOYNPXla_N[`VaV\\[6----sy|n-oynpx]|tr-J-np|5:?;=-7-}|tr-8->;=6H----}n{|P|y|-J-zv\x075}n{|=P|y|9-OYNPXlP\\Y\\_9-zv{5>;=9-oynpx]|tr66H----}n{|P|y|-J-zv\x075}n{|P|y|9-}n{|>P|y|9-zn\x075=;=9-oynpx]|tr-:-]V-8->;=66H--0ryvs-qrsv{rq5b`Rl`]_RNQla_N[`VaV\\[6----rp?-prr{Pr{rP||q-J-r|yv|{-7-}v\x07ry_nv|-<-?;=H----sy|n-n{vv|{_nqv-J-qvn{pr5rp?5=;=9-=;=69-prr{Pr{rP||q6-7->;?H----sy|n-n{vv|{]|tr-J--qvn{pr5tylSntP||q;\x07\b9-prr{Pr{rP||q6-<-n{vv|{_nqvH----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-z||ur}5=;=9-=;?9-}|tr-:-n{vv|{]|tr66H--0ryr----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-}|tr6H--0r{qvs--tylSntP|y|-J-zv\x075}n{|P|y|9-rpA5}n{|P|y|;to9-=;=69-\05z|qryNy}un66H--<<-JJJJJJJJJJJJJJJJ--ZNV[lZ\\QRYlP\\Y\\_--0v{pyqr-Is|tlsntzr{K--0v{pyqr-I}rzyv}yvrqlny}unlsntzr{K--0v{pyqr-Iqvurv{tlsntzr{K--ZNV[lR[Q\f"),yd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("0vs-qrsv{rq5b`RlRQY6--n\bv{t-sy|n-Y|tQr}uH0r{qvs0vs-qrsv{rq5b`RlcR_aRelZN_X6--nvor-sy|n-znxH0r{qvsn\bv{t-sy|n-V_||sZnxHn\bv{t-rpA-d|yq]|vv|{Hn\bv{t-rp@-PnzrnQvrpv|{Hn\bv{t-rp@-cvr]|vv|{H0v{pyqr-Ip|zz|{K0v{pyqr-Il}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|tQr}u-J-y|t?5:z]|vv|{; 6H--0r{qvs--V_||sZnx-J-=;=H--0vs-qrsv{rq5b`RlcR_aRelZN_X6----V_||sZnx-J-r}5no5znx-:->;=69-=;>6H--0r{qvs--0v{pyqr-I|yq}|lrr\x07K--0v{pyqr-Ir{zn}lrr\x07K--0v{pyqr-Is|tlrr\x07K--ZNV[lR[Q\f"),bd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("0qrsv{r-OYNPXlP\\Y\\_-rpA5=;=EC9-=;>=C9-=;>AF9->;=6{vs|z-sy|n-sy||H{vs|z-nz}yrPor-}n{|=lzn}H{vs|z-znA-}n{|=lznv\x07H{vs|z-sy|n-}n{|=l ||zH0vs-qrsv{rq5b`RlYbZV[N[PR6--{vs|z-nz}yrPor-}n{|=lyzv{n{prZn}H0r{qvs{vs|z-nz}yrPor-}n{|>lzn}H{vs|z-znA-}n{|>lznv\x07H{vs|z-sy|n-}n{|>l ||zH0vs-qrsv{rq5b`RlYbZV[N[PR6--{vs|z-nz}yrPor-}n{|>lyzv{n{prZn}H0r{qvs{vs|z-sy|n-z|qryNy}unH{vs|z-sy|n-}|trH0vs-qrsv{rq5b`RlP\\[`aN[alP\\Y\\_6--{vs|z-rp@-p|{n{P|y|H0r{qvsp-Pyv}}r-\n--znA-znv\x07V{rrH--sy|n-sy||V{qr\x07H\fH0vs-[bZlPYV]]R_`-K-=--{vs|z-Pyv}}r-pyv}}rh[bZlPYV]]R_`jH0r{qvs0vs-qrsv{rq5b`RlRQY6--n\bv{t-sy|n-Y|tQr}uH0r{qvsn\bv{t-rpA-d|yq]|vv|{Hn\bv{t-rp@-PnzrnQvrpv|{Hn\bv{t-sy|n-V_||sZnxH{vs|z-sy|n-u|{Sy||V{qr\x07H{vs|z-rp?-r|yv|{H{vs|z-sy|n-}v\x07ry_nv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r669-q-<-5\0;\x07-8-r69-\0;\x076H\frp@-u?to5rp@-p6-\n----rpA-X-J-rpA5>;=9-?;=-<-@;=9->;=-<-@;=9-@;=6H----rp@-}-J-no5snp5p;\x07\x07\x07-8-X;\x07\b 6-7-C;=-:-X;6H----r{-p; -7-zv\x075X;\x07\x07\x079-pynz}5}-:-X;\x07\x07\x079-=;=9->;=69-p;\b6H\fZNV[lORS\\_R|vq-znv{56-\n--ZNV[l`aN_a--<<-JJJ-顶部裁切-JJJ--sy|n-||sP]|tr-J-}|5pynz}5:PnzrnQvrpv|{;\b9-=;=9->;=69-@;=6H--vs-5----V_||sZnx-K-=;B-33----d|yq]|vv|{;\b-K-z|qryO|{qv{tZn\x07;\b-:-||sP]|tr-7-5z|qryO|{qv{tZn\x07;\b-:-z|qryO|{qv{tZv{;\b6--6-\n----qvpnqH--\f--<<-JJJJJJJJJJJJJJ--<<-JJJ-前置裁切计算-JJJ--0vs-[bZlPYV]]R_`-K-=----o||y-pyv}}rqH----rpA-pyv}}r]|vv|{H----0}ntzn-{|yyly||}ln----s|-5-v{-v-J-=H-v-I-[bZlPYV]]R_`H-v-88-6-\n------pyv}}r]|vv|{-J-pyv}}rh-v-j;znv\x07V{rr-7-d|yq]|vv|{H------pyv}}rq-J-5pyv}}rh-v-j;sy||V{qr\x07-I-=;=-\v\v-no5sy||-:-pyv}}rh-v-j;sy||V{qr\x076-I->;=6H------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\x07-K-:=;B-33-pyv}}r]|vv|{;\x07-I-=;BH------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\b-K-:=;B-33-pyv}}r]|vv|{;\b-I-=;BH------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{; -K-:=;B-33-pyv}}r]|vv|{; -I-=;BH------vs-5pyv}}rq6-\n--------qvpnqH------\f----\f----0}ntzn-{|yyly||}lr{q--0r{qvs--<<-JJJJJJJJJJJJJJJJJJ--0v{pyqr-Ipyv}}v{tl}yn{rlsntzr{K--rpA-qvssrP|y|-J-rpA5-qvssr9-|}npv\b-6H--0v{pyqr-Iy|tqr}uoslsntzr{K--0v{pyqr-Izn}lsntzr{K--0v{pyqr-Ip|y|lsntzr{K--0v{pyqr-Iny}unzn}lsntzr{K--0v{pyqr-Iny}unrlsntzr{K--0v{pyqr-I}rpynzn}lsntzr{K--_rsyrprqYvtu-rsyrprqYvtu-J-_rsyrprqYvtu5-rp@5-=;=-69-rp@5-=;=-69-rp@5-=;=-69-rp@5-=;=-6-6H--<<-nppzynv|{-5onxrq-v{qvrp-yvtuv{t-|{y\b6--0vsqrs-b`RlYVTUaZN]----rpA-yvtuZn}ar\x07ryJ-r\x07r?Q5-yvtuZn}9-b?-6H----rsyrprqYvtu;v{qvrpQvssr-8J-yvtuZn}ar\x07rya|Yv{rn5-yvtuZn}ar\x07ry-6;to-7-yvtuZn}V{r{v\bH--0ryr----rsyrprqYvtu;v{qvrpQvssr-8J-rp@5->;=-6H--0r{qvs--<<-z|qynv|{--0v{pyqr-In|zn}lsntzr{K--rsyrprqYvtu;v{qvrpQvssr-7J-qvssrP|y|;toH--rp@-|t|v{tYvtu-J-rsyrprqYvtu;v{qvrpQvssrH--0v{pyqr-Ir{zn}lsntzr{K--tylSntP|y|-J-rpA5-|t|v{tYvtu9-qvssrP|y|;n-6H--<<-JJJ-纯色-JJJ--0vs-qrsv{rq5b`RlP\\[`aN[alP\\Y\\_6----tylSntP|y|-J-rpA5p|{n{P|y|;9-p|{n{P|y|;t9-p|{n{P|y|;o9-|}npv\b6H--0r{qvs--<<-JJJJJJJJJJJ--<<-JJJ-楼层显示-JJJ--sy|n-sy||\\}npv\b-J->;=H--vs-5u|{Sy||V{qr\x07-K-:=;=>-33-no5sy||-:-u|{Sy||V{qr\x076-K-=;FF6-\n----sy||\\}npv\b-J-=;?-7-zv{55>;=-8-PnzrnQvrpv|{;\b69->;=6H--\f--tylSntP|y|;n-J-tylSntP|y|;n-7-sy||\\}npv\b-7-ovtu{rH--<<-JJJJJJJJJJJJJJ--<<-颜色增益调整,在色调映射前--rp@-toP|y|-J-tylSntP|y|;toH--rp@-uP|y|-J-to?u5toP|y|6H--rp@-sv{nyU`c-J-rp@5uP|y|;\x079-uP|y|;\b-8-p|y|`nnv|{9-uP|y|; -8-p|y|Ovtu{r6H--tylSntP|y|;to-J-u?to5sv{nyU`c6H---ZNV[lZ\\QRYlP\\Y\\_--<<色调映射-色彩空间转换--0v{pyqr-I|{rzn}}v{tlsntzr{K--0v{pyqr-Ir{p|qv{tlsntzr{K--<<-JJJ-全景图-JJJ--rp@-}n{|=a|crr\x07-J-{|znyv r5d|yq]|vv|{;\x07\b -:-}n{|=lznv\x07h@j;\x07\b 6H--}n{|=a|crr\x07-J- ||zcrp|5PnzrnQvrpv|{9-}n{|=a|crr\x079-}n{|=l ||z6H--}n{|=a|crr\x07-J-}n{|=a|crr\x07-7-zn@5}n{|=lznv\x076H--rp@-}n{|>a|crr\x07-J-{|znyv r5d|yq]|vv|{;\x07\b -:-}n{|>lznv\x07h@j;\x07\b 6H--}n{|>a|crr\x07-J- ||zcrp|5PnzrnQvrpv|{9-}n{|>a|crr\x079-}n{|>l ||z6H--}n{|>a|crr\x07-J-}n{|>a|crr\x07-7-zn@5}n{|>lznv\x076H--rpA-}n{|P|y|H--rpA-}n{|=P|y|-J-r\x07rPor5}n{|=lzn}9-}n{|=a|crr\x076H--rpA-}n{|>P|y|-J-r\x07rPor5}n{|>lzn}9-}n{|>a|crr\x076H--0vs-qrsv{rq5b`RlYbZV[N[PR6----}n{|=P|y|;n-J->;=-:-r\x07rPor5}n{|=lyzv{n{prZn}9-}n{|=a|crr\x076;H----}n{|>P|y|;n-J->;=-:-r\x07rPor5}n{|>lyzv{n{prZn}9-}n{|>a|crr\x076;H--0r{qvs--0vs-qrsv{rq5b`RlOYNPXla_N[`VaV\\[6----sy|n-oynpx]|tr-J-np|5:?;=-7-}|tr-8->;=6H----}n{|P|y|-J-zv\x075}n{|=P|y|9-OYNPXlP\\Y\\_9-zv{5>;=9-oynpx]|tr66H----}n{|P|y|-J-zv\x075}n{|P|y|9-}n{|>P|y|9-zn\x075=;=9-oynpx]|tr-:-]V-8->;=66H--0ryvs-qrsv{rq5b`Rl`]_RNQla_N[`VaV\\[6----rp?-prr{Pr{rP||q-J-r|yv|{-7-}v\x07ry_nv|-<-?;=H----sy|n-n{vv|{_nqv-J-qvn{pr5rp?5=;=9-=;=69-prr{Pr{rP||q6-7->;?H----sy|n-n{vv|{]|tr-J-qvn{pr5tylSntP||q;\x07\b9-prr{Pr{rP||q6-<-n{vv|{_nqvH----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-z||ur}5=;=9-=;?9-}|tr-:-n{vv|{]|tr66H--0ryr----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-}|tr6H--0r{qvs--tylSntP|y|-J-zv\x075}n{|P|y|9-tylSntP|y|9-z|qryNy}un6H--<<-JJJJJJJJJJJJJ--0v{pyqr-Is|tlsntzr{K--0v{pyqr-I}rzyv}yvrqlny}unlsntzr{K--0v{pyqr-Iqvurv{tlsntzr{K--0vs-qrsv{rq5b`RlRQY6----tylSntP|y|;n-J-Y|tQr}uH--0r{qvs--ZNV[lR[Q\f"),xd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("0qrsv{r-]U\\[T0vs-qrsv{rq5b`RlRQY6--n\bv{t-sy|n-Y|tQr}uH0r{qvs0vs-qrsv{rq5b`RlcR_aRelZN_X6--nvor-sy|n-znxH0r{qvsn\bv{t-sy|n-V_||sZnxHn\bv{t-rpA-d|yq]|vv|{Hn\bv{t-rp@-PnzrnQvrpv|{Hn\bv{t-rp@-cvr]|vv|{H0vs{qrs-SYNal`UNQRQ--n\bv{t-rp@-[|znyH0r{qvs0v{pyqr-Ip|zz|{K0v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9-vrZnv\x07h>jh>j9-vrZnv\x07h?jh>j9-vrZnv\x07h=jh?j9-vrZnv\x07h>jh?j9-vrZnv\x07h?jh?j6H--PnzrnQvrpv|{-J-{|znyv r5pnzrn_|nv|{Znv\x07-7-rp@5=;=9-=;=9-:>;=66H--0vs-qrsv{rq5b`RlRQY6----Y|tQr}u-J-y|t?5:z]|vv|{; 6H--0r{qvs--V_||sZnx-J-=;=H--0vs-qrsv{rq5b`RlcR_aRelZN_X6----V_||sZnx-J-r}5no5znx-:->;=69-=;>6H--0r{qvs--0v{pyqr-I|yq}|lrr\x07K--0v{pyqr-Ir{zn}lrr\x07K--0v{pyqr-Iunq|zn}lrr\x07K--0v{pyqr-Is|tlrr\x07K--ZNV[lR[Q\f"),wd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("0qrsv{r-]U\\[T0qrsv{r-OYNPXlP\\Y\\_-rpA5=;=EC9-=;>=C9-=;>AF9->;=6{vs|z-sy|n-sy||H{vs|z-nz}yrPor-}n{|=lzn}H{vs|z-znA-}n{|=lznv\x07H{vs|z-sy|n-}n{|=l ||zH0vs-qrsv{rq5b`RlYbZV[N[PR6--{vs|z-nz}yrPor-}n{|=lyzv{n{prZn}H0r{qvs{vs|z-nz}yrPor-}n{|>lzn}H{vs|z-znA-}n{|>lznv\x07H{vs|z-sy|n-}n{|>l ||zH0vs-qrsv{rq5b`RlYbZV[N[PR6--{vs|z-nz}yrPor-}n{|>lyzv{n{prZn}H0r{qvs{vs|z-sy|n-z|qryNy}unH{vs|z-sy|n-}|trH0vs-qrsv{rq5b`RlP\\[`aN[alP\\Y\\_6--{vs|z-rp@-p|{n{P|y|H0r{qvsp-Pyv}}r-\n--znA-znv\x07V{rrH--sy|n-sy||V{qr\x07H\fH0vs-[bZlPYV]]R_`-K-=--{vs|z-Pyv}}r-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|9-sy|n- ||z6-\n--sy|n-urn-J-q|5qvrpv|{9-rp|6H--rp@-q-J-qvrpv|{-7-urnH--rp@-}-J-rp|-:-qH--rp@-\0-J-}-7- ||zH--r{-{|znyv r5q-8-\x006H\frp@-to?u5rp@-p6-\n----rpA-X-J-rpA5=;=9-:>;=-<-@;=9-?;=-<-@;=9-:>;=6H----rpA-}-J-zv\x075rpA5p;ot9-X; 69-rpA5p;to9-X;\x07\b69-r}5p;o9-p;t66H----rpA-\0-J-zv\x075rpA5};\x07\b9-p;69-rpA5p;9-};\b \x0769-r}5};\x079-p;66H----sy|n-q-J-\0;\x07-:-zv{5\0;9-\0;\b6H----sy|n-r-J->;=r:>=H----r{-rp@5no5\0; -8-5\0;-:-\0;\b6-<-5C;=-7-q-8-r669-q-<-5\0;\x07-8-r69-\0;\x076H\frp@-u?to5rp@-p6-\n----rpA-X-J-rpA5>;=9-?;=-<-@;=9->;=-<-@;=9-@;=6H----rp@-}-J-no5snp5p;\x07\x07\x07-8-X;\x07\b 6-7-C;=-:-X;6H----r{-p; -7-zv\x075X;\x07\x07\x079-pynz}5}-:-X;\x07\x07\x079-=;=9->;=69-p;\b6H\fZNV[lORS\\_R|vq-znv{56-\n--ZNV[l`aN_a--<<-JJJ-顶部裁切-JJJ--sy|n-||sP]|tr-J-}|5pynz}5:PnzrnQvrpv|{;\b9-=;=9->;=69-@;=6H--vs-5----V_||sZnx-K-=;B-33----d|yq]|vv|{;\b-K-z|qryO|{qv{tZn\x07;\b-:-||sP]|tr-7-5z|qryO|{qv{tZn\x07;\b-:-z|qryO|{qv{tZv{;\b6--6-\n----qvpnqH--\f--<<-JJJJJJJJJJJJJJ--<<-JJJ-前置裁切计算-JJJ--0vs-[bZlPYV]]R_`-K-=----o||y-pyv}}rqH----rpA-pyv}}r]|vv|{H----0}ntzn-{|yyly||}ln----s|-5-v{-v-J-=H-v-I-[bZlPYV]]R_`H-v-88-6-\n------pyv}}r]|vv|{-J-pyv}}rh-v-j;znv\x07V{rr-7-d|yq]|vv|{H------pyv}}rq-J-5pyv}}rh-v-j;sy||V{qr\x07-I-=;=-\v\v-no5sy||-:-pyv}}rh-v-j;sy||V{qr\x076-I->;=6H------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\x07-K-:=;B-33-pyv}}r]|vv|{;\x07-I-=;BH------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\b-K-:=;B-33-pyv}}r]|vv|{;\b-I-=;BH------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{; -K-:=;B-33-pyv}}r]|vv|{; -I-=;BH------vs-5pyv}}rq6-\n--------qvpnqH------\f----\f----0}ntzn-{|yyly||}lr{q--0r{qvs--<<-JJJJJJJJJJJJJJJJ--0v{pyqr-Ipyv}}v{tl}yn{rlsntzr{K--rpA-qvssrP|y|-J-rpA5-qvssr9-|}npv\b-6H--_rsyrprqYvtu-rsyrprqYvtu-J-_rsyrprqYvtu5-rp@5-=;=-69-rp@5-=;=-69-rp@5-=;=-69-rp@5-=;=-6-6H--rp@-|nyRzvvr_nqvn{pr-J-rzvvrH--0v{pyqr-Iy|tqr}uoslsntzr{K--0v{pyqr-Izn}lsntzr{K--0v{pyqr-Ip|y|lsntzr{K--0v{pyqr-Iny}unzn}lsntzr{K--0v{pyqr-Iny}unrlsntzr{K--0v{pyqr-I}rpynzn}lsntzr{K--0v{pyqr-I{|znylsntzr{lortv{K--0v{pyqr-I{|znylsntzr{lzn}K--0v{pyqr-Irzvvrzn}lsntzr{K--<<-nppzynv|{--0v{pyqr-Iyvtul}u|{tlsntzr{K--0v{pyqr-Iyvtulsntzr{lortv{K--0v{pyqr-Iyvtulsntzr{lzn}K--0v{pyqr-Iyvtulsntzr{lr{qK--<<-z|qynv|{--0v{pyqr-In|zn}lsntzr{K--rp@-|t|v{tYvtu-J-rsyrprqYvtu;qvrpQvssr-8-rsyrprqYvtu;v{qvrpQvssr-8-rsyrprqYvtu;qvrp`}rpyn-8-rsyrprqYvtu;v{qvrp`}rpyn-8-|nyRzvvr_nqvn{prH--0v{pyqr-Ir{zn}lsntzr{K--tylSntP|y|-J-rpA5-|t|v{tYvtu9-qvssrP|y|;n-6H--<<-JJJ-纯色-JJJ--0vs-qrsv{rq5b`RlP\\[`aN[alP\\Y\\_6----tylSntP|y|-J-rpA5p|{n{P|y|;9-p|{n{P|y|;t9-p|{n{P|y|;o9-|}npv\b6H--0r{qvs--<<-JJJJJJJJJJJ--<<-JJJ-楼层显示-JJJ--sy|n-sy||\\}npv\b-J->;=H--vs-5u|{Sy||V{qr\x07-K-:=;=>-33-no5sy||-:-u|{Sy||V{qr\x076-K-=;FF6-\n----sy||\\}npv\b-J-=;?-7-zv{55>;=-8-PnzrnQvrpv|{;\b69->;=6H--\f--tylSntP|y|;n-J-tylSntP|y|;n-7-sy||\\}npv\b-7-ovtu{rH--<<-JJJJJJJJJJJJJJ--<<-颜色增益调整,在色调映射前--rp@-toP|y|-J-tylSntP|y|;toH--rp@-uP|y|-J-to?u5toP|y|6H--rp@-sv{nyU`c-J-rp@5uP|y|;\x079-uP|y|;\b-8-p|y|`nnv|{9-uP|y|; -8-p|y|Ovtu{r6H--tylSntP|y|;to-J-u?to5sv{nyU`c6H---ZNV[lZ\\QRYlP\\Y\\_--<<色调映射-色彩空间转换--0v{pyqr-I|{rzn}}v{tlsntzr{K--0v{pyqr-Ir{p|qv{tlsntzr{K--<<-JJJ-全景图-JJJ--rp@-}n{|=a|crr\x07-J-{|znyv r5d|yq]|vv|{;\x07\b -:-}n{|=lznv\x07h@j;\x07\b 6H--}n{|=a|crr\x07-J- ||zcrp|5PnzrnQvrpv|{9-}n{|=a|crr\x079-}n{|=l ||z6H--}n{|=a|crr\x07-J-}n{|=a|crr\x07-7-zn@5}n{|=lznv\x076H--rp@-}n{|>a|crr\x07-J-{|znyv r5d|yq]|vv|{;\x07\b -:-}n{|>lznv\x07h@j;\x07\b 6H--}n{|>a|crr\x07-J- ||zcrp|5PnzrnQvrpv|{9-}n{|>a|crr\x079-}n{|>l ||z6H--}n{|>a|crr\x07-J-}n{|>a|crr\x07-7-zn@5}n{|>lznv\x076H--rpA-}n{|P|y|H--rpA-}n{|=P|y|-J-r\x07rPor5}n{|=lzn}9-}n{|=a|crr\x076H--rpA-}n{|>P|y|-J-r\x07rPor5}n{|>lzn}9-}n{|>a|crr\x076H--0vs-qrsv{rq5b`RlYbZV[N[PR6----}n{|=P|y|;n-J->;=-:-r\x07rPor5}n{|=lyzv{n{prZn}9-}n{|=a|crr\x076;H----}n{|>P|y|;n-J->;=-:-r\x07rPor5}n{|>lyzv{n{prZn}9-}n{|>a|crr\x076;H--0r{qvs--0vs-qrsv{rq5b`RlOYNPXla_N[`VaV\\[6----sy|n-oynpx]|tr-J-np|5:?;=-7-}|tr-8->;=6H----}n{|P|y|-J-zv\x075}n{|=P|y|9-OYNPXlP\\Y\\_9-zv{5>;=9-oynpx]|tr66H----}n{|P|y|-J-zv\x075}n{|P|y|9-}n{|>P|y|9-zn\x075=;=9-oynpx]|tr-:-]V-8->;=66H--0ryvs-qrsv{rq5b`Rl`]_RNQla_N[`VaV\\[6----rp?-prr{Pr{rP||q-J-r|yv|{-7-}v\x07ry_nv|-<-?;=H----sy|n-n{vv|{_nqv-J-qvn{pr5rp?5=;=9-=;=69-prr{Pr{rP||q6-7->;?H----sy|n-n{vv|{]|tr-J-qvn{pr5tylSntP||q;\x07\b9-prr{Pr{rP||q6-<-n{vv|{_nqvH----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-z||ur}5=;=9-=;?9-}|tr-:-n{vv|{]|tr66H--0ryr----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-}|tr6H--0r{qvs--tylSntP|y|-J-zv\x075}n{|P|y|9-tylSntP|y|9-z|qryNy}un6H--<<-JJJJJJJJJJJJJJ--0v{pyqr-Is|tlsntzr{K--0v{pyqr-I}rzyv}yvrqlny}unlsntzr{K--0v{pyqr-Iqvurv{tlsntzr{K--0vs-qrsv{rq5b`RlRQY6----tylSntP|y|;n-J-Y|tQr}uH--0r{qvs--ZNV[lR[Q\f");new d.Vector4;var ra={modelAlpha:new d.Uniform(0),progress:new d.Uniform(0),pano0_map:new d.Uniform(null),pano0_luminanceMap:new d.Uniform(null),pano0_matrix:new d.Uniform(new d.Matrix4),pano0_zoom:new d.Uniform(1),pano1_map:new d.Uniform(null),pano1_luminanceMap:new d.Uniform(null),pano1_matrix:new d.Uniform(new d.Matrix4),pano1_zoom:new d.Uniform(1),clippers:new d.Uniform([]),shownFloorIndex:new d.Uniform(-1),constantColor:new d.Uniform(null),geometricError:new d.Uniform(0),pixelRatio:new d.Uniform(1),resolution:new d.Uniform(new d.Vector2(512,512)),floor:new d.Uniform(0),brightness:new d.Uniform(1),modelBoundingMin:new d.Uniform(new d.Vector3),modelBoundingMax:new d.Uniform(new d.Vector3),colorSaturation:new d.Uniform(0),colorBrightness:new d.Uniform(0)},Ed={none:{vertexShader:Ad,fragmentShader:gd,uniforms:d.UniformsUtils.merge([ra,{opacity:{value:1}},d.UniformsLib.fog]),lights:!1,clipping:!1},basic:{vertexShader:yd,fragmentShader:bd,uniforms:d.UniformsUtils.merge([ra,d.ShaderLib.basic.uniforms]),lights:!1,clipping:!0},phong:{vertexShader:xd,fragmentShader:wd,uniforms:d.UniformsUtils.merge([ra,d.ShaderLib.phong.uniforms]),lights:!0,clipping:!0}},Jr=function(n){se(t,n);function t(e,r){e===void 0&&(e="basic"),r===void 0&&(r={});var i=this,a,o,s,l,u,c,f,m,A,h,p,g,v,y,b,x,w,E,C,M,R,L,S,I,O,P=Ed[e];i=n.call(this,{vertexShader:P.vertexShader,fragmentShader:P.fragmentShader,uniforms:d.UniformsUtils.clone(P.uniforms),lights:P.lights,clipping:P.clipping,defines:{USE_CONSTANT_COLOR:!1,USE_EDL:!1,USE_HQ_WEIGHT:!1,USE_HQ_DEPTH:!1,NUM_CLIPPING_BOX:!1,USE_CLIPFLOOR:!1,USE_VERTEX_MARK:!1,USE_LUMINANCE:!1,USE_PANO_OPACITY:!1,USE_BLACK_TRANSITION:!1,USE_SPREAD_TRANSITION:!1,USE_POINT_NORMAL:!1,USE_POINT_CIRCLE:!1,USE_POINT_ADAPTIVE_SIZE:!1,USE_POINT_COLOR_ALTITUDE:!1}})||this,i.shaderType=e,i.color=new d.Color(16777215),i.map=null,i.lightMap=null,i.lightMapIntensity=1,i.aoMap=null,i.aoMapIntensity=1,i.specularMap=null,i.specular=new d.Color(1118481),i.alphaMap=null,i.envMap=null,i.reflectivity=1,i.refractionRatio=.98,i.emissiveMap=null,i.emissive=new d.Color(0),i.emissiveIntensity=1,i.bumpMap=null,i.bumpScale=1,i.normalMap=null,i.normalMapType=d.TangentSpaceNormalMap,i.normalScale=new d.Vector2(1,1),i.displacementMap=null,i.displacementScale=1,i.displacementBias=0,i.shininess=30;var F,V=null,D=null;return Object.defineProperties(i,{pano0:{get:function(){return V},set:function(z){if(V!==z){V=z,z===null?(this.uniforms.pano0_map.value=null,this.uniforms.pano0_luminanceMap.value=null,this.uniforms.pano0_matrix.value.identity(),this.uniforms.pano0_zoom.value=1):(this.uniforms.pano0_map.value=z.map instanceof Ne?z.map.texture:z.map,this.uniforms.pano0_luminanceMap.value=z.luminanceMap instanceof Ne?z.luminanceMap.texture:z.luminanceMap,this.uniforms.pano0_matrix.value.copy(z.matrix),this.uniforms.pano0_zoom.value=z.zoom);var U=this.uniforms.pano0_luminanceMap.value!==null&&this.uniforms.pano1_luminanceMap.value!==null,H=this.defines.USE_LUMINANCE;H!==U&&(this.defines.USE_LUMINANCE=U,this.needsUpdate=!0)}}},pano1:{get:function(){return D},set:function(z){if(D!==z){D=z,z===null?(this.uniforms.pano1_map.value=null,this.uniforms.pano1_luminanceMap.value=null,this.uniforms.pano1_matrix.value.identity(),this.uniforms.pano1_zoom.value=1):(this.uniforms.pano1_map.value=z.map instanceof Ne?z.map.texture:z.map,this.uniforms.pano1_luminanceMap.value=z.luminanceMap instanceof Ne?z.luminanceMap.texture:z.luminanceMap,this.uniforms.pano1_matrix.value.copy(z.matrix),this.uniforms.pano1_zoom.value=z.zoom);var U=this.uniforms.pano0_luminanceMap.value!==null&&this.uniforms.pano1_luminanceMap.value!==null,H=this.defines.USE_LUMINANCE;H!==U&&(this.defines.USE_LUMINANCE=U,this.needsUpdate=!0)}}},modelAlpha:{get:function(){return this.uniforms.modelAlpha.value},set:function(z){this.uniforms.modelAlpha.value=z}},progress:{get:function(){return this.uniforms.progress.value},set:function(z){this.uniforms.progress.value=z}},transition:{get:function(){return this.defines.USE_BLACK_TRANSITION?"BLACK":this.defines.USE_SPREAD_TRANSITION?"SPREAD":"FADE"},set:function(z){var U=this.defines.USE_BLACK_TRANSITION,H=this.defines.USE_SPREAD_TRANSITION;this.defines.USE_BLACK_TRANSITION=!1,this.defines.USE_SPREAD_TRANSITION=!1,this.defines["USE_".concat(z,"_TRANSITION")]=!0;var K=!1;U!==this.defines.USE_BLACK_TRANSITION&&(K=!0),H!==this.defines.USE_SPREAD_TRANSITION&&(K=!0),K&&(this.needsUpdate=!0)}},constantColor:{get:function(){return this.uniforms.constantColor.value},set:function(z){this.uniforms.constantColor.value=z;var U=this.defines.USE_CONSTANT_COLOR,H=z!==null;U!==H&&(this.defines.USE_CONSTANT_COLOR=H,this.needsUpdate=!0)}},opacity:{get:function(){return this.uniforms.opacity.value},set:function(z){this.uniforms.opacity.value=z}},shownFloorIndex:{get:function(){return this.uniforms.shownFloorIndex.value},set:function(z){this.uniforms.shownFloorIndex.value=z}},brightness:{get:function(){return this.uniforms.brightness.value},set:function(z){this.uniforms.brightness.value=z}},clippers:{get:function(){return F},set:function(z){F!==z&&(F=z,this.uniforms.clippers.value=(F||[]).map(function(U){var H=typeof U.floorIndex=="number"?U.floorIndex:-1,K=new d.Matrix4().getInverse(U.clippingBoxMatrix);return{matrixInverse:K,floorIndex:H}}),this.needsUpdate=!0)}},useEDL:{get:function(){return this.defines.USE_EDL},set:function(z){z!==this.defines.USE_EDL&&(this.defines.USE_EDL=z,this.needsUpdate=!0)}},useHQWeight:{get:function(){return this.defines.USE_HQ_WEIGHT},set:function(z){z!==this.defines.USE_HQ_WEIGHT&&(this.defines.USE_HQ_WEIGHT=z,this.needsUpdate=!0)}},useHQDepth:{get:function(){return this.defines.USE_HQ_DEPTH},set:function(z){z!==this.defines.USE_HQ_DEPTH&&(this.defines.USE_HQ_DEPTH=z,this.needsUpdate=!0)}},floor:{get:function(){return this.uniforms.floor.value},set:function(z){this.uniforms.floor.value=z}},colorSaturation:{get:function(){return this.uniforms.colorSaturation.value},set:function(z){this.uniforms.colorSaturation.value=z}},colorBrightness:{get:function(){return this.uniforms.colorBrightness.value},set:function(z){this.uniforms.colorBrightness.value=z}}}),i.pano0=(a=r.pano0)!==null&&a!==void 0?a:me.pano0,i.pano1=(o=r.pano1)!==null&&o!==void 0?o:me.pano1,i.modelAlpha=(s=r.modelAlpha)!==null&&s!==void 0?s:me.modelAlpha,i.progress=(l=r.progress)!==null&&l!==void 0?l:me.progress,i.transition=(u=r.transition)!==null&&u!==void 0?u:me.transition,i.constantColor=(c=r.constantColor)!==null&&c!==void 0?c:me.constantColor,i.opacity=(f=r.opacity)!==null&&f!==void 0?f:me.opacity,i.floorStyle=(m=r.floorStyle)!==null&&m!==void 0?m:me.floorStyle,i.shownFloorIndex=(A=r.shownFloorIndex)!==null&&A!==void 0?A:me.shownFloorIndex,i.clippers=(h=r.clippers)!==null&&h!==void 0?h:me.clippers,i.useEDL=(p=r.useEDL)!==null&&p!==void 0?p:me.useEDL,i.useHQWeight=(g=r.useHQWeight)!==null&&g!==void 0?g:me.useHQWeight,i.useHQDepth=(v=r.useHQDepth)!==null&&v!==void 0?v:me.useHQDepth,i.pointSize=(y=r.pointSize)!==null&&y!==void 0?y:me.pointSize,i.pointColor=(b=r.pointColor)!==null&&b!==void 0?b:me.pointColor,i.pointShape=(x=r.pointShape)!==null&&x!==void 0?x:me.pointShape,i.pointScale=(w=r.pointScale)!==null&&w!==void 0?w:me.pointScale,i.pointBack=(E=r.pointBack)!==null&&E!==void 0?E:me.pointBack,i.pointMinPixel=(C=r.pointMinPixel)!==null&&C!==void 0?C:me.pointMinPixel,i.pointMaxPixel=(M=r.pointMaxPixel)!==null&&M!==void 0?M:me.pointMaxPixel,i.gradientTexture=(R=r.gradientTexture)!==null&&R!==void 0?R:me.gradientTexture,i.brightness=(L=r.brightness)!==null&&L!==void 0?L:me.brightness,i.colorSaturation=(S=r.colorSaturation)!==null&&S!==void 0?S:me.colorSaturation,i.colorBrightness=(I=r.colorBrightness)!==null&&I!==void 0?I:me.colorBrightness,i.customShaders=(O=r.customShaders)!==null&&O!==void 0?O:me.customShaders,i.customShaderHash="",i.customShaderUniforms={},i.customShaderDefines={},i.floor=0,i.transparent=!0,i}return t.prototype.onBeforeCompile=function(e,r){var i=this,a,o,s=this.customShaders.filter(function(g){return g.type.includes(i.shaderType)}),l=s.reduce(function(g,v){return g+v.vertex.mainBefore},""),u=s.reduce(function(g,v){return g+v.vertex.mainStart},""),c=s.reduce(function(g,v){return g+v.vertex.mainEnd},""),f=s.reduce(function(g,v){return g+v.fragment.mainBefore},""),m=s.reduce(function(g,v){return g+v.fragment.mainStart},""),A=s.reduce(function(g,v){return g+v.fragment.mainModelColor},""),h=s.reduce(function(g,v){return g+v.fragment.mainEnd},"");e.vertexShader=e.vertexShader.replace(/MAIN_BEFORE/g,l),e.fragmentShader=e.fragmentShader.replace(/MAIN_BEFORE/g,f),e.vertexShader=e.vertexShader.replace(/MAIN_START/g,u),e.fragmentShader=e.fragmentShader.replace(/MAIN_START/g,m),e.vertexShader=e.vertexShader.replace(/MAIN_END/g,c),e.fragmentShader=e.fragmentShader.replace(/MAIN_END/g,h),e.fragmentShader=e.fragmentShader.replace(/MAIN_MODEL_COLOR/g,A);var p=String((o=(a=this.clippers)===null||a===void 0?void 0:a.length)!==null&&o!==void 0?o:0);e.vertexShader=e.vertexShader.replace(/NUM_CLIPPERS/g,p),e.fragmentShader=e.fragmentShader.replace(/NUM_CLIPPERS/g,p),s.forEach(function(g){g.onBeforeCompile(e,r)})},t.prototype.refreshUniforms=function(e){var r,i,a=this.uniforms;a.diffuse&&a.diffuse.value.copy(this.color),a.opacity&&(a.opacity.value=this.opacity),a.color&&a.diffuse.value.copy(this.color),a.emissive&&a.emissive.value.copy(this.emissive).multiplyScalar(this.emissiveIntensity),a.map&&(a.map.value=this.map),a.alphaMap&&(a.alphaMap.value=this.alphaMap),a.specularMap&&(a.specularMap.value=this.specularMap),a.envMap&&(a.envMap.value=this.envMap,a.flipEnvMap.value=!((r=this.envMap)===null||r===void 0)&&r.isCubeTexture?-1:1,a.reflectivity.value=this.reflectivity,a.refractionRatio.value=this.refractionRatio,a.maxMipLevel.value=this.envMap&&(i=e==null?void 0:e.properties.get(this.envMap).__maxMipLevel)!==null&&i!==void 0?i:0),a.lightMap&&(a.lightMap.value=this.lightMap,a.lightMapIntensity.value=this.lightMapIntensity),a.aoMap&&(a.aoMap.value=this.aoMap,a.aoMapIntensity.value=this.aoMapIntensity),a.specular&&a.specular.value.copy(this.specular),a.shininess&&(a.shininess.value=Math.max(this.shininess,1e-4)),a.emissiveMap&&(a.emissiveMap.value=this.emissiveMap),a.bumpMap&&(a.bumpMap.value=this.bumpMap,a.bumpScale.value=this.bumpScale,this.side===d.BackSide&&(a.bumpScale.value*=-1)),a.normalMap&&(a.normalMap.value=this.normalMap,a.normalScale.value.copy(this.normalScale),this.side===d.BackSide&&a.normalScale.value.negate()),a.displacementMap&&(a.displacementMap.value=this.displacementMap,a.displacementScale.value=this.displacementScale,a.displacementBias.value=this.displacementBias);var o;this.map?o=this.map:this.specularMap?o=this.specularMap:this.displacementMap?o=this.displacementMap:this.normalMap?o=this.normalMap:this.bumpMap?o=this.bumpMap:this.alphaMap?o=this.alphaMap:this.emissiveMap&&(o=this.emissiveMap),o!==void 0&&(o.matrixAutoUpdate===!0&&o.updateMatrix(),a.uvTransform.value.copy(o.matrix));var s;this.aoMap?s=this.aoMap:this.lightMap&&(s=this.lightMap),s!==void 0&&(s.matrixAutoUpdate===!0&&s.updateMatrix(),a.uv2Transform.value.copy(s.matrix))},t.prototype.update=function(e,r,i){var a="".concat(i.id,":").concat(i.materialVersion);a!==this.syncModelVersion&&(Object.assign(this,i.getMaterial()),this.syncModelVersion=a);var o=this.customShaders.map(function(v){return v.getHash()}).join("");this.customShaderHash!==o&&(this.customShaderHash=o,this.needsUpdate=!0);for(var s=this.customShaders.reduce(function(v,y){return Object.assign(v,y.defines)},{}),l=Object.keys(this.customShaderDefines),u=0,c=l;u<c.length;u++){var f=c[u];delete this.defines[f]}this.customShaderDefines=s,Object.assign(this.defines,this.customShaderDefines);for(var m=this.customShaders.reduce(function(v,y){return Object.assign(v,y.uniforms)},{}),A=Object.keys(this.customShaderUniforms),h=0,p=A;h<p.length;h++){var g=p[h];delete this.uniforms[g]}this.customShaderUniforms=m,Object.assign(this.uniforms,this.customShaderUniforms),this.visible=!0,this.refreshUniforms(e),this.shaderType==="none"?(this.depthWrite=!1,this.transparent=!0):(this.transparent=!1,this.depthWrite=!0,this.shownFloorIndex>-1&&(this.transparent=this.shownFloorIndex!==this.floor),this.opacity<1&&(this.transparent=!0),this.alphaMap&&(this.transparent=!0),this.brightness<1&&(this.transparent=!0),this.transparent&&(this.depthWrite=!1),this.floorStyle==="VISIBILITY"&&this.shownFloorIndex!==-1&&this.floor!==this.shownFloorIndex&&(this.visible=!1)),this.uniforms.pixelRatio.value=r.pixelRatio,this.uniforms.resolution.value.copy(r.resolution),this.uniforms.modelBoundingMax.value.copy(i.bounding.max),this.uniforms.modelBoundingMin.value.copy(i.bounding.min)},t.prototype.copy=function(e){return n.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.specular.copy(e.specular),this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.emissiveMap=e.emissiveMap,this.emissive.copy(e.emissive),this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.shininess=e.shininess,this.customShaders=e.customShaders,this.pano0=e.pano0,this.pano1=e.pano1,this.modelAlpha=e.modelAlpha,this.progress=e.progress,this.transition=e.transition,this.opacity=e.opacity,this.constantColor=e.constantColor,this.shownFloorIndex=e.shownFloorIndex,this.brightness=e.brightness,this.clippers=e.clippers,this.useEDL=e.useEDL,this.useHQWeight=e.useHQWeight,this.useHQDepth=e.useHQDepth,this.pointColor=e.pointColor,this.pointSize=e.pointSize,this.pointShape=e.pointShape,this.pointScale=e.pointScale,this.pointBack=e.pointBack,this.pointMinPixel=e.pointMinPixel,this.pointMaxPixel=e.pointMaxPixel,this.gradientTexture=e.gradientTexture,this.floor=e.floor,this.colorSaturation=e.colorSaturation,this.colorBrightness=e.colorBrightness,this},t}(d.ShaderMaterial);const Sd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("{vs|z-sy|n-sy||H0vs-qrsv{rq5b`RlP\\[`aN[alP\\Y\\_6--{vs|z-rp@-p|{n{P|y|H0r{qvs0vs-qrsv{rq5b`Rl]\\V[al[\\_ZNY6--n\bv{t-rp@-[|znyH0r{qvs0vs-qrsv{rq5b`RlRQY6--n\bv{t-sy|n-Y|tQr}uH0r{qvsp-Pyv}}r-\n--znA-znv\x07V{rrH--sy|n-sy||V{qr\x07H\fH0vs-[bZlPYV]]R_`-K-=--{vs|z-Pyv}}r-pyv}}rh[bZlPYV]]R_`jH0r{qvsn\bv{t-rpA-d|yq]|vv|{Hn\bv{t-rp@-PnzrnQvrpv|{Hn\bv{t-rp@-P|y|Hn\bv{t-sy|n-]|v{`v rH{vs|z-sy|n-|}npv\bH{vs|z-sy|n-z|qryNy}unH{vs|z-sy|n-u|{Sy||V{qr\x07H<<u调整{vs|z-sy|n-p|y|`nnv|{H{vs|z-sy|n-p|y|Ovtu{rH0v{pyqr-Ip|zz|{K0v{pyqr-Is|tl}nlsntzr{K0v{pyqr-Iy|tqr}uosl}nlsntzr{K0v{pyqr-Ipyv}}v{tl}yn{rl}nlsntzr{Krp@-nqwP|y|arz}rnr5rp@-p|y|9-sy|n-rz}rnr6\n----<<-将色温范围从-:>;=-到->;=-映射到实际的色温范围----sy|n-rz}-J-5rz}rnr-8->;=6-7-B===;=H-<<-范围从-=-到->====----<<-计算色温系数----sy|n-lsnp|9-tlsnp|9-olsnp|H----vs-5rz}-IJ-CC==;=6-\n--------lsnp|-J->;=H--------tlsnp|-J-=;@F==E>BDEDCF=>FC=DEA-7-y|t5rz}-<->==;=6-:-=;C@>EA>AA@DEEC?DAB=FEH--------olsnp|-J-rz}-IJ->F==;=-L-=;=-G-=;BA@?=CDEF>>=>FC=DEA@-7-y|t5rz}-<->==;=-:->=;=6-:->;>FC?BA=EF>AH----\f-ryr-\n--------lsnp|-J->;?F?F@C>EC=C?DAB=FE=A-7-}|5rz}-<->==;=-:-C=;=9-:=;>@@?=ADBF?6H--------tlsnp|-J->;>?FEF=EC=EFB?FA>>DCB-7-}|5rz}-<->==;=-:-C=;=9-:=;=DBB>AEAF?6H--------olsnp|-J->;=H----\f----<<-调整颜色----rp@-nqwrqP|y|H----nqwrqP|y|;-J-pynz}5p|y|;-7-lsnp|9-=;=9->;=6H----nqwrqP|y|;t-J-pynz}5p|y|;t-7-tlsnp|9-=;=9->;=6H----nqwrqP|y|;o-J-pynz}5p|y|;o-7-olsnp|9-=;=9->;=6H----r{-nqwrqP|y|H\frp@-to?u5rp@-p6-\n----rpA-X-J-rpA5=;=9-:>;=-<-@;=9-?;=-<-@;=9-:>;=6H----rpA-}-J-zv\x075rpA5p;ot9-X; 69-rpA5p;to9-X;\x07\b69-r}5p;o9-p;t66H----rpA-\0-J-zv\x075rpA5};\x07\b9-p;69-rpA5p;9-};\b \x0769-r}5};\x079-p;66H----sy|n-q-J-\0;\x07-:-zv{5\0;9-\0;\b6H----sy|n-r-J->;=r:>=H----r{-rp@5no5\0; -8-5\0;-:-\0;\b6-<-5C;=-7-q-8-r669-q-<-5\0;\x07-8-r69-\0;\x076H\frp@-u?to5rp@-p6-\n----rpA-X-J-rpA5>;=9-?;=-<-@;=9->;=-<-@;=9-@;=6H----rp@-}-J-no5snp5p;\x07\x07\x07-8-X;\x07\b 6-7-C;=-:-X;6H----r{-p; -7-zv\x075X;\x07\x07\x079-pynz}5}-:-X;\x07\x07\x079-=;=9->;=69-p;\b6H\fZNV[lORS\\_R|vq-znv{56-\n--ZNV[l`aN_a--<<-JJJ-点大小剔除-JJJ--vs-5]|v{`v r-I-=;==>6-\n----qvpnqH--\f--<<-JJJ-前置裁切计算-JJJ--0vs-[bZlPYV]]R_`-K-=----o||y-pyv}}rqH----rpA-pyv}}r]|vv|{H----0}ntzn-{|yyly||}ln----s|-5-v{-v-J-=H-v-I-[bZlPYV]]R_`H-v-88-6-\n------pyv}}r]|vv|{-J-pyv}}rh-v-j;znv\x07V{rr-7-d|yq]|vv|{H------pyv}}rq-J-5pyv}}rh-v-j;sy||V{qr\x07-I-=;=-\v\v-no5sy||-:-pyv}}rh-v-j;sy||V{qr\x076-I->;=6H------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\x07-K-:=;B-33-pyv}}r]|vv|{;\x07-I-=;BH------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\b-K-:=;B-33-pyv}}r]|vv|{;\b-I-=;BH------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{; -K-:=;B-33-pyv}}r]|vv|{; -I-=;BH------vs-5pyv}}rq6-\n--------qvpnqH------\f----\f----0}ntzn-{|yyly||}lr{q--0r{qvs--<<-JJJJJJJJJJJJJJJJ--<<-JJJ-形状裁切-JJJ--0vs-qrsv{rq5b`Rl]\\V[al`UN]RlPV_PYR6----sy|n--J-?;=-7-tyl]|v{P||q;\x07-:->;=H----sy|n--J-?;=-7-tyl]|v{P||q;\b-:->;=H----sy|n-pp-J-7-8-7H----vs-5]|v{`v r-K-@;=-33-pp-K->;=6-\n------qvpnqH----\f--0r{qvs--<<-JJJJJJJJJJJJJ--0v{pyqr-Ipyv}}v{tl}yn{rlsntzr{K--0v{pyqr-Iy|tqr}uoslsntzr{K--<<-JJJ-颜色-JJJ--rpA-sv{nyP|y|-J-_TOa|Yv{rn5rpA5P|y|9-|}npv\b66H--0vs-qrsv{rq5b`Rl]\\V[al[\\_ZNY6----0vs-qrsv{rq5b`Rl]\\V[alONPXlUVQQR[6------rp@-pnzrnQvrpv|{-J-{|znyv r5pnzrn]|vv|{-:-d|yq]|vv|{;\x07\b 6H------vs-5q|5pnzrnQvrpv|{9-[|zny6-I-=;=6-\n--------qvpnqH------\f----0ryvs-qrsv{rq5b`Rl]\\V[alONPXlQN_X6------rp@-pnzrnQvrpv|{-J-{|znyv r5pnzrn]|vv|{-:-d|yq]|vv|{;\x07\b 6H------vs-5q|5pnzrnQvrpv|{9-[|zny6-I-=;=6-\n--------sv{nyP|y|;\x07\b -J-sv{nyP|y|;\x07\b -7-=;EH------\f----0r{qvs--0r{qvs--tylSntP|y|-J-sv{nyP|y|H--<<-JJJJJJJJJJJ--<<-JJJ-纯色-JJJ--0vs-qrsv{rq5b`RlP\\[`aN[alP\\Y\\_6----tylSntP|y|-J-rpA5p|{n{P|y|;9-p|{n{P|y|;t9-p|{n{P|y|;o9-|}npv\b6H--0r{qvs--<<-JJJJJJJJJJJ--<<-JJJ-楼层显示-JJJ--sy|n-sy||\\}npv\b-J->;=H--vs-5u|{Sy||V{qr\x07-K-:=;=>-33-no5sy||-:-u|{Sy||V{qr\x076-K-=;FF6-\n----sy||\\}npv\b-J-=;>-7-zv{55>;=-8-PnzrnQvrpv|{;\b69->;=6H--\f--tylSntP|y|;n-J-tylSntP|y|;n-7-sy||\\}npv\bH--<<-JJJJJJJJJJJJJJ--tylSntP|y|;n-J-tylSntP|y|;n-7-z|qryNy}unH--<<提取亮度--rp@-toP|y|-J-tylSntP|y|;toH--rp@-uP|y|-J-to?u5toP|y|6H--rp@-sv{nyU`c-J-rp@5uP|y|;\x079-uP|y|;\b-8-p|y|`nnv|{9-uP|y|; -8-p|y|Ovtu{r6H--tylSntP|y|;to-J-u?to5sv{nyU`c6H--ZNV[lZ\\QRYlP\\Y\\_--0v{pyqr-I|{rzn}}v{tlsntzr{K--0v{pyqr-Ir{p|qv{tlsntzr{K--0v{pyqr-Is|tlsntzr{K--0v{pyqr-I}rzyv}yvrqlny}unlsntzr{K--0vs-qrsv{rq5b`RlRQY6----tylSntP|y|;n-J-Y|tQr}uH--0r{qvs--0vs-qrsv{rq5b`RlU^ldRVTUa6----sy|n-qvn{pr-J-?;=-7-yr{tu5tyl]|v{P||q;\x07\b-:-=;B6H----sy|n-rvtu-J-zn\x075=;=9->;=-:-qvn{pr6H----rvtu-J-}|5rvtu9->;B6H----tylSntP|y|;n-J-rvtuH----tylSntP|y|;\x07\b -J-tylSntP|y|;\x07\b -7-rvtuH--0r{qvs--ZNV[lR[Q\f"),Cd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("nvor-rp@-p|y|H0vs-qrsv{rq5b`Rl]\\V[alP\\Y\\_lNYaVabQR6--{vs|z-nz}yr?Q-tnqvr{ar\x07rH0r{qvs0vs-qrsv{rq5b`RlRQY6--n\bv{t-sy|n-Y|tQr}uH0r{qvs{vs|z-rp?-r|yv|{H{vs|z-sy|n-}v\x07ry_nv|H{vs|z-sy|n-}|v{`pnyrH{vs|z-sy|n-}|v{Zv{]v\x07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-vrZnv\x07h?jh>j9-vrZnv\x07h=jh?j9-vrZnv\x07h>jh?j9-vrZnv\x07h?jh?j6H--PnzrnQvrpv|{-J-{|znyv r5pnzrn_|nv|{Znv\x07-7-rp@5=;=9-=;=9-:>;=66H--<<传递nvor的p|y|到s里使用--<<动态调整}|v{`v r--sy|n-rny]|v{`v r-J-}|v{`pnyr-7-}v\x07ry_nv|H--0vs-qrsv{rq5b`Rl]\\V[al`VgRlTR\\ZRa_VP6----rny]|v{`v r-7J-tr|zrvpR|H----sy|n-urvtu-J->;=-<-}|wrpv|{Znv\x07h>jh>j-7-zv\x075>;=9-:z]|vv|{; 9-:}|wrpv|{Znv\x07h?jh@j6-7-?;=H----rny]|v{`v r-J-r|yv|{;\b-7-rny]|v{`v r-<-urvtuH--0ryvs-qrsv{rq5b`Rl]\\V[al`VgRlNaaR[bNaV\\[6----sy|n-urvtu-J->;=-<-}|wrpv|{Znv\x07h>jh>j-7-zv\x075>;=9-:z]|vv|{; 9-:}|wrpv|{Znv\x07h?jh@j6-7-?;=H----rny]|v{`v r-J-r|yv|{;\b-7-rny]|v{`v r-<-urvtuH--0r{qvs--tyl]|v{`v r-J-pynz}5rny]|v{`v r9-}|v{Zv{]v\x07ry-7-}v\x07ry_nv|9-}|v{Zn\x07]v\x07ry-7-}v\x07ry_nv|6H--]|v{`v r-J-tyl]|v{`v rH--0vs-qrsv{rq5b`Rl]\\V[alP\\Y\\_lNYaVabQR6----P|y|-J-trP|y|O\bUrvtu5tnqvr{ar\x07r9-d|yq]|vv|{6H--0ryr----P|y|-J-p|y|H--0r{qvs--0vs-qrsv{rq5b`Rl]\\V[al[\\_ZNY6----[|zny-J-{|znyv r5zn@5z|qryZnv\x076-7-{|zny6H--0r{qvs--0vs-qrsv{rq5b`RlRQY6----Y|tQr}u-J-y|t?5:z]|vv|{; 6H--0r{qvs--0vs-qrsv{rq5b`RlU^lQR]aU6----<<-sy|n-}|wSnp|-J-:=;B-7-r|yv|{;\b-<-5n{5s|-<-?;=6-7-z]|vv|{; 6H----<<-sy|n-_nqv-J-rny]|v{`v r-<-}|wSnp|H----sy|n-|vtv{nyQr}u-J-tyl]|vv|{;H----sy|n-nqwrqQr}u-J-|vtv{nyQr}u-8-=;>H----sy|n-nqw-J-nqwrqQr}u-<-|vtv{nyQr}uH----z]|vv|{;\x07\b -J-z]|vv|{;\x07\b -7-nqwH----tyl]|vv|{-J-}|wrpv|{Znv\x07-7-z]|vv|{H--0r{qvs--0v{pyqr-I|yq}|lrr\x07K--0v{pyqr-Is|tlrr\x07K--ZNV[lR[Q\f");var Md=Object.assign({pointScale:new d.Uniform(1),pointMinPixel:new d.Uniform(1),pointMaxPixel:new d.Uniform(1),opacity:new d.Uniform(1),gradientTexture:new d.Uniform(null),modelAlpha:new d.Uniform(0),clippers:new d.Uniform([]),shownFloorIndex:new d.Uniform(-1),constantColor:new d.Uniform(null),geometricError:new d.Uniform(0),pixelRatio:new d.Uniform(1),resolution:new d.Uniform(new d.Vector2(512,512)),floor:new d.Uniform(0),brightness:new d.Uniform(1),modelBoundingMin:new d.Uniform(new d.Vector3),modelBoundingMax:new d.Uniform(new d.Vector3),colorSaturation:new d.Uniform(0),colorBrightness:new d.Uniform(0)},d.UniformsUtils.clone(d.UniformsLib.fog)),ii=function(n){se(t,n);function t(e){e===void 0&&(e={});var r,i,a,o,s,l,u,c,f,m,A,h,p,g,v,y,b,x,w,E,C,M,R,L,S,I=n.call(this,{vertexShader:Cd,fragmentShader:Sd,uniforms:d.UniformsUtils.clone(Md),lights:!1,clipping:!0,defines:{USE_CONSTANT_COLOR:!1,USE_EDL:!1,USE_HQ_WEIGHT:!1,USE_HQ_DEPTH:!1,NUM_CLIPPING_BOX:!1,USE_CLIPFLOOR:!1,USE_VERTEX_MARK:!1,USE_MAP:!0,USE_UV:!0,USE_LUMINANCE:!1,USE_PANO_OPACITY:!1,USE_BLACK_TRANSITION:!1,USE_POINT_NORMAL:!1,USE_POINT_SHAPE_CIRCLE:!1,USE_POINT_SIZE_ATTENUATION:!1,USE_POINT_SIZE_GEOMETRIC:!1,USE_POINT_BACK_HIDDEN:!1,USE_POINT_BACK_DARK:!1}})||this,O;return I.customShaderHash="",I.customShaderUniforms={},I.customShaderDefines={},Object.defineProperties(I,{constantColor:{get:function(){return this.uniforms.constantColor.value},set:function(P){this.uniforms.constantColor.value=P;var F=this.defines.USE_CONSTANT_COLOR,V=P!==null;F!==V&&(this.defines.USE_CONSTANT_COLOR=V,this.needsUpdate=!0)}},opacity:{get:function(){return this.uniforms.opacity.value},set:function(P){this.uniforms.opacity.value=P}},modelAlpha:{get:function(){return this.uniforms.modelAlpha.value},set:function(P){this.uniforms.modelAlpha.value=P}},shownFloorIndex:{get:function(){return this.uniforms.shownFloorIndex.value},set:function(P){this.uniforms.shownFloorIndex.value=P}},clippers:{get:function(){return O},set:function(P){O!==P&&(O=P,this.uniforms.clippers.value=(O||[]).map(function(F){var V=typeof F.floorIndex=="number"?F.floorIndex:-1,D=new d.Matrix4().getInverse(F.clippingBoxMatrix);return{matrixInverse:D,floorIndex:V}}),this.needsUpdate=!0)}},pointColor:{get:function(){return this.defines.USE_POINT_COLOR_ALTITUDE===!0?"ALTITUDE":"RGB"},set:function(P){var F=P==="ALTITUDE";this.defines.USE_POINT_COLOR_ALTITUDE!==F&&(this.defines.USE_POINT_COLOR_ALTITUDE=F,this.needsUpdate=!0)}},pointSize:{get:function(){return this.defines.USE_POINT_SIZE_GEOMETRIC===!0?"GEOMETRIC":this.defines.USE_POINT_SIZE_ATTENUATION===!0?"ATTENUATION":"FIXED"},set:function(P){var F=P==="ATTENUATION",V=P==="GEOMETRIC";this.defines.USE_POINT_SIZE_GEOMETRIC!==V&&(this.defines.USE_POINT_SIZE_GEOMETRIC=V,this.needsUpdate=!0),this.defines.USE_POINT_SIZE_ATTENUATION!==F&&(this.defines.USE_POINT_SIZE_ATTENUATION=F,this.needsUpdate=!0)}},pointShape:{get:function(){return this.defines.USE_POINT_SHAPE_CIRCLE===!0?"CIRCLE":"SQUARE"},set:function(P){var F=P==="CIRCLE";this.defines.USE_POINT_SHAPE_CIRCLE!==F&&(this.defines.USE_POINT_SHAPE_CIRCLE=F,this.needsUpdate=!0)}},pointScale:{get:function(){return this.uniforms.pointScale.value},set:function(P){this.uniforms.pointScale.value=P}},pointBack:{get:function(){return this.defines.USE_POINT_BACK_HIDDEN===!0?"HIDDEN":this.defines.USE_POINT_BACK_DARK===!0?"DARK":"VISIBLE"},set:function(P){var F=P==="HIDDEN",V=P==="DARK";this.defines.USE_POINT_BACK_HIDDEN!==F&&(this.defines.USE_POINT_BACK_HIDDEN=F,this.needsUpdate=!0),this.defines.USE_POINT_BACK_DARK!==V&&(this.defines.USE_POINT_BACK_DARK=V,this.needsUpdate=!0)}},pointMinPixel:{get:function(){return this.uniforms.pointMinPixel.value},set:function(P){this.uniforms.pointMinPixel.value=P}},pointMaxPixel:{get:function(){return this.uniforms.pointMaxPixel.value},set:function(P){this.uniforms.pointMaxPixel.value=P}},useEDL:{get:function(){return this.defines.USE_EDL},set:function(P){P!==this.defines.USE_EDL&&(this.defines.USE_EDL=P,this.needsUpdate=!0)}},useHQWeight:{get:function(){return this.defines.USE_HQ_WEIGHT},set:function(P){P!==this.defines.USE_HQ_WEIGHT&&(this.defines.USE_HQ_WEIGHT=P,this.needsUpdate=!0)}},useHQDepth:{get:function(){return this.defines.USE_HQ_DEPTH},set:function(P){P!==this.defines.USE_HQ_DEPTH&&(this.defines.USE_HQ_DEPTH=P,this.needsUpdate=!0)}},gradientTexture:{get:function(){return this.uniforms.gradientTexture.value},set:function(P){this.uniforms.gradientTexture.value=P}},floor:{get:function(){return this.uniforms.floor.value},set:function(P){this.uniforms.floor.value=P}},brightness:{get:function(){return this.uniforms.brightness.value},set:function(P){this.uniforms.brightness.value=P}},colorSaturation:{get:function(){return this.uniforms.colorSaturation.value},set:function(P){this.uniforms.colorSaturation.value=P}},colorBrightness:{get:function(){return this.uniforms.colorBrightness.value},set:function(P){this.uniforms.colorBrightness.value=P}}}),I.pano0=(r=e.pano0)!==null&&r!==void 0?r:me.pano0,I.pano1=(i=e.pano1)!==null&&i!==void 0?i:me.pano1,I.modelAlpha=(a=e.modelAlpha)!==null&&a!==void 0?a:me.modelAlpha,I.progress=(o=e.progress)!==null&&o!==void 0?o:me.progress,I.transition=(s=e.transition)!==null&&s!==void 0?s:me.transition,I.constantColor=(l=e.constantColor)!==null&&l!==void 0?l:me.constantColor,I.opacity=(u=e.opacity)!==null&&u!==void 0?u:me.opacity,I.floorStyle=(c=e.floorStyle)!==null&&c!==void 0?c:me.floorStyle,I.shownFloorIndex=(f=e.shownFloorIndex)!==null&&f!==void 0?f:me.shownFloorIndex,I.clippers=(m=e.clippers)!==null&&m!==void 0?m:me.clippers,I.useEDL=(A=e.useEDL)!==null&&A!==void 0?A:me.useEDL,I.useHQWeight=(h=e.useHQWeight)!==null&&h!==void 0?h:me.useHQWeight,I.useHQDepth=(p=e.useHQDepth)!==null&&p!==void 0?p:me.useHQDepth,I.pointColor=(g=e.pointColor)!==null&&g!==void 0?g:me.pointColor,I.pointShape=(v=e.pointShape)!==null&&v!==void 0?v:me.pointShape,I.pointSize=(y=e.pointSize)!==null&&y!==void 0?y:me.pointSize,I.pointScale=(b=e.pointScale)!==null&&b!==void 0?b:me.pointScale,I.pointBack=(x=e.pointBack)!==null&&x!==void 0?x:me.pointBack,I.pointMinPixel=(w=e.pointMinPixel)!==null&&w!==void 0?w:me.pointMinPixel,I.pointMaxPixel=(E=e.pointMaxPixel)!==null&&E!==void 0?E:me.pointMaxPixel,I.gradientTexture=(C=e.gradientTexture)!==null&&C!==void 0?C:me.gradientTexture,I.brightness=(M=e.brightness)!==null&&M!==void 0?M:me.brightness,I.colorSaturation=(R=e.colorSaturation)!==null&&R!==void 0?R:me.colorSaturation,I.colorBrightness=(L=e.colorBrightness)!==null&&L!==void 0?L:me.colorBrightness,I.customShaders=(S=e.customShaders)!==null&&S!==void 0?S:me.customShaders,I.customShaderHash="",I.floor=0,I.transparent=!0,I}return t.prototype.onBeforeCompile=function(e,r){var i,a,o=this.customShaders.filter(function(p){return p.type.includes("pointcloud")}),s=o.reduce(function(p,g){return p+g.vertex.mainBefore},""),l=o.reduce(function(p,g){return p+g.vertex.mainStart},""),u=o.reduce(function(p,g){return p+g.vertex.mainEnd},""),c=o.reduce(function(p,g){return p+g.fragment.mainBefore},""),f=o.reduce(function(p,g){return p+g.fragment.mainStart},""),m=o.reduce(function(p,g){return p+g.fragment.mainModelColor},""),A=o.reduce(function(p,g){return p+g.fragment.mainEnd},"");e.vertexShader=e.vertexShader.replace(/MAIN_BEFORE/g,s),e.fragmentShader=e.fragmentShader.replace(/MAIN_BEFORE/g,c),e.vertexShader=e.vertexShader.replace(/MAIN_START/g,l),e.fragmentShader=e.fragmentShader.replace(/MAIN_START/g,f),e.vertexShader=e.vertexShader.replace(/MAIN_END/g,u),e.fragmentShader=e.fragmentShader.replace(/MAIN_END/g,A),e.fragmentShader=e.fragmentShader.replace(/MAIN_MODEL_COLOR/g,m);var h=String((a=(i=this.clippers)===null||i===void 0?void 0:i.length)!==null&&a!==void 0?a:0);e.vertexShader=e.vertexShader.replace(/NUM_CLIPPERS/g,h),e.fragmentShader=e.fragmentShader.replace(/NUM_CLIPPERS/g,h),o.forEach(function(p){p.onBeforeCompile(e,r)})},t.prototype.update=function(e,r,i){var a="".concat(i.id,":").concat(i.materialVersion);a!==this.syncModelVersion&&(Object.assign(this,i.getMaterial()),this.syncModelVersion=a);var o=this.customShaders.map(function(v){return v.getHash()}).join("");this.customShaderHash!==o&&(this.customShaderHash=o,this.needsUpdate=!0);for(var s=this.customShaders.reduce(function(v,y){return Object.assign(v,y.defines)},{}),l=Object.keys(this.customShaderDefines),u=0,c=l;u<c.length;u++){var f=c[u];delete this.defines[f]}this.customShaderDefines=s,Object.assign(this.defines,this.customShaderDefines);for(var m=this.customShaders.reduce(function(v,y){return Object.assign(v,y.uniforms)},{}),A=Object.keys(this.customShaderUniforms),h=0,p=A;h<p.length;h++){var g=p[h];delete this.uniforms[g]}this.customShaderUniforms=m,Object.assign(this.uniforms,this.customShaderUniforms),this.visible=!0,this.transparent=!1,this.shownFloorIndex>-1&&(this.transparent=this.shownFloorIndex!==this.floor),this.modelAlpha<1&&(this.transparent=!0),this.opacity<1&&(this.transparent=!0),this.brightness<1&&(this.transparent=!0),this.depthWrite=!0,this.depthTest=!0,this.useEDL&&(this.transparent=!1),this.useHQWeight?(this.depthWrite=!1,this.blending=d.CustomBlending,this.blendSrc=d.SrcAlphaFactor,this.blendSrcAlpha=d.SrcAlphaFactor,this.blendDst=d.OneFactor,this.blendDstAlpha=d.OneFactor):(this.blending=d.NormalBlending,this.blendDst=d.OneMinusSrcAlphaFactor,this.blendEquation=d.AddEquation,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null),this.floorStyle==="VISIBILITY"&&this.shownFloorIndex!==-1&&this.floor!==this.shownFloorIndex&&(this.visible=!1),this.uniforms.pixelRatio.value=r.pixelRatio,this.uniforms.resolution.value.copy(r.resolution),this.uniforms.modelBoundingMax.value.copy(i.bounding.max),this.uniforms.modelBoundingMin.value.copy(i.bounding.min)},t.prototype.copy=function(e){return n.prototype.copy.call(this,this),this.customShaders=e.customShaders,this.pano0=e.pano0,this.pano1=e.pano1,this.progress=e.progress,this.transition=e.transition,this.shownFloorIndex=e.shownFloorIndex,this.brightness=e.brightness,this.clippers=e.clippers,this.constantColor=e.constantColor,this.modelAlpha=e.modelAlpha,this.useEDL=e.useEDL,this.useHQWeight=e.useHQWeight,this.useHQDepth=e.useHQDepth,this.pointColor=e.pointColor,this.pointSize=e.pointSize,this.pointShape=e.pointShape,this.pointScale=e.pointScale,this.pointBack=e.pointBack,this.pointMinPixel=e.pointMinPixel,this.pointMaxPixel=e.pointMaxPixel,this.gradientTexture=e.gradientTexture,this.colorSaturation=e.colorSaturation,this.colorBrightness=e.colorBrightness,this},t}(d.ShaderMaterial),nn=function(n){se(t,n);function t(e){var r=e.preserveDrawingBuffer,i=r===void 0?!0:r,a=e.premultipliedAlpha,o=a===void 0?!0:a,s=e.stencil,l=s===void 0?!0:s,u=e.backgroundColor,c=u===void 0?1579548:u,f=e.backgroundAlpha,m=f===void 0?1:f,A=e.pixelRatio,h=A===void 0?1:A,p=e.antialias,g=e.webgl2,v=e.logarithmicDepthBuffer,y=e.precision,b=this,x={antialias:p,alpha:!0,depth:!0,preserveDrawingBuffer:i,stencil:l,premultipliedAlpha:o,powerPreference:"high-performance"},w={logarithmicDepthBuffer:v,precision:y};if(g){var E=document.createElement("canvas"),C=E.getContext("webgl2",x);C?b=n.call(this,k(k(k({},x),w),{antialias:!0,canvas:E,context:C}))||this:(console.error("error occurred when getting webgl2 canvas context, mybe webgl2 not support, fallback to webgl."),b=n.call(this,k(k({},x),w))||this)}else b=n.call(this,k(k({},x),w))||this;return b.setPixelRatio(h),b.setClearColor(c,m),b.outputEncoding=d.sRGBEncoding,b.autoClear=!0,b}return t}(d.WebGLRenderer),D0=function(n){se(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.add=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return n.prototype.add.apply(this,e)},t.prototype.remove=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return n.prototype.remove.apply(this,e)},t}(d.Scene);function Nt(n,t){var e=Math.abs(Math.cos(n.latitude)),r=-Math.sin(n.longitude)*e,i=-Math.sin(n.latitude),a=-Math.cos(n.longitude)*e;return t?t.set(r,i,a):new d.Vector3(r,i,a)}var Id=1,Td=.1,Pd=2e3,di=Math.PI*2,ns=Math.PI/2;function na(n){return n>0&&n<=di?n:(n%di+di)%di}function Bd(n,t,e,r){e=Math.pow(e,4);for(var i=0;i<16;i++)r.elements[i]=n.elements[i]+(t.elements[i]-n.elements[i])*e;return r}var z0=function(n){se(t,n);function t(e,r,i,a,o,s,l){r===void 0&&(r=Id),i===void 0&&(i=Td),a===void 0&&(a=Pd),o===void 0&&(o=new d.Vector2),s===void 0&&(s=new d.Vector2(512,512)),l===void 0&&(l=1);var u=n.call(this)||this;u.fov=e,u.aspect=r,u.near=i,u.far=a,u.perspToOrtho=o,u.resolution=s,u.pixelRatio=l,u.time=0,u.needsRender=!0,u.refineModel=!0,u.pose={longitude:0,latitude:0,fov:e,distance:0,offset:new d.Vector3},u.computePose(),u.perspectiveCamera=new d.PerspectiveCamera(u.fov,u.aspect,.001,u.far);var c=Math.max(u.orthoDistance,.01)*Math.tan(.5*u.fov/180*Math.PI),f=-.5*u.aspect*2*c;return u.orthographicCamera=new d.OrthographicCamera(f,-f,c,-c,.001,u.far),u.computeProjectionMatrix(),u.lastValues={position:u.position.clone(),quaternion:u.quaternion.clone(),scale:u.scale.clone(),fov:u.fov,aspect:u.aspect,near:u.near,far:u.far,orthoDistance:u.orthoDistance,perspToOrtho:u.perspToOrtho.clone()},u.type=u.perspToOrtho.x<1?"PerspectiveCamera":"OrthographicCamera",u}return Object.defineProperty(t.prototype,"orthoDistance",{get:function(){return this.pose.distance>1?this.pose.distance:1+(this.pose.distance-1)*this.perspToOrtho.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"zoom",{get:function(){return this.type==="OrthographicCamera"?this.orthographicCamera.zoom:this.type==="PerspectiveCamera"?this.perspectiveCamera.zoom:1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.type==="OrthographicCamera"?this.orthographicCamera.top:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.type==="OrthographicCamera"?this.orthographicCamera.bottom:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){return this.type==="OrthographicCamera"?this.orthographicCamera.left:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.type==="OrthographicCamera"?this.orthographicCamera.right:0},enumerable:!1,configurable:!0}),t.prototype.getDirection=function(e){return Nt(this.pose,e)},t.prototype.computePose=function(e){e===void 0&&(e=0),this.updateMatrix();var r=this.matrix.elements;return this.pose.latitude=Math.asin(fe(r[9],-1,1)),Math.abs(r[9])<.9999999?this.pose.longitude=na(Math.atan2(r[8],r[10])):this.pose.longitude=na(Math.atan2(-r[2],r[0])),this.pose.fov=this.fov,this.pose.distance=e,this.pose.offset=new d.Vector3(-r[8],-r[9],-r[10]).setLength(this.pose.distance).add(this.position),this},t.prototype.setFromPose=function(e){var r,i,a,o,s,l=na((r=e.longitude)!==null&&r!==void 0?r:this.pose.longitude),u=Math.max(-ns+1e-4,Math.min(ns-1e-4,(i=e.latitude)!==null&&i!==void 0?i:this.pose.latitude)),c=(a=e.fov)!==null&&a!==void 0?a:this.pose.fov,f=(o=e.distance)!==null&&o!==void 0?o:this.pose.distance,m=(s=e.offset)!==null&&s!==void 0?s:this.pose.offset,A=Nt({longitude:l,latitude:u}).normalize();return this.position.set(0,0,0),this.lookAt(A),this.position.add(m).sub(A.clone().setLength(f)),this.fov!==c&&(this.fov=c,this.updateProjectionMatrix()),this.updateMatrixWorld(),this.pose.longitude=l,this.pose.latitude=u,this.pose.fov=c,this.pose.distance=f,this.pose.offset.copy(m),this.needsRender=!0,this},t.prototype.copyPose=function(){return{longitude:this.pose.longitude,latitude:this.pose.latitude,fov:this.pose.fov,distance:this.pose.distance,offset:this.pose.offset.clone()}},t.prototype.computeProjectionMatrix=function(){Bd(this.orthographicCamera.projectionMatrix,this.perspectiveCamera.projectionMatrix,1-this.perspToOrtho.x,this.projectionMatrix),this.projectionMatrixInverse.getInverse(this.projectionMatrix),this.needsRender=!0},t.prototype.setViewOffset=function(e,r,i,a,o,s){this.perspectiveCamera.setViewOffset(e,r,i,a,o,s),this.orthographicCamera.setViewOffset(e,r,i,a,o,s),this.computeProjectionMatrix()},t.prototype.clearViewOffset=function(){this.perspectiveCamera.clearViewOffset(),this.orthographicCamera.clearViewOffset(),this.computeProjectionMatrix()},t.prototype.updateProjectionMatrix=function(){this.perspectiveCamera.updateProjectionMatrix(),this.orthographicCamera.updateProjectionMatrix(),this.computeProjectionMatrix()},Object.defineProperty(t.prototype,"perspectiveProjectionMatrix",{get:function(){return this.perspectiveCamera.projectionMatrix},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"perspectiveProjectionMatrixInverse",{get:function(){return this.perspectiveCamera.projectionMatrixInverse},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"orthographicProjectionMatrix",{get:function(){return this.orthographicCamera.projectionMatrix},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"orthographicProjectionMatrixInverse",{get:function(){return this.orthographicCamera.projectionMatrixInverse},enumerable:!1,configurable:!0}),t.prototype.updateTime=function(e,r){this.time=e;var i=!1;if((this.lastValues.fov!==this.fov||this.lastValues.near!==this.near||this.lastValues.far!==this.far||this.lastValues.aspect!==this.aspect)&&(this.perspectiveCamera.fov=this.fov,this.perspectiveCamera.near=this.near,this.perspectiveCamera.far=this.far,this.perspectiveCamera.aspect=this.aspect,this.perspectiveCamera.updateProjectionMatrix(),i=!0),!this.lastValues.position.equals(this.position)||!this.lastValues.quaternion.equals(this.quaternion)||!this.lastValues.scale.equals(this.scale)||!this.lastValues.perspToOrtho.equals(this.perspToOrtho)||this.lastValues.fov!==this.fov||this.lastValues.near!==this.near||this.lastValues.far!==this.far||this.lastValues.orthoDistance!==this.orthoDistance||this.lastValues.aspect!==this.aspect){var a=Math.max(this.orthoDistance,.01)*Math.tan(.5*this.fov/180*Math.PI),o=-.5*this.aspect*2*a;this.orthographicCamera.left=o,this.orthographicCamera.right=-o,this.orthographicCamera.top=a,this.orthographicCamera.bottom=-a,this.orthographicCamera.near=this.near,this.orthographicCamera.far=this.far,this.orthographicCamera.updateProjectionMatrix(),i=!0}i&&this.computeProjectionMatrix(),this.lastValues.position.copy(this.position),this.lastValues.quaternion.copy(this.quaternion),this.lastValues.scale.copy(this.scale),this.lastValues.fov=this.fov,this.lastValues.aspect=this.aspect,this.lastValues.near=this.near,this.lastValues.far=this.far,this.lastValues.orthoDistance=this.orthoDistance,this.lastValues.perspToOrtho.copy(this.perspToOrtho),this.type=this.perspToOrtho.x<1?"PerspectiveCamera":"OrthographicCamera"},Object.defineProperty(t.prototype,"isPerspectiveCamera",{get:function(){return this.perspToOrtho.x<1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isOrthographicCamera",{get:function(){return this.perspToOrtho.x>=1},enumerable:!1,configurable:!0}),t.prototype.copy=function(e,r){return n.prototype.copy.call(this,e,r),this.fov=e.fov,this.aspect=e.aspect,this.near=e.near,this.far=e.far,this.perspToOrtho.copy(e.perspToOrtho),this.updateTime(Ee(),0),this},t}(d.Camera),mt;(function(n){n[n.Outside=-1]="Outside",n[n.Intersecting=0]="Intersecting",n[n.Inside=1]="Inside"})(mt||(mt={}));var Q0=1e-6,ze=new d.Vector3,Ur=new d.Matrix4,Rr=new d.Vector3,Fr=new d.Vector3,kr=new d.Vector3,Ha=new d.Vector3,ia=new d.Box3,aa=new d.Sphere,is=new d.Matrix4,oa=new d.Ray,pt=new d.Object3D,as=new d.Frustum;function U0(n,t){var e=n.elements;return t.setFromRotationMatrix(Ur.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1)),t}var qn=function(){function n(t){t===void 0&&(t=[]),this.planes=t}return Object.defineProperty(n,"MASK_OUTSIDE",{get:function(){return 4294967295},enumerable:!1,configurable:!0}),Object.defineProperty(n,"MASK_INSIDE",{get:function(){return 0},enumerable:!1,configurable:!0}),Object.defineProperty(n,"MASK_INDETERMINATE",{get:function(){return 2147483647},enumerable:!1,configurable:!0}),n.prototype.setFromFrustum=function(t){return this.planes=t.planes.map(function(e){return e.clone()}),this},n.prototype.setFromCamera=function(t){return Ur.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),as.setFromProjectionMatrix(Ur),this.setFromFrustum(as),this},n.prototype.applyMatrix4=function(t){for(var e=0,r=this.planes;e<r.length;e++){var i=r[e];i.applyMatrix4(t)}},n.prototype.copy=function(t){return this.planes=t.planes.map(function(e){return e.clone()}),this},n.prototype.clone=function(){return new n().copy(this)},n.prototype.computeVisibility=function(t){for(var e=mt.Inside,r=0,i=this.planes;r<i.length;r++){var a=i[r],o=t.intersectPlane(a);switch(o){case mt.Outside:return mt.Outside;case mt.Intersecting:e=mt.Intersecting;break}}return e},n.prototype.computeVisibilityWithPlaneMask=function(t,e){if(e===n.MASK_OUTSIDE||e===n.MASK_INSIDE)return e;for(var r=n.MASK_INSIDE,i=Math.min(32,this.planes.length),a=0;a<i;++a){var o=1<<a;if(e&o){var s=this.planes[a],l=t.intersectPlane(s);if(l===mt.Outside)return n.MASK_OUTSIDE;l===mt.Intersecting&&(r|=o)}}return r},n}(),H0=function(){function n(){this.type="box",this.center=new d.Vector3,this.halfSize=new d.Vector3,this.rotation=new d.Matrix3}return n.prototype.fromJson=function(t){var e=t.box;this.center.set(e[0],e[1],e[2]);var r=e[3],i=e[4],a=e[5],o=e[6],s=e[7],l=e[8],u=e[9],c=e[10],f=e[11],m=Math.sqrt(r*r+i*i+a*a),A=Math.sqrt(o*o+s*s+l*l),h=Math.sqrt(u*u+c*c+f*f);this.halfSize.set(m,A,h);var p=this.halfSize.toArray().reduce(function(g,v){return g+v},0);return(isNaN(p)||p<=0)&&this.halfSize.setScalar(Q0),this.rotation.fromArray([r/m,i/m,a/m,o/A,s/A,l/A,u/h,c/h,f/h]),isNaN(this.rotation.toArray().reduce(function(g,v){return g+v},0))&&this.rotation.identity(),this},n.prototype.toJson=function(){return this.rotation.extractBasis(Rr,Fr,kr),{box:Et(Et(Et(Et([],this.center.toArray(),!0),Rr.multiplyScalar(this.halfSize.x).toArray(),!0),Fr.multiplyScalar(this.halfSize.y).toArray(),!0),kr.multiplyScalar(this.halfSize.z).toArray(),!0)}},n.prototype.copy=function(t){return this.center.copy(t.center),this.halfSize.copy(t.halfSize),this.rotation.copy(t.rotation),this},n.prototype.clone=function(){return new n().copy(this)},n.prototype.applyMatrix4=function(t){return pt.position.copy(this.center),U0(this.rotation,pt.quaternion),pt.scale.copy(this.halfSize),pt.matrix.compose(pt.position,pt.quaternion,pt.scale),pt.matrix.premultiply(t),pt.matrix.decompose(pt.position,pt.quaternion,pt.scale),this.center.copy(pt.position),this.rotation.setFromMatrix4(Ur.makeRotationFromQuaternion(pt.quaternion)),this.halfSize.copy(pt.scale),this},n.prototype.getCenter=function(t){return t.copy(this.center)},n.prototype.distanceSquaredToPoint=function(t){var e=this.rotation.elements,r=t.x-this.center.x,i=t.y-this.center.y,a=t.z-this.center.z,o=0,s;return s=r*e[0]+i*e[1]+a*e[2],s<0&&(s=-s),s-=this.halfSize.x,s>0&&(o+=s*s),s=r*e[3]+i*e[4]+a*e[5],s<0&&(s=-s),s-=this.halfSize.y,s>0&&(o+=s*s),s=r*e[6]+i*e[7]+a*e[8],s<0&&(s=-s),s-=this.halfSize.z,s>0&&(o+=s*s),o},n.prototype.distanceToPoint=function(t){return Math.sqrt(this.distanceSquaredToPoint(t))},n.prototype.distanceToPlane=function(t){var e=t.projectPoint(this.center,new d.Vector3);return this.distanceToPoint(e)},n.prototype.getBoundingBox=function(t){return t.makeEmpty(),this.rotation.extractBasis(Rr,Fr,kr),Rr.setLength(this.halfSize.x),Fr.setLength(this.halfSize.y),kr.setLength(this.halfSize.z),t.expandByPoint(ze.copy(this.center).add(Rr)),t.expandByPoint(ze.copy(this.center).sub(Rr)),t.expandByPoint(ze.copy(this.center).add(Fr)),t.expandByPoint(ze.copy(this.center).sub(Fr)),t.expandByPoint(ze.copy(this.center).add(kr)),t.expandByPoint(ze.copy(this.center).sub(kr)),t},n.prototype.toGeometry=function(){var t=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),e=new Float32Array(8*3);ze.set(this.halfSize.x,this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,0),ze.set(-this.halfSize.x,this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,3),ze.set(-this.halfSize.x,-this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,6),ze.set(this.halfSize.x,-this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,9),ze.set(this.halfSize.x,this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,12),ze.set(-this.halfSize.x,this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,15),ze.set(-this.halfSize.x,-this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,18),ze.set(this.halfSize.x,-this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,21);var r=new d.BufferGeometry;return r.setIndex(new d.BufferAttribute(t,1)),r.setAttribute("position",new d.BufferAttribute(e,3)),r.computeBoundingBox(),r.computeBoundingSphere(),r},n.prototype.intersectPlane=function(t){var e=this.center,r=t.normal,i=this.rotation.elements,a=this.halfSize,o=r.x,s=r.y,l=r.z,u=Math.abs(o*i[0]*a.x+s*i[1]*a.x+l*i[2]*a.x)+Math.abs(o*i[3]*a.y+s*i[4]*a.y+l*i[5]*a.y)+Math.abs(o*i[6]*a.z+s*i[7]*a.z+l*i[8]*a.z),c=r.dot(e)+t.constant;return c<=-u?mt.Outside:c>=u?mt.Inside:mt.Intersecting},n.prototype.intersectRay=function(t,e){if(Ha.copy(this.halfSize).multiplyScalar(2),ia.setFromCenterAndSize(ze.set(0,0,0),Ha),this.rotation.extractBasis(Rr,Fr,kr),Ur.makeBasis(Rr,Fr,kr),Ur.setPosition(this.center),is.getInverse(Ur),oa.copy(t).applyMatrix4(is),ia.containsPoint(oa.origin))return!0;var r=oa.intersectBox(ia,ze);return r?e!==void 0?r.applyMatrix4(Ur).distanceTo(t.origin)<e:!0:!1},n}(),q0=function(){function n(){this.type="sphere",this.center=new d.Vector3,this.radius=-1}return n.prototype.fromJson=function(t){var e=t.sphere;return this.center.set(e[0],e[1],e[2]),this.radius=Math.max(e[3],Q0),this},n.prototype.toJson=function(){return{sphere:Et(Et([],this.center.toArray(),!0),[this.radius],!1)}},n.prototype.copy=function(t){return this.center.copy(t.center),this.radius=t.radius,this},n.prototype.clone=function(){return new n().copy(this)},n.prototype.getBoundingBox=function(t){return t.setFromCenterAndSize(this.center,Ha.set(1,1,1).multiplyScalar(this.radius*2)),t},n.prototype.toGeometry=function(){for(var t=32,e=new Float32Array(t*3*2*2),r=0;r<=t;r++){var i=0;i=r/t*Math.PI*2,e[r*6+0]=this.center.x+Math.cos(i)*this.radius,e[r*6+1]=this.center.y+Math.sin(i)*this.radius,e[r*6+2]=this.center.z+0,i=(r+1)/t*Math.PI*2,e[r*6+3]=this.center.x+Math.cos(i)*this.radius,e[r*6+4]=this.center.y+Math.sin(i)*this.radius,e[r*6+5]=this.center.z+0}for(var r=t;r<=t*2;r++){var i=0;i=r/t*Math.PI*2,e[r*6+0]=this.center.x+Math.cos(i)*this.radius,e[r*6+1]=this.center.y+0,e[r*6+2]=this.center.z+Math.sin(i)*this.radius,i=(r+1)/t*Math.PI*2,e[r*6+3]=this.center.x+Math.cos(i)*this.radius,e[r*6+4]=this.center.y+0,e[r*6+5]=this.center.z+Math.sin(i)*this.radius}var a=new d.BufferGeometry;return a.setAttribute("position",new d.BufferAttribute(e,3)),a.computeBoundingBox(),a.computeBoundingSphere(),a},n.prototype.applyMatrix4=function(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this},n.prototype.getCenter=function(t){return t.copy(this.center)},n.prototype.distanceSquaredToPoint=function(t){var e=this.distanceToPoint(t);return e*e},n.prototype.distanceToPoint=function(t){var e=this.center.distanceTo(t)-this.radius;return e<=0?0:e},n.prototype.distanceToPlane=function(t){var e=Math.abs(t.distanceToPoint(this.center));return Math.max(0,e-this.radius)},n.prototype.intersectPlane=function(t){var e=this.center,r=this.radius,i=t.normal,a=i.dot(e)+t.constant;return a<-r?mt.Outside:a<r?mt.Intersecting:mt.Inside},n.prototype.intersectRay=function(t,e){if(aa.set(this.center,this.radius),aa.containsPoint(t.origin))return!0;var r=t.intersectSphere(aa,ze);return r?e!==void 0?t.origin.distanceTo(r)<e:!0:!1},n}(),Rd=function(){function n(){throw this.type="regin",this.west=0,this.south=0,this.east=0,this.north=0,this.minHeight=0,this.maxHeight=0,new Error("Region bounding volume not supported.")}return n.prototype.fromJson=function(t){var e=t.region;return this.west=e[0],this.south=e[1],this.east=e[2],this.north=e[3],this.minHeight=e[4],this.maxHeight=e[5],this},n.prototype.toJson=function(){return{region:[this.west,this.south,this.east,this.north,this.minHeight,this.maxHeight]}},n.prototype.copy=function(t){return this.west=t.west,this.south=t.south,this.east=t.east,this.north=t.north,this.minHeight=t.minHeight,this.maxHeight=t.maxHeight,this},n.prototype.clone=function(){return new n().copy(this)},n.prototype.getBoundingBox=function(t){throw new Error("not implemented")},n.prototype.toGeometry=function(){throw new Error("not implemented")},n.prototype.applyMatrix4=function(t){throw new Error("not implemented")},n.prototype.getCenter=function(t){throw new Error("not implemented")},n.prototype.distanceToPoint=function(t){throw new Error("not implemented")},n.prototype.distanceSquaredToPoint=function(t){throw new Error("not implemented")},n.prototype.distanceToPlane=function(t){throw new Error("not implemented")},n.prototype.intersectPlane=function(t){throw new Error("not implemented")},n.prototype.intersectRay=function(t){throw new Error("not implemented")},n}();function bi(n){if("box"in n)return new H0().fromJson(n);if("sphere"in n)return new q0().fromJson(n);if("region"in n)return new Rd().fromJson(n);throw new Error("BoundingVolume ".concat(JSON.stringify(n)," never suppored."))}var fi=[4821759,8191922,16637280,16739958,5822969,376977,16747077,9259235,14514687].map(function(n){return new d.LineBasicMaterial({color:n,depthWrite:!1,depthTest:!1,transparent:!0})}),Fd=function(){var n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),t=new Float32Array(8*3);ze.set(1,1,1).toArray(t,0),ze.set(-1,1,1).toArray(t,3),ze.set(-1,-1,1).toArray(t,6),ze.set(1,-1,1).toArray(t,9),ze.set(1,1,-1).toArray(t,12),ze.set(-1,1,-1).toArray(t,15),ze.set(-1,-1,-1).toArray(t,18),ze.set(1,-1,-1).toArray(t,21);var e=new d.BufferGeometry;return e.setIndex(new d.BufferAttribute(n,1)),e.setAttribute("position",new d.BufferAttribute(t,3)),e.computeBoundingBox(),e.computeBoundingSphere(),e}(),kd=function(){for(var n=32,t=new Float32Array(n*3*2*2),e=0;e<=n;e++){var r=0;r=e/n*Math.PI*2,t[e*6+0]=Math.cos(r),t[e*6+1]=Math.sin(r),t[e*6+2]=0,r=(e+1)/n*Math.PI*2,t[e*6+3]=Math.cos(r),t[e*6+4]=Math.sin(r),t[e*6+5]=0}for(var e=n;e<=n*2;e++){var r=0;r=e/n*Math.PI*2,t[e*6+0]=Math.cos(r),t[e*6+1]=0,t[e*6+2]=Math.sin(r),r=(e+1)/n*Math.PI*2,t[e*6+3]=Math.cos(r),t[e*6+4]=0,t[e*6+5]=Math.sin(r)}var i=new d.BufferGeometry;return i.setAttribute("position",new d.BufferAttribute(t,3)),i.computeBoundingBox(),i.computeBoundingSphere(),i}();function Ld(n,t){if(n instanceof H0){var e=new d.LineSegments(Fd,fi[Math.min(t,fi.length-1)]);return e.position.copy(n.center),U0(n.rotation,e.quaternion),e.scale.set(n.halfSize.x,n.halfSize.y,n.halfSize.z),e.matrix.compose(e.position,e.quaternion,e.scale),e}else if(n instanceof q0){var e=new d.LineSegments(kd,fi[Math.min(t,fi.length-1)]);return e.position.copy(n.center),e.scale.set(n.radius,n.radius,n.radius),e.matrix.compose(e.position,e.quaternion,e.scale),e}throw new Error("never")}var Od=new d.Vector3,po=function(){function n(t,e,r,i){var a=this,o,s,l,u;this.parent=null,this.floor=0,this.id=t,this.state={visible:!1,frameNumber:0,selectedFrameNumber:0,requestedFrameNumber:0,touchedFrameNumber:0,distanceToCamera:0,centerZDepth:0,centerScreenY:0,screenSpaceError:0,visibilityPlaneMask:0,inRequestVolume:!1,shouldRefine:!1,stackLength:0,finalResolution:!0,selectionDepth:0,shouldSelect:!1,lastSelect:!1,ancestorWithContent:null,ancestorWithContentAvailable:null},this.parent=i!=null?i:null,this.level=this.parent?this.parent.level+1:0,this.tileset=r,this.refine=(o=e.refine)!==null&&o!==void 0?o:this.parent?this.parent.refine:"REPLACE",this.transform=new d.Matrix4,e.transform&&this.transform.fromArray(e.transform),this.parent&&this.transform.premultiply(this.parent.transform),typeof e.geometricError=="number"?this.geometricError=e.geometricError*this.transform.getMaxScaleOnAxis():this.geometricError=(l=(s=this.parent)===null||s===void 0?void 0:s.geometricError)!==null&&l!==void 0?l:0,e.content&&e.content.uri?(this.content={uri:e.content.uri,loadState:"UNLOADED",byteLength:0},e.content.group!==void 0&&(this.content.group=e.content.group),e.content.boundingVolume&&(this.content.boundingVolume=bi(e.content.boundingVolume).applyMatrix4(this.transform)),/\.json$/.test(this.content.uri)?this.type="TILESET":this.type="SCENEGRAPH"):(this.content=null,this.type="EMPTY"),this.levelOfContent=this.parent?this.parent.levelOfContent:-1,this.type==="SCENEGRAPH"&&(this.levelOfContent=this.levelOfContent+1),e.boundingVolume&&(this.boundingVolume=bi(e.boundingVolume).applyMatrix4(this.transform)),e.viewerRequestVolume&&(this.viewerRequestVolume=bi(e.viewerRequestVolume).applyMatrix4(this.transform)),this.extras=(u=e.extras)!==null&&u!==void 0?u:{},typeof this.extras.floor!="number"&&i&&typeof i.extras.floor=="number"&&(this.extras.floor=i.extras.floor),typeof this.extras.floor=="number"&&(this.floor=this.extras.floor,this.tileset.floorLength=Math.max(this.tileset.floorLength,this.floor+1)),this.boundingVolume&&(this.boundingVolumeDebugObject=Ld(this.boundingVolume,this.levelOfContent)),e.children?this.children=e.children.map(function(c,f){return new n("".concat(a.id,".").concat(f),c,r,a)}):this.children=[]}return n.prototype.traverse=function(t){t(this);for(var e=0,r=this.children;e<r.length;e++){var i=r[e];i.traverse(t)}},n.prototype.updateState=function(t){this.state.frameNumber=t.frameNumber;var e=this.tileset.transformIsIdentity?null:this.tileset.transform;if(this.boundingVolume){var r=e?this.boundingVolume.clone().applyMatrix4(e):this.boundingVolume;if(t.camera.type==="OrthographicCamera"){var i=new d.Plane().setFromNormalAndCoplanarPoint(t.camera.direction,t.camera.position);this.state.distanceToCamera=r.distanceToPlane(i)}else this.state.distanceToCamera=r.distanceToPoint(t.camera.position);var a=r.getCenter(Od).sub(t.camera.position);this.state.centerZDepth=t.camera.direction.dot(a),this.state.centerScreenY=t.camera.up.dot(a);var o=this.parent?this.parent.state.visibilityPlaneMask:qn.MASK_INDETERMINATE;this.state.visibilityPlaneMask=t.cullingVolume.computeVisibilityWithPlaneMask(r,o),this.state.visible=this.state.visibilityPlaneMask!==qn.MASK_OUTSIDE}else this.state.distanceToCamera=0,this.state.centerZDepth=0,this.state.visibilityPlaneMask=qn.MASK_INDETERMINATE,this.state.visible=!0;if(this.levelOfContent<=t.minLevelOfDetail&&(this.state.visible=!0),this.viewerRequestVolume){var s=e?this.viewerRequestVolume.clone().applyMatrix4(e):this.viewerRequestVolume;this.state.inRequestVolume=s.distanceSquaredToPoint(t.camera.position)<=0}else this.state.inRequestVolume=!0;this.state.screenSpaceError=this.getScreenSpaceError(t,this.state.distanceToCamera,!1)},Object.defineProperty(n.prototype,"selected",{get:function(){return this.state.selectedFrameNumber===this.tileset.frameNumber},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasChildren",{get:function(){return this.children.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"siblingIndex",{get:function(){var t,e;return(e=(t=this.parent)===null||t===void 0?void 0:t.children.indexOf(this))!==null&&e!==void 0?e:0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasTilesetContent",{get:function(){return this.children.length>0&&this.type==="TILESET"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasRenderContent",{get:function(){return this.type==="SCENEGRAPH"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"contentAvailable",{get:function(){var t;return this.hasRenderContent&&((t=this.content)===null||t===void 0?void 0:t.loadState)==="READY"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasUnloadedContent",{get:function(){var t;return((t=this.content)===null||t===void 0?void 0:t.loadState)==="UNLOADED"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasEmptyContent",{get:function(){return this.type==="EMPTY"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"contentReady",{get:function(){var t;return((t=this.content)===null||t===void 0?void 0:t.loadState)==="READY"||this.hasEmptyContent},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"contentByteLength",{get:function(){return this.content?this.content.byteLength:0},enumerable:!1,configurable:!0}),n.prototype.getScreenSpaceError=function(t,e,r){var i=this.tileset.transformIsIdentity?1:this.tileset.transform.getMaxScaleOnAxis(),a=this.parent?this.parent.geometricError:this.tileset.geometricError,o=i*(r?a:this.geometricError);if(o===0)return 0;var s=Math.max(e,.001),l=o*t.height/(s*t.sseDenominator);return l},n.prototype.getPriority=function(){var t=this.refine==="ADD"||this.tileset.skipLevelOfDetail;if(t&&!this.state.visible||this.tileset.frameNumber-this.state.touchedFrameNumber>=1)return-1;var e=this.parent,r=e&&(!t||this.state.screenSpaceError===0),i=r?e.state.screenSpaceError:this.state.screenSpaceError,a=this.tileset.root?this.tileset.root.state.screenSpaceError:0,o=Math.max(a-i,0);return o},n}();function os(n){var t=n.refine==="ADD"||n.tileset.skipLevelOfDetail,e=n.parent,r=e&&(!t||n.state.screenSpaceError===0),i=r?e.state.screenSpaceError:n.state.screenSpaceError,a=n.tileset.root?n.tileset.root.state.screenSpaceError:0,o=Math.max(a-i,0);return o}var G0=function(){function n(t,e){this.tileset=t,this.options=e,this.activeRequests=0,this.requestQueue=[]}return n.prototype.reset=function(){for(var t=0,e=this.requestQueue;t<e.length;t++){var r=e[t];this.options.onTileSkip&&this.options.onTileSkip(r.tile)}this.requestQueue.length=0},n.prototype.update=function(t,e,r){for(var i=this,a=r.time,o=this.requestQueue,s=new Set(t),l=0;l<o.length;l++){var u=o[l];if(s.has(u.tile)){s.delete(u.tile);continue}u.status==="WAITING"&&(o.splice(l,1),l--,this.options.onTileSkip&&this.options.onTileSkip(u.tile))}s.size>0&&(s.forEach(function(h){o.push({tile:h,status:"WAITING",time:a,error:null})}),s.clear());for(var c=this.tileset.maxRequests,l=0;l<o.length&&c>0;l++){var u=o[l];if(u.status==="DONE")u.error!==null?this.options.onTileError&&this.options.onTileError(u.tile,u.error):(c--,u.tile.content&&(u.tile.content.loadState="READY"),this.options.onTileLoad&&this.options.onTileLoad(u.tile)),o.splice(l,1),l--;else if(u.status==="PENDING"&&a-u.time<1e3)break}switch(e){case"SCREEN_SPACE_ERROR":{var f=new Map;o.sort(function(h,p){if(h.tile.state.requestedFrameNumber!==p.tile.state.requestedFrameNumber)return p.tile.state.requestedFrameNumber-h.tile.state.requestedFrameNumber;if(h.tile.state.requestedFrameNumber===r.frameNumber){var g=f.get(h.tile.id);g===void 0&&(g=os(h.tile),f.set(h.tile.id,g));var v=f.get(p.tile.id);return v===void 0&&(v=os(p.tile),f.set(p.tile.id,v)),g-v}else return h.tile.level!==p.tile.level?h.tile.level-p.tile.level:h.tile.state.distanceToCamera-p.tile.state.distanceToCamera});break}case"SCREEN_VERTICAL":{o.sort(function(h,p){return h.tile.state.requestedFrameNumber!==p.tile.state.requestedFrameNumber?p.tile.state.requestedFrameNumber-h.tile.state.requestedFrameNumber:h.tile.state.requestedFrameNumber===r.frameNumber?h.tile.state.centerScreenY!==p.tile.state.centerScreenY?h.tile.state.centerScreenY-p.tile.state.centerScreenY:h.tile.state.centerZDepth!==p.tile.state.centerZDepth?h.tile.state.centerZDepth-p.tile.state.centerZDepth:h.tile.level!==p.tile.level?h.tile.level-p.tile.level:h.tile.state.distanceToCamera-p.tile.state.distanceToCamera:h.tile.level!==p.tile.level?h.tile.level-p.tile.level:h.tile.state.distanceToCamera-p.tile.state.distanceToCamera});break}case"SCREEN_LEVEL_VERTICAL":{o.sort(function(h,p){return h.tile.state.requestedFrameNumber!==p.tile.state.requestedFrameNumber?p.tile.state.requestedFrameNumber-h.tile.state.requestedFrameNumber:h.tile.state.requestedFrameNumber===r.frameNumber?h.tile.level!==p.tile.level?h.tile.level-p.tile.level:h.tile.state.centerScreenY!==p.tile.state.centerScreenY?h.tile.state.centerScreenY-p.tile.state.centerScreenY:h.tile.state.centerZDepth!==p.tile.state.centerZDepth?h.tile.state.centerZDepth-p.tile.state.centerZDepth:h.tile.state.distanceToCamera-p.tile.state.distanceToCamera:h.tile.level!==p.tile.level?h.tile.level-p.tile.level:h.tile.state.distanceToCamera-p.tile.state.distanceToCamera});break}}c=Math.max(this.tileset.maxRequests-this.activeRequests,0);for(var m=function(h){var p=o[h];p.status==="WAITING"&&(c--,p.status="PENDING",p.time=a,A.activeRequests++,A.tileset.options.tileLoader(p.tile).catch(function(g){p.error=g}).then(function(){p.status="DONE",p.tile.content&&p.tile.content.loadState==="READY"&&(p.tile.content.loadState="LOADING"),i.activeRequests--}))},A=this,l=0;l<o.length&&c>0;l++)m(l)},n}(),Vd=function(){function n(t,e,r){this.item=t,this.previous=e,this.next=r}return n}(),Nd=function(){function n(){this.head=null,this.tail=null,this._length=0}return Object.defineProperty(n.prototype,"length",{get:function(){return this._length},enumerable:!1,configurable:!0}),n.prototype.add=function(t){var e=new Vd(t,this.tail,null);return this.tail?(this.tail.next=e,this.tail=e):(this.head=e,this.tail=e),this._length++,e},n.prototype.remove=function(t){t.previous&&t.next?(t.previous.next=t.next,t.next.previous=t.previous):t.previous?(t.previous.next=null,this.tail=t.previous):t.next?(t.next.previous=null,this.head=t.next):(this.head=null,this.tail=null),t.next=null,t.previous=null,this._length--},n.prototype.splice=function(t,e){t!==e&&(this.remove(e),this.insert(t,e))},n.prototype.insert=function(t,e){var r=t.next;t.next=e,this.tail===t?this.tail=e:r.previous=e,e.next=r,e.previous=t,this._length++},n.prototype.toArray=function(){for(var t=[],e=this.head;e;)t.push(e),e=e.next;return t},n}(),K0=function(){function n(t){t===void 0&&(t={}),this.options=t,this.cacheNodeMap=new Map,this.list=new Nd,this.sentinel=this.list.add("sentinel")}return n.prototype.reset=function(){this.list.tail&&this.list.splice(this.list.tail,this.sentinel)},n.prototype.touchTile=function(t){var e=this.cacheNodeMap.get(t);e&&this.list.splice(this.sentinel,e)},n.prototype.loadTile=function(t){if(!this.cacheNodeMap.has(t)){var e=this.list.add(t);this.cacheNodeMap.set(t,e),this.options.onTileLoad&&this.options.onTileLoad(t)}},n.prototype.unloadTile=function(t){var e=this.cacheNodeMap.get(t);e&&(this.list.remove(e),this.cacheNodeMap.delete(t),this.options.onTileUnload&&this.options.onTileUnload(t))},n.prototype.unloadTiles=function(t){for(var e=this.list.head;e!==this.sentinel&&t();){var r=e.item;e=e.next,this.unloadTile(r)}},n.prototype.toArray=function(){for(var t=[],e=0,r=this.list.toArray();e<r.length;e++){var i=r[e];i.item!=="sentinel"&&t.push(i.item)}return t},n}(),Hr=function(){function n(){this.map=new Map,this.array=[],this._length=0}return Object.defineProperty(n.prototype,"length",{get:function(){return this._length},enumerable:!1,configurable:!0}),n.prototype.get=function(t){return this.array[t]},n.prototype.set=function(t,e){t>=this.length&&(this._length=t+1),this.map.has(this.array[t])&&this.map.delete(this.array[t]),this.array[t]=e,this.map.set(e,t)},n.prototype.delete=function(t){var e=this.map.get(t);e!==void 0&&e>=0&&(this.array.splice(e,1),this.map.delete(t),this._length--)},n.prototype.push=function(t){if(!this.map.has(t)){var e=this._length++;this.array[e]=t,this.map.set(t,e)}},n.prototype.pop=function(){var t=this.array[--this._length];return this.map.delete(t),this.array[this._length]=void 0,t},n.prototype.reset=function(){this.array=[],this.map=new Map,this._length=0},n.prototype.find=function(t){return this.map.has(t)},n.prototype.peek=function(){return this.array[this._length-1]},n}(),vo=function(){function n(t){this.tileset=t,this._canSelectTile=!0,this._loadAllTilesTraversalStack=new Hr,this.root=null}return n.prototype.traverse=function(t,e,r){this.root=t,this.reset()},n.prototype.reset=function(){this._loadAllTilesTraversalStack.reset(),this.tileset.hasMixedContent=!1,this.tileset.needsRefinedTiles.clear(),this.tileset.requestedTiles.length=0,this.tileset.selectedTiles.length=0},n.prototype.updateTile=function(t,e){this.updateTileVisibility(t,e),t.state.shouldSelect=!1,t.state.finalResolution=!0},n.prototype.selectTile=function(t,e){var r=t.contentAvailable&&this._canSelectTile;r&&t.state.selectedFrameNumber<e.frameNumber&&(t.state.selectedFrameNumber=e.frameNumber,this.tileset.selectedTiles.push(t),this.tileset.needsRefinedTiles.add(t))},n.prototype.loadTile=function(t,e){t.state.requestedFrameNumber<e.frameNumber&&(t.state.requestedFrameNumber=e.frameNumber,t.hasUnloadedContent&&this.tileset.requestedTiles.push(t)),this.tileset.needsRefinedTiles.add(t)},n.prototype.touchTile=function(t,e){this.tileset.cache.touchTile(t),t.state.touchedFrameNumber=e.frameNumber},n.prototype.canTraverse=function(t,e){return t.levelOfContent>=e.maxLevelOfDetail||t.children.length===0?!1:t.levelOfContent<=e.minLevelOfDetail||t.hasTilesetContent?!0:t.state.screenSpaceError>this.tileset.maxScreenSpaceError},n.prototype.updateTileVisibility=function(t,e){if(t.updateState(e),!(!t.state.visible||!t.state.inRequestVolume)){var r=t.children.length>0;if(t.hasTilesetContent&&r){var i=t.children[0];this.updateTileVisibility(i,e),t.state.visible=i.state.visible;return}if(this.meetsScreenSpaceErrorEarly(t,e)){t.state.visible=!1;return}var a=t.refine==="REPLACE";if(a&&r&&!this.anyChildrenVisible(t,e)){t.state.visible=!1;return}}},n.prototype.anyChildrenVisible=function(t,e){for(var r=!1,i=t.children,a=0,o=i;a<o.length;a++){var s=o[a];s.updateState(e),r=r||s.state.visible}return r},n.prototype.meetsScreenSpaceErrorEarly=function(t,e){var r=t.parent;return!r||r.refine!=="ADD"||r.levelOfContent<e.minLevelOfDetail?!1:r.levelOfContent>e.maxLevelOfDetail?!0:t.getScreenSpaceError(e,t.state.distanceToCamera,!0)<this.tileset.maxScreenSpaceError},n.prototype.sortTilesByDistanceToCamera=function(t){t.sort(function(e,r){return r.state.distanceToCamera===0&&e.state.distanceToCamera===0?r.state.centerZDepth-e.state.centerZDepth:r.state.distanceToCamera-e.state.distanceToCamera})},n.prototype.loadAllTiles=function(t,e){var r=this._loadAllTilesTraversalStack;for(r.push(t);r.length>0;){var i=r.pop();i.hasUnloadedContent&&i.state.requestedFrameNumber<e.frameNumber&&this.tileset.requestedTiles.push(i),this.touchTile(i,e);for(var a=0,o=i.children;a<o.length;a++){var s=o[a];r.push(s)}}},n}(),Dd=function(n){se(t,n);function t(e){var r=n.call(this,e)||this;return r.tileset=e,r._traversalStack=new Hr,r._emptyTraversalStack=new Hr,r}return t.prototype.traverse=function(e,r,i){i===void 0&&(i=[]),n.prototype.traverse.call(this,e,r,i);for(var a=0,o=i;a<o.length;a++){var s=o[a];this._traversalStack.reset(),this._emptyTraversalStack.reset(),s.camera.refine&&(this._canSelectTile=s.camera.visible,this.updateTile(e,s),this.executeTraversal(e,s))}this._traversalStack.reset(),this._emptyTraversalStack.reset(),r.camera.refine&&(this._canSelectTile=r.camera.visible,this.updateTile(e,r),this.executeTraversal(e,r)),this.tileset.loadAll&&this.loadAllTiles(e,r)},t.prototype.reset=function(){n.prototype.reset.call(this),this._traversalStack.reset(),this._emptyTraversalStack.reset()},t.prototype.executeTraversal=function(e,r){var i=this._traversalStack;for(e.state.visible&&e.state.inRequestVolume&&i.push(e);i.length>0;){var a=i.pop(),o=a.parent,s=!o||o.state.shouldRefine,l=!1;this.canTraverse(a,r)&&(l=this.updateAndPushChildren(a,r,i)&&s);var u=!l&&s;a.hasRenderContent?a.refine==="ADD"?(this.loadTile(a,r),this.selectDesiredTile(a,r)):a.refine==="REPLACE"&&(this.loadTile(a,r),u&&this.selectDesiredTile(a,r)):(this.loadTile(a,r),u&&this.selectDesiredTile(a,r)),this.touchTile(a,r),a.state.shouldRefine=l}},t.prototype.updateAndPushChildren=function(e,r,i){for(var a=e.children,o=0,s=a;o<s.length;o++){var l=s[o];this.updateTile(l,r)}this.sortTilesByDistanceToCamera(a);for(var u=e.refine==="REPLACE"&&e.hasRenderContent,c=!1,f=!0,m=0,A=a;m<A.length;m++){var l=A[m];if(l.levelOfContent<=r.minLevelOfDetail||l.state.visible&&l.state.inRequestVolume?(i.find(l)&&i.delete(l),i.push(l),c===!1&&(c=!0)):(u||this.tileset.loadSiblings)&&(this.loadTile(l,r),this.touchTile(l,r)),u){var h=void 0;l.state.inRequestVolume?l.hasRenderContent?h=l.contentAvailable:h=this.executeEmptyTraversal(l,r):h=!1,f=f&&h}}return c||(f=!1),f},t.prototype.selectDesiredTile=function(e,r){e.contentAvailable&&n.prototype.selectTile.call(this,e,r)},t.prototype.executeEmptyTraversal=function(e,r){var i=!0,a=this._emptyTraversalStack;for(a.push(e);a.length>0&&i;){var o=a.pop(),s=!o.hasRenderContent&&this.canTraverse(o,r);if(!s&&!o.contentAvailable&&(i=!1),this.updateTile(o,r),o.state.visible||(this.loadTile(o,r),this.touchTile(o,r)),s)for(var l=o.children,u=0,c=l;u<c.length;u++){var f=c[u];a.find(f)&&a.delete(f),a.push(f)}}return i},t}(vo),zd=function(n){se(t,n);function t(e){var r=n.call(this,e)||this;return r.tileset=e,r.baseScreenSpaceError=1024,r.skipScreenSpaceErrorFactor=16,r.skipLevels=1,r._traversalStack=new Hr,r._descendantTraversalStack=new Hr,r._selectionTraversalStack=new Hr,r._selectionTraversalancestorStack=new Hr,r}return t.prototype.traverse=function(e,r,i){i===void 0&&(i=[]),n.prototype.traverse.call(this,e,r,i);for(var a=0,o=i;a<o.length;a++){var s=o[a];this._traversalStack.reset(),s.camera.refine&&(this._canSelectTile=s.camera.visible,this.updateTile(e,s),this.executeTraversal(e,s),this.traverseAndSelect(e,s))}this.tileset.hasMixedContent=!1,this._traversalStack.reset(),this._descendantTraversalStack.reset(),this._selectionTraversalStack.reset(),this._selectionTraversalancestorStack.reset(),r.camera.refine&&(this._canSelectTile=r.camera.visible,this.updateTile(e,r),this.executeTraversal(e,r),this.traverseAndSelect(e,r)),this.tileset.loadAll&&this.loadAllTiles(e,r)},t.prototype.reset=function(){n.prototype.reset.call(this),this._traversalStack.reset(),this._descendantTraversalStack.reset(),this._selectionTraversalStack.reset(),this._selectionTraversalancestorStack.reset()},t.prototype.executeTraversal=function(e,r){var i=this._traversalStack;for(e.state.visible&&e.state.inRequestVolume&&i.push(e);i.length>0;){var a=i.pop();this.updateTileAncestorContentLinks(a,r);var o=a.parent,s=!o||o.state.shouldRefine,l=!1;this.canTraverse(a,r)&&(l=this.updateAndPushChildren(a,r,i)&&s);var u=!l&&s;a.hasRenderContent?a.refine==="ADD"?(this.loadTile(a,r),this.selectDesiredTile(a,r)):a.refine==="REPLACE"&&(this.inBaseTraversal(a,this.baseScreenSpaceError)?(this.loadTile(a,r),u&&this.selectDesiredTile(a,r)):u?(this.loadTile(a,r),this.selectDesiredTile(a,r)):this.reachedSkippingThreshold(a)&&this.loadTile(a,r)):(this.loadTile(a,r),u&&this.selectDesiredTile(a,r)),this.touchTile(a,r),a.state.shouldRefine=l}},t.prototype.updateAndPushChildren=function(e,r,i){for(var a=e.children,o=0,s=a;o<s.length;o++){var l=s[o];this.updateTile(l,r)}this.sortTilesByDistanceToCamera(a);for(var u=!1,c=0,f=a;c<f.length;c++){var l=f[c];l.levelOfContent<=r.minLevelOfDetail||l.state.visible&&l.state.inRequestVolume?(i.push(l),u===!1&&(u=!0)):this.tileset.loadSiblings&&(this.loadTile(l,r),this.touchTile(l,r))}return u},t.prototype.selectDesiredTile=function(e,r){var i=e.contentAvailable?e:e.state.ancestorWithContentAvailable;i&&(i.state.shouldSelect=!0),e.contentAvailable||this.selectDescendants(e,r)},t.prototype.selectDescendants=function(e,r){var i=this._descendantTraversalStack;for(i.push(e);i.length>0;)for(var a=i.pop(),o=a.children,s=0,l=o;s<l.length;s++){var u=l[s];u.state.visible&&(u.contentAvailable?(this.updateTile(u,r),this.touchTile(u,r),this.selectTile(u,r)):i.push(u))}},t.prototype.reachedSkippingThreshold=function(e){var r=e.state.ancestorWithContent,i=r!==null&&e.state.screenSpaceError<r.state.screenSpaceError/this.skipScreenSpaceErrorFactor&&e.levelOfContent>r.levelOfContent+this.skipLevels;return i},t.prototype.updateTileAncestorContentLinks=function(e,r){e.state.ancestorWithContent=null,e.state.ancestorWithContentAvailable=null;var i=e.parent;if(i){var a=!(i.hasRenderContent&&i.hasUnloadedContent)||i.state.requestedFrameNumber===r.frameNumber;e.state.ancestorWithContent=a?i:i.state.ancestorWithContent,e.state.ancestorWithContentAvailable=i.contentAvailable?i:i.state.ancestorWithContentAvailable}},t.prototype.inBaseTraversal=function(e,r){return e.state.ancestorWithContent?e.parent&&e.state.screenSpaceError===0?e.parent.state.screenSpaceError>r:e.state.screenSpaceError>r:!0},t.prototype.traverseAndSelect=function(e,r){var i=this._selectionTraversalStack,a=this._selectionTraversalancestorStack,o;for(i.push(e);i.length>0||a.length>0;){if(a.length>0){var s=a.peek();if(s.state.stackLength===i.length){a.pop(),s!==o&&(s.state.finalResolution=!1),this.selectTile(s,r);continue}}var l=i.pop();if(l){var u=this.canTraverse(l,r);if(l.state.shouldSelect)if(l.refine==="ADD")this.selectTile(l,r);else{if(l.state.selectionDepth=a.length,l.state.selectionDepth>0&&(l.tileset.hasMixedContent=!0),o=l,!u){this.selectTile(l,r);continue}a.push(l),l.state.stackLength=i.length}if(u)for(var c=0,f=l.children;c<f.length;c++){var m=f[c];m.state.visible&&i.push(m)}}}},t}(vo),Qd=function(n){se(t,n);function t(e){var r=n.call(this,e)||this;return r.tileset=e,r._traversalStack=new Hr,r}return t.prototype.canTraverse=function(e,r){return!(e.levelOfContent>=r.maxLevelOfDetail||e.children.length===0)},t.prototype.traverse=function(e,r,i){n.prototype.traverse.call(this,e,r,[]),this._traversalStack.reset(),e.updateState(r);for(var a=0,o=i;a<o.length;a++){var s=o[a];this._traversalStack.reset(),s.camera.refine&&(this._canSelectTile=s.camera.visible,e.updateState(s),this.executeTraversal(e,s))}this._traversalStack.reset(),r.camera.refine&&(this._canSelectTile=r.camera.visible,e.updateState(r),this.executeTraversal(e,r)),this.tileset.loadAll&&this.loadAllTiles(e,r)},t.prototype.reset=function(){n.prototype.reset.call(this),this._traversalStack.reset()},t.prototype.executeTraversal=function(e,r){var i=this._traversalStack;for(i.push(e);i.length>0;){var a=i.pop(),o=a.refine==="ADD",s=a.refine==="REPLACE",l=this.canTraverse(a,r);l&&this.updateAndPushChildren(a,r,i),(o||s&&!l)&&(this.loadTile(a,r),this.touchTile(a,r),this.selectDesiredTile(a,r))}},t.prototype.updateAndPushChildren=function(e,r,i){for(var a=e.children,o=0;o<a.length;++o){var s=a[o];s.updateState(r),s.state.visible&&i.push(s)}},t.prototype.selectDesiredTile=function(e,r){e.contentAvailable&&n.prototype.selectTile.call(this,e,r)},t}(vo),ss=[5635925,5592575,16733525],j0=function(){function n(t,e,r){var i;this.index=t,this.name=e.name,this.visible=!1,this.tileset=r,this.transform=new d.Matrix4,e.transform&&this.transform.fromArray(e.transform),this.transform.premultiply(this.tileset.root.transform),this.content={uri:e.file,color:new d.Color((i=e.color)!==null&&i!==void 0?i:ss[t%ss.length]),byteLength:0,loadState:"UNLOADED",data:void 0}}return n}(),Ud=new d.Matrix4,br=function(){function n(t,e,r){var i=this,a,o,s,l,u,c,f,m,A;if(this.id=t,this.transform=new d.Matrix4,this.transformIsIdentity=!0,this.hasMixedContent=!1,this.url=(a=r.url)!==null&&a!==void 0?a:"",this.referer=(o=r.referer)!==null&&o!==void 0?o:"",this.asset={version:e.asset.version,tilesetVersion:e.asset.tilesetVersion||"",gltfUpAxis:(s=e.asset.gltfUpAxis)!==null&&s!==void 0?s:"Y",overview:e.asset.overview,trajectories:(u=(l=e.asset.trajectories)===null||l===void 0?void 0:l.list)!==null&&u!==void 0?u:[]},this.rootMeta=(c=e.rootMeta)!==null&&c!==void 0?c:{},this.pointLength=(f=this.rootMeta.numTotalPoints)!==null&&f!==void 0?f:1/0,this.floorLength=(m=this.rootMeta.numFloors)!==null&&m!==void 0?m:1,this.properties=(A=e.properties)!==null&&A!==void 0?A:{},this.options=r,this.maxMemoryUsage=n.DEFAULT_MAX_MEMORY_USAGE,this.maxScreenSpaceError=n.DEFAULT_MAX_SCREEN_SPACE_ERROR,this.skipLevelOfDetail=n.DEFAULT_SKIP_LEVEL_OF_DETAIL,this.mostDetail=n.DEFAULT_MOST_DETAIL,this.loadSiblings=n.DEFAULT_LOAD_SIBLINGS,this.loadAll=n.DEFAULT_LOAD_ALL,this.maxRequests=n.DEFAULT_MAX_REQUESTS,this.tileRequestOrder=n.DEFAULT_REQUEST_ORDER,this.requestedTiles=[],this.selectedTiles=[],this.unloadTiles=[],this.needsRefinedTiles=new Set,this.selectedTrajectories=[],this.normalTraverser=new Dd(this),this.skipTraverser=new zd(this),this.mostDetailTraverser=new Qd(this),this.cache=new K0({onTileLoad:function(g){i.memoryUsageInBytes+=g.contentByteLength},onTileUnload:function(g){i.memoryUsageInBytes-=g.contentByteLength,i.unloadTiles.push(g)}}),this.requestScheduler=new G0(this,{onTileSkip:function(g){},onTileLoad:function(g){var v;!((v=g.content)===null||v===void 0)&&v.data&&(i.loadedTiles.add(g),i.cache.loadTile(g)),i.options.onTileLoad(g)},onTileError:function(g,v){i.options.onTileError(g,v)}}),this.frameNumber=0,this.maxLevelOfDetail=0,this.minLevelOfDetail=0,this.loadedTiles=new Set,this.memoryUsageInBytes=0,this.root=new po("".concat(this.id,".0"),e.root,this),this.geometricError=e.geometricError,this.trajectories=[],this.asset.trajectories)for(var h=0;h<this.asset.trajectories.length;h++){var p=new j0(h,this.asset.trajectories[h],this);this.trajectories.push(p)}}return Object.defineProperty(n.prototype,"traverser",{get:function(){return this.mostDetail?this.mostDetailTraverser:this.skipLevelOfDetail?this.skipTraverser:this.normalTraverser},enumerable:!1,configurable:!0}),n.prototype.reset=function(){for(var t=this,e=[this.root],r;r=e.pop();){for(var i=0,a=r.children.length;i<a;i++)e.push(r.children[i]);this.cache.unloadTile(r)}for(var o=function(){var c=s.unloadTiles.pop();c&&(s.loadedTiles.delete(c),s.memoryUsageInBytes-=c.contentByteLength,s.options.tileUnloader(c).catch(function(){}).then(function(){t.options.onTileUnload&&t.options.onTileUnload(c)}))},s=this;this.unloadTiles.length;)o();this.cache.reset(),this.traverser.reset(),this.requestScheduler.reset(),this.loadedTiles.clear();for(var l=function(){var c=u.trajectories.pop();c&&u.options.trajectoryUnloader(c).catch(function(){}).then(function(){t.options.onTrajectoryUnload&&t.options.onTrajectoryUnload(c)})},u=this;this.trajectories.length;)l()},n.prototype.update=function(t,e){var r=this,i;e===void 0&&(e=[]),this.frameNumber=t.frameNumber,this.minLevelOfDetail=t.minLevelOfDetail,this.maxLevelOfDetail=t.maxLevelOfDetail,this.transformIsIdentity=this.transform.equals(Ud),this.traverser.traverse(this.root,t,e),this.cache.unloadTiles(function(){var m=r.memoryUsageInBytes>r.maxMemoryUsage*1024*1024;return m}),this.requestScheduler.update(this.requestedTiles,this.tileRequestOrder,t);for(var a=function(){var m=o.unloadTiles.pop();m&&(o.loadedTiles.delete(m),o.options.tileUnloader(m).catch(function(){}).then(function(){r.options.onTileUnload&&r.options.onTileUnload(m)}))},o=this;this.unloadTiles.length;)a();this.selectedTrajectories.length=0;for(var s=function(m){m.visible===!0&&m.content.loadState==="READY"&&(!((i=m.content.data)===null||i===void 0)&&i.object)?l.selectedTrajectories.push(m):m.visible===!0&&m.content.loadState==="UNLOADED"&&l.options.trajectoryLoader(m).then(function(){r.options.onTrajectoryLoad(m)}).catch(function(A){r.options.onTrajectoryError(m,A)})},l=this,u=0,c=this.trajectories;u<c.length;u++){var f=c[u];s(f)}},n.DEFAULT_MAX_MEMORY_USAGE=16,n.DEFAULT_MAX_SCREEN_SPACE_ERROR=4,n.DEFAULT_SKIP_LEVEL_OF_DETAIL=!1,n.DEFAULT_MOST_DETAIL=!1,n.DEFAULT_LOAD_SIBLINGS=!1,n.DEFAULT_LOAD_ALL=!1,n.DEFAULT_MAX_REQUESTS=6,n.DEFAULT_REQUEST_ORDER="SCREEN_SPACE_ERROR",n}(),_0=function(){function n(t,e){this.position=t,this.indices=e}return n.prototype.getPositionCount=function(){var t,e,r=this.indices,i=this.position;return r?r.array.length/((t=r.stride)!==null&&t!==void 0?t:1):i.array.length/((e=i.stride)!==null&&e!==void 0?e:3)},n.prototype.getPositionByIndex=function(t,e){var r,i,a,o,s=this.indices,l=this.position,u=t;if(s){var c=s.array,f=(r=s.stride)!==null&&r!==void 0?r:1,m=(i=s.offset)!==null&&i!==void 0?i:0;u=c[t*f+m]}var A=l.array,h=(a=l.stride)!==null&&a!==void 0?a:3,p=(o=l.offset)!==null&&o!==void 0?o:0;return u=u*h+p,e.x=A[u],e.y=A[u+1],e.z=A[u+2],e},n.prototype.createTree=function(t,e,r){throw new Error("not implemented")},n.prototype.trianglesInSphere=function(t,e){throw new Error("not implemented")},n.prototype.intersectRay=function(t,e,r,i){throw new Error("not implemented")},n}(),Cn=function(){function n(t,e,r,i,a){this.id=t,this.extents=e,this.startIndex=r,this.endIndex=i,this.deepth=a}return n}(),Er=6*4+4+4+2+2;function J0(n,t){for(var e=new ArrayBuffer(t*Er),r=new Float32Array(e),i=new Uint32Array(e),a=new Uint16Array(e),o=[n],s,l;s=o.pop();)l=s.id*Er/4,r[l]=s.extents[0],r[l+1]=s.extents[1],r[l+2]=s.extents[2],r[l+3]=s.extents[3],r[l+4]=s.extents[4],r[l+5]=s.extents[5],i[l+6]=s.startIndex,i[l+7]=s.endIndex,l=s.id*Er/2,s.node0&&(a[l+16]=s.node0.id,o.push(s.node0)),s.node1&&(a[l+17]=s.node1.id,o.push(s.node1));return e}function X0(n,t,e,r,i,a,o,s,l){l===void 0&&(l=0),e=e-l,r=r-l,i=i-l,a=a+l,o=o+l,s=s+l;var u=0,c=0,f=0,m=0,A=0,h=0;return t.x>=0?(u=(e-n.x)*t.x,c=(a-n.x)*t.x):(u=(a-n.x)*t.x,c=(e-n.x)*t.x),t.y>=0?(f=(r-n.y)*t.y,m=(o-n.y)*t.y):(f=(o-n.y)*t.y,m=(r-n.y)*t.y),!(u>m||f>c||(f>u&&(u=f),m<c&&(c=m),t.z>=0?(A=(i-n.z)*t.z,h=(s-n.z)*t.z):(A=(s-n.z)*t.z,h=(i-n.z)*t.z),u>h||A>c)||(A>u&&(u=A),h<c&&(c=h),c<0))}var dn=function(){function n(t,e,r){this.x=t,this.y=e,this.z=r}return n.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},n.prototype.set=function(t,e,r){return this.x=t,this.y=e,this.z=r,this},n.prototype.fromArray=function(t,e){return e===void 0&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},n.prototype.toArray=function(t,e){return t===void 0&&(t=[]),e===void 0&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},n.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this},n.prototype.multiplyScalar=function(t){return this.x*=t,this.y*=t,this.z*=t,this},n.prototype.subVectors=function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},n.prototype.addScaledVector=function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},n.prototype.dot=function(t){return this.x*t.x+this.y*t.y+this.z*t.z},n.prototype.cross=function(t){var e=this.x,r=this.y,i=this.z;return this.x=r*t.z-i*t.y,this.y=i*t.x-e*t.z,this.z=e*t.y-r*t.x,this},n.prototype.crossVectors=function(t,e){var r=t.x,i=t.y,a=t.z,o=e.x,s=e.y,l=e.z;return this.x=i*l-a*s,this.y=a*o-r*l,this.z=r*s-i*o,this},n.prototype.distanceTo=function(t){return Math.sqrt(this.distanceToSquared(t))},n.prototype.distanceToSquared=function(t){var e=this.x-t.x,r=this.y-t.y,i=this.z-t.z;return e*e+r*r+i*i},n.prototype.clone=function(){return new n(this.x,this.y,this.z)},n}(),W0=function(){function n(t,e,r){this.triangle=t,this.intersectionPoint=e,this.index=r}return n}(),us=1e-6,Ue=new dn(0,0,0),Lr=new dn(0,0,0),Or=new dn(0,0,0),Vr=new dn(0,0,0),Z0=function(n){se(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.createTree=function(e,r,i){r=Math.min(r,16);var a=this.getPositionCount()/3,o=a>65535?new Uint32Array(a):new Uint16Array(a),s=new Float32Array(a*6),l=[],u=0,c=-1;if(i)for(var f=0,m=0,A=0,h=void 0,p=void 0,g=void 0,v=void 0,y=void 0,b=void 0,x=void 0;f<a;f+=1,m+=3,A+=6)o[f]=f,this.getPositionByIndex(m,Lr),this.getPositionByIndex(m+1,Or),this.getPositionByIndex(m+2,Vr),h=v=Lr.x,x=Or.x,x<h&&(h=x),x>v&&(v=x),x=Vr.x,x<h&&(h=x),x>v&&(v=x),p=y=Lr.y,x=Or.y,x<p&&(p=x),x>y&&(y=x),x=Vr.y,x<p&&(p=x),x>y&&(y=x),g=b=Lr.z,x=Or.z,x<g&&(g=x),x>b&&(b=x),x=Vr.z,x<g&&(g=x),x>b&&(b=x),s[A]=h,s[A+1]=p,s[A+2]=g,s[A+3]=v,s[A+4]=y,s[A+5]=b;else{for(var w=1/0,E=1/0,C=1/0,M=-1/0,R=-1/0,L=-1/0,f=0,m=0,A=0,h=void 0,p=void 0,g=void 0,v=void 0,y=void 0,b=void 0,x=void 0;f<a;f+=1,m+=3,A+=6)o[f]=f,this.getPositionByIndex(m,Lr),this.getPositionByIndex(m+1,Or),this.getPositionByIndex(m+2,Vr),h=v=Lr.x,x=Or.x,x<h&&(h=x),x>v&&(v=x),x=Vr.x,x<h&&(h=x),x>v&&(v=x),p=y=Lr.y,x=Or.y,x<p&&(p=x),x>y&&(y=x),x=Vr.y,x<p&&(p=x),x>y&&(y=x),g=b=Lr.z,x=Or.z,x<g&&(g=x),x>b&&(b=x),x=Vr.z,x<g&&(g=x),x>b&&(b=x),s[A]=h,s[A+1]=p,s[A+2]=g,s[A+3]=v,s[A+4]=y,s[A+5]=b,h<w&&(w=h),v>M&&(M=v),p<E&&(E=p),y>R&&(R=y),g<C&&(C=g),b>L&&(L=b);i=[w,E,C,M,R,L]}var S=new Cn(++c,i,0,a,0);l[u++]=S;var I=[],O=[0,1,2],P=function(V,D){return I[D]-I[V]};function F(V){var D=V.startIndex,z=V.endIndex,U=V.extents;I[0]=U[3]-U[0],I[1]=U[4]-U[1],I[2]=U[5]-U[2],O.sort(P);for(var H=0;H<3;H++){for(var K=O[H],j=U[K]+U[K+3],J=D,X=z-1,W=-1,Z=void 0;J<=X;)W===-1?(Z=o[J],s[Z*6+K]+s[Z*6+K+3]<j?J++:W=Z):(Z=o[X],s[Z*6+K]+s[Z*6+K+3]>=j||(o[J]=Z,o[X]=W,W=-1,J++),X--);if(J>D&&J<z){var ee=new Cn(++c,ls(o,s,D,J,us),D,J,V.deepth+1);ee.deepth<r&&ee.endIndex-ee.startIndex>e&&(l[u++]=ee);var Y=new Cn(++c,ls(o,s,J,z,us),J,z,V.deepth+1);Y.deepth<r&&Y.endIndex-Y.startIndex>e&&(l[u++]=Y),V.node0=ee,V.node1=Y,V.startIndex=0,V.endIndex=0;break}}}for(;u;)F(l[--u]);return this.offsetArray=o,this.rootNodePacked=J0(S,c+1),l.length=0,this},t.prototype.trianglesInSphere=function(e,r){for(var i=this.offsetArray,a=this.rootNodePacked,o=new Float32Array(a),s=new Uint32Array(a),l=new Uint16Array(a),u=[0],c=[],f,m,A,h;(f=u.pop())!==void 0;){h=f*Er/4;var p=sa(e.x,o[h],o[h+3])-e.x,g=sa(e.y,o[h+1],o[h+4])-e.y,v=sa(e.z,o[h+2],o[h+5])-e.z;if(p*p+g*g+v*v<=r*r){for(var y=s[h+6];y<s[h+7];y++)c.push(i[y]);h=f*Er/2,m=l[h+16],A=l[h+17],m&&u.push(m),A&&u.push(A)}}for(var b=c.length,x=new Float32Array(b*9),y=0;y<b;y++){var w=c[y];this.getPositionByIndex(w,Ue),x[y*9]=Ue.x,x[y*9+1]=Ue.y,x[y*9+2]=Ue.z,this.getPositionByIndex(w+1,Ue),x[y*9+3]=Ue.x,x[y*9+4]=Ue.y,x[y*9+5]=Ue.z,this.getPositionByIndex(w+2,Ue),x[y*9+6]=Ue.x,x[y*9+7]=Ue.y,x[y*9+8]=Ue.z}return x},t.prototype.intersectRay=function(e,r,i,a){for(var o=this.offsetArray,s=this.rootNodePacked,l=new Float32Array(s),u=new Uint32Array(s),c=new Uint16Array(s),f=new dn(1/r.x,1/r.y,1/r.z),m=[0],A,h,p,g;(A=m.pop())!==void 0;)if(g=A*Er/4,X0(e,f,l[g],l[g+1],l[g+2],l[g+3],l[g+4],l[g+5])){for(var v=u[g+6],y=u[g+7],b=void 0,x=void 0,w=void 0,E=e.x,C=e.y,M=e.z,R=r.x,L=r.y,S=r.z,I=void 0,O=void 0,P=void 0,F=void 0,V=void 0,D=void 0,z=void 0,U=void 0,H=void 0,K=void 0,j=void 0,J=void 0,X=void 0,W=void 0,Z=void 0,ee=void 0,Y=void 0,ie=void 0,te=void 0,le=void 0,oe=void 0,xe=void 0,he=void 0,Ae=void 0,Re=void 0,Se=void 0,Te=void 0;v<y;v++){if(b=o[v],x=b*3,this.getPositionByIndex(x,Ue),I=Ue.x,O=Ue.y,P=Ue.z,this.getPositionByIndex(x+1,Ue),F=Ue.x,V=Ue.y,D=Ue.z,this.getPositionByIndex(x+2,Ue),z=Ue.x,U=Ue.y,H=Ue.z,K=F-I,j=V-O,J=D-P,X=z-I,W=U-O,Z=H-P,ee=j*Z-J*W,Y=J*X-K*Z,ie=K*W-j*X,he=R*ee+L*Y+S*ie,he>0)xe=1;else if(he<0)xe=-1,he=-he;else continue;te=E-I,le=C-O,oe=M-P,Ae=xe*(R*(le*Z-oe*W)+L*(oe*X-te*Z)+S*(te*W-le*X)),!(Ae<0)&&(Re=xe*(R*(j*oe-J*le)+L*(J*te-K*oe)+S*(K*le-j*te)),!(Re<0)&&(Ae+Re>he||(Se=-xe*(te*ee+le*Y+oe*ie),!(Se<0)&&(Te=Se/he,a.push(new W0([I,O,P,F,V,D,z,U,H],[E+R*Te,C+L*Te,M+S*Te],b))))))}g=A*Er/2,h=c[g+16],p=c[g+17],h&&m.push(h),p&&m.push(p)}return a},t}(_0);function sa(n,t,e){return n<t?t:n>e?e:n}function ls(n,t,e,r,i){if(e>=r)return[0,0,0,0,0,0];for(var a=1/0,o=1/0,s=1/0,l=-1/0,u=-1/0,c=-1/0,f=e,m=void 0,A=void 0;f<r;f++)m=n[f]*6,A=t[m],A<a&&(a=A),A=t[m+1],A<o&&(o=A),A=t[m+2],A<s&&(s=A),A=t[m+3],A>l&&(l=A),A=t[m+4],A>u&&(u=A),A=t[m+5],A>c&&(c=A);return[a-i,o-i,s-i,l+i,u+i,c+i]}var cs=1e-6,Hd=["x","y","z"],ut=new dn(0,0,0),Y0=function(n){se(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.createTree=function(e,r,i){r=Math.min(r,16);var a=this.getPositionByIndex.bind(this),o=this.getPositionCount(),s=o>65535?new Uint32Array(o):new Uint16Array(o),l=[],u=0,c=-1;if(i)for(var f=0;f<o;f+=1)s[f]=f;else{a(0,ut);for(var m=ut.x,A=ut.y,h=ut.z,p=m,g=A,v=h,f=0,y=void 0,b=void 0,x=void 0;f<o;f+=1)s[f]=f,a(f,ut),y=ut.x,b=ut.y,x=ut.z,y<m?m=y:y>p&&(p=y),b<A?A=b:b>g&&(g=b),x<h?h=x:x>v&&(v=x);i=[m,A,h,p,g,v]}var w=new Cn(++c,i,0,o,0);l[u++]=w;var E=[],C=[0,1,2],M=function(L,S){return E[S]-E[L]};function R(L){var S=L.startIndex,I=L.endIndex,O=L.extents;E[0]=O[3]-O[0],E[1]=O[4]-O[1],E[2]=O[5]-O[2];for(var P=C.sort(M)[0],F=Hd[P],V=(O[P]+O[P+3])/2,D=S,z=I-1,U=-1,H;D<=z;)U===-1?(H=s[D],a(H,ut),ut[F]<V?D++:U=H):(H=s[z],a(H,ut),ut[F]>=V||(s[D]=H,s[z]=U,U=-1,D++),z--);if(D>S){var K=O.slice();K[P+3]=V+cs;var j=new Cn(++c,K,S,D,L.deepth+1);j.deepth<r&&j.endIndex-j.startIndex>e&&(l[u++]=j),L.node0=j}if(I>D){var J=O.slice();J[P]=V-cs;var X=new Cn(++c,J,D,I,L.deepth+1);X.deepth<r&&X.endIndex-X.startIndex>e&&(l[u++]=X),L.node1=X}L.startIndex=0,L.endIndex=0}for(;u;)R(l[--u]);return this.offsetArray=s,this.rootNodePacked=J0(w,c+1),l.length=0,this},t.prototype.intersectRay=function(e,r,i,a){for(var o=this.offsetArray,s=this.rootNodePacked,l=new Float32Array(s),u=new Uint32Array(s),c=new Uint16Array(s),f=i*i,m=new dn(1/r.x,1/r.y,1/r.z),A=[0],h,p,g,v;(h=A.pop())!==void 0;)if(v=h*Er/4,X0(e,m,l[v],l[v+1],l[v+2],l[v+3],l[v+4],l[v+5],i)){for(var y=u[v+6],b=u[v+7],x=void 0,w=void 0,E=void 0,C=void 0,M=void 0,R=void 0,L=void 0,S=void 0,I=void 0,O=void 0,P=void 0,F=void 0;y<b;y++)x=o[y],this.getPositionByIndex(x,ut),w=ut.x,E=ut.y,C=ut.z,M=e.x,R=e.y,L=e.z,S=r.x,I=r.y,O=r.z,P=S*(w-M)+I*(E-R)+O*(C-L),P>0&&(M+=S*P,R+=I*P,L+=O*P),S=w-M,I=E-R,O=C-L,P=S*S+I*I+O*O,P<=f&&a.push(new W0([w,E,C,w,E,C,w,E,C],[M,R,L],x));v=h*Er/2,p=c[v+16],g=c[v+17],p&&A.push(p),g&&A.push(g)}return a},t}(_0);const $0="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO3ZhciBlcj1mdW5jdGlvbihlLHIpe3JldHVybiBlcj1PYmplY3Quc2V0UHJvdG90eXBlT2Z8fHtfX3Byb3RvX186W119aW5zdGFuY2VvZiBBcnJheSYmZnVuY3Rpb24odCxvKXt0Ll9fcHJvdG9fXz1vfXx8ZnVuY3Rpb24odCxvKXtmb3IodmFyIGYgaW4gbylPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwobyxmKSYmKHRbZl09b1tmXSl9LGVyKGUscil9O2Z1bmN0aW9uIGhy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i5ub2RlMSYmKGRbcysxN109bi5ub2RlMS5pZCx2LnB1c2gobi5ub2RlMSkpO3JldHVybiB0fWZ1bmN0aW9uIGNyKGUscix0LG8sZixkLHYsbixzKXtzPT09dm9pZCAwJiYocz0wKSx0PXQtcyxvPW8tcyxmPWYtcyxkPWQrcyx2PXYrcyxuPW4rczt2YXIgdT0wLHc9MCx5PTAscD0wLGE9MCxoPTA7cmV0dXJuIHIueD49MD8odT0odC1lLngpKnIueCx3PShkLWUueCkqci54KToodT0oZC1lLngpKnIueCx3PSh0LWUueCkqci54KSxyLnk+PTA/KHk9KG8tZS55KSpyLnkscD0odi1lLnkpKnIueSk6KHk9KHYtZS55KSpyLnkscD0oby1lLnkpKnIueSksISh1PnB8fHk+d3x8KHk+dSYmKHU9eSkscDx3JiYodz1wKSxyLno+PTA/KGE9KGYtZS56KSpyLnosaD0obi1lLnopKnIueik6KGE9KG4tZS56KSpyLnosaD0oZi1lLnopKnIueiksdT5ofHxhPncpfHwoYT51JiYodT1hKSxoPHcmJih3PWgpLHc8MCkpfXZhciBZPWZ1bmN0aW9uKCl7ZnVuY3Rpb24gZShyLHQsbyl7dGhpcy54PXIsdGhpcy55PXQsdGhpcy56PW99cmV0dXJuIGUucHJvdG90eXBlLmNvcHk9ZnVuY3Rpb24ocil7cmV0dXJuIHRoaXMueD1yLngsdGhpcy55PXIueSx0aGlzLno9ci56LHRoaXN9LGUucHJvdG90eXBlLnNldD1mdW5jdGlvbihyLHQsbyl7cmV0dXJuIHRoaXMueD1yLHRoaXMueT10LHRoaXMuej1vLHRoaXN9LGUucHJvdG90eXBlLmZyb21BcnJheT1mdW5jdGlvbihyLHQpe3JldHVybiB0PT09dm9pZCAwJiYodD0wKSx0aGlzLng9clt0XSx0aGlzLnk9clt0KzFdLHRoaXMuej1yW3QrMl0sdGhpc30sZS5wcm90b3R5cGUudG9BcnJheT1mdW5jdGlvbihyLHQpe3JldHVybiByPT09dm9pZCAwJiYocj1bXSksdD09PXZvaWQgMCYm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T1zLmF0dHJpYnV0ZXNbd107eSYmeS5idWZmZXIgaW5zdGFuY2VvZiBBcnJheUJ1ZmZlciYmby5hZGQoeS5idWZmZXIpfXU9cy5pbmRpY2VzLHUmJnUuYnVmZmVyIGluc3RhbmNlb2YgQXJyYXlCdWZmZXImJm8uYWRkKHUuYnVmZmVyKSx1PXMub2Zmc2V0QXJyYXksdSYmdS5idWZmZXIgaW5zdGFuY2VvZiBBcnJheUJ1ZmZlciYmby5hZGQodS5idWZmZXIpLG8uYWRkKHMucm9vdE5vZGVQYWNrZWQpfXJldHVybntvdXRwdXQ6dCx0cmFuc2ZlcjpBcnJheS5mcm9tKG8pfX0pfSl9KSgpOwo=",qd=n=>Uint8Array.from(atob(n),t=>t.charCodeAt(0)),ds=typeof self!="undefined"&&self.Blob&&new Blob([qd($0)],{type:"text/javascript;charset=utf-8"});function Gd(n){let t;try{if(t=ds&&(self.URL||self.webkitURL).createObjectURL(ds),!t)throw"";const e=new Worker(t,{name:n==null?void 0:n.name});return e.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),e}catch(e){return new Worker("data:text/javascript;base64,"+$0,{name:n==null?void 0:n.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var eu=function(){function n(t,e){this.pool=e,this.workerCreator=t,this.queue=[],this.workers=[],this.workersResolver=[],this.workerStatus=0}return n.prototype.initWorker=function(t){if(this.workerCreator&&!this.workers[t]){var e=this.workerCreator();e.addEventListener("message",this.onMessage.bind(this,t)),this.workers[t]=e}},n.prototype.getIdleWorker=function(){for(var t=0;t<this.pool;t++)if(!(this.workerStatus&1<<t))return t;return-1},n.prototype.onMessage=function(t,e){var r=this.workersResolver[t],i=r.resolve,a=r.reject;if(e.data&&"$$error"in e.data?a(e.data.$$error):i(e.data),this.queue.length){var o=this.queue.shift(),s=o.resolve,l=o.reject,u=o.input,c=o.transfer;this.workersResolver[t]={resolve:s,reject:l},this.workers[t].postMessage(u,c)}else this.workerStatus^=1<<t},n.prototype.postMessage=function(t,e){var r=this;return e===void 0&&(e=[]),new Promise(function(i,a){var o=r.getIdleWorker();o!==-1?(r.initWorker(o),r.workerStatus|=1<<o,r.workersResolver[o]={resolve:i,reject:a},r.workers[o].postMessage(t,e)):r.queue.push({resolve:i,reject:a,input:t,transfer:e})})},n.prototype.dispose=function(){this.workers.forEach(function(t){return t.terminate()}),this.workersResolver.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0},n}(),Kd=new eu(function(){return new Gd},4),jd=new Map,Mn=new d.Ray,fs=new d.Matrix3,Gn=new d.Matrix4,tu=new d.Vector3,_d=new d.Vector3,Jd=new d.Vector3,Xd=new d.Triangle;function Wd(n,t,e,r){var i,a=n.matrixWorld;Gn.getInverse(a),Mn.copy(e.ray).applyMatrix4(Gn);for(var o=t.intersectRay(Mn.origin,Mn.direction,0,[]),s=n.geometry,l=n.material,u=s.groups,c=s.index,f=0,m=o.length;f<m;f++){var A=o[f],h=A.triangle,p=A.index,g=A.intersectionPoint,v=new d.Vector3(g[0],g[1],g[2]).applyMatrix4(a),y=e.ray.origin.distanceTo(v);if(!(y<e.near||y>e.far)){var b=void 0;if(Array.isArray(l)){if(u)for(var x=p*3,w=0,E=u;w<E.length;w++){var C=E[w];if(x>=C.start&&x-C.start<C.count){b=l[(i=C.materialIndex)!==null&&i!==void 0?i:0];break}}}else b=l;if(b){var M=Xd.set(tu.set(h[0],h[1],h[2]).applyMatrix4(a),_d.set(h[3],h[4],h[5]).applyMatrix4(a),Jd.set(h[6],h[7],h[8]).applyMatrix4(a)).getNormal(new d.Vector3),R=p*3,L=new d.Face3(c?c.array[R]:R,c?c.array[R+1]:R+1,c?c.array[R+2]:R+2,M),S=e.ray.direction.dot(M);b.side===d.FrontSide&&S>=0||b.side===d.BackSide&&S<=0||r.push({distance:y,object:n,face:L,point:v,distanceToRay:0,faceIndex:p})}}}}function Zd(n,t,e,r){var i,a,o=n.matrixWorld;fs.getNormalMatrix(o),Gn.getInverse(o);var s=((a=(i=e.params.Points)===null||i===void 0?void 0:i.threshold)!==null&&a!==void 0?a:1)*Gn.getMaxScaleOnAxis();Mn.copy(e.ray).applyMatrix4(Gn);for(var l=t.intersectRay(Mn.origin,Mn.direction,s,[]),u=n.geometry,c=u.index,f=u.getAttribute("normal"),m=0,A=l.length;m<A;m++){var h=l[m],p=h.triangle,g=h.index,v=h.intersectionPoint,y=new d.Vector3(v[0],v[1],v[2]).applyMatrix4(o),b=e.ray.origin.distanceTo(y);if(!(b<e.near||b>e.far)){var x=tu.set(p[0],p[1],p[2]).applyMatrix4(o),w=c?c.array[g]:g,E=void 0;if(f instanceof d.BufferAttribute){var C=new d.Vector3().fromBufferAttribute(f,w).applyNormalMatrix(fs);E=new d.Face3(w,w,w,C)}r.push({distance:b,object:n,face:E,point:y,distanceToRay:y.distanceTo(x),index:g})}}}var ru="__bvh_mesh__",Yd=d.Mesh.prototype.raycast;function $d(n,t){var e=ef(this);e?Wd(this,e,n,t):Yd.call(this,n,t)}function ef(n){var t=n[ru];return t instanceof Z0,t}function tf(n,t){var e;Object.assign(n,(e={},e[ru]=t,e.raycast=$d,e))}var nu="__bvh_points__",rf=d.Points.prototype.raycast;function nf(n,t){var e=af(this);e?Zd(this,e,n,t):rf.call(this,n,t)}function af(n){var t=n[nu];return t instanceof Y0,t}function of(n,t){var e;Object.assign(n,(e={},e[nu]=t,e.raycast=nf,e))}function sf(n,t,e,r){var i=[];return n.traverse(function(a){(a instanceof d.Mesh||a instanceof d.Points)&&a.geometry instanceof d.BufferGeometry&&i.push(a)}),Promise.resolve().then(function(){for(var a=[],o=new Set,s=null,l=0;l<i.length;l++){var u=i[l],c=u.geometry;if(c instanceof d.BufferGeometry){var f=void 0;if(u instanceof d.Mesh?f="mesh":u instanceof d.Points&&(f="points"),!!f){var m=c.boundingBox,A=m?[m.min.x,m.min.y,m.min.z,m.max.x,m.max.y,m.max.z]:void 0,h={};for(var p in c.attributes){var g=c.attributes[p];g instanceof d.InterleavedBufferAttribute?(h[p]={array:g.data.array,stride:g.data.stride,offset:g.offset},s=g.data.array,s&&s.buffer instanceof ArrayBuffer&&o.add(s.buffer)):(h[p]={array:g.array},s=g.array,s&&s.buffer instanceof ArrayBuffer&&o.add(s.buffer))}var v=void 0,y=c.getIndex();y&&(y instanceof d.InterleavedBufferAttribute?(v={array:y.data.array,stride:y.data.stride,offset:y.offset},s=y.data.array,s&&s.buffer instanceof ArrayBuffer&&o.add(s.buffer)):(v={array:y.array},s=y.array,s&&s.buffer instanceof ArrayBuffer&&o.add(s.buffer)));var b={type:f,attributes:h,indices:v,maxItemPerNode:e,maxTreeDepth:r,extents:A};a.push(b)}}}return Kd.postMessage(a,Array.from(o))}).then(function(a){for(var o=0;o<i.length;o++){var s=i[o],l=s.geometry,u=a[o];if(l instanceof d.BufferGeometry){for(var c in u.attributes){var f=u.attributes[c].array,m=l.attributes[c];m instanceof d.InterleavedBufferAttribute?m.data.array=f:m.array=f}var A=l.getIndex();if(A&&u.indices){var f=u.indices.array;A instanceof d.InterleavedBufferAttribute?A.data.array=f:A.array=f}if(s instanceof d.Mesh){var h=new Z0(u.attributes.position,u.indices);h.offsetArray=u.offsetArray,h.rootNodePacked=u.rootNodePacked,tf(s,h)}else if(s instanceof d.Points){var h=new Y0(u.attributes.position,u.indices);h.offsetArray=u.offsetArray,h.rootNodePacked=u.rootNodePacked,of(s,h)}}}return n})}var iu=function(n){se(t,n);function t(e,r,i){i===void 0&&(i=Q);var a=n.call(this)||this;return a.contentObject=r,a.disposer=i,a.name=e,a.materials=[],a.pbmObjects=[],a.disposers=[i],a.add(r),r.traverse(function(o){var s;if(o instanceof d.Mesh||o instanceof d.Points){var l=o.material;Array.isArray(l)?(s=a.materials).push.apply(s,l):a.materials.push(l)}(o instanceof Tt||o instanceof er)&&a.pbmObjects.push(o)}),a}return t.prototype.generateBvhTree=function(){return sf(this,!0,200,10)},t.prototype.intersectRaycaster=function(e,r,i){r===void 0&&(r=!0),i===void 0&&(i=[]);for(var a=this.children.slice(),o,s=[];o=a.pop();)if(o.visible){o.raycast(e,s);for(var l=0,u=o.children.length;l<u;l++)a.push(o.children[l])}return s.forEach(function(c){var f=0;if((c.object instanceof Tt||c.object instanceof er)&&c.face){var m=Array.isArray(c.object.material)?c.object.material[c.face.materialIndex]:c.object.material;m&&(f=m.floor)}c.floor=f}),r&&s.sort(function(c,f){return c.distance-f.distance}),i.push.apply(i,s),i},t.prototype.update=function(e,r,i,a){for(var o=0,s=this.pbmObjects;o<s.length;o++){var l=s[o];l.update(e,r,i,a)}},t.prototype.dispose=function(){for(var e=0,r=this.disposers;e<r.length;e++){var i=r[e];i()}this.disposers.length=0,this.pbmObjects.length=0},t.prototype.clone=function(){return new t(this.name,this.contentObject,this.disposer)},t}(d.Object3D);function at(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=[];n=n.map(function(s){return(s!=null?s:"").trim()}).filter(function(s){return s.length>0&&!/^\/+$/.test(s)});for(var r=0;r<n.length;r++){var i=r===0,a=r===n.length-1,o=n[r];i||(o=o.replace(/^\.\//,"").replace(/^\/+/,"")),a||(o=o.replace(/\/+$/,"")),e.push(o)}return e.join("/")}function xi(n){var t,e=/^(http\:|https\:|file\:)?\/\/[^/]/.exec(n);if(!e)return n;var r=e[1]||"",i=n.slice(r.length+2),a=i.indexOf("#");a>=0&&(n.slice(a),i=n.slice(0,a));var o=i.indexOf("?");o>=0&&(n.slice(o),i=n.slice(0,o));for(var s=i.split("/"),l=s.shift(),u=(t=s.pop())!==null&&t!==void 0?t:"",c=[],f=0,m=s;f<m.length;f++){var A=m[f];if(!(A===""||A===".")){if(A===".."){c.pop();continue}c.push(A)}}return r+"//"+l+"/"+c.join("/")+"/"+u}function Cr(n){return n.indexOf("//")===0||/^[0-9a-z]+\:/i.test(n)}function au(n,t,e){if(n.content&&n.content.uri&&(Cr(n.content.uri)||(n.content.uri=xi(at(t,n.content.uri)))),n.transform){for(var r=!1,i=0;i<16;i++){var a=n.transform[i];if(typeof a!="number"||isNaN(a)||!isFinite(a)){r=!0;break}}if(n.transform[15]===0&&(r=!0),r)throw new Error("Invalid Tile Transform: "+JSON.stringify(n.transform))}if(n.children)for(var o=0,s=n.children;o<s.length;o++){var l=s[o];au(l,t)}return n}function wi(n,t){if(n.asset||(n.asset={}),n.rootMeta||(n.rootMeta={}),n.asset.overview){var e=n.asset.overview;Cr(e.imageFile)||(e.imageFile=xi(at(t,e.imageFile))),Cr(e.worldFile)||(e.worldFile=xi(at(t,e.worldFile)))}if(n.asset.trajectories)for(var r=0;r<n.asset.trajectories.list.length;r++){var i=n.asset.trajectories.list[r];i.file=xi(at(t,i.file))}return au(n.root,t),n}function uf(n,t,e){for(var r,i,a=Promise.resolve(),o=n.slice(),s=function(){for(var l=[],u=0,c=void 0;c=o.shift();){l.push(c);var f=((r=c.image)===null||r===void 0?void 0:r.width)*((i=c.image)===null||i===void 0?void 0:i.height);if(!isNaN(f)&&isFinite(f)&&(u+=f),u>=e)break}a=a.then(function(){return new Promise(function(m){dt.shared.add(function(){for(var A=0,h=l;A<h.length;A++){var p=h[A];t.initTexture(p)}m()},!0)})}).catch(function(){})};o.length>0;)s();return a}function mo(n,t){if(t===void 0&&(t=""),(t[0]==="?"||t[0]==="&")&&(t=t.slice(1)),!t)return n;var e=n.indexOf("#"),r="";return e>=0&&(r=n.slice(e),n=n.slice(0,e)),(n[n.length-1]==="?"||n[n.length-1]==="&")&&(n=n.slice(0,-1)),n.indexOf("?")>=0?"".concat(n,"&").concat(t).concat(r):"".concat(n,"?").concat(t).concat(r)}var ua=4;function ou(n,t,e){var r=new DataView(t);if(n.magic=r.getUint32(e,!0),e+=ua,n.version=r.getUint32(e,!0),e+=ua,n.byteLength=r.getUint32(e,!0),e+=ua,n.version!==1)throw new Error("3D Tile Version ".concat(n.version," not supported"));return e}var sr,We;(function(n){n[n.BYTE=5120]="BYTE",n[n.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",n[n.SHORT=5122]="SHORT",n[n.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",n[n.INT=5124]="INT",n[n.UNSIGNED_INT=5125]="UNSIGNED_INT",n[n.FLOAT=5126]="FLOAT",n[n.DOUBLE=5130]="DOUBLE"})(We||(We={}));var lf=(sr={},sr[We.DOUBLE]=Float64Array,sr[We.FLOAT]=Float32Array,sr[We.UNSIGNED_SHORT]=Uint16Array,sr[We.UNSIGNED_INT]=Uint32Array,sr[We.UNSIGNED_BYTE]=Uint8Array,sr[We.BYTE]=Int8Array,sr[We.SHORT]=Int16Array,sr[We.INT]=Int32Array,sr),cf={DOUBLE:We.DOUBLE,FLOAT:We.FLOAT,UNSIGNED_SHORT:We.UNSIGNED_SHORT,UNSIGNED_INT:We.UNSIGNED_INT,UNSIGNED_BYTE:We.UNSIGNED_BYTE,BYTE:We.BYTE,SHORT:We.SHORT,INT:We.INT};function Fi(n){var t=lf[n];if(!t)throw new Error("Failed to convert GL type");return t}function la(n){var t=Fi(n);return t.BYTES_PER_ELEMENT}function hs(n,t,e,r){e===void 0&&(e=0);var i=Fi(n);if(e%la(n)!==0){var a=r?t.slice(e,e+r*la(n)):t.slice(e);return new i(a)}else return new i(t,e,r!=null?r:(t.byteLength-e)/la(n))}function df(n){var t=cf[n];if(!t)throw new Error("Failed to convert GL type");return t}var su=function(){function n(t,e){this.featuresLength=0,this.cachedTypedArrays={},this.json=t,this.buffer=e;var r=this.getGlobalProperty("POINTS_LENGTH",We.UNSIGNED_INT,1);r&&r.length&&(this.featuresLength=r[0])}return n.prototype.getExtension=function(t){return this.json.extensions&&this.json.extensions[t]},n.prototype.hasProperty=function(t){return!!this.json[t]},n.prototype.getGlobalProperty=function(t,e,r){var i=this.json[t];if(typeof i=="number"){var a=Fi(e);return new a([i])}else if(Array.isArray(i)){var a=Fi(e);return new a(i)}else if(i&&Number.isFinite(i.byteOffset))return this.getTypedArrayFromBinary(t,e,r,1,i.byteOffset);return null},n.prototype.getPropertyArray=function(t,e,r){var i=this.json[t];return i&&Number.isFinite(i.byteOffset)?("componentType"in i&&(e=df(i.componentType)),this.getTypedArrayFromBinary(t,e,r,this.featuresLength,i.byteOffset)):this.getTypedArrayFromArray(t,e,i)},n.prototype.getProperty=function(t,e,r,i,a){var o=this.json[t];if(!o)return null;var s=this.getPropertyArray(t,e,r);if(r===1)return a[0]=s[i],a;for(var l=0;l<r;++l)a[l]=s[r*i+l];return a},n.prototype.getTypedArrayFromBinary=function(t,e,r,i,a){var o=this.cachedTypedArrays,s=o[t];return s||(s=hs(e,this.buffer.buffer,this.buffer.byteOffset+a,i*r),o[t]=s),s},n.prototype.getTypedArrayFromArray=function(t,e,r){var i=this.cachedTypedArrays,a=i[t];return a||(a=hs(e,r),i[t]=a),a},n}(),yn=4,ps="b3dm tile in legacy format.";function uu(n,t,e){var r=new TextDecoder("utf8"),i=new Uint8Array(n,t,e),a=r.decode(i);return a}function lu(n,t,e){return e=ff(n,t,e),e=hf(n,t,e),e=pf(n,t,e),e}function ff(n,t,e){var r=new DataView(t),i=0;n.header=n.header||{};var a=r.getUint32(e,!0);e+=yn;var o=r.getUint32(e,!0);e+=yn;var s=r.getUint32(e,!0);e+=yn;var l=r.getUint32(e,!0);return e+=yn,s>=570425344?(e-=yn*2,i=a,s=o,l=0,a=0,o=0,console.warn(ps)):l>=570425344&&(e-=yn,i=s,s=a,l=o,a=0,o=0,console.warn(ps)),n.header.featureTableJsonByteLength=a,n.header.featureTableBinaryByteLength=o,n.header.batchTableJsonByteLength=s,n.header.batchTableBinaryByteLength=l,n.header.batchLength=i,e}function hf(n,t,e){var r=n.header||{},i=r.featureTableJsonByteLength,a=r.featureTableBinaryByteLength,o=r.batchLength;if(n.featureTableJson={BATCH_LENGTH:o||0},i&&i>0){var s=uu(t,e,i);n.featureTableJson=JSON.parse(s)}e+=i||0,n.featureTableBinary=new Uint8Array(t,e,a),e+=a||0,n.rtcCenter=[0,0,0];var l=new su(n.featureTableJson,n.featureTableBinary);if(Array.isArray(l.json.RTC_CENTER)){var u=l.json.RTC_CENTER;n.rtcCenter[0]=u[0],n.rtcCenter[1]=u[1],n.rtcCenter[2]=u[2]}else{var u=l.getGlobalProperty("RTC_CENTER",We.FLOAT,3);u&&(n.rtcCenter[0]=u[0],n.rtcCenter[1]=u[1],n.rtcCenter[2]=u[2])}return e}function pf(n,t,e){var r=n.header||{},i=r.batchTableJsonByteLength,a=r.batchTableBinaryByteLength;if(i&&i>0){var o=uu(t,e,i);n.batchTableJson=JSON.parse(o),e+=i,a&&a>0&&(n.batchTableBinary=new Uint8Array(t,e,a),n.batchTableBinary=new Uint8Array(n.batchTableBinary),e+=a)}return e}function vf(n,t,e){var r=e!==void 0?new Uint8Array(n).subarray(t,t+e):new Uint8Array(n).subarray(t),i=new Uint8Array(r);return i.buffer}function mf(n,t,e){var r=n.byteLength-e;if(r===0)throw new Error("glTF byte length must be greater than 0.");return e%4!==0&&console.warn("".concat(n.type,": embedded glb is not aligned to a 4-byte boundary.")),n.gltfArrayBuffer=vf(t,e,r),n.byteLength}function qa(n){if(typeof TextDecoder!="undefined")return new TextDecoder().decode(n);for(var t="",e=0,r=n.length;e<r;e++)t+=String.fromCharCode(n[e]);try{return decodeURIComponent(escape(t))}catch(i){return t}}var Oe={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},Vn={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},ki={9728:d.NearestFilter,9729:d.LinearFilter,9984:d.NearestMipmapNearestFilter,9985:d.LinearMipmapNearestFilter,9986:d.NearestMipmapLinearFilter,9987:d.LinearMipmapLinearFilter},Li={33071:d.ClampToEdgeWrapping,33648:d.MirroredRepeatWrapping,10497:d.RepeatWrapping},vs={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},kt={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Nr={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},Af={CUBICSPLINE:void 0,LINEAR:d.InterpolateLinear,STEP:d.InterpolateDiscrete},yr={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function vt(n){var t=[];for(var e in n)t.push(n[e]);return t}function gf(n){var t=Array.from(n);return function(){for(var e=0,r=t;e<r.length;e++){var i=r[e];typeof i.dispose=="function"&&i.dispose(),typeof i.close=="function"&&i.close()}}}var yf=function(){function n(t,e,r){this.json=t,this.extensions=e,this.options=r,this.cache=new Map,this.disposeSet=new Set,this.textureSet=new Set,this.nodeNamesUsed={}}return n.prototype.dispose=function(){this.cache.clear(),this.disposeSet.forEach(function(t){typeof t.dispose=="function"&&t.dispose(),typeof t.close=="function"&&t.close()}),this.disposeSet.clear(),this.textureSet.clear(),this.extensions={},this.json={asset:{version:"unknown"}}},n.prototype.markDefs=function(){for(var t=this.json.nodes||[],e=this.json.skins||[],r=this.json.meshes||[],i=0,a=e.length;i<a;i++)for(var o=e[i].joints,s=0,l=o.length;s<l;s++)t[o[s]].isBone=!0;for(var u=0,c=t.length;u<c;u++){var f=t[u];f.mesh!==void 0&&f.skin!==void 0&&(r[f.mesh].isSkinnedMesh=!0)}},n.prototype.parse=function(){var t=this,e=this.json,r=this.extensions;this.markDefs();for(var i=0,a=vt(r);i<a.length;i++){var o=a[i];o.markDefs(this)}return Promise.all(vt(r).map(function(s){return s.prepare(t)})).then(function(){var s,l,u;return Promise.all([Promise.all(((s=e.scenes)!==null&&s!==void 0?s:[]).map(function(c,f){return t.loadScene(f)})),Promise.all(((l=e.animations)!==null&&l!==void 0?l:[]).map(function(c,f){return t.loadAnimation(f)})),Promise.all(((u=e.cameras)!==null&&u!==void 0?u:[]).map(function(c,f){return t.loadCamera(f)}))])}).then(function(s){var l=s[0],u=s[1],c=s[2],f={json:e,scene:l[e.scene||0],scenes:l,animations:u,cameras:c,textures:[],dispose:Q};return f}).then(function(s){return Promise.all(vt(r).map(function(l){return l.emitResult(s,t)})).then(function(){return s})}).then(function(s){var l=Array.from(t.textureSet),u=gf(t.disposeSet);return Object.assign(s,{textures:l,dispose:u}),t.textureSet.clear(),t.disposeSet.clear(),t.dispose(),s})},n.prototype.loadCamera=function(t){var e="camera:"+t,r=this.cache.get(e);if(r)return r;for(var i=null,a=0,o=vt(this.extensions);a<o.length;a++){var s=o[a];if(i=s.loadCamera(t,this),i)break}if(!i){var l=void 0,u=this.json.cameras[t],c=u[u.type];c?u.type==="perspective"?l=new d.PerspectiveCamera(d.MathUtils.radToDeg(c.yfov),c.aspectRatio||1,c.znear||1,c.zfar||2e6):u.type==="orthographic"?l=new d.OrthographicCamera(-c.xmag,c.xmag,c.ymag,-c.ymag,c.znear,c.zfar):(console.warn("glTF: Invalid camera type ".concat(u.type,".")),l=new d.Camera):(console.warn("glTF: Missing camera parameters."),l=new d.Camera),u.name&&(l.name=this.createUniqueName(u.name)),i=Promise.resolve(l)}return this.cache.set(e,i),i},n.prototype.loadSkin=function(t){var e="animation:"+t,r=this.cache.get(e);if(r)return r;var i,a=this.json.skins[t],o={joints:a.joints};return a.inverseBindMatrices===void 0?i=Promise.resolve(o):i=this.loadAccessor(a.inverseBindMatrices).then(function(s){return s&&(o.inverseBindMatrices=s),o}),this.cache.set(e,i),i},n.prototype.loadAnimation=function(t){var e="animation:"+t,r=this.cache.get(e);if(r)return r;for(var i=null,a=0,o=vt(this.extensions);a<o.length;a++){var s=o[a];if(i=s.loadAnimation(t,this),i)break}if(!i){for(var l=this.json,u=l.animations[t],c=[],f=[],m=[],A=[],h=[],p=0,g=u.channels.length;p<g;p++){var v=u.channels[p],y=u.samplers[v.sampler],b=v.target,x=b.node!==void 0?b.node:b.id,w=u.parameters!==void 0?u.parameters[y.input]:y.input,E=u.parameters!==void 0?u.parameters[y.output]:y.output;c.push(this.loadNode(x)),f.push(this.loadAccessor(w)),m.push(this.loadAccessor(E)),A.push(y),h.push(b)}i=Promise.all([Promise.all(c),Promise.all(f),Promise.all(m),Promise.all(A),Promise.all(h)]).then(function(C){for(var M=C[0],R=C[1],L=C[2],S=C[3],I=C[4],O=[],P=function(z,U){var H=M[z],K=R[z],j=L[z],J=S[z],X=I[z];if(H===void 0)return"continue";H.updateMatrix(),H.matrixAutoUpdate=!0;var W=void 0;switch(Nr[X.path]){case Nr.weights:W=d.NumberKeyframeTrack;break;case Nr.rotation:W=d.QuaternionKeyframeTrack;break;case Nr.position:case Nr.scale:default:W=d.VectorKeyframeTrack;break}var Z=H.name?H.name:H.uuid,ee=J.interpolation!==void 0?Af[J.interpolation]:d.InterpolateLinear,Y=[];Nr[X.path]===Nr.weights?H.traverse(function(Ae){Ae.morphTargetInfluences&&Y.push(Ae.name?Ae.name:Ae.uuid)}):Y.push(Z);var ie=j.array;if(j.normalized){for(var te=ca(ie.constructor),le=new Float32Array(ie.length),oe=0,xe=ie.length;oe<xe;oe++)le[oe]=ie[oe]*te;ie=le}for(var oe=0,xe=Y.length;oe<xe;oe++){var he=new W(Y[oe]+"."+Nr[X.path],K.array,ie,ee);O.push(he)}},F=0,V=M.length;F<V;F++)P(F);var D=u.name?u.name:"animation_"+t;return new d.AnimationClip(D,void 0,O)})}return this.cache.set(e,i),i},n.prototype.loadBuffer=function(t){var e=this.json.buffers[t];if(e.type&&e.type!=="arraybuffer")throw new Error("glTF: "+e.type+" buffer type is not supported.");var r="buffer:"+t,i=this.cache.get(r);if(i)return i;for(var a=null,o=0,s=vt(this.extensions);o<s.length;o++){var l=s[o];if(a=l.loadBuffer(t,this),a)break}if(!a){var u=this.json.buffers[t];a=this.options.fetcher.ajax(this.resolveResouce(u.uri),{responseType:"arraybuffer"}).then(function(c){return c.body})}return this.cache.set(r,a),a},n.prototype.loadBufferView=function(t){var e="bufferView:"+t,r=this.cache.get(e);if(r)return r;for(var i=null,a=0,o=vt(this.extensions);a<o.length;a++){var s=o[a];if(i=s.loadBufferView(t,this),i)break}if(!i){var l=this.json.bufferViews[t];i=this.loadBuffer(l.buffer).then(function(u){var c=l.byteLength||0,f=l.byteOffset||0;return u.slice(f,f+c)})}return this.cache.set(e,i),i},n.prototype.loadAccessor=function(t){var e=this,r="accessor:"+t,i=this.cache.get(r);if(i)return i;var a=null;if(!a){var o=this.json.accessors[t];if(o.bufferView===void 0&&o.sparse===void 0)a=Promise.resolve(null);else{var s=[];o.bufferView!==void 0?s.push(this.loadBufferView(o.bufferView)):s.push(Promise.resolve(null)),o.sparse!==void 0&&(s.push(this.loadBufferView(o.sparse.indices.bufferView)),s.push(this.loadBufferView(o.sparse.values.bufferView))),a=Promise.all(s).then(function(l){var u=l[0],c=vs[o.type],f=Vn[o.componentType],m=f.BYTES_PER_ELEMENT,A=m*c,h=o.byteOffset||0,p=o.bufferView!==void 0?e.json.bufferViews[o.bufferView].byteStride:void 0,g=o.normalized===!0,v,y;if(p&&p!==A){var b=Math.floor(h/p),x="InterleavedBuffer:"+o.bufferView+":"+o.componentType+":"+b+":"+o.count,w=e.cache.get(x);w||(v=new f(u,b*p,o.count*p/m),w=new d.InterleavedBuffer(v,p/m),e.cache.set(x,w)),y=new d.InterleavedBufferAttribute(w,c,h%p/m,g)}else u===null?v=new f(o.count*c):v=new f(u,h,o.count*c),y=new d.BufferAttribute(v,c,g);if(o.sparse!==void 0){var E=vs.SCALAR,C=Vn[o.sparse.indices.componentType],M=o.sparse.indices.byteOffset||0,R=o.sparse.values.byteOffset||0,L=new C(l[1],M,o.sparse.count*E),S=new f(l[2],R,o.sparse.count*c);u!==null&&(y=new d.BufferAttribute(y.array.slice(),y.itemSize,y.normalized));for(var I=0,O=L.length;I<O;I++){var P=L[I];if(y.setX(P,S[I*c]),c>=2&&y.setY(P,S[I*c+1]),c>=3&&y.setZ(P,S[I*c+2]),c>=4&&y.setW(P,S[I*c+3]),c>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return y})}}return this.cache.set(r,a),a},n.prototype.createPrimitiveKey=function(t){for(var e=0,r=vt(this.extensions);e<r.length;e++){var i=r[e],a=i.createPrimitiveKey(t,this);if(a)return a}for(var o="",s=Object.keys(t.attributes).sort(),l=0,u=s.length;l<u;l++)o+=s[l]+":"+t.attributes[s[l]]+";";return t.indices+":"+o+":"+t.mode},n.prototype.loadGeometry=function(t){for(var e=this,r=null,i=0,a=vt(this.extensions);i<a.length;i++){var o=a[i];if(r=o.loadGeometry(t,this),r)break}return r||(r=this.addGeometryPrimitiveAttributes(new d.BufferGeometry,t)),r=r.then(function(s){return e.disposeSet.add(s),s}),r},n.prototype.loadImage=function(t){for(var e=this,r=null,i=0,a=vt(this.extensions);i<a.length;i++){var o=a[i];if(r=o.loadImage(t,this),r)break}if(!r){var s=this.json.images[t];if(s.bufferView!==void 0){var l=this.json.bufferViews[s.bufferView];r=this.loadBuffer(l.buffer).then(function(c){var f=l.byteOffset||0,m=l.byteLength||0,A=new Uint8Array(c,f,m),h=new Blob([A],{type:s.mimeType});return Ua(h)})}else if(s.uri){var u=this.resolveResouce(s.uri);r=this.options.fetcher.loadImage(u,{},void 0,void 0,void 0,Ri()).then(function(c){return c.body})}else throw new Error("glTF: Invalid image defs.")}return r=r.then(function(c){return e.disposeSet.add(c),c}),r},n.prototype.loadMaterialAsMeshStandardMaterial=function(t){var e=this,r=[],i=new d.MeshStandardMaterial;if(i.color=new d.Color(1,1,1),i.opacity=1,Object.keys(t.attributes).filter(function(c){return kt[c]==="color"}).length>0&&(i.vertexColors=!0),Object.keys(t.attributes).filter(function(c){return kt[c]==="normal"}).length===0&&(i.flatShading=!0),Object.keys(t.attributes).filter(function(c){return kt[c]==="tangent"}).length===0&&(i.normalScale&&(i.normalScale.y*=-1),i.clearcoatNormalScale&&(i.clearcoatNormalScale.y*=-1)),t.material!==void 0){var a=this.json.materials[t.material];a.name&&(i.name=a.name);var o=a.pbrMetallicRoughness||{};if(Array.isArray(o.baseColorFactor)){var s=o.baseColorFactor;i.color.fromArray(s),i.opacity=s[3]}o.baseColorTexture!==void 0&&r.push(this.createMaterialTexture(o.baseColorTexture).then(function(c){c.encoding=d.sRGBEncoding,i.map=c,e.disposeSet.add(c)})),i.metalness=o.metallicFactor!==void 0?o.metallicFactor:1,i.roughness=o.roughnessFactor!==void 0?o.roughnessFactor:1,o.metallicRoughnessTexture!==void 0&&r.push(this.createMaterialTexture(o.metallicRoughnessTexture).then(function(c){c.encoding=d.sRGBEncoding,i.metalnessMap=c,i.roughnessMap=c,e.disposeSet.add(c)})),a.doubleSided===!0&&(i.side=d.DoubleSide);var l=a.alphaMode||yr.OPAQUE;if(l===yr.BLEND?(i.transparent=!0,i.depthWrite=!1):(i.transparent=!1,l===yr.MASK&&(i.alphaTest=a.alphaCutoff!==void 0?a.alphaCutoff:.5)),a.normalTexture!==void 0&&(r.push(this.createMaterialTexture(a.normalTexture).then(function(c){i.normalMap=c,e.disposeSet.add(c)})),i.normalScale=new d.Vector2(1,1),a.normalTexture.scale!==void 0)){var u=a.normalTexture.scale;i.normalScale.set(u,u)}a.occlusionTexture!==void 0&&(r.push(this.createMaterialTexture(a.occlusionTexture).then(function(c){i.aoMap=c,e.disposeSet.add(c)})),a.occlusionTexture.strength!==void 0&&(i.aoMapIntensity=a.occlusionTexture.strength)),a.emissiveFactor!==void 0&&(i.emissive=new d.Color().fromArray(a.emissiveFactor)),a.emissiveTexture!==void 0&&r.push(this.createMaterialTexture(a.emissiveTexture).then(function(c){i.emissiveMap=c,e.disposeSet.add(c)}))}return this.disposeSet.add(i),Promise.all(r).then(function(){return i})},n.prototype.loadMaterialAsLineBasicMaterial=function(t){var e=[],r=new d.LineBasicMaterial;if(r.color=new d.Color(1,1,1),r.opacity=1,Object.keys(t.attributes).filter(function(l){return kt[l]==="color"}).length>0&&(r.vertexColors=!0),Object.keys(t.attributes).filter(function(l){return kt[l]==="tangent"}).length===0&&(r.normalScale&&(r.normalScale.y*=-1),r.clearcoatNormalScale&&(r.clearcoatNormalScale.y*=-1)),t.material!==void 0){var i=this.json.materials[t.material];i.name&&(r.name=i.name);var a=i.pbrMetallicRoughness||{};if(Array.isArray(a.baseColorFactor)){var o=a.baseColorFactor;r.color.fromArray(o),r.opacity=o[3]}i.doubleSided===!0&&(r.side=d.DoubleSide);var s=i.alphaMode||yr.OPAQUE;s===yr.BLEND?(r.transparent=!0,r.depthWrite=!1):(r.transparent=!1,s===yr.MASK&&(r.alphaTest=i.alphaCutoff!==void 0?i.alphaCutoff:.5))}return this.disposeSet.add(r),Promise.all(e).then(function(){return r})},n.prototype.loadMaterialAsPointsMaterial=function(t){var e=this,r=[],i=new d.PointsMaterial;if(i.color=new d.Color(1,1,1),i.opacity=1,i.sizeAttenuation=!1,Object.keys(t.attributes).filter(function(u){return kt[u]==="color"}).length>0&&(i.vertexColors=!0),Object.keys(t.attributes).filter(function(u){return kt[u]==="tangent"}).length===0&&(i.normalScale&&(i.normalScale.y*=-1),i.clearcoatNormalScale&&(i.clearcoatNormalScale.y*=-1)),t.material!==void 0){var a=this.json.materials[t.material];a.name&&(i.name=a.name);var o=a.pbrMetallicRoughness||{};if(Array.isArray(o.baseColorFactor)){var s=o.baseColorFactor;i.color.fromArray(s),i.opacity=s[3]}o.baseColorTexture!==void 0&&r.push(this.createMaterialTexture(o.baseColorTexture).then(function(u){u.encoding=d.sRGBEncoding,i.map=u,e.disposeSet.add(u)})),a.doubleSided===!0&&(i.side=d.DoubleSide);var l=a.alphaMode||yr.OPAQUE;l===yr.BLEND?(i.transparent=!0,i.depthWrite=!1):(i.transparent=!1,l===yr.MASK&&(i.alphaTest=a.alphaCutoff!==void 0?a.alphaCutoff:.5))}return this.disposeSet.add(i),Promise.all(r).then(function(){return i})},n.prototype.loadMaterial=function(t){var e,r=(e=t.mode)!==null&&e!==void 0?e:Oe.TRIANGLES,i="material:"+this.createPrimitiveKey(t),a=this.cache.get(i);if(a)return a;for(var o=null,s=0,l=vt(this.extensions);s<l.length;s++){var u=l[s];if(o=u.loadMaterial(t,this),o)break}if(r===Oe.TRIANGLES||r===Oe.TRIANGLE_STRIP||r===Oe.TRIANGLE_FAN)o=this.loadMaterialAsMeshStandardMaterial(t);else if(r===Oe.LINES||r===Oe.LINE_STRIP||r===Oe.LINE_LOOP)o=this.loadMaterialAsLineBasicMaterial(t);else if(r===Oe.POINTS)o=this.loadMaterialAsPointsMaterial(t);else throw new Error("glTF: Primitive mode unsupported: "+r);return this.cache.set(i,o),o},n.prototype.loadTexture=function(t){var e=this,r="texture:"+t,i=this.cache.get(r);if(i)return i;for(var a=null,o=0,s=vt(this.extensions);o<s.length;o++){var l=s[o];if(a=l.loadTexture(t,this),a)break}if(!a){var u=this.json.textures[t];a=this.loadImage(u.source).then(function(c){var f=new d.Texture(c);f.needsUpdate=!0,f.flipY=!1,u.name&&(f.name=u.name);var m=e.json.samplers||{},A=m[u.sampler]||{};return f.magFilter=ki[A.magFilter]||d.LinearFilter,f.minFilter=ki[A.minFilter]||d.LinearMipmapLinearFilter,f.wrapS=Li[A.wrapS]||d.RepeatWrapping,f.wrapT=Li[A.wrapT]||d.RepeatWrapping,f.onUpdate=function(){c.close()},f})}return a=a.then(function(c){return e.disposeSet.add(c),c}),this.cache.set(r,a),a},n.prototype.loadMesh=function(t){for(var e=this,r=null,i=0,a=vt(this.extensions);i<a.length;i++){var o=a[i];if(r=o.loadMesh(t,this),r)break}if(!r){var s=this.json.meshes[t],l=s.primitives,u=Promise.all(l.map(function(f){return e.loadGeometry(f)})),c=Promise.all(l.map(function(f){return e.loadMaterial(f)}));r=Promise.all([u,c]).then(function(f){for(var m=f[0],A=f[1],h=[],p=0;p<l.length;p++){var g=l[p],v=m[p],y=A[p],b=g.mode||Oe.TRIANGLES,x=void 0;if(b===Oe.TRIANGLES||b===Oe.TRIANGLE_STRIP||b===Oe.TRIANGLE_FAN)if(b===Oe.TRIANGLE_STRIP?v=e.toGeometryTrianglesDrawMode(v,d.TriangleStripDrawMode):b===Oe.TRIANGLE_FAN&&(v=e.toGeometryTrianglesDrawMode(v,d.TriangleFanDrawMode)),e.disposeSet.add(v),s.isSkinnedMesh){var w=new d.SkinnedMesh(v,y);v.attributes.skinWeight.normalized||w.normalizeSkinWeights(),x=w}else x=new d.Mesh(v,y);else if(b===Oe.POINTS)x=new d.Points(v,y);else if(b===Oe.LINES)x=new d.LineSegments(v,y);else if(b===Oe.LINE_STRIP)x=new d.Line(v,y);else if(b===Oe.LINE_LOOP)x=new d.LineLoop(v,y);else throw new Error("glTF: Primitive mode unsupported: "+b);if(Object.keys(v.morphAttributes).length>0){if(s.weights!==void 0)for(var E=0,C=s.weights.length;E<C;E++)x.morphTargetInfluences[E]=s.weights[E];if(s.extras&&Array.isArray(s.extras.targetNames)){var M=s.extras.targetNames;if(x.morphTargetInfluences.length===M.length){x.morphTargetDictionary={};for(var E=0,C=M.length;E<C;E++)x.morphTargetDictionary[M[E]]=E}else console.warn("glTF: Invalid extras.targetNames length. Ignoring names.")}}x.name=e.createUniqueName(s.name||"mesh_"+t),h.push(x)}if(h.length===1)return h[0];for(var R=new d.Group,L=0,S=h;L<S.length;L++){var x=S[L];R.add(x)}return R})}return r},n.prototype.loadNodeAttachments=function(t){for(var e=[],r=0,i=vt(this.extensions);r<i.length;r++){var a=i[r],o=a.loadNodeAttachments(t,this);o&&e.push(o)}return e},n.prototype.loadNode=function(t){var e="node:"+t,r=this.cache.get(e);if(r)return r;var i=this.json,a=i.nodes[t],o=a.name?this.createUniqueName(a.name):"",s=[];a.mesh!==void 0&&s.push(this.loadMesh(a.mesh).then(function(m){if(a.weights!==void 0){var A=a.weights;m.traverse(function(h){if(h instanceof d.Mesh||h instanceof d.Line||h instanceof d.Points)for(var p=0,g=A.length;p<g;p++)h.morphTargetInfluences[p]=A[p]})}return m})),a.camera!==void 0&&s.push(this.loadCamera(a.camera));for(var l=this.loadNodeAttachments(t),u=0,c=l;u<c.length;u++){var f=c[u];s.push(f)}return Promise.all(s).then(function(m){var A;if(a.isBone===!0?A=new d.Bone:m.length>1?A=new d.Group:m.length===1?A=m[0]:A=new d.Object3D,A!==m[0])for(var h=0,p=m.length;h<p;h++)A.add(m[h]);if(a.name&&(A.name=o),a.matrix!==void 0){var g=new d.Matrix4;g.fromArray(a.matrix),A.applyMatrix4(g)}else a.translation!==void 0&&A.position.fromArray(a.translation),a.rotation!==void 0&&A.quaternion.fromArray(a.rotation),a.scale!==void 0&&A.scale.fromArray(a.scale);return A})},n.prototype.loadScene=function(t){var e=this.json,r=e.scenes[t],i=new d.Group;r.name&&(i.name=this.createUniqueName(r.name));for(var a=r.nodes||[],o=[],s=0,l=a.length;s<l;s++)o.push(this.buildNodeHierarchy(a[s],i));return Promise.all(o).then(function(){return i})},n.prototype.createMaterialTexture=function(t){var e=this;return this.loadTexture(t.index).then(function(r){for(var i=0,a=vt(e.extensions);i<a.length;i++){var o=a[i],s=o.extendTexture(r,t,e);s&&(r=s,e.disposeSet.add(r))}return e.textureSet.add(r),r})},n.prototype.addGeometryPrimitiveAttributes=function(t,e){var r=this,i=e.attributes,a=[],o=function(w){var E=kt[w]||w.toLowerCase();if(E in t.attributes)return"continue";a.push(s.loadAccessor(i[w]).then(function(C){C&&t.setAttribute(E,C)}))},s=this;for(var l in i)o(l);e.indices!==void 0&&!t.index&&a.push(this.loadAccessor(e.indices).then(function(w){w&&t.setIndex(w)}));var u=new d.Box3;if(i.POSITION!==void 0){var c=this.json.accessors[i.POSITION],f=c.min,m=c.max;if(f!==void 0&&m!==void 0){if(u.set(new d.Vector3(f[0],f[1],f[2]),new d.Vector3(m[0],m[1],m[2])),c.normalized){var A=ca(Vn[c.componentType]);u.min.multiplyScalar(A),u.max.multiplyScalar(A)}}else console.warn("glTF: Missing min/max properties for accessor POSITION.")}var h=e.targets;if(h!==void 0){for(var p=new d.Vector3,g=new d.Vector3,v=0,y=h.length;v<y;v++){var b=h[v];if(b.POSITION!==void 0){var c=this.json.accessors[b.POSITION],f=c.min,m=c.max;if(f!==void 0&&m!==void 0){if(g.setX(Math.max(Math.abs(f[0]),Math.abs(m[0]))),g.setY(Math.max(Math.abs(f[1]),Math.abs(m[1]))),g.setZ(Math.max(Math.abs(f[2]),Math.abs(m[2]))),c.normalized){var A=ca(Vn[c.componentType]);g.multiplyScalar(A)}p.max(g)}else console.warn("glTF: Missing min/max properties for accessor POSITION.")}}u.expandByVector(p)}t.boundingBox=u;var x=new d.Sphere;return u.getCenter(x.center),x.radius=u.min.distanceTo(u.max)/2,t.boundingSphere=x,Promise.all(a).then(function(){if(t.attributes.uv&&!t.attributes.uv2&&r.options.copyUV2&&t.setAttribute("uv2",t.attributes.uv),e.targets){for(var w=!1,E=!1,C=0,M=e.targets.length;C<M;C++){var R=e.targets[C];if(R.POSITION!==void 0&&(w=!0),R.NORMAL!==void 0&&(E=!0),w&&E)break}if(!w&&!E)return t;var L=[];t.morphTargetsRelative=!0;for(var S=function(I,O){var P=e.targets[I];w?L.push(r.loadAccessor(P.POSITION).then(function(F){F&&(t.morphAttributes.position[I]=F)})):t.morphAttributes.position[I]=t.attributes.position,E?L.push(r.loadAccessor(P.NORMAL).then(function(F){F&&(t.morphAttributes.normal[I]=F)})):t.morphAttributes.normal[I]=t.attributes.normal},C=0,M=e.targets.length;C<M;C++)S(C,M);return Promise.all(L).then(function(){return t})}else return t})},n.prototype.buildNodeHierarchy=function(t,e){var r=this,i=this.json.nodes[t];return this.loadNode(t).then(function(a){if(i.skin===void 0)return a;var o;return r.loadSkin(i.skin).then(function(s){o=s;for(var l=[],u=0,c=o.joints.length;u<c;u++)l.push(r.loadNode(o.joints[u]));return Promise.all(l)}).then(function(s){return a.traverse(function(l){if(l instanceof d.SkinnedMesh){for(var u=[],c=[],f=0,m=s.length;f<m;f++){var A=s[f];if(A instanceof d.Bone){u.push(A);var h=new d.Matrix4;o.inverseBindMatrices!==void 0&&h.fromArray(o.inverseBindMatrices.array,f*16),c.push(h)}else console.warn('glTF: Joint "%s" could not be found.',o.joints[f])}l.bind(new d.Skeleton(u,c),l.matrixWorld)}}),a})}).then(function(a){e.add(a);var o=[];if(i.children)for(var s=i.children,l=0,u=s.length;l<u;l++){var c=s[l];o.push(r.buildNodeHierarchy(c,a))}return Promise.all(o).then(function(){return a})})},n.prototype.createUniqueName=function(t){for(var e=d.PropertyBinding.sanitizeNodeName(t||""),r=e,i=1;this.nodeNamesUsed[r];++i)r=e+"_"+i;return this.nodeNamesUsed[r]=!0,r},n.prototype.resolveResouce=function(t){return at(this.options.resourcePath,mo(t,this.options.search))},n.prototype.toGeometryTrianglesDrawMode=function(t,e){var r=t.getIndex();if(r===null){var i=[],a=t.getAttribute("position");if(a!==void 0){for(var o=0;o<a.count;o++)i.push(o);t.setIndex(i),r=t.getIndex()}}if(r===null)return console.error("glTF: Undefined position attribute. Processing not possible."),t;var s=r.count-2,l=[];if(e===d.TriangleFanDrawMode)for(var o=1;o<=s;o++)l.push(r.getX(0)),l.push(r.getX(o)),l.push(r.getX(o+1));else for(var o=0;o<s;o++)o%2===0?(l.push(r.getX(o)),l.push(r.getX(o+1)),l.push(r.getX(o+2))):(l.push(r.getX(o+2)),l.push(r.getX(o+1)),l.push(r.getX(o)));l.length/3!==s&&console.error("glTF: Unable to generate correct amount of triangles.");var u=t.clone();return u.setIndex(l),this.disposeSet.add(u),u},n}();function ca(n){switch(n){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("glTF: Unsupported normalized accessor component type.")}}var fr=function(){function n(){}return n.prototype.markDefs=function(t){},n.prototype.prepare=function(t){},n.prototype.emitResult=function(t,e){},n.prototype.createPrimitiveKey=function(t,e){},n.prototype.extendTexture=function(t,e,r){return null},n.prototype.loadBuffer=function(t,e){return null},n.prototype.loadBufferView=function(t,e){return null},n.prototype.loadImage=function(t,e){return null},n.prototype.loadTexture=function(t,e){return null},n.prototype.loadGeometry=function(t,e){return null},n.prototype.loadMaterial=function(t,e){return null},n.prototype.loadMesh=function(t,e){return null},n.prototype.loadNodeAttachments=function(t,e){return null},n.prototype.loadCamera=function(t,e){return null},n.prototype.loadAnimation=function(t,e){return null},n}(),bf=function(n){se(t,n);function t(){var e=n.call(this)||this;return e.header={magic:"",version:0,length:0},e.content="",e.body=null,e}return t.getMagic=function(e){return qa(new Uint8Array(e.slice(0,4)))},t.prototype.loadGlbBinary=function(e){var r=new DataView(e,0,t.HEADER_LENGTH);if(this.header={magic:t.getMagic(e),version:r.getUint32(4,!0),length:r.getUint32(8,!0)},this.header.magic!==t.HEADER_MAGIC)throw new Error("glTF:KHR_binary_glTF: Unsupported.");if(this.header.version<2)throw new Error("glTF:KHR_binary_glTF: Legacy binary file detected.");for(var i=new DataView(e,t.HEADER_LENGTH),a=0,o=null,s=null;a<i.byteLength;){var l=i.getUint32(a,!0);if(a+=4,l!==0){var u=i.getUint32(a,!0);if(a+=4,u===t.CHUNK_TYPES.JSON){var c=new Uint8Array(e,t.HEADER_LENGTH+a,l);o=qa(c)}else if(u===t.CHUNK_TYPES.BIN){var f=t.HEADER_LENGTH+a;s=e.slice(f,f+l)}a+=l}}if(o===null)throw new Error("glTF:KHR_binary_glTF: JSON content not found.");this.content=o,this.body=s},t.prototype.loadBuffer=function(e,r){var i=r.json.buffers[e];return i.uri===void 0&&e===0&&this.body?Promise.resolve(this.body):null},t.prototype.clear=function(){this.body=null,this.content=""},t.HEADER_MAGIC="glTF",t.HEADER_LENGTH=12,t.CHUNK_TYPES={JSON:1313821514,BIN:5130562},t}(fr),xf="https://vr-public.realsee-cdn.cn/release/static/image/release/five/resource/draco/1.5.6/",ms={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},As={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"},wf=function(){function n(){this.decoderPath=xf,this.decoderConfig={},this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL=""}return n.prototype.setDecoderPath=function(t){this.decoderPath=t},n.prototype.setDecoderConfig=function(t){return this.decoderConfig=t,this},n.prototype.setWorkerLimit=function(t){return this.workerLimit=t,this},n.prototype.decodeDracoFile=function(t,e,r,i){var a={attributeIDs:r||ms,attributeTypes:i||As,useUniqueIDs:!!r};this.decodeGeometry(t,a).then(e)},n.prototype.decodeGeometry=function(t,e){var r=this;e===void 0&&(e={attributeIDs:ms,attributeTypes:As,useUniqueIDs:!1});for(var i in e.attributeTypes){var a=e.attributeTypes[i];a.BYTES_PER_ELEMENT!==void 0&&(e.attributeTypes[i]=a.name)}var o,s=this.workerNextTaskID++,l=t.byteLength,u=this._getWorker(s,l).then(function(c){return o=c,new Promise(function(f,m){o._callbacks[s]={resolve:f,reject:m},o.postMessage({type:"decode",id:s,taskConfig:e,buffer:t},[t])})}).then(function(c){return r._createGeometry(c.geometry)});return u.catch(function(){return!0}).then(function(){o&&s&&r._releaseTask(o,s)}),u},n.prototype._createGeometry=function(t){var e=new d.BufferGeometry;t.index&&e.setIndex(new d.BufferAttribute(t.index.array,1));for(var r=0;r<t.attributes.length;r++){var i=t.attributes[r],a=i.name,o=i.array,s=i.itemSize;e.setAttribute(a,new d.BufferAttribute(o,s))}return e},n.prototype._initDecoder=function(){var t=this;if(this.decoderPending)return this.decoderPending;var e=typeof WebAssembly!="object"||this.decoderConfig.type==="js";if(e){var r=Sn(this.decoderPath+"draco_decoder.js",{responseType:"text"}).then(function(a){return a.body});this.decoderPending=r.then(function(a){var o=["/* draco decoder */",a,"","/* worker */",gs].join(`
|
|
418
418
|
`);t.workerSourceURL=URL.createObjectURL(new Blob([o]))})}else{var r=Sn(this.decoderPath+"draco_wasm_wrapper.js",{responseType:"text"}).then(function(o){return o.body}),i=Sn(this.decoderPath+"draco_decoder.wasm",{responseType:"arraybuffer"}).then(function(o){return o.body});this.decoderPending=Promise.all([r,i]).then(function(o){var s=o[0],l=o[1];t.decoderConfig.wasmBinary=l;var u=["/* draco decoder */",s,"","/* worker */",gs].join(`
|
|
419
419
|
`);t.workerSourceURL=URL.createObjectURL(new Blob([u]))})}return this.decoderPending},n.prototype._getWorker=function(t,e){var r=this;return this._initDecoder().then(function(){if(r.workerPool.length<r.workerLimit){var i=new Worker(r.workerSourceURL);i._callbacks={},i._taskCosts={},i._taskLoad=0,i.postMessage({type:"init",decoderConfig:r.decoderConfig}),i.onmessage=function(o){var s=o.data;switch(s.type){case"decode":i._callbacks[s.id].resolve(s);break;case"error":i._callbacks[s.id].reject(s);break;default:console.error('DRACO: Unexpected message, "'+s.type+'"')}},r.workerPool.push(i)}else r.workerPool.sort(function(o,s){return o._taskLoad>s._taskLoad?-1:1});var a=r.workerPool[r.workerPool.length-1];return a._taskCosts[t]=e,a._taskLoad+=e,a})},n.prototype._releaseTask=function(t,e){t._taskLoad-=t._taskCosts[e],delete t._callbacks[e],delete t._taskCosts[e]},n.prototype.dispose=function(){for(var t=0;t<this.workerPool.length;++t)this.workerPool[t].terminate();return this.workerPool.length=0,this},n}(),Oi=new wf,gs=`
|
|
420
420
|
let decoderConfig;
|
|
@@ -2162,7 +2162,7 @@ void main() {
|
|
|
2162
2162
|
#include <premultiplied_alpha_fragment>
|
|
2163
2163
|
|
|
2164
2164
|
}
|
|
2165
|
-
`},Oo=function(n){se(t,n);function t(e){var r=n.call(this,{uniforms:d.UniformsUtils.clone(ka.uniforms),vertexShader:ka.vertexShader,fragmentShader:ka.fragmentShader,clipping:!0})||this;return r.type="LineMaterial",r.dashed=!1,Object.defineProperties(r,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(i){this.uniforms.diffuse.value=i}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(i){this.uniforms.linewidth.value=i}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(i){this.uniforms.dashScale.value=i}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(i){this.uniforms.dashSize.value=i}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(i){this.uniforms.gapSize.value=i}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(i){this.uniforms.opacity.value=i}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(i){this.uniforms.resolution.value.copy(i)}}}),r.setValues(e),r}return t}(d.ShaderMaterial);Object.assign(Oo.prototype,{isLineMaterial:!0});var el=function(n){se(t,n);function t(e,r){var i=n.call(this)||this;return i.type="LineSegments2",i.geometry=e!==void 0?e:new Lo,i.material=r!==void 0?r:new Oo({color:Math.random()*16777215}),i}return t.prototype.computeLineDistances=function(){for(var e=this.geometry,r=e.attributes.instanceStart,i=e.attributes.instanceEnd,a=new Float32Array(2*r.count),o=new d.Vector3,s=new d.Vector3,l=0,u=0,c=r.count;l<c;l++,u+=2)o.fromBufferAttribute(r,l),s.fromBufferAttribute(i,l),a[u]=u===0?0:a[u-1],a[u+1]=a[u]+o.distanceTo(s);var f=new d.InstancedInterleavedBuffer(a,2,1);return e.setAttribute("instanceDistanceStart",new d.InterleavedBufferAttribute(f,1,0)),e.setAttribute("instanceDistanceEnd",new d.InterleavedBufferAttribute(f,1,1)),this},t.prototype.raycast=function(e,r){e.camera===null&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');var i=e.ray,a=e.camera,o=a.projectionMatrix,s=this.geometry,l=this.material,u=l.resolution,c=l.linewidth,f=s.attributes.instanceStart,m=s.attributes.instanceEnd,A=new d.Vector4,h=new d.Vector4,p=new d.Vector4,g=new d.Vector3,v=new d.Matrix4,y=new d.Line3,b=new d.Vector3;i.at(1,p),p.w=1,p.applyMatrix4(a.matrixWorldInverse),p.applyMatrix4(o),p.multiplyScalar(1/p.w),p.x*=u.x/2,p.y*=u.y/2,p.z=0,g.copy(p);var x=this.matrixWorld;v.multiplyMatrices(a.matrixWorldInverse,x);for(var w=0,E=f.count;w<E;w++){A.fromBufferAttribute(f,w),h.fromBufferAttribute(m,w),A.w=1,h.w=1,A.applyMatrix4(v),h.applyMatrix4(v),A.applyMatrix4(o),h.applyMatrix4(o),A.multiplyScalar(1/A.w),h.multiplyScalar(1/h.w);var C=A.z<-1&&h.z<-1,M=A.z>1&&h.z>1;if(!(C||M)){A.x*=u.x/2,A.y*=u.y/2,h.x*=u.x/2,h.y*=u.y/2,y.start.copy(A),y.start.z=0,y.end.copy(h),y.end.z=0;var R=y.closestPointToPointParameter(g,!0);y.at(R,b);var L=d.MathUtils.lerp(A.z,h.z,R),S=L>=-1&&L<=1,I=g.distanceTo(b)<c*.5;if(S&&I){y.start.fromBufferAttribute(f,w),y.end.fromBufferAttribute(m,w),y.start.applyMatrix4(x),y.end.applyMatrix4(x);var O=new d.Vector3,P=new d.Vector3;i.distanceSqToSegment(y.start,y.end,P,O),r.push({point:P,pointOnLine:O,distance:i.origin.distanceTo(P),object:this,faceIndex:w})}}}},t}(d.Mesh);Object.assign(el.prototype,{isLineSegments2:!0});var tl=function(n){se(t,n);function t(e,r){var i=n.call(this,e,r)||this;return i.type="Line2",i}return t}(el);Object.assign(tl.prototype,{isLine2:!0});var rl=function(n){se(t,n);function t(){var e=n.call(this)||this;return e.type="LineGeometry",e}return t.prototype.setPositions=function(e){for(var r=e.length-3,i=new Float32Array(2*r),a=0;a<r;a+=3)i[2*a]=e[a],i[2*a+1]=e[a+1],i[2*a+2]=e[a+2],i[2*a+3]=e[a+3],i[2*a+4]=e[a+4],i[2*a+5]=e[a+5];return n.prototype.setPositions.call(this,i),this},t.prototype.setColors=function(e){for(var r=e.length-3,i=new Float32Array(2*r),a=0;a<r;a+=3)i[2*a]=e[a],i[2*a+1]=e[a+1],i[2*a+2]=e[a+2],i[2*a+3]=e[a+3],i[2*a+4]=e[a+4],i[2*a+5]=e[a+5];return n.prototype.setColors.call(this,i),this},t.prototype.fromLine=function(e){var r=e.geometry;if(r instanceof d.Geometry){var i=new d.BufferGeometry().fromGeometry(r);this.setPositions(i.attributes.position.array)}else r instanceof d.BufferGeometry&&this.setPositions(r.attributes.position.array);return this},t.prototype.copy=function(){return this},t}(Lo);Object.assign(rl.prototype,{isLineGeometry:!0});var Vv="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAeDzoaGh7xYWFuZOTk6OZVk+12uYqqq6JEnn0Wg0OT4+/geAXwGEAdwDIFJQXC1wO4DWR48e/RCPxxclSSroVzRFUbSDg4P848ePFwH8DuAhkWih83TRQWxFOXgAwvDwcOfo6OhvXV1d39tsNtuVBwTDWBwOh1UUxVsMw1hXVlbSdCgNV43uYSvrHg6H24aHh38eHBz85TrgF9FYLHA4HLzH43FvbW2d7u/vG+dANp8FpqIlbd3d3V8Fg8EfBUFw4BONZVmL3+9vHhkZCQL4AoAHgJPK8G+yzC0XDofdoVAo5PP5vkadTBAEtr+/39ff3x8gAp/RPOEqx2qjx+NpvXv3bk9DQ0NDvQgwDIOWlhZrMBj8kgi0UJdxRgYMArzL5XJ7vd57qLPZ7Xamp6fnNgBXtQxcjFuHw+Hyer3t9SYgCAITCAScAJoBNNEY/08GOFVVrfVMv7kMNDntFD1vjIAPrlRN0xjckOm6biFQ3jwNPwDMZrOnqVTqfb3Bi8Wivru7W/VCYkwPlKOjo0IikXh7EwQikYgE4Nw0CfXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg==",l0=14467195,Nv=8,Dv=2,zv=20,c0=null,to=function(n){se(t,n);function t(e,r){e===void 0&&(e=new d.Vector3),r===void 0&&(r=new d.Vector3);var i=n.call(this)||this;i.type="FiveLine",i.needsRender=!0;var a=new rl,o=new Oo({color:l0,linewidth:Dv,dashScale:zv,dashed:!1});i.line=new tl(a,o);var s=new d.BufferGeometry,l=new d.PointsMaterial({color:l0,size:Nv,map:c0||(c0=new d.TextureLoader().load(Vv)),sizeAttenuation:!1,transparent:!0});return i.points=new d.Points(s,l),i.points.renderOrder=11,i.points.frustumCulled=!1,i.setPoints(e,r),i.add(i.line,i.points),i}return Object.defineProperty(t,"version",{get:function(){return"6.3.0-alpha.10"},enumerable:!1,configurable:!0}),t.prototype.setPoints=function(e,r){var i=[].concat(e.toArray(),r.toArray());this.points.geometry.setAttribute("position",new d.BufferAttribute(new Float32Array(i),3)),this.line.geometry.setPositions(i),this.line.computeLineDistances(),this.needsRender=!0},t.prototype.getPoints=function(){var e=this.points.geometry.attributes.position.array;return[new d.Vector3(e[0],e[1],e[2]),new d.Vector3(e[3],e[4],e[5])]},t.prototype.setMaterial=function(e){var r=this.line.material;for(var i in e)if(e.hasOwnProperty(i)){var a=e[i];i==="dashed"?(r.dashed=a,a?r.defines.USE_DASH="":delete r.defines.USE_DASH,r.needsUpdate=!0):r[i]=e[i]}this.needsRender=!0},t.prototype.setResolution=function(e,r){var i=this.line.material.resolution;(i.x!==e||i.y!==r)&&(i.set(e,r),this.needsRender=!0)},t}(d.Object3D);Object.assign(to.prototype,{isFiveLine:!0});var Je={Handedness:Object.freeze({NONE:"none",LEFT:"left",RIGHT:"right"}),ComponentState:Object.freeze({DEFAULT:"default",TOUCHED:"touched",PRESSED:"pressed"}),ComponentProperty:Object.freeze({BUTTON:"button",X_AXIS:"xAxis",Y_AXIS:"yAxis",STATE:"state"}),ComponentType:Object.freeze({TRIGGER:"trigger",SQUEEZE:"squeeze",TOUCHPAD:"touchpad",THUMBSTICK:"thumbstick",BUTTON:"button"}),ButtonTouchThreshold:.05,AxisTouchThreshold:.1,VisualResponseProperty:Object.freeze({TRANSFORM:"transform",VISIBILITY:"visibility"})};function nl(n){return zi(this,void 0,void 0,function(){var t;return Qi(this,function(e){switch(e.label){case 0:return[4,fetch(n)];case 1:if(t=e.sent(),t.ok)return[2,t.json()];throw new Error(t.statusText)}})})}function Qv(n){return zi(this,void 0,void 0,function(){var t,e;return Qi(this,function(r){switch(r.label){case 0:if(!n)throw new Error("No basePath supplied");return t="profilesList.json",[4,nl("".concat(n,"/").concat(t))];case 1:return e=r.sent(),[2,e]}})})}function Uv(n,t){return zi(this,arguments,void 0,function(e,r,i,a){var o,s,l,u,c,f;return i===void 0&&(i=null),a===void 0&&(a=!0),Qi(this,function(m){switch(m.label){case 0:if(!e)throw new Error("No xrInputSource supplied");if(!r)throw new Error("No basePath supplied");return[4,Qv(r)];case 1:if(o=m.sent(),e.profiles.some(function(A){var h=o[A];return h&&(s={profileId:A,profilePath:"".concat(r,"/").concat(h.path),deprecated:!!h.deprecated}),!!s}),!s){if(!i)throw new Error("No matching profile name found");if(l=o[i],!l)throw new Error('No matching profile name found and default profile "'.concat(i,'" missing.'));s={profileId:i,profilePath:"".concat(r,"/").concat(l.path),deprecated:!!l.deprecated}}return[4,nl(s.profilePath)];case 2:if(u=m.sent(),a){if(f=void 0,f=u.layouts[e.handedness],!f)throw new Error("No matching handedness, ".concat(e.handedness,", in profile ").concat(s.profileId));f.assetPath&&(c=s.profilePath.replace("profile.json",f.assetPath))}return[2,{profile:u,assetPath:c}]}})})}var Hv={xAxis:0,yAxis:0,button:0,state:Je.ComponentState.DEFAULT};function qv(n,t){n===void 0&&(n=0),t===void 0&&(t=0);var e=n,r=t,i=Math.sqrt(n*n+t*t);if(i>1){var a=Math.atan2(t,n);e=Math.cos(a),r=Math.sin(a)}var o={normalizedXAxis:e*.5+.5,normalizedYAxis:r*.5+.5};return o}var Gv=function(){function n(t){this.componentProperty=t.componentProperty,this.states=t.states,this.valueNodeName=t.valueNodeName,this.valueNodeProperty=t.valueNodeProperty,this.valueNodeProperty===Je.VisualResponseProperty.TRANSFORM&&(this.minNodeName=t.minNodeName,this.maxNodeName=t.maxNodeName),this.value=0,this.updateFromComponent(Hv)}return n.prototype.updateFromComponent=function(t){var e=t.xAxis,r=t.yAxis,i=t.button,a=t.state,o=qv(e,r),s=o.normalizedXAxis,l=o.normalizedYAxis;switch(this.componentProperty){case Je.ComponentProperty.X_AXIS:this.value=this.states.includes(a)?s:.5;break;case Je.ComponentProperty.Y_AXIS:this.value=this.states.includes(a)?l:.5;break;case Je.ComponentProperty.BUTTON:this.value=this.states.includes(a)?i:0;break;case Je.ComponentProperty.STATE:this.valueNodeProperty===Je.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(a):this.value=this.states.includes(a)?1:0;break;default:throw new Error("Unexpected visualResponse componentProperty ".concat(this.componentProperty))}},n}(),Kv=function(){function n(t,e){var r=this;if(!t||!e||!e.visualResponses||!e.gamepadIndices||Object.keys(e.gamepadIndices).length===0)throw new Error("Invalid arguments supplied");this.id=t,this.type=e.type,this.rootNodeName=e.rootNodeName,this.touchPointNodeName=e.touchPointNodeName,this.visualResponses={},Object.keys(e.visualResponses).forEach(function(i){var a=new Gv(e.visualResponses[i]);r.visualResponses[i]=a}),this.gamepadIndices=Object.assign({},e.gamepadIndices),this.values={state:Je.ComponentState.DEFAULT,button:this.gamepadIndices.button!==void 0?0:void 0,xAxis:this.gamepadIndices.xAxis!==void 0?0:void 0,yAxis:this.gamepadIndices.yAxis!==void 0?0:void 0}}return Object.defineProperty(n.prototype,"data",{get:function(){var t=k({id:this.id},this.values);return t},enumerable:!1,configurable:!0}),n.prototype.updateFromGamepad=function(t){var e=this;if(this.values.state=Je.ComponentState.DEFAULT,this.gamepadIndices.button!==void 0&&t.buttons.length>this.gamepadIndices.button){var r=t.buttons[this.gamepadIndices.button];this.values.button=r.value,this.values.button=this.values.button<0?0:this.values.button,this.values.button=this.values.button>1?1:this.values.button,r.pressed||this.values.button===1?this.values.state=Je.ComponentState.PRESSED:(r.touched||this.values.button>Je.ButtonTouchThreshold)&&(this.values.state=Je.ComponentState.TOUCHED)}this.gamepadIndices.xAxis!==void 0&&t.axes.length>this.gamepadIndices.xAxis&&(this.values.xAxis=t.axes[this.gamepadIndices.xAxis],this.values.xAxis=this.values.xAxis<-1?-1:this.values.xAxis,this.values.xAxis=this.values.xAxis>1?1:this.values.xAxis,this.values.state===Je.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>Je.AxisTouchThreshold&&(this.values.state=Je.ComponentState.TOUCHED)),this.gamepadIndices.yAxis!==void 0&&t.axes.length>this.gamepadIndices.yAxis&&(this.values.yAxis=t.axes[this.gamepadIndices.yAxis],this.values.yAxis=this.values.yAxis<-1?-1:this.values.yAxis,this.values.yAxis=this.values.yAxis>1?1:this.values.yAxis,this.values.state===Je.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>Je.AxisTouchThreshold&&(this.values.state=Je.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(function(i){i.updateFromComponent(e.values)})},n}(),jv=function(){function n(t,e,r){var i=this;if(!t)throw new Error("No xrInputSource supplied");if(!e)throw new Error("No profile supplied");this.xrInputSource=t,this.assetUrl=r,this.id=e.profileId,this.layoutDescription=e.layouts[t.handedness],this.components={},Object.keys(this.layoutDescription.components).forEach(function(a){var o=i.layoutDescription.components[a];i.components[a]=new Kv(a,o)}),this.updateFromGamepad()}return Object.defineProperty(n.prototype,"gripSpace",{get:function(){return this.xrInputSource.gripSpace},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"targetRaySpace",{get:function(){return this.xrInputSource.targetRaySpace},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"data",{get:function(){var t=[];return Object.values(this.components).forEach(function(e){t.push(e.data)}),t},enumerable:!1,configurable:!0}),n.prototype.updateFromGamepad=function(){var t=this;Object.values(this.components).forEach(function(e){e.updateFromGamepad(t.xrInputSource.gamepad)})},n}(),_v="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",Jv="generic-trigger",Xv=function(n){se(t,n);function t(){var e=n.call(this)||this;return e.motionController=null,e.envMap=null,e}return t.prototype.setEnvironmentMap=function(e){var r=this;return this.envMap==e?this:(this.envMap=e,this.traverse(function(i){i instanceof d.Mesh&&i.isMesh&&(i.material.envMap=r.envMap,i.material.needsUpdate=!0)}),this)},t.prototype.updateMatrixWorld=function(e){n.prototype.updateMatrixWorld.call(this,e),this.motionController&&(this.motionController.updateFromGamepad(),Object.values(this.motionController.components).forEach(function(r){Object.values(r.visualResponses).forEach(function(i){var a=i.valueNode,o=i.minNode,s=i.maxNode,l=i.value,u=i.valueNodeProperty;a&&(u===Je.VisualResponseProperty.VISIBILITY?a.visible=l:u===Je.VisualResponseProperty.TRANSFORM&&(a.quaternion.copy(o.quaternion).slerp(s.quaternion,l),a.position.lerpVectors(o.position,s.position,l)))})}))},t}(Un.Object3D);function Wv(n,t){Object.values(n.components).forEach(function(e){var r=e.type,i=e.touchPointNodeName,a=e.visualResponses;if(r===Je.ComponentType.TOUCHPAD)if(e.touchPointNode=t.getObjectByName(i),e.touchPointNode){var o=new Un.SphereGeometry(.001),s=new Un.MeshBasicMaterial({color:255}),l=new Un.Mesh(o,s);e.touchPointNode.add(l)}else console.warn("Could not find touch dot, ".concat(e.touchPointNodeName,", in touchpad component ").concat(e.id));Object.values(a).forEach(function(u){var c=u.valueNodeName,f=u.minNodeName,m=u.maxNodeName,A=u.valueNodeProperty;if(A===Je.VisualResponseProperty.TRANSFORM){if(u.minNode=t.getObjectByName(f),u.maxNode=t.getObjectByName(m),!u.minNode){console.warn("Could not find ".concat(f," in the model"));return}if(!u.maxNode){console.warn("Could not find ".concat(m," in the model"));return}}u.valueNode=t.getObjectByName(c),u.valueNode||console.warn("Could not find ".concat(c," in the model"))})})}function d0(n,t){Wv(n.motionController,t),n.envMap&&t.traverse(function(e){e instanceof d.Mesh&&e.isMesh&&(e.material.envMap=n.envMap,e.material.needsUpdate=!0)}),n.add(t)}var Zv=function(){function n(t){t===void 0&&(t=null),this.gltfLoader=t,this.path=_v,this._assetCache={}}return n.prototype.createControllerModel=function(t){var e=this,r=new Xv,i=null;return t.addEventListener("connected",function(a){var o=a.data;o.targetRayMode!=="tracked-pointer"||!o.gamepad||Uv(o,e.path,Jv).then(function(s){var l=s.profile,u=s.assetPath;r.motionController=new jv(o,l,u);var c=e._assetCache[r.motionController.assetUrl];if(c)i=c.scene.clone(),d0(r,i);else{if(!e.gltfLoader)throw new Error("GLTFLoader not set.");e.gltfLoader.load(r.motionController.assetUrl,function(f){e._assetCache[r.motionController.assetUrl]=f,i=f.scene.clone(),d0(r,i)})}}).catch(function(s){console.warn(s)})}),t.addEventListener("disconnected",function(){r.motionController=null,r.remove(i),i=null}),r},n}();function Yv(n,t){return n}var f0=300,$v=new d.Matrix4().makeRotationAxis(new d.Vector3(0,1,0),Math.PI),h0=new d.Vector3(-1,1,1),em=function(n){se(t,n);function t(e){var r=n.call(this,e)||this;r.xrManager=new Ov(r.renderer,r.renderer.getContext(),{onSessionStart:function(l){r.emit("xr.session.start",_("xr.session.start",{session:l,machineType:r.xrManager.machineType}))},onSessionEnd:function(){r.emit("xr.session.end",_("xr.session.end",{session:null,machineType:r.xrManager.machineType}))}}),r.xrControllerRay={left:new d.Raycaster,right:new d.Raycaster},r.xrControllerRay.left.params.Points={threshold:.1},r.xrControllerRay.right.params.Points={threshold:.1},r.gazeRay=null,r.pointerLines={left:new to,right:new to},r.pointerLines.left.visible=!1,r.pointerLines.right.visible=!0,r.pointerLines.left.setMaterial({color:new d.Vector3(1,1,1)}),r.pointerLines.left.points.material.depthTest=!1,r.pointerLines.right.setMaterial({color:new d.Vector3(1,1,1)}),r.pointerLines.right.points.material.depthTest=!1,r.controllerWrappers=[new d.Group,new d.Group];var i=r.xrManager.getController(0);r.controllerWrappers[0].add(i);var a=r.xrManager.getController(1);r.controllerWrappers[1].add(a);var o=new Zv;o.gltfLoader={load:function(l,u){Pi.ajax(l,{responseType:"arraybuffer"}).then(function(c){var f;return Ao(c.body,{resourcePath:l.slice(0,l.lastIndexOf("/")+1),search:(f=l.split("?")[1])!==null&&f!==void 0?f:"",fetcher:Pi})}).then(function(c){return u(c)})}},(r.xrManager.machineType==="Oculus"||r.xrManager.machineType==="Pico")&&r.scene.add(r.pointerLines.left,r.pointerLines.right,r.controllerWrappers[0],r.controllerWrappers[1]),r.panoResources={},r.panoResources[r.locationMotion.keyframes[0].key=r.locationMotion.keyframes[1].key=St()]={panoId:De(r.currentPano),leftPanoPicture:null,position:r.camera.pose.offset.clone(),effect:"fade",fixCameraTransform:new d.Matrix4},r.parallaxCameraMatrixs=[];var s=dt.shared.getContext();return s?(r.on("xr.session.end",function(){r.scene.remove(r.pointerLines.left,r.pointerLines.right)}),r.xrManager.setSession(s),r.on("xr.session.start",function(){var l=r.xrManager.getControllerGrip(0);l.add(o.createControllerModel(l)),r.controllerWrappers[0].add(l);var u=r.xrManager.getControllerGrip(1);u.add(o.createControllerModel(u)),r.controllerWrappers[1].add(u)}),r.xrHandleState={LeftAxesUp:{touchStartTime:0,touchStart:!1},LeftAxesDown:{touchStartTime:0,touchStart:!1},LeftAxesLeft:{touchStartTime:0,touchStart:!1},LeftAxesRight:{touchStartTime:0,touchStart:!1},LeftTrigger:{touchStartTime:0,touchStart:!1},LeftPinch:{touchStartTime:0,touchStart:!1},RightAxesUp:{touchStartTime:0,touchStart:!1},RightAxesDown:{touchStartTime:0,touchStart:!1},RightAxesLeft:{touchStartTime:0,touchStart:!1},RightAxesRight:{touchStartTime:0,touchStart:!1},RightTrigger:{touchStartTime:0,touchStart:!1},RightPinch:{touchStartTime:0,touchStart:!1},Y:{touchStartTime:0,touchStart:!1},X:{touchStartTime:0,touchStart:!1},A:{touchStartTime:0,touchStart:!1},B:{touchStartTime:0,touchStart:!1}},r.xrManager.machineType==="VP"&&r.initHandEvent(),r):(console.error("获取session失败,请退出重试"),r)}return t.parseArgs=function(e){if(e instanceof t)return e;var r=k(k({},e),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2});return n.parseArgs.call(this,r)},t.initAnimationEndState=function(e){var r=this.parseArgs(e),i=n.initAnimationEndState.call(this,r);return k(k({},i),{mode:"XRPanorama"})},t.prototype.moveToPano=function(e,r,i){var a=this,o,s,l,u,c=(o=r.effect)!==null&&o!==void 0?o:"fade";this.userAction=i,this.stopMomentumMovement();var f=this.works.getResolvedObserver(e);if(!f)throw new Error("Invalid PanoIndex");var m=Jn(f.images.up),A=this.imageOptions.size;typeof A=="undefined"&&f&&m&&(A=Number(m)),typeof A=="undefined"&&(A=2048);var h=this.imageOptions.transform,p=function(S,I){return Yv(sn(S,h,I))},g=k({key:"pano.".concat(f.panoId)},Dt(this.imageOptions,["format","size","quality"])),v=f.images,y=(l=(s=f.images.tiles)===null||s===void 0?void 0:s.filter(function(S){return S.size>A}))!==null&&l!==void 0?l:null,b="pano:"+Hi([v,g,h]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===b)return;var x=this.pendingTextureTask.panoId;(u=this.panoMeshes[x])===null||u===void 0||u.setProgress(0),this.emit("pano.texture.abort",_("pano.texture.abort",{error:null,progress:0,meta:null,pano:f.pano}))}var w=this.models.getMaterial()||{},E=w.pano0,C=w.pano1,M;if((E==null?void 0:E.map.name)===b?M=E:(C==null?void 0:C.map.name)===b&&(M=C),M){var R={panoId:f.panoId,effect:c,leftPanoPicture:{zoom:1,map:M.map,luminanceMap:M.luminanceMap,matrix:new d.Matrix4().compose(f.position,f.quaternion,h0)},position:f.position.clone(),fixCameraTransform:new d.Matrix4};this.doMoveToPano(f.pano,R,r);return}var L="move-to-pano-"+f.panoId;this.pending.add(L),this.pendingTextureTask={panoId:f.panoId,hash:b,onLoad:function(S){if(a.pending.delete(L),a.destroyed)S.body.dispose();else{S.body.name=b;var I={panoId:f.panoId,effect:c,leftPanoPicture:{zoom:1,map:S.body,luminanceMap:null,matrix:new d.Matrix4().compose(f.position,f.quaternion,h0)},position:f.position.clone(),fixCameraTransform:new d.Matrix4};a.doMoveToPano(f.pano,I,r)}},onError:function(S){a.pending.delete(L);var I=k(k(k({},f.pano),{mode:a.mode}),_e(a.camera.pose));a.emit("pano.error",_("pano.error",{error:S,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:I})),a.emit("pano.cancel",_("pano.cancel",{error:null,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:I})),r.moveCancelCallback&&r.moveCancelCallback()}},Promise.all([this.tileLevelForFov&&y&&y.length?this.textureLoader.loadTiledCubeTexture(v,y,{tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:p,options:g},format:d.RGBAFormat,minFilter:d.LinearFilter,magFilter:d.LinearFilter,generateMipmaps:!1,viaAjax:!0,fetcher:it(f.work)},void 0,void 0,function(S){var I,O;a.emit("pano.texture.progress",_("pano.texture.progress",{error:null,progress:S,meta:null,pano:f.pano})),((I=a.pendingTextureTask)===null||I===void 0?void 0:I.hash)===b&&((O=a.panoMeshes[f.panoId])===null||O===void 0||O.setProgress(S))},this.renderer):this.textureLoader.loadCubeTexture(v,{imageURL:{transform:p,options:g},format:d.RGBAFormat,fetcher:it(f.work)},void 0,void 0,function(S){var I,O;((I=a.pendingTextureTask)===null||I===void 0?void 0:I.hash)===b&&((O=a.panoMeshes[f.panoId])===null||O===void 0||O.setProgress(S)),a.emit("pano.texture.progress",_("pano.texture.progress",{error:null,progress:S,meta:null,pano:f.pano}))},this.renderer)]).then(function(S){var I,O,P=S[0];((I=a.pendingTextureTask)===null||I===void 0?void 0:I.hash)===b?(a.pendingTextureTask.onLoad(P),(O=a.panoMeshes[f.panoId])===null||O===void 0||O.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.success",_("pano.texture.success",{error:null,progress:1,meta:P.meta,pano:f.pano}))):P.body.dispose()}).catch(function(S){var I,O;((I=a.pendingTextureTask)===null||I===void 0?void 0:I.hash)===b&&(a.pendingTextureTask.onError(S),(O=a.panoMeshes[f.panoId])===null||O===void 0||O.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.error",_("pano.texture.error",{error:S,progress:0,meta:null,pano:f.pano})),a.emit("error",S))}),this.emit("pano.texture.load",_("pano.texture.load",{error:null,progress:0,meta:null,pano:f.pano}))},t.prototype.doMoveToPano=function(e,r,i){var a=this,o,s,l,u,c,f,m,A,h,p;i===void 0&&(i={});var g=Ee(),v=St();this.panoResources[v]=r;var y=1,b,x,w;if(this.locationMotion.ended){var E=this.locationMotion.getKeyFrameSegment(g);E[0];var C=E[1],M=this.locationMotion.value,R=this.panoResourceFromLocationMotionKeyframe(C).position,L=r.position;b=Math.max(R.distanceTo(L),y),x=[{key:C.key,progress:0,value:k(k({},M),{count:0})},{key:v,progress:1,value:{distance:0,count:1}}],w=0}else{var S=this.locationMotion.getKeyFrameSegment(g),I=S[0],C=S[1],M=this.locationMotion.value,O=this.panoResourceFromLocationMotionKeyframe(I).position,R=this.panoResourceFromLocationMotionKeyframe(C).position,L=r.position,P=C.value.count-M.count,F=Math.max(O.distanceTo(R),y)*P,V=Math.max(R.distanceTo(L),y);b=F+V,x=[{key:I.key,progress:0,value:k({},M)},{key:C.key,progress:F/b,value:C.value},{key:v,progress:1,value:{count:C.value.count+1,distance:0}}];var D=this.locationMotionKeyframesLength(this.locationMotion.keyframes),z=this.locationMotionKeyframesLength(x);w=this.locationMotion.getProgressVelocity(g)*D/z}var U=r.effect==="instant"?0:this.calculateMovingDuration(i.duration,r.effect==="fly"?b:0),H={longitude:i.longitude,latitude:i.latitude,fov:i.fov},K=k(k({},e),{mode:this.mode,longitude:(o=H.longitude)!==null&&o!==void 0?o:this.camera.pose.longitude,latitude:(s=H.latitude)!==null&&s!==void 0?s:this.camera.pose.latitude,fov:(l=H.fov)!==null&&l!==void 0?l:this.camera.pose.fov,offset:r.position.clone(),distance:0}),j=this.currentPano;if(this.emit("pano.moveTo",_("pano.moveTo",{options:i,prevPano:j,progress:0,state:K,userAction:this.userAction,error:null})),i.moveStartCallback&&i.moveStartCallback(K),this.videoTexture&&this.videoTexture.image instanceof HTMLVideoElement&&this.videoTexture.image.getAttribute("src")&&(this.videoTexture.image.pause(),this.videoTexture.image.removeAttribute("uuid"),this.videoTexture.image.removeAttribute("src"),this.videoTexture.image.oncanplay=Q,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),r.effect==="fly")this.cameraMotion.set(H,U).catch(Q);else{var J=Nt({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude}),X=Nt({longitude:(u=H.longitude)!==null&&u!==void 0?u:this.cameraMotion.value.longitude,latitude:(c=H.latitude)!==null&&c!==void 0?c:this.cameraMotion.value.latitude}),W=new d.Object3D;W.lookAt(J);var Z=new d.Matrix4().makeRotationFromQuaternion(W.quaternion);W.lookAt(X);var ee=new d.Matrix4().makeRotationFromQuaternion(W.quaternion),Y=new d.Matrix4().getInverse(Z).premultiply(ee),ie=this.cameraMotion.value.fov,te=(f=H.fov)!==null&&f!==void 0?f:this.cameraMotion.value.fov,le=1;r.effect==="zoomin"?le=1.5:r.effect==="zoomout"&&(le=.4);for(var oe=te*le,xe=0;xe<x.length-1;xe++){var he=x[xe].key;if(he){var Ae=this.panoResources[he];Ae&&(Ae.fixCameraTransform.copy(Y),Ae.leftPanoPicture&&(Ae.leftPanoPicture.zoom=Math.tan(ie/2/180*Math.PI)/Math.tan(oe/2/180*Math.PI)))}}this.cameraMotion.setKeyframes([{progress:0,value:{longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude,fov:this.cameraMotion.value.fov}},{progress:0,value:{longitude:(m=H.longitude)!==null&&m!==void 0?m:this.cameraMotion.value.longitude,latitude:(A=H.latitude)!==null&&A!==void 0?A:this.cameraMotion.value.latitude,fov:oe}},{progress:1,value:{longitude:(h=H.longitude)!==null&&h!==void 0?h:this.cameraMotion.value.longitude,latitude:(p=H.latitude)!==null&&p!==void 0?p:this.cameraMotion.value.latitude,fov:te}}],U).catch(Q)}var Re=this.locationMotion.setKeyframes(x,U,w);Re.then(function(){for(var Se,Te,re,ae=0,q=a.models;ae<q.length;ae++){var Ve=q[ae];Ve.show()}var Fe=k(k({},e),{mode:a.mode,longitude:a.camera.pose.longitude,latitude:a.camera.pose.latitude,fov:a.camera.pose.fov,offset:a.camera.pose.offset.clone(),distance:0});a.emit("pano.arrived",_("pano.arrived",{options:i,prevPano:j,progress:1,state:Fe,userAction:a.userAction,error:null})),i.moveEndCallback&&i.moveEndCallback(Fe);var Ie=a.works.getResolvedObserver(a.currentPano);if(Ie&&Ie.video&&a.videoTexture&&a.videoTexture.image instanceof HTMLVideoElement){var Ge=$v.clone().multiply((re=(Te=(Se=a.models.getMaterial())===null||Se===void 0?void 0:Se.pano1)===null||Te===void 0?void 0:Te.matrix)!==null&&re!==void 0?re:new d.Matrix4).multiply(Ie.video.matrix),ye={map:a.videoTexture,size:Ie.video.size,matrix:Ge,alpha:1},pe=St(),be=a.videoTexture.image;be.setAttribute("uuid",pe),Ku().then(function(ge){ge&&Ie.video&&be.getAttribute("uuid")===pe&&(be.oncanplay=function(){be.oncanplay=Q,be.play()},be.ontimeupdate=function(){be.currentTime>.5&&(be.ontimeupdate=Q,a.panoVideo.setMaterial(ye))},be.src=Ie.video.source)}).catch(function(){be.removeAttribute("uuid")})}},function(){a.emit("pano.cancel",_("pano.cancel",{options:i,prevPano:j,progress:0,state:K,userAction:a.userAction,error:null})),i.moveCancelCallback&&i.moveCancelCallback()})},t.prototype.checkSelectedPano=function(e){var r=this,i,a,o,s;this.stopMomentumMovement();var l=this.camera.getDirection(new d.Vector3).setY(0),u=null,c=this.works.getResolvedObserver(this.currentPano);if(!c)return null;var f=c.accessibleIds.filter(function(X){var W=At(X);if(Yt(W,r.currentPano))return!1;var Z=r.works.getResolvedObserver(W);return!Z||Z.position.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:Z.loadable||Z.active}),m=this.models.intersectRaycaster(e)[0];if(m){var A=dr(f,function(X){var W=r.works.getResolvedObserver(X);if(!W)return 1/0;var Z=W.standingPosition.clone();return Z.distanceTo(m.point)},!0),h=A[0],p=A[1];h&&p<this.panoTapTriggerRadius&&(u=(i=this.works.getResolvedObserver(h))!==null&&i!==void 0?i:null)}if(s0(u)){var g=this.getForwardObserverOrNot(e);g&&(u=g)}for(var v=0,y=this.locationMotion.keyframes;v<y.length;v++){var b=y[v],x=this.panoResourceFromLocationMotionKeyframe(b);if(!(b.progress<this.locationMotion.progress)&&u&&x.panoId===u.panoId){u=null;break}}if(s0(u))return this.locationMotion.ended===!0&&this.cameraBounce(),null;if(u&&!u.active){var w=u.panoId;this.panoMeshes[w]&&(this.panoMeshes[w].setDisabled(!1),this.panoMeshes[w].setLoading(!0))}var E={};if(u){for(var C=Math.PI/6,M=Math.PI/12,R=new d.Vector3(0,1,0),L=u.position.clone().setY(0).sub(c.position.clone().setY(0)).normalize(),S=L.clone().applyAxisAngle(R,C),I=L.clone().applyAxisAngle(R,-C),O=[],P=[],F=[],V=0,D=u.accessibleIds;V<D.length;V++){var h=D[V],z=At(h);if(!(Yt(z,this.currentPano)||Yt(z,u.pano))){var U=this.works.getResolvedObserver(h);if(U){var H=U.position.clone().sub(u.position).setY(0);L.angleTo(H)<C?F.push(H):S.angleTo(H)<C?O.push(H):I.angleTo(H)<C&&P.push(H)}}}var K=F.length>0?F:Et(Et([],O,!0),P,!0),j=K.slice().sort(function(X,W){return X.angleTo(L)-W.angleTo(L)})[0];j&&j.angleTo(l)>M&&(E.longitude=Math.atan2(-j.x,-j.z))}this.cameraMotion.value.latitude<-Math.PI/4&&(E.latitude=fe(0,this.minLatitude,this.maxLatitude)),this.cameraMotion.value.fov<60&&(E.fov=this.defaultFov);var J={workCode:u.pano.workCode,panoIndex:u.pano.panoIndex,mode:this.mode,longitude:(a=E.longitude)!==null&&a!==void 0?a:this.camera.pose.longitude,latitude:(o=E.latitude)!==null&&o!==void 0?o:this.camera.pose.latitude,fov:(s=E.fov)!==null&&s!==void 0?s:this.camera.pose.fov,distance:0,offset:u?u.position.clone():new d.Vector3};return this.emit("pano.select",_("pano.select",{prevPano:this.currentPano,state:J,userAction:!0,options:E,progress:0,error:null})),u&&u.active?(this.emit("pano.request",_("pano.request",{userAction:!0,prevPano:this.currentPano,progress:0,state:J,options:E,error:null})),u.pano):null},t.prototype.destroy=function(){n.prototype.destroy.call(this)},t.prototype.isReady=function(){return!1},t.prototype.updateCamera=function(e,r,i){return Promise.resolve()},t.prototype.updateCameraWithKeyframes=function(e,r,i){return Promise.resolve()},t.prototype.updateTime=function(e,r){for(var i=this,a,o,s,l,u,c,f,m,A=[],h=2;h<arguments.length;h++)A[h-2]=arguments[h];this.userAction=!0;var p={},g={},v=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),y=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),b=!1;if(this.cameraMotion.ended===!1&&(this.cameraMotion.update(e),g.longitude=this.cameraMotion.value.longitude,g.latitude=this.cameraMotion.value.latitude,g.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),p.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(fe(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var x=this.locationMotion.getKeyFrameSegment(e),w=x[0],E=x[1],C=this.panoResourceFromLocationMotionKeyframe(w),M=this.panoResourceFromLocationMotionKeyframe(E),R=new d.Vector3().copy(C.position),L=new d.Vector3().copy(M.position),S=this.locationMotion.value.count-E.value.count+1;p.progress=S,M.leftPanoPicture&&(S<1?C.leftPanoPicture&&(p.pano0=C.leftPanoPicture):p.pano0=M.leftPanoPicture,p.pano1=M.leftPanoPicture),M.effect==="montage"?p.transition="BLACK":M.effect==="spread"?p.transition="SPREAD":p.transition="FADE",(M.effect==="zoomin"||M.effect==="zoomout")&&(p.progress=Math.pow(S,3)),S<1&&M.effect!=="fly"&&(p.pano0&&C.leftPanoPicture&&(p.pano0={map:p.pano0.map,zoom:p.pano0.zoom,luminanceMap:p.pano0.luminanceMap,matrix:C.leftPanoPicture.matrix.clone().setPosition(M.position)}),R.copy(L),b=!0),g.distance=this.locationMotion.value.distance,g.offset=new d.Vector3(R.x+(L.x-R.x)*S,R.y+(L.y-R.y)*S,R.z+(L.z-R.z)*S);for(var I=[],O=[],P=0,F=this.locationMotion.keyframes;P<F.length;P++){var V=F[P],D=V.key,z=V.progress;D!==void 0&&(I.push(D),z>this.locationMotion.progress&&O.push(D))}for(var U=0,H=Object.keys(this.panoResources);U<H.length;U++){var K=H[U];if(!(O.indexOf(K)>=0)){var j=this.panoResources[K];if(j.leftPanoPicture){var J=j.leftPanoPicture.map;if(J){if(J===((a=p.pano0)===null||a===void 0?void 0:a.map)||J===((o=p.pano1)===null||o===void 0?void 0:o.map))continue;J instanceof Ne&&J.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(J.cubeRenderTarget),J.dispose(),j.leftPanoPicture=null}}I.indexOf(K)>=0||delete this.panoResources[K]}}this.currentPano=At(M.panoId),this.emit("pano.moving",_("pano.moving",{userAction:this.userAction,prevPano:At(v.panoId),state:k(k(k(k({},At(y.panoId)),{mode:this.mode}),_e(this.camera.pose)),g),options:{},progress:this.locationMotion.progress,error:null}))}Ut(p)===!1&&(!((s=p.pano0)===null||s===void 0)&&s.map&&p.pano0.map instanceof Ne&&!p.pano0.map.cubeRenderTarget&&(p.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((l=p.pano1)===null||l===void 0)&&l.map&&p.pano1.map instanceof Ne&&!p.pano1.map.cubeRenderTarget&&(p.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),this.models.setMaterial(p)),Ut(g)===!1&&this.setCamera(g);var X=this.works.getResolvedObserver(this.currentPano),W=A[1];if(!W){console.error("xrFrame丢失,请重试");return}if(!this.xrManager.session){console.error("session丢失,请重试");return}var Z=this.xrManager.referenceSpace;if(Z){var ee=this.xrManager.cameraVR,Y=this.xrManager.cameraL,ie=this.xrManager.cameraR,te=[Y,ie],le=W.getViewerPose(Z),oe=new d.Vector3(0,0,0);if(le){var xe;xe=this.xrManager.session.renderState.baseLayer;var he=le.views;if(!xe){console.error("no layer found");return}this.renderer.setFramebuffer(xe.framebuffer);var Ae=!1;he.length!==ee.cameras.length&&(ee.cameras.length=0,Ae=!0),this.parallaxCameraMatrixs=[];var Re=new d.Vector3,Se=new d.Vector3;new d.Matrix4().fromArray(he[0].transform.matrix).decompose(Re,new d.Quaternion,new d.Vector3),new d.Matrix4().fromArray(he[1].transform.matrix).decompose(Se,new d.Quaternion,new d.Vector3),Se.clone().sub(Re).normalize();var Te=new d.Vector3,re=new d.Quaternion,ae=new d.Vector3;this.camera.matrix.decompose(Te,re,ae);for(var q=0;q<he.length;q++){var Ve=he[q],Fe=xe.getViewport(Ve),Ie=te[q];Ie.matrix.fromArray(Ve.transform.matrix);var Ge=new d.Vector3,ye=new d.Quaternion,pe=new d.Vector3;Ie.matrix.decompose(Ge,ye,pe),oe.copy(Te),Ie.position.copy(Te),Ie.quaternion.copy(ye),Ie.scale.copy(pe),Ie.updateMatrix(),Ie.projectionMatrix.fromArray(Ve.projectionMatrix),Ie.viewport.set(Fe.x,Fe.y,Fe.width,Fe.height),Ae===!0&&ee.cameras.push(Ie)}if(this.xrManager.session&&this.xrManager.session.inputSources){for(var q=0;q<this.xrManager.session.inputSources.length;q++)if(this.xrManager.session.inputSources[q]&&this.xrManager.session.inputSources[q].targetRayMode==="transient-pointer"){var be=W.getPose(this.xrManager.session.inputSources[q].targetRaySpace,Z);if(be){var ge=new d.Vector3(0,0,-1).applyQuaternion(be.transform.orientation),ve=new d.Raycaster(this.camera.position,ge);this.gazeRay=ve}}}if(this.xrManager.machineType==="Oculus"||this.xrManager.machineType==="Pico"){for(var Qe=this.xrManager.session.inputSources,q=0;q<Qe.length;q++){var Ke=this.xrManager.controllers[q],rt=Qe[q];if(rt){Ke&&Ke.update(rt,W,Z);var ve=this.xrManager.getController(q),Xr=new d.Vector3(0,1.2,0),ke=ve.position.clone().add(oe).sub(Xr);rt.handedness==="left"?this.xrControllerRay.left.set(ke,new d.Vector3(0,0,-1).applyEuler(ve.rotation)):rt.handedness==="right"&&this.xrControllerRay.right.set(ke,new d.Vector3(0,0,-1).applyEuler(ve.rotation)),this.controllerWrappers[q].position.copy(new d.Vector3(0,0,0).add(oe).sub(Xr));var Ze=this.models.intersectRaycaster(this.xrControllerRay.right);if(Ze.length===0&&(Ze=this.xrControllerRay.right.intersectObject(this.boundingMesh,!0).map(function(Tr){var Yr;return k({floor:(Yr=X==null?void 0:X.floorIndex)!==null&&Yr!==void 0?Yr:0},Tr)})),Ze.length>=1&&Ze[0].face)if(rt.handedness==="right"){var st=this.xrControllerRay.right.intersectObject(this.xrCustomObjectsScene,!0),tr=Ze[0].face.normal,fn=tr.clone(),rr=Ze[0].point.clone();this.intersectMesh.position.copy(rr);var Pt=rr.clone().add(fn);if(this.intersectMesh.lookAt(Pt),Math.abs(tr.y)>.99){var nr=this.camera.position.clone().sub(rr);this.intersectMesh.rotation.z=-Math.atan2(nr.z,nr.x)}this.intersectMesh.visible=!0,this.needsRender=!0,st.length>0?(this.pointerLines.right.setPoints(ke,st[0].point),this.pointerLines.right.points.visible=!0,this.intersectMesh.visible=!1):(this.pointerLines.right.points.visible=!1,this.pointerLines.right.setPoints(ke,Ze[0].point));var Mr=Ze[0],Ht=_("intersect.update",{raycaster:(u=this.xrControllerRay.right)!==null&&u!==void 0?u:null,intersection:Mr!=null?Mr:null,object:this.intersectMesh});if(this.emit("intersect.update",Ht),Ht.defaultPrevented){this.hideIntersectMesh();return}}else this.pointerLines.left.setPoints(ke,Ze[0].point)}}this.updateControllerHelper(Qe,e,r)}if(this.camera.pose.distance>.1||b)for(var ir=0,qt=Object.keys(this.panoMeshes);ir<qt.length;ir++){var ft=qt[ir],Le=this.panoMeshes[ft];Le.setOpacity(0),Le.setCurrent(!1),Le.updateTime&&Le.updateTime(e,r),Le.visible=!1}else if(X){var hr=dr(X.visibleIds,function(ht){var jt=i.works.getResolvedObserver(ht);return jt?X.standingPosition.distanceTo(jt.standingPosition):1/0},!0),gt=hr[1];gt=fe(gt,2.5,1/0);for(var pr=X.visibleIds.concat(De(this.currentPano)),vr=this.getForwardObserverOrNot(),Gt=this.camera.getDirection(new d.Vector3),Ct=0,mr=Object.keys(this.panoMeshes);Ct<mr.length;Ct++){var ft=mr[Ct],Le=this.panoMeshes[ft],Ir=this.works.getResolvedObserver(ft);if(pr.indexOf(ft)===-1)Le.setCurrent(!1),Le.setOpacity(0);else if(!Ir)Le.setCurrent(!1),Le.setOpacity(0);else if(!Ir.loadable&&!Ir.active)Le.setCurrent(!1),Le.setOpacity(0);else{var hn=Le.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);Le.setCurrent(!Le.loading&&Le.progress===0&&vr!==null&&vr.panoId===ft),Le.setOpacity(hn<.01?0:fe(gt/hn*1.2,.65,.98));var Wr=this.camera.position.clone().setY(Le.position.y),ge=new d.Vector3().copy(Le.position).sub(Wr).normalize();if(ft===De(this.currentPano)){var Zr=fe((.5-Wr.distanceTo(Le.position))/.5,0,1);ge.multiplyScalar(1-Zr).add(Gt.clone().multiplyScalar(Zr))}ge.length()>0&&Le.quaternion.setFromEuler(new d.Euler(0,Math.atan2(ge.x,ge.z),0))}Le.updateTime&&Le.updateTime(e,r)}}var Kt=function(){return 4}(),Ye=function(){var ht=new d.PerspectiveCamera;ht.applyMatrix4(ee.matrix),ht.position.set(0,0,0);var jt=i.works.getResolvedObserver(y.panoId),Tr=jt!=null?jt:X;Tr&&ht.quaternion.premultiply(Tr.quaternion.clone().inverse()),ht.updateProjectionMatrix(),ht.updateMatrixWorld(!0);var Yr=new d.Frustum().setFromProjectionMatrix(new d.Matrix4().multiplyMatrices(ht.projectionMatrix,ht.matrixWorldInverse));return Yr}();y.panoId===De(this.currentPano)&&((c=y.leftPanoPicture)===null||c===void 0?void 0:c.map)instanceof Ne&&(y.leftPanoPicture.map.maxRequest=this.tileMaxRequest,y.leftPanoPicture.map.update(Ye,Kt),y.leftPanoPicture.map.needsRender===!0&&(this.needsRender=!0,this.modelSceneNeedsRender=!0));{var He=this.tiling.object.visible;if(this.initAnimationed){var nt=y.panoId,yt=this.works.getResolvedObserver(nt);yt?ai(this.camera.position,yt.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==nt&&this.tiling.cleanup(),this.tiling.panoId=nt,this.tiling.setResource((m=(f=yt.images)===null||f===void 0?void 0:f.tiles)!==null&&m!==void 0?m:[],this.enableIOSEDR&&yt.images.luminance?yt.images.luminance:null),this.tiling.setFetcher(it(yt.work)),this.tiling.setRotation(yt.quaternion),this.tiling.setPosition(yt.position),this.tiling.maxRequest=this.tileMaxRequest,Kt>this.TILED_CUBE_TEXTURE_LEVEL?this.tiling.update(Ye,Kt,e):this.tiling.update(Ye,0,e)):this.tiling.object.visible=!1:this.tiling.object.visible=!1}else this.tiling.object.visible=!1;He!==this.tiling.object.visible&&(this.tiling.object.needsRender=!0,this.modelSceneNeedsRender=!0)}this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e)}}},t.prototype.render=function(){var e=this.xrManager.getCamera(this.camera);this.renderer.render(this.modelScene,e),this.renderer.autoClearColor=!1,this.renderer.autoClearDepth=!1,this.renderer.render(this.scene,e),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0},t.prototype.onPanGesture=function(){},t.prototype.onTapGesture=function(){},t.prototype.onPinchGesture=function(){},t.prototype.onMouseMove=function(){},t.prototype.onMouseOut=function(){},t.prototype.panoResourceFromLocationMotionKeyframe=function(e){return this.panoResources[e.key]},t.prototype.updateControllerHelper=function(e,r,i){var a=this.xrControllerRay.left,o=this.xrControllerRay.right;if(!(!e||e.length===0)){for(var s={buttons:{X:!1,Y:!1,LeftTrigger:!1,LeftPinch:!1,A:!1,B:!1,RightTrigger:!1,RightPinch:!1}},l=0;l<e.length;l++){var u=e[l].handedness,c=e[l].gamepad;switch(u){case"left":c.axes&&(this.emitHandleEvent(c.axes[2]===-1,"LeftAxesLeft",r),this.emitHandleEvent(c.axes[2]===1,"LeftAxesRight",r),this.emitHandleEvent(c.axes[3]===-1,"LeftAxesUp",r),this.emitHandleEvent(c.axes[3]===1,"LeftAxesDown",r)),c!=null&&c.buttons&&(c.buttons[4]&&this.emitHandleEvent(c.buttons[4].pressed,"X",r),c.buttons[5]&&this.emitHandleEvent(c.buttons[5].pressed,"Y",r),c.buttons[0]&&this.emitHandleEvent(c.buttons[0].pressed,"LeftTrigger",r),c.buttons[1]&&this.emitHandleEvent(c.buttons[1].pressed,"LeftPinch",r));var f={raycaster:a,axes:{up:c.axes&&c.axes[3]<0?Math.abs(c.axes[3]):0,down:c.axes&&c.axes[3]<0?0:Math.abs(c.axes[3]),left:c.axes&&c.axes[2]<0?Math.abs(c.axes[2]):0,right:c.axes&&c.axes[2]<0?0:Math.abs(c.axes[2])},deltaTime:i};s.buttons.X=c.buttons&&c.buttons[4]?c.buttons[4].pressed:!1,s.buttons.Y=c.buttons&&c.buttons[5]?c==null?void 0:c.buttons[5].pressed:!1,s.buttons.LeftTrigger=c.buttons&&c.buttons[0]?c==null?void 0:c.buttons[0].pressed:!1,s.buttons.LeftPinch=c.buttons&&c.buttons[1]?c==null?void 0:c.buttons[1].pressed:!1,s.left=f;break;case"right":c.axes&&(this.emitHandleEvent(c.axes[2]===-1,"RightAxesLeft",r),this.emitHandleEvent(c.axes[2]===1,"RightAxesRight",r),this.emitHandleEvent(c.axes[3]===-1,"RightAxesUp",r),this.emitHandleEvent(c.axes[3]===1,"RightAxesDown",r)),c.buttons&&(c.buttons[4]&&this.emitHandleEvent(c.buttons[4].pressed,"A",r),c.buttons[5]&&this.emitHandleEvent(c.buttons[5].pressed,"B",r),c.buttons[0]&&this.emitHandleEvent(c.buttons[0].pressed,"RightTrigger",r),c.buttons[1]&&this.emitHandleEvent(c.buttons[1].pressed,"RightPinch",r));var m={raycaster:o,axes:{up:c.axes&&c.axes[3]<0?Math.abs(c.axes[3]):0,down:c.axes&&c.axes[3]<0?0:Math.abs(c.axes[3]),left:c.axes&&c.axes[2]<0?Math.abs(c.axes[2]):0,right:c.axes&&c.axes[2]<0?0:Math.abs(c.axes[2])},deltaTime:i};s.right=m,s.buttons.A=c.buttons&&c.buttons[4]?c==null?void 0:c.buttons[4].pressed:!1,s.buttons.B=c.buttons&&c.buttons[5]?c==null?void 0:c.buttons[5].pressed:!1,s.buttons.RightTrigger=c.buttons&&c.buttons[0]?c==null?void 0:c.buttons[0].pressed:!1,s.buttons.RightPinch=c.buttons&&c.buttons[1]?c==null?void 0:c.buttons[1].pressed:!1;break}}this.emit("xr.controller.update",_("xr.controller.update",s))}},t.prototype.emitHandleEvent=function(e,r,i){var a=this.xrControllerRay.left,o=this.xrControllerRay.right;if(e)if(this.xrHandleState[r].touchStart===!1)this.xrHandleState[r].touchStartTime=i,this.xrHandleState[r].touchStart=!0,this.emit("xr.gesture.buttonDown",_("xr.gesture.buttonDown",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!1,isFirst:!0,controllers:{raycaster:{leftRay:a,rightRay:o}}}));else{var s=i-this.xrHandleState[r].touchStartTime;s>f0&&this.emit("xr.gesture.press",_("xr.gesture.tap",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!0,controllers:{raycaster:{leftRay:a,rightRay:o}}}))}else if(this.xrHandleState[r].touchStart===!0){this.emit("xr.gesture.buttonUp",_("xr.gesture.buttonUp",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:a,rightRay:o}}}));var s=i-this.xrHandleState[r].touchStartTime;if(s<=f0){var l=_("xr.gesture.tap",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:a,rightRay:o}}}),u=this.emit("xr.gesture.tap",l);!u&&!l.defaultPrevented&&r==="RightTrigger"&&this.checkSelectedPano(this.xrControllerRay.right)}this.xrHandleState[r].touchStart=!1,this.xrHandleState[r].touchStartTime=0}},t.prototype.initHandEvent=function(){var e=this;if(!this.xrManager.session)throw new Error("初始化失败");this.xrManager.session.addEventListener("select",function(r){e.gazeRay&&e.checkSelectedPano(e.gazeRay)})},t}(Ro),Ft={Floorplan:eo,Topview:Mp,Panorama:Ro,VRPanorama:yv,Model:xv,Mapview:Fv,XRPanorama:em},il=["gesture.pan","gesture.tap","gesture.dbltap","gesture.press","gesture.pinch","gesture.mousewheel","gesture.mousemove","gesture.momentum","initAnimation.start","initAnimation.end","camera.update","intersect.update","pano.select","pano.moveTo","pano.moving","pano.arrived","pano.cancel","pano.error","pano.texture.load","pano.texture.progress","pano.texture.success","pano.texture.error","pano.texture.abort","xr.session.start","xr.session.end","xr.gesture.tap","xr.gesture.press","xr.gesture.buttonUp","xr.gesture.buttonDown","xr.controller.update"];function tm(n){n.on("initAnimation.start",function(t){n.emit("initAnimationWillStart",t.state.panoIndex,t.state,t.userAction)}),n.on("initAnimation.end",function(t){n.emit("initAnimationEnded",t.state.panoIndex,t.state,t.userAction)}),n.on("gesture.pan",function(t){var e=!1;e=n.emit("wantsGesture","pan",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsPanGesture",t.state,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","pan",t.pointers,t.isFinal),n.emit("panGesture",t.state,t.isFinal))}),n.on("gesture.tap",function(t){var e=!1;e=n.emit("wantsGesture","tap",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsTapGesture",t.center.raycaster,t.center.coords,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","tap",t.pointers,t.isFinal),n.emit("tapGesture",t.center.raycaster,t.center.coords,t.isFinal))}),n.on("gesture.dbltap",function(t){var e=!1;e=n.emit("wantsGesture","dbltap",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsDblTapGesture",t.center.raycaster,t.center.coords,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","dbltap",t.pointers,t.isFinal),n.emit("dblTapGesture",t.center.raycaster,t.center.coords,t.isFinal))}),n.on("gesture.press",function(t){var e=!1;e=n.emit("wantsGesture","press",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsPressGesture",t.center.raycaster,t.center.coords,t.center.delta,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","press",t.pointers,t.isFinal),n.emit("pressGesture",t.center.raycaster,t.center.coords,t.center.delta,t.isFinal))}),n.on("gesture.pinch",function(t){var e=!1;e=n.emit("wantsGesture","pinch",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsPinchGesture",t.scale,t.state.fov,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","pinch",t.pointers,t.isFinal),n.emit("pinchGesture",t.scale,t.state.fov,t.isFinal))}),n.on("gesture.mousewheel",function(t){var e=!1;e=n.emit("wantsGesture","mouseWheel",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsMouseWheel",t.center.delta,t.state.fov,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","mouseWheel",t.pointers,t.isFinal),n.emit("mouseWheel",t.center.delta,t.state.fov,t.isFinal))}),n.on("gesture.mousemove",function(t){var e=!1;e=n.emit("wantsGesture","mouseMove",t.pointers,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","mouseMove",t.pointers,t.isFinal),e=n.emit("wantsChangeCameraFov",t.state.fov),e&&t.preventDefault())}),n.on("gesture.momentum",function(t){var e=!1;e=n.emit("wantsInteriaPan",t.state),e&&t.preventDefault(),t.defaultPrevented||n.emit("interiaPan",t.state,t.isFinal)}),n.on("camera.update",function(t){n.emit("cameraFovUpdate",t.state.fov,t.userAction),n.emit("cameraDirectionUpdate",t.state,t.userAction);var e=Nt(t.state);e.setLength(t.state.distance);var r=t.state.offset.clone().sub(e);n.emit("cameraPositionUpdate",r,t.userAction),n.emit("cameraUpdate",t.state,t.userAction)}),n.on("intersect.update",function(t){if(t.intersection){var e=!1;e=n.emit("wantsShowIntersectionOnModel",t.raycaster),e&&t.preventDefault(),t.defaultPrevented||n.emit("intersectionOnModelUpdate",t.intersection,t.object)}else n.emit("intersectionHidden")}),n.on("pano.request",function(t){var e=n.emit("wantsMoveToPano",t.state.panoIndex,t.options,t.userAction);e||(e=n.emit("wantsToMoveToPano",t.state.panoIndex,t.options,t.userAction)),e&&t.preventDefault(),t.defaultPrevented||n.emit("panoWillLoad",t.state.panoIndex)}),n.on("pano.select",function(t){n.emit("panoSelected",t.state.panoIndex)}),n.on("pano.moveTo",function(t){n.emit("panoLoaded",t.state.panoIndex),n.emit("moveToPano",t.state.panoIndex,t.userAction),n.emit("panoWillArrive",t.state.panoIndex,t.state,t.userAction)}),n.on("pano.moving",function(t){n.emit("movingToPano",t.state.panoIndex,t.prevPano.panoIndex,t.progress)}),n.on("pano.arrived",function(t){n.emit("panoArrived",t.state.panoIndex,t.state,t.userAction)}),n.on("pano.cancel",function(t){n.emit("moveToPanoCanceled",t.state.panoIndex)}),n.on("pano.error",function(t){n.emit("panoLoadError",t.error,t.state.panoIndex)}),n.on("pano.texture.load",function(t){n.emit("textureStartLoad",t.pano.panoIndex)}),n.on("pano.texture.success",function(t){n.emit("textureLoaded",t.pano.panoIndex,t.meta)}),n.on("pano.texture.error",function(t){n.emit("textureError",t.error,t.pano.panoIndex)}),n.on("pano.texture.abort",function(t){n.emit("textureAbort",t.pano.panoIndex)}),n.on("pano.texture.progress",function(t){n.emit("textureLoading",t.progress,t.pano.panoIndex)}),n.on("xr.session.start",function(t){n.emit("webXRSessionStart")}),n.on("xr.session.end",function(t){n.emit("webXRSessionEnd")}),n.on("xr.gesture.tap",function(t){n.emit("webXRControllerEvent","tap",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.gesture.press",function(t){n.emit("webXRControllerEvent","press",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.gesture.buttonUp",function(t){n.emit("webXRControllerEvent","buttonUp",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.gesture.buttonDown",function(t){n.emit("webXRControllerEvent","buttonDown",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.controller.update",function(t){n.emit("webXRControllerRayUpdate",{leftRay:t.left?t.left.raycaster:void 0,rightRay:t.right?t.right.raycaster:void 0}),t.left&&n.emit("webXRAxesUpdate","left",{raycaster:{leftRay:t.left?t.left.raycaster:void 0,rightRay:t.right?t.right.raycaster:void 0},axesState:{up:t.left.axes.up,down:t.left.axes.down,left:t.left.axes.left,right:t.left.axes.right},deltaTime:t.left.deltaTime}),t.right&&n.emit("webXRAxesUpdate","right",{raycaster:{leftRay:t.left?t.left.raycaster:void 0,rightRay:t.right?t.right.raycaster:void 0},axesState:{up:t.right.axes.up,down:t.right.axes.down,left:t.right.axes.left,right:t.right.axes.right},deltaTime:t.right.deltaTime})}),n.on("works.request",function(t){n.emit("willLoad",t.input,t.works[0],t.state)}),n.on("works.load",function(t){n.emit("load",t.input,t.works[0],t.state)}),n.on("works.ready",function(t){n.emit("loaded",t.input,t.works[0])}),n.on("state.change",function(t){n.emit("stateChange",t.state,t.userAction)}),n.on("currentState.change",function(t){n.emit("currentStateChange",t.state,t.userAction)}),n.on("state.set",function(t){n.emit("setState",t.state)}),n.on("state.synced",function(t){n.emit("stateSynced",t.state)}),n.on("model.request",function(t){n.emit("modelWillLoad",t.work.model)}),n.on("model.error",function(t){n.emit("modelLoadError",t.error,t.model)}),n.on("model.load",function(t){n.emit("modelLoaded",t.model)}),n.on("model.changeShownFloor",function(t){n.emit("modelShownFloorChange",t.model.shownFloor,t.model.floorLength)}),n.on("render",function(t){n.emit("renderFrame",t.needsRender)}),n.on("mode.change.request",function(t){n.emit("wantsChangeMode",t.mode,t.prevMode)}),n.on("mode.change",function(t){n.emit("modeChange",t.mode,t.prevMode,t.state.panoIndex,t.state,t.userAction)}),n.on("helpers.visible",function(t){n.emit("helpersVisibleChange",t.object.visible)}),n.on("network.resource",function(t){n.emit("network",t.source,t.requestType,t.requestState,t.detail)})}function rm(){if(typeof window!="undefined"){var n=document.createElement("video");n.loop=!0,n.autoplay=!0,n.playsInline=!0,n.muted=!0,n.crossOrigin="";var t=function(){document.removeEventListener("touchstart",t,!1),document.removeEventListener("mousedown",t,!1),n.muted=!1};return document.addEventListener("touchstart",t,!1),document.addEventListener("mousedown",t,!1),n}else return{}}function p0(n){{var t=new d.DirectionalLight(16777215,.3);t.position.copy(new d.Vector3(1,1,1)),n.add(t)}{var t=new d.DirectionalLight(16777215,.1);t.position.copy(new d.Vector3(-1,-1,-1)),n.add(t)}{var t=new d.DirectionalLight(16777215,.1);n.add(t)}{var t=new d.AmbientLight(16777215,.6);n.add(t)}}function nm(n){for(var t,e,r={},i=n.split(/(\;|\,)/),a=0,o=i;a<o.length;a++){var s=o[a],l=s.split("="),u=(t=l[0])===null||t===void 0?void 0:t.trim(),c=(e=l[1])===null||e===void 0?void 0:e.trim();u&&c&&(r[u]=c)}return r}function al(){var n;if(typeof document!="undefined")for(var t=document.getElementsByTagName("meta"),e=0;e<t.length;e++){var r=t[e];if(r.getAttribute("name")==="viewport"){var i=nm((n=r.getAttribute("content"))!==null&&n!==void 0?n:""),a=Number(i["initial-scale"]);if(!isNaN(a))return a}}return 1}const im="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAV8AAAA/CAQAAADtPwPkAAAR+0lEQVR4AezYg3LEQACH8d1cbdu23Q5qG9G47z/TN/h6tn2b/H+TUTLc7yjcOXV46OUAnUs6EbUp022ZBXc1NhoZYYd7fjDRvdcHAwrlK2QBVJ4sgoqONmY45RUT23sZ6H42F2hK5CtkMbjhZlDmUUcvq1zyieUVyjbE4I1GBfItwxG56YaUZTQwyh4P6NgJ4YYYvCuQb5kOyI03pORjiqe4Lwpq5pt1vJqfUwKWJVbSMYfppYconG+maNNQOWBZuwHTzicGel75NtFOkxr5apmV8cikcko0DrDQs863AeGl0cE0+1xy573m0/wf0cEKW6H7BWtggiMG8sy3oHRDpJMw4NWb6am/bv9znkqEzjd61t5oo5clTrjhwevO75EJRBKSRt745Z16ZEjcM73sccZplBPm8PyTcxZAkSRdHm/acJ0Z3JZhHB0BxqDHgWFZ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93UTTj42tvaFS++GVsc5JRyLSLJ8nzO555hFBmiSRCqMr4GwrcmGkib5xSvcwmzFK6e8s7DMa2xH4YZdZumSOwsVzFeBWdr37tpIhOpSwXqONNgZq/2KgvBt54znHN1HzlljTO4oVD5fb+prNIJXQNL1ofDKQisbPLJDv3jNSLq9OkYBEIihKIj3v7S1TRQCX5Kdl1ZQlol7LF+E++fwirfiq2sf4cTXxc6hzxffPuLEeqSWrPGWMF58TWr5viyJAP5/4EV4KePiaSE8eNRgjDy8/tyRW+FZjhS+2tlovNJovtJovNJ0uhK6Wo64SDdxEbM//KesjwAAAABJRU5ErkJggg==";var v0=[351,63],m0=[20,20],am=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),om=new Float32Array([0,0,1,0,0,1,1,1]),sm=new Uint8Array([0,1,2,1,3,2]),ji=new d.BufferGeometry;ji.setAttribute("position",new d.BufferAttribute(am,3));ji.setAttribute("uv",new d.BufferAttribute(om,2));ji.setIndex(new d.BufferAttribute(sm,1));var Ii=new d.MeshBasicMaterial({transparent:!0,depthTest:!1,depthWrite:!1,stencilWrite:!1,fog:!1}),ol=new d.Mesh(ji,Ii);ol.matrixAutoUpdate=!1;var Vo=new d.Scene;Vo.add(ol);Vo.matrixAutoUpdate=!1;var oi=new d.OrthographicCamera(-.5,.5,.5,-.5,.1,1);oi.position.set(0,0,.5);oi.lookAt(0,0,0);oi.updateMatrixWorld(!0);oi.matrixAutoUpdate=!1;var um=new d.Vector4,lm=new d.Vector4;function cm(n){if(Ii.map){var r=n.getViewport(um),i=n.getScissor(lm),a=n.getScissorTest(),o=n.autoClear,s=i.x+m0[0]/3,l=i.y+m0[1]/3,u=v0[0]/3,c=v0[1]/3;n.setViewport(s,l,u,c),n.setScissor(s,l,u,c),n.setScissorTest(!0),n.autoClear=!1,n.render(Vo,oi),n.setViewport(r),n.setScissor(i),n.setScissorTest(a),n.autoClear=o}else{var t=new d.Texture,e=new Image;e.onload=function(){t.image=e,t.wrapS=d.ClampToEdgeWrapping,t.wrapT=d.ClampToEdgeWrapping,t.minFilter=d.LinearFilter,t.needsUpdate=!0,t.generateMipmaps=!1,Ii.needsUpdate=!0,e.onload=Q},e.src=im,Ii.map=t}}var dm=800,A0=90,fm=function(n){return n.replace("//vrlab-public.ljcdn.com/","//vr-public.realsee-cdn.cn/").replace("//vrlab-image4.ljcdn.com/","//vr-image-4.realsee-cdn.cn/").replace("//vrlab-image3.ljcdn.com/","//vr-image-3.realsee-cdn.cn/").replace("//vrlab-image2.ljcdn.com/","//vr-image-2.realsee-cdn.cn/").replace("//vrlab-image1.ljcdn.com/","//vr-image-1.realsee-cdn.cn/")},hm=new d.Vector2,Ai=new d.Frustum,gi=new d.Matrix4,g0=new WeakMap,La=new WeakMap,y0=Xa([]),sl=function(n){se(t,n);function t(e){e===void 0&&(e={});var r,i,a,o,s,l,u,c,f,m,A,h=n.call(this)||this;if(h.ident=St(),typeof window!="undefined"&&(ro.instances[h.ident]=h),h.renderSwitch01=0,h.currentMode="Panorama",h.pano={workCode:"",panoIndex:0},h.needsRender=!1,h.modelSceneNeedsRender=!1,h.onlyRenderIfNeeds=(r=e.onlyRenderIfNeeds)!==null&&r!==void 0?r:!0,h.imageOptions=k({},(i=e.imageOptions)!==null&&i!==void 0?i:{}),h.textureOptions=k({},(a=e.textureOptions)!==null&&a!==void 0?a:{}),h.poweredByRealsee=(o=e.poweredByRealsee)!==null&&o!==void 0?o:!0,h.extraElements=[],h.controllerInits={Panorama:Object.assign({},e.panorama),Model:Object.assign({},e.model),Floorplan:Object.assign({},e.floorplan),Topview:Object.assign({},e.topview),Mapview:Object.assign({},e.mapview),VRPanorama:Object.assign({},e.vrPanorama),XRPanorama:Object.assign({},e.xrPanorama)},h.fps={testCount:0,testTime:Ee()},h.info=null,h.modeChangeDuration=(s=e.modeChangeDuration)!==null&&s!==void 0?s:dm,h.enableWheel=(l=e.enableWheel)!==null&&l!==void 0?l:!0,typeof window!="undefined")if("renderer"in e)e.renderer instanceof nn&&h.throwError(new Error("cannot render a internal renderer")),h.renderer=e.renderer;else try{h.renderer=new nn({preserveDrawingBuffer:e.preserveDrawingBuffer,backgroundColor:e.backgroundColor,backgroundAlpha:e.backgroundAlpha,antialias:e.antialias,webgl2:e.webgl2,logarithmicDepthBuffer:e.logarithmicDepthBuffer,precision:e.precision});var p=al();h.renderer.setPixelRatio(p===1?window.devicePixelRatio:1),h.renderer.setSize(512,512)}catch(L){L instanceof Error&&h.throwError(L)}h.getPixelsRenderTarget=new d.WebGLRenderTarget(1,1,{encoding:(c=(u=h.renderer)===null||u===void 0?void 0:u.outputEncoding)!==null&&c!==void 0?c:d.sRGBEncoding,generateMipmaps:!1});var g=new d.DepthTexture(1,1);g.generateMipmaps=!1,g.format=d.DepthStencilFormat,g.type=d.UnsignedInt248Type,h.modelRenderTarget=new d.WebGLRenderTarget(1,1,{encoding:(m=(f=h.renderer)===null||f===void 0?void 0:f.outputEncoding)!==null&&m!==void 0?m:d.sRGBEncoding,depthTexture:g,generateMipmaps:!1,depthBuffer:!0,stencilBuffer:!0}),h.scissor=Object.assign({left:0,bottom:0,width:1,height:1},e.scissor),h.camera=new z0(A0),h.scene=new D0,h.xrCustomObjectsScene=new d.Scene,h.scene.add(h.xrCustomObjectsScene),h.scene.matrixAutoUpdate=!1,h.lastLoadWorkTask=Promise.resolve(),h.requestProxy=(A=e.requestProxy)!==null&&A!==void 0?A:fm,h.networkSubscribe=new I0,h.networkSubscribe.on("network",function(L,S,I,O){var P;h.emit("network.resource",_("network.resource",{source:L,requestType:S,requestState:I,detail:O})),(P=h.analysis)===null||P===void 0||P.network(h.works,L,S,I,O)}),h.boundingMesh=cp(new d.Box3(new d.Vector3(-.5,-.5,-.5),new d.Vector3(.5,.5,.5))),h.boundingMesh.name="bounding",h.models=Us(),h.models.push(new Za),h.lastModels=Us(),h.lastWorks=Xa([]),h.readyCallbacks=[],h.syncingState=!1,h.helperGroup=new d.Group,h.helperGroup.name="helper",h.helperGroup.matrixAutoUpdate=!1,h.scene.add(h.helperGroup),h.modelGroup=new d.Group,h.modelGroup.visible=!1,h.modelGroup.name="model",h.modelGroup.matrixAutoUpdate=!1,h.modelScene=new d.Scene,h.modelScene.add(h.modelGroup),h.modelScene.add(h.boundingMesh),h.modelScene.matrixAutoUpdate=!1,h.videoTexture=new d.VideoTexture(e.videoInstance||rm()),p0(h.scene),p0(h.modelScene),h.state={mode:h.currentMode,workCode:h.pano.workCode,panoIndex:h.pano.panoIndex,longitude:h.camera.pose.longitude,latitude:h.camera.pose.latitude,fov:h.camera.pose.fov,offset:h.camera.pose.offset.clone(),distance:h.camera.pose.distance},h.stateSynced=!1,h._enablePostProcessing=!1,h._enableIOSEDR=!1,h._enableEDL=!1,h._enableHQ=!1,h.destroyed=!1,h.paused=!0,typeof window!="undefined"&&(e.play!==!1&&h.play(),h.stopAnimationLoop=dt.shared.add(function(L,S){for(var I=[],O=2;O<arguments.length;O++)I[O-2]=arguments[O];h.updateTime.apply(h,Et([L,S],I,!1))},!1,0,10));var v=function(){typeof document!="undefined"&&document.fullscreenElement===null&&h.currentMode==="VRPanorama"&&h.controller.emit("vr.requestExit",_("vr.requestExit",{}))},y=function(){h.needsRender=!0,h.modelSceneNeedsRender=!0};if(typeof document!="undefined"&&document.addEventListener("fullscreenchange",v,!1),h.renderer&&h.renderer.domElement.addEventListener("webglcontextrestored",y,!1),h.removeEventListeners=function(){typeof document!="undefined"&&document.removeEventListener("fullscreenchange",v,!1),h.renderer&&h.renderer.domElement.removeEventListener("webglcontextrestored",y,!1)},h.plugins={},e.plugins&&e.plugins.length)for(var b=0,x=e.plugins;b<x.length;b++){var w=x[b];if(typeof w=="function")w(h);else if(Array.isArray(w)){var E=w[0],C=w[1],M=w[2];if(typeof E=="function"){var R=E(h,M);typeof C=="string"&&(h.plugins[C]?h.throwError(new Error("plugin name ".concat(C," is exists."))):h.plugins[C]=R)}}}return h.gpuPickingRenderTarget=new d.WebGLRenderTarget(1,1,{generateMipmaps:!1}),h.meshReplaceMaterialMap=new Map,h.meshOriginMaterialMap=new Map,tm(h),h}return Object.defineProperty(t,"version",{get:function(){return"6.3.0-alpha.10"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"dracoPath",{get:function(){return Oi.decoderPath},set:function(e){Oi.setDecoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t,"ktx2Path",{get:function(){return Kn.transcoderPath},set:function(e){Kn.setTranscoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"panoIndex",{get:function(){return this.pano.panoIndex},enumerable:!1,configurable:!0}),t.prototype.getGPUPicking=function(e,r,i,a,o){var s=this;if(a===void 0&&(a=1),o===void 0&&(o=new d.Vector3(0,0,0)),!this.renderer)throw new Error("renderer is not initialized.");this.models.setMaterial({constantColor:o}),this.scene.traverse(function(f){if(!(!(f instanceof d.Mesh)||f instanceof Tt)){var m=Object.keys(i).filter(function(h){return h===f.uuid})[0];if(m)if(s.meshOriginMaterialMap.set(m,f.material),s.meshReplaceMaterialMap.get(m))f.material=s.meshReplaceMaterialMap.get(m);else{var A=new d.ShaderMaterial({uniforms:{color:{value:i[m]}},vertexShader:`
|
|
2165
|
+
`},Oo=function(n){se(t,n);function t(e){var r=n.call(this,{uniforms:d.UniformsUtils.clone(ka.uniforms),vertexShader:ka.vertexShader,fragmentShader:ka.fragmentShader,clipping:!0})||this;return r.type="LineMaterial",r.dashed=!1,Object.defineProperties(r,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(i){this.uniforms.diffuse.value=i}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(i){this.uniforms.linewidth.value=i}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(i){this.uniforms.dashScale.value=i}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(i){this.uniforms.dashSize.value=i}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(i){this.uniforms.gapSize.value=i}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(i){this.uniforms.opacity.value=i}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(i){this.uniforms.resolution.value.copy(i)}}}),r.setValues(e),r}return t}(d.ShaderMaterial);Object.assign(Oo.prototype,{isLineMaterial:!0});var el=function(n){se(t,n);function t(e,r){var i=n.call(this)||this;return i.type="LineSegments2",i.geometry=e!==void 0?e:new Lo,i.material=r!==void 0?r:new Oo({color:Math.random()*16777215}),i}return t.prototype.computeLineDistances=function(){for(var e=this.geometry,r=e.attributes.instanceStart,i=e.attributes.instanceEnd,a=new Float32Array(2*r.count),o=new d.Vector3,s=new d.Vector3,l=0,u=0,c=r.count;l<c;l++,u+=2)o.fromBufferAttribute(r,l),s.fromBufferAttribute(i,l),a[u]=u===0?0:a[u-1],a[u+1]=a[u]+o.distanceTo(s);var f=new d.InstancedInterleavedBuffer(a,2,1);return e.setAttribute("instanceDistanceStart",new d.InterleavedBufferAttribute(f,1,0)),e.setAttribute("instanceDistanceEnd",new d.InterleavedBufferAttribute(f,1,1)),this},t.prototype.raycast=function(e,r){e.camera===null&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');var i=e.ray,a=e.camera,o=a.projectionMatrix,s=this.geometry,l=this.material,u=l.resolution,c=l.linewidth,f=s.attributes.instanceStart,m=s.attributes.instanceEnd,A=new d.Vector4,h=new d.Vector4,p=new d.Vector4,g=new d.Vector3,v=new d.Matrix4,y=new d.Line3,b=new d.Vector3;i.at(1,p),p.w=1,p.applyMatrix4(a.matrixWorldInverse),p.applyMatrix4(o),p.multiplyScalar(1/p.w),p.x*=u.x/2,p.y*=u.y/2,p.z=0,g.copy(p);var x=this.matrixWorld;v.multiplyMatrices(a.matrixWorldInverse,x);for(var w=0,E=f.count;w<E;w++){A.fromBufferAttribute(f,w),h.fromBufferAttribute(m,w),A.w=1,h.w=1,A.applyMatrix4(v),h.applyMatrix4(v),A.applyMatrix4(o),h.applyMatrix4(o),A.multiplyScalar(1/A.w),h.multiplyScalar(1/h.w);var C=A.z<-1&&h.z<-1,M=A.z>1&&h.z>1;if(!(C||M)){A.x*=u.x/2,A.y*=u.y/2,h.x*=u.x/2,h.y*=u.y/2,y.start.copy(A),y.start.z=0,y.end.copy(h),y.end.z=0;var R=y.closestPointToPointParameter(g,!0);y.at(R,b);var L=d.MathUtils.lerp(A.z,h.z,R),S=L>=-1&&L<=1,I=g.distanceTo(b)<c*.5;if(S&&I){y.start.fromBufferAttribute(f,w),y.end.fromBufferAttribute(m,w),y.start.applyMatrix4(x),y.end.applyMatrix4(x);var O=new d.Vector3,P=new d.Vector3;i.distanceSqToSegment(y.start,y.end,P,O),r.push({point:P,pointOnLine:O,distance:i.origin.distanceTo(P),object:this,faceIndex:w})}}}},t}(d.Mesh);Object.assign(el.prototype,{isLineSegments2:!0});var tl=function(n){se(t,n);function t(e,r){var i=n.call(this,e,r)||this;return i.type="Line2",i}return t}(el);Object.assign(tl.prototype,{isLine2:!0});var rl=function(n){se(t,n);function t(){var e=n.call(this)||this;return e.type="LineGeometry",e}return t.prototype.setPositions=function(e){for(var r=e.length-3,i=new Float32Array(2*r),a=0;a<r;a+=3)i[2*a]=e[a],i[2*a+1]=e[a+1],i[2*a+2]=e[a+2],i[2*a+3]=e[a+3],i[2*a+4]=e[a+4],i[2*a+5]=e[a+5];return n.prototype.setPositions.call(this,i),this},t.prototype.setColors=function(e){for(var r=e.length-3,i=new Float32Array(2*r),a=0;a<r;a+=3)i[2*a]=e[a],i[2*a+1]=e[a+1],i[2*a+2]=e[a+2],i[2*a+3]=e[a+3],i[2*a+4]=e[a+4],i[2*a+5]=e[a+5];return n.prototype.setColors.call(this,i),this},t.prototype.fromLine=function(e){var r=e.geometry;if(r instanceof d.Geometry){var i=new d.BufferGeometry().fromGeometry(r);this.setPositions(i.attributes.position.array)}else r instanceof d.BufferGeometry&&this.setPositions(r.attributes.position.array);return this},t.prototype.copy=function(){return this},t}(Lo);Object.assign(rl.prototype,{isL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GOFVVrfVMv7kMNDntFD1vjIAPrlRN0xjckOm6biFQ3jwNPwDMZrOnqVTqfb3Bi8Wivru7W/VCYkwPlKOjo0IikXh7EwQikYgE4Nw0CfXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg==",l0=14467195,Nv=8,Dv=2,zv=20,c0=null,to=function(n){se(t,n);function t(e,r){e===void 0&&(e=new d.Vector3),r===void 0&&(r=new d.Vector3);var i=n.call(this)||this;i.type="FiveLine",i.needsRender=!0;var a=new rl,o=new Oo({color:l0,linewidth:Dv,dashScale:zv,dashed:!1});i.line=new tl(a,o);var s=new d.BufferGeometry,l=new d.PointsMaterial({color:l0,size:Nv,map:c0||(c0=new d.TextureLoader().load(Vv)),sizeAttenuation:!1,transparent:!0});return i.points=new d.Points(s,l),i.points.renderOrder=11,i.points.frustumCulled=!1,i.setPoints(e,r),i.add(i.line,i.points),i}return Object.defineProperty(t,"version",{get:function(){return"6.3.0-alpha.11"},enumerable:!1,configurable:!0}),t.prototype.setPoints=function(e,r){var i=[].concat(e.toArray(),r.toArray());this.points.geometry.setAttribute("position",new d.BufferAttribute(new Float32Array(i),3)),this.line.geometry.setPositions(i),this.line.computeLineDistances(),this.needsRender=!0},t.prototype.getPoints=function(){var e=this.points.geometry.attributes.position.array;return[new d.Vector3(e[0],e[1],e[2]),new d.Vector3(e[3],e[4],e[5])]},t.prototype.setMaterial=function(e){var r=this.line.material;for(var i in e)if(e.hasOwnProperty(i)){var a=e[i];i==="dashed"?(r.dashed=a,a?r.defines.USE_DASH="":delete r.defines.USE_DASH,r.needsUpdate=!0):r[i]=e[i]}this.needsRender=!0},t.prototype.setResolution=function(e,r){var i=this.line.material.resolution;(i.x!==e||i.y!==r)&&(i.set(e,r),this.needsRender=!0)},t}(d.Object3D);Object.assign(to.prototype,{isFiveLine:!0});var Je={Handedness:Object.freeze({NONE:"none",LEFT:"left",RIGHT:"right"}),ComponentState:Object.freeze({DEFAULT:"default",TOUCHED:"touched",PRESSED:"pressed"}),ComponentProperty:Object.freeze({BUTTON:"button",X_AXIS:"xAxis",Y_AXIS:"yAxis",STATE:"state"}),ComponentType:Object.freeze({TRIGGER:"trigger",SQUEEZE:"squeeze",TOUCHPAD:"touchpad",THUMBSTICK:"thumbstick",BUTTON:"button"}),ButtonTouchThreshold:.05,AxisTouchThreshold:.1,VisualResponseProperty:Object.freeze({TRANSFORM:"transform",VISIBILITY:"visibility"})};function nl(n){return zi(this,void 0,void 0,function(){var t;return Qi(this,function(e){switch(e.label){case 0:return[4,fetch(n)];case 1:if(t=e.sent(),t.ok)return[2,t.json()];throw new Error(t.statusText)}})})}function Qv(n){return zi(this,void 0,void 0,function(){var t,e;return Qi(this,function(r){switch(r.label){case 0:if(!n)throw new Error("No basePath supplied");return t="profilesList.json",[4,nl("".concat(n,"/").concat(t))];case 1:return e=r.sent(),[2,e]}})})}function Uv(n,t){return zi(this,arguments,void 0,function(e,r,i,a){var o,s,l,u,c,f;return i===void 0&&(i=null),a===void 0&&(a=!0),Qi(this,function(m){switch(m.label){case 0:if(!e)throw new Error("No xrInputSource supplied");if(!r)throw new Error("No basePath supplied");return[4,Qv(r)];case 1:if(o=m.sent(),e.profiles.some(function(A){var h=o[A];return h&&(s={profileId:A,profilePath:"".concat(r,"/").concat(h.path),deprecated:!!h.deprecated}),!!s}),!s){if(!i)throw new Error("No matching profile name found");if(l=o[i],!l)throw new Error('No matching profile name found and default profile "'.concat(i,'" missing.'));s={profileId:i,profilePath:"".concat(r,"/").concat(l.path),deprecated:!!l.deprecated}}return[4,nl(s.profilePath)];case 2:if(u=m.sent(),a){if(f=void 0,f=u.layouts[e.handedness],!f)throw new Error("No matching handedness, ".concat(e.handedness,", in profile ").concat(s.profileId));f.assetPath&&(c=s.profilePath.replace("profile.json",f.assetPath))}return[2,{profile:u,assetPath:c}]}})})}var Hv={xAxis:0,yAxis:0,button:0,state:Je.ComponentState.DEFAULT};function qv(n,t){n===void 0&&(n=0),t===void 0&&(t=0);var e=n,r=t,i=Math.sqrt(n*n+t*t);if(i>1){var a=Math.atan2(t,n);e=Math.cos(a),r=Math.sin(a)}var o={normalizedXAxis:e*.5+.5,normalizedYAxis:r*.5+.5};return o}var Gv=function(){function n(t){this.componentProperty=t.componentProperty,this.states=t.states,this.valueNodeName=t.valueNodeName,this.valueNodeProperty=t.valueNodeProperty,this.valueNodeProperty===Je.VisualResponseProperty.TRANSFORM&&(this.minNodeName=t.minNodeName,this.maxNodeName=t.maxNodeName),this.value=0,this.updateFromComponent(Hv)}return n.prototype.updateFromComponent=function(t){var e=t.xAxis,r=t.yAxis,i=t.button,a=t.state,o=qv(e,r),s=o.normalizedXAxis,l=o.normalizedYAxis;switch(this.componentProperty){case Je.ComponentProperty.X_AXIS:this.value=this.states.includes(a)?s:.5;break;case Je.ComponentProperty.Y_AXIS:this.value=this.states.includes(a)?l:.5;break;case Je.ComponentProperty.BUTTON:this.value=this.states.includes(a)?i:0;break;case Je.ComponentProperty.STATE:this.valueNodeProperty===Je.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(a):this.value=this.states.includes(a)?1:0;break;default:throw new Error("Unexpected visualResponse componentProperty ".concat(this.componentProperty))}},n}(),Kv=function(){function n(t,e){var r=this;if(!t||!e||!e.visualResponses||!e.gamepadIndices||Object.keys(e.gamepadIndices).length===0)throw new Error("Invalid arguments supplied");this.id=t,this.type=e.type,this.rootNodeName=e.rootNodeName,this.touchPointNodeName=e.touchPointNodeName,this.visualResponses={},Object.keys(e.visualResponses).forEach(function(i){var a=new Gv(e.visualResponses[i]);r.visualResponses[i]=a}),this.gamepadIndices=Object.assign({},e.gamepadIndices),this.values={state:Je.ComponentState.DEFAULT,button:this.gamepadIndices.button!==void 0?0:void 0,xAxis:this.gamepadIndices.xAxis!==void 0?0:void 0,yAxis:this.gamepadIndices.yAxis!==void 0?0:void 0}}return Object.defineProperty(n.prototype,"data",{get:function(){var t=k({id:this.id},this.values);return t},enumerable:!1,configurable:!0}),n.prototype.updateFromGamepad=function(t){var e=this;if(this.values.state=Je.ComponentState.DEFAULT,this.gamepadIndices.button!==void 0&&t.buttons.length>this.gamepadIndices.button){var r=t.buttons[this.gamepadIndices.button];this.values.button=r.value,this.values.button=this.values.button<0?0:this.values.button,this.values.button=this.values.button>1?1:this.values.button,r.pressed||this.values.button===1?this.values.state=Je.ComponentState.PRESSED:(r.touched||this.values.button>Je.ButtonTouchThreshold)&&(this.values.state=Je.ComponentState.TOUCHED)}this.gamepadIndices.xAxis!==void 0&&t.axes.length>this.gamepadIndices.xAxis&&(this.values.xAxis=t.axes[this.gamepadIndices.xAxis],this.values.xAxis=this.values.xAxis<-1?-1:this.values.xAxis,this.values.xAxis=this.values.xAxis>1?1:this.values.xAxis,this.values.state===Je.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>Je.AxisTouchThreshold&&(this.values.state=Je.ComponentState.TOUCHED)),this.gamepadIndices.yAxis!==void 0&&t.axes.length>this.gamepadIndices.yAxis&&(this.values.yAxis=t.axes[this.gamepadIndices.yAxis],this.values.yAxis=this.values.yAxis<-1?-1:this.values.yAxis,this.values.yAxis=this.values.yAxis>1?1:this.values.yAxis,this.values.state===Je.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>Je.AxisTouchThreshold&&(this.values.state=Je.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(function(i){i.updateFromComponent(e.values)})},n}(),jv=function(){function n(t,e,r){var i=this;if(!t)throw new Error("No xrInputSource supplied");if(!e)throw new Error("No profile supplied");this.xrInputSource=t,this.assetUrl=r,this.id=e.profileId,this.layoutDescription=e.layouts[t.handedness],this.components={},Object.keys(this.layoutDescription.components).forEach(function(a){var o=i.layoutDescription.components[a];i.components[a]=new Kv(a,o)}),this.updateFromGamepad()}return Object.defineProperty(n.prototype,"gripSpace",{get:function(){return this.xrInputSource.gripSpace},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"targetRaySpace",{get:function(){return this.xrInputSource.targetRaySpace},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"data",{get:function(){var t=[];return Object.values(this.components).forEach(function(e){t.push(e.data)}),t},enumerable:!1,configurable:!0}),n.prototype.updateFromGamepad=function(){var t=this;Object.values(this.components).forEach(function(e){e.updateFromGamepad(t.xrInputSource.gamepad)})},n}(),_v="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",Jv="generic-trigger",Xv=function(n){se(t,n);function t(){var e=n.call(this)||this;return e.motionController=null,e.envMap=null,e}return t.prototype.setEnvironmentMap=function(e){var r=this;return this.envMap==e?this:(this.envMap=e,this.traverse(function(i){i instanceof d.Mesh&&i.isMesh&&(i.material.envMap=r.envMap,i.material.needsUpdate=!0)}),this)},t.prototype.updateMatrixWorld=function(e){n.prototype.updateMatrixWorld.call(this,e),this.motionController&&(this.motionController.updateFromGamepad(),Object.values(this.motionController.components).forEach(function(r){Object.values(r.visualResponses).forEach(function(i){var a=i.valueNode,o=i.minNode,s=i.maxNode,l=i.value,u=i.valueNodeProperty;a&&(u===Je.VisualResponseProperty.VISIBILITY?a.visible=l:u===Je.VisualResponseProperty.TRANSFORM&&(a.quaternion.copy(o.quaternion).slerp(s.quaternion,l),a.position.lerpVectors(o.position,s.position,l)))})}))},t}(Un.Object3D);function Wv(n,t){Object.values(n.components).forEach(function(e){var r=e.type,i=e.touchPointNodeName,a=e.visualResponses;if(r===Je.ComponentType.TOUCHPAD)if(e.touchPointNode=t.getObjectByName(i),e.touchPointNode){var o=new Un.SphereGeometry(.001),s=new Un.MeshBasicMaterial({color:255}),l=new Un.Mesh(o,s);e.touchPointNode.add(l)}else console.warn("Could not find touch dot, ".concat(e.touchPointNodeName,", in touchpad component ").concat(e.id));Object.values(a).forEach(function(u){var c=u.valueNodeName,f=u.minNodeName,m=u.maxNodeName,A=u.valueNodeProperty;if(A===Je.VisualResponseProperty.TRANSFORM){if(u.minNode=t.getObjectByName(f),u.maxNode=t.getObjectByName(m),!u.minNode){console.warn("Could not find ".concat(f," in the model"));return}if(!u.maxNode){console.warn("Could not find ".concat(m," in the model"));return}}u.valueNode=t.getObjectByName(c),u.valueNode||console.warn("Could not find ".concat(c," in the model"))})})}function d0(n,t){Wv(n.motionController,t),n.envMap&&t.traverse(function(e){e instanceof d.Mesh&&e.isMesh&&(e.material.envMap=n.envMap,e.material.needsUpdate=!0)}),n.add(t)}var Zv=function(){function n(t){t===void 0&&(t=null),this.gltfLoader=t,this.path=_v,this._assetCache={}}return n.prototype.createControllerModel=function(t){var e=this,r=new Xv,i=null;return t.addEventListener("connected",function(a){var o=a.data;o.targetRayMode!=="tracked-pointer"||!o.gamepad||Uv(o,e.path,Jv).then(function(s){var l=s.profile,u=s.assetPath;r.motionController=new jv(o,l,u);var c=e._assetCache[r.motionController.assetUrl];if(c)i=c.scene.clone(),d0(r,i);else{if(!e.gltfLoader)throw new Error("GLTFLoader not set.");e.gltfLoader.load(r.motionController.assetUrl,function(f){e._assetCache[r.motionController.assetUrl]=f,i=f.scene.clone(),d0(r,i)})}}).catch(function(s){console.warn(s)})}),t.addEventListener("disconnected",function(){r.motionController=null,r.remove(i),i=null}),r},n}();function Yv(n,t){return n}var f0=300,$v=new d.Matrix4().makeRotationAxis(new d.Vector3(0,1,0),Math.PI),h0=new d.Vector3(-1,1,1),em=function(n){se(t,n);function t(e){var r=n.call(this,e)||this;r.xrManager=new Ov(r.renderer,r.renderer.getContext(),{onSessionStart:function(l){r.emit("xr.session.start",_("xr.session.start",{session:l,machineType:r.xrManager.machineType}))},onSessionEnd:function(){r.emit("xr.session.end",_("xr.session.end",{session:null,machineType:r.xrManager.machineType}))}}),r.xrControllerRay={left:new d.Raycaster,right:new d.Raycaster},r.xrControllerRay.left.params.Points={threshold:.1},r.xrControllerRay.right.params.Points={threshold:.1},r.gazeRay=null,r.pointerLines={left:new to,right:new to},r.pointerLines.left.visible=!1,r.pointerLines.right.visible=!0,r.pointerLines.left.setMaterial({color:new d.Vector3(1,1,1)}),r.pointerLines.left.points.material.depthTest=!1,r.pointerLines.right.setMaterial({color:new d.Vector3(1,1,1)}),r.pointerLines.right.points.material.depthTest=!1,r.controllerWrappers=[new d.Group,new d.Group];var i=r.xrManager.getController(0);r.controllerWrappers[0].add(i);var a=r.xrManager.getController(1);r.controllerWrappers[1].add(a);var o=new Zv;o.gltfLoader={load:function(l,u){Pi.ajax(l,{responseType:"arraybuffer"}).then(function(c){var f;return Ao(c.body,{resourcePath:l.slice(0,l.lastIndexOf("/")+1),search:(f=l.split("?")[1])!==null&&f!==void 0?f:"",fetcher:Pi})}).then(function(c){return u(c)})}},(r.xrManager.machineType==="Oculus"||r.xrManager.machineType==="Pico")&&r.scene.add(r.pointerLines.left,r.pointerLines.right,r.controllerWrappers[0],r.controllerWrappers[1]),r.panoResources={},r.panoResources[r.locationMotion.keyframes[0].key=r.locationMotion.keyframes[1].key=St()]={panoId:De(r.currentPano),leftPanoPicture:null,position:r.camera.pose.offset.clone(),effect:"fade",fixCameraTransform:new d.Matrix4},r.parallaxCameraMatrixs=[];var s=dt.shared.getContext();return s?(r.on("xr.session.end",function(){r.scene.remove(r.pointerLines.left,r.pointerLines.right)}),r.xrManager.setSession(s),r.on("xr.session.start",function(){var l=r.xrManager.getControllerGrip(0);l.add(o.createControllerModel(l)),r.controllerWrappers[0].add(l);var u=r.xrManager.getControllerGrip(1);u.add(o.createControllerModel(u)),r.controllerWrappers[1].add(u)}),r.xrHandleState={LeftAxesUp:{touchStartTime:0,touchStart:!1},LeftAxesDown:{touchStartTime:0,touchStart:!1},LeftAxesLeft:{touchStartTime:0,touchStart:!1},LeftAxesRight:{touchStartTime:0,touchStart:!1},LeftTrigger:{touchStartTime:0,touchStart:!1},LeftPinch:{touchStartTime:0,touchStart:!1},RightAxesUp:{touchStartTime:0,touchStart:!1},RightAxesDown:{touchStartTime:0,touchStart:!1},RightAxesLeft:{touchStartTime:0,touchStart:!1},RightAxesRight:{touchStartTime:0,touchStart:!1},RightTrigger:{touchStartTime:0,touchStart:!1},RightPinch:{touchStartTime:0,touchStart:!1},Y:{touchStartTime:0,touchStart:!1},X:{touchStartTime:0,touchStart:!1},A:{touchStartTime:0,touchStart:!1},B:{touchStartTime:0,touchStart:!1}},r.xrManager.machineType==="VP"&&r.initHandEvent(),r):(console.error("获取session失败,请退出重试"),r)}return t.parseArgs=function(e){if(e instanceof t)return e;var r=k(k({},e),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2});return n.parseArgs.call(this,r)},t.initAnimationEndState=function(e){var r=this.parseArgs(e),i=n.initAnimationEndState.call(this,r);return k(k({},i),{mode:"XRPanorama"})},t.prototype.moveToPano=function(e,r,i){var a=this,o,s,l,u,c=(o=r.effect)!==null&&o!==void 0?o:"fade";this.userAction=i,this.stopMomentumMovement();var f=this.works.getResolvedObserver(e);if(!f)throw new Error("Invalid PanoIndex");var m=Jn(f.images.up),A=this.imageOptions.size;typeof A=="undefined"&&f&&m&&(A=Number(m)),typeof A=="undefined"&&(A=2048);var h=this.imageOptions.transform,p=function(S,I){return Yv(sn(S,h,I))},g=k({key:"pano.".concat(f.panoId)},Dt(this.imageOptions,["format","size","quality"])),v=f.images,y=(l=(s=f.images.tiles)===null||s===void 0?void 0:s.filter(function(S){return S.size>A}))!==null&&l!==void 0?l:null,b="pano:"+Hi([v,g,h]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===b)return;var x=this.pendingTextureTask.panoId;(u=this.panoMeshes[x])===null||u===void 0||u.setProgress(0),this.emit("pano.texture.abort",_("pano.texture.abort",{error:null,progress:0,meta:null,pano:f.pano}))}var w=this.models.getMaterial()||{},E=w.pano0,C=w.pano1,M;if((E==null?void 0:E.map.name)===b?M=E:(C==null?void 0:C.map.name)===b&&(M=C),M){var R={panoId:f.panoId,effect:c,leftPanoPicture:{zoom:1,map:M.map,luminanceMap:M.luminanceMap,matrix:new d.Matrix4().compose(f.position,f.quaternion,h0)},position:f.position.clone(),fixCameraTransform:new d.Matrix4};this.doMoveToPano(f.pano,R,r);return}var L="move-to-pano-"+f.panoId;this.pending.add(L),this.pendingTextureTask={panoId:f.panoId,hash:b,onLoad:function(S){if(a.pending.delete(L),a.destroyed)S.body.dispose();else{S.body.name=b;var I={panoId:f.panoId,effect:c,leftPanoPicture:{zoom:1,map:S.body,luminanceMap:null,matrix:new d.Matrix4().compose(f.position,f.quaternion,h0)},position:f.position.clone(),fixCameraTransform:new d.Matrix4};a.doMoveToPano(f.pano,I,r)}},onError:function(S){a.pending.delete(L);var I=k(k(k({},f.pano),{mode:a.mode}),_e(a.camera.pose));a.emit("pano.error",_("pano.error",{error:S,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:I})),a.emit("pano.cancel",_("pano.cancel",{error:null,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:I})),r.moveCancelCallback&&r.moveCancelCallback()}},Promise.all([this.tileLevelForFov&&y&&y.length?this.textureLoader.loadTiledCubeTexture(v,y,{tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:p,options:g},format:d.RGBAFormat,minFilter:d.LinearFilter,magFilter:d.LinearFilter,generateMipmaps:!1,viaAjax:!0,fetcher:it(f.work)},void 0,void 0,function(S){var I,O;a.emit("pano.texture.progress",_("pano.texture.progress",{error:null,progress:S,meta:null,pano:f.pano})),((I=a.pendingTextureTask)===null||I===void 0?void 0:I.hash)===b&&((O=a.panoMeshes[f.panoId])===null||O===void 0||O.setProgress(S))},this.renderer):this.textureLoader.loadCubeTexture(v,{imageURL:{transform:p,options:g},format:d.RGBAFormat,fetcher:it(f.work)},void 0,void 0,function(S){var I,O;((I=a.pendingTextureTask)===null||I===void 0?void 0:I.hash)===b&&((O=a.panoMeshes[f.panoId])===null||O===void 0||O.setProgress(S)),a.emit("pano.texture.progress",_("pano.texture.progress",{error:null,progress:S,meta:null,pano:f.pano}))},this.renderer)]).then(function(S){var I,O,P=S[0];((I=a.pendingTextureTask)===null||I===void 0?void 0:I.hash)===b?(a.pendingTextureTask.onLoad(P),(O=a.panoMeshes[f.panoId])===null||O===void 0||O.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.success",_("pano.texture.success",{error:null,progress:1,meta:P.meta,pano:f.pano}))):P.body.dispose()}).catch(function(S){var I,O;((I=a.pendingTextureTask)===null||I===void 0?void 0:I.hash)===b&&(a.pendingTextureTask.onError(S),(O=a.panoMeshes[f.panoId])===null||O===void 0||O.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.error",_("pano.texture.error",{error:S,progress:0,meta:null,pano:f.pano})),a.emit("error",S))}),this.emit("pano.texture.load",_("pano.texture.load",{error:null,progress:0,meta:null,pano:f.pano}))},t.prototype.doMoveToPano=function(e,r,i){var a=this,o,s,l,u,c,f,m,A,h,p;i===void 0&&(i={});var g=Ee(),v=St();this.panoResources[v]=r;var y=1,b,x,w;if(this.locationMotion.ended){var E=this.locationMotion.getKeyFrameSegment(g);E[0];var C=E[1],M=this.locationMotion.value,R=this.panoResourceFromLocationMotionKeyframe(C).position,L=r.position;b=Math.max(R.distanceTo(L),y),x=[{key:C.key,progress:0,value:k(k({},M),{count:0})},{key:v,progress:1,value:{distance:0,count:1}}],w=0}else{var S=this.locationMotion.getKeyFrameSegment(g),I=S[0],C=S[1],M=this.locationMotion.value,O=this.panoResourceFromLocationMotionKeyframe(I).position,R=this.panoResourceFromLocationMotionKeyframe(C).position,L=r.position,P=C.value.count-M.count,F=Math.max(O.distanceTo(R),y)*P,V=Math.max(R.distanceTo(L),y);b=F+V,x=[{key:I.key,progress:0,value:k({},M)},{key:C.key,progress:F/b,value:C.value},{key:v,progress:1,value:{count:C.value.count+1,distance:0}}];var D=this.locationMotionKeyframesLength(this.locationMotion.keyframes),z=this.locationMotionKeyframesLength(x);w=this.locationMotion.getProgressVelocity(g)*D/z}var U=r.effect==="instant"?0:this.calculateMovingDuration(i.duration,r.effect==="fly"?b:0),H={longitude:i.longitude,latitude:i.latitude,fov:i.fov},K=k(k({},e),{mode:this.mode,longitude:(o=H.longitude)!==null&&o!==void 0?o:this.camera.pose.longitude,latitude:(s=H.latitude)!==null&&s!==void 0?s:this.camera.pose.latitude,fov:(l=H.fov)!==null&&l!==void 0?l:this.camera.pose.fov,offset:r.position.clone(),distance:0}),j=this.currentPano;if(this.emit("pano.moveTo",_("pano.moveTo",{options:i,prevPano:j,progress:0,state:K,userAction:this.userAction,error:null})),i.moveStartCallback&&i.moveStartCallback(K),this.videoTexture&&this.videoTexture.image instanceof HTMLVideoElement&&this.videoTexture.image.getAttribute("src")&&(this.videoTexture.image.pause(),this.videoTexture.image.removeAttribute("uuid"),this.videoTexture.image.removeAttribute("src"),this.videoTexture.image.oncanplay=Q,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),r.effect==="fly")this.cameraMotion.set(H,U).catch(Q);else{var J=Nt({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude}),X=Nt({longitude:(u=H.longitude)!==null&&u!==void 0?u:this.cameraMotion.value.longitude,latitude:(c=H.latitude)!==null&&c!==void 0?c:this.cameraMotion.value.latitude}),W=new d.Object3D;W.lookAt(J);var Z=new d.Matrix4().makeRotationFromQuaternion(W.quaternion);W.lookAt(X);var ee=new d.Matrix4().makeRotationFromQuaternion(W.quaternion),Y=new d.Matrix4().getInverse(Z).premultiply(ee),ie=this.cameraMotion.value.fov,te=(f=H.fov)!==null&&f!==void 0?f:this.cameraMotion.value.fov,le=1;r.effect==="zoomin"?le=1.5:r.effect==="zoomout"&&(le=.4);for(var oe=te*le,xe=0;xe<x.length-1;xe++){var he=x[xe].key;if(he){var Ae=this.panoResources[he];Ae&&(Ae.fixCameraTransform.copy(Y),Ae.leftPanoPicture&&(Ae.leftPanoPicture.zoom=Math.tan(ie/2/180*Math.PI)/Math.tan(oe/2/180*Math.PI)))}}this.cameraMotion.setKeyframes([{progress:0,value:{longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude,fov:this.cameraMotion.value.fov}},{progress:0,value:{longitude:(m=H.longitude)!==null&&m!==void 0?m:this.cameraMotion.value.longitude,latitude:(A=H.latitude)!==null&&A!==void 0?A:this.cameraMotion.value.latitude,fov:oe}},{progress:1,value:{longitude:(h=H.longitude)!==null&&h!==void 0?h:this.cameraMotion.value.longitude,latitude:(p=H.latitude)!==null&&p!==void 0?p:this.cameraMotion.value.latitude,fov:te}}],U).catch(Q)}var Re=this.locationMotion.setKeyframes(x,U,w);Re.then(function(){for(var Se,Te,re,ae=0,q=a.models;ae<q.length;ae++){var Ve=q[ae];Ve.show()}var Fe=k(k({},e),{mode:a.mode,longitude:a.camera.pose.longitude,latitude:a.camera.pose.latitude,fov:a.camera.pose.fov,offset:a.camera.pose.offset.clone(),distance:0});a.emit("pano.arrived",_("pano.arrived",{options:i,prevPano:j,progress:1,state:Fe,userAction:a.userAction,error:null})),i.moveEndCallback&&i.moveEndCallback(Fe);var Ie=a.works.getResolvedObserver(a.currentPano);if(Ie&&Ie.video&&a.videoTexture&&a.videoTexture.image instanceof HTMLVideoElement){var Ge=$v.clone().multiply((re=(Te=(Se=a.models.getMaterial())===null||Se===void 0?void 0:Se.pano1)===null||Te===void 0?void 0:Te.matrix)!==null&&re!==void 0?re:new d.Matrix4).multiply(Ie.video.matrix),ye={map:a.videoTexture,size:Ie.video.size,matrix:Ge,alpha:1},pe=St(),be=a.videoTexture.image;be.setAttribute("uuid",pe),Ku().then(function(ge){ge&&Ie.video&&be.getAttribute("uuid")===pe&&(be.oncanplay=function(){be.oncanplay=Q,be.play()},be.ontimeupdate=function(){be.currentTime>.5&&(be.ontimeupdate=Q,a.panoVideo.setMaterial(ye))},be.src=Ie.video.source)}).catch(function(){be.removeAttribute("uuid")})}},function(){a.emit("pano.cancel",_("pano.cancel",{options:i,prevPano:j,progress:0,state:K,userAction:a.userAction,error:null})),i.moveCancelCallback&&i.moveCancelCallback()})},t.prototype.checkSelectedPano=function(e){var r=this,i,a,o,s;this.stopMomentumMovement();var l=this.camera.getDirection(new d.Vector3).setY(0),u=null,c=this.works.getResolvedObserver(this.currentPano);if(!c)return null;var f=c.accessibleIds.filter(function(X){var W=At(X);if(Yt(W,r.currentPano))return!1;var Z=r.works.getResolvedObserver(W);return!Z||Z.position.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:Z.loadable||Z.active}),m=this.models.intersectRaycaster(e)[0];if(m){var A=dr(f,function(X){var W=r.works.getResolvedObserver(X);if(!W)return 1/0;var Z=W.standingPosition.clone();return Z.distanceTo(m.point)},!0),h=A[0],p=A[1];h&&p<this.panoTapTriggerRadius&&(u=(i=this.works.getResolvedObserver(h))!==null&&i!==void 0?i:null)}if(s0(u)){var g=this.getForwardObserverOrNot(e);g&&(u=g)}for(var v=0,y=this.locationMotion.keyframes;v<y.length;v++){var b=y[v],x=this.panoResourceFromLocationMotionKeyframe(b);if(!(b.progress<this.locationMotion.progress)&&u&&x.panoId===u.panoId){u=null;break}}if(s0(u))return this.locationMotion.ended===!0&&this.cameraBounce(),null;if(u&&!u.active){var w=u.panoId;this.panoMeshes[w]&&(this.panoMeshes[w].setDisabled(!1),this.panoMeshes[w].setLoading(!0))}var E={};if(u){for(var C=Math.PI/6,M=Math.PI/12,R=new d.Vector3(0,1,0),L=u.position.clone().setY(0).sub(c.position.clone().setY(0)).normalize(),S=L.clone().applyAxisAngle(R,C),I=L.clone().applyAxisAngle(R,-C),O=[],P=[],F=[],V=0,D=u.accessibleIds;V<D.length;V++){var h=D[V],z=At(h);if(!(Yt(z,this.currentPano)||Yt(z,u.pano))){var U=this.works.getResolvedObserver(h);if(U){var H=U.position.clone().sub(u.position).setY(0);L.angleTo(H)<C?F.push(H):S.angleTo(H)<C?O.push(H):I.angleTo(H)<C&&P.push(H)}}}var K=F.length>0?F:Et(Et([],O,!0),P,!0),j=K.slice().sort(function(X,W){return X.angleTo(L)-W.angleTo(L)})[0];j&&j.angleTo(l)>M&&(E.longitude=Math.atan2(-j.x,-j.z))}this.cameraMotion.value.latitude<-Math.PI/4&&(E.latitude=fe(0,this.minLatitude,this.maxLatitude)),this.cameraMotion.value.fov<60&&(E.fov=this.defaultFov);var J={workCode:u.pano.workCode,panoIndex:u.pano.panoIndex,mode:this.mode,longitude:(a=E.longitude)!==null&&a!==void 0?a:this.camera.pose.longitude,latitude:(o=E.latitude)!==null&&o!==void 0?o:this.camera.pose.latitude,fov:(s=E.fov)!==null&&s!==void 0?s:this.camera.pose.fov,distance:0,offset:u?u.position.clone():new d.Vector3};return this.emit("pano.select",_("pano.select",{prevPano:this.currentPano,state:J,userAction:!0,options:E,progress:0,error:null})),u&&u.active?(this.emit("pano.request",_("pano.request",{userAction:!0,prevPano:this.currentPano,progress:0,state:J,options:E,error:null})),u.pano):null},t.prototype.destroy=function(){n.prototype.destroy.call(this)},t.prototype.isReady=function(){return!1},t.prototype.updateCamera=function(e,r,i){return Promise.resolve()},t.prototype.updateCameraWithKeyframes=function(e,r,i){return Promise.resolve()},t.prototype.updateTime=function(e,r){for(var i=this,a,o,s,l,u,c,f,m,A=[],h=2;h<arguments.length;h++)A[h-2]=arguments[h];this.userAction=!0;var p={},g={},v=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),y=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),b=!1;if(this.cameraMotion.ended===!1&&(this.cameraMotion.update(e),g.longitude=this.cameraMotion.value.longitude,g.latitude=this.cameraMotion.value.latitude,g.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),p.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(fe(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var x=this.locationMotion.getKeyFrameSegment(e),w=x[0],E=x[1],C=this.panoResourceFromLocationMotionKeyframe(w),M=this.panoResourceFromLocationMotionKeyframe(E),R=new d.Vector3().copy(C.position),L=new d.Vector3().copy(M.position),S=this.locationMotion.value.count-E.value.count+1;p.progress=S,M.leftPanoPicture&&(S<1?C.leftPanoPicture&&(p.pano0=C.leftPanoPicture):p.pano0=M.leftPanoPicture,p.pano1=M.leftPanoPicture),M.effect==="montage"?p.transition="BLACK":M.effect==="spread"?p.transition="SPREAD":p.transition="FADE",(M.effect==="zoomin"||M.effect==="zoomout")&&(p.progress=Math.pow(S,3)),S<1&&M.effect!=="fly"&&(p.pano0&&C.leftPanoPicture&&(p.pano0={map:p.pano0.map,zoom:p.pano0.zoom,luminanceMap:p.pano0.luminanceMap,matrix:C.leftPanoPicture.matrix.clone().setPosition(M.position)}),R.copy(L),b=!0),g.distance=this.locationMotion.value.distance,g.offset=new d.Vector3(R.x+(L.x-R.x)*S,R.y+(L.y-R.y)*S,R.z+(L.z-R.z)*S);for(var I=[],O=[],P=0,F=this.locationMotion.keyframes;P<F.length;P++){var V=F[P],D=V.key,z=V.progress;D!==void 0&&(I.push(D),z>this.locationMotion.progress&&O.push(D))}for(var U=0,H=Object.keys(this.panoResources);U<H.length;U++){var K=H[U];if(!(O.indexOf(K)>=0)){var j=this.panoResources[K];if(j.leftPanoPicture){var J=j.leftPanoPicture.map;if(J){if(J===((a=p.pano0)===null||a===void 0?void 0:a.map)||J===((o=p.pano1)===null||o===void 0?void 0:o.map))continue;J instanceof Ne&&J.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(J.cubeRenderTarget),J.dispose(),j.leftPanoPicture=null}}I.indexOf(K)>=0||delete this.panoResources[K]}}this.currentPano=At(M.panoId),this.emit("pano.moving",_("pano.moving",{userAction:this.userAction,prevPano:At(v.panoId),state:k(k(k(k({},At(y.panoId)),{mode:this.mode}),_e(this.camera.pose)),g),options:{},progress:this.locationMotion.progress,error:null}))}Ut(p)===!1&&(!((s=p.pano0)===null||s===void 0)&&s.map&&p.pano0.map instanceof Ne&&!p.pano0.map.cubeRenderTarget&&(p.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((l=p.pano1)===null||l===void 0)&&l.map&&p.pano1.map instanceof Ne&&!p.pano1.map.cubeRenderTarget&&(p.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),this.models.setMaterial(p)),Ut(g)===!1&&this.setCamera(g);var X=this.works.getResolvedObserver(this.currentPano),W=A[1];if(!W){console.error("xrFrame丢失,请重试");return}if(!this.xrManager.session){console.error("session丢失,请重试");return}var Z=this.xrManager.referenceSpace;if(Z){var ee=this.xrManager.cameraVR,Y=this.xrManager.cameraL,ie=this.xrManager.cameraR,te=[Y,ie],le=W.getViewerPose(Z),oe=new d.Vector3(0,0,0);if(le){var xe;xe=this.xrManager.session.renderState.baseLayer;var he=le.views;if(!xe){console.error("no layer found");return}this.renderer.setFramebuffer(xe.framebuffer);var Ae=!1;he.length!==ee.cameras.length&&(ee.cameras.length=0,Ae=!0),this.parallaxCameraMatrixs=[];var Re=new d.Vector3,Se=new d.Vector3;new d.Matrix4().fromArray(he[0].transform.matrix).decompose(Re,new d.Quaternion,new d.Vector3),new d.Matrix4().fromArray(he[1].transform.matrix).decompose(Se,new d.Quaternion,new d.Vector3),Se.clone().sub(Re).normalize();var Te=new d.Vector3,re=new d.Quaternion,ae=new d.Vector3;this.camera.matrix.decompose(Te,re,ae);for(var q=0;q<he.length;q++){var Ve=he[q],Fe=xe.getViewport(Ve),Ie=te[q];Ie.matrix.fromArray(Ve.transform.matrix);var Ge=new d.Vector3,ye=new d.Quaternion,pe=new d.Vector3;Ie.matrix.decompose(Ge,ye,pe),oe.copy(Te),Ie.position.copy(Te),Ie.quaternion.copy(ye),Ie.scale.copy(pe),Ie.updateMatrix(),Ie.projectionMatrix.fromArray(Ve.projectionMatrix),Ie.viewport.set(Fe.x,Fe.y,Fe.width,Fe.height),Ae===!0&&ee.cameras.push(Ie)}if(this.xrManager.session&&this.xrManager.session.inputSources){for(var q=0;q<this.xrManager.session.inputSources.length;q++)if(this.xrManager.session.inputSources[q]&&this.xrManager.session.inputSources[q].targetRayMode==="transient-pointer"){var be=W.getPose(this.xrManager.session.inputSources[q].targetRaySpace,Z);if(be){var ge=new d.Vector3(0,0,-1).applyQuaternion(be.transform.orientation),ve=new d.Raycaster(this.camera.position,ge);this.gazeRay=ve}}}if(this.xrManager.machineType==="Oculus"||this.xrManager.machineType==="Pico"){for(var Qe=this.xrManager.session.inputSources,q=0;q<Qe.length;q++){var Ke=this.xrManager.controllers[q],rt=Qe[q];if(rt){Ke&&Ke.update(rt,W,Z);var ve=this.xrManager.getController(q),Xr=new d.Vector3(0,1.2,0),ke=ve.position.clone().add(oe).sub(Xr);rt.handedness==="left"?this.xrControllerRay.left.set(ke,new d.Vector3(0,0,-1).applyEuler(ve.rotation)):rt.handedness==="right"&&this.xrControllerRay.right.set(ke,new d.Vector3(0,0,-1).applyEuler(ve.rotation)),this.controllerWrappers[q].position.copy(new d.Vector3(0,0,0).add(oe).sub(Xr));var Ze=this.models.intersectRaycaster(this.xrControllerRay.right);if(Ze.length===0&&(Ze=this.xrControllerRay.right.intersectObject(this.boundingMesh,!0).map(function(Tr){var Yr;return k({floor:(Yr=X==null?void 0:X.floorIndex)!==null&&Yr!==void 0?Yr:0},Tr)})),Ze.length>=1&&Ze[0].face)if(rt.handedness==="right"){var st=this.xrControllerRay.right.intersectObject(this.xrCustomObjectsScene,!0),tr=Ze[0].face.normal,fn=tr.clone(),rr=Ze[0].point.clone();this.intersectMesh.position.copy(rr);var Pt=rr.clone().add(fn);if(this.intersectMesh.lookAt(Pt),Math.abs(tr.y)>.99){var nr=this.camera.position.clone().sub(rr);this.intersectMesh.rotation.z=-Math.atan2(nr.z,nr.x)}this.intersectMesh.visible=!0,this.needsRender=!0,st.length>0?(this.pointerLines.right.setPoints(ke,st[0].point),this.pointerLines.right.points.visible=!0,this.intersectMesh.visible=!1):(this.pointerLines.right.points.visible=!1,this.pointerLines.right.setPoints(ke,Ze[0].point));var Mr=Ze[0],Ht=_("intersect.update",{raycaster:(u=this.xrControllerRay.right)!==null&&u!==void 0?u:null,intersection:Mr!=null?Mr:null,object:this.intersectMesh});if(this.emit("intersect.update",Ht),Ht.defaultPrevented){this.hideIntersectMesh();return}}else this.pointerLines.left.setPoints(ke,Ze[0].point)}}this.updateControllerHelper(Qe,e,r)}if(this.camera.pose.distance>.1||b)for(var ir=0,qt=Object.keys(this.panoMeshes);ir<qt.length;ir++){var ft=qt[ir],Le=this.panoMeshes[ft];Le.setOpacity(0),Le.setCurrent(!1),Le.updateTime&&Le.updateTime(e,r),Le.visible=!1}else if(X){var hr=dr(X.visibleIds,function(ht){var jt=i.works.getResolvedObserver(ht);return jt?X.standingPosition.distanceTo(jt.standingPosition):1/0},!0),gt=hr[1];gt=fe(gt,2.5,1/0);for(var pr=X.visibleIds.concat(De(this.currentPano)),vr=this.getForwardObserverOrNot(),Gt=this.camera.getDirection(new d.Vector3),Ct=0,mr=Object.keys(this.panoMeshes);Ct<mr.length;Ct++){var ft=mr[Ct],Le=this.panoMeshes[ft],Ir=this.works.getResolvedObserver(ft);if(pr.indexOf(ft)===-1)Le.setCurrent(!1),Le.setOpacity(0);else if(!Ir)Le.setCurrent(!1),Le.setOpacity(0);else if(!Ir.loadable&&!Ir.active)Le.setCurrent(!1),Le.setOpacity(0);else{var hn=Le.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);Le.setCurrent(!Le.loading&&Le.progress===0&&vr!==null&&vr.panoId===ft),Le.setOpacity(hn<.01?0:fe(gt/hn*1.2,.65,.98));var Wr=this.camera.position.clone().setY(Le.position.y),ge=new d.Vector3().copy(Le.position).sub(Wr).normalize();if(ft===De(this.currentPano)){var Zr=fe((.5-Wr.distanceTo(Le.position))/.5,0,1);ge.multiplyScalar(1-Zr).add(Gt.clone().multiplyScalar(Zr))}ge.length()>0&&Le.quaternion.setFromEuler(new d.Euler(0,Math.atan2(ge.x,ge.z),0))}Le.updateTime&&Le.updateTime(e,r)}}var Kt=function(){return 4}(),Ye=function(){var ht=new d.PerspectiveCamera;ht.applyMatrix4(ee.matrix),ht.position.set(0,0,0);var jt=i.works.getResolvedObserver(y.panoId),Tr=jt!=null?jt:X;Tr&&ht.quaternion.premultiply(Tr.quaternion.clone().inverse()),ht.updateProjectionMatrix(),ht.updateMatrixWorld(!0);var Yr=new d.Frustum().setFromProjectionMatrix(new d.Matrix4().multiplyMatrices(ht.projectionMatrix,ht.matrixWorldInverse));return Yr}();y.panoId===De(this.currentPano)&&((c=y.leftPanoPicture)===null||c===void 0?void 0:c.map)instanceof Ne&&(y.leftPanoPicture.map.maxRequest=this.tileMaxRequest,y.leftPanoPicture.map.update(Ye,Kt),y.leftPanoPicture.map.needsRender===!0&&(this.needsRender=!0,this.modelSceneNeedsRender=!0));{var He=this.tiling.object.visible;if(this.initAnimationed){var nt=y.panoId,yt=this.works.getResolvedObserver(nt);yt?ai(this.camera.position,yt.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==nt&&this.tiling.cleanup(),this.tiling.panoId=nt,this.tiling.setResource((m=(f=yt.images)===null||f===void 0?void 0:f.tiles)!==null&&m!==void 0?m:[],this.enableIOSEDR&&yt.images.luminance?yt.images.luminance:null),this.tiling.setFetcher(it(yt.work)),this.tiling.setRotation(yt.quaternion),this.tiling.setPosition(yt.position),this.tiling.maxRequest=this.tileMaxRequest,Kt>this.TILED_CUBE_TEXTURE_LEVEL?this.tiling.update(Ye,Kt,e):this.tiling.update(Ye,0,e)):this.tiling.object.visible=!1:this.tiling.object.visible=!1}else this.tiling.object.visible=!1;He!==this.tiling.object.visible&&(this.tiling.object.needsRender=!0,this.modelSceneNeedsRender=!0)}this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e)}}},t.prototype.render=function(){var e=this.xrManager.getCamera(this.camera);this.renderer.render(this.modelScene,e),this.renderer.autoClearColor=!1,this.renderer.autoClearDepth=!1,this.renderer.render(this.scene,e),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0},t.prototype.onPanGesture=function(){},t.prototype.onTapGesture=function(){},t.prototype.onPinchGesture=function(){},t.prototype.onMouseMove=function(){},t.prototype.onMouseOut=function(){},t.prototype.panoResourceFromLocationMotionKeyframe=function(e){return this.panoResources[e.key]},t.prototype.updateControllerHelper=function(e,r,i){var a=this.xrControllerRay.left,o=this.xrControllerRay.right;if(!(!e||e.length===0)){for(var s={buttons:{X:!1,Y:!1,LeftTrigger:!1,LeftPinch:!1,A:!1,B:!1,RightTrigger:!1,RightPinch:!1}},l=0;l<e.length;l++){var u=e[l].handedness,c=e[l].gamepad;switch(u){case"left":c.axes&&(this.emitHandleEvent(c.axes[2]===-1,"LeftAxesLeft",r),this.emitHandleEvent(c.axes[2]===1,"LeftAxesRight",r),this.emitHandleEvent(c.axes[3]===-1,"LeftAxesUp",r),this.emitHandleEvent(c.axes[3]===1,"LeftAxesDown",r)),c!=null&&c.buttons&&(c.buttons[4]&&this.emitHandleEvent(c.buttons[4].pressed,"X",r),c.buttons[5]&&this.emitHandleEvent(c.buttons[5].pressed,"Y",r),c.buttons[0]&&this.emitHandleEvent(c.buttons[0].pressed,"LeftTrigger",r),c.buttons[1]&&this.emitHandleEvent(c.buttons[1].pressed,"LeftPinch",r));var f={raycaster:a,axes:{up:c.axes&&c.axes[3]<0?Math.abs(c.axes[3]):0,down:c.axes&&c.axes[3]<0?0:Math.abs(c.axes[3]),left:c.axes&&c.axes[2]<0?Math.abs(c.axes[2]):0,right:c.axes&&c.axes[2]<0?0:Math.abs(c.axes[2])},deltaTime:i};s.buttons.X=c.buttons&&c.buttons[4]?c.buttons[4].pressed:!1,s.buttons.Y=c.buttons&&c.buttons[5]?c==null?void 0:c.buttons[5].pressed:!1,s.buttons.LeftTrigger=c.buttons&&c.buttons[0]?c==null?void 0:c.buttons[0].pressed:!1,s.buttons.LeftPinch=c.buttons&&c.buttons[1]?c==null?void 0:c.buttons[1].pressed:!1,s.left=f;break;case"right":c.axes&&(this.emitHandleEvent(c.axes[2]===-1,"RightAxesLeft",r),this.emitHandleEvent(c.axes[2]===1,"RightAxesRight",r),this.emitHandleEvent(c.axes[3]===-1,"RightAxesUp",r),this.emitHandleEvent(c.axes[3]===1,"RightAxesDown",r)),c.buttons&&(c.buttons[4]&&this.emitHandleEvent(c.buttons[4].pressed,"A",r),c.buttons[5]&&this.emitHandleEvent(c.buttons[5].pressed,"B",r),c.buttons[0]&&this.emitHandleEvent(c.buttons[0].pressed,"RightTrigger",r),c.buttons[1]&&this.emitHandleEvent(c.buttons[1].pressed,"RightPinch",r));var m={raycaster:o,axes:{up:c.axes&&c.axes[3]<0?Math.abs(c.axes[3]):0,down:c.axes&&c.axes[3]<0?0:Math.abs(c.axes[3]),left:c.axes&&c.axes[2]<0?Math.abs(c.axes[2]):0,right:c.axes&&c.axes[2]<0?0:Math.abs(c.axes[2])},deltaTime:i};s.right=m,s.buttons.A=c.buttons&&c.buttons[4]?c==null?void 0:c.buttons[4].pressed:!1,s.buttons.B=c.buttons&&c.buttons[5]?c==null?void 0:c.buttons[5].pressed:!1,s.buttons.RightTrigger=c.buttons&&c.buttons[0]?c==null?void 0:c.buttons[0].pressed:!1,s.buttons.RightPinch=c.buttons&&c.buttons[1]?c==null?void 0:c.buttons[1].pressed:!1;break}}this.emit("xr.controller.update",_("xr.controller.update",s))}},t.prototype.emitHandleEvent=function(e,r,i){var a=this.xrControllerRay.left,o=this.xrControllerRay.right;if(e)if(this.xrHandleState[r].touchStart===!1)this.xrHandleState[r].touchStartTime=i,this.xrHandleState[r].touchStart=!0,this.emit("xr.gesture.buttonDown",_("xr.gesture.buttonDown",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!1,isFirst:!0,controllers:{raycaster:{leftRay:a,rightRay:o}}}));else{var s=i-this.xrHandleState[r].touchStartTime;s>f0&&this.emit("xr.gesture.press",_("xr.gesture.tap",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!0,controllers:{raycaster:{leftRay:a,rightRay:o}}}))}else if(this.xrHandleState[r].touchStart===!0){this.emit("xr.gesture.buttonUp",_("xr.gesture.buttonUp",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:a,rightRay:o}}}));var s=i-this.xrHandleState[r].touchStartTime;if(s<=f0){var l=_("xr.gesture.tap",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:a,rightRay:o}}}),u=this.emit("xr.gesture.tap",l);!u&&!l.defaultPrevented&&r==="RightTrigger"&&this.checkSelectedPano(this.xrControllerRay.right)}this.xrHandleState[r].touchStart=!1,this.xrHandleState[r].touchStartTime=0}},t.prototype.initHandEvent=function(){var e=this;if(!this.xrManager.session)throw new Error("初始化失败");this.xrManager.session.addEventListener("select",function(r){e.gazeRay&&e.checkSelectedPano(e.gazeRay)})},t}(Ro),Ft={Floorplan:eo,Topview:Mp,Panorama:Ro,VRPanorama:yv,Model:xv,Mapview:Fv,XRPanorama:em},il=["gesture.pan","gesture.tap","gesture.dbltap","gesture.press","gesture.pinch","gesture.mousewheel","gesture.mousemove","gesture.momentum","initAnimation.start","initAnimation.end","camera.update","intersect.update","pano.select","pano.moveTo","pano.moving","pano.arrived","pano.cancel","pano.error","pano.texture.load","pano.texture.progress","pano.texture.success","pano.texture.error","pano.texture.abort","xr.session.start","xr.session.end","xr.gesture.tap","xr.gesture.press","xr.gesture.buttonUp","xr.gesture.buttonDown","xr.controller.update"];function tm(n){n.on("initAnimation.start",function(t){n.emit("initAnimationWillStart",t.state.panoIndex,t.state,t.userAction)}),n.on("initAnimation.end",function(t){n.emit("initAnimationEnded",t.state.panoIndex,t.state,t.userAction)}),n.on("gesture.pan",function(t){var e=!1;e=n.emit("wantsGesture","pan",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsPanGesture",t.state,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","pan",t.pointers,t.isFinal),n.emit("panGesture",t.state,t.isFinal))}),n.on("gesture.tap",function(t){var e=!1;e=n.emit("wantsGesture","tap",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsTapGesture",t.center.raycaster,t.center.coords,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","tap",t.pointers,t.isFinal),n.emit("tapGesture",t.center.raycaster,t.center.coords,t.isFinal))}),n.on("gesture.dbltap",function(t){var e=!1;e=n.emit("wantsGesture","dbltap",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsDblTapGesture",t.center.raycaster,t.center.coords,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","dbltap",t.pointers,t.isFinal),n.emit("dblTapGesture",t.center.raycaster,t.center.coords,t.isFinal))}),n.on("gesture.press",function(t){var e=!1;e=n.emit("wantsGesture","press",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsPressGesture",t.center.raycaster,t.center.coords,t.center.delta,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","press",t.pointers,t.isFinal),n.emit("pressGesture",t.center.raycaster,t.center.coords,t.center.delta,t.isFinal))}),n.on("gesture.pinch",function(t){var e=!1;e=n.emit("wantsGesture","pinch",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsPinchGesture",t.scale,t.state.fov,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","pinch",t.pointers,t.isFinal),n.emit("pinchGesture",t.scale,t.state.fov,t.isFinal))}),n.on("gesture.mousewheel",function(t){var e=!1;e=n.emit("wantsGesture","mouseWheel",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsMouseWheel",t.center.delta,t.state.fov,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","mouseWheel",t.pointers,t.isFinal),n.emit("mouseWheel",t.center.delta,t.state.fov,t.isFinal))}),n.on("gesture.mousemove",function(t){var e=!1;e=n.emit("wantsGesture","mouseMove",t.pointers,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","mouseMove",t.pointers,t.isFinal),e=n.emit("wantsChangeCameraFov",t.state.fov),e&&t.preventDefault())}),n.on("gesture.momentum",function(t){var e=!1;e=n.emit("wantsInteriaPan",t.state),e&&t.preventDefault(),t.defaultPrevented||n.emit("interiaPan",t.state,t.isFinal)}),n.on("camera.update",function(t){n.emit("cameraFovUpdate",t.state.fov,t.userAction),n.emit("cameraDirectionUpdate",t.state,t.userAction);var e=Nt(t.state);e.setLength(t.state.distance);var r=t.state.offset.clone().sub(e);n.emit("cameraPositionUpdate",r,t.userAction),n.emit("cameraUpdate",t.state,t.userAction)}),n.on("intersect.update",function(t){if(t.intersection){var e=!1;e=n.emit("wantsShowIntersectionOnModel",t.raycaster),e&&t.preventDefault(),t.defaultPrevented||n.emit("intersectionOnModelUpdate",t.intersection,t.object)}else n.emit("intersectionHidden")}),n.on("pano.request",function(t){var e=n.emit("wantsMoveToPano",t.state.panoIndex,t.options,t.userAction);e||(e=n.emit("wantsToMoveToPano",t.state.panoIndex,t.options,t.userAction)),e&&t.preventDefault(),t.defaultPrevented||n.emit("panoWillLoad",t.state.panoIndex)}),n.on("pano.select",function(t){n.emit("panoSelected",t.state.panoIndex)}),n.on("pano.moveTo",function(t){n.emit("panoLoaded",t.state.panoIndex),n.emit("moveToPano",t.state.panoIndex,t.userAction),n.emit("panoWillArrive",t.state.panoIndex,t.state,t.userAction)}),n.on("pano.moving",function(t){n.emit("movingToPano",t.state.panoIndex,t.prevPano.panoIndex,t.progress)}),n.on("pano.arrived",function(t){n.emit("panoArrived",t.state.panoIndex,t.state,t.userAction)}),n.on("pano.cancel",function(t){n.emit("moveToPanoCanceled",t.state.panoIndex)}),n.on("pano.error",function(t){n.emit("panoLoadError",t.error,t.state.panoIndex)}),n.on("pano.texture.load",function(t){n.emit("textureStartLoad",t.pano.panoIndex)}),n.on("pano.texture.success",function(t){n.emit("textureLoaded",t.pano.panoIndex,t.meta)}),n.on("pano.texture.error",function(t){n.emit("textureError",t.error,t.pano.panoIndex)}),n.on("pano.texture.abort",function(t){n.emit("textureAbort",t.pano.panoIndex)}),n.on("pano.texture.progress",function(t){n.emit("textureLoading",t.progress,t.pano.panoIndex)}),n.on("xr.session.start",function(t){n.emit("webXRSessionStart")}),n.on("xr.session.end",function(t){n.emit("webXRSessionEnd")}),n.on("xr.gesture.tap",function(t){n.emit("webXRControllerEvent","tap",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.gesture.press",function(t){n.emit("webXRControllerEvent","press",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.gesture.buttonUp",function(t){n.emit("webXRControllerEvent","buttonUp",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.gesture.buttonDown",function(t){n.emit("webXRControllerEvent","buttonDown",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.controller.update",function(t){n.emit("webXRControllerRayUpdate",{leftRay:t.left?t.left.raycaster:void 0,rightRay:t.right?t.right.raycaster:void 0}),t.left&&n.emit("webXRAxesUpdate","left",{raycaster:{leftRay:t.left?t.left.raycaster:void 0,rightRay:t.right?t.right.raycaster:void 0},axesState:{up:t.left.axes.up,down:t.left.axes.down,left:t.left.axes.left,right:t.left.axes.right},deltaTime:t.left.deltaTime}),t.right&&n.emit("webXRAxesUpdate","right",{raycaster:{leftRay:t.left?t.left.raycaster:void 0,rightRay:t.right?t.right.raycaster:void 0},axesState:{up:t.right.axes.up,down:t.right.axes.down,left:t.right.axes.left,right:t.right.axes.right},deltaTime:t.right.deltaTime})}),n.on("works.request",function(t){n.emit("willLoad",t.input,t.works[0],t.state)}),n.on("works.load",function(t){n.emit("load",t.input,t.works[0],t.state)}),n.on("works.ready",function(t){n.emit("loaded",t.input,t.works[0])}),n.on("state.change",function(t){n.emit("stateChange",t.state,t.userAction)}),n.on("currentState.change",function(t){n.emit("currentStateChange",t.state,t.userAction)}),n.on("state.set",function(t){n.emit("setState",t.state)}),n.on("state.synced",function(t){n.emit("stateSynced",t.state)}),n.on("model.request",function(t){n.emit("modelWillLoad",t.work.model)}),n.on("model.error",function(t){n.emit("modelLoadError",t.error,t.model)}),n.on("model.load",function(t){n.emit("modelLoaded",t.model)}),n.on("model.changeShownFloor",function(t){n.emit("modelShownFloorChange",t.model.shownFloor,t.model.floorLength)}),n.on("render",function(t){n.emit("renderFrame",t.needsRender)}),n.on("mode.change.request",function(t){n.emit("wantsChangeMode",t.mode,t.prevMode)}),n.on("mode.change",function(t){n.emit("modeChange",t.mode,t.prevMode,t.state.panoIndex,t.state,t.userAction)}),n.on("helpers.visible",function(t){n.emit("helpersVisibleChange",t.object.visible)}),n.on("network.resource",function(t){n.emit("network",t.source,t.requestType,t.requestState,t.detail)})}function rm(){if(typeof window!="undefined"){var n=document.createElement("video");n.loop=!0,n.autoplay=!0,n.playsInline=!0,n.muted=!0,n.crossOrigin="";var t=function(){document.removeEventListener("touchstart",t,!1),document.removeEventListener("mousedown",t,!1),n.muted=!1};return document.addEventListener("touchstart",t,!1),document.addEventListener("mousedown",t,!1),n}else return{}}function p0(n){{var t=new d.DirectionalLight(16777215,.3);t.position.copy(new d.Vector3(1,1,1)),n.add(t)}{var t=new d.DirectionalLight(16777215,.1);t.position.copy(new d.Vector3(-1,-1,-1)),n.add(t)}{var t=new d.DirectionalLight(16777215,.1);n.add(t)}{var t=new d.AmbientLight(16777215,.6);n.add(t)}}function nm(n){for(var t,e,r={},i=n.split(/(\;|\,)/),a=0,o=i;a<o.length;a++){var s=o[a],l=s.split("="),u=(t=l[0])===null||t===void 0?void 0:t.trim(),c=(e=l[1])===null||e===void 0?void 0:e.trim();u&&c&&(r[u]=c)}return r}function al(){var n;if(typeof document!="undefined")for(var t=document.getElementsByTagName("meta"),e=0;e<t.length;e++){var r=t[e];if(r.getAttribute("name")==="viewport"){var i=nm((n=r.getAttribute("content"))!==null&&n!==void 0?n:""),a=Number(i["initial-scale"]);if(!isNaN(a))return a}}return 1}const im="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAV8AAAA/CAQAAADtPwPkAAAR+0lEQVR4AezYg3LEQACH8d1cbdu23Q5qG9G47z/TN/h6tn2b/H+TUTLc7yjcOXV46OUAnUs6EbUp022ZBXc1NhoZYYd7fjDRvdcHAwrlK2QBVJ4sgoqONmY45RUT23sZ6H42F2hK5CtkMbjhZlDmUUcvq1zyieUVyjbE4I1GBfItwxG56YaUZTQwyh4P6NgJ4YYYvCuQb5kOyI03pORjiqe4Lwpq5pt1vJqfUwKWJVbSMYfppYconG+maNNQOWBZuwHTzicGel75NtFOkxr5apmV8cikcko0DrDQs863AeGl0cE0+1xy573m0/wf0cEKW6H7BWtggiMG8sy3oHRDpJMw4NWb6am/bv9znkqEzjd61t5oo5clTrjhwevO75EJRBKSRt745Z16ZEjcM73sccZplBPm8PyTcxZAkSRdHm/acJ0Z3JZhHB0BxqDHgWFZFmm0ZbCw87twI/zc3e/Cz93vPneXtU/WdQS3oTviXdY/q5PsJKfoGuQjZuO/0in1qsj85cu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Ma2xH4YZdZumSOwsVzFeBWdr37tpIhOpSwXqONNgZq/2KgvBt54znHN1HzlljTO4oVD5fb+prNIJXQNL1ofDKQisbPLJDv3jNSLq9OkYBEIihKIj3v7S1TRQCX5Kdl1ZQlol7LF+E++fwirfiq2sf4cTXxc6hzxffPuLEeqSWrPGWMF58TWr5viyJAP5/4EV4KePiaSE8eNRgjDy8/tyRW+FZjhS+2tlovNJovtJovNJ0uhK6Wo64SDdxEbM//KesjwAAAABJRU5ErkJggg==";var v0=[351,63],m0=[20,20],am=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),om=new Float32Array([0,0,1,0,0,1,1,1]),sm=new Uint8Array([0,1,2,1,3,2]),ji=new d.BufferGeometry;ji.setAttribute("position",new d.BufferAttribute(am,3));ji.setAttribute("uv",new d.BufferAttribute(om,2));ji.setIndex(new d.BufferAttribute(sm,1));var Ii=new d.MeshBasicMaterial({transparent:!0,depthTest:!1,depthWrite:!1,stencilWrite:!1,fog:!1}),ol=new d.Mesh(ji,Ii);ol.matrixAutoUpdate=!1;var Vo=new d.Scene;Vo.add(ol);Vo.matrixAutoUpdate=!1;var oi=new d.OrthographicCamera(-.5,.5,.5,-.5,.1,1);oi.position.set(0,0,.5);oi.lookAt(0,0,0);oi.updateMatrixWorld(!0);oi.matrixAutoUpdate=!1;var um=new d.Vector4,lm=new d.Vector4;function cm(n){if(Ii.map){var r=n.getViewport(um),i=n.getScissor(lm),a=n.getScissorTest(),o=n.autoClear,s=i.x+m0[0]/3,l=i.y+m0[1]/3,u=v0[0]/3,c=v0[1]/3;n.setViewport(s,l,u,c),n.setScissor(s,l,u,c),n.setScissorTest(!0),n.autoClear=!1,n.render(Vo,oi),n.setViewport(r),n.setScissor(i),n.setScissorTest(a),n.autoClear=o}else{var t=new d.Texture,e=new Image;e.onload=function(){t.image=e,t.wrapS=d.ClampToEdgeWrapping,t.wrapT=d.ClampToEdgeWrapping,t.minFilter=d.LinearFilter,t.needsUpdate=!0,t.generateMipmaps=!1,Ii.needsUpdate=!0,e.onload=Q},e.src=im,Ii.map=t}}var dm=800,A0=90,fm=function(n){return n.replace("//vrlab-public.ljcdn.com/","//vr-public.realsee-cdn.cn/").replace("//vrlab-image4.ljcdn.com/","//vr-image-4.realsee-cdn.cn/").replace("//vrlab-image3.ljcdn.com/","//vr-image-3.realsee-cdn.cn/").replace("//vrlab-image2.ljcdn.com/","//vr-image-2.realsee-cdn.cn/").replace("//vrlab-image1.ljcdn.com/","//vr-image-1.realsee-cdn.cn/")},hm=new d.Vector2,Ai=new d.Frustum,gi=new d.Matrix4,g0=new WeakMap,La=new WeakMap,y0=Xa([]),sl=function(n){se(t,n);function t(e){e===void 0&&(e={});var r,i,a,o,s,l,u,c,f,m,A,h=n.call(this)||this;if(h.ident=St(),typeof window!="undefined"&&(ro.instances[h.ident]=h),h.renderSwitch01=0,h.currentMode="Panorama",h.pano={workCode:"",panoIndex:0},h.needsRender=!1,h.modelSceneNeedsRender=!1,h.onlyRenderIfNeeds=(r=e.onlyRenderIfNeeds)!==null&&r!==void 0?r:!0,h.imageOptions=k({},(i=e.imageOptions)!==null&&i!==void 0?i:{}),h.textureOptions=k({},(a=e.textureOptions)!==null&&a!==void 0?a:{}),h.poweredByRealsee=(o=e.poweredByRealsee)!==null&&o!==void 0?o:!0,h.extraElements=[],h.controllerInits={Panorama:Object.assign({},e.panorama),Model:Object.assign({},e.model),Floorplan:Object.assign({},e.floorplan),Topview:Object.assign({},e.topview),Mapview:Object.assign({},e.mapview),VRPanorama:Object.assign({},e.vrPanorama),XRPanorama:Object.assign({},e.xrPanorama)},h.fps={testCount:0,testTime:Ee()},h.info=null,h.modeChangeDuration=(s=e.modeChangeDuration)!==null&&s!==void 0?s:dm,h.enableWheel=(l=e.enableWheel)!==null&&l!==void 0?l:!0,typeof window!="undefined")if("renderer"in e)e.renderer instanceof nn&&h.throwError(new Error("cannot render a internal renderer")),h.renderer=e.renderer;else try{h.renderer=new nn({preserveDrawingBuffer:e.preserveDrawingBuffer,backgroundColor:e.backgroundColor,backgroundAlpha:e.backgroundAlpha,antialias:e.antialias,webgl2:e.webgl2,logarithmicDepthBuffer:e.logarithmicDepthBuffer,precision:e.precision});var p=al();h.renderer.setPixelRatio(p===1?window.devicePixelRatio:1),h.renderer.setSize(512,512)}catch(L){L instanceof Error&&h.throwError(L)}h.getPixelsRenderTarget=new d.WebGLRenderTarget(1,1,{encoding:(c=(u=h.renderer)===null||u===void 0?void 0:u.outputEncoding)!==null&&c!==void 0?c:d.sRGBEncoding,generateMipmaps:!1});var g=new d.DepthTexture(1,1);g.generateMipmaps=!1,g.format=d.DepthStencilFormat,g.type=d.UnsignedInt248Type,h.modelRenderTarget=new d.WebGLRenderTarget(1,1,{encoding:(m=(f=h.renderer)===null||f===void 0?void 0:f.outputEncoding)!==null&&m!==void 0?m:d.sRGBEncoding,depthTexture:g,generateMipmaps:!1,depthBuffer:!0,stencilBuffer:!0}),h.scissor=Object.assign({left:0,bottom:0,width:1,height:1},e.scissor),h.camera=new z0(A0),h.scene=new D0,h.xrCustomObjectsScene=new d.Scene,h.scene.add(h.xrCustomObjectsScene),h.scene.matrixAutoUpdate=!1,h.lastLoadWorkTask=Promise.resolve(),h.requestProxy=(A=e.requestProxy)!==null&&A!==void 0?A:fm,h.networkSubscribe=new I0,h.networkSubscribe.on("network",function(L,S,I,O){var P;h.emit("network.resource",_("network.resource",{source:L,requestType:S,requestState:I,detail:O})),(P=h.analysis)===null||P===void 0||P.network(h.works,L,S,I,O)}),h.boundingMesh=cp(new d.Box3(new d.Vector3(-.5,-.5,-.5),new d.Vector3(.5,.5,.5))),h.boundingMesh.name="bounding",h.models=Us(),h.models.push(new Za),h.lastModels=Us(),h.lastWorks=Xa([]),h.readyCallbacks=[],h.syncingState=!1,h.helperGroup=new d.Group,h.helperGroup.name="helper",h.helperGroup.matrixAutoUpdate=!1,h.scene.add(h.helperGroup),h.modelGroup=new d.Group,h.modelGroup.visible=!1,h.modelGroup.name="model",h.modelGroup.matrixAutoUpdate=!1,h.modelScene=new d.Scene,h.modelScene.add(h.modelGroup),h.modelScene.add(h.boundingMesh),h.modelScene.matrixAutoUpdate=!1,h.videoTexture=new d.VideoTexture(e.videoInstance||rm()),p0(h.scene),p0(h.modelScene),h.state={mode:h.currentMode,workCode:h.pano.workCode,panoIndex:h.pano.panoIndex,longitude:h.camera.pose.longitude,latitude:h.camera.pose.latitude,fov:h.camera.pose.fov,offset:h.camera.pose.offset.clone(),distance:h.camera.pose.distance},h.stateSynced=!1,h._enablePostProcessing=!1,h._enableIOSEDR=!1,h._enableEDL=!1,h._enableHQ=!1,h.destroyed=!1,h.paused=!0,typeof window!="undefined"&&(e.play!==!1&&h.play(),h.stopAnimationLoop=dt.shared.add(function(L,S){for(var I=[],O=2;O<arguments.length;O++)I[O-2]=arguments[O];h.updateTime.apply(h,Et([L,S],I,!1))},!1,0,10));var v=function(){typeof document!="undefined"&&document.fullscreenElement===null&&h.currentMode==="VRPanorama"&&h.controller.emit("vr.requestExit",_("vr.requestExit",{}))},y=function(){h.needsRender=!0,h.modelSceneNeedsRender=!0};if(typeof document!="undefined"&&document.addEventListener("fullscreenchange",v,!1),h.renderer&&h.renderer.domElement.addEventListener("webglcontextrestored",y,!1),h.removeEventListeners=function(){typeof document!="undefined"&&document.removeEventListener("fullscreenchange",v,!1),h.renderer&&h.renderer.domElement.removeEventListener("webglcontextrestored",y,!1)},h.plugins={},e.plugins&&e.plugins.length)for(var b=0,x=e.plugins;b<x.length;b++){var w=x[b];if(typeof w=="function")w(h);else if(Array.isArray(w)){var E=w[0],C=w[1],M=w[2];if(typeof E=="function"){var R=E(h,M);typeof C=="string"&&(h.plugins[C]?h.throwError(new Error("plugin name ".concat(C," is exists."))):h.plugins[C]=R)}}}return h.gpuPickingRenderTarget=new d.WebGLRenderTarget(1,1,{generateMipmaps:!1}),h.meshReplaceMaterialMap=new Map,h.meshOriginMaterialMap=new Map,tm(h),h}return Object.defineProperty(t,"version",{get:function(){return"6.3.0-alpha.11"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"dracoPath",{get:function(){return Oi.decoderPath},set:function(e){Oi.setDecoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t,"ktx2Path",{get:function(){return Kn.transcoderPath},set:function(e){Kn.setTranscoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"panoIndex",{get:function(){return this.pano.panoIndex},enumerable:!1,configurable:!0}),t.prototype.getGPUPicking=function(e,r,i,a,o){var s=this;if(a===void 0&&(a=1),o===void 0&&(o=new d.Vector3(0,0,0)),!this.renderer)throw new Error("renderer is not initialized.");this.models.setMaterial({constantColor:o}),this.scene.traverse(function(f){if(!(!(f instanceof d.Mesh)||f instanceof Tt)){var m=Object.keys(i).filter(function(h){return h===f.uuid})[0];if(m)if(s.meshOriginMaterialMap.set(m,f.material),s.meshReplaceMaterialMap.get(m))f.material=s.meshReplaceMaterialMap.get(m);else{var A=new d.ShaderMaterial({uniforms:{color:{value:i[m]}},vertexShader:`
|
|
2166
2166
|
void main() {
|
|
2167
2167
|
vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
|
|
2168
2168
|
gl_Position = projectionMatrix * mvPosition;
|
|
@@ -2172,4 +2172,4 @@ void main() {
|
|
|
2172
2172
|
void main() {
|
|
2173
2173
|
gl_FragColor = vec4( color, 1.0 );
|
|
2174
2174
|
}
|
|
2175
|
-
`});A.depthTest=f.material.depthTest,A.side=f.material.side,s.meshReplaceMaterialMap.set(m,A),f.material=A}}});var l=this.renderer.getSize(new d.Vector2);this.camera.setViewOffset(l.width,l.height,e*a,r*a,1,1),this.renderer.setRenderTarget(this.gpuPickingRenderTarget),this.render();var u=new Uint8Array(4);this.renderer.readRenderTargetPixels(this.gpuPickingRenderTarget,0,0,1,1,u),this.renderer.setRenderTarget(null),this.camera.clearViewOffset(),this.scene.traverse(function(f){!(f instanceof d.Mesh)||f instanceof Tt||s.meshOriginMaterialMap.get(f.uuid)&&(f.material=s.meshOriginMaterialMap.get(f.uuid))}),this.models.setMaterial({constantColor:null});var c=Object.keys(i).filter(function(f){return i[f].equals(new d.Color().setRGB(u[0]/255,u[1]/255,u[2]/255))})[0];return c||!1},t.prototype.dispose=function(){var e,r;if(this.destroyed!==!0){delete ro.instances[this.ident],this.emit("dispose"),this.destroyed=!0,this.pause(),this.stopAnimationLoop&&(this.stopAnimationLoop(),delete this.stopAnimationLoop),(e=this.renderer)===null||e===void 0||e.setAnimationLoop(null),this.off(),this.networkSubscribe.off(),this.controller&&(this.controller.destroy(),this.controller=void 0);var i=this.getElement();i&&i.parentNode&&i.parentNode.removeChild(i);var a=this.models.getMaterial();a&&(a.pano0&&a.pano0.map.dispose(),a.pano1&&a.pano1.map!==((r=a.pano0)===null||r===void 0?void 0:r.map)&&a.pano1.map.dispose());for(var o=0,s=this.models;o<s.length;o++){var l=s[o];l.dispose()}this.models.length=0,this.models.setMaterial({pano0:null,pano1:null}),this.meshReplaceMaterialMap.forEach(function(u){u.dispose()}),this.meshOriginMaterialMap.forEach(function(u){u.dispose()}),this.renderer instanceof nn&&this.renderer.forceContextLoss&&this.renderer.forceContextLoss()}},t.prototype.setScissor=function(e){var r;if(Object.assign(this.scissor,e),this.controller&&this.controller.updateRenderSize){var i=new d.Vector2;(r=this.renderer)===null||r===void 0||r.getDrawingBufferSize(i),this.controller.updateRenderSize(i)}},Object.defineProperty(t.prototype,"helperVisible",{get:function(){return this.helperGroup.visible},set:function(e){this.helperGroup.visible!==e&&(this.helperGroup.visible=e,this.emit("helpers.visible",_("helpers.visible",{object:this.helperGroup})),this.needsRender=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableIOSEDR",{get:function(){return this._enableIOSEDR},set:function(e){this._enableIOSEDR!==e&&(this._enableIOSEDR=e,this.currentMode&&this.currentMode==="Panorama"&&this.changeMode(this.currentMode,this.getCurrentState(),0,!1,!0))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"postProcessingType",{get:function(){return this.currentMode==="Panorama"&&this.enableIOSEDR&&this.enablePostProcessing?"luminance":this.currentMode==="Mapview"&&this.enableEDL?"edl":this.currentMode==="Mapview"&&this.enableHQ?"hq":null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableEDL",{get:function(){return this._enableEDL},set:function(e){if(e===!0&&this.currentMode!==t.Mode.Mapview)throw new Error("只支持Mapview下开启EDL");this._enableEDL!==e&&(this._enableEDL=e,this.boundingMesh.visible=!e,this.needsRender=!0,this.modelSceneNeedsRender=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableHQ",{get:function(){return this._enableHQ},set:function(e){if(e===!0&&this.currentMode!==t.Mode.Mapview)throw new Error("只支持Mapview下开启HQ");this._enableHQ!==e&&(this._enableHQ=e,this.boundingMesh.visible=!e,this.needsRender=!0,this.modelSceneNeedsRender=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enablePostProcessing",{get:function(){return this._enablePostProcessing},set:function(e){this._enablePostProcessing!==e&&(this._enablePostProcessing=e),this.needsRender=!0,this.modelSceneNeedsRender=!0},enumerable:!1,configurable:!0}),t.prototype.updateConfiguration=function(e,r){r===void 0&&(r=!0);var i=!1;e.panorama&&(Object.assign(this.controllerInits.Panorama,e.panorama),this.currentMode==="Panorama"&&(i=!0)),e.model&&(Object.assign(this.controllerInits.Model,e.model),this.currentMode==="Model"&&(i=!0)),e.floorplan&&(Object.assign(this.controllerInits.Floorplan,e.floorplan),this.currentMode==="Floorplan"&&(i=!0)),e.topview&&(Object.assign(this.controllerInits.Topview,e.topview),this.currentMode==="Topview"&&(i=!0)),e.mapview&&(Object.assign(this.controllerInits.Mapview,e.mapview),this.currentMode==="Mapview"&&(i=!0)),e.vrPanorama&&(Object.assign(this.controllerInits.VRPanorama,e.vrPanorama),this.currentMode==="VRPanorama"&&(i=!0)),e.imageOptions&&(Object.assign(this.imageOptions,e.imageOptions),(this.currentMode==="Panorama"||this.currentMode==="VRPanorama")&&(i=!0)),e.textureOptions&&Object.assign(this.textureOptions,e.textureOptions),r&&i&&this.controller&&this.currentMode&&this.changeMode(this.currentMode,this.getCurrentState(),0,!1,!0)},t.prototype.appendTo=function(e,r){if(r===void 0&&(r={}),!!this.renderer){if(!(this.renderer instanceof nn)){this.throwError(new Error("cannot call appendTo method when render a external renderer"));return}var i=this.getElement();if(i){e.appendChild(i),this.refresh(r);var a=window.getComputedStyle(e).position;a!=="relative"&&a!=="absolute"&&a!=="fixed"&&a!=="sticky"&&(e.style.position="relative")}}},t.prototype.refresh=function(e,r){if(e===void 0&&(e={}),!!this.renderer){var i=this.getElement();if(i){var a=i.parentNode;if(a&&a.nodeName){var o=e.width,s=o===void 0?a.offsetWidth:o,l=e.height,u=l===void 0?a.offsetHeight:l;this.renderer instanceof nn&&(r&&this.renderer.setPixelRatio(r),this.renderer.setSize(s,u))}var c=new d.Vector2;if(this.renderer.getDrawingBufferSize(c),this.controller&&this.controller.updateRenderSize&&this.controller.updateRenderSize(c),this.modelRenderTarget.width!==c.x||this.modelRenderTarget.height!==c.y){this.modelRenderTarget.setSize(c.x,c.y),this.modelRenderTarget.depthTexture.dispose();var f=new d.DepthTexture(c.x,c.y);f.generateMipmaps=!1,f.format=d.DepthStencilFormat,f.type=d.UnsignedInt248Type,this.modelRenderTarget.depthTexture=f,this.modelRenderTarget.depthTexture.needsUpdate=!0}this.needsRender=!0,this.modelSceneNeedsRender=!0,this.render(Q,!0)}}},t.prototype.addExtraElement=function(e){var r=this;return this.extraElements.indexOf(e)===-1&&(this.extraElements.push(e),this.controller&&this.controller.bindExtraElement(e)),function(){return r.removeExtraElement(e)}},t.prototype.removeExtraElement=function(e){var r=this.extraElements.indexOf(e);r!==-1&&(this.extraElements.splice(r,1),this.controller&&this.controller.unbindExtraElement(e))},t.prototype.getPose=function(){var e=this.camera.copyPose(),r=e.longitude,i=e.latitude,a=e.fov,o=e.offset,s=e.distance;return{longitude:r,latitude:i,fov:a,offset:o.clone(),distance:s}},t.prototype.getSize=function(e){if(!this.renderer)throw new Error("renderer is not initialized");return this.renderer.getSize(e),e.x*=this.scissor.width,e.y*=this.scissor.height,e},t.prototype.getDrawingBufferSize=function(e){if(!this.renderer)throw new Error("renderer is not initialized");return this.renderer.getDrawingBufferSize(e),e.x*=this.scissor.width,e.y*=this.scissor.height,e},t.prototype.updateCamera=function(e,r,i){return i===void 0&&(i=!0),this.controller?this.controller.updateCamera(e,r,i):Promise.reject(new Error("controller is not initialized."))},t.prototype.updateCameraWithKeyframes=function(e,r,i){return i===void 0&&(i=!0),this.controller?this.controller.updateCameraWithKeyframes(e,r,i):Promise.reject(new Error("controller is not initialized."))},t.prototype.getLongitudeAndLatitude=function(){var e=this.getPose(),r=e.longitude,i=e.latitude;return{longitude:r,latitude:i}},t.prototype.getOffset=function(){return this.getPose().offset},t.prototype.getCameraLocal=function(){if(this.pano.workCode&&this.controller&&this.works){var e=this.works.getResolvedObserver(this.pano);if(e){var r=new d.Object3D;return r.position.copy(e.position),r.quaternion.copy(e.quaternion),r.scale.set(1,1,1),r.matrix.compose(r.position,r.quaternion,r.scale),r.matrixAutoUpdate=!1,dp(this.camera,r)}}return null},Object.defineProperty(t.prototype,"works",{get:function(){var e=La.get(this);if(!e)return y0;for(var r=0,i=e;r<i.length;r++){var a=i[r];if(!xo.has(a))return y0}return e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"work",{get:function(){return this.works[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"model",{get:function(){return this.models[0]},enumerable:!1,configurable:!0}),t.prototype.load=function(e,r,i,a){var o=this;if(a===void 0&&(a=!0),!this.renderer)throw new Error("renderer is not initialized");var s=this.lastLoadWorkTask.then(function(){return hp(e)?e.then(function(l){return o.load_(l,r,i,a)}):o.load_(e,r,i,a)});return this.lastLoadWorkTask=s.catch(function(l){o.throwError(l)}),s},t.prototype.load_=function(e,r,i,a){var o=this,s,l,u,c,f,m,A,h,p;a===void 0&&(a=!0);var g={};typeof i=="number"?g.duration=i:typeof i=="object"&&Object.assign(g,i),this.controller||(g.duration=0,g.effect="instant");var v=[];if(Array.isArray(e))for(var y=0,b=e;y<b.length;y++){var x=b[y];typeof x!="string"&&"work"in x?v.push(jn(x.work,x)):v.push(jn(x))}else v.push(jn(e));for(var w=Xa(v),E=function(W){var Z=C,ee=new co({allowHosts:W.allowHosts,get requestProxy(){return Z.requestProxy},get networkSubscribe(){return Z.networkSubscribe}});jh(W,ee)},C=this,M=0,R=w;M<R.length;M++){var L=R[M];E(L)}this.lastWorks=this.works,r===void 0&&(r="inherit"),r==="inherit"&&this.lastWorks.length===0&&(r="initial");var S=w.initial,I=S.work.observers[0],O=I?{workCode:I.work.workCode,panoIndex:I.panoIndex}:{workCode:S.work.workCode,panoIndex:0},P=(s=S.mode)!==null&&s!==void 0?s:I?"Panorama":"Mapview",F={};if(r==="inherit"){P=this.currentMode;var V=w.resolvedObservers[this.panoIndex];V?O={workCode:V.work.workCode,panoIndex:V.panoIndex}:typeof w.initial.panoIndex=="number"?O={workCode:w.initial.work.workCode,panoIndex:w.initial.panoIndex}:(P==="Panorama"||P==="VRPanorama"||P==="XRPanorama")&&(P="Mapview"),F={longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,distance:this.camera.pose.distance,offset:this.camera.pose.offset.clone()}}else if(r==="initial")typeof S.panoIndex=="number"&&(O={workCode:S.work.workCode,panoIndex:S.panoIndex}),S.mode&&(P=S.mode),F={longitude:S.longitude,latitude:S.latitude,fov:S.fov,distance:S.distance,offset:(l=S.offset)===null||l===void 0?void 0:l.clone()};else{if(P=(u=r.mode)!==null&&u!==void 0?u:this.currentMode,typeof r.panoIndex=="number"){var V=w.getResolvedObserver({workCode:(f=(c=r.workCode)!==null&&c!==void 0?c:S.work.workCode)!==null&&f!==void 0?f:"",panoIndex:r.panoIndex});V&&(O={workCode:V.work.workCode,panoIndex:V.panoIndex})}F={longitude:r.longitude,latitude:r.latitude,fov:r.fov,distance:r.distance,offset:r.offset}}var D=k(k(k({},O),{mode:P}),F);this.emit("works.request",_("works.request",{input:e,works:w,state:D,userAction:a}));var z=function(){var W,Z;o.pano=O;var ee=(W=g.duration)!==null&&W!==void 0?W:o.modeChangeDuration,Y=(Z=g.effect)!==null&&Z!==void 0?Z:"fade",ie=k(k({initial:{state:D,currentState:o.getCurrentState(),duration:ee,effect:Y,userAction:a}},o.commonParams()),o.controllerInits[P]);if(o.controller&&o.currentMode===P)o.controller.updateWork(w,D,{effect:Y,duration:ee},a)===!1&&(o.controller.destroy(),o.controller=o.applyController(P,ie));else{var te=o.currentMode,le=Ft[P].initAnimationEndState(ie);if(o.controller)o.controller.destroy();else{var oe=Ft[P].initAnimationEndState(ie);o.camera.setFromPose(oe),o.modelGroup.visible=!0,o.emit("camera.update",_("camera.update",{state:o.getCurrentState(),userAction:a}))}o.controller=o.applyController(P,ie);var xe=_("mode.change",{prevMode:te,mode:P,state:le,userAction:a});o.emit("mode.change",xe)}};if(La.set(this,w),!this.controller){var U=k(k({initial:{state:D,currentState:this.getCurrentState(),duration:(m=g.duration)!==null&&m!==void 0?m:this.modeChangeDuration,effect:(A=g.effect)!==null&&A!==void 0?A:"fade",userAction:a}},this.commonParams()),this.controllerInits[P]),H=Ft[P].initAnimationEndState(U);this.camera.setFromPose(H),this.emit("camera.update",_("camera.update",{state:this.getCurrentState(),userAction:a}))}if(this.updateConfiguration(g,!1),P===t.Mode.Floorplan||P===t.Mode.Topview||P===t.Mode.Mapview||P===t.Mode.Model)this.loadModel(w,g).then(function(){o.needsRender=!0,o.modelSceneNeedsRender=!0,z(),o.emit("camera.update",_("camera.update",{state:o.getCurrentState(),userAction:a}))});else{if(!this.controller){var K=new d.Vector3,j=w.getResolvedObserver(O);j&&K.copy(j.position),this.camera.setFromPose({fov:F.fov,longitude:F.longitude,latitude:F.latitude,distance:F.distance,offset:(h=F.offset)!==null&&h!==void 0?h:K}),this.needsRender=!0,this.modelSceneNeedsRender=!0}z();var J=!1,X=function(){o.works===w&&J===!1&&(o.needsRender=!0,o.modelSceneNeedsRender=!0,o.emit("camera.update",_("camera.update",{state:o.getCurrentState(),userAction:a})),o.loadModel(w,g),J=!0)};this.controller.once("pano.arrived",X),this.controller.once("pano.cancel",X),setTimeout(X,((p=g.duration)!==null&&p!==void 0?p:this.modeChangeDuration)+1e3)}return this.emit("works.load",_("works.load",{input:e,state:this.getCurrentState(),userAction:a,works:w})),this.ready().then(function(){var W;o.emit("works.ready",_("works.ready",{input:e,state:o.getCurrentState(),userAction:a,works:w})),(W=o.analysis)===null||W===void 0||W.work(w)})},t.prototype.reset=function(){var e=this,r=this.lastLoadWorkTask.then(function(){return e.reset_()});return this.lastLoadWorkTask=r.catch(function(i){e.throwError(i)}),r},t.prototype.reset_=function(){var e=this;return new Promise(function(r){var i;e.controller&&(e.controller.destroy(),e.controller=void 0);var a=e.models.getMaterial();a&&(a.pano0&&a.pano0.map.dispose(),a.pano1&&a.pano1.map!==((i=a.pano0)===null||i===void 0?void 0:i.map)&&a.pano1.map.dispose()),e.models.setMaterial({pano0:null,pano1:null});for(var o=0,s=e.models;o<s.length;o++){var l=s[o];e.lastModels.push(l)}if(e.models.length=0,e.lastModels.length>0){for(var u=0,c=e.lastModels;u<c.length;u++){var l=c[u];e.modelGroup.remove(l),l.dispose(),e.needsRender=!0,e.modelSceneNeedsRender=!0}e.lastModels.length=0}e.lastWorks&&delete e.lastWorks,La.delete(e),e.currentMode="Panorama",e.pano={workCode:"",panoIndex:0},e.camera.setFromPose({distance:0,fov:A0,longitude:0,latitude:0,offset:new d.Vector3(0,0,0)}),e.state={mode:e.currentMode,workCode:e.pano.workCode,panoIndex:e.pano.panoIndex,longitude:e.camera.pose.longitude,latitude:e.camera.pose.latitude,fov:e.camera.pose.fov,offset:e.camera.pose.offset.clone(),distance:e.camera.pose.distance},e.models.needsRender=!1,e.camera.needsRender=!1,e.needsRender=!1,e.modelSceneNeedsRender=!1,r()})},t.prototype.changeMode=function(e,r,i,a,o){var s=this;return r===void 0&&(r={}),a===void 0&&(a=!0),o===void 0&&(o=!1),new Promise(function(l,u){var c,f,m,A;if(!s.renderer)throw new Error("renderer is not initialized.");r=k({},r);var h=0;s.controller&&(typeof i=="number"?h=i:h=(c=i==null?void 0:i.duration)!==null&&c!==void 0?c:s.modeChangeDuration);var p="fly";s.controller&&typeof i=="object"&&i.effect&&(p=i.effect);var g=typeof r.panoIndex=="number"?{workCode:(A=(f=r.workCode)!==null&&f!==void 0?f:(m=s.work)===null||m===void 0?void 0:m.workCode)!==null&&A!==void 0?A:"",panoIndex:r.panoIndex}:s.pano;if(!t.Mode.hasOwnProperty(e)){var v=new Error('mode "'.concat(e,'" is not existed'));s.throwError(v),u(v);return}if((e===t.Mode.Floorplan||e===t.Mode.Topview||e===t.Mode.Mapview||e===t.Mode.Model)&&!s.models.loaded){var v=new Error("model is not ready.");s.throwError(v),u(v);return}if((e===t.Mode.Panorama||e===t.Mode.VRPanorama||e===t.Mode.XRPanorama)&&!s.works.getResolvedObserver(g)){var v=new Error("PanoId ".concat(De(g)," not existed."));s.throwError(v),u(v);return}var y=s.controller,b=s.currentMode,x=function(){if(s.controller&&s.controller.stopMomentumMovement(),s.controller&&o===!1&&b===e)e===t.Mode.Panorama||e===t.Mode.Model||e===t.Mode.VRPanorama||e===t.Mode.XRPanorama?Yt(s.pano,g)&&"moveToPano"in s.controller&&typeof s.controller.moveToPano=="function"?s.controller.moveToPano(g,k({duration:h},r),a):s.controller.updateCamera(r,h,a).catch(Q):(Yt(s.pano,g)||(s.pano=g),s.controller.updateCamera(r,h,a).catch(Q));else{var E=k(k({},r),g),C=k(k({initial:{state:E,currentState:s.getCurrentState(),duration:h,effect:p,userAction:a}},s.commonParams()),s.controllerInits[e]),M=Ft[e].initAnimationEndState(C),R=_("mode.change.request",{prevMode:s.currentMode,mode:e,state:M,userAction:a});if(s.emit("mode.change.request",R),!R.defaultPrevented){y&&y.destroy(),s.controller=s.applyController(e,C);var L=_("mode.change",{prevMode:s.currentMode,mode:e,state:M,userAction:a});s.emit("mode.change",L)}}l()};if(e===t.Mode.VRPanorama)s.requestFullscreen(),pp().then(function(){return x()}).catch(function(E){E instanceof Error&&(s.exitFullscreen(),s.throwError(E),u(E))});else if(e===t.Mode.XRPanorama){var w=dt.shared.getContext();w?w.end():vp().then(function(E){dt.shared.setContext(E),x()}).catch(function(E){E instanceof Error&&(s.throwError(E),u(E))})}else x()})},t.prototype.getPixels=function(e,r,i,a,o,s,l){if(!this.renderer)throw new Error("renderer is not initialized.");var u=this.renderer.getPixelRatio(),c=this.renderer.getRenderTarget(),f=this.renderer.getSize(new d.Vector2);e=Math.ceil(e),r=Math.ceil(r),i=Math.ceil(i),a=Math.ceil(a),o=Math.ceil(o!=null?o:u),s=s!=null?s:!1;var m=this.getPixelsRenderTarget;m.setSize(i*o,a*o),this.renderer.setRenderTarget(m),this.camera.setViewOffset(f.width,f.height,e,f.height-r-a,i,a),this.camera.pixelRatio=o,this.camera.resolution.set(i,a),this.camera.aspect=this.camera.resolution.width/this.camera.resolution.height;for(var A=0,h=this.scene.children;A<h.length;A++){var p=h[A];p instanceof d.Object3D&&p.traverseVisible(function(S){S.setResolution&&S.setResolution(i*o/u,a*o/u)})}this.controller?(this.controller.updateRenderSize(new d.Vector2(i*o,a*o)),this.controller.render(!0,this.postProcessingType)):(this.renderer.render(this.scene,this.camera),this.renderer.autoClearDepth=!1,this.renderer.autoClearColor=!1,this.renderer.render(this.modelScene,this.camera),this.renderer.autoClearDepth=!0,this.renderer.autoClearColor=!0);var g=i*o,v=a*o,y=g*v,b=y*4,x;try{if(l){if(l.length!==b)throw new Error("buffer length is not equals pixels ".concat(b))}else l=new Uint8Array(b);if(this.renderer.readRenderTargetPixels(m,0,0,i*o,a*o,l),s)for(var w=y/2,E=0,C=0,M=0,R=0;C<w;C++)for(R=(v-Math.floor(C/g)-1)*g+C%g,M=0;M<4;M++)E=l[C*4+M],l[C*4+M]=l[R*4+M],l[R*4+M]=E}catch(S){x=S}if(this.renderer.setRenderTarget(c),this.controller&&this.controller.updateRenderSize){var L=new d.Vector2;this.renderer.getDrawingBufferSize(L),this.controller.updateRenderSize(L)}if(this.camera.clearViewOffset(),this.camera.pixelRatio=u,this.getSize(this.camera.resolution),this.camera.aspect=this.camera.resolution.width/this.camera.resolution.height,x)throw x;return l},t.prototype.getElement=function(){var e;return(e=this.renderer)===null||e===void 0?void 0:e.domElement},Object.defineProperty(t.prototype,"observers",{get:function(){return this.works.resolvedObservers},enumerable:!1,configurable:!0}),t.prototype.render=function(e,r){var i=this;if(r===void 0&&(r=!1),!this.renderer)return null;if(r){var a=this.renderer.getSize(hm);this.scene.traverseVisible(function(o){o.setResolution&&o.setResolution(a.x,a.y)})}return this.aroundScissor(function(){i.renderer&&(i.controller?(i.controller.render(i.onlyRenderIfNeeds?i.modelSceneNeedsRender:!0,i.postProcessingType),i.info={memory:k({},i.controller.renderer.info.memory),render:k({},i.controller.renderer.info.render)}):(i.renderer.render(i.scene,i.camera),i.info={memory:k({},i.renderer.info.memory),render:k({},i.renderer.info.render)}),i.poweredByRealsee&&i.currentMode!=="VRPanorama"&&i.currentMode!=="XRPanorama"&&i.renderer.getRenderTarget()!==i.getPixelsRenderTarget&&cm(i.renderer)),e&&dt.shared.add(e,!0)}),null},t.prototype.updateTime=function(e,r){for(var i,a=this,o=[],s=2;s<arguments.length;s++)o[s-2]=arguments[s];if(!this.destroyed){if(this.works.update(),this.syncingState=this.syncState(e,r),this.controller&&(i=this.controller).updateTime.apply(i,Et([e,r],o,!1)),this.renderer&&(this.camera.pixelRatio=this.renderer.getPixelRatio(),this.getSize(this.camera.resolution),this.camera.aspect=this.camera.resolution.width/this.camera.resolution.height),this.camera.updateTime(e,r),this.renderer){Kn.detectSupport(this.renderer);var l=this.models.loaded,u=this.models.refined;if(this.models.update(this.renderer,this.camera,this.currentMode),l===!1&&this.models.loaded===!0&&this.emit("models.load",_("models.load",{models:this.models})),u===!1&&this.models.refined===!0&&this.emit("models.refined",_("models.refined",{models:this.models})),this.models.loaded){for(var c=0,f=this.models;c<f.length;c++){var m=f[c];m.parent!==this.modelGroup&&(this.modelGroup.add(m),this.needsRender=!0,this.modelSceneNeedsRender=!0)}if(this.lastModels.length>0){for(var A=0,h=this.lastModels;A<h.length;A++){var m=h[A];this.modelGroup.remove(m),m.dispose(),this.needsRender=!0,this.modelSceneNeedsRender=!0}this.lastModels.length=0}this.lastWorks&&delete this.lastWorks}this.lastModels.setMaterial(this.models.getMaterial()),this.lastModels.materialVersion=this.models.materialVersion,this.lastModels.update(this.renderer,this.camera,this.currentMode)}this.syncingState=!1;var p=new d.Vector2(512,512),g=new d.Vector2(512,512);this.renderer&&(this.renderer.getSize(p),p.x*=this.scissor.width,p.y*=this.scissor.height,this.renderer.getDrawingBufferSize(g),g.x*=this.scissor.width,g.y*=this.scissor.height);{for(var v=new d.Box3,y=new d.Box3,b=new d.Vector3(4,4,4),x=0,w=this.works.resolvedObservers;x<w.length;x++){var E=w[x];y.setFromCenterAndSize(E.position,b),v.union(y)}if(v.union(this.models.bounding),this.lastWorks)for(var C=0,M=this.lastWorks.resolvedObservers;C<M.length;C++){var E=M[C];y.setFromCenterAndSize(E.position,b),v.union(y)}v.union(this.lastModels.bounding),v.getCenter(this.boundingMesh.position),v.getSize(this.boundingMesh.scale),this.boundingMesh.boundingBox.copy(v),this.renderer&&this.boundingMesh.update(this.renderer,this.camera,this.model)}var R=_("render.prepare",{needsRender:!0,info:null});if(this.emit("render.prepare",R),!R.defaultPrevented){var L=[];gi.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),Ai.setFromProjectionMatrix(gi);for(var S=0,I=this.scene.children;S<I.length;S++){var O=I[S];O!==this.modelGroup&&O!==this.boundingMesh&&O instanceof d.Object3D&&O.traverseVisible(function(U){if(U.setResolution&&U.setResolution(p.x,p.y),U.setTime&&U.setTime(e),U.mixer instanceof d.AnimationMixer){var H=g0.get(U.mixer);H||(H=new d.Clock,g0.set(U.mixer,H)),U.mixer.update(H.getDelta())}(U instanceof d.Mesh||U instanceof d.Line||U instanceof d.Points)&&(U instanceof d.ImmediateRenderObject||!U.frustumCulled||Ai.intersectsObject(U))&&L.push(U)})}if(g.width*g.height>4096*2048?this.renderSwitch01=this.renderSwitch01^1:this.renderSwitch01=0,this.renderer&&this.paused===!1&&this.renderSwitch01===0){var P=void 0;if(this.onlyRenderIfNeeds!==!0)P=this.render();else{if(this.controller&&(this.controller.needsRender===!0&&(this.controller.needsRender=!1,this.needsRender=!0),this.controller.modelSceneNeedsRender===!0&&(this.controller.modelSceneNeedsRender=!1,this.modelSceneNeedsRender=!0)),this.camera.needsRender===!0&&(this.camera.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0),this.models.needsRender===!0&&(this.models.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0),this.needsRender!==!0)for(var F=0,V=L;F<V.length;F++){var D=V[F],z=function(U){U.needsRender===!0?(U.needsRender=!1,a.needsRender=!0):U.mixer&&U.mixer.stats.actions.inUse>0&&(a.needsRender=!0)};z(D),D.traverseAncestors(z)}(this.needsRender!==!1||this.modelSceneNeedsRender!==!1)&&(P=this.render())}this.needsRender=!1,this.modelSceneNeedsRender=!1,this.hasListener("render")&&this.emit("render",_("render",{needsRender:P!==void 0,info:this.info}))}this.needsRender=!1,this.modelSceneNeedsRender=!1}this.fps.testTime&&e-this.fps.testTime<1e3?this.fps.testCount++:(this.emit("fps",this.fps.testCount),this.fps.testTime=e,this.fps.testCount=0)}},t.prototype.pause=function(){this.paused=!0,this.renderer&&this.renderer instanceof nn&&this.renderer.clear(!0,!0,!0)},t.prototype.play=function(){this.needsRender=!0,this.modelSceneNeedsRender=!0,this.paused=!1},t.prototype.moveToPano=function(e,r,i){r===void 0&&(r={}),i===void 0&&(i=!0);var a=this,o=a.controller,s=a.renderer;if(!o)return this.throwError(new Error("controller is not initialized.")),Promise.resolve();if(!s)return this.throwError(new Error("renderer is not initialized.")),Promise.resolve();var l=this.works.getResolvedObserver(e);if(!l)return this.throwError(new Error("pano ".concat(JSON.stringify(e)," not existed."))),Promise.resolve();var u={workCode:l.work.workCode,panoIndex:l.panoIndex};return"moveToPano"in o&&typeof o.moveToPano=="function"?o.moveToPano(u,r,i):l&&(this.pano=u,this.once("initAnimation.start",function(c){r.moveStartCallback&&r.moveStartCallback(c.state)}),this.once("initAnimation.end",function(c){r.moveEndCallback&&r.moveEndCallback(c.state)}),this.changeMode(t.Mode.Panorama,r,{effect:r.effect},i)),this.ready()},t.prototype.preloadPano=function(e,r){var i=this;r===void 0&&(r=Q);var a=this.works.getResolvedObserver(e);if(!a)return Promise.reject(new Error("Pano ".concat(JSON.stringify(e)," never found")));var o=["right","left","up","down","front","back"],s=Ee();return Promise.all(o.map(function(l){var u=k({key:"pano.".concat(a.panoId,".").concat(l)},Dt(i.imageOptions,["size","format","quality","mappings"])),c=a.images[l],f=i.imageOptions.transform?i.imageOptions.transform(c,u):lt(c,u);return it(a.work).preload(f)})).then(function(){var l=Ee()-s;return r(l),l})},t.prototype.project2d=function(e,r){if(r===void 0&&(r=!1),!this.renderer)return null;if(this.models.length>0&&r){var i=this.camera.position,a=e.clone().sub(i),o=new d.Raycaster(i,a.clone().normalize());o.params.Points={threshold:.1};var s=this.models.intersectRaycaster(o)[0];if(s&&s.distance+.01<a.length())return null}var l=e.clone().project(this.camera);if(Math.abs(l.z)>1)return null;var u=this.renderer.getSize(new d.Vector2),c=u.x*this.scissor.width,f=u.y*this.scissor.height,m=u.x*this.scissor.left+(l.x+1)/2*c,A=u.y*(1-this.scissor.bottom-this.scissor.height)+(-l.y+1)/2*f;return new d.Vector2(m,A)},t.prototype.getRenderObjects=function(e){gi.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),Ai.setFromProjectionMatrix(gi),e||(e=this.scene);var r=[];return e.traverseVisible(function(i){(i instanceof d.Mesh||i instanceof d.Line||i instanceof d.Points)&&(i instanceof d.ImmediateRenderObject||!i.frustumCulled||Ai.intersectsObject(i))&&r.push(i)}),r},t.prototype.getCurrentState=function(){return k(k({},this.getPose()),{mode:this.currentMode,workCode:this.pano.workCode,panoIndex:this.pano.panoIndex})},t.prototype.setState=function(e,r,i){var a,o,s,l,u,c,f,m,A,h;r===void 0&&(r=!1),i===void 0&&(i=!0),e=Object.assign({},e),e.offset&&!(e instanceof d.Vector3)&&(e.offset=new d.Vector3(e.offset.x,e.offset.y,e.offset.z));var p;typeof e.panoIndex=="number"&&(e.workCode?p={workCode:e.workCode,panoIndex:e.panoIndex}:p={workCode:(o=(a=this.work)===null||a===void 0?void 0:a.workCode)!==null&&o!==void 0?o:"",panoIndex:e.panoIndex});var g=(s=e.mode)!==null&&s!==void 0?s:this.state.mode,v,y,b,x,w;if((e.mode===t.Mode.Floorplan||e.mode===t.Mode.Topview||e.mode===t.Mode.Mapview||e.mode===t.Mode.Model)&&!this.models.loaded){this.throwError(new Error("model is not ready."));return}if(this.controller&&this.controller.stopMomentumMovement(),this.state.mode!==g){if(g==="VRPanorama"){this.changeMode("VRPanorama",void 0,void 0,!0);return}var E={workCode:p==null?void 0:p.workCode,panoIndex:p==null?void 0:p.panoIndex};typeof e.longitude=="number"&&(E.longitude=e.longitude),typeof e.latitude=="number"&&(E.latitude=e.latitude),typeof e.fov=="number"&&(E.fov=e.fov),typeof e.distance=="number"&&(E.distance=e.distance),e.offset instanceof d.Vector3&&(E.offset=e.offset);var C=k(k({initial:{state:E,currentState:this.getCurrentState(),duration:this.modeChangeDuration,effect:"fly",userAction:!1}},this.commonParams()),this.controllerInits[g]),M=Ft[g].initAnimationEndState(C);v=M.longitude,y=M.latitude,b=M.fov,x=M.offset,w=M.distance}else v=(l=e.longitude)!==null&&l!==void 0?l:this.state.longitude,y=(u=e.latitude)!==null&&u!==void 0?u:this.state.latitude,b=(c=e.fov)!==null&&c!==void 0?c:this.state.fov,x=(f=e.offset)!==null&&f!==void 0?f:this.state.offset,w=(m=e.distance)!==null&&m!==void 0?m:this.state.distance;var R={workCode:(p!=null?p:this.pano).workCode,panoIndex:(p!=null?p:this.pano).panoIndex,mode:g,longitude:v,latitude:y,fov:b,offset:x,distance:w};this.emit("state.set",_("state.set",{userAction:i,state:R})),zr(this.state,R)||(this.controller&&R.mode==="VRPanorama"&&R.mode!==this.state.mode?(ur(this.state,R),this.changeMode("VRPanorama")):this.controller&&R.mode==="XRPanorama"&&R.mode!==this.state.mode?(ur(this.state,R),this.changeMode("XRPanorama")):(ur(this.state,R),this.controller&&i&&(this.controller.userAction=!1),r&&this.state.mode===R.mode&&(this.syncingState=this.syncState(Ee(),0,r),this.syncingState&&((A=this.controller)===null||A===void 0||A.updateTime(Ee(),0),this.syncingState=!1)),this.emit("state.change",_("state.change",{userAction:i,state:this.state})),(h=this.analysis)===null||h===void 0||h.state(this.works,this.state)))},t.prototype.aroundScissor=function(e){if(this.renderer){if(this.state.mode==="XRPanorama"){e();return}var r=new d.Vector2,i=this.scissor.left!==0||this.scissor.bottom!==0||this.scissor.width!==1||this.scissor.height!==1;if(i){this.renderer.getSize(r);var a=Math.floor(r.x*this.scissor.left),o=Math.floor(r.y*this.scissor.bottom),s=Math.floor(r.x*this.scissor.width),l=Math.floor(r.y*this.scissor.height);this.renderer.setViewport(a,o,s,l),this.renderer.setScissor(a,o,s,l),this.renderer.setScissorTest(!0)}e(),i&&(this.renderer.setViewport(0,0,r.x,r.y),this.renderer.setScissor(0,0,r.x,r.y),this.renderer.setScissorTest(!1))}},t.prototype.syncState=function(e,r,i){i===void 0&&(i=!1);var a=this.stateSynced;if(this.stateSynced=!1,this.works.length===0||!this.controller)return!1;if(this.state.mode!==this.currentMode){var o={mode:this.state.mode,workCode:this.state.workCode,panoIndex:this.state.panoIndex,longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset,distance:this.state.distance};return this.changeMode(this.state.mode,o,this.modeChangeDuration,this.controller.userAction),!0}if(!this.controller.isReady())return!1;if(this.controller instanceof Ft.Model){if(Mi(this.camera.pose.offset,this.state.offset)){var s={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset};return this.controller.moveToPosition(this.state.offset,k(k({},s),{duration:i?0:void 0}),!1),!0}}else{var l={workCode:this.state.workCode,panoIndex:this.state.panoIndex};if(!Yt(l,this.pano)&&"moveToPano"in this.controller&&typeof this.controller.moveToPano=="function"){var s={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset,distance:this.state.distance};return this.controller.moveToPano(l,s,!1),!0}}if(this.controller instanceof Ft.Floorplan||this.controller instanceof Ft.Topview||this.controller instanceof Ft.Mapview){var u=1,c=.2,f=.2,m=Math.PI/45,A=i?this.state.fov:wa(this.camera.pose.fov,this.state.fov,u),h=Math.abs(this.camera.pose.distance-this.state.distance),p=h>f*15?h/15:c,g=i?this.state.distance:wa(this.camera.pose.distance,this.state.distance,p),v=this.camera.pose.offset.distanceTo(this.state.offset),y=v>f*15?v/15:f,b=i?new d.Vector3().copy(this.state.offset):fp(this.camera.pose.offset,this.state.offset,y),x=i?{longitude:this.state.longitude,latitude:this.state.latitude}:js({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},m),w=x.longitude,E=x.latitude;if(Lt(A,this.camera.pose.fov)||Mi(b,this.camera.pose.offset)||Lt(g,this.camera.pose.distance)||Lt(w,this.camera.pose.longitude,Math.PI*2)||Lt(E,this.camera.pose.latitude)){var C={x:b.x,y:b.y,z:b.z},M={fov:A};return Object.assign(C,{distance:g}),Object.assign(M,{longitude:w,latitude:E}),this.controller.stopMomentumMovement(),this.controller.cameraMotion.set(M,0).catch(Q),this.controller.locationMotion.set(C,0).catch(Q),!0}}else{var R=1,L=Math.PI/45,A=i?this.state.fov:wa(this.camera.pose.fov,this.state.fov,R),S=i?{longitude:this.state.longitude,latitude:this.state.latitude}:js({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},L),w=S.longitude,E=S.latitude,g=this.state.distance,b=new d.Vector3().copy(this.state.offset);if(Lt(g,this.camera.pose.distance)&&(this.state.distance=this.camera.pose.distance),Mi(b,this.camera.pose.offset)&&(this.state.offset=this.camera.pose.offset.clone()),Lt(w,this.camera.pose.longitude,Math.PI*2)||Lt(E,this.camera.pose.latitude)||Lt(A,this.camera.pose.fov))return this.controller.stopMomentumMovement(),this.controller.cameraMotion.set({longitude:w,latitude:E,fov:A},0).catch(Q),!0}if(this.stateSynced=!0,a===!1&&this.emit("state.synced",_("state.synced",{userAction:!1,state:this.state})),this.readyCallbacks.length&&this.stateSynced){var I=this.currentMode,O=I===t.Mode.Floorplan||I===t.Mode.Topview||I===t.Mode.Mapview||I===t.Mode.Model;if(!O||this.models.loaded){var P=this.readyCallbacks.slice();this.readyCallbacks.length=0;for(var F=0,V=P;F<V.length;F++){var D=V[F];this.controller instanceof Ft.Panorama&&D.tile===!0&&!this.controller.isTileReady()?this.readyCallbacks.push(D):D()}}}return!1},t.prototype.ready=function(e){var r=this;return e===void 0&&(e={}),new Promise(function(i){var a;r.readyCallbacks.push(Object.assign(i,{tile:(a=e.tile)!==null&&a!==void 0?a:!1}))})},t.prototype.requestFullscreen=function(){var e;if(zn){var r=(e=this.getElement())===null||e===void 0?void 0:e.parentNode;r&&"requestFullscreen"in r&&typeof document!="undefined"&&document.fullscreenElement===null&&r.requestFullscreen()}},t.prototype.exitFullscreen=function(){typeof document!="undefined"&&document.fullscreenElement&&"exitFullscreen"in document&&document.exitFullscreen()},t.prototype.throwError=function(e){this.hasListener("error")?this.emit("error",e):console.error(e)},t.prototype.loadModel=function(e,r){for(var i=this,a=[],o=function(g){var v=s.models.filter(function(b){var x;return((x=b.work)===null||x===void 0?void 0:x.workCode)===g.workCode})[0];if(v)v.work=g,a.push(v);else{var y=new Za({onError:function(b){i.emit("model.error",_("model.error",{work:g,model:y,error:b})),i.throwError(b)},onShownFloorChange:function(b){i.emit("model.changeShownFloor",_("model.changeShownFloor",{work:g,model:y,error:null}))},onLoad:function(){i.emit("model.load",_("model.load",{work:g,model:y,error:null}))}});a.push(y),s.emit("model.request",_("model.request",{work:g,model:y,error:null})),y.load(g,{textureOptions:s.textureOptions,"3d-tiles":r["3d-tiles"]})}},s=this,l=0,u=e;l<u.length;l++){var c=u[l];o(c)}if(this.models.length>0){for(var f=0,m=this.models;f<m.length;f++){var A=m[f];a.indexOf(A)===-1&&this.lastModels.push(A)}this.models.length=0}for(var h=0,p=a;h<p.length;h++){var A=p[h];this.models.push(A)}return this.renderer&&(this.models.loaded=!1),new Promise(function(g){i.on("models.load",function(){g()})})},t.prototype.commonParams=function(){return{ident:this.ident,scene:this.scene,xrCustomObjectsScene:this.xrCustomObjectsScene,helper:this.helperGroup,boundingMesh:this.boundingMesh,camera:this.camera,renderer:this.renderer,scissor:this.scissor,element:this.getElement(),models:this.models,works:this.works,imageOptions:this.imageOptions,enableWheel:this.enableWheel,enableIOSEDR:this._enableIOSEDR,enableEDL:this.enableEDL,enableHQ:this.enableHQ,extraElements:this.extraElements,videoTexture:this.videoTexture,modelScene:this.modelScene,modelRenderTarget:this.modelRenderTarget}},t.prototype.applyController=function(e,r){var i=this;if(!this.renderer)throw new Error("renderer is not initialized.");e!==t.Mode.Mapview&&(this.enableEDL=!1,this.enableHQ=!1);var a=Ft[e];this.currentMode=e;for(var o=new a(r),s=function(A){o.on(A,function(){for(var h=[],p=0;p<arguments.length;p++)h[p]=arguments[p];var g=i.emit.apply(i,Et([A],h,!1));if(g)return!1})},l=0,u=il;l<u.length;l++){var c=u[l];s(c)}{var f=Ft[e].initAnimationEndState(r),m=r.initial.userAction;zr(this.state,f)||(ur(this.state,f),this.emit("state.change",_("state.change",{userAction:m,state:this.state}))),this.emit("currentState.change",_("currentState.change",{userAction:m,state:this.getCurrentState()}))}return o.on("camera.update",function(A){var h;if(i.controller){var p=i.controller.getTargetState();A.userAction&&i.syncingState===!1&&i.state.mode===p.mode&&!zr(i.state,p)&&(ur(i.state,p),i.emit("state.change",_("state.change",{userAction:A.userAction,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}i.emit("currentState.change",_("currentState.change",{userAction:A.userAction,state:i.getCurrentState()}))}),o.on("initAnimation.start",function(A){var h,p=A.state,g=A.userAction;g&&i.state.mode===p.mode&&!zr(i.state,p)&&(ur(i.state,p),i.emit("state.change",_("state.change",{userAction:g,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),o.on("initAnimation.end",function(A){var h,p=A.state,g=A.userAction;g&&i.state.mode===p.mode&&!zr(i.state,p)&&(ur(i.state,p),i.emit("state.change",_("state.change",{userAction:g,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),o.on("pano.moveTo",function(A){var h,p=A.state,g=A.userAction;i.pano={workCode:p.workCode,panoIndex:p.panoIndex},g&&i.state.mode===p.mode&&!zr(i.state,p)&&(ur(i.state,p),i.emit("state.change",_("state.change",{userAction:g,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),o.on("pano.arrived",function(A){var h,p=A.state,g=A.userAction;g&&i.state.mode===p.mode&&!zr(i.state,p)&&(ur(i.state,p),i.emit("state.change",_("state.change",{userAction:g,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),o.on("pano.cancel",function(A){var h,p=A.state,g=A.userAction;g&&i.state.mode===p.mode&&!zr(i.state,p)&&(ur(i.state,p),i.emit("state.change",_("state.change",{userAction:g,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),o.on("pano.moveTo",function(A){var h=A.userAction;i.emit("currentState.change",_("currentState.change",{userAction:h,state:i.getCurrentState()}))}),o.on("pano.request",function(A){i.emit("pano.request",A),A.defaultPrevented||i.moveToPano(A.state,A.options,A.userAction)}),o.on("vr.requestExit",function(){i.currentMode===t.Mode.VRPanorama&&(i.exitFullscreen(),i.changeMode(t.Mode.Panorama))}),o.on("error",function(A){return i.throwError(A)}),o},t.prototype.removeEventListeners=function(){},t.prototype.getWorkResources=function(e){var r=this,i,a=this.models.find(function(u){return u.work===e}),o=((i=a==null?void 0:a.viewLayers)!==null&&i!==void 0?i:[]).map(function(u){return u.scene});function s(u){var c=/([0-9a-z\.\_\-]+)([\?\#].*)?$/i.exec(u);if(c){var f=String(c[1]).trim().split(".").slice(1).reverse()[0];if(f)return f}return""}function l(u,c){c===void 0&&(c=0);var f=[];if(u.content&&u.content.uri){var m=s(u.content.uri);if(m==="json"){var A=lt(u.content.uri,{key:"model.".concat(c)});f.push({url:A,type:"tileset"})}else if(m==="at3d"&&u.extras[m]){var A=u.content.uri;f.push({url:A,type:"model"});for(var h=u.extras[m],p=h.textureArray,g=h.textureOptions,v=0,y=p;v<y.length;v++){var b=y[v],x=k({key:"texture.pbm"},Dt(g,["format","quality","size","sharpen","mappings"])),w=sn(b,g==null?void 0:g.transform,x);f.push({url:w,type:"texture"})}}else{var A=lt(u.content.uri,{key:"model.".concat(c)});f.push({url:A,type:"model"})}}if(u.children)for(var E=0;E<u.children.length;E++){var C=u.children[E];f.push.apply(f,l(C,E))}return f}return Promise.all(o.map(function(u){return u.loadAllTilesets()})).then(function(){for(var u=[],c=["right","left","up","down","front","back"],f=0,m=e.observers;f<m.length;f++){for(var A=m[f],h=0,p=c;h<p.length;h++){var g=p[h],v=k({key:"pano.".concat(De(A.pano),".").concat(g)},Dt(r.imageOptions,["size","format","quality","mappings"])),y=A.images[g],b=sn(y,r.imageOptions.transform,v);u.push({url:b,type:"pano"})}if(A.images.tiles)for(var x=0,w=A.images.tiles;x<w.length;x++)for(var E=w[x],C=0,M=c;C<M.length;C++)for(var g=M[C],R=E.size,L=Math.pow(2,E.level),S=1/L,I=0;I<L;I++)for(var O=0;O<L;O++){var P="".concat(A.panoId,".").concat(g,".").concat(E.level,".").concat(I,".").concat(O),v=k(k({key:"pano_tile.".concat(P)},Dt(r.imageOptions,["format","size","quality","sharpen","mappings"])),{size:E.scale>=1?void 0:R*S*E.scale,cut:[R*S*O,R*S*I,R*S,R*S]}),b=sn(E[g],r.imageOptions.transform,v);u.push({url:b,type:"pano_tile"})}}for(var F=0,V=o;F<V.length;F++){var D=V[F];D.tileset.url&&u.push({url:D.tileset.url,type:"model"}),u.push.apply(u,l(D.tileset.root))}return u})},t.Mode={Panorama:"Panorama",Model:"Model",Floorplan:"Floorplan",Topview:"Topview",Mapview:"Mapview",VRPanorama:"VRPanorama",XRPanorama:"XRPanorama"},t.Line=null,t}(Ui),ro={instances:{},constructor:sl};typeof window!="undefined"&&Object.assign(window,{__FIVE_DEBUG__:ro});var pm=function(){function n(){}return n.createButton=function(t){var e=document.createElement("button");function r(){e.style.display="",e.style.cursor="pointer",e.style.left="calc(50% - 50px)",e.style.width="100px",e.textContent="ENTER VR",e.onmouseenter=function(){e.style.opacity="1.0"},e.onmouseleave=function(){e.style.opacity="0.5"},e.onclick=function(){t&&t()}}function i(){e.style.display="",e.style.cursor="auto",e.style.left="calc(50% - 75px)",e.style.width="150px",e.onmouseenter=null,e.onmouseleave=null,e.onclick=null}function a(){i(),e.textContent="VR NOT SUPPORTED"}function o(l){l.style.position="absolute",l.style.bottom="20px",l.style.padding="12px 6px",l.style.border="1px solid #fff",l.style.borderRadius="4px",l.style.background="rgba(0,0,0,0.1)",l.style.color="#fff",l.style.font="normal 13px sans-serif",l.style.textAlign="center",l.style.opacity="0.5",l.style.outline="none",l.style.zIndex="999"}if("xr"in navigator)return e.id="VRButton",e.style.display="none",o(e),navigator.xr.isSessionSupported("immersive-vr").then(function(l){l?r():a()}),e;var s=document.createElement("a");return window.isSecureContext===!1?(s.href=document.location.href.replace(/^http:/,"https:"),s.innerHTML="WEBXR NEEDS HTTPS"):(s.href="https://immersiveweb.dev/",s.innerHTML="WEBXR NOT AVAILABLE"),s.style.left="calc(50% - 90px)",s.style.width="180px",s.style.textDecoration="none",o(s),s},n}();exports.AnimationFrameLoop=dt;exports.Camera=z0;exports.CustomShader=_c;exports.Fetcher=co;exports.Five=sl;exports.InternalWebGLRenderer=nn;exports.IntersectMesh=qi;exports.Model=Za;exports.ModelViewLayer=Ci;exports.NetworkSubscribe=I0;exports.PBMContainer=rd;exports.PBMGroup=jc;exports.PBMMesh=Tt;exports.PBMMeshMaterial=Jr;exports.PBMPointCloud=er;exports.PBMPointCloudMaterial=ii;exports.PROXY_CONTROLLER_EVENT_NAMES=il;exports.PanoCircleMesh=Du;exports.PanoCircleMeshCustom=ip;exports.PanoCircleMeshSolid=ep;exports.Scene=D0;exports.Subscribe=Ui;exports.TextureLoader=Bn;exports.Tile=po;exports.Tile3DModel=an;exports.TileCache=K0;exports.TileCubeTextureTarget=Ne;exports.TileNode=iu;exports.TileRequestScheduler=G0;exports.Tileset=br;exports.Trajectory=j0;exports.TrajectoryNode=Fu;exports.Work=wo;exports.XRButton=pm;exports.defaultImageURLTransform=lt;exports.defaultPbmParameters=me;exports.getViewportScale=al;exports.imageSupport=B0;exports.isPanoId=F0;exports.loadAt3d=Eu;exports.loadB3dm=cu;exports.loadDome=Su;exports.loadDomez=Mu;exports.loadGlb=Iu;exports.loadPbm=bu;exports.loadPly=bo;exports.loadPnts=fu;exports.panoEqual=Yt;exports.panoParse=At;exports.panoStringify=De;exports.parseWork=jn;
|
|
2175
|
+
`});A.depthTest=f.material.depthTest,A.side=f.material.side,s.meshReplaceMaterialMap.set(m,A),f.material=A}}});var l=this.renderer.getSize(new d.Vector2);this.camera.setViewOffset(l.width,l.height,e*a,r*a,1,1),this.renderer.setRenderTarget(this.gpuPickingRenderTarget),this.render();var u=new Uint8Array(4);this.renderer.readRenderTargetPixels(this.gpuPickingRenderTarget,0,0,1,1,u),this.renderer.setRenderTarget(null),this.camera.clearViewOffset(),this.scene.traverse(function(f){!(f instanceof d.Mesh)||f instanceof Tt||s.meshOriginMaterialMap.get(f.uuid)&&(f.material=s.meshOriginMaterialMap.get(f.uuid))}),this.models.setMaterial({constantColor:null});var c=Object.keys(i).filter(function(f){return i[f].equals(new d.Color().setRGB(u[0]/255,u[1]/255,u[2]/255))})[0];return c||!1},t.prototype.dispose=function(){var e,r;if(this.destroyed!==!0){delete ro.instances[this.ident],this.emit("dispose"),this.destroyed=!0,this.pause(),this.stopAnimationLoop&&(this.stopAnimationLoop(),delete this.stopAnimationLoop),(e=this.renderer)===null||e===void 0||e.setAnimationLoop(null),this.off(),this.networkSubscribe.off(),this.controller&&(this.controller.destroy(),this.controller=void 0);var i=this.getElement();i&&i.parentNode&&i.parentNode.removeChild(i);var a=this.models.getMaterial();a&&(a.pano0&&a.pano0.map.dispose(),a.pano1&&a.pano1.map!==((r=a.pano0)===null||r===void 0?void 0:r.map)&&a.pano1.map.dispose());for(var o=0,s=this.models;o<s.length;o++){var l=s[o];l.dispose()}this.models.length=0,this.models.setMaterial({pano0:null,pano1:null}),this.meshReplaceMaterialMap.forEach(function(u){u.dispose()}),this.meshOriginMaterialMap.forEach(function(u){u.dispose()}),this.renderer instanceof nn&&this.renderer.forceContextLoss&&this.renderer.forceContextLoss()}},t.prototype.setScissor=function(e){var r;if(Object.assign(this.scissor,e),this.controller&&this.controller.updateRenderSize){var i=new d.Vector2;(r=this.renderer)===null||r===void 0||r.getDrawingBufferSize(i),this.controller.updateRenderSize(i)}},Object.defineProperty(t.prototype,"helperVisible",{get:function(){return this.helperGroup.visible},set:function(e){this.helperGroup.visible!==e&&(this.helperGroup.visible=e,this.emit("helpers.visible",_("helpers.visible",{object:this.helperGroup})),this.needsRender=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableIOSEDR",{get:function(){return this._enableIOSEDR},set:function(e){this._enableIOSEDR!==e&&(this._enableIOSEDR=e,this.currentMode&&this.currentMode==="Panorama"&&this.changeMode(this.currentMode,this.getCurrentState(),0,!1,!0))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"postProcessingType",{get:function(){return this.currentMode==="Panorama"&&this.enableIOSEDR&&this.enablePostProcessing?"luminance":this.currentMode==="Mapview"&&this.enableEDL?"edl":this.currentMode==="Mapview"&&this.enableHQ?"hq":null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableEDL",{get:function(){return this._enableEDL},set:function(e){if(e===!0&&this.currentMode!==t.Mode.Mapview)throw new Error("只支持Mapview下开启EDL");this._enableEDL!==e&&(this._enableEDL=e,this.boundingMesh.visible=!e,this.needsRender=!0,this.modelSceneNeedsRender=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableHQ",{get:function(){return this._enableHQ},set:function(e){if(e===!0&&this.currentMode!==t.Mode.Mapview)throw new Error("只支持Mapview下开启HQ");this._enableHQ!==e&&(this._enableHQ=e,this.boundingMesh.visible=!e,this.needsRender=!0,this.modelSceneNeedsRender=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enablePostProcessing",{get:function(){return this._enablePostProcessing},set:function(e){this._enablePostProcessing!==e&&(this._enablePostProcessing=e),this.needsRender=!0,this.modelSceneNeedsRender=!0},enumerable:!1,configurable:!0}),t.prototype.updateConfiguration=function(e,r){r===void 0&&(r=!0);var i=!1;e.panorama&&(Object.assign(this.controllerInits.Panorama,e.panorama),this.currentMode==="Panorama"&&(i=!0)),e.model&&(Object.assign(this.controllerInits.Model,e.model),this.currentMode==="Model"&&(i=!0)),e.floorplan&&(Object.assign(this.controllerInits.Floorplan,e.floorplan),this.currentMode==="Floorplan"&&(i=!0)),e.topview&&(Object.assign(this.controllerInits.Topview,e.topview),this.currentMode==="Topview"&&(i=!0)),e.mapview&&(Object.assign(this.controllerInits.Mapview,e.mapview),this.currentMode==="Mapview"&&(i=!0)),e.vrPanorama&&(Object.assign(this.controllerInits.VRPanorama,e.vrPanorama),this.currentMode==="VRPanorama"&&(i=!0)),e.imageOptions&&(Object.assign(this.imageOptions,e.imageOptions),(this.currentMode==="Panorama"||this.currentMode==="VRPanorama")&&(i=!0)),e.textureOptions&&Object.assign(this.textureOptions,e.textureOptions),r&&i&&this.controller&&this.currentMode&&this.changeMode(this.currentMode,this.getCurrentState(),0,!1,!0)},t.prototype.appendTo=function(e,r){if(r===void 0&&(r={}),!!this.renderer){if(!(this.renderer instanceof nn)){this.throwError(new Error("cannot call appendTo method when render a external renderer"));return}var i=this.getElement();if(i){e.appendChild(i),this.refresh(r);var a=window.getComputedStyle(e).position;a!=="relative"&&a!=="absolute"&&a!=="fixed"&&a!=="sticky"&&(e.style.position="relative")}}},t.prototype.refresh=function(e,r){if(e===void 0&&(e={}),!!this.renderer){var i=this.getElement();if(i){var a=i.parentNode;if(a&&a.nodeName){var o=e.width,s=o===void 0?a.offsetWidth:o,l=e.height,u=l===void 0?a.offsetHeight:l;this.renderer instanceof nn&&(r&&this.renderer.setPixelRatio(r),this.renderer.setSize(s,u))}var c=new d.Vector2;if(this.renderer.getDrawingBufferSize(c),this.controller&&this.controller.updateRenderSize&&this.controller.updateRenderSize(c),this.modelRenderTarget.width!==c.x||this.modelRenderTarget.height!==c.y){this.modelRenderTarget.setSize(c.x,c.y),this.modelRenderTarget.depthTexture.dispose();var f=new d.DepthTexture(c.x,c.y);f.generateMipmaps=!1,f.format=d.DepthStencilFormat,f.type=d.UnsignedInt248Type,this.modelRenderTarget.depthTexture=f,this.modelRenderTarget.depthTexture.needsUpdate=!0}this.needsRender=!0,this.modelSceneNeedsRender=!0,this.render(Q,!0)}}},t.prototype.addExtraElement=function(e){var r=this;return this.extraElements.indexOf(e)===-1&&(this.extraElements.push(e),this.controller&&this.controller.bindExtraElement(e)),function(){return r.removeExtraElement(e)}},t.prototype.removeExtraElement=function(e){var r=this.extraElements.indexOf(e);r!==-1&&(this.extraElements.splice(r,1),this.controller&&this.controller.unbindExtraElement(e))},t.prototype.getPose=function(){var e=this.camera.copyPose(),r=e.longitude,i=e.latitude,a=e.fov,o=e.offset,s=e.distance;return{longitude:r,latitude:i,fov:a,offset:o.clone(),distance:s}},t.prototype.getSize=function(e){if(!this.renderer)throw new Error("renderer is not initialized");return this.renderer.getSize(e),e.x*=this.scissor.width,e.y*=this.scissor.height,e},t.prototype.getDrawingBufferSize=function(e){if(!this.renderer)throw new Error("renderer is not initialized");return this.renderer.getDrawingBufferSize(e),e.x*=this.scissor.width,e.y*=this.scissor.height,e},t.prototype.updateCamera=function(e,r,i){return i===void 0&&(i=!0),this.controller?this.controller.updateCamera(e,r,i):Promise.reject(new Error("controller is not initialized."))},t.prototype.updateCameraWithKeyframes=function(e,r,i){return i===void 0&&(i=!0),this.controller?this.controller.updateCameraWithKeyframes(e,r,i):Promise.reject(new Error("controller is not initialized."))},t.prototype.getLongitudeAndLatitude=function(){var e=this.getPose(),r=e.longitude,i=e.latitude;return{longitude:r,latitude:i}},t.prototype.getOffset=function(){return this.getPose().offset},t.prototype.getCameraLocal=function(){if(this.pano.workCode&&this.controller&&this.works){var e=this.works.getResolvedObserver(this.pano);if(e){var r=new d.Object3D;return r.position.copy(e.position),r.quaternion.copy(e.quaternion),r.scale.set(1,1,1),r.matrix.compose(r.position,r.quaternion,r.scale),r.matrixAutoUpdate=!1,dp(this.camera,r)}}return null},Object.defineProperty(t.prototype,"works",{get:function(){var e=La.get(this);if(!e)return y0;for(var r=0,i=e;r<i.length;r++){var a=i[r];if(!xo.has(a))return y0}return e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"work",{get:function(){return this.works[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"model",{get:function(){return this.models[0]},enumerable:!1,configurable:!0}),t.prototype.load=function(e,r,i,a){var o=this;if(a===void 0&&(a=!0),!this.renderer)throw new Error("renderer is not initialized");var s=this.lastLoadWorkTask.then(function(){return hp(e)?e.then(function(l){return o.load_(l,r,i,a)}):o.load_(e,r,i,a)});return this.lastLoadWorkTask=s.catch(function(l){o.throwError(l)}),s},t.prototype.load_=function(e,r,i,a){var o=this,s,l,u,c,f,m,A,h,p;a===void 0&&(a=!0);var g={};typeof i=="number"?g.duration=i:typeof i=="object"&&Object.assign(g,i),this.controller||(g.duration=0,g.effect="instant");var v=[];if(Array.isArray(e))for(var y=0,b=e;y<b.length;y++){var x=b[y];typeof x!="string"&&"work"in x?v.push(jn(x.work,x)):v.push(jn(x))}else v.push(jn(e));for(var w=Xa(v),E=function(W){var Z=C,ee=new co({allowHosts:W.allowHosts,get requestProxy(){return Z.requestProxy},get networkSubscribe(){return Z.networkSubscribe}});jh(W,ee)},C=this,M=0,R=w;M<R.length;M++){var L=R[M];E(L)}this.lastWorks=this.works,r===void 0&&(r="inherit"),r==="inherit"&&this.lastWorks.length===0&&(r="initial");var S=w.initial,I=S.work.observers[0],O=I?{workCode:I.work.workCode,panoIndex:I.panoIndex}:{workCode:S.work.workCode,panoIndex:0},P=(s=S.mode)!==null&&s!==void 0?s:I?"Panorama":"Mapview",F={};if(r==="inherit"){P=this.currentMode;var V=w.resolvedObservers[this.panoIndex];V?O={workCode:V.work.workCode,panoIndex:V.panoIndex}:typeof w.initial.panoIndex=="number"?O={workCode:w.initial.work.workCode,panoIndex:w.initial.panoIndex}:(P==="Panorama"||P==="VRPanorama"||P==="XRPanorama")&&(P="Mapview"),F={longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,distance:this.camera.pose.distance,offset:this.camera.pose.offset.clone()}}else if(r==="initial")typeof S.panoIndex=="number"&&(O={workCode:S.work.workCode,panoIndex:S.panoIndex}),S.mode&&(P=S.mode),F={longitude:S.longitude,latitude:S.latitude,fov:S.fov,distance:S.distance,offset:(l=S.offset)===null||l===void 0?void 0:l.clone()};else{if(P=(u=r.mode)!==null&&u!==void 0?u:this.currentMode,typeof r.panoIndex=="number"){var V=w.getResolvedObserver({workCode:(f=(c=r.workCode)!==null&&c!==void 0?c:S.work.workCode)!==null&&f!==void 0?f:"",panoIndex:r.panoIndex});V&&(O={workCode:V.work.workCode,panoIndex:V.panoIndex})}F={longitude:r.longitude,latitude:r.latitude,fov:r.fov,distance:r.distance,offset:r.offset}}var D=k(k(k({},O),{mode:P}),F);this.emit("works.request",_("works.request",{input:e,works:w,state:D,userAction:a}));var z=function(){var W,Z;o.pano=O;var ee=(W=g.duration)!==null&&W!==void 0?W:o.modeChangeDuration,Y="fly";(o.currentMode==="Panorama"||o.currentMode==="VRPanorama"||o.currentMode==="XRPanorama")&&o.currentMode===P&&(Y=(Z=g.effect)!==null&&Z!==void 0?Z:"fade");var ie=k(k({initial:{state:D,currentState:o.getCurrentState(),duration:ee,effect:Y,userAction:a}},o.commonParams()),o.controllerInits[P]);if(o.controller&&o.currentMode===P)o.controller.updateWork(w,D,{effect:Y,duration:ee},a)===!1&&(o.controller.destroy(),o.controller=o.applyController(P,ie));else{var te=o.currentMode,le=Ft[P].initAnimationEndState(ie);if(o.controller)o.controller.destroy();else{var oe=Ft[P].initAnimationEndState(ie);o.camera.setFromPose(oe),o.modelGroup.visible=!0,o.emit("camera.update",_("camera.update",{state:o.getCurrentState(),userAction:a}))}o.controller=o.applyController(P,ie);var xe=_("mode.change",{prevMode:te,mode:P,state:le,userAction:a});o.emit("mode.change",xe)}};if(La.set(this,w),!this.controller){var U=k(k({initial:{state:D,currentState:this.getCurrentState(),duration:(m=g.duration)!==null&&m!==void 0?m:this.modeChangeDuration,effect:(A=g.effect)!==null&&A!==void 0?A:"fade",userAction:a}},this.commonParams()),this.controllerInits[P]),H=Ft[P].initAnimationEndState(U);this.camera.setFromPose(H),this.emit("camera.update",_("camera.update",{state:this.getCurrentState(),userAction:a}))}if(this.updateConfiguration(g,!1),P===t.Mode.Floorplan||P===t.Mode.Topview||P===t.Mode.Mapview||P===t.Mode.Model)this.loadModel(w,g).then(function(){o.needsRender=!0,o.modelSceneNeedsRender=!0,z(),o.emit("camera.update",_("camera.update",{state:o.getCurrentState(),userAction:a}))});else{if(!this.controller){var K=new d.Vector3,j=w.getResolvedObserver(O);j&&K.copy(j.position),this.camera.setFromPose({fov:F.fov,longitude:F.longitude,latitude:F.latitude,distance:F.distance,offset:(h=F.offset)!==null&&h!==void 0?h:K}),this.needsRender=!0,this.modelSceneNeedsRender=!0}z();var J=!1,X=function(){o.works===w&&J===!1&&(o.needsRender=!0,o.modelSceneNeedsRender=!0,o.emit("camera.update",_("camera.update",{state:o.getCurrentState(),userAction:a})),o.loadModel(w,g),J=!0)};this.controller.once("pano.arrived",X),this.controller.once("pano.cancel",X),setTimeout(X,((p=g.duration)!==null&&p!==void 0?p:this.modeChangeDuration)+1e3)}return this.emit("works.load",_("works.load",{input:e,state:this.getCurrentState(),userAction:a,works:w})),this.ready().then(function(){var W;o.emit("works.ready",_("works.ready",{input:e,state:o.getCurrentState(),userAction:a,works:w})),(W=o.analysis)===null||W===void 0||W.work(w)})},t.prototype.reset=function(){var e=this,r=this.lastLoadWorkTask.then(function(){return e.reset_()});return this.lastLoadWorkTask=r.catch(function(i){e.throwError(i)}),r},t.prototype.reset_=function(){var e=this;return new Promise(function(r){var i;e.controller&&(e.controller.destroy(),e.controller=void 0);var a=e.models.getMaterial();a&&(a.pano0&&a.pano0.map.dispose(),a.pano1&&a.pano1.map!==((i=a.pano0)===null||i===void 0?void 0:i.map)&&a.pano1.map.dispose()),e.models.setMaterial({pano0:null,pano1:null});for(var o=0,s=e.models;o<s.length;o++){var l=s[o];e.lastModels.push(l)}if(e.models.length=0,e.lastModels.length>0){for(var u=0,c=e.lastModels;u<c.length;u++){var l=c[u];e.modelGroup.remove(l),l.dispose(),e.needsRender=!0,e.modelSceneNeedsRender=!0}e.lastModels.length=0}e.lastWorks&&delete e.lastWorks,La.delete(e),e.currentMode="Panorama",e.pano={workCode:"",panoIndex:0},e.camera.setFromPose({distance:0,fov:A0,longitude:0,latitude:0,offset:new d.Vector3(0,0,0)}),e.state={mode:e.currentMode,workCode:e.pano.workCode,panoIndex:e.pano.panoIndex,longitude:e.camera.pose.longitude,latitude:e.camera.pose.latitude,fov:e.camera.pose.fov,offset:e.camera.pose.offset.clone(),distance:e.camera.pose.distance},e.models.needsRender=!1,e.camera.needsRender=!1,e.needsRender=!1,e.modelSceneNeedsRender=!1,r()})},t.prototype.changeMode=function(e,r,i,a,o){var s=this;return r===void 0&&(r={}),a===void 0&&(a=!0),o===void 0&&(o=!1),new Promise(function(l,u){var c,f,m,A;if(!s.renderer)throw new Error("renderer is not initialized.");r=k({},r);var h=0;s.controller&&(typeof i=="number"?h=i:h=(c=i==null?void 0:i.duration)!==null&&c!==void 0?c:s.modeChangeDuration);var p="fly";s.controller&&typeof i=="object"&&i.effect&&(p=i.effect);var g=typeof r.panoIndex=="number"?{workCode:(A=(f=r.workCode)!==null&&f!==void 0?f:(m=s.work)===null||m===void 0?void 0:m.workCode)!==null&&A!==void 0?A:"",panoIndex:r.panoIndex}:s.pano;if(!t.Mode.hasOwnProperty(e)){var v=new Error('mode "'.concat(e,'" is not existed'));s.throwError(v),u(v);return}if((e===t.Mode.Floorplan||e===t.Mode.Topview||e===t.Mode.Mapview||e===t.Mode.Model)&&!s.models.loaded){var v=new Error("model is not ready.");s.throwError(v),u(v);return}if((e===t.Mode.Panorama||e===t.Mode.VRPanorama||e===t.Mode.XRPanorama)&&!s.works.getResolvedObserver(g)){var v=new Error("PanoId ".concat(De(g)," not existed."));s.throwError(v),u(v);return}var y=s.controller,b=s.currentMode,x=function(){if(s.controller&&s.controller.stopMomentumMovement(),s.controller&&o===!1&&b===e)e===t.Mode.Panorama||e===t.Mode.Model||e===t.Mode.VRPanorama||e===t.Mode.XRPanorama?Yt(s.pano,g)&&"moveToPano"in s.controller&&typeof s.controller.moveToPano=="function"?s.controller.moveToPano(g,k({duration:h},r),a):s.controller.updateCamera(r,h,a).catch(Q):(Yt(s.pano,g)||(s.pano=g),s.controller.updateCamera(r,h,a).catch(Q));else{var E=k(k({},r),g),C=k(k({initial:{state:E,currentState:s.getCurrentState(),duration:h,effect:p,userAction:a}},s.commonParams()),s.controllerInits[e]),M=Ft[e].initAnimationEndState(C),R=_("mode.change.request",{prevMode:s.currentMode,mode:e,state:M,userAction:a});if(s.emit("mode.change.request",R),!R.defaultPrevented){y&&y.destroy(),s.controller=s.applyController(e,C);var L=_("mode.change",{prevMode:s.currentMode,mode:e,state:M,userAction:a});s.emit("mode.change",L)}}l()};if(e===t.Mode.VRPanorama)s.requestFullscreen(),pp().then(function(){return x()}).catch(function(E){E instanceof Error&&(s.exitFullscreen(),s.throwError(E),u(E))});else if(e===t.Mode.XRPanorama){var w=dt.shared.getContext();w?w.end():vp().then(function(E){dt.shared.setContext(E),x()}).catch(function(E){E instanceof Error&&(s.throwError(E),u(E))})}else x()})},t.prototype.getPixels=function(e,r,i,a,o,s,l){if(!this.renderer)throw new Error("renderer is not initialized.");var u=this.renderer.getPixelRatio(),c=this.renderer.getRenderTarget(),f=this.renderer.getSize(new d.Vector2);e=Math.ceil(e),r=Math.ceil(r),i=Math.ceil(i),a=Math.ceil(a),o=Math.ceil(o!=null?o:u),s=s!=null?s:!1;var m=this.getPixelsRenderTarget;m.setSize(i*o,a*o),this.renderer.setRenderTarget(m),this.camera.setViewOffset(f.width,f.height,e,f.height-r-a,i,a),this.camera.pixelRatio=o,this.camera.resolution.set(i,a),this.camera.aspect=this.camera.resolution.width/this.camera.resolution.height;for(var A=0,h=this.scene.children;A<h.length;A++){var p=h[A];p instanceof d.Object3D&&p.traverseVisible(function(S){S.setResolution&&S.setResolution(i*o/u,a*o/u)})}this.controller?(this.controller.updateRenderSize(new d.Vector2(i*o,a*o)),this.controller.render(!0,this.postProcessingType)):(this.renderer.render(this.scene,this.camera),this.renderer.autoClearDepth=!1,this.renderer.autoClearColor=!1,this.renderer.render(this.modelScene,this.camera),this.renderer.autoClearDepth=!0,this.renderer.autoClearColor=!0);var g=i*o,v=a*o,y=g*v,b=y*4,x;try{if(l){if(l.length!==b)throw new Error("buffer length is not equals pixels ".concat(b))}else l=new Uint8Array(b);if(this.renderer.readRenderTargetPixels(m,0,0,i*o,a*o,l),s)for(var w=y/2,E=0,C=0,M=0,R=0;C<w;C++)for(R=(v-Math.floor(C/g)-1)*g+C%g,M=0;M<4;M++)E=l[C*4+M],l[C*4+M]=l[R*4+M],l[R*4+M]=E}catch(S){x=S}if(this.renderer.setRenderTarget(c),this.controller&&this.controller.updateRenderSize){var L=new d.Vector2;this.renderer.getDrawingBufferSize(L),this.controller.updateRenderSize(L)}if(this.camera.clearViewOffset(),this.camera.pixelRatio=u,this.getSize(this.camera.resolution),this.camera.aspect=this.camera.resolution.width/this.camera.resolution.height,x)throw x;return l},t.prototype.getElement=function(){var e;return(e=this.renderer)===null||e===void 0?void 0:e.domElement},Object.defineProperty(t.prototype,"observers",{get:function(){return this.works.resolvedObservers},enumerable:!1,configurable:!0}),t.prototype.render=function(e,r){var i=this;if(r===void 0&&(r=!1),!this.renderer)return null;if(r){var a=this.renderer.getSize(hm);this.scene.traverseVisible(function(o){o.setResolution&&o.setResolution(a.x,a.y)})}return this.aroundScissor(function(){i.renderer&&(i.controller?(i.controller.render(i.onlyRenderIfNeeds?i.modelSceneNeedsRender:!0,i.postProcessingType),i.info={memory:k({},i.controller.renderer.info.memory),render:k({},i.controller.renderer.info.render)}):(i.renderer.render(i.scene,i.camera),i.info={memory:k({},i.renderer.info.memory),render:k({},i.renderer.info.render)}),i.poweredByRealsee&&i.currentMode!=="VRPanorama"&&i.currentMode!=="XRPanorama"&&i.renderer.getRenderTarget()!==i.getPixelsRenderTarget&&cm(i.renderer)),e&&dt.shared.add(e,!0)}),null},t.prototype.updateTime=function(e,r){for(var i,a=this,o=[],s=2;s<arguments.length;s++)o[s-2]=arguments[s];if(!this.destroyed){if(this.works.update(),this.syncingState=this.syncState(e,r),this.controller&&(i=this.controller).updateTime.apply(i,Et([e,r],o,!1)),this.renderer&&(this.camera.pixelRatio=this.renderer.getPixelRatio(),this.getSize(this.camera.resolution),this.camera.aspect=this.camera.resolution.width/this.camera.resolution.height),this.camera.updateTime(e,r),this.renderer){Kn.detectSupport(this.renderer);var l=this.models.loaded,u=this.models.refined;if(this.models.update(this.renderer,this.camera,this.currentMode),l===!1&&this.models.loaded===!0&&this.emit("models.load",_("models.load",{models:this.models})),u===!1&&this.models.refined===!0&&this.emit("models.refined",_("models.refined",{models:this.models})),this.models.loaded){for(var c=0,f=this.models;c<f.length;c++){var m=f[c];m.parent!==this.modelGroup&&(this.modelGroup.add(m),this.needsRender=!0,this.modelSceneNeedsRender=!0)}if(this.lastModels.length>0){for(var A=0,h=this.lastModels;A<h.length;A++){var m=h[A];this.modelGroup.remove(m),m.dispose(),this.needsRender=!0,this.modelSceneNeedsRender=!0}this.lastModels.length=0}this.lastWorks&&delete this.lastWorks}this.lastModels.setMaterial(this.models.getMaterial()),this.lastModels.materialVersion=this.models.materialVersion,this.lastModels.update(this.renderer,this.camera,this.currentMode)}this.syncingState=!1;var p=new d.Vector2(512,512),g=new d.Vector2(512,512);this.renderer&&(this.renderer.getSize(p),p.x*=this.scissor.width,p.y*=this.scissor.height,this.renderer.getDrawingBufferSize(g),g.x*=this.scissor.width,g.y*=this.scissor.height);{for(var v=new d.Box3,y=new d.Box3,b=new d.Vector3(4,4,4),x=0,w=this.works.resolvedObservers;x<w.length;x++){var E=w[x];y.setFromCenterAndSize(E.position,b),v.union(y)}if(v.union(this.models.bounding),this.lastWorks)for(var C=0,M=this.lastWorks.resolvedObservers;C<M.length;C++){var E=M[C];y.setFromCenterAndSize(E.position,b),v.union(y)}v.union(this.lastModels.bounding),v.getCenter(this.boundingMesh.position),v.getSize(this.boundingMesh.scale),this.boundingMesh.boundingBox.copy(v),this.renderer&&this.boundingMesh.update(this.renderer,this.camera,this.model)}var R=_("render.prepare",{needsRender:!0,info:null});if(this.emit("render.prepare",R),!R.defaultPrevented){var L=[];gi.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),Ai.setFromProjectionMatrix(gi);for(var S=0,I=this.scene.children;S<I.length;S++){var O=I[S];O!==this.modelGroup&&O!==this.boundingMesh&&O instanceof d.Object3D&&O.traverseVisible(function(U){if(U.setResolution&&U.setResolution(p.x,p.y),U.setTime&&U.setTime(e),U.mixer instanceof d.AnimationMixer){var H=g0.get(U.mixer);H||(H=new d.Clock,g0.set(U.mixer,H)),U.mixer.update(H.getDelta())}(U instanceof d.Mesh||U instanceof d.Line||U instanceof d.Points)&&(U instanceof d.ImmediateRenderObject||!U.frustumCulled||Ai.intersectsObject(U))&&L.push(U)})}if(g.width*g.height>4096*2048?this.renderSwitch01=this.renderSwitch01^1:this.renderSwitch01=0,this.renderer&&this.paused===!1&&this.renderSwitch01===0){var P=void 0;if(this.onlyRenderIfNeeds!==!0)P=this.render();else{if(this.controller&&(this.controller.needsRender===!0&&(this.controller.needsRender=!1,this.needsRender=!0),this.controller.modelSceneNeedsRender===!0&&(this.controller.modelSceneNeedsRender=!1,this.modelSceneNeedsRender=!0)),this.camera.needsRender===!0&&(this.camera.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0),this.models.needsRender===!0&&(this.models.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0),this.needsRender!==!0)for(var F=0,V=L;F<V.length;F++){var D=V[F],z=function(U){U.needsRender===!0?(U.needsRender=!1,a.needsRender=!0):U.mixer&&U.mixer.stats.actions.inUse>0&&(a.needsRender=!0)};z(D),D.traverseAncestors(z)}(this.needsRender!==!1||this.modelSceneNeedsRender!==!1)&&(P=this.render())}this.needsRender=!1,this.modelSceneNeedsRender=!1,this.hasListener("render")&&this.emit("render",_("render",{needsRender:P!==void 0,info:this.info}))}this.needsRender=!1,this.modelSceneNeedsRender=!1}this.fps.testTime&&e-this.fps.testTime<1e3?this.fps.testCount++:(this.emit("fps",this.fps.testCount),this.fps.testTime=e,this.fps.testCount=0)}},t.prototype.pause=function(){this.paused=!0,this.renderer&&this.renderer instanceof nn&&this.renderer.clear(!0,!0,!0)},t.prototype.play=function(){this.needsRender=!0,this.modelSceneNeedsRender=!0,this.paused=!1},t.prototype.moveToPano=function(e,r,i){r===void 0&&(r={}),i===void 0&&(i=!0);var a=this,o=a.controller,s=a.renderer;if(!o)return this.throwError(new Error("controller is not initialized.")),Promise.resolve();if(!s)return this.throwError(new Error("renderer is not initialized.")),Promise.resolve();var l=this.works.getResolvedObserver(e);if(!l)return this.throwError(new Error("pano ".concat(JSON.stringify(e)," not existed."))),Promise.resolve();var u={workCode:l.work.workCode,panoIndex:l.panoIndex};return"moveToPano"in o&&typeof o.moveToPano=="function"?o.moveToPano(u,r,i):l&&(this.pano=u,this.once("initAnimation.start",function(c){r.moveStartCallback&&r.moveStartCallback(c.state)}),this.once("initAnimation.end",function(c){r.moveEndCallback&&r.moveEndCallback(c.state)}),this.changeMode(t.Mode.Panorama,r,{effect:r.effect},i)),this.ready()},t.prototype.preloadPano=function(e,r){var i=this;r===void 0&&(r=Q);var a=this.works.getResolvedObserver(e);if(!a)return Promise.reject(new Error("Pano ".concat(JSON.stringify(e)," never found")));var o=["right","left","up","down","front","back"],s=Ee();return Promise.all(o.map(function(l){var u=k({key:"pano.".concat(a.panoId,".").concat(l)},Dt(i.imageOptions,["size","format","quality","mappings"])),c=a.images[l],f=i.imageOptions.transform?i.imageOptions.transform(c,u):lt(c,u);return it(a.work).preload(f)})).then(function(){var l=Ee()-s;return r(l),l})},t.prototype.project2d=function(e,r){if(r===void 0&&(r=!1),!this.renderer)return null;if(this.models.length>0&&r){var i=this.camera.position,a=e.clone().sub(i),o=new d.Raycaster(i,a.clone().normalize());o.params.Points={threshold:.1};var s=this.models.intersectRaycaster(o)[0];if(s&&s.distance+.01<a.length())return null}var l=e.clone().project(this.camera);if(Math.abs(l.z)>1)return null;var u=this.renderer.getSize(new d.Vector2),c=u.x*this.scissor.width,f=u.y*this.scissor.height,m=u.x*this.scissor.left+(l.x+1)/2*c,A=u.y*(1-this.scissor.bottom-this.scissor.height)+(-l.y+1)/2*f;return new d.Vector2(m,A)},t.prototype.getRenderObjects=function(e){gi.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),Ai.setFromProjectionMatrix(gi),e||(e=this.scene);var r=[];return e.traverseVisible(function(i){(i instanceof d.Mesh||i instanceof d.Line||i instanceof d.Points)&&(i instanceof d.ImmediateRenderObject||!i.frustumCulled||Ai.intersectsObject(i))&&r.push(i)}),r},t.prototype.getCurrentState=function(){return k(k({},this.getPose()),{mode:this.currentMode,workCode:this.pano.workCode,panoIndex:this.pano.panoIndex})},t.prototype.setState=function(e,r,i){var a,o,s,l,u,c,f,m,A,h;r===void 0&&(r=!1),i===void 0&&(i=!0),e=Object.assign({},e),e.offset&&!(e instanceof d.Vector3)&&(e.offset=new d.Vector3(e.offset.x,e.offset.y,e.offset.z));var p;typeof e.panoIndex=="number"&&(e.workCode?p={workCode:e.workCode,panoIndex:e.panoIndex}:p={workCode:(o=(a=this.work)===null||a===void 0?void 0:a.workCode)!==null&&o!==void 0?o:"",panoIndex:e.panoIndex});var g=(s=e.mode)!==null&&s!==void 0?s:this.state.mode,v,y,b,x,w;if((e.mode===t.Mode.Floorplan||e.mode===t.Mode.Topview||e.mode===t.Mode.Mapview||e.mode===t.Mode.Model)&&!this.models.loaded){this.throwError(new Error("model is not ready."));return}if(this.controller&&this.controller.stopMomentumMovement(),this.state.mode!==g){if(g==="VRPanorama"){this.changeMode("VRPanorama",void 0,void 0,!0);return}var E={workCode:p==null?void 0:p.workCode,panoIndex:p==null?void 0:p.panoIndex};typeof e.longitude=="number"&&(E.longitude=e.longitude),typeof e.latitude=="number"&&(E.latitude=e.latitude),typeof e.fov=="number"&&(E.fov=e.fov),typeof e.distance=="number"&&(E.distance=e.distance),e.offset instanceof d.Vector3&&(E.offset=e.offset);var C=k(k({initial:{state:E,currentState:this.getCurrentState(),duration:this.modeChangeDuration,effect:"fly",userAction:!1}},this.commonParams()),this.controllerInits[g]),M=Ft[g].initAnimationEndState(C);v=M.longitude,y=M.latitude,b=M.fov,x=M.offset,w=M.distance}else v=(l=e.longitude)!==null&&l!==void 0?l:this.state.longitude,y=(u=e.latitude)!==null&&u!==void 0?u:this.state.latitude,b=(c=e.fov)!==null&&c!==void 0?c:this.state.fov,x=(f=e.offset)!==null&&f!==void 0?f:this.state.offset,w=(m=e.distance)!==null&&m!==void 0?m:this.state.distance;var R={workCode:(p!=null?p:this.pano).workCode,panoIndex:(p!=null?p:this.pano).panoIndex,mode:g,longitude:v,latitude:y,fov:b,offset:x,distance:w};this.emit("state.set",_("state.set",{userAction:i,state:R})),zr(this.state,R)||(this.controller&&R.mode==="VRPanorama"&&R.mode!==this.state.mode?(ur(this.state,R),this.changeMode("VRPanorama")):this.controller&&R.mode==="XRPanorama"&&R.mode!==this.state.mode?(ur(this.state,R),this.changeMode("XRPanorama")):(ur(this.state,R),this.controller&&i&&(this.controller.userAction=!1),r&&this.state.mode===R.mode&&(this.syncingState=this.syncState(Ee(),0,r),this.syncingState&&((A=this.controller)===null||A===void 0||A.updateTime(Ee(),0),this.syncingState=!1)),this.emit("state.change",_("state.change",{userAction:i,state:this.state})),(h=this.analysis)===null||h===void 0||h.state(this.works,this.state)))},t.prototype.aroundScissor=function(e){if(this.renderer){if(this.state.mode==="XRPanorama"){e();return}var r=new d.Vector2,i=this.scissor.left!==0||this.scissor.bottom!==0||this.scissor.width!==1||this.scissor.height!==1;if(i){this.renderer.getSize(r);var a=Math.floor(r.x*this.scissor.left),o=Math.floor(r.y*this.scissor.bottom),s=Math.floor(r.x*this.scissor.width),l=Math.floor(r.y*this.scissor.height);this.renderer.setViewport(a,o,s,l),this.renderer.setScissor(a,o,s,l),this.renderer.setScissorTest(!0)}e(),i&&(this.renderer.setViewport(0,0,r.x,r.y),this.renderer.setScissor(0,0,r.x,r.y),this.renderer.setScissorTest(!1))}},t.prototype.syncState=function(e,r,i){i===void 0&&(i=!1);var a=this.stateSynced;if(this.stateSynced=!1,this.works.length===0||!this.controller)return!1;if(this.state.mode!==this.currentMode){var o={mode:this.state.mode,workCode:this.state.workCode,panoIndex:this.state.panoIndex,longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset,distance:this.state.distance};return this.changeMode(this.state.mode,o,this.modeChangeDuration,this.controller.userAction),!0}if(!this.controller.isReady())return!1;if(this.controller instanceof Ft.Model){if(Mi(this.camera.pose.offset,this.state.offset)){var s={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset};return this.controller.moveToPosition(this.state.offset,k(k({},s),{duration:i?0:void 0}),!1),!0}}else{var l={workCode:this.state.workCode,panoIndex:this.state.panoIndex};if(!Yt(l,this.pano)&&"moveToPano"in this.controller&&typeof this.controller.moveToPano=="function"){var s={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset,distance:this.state.distance};return this.controller.moveToPano(l,s,!1),!0}}if(this.controller instanceof Ft.Floorplan||this.controller instanceof Ft.Topview||this.controller instanceof Ft.Mapview){var u=1,c=.2,f=.2,m=Math.PI/45,A=i?this.state.fov:wa(this.camera.pose.fov,this.state.fov,u),h=Math.abs(this.camera.pose.distance-this.state.distance),p=h>f*15?h/15:c,g=i?this.state.distance:wa(this.camera.pose.distance,this.state.distance,p),v=this.camera.pose.offset.distanceTo(this.state.offset),y=v>f*15?v/15:f,b=i?new d.Vector3().copy(this.state.offset):fp(this.camera.pose.offset,this.state.offset,y),x=i?{longitude:this.state.longitude,latitude:this.state.latitude}:js({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},m),w=x.longitude,E=x.latitude;if(Lt(A,this.camera.pose.fov)||Mi(b,this.camera.pose.offset)||Lt(g,this.camera.pose.distance)||Lt(w,this.camera.pose.longitude,Math.PI*2)||Lt(E,this.camera.pose.latitude)){var C={x:b.x,y:b.y,z:b.z},M={fov:A};return Object.assign(C,{distance:g}),Object.assign(M,{longitude:w,latitude:E}),this.controller.stopMomentumMovement(),this.controller.cameraMotion.set(M,0).catch(Q),this.controller.locationMotion.set(C,0).catch(Q),!0}}else{var R=1,L=Math.PI/45,A=i?this.state.fov:wa(this.camera.pose.fov,this.state.fov,R),S=i?{longitude:this.state.longitude,latitude:this.state.latitude}:js({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},L),w=S.longitude,E=S.latitude,g=this.state.distance,b=new d.Vector3().copy(this.state.offset);if(Lt(g,this.camera.pose.distance)&&(this.state.distance=this.camera.pose.distance),Mi(b,this.camera.pose.offset)&&(this.state.offset=this.camera.pose.offset.clone()),Lt(w,this.camera.pose.longitude,Math.PI*2)||Lt(E,this.camera.pose.latitude)||Lt(A,this.camera.pose.fov))return this.controller.stopMomentumMovement(),this.controller.cameraMotion.set({longitude:w,latitude:E,fov:A},0).catch(Q),!0}if(this.stateSynced=!0,a===!1&&this.emit("state.synced",_("state.synced",{userAction:!1,state:this.state})),this.readyCallbacks.length&&this.stateSynced){var I=this.currentMode,O=I===t.Mode.Floorplan||I===t.Mode.Topview||I===t.Mode.Mapview||I===t.Mode.Model;if(!O||this.models.loaded){var P=this.readyCallbacks.slice();this.readyCallbacks.length=0;for(var F=0,V=P;F<V.length;F++){var D=V[F];this.controller instanceof Ft.Panorama&&D.tile===!0&&!this.controller.isTileReady()?this.readyCallbacks.push(D):D()}}}return!1},t.prototype.ready=function(e){var r=this;return e===void 0&&(e={}),new Promise(function(i){var a;r.readyCallbacks.push(Object.assign(i,{tile:(a=e.tile)!==null&&a!==void 0?a:!1}))})},t.prototype.requestFullscreen=function(){var e;if(zn){var r=(e=this.getElement())===null||e===void 0?void 0:e.parentNode;r&&"requestFullscreen"in r&&typeof document!="undefined"&&document.fullscreenElement===null&&r.requestFullscreen()}},t.prototype.exitFullscreen=function(){typeof document!="undefined"&&document.fullscreenElement&&"exitFullscreen"in document&&document.exitFullscreen()},t.prototype.throwError=function(e){this.hasListener("error")?this.emit("error",e):console.error(e)},t.prototype.loadModel=function(e,r){for(var i=this,a=[],o=function(g){var v=s.models.filter(function(b){var x;return((x=b.work)===null||x===void 0?void 0:x.workCode)===g.workCode})[0];if(v)v.work=g,a.push(v);else{var y=new Za({onError:function(b){i.emit("model.error",_("model.error",{work:g,model:y,error:b})),i.throwError(b)},onShownFloorChange:function(b){i.emit("model.changeShownFloor",_("model.changeShownFloor",{work:g,model:y,error:null}))},onLoad:function(){i.emit("model.load",_("model.load",{work:g,model:y,error:null}))}});a.push(y),s.emit("model.request",_("model.request",{work:g,model:y,error:null})),y.load(g,{textureOptions:s.textureOptions,"3d-tiles":r["3d-tiles"]})}},s=this,l=0,u=e;l<u.length;l++){var c=u[l];o(c)}if(this.models.length>0){for(var f=0,m=this.models;f<m.length;f++){var A=m[f];a.indexOf(A)===-1&&this.lastModels.push(A)}this.models.length=0}for(var h=0,p=a;h<p.length;h++){var A=p[h];this.models.push(A)}return this.renderer&&(this.models.loaded=!1),new Promise(function(g){i.on("models.load",function(){g()})})},t.prototype.commonParams=function(){return{ident:this.ident,scene:this.scene,xrCustomObjectsScene:this.xrCustomObjectsScene,helper:this.helperGroup,boundingMesh:this.boundingMesh,camera:this.camera,renderer:this.renderer,scissor:this.scissor,element:this.getElement(),models:this.models,works:this.works,imageOptions:this.imageOptions,enableWheel:this.enableWheel,enableIOSEDR:this._enableIOSEDR,enableEDL:this.enableEDL,enableHQ:this.enableHQ,extraElements:this.extraElements,videoTexture:this.videoTexture,modelScene:this.modelScene,modelRenderTarget:this.modelRenderTarget}},t.prototype.applyController=function(e,r){var i=this;if(!this.renderer)throw new Error("renderer is not initialized.");e!==t.Mode.Mapview&&(this.enableEDL=!1,this.enableHQ=!1);var a=Ft[e];this.currentMode=e;for(var o=new a(r),s=function(A){o.on(A,function(){for(var h=[],p=0;p<arguments.length;p++)h[p]=arguments[p];var g=i.emit.apply(i,Et([A],h,!1));if(g)return!1})},l=0,u=il;l<u.length;l++){var c=u[l];s(c)}{var f=Ft[e].initAnimationEndState(r),m=r.initial.userAction;zr(this.state,f)||(ur(this.state,f),this.emit("state.change",_("state.change",{userAction:m,state:this.state}))),this.emit("currentState.change",_("currentState.change",{userAction:m,state:this.getCurrentState()}))}return o.on("camera.update",function(A){var h;if(i.controller){var p=i.controller.getTargetState();A.userAction&&i.syncingState===!1&&i.state.mode===p.mode&&!zr(i.state,p)&&(ur(i.state,p),i.emit("state.change",_("state.change",{userAction:A.userAction,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}i.emit("currentState.change",_("currentState.change",{userAction:A.userAction,state:i.getCurrentState()}))}),o.on("initAnimation.start",function(A){var h,p=A.state,g=A.userAction;g&&i.state.mode===p.mode&&!zr(i.state,p)&&(ur(i.state,p),i.emit("state.change",_("state.change",{userAction:g,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),o.on("initAnimation.end",function(A){var h,p=A.state,g=A.userAction;g&&i.state.mode===p.mode&&!zr(i.state,p)&&(ur(i.state,p),i.emit("state.change",_("state.change",{userAction:g,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),o.on("pano.moveTo",function(A){var h,p=A.state,g=A.userAction;i.pano={workCode:p.workCode,panoIndex:p.panoIndex},g&&i.state.mode===p.mode&&!zr(i.state,p)&&(ur(i.state,p),i.emit("state.change",_("state.change",{userAction:g,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),o.on("pano.arrived",function(A){var h,p=A.state,g=A.userAction;g&&i.state.mode===p.mode&&!zr(i.state,p)&&(ur(i.state,p),i.emit("state.change",_("state.change",{userAction:g,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),o.on("pano.cancel",function(A){var h,p=A.state,g=A.userAction;g&&i.state.mode===p.mode&&!zr(i.state,p)&&(ur(i.state,p),i.emit("state.change",_("state.change",{userAction:g,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),o.on("pano.moveTo",function(A){var h=A.userAction;i.emit("currentState.change",_("currentState.change",{userAction:h,state:i.getCurrentState()}))}),o.on("pano.request",function(A){i.emit("pano.request",A),A.defaultPrevented||i.moveToPano(A.state,A.options,A.userAction)}),o.on("vr.requestExit",function(){i.currentMode===t.Mode.VRPanorama&&(i.exitFullscreen(),i.changeMode(t.Mode.Panorama))}),o.on("error",function(A){return i.throwError(A)}),o},t.prototype.removeEventListeners=function(){},t.prototype.getWorkResources=function(e){var r=this,i,a=this.models.find(function(u){return u.work===e}),o=((i=a==null?void 0:a.viewLayers)!==null&&i!==void 0?i:[]).map(function(u){return u.scene});function s(u){var c=/([0-9a-z\.\_\-]+)([\?\#].*)?$/i.exec(u);if(c){var f=String(c[1]).trim().split(".").slice(1).reverse()[0];if(f)return f}return""}function l(u,c){c===void 0&&(c=0);var f=[];if(u.content&&u.content.uri){var m=s(u.content.uri);if(m==="json"){var A=lt(u.content.uri,{key:"model.".concat(c)});f.push({url:A,type:"tileset"})}else if(m==="at3d"&&u.extras[m]){var A=u.content.uri;f.push({url:A,type:"model"});for(var h=u.extras[m],p=h.textureArray,g=h.textureOptions,v=0,y=p;v<y.length;v++){var b=y[v],x=k({key:"texture.pbm"},Dt(g,["format","quality","size","sharpen","mappings"])),w=sn(b,g==null?void 0:g.transform,x);f.push({url:w,type:"texture"})}}else{var A=lt(u.content.uri,{key:"model.".concat(c)});f.push({url:A,type:"model"})}}if(u.children)for(var E=0;E<u.children.length;E++){var C=u.children[E];f.push.apply(f,l(C,E))}return f}return Promise.all(o.map(function(u){return u.loadAllTilesets()})).then(function(){for(var u=[],c=["right","left","up","down","front","back"],f=0,m=e.observers;f<m.length;f++){for(var A=m[f],h=0,p=c;h<p.length;h++){var g=p[h],v=k({key:"pano.".concat(De(A.pano),".").concat(g)},Dt(r.imageOptions,["size","format","quality","mappings"])),y=A.images[g],b=sn(y,r.imageOptions.transform,v);u.push({url:b,type:"pano"})}if(A.images.tiles)for(var x=0,w=A.images.tiles;x<w.length;x++)for(var E=w[x],C=0,M=c;C<M.length;C++)for(var g=M[C],R=E.size,L=Math.pow(2,E.level),S=1/L,I=0;I<L;I++)for(var O=0;O<L;O++){var P="".concat(A.panoId,".").concat(g,".").concat(E.level,".").concat(I,".").concat(O),v=k(k({key:"pano_tile.".concat(P)},Dt(r.imageOptions,["format","size","quality","sharpen","mappings"])),{size:E.scale>=1?void 0:R*S*E.scale,cut:[R*S*O,R*S*I,R*S,R*S]}),b=sn(E[g],r.imageOptions.transform,v);u.push({url:b,type:"pano_tile"})}}for(var F=0,V=o;F<V.length;F++){var D=V[F];D.tileset.url&&u.push({url:D.tileset.url,type:"model"}),u.push.apply(u,l(D.tileset.root))}return u})},t.Mode={Panorama:"Panorama",Model:"Model",Floorplan:"Floorplan",Topview:"Topview",Mapview:"Mapview",VRPanorama:"VRPanorama",XRPanorama:"XRPanorama"},t.Line=null,t}(Ui),ro={instances:{},constructor:sl};typeof window!="undefined"&&Object.assign(window,{__FIVE_DEBUG__:ro});var pm=function(){function n(){}return n.createButton=function(t){var e=document.createElement("button");function r(){e.style.display="",e.style.cursor="pointer",e.style.left="calc(50% - 50px)",e.style.width="100px",e.textContent="ENTER VR",e.onmouseenter=function(){e.style.opacity="1.0"},e.onmouseleave=function(){e.style.opacity="0.5"},e.onclick=function(){t&&t()}}function i(){e.style.display="",e.style.cursor="auto",e.style.left="calc(50% - 75px)",e.style.width="150px",e.onmouseenter=null,e.onmouseleave=null,e.onclick=null}function a(){i(),e.textContent="VR NOT SUPPORTED"}function o(l){l.style.position="absolute",l.style.bottom="20px",l.style.padding="12px 6px",l.style.border="1px solid #fff",l.style.borderRadius="4px",l.style.background="rgba(0,0,0,0.1)",l.style.color="#fff",l.style.font="normal 13px sans-serif",l.style.textAlign="center",l.style.opacity="0.5",l.style.outline="none",l.style.zIndex="999"}if("xr"in navigator)return e.id="VRButton",e.style.display="none",o(e),navigator.xr.isSessionSupported("immersive-vr").then(function(l){l?r():a()}),e;var s=document.createElement("a");return window.isSecureContext===!1?(s.href=document.location.href.replace(/^http:/,"https:"),s.innerHTML="WEBXR NEEDS HTTPS"):(s.href="https://immersiveweb.dev/",s.innerHTML="WEBXR NOT AVAILABLE"),s.style.left="calc(50% - 90px)",s.style.width="180px",s.style.textDecoration="none",o(s),s},n}();exports.AnimationFrameLoop=dt;exports.Camera=z0;exports.CustomShader=_c;exports.Fetcher=co;exports.Five=sl;exports.InternalWebGLRenderer=nn;exports.IntersectMesh=qi;exports.Model=Za;exports.ModelViewLayer=Ci;exports.NetworkSubscribe=I0;exports.PBMContainer=rd;exports.PBMGroup=jc;exports.PBMMesh=Tt;exports.PBMMeshMaterial=Jr;exports.PBMPointCloud=er;exports.PBMPointCloudMaterial=ii;exports.PROXY_CONTROLLER_EVENT_NAMES=il;exports.PanoCircleMesh=Du;exports.PanoCircleMeshCustom=ip;exports.PanoCircleMeshSolid=ep;exports.Scene=D0;exports.Subscribe=Ui;exports.TextureLoader=Bn;exports.Tile=po;exports.Tile3DModel=an;exports.TileCache=K0;exports.TileCubeTextureTarget=Ne;exports.TileNode=iu;exports.TileRequestScheduler=G0;exports.Tileset=br;exports.Trajectory=j0;exports.TrajectoryNode=Fu;exports.Work=wo;exports.XRButton=pm;exports.defaultImageURLTransform=lt;exports.defaultPbmParameters=me;exports.getViewportScale=al;exports.imageSupport=B0;exports.isPanoId=F0;exports.loadAt3d=Eu;exports.loadB3dm=cu;exports.loadDome=Su;exports.loadDomez=Mu;exports.loadGlb=Iu;exports.loadPbm=bu;exports.loadPly=bo;exports.loadPnts=fu;exports.panoEqual=Yt;exports.panoParse=At;exports.panoStringify=De;exports.parseWork=jn;
|