@realsee/five 6.0.0-alpha.72 → 6.0.0-alpha.73
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/five/index.js +4 -4
- package/five/index.mjs +5 -5
- 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/react/index.js +2 -2
- package/react/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-react.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 +4 -4
- 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: 12/
|
|
5
|
-
* Version: 6.0.0-alpha.
|
|
4
|
+
* Generated: 12/28/2023
|
|
5
|
+
* Version: 6.0.0-alpha.73
|
|
6
6
|
* Terms:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
* Update: July 28, 2021
|
|
@@ -925,7 +925,7 @@ self.onmessage = function(event) {
|
|
|
925
925
|
}
|
|
926
926
|
postMessage({ id: packet.id, error: "type never matched." });
|
|
927
927
|
};
|
|
928
|
-
`),ma=typeof Worker!="undefined"&&typeof Blob!="undefined",Fu="";if(ma)try{var Od=new Blob([Ld],{type:"text/javascript"});Fu=URL.createObjectURL(Od)}catch(n){}var ku=function(){function n(){var t=this;if(!ma)throw new Error("LZMAWorker cannot work in this broswer.");this.callCounter=0,this.requests={};var e=this.worker=new Worker(Fu);e.onmessage=function(r){var i=r.data,a=i.id,o=i.result,s=i.error,u=t.getKey(a);t.requests[u]&&(s?t.requests[u](new Error(s)):t.requests[u](null,o),delete t.requests[u])},e.onerror=function(r){return console.error(r)}}return n.prototype.getKey=function(t){return"key_"+String(t)},n.prototype.decompress=function(t,e){var r=++this.callCounter;this.requests[this.getKey(r)]=e,this.worker.postMessage({type:"decompress",id:r,data:t},[t.buffer])},n.prototype.terminate=function(){this.worker.terminate()},n.support=ma,n}();function Yo(n){return Array.prototype.reduce.call(n,function(t,e,r){return t|e<<r*8},0)}function Vd(n){for(var t=[],e=n.length,r=function(o){var s={data:n[o],offset:0,readByte:function(){return this.data[this.offset++]}},u=s.data.length,c={data:[],offset:0,writeByte:function(h){var p=Math.floor(this.offset/u);this.data[p]||(this.data[p]=new Uint8Array(u)),this.data[p][this.offset%u]=h,this.offset++}};Bd.decompressFile(s,c),i=new Uint8Array(c.offset);for(var l=0;l<c.offset;l++)i[l]=c.data[Math.floor(l/u)][l%u];t.push(i)},i,a=0;a<e;a++)r(a);return t}function Nd(n){for(var t=[],e=n.length,r=function(a){t.push(new Promise(function(o,s){var u=new ku;u.decompress(n[a],function(c,l){if(u.terminate(),c)return s(c);o(l)})}))},i=0;i<e;i++)r(i);return Promise.all(t)}function Lu(n){var t=new Uint8Array(n),e=Yo(t.slice(0,4));if(e>10)return Promise.reject(new Error("LZMA got too many sub chunks."));for(var r=[],i=[],a=4+e*4,o=0;o<e;o++)i[o]=Yo(t.slice(4+o*4,8+o*4)),o===e-1?r[o]=t.subarray(a,a+i[o]):r[o]=t.slice(a,a+i[o]),a+=i[o];return ku.support?Nd(r):Promise.resolve(Vd(r))}var Xi=!1,Ou=[];function Vu(n){if(n===void 0&&(n=!1),!(!n&&Xi)){Xi=!0;var t=Ou.shift();if(t){try{t()}catch(e){}ot.shared.add(function(){return Vu(!0)},!0,2,-100)}else Xi=!1}}function Ai(n){return new Promise(function(t,e){var r=function(){try{t(n())}catch(i){e(i)}};Ou.push(r),ot.shared.add(function(){return Vu()},!0,2,-100)})}function nr(n,t){for(var e={},r=0,i=t;r<i.length;r++){var a=i[r];a in n&&(e[a]=n[a])}return e}function Qd(n,t){for(var e=F({},n),r=0,i=t;r<i.length;r++){var a=i[r];a in e&&delete e[a]}return e}function En(n,t){t===void 0&&(t=!1);var e=typeof n;if(e==="string")return JSON.stringify(n);if(n===!0)return"true";if(n===!1)return"false";if(n===null)return"null";if(n instanceof Array){for(var r="[",i=n.length-1,a=0;a<i;a++)r+=En(n[a],!1)+",";return i>-1&&(r+=En(n[a],!1)),r+"]"}if(n instanceof Object){if(typeof n.toJSON=="function")return En(n.toJSON(),t);for(var o=Object.keys(n).sort(),s=o.length,r="",a=0;a<s;){var u=o[a],c=En(n[u],!0);c!==void 0&&(a&&r!==""&&(r+=","),r+=JSON.stringify(u)+":"+c),a++}return"{"+r+"}"}switch(e){case"function":return JSON.stringify(n.toString());case"undefined":return t?void 0:null;case"number":return n;default:return isFinite(n)?n:null}}function dn(n){return"hash::".concat(En(n,!1))}const kr=Br.Reader,_t=Br.util,Ut=Br.roots["@REALSEE/FIVE:five/loaders/model/proto/pbm.proto"]||(Br.roots["@REALSEE/FIVE:five/loaders/model/proto/pbm.proto"]={}),Nu=Ut.Model=(()=>{function n(t){if(this.chunks=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.chunks=_t.emptyArray,n.prototype.createAt=_t.Long?_t.Long.fromBits(0,0,!0):0,n.prototype.description="",n.decode=function(e,r){e instanceof kr||(e=kr.create(e));let i=r===void 0?e.len:e.pos+r,a=new Ut.Model;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.chunks&&a.chunks.length||(a.chunks=[]),a.chunks.push(Ut.Chunk.decode(e,e.uint32()));break}case 2:{a.createAt=e.uint64();break}case 3:{a.description=e.string();break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Model"},n})();Ut.Chunk=(()=>{function n(t){if(t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.vertices=null,n.prototype.faces=null,n.prototype.name="",n.prototype.texture="",n.decode=function(e,r){e instanceof kr||(e=kr.create(e));let i=r===void 0?e.len:e.pos+r,a=new Ut.Chunk;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.vertices=Ut.Vertices.decode(e,e.uint32());break}case 2:{a.faces=Ut.Faces.decode(e,e.uint32());break}case 3:{a.name=e.string();break}case 4:{a.texture=e.string();break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("vertices"))throw _t.ProtocolError("missing required 'vertices'",{instance:a});if(!a.hasOwnProperty("faces"))throw _t.ProtocolError("missing required 'faces'",{instance:a});if(!a.hasOwnProperty("name"))throw _t.ProtocolError("missing required 'name'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Chunk"},n})();Ut.Vertices=(()=>{function n(t){if(this.xyz=[],this.uvs=[],this.marks=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.xyz=_t.emptyArray,n.prototype.uvs=_t.emptyArray,n.prototype.marks=_t.emptyArray,n.decode=function(e,r){e instanceof kr||(e=kr.create(e));let i=r===void 0?e.len:e.pos+r,a=new Ut.Vertices;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.xyz&&a.xyz.length||(a.xyz=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.xyz.push(e.float())}else a.xyz.push(e.float());break}case 2:{if(a.uvs&&a.uvs.length||(a.uvs=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.uvs.push(e.float())}else a.uvs.push(e.float());break}case 3:{if(a.marks&&a.marks.length||(a.marks=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.marks.push(e.int32())}else a.marks.push(e.int32());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Vertices"},n})();Ut.Faces=(()=>{function n(t){if(this.indices=[],this.normals=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.indices=_t.emptyArray,n.prototype.normals=_t.emptyArray,n.decode=function(e,r){e instanceof kr||(e=kr.create(e));let i=r===void 0?e.len:e.pos+r,a=new Ut.Faces;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.indices&&a.indices.length||(a.indices=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.indices.push(e.uint32())}else a.indices.push(e.uint32());break}case 2:{if(a.normals&&a.normals.length||(a.normals=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.normals.push(e.float())}else a.normals.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Faces"},n})();Ut.VertexMark=(()=>{const n={},t=Object.create(n);return t[n[0]="VERTEX_MARK_UNSPECIFIED"]=0,t[n[1]="VERTEX_MARK_ROOF"]=1,t})();function Qu(n,t){var e,r,i,a={byteLength:0},o=za((e=t.textureOptions)!==null&&e!==void 0?e:{},(i=(r=t.textureArray)===null||r===void 0?void 0:r.length)!==null&&i!==void 0?i:0),s={};if(t.textureArray)for(var u=0,c=t.textureArray;u<c.length;u++){var l=c[u];s[l]=Ua(l,o,t.fetcher)}return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"})}).then(function(h){return a.byteLength=h.body.byteLength,Ai(function(){var p=new Uint8Array(h.body);return Nu.decode(p)})}).then(function(h){return Ai(function(){var p,v;return Uu(h,(p=t.textureBaseUri)!==null&&p!==void 0?p:function(){var m=n.lastIndexOf("/");if(m>=0){var A=n.slice(0,m)+"/";return/\/model\/$/.test(A)&&(A=A.replace(/\/model\/$/,"/materials/")),A}return""}(),((v=t.textureArray)!==null&&v!==void 0?v:[]).slice(),o,s,t.fetcher)})}).then(function(h){var p=new d.Group;p.renderOrder=-4,p.matrixAutoUpdate=!1,p.matrix.compose(p.position,p.quaternion,p.scale),p.name=n;for(var v=0,m=h.objects;v<m.length;v++){var A=m[v];p.add(A)}return h.texturePromise.then(function(){return{type:"pbm",uri:n,byteLength:a.byteLength,object:p,dispose:function(){return h.dispose()}}})})}function Du(n){var t=n.match(/(group|floor)-?(\d+)/);return t?parseInt(t[2],10):0}function ga(n){var t=n.match(/(chunk)-?(\d+)/);return t?parseInt(t[2],10):0}function Dd(n){var t=n.match(/(sub)-?(\d+)/);return t?parseInt(t[2],10):0}function Jo(n){var t=Du(n.name),e=ga(n.name),r=Dd(n.name);return t*1e6+e*1e3+r}function Ud(n){for(var t,e,r,i=typeof n.createAt=="number"?n.createAt:0,a=(t=n.description)!==null&&t!==void 0?t:"",o=[],s=!0,u=!0,c=0,l=n.chunks;c<l.length;c++){var h=l[c];if(!h.vertices.marks||h.vertices.marks.length===0){u=!1;break}}for(var p=0,v=n.chunks;p<v.length;p++){var h=v[p];if(!h.faces.normals||h.faces.normals.length===0){s=!1;break}}for(var m=n.chunks.sort(function(qe,Zt){return Jo(qe)-Jo(Zt)}),A=[],y=0,f=m;y<f.length;y++){var h=f[y],g=Du(h.name);A[g]||(A[g]=[]),A[g].push(h)}for(var b=0;b<A.length;b++){var E=A[b];if(E)if(s){for(var w=0,x=0;x<E.length;x++){var h=E[x];w+=h.faces.indices.length}for(var M=new Float32Array(w*3),C=new Float32Array(w),S=new Float32Array(w*2),P=new Float32Array(w*3),I=[],B=[1/0,1/0,1/0,-1/0,-1/0,-1/0],L=0,k=0;k<E.length;k++){for(var O=[1/0,1/0,1/0,-1/0,-1/0,-1/0],h=E[k],N=h.vertices.xyz,D=h.vertices.uvs,H=h.faces.indices,z=h.faces.normals,U=h.vertices.marks,q=H.length,x=0;x<q;x++){var j=H[x],_=M[L*3+x*3]=N[j*3],Z=M[L*3+x*3+1]=N[j*3+1],W=M[L*3+x*3+2]=N[j*3]+2;C[L+x]=u?U[j]:0,S[L*2+x*2]=D[j*2],S[L*2+x*2+1]=D[j*2+1];var Y=Math.floor(x/3)*3;P[L*3+x*3]=z[Y],P[L*3+x*3+1]=z[Y+1],P[L*3+x*3+2]=z[Y+2],_<O[0]&&(O[0]=_),Z<O[1]&&(O[1]=Z),W<O[2]&&(O[2]=W),_>O[3]&&(O[3]=_),Z>O[4]&&(O[4]=Z),W>O[5]&&(O[5]=W)}O[0]<B[0]&&(B[0]=O[0]),O[1]<B[1]&&(B[1]=O[1]),O[2]<B[2]&&(B[2]=O[2]),O[3]>B[3]&&(B[3]=O[3]),O[4]>B[4]&&(B[4]=O[4]),O[5]>B[5]&&(B[5]=O[5]),I.push({materialIndex:k,name:h.name,chunkName:ga(h.name),start:L,count:h.faces.indices.length,texture:(e=h.texture)!==null&&e!==void 0?e:void 0}),L+=q}var ce={createAt:i,description:a,vertices:M,uvs:S,normals:P,indices:null,floorIndex:b,groups:I,extents:B,vertexMarks:C};o.push(ce)}else{for(var w=0,te=0,x=0;x<E.length;x++){var h=E[x];te+=h.vertices.xyz.length/3,w+=h.faces.indices.length}for(var M=new Float32Array(te*3),S=new Float32Array(te*2),P=new Float32Array(te*3),se=new Float32Array(te),ue=new Uint32Array(w),C=new Float32Array(w),I=[],B=[1/0,1/0,1/0,-1/0,-1/0,-1/0],pe=0,L=0,k=0;k<E.length;k++){for(var O=[1/0,1/0,1/0,-1/0,-1/0,-1/0],h=E[k],N=h.vertices.xyz,U=h.vertices.marks,D=h.vertices.uvs,H=h.faces.indices,he=N.length/3,q=H.length,x=0;x<he;x++){var _=M[L*3+x*3]=N[x*3],Z=M[L*3+x*3+1]=N[x*3+1],W=M[L*3+x*3+2]=N[x*3+2];C[L+x]=u?U[x]:0,S[L*2+x*2]=D[x*2],S[L*2+x*2+1]=D[x*2+1],se[L+x]=b,_<O[0]&&(O[0]=_),Z<O[1]&&(O[1]=Z),W<O[2]&&(O[2]=W),_>O[3]&&(O[3]=_),Z>O[4]&&(O[4]=Z),W>O[5]&&(O[5]=W)}O[0]<B[0]&&(B[0]=O[0]),O[1]<B[1]&&(B[1]=O[1]),O[2]<B[2]&&(B[2]=O[2]),O[3]>B[3]&&(B[3]=O[3]),O[4]>B[4]&&(B[4]=O[4]),O[5]>B[5]&&(B[5]=O[5]);for(var x=0;x<q;x++)ue[pe+x]=L+H[x];I.push({materialIndex:k,name:h.name,chunkName:ga(h.name),start:pe,count:h.faces.indices.length,texture:(r=h.texture)!==null&&r!==void 0?r:void 0}),L+=he,pe+=q}for(var x=0;x<w;x+=3){var de=void 0,be=void 0,fe=void 0,Se=void 0,ee=void 0,le=void 0,X=void 0,Te=void 0,Fe=void 0,Ye=void 0,Xe=void 0,Ge=void 0,ut=void 0,Ne=void 0,me=void 0,Ae=void 0,nt=void 0,Ce=void 0,He=void 0,Oe=void 0,it=void 0;de=ue[x]*3,be=ue[x+1]*3,fe=ue[x+2]*3,Se=M[de],ee=M[de+1],le=M[de+2],X=M[be],Te=M[be+1],Fe=M[be+2],Ye=M[fe],Xe=M[fe+1],Ge=M[fe+2],ut=Ye-X,Ne=Xe-Te,me=Ge-Fe,Ae=Se-X,nt=ee-Te,Ce=le-Fe,He=Ne*Ce-me*nt,Oe=me*Ae-ut*Ce,it=ut*nt-Ne*Ae,P[de]+=He,P[de+1]+=Oe,P[de+2]+=it,P[be]+=He,P[be+1]+=Oe,P[be+2]+=it,P[fe]+=He,P[fe+1]+=Oe,P[fe+2]+=it}var ce={createAt:i,description:a,vertices:M,uvs:S,normals:P,indices:ue,floorIndex:b,groups:I,extents:B,vertexMarks:C};o.push(ce)}}return o}function Ua(n,t,e,r){var i=F({key:"texture.pbm"},nr(t,["format","quality","size","sharpen","mappings"])),a=new An,o=a.loadTexture(n,{imageURL:{transform:t.transform,options:i},wrapS:d.ClampToEdgeWrapping,wrapT:d.ClampToEdgeWrapping,minFilter:d.LinearFilter,maxSize:typeof i.size=="number"?new d.Vector2(i.size,i.size):void 0,fetcher:e}).then(function(s){var u=s.body;return u.needsUpdate=!0,u});return Object.assign(o,{url:n,textureOptions:t})}function Uu(n,t,e,r,i,a,o){i===void 0&&(i={});for(var s=Ud(n),u=0,c="",l=[],h={},p=new Set,v=0,m=s;v<m.length;v++){var A=m[v],y=A.createAt,f=A.description,g=A.vertices,b=A.vertexMarks,E=A.uvs,w=A.normals,x=A.indices,M=A.floorIndex,C=A.groups,S=A.extents,P=new d.Box3;P.min.x=S[0],P.min.y=S[1],P.min.z=S[2],P.max.x=S[3],P.max.y=S[4],P.max.z=S[5];var I=new d.BufferGeometry;I.setAttribute("position",new d.BufferAttribute(g,3)),I.setAttribute("uv",new d.BufferAttribute(E,2)),I.setAttribute("normal",new d.BufferAttribute(w,3)),I.setAttribute("isRoofMark",new d.BufferAttribute(b,1)),x&&I.setIndex(new d.BufferAttribute(x,1)),I.boundingBox=P,I.boundingSphere=P.getBoundingSphere(new d.Sphere);for(var B=0,L=C;B<L.length;B++){var k=L[B];I.addGroup(k.start,k.count,k.materialIndex)}p.add(I);for(var O=[],N=0,D=C;N<D.length;N++){var k=D[N],H=e[k.chunkName]||(k.texture?Et(t||"",k.texture):void 0),z=new Dn;z.defines.USE_VERTEX_FLOOR=!1,z.floor=M,O.push(z),H?h[H]?h[H].push(z):h[H]=[z]:(z.defines.USE_MAP=!1,z.uniforms.diffuse.value=new d.Color(16777215)),p.add(z)}var U=new Gt(I,O);U.name="model_floor_"+M,U.userData.createAt=y,U.userData.description=f,U.matrix.compose(U.position,U.quaternion,U.scale),U.matrixAutoUpdate=!1,U.frustumCulled=!1,U.renderOrder=-1e3+M,u=y,c=f,l.push(U)}var q="",j=function(Z){Z=za(Z,e.length);var W=[],Y=dn(Z);if(q===Y)return Promise.resolve();q=Y;for(var ce=function(pe){var he=null;pe in i&&(dn(i[pe].textureOptions)===dn(Z)?he=i[pe]:i[pe].then(function(de){return de.dispose()})),he||(he=Ua(pe,Z,a)),W.push(he.then(function(de){if(q!==Y){de.dispose();return}for(var be=0,fe=h[pe];be<fe.length;be++){var Se=fe[be];Se.uniforms.map.value&&(p.delete(Se.uniforms.map.value),Se.uniforms.map.value.dispose()),Se.uniforms.map.value=de,p.add(de),Se.uniforms.exposure.value=3.3}}).catch(function(){if(q===Y)for(var de=0,be=h[pe];de<be.length;de++){var fe=be[de];fe.uniforms.map.value&&(p.delete(fe.uniforms.map.value),fe.uniforms.map.value.dispose()),fe.uniforms.map.value=null,fe.defines.USE_MAP=!1,fe.uniforms.diffuse.value=new d.Color(16777215)}}))},te=0,se=Object.keys(h);te<se.length;te++){var ue=se[te];ce(ue)}for(var ue in i)delete i[ue];return Promise.all(W).then(function(){})},_=j(r);return{createAt:u,description:c,objects:l,texturePromise:_,updateTexture:j,dispose:function(){p.forEach(function(Z){Z.dispose()}),p.clear()}}}function za(n,t){return n=Object.assign({},n),n.autoResize!==!1&&(t>96?n.size=Math.min(n.size||1/0,100):t>48?n.size=Math.min(n.size||1/0,200):t>24?n.size=Math.min(n.size||1/0,400):t>22?n.size=Math.min(n.size||1/0,800):t>5&&(n.size=Math.min(n.size||1/0,1024))),n}function zu(n,t){var e,r,i,a={byteLength:0},o=za((e=t.textureOptions)!==null&&e!==void 0?e:{},(i=(r=t.textureArray)===null||r===void 0?void 0:r.length)!==null&&i!==void 0?i:0),s={};if(t.textureArray)for(var u=0,c=t.textureArray;u<c.length;u++){var l=c[u];s[l]=Ua(l,o,t.fetcher)}return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"})}).then(function(h){return Lu(h.body)}).then(function(h){return Ai(function(){for(var p,v={chunks:[],createAt:void 0,description:void 0},m=0,A=h;m<A.length;m++){var y=A[m],f=Nu.decode(y);f.chunks.length&&((p=v.chunks).push.apply(p,f.chunks),v.createAt=f.createAt,v.description=f.description)}return v})}).then(function(h){return Ai(function(){var p,v,m;return Uu(h,(p=t.textureBaseUri)!==null&&p!==void 0?p:function(){var A=n.lastIndexOf("/");if(A>=0){var y=n.slice(0,A)+"/";return/\/model\/$/.test(y)&&(y=y.replace(/\/model\/$/,"/materials/")),y}return""}(),((v=t.textureArray)!==null&&v!==void 0?v:[]).slice(),(m=t.textureOptions)!==null&&m!==void 0?m:{},s,t.fetcher)})}).then(function(h){var p=new d.Group;p.renderOrder=-4,p.name=n;for(var v=0,m=h.objects;v<m.length;v++){var A=m[v];p.add(A)}return h.texturePromise.then(function(){return{type:"at3d",uri:n,byteLength:a.byteLength,object:p,dispose:function(){return h.dispose()}}})})}const ze=Br.Reader,st=Br.util,xe=Br.roots["@REALSEE/FIVE:five/loaders/model/proto/dome.proto"]||(Br.roots["@REALSEE/FIVE:five/loaders/model/proto/dome.proto"]={}),zd=xe.Model=(()=>{function n(t){if(this.meshes=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.meshes=st.emptyArray,n.decode=function(e,r){e instanceof ze||(e=ze.create(e));let i=r===void 0?e.len:e.pos+r,a=new xe.Model;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.meshes&&a.meshes.length||(a.meshes=[]),a.meshes.push(xe.Mesh.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Model"},n})();xe.Mesh=(()=>{function n(t){if(this.chunks=[],this.matrix=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.name="",n.prototype.chunks=st.emptyArray,n.prototype.matrix=st.emptyArray,n.decode=function(e,r){e instanceof ze||(e=ze.create(e));let i=r===void 0?e.len:e.pos+r,a=new xe.Mesh;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.name=e.string();break}case 2:{a.chunks&&a.chunks.length||(a.chunks=[]),a.chunks.push(xe.Chunk.decode(e,e.uint32()));break}case 3:{a.matrix&&a.matrix.length||(a.matrix=[]),a.matrix.push(xe.Matrix.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("name"))throw st.ProtocolError("missing required 'name'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Mesh"},n})();xe.Matrix=(()=>{function n(t){if(this.elements=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.elements=st.emptyArray,n.decode=function(e,r){e instanceof ze||(e=ze.create(e));let i=r===void 0?e.len:e.pos+r,a=new xe.Matrix;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.elements&&a.elements.length||(a.elements=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.elements.push(e.float())}else a.elements.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Matrix"},n})();xe.Chunk=(()=>{function n(t){if(this.material=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.geometry=null,n.prototype.material=st.emptyArray,n.decode=function(e,r){e instanceof ze||(e=ze.create(e));let i=r===void 0?e.len:e.pos+r,a=new xe.Chunk;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 2:{a.geometry=xe.Geometry.decode(e,e.uint32());break}case 3:{a.material&&a.material.length||(a.material=[]),a.material.push(xe.Material.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("geometry"))throw st.ProtocolError("missing required 'geometry'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Chunk"},n})();xe.Geometry=(()=>{function n(t){if(this.groups=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.position=null,n.prototype.uv=null,n.prototype.uv2=null,n.prototype.normal=null,n.prototype.groups=st.emptyArray,n.decode=function(e,r){e instanceof ze||(e=ze.create(e));let i=r===void 0?e.len:e.pos+r,a=new xe.Geometry;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.position=xe.Position.decode(e,e.uint32());break}case 2:{a.uv=xe.UV.decode(e,e.uint32());break}case 3:{a.uv2=xe.UV.decode(e,e.uint32());break}case 4:{a.normal=xe.Normal.decode(e,e.uint32());break}case 5:{a.groups&&a.groups.length||(a.groups=[]),a.groups.push(xe.Group.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("position"))throw st.ProtocolError("missing required 'position'",{instance:a});if(!a.hasOwnProperty("normal"))throw st.ProtocolError("missing required 'normal'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Geometry"},n})();xe.Position=(()=>{function n(t){if(this.array=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.array=st.emptyArray,n.decode=function(e,r){e instanceof ze||(e=ze.create(e));let i=r===void 0?e.len:e.pos+r,a=new xe.Position;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.array&&a.array.length||(a.array=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.array.push(e.float())}else a.array.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Position"},n})();xe.UV=(()=>{function n(t){if(this.array=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.array=st.emptyArray,n.decode=function(e,r){e instanceof ze||(e=ze.create(e));let i=r===void 0?e.len:e.pos+r,a=new xe.UV;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.array&&a.array.length||(a.array=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.array.push(e.float())}else a.array.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/UV"},n})();xe.Normal=(()=>{function n(t){if(this.array=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.array=st.emptyArray,n.decode=function(e,r){e instanceof ze||(e=ze.create(e));let i=r===void 0?e.len:e.pos+r,a=new xe.Normal;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.array&&a.array.length||(a.array=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.array.push(e.float())}else a.array.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Normal"},n})();xe.Group=(()=>{function n(t){if(t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.start=0,n.prototype.count=0,n.prototype.materialIndex=0,n.decode=function(e,r){e instanceof ze||(e=ze.create(e));let i=r===void 0?e.len:e.pos+r,a=new xe.Group;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.start=e.uint32();break}case 2:{a.count=e.uint32();break}case 3:{a.materialIndex=e.uint32();break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("start"))throw st.ProtocolError("missing required 'start'",{instance:a});if(!a.hasOwnProperty("count"))throw st.ProtocolError("missing required 'count'",{instance:a});if(!a.hasOwnProperty("materialIndex"))throw st.ProtocolError("missing required 'materialIndex'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Group"},n})();xe.Material=(()=>{function n(t){if(t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.kd=null,n.prototype.ks=null,n.prototype.ke=null,n.prototype.mapkd="",n.prototype.mapks="",n.prototype.mapke="",n.prototype.norm="",n.prototype.mapbump="",n.prototype.bump="",n.prototype.mapd="",n.prototype.ns=0,n.prototype.d=0,n.prototype.tr=0,n.prototype.mapkdrepeat="",n.decode=function(e,r){e instanceof ze||(e=ze.create(e));let i=r===void 0?e.len:e.pos+r,a=new xe.Material;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.kd=xe.Color.decode(e,e.uint32());break}case 2:{a.ks=xe.Color.decode(e,e.uint32());break}case 3:{a.ke=xe.Color.decode(e,e.uint32());break}case 4:{a.mapkd=e.string();break}case 5:{a.mapks=e.string();break}case 6:{a.mapke=e.string();break}case 7:{a.norm=e.string();break}case 8:{a.mapbump=e.string();break}case 9:{a.bump=e.string();break}case 10:{a.mapd=e.string();break}case 11:{a.ns=e.float();break}case 12:{a.d=e.float();break}case 13:{a.tr=e.float();break}case 14:{a.mapkdrepeat=e.string();break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Material"},n})();xe.Color=(()=>{function n(t){if(this.rgb=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.rgb=st.emptyArray,n.decode=function(e,r){e instanceof ze||(e=ze.create(e));let i=r===void 0?e.len:e.pos+r,a=new xe.Color;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.rgb&&a.rgb.length||(a.rgb=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.rgb.push(e.float())}else a.rgb.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Color"},n})();function Gu(n,t){var e={byteLength:0};return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"})}).then(function(r){return e.byteLength=r.body.byteLength,Hu(new Uint8Array(r.body),t.textureBaseUri||"",t.textureOptions,t.fetcher)}).then(function(r){var i=new d.Group;i.renderOrder=-4,i.matrixAutoUpdate=!1,i.matrix.compose(i.position,i.quaternion,i.scale),i.name=n;for(var a=0,o=r.objects;a<o.length;a++){var s=o[a];i.add(s)}return r.texturePromise.then(function(){return{type:"dome",uri:n,byteLength:e.byteLength,object:i,dispose:function(){return r.dispose()}}})})}function Gd(n){for(var t=[0,0,0],e=0;e<n.attributes.normal.array.length/9;e++)t[0]=n.attributes.normal.array[e*9],t[1]=n.attributes.normal.array[e*9+1],t[2]=n.attributes.normal.array[e*9+2],n.attributes.normal.array[e*9]=n.attributes.normal.array[e*9+6],n.attributes.normal.array[e*9+1]=n.attributes.normal.array[e*9+7],n.attributes.normal.array[e*9+2]=n.attributes.normal.array[e*9+8],n.attributes.normal.array[e*9+6]=t[0],n.attributes.normal.array[e*9+7]=t[1],n.attributes.normal.array[e*9+8]=t[2];for(var e=0;e<n.attributes.position.array.length/9;e++)t[0]=n.attributes.position.array[e*9],t[1]=n.attributes.position.array[e*9+1],t[2]=n.attributes.position.array[e*9+2],n.attributes.position.array[e*9]=n.attributes.position.array[e*9+6],n.attributes.position.array[e*9+1]=n.attributes.position.array[e*9+7],n.attributes.position.array[e*9+2]=n.attributes.position.array[e*9+8],n.attributes.position.array[e*9+6]=t[0],n.attributes.position.array[e*9+7]=t[1],n.attributes.position.array[e*9+8]=t[2];for(var e=0;e<n.attributes.uv.array.length/6;e++)t[0]=n.attributes.uv.array[e*6],t[1]=n.attributes.uv.array[e*6+1],n.attributes.uv.array[e*6]=n.attributes.uv.array[e*6+4],n.attributes.uv.array[e*6+1]=n.attributes.uv.array[e*6+5],n.attributes.uv.array[e*6+4]=t[0],n.attributes.uv.array[e*6+5]=t[1];n.attributes.normal.needsUpdate=!0,n.attributes.position.needsUpdate=!0,n.attributes.uv.needsUpdate=!0}function Hd(n){var t=n.position,e=n.normal,r=n.uv,i=n.uv2,a=n.groups,o=new d.BufferGeometry;o.setAttribute("position",new d.BufferAttribute(new Float32Array(t.array),3)),e&&o.setAttribute("normal",new d.BufferAttribute(new Float32Array(e.array),3)),r&&o.setAttribute("uv",new d.BufferAttribute(new Float32Array(r.array),2)),i&&o.setAttribute("uv2",new d.BufferAttribute(new Float32Array(i.array),2));for(var s=0,u=a;s<u.length;s++){var c=u[s];o.addGroup(c.start,c.count,c.materialIndex)}return o}function rn(n,t,e,r,i,a,o){if(o.hasOwnProperty(n))return o[n];n=n.split("?")[0],Ar(n)||(n=Et(t,n)),n=n.replace(/\/\/vrlab-image\d*.ljcdn.com\//,"//vrlab-public.ljcdn.com/"),n.indexOf("//")===0&&(n="https:"+n);var s=F({key:"texture.dome",size:64},nr(e,["quality","format","sharpen","mappings"])),u=o[n]=i.loadTexture(n,{imageURL:{transform:e.transform,options:s},wrapS:d.RepeatWrapping,wrapT:d.RepeatWrapping,fetcher:a}).then(function(c){var l=c.body;return r&&l.repeat.copy(r),l.needsUpdate=!0,l.updateMatrix(),l});return u}function qd(n,t,e,r,i,a,o){var s=[],u=new Dn;o.add(u);var c=u.uniforms;c.exposure.value=4.3;var l=u.defines;if(l.USE_MAP=!1,l.USE_UV=!1,n.kd&&(c.diffuse.value=new d.Color().fromArray(n.kd.rgb)),n.mapkd){var h=null;if(n.mapkdrepeat){var p=n.mapkdrepeat.split(/\s+/).map(function(y){return Number(y)}),v=p[0],m=p[1];h=new d.Vector2(v,m)}s.push(rn(n.mapkd,t,e,h,r,i,a).then(function(y){l.USE_MAP=!0,l.USE_UV=!0,c.map.value=y,o.add(y),c.uvTransform.value=y.matrix,u.needsUpdate=!0}).catch(Q))}if(n.ks&&(c.specular.value=new d.Color().fromArray(n.ks.rgb)),n.mapks&&s.push(rn(n.mapks,t,e,null,r,i,a).then(function(y){c.specularMap.value=y,o.add(y)}).catch(Q)),n.ke&&(c.emissive.value=new d.Color().fromArray(n.ke.rgb)),n.mapke&&s.push(rn(n.mapke,t,e,null,r,i,a).then(function(y){c.emissiveMap.value=y,o.add(y)}).catch(Q)),n.norm&&s.push(rn(n.norm,t,e,null,r,i,a).then(function(y){c.normalMap.value=y,o.add(y)}).catch(Q)),n.mapbump&&s.push(rn(n.mapbump,t,e,null,r,i,a).then(function(y){c.bumpMap.value=y,o.add(y)}).catch(Q)),n.bump&&s.push(rn(n.bump,t,e,null,r,i,a).then(function(y){c.bumpMap.value=y,o.add(y)}).catch(Q)),typeof n.ns=="number"&&(c.shininess.value=n.ns),typeof n.d=="number"){var A=n.d;A>0&&A<1&&(u.opacity=A)}return u.floor=0,u.defines.USE_VERTEX_FLOOR=!1,{material:u,textureReady:Promise.all(s).then(Q)}}function Kd(n){return zd.decode(n).meshes}function Hu(n,t,e,r){for(var i=[],a=[],o=new Set,s=Kd(n),u=new An,c=new d.Matrix4,l=new d.Vector3,h=new d.Quaternion,p=new d.Vector3,v={},m=0,A=s;m<A.length;m++){var y=A[m],f=y.name,g=y.chunks,b=y.matrix;if(!(f==="Ceiling"||f==="CeilingDrop"))for(var E=0,w=b;E<w.length;E++){var x=w[E];c.elements=x.elements;var M=new d.Group;M.renderOrder=-4;for(var C=0;C<g.length;C++){var S=Hd(g[C].geometry);S.applyMatrix4(c),c.decompose(l,h,p),p.x*p.y*p.z<0&&S.attributes.normal&&S.attributes.position&&S.attributes.uv&&Gd(S),o.add(S);for(var P=[],I=0,B=g[C].material;I<B.length;I++){var L=B[I],k=qd(L,t||"",e,u,r,v,o),O=k.material,N=k.textureReady;a.push(N),P.push(O)}var D=new Gt(S,P);D.name="chunk_"+C,D.matrix.compose(D.position,D.quaternion,D.scale),D.matrixAutoUpdate=!1,D.frustumCulled=!1,D.renderOrder=-1e3,M.add(D)}M.name=f,i.push(M)}}var H=Promise.all(a).catch(Q),z=function(U){return Promise.resolve()};return{createAt:0,description:"",objects:i,texturePromise:H,updateTexture:z,dispose:function(){o.forEach(function(U){U.dispose()}),o.clear()}}}function qu(n,t){var e={byteLength:0};return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"})}).then(function(r){return e.byteLength=r.body.byteLength,Lu(r.body)}).then(function(r){var i=r.reduce(function(s,u){return s+u.length},0),a=new Uint8Array(i),o=0;return r.forEach(function(s){a.set(s,o),o+=s.length}),a}).then(function(r){return Hu(r,t.textureBaseUri||"",t.textureOptions,t.fetcher)}).then(function(r){var i=new d.Group;i.renderOrder=-4,i.name=n;for(var a=0,o=r.objects;a<o.length;a++){var s=o[a];i.add(s)}return r.texturePromise.then(function(){return{type:"domez",uri:n,byteLength:e.byteLength,object:i,dispose:function(){return r.dispose()}}})})}var jd=new d.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);function Wd(n,t){var e=0;return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"}).then(function(r){return e=r.body.byteLength,r.body})}).then(function(r){var i;return Da(r,{copyUV2:!1,addonExtensions:["PBM_mesh"],resourcePath:n.slice(0,n.lastIndexOf("/")+1),search:(i=n.split("?")[1])!==null&&i!==void 0?i:"",fetcher:t.fetcher})}).then(function(r){var i=new d.Matrix4;if(t.upAxis!=="Z"&&i.premultiply(jd),r.CESIUM_RTC){var a=new d.Matrix4().setPosition(r.CESIUM_RTC.center);i.premultiply(a)}var o=r.scene;return o.applyMatrix4(i),{type:"glb",uri:n,byteLength:e,object:o,dispose:function(){return r.dispose()}}})}var nn=new d.Vector3,$o=new d.Matrix4,Xd=30;function es(n,t){var e=t.tileset.properties.floorInfo;n.traverse(function(r){if("floor"in t.extras)r instanceof Gt?(r.material.forEach(function(g){g.floor=t.extras.floor}),r.renderOrder=-1e3+t.extras.floor):r instanceof Fr&&(r.material.floor=t.extras.floor,r.renderOrder=-1e3+t.extras.floor);else if((r instanceof Gt||r instanceof Fr)&&e){var i=r.geometry.index,a=r.geometry.getAttribute("position"),o=0,s=new Float32Array(a.count);if(e)if(i){for(var u=0,c=i.count,l=0;l<c;l++){var y=i.array[l];nn.set(a.array[y*3+0],a.array[y*3+1],a.array[y*3+2]),nn.applyMatrix4(r.matrixWorld);var h=nn.y;s[y]=0;for(var p=0;p<e.length;p++){var f=e[p],m=f.ground,A=f.height;if(h<m+A){s[y]=p;break}}u+=s[y]}o=u/c}else{for(var u=0,c=a.count,l=0;l<c;l++){nn.set(a.array[l*3+0],a.array[l*3+1],a.array[l*3+2]),nn.applyMatrix4(r.matrixWorld);var h=nn.y;s[l]=0;for(var p=0;p<e.length;p++){var v=e[p],m=v.ground,A=v.height;if(h<m+A){s[l]=p;break}}u+=s[l]}o=u/c}r.renderOrder=-1e3+o,r.geometry.setAttribute("floor",new d.BufferAttribute(s,1)),Array.isArray(r.material)?r.material.forEach(function(g){g.defines.USE_VERTEX_FLOOR=!0,g.needsUpdate=!0}):(r.material.defines.USE_VERTEX_FLOOR=!0,r.material.needsUpdate=!0)}})}var Qt=function(n){oe(t,n);function t(e,r,i){var a,o,s,u,c=n.call(this)||this;c.model=e,c.search=(a=i.search)!==null&&a!==void 0?a:"",c.unloadTileQueue=[],c.boundingBox=new d.Box3,c.minLevelOfDetail=t.DEFAULT_MIN_LEVEL_OF_DETAIL,c.maxLevelOfDetail=t.DEFAULT_MAX_LEVEL_OF_DETAIL,c.needsRefined=!0,c.refined=!1,c.refineProgress=[0,0],c.loaded=!1,c.disposed=!1,c.needsRender=!0,c.matrixAutoUpdate=!1,c.renderOrder=-4,c.lastRefineTime=-1,c.nodes=new Map,c.nodeGroup=new d.Group,c.nodeGroup.matrixAutoUpdate=!1,c.nodeGroup.renderOrder=-4,c.add(c.nodeGroup),c.debugBoundings=new Map,c.debugBoundingGroup=new d.Group,c.debugBoundingGroup.visible=!1,c.debugBoundingGroup.matrixAutoUpdate=!1,c.debugBoundingGroup.renderOrder=-4,c.add(c.debugBoundingGroup),c.cacheCameras=[];var l=Uo(r,(o=i.resourcePath)!==null&&o!==void 0?o:"");return c.tileset=new ti((u=(s=c.model.work)===null||s===void 0?void 0:s.workCode)!==null&&u!==void 0?u:"",l,{contentLoader:function(h){return c.loadContent(h,{fetcher:i.fetcher})},onTileLoad:function(){},onTileUnload:function(h){c.unloadTileQueue.push(h)},onTileError:function(h,p){i.onError&&i.onError(Object.assign(p,{error:p})),console.error("Tile error",h.id,p)}}),c.tileset.root.boundingVolume&&c.tileset.root.boundingVolume.getBoundingBox(c.boundingBox),c}return Object.defineProperty(t.prototype,"debug",{get:function(){return this.debugBoundingGroup.visible},set:function(e){this.debugBoundingGroup.visible!==e&&(this.debugBoundingGroup.visible=e,this.needsRender=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxMemoryUsage",{get:function(){return this.tileset.maxMemoryUsage},set:function(e){this.tileset.maxMemoryUsage=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxRequests",{get:function(){return this.tileset.maxRequests},set:function(e){this.tileset.maxRequests=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxScreenSpaceError",{get:function(){return this.tileset.maxScreenSpaceError},set:function(e){this.tileset.maxScreenSpaceError=e},enumerable:!1,configurable:!0}),t.prototype.loadContent=function(e,r){var i=this;if(!e.content)return Promise.resolve(!1);var a=e.content,o=Eu(a.uri,this.search);if(e.type==="TILESET"){var s=Wt(o,{key:"model.".concat(e.siblingIndex)});return r.fetcher.ajax(s,{responseType:"text"}).then(function(u){return u.body}).then(function(u){var c=s.slice(0,s.lastIndexOf("/")+1);return Uo(JSON.parse(u),c)}).then(function(u){return e.geometricError=u.geometricError,e.children.length===0&&(e.children=[new Qa("".concat(e.id,".0"),u.root,e.tileset,e)]),!0})}return e.type==="SCENEGRAPH"?Promise.resolve().then(function(){var u,c,l,h,p,v,m,A,y,f,g="",b=o.split("#"),E=b[0],w=b[1],x=(w||E).split("?")[0].match(/\.([0-9a-zA-Z]+)$/);if(x&&(g=x[1]),g==="b3dm"){var M=Wt(o,{key:"model.".concat(e.siblingIndex)});return Tu(M,{upAxis:e.tileset.asset.gltfUpAxis,fetcher:r.fetcher}).then(function(C){return C.object.applyMatrix4(e.transform),C.object.updateWorldMatrix(!1,!0),C.object.matrixAutoUpdate=!1,es(C.object,e),C})}if(g==="pnts"){var M=Wt(o,{key:"model.".concat(e.siblingIndex)});return Bu(M,{fetcher:r.fetcher,computeBoundingBox:!1}).then(function(S){if(S.object.applyMatrix4(e.transform),S.object.updateWorldMatrix(!1,!0),S.object.matrixAutoUpdate=!1,e.boundingVolume){var P=e.boundingVolume;S.object.traverse(function(I){if(I instanceof Fr){$o.getInverse(I.matrixWorld);var B=new d.Box3;P.getBoundingBox(B),B.applyMatrix4($o),I.geometry.boundingBox=B}})}return S})}if(g==="glb"){var M=Wt(o,{key:"model.".concat(e.siblingIndex)});return Wd(M,{upAxis:e.tileset.asset.gltfUpAxis,fetcher:r.fetcher}).then(function(S){return S.object.applyMatrix4(e.transform),S.object.updateWorldMatrix(!1,!0),S.object.matrixAutoUpdate=!1,es(S.object,e),S})}if(g==="at3d"){var M=e.extras.at3d?o:Wt(o,{key:"model.".concat(e.siblingIndex)});return zu(M,{textureBaseUri:(u=e.extras.at3d)===null||u===void 0?void 0:u.textureBaseUri,textureArray:(c=e.extras.at3d)===null||c===void 0?void 0:c.textureArray,textureOptions:(l=e.extras.at3d)===null||l===void 0?void 0:l.textureOptions,fetcher:r.fetcher}).then(function(S){return S.object.applyMatrix4(e.transform),S.object.updateWorldMatrix(!1,!0),S.object.matrixAutoUpdate=!1,S})}if(g==="pbm"){var M=e.extras.pbm?o:Wt(o,{key:"model.".concat(e.siblingIndex)});return Qu(M,{textureBaseUri:(h=e.extras.pbm)===null||h===void 0?void 0:h.textureBaseUri,textureArray:(p=e.extras.pbm)===null||p===void 0?void 0:p.textureArray,textureOptions:(v=e.extras.pbm)===null||v===void 0?void 0:v.textureOptions,fetcher:r.fetcher}).then(function(S){return S.object.applyMatrix4(e.transform),S.object.updateWorldMatrix(!1,!0),S.object.matrixAutoUpdate=!1,S})}if(g==="dome"){var M=e.extras.dome?o:Wt(o,{key:"model.".concat(e.siblingIndex)});return Gu(M,{textureBaseUri:(m=e.extras.dome)===null||m===void 0?void 0:m.textureBaseUri,textureOptions:(A=e.extras.dome)===null||A===void 0?void 0:A.textureOptions,fetcher:r.fetcher}).then(function(S){return S.object.applyMatrix4(e.transform),S.object.updateWorldMatrix(!1,!0),S.object.matrixAutoUpdate=!1,S})}if(g==="domez"){var M=e.extras.domez?o:Wt(o,{key:"model.".concat(e.siblingIndex)});return qu(M,{textureBaseUri:(y=e.extras.domez)===null||y===void 0?void 0:y.textureBaseUri,textureOptions:(f=e.extras.domez)===null||f===void 0?void 0:f.textureOptions,fetcher:r.fetcher}).then(function(S){return S.object.applyMatrix4(e.transform),S.object.updateWorldMatrix(!1,!0),S.object.matrixAutoUpdate=!1,S})}}).then(function(u){if(!u)return Promise.resolve(!1);if(u.type==="pnts"){var c=u.object,l=c.material;l.uniforms.geometricError.value=e.geometricError}var h={type:u.type,uri:u.uri,byteLength:u.byteLength,object:new bu(u.object,u.dispose)};return h.object.generateBvhTree().then(function(){return h})}).then(function(u){if(!u)return!1;if(i.disposed)return u.object.dispose(),a.data=void 0,a.byteLength=0,!1;if(u.object.traverse(function(l){(l instanceof Fr||l instanceof Gt)&&(l.model=i.model)}),a.data=u,a.byteLength=u.byteLength,u.object.traverse(function(l){l.renderOrder>-4&&(l.renderOrder=-4)}),u.object.visible=!1,i.boundingBox.expandByObject(u.object),i.nodes.set(e.id,u.object),i.nodeGroup.add(u.object),e.boundingVolume){var c=Pc(e.boundingVolume,e.state.selectionDepth);c.matrixWorldNeedsUpdate=!0,c.matrixAutoUpdate=!1,c.frustumCulled=!1,c.visible=!0,i.debugBoundings.set(e.id,c),i.debugBoundingGroup.add(c)}return!0}):Promise.resolve(!1)},t.prototype.intersectRaycaster=function(e,r,i){r===void 0&&(r=!0),i===void 0&&(i=[]);for(var a=[this.tileset.root],o=this.tileset.transform,s;s=a.pop();){var u=void 0;if(s.boundingVolume){var c=s.boundingVolume.clone().applyMatrix4(o);u=c.intersectRay(e.ray,e.far)}else u=!0;if(u){for(var l=0,h=s.children.length;l<h;l++)a.push(s.children[l]);s.selected&&s.content&&s.content.data&&s.content.data.object.intersectRaycaster(e,!1,i)}}return r&&i.sort(function(p,v){return p.distance-v.distance}),i},t.prototype.update=function(e,r){var i=this;this.tileset.transform.equals(this.matrixWorld)||this.tileset.transform.copy(this.matrixWorld);var a=ve();if(this.needsRefined&&a-this.lastRefineTime>Xd){this.lastRefineTime=a,this.tileset.cache.reset(),this.tileset.frameNumber++;var o={camera:{position:new d.Vector3().copy(r.position),direction:r.getDirection(new d.Vector3),up:new d.Vector3().copy(r.up),visible:r.visible},minLevelOfDetail:this.visible?this.minLevelOfDetail:-1,maxLevelOfDetail:this.visible?this.maxLevelOfDetail:-1,height:r.screenHeight,pixelRatio:r.pixelRatio,frameNumber:this.tileset.frameNumber,sseDenominator:2*Math.tan(.5*r.fov/180*Math.PI),cullingVolume:new Pn().setFromCamera(r)},s=this.cacheCameras.map(function(p){return F(F({},o),{camera:{position:new d.Vector3().copy(p.position),direction:p.getWorldDirection(new d.Vector3),up:new d.Vector3().copy(p.up),visible:p.visible},cullingVolume:new Pn().setFromCamera(p)})});this.tileset.traverse(o,s),this.refined=!0,this.refineProgress[0]=0,this.refineProgress[1]=0,this.tileset.needsRefinedTiles.forEach(function(p){if(i.refineProgress[1]++,p.content&&p.state.visible){var v=p.content.loadState;if(v==="UNLOADED"||v==="LOADING"){i.refined=!1;return}}i.refineProgress[0]++}),this.loaded===!1&&(this.loaded=!0,this.tileset.needsRefinedTiles.forEach(function(p){if(i.loaded!==!1&&p.content&&p.state.visible&&p.state.selectionDepth===0){var v=p.content.loadState;(v==="UNLOADED"||v==="LOADING")&&(i.loaded=!1)}}))}var u;this.tileset.tiles.forEach(function(p){var v=p.selected,m=p.id;u=i.nodes.get(m),u&&u.visible!==v&&(u.visible=v,i.needsRender=!0),u=i.debugBoundings.get(m),u&&u.visible!==v&&(u.visible=v,i.needsRender=!0)});for(var c;c=this.unloadTileQueue.pop();){var l=c.id,h=c.content;h&&h.data&&(h.data.object.dispose(),h.data=void 0,h.byteLength=0),u=this.nodes.get(l),u&&(this.nodeGroup.remove(u),this.nodes.delete(l),this.needsRender=!0),u=this.debugBoundings.get(l),u&&(this.debugBoundingGroup.remove(u),this.debugBoundings.delete(l),this.needsRender=!0)}},t.prototype.dispose=function(){var e=this;this.disposed=!0,this.tileset.reset();for(var r,i;r=this.unloadTileQueue.pop();){var a=r.id,o=r.content;o&&o.data&&(o.data.object.dispose(),o.data=void 0,o.byteLength=0),i=this.nodes.get(a),i&&(this.nodeGroup.remove(i),this.nodes.delete(a),this.needsRender=!0),i=this.debugBoundings.get(a),i&&(this.debugBoundingGroup.remove(i),this.debugBoundings.delete(a),this.needsRender=!0)}this.nodes.forEach(function(s,u,c){e.nodeGroup.remove(s),s.dispose(),c.delete(u)})},t.DEFAULT_MIN_LEVEL_OF_DETAIL=-1,t.DEFAULT_MAX_LEVEL_OF_DETAIL=20,t.DEFAULT_MAX_MEMORY_USAGE=16,t.DEFAULT_MAX_SCREEN_SPACE_ERROR=ti.DEFAULT_MAX_SCREEN_SPACE_ERROR,t.DEFAULT_MAX_REQUESTS=ti.DEFAULT_MAX_REQUESTS,t}(d.Object3D);function ae(n,t,e){return n<t?t:n>e?e:n}function _d(n){return-((n-.25)*360+90)/180*Math.PI}function ya(n,t){if(n===t)return!0;if(n&&t&&typeof n=="object"&&typeof t=="object"){if(n.constructor!==t.constructor)return!1;var e,r,i;if(Array.isArray(n)){if(e=n.length,e!=t.length)return!1;for(r=e;r--!==0;)if(!ya(n[r],t[r]))return!1;return!0}if(n.constructor===RegExp)return n.source===t.source&&n.flags===t.flags;if(n.valueOf!==Object.prototype.valueOf)return n.valueOf()===t.valueOf();if(n.toString!==Object.prototype.toString)return n.toString()===t.toString();if(i=Object.keys(n),e=i.length,e!==Object.keys(t).length)return!1;for(r=e;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=e;r--!==0;){var a=i[r];if(!ya(n[a],t[a]))return!1}return!0}return n!==n&&t!==t}function Kt(n){return typeof n=="number"}function Zd(n){return(n&n-1)===0&&n!==0}var ts=function(){return new Error("Invalid input.")},rs=function(){return new Error("Invalid certificate.")},ns=function(){return new Error("Invalid signature.")},Yd=function(n){return new Error("date(".concat(n.toString(),") expired."))},Jd=function(n){return new Error("host(".concat(JSON.stringify(n),") is not allowed."))};function $d(n,t){for(var e={},r=0,i=Object.keys(n);r<i.length;r++){var a=i[r];t.indexOf(a)===-1&&(e[a]=n[a])}return e}function xn(n,t){t===void 0&&(t=!1);var e=typeof n;if(e==="string")return JSON.stringify(n);if(n===!0)return"true";if(n===!1)return"false";if(n===null)return"null";if(n instanceof Array){for(var r="[",i=n.length-1,a=0;a<i;a++)r+=xn(n[a],!1)+",";return i>-1&&(r+=xn(n[a],!1)),r+"]"}if(n instanceof Object){if(typeof n.toJSON=="function")return xn(n.toJSON(),t);for(var o=Object.keys(n).sort(),s=o.length,r="",a=0;a<s;){var u=o[a],c=xn(n[u],!0);c!==void 0&&(a&&r!==""&&(r+=","),r+=JSON.stringify(u)+":"+c),a++}return"{"+r+"}"}switch(e){case"function":case"undefined":return t?void 0:null;case"number":return 0;default:return isFinite(n)?n:null}}function ef(n){return String(xn(n,!1))}function Ku(n){var t,e,r;if(Array.isArray(n)){var i=void 0,a,o;if(n.length<=0)return ts();for(var s=function(w){var x=Ku(n[w]);if(x instanceof Error)return{value:x};if(!i)i=x.issuer;else if(i!==x.issuer)return{value:rs()};a?x.expire.getTime()<a.getTime()&&(a=x.expire):a=x.expire,o?o=o.filter(function(M){return x.allowHosts.indexOf(M)!==-1}):o=x.allowHosts},u=0;u<n.length;u++){var c=s(u);if(typeof c=="object")return c.value}return qr({issuer:i,expire:a,allowHosts:o})}var l=JSON.parse(n),h=typeof location!="undefined"?location.hostname:"",p=Date.now();if(typeof l!="object")return ts();var v=new Date(typeof l.expire_at=="string"&&/^\d+$/.test(l.expire_at)?Number(l.expire_at):l.expire_at),m=Array.isArray(l.allow_hosts)?l.allow_hosts:[];if(h.length===0||Xr(h)||rr.filter(function(w){return Rr(w,h)}).length>0){var A=String((t=l.certificate)!==null&&t!==void 0?t:"");if(A){var y=new Qe;return y.readCertPEM(A),qr({issuer:y.getSubjectString(),expire:v,allowHosts:m})}return qr({issuer:"none",expire:v,allowHosts:m})}var f=String((e=l.certificate)!==null&&e!==void 0?e:"");if(!f)return rs();var g=new Qe;g.readCertPEM(f);var b=String((r=l._signature)!==null&&r!==void 0?r:"");if(!b)return ns();var E=ef($d(l,["_signature"]));return Fl(E,b,g)===!1?ns():p<v.getTime()?m.filter(function(w){return Rr(w,h)}).length===0?Jd(h):qr({issuer:g.getSubjectString(),expire:v,allowHosts:m}):Yd(v)}var is=new d.Matrix4,Ga=new WeakMap,Ha=function(){function n(t,e){this.name="",this.workCode="",this.expire=new Date,this.allowHosts=[],this.initial={work:this},this.observers=[],this.issuer="none",this.raw={works:[""],options:""},this.options={transform:new d.Matrix4};var r=tf(t,e,this);if(r instanceof Error)throw new Error("[PARSE FAILED]: "+r.message+`
|
|
928
|
+
`),ma=typeof Worker!="undefined"&&typeof Blob!="undefined",Fu="";if(ma)try{var Od=new Blob([Ld],{type:"text/javascript"});Fu=URL.createObjectURL(Od)}catch(n){}var ku=function(){function n(){var t=this;if(!ma)throw new Error("LZMAWorker cannot work in this broswer.");this.callCounter=0,this.requests={};var e=this.worker=new Worker(Fu);e.onmessage=function(r){var i=r.data,a=i.id,o=i.result,s=i.error,u=t.getKey(a);t.requests[u]&&(s?t.requests[u](new Error(s)):t.requests[u](null,o),delete t.requests[u])},e.onerror=function(r){return console.error(r)}}return n.prototype.getKey=function(t){return"key_"+String(t)},n.prototype.decompress=function(t,e){var r=++this.callCounter;this.requests[this.getKey(r)]=e,this.worker.postMessage({type:"decompress",id:r,data:t},[t.buffer])},n.prototype.terminate=function(){this.worker.terminate()},n.support=ma,n}();function Yo(n){return Array.prototype.reduce.call(n,function(t,e,r){return t|e<<r*8},0)}function Vd(n){for(var t=[],e=n.length,r=function(o){var s={data:n[o],offset:0,readByte:function(){return this.data[this.offset++]}},u=s.data.length,c={data:[],offset:0,writeByte:function(h){var p=Math.floor(this.offset/u);this.data[p]||(this.data[p]=new Uint8Array(u)),this.data[p][this.offset%u]=h,this.offset++}};Bd.decompressFile(s,c),i=new Uint8Array(c.offset);for(var l=0;l<c.offset;l++)i[l]=c.data[Math.floor(l/u)][l%u];t.push(i)},i,a=0;a<e;a++)r(a);return t}function Nd(n){for(var t=[],e=n.length,r=function(a){t.push(new Promise(function(o,s){var u=new ku;u.decompress(n[a],function(c,l){if(u.terminate(),c)return s(c);o(l)})}))},i=0;i<e;i++)r(i);return Promise.all(t)}function Lu(n){var t=new Uint8Array(n),e=Yo(t.slice(0,4));if(e>10)return Promise.reject(new Error("LZMA got too many sub chunks."));for(var r=[],i=[],a=4+e*4,o=0;o<e;o++)i[o]=Yo(t.slice(4+o*4,8+o*4)),o===e-1?r[o]=t.subarray(a,a+i[o]):r[o]=t.slice(a,a+i[o]),a+=i[o];return ku.support?Nd(r):Promise.resolve(Vd(r))}var Xi=!1,Ou=[];function Vu(n){if(n===void 0&&(n=!1),!(!n&&Xi)){Xi=!0;var t=Ou.shift();if(t){try{t()}catch(e){}ot.shared.add(function(){return Vu(!0)},!0,2,-100)}else Xi=!1}}function Ai(n){return new Promise(function(t,e){var r=function(){try{t(n())}catch(i){e(i)}};Ou.push(r),ot.shared.add(function(){return Vu()},!0,2,-100)})}function nr(n,t){for(var e={},r=0,i=t;r<i.length;r++){var a=i[r];a in n&&(e[a]=n[a])}return e}function Qd(n,t){for(var e=F({},n),r=0,i=t;r<i.length;r++){var a=i[r];a in e&&delete e[a]}return e}function En(n,t){t===void 0&&(t=!1);var e=typeof n;if(e==="string")return JSON.stringify(n);if(n===!0)return"true";if(n===!1)return"false";if(n===null)return"null";if(n instanceof Array){for(var r="[",i=n.length-1,a=0;a<i;a++)r+=En(n[a],!1)+",";return i>-1&&(r+=En(n[a],!1)),r+"]"}if(n instanceof Object){if(typeof n.toJSON=="function")return En(n.toJSON(),t);for(var o=Object.keys(n).sort(),s=o.length,r="",a=0;a<s;){var u=o[a],c=En(n[u],!0);c!==void 0&&(a&&r!==""&&(r+=","),r+=JSON.stringify(u)+":"+c),a++}return"{"+r+"}"}switch(e){case"function":return JSON.stringify(n.toString());case"undefined":return t?void 0:null;case"number":return n;default:return isFinite(n)?n:null}}function dn(n){return"hash::".concat(En(n,!1))}const kr=Br.Reader,_t=Br.util,Ut=Br.roots["@REALSEE/FIVE:five/loaders/model/proto/pbm.proto"]||(Br.roots["@REALSEE/FIVE:five/loaders/model/proto/pbm.proto"]={}),Nu=Ut.Model=(()=>{function n(t){if(this.chunks=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.chunks=_t.emptyArray,n.prototype.createAt=_t.Long?_t.Long.fromBits(0,0,!0):0,n.prototype.description="",n.decode=function(e,r){e instanceof kr||(e=kr.create(e));let i=r===void 0?e.len:e.pos+r,a=new Ut.Model;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.chunks&&a.chunks.length||(a.chunks=[]),a.chunks.push(Ut.Chunk.decode(e,e.uint32()));break}case 2:{a.createAt=e.uint64();break}case 3:{a.description=e.string();break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Model"},n})();Ut.Chunk=(()=>{function n(t){if(t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.vertices=null,n.prototype.faces=null,n.prototype.name="",n.prototype.texture="",n.decode=function(e,r){e instanceof kr||(e=kr.create(e));let i=r===void 0?e.len:e.pos+r,a=new Ut.Chunk;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.vertices=Ut.Vertices.decode(e,e.uint32());break}case 2:{a.faces=Ut.Faces.decode(e,e.uint32());break}case 3:{a.name=e.string();break}case 4:{a.texture=e.string();break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("vertices"))throw _t.ProtocolError("missing required 'vertices'",{instance:a});if(!a.hasOwnProperty("faces"))throw _t.ProtocolError("missing required 'faces'",{instance:a});if(!a.hasOwnProperty("name"))throw _t.ProtocolError("missing required 'name'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Chunk"},n})();Ut.Vertices=(()=>{function n(t){if(this.xyz=[],this.uvs=[],this.marks=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.xyz=_t.emptyArray,n.prototype.uvs=_t.emptyArray,n.prototype.marks=_t.emptyArray,n.decode=function(e,r){e instanceof kr||(e=kr.create(e));let i=r===void 0?e.len:e.pos+r,a=new Ut.Vertices;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.xyz&&a.xyz.length||(a.xyz=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.xyz.push(e.float())}else a.xyz.push(e.float());break}case 2:{if(a.uvs&&a.uvs.length||(a.uvs=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.uvs.push(e.float())}else a.uvs.push(e.float());break}case 3:{if(a.marks&&a.marks.length||(a.marks=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.marks.push(e.int32())}else a.marks.push(e.int32());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Vertices"},n})();Ut.Faces=(()=>{function n(t){if(this.indices=[],this.normals=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.indices=_t.emptyArray,n.prototype.normals=_t.emptyArray,n.decode=function(e,r){e instanceof kr||(e=kr.create(e));let i=r===void 0?e.len:e.pos+r,a=new Ut.Faces;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.indices&&a.indices.length||(a.indices=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.indices.push(e.uint32())}else a.indices.push(e.uint32());break}case 2:{if(a.normals&&a.normals.length||(a.normals=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.normals.push(e.float())}else a.normals.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Faces"},n})();Ut.VertexMark=(()=>{const n={},t=Object.create(n);return t[n[0]="VERTEX_MARK_UNSPECIFIED"]=0,t[n[1]="VERTEX_MARK_ROOF"]=1,t})();function Qu(n,t){var e,r,i,a={byteLength:0},o=za((e=t.textureOptions)!==null&&e!==void 0?e:{},(i=(r=t.textureArray)===null||r===void 0?void 0:r.length)!==null&&i!==void 0?i:0),s={};if(t.textureArray)for(var u=0,c=t.textureArray;u<c.length;u++){var l=c[u];s[l]=Ua(l,o,t.fetcher)}return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"})}).then(function(h){return a.byteLength=h.body.byteLength,Ai(function(){var p=new Uint8Array(h.body);return Nu.decode(p)})}).then(function(h){return Ai(function(){var p,v;return Uu(h,(p=t.textureBaseUri)!==null&&p!==void 0?p:function(){var m=n.lastIndexOf("/");if(m>=0){var A=n.slice(0,m)+"/";return/\/model\/$/.test(A)&&(A=A.replace(/\/model\/$/,"/materials/")),A}return""}(),((v=t.textureArray)!==null&&v!==void 0?v:[]).slice(),o,s,t.fetcher)})}).then(function(h){var p=new d.Group;p.renderOrder=-4,p.matrixAutoUpdate=!1,p.matrix.compose(p.position,p.quaternion,p.scale),p.name=n;for(var v=0,m=h.objects;v<m.length;v++){var A=m[v];p.add(A)}return h.texturePromise.then(function(){return{type:"pbm",uri:n,byteLength:a.byteLength,object:p,dispose:function(){return h.dispose()}}})})}function Du(n){var t=n.match(/(group|floor)-?(\d+)/);return t?parseInt(t[2],10):0}function ga(n){var t=n.match(/(chunk)-?(\d+)/);return t?parseInt(t[2],10):0}function Dd(n){var t=n.match(/(sub)-?(\d+)/);return t?parseInt(t[2],10):0}function Jo(n){var t=Du(n.name),e=ga(n.name),r=Dd(n.name);return t*1e6+e*1e3+r}function Ud(n){for(var t,e,r,i=typeof n.createAt=="number"?n.createAt:0,a=(t=n.description)!==null&&t!==void 0?t:"",o=[],s=!0,u=!0,c=0,l=n.chunks;c<l.length;c++){var h=l[c];if(!h.vertices.marks||h.vertices.marks.length===0){u=!1;break}}for(var p=0,v=n.chunks;p<v.length;p++){var h=v[p];if(!h.faces.normals||h.faces.normals.length===0){s=!1;break}}for(var m=n.chunks.sort(function(qe,Zt){return Jo(qe)-Jo(Zt)}),A=[],y=0,f=m;y<f.length;y++){var h=f[y],g=Du(h.name);A[g]||(A[g]=[]),A[g].push(h)}for(var b=0;b<A.length;b++){var E=A[b];if(E)if(s){for(var w=0,x=0;x<E.length;x++){var h=E[x];w+=h.faces.indices.length}for(var M=new Float32Array(w*3),C=new Float32Array(w),S=new Float32Array(w*2),P=new Float32Array(w*3),I=[],B=[1/0,1/0,1/0,-1/0,-1/0,-1/0],L=0,k=0;k<E.length;k++){for(var O=[1/0,1/0,1/0,-1/0,-1/0,-1/0],h=E[k],N=h.vertices.xyz,D=h.vertices.uvs,H=h.faces.indices,z=h.faces.normals,U=h.vertices.marks,q=H.length,x=0;x<q;x++){var j=H[x],_=M[L*3+x*3]=N[j*3],Z=M[L*3+x*3+1]=N[j*3+1],W=M[L*3+x*3+2]=N[j*3+2];C[L+x]=u?U[j]:0,S[L*2+x*2]=D[j*2],S[L*2+x*2+1]=D[j*2+1];var Y=Math.floor(x/3)*3;P[L*3+x*3]=z[Y],P[L*3+x*3+1]=z[Y+1],P[L*3+x*3+2]=z[Y+2],_<O[0]&&(O[0]=_),Z<O[1]&&(O[1]=Z),W<O[2]&&(O[2]=W),_>O[3]&&(O[3]=_),Z>O[4]&&(O[4]=Z),W>O[5]&&(O[5]=W)}O[0]<B[0]&&(B[0]=O[0]),O[1]<B[1]&&(B[1]=O[1]),O[2]<B[2]&&(B[2]=O[2]),O[3]>B[3]&&(B[3]=O[3]),O[4]>B[4]&&(B[4]=O[4]),O[5]>B[5]&&(B[5]=O[5]),I.push({materialIndex:k,name:h.name,chunkName:ga(h.name),start:L,count:h.faces.indices.length,texture:(e=h.texture)!==null&&e!==void 0?e:void 0}),L+=q}var ce={createAt:i,description:a,vertices:M,uvs:S,normals:P,indices:null,floorIndex:b,groups:I,extents:B,vertexMarks:C};o.push(ce)}else{for(var w=0,te=0,x=0;x<E.length;x++){var h=E[x];te+=h.vertices.xyz.length/3,w+=h.faces.indices.length}for(var M=new Float32Array(te*3),S=new Float32Array(te*2),P=new Float32Array(te*3),se=new Float32Array(te),ue=new Uint32Array(w),C=new Float32Array(w),I=[],B=[1/0,1/0,1/0,-1/0,-1/0,-1/0],pe=0,L=0,k=0;k<E.length;k++){for(var O=[1/0,1/0,1/0,-1/0,-1/0,-1/0],h=E[k],N=h.vertices.xyz,U=h.vertices.marks,D=h.vertices.uvs,H=h.faces.indices,he=N.length/3,q=H.length,x=0;x<he;x++){var _=M[L*3+x*3]=N[x*3],Z=M[L*3+x*3+1]=N[x*3+1],W=M[L*3+x*3+2]=N[x*3+2];C[L+x]=u?U[x]:0,S[L*2+x*2]=D[x*2],S[L*2+x*2+1]=D[x*2+1],se[L+x]=b,_<O[0]&&(O[0]=_),Z<O[1]&&(O[1]=Z),W<O[2]&&(O[2]=W),_>O[3]&&(O[3]=_),Z>O[4]&&(O[4]=Z),W>O[5]&&(O[5]=W)}O[0]<B[0]&&(B[0]=O[0]),O[1]<B[1]&&(B[1]=O[1]),O[2]<B[2]&&(B[2]=O[2]),O[3]>B[3]&&(B[3]=O[3]),O[4]>B[4]&&(B[4]=O[4]),O[5]>B[5]&&(B[5]=O[5]);for(var x=0;x<q;x++)ue[pe+x]=L+H[x];I.push({materialIndex:k,name:h.name,chunkName:ga(h.name),start:pe,count:h.faces.indices.length,texture:(r=h.texture)!==null&&r!==void 0?r:void 0}),L+=he,pe+=q}for(var x=0;x<w;x+=3){var de=void 0,be=void 0,fe=void 0,Se=void 0,ee=void 0,le=void 0,X=void 0,Te=void 0,Fe=void 0,Ye=void 0,Xe=void 0,Ge=void 0,ut=void 0,Ne=void 0,me=void 0,Ae=void 0,nt=void 0,Ce=void 0,He=void 0,Oe=void 0,it=void 0;de=ue[x]*3,be=ue[x+1]*3,fe=ue[x+2]*3,Se=M[de],ee=M[de+1],le=M[de+2],X=M[be],Te=M[be+1],Fe=M[be+2],Ye=M[fe],Xe=M[fe+1],Ge=M[fe+2],ut=Ye-X,Ne=Xe-Te,me=Ge-Fe,Ae=Se-X,nt=ee-Te,Ce=le-Fe,He=Ne*Ce-me*nt,Oe=me*Ae-ut*Ce,it=ut*nt-Ne*Ae,P[de]+=He,P[de+1]+=Oe,P[de+2]+=it,P[be]+=He,P[be+1]+=Oe,P[be+2]+=it,P[fe]+=He,P[fe+1]+=Oe,P[fe+2]+=it}var ce={createAt:i,description:a,vertices:M,uvs:S,normals:P,indices:ue,floorIndex:b,groups:I,extents:B,vertexMarks:C};o.push(ce)}}return o}function Ua(n,t,e,r){var i=F({key:"texture.pbm"},nr(t,["format","quality","size","sharpen","mappings"])),a=new An,o=a.loadTexture(n,{imageURL:{transform:t.transform,options:i},wrapS:d.ClampToEdgeWrapping,wrapT:d.ClampToEdgeWrapping,minFilter:d.LinearFilter,maxSize:typeof i.size=="number"?new d.Vector2(i.size,i.size):void 0,fetcher:e}).then(function(s){var u=s.body;return u.needsUpdate=!0,u});return Object.assign(o,{url:n,textureOptions:t})}function Uu(n,t,e,r,i,a,o){i===void 0&&(i={});for(var s=Ud(n),u=0,c="",l=[],h={},p=new Set,v=0,m=s;v<m.length;v++){var A=m[v],y=A.createAt,f=A.description,g=A.vertices,b=A.vertexMarks,E=A.uvs,w=A.normals,x=A.indices,M=A.floorIndex,C=A.groups,S=A.extents,P=new d.Box3;P.min.x=S[0],P.min.y=S[1],P.min.z=S[2],P.max.x=S[3],P.max.y=S[4],P.max.z=S[5];var I=new d.BufferGeometry;I.setAttribute("position",new d.BufferAttribute(g,3)),I.setAttribute("uv",new d.BufferAttribute(E,2)),I.setAttribute("normal",new d.BufferAttribute(w,3)),I.setAttribute("isRoofMark",new d.BufferAttribute(b,1)),x&&I.setIndex(new d.BufferAttribute(x,1)),I.boundingBox=P,I.boundingSphere=P.getBoundingSphere(new d.Sphere);for(var B=0,L=C;B<L.length;B++){var k=L[B];I.addGroup(k.start,k.count,k.materialIndex)}p.add(I);for(var O=[],N=0,D=C;N<D.length;N++){var k=D[N],H=e[k.chunkName]||(k.texture?Et(t||"",k.texture):void 0),z=new Dn;z.defines.USE_VERTEX_FLOOR=!1,z.floor=M,O.push(z),H?h[H]?h[H].push(z):h[H]=[z]:(z.defines.USE_MAP=!1,z.uniforms.diffuse.value=new d.Color(16777215)),p.add(z)}var U=new Gt(I,O);U.name="model_floor_"+M,U.userData.createAt=y,U.userData.description=f,U.matrix.compose(U.position,U.quaternion,U.scale),U.matrixAutoUpdate=!1,U.frustumCulled=!1,U.renderOrder=-1e3+M,u=y,c=f,l.push(U)}var q="",j=function(Z){Z=za(Z,e.length);var W=[],Y=dn(Z);if(q===Y)return Promise.resolve();q=Y;for(var ce=function(pe){var he=null;pe in i&&(dn(i[pe].textureOptions)===dn(Z)?he=i[pe]:i[pe].then(function(de){return de.dispose()})),he||(he=Ua(pe,Z,a)),W.push(he.then(function(de){if(q!==Y){de.dispose();return}for(var be=0,fe=h[pe];be<fe.length;be++){var Se=fe[be];Se.uniforms.map.value&&(p.delete(Se.uniforms.map.value),Se.uniforms.map.value.dispose()),Se.uniforms.map.value=de,p.add(de),Se.uniforms.exposure.value=3.3}}).catch(function(){if(q===Y)for(var de=0,be=h[pe];de<be.length;de++){var fe=be[de];fe.uniforms.map.value&&(p.delete(fe.uniforms.map.value),fe.uniforms.map.value.dispose()),fe.uniforms.map.value=null,fe.defines.USE_MAP=!1,fe.uniforms.diffuse.value=new d.Color(16777215)}}))},te=0,se=Object.keys(h);te<se.length;te++){var ue=se[te];ce(ue)}for(var ue in i)delete i[ue];return Promise.all(W).then(function(){})},_=j(r);return{createAt:u,description:c,objects:l,texturePromise:_,updateTexture:j,dispose:function(){p.forEach(function(Z){Z.dispose()}),p.clear()}}}function za(n,t){return n=Object.assign({},n),n.autoResize!==!1&&(t>96?n.size=Math.min(n.size||1/0,100):t>48?n.size=Math.min(n.size||1/0,200):t>24?n.size=Math.min(n.size||1/0,400):t>22?n.size=Math.min(n.size||1/0,800):t>5&&(n.size=Math.min(n.size||1/0,1024))),n}function zu(n,t){var e,r,i,a={byteLength:0},o=za((e=t.textureOptions)!==null&&e!==void 0?e:{},(i=(r=t.textureArray)===null||r===void 0?void 0:r.length)!==null&&i!==void 0?i:0),s={};if(t.textureArray)for(var u=0,c=t.textureArray;u<c.length;u++){var l=c[u];s[l]=Ua(l,o,t.fetcher)}return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"})}).then(function(h){return Lu(h.body)}).then(function(h){return Ai(function(){for(var p,v={chunks:[],createAt:void 0,description:void 0},m=0,A=h;m<A.length;m++){var y=A[m],f=Nu.decode(y);f.chunks.length&&((p=v.chunks).push.apply(p,f.chunks),v.createAt=f.createAt,v.description=f.description)}return v})}).then(function(h){return Ai(function(){var p,v,m;return Uu(h,(p=t.textureBaseUri)!==null&&p!==void 0?p:function(){var A=n.lastIndexOf("/");if(A>=0){var y=n.slice(0,A)+"/";return/\/model\/$/.test(y)&&(y=y.replace(/\/model\/$/,"/materials/")),y}return""}(),((v=t.textureArray)!==null&&v!==void 0?v:[]).slice(),(m=t.textureOptions)!==null&&m!==void 0?m:{},s,t.fetcher)})}).then(function(h){var p=new d.Group;p.renderOrder=-4,p.name=n;for(var v=0,m=h.objects;v<m.length;v++){var A=m[v];p.add(A)}return h.texturePromise.then(function(){return{type:"at3d",uri:n,byteLength:a.byteLength,object:p,dispose:function(){return h.dispose()}}})})}const ze=Br.Reader,st=Br.util,xe=Br.roots["@REALSEE/FIVE:five/loaders/model/proto/dome.proto"]||(Br.roots["@REALSEE/FIVE:five/loaders/model/proto/dome.proto"]={}),zd=xe.Model=(()=>{function n(t){if(this.meshes=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.meshes=st.emptyArray,n.decode=function(e,r){e instanceof ze||(e=ze.create(e));let i=r===void 0?e.len:e.pos+r,a=new xe.Model;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.meshes&&a.meshes.length||(a.meshes=[]),a.meshes.push(xe.Mesh.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Model"},n})();xe.Mesh=(()=>{function n(t){if(this.chunks=[],this.matrix=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.name="",n.prototype.chunks=st.emptyArray,n.prototype.matrix=st.emptyArray,n.decode=function(e,r){e instanceof ze||(e=ze.create(e));let i=r===void 0?e.len:e.pos+r,a=new xe.Mesh;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.name=e.string();break}case 2:{a.chunks&&a.chunks.length||(a.chunks=[]),a.chunks.push(xe.Chunk.decode(e,e.uint32()));break}case 3:{a.matrix&&a.matrix.length||(a.matrix=[]),a.matrix.push(xe.Matrix.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("name"))throw st.ProtocolError("missing required 'name'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Mesh"},n})();xe.Matrix=(()=>{function n(t){if(this.elements=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.elements=st.emptyArray,n.decode=function(e,r){e instanceof ze||(e=ze.create(e));let i=r===void 0?e.len:e.pos+r,a=new xe.Matrix;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.elements&&a.elements.length||(a.elements=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.elements.push(e.float())}else a.elements.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Matrix"},n})();xe.Chunk=(()=>{function n(t){if(this.material=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.geometry=null,n.prototype.material=st.emptyArray,n.decode=function(e,r){e instanceof ze||(e=ze.create(e));let i=r===void 0?e.len:e.pos+r,a=new xe.Chunk;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 2:{a.geometry=xe.Geometry.decode(e,e.uint32());break}case 3:{a.material&&a.material.length||(a.material=[]),a.material.push(xe.Material.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("geometry"))throw st.ProtocolError("missing required 'geometry'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Chunk"},n})();xe.Geometry=(()=>{function n(t){if(this.groups=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.position=null,n.prototype.uv=null,n.prototype.uv2=null,n.prototype.normal=null,n.prototype.groups=st.emptyArray,n.decode=function(e,r){e instanceof ze||(e=ze.create(e));let i=r===void 0?e.len:e.pos+r,a=new xe.Geometry;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.position=xe.Position.decode(e,e.uint32());break}case 2:{a.uv=xe.UV.decode(e,e.uint32());break}case 3:{a.uv2=xe.UV.decode(e,e.uint32());break}case 4:{a.normal=xe.Normal.decode(e,e.uint32());break}case 5:{a.groups&&a.groups.length||(a.groups=[]),a.groups.push(xe.Group.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("position"))throw st.ProtocolError("missing required 'position'",{instance:a});if(!a.hasOwnProperty("normal"))throw st.ProtocolError("missing required 'normal'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Geometry"},n})();xe.Position=(()=>{function n(t){if(this.array=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.array=st.emptyArray,n.decode=function(e,r){e instanceof ze||(e=ze.create(e));let i=r===void 0?e.len:e.pos+r,a=new xe.Position;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.array&&a.array.length||(a.array=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.array.push(e.float())}else a.array.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Position"},n})();xe.UV=(()=>{function n(t){if(this.array=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.array=st.emptyArray,n.decode=function(e,r){e instanceof ze||(e=ze.create(e));let i=r===void 0?e.len:e.pos+r,a=new xe.UV;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.array&&a.array.length||(a.array=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.array.push(e.float())}else a.array.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/UV"},n})();xe.Normal=(()=>{function n(t){if(this.array=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.array=st.emptyArray,n.decode=function(e,r){e instanceof ze||(e=ze.create(e));let i=r===void 0?e.len:e.pos+r,a=new xe.Normal;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.array&&a.array.length||(a.array=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.array.push(e.float())}else a.array.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Normal"},n})();xe.Group=(()=>{function n(t){if(t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.start=0,n.prototype.count=0,n.prototype.materialIndex=0,n.decode=function(e,r){e instanceof ze||(e=ze.create(e));let i=r===void 0?e.len:e.pos+r,a=new xe.Group;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.start=e.uint32();break}case 2:{a.count=e.uint32();break}case 3:{a.materialIndex=e.uint32();break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("start"))throw st.ProtocolError("missing required 'start'",{instance:a});if(!a.hasOwnProperty("count"))throw st.ProtocolError("missing required 'count'",{instance:a});if(!a.hasOwnProperty("materialIndex"))throw st.ProtocolError("missing required 'materialIndex'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Group"},n})();xe.Material=(()=>{function n(t){if(t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.kd=null,n.prototype.ks=null,n.prototype.ke=null,n.prototype.mapkd="",n.prototype.mapks="",n.prototype.mapke="",n.prototype.norm="",n.prototype.mapbump="",n.prototype.bump="",n.prototype.mapd="",n.prototype.ns=0,n.prototype.d=0,n.prototype.tr=0,n.prototype.mapkdrepeat="",n.decode=function(e,r){e instanceof ze||(e=ze.create(e));let i=r===void 0?e.len:e.pos+r,a=new xe.Material;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.kd=xe.Color.decode(e,e.uint32());break}case 2:{a.ks=xe.Color.decode(e,e.uint32());break}case 3:{a.ke=xe.Color.decode(e,e.uint32());break}case 4:{a.mapkd=e.string();break}case 5:{a.mapks=e.string();break}case 6:{a.mapke=e.string();break}case 7:{a.norm=e.string();break}case 8:{a.mapbump=e.string();break}case 9:{a.bump=e.string();break}case 10:{a.mapd=e.string();break}case 11:{a.ns=e.float();break}case 12:{a.d=e.float();break}case 13:{a.tr=e.float();break}case 14:{a.mapkdrepeat=e.string();break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Material"},n})();xe.Color=(()=>{function n(t){if(this.rgb=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.rgb=st.emptyArray,n.decode=function(e,r){e instanceof ze||(e=ze.create(e));let i=r===void 0?e.len:e.pos+r,a=new xe.Color;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.rgb&&a.rgb.length||(a.rgb=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.rgb.push(e.float())}else a.rgb.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Color"},n})();function Gu(n,t){var e={byteLength:0};return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"})}).then(function(r){return e.byteLength=r.body.byteLength,Hu(new Uint8Array(r.body),t.textureBaseUri||"",t.textureOptions,t.fetcher)}).then(function(r){var i=new d.Group;i.renderOrder=-4,i.matrixAutoUpdate=!1,i.matrix.compose(i.position,i.quaternion,i.scale),i.name=n;for(var a=0,o=r.objects;a<o.length;a++){var s=o[a];i.add(s)}return r.texturePromise.then(function(){return{type:"dome",uri:n,byteLength:e.byteLength,object:i,dispose:function(){return r.dispose()}}})})}function Gd(n){for(var t=[0,0,0],e=0;e<n.attributes.normal.array.length/9;e++)t[0]=n.attributes.normal.array[e*9],t[1]=n.attributes.normal.array[e*9+1],t[2]=n.attributes.normal.array[e*9+2],n.attributes.normal.array[e*9]=n.attributes.normal.array[e*9+6],n.attributes.normal.array[e*9+1]=n.attributes.normal.array[e*9+7],n.attributes.normal.array[e*9+2]=n.attributes.normal.array[e*9+8],n.attributes.normal.array[e*9+6]=t[0],n.attributes.normal.array[e*9+7]=t[1],n.attributes.normal.array[e*9+8]=t[2];for(var e=0;e<n.attributes.position.array.length/9;e++)t[0]=n.attributes.position.array[e*9],t[1]=n.attributes.position.array[e*9+1],t[2]=n.attributes.position.array[e*9+2],n.attributes.position.array[e*9]=n.attributes.position.array[e*9+6],n.attributes.position.array[e*9+1]=n.attributes.position.array[e*9+7],n.attributes.position.array[e*9+2]=n.attributes.position.array[e*9+8],n.attributes.position.array[e*9+6]=t[0],n.attributes.position.array[e*9+7]=t[1],n.attributes.position.array[e*9+8]=t[2];for(var e=0;e<n.attributes.uv.array.length/6;e++)t[0]=n.attributes.uv.array[e*6],t[1]=n.attributes.uv.array[e*6+1],n.attributes.uv.array[e*6]=n.attributes.uv.array[e*6+4],n.attributes.uv.array[e*6+1]=n.attributes.uv.array[e*6+5],n.attributes.uv.array[e*6+4]=t[0],n.attributes.uv.array[e*6+5]=t[1];n.attributes.normal.needsUpdate=!0,n.attributes.position.needsUpdate=!0,n.attributes.uv.needsUpdate=!0}function Hd(n){var t=n.position,e=n.normal,r=n.uv,i=n.uv2,a=n.groups,o=new d.BufferGeometry;o.setAttribute("position",new d.BufferAttribute(new Float32Array(t.array),3)),e&&o.setAttribute("normal",new d.BufferAttribute(new Float32Array(e.array),3)),r&&o.setAttribute("uv",new d.BufferAttribute(new Float32Array(r.array),2)),i&&o.setAttribute("uv2",new d.BufferAttribute(new Float32Array(i.array),2));for(var s=0,u=a;s<u.length;s++){var c=u[s];o.addGroup(c.start,c.count,c.materialIndex)}return o}function rn(n,t,e,r,i,a,o){if(o.hasOwnProperty(n))return o[n];n=n.split("?")[0],Ar(n)||(n=Et(t,n)),n=n.replace(/\/\/vrlab-image\d*.ljcdn.com\//,"//vrlab-public.ljcdn.com/"),n.indexOf("//")===0&&(n="https:"+n);var s=F({key:"texture.dome",size:64},nr(e,["quality","format","sharpen","mappings"])),u=o[n]=i.loadTexture(n,{imageURL:{transform:e.transform,options:s},wrapS:d.RepeatWrapping,wrapT:d.RepeatWrapping,fetcher:a}).then(function(c){var l=c.body;return r&&l.repeat.copy(r),l.needsUpdate=!0,l.updateMatrix(),l});return u}function qd(n,t,e,r,i,a,o){var s=[],u=new Dn;o.add(u);var c=u.uniforms;c.exposure.value=4.3;var l=u.defines;if(l.USE_MAP=!1,l.USE_UV=!1,n.kd&&(c.diffuse.value=new d.Color().fromArray(n.kd.rgb)),n.mapkd){var h=null;if(n.mapkdrepeat){var p=n.mapkdrepeat.split(/\s+/).map(function(y){return Number(y)}),v=p[0],m=p[1];h=new d.Vector2(v,m)}s.push(rn(n.mapkd,t,e,h,r,i,a).then(function(y){l.USE_MAP=!0,l.USE_UV=!0,c.map.value=y,o.add(y),c.uvTransform.value=y.matrix,u.needsUpdate=!0}).catch(Q))}if(n.ks&&(c.specular.value=new d.Color().fromArray(n.ks.rgb)),n.mapks&&s.push(rn(n.mapks,t,e,null,r,i,a).then(function(y){c.specularMap.value=y,o.add(y)}).catch(Q)),n.ke&&(c.emissive.value=new d.Color().fromArray(n.ke.rgb)),n.mapke&&s.push(rn(n.mapke,t,e,null,r,i,a).then(function(y){c.emissiveMap.value=y,o.add(y)}).catch(Q)),n.norm&&s.push(rn(n.norm,t,e,null,r,i,a).then(function(y){c.normalMap.value=y,o.add(y)}).catch(Q)),n.mapbump&&s.push(rn(n.mapbump,t,e,null,r,i,a).then(function(y){c.bumpMap.value=y,o.add(y)}).catch(Q)),n.bump&&s.push(rn(n.bump,t,e,null,r,i,a).then(function(y){c.bumpMap.value=y,o.add(y)}).catch(Q)),typeof n.ns=="number"&&(c.shininess.value=n.ns),typeof n.d=="number"){var A=n.d;A>0&&A<1&&(u.opacity=A)}return u.floor=0,u.defines.USE_VERTEX_FLOOR=!1,{material:u,textureReady:Promise.all(s).then(Q)}}function Kd(n){return zd.decode(n).meshes}function Hu(n,t,e,r){for(var i=[],a=[],o=new Set,s=Kd(n),u=new An,c=new d.Matrix4,l=new d.Vector3,h=new d.Quaternion,p=new d.Vector3,v={},m=0,A=s;m<A.length;m++){var y=A[m],f=y.name,g=y.chunks,b=y.matrix;if(!(f==="Ceiling"||f==="CeilingDrop"))for(var E=0,w=b;E<w.length;E++){var x=w[E];c.elements=x.elements;var M=new d.Group;M.renderOrder=-4;for(var C=0;C<g.length;C++){var S=Hd(g[C].geometry);S.applyMatrix4(c),c.decompose(l,h,p),p.x*p.y*p.z<0&&S.attributes.normal&&S.attributes.position&&S.attributes.uv&&Gd(S),o.add(S);for(var P=[],I=0,B=g[C].material;I<B.length;I++){var L=B[I],k=qd(L,t||"",e,u,r,v,o),O=k.material,N=k.textureReady;a.push(N),P.push(O)}var D=new Gt(S,P);D.name="chunk_"+C,D.matrix.compose(D.position,D.quaternion,D.scale),D.matrixAutoUpdate=!1,D.frustumCulled=!1,D.renderOrder=-1e3,M.add(D)}M.name=f,i.push(M)}}var H=Promise.all(a).catch(Q),z=function(U){return Promise.resolve()};return{createAt:0,description:"",objects:i,texturePromise:H,updateTexture:z,dispose:function(){o.forEach(function(U){U.dispose()}),o.clear()}}}function qu(n,t){var e={byteLength:0};return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"})}).then(function(r){return e.byteLength=r.body.byteLength,Lu(r.body)}).then(function(r){var i=r.reduce(function(s,u){return s+u.length},0),a=new Uint8Array(i),o=0;return r.forEach(function(s){a.set(s,o),o+=s.length}),a}).then(function(r){return Hu(r,t.textureBaseUri||"",t.textureOptions,t.fetcher)}).then(function(r){var i=new d.Group;i.renderOrder=-4,i.name=n;for(var a=0,o=r.objects;a<o.length;a++){var s=o[a];i.add(s)}return r.texturePromise.then(function(){return{type:"domez",uri:n,byteLength:e.byteLength,object:i,dispose:function(){return r.dispose()}}})})}var jd=new d.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);function Wd(n,t){var e=0;return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"}).then(function(r){return e=r.body.byteLength,r.body})}).then(function(r){var i;return Da(r,{copyUV2:!1,addonExtensions:["PBM_mesh"],resourcePath:n.slice(0,n.lastIndexOf("/")+1),search:(i=n.split("?")[1])!==null&&i!==void 0?i:"",fetcher:t.fetcher})}).then(function(r){var i=new d.Matrix4;if(t.upAxis!=="Z"&&i.premultiply(jd),r.CESIUM_RTC){var a=new d.Matrix4().setPosition(r.CESIUM_RTC.center);i.premultiply(a)}var o=r.scene;return o.applyMatrix4(i),{type:"glb",uri:n,byteLength:e,object:o,dispose:function(){return r.dispose()}}})}var nn=new d.Vector3,$o=new d.Matrix4,Xd=30;function es(n,t){var e=t.tileset.properties.floorInfo;n.traverse(function(r){if("floor"in t.extras)r instanceof Gt?(r.material.forEach(function(g){g.floor=t.extras.floor}),r.renderOrder=-1e3+t.extras.floor):r instanceof Fr&&(r.material.floor=t.extras.floor,r.renderOrder=-1e3+t.extras.floor);else if((r instanceof Gt||r instanceof Fr)&&e){var i=r.geometry.index,a=r.geometry.getAttribute("position"),o=0,s=new Float32Array(a.count);if(e)if(i){for(var u=0,c=i.count,l=0;l<c;l++){var y=i.array[l];nn.set(a.array[y*3+0],a.array[y*3+1],a.array[y*3+2]),nn.applyMatrix4(r.matrixWorld);var h=nn.y;s[y]=0;for(var p=0;p<e.length;p++){var f=e[p],m=f.ground,A=f.height;if(h<m+A){s[y]=p;break}}u+=s[y]}o=u/c}else{for(var u=0,c=a.count,l=0;l<c;l++){nn.set(a.array[l*3+0],a.array[l*3+1],a.array[l*3+2]),nn.applyMatrix4(r.matrixWorld);var h=nn.y;s[l]=0;for(var p=0;p<e.length;p++){var v=e[p],m=v.ground,A=v.height;if(h<m+A){s[l]=p;break}}u+=s[l]}o=u/c}r.renderOrder=-1e3+o,r.geometry.setAttribute("floor",new d.BufferAttribute(s,1)),Array.isArray(r.material)?r.material.forEach(function(g){g.defines.USE_VERTEX_FLOOR=!0,g.needsUpdate=!0}):(r.material.defines.USE_VERTEX_FLOOR=!0,r.material.needsUpdate=!0)}})}var Qt=function(n){oe(t,n);function t(e,r,i){var a,o,s,u,c=n.call(this)||this;c.model=e,c.search=(a=i.search)!==null&&a!==void 0?a:"",c.unloadTileQueue=[],c.boundingBox=new d.Box3,c.minLevelOfDetail=t.DEFAULT_MIN_LEVEL_OF_DETAIL,c.maxLevelOfDetail=t.DEFAULT_MAX_LEVEL_OF_DETAIL,c.needsRefined=!0,c.refined=!1,c.refineProgress=[0,0],c.loaded=!1,c.disposed=!1,c.needsRender=!0,c.matrixAutoUpdate=!1,c.renderOrder=-4,c.lastRefineTime=-1,c.nodes=new Map,c.nodeGroup=new d.Group,c.nodeGroup.matrixAutoUpdate=!1,c.nodeGroup.renderOrder=-4,c.add(c.nodeGroup),c.debugBoundings=new Map,c.debugBoundingGroup=new d.Group,c.debugBoundingGroup.visible=!1,c.debugBoundingGroup.matrixAutoUpdate=!1,c.debugBoundingGroup.renderOrder=-4,c.add(c.debugBoundingGroup),c.cacheCameras=[];var l=Uo(r,(o=i.resourcePath)!==null&&o!==void 0?o:"");return c.tileset=new ti((u=(s=c.model.work)===null||s===void 0?void 0:s.workCode)!==null&&u!==void 0?u:"",l,{contentLoader:function(h){return c.loadContent(h,{fetcher:i.fetcher})},onTileLoad:function(){},onTileUnload:function(h){c.unloadTileQueue.push(h)},onTileError:function(h,p){i.onError&&i.onError(Object.assign(p,{error:p})),console.error("Tile error",h.id,p)}}),c.tileset.root.boundingVolume&&c.tileset.root.boundingVolume.getBoundingBox(c.boundingBox),c}return Object.defineProperty(t.prototype,"debug",{get:function(){return this.debugBoundingGroup.visible},set:function(e){this.debugBoundingGroup.visible!==e&&(this.debugBoundingGroup.visible=e,this.needsRender=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxMemoryUsage",{get:function(){return this.tileset.maxMemoryUsage},set:function(e){this.tileset.maxMemoryUsage=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxRequests",{get:function(){return this.tileset.maxRequests},set:function(e){this.tileset.maxRequests=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxScreenSpaceError",{get:function(){return this.tileset.maxScreenSpaceError},set:function(e){this.tileset.maxScreenSpaceError=e},enumerable:!1,configurable:!0}),t.prototype.loadContent=function(e,r){var i=this;if(!e.content)return Promise.resolve(!1);var a=e.content,o=Eu(a.uri,this.search);if(e.type==="TILESET"){var s=Wt(o,{key:"model.".concat(e.siblingIndex)});return r.fetcher.ajax(s,{responseType:"text"}).then(function(u){return u.body}).then(function(u){var c=s.slice(0,s.lastIndexOf("/")+1);return Uo(JSON.parse(u),c)}).then(function(u){return e.geometricError=u.geometricError,e.children.length===0&&(e.children=[new Qa("".concat(e.id,".0"),u.root,e.tileset,e)]),!0})}return e.type==="SCENEGRAPH"?Promise.resolve().then(function(){var u,c,l,h,p,v,m,A,y,f,g="",b=o.split("#"),E=b[0],w=b[1],x=(w||E).split("?")[0].match(/\.([0-9a-zA-Z]+)$/);if(x&&(g=x[1]),g==="b3dm"){var M=Wt(o,{key:"model.".concat(e.siblingIndex)});return Tu(M,{upAxis:e.tileset.asset.gltfUpAxis,fetcher:r.fetcher}).then(function(C){return C.object.applyMatrix4(e.transform),C.object.updateWorldMatrix(!1,!0),C.object.matrixAutoUpdate=!1,es(C.object,e),C})}if(g==="pnts"){var M=Wt(o,{key:"model.".concat(e.siblingIndex)});return Bu(M,{fetcher:r.fetcher,computeBoundingBox:!1}).then(function(S){if(S.object.applyMatrix4(e.transform),S.object.updateWorldMatrix(!1,!0),S.object.matrixAutoUpdate=!1,e.boundingVolume){var P=e.boundingVolume;S.object.traverse(function(I){if(I instanceof Fr){$o.getInverse(I.matrixWorld);var B=new d.Box3;P.getBoundingBox(B),B.applyMatrix4($o),I.geometry.boundingBox=B}})}return S})}if(g==="glb"){var M=Wt(o,{key:"model.".concat(e.siblingIndex)});return Wd(M,{upAxis:e.tileset.asset.gltfUpAxis,fetcher:r.fetcher}).then(function(S){return S.object.applyMatrix4(e.transform),S.object.updateWorldMatrix(!1,!0),S.object.matrixAutoUpdate=!1,es(S.object,e),S})}if(g==="at3d"){var M=e.extras.at3d?o:Wt(o,{key:"model.".concat(e.siblingIndex)});return zu(M,{textureBaseUri:(u=e.extras.at3d)===null||u===void 0?void 0:u.textureBaseUri,textureArray:(c=e.extras.at3d)===null||c===void 0?void 0:c.textureArray,textureOptions:(l=e.extras.at3d)===null||l===void 0?void 0:l.textureOptions,fetcher:r.fetcher}).then(function(S){return S.object.applyMatrix4(e.transform),S.object.updateWorldMatrix(!1,!0),S.object.matrixAutoUpdate=!1,S})}if(g==="pbm"){var M=e.extras.pbm?o:Wt(o,{key:"model.".concat(e.siblingIndex)});return Qu(M,{textureBaseUri:(h=e.extras.pbm)===null||h===void 0?void 0:h.textureBaseUri,textureArray:(p=e.extras.pbm)===null||p===void 0?void 0:p.textureArray,textureOptions:(v=e.extras.pbm)===null||v===void 0?void 0:v.textureOptions,fetcher:r.fetcher}).then(function(S){return S.object.applyMatrix4(e.transform),S.object.updateWorldMatrix(!1,!0),S.object.matrixAutoUpdate=!1,S})}if(g==="dome"){var M=e.extras.dome?o:Wt(o,{key:"model.".concat(e.siblingIndex)});return Gu(M,{textureBaseUri:(m=e.extras.dome)===null||m===void 0?void 0:m.textureBaseUri,textureOptions:(A=e.extras.dome)===null||A===void 0?void 0:A.textureOptions,fetcher:r.fetcher}).then(function(S){return S.object.applyMatrix4(e.transform),S.object.updateWorldMatrix(!1,!0),S.object.matrixAutoUpdate=!1,S})}if(g==="domez"){var M=e.extras.domez?o:Wt(o,{key:"model.".concat(e.siblingIndex)});return qu(M,{textureBaseUri:(y=e.extras.domez)===null||y===void 0?void 0:y.textureBaseUri,textureOptions:(f=e.extras.domez)===null||f===void 0?void 0:f.textureOptions,fetcher:r.fetcher}).then(function(S){return S.object.applyMatrix4(e.transform),S.object.updateWorldMatrix(!1,!0),S.object.matrixAutoUpdate=!1,S})}}).then(function(u){if(!u)return Promise.resolve(!1);if(u.type==="pnts"){var c=u.object,l=c.material;l.uniforms.geometricError.value=e.geometricError}var h={type:u.type,uri:u.uri,byteLength:u.byteLength,object:new bu(u.object,u.dispose)};return h.object.generateBvhTree().then(function(){return h})}).then(function(u){if(!u)return!1;if(i.disposed)return u.object.dispose(),a.data=void 0,a.byteLength=0,!1;if(u.object.traverse(function(l){(l instanceof Fr||l instanceof Gt)&&(l.model=i.model)}),a.data=u,a.byteLength=u.byteLength,u.object.traverse(function(l){l.renderOrder>-4&&(l.renderOrder=-4)}),u.object.visible=!1,i.boundingBox.expandByObject(u.object),i.nodes.set(e.id,u.object),i.nodeGroup.add(u.object),e.boundingVolume){var c=Pc(e.boundingVolume,e.state.selectionDepth);c.matrixWorldNeedsUpdate=!0,c.matrixAutoUpdate=!1,c.frustumCulled=!1,c.visible=!0,i.debugBoundings.set(e.id,c),i.debugBoundingGroup.add(c)}return!0}):Promise.resolve(!1)},t.prototype.intersectRaycaster=function(e,r,i){r===void 0&&(r=!0),i===void 0&&(i=[]);for(var a=[this.tileset.root],o=this.tileset.transform,s;s=a.pop();){var u=void 0;if(s.boundingVolume){var c=s.boundingVolume.clone().applyMatrix4(o);u=c.intersectRay(e.ray,e.far)}else u=!0;if(u){for(var l=0,h=s.children.length;l<h;l++)a.push(s.children[l]);s.selected&&s.content&&s.content.data&&s.content.data.object.intersectRaycaster(e,!1,i)}}return r&&i.sort(function(p,v){return p.distance-v.distance}),i},t.prototype.update=function(e,r){var i=this;this.tileset.transform.equals(this.matrixWorld)||this.tileset.transform.copy(this.matrixWorld);var a=ve();if(this.needsRefined&&a-this.lastRefineTime>Xd){this.lastRefineTime=a,this.tileset.cache.reset(),this.tileset.frameNumber++;var o={camera:{position:new d.Vector3().copy(r.position),direction:r.getDirection(new d.Vector3),up:new d.Vector3().copy(r.up),visible:r.visible},minLevelOfDetail:this.visible?this.minLevelOfDetail:-1,maxLevelOfDetail:this.visible?this.maxLevelOfDetail:-1,height:r.screenHeight,pixelRatio:r.pixelRatio,frameNumber:this.tileset.frameNumber,sseDenominator:2*Math.tan(.5*r.fov/180*Math.PI),cullingVolume:new Pn().setFromCamera(r)},s=this.cacheCameras.map(function(p){return F(F({},o),{camera:{position:new d.Vector3().copy(p.position),direction:p.getWorldDirection(new d.Vector3),up:new d.Vector3().copy(p.up),visible:p.visible},cullingVolume:new Pn().setFromCamera(p)})});this.tileset.traverse(o,s),this.refined=!0,this.refineProgress[0]=0,this.refineProgress[1]=0,this.tileset.needsRefinedTiles.forEach(function(p){if(i.refineProgress[1]++,p.content&&p.state.visible){var v=p.content.loadState;if(v==="UNLOADED"||v==="LOADING"){i.refined=!1;return}}i.refineProgress[0]++}),this.loaded===!1&&(this.loaded=!0,this.tileset.needsRefinedTiles.forEach(function(p){if(i.loaded!==!1&&p.content&&p.state.visible&&p.state.selectionDepth===0){var v=p.content.loadState;(v==="UNLOADED"||v==="LOADING")&&(i.loaded=!1)}}))}var u;this.tileset.tiles.forEach(function(p){var v=p.selected,m=p.id;u=i.nodes.get(m),u&&u.visible!==v&&(u.visible=v,i.needsRender=!0),u=i.debugBoundings.get(m),u&&u.visible!==v&&(u.visible=v,i.needsRender=!0)});for(var c;c=this.unloadTileQueue.pop();){var l=c.id,h=c.content;h&&h.data&&(h.data.object.dispose(),h.data=void 0,h.byteLength=0),u=this.nodes.get(l),u&&(this.nodeGroup.remove(u),this.nodes.delete(l),this.needsRender=!0),u=this.debugBoundings.get(l),u&&(this.debugBoundingGroup.remove(u),this.debugBoundings.delete(l),this.needsRender=!0)}},t.prototype.dispose=function(){var e=this;this.disposed=!0,this.tileset.reset();for(var r,i;r=this.unloadTileQueue.pop();){var a=r.id,o=r.content;o&&o.data&&(o.data.object.dispose(),o.data=void 0,o.byteLength=0),i=this.nodes.get(a),i&&(this.nodeGroup.remove(i),this.nodes.delete(a),this.needsRender=!0),i=this.debugBoundings.get(a),i&&(this.debugBoundingGroup.remove(i),this.debugBoundings.delete(a),this.needsRender=!0)}this.nodes.forEach(function(s,u,c){e.nodeGroup.remove(s),s.dispose(),c.delete(u)})},t.DEFAULT_MIN_LEVEL_OF_DETAIL=-1,t.DEFAULT_MAX_LEVEL_OF_DETAIL=20,t.DEFAULT_MAX_MEMORY_USAGE=16,t.DEFAULT_MAX_SCREEN_SPACE_ERROR=ti.DEFAULT_MAX_SCREEN_SPACE_ERROR,t.DEFAULT_MAX_REQUESTS=ti.DEFAULT_MAX_REQUESTS,t}(d.Object3D);function ae(n,t,e){return n<t?t:n>e?e:n}function _d(n){return-((n-.25)*360+90)/180*Math.PI}function ya(n,t){if(n===t)return!0;if(n&&t&&typeof n=="object"&&typeof t=="object"){if(n.constructor!==t.constructor)return!1;var e,r,i;if(Array.isArray(n)){if(e=n.length,e!=t.length)return!1;for(r=e;r--!==0;)if(!ya(n[r],t[r]))return!1;return!0}if(n.constructor===RegExp)return n.source===t.source&&n.flags===t.flags;if(n.valueOf!==Object.prototype.valueOf)return n.valueOf()===t.valueOf();if(n.toString!==Object.prototype.toString)return n.toString()===t.toString();if(i=Object.keys(n),e=i.length,e!==Object.keys(t).length)return!1;for(r=e;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=e;r--!==0;){var a=i[r];if(!ya(n[a],t[a]))return!1}return!0}return n!==n&&t!==t}function Kt(n){return typeof n=="number"}function Zd(n){return(n&n-1)===0&&n!==0}var ts=function(){return new Error("Invalid input.")},rs=function(){return new Error("Invalid certificate.")},ns=function(){return new Error("Invalid signature.")},Yd=function(n){return new Error("date(".concat(n.toString(),") expired."))},Jd=function(n){return new Error("host(".concat(JSON.stringify(n),") is not allowed."))};function $d(n,t){for(var e={},r=0,i=Object.keys(n);r<i.length;r++){var a=i[r];t.indexOf(a)===-1&&(e[a]=n[a])}return e}function xn(n,t){t===void 0&&(t=!1);var e=typeof n;if(e==="string")return JSON.stringify(n);if(n===!0)return"true";if(n===!1)return"false";if(n===null)return"null";if(n instanceof Array){for(var r="[",i=n.length-1,a=0;a<i;a++)r+=xn(n[a],!1)+",";return i>-1&&(r+=xn(n[a],!1)),r+"]"}if(n instanceof Object){if(typeof n.toJSON=="function")return xn(n.toJSON(),t);for(var o=Object.keys(n).sort(),s=o.length,r="",a=0;a<s;){var u=o[a],c=xn(n[u],!0);c!==void 0&&(a&&r!==""&&(r+=","),r+=JSON.stringify(u)+":"+c),a++}return"{"+r+"}"}switch(e){case"function":case"undefined":return t?void 0:null;case"number":return 0;default:return isFinite(n)?n:null}}function ef(n){return String(xn(n,!1))}function Ku(n){var t,e,r;if(Array.isArray(n)){var i=void 0,a,o;if(n.length<=0)return ts();for(var s=function(w){var x=Ku(n[w]);if(x instanceof Error)return{value:x};if(!i)i=x.issuer;else if(i!==x.issuer)return{value:rs()};a?x.expire.getTime()<a.getTime()&&(a=x.expire):a=x.expire,o?o=o.filter(function(M){return x.allowHosts.indexOf(M)!==-1}):o=x.allowHosts},u=0;u<n.length;u++){var c=s(u);if(typeof c=="object")return c.value}return qr({issuer:i,expire:a,allowHosts:o})}var l=JSON.parse(n),h=typeof location!="undefined"?location.hostname:"",p=Date.now();if(typeof l!="object")return ts();var v=new Date(typeof l.expire_at=="string"&&/^\d+$/.test(l.expire_at)?Number(l.expire_at):l.expire_at),m=Array.isArray(l.allow_hosts)?l.allow_hosts:[];if(h.length===0||Xr(h)||rr.filter(function(w){return Rr(w,h)}).length>0){var A=String((t=l.certificate)!==null&&t!==void 0?t:"");if(A){var y=new Qe;return y.readCertPEM(A),qr({issuer:y.getSubjectString(),expire:v,allowHosts:m})}return qr({issuer:"none",expire:v,allowHosts:m})}var f=String((e=l.certificate)!==null&&e!==void 0?e:"");if(!f)return rs();var g=new Qe;g.readCertPEM(f);var b=String((r=l._signature)!==null&&r!==void 0?r:"");if(!b)return ns();var E=ef($d(l,["_signature"]));return Fl(E,b,g)===!1?ns():p<v.getTime()?m.filter(function(w){return Rr(w,h)}).length===0?Jd(h):qr({issuer:g.getSubjectString(),expire:v,allowHosts:m}):Yd(v)}var is=new d.Matrix4,Ga=new WeakMap,Ha=function(){function n(t,e){this.name="",this.workCode="",this.expire=new Date,this.allowHosts=[],this.initial={work:this},this.observers=[],this.issuer="none",this.raw={works:[""],options:""},this.options={transform:new d.Matrix4};var r=tf(t,e,this);if(r instanceof Error)throw new Error("[PARSE FAILED]: "+r.message+`
|
|
929
929
|
Error work input:
|
|
930
930
|
`+JSON.stringify(t))}return n.prototype.toJSON=function(){return this.raw},n.parse=kn,n}();function as(n){return n==null?"null":Array.isArray(n)?"array":typeof n=="object"?"dict":"value"}function ba(n,t){var e=as(n),r=as(t);if(r==="null")return n;if(r==="value")return t;if(r!==e)return JSON.parse(JSON.stringify(t));if(r==="array")for(var i=0;i<t.length;i++)n[i]=ba(n[i],t[i]);else if(r==="dict")for(var a in t)n[a]=ba(n[a],t[a]);return n}function qa(n,t){return n.indexOf(t)===0}function Ka(n,t,e,r){var i,a=t;if(r.jsonp===!0){a=t.replace(/([\?\#].*)?$/i,"");var o=vo("".concat(a)).slice(0,7);a="".concat(a,".").concat(o,".jsonp")}if(r.shortPath===!0){var s=a.replace(n,"").split("."),u=(i=s.shift())!==null&&i!==void 0?i:"",c=s.join(".");a=Et(n,vo(u))+(c?"."+c:"")}var l=a.replace(n,"");return r.baseURL&&(a=Et(r.baseURL,l)),a}function Ze(n,t,e,r,i){var a=e;return Ar(e)||(t&&(t=Et(t,String(r))),a=Et(t,a)),Ar(a)||(a=Et(n,a)),qa(a,n)||console.warn("".concat(a," is not start with base_url(").concat(n,").")),Ka(n,a,"panorama",i)}function os(n,t,e){var r=t;return Ar(r)||(r=Et(n,t)),qa(r,n)||console.warn("".concat(r," is not start with base_url(").concat(n,").")),Ka(n,r,"model",e)}function Xn(n,t,e,r){var i=t;return Ar(i)||(i=Et(e,i)),Ar(i)||(i=Et(n,i)),qa(i,n)||console.warn("".concat(i," is not start with base_url(").concat(n,").")),Ka(n,i,"texture",r)}function tf(n,t,e){for(var r,i,a,o,s,u,c,l,h,p,v,m,A,y,f,g,b,E,w=JSON.stringify(t),x=[],M=0,C=[].concat(n);M<C.length;M++){var S=C[M];S instanceof Ha?x.push.apply(x,S.raw.works):typeof S=="string"?x.push(S):x.push(JSON.stringify(S))}var P=Ku(x);if(P instanceof Error)return P;t=JSON.parse(w);var I={transform:new d.Matrix4};typeof t.debug!="undefined"&&(I.debug=t.debug),t.transform&&(Array.isArray(t.transform)?I.transform.fromArray(t.transform):I.transform.copy(t.transform)),t.viewerRequestVolume&&("clone"in t.viewerRequestVolume?I.viewerRequestVolume=t.viewerRequestVolume.clone():I.viewerRequestVolume=Bn(t.viewerRequestVolume)),typeof t.modelMinLevelOfDetail!="undefined"&&t.modelMinLevelOfDetail>=0&&(I.modelMinLevelOfDetail=t.modelMinLevelOfDetail),typeof t.modelMaxLevelOfDetail!="undefined"&&t.modelMaxLevelOfDetail>=0&&(I.modelMaxLevelOfDetail=t.modelMaxLevelOfDetail),typeof t.modelMaxRequests!="undefined"&&t.modelMaxRequests>=0&&(I.modelMaxRequests=t.modelMaxRequests),typeof t.modelMaxMemoryUsage!="undefined"&&t.modelMaxMemoryUsage>=0&&(I.modelMaxMemoryUsage=t.modelMaxMemoryUsage),typeof t.modelMaxScreenSpaceError!="undefined"&&t.modelMaxScreenSpaceError>=0&&(I.modelMaxScreenSpaceError=t.modelMaxScreenSpaceError),Object.defineProperty(e,"options",{configurable:!1,get:function(){return I}}),n=x.map(function(ee){return JSON.parse(ee)}).reduce(function(ee,le){return ba(ee,le)}),Object.defineProperty(e,"raw",{configurable:!1,get:function(){return{works:x,options:w}}});{var B;if(t.workCode&&(typeof t.workCode=="string"?B=t.workCode:typeof t.workCode=="function"&&(B=t.workCode(n))),typeof B=="undefined"&&(B=String(n.resource_code||n.basic_code||n.vr_code||n.code||n.project_id||n.work_code||n.workCode)),typeof B=="undefined")return new Error("WorkCode never matched.");Object.defineProperty(e,"workCode",{configurable:!1,get:function(){return B}})}{var L=String(n.name);Object.defineProperty(e,"name",{configurable:!1,get:function(){return L}})}if(P instanceof Error)return P;Object.defineProperty(e,"issuer",{configurable:!1,get:function(){return P.issuer}}),Object.defineProperty(e,"expire",{configurable:!1,get:function(){return P.expire}}),Object.defineProperty(e,"allowHosts",{configurable:!1,get:function(){return P.allowHosts}});var k=(r=n.base_url)!==null&&r!==void 0?r:"";if(k&&k[k.length-1]!=="/"&&(k+="/"),P instanceof Error)return P;if(n.model){var O={work:e,layers:[]},N;n.model.file?N=os(k,n.model.file,t):n.model.file_url&&(N=os(k,n.model.file_url,t)),Object.defineProperty(O,"file",{configurable:!1,get:function(){return N}});var D;n.model.textureBase?D=Xn(k,"",n.model.textureBase,t):n.model.material_base_url?D=Xn(k,"",n.model.material_base_url,t):O.file&&(D=O.file.split("/").slice(0,-1).join("/").replace("/model/","/materials/")),Object.defineProperty(O,"textureBase",{configurable:!1,get:function(){return D}});var H;Array.isArray(n.model.textures)?(H=n.model.textures.map(function(ee){var le,X;return Xn(k,ee,(X=(le=n.model.textureBase)!==null&&le!==void 0?le:n.model.material_base_url)!==null&&X!==void 0?X:"",t)}),Object.freeze(H)):Array.isArray(n.model.material_textures)&&(H=n.model.material_textures.map(function(ee){var le,X;return Xn(k,ee,(X=(le=n.model.textureBase)!==null&&le!==void 0?le:n.model.material_base_url)!==null&&X!==void 0?X:"",t)}),Object.freeze(H)),Object.defineProperty(O,"textures",{configurable:!1,get:function(){return H}});var z=[];if(Array.isArray(n.model.tiles))for(var U=0,q=n.model.tiles;U<q.length;U++){var j=q[U];j&&(j.tileset||j.tileset_url)&&z.push(Object.freeze({type:(i=j.type)!==null&&i!==void 0?i:"mesh",name:(a=j.name)!==null&&a!==void 0?a:"",upAxis:(s=(o=j.upAxis)!==null&&o!==void 0?o:j.up_axis)!==null&&s!==void 0?s:"-Y",tileset:j.tileset||j.tileset_url}))}else n.model.tiles&&(n.model.tiles.tileset||n.model.tiles.tileset_url)&&z.push(Object.freeze({type:(u=n.model.tiles.type)!==null&&u!==void 0?u:"mesh",name:(c=n.model.tiles.name)!==null&&c!==void 0?c:"lod",upAxis:(h=(l=n.model.tiles.upAxis)!==null&&l!==void 0?l:n.model.tiles.up_axis)!==null&&h!==void 0?h:"-Y",tileset:n.model.tiles.tileset||n.model.tiles.tileset_url}));if(Array.isArray(n.model.layers))for(var _=0,Z=n.model.layers;_<Z.length;_++){var W=Z[_];W&&(W.tileset||W.tileset_url)&&z.push(Object.freeze({type:(p=W.type)!==null&&p!==void 0?p:"mesh",name:(v=W.name)!==null&&v!==void 0?v:"",upAxis:(m=W.upAxis)!==null&&m!==void 0?m:W.up_axis,tileset:W.tileset||W.tileset_url}))}Object.freeze(z),Object.defineProperty(O,"layers",{configurable:!1,get:function(){return z}}),Object.defineProperty(e,"model",{configurable:!1,get:function(){if(O.file||O.layers.length)return O}})}if(P instanceof Error)return P;{var Y=[];if(n.observers&&Array.isArray(n.observers)){var ce=[];n.panorama&&(Array.isArray(n.panorama)?ce=n.panorama:Array.isArray(n.panorama.list)?ce=n.panorama.list:Array.isArray(n.panorama.info)&&(ce=n.panorama.info));for(var te=function(ee){var le={},X=n.observers[ee];if(!X)return"break";var Te=ce[ee];if(!Te)return"break";X=Object.assign({},X,Te,{active:X.active!==!1&&Te.active!==!1}),Object.defineProperty(le,"work",{configurable:!1,get:function(){return e}}),Object.defineProperty(le,"index",{configurable:!1,get:function(){return ee}}),Object.defineProperty(le,"panoIndex",{configurable:!1,get:function(){return ee}});var Fe=Be({workCode:e.workCode,panoIndex:ee});Object.defineProperty(le,"panoId",{configurable:!1,get:function(){return Fe}});var Ye=Object.freeze({workCode:e.workCode,panoIndex:ee});Object.defineProperty(le,"pano",{configurable:!1,get:function(){return Ye}});var Xe=X.active!==!1;Object.defineProperty(le,"active",{configurable:!1,get:function(){return Xe}});var Ge=X.loadable===!0;Object.defineProperty(le,"loadable",{configurable:!1,get:function(){return Ge}});var ut=X.derived_id;Object.defineProperty(le,"derivedId",{configurable:!1,get:function(){return ut}});var Ne=X.derived_id_str;Object.defineProperty(le,"derivedIdStr",{configurable:!1,get:function(){return Ne}});var me=(E=(g=(y=(A=n.panorama)===null||A===void 0?void 0:A.pano_high_cube_base_url)!==null&&y!==void 0?y:(f=n.panorama)===null||f===void 0?void 0:f.pano_cube_base_url)!==null&&g!==void 0?g:(b=n.panorama)===null||b===void 0?void 0:b.base_url)!==null&&E!==void 0?E:"",Ae={up:Ze(k,me,X.images?X.images.up:X.up,ee,t),down:Ze(k,me,X.images?X.images.down:X.down,ee,t),right:Ze(k,me,X.images?X.images.right:X.right,ee,t),left:Ze(k,me,X.images?X.images.left:X.left,ee,t),front:Ze(k,me,X.images?X.images.front:X.front,ee,t),back:Ze(k,me,X.images?X.images.back:X.back,ee,t)},nt=X.images?X.images.depth:X.depth;nt&&(Ae.depth=Ze(k,me,nt,ee,t));var Ce=X.images?X.images.luminance:X.luminance;Ce&&(Ae.luminance=Object.freeze({up:Ze(k,me,Ce.up,ee,t),down:Ze(k,me,Ce.down,ee,t),right:Ze(k,me,Ce.right,ee,t),left:Ze(k,me,Ce.left,ee,t),front:Ze(k,me,Ce.front,ee,t),back:Ze(k,me,Ce.back,ee,t)}));var He=X.images?X.images.tiles:X.tiles;if(He){for(var Oe=[],it=function(Ke){var Lt=Ke.match(/\/cube_(\d+)\//);if(Lt){var sr=Number(Lt[1]);if(Zd(sr))return sr}return!1},qe=function(Ke,Lt){return Ke.replace(/\/cube_(\d+)\//,function(){return"/cube_".concat(Lt,"/")})},Zt=0,Or=He;Zt<Or.length;Zt++){var Je=Or[Zt];if(typeof Je=="number"){var Mt=Je,_r=it(Ae.front);if(_r===!1)continue;var $e=Math.max(_r,Math.pow(2,Mt)*512);if($e>2048){var Bt=qe(Ae.up,$e),Rt=qe(Ae.down,$e),Ht=qe(Ae.right,$e),Yt=qe(Ae.left,$e),pt=qe(Ae.front,$e),Ie=qe(Ae.back,$e);Oe.push(Object.freeze({level:Mt,size:$e,up:Bt,down:Rt,right:Ht,left:Yt,front:pt,back:Ie}))}else{var Bt=Ae.up,Rt=Ae.down,Ht=Ae.right,Yt=Ae.left,pt=Ae.front,Ie=Ae.back;Oe.push(Object.freeze({level:Mt,size:$e,up:Bt,down:Rt,right:Ht,left:Yt,front:pt,back:Ie}))}}else{var Mt=Je.level;if(typeof Mt!="number")continue;var $e=Je.size;if(typeof $e!="number")continue;var Bt=Ze(k,me,Je.up,ee,t),Rt=Ze(k,me,Je.down,ee,t),Ht=Ze(k,me,Je.right,ee,t),Yt=Ze(k,me,Je.left,ee,t),pt=Ze(k,me,Je.front,ee,t),Ie=Ze(k,me,Je.back,ee,t);Oe.push(Object.freeze({level:Mt,size:$e,up:Bt,down:Rt,right:Ht,left:Yt,front:pt,back:Ie}))}}Oe.sort(function(Ke,Lt){return Ke.level-Lt.level}),Object.freeze(Oe),Object.defineProperty(Ae,"tiles",{configurable:!1,get:function(){return Oe}})}Object.freeze(Ae),Object.defineProperty(le,"images",{configurable:!1,get:function(){return Ae}});var gr=new d.Vector3;if(X.position instanceof d.Vector3)gr.copy(X.position);else if(Array.isArray(X.position))gr.fromArray(X.position);else return"break";Object.freeze(gr),Object.defineProperty(le,"position",{configurable:!1,get:function(){return gr}});var Ft=new d.Vector3;if(X.standingPosition instanceof d.Vector3)Ft.copy(X.standingPosition);else if(Array.isArray(X.standingPosition))Ft.fromArray(X.standingPosition);else if(X.standing_position instanceof d.Vector3)Ft.copy(X.standing_position);else if(Array.isArray(X.standing_position))Ft.fromArray(X.standing_position);else return"break";Object.freeze(Ft),Object.defineProperty(le,"standingPosition",{configurable:!1,get:function(){return Ft}});var ir=new d.Quaternion;if(X.quaternion instanceof d.Quaternion)ir.copy(X.quaternion);else if(Array.isArray(X.quaternion))ir.fromArray(X.quaternion);else if(X.quaternion){var kt=X.quaternion,mn=kt.x,Vr=kt.y,Nr=kt.z,ar=kt.w;ir.set(mn,Vr,Nr,ar)}else return"break";Object.freeze(ir),Object.defineProperty(le,"quaternion",{configurable:!1,get:function(){return ir}});var or=0;Kt(X.floorIndex)?or=X.floorIndex:Kt(X.floor_index)?or=X.floor_index:Kt(X.floor)&&(or=X.floor),Object.defineProperty(le,"floorIndex",{configurable:!1,get:function(){return or}});var et;X.video&&(et={},typeof X.video.source=="string"&&(et.source=X.video.source),X.video.matrix instanceof d.Matrix4?et.matrix=X.video.matrix.clone():Array.isArray(X.video.matrix)&&(et.matrix=new d.Matrix4().fromArray(X.video.matrix)),X.video.size instanceof d.Vector2?et.size=X.video.size.clone():Array.isArray(X.video.size)&&(et.size=new d.Vector2().fromArray(X.video.size)),et.source&&et.matrix&&et.size&&(le.video=et)),Object.freeze(et),Object.defineProperty(le,"video",{configurable:!1,get:function(){return et}}),Array.isArray(X.accessibleNodes)?(le.accessibleNodes=X.accessibleNodes.slice(),le.accessibleIds=X.accessibleNodes.map(function(Ke){return Be({workCode:e.workCode,panoIndex:Ke})})):Array.isArray(X.accessible_nodes)&&(le.accessibleNodes=X.accessible_nodes.slice(),le.accessibleIds=X.accessible_nodes.map(function(Ke){return Be({workCode:e.workCode,panoIndex:Ke})})),Array.isArray(X.visibleNodes)?(le.visibleNodes=X.visibleNodes.slice(),le.visibleIds=X.visibleNodes.map(function(Ke){return Be({workCode:e.workCode,panoIndex:Ke})})):Array.isArray(X.visible_nodes)&&(le.visibleNodes=X.visible_nodes.slice(),le.visibleIds=X.visible_nodes.map(function(Ke){return Be({workCode:e.workCode,panoIndex:Ke})})),Y[ee]=le},se=0;se<n.observers.length;se++){var ue=te(se);if(ue==="break")break}}for(var pe=function(ee){if(ee.accessibleIds){var Te=ee.accessibleIds.filter(function(me){return!!Y.find(function(Ae){return Ae.panoId===me})});Object.freeze(Te),Object.defineProperty(ee,"accessibleIds",{configurable:!1,get:function(){return Te}})}else{for(var le=[],X=0;X<Y.length;X++)Y[X]!==ee&&(Math.abs(Y[X].position.y-ee.position.y)>3||Y[X].position.distanceTo(ee.position)>10||le.push(Y[X].panoId));Object.freeze(le),Object.defineProperty(ee,"accessibleIds",{configurable:!1,get:function(){return le}})}if(ee.accessibleNodes){var Ye=ee.accessibleNodes.filter(function(me){return!!Y.find(function(Ae){return Ae.panoIndex===me})});Object.freeze(Ye),Object.defineProperty(ee,"accessibleNodes",{configurable:!1,get:function(){return Ye}})}else{for(var Fe=[],X=0;X<Y.length;X++)Y[X]!==ee&&(Math.abs(Y[X].position.y-ee.position.y)>3||Y[X].position.distanceTo(ee.position)>10||Fe.push(Y[X].panoIndex));Object.freeze(Fe),Object.defineProperty(ee,"accessibleNodes",{configurable:!1,get:function(){return Fe}})}if(ee.visibleIds){var Ge=ee.visibleIds.filter(function(me){return!!Y.find(function(Ae){return Ae.panoId===me})});Object.freeze(Ge),Object.defineProperty(ee,"visibleIds",{configurable:!1,get:function(){return Ge}})}else{var Xe=ee.accessibleIds.slice();Object.freeze(Xe),Object.defineProperty(ee,"visibleIds",{configurable:!1,get:function(){return Xe}})}if(ee.visibleNodes){var Ne=ee.visibleNodes.filter(function(me){return!!Y.find(function(Ae){return Ae.panoIndex===me})});Object.freeze(Ne),Object.defineProperty(ee,"visibleNodes",{configurable:!1,get:function(){return Ne}})}else{var ut=ee.accessibleNodes.slice();Object.freeze(ut),Object.defineProperty(ee,"visibleNodes",{configurable:!1,get:function(){return ut}})}},he=0,de=Y;he<de.length;he++){var be=de[he];pe(be)}Object.freeze(Y),Object.defineProperty(e,"observers",{configurable:!1,get:function(){return Y}})}if(P instanceof Error)return P;if(n.initial){if((n.initial.mode==="Panorama"&&e.observers.length===0||n.initial.mode==="Floorplan"||n.initial.mode==="Topview"||n.initial.mode==="Model"||n.initial.mode==="Mapview"||n.initial.mode==="DepthPanorama")&&(e.initial.mode=n.initial.mode),Kt(n.initial.latitude)&&(e.initial.latitude=n.initial.latitude),Kt(n.initial.longitude)?e.initial.longitude=n.initial.longitude:Kt(n.initial.heading)&&(e.initial.longitude=_d(n.initial.heading)),Kt(n.initial.fov)&&(e.initial.fov=n.initial.fov),e.observers.length>0){var fe=void 0;Kt(n.initial.panoIndex)?fe=n.initial.panoIndex:Kt(n.initial.pano_index)?fe=n.initial.pano_index:Kt(n.initial.pano)&&(fe=n.initial.pano),typeof fe=="number"&&(fe=ae(fe,0,e.observers.length-1),e.initial.panoIndex=fe)}if(Kt(n.initial.distance)&&(e.initial.distance=n.initial.distance),Array.isArray(n.initial.offset)){var Se=[0,0,0].map(function(ee,le){var X=Number(n.initial.offset[le]);return isNaN(X)||!isFinite(X)?0:X});e.initial.offset=new d.Vector3().fromArray(Se)}!e.initial.mode&&typeof e.initial.panoIndex=="number"&&(e.initial.mode="Panorama")}return P instanceof Error?P:(Ga.set(e,{works:x,options:w}),e)}function kn(n,t){typeof n=="string"&&n.trim()[0]==="{"&&(n=JSON.parse(n));var e=Ga.get(n);if(e){if(t&&!ya(JSON.parse(e.options),t))throw new Error("[PARSE FAILED]: work is parsed with different options.");return n}else try{return new Ha(n,t!=null?t:{})}catch(r){throw new Error("[PARSE FAILED]: "+r.message+`
|
|
931
931
|
Error work input:
|
|
@@ -2017,7 +2017,7 @@ void main() {
|
|
|
2017
2017
|
#include <premultiplied_alpha_fragment>
|
|
2018
2018
|
|
|
2019
2019
|
}
|
|
2020
|
-
`},ro=function(n){oe(t,n);function t(e){var r=n.call(this,{uniforms:d.UniformsUtils.clone(aa.uniforms),vertexShader:aa.vertexShader,fragmentShader:aa.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(ro.prototype,{isLineMaterial:!0});var u0=function(n){oe(t,n);function t(e,r){var i=n.call(this)||this;return i.type="LineSegments2",i.geometry=e!==void 0?e:new to,i.material=r!==void 0?r:new ro({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,u=0,c=0,l=r.count;u<l;u++,c+=2)o.fromBufferAttribute(r,u),s.fromBufferAttribute(i,u),a[c]=c===0?0:a[c-1],a[c+1]=a[c]+o.distanceTo(s);var h=new d.InstancedInterleavedBuffer(a,2,1);return e.setAttribute("instanceDistanceStart",new d.InterleavedBufferAttribute(h,1,0)),e.setAttribute("instanceDistanceEnd",new d.InterleavedBufferAttribute(h,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,u=this.material,c=u.resolution,l=u.linewidth,h=s.attributes.instanceStart,p=s.attributes.instanceEnd,v=new d.Vector4,m=new d.Vector4,A=new d.Vector4,y=new d.Vector3,f=new d.Matrix4,g=new d.Line3,b=new d.Vector3;i.at(1,A),A.w=1,A.applyMatrix4(a.matrixWorldInverse),A.applyMatrix4(o),A.multiplyScalar(1/A.w),A.x*=c.x/2,A.y*=c.y/2,A.z=0,y.copy(A);var E=this.matrixWorld;f.multiplyMatrices(a.matrixWorldInverse,E);for(var w=0,x=h.count;w<x;w++){v.fromBufferAttribute(h,w),m.fromBufferAttribute(p,w),v.w=1,m.w=1,v.applyMatrix4(f),m.applyMatrix4(f),v.applyMatrix4(o),m.applyMatrix4(o),v.multiplyScalar(1/v.w),m.multiplyScalar(1/m.w);var M=v.z<-1&&m.z<-1,C=v.z>1&&m.z>1;if(!(M||C)){v.x*=c.x/2,v.y*=c.y/2,m.x*=c.x/2,m.y*=c.y/2,g.start.copy(v),g.start.z=0,g.end.copy(m),g.end.z=0;var S=g.closestPointToPointParameter(y,!0);g.at(S,b);var P=d.MathUtils.lerp(v.z,m.z,S),I=P>=-1&&P<=1,B=y.distanceTo(b)<l*.5;if(I&&B){g.start.fromBufferAttribute(h,w),g.end.fromBufferAttribute(p,w),g.start.applyMatrix4(E),g.end.applyMatrix4(E);var L=new d.Vector3,k=new d.Vector3;i.distanceSqToSegment(g.start,g.end,k,L),r.push({point:k,pointOnLine:L,distance:i.origin.distanceTo(k),object:this,faceIndex:w})}}}},t}(d.Mesh);Object.assign(u0.prototype,{isLineSegments2:!0});var l0=function(n){oe(t,n);function t(e,r){var i=n.call(this,e,r)||this;return i.type="Line2",i}return t}(u0);Object.assign(l0.prototype,{isLine2:!0});var c0=function(n){oe(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}(to);Object.assign(c0.prototype,{isLineGeometry:!0});var lp="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==",Rs=14467195,cp=8,dp=2,fp=20,Fs=null,Sa=function(n){oe(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 c0,o=new ro({color:Rs,linewidth:dp,dashScale:fp,dashed:!1});i.line=new l0(a,o);var s=new d.BufferGeometry,u=new d.PointsMaterial({color:Rs,size:cp,map:Fs||(Fs=new d.TextureLoader().load(lp)),sizeAttenuation:!1,transparent:!0});return i.points=new d.Points(s,u),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.0.0-alpha.72"},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(Sa.prototype,{isFiveLine:!0});var Ue={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 d0(n){return bi(this,void 0,void 0,function(){var t;return wi(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 hp(n){return bi(this,void 0,void 0,function(){var t,e;return wi(this,function(r){switch(r.label){case 0:if(!n)throw new Error("No basePath supplied");return t="profilesList.json",[4,d0("".concat(n,"/").concat(t))];case 1:return e=r.sent(),[2,e]}})})}function pp(n,t,e,r){return e===void 0&&(e=null),r===void 0&&(r=!0),bi(this,void 0,void 0,function(){var i,a,o,s,u,c;return wi(this,function(l){switch(l.label){case 0:if(!n)throw new Error("No xrInputSource supplied");if(!t)throw new Error("No basePath supplied");return[4,hp(t)];case 1:if(i=l.sent(),n.profiles.some(function(h){var p=i[h];return p&&(a={profileId:h,profilePath:"".concat(t,"/").concat(p.path),deprecated:!!p.deprecated}),!!a}),!a){if(!e)throw new Error("No matching profile name found");if(o=i[e],!o)throw new Error('No matching profile name found and default profile "'.concat(e,'" missing.'));a={profileId:e,profilePath:"".concat(t,"/").concat(o.path),deprecated:!!o.deprecated}}return[4,d0(a.profilePath)];case 2:if(s=l.sent(),r){if(c=void 0,c=s.layouts[n.handedness],!c)throw new Error("No matching handedness, ".concat(n.handedness,", in profile ").concat(a.profileId));c.assetPath&&(u=a.profilePath.replace("profile.json",c.assetPath))}return[2,{profile:s,assetPath:u}]}})})}var vp={xAxis:0,yAxis:0,button:0,state:Ue.ComponentState.DEFAULT};function Ap(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 mp=function(){function n(t){this.componentProperty=t.componentProperty,this.states=t.states,this.valueNodeName=t.valueNodeName,this.valueNodeProperty=t.valueNodeProperty,this.valueNodeProperty===Ue.VisualResponseProperty.TRANSFORM&&(this.minNodeName=t.minNodeName,this.maxNodeName=t.maxNodeName),this.value=0,this.updateFromComponent(vp)}return n.prototype.updateFromComponent=function(t){var e=t.xAxis,r=t.yAxis,i=t.button,a=t.state,o=Ap(e,r),s=o.normalizedXAxis,u=o.normalizedYAxis;switch(this.componentProperty){case Ue.ComponentProperty.X_AXIS:this.value=this.states.includes(a)?s:.5;break;case Ue.ComponentProperty.Y_AXIS:this.value=this.states.includes(a)?u:.5;break;case Ue.ComponentProperty.BUTTON:this.value=this.states.includes(a)?i:0;break;case Ue.ComponentProperty.STATE:this.valueNodeProperty===Ue.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}(),gp=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 mp(e.visualResponses[i]);r.visualResponses[i]=a}),this.gamepadIndices=Object.assign({},e.gamepadIndices),this.values={state:Ue.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=F({id:this.id},this.values);return t},enumerable:!1,configurable:!0}),n.prototype.updateFromGamepad=function(t){var e=this;if(this.values.state=Ue.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=Ue.ComponentState.PRESSED:(r.touched||this.values.button>Ue.ButtonTouchThreshold)&&(this.values.state=Ue.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===Ue.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>Ue.AxisTouchThreshold&&(this.values.state=Ue.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===Ue.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>Ue.AxisTouchThreshold&&(this.values.state=Ue.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(function(i){i.updateFromComponent(e.values)})},n}(),yp=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 gp(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}(),bp="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",wp="generic-trigger",Ep=function(n){oe(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,u=i.value,c=i.valueNodeProperty;a&&(c===Ue.VisualResponseProperty.VISIBILITY?a.visible=u:c===Ue.VisualResponseProperty.TRANSFORM&&(a.quaternion.copy(o.quaternion).slerp(s.quaternion,u),a.position.lerpVectors(o.position,s.position,u)))})}))},t}(In.Object3D);function xp(n,t){Object.values(n.components).forEach(function(e){var r=e.type,i=e.touchPointNodeName,a=e.visualResponses;if(r===Ue.ComponentType.TOUCHPAD)if(e.touchPointNode=t.getObjectByName(i),e.touchPointNode){var o=new In.SphereGeometry(.001),s=new In.MeshBasicMaterial({color:255}),u=new In.Mesh(o,s);e.touchPointNode.add(u)}else console.warn("Could not find touch dot, ".concat(e.touchPointNodeName,", in touchpad component ").concat(e.id));Object.values(a).forEach(function(c){var l=c.valueNodeName,h=c.minNodeName,p=c.maxNodeName,v=c.valueNodeProperty;if(v===Ue.VisualResponseProperty.TRANSFORM){if(c.minNode=t.getObjectByName(h),c.maxNode=t.getObjectByName(p),!c.minNode){console.warn("Could not find ".concat(h," in the model"));return}if(!c.maxNode){console.warn("Could not find ".concat(p," in the model"));return}}c.valueNode=t.getObjectByName(l),c.valueNode||console.warn("Could not find ".concat(l," in the model"))})})}function ks(n,t){xp(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 Mp=function(){function n(t){t===void 0&&(t=null),this.gltfLoader=t,this.path=bp,this._assetCache={}}return n.prototype.createControllerModel=function(t){var e=this,r=new Ep,i=null;return t.addEventListener("connected",function(a){var o=a.data;o.targetRayMode!=="tracked-pointer"||!o.gamepad||pp(o,e.path,wp).then(function(s){var u=s.profile,c=s.assetPath;r.motionController=new yp(o,u,c);var l=e._assetCache[r.motionController.assetUrl];if(l)i=l.scene.clone(),ks(r,i);else{if(!e.gltfLoader)throw new Error("GLTFLoader not set.");e.gltfLoader.load(r.motionController.assetUrl,function(h){e._assetCache[r.motionController.assetUrl]=h,i=h.scene.clone(),ks(r,i)})}}).catch(function(s){console.warn(s)})}),t.addEventListener("disconnected",function(){r.motionController=null,r.remove(i),i=null}),r},n}();function Cp(n,t){if(!t)return n;var e=n.match(/\d+_[a-z].png/);return n.substring(0,e.index)+t+"/"+n.substring(e.index)}var Ls=300,Sp=new d.Matrix4().makeRotationAxis(new d.Vector3(0,1,0),Math.PI),Os=new d.Vector3(-1,1,1),Ip=function(n){oe(t,n);function t(e){var r,i=n.call(this,e)||this;i.xrManager=new up(i.renderer,i.renderer.getContext(),{onSessionStart:function(c){i.emit("xr.session.start",K("xr.session.start",{session:c,machineType:i.xrManager.machineType}))},onSessionEnd:function(){i.emit("xr.session.end",K("xr.session.end",{session:null,machineType:i.xrManager.machineType}))}}),i.xrControllerRay={left:new d.Raycaster,right:new d.Raycaster},i.xrControllerRay.left.params.Points={threshold:.1},i.xrControllerRay.right.params.Points={threshold:.1},i.pointerLines={left:new Sa,right:new Sa},i.pointerLines.left.visible=!1,i.pointerLines.right.visible=!0,i.pointerLines.left.setMaterial({color:new d.Vector3(1,1,1)}),i.pointerLines.left.points.material.depthTest=!1,i.pointerLines.right.setMaterial({color:new d.Vector3(1,1,1)}),i.pointerLines.right.points.material.depthTest=!1,i.scene.add(i.pointerLines.left,i.pointerLines.right),i.panoResources={},i.panoResources[i.locationMotion.keyframes[0].key=i.locationMotion.keyframes[1].key=ht()]={panoId:Be(i.currentPano),leftPanoPicture:null,position:i.camera.pose.offset.clone(),effect:"fade"},i.parallaxCameraMatrixs=[],i.onlyUseRightController=(r=e.onlyUseRightController)!==null&&r!==void 0?r:!1;var a=ot.shared.getContext();if(!a)return console.error("获取session失败,请退出重试"),i;i.on("xr.session.end",function(){i.scene.remove(i.pointerLines.left,i.pointerLines.right)}),i.xrManager.setSession(a),i.controllerWrappers=[new d.Group,new d.Group],i.scene.add(i.controllerWrappers[0],i.controllerWrappers[1]);var o=i.xrManager.getController(0);i.controllerWrappers[0].add(o);var s=i.xrManager.getController(1);i.controllerWrappers[1].add(s);var u=new Mp;return u.gltfLoader={load:function(c,l){ui.ajax(c,{responseType:"arraybuffer"}).then(function(h){var p;return Da(h.body,{resourcePath:c.slice(0,c.lastIndexOf("/")+1),search:(p=c.split("?")[1])!==null&&p!==void 0?p:"",fetcher:ui})}).then(function(h){return l(h)})}},i.on("xr.session.start",function(){var c=i.xrManager.getControllerGrip(0);if(c.add(u.createControllerModel(c)),i.controllerWrappers[0].add(c),!i.onlyUseRightController){var l=i.xrManager.getControllerGrip(1);l.add(u.createControllerModel(l)),i.controllerWrappers[1].add(l)}}),i.xrControllerState={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}},i}return t.parseArgs=function(e){if(e instanceof t)return e;var r=F(F({},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 F(F({},i),{mode:"XRPanorama"})},t.prototype.moveToPano=function(e,r,i){var a=this,o,s,u,c;this.userAction=i,this.stopMomentumMovement();var l=this.works.getResolvedObserver(e);if(!l)throw new Error("Invalid PanoIndex");var h=this.imageOptions.size;if(typeof h=="undefined"&&l){var p=l.images.up.match(/\/cube_(\d+)\//);p&&(h=Number(p[1]))}typeof h=="undefined"&&(h=2048);var v=this.imageOptions.transform,m=function(P,I){return Cp(li(P,v,I))},A=F({key:"pano.".concat(l.panoId)},nr(this.imageOptions,["format","size","quality"])),y=l.images,f=(s=(o=l.images.tiles)===null||o===void 0?void 0:o.filter(function(P){return P.size>h}))!==null&&s!==void 0?s:null,g="pano:"+dn([y,A,v]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===g)return;var b=this.pendingTextureTask.panoId;(u=this.panoMeshes[b])===null||u===void 0||u.setProgress(0),this.emit("pano.texture.abort",K("pano.texture.abort",{error:null,progress:0,meta:null,pano:l.pano})),this.pendingTextureTask.onError(new Error("texture aborted"))}var E=this.models.getMaterial()||{},w=E.pano0,x=E.pano1,M;if((w==null?void 0:w.map.name)===g?M=w:(x==null?void 0:x.map.name)===g&&(M=x),M){var C={panoId:l.panoId,effect:(c=r.effect)!==null&&c!==void 0?c:"fade",leftPanoPicture:{map:M.map,luminanceMap:M.luminanceMap,matrix:new d.Matrix4().compose(l.position,l.quaternion,Os)},position:l.position.clone()};this.doMoveToPano(l.pano,C,r);return}var S="move-to-pano-"+l.panoId;this.pending.add(S),this.pendingTextureTask={panoId:l.panoId,hash:g,onLoad:function(P){var I;if(a.pending.delete(S),a.destroyed)P.body.dispose();else{P.body.name=g;var B={panoId:l.panoId,effect:(I=r.effect)!==null&&I!==void 0?I:"fade",leftPanoPicture:{map:P.body,luminanceMap:null,matrix:new d.Matrix4().compose(l.position,l.quaternion,Os)},position:l.position.clone()};a.doMoveToPano(l.pano,B,r)}},onError:function(P){a.pending.delete(S);var I=F(F(F({},l.pano),{mode:a.mode}),Ve(a.camera.pose));a.emit("pano.error",K("pano.error",{error:P,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:I})),a.emit("pano.cancel",K("pano.cancel",{error:null,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:I})),r.moveCancelCallback&&r.moveCancelCallback()}},Promise.all([this.tileLevelForFov&&f&&f.length?this.textureLoader.loadTiledCubeTexture(y,f,{tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:m,options:A},format:d.RGBAFormat,viaAjax:!0,fetcher:ft(l.work)},void 0,void 0,function(P){var I,B;a.emit("pano.texture.progress",K("pano.texture.progress",{error:null,progress:P,meta:null,pano:l.pano})),((I=a.pendingTextureTask)===null||I===void 0?void 0:I.hash)===g&&((B=a.panoMeshes[l.panoId])===null||B===void 0||B.setProgress(P))},this.renderer):this.textureLoader.loadCubeTexture(y,{imageURL:{transform:m,options:A},format:d.RGBAFormat,fetcher:ft(l.work)},void 0,void 0,function(P){var I,B;((I=a.pendingTextureTask)===null||I===void 0?void 0:I.hash)===g&&((B=a.panoMeshes[l.panoId])===null||B===void 0||B.setProgress(P)),a.emit("pano.texture.progress",K("pano.texture.progress",{error:null,progress:P,meta:null,pano:l.pano}))},this.renderer)]).then(function(P){var I,B,L=P[0];((I=a.pendingTextureTask)===null||I===void 0?void 0:I.hash)===g?(a.pendingTextureTask.onLoad(L),(B=a.panoMeshes[l.panoId])===null||B===void 0||B.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.success",K("pano.texture.success",{error:null,progress:1,meta:L.meta,pano:l.pano}))):L.body.dispose()}).catch(function(P){var I,B;((I=a.pendingTextureTask)===null||I===void 0?void 0:I.hash)===g&&(a.pendingTextureTask.onError(P),(B=a.panoMeshes[l.panoId])===null||B===void 0||B.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.error",K("pano.texture.error",{error:P,progress:0,meta:null,pano:l.pano})),a.emit("error",P))}),this.emit("pano.texture.load",K("pano.texture.load",{error:null,progress:0,meta:null,pano:l.pano}))},t.prototype.doMoveToPano=function(e,r,i){var a=this,o,s,u;i===void 0&&(i={});var c=ve(),l=ht();this.panoResources[l]=r;var h=1,p,v,m;if(this.locationMotion.ended){var A=this.locationMotion.getKeyFrameSegment(c);A[0];var y=A[1],f=this.locationMotion.value,g=this.panoResourceFromLocationMotionKeyframe(y).position,b=r.position;p=Math.max(g.distanceTo(b),h),v=[{key:y.key,progress:0,value:F(F({},f),{count:0})},{key:l,progress:1,value:{distance:0,count:1}}],m=0}else{var E=this.locationMotion.getKeyFrameSegment(c),w=E[0],y=E[1],f=this.locationMotion.value,x=this.panoResourceFromLocationMotionKeyframe(w).position,g=this.panoResourceFromLocationMotionKeyframe(y).position,b=r.position,M=y.value.count-f.count,C=Math.max(x.distanceTo(g),h)*M,S=Math.max(g.distanceTo(b),h);p=C+S,v=[{key:w.key,progress:0,value:F({},f)},{key:y.key,progress:C/p,value:y.value},{key:l,progress:1,value:{count:y.value.count+1,distance:0}}];var P=this.locationMotionKeyframesLength(this.locationMotion.keyframes),I=this.locationMotionKeyframesLength(v);m=this.locationMotion.getProgressVelocity(c)*P/I}var B=this.calculateMovingDuration(i.duration,p),L={longitude:i.longitude,latitude:i.latitude,fov:i.fov},k=F(F({},e),{mode:this.mode,longitude:(o=L.longitude)!==null&&o!==void 0?o:this.camera.pose.longitude,latitude:(s=L.latitude)!==null&&s!==void 0?s:this.camera.pose.latitude,fov:(u=L.fov)!==null&&u!==void 0?u:this.camera.pose.fov,offset:r.position.clone(),distance:0}),O=this.currentPano;this.emit("pano.moveTo",K("pano.moveTo",{options:i,prevPano:O,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),this.cameraMotion.set(L,B).catch(Q);var N=this.locationMotion.setKeyframes(v,B,m);N.then(function(){var D,H,z,U=F(F({},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",K("pano.arrived",{options:i,prevPano:O,progress:1,state:U,userAction:a.userAction,error:null})),i.moveEndCallback&&i.moveEndCallback(U);var q=a.works.getResolvedObserver(a.currentPano);if(q&&q.video&&a.videoTexture&&a.videoTexture.image instanceof HTMLVideoElement){var j=Sp.clone().multiply((z=(H=(D=a.models.getMaterial())===null||D===void 0?void 0:D.pano1)===null||H===void 0?void 0:H.matrix)!==null&&z!==void 0?z:new d.Matrix4).multiply(q.video.matrix),_={map:a.videoTexture,size:q.video.size,matrix:j,alpha:1},Z=ht(),W=a.videoTexture.image;W.setAttribute("uuid",Z),Ju().then(function(Y){Y&&q.video&&W.getAttribute("uuid")===Z&&(W.oncanplay=function(){W.oncanplay=Q,W.play()},W.ontimeupdate=function(){W.currentTime>.5&&(W.ontimeupdate=Q,a.panoVideo.setMaterial(_))},W.src=q.video.source)}).catch(function(){W.removeAttribute("uuid")})}},function(){a.emit("pano.cancel",K("pano.cancel",{options:i,prevPano:O,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 u=this.camera.getDirection(new d.Vector3).setY(0),c=null,l=this.works.getResolvedObserver(this.currentPano);if(!l)return null;var h=l.accessibleIds.filter(function(Z){var W=We(Z);if(Tt(W,r.currentPano))return!1;var Y=r.works.getResolvedObserver(W);return!Y||Y.position.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:Y.loadable||Y.active}),p=this.models.intersectRaycaster(e)[0];if(p){var v=Pt(h,function(Z){var W=r.works.getResolvedObserver(Z);if(!W)return 1/0;var Y=W.standingPosition.clone();return Y.distanceTo(p.point)},!0),m=v[0],A=v[1];m&&A<this.panoTapTriggerRadius&&(c=(i=this.works.getResolvedObserver(m))!==null&&i!==void 0?i:null)}if(Ps(c)){var y=this.getForwardObserverOrNot(e);y&&(c=y)}for(var f=0,g=this.locationMotion.keyframes;f<g.length;f++){var b=g[f],E=this.panoResourceFromLocationMotionKeyframe(b);if(!(b.progress<this.locationMotion.progress)&&c&&E.panoId===c.panoId){c=null;break}}if(Ps(c))return this.locationMotion.ended===!0&&this.cameraBounce(),null;if(c&&!c.active){var w=c.panoId;this.panoMeshes[w]&&(this.panoMeshes[w].setDisabled(!1),this.panoMeshes[w].setLoading(!0))}var x={};if(c){x.effect="fade";for(var M=Math.PI/6,C=Math.PI/12,S=new d.Vector3(0,1,0),P=c.position.clone().setY(0).sub(l.position.clone().setY(0)).normalize(),I=P.clone().applyAxisAngle(S,M),B=P.clone().applyAxisAngle(S,-M),L=[],k=[],O=[],N=0,D=c.accessibleIds;N<D.length;N++){var m=D[N],H=We(m);if(!(Tt(H,this.currentPano)||Tt(H,c.pano))){var z=this.works.getResolvedObserver(m);if(z){var U=z.position.clone().sub(c.position).setY(0);P.angleTo(U)<M?O.push(U):I.angleTo(U)<M?L.push(U):B.angleTo(U)<M&&k.push(U)}}}var q=O.length>0?O:rt(rt([],L,!0),k,!0),j=q.slice().sort(function(Z,W){return Z.angleTo(P)-W.angleTo(P)})[0];j&&j.angleTo(u)>C&&(x.longitude=Math.atan2(-j.x,-j.z))}this.cameraMotion.value.latitude<-Math.PI/4&&(x.latitude=ae(0,this.minLatitude,this.maxLatitude)),this.cameraMotion.value.fov<60&&(x.fov=this.defaultFov);var _={workCode:c.pano.workCode,panoIndex:c.pano.panoIndex,mode:this.mode,longitude:(a=x.longitude)!==null&&a!==void 0?a:this.camera.pose.longitude,latitude:(o=x.latitude)!==null&&o!==void 0?o:this.camera.pose.latitude,fov:(s=x.fov)!==null&&s!==void 0?s:this.camera.pose.fov,distance:0,offset:c?c.position.clone():new d.Vector3};return this.emit("pano.select",K("pano.select",{prevPano:this.currentPano,state:_,userAction:!0,options:x,progress:0,error:null})),c&&c.active?(this.emit("pano.request",K("pano.request",{userAction:!0,prevPano:this.currentPano,progress:0,state:_,options:x,error:null})),c.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,u,c,l,h,p,v=[],m=2;m<arguments.length;m++)v[m-2]=arguments[m];this.userAction=!0;var A={},y={},f=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),g=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),b=!1;if(this.cameraMotion.ended===!1&&(this.cameraMotion.update(e),y.longitude=this.cameraMotion.value.longitude,y.latitude=this.cameraMotion.value.latitude,y.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),A.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(ae(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var E=this.locationMotion.getKeyFrameSegment(e),w=E[0],x=E[1],M=this.panoResourceFromLocationMotionKeyframe(w),C=this.panoResourceFromLocationMotionKeyframe(x),S=new d.Vector3().copy(M.position),P=new d.Vector3().copy(C.position),I=this.locationMotion.value.count-x.value.count+1;A.progress=I,C.leftPanoPicture&&(I<1?M.leftPanoPicture&&(A.pano0=M.leftPanoPicture):A.pano0=C.leftPanoPicture,A.pano1=C.leftPanoPicture),b=A.useBlackTransition=C.effect==="instant"||C.effect==="montage",(C.effect==="fade"||C.effect==="montage")&&(A.pano0&&M.leftPanoPicture&&(A.pano0={map:A.pano0.map,luminanceMap:A.pano0.luminanceMap,matrix:M.leftPanoPicture.matrix.clone().setPosition(C.position)}),S.copy(P)),y.distance=this.locationMotion.value.distance,y.offset=new d.Vector3(S.x+(P.x-S.x)*I,S.y+(P.y-S.y)*I,S.z+(P.z-S.z)*I);for(var B=[],L=[],k=0,O=this.locationMotion.keyframes;k<O.length;k++){var N=O[k],D=N.key,H=N.progress;D!==void 0&&(B.push(D),H>=this.locationMotion.progress&&L.push(D))}for(var z=0,U=Object.keys(this.panoResources);z<U.length;z++){var q=U[z];if(!(L.indexOf(q)>=0)){var j=this.panoResources[q];if(j.leftPanoPicture){var _=j.leftPanoPicture.map;if(_){if(_===((a=A.pano0)===null||a===void 0?void 0:a.map)||_===((o=A.pano1)===null||o===void 0?void 0:o.map))continue;_ instanceof Le&&_.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(_.cubeRenderTarget),_.dispose(),j.leftPanoPicture=null}}B.indexOf(q)>=0||delete this.panoResources[q]}}this.currentPano=We(C.panoId),this.emit("pano.moving",K("pano.moving",{userAction:this.userAction,prevPano:We(f.panoId),state:F(F(F(F({},We(g.panoId)),{mode:this.mode}),Ve(this.camera.pose)),y),options:{},progress:this.locationMotion.progress,error:null}))}xt(A)===!1&&(!((s=A.pano0)===null||s===void 0)&&s.map&&A.pano0.map instanceof Le&&!A.pano0.map.cubeRenderTarget&&(A.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((u=A.pano1)===null||u===void 0)&&u.map&&A.pano1.map instanceof Le&&!A.pano1.map.cubeRenderTarget&&(A.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),this.models.setMaterial(A)),xt(y)===!1&&this.setCamera(y);var Z=this.works.getResolvedObserver(this.currentPano),W=v[1];if(!W){console.error("xrFrame丢失,请重试");return}if(!this.xrManager.session){console.error("session丢失,请重试");return}var Y=this.xrManager.referenceSpace;if(Y){var ce=this.xrManager.cameraVR,te=this.xrManager.cameraL,se=this.xrManager.cameraR,ue=[te,se],pe=W.getViewerPose(Y),he=new d.Vector3(0,0,0);if(pe){var de;de=this.xrManager.session.renderState.baseLayer;var be=pe.views;if(!de){console.error("no layer found");return}this.renderer.setFramebuffer(de.framebuffer);var fe=!1;be.length!==ce.cameras.length&&(ce.cameras.length=0,fe=!0),this.parallaxCameraMatrixs=[];var Se=new d.Vector3,ee=new d.Vector3;new d.Matrix4().fromArray(be[0].transform.matrix).decompose(Se,new d.Quaternion,new d.Vector3),new d.Matrix4().fromArray(be[1].transform.matrix).decompose(ee,new d.Quaternion,new d.Vector3),ee.clone().sub(Se).normalize();var le=new d.Vector3,X=new d.Quaternion,Te=new d.Vector3;this.camera.matrix.decompose(le,X,Te);for(var Fe=0;Fe<be.length;Fe++){var Ye=be[Fe],Xe=de.getViewport(Ye),Ge=ue[Fe];Ge.matrix.fromArray(Ye.transform.matrix);var ut=new d.Vector3,Ne=new d.Quaternion,me=new d.Vector3;Ge.matrix.decompose(ut,Ne,me),he.copy(le),Ge.position.copy(le),Ge.quaternion.copy(Ne),Ge.scale.copy(me),Ge.updateMatrix(),Ge.projectionMatrix.fromArray(Ye.projectionMatrix),Ge.viewport.set(Xe.x,Xe.y,Xe.width,Xe.height),fe===!0&&ce.cameras.push(Ge)}pe.views[0].transform.position,pe.views[1].transform.position;for(var Ae=this.xrManager.session.inputSources,Fe=0;Fe<this.xrManager.controllers.length;Fe++){var nt=this.xrManager.controllers[Fe],Ce=Ae[Fe];if(Ce){nt.update(Ce,W,Y);var He=this.xrManager.getController(Fe),Oe=new d.Vector3(0,1.2,0),it=He.position.clone().add(he).sub(Oe);Ce.handedness==="left"?this.xrControllerRay.left.set(it,new d.Vector3(0,0,-1).applyEuler(He.rotation)):Ce.handedness==="right"&&this.xrControllerRay.right.set(it,new d.Vector3(0,0,-1).applyEuler(He.rotation)),this.controllerWrappers[Fe].position.copy(new d.Vector3(0,0,0).add(he).sub(Oe));var qe=this.models.intersectRaycaster(this.xrControllerRay.right);if(qe.length===0&&(qe=this.xrControllerRay.right.intersectObject(this.boundingMesh,!0).map(function(ct){var gt;return F({floor:(gt=Z==null?void 0:Z.floorIndex)!==null&>!==void 0?gt:0},ct)})),qe.length>=1&&qe[0].face)if(Ce.handedness==="right"){var Zt=this.xrControllerRay.right.intersectObject(this.xrCustomObjectsScene,!0),Or=qe[0].face.normal,Je=Or.clone().multiplyScalar(.05),Mt=qe[0].point.clone().add(Je);this.intersectMesh.position.copy(Mt);var _r=Mt.clone().add(Je);if(this.intersectMesh.lookAt(_r),Math.abs(Or.y)>.99){var $e=this.camera.position.clone().sub(Mt);this.intersectMesh.rotation.z=-Math.atan2($e.z,$e.x)}this.intersectMesh.visible=!0,this.needsRender=!0,Zt.length>0?(this.pointerLines.right.setPoints(it,Zt[0].point),this.pointerLines.right.points.visible=!0,this.intersectMesh.visible=!1):(this.pointerLines.right.points.visible=!1,this.pointerLines.right.setPoints(it,qe[0].point));var Bt=qe[0],Rt=K("intersect.update",{raycaster:(c=this.xrControllerRay.right)!==null&&c!==void 0?c:null,intersection:Bt!=null?Bt:null,object:this.intersectMesh});if(this.emit("intersect.update",Rt),Rt.defaultPrevented){this.hideIntersectMesh();return}}else this.pointerLines.left.setPoints(it,qe[0].point)}}if(this.camera.pose.distance>.1||b){if(Z)for(var Ht=0,Yt=Object.keys(this.panoMeshes);Ht<Yt.length;Ht++){var pt=Yt[Ht],Ie=this.panoMeshes[pt];Ie.setOpacity(0),Ie.setCurrent(!1),Ie.updateTime&&Ie.updateTime(e,r)}}else if(Z){var gr=Pt(Z.visibleIds,function(at){var ct=i.works.getResolvedObserver(at);return ct?Z.standingPosition.distanceTo(ct.standingPosition):1/0},!0),Ft=gr[1];Ft=ae(Ft,2.5,1/0);for(var ir=Z.visibleIds.concat(Be(this.currentPano)),kt=this.getForwardObserverOrNot(),mn=this.camera.getDirection(new d.Vector3),Vr=0,Nr=Object.keys(this.panoMeshes);Vr<Nr.length;Vr++){var pt=Nr[Vr],Ie=this.panoMeshes[pt],ar=this.works.getResolvedObserver(pt);if(ir.indexOf(pt)===-1)Ie.setCurrent(!1),Ie.setOpacity(0);else if(!ar)Ie.setCurrent(!1),Ie.setOpacity(0);else if(!ar.loadable&&!ar.active)Ie.setCurrent(!1),Ie.setOpacity(0);else{var or=Ie.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);Ie.setCurrent(!Ie.loading&&Ie.progress===0&&kt!==null&&kt.panoId===pt),Ie.setOpacity(or<.01?0:ae(Ft/or*1.2,.65,.98));var et=this.camera.position.clone().setY(Ie.position.y),Ke=new d.Vector3().copy(Ie.position).sub(et).normalize();if(pt===Be(this.currentPano)){var Lt=ae((.5-et.distanceTo(Ie.position))/.5,0,1);Ke.multiplyScalar(1-Lt).add(mn.clone().multiplyScalar(Lt))}Ke.length()>0&&Ie.quaternion.setFromEuler(new d.Euler(0,Math.atan2(Ke.x,Ke.z),0))}Ie.updateTime&&Ie.updateTime(e,r)}}var sr=function(){if(i.tileLevelForFov===!1)return 0;var at=new d.Vector2(4e3,4e3),ct=g.panoId,gt=i.works.getResolvedObserver(ct),yt=i.imageOptions.size;if(typeof yt=="undefined"&>){var Gn=gt.images.up.match(/\/cube_(\d+)\//);Gn&&(yt=Number(Gn[1]))}typeof yt=="undefined"&&(yt=2048);var Dr=0;yt>=1024&&(Dr=1),yt>=2048&&(Dr=2),yt>=4096&&(Dr=3),yt>=8192&&(Dr=4);var Ur=i.tileLevelForFov(te.fov,at);return Ur>Dr?Ur:0}(),gn=function(){var at=new d.PerspectiveCamera;at.applyMatrix4(ce.matrix),at.position.set(0,0,0);var ct=i.works.getResolvedObserver(g.panoId),gt=ct!=null?ct:Z;gt&&at.quaternion.premultiply(gt.quaternion.clone().inverse()),at.updateProjectionMatrix(),at.updateMatrixWorld(!0);var yt=new d.Frustum().setFromProjectionMatrix(new d.Matrix4().multiplyMatrices(at.projectionMatrix,at.matrixWorldInverse));return yt}();g.panoId===Be(this.currentPano)&&((l=g.leftPanoPicture)===null||l===void 0?void 0:l.map)instanceof Le&&(g.leftPanoPicture.map.update(gn,sr),g.leftPanoPicture.map.needsRender===!0&&(this.needsRender=!0));{var zn=this.tiling.object.visible;if(sr>this.TILED_CUBE_TEXTURE_LEVEL&&this.initAnimationed){var Qr=g.panoId,lt=this.works.getResolvedObserver(Qr);lt?Mi(this.camera.position,lt.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==Qr&&this.tiling.cleanup(),this.tiling.panoId=Qr,this.tiling.setResource((p=(h=lt.images)===null||h===void 0?void 0:h.tiles)!==null&&p!==void 0?p:[],this.enableIOSEDR&<.images.luminance?lt.images.luminance:null),this.tiling.setFetcher(ft(lt.work)),this.tiling.setRotation(lt.quaternion),this.tiling.setPosition(lt.position),this.tiling.update(gn,sr,e)):this.tiling.object.visible=!1:this.tiling.object.visible=!1}else this.tiling.object.visible=!1;zn!==this.tiling.object.visible&&(this.tiling.object.needsRender=!0)}this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e),!(!Ae||Ae.length<1)&&this.updateControllerHelper(Ae,e,r)}}},t.prototype.render=function(){var e=this.xrManager.getCamera(this.camera);this.renderer.render(this.scene,e)},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}},u=0;u<e.length;u++){var c=e[u].handedness,l=e[u].gamepad;switch(c){case"left":l.axes&&(this.emitEvent(l.axes[2]===-1,"LeftAxesLeft",r),this.emitEvent(l.axes[2]===1,"LeftAxesRight",r),this.emitEvent(l.axes[3]===-1,"LeftAxesUp",r),this.emitEvent(l.axes[3]===1,"LeftAxesDown",r)),l!=null&&l.buttons&&(this.emitEvent(l==null?void 0:l.buttons[4].pressed,"X",r),this.emitEvent(l.buttons[5].pressed,"Y",r),this.emitEvent(l==null?void 0:l.buttons[0].pressed,"LeftTrigger",r),this.emitEvent(l==null?void 0:l.buttons[1].pressed,"LeftPinch",r));var h={raycaster:a,axes:{up:l.axes&&l.axes[3]<0?Math.abs(l.axes[3]):0,down:l.axes&&l.axes[3]<0?0:Math.abs(l.axes[3]),left:l.axes&&l.axes[2]<0?Math.abs(l.axes[2]):0,right:l.axes&&l.axes[2]<0?0:Math.abs(l.axes[2])},deltaTime:i};s.buttons.X=l.buttons&&l.buttons[4]?l.buttons[4].pressed:!1,s.buttons.Y=l.buttons&&l.buttons[5]?l==null?void 0:l.buttons[5].pressed:!1,s.buttons.LeftTrigger=l.buttons&&l.buttons[0]?l==null?void 0:l.buttons[0].pressed:!1,s.buttons.LeftPinch=l.buttons&&l.buttons[1]?l==null?void 0:l.buttons[1].pressed:!1,s.left=h;break;case"right":l.axes&&(this.emitEvent(l.axes[2]===-1,"RightAxesLeft",r),this.emitEvent(l.axes[2]===1,"RightAxesRight",r),this.emitEvent(l.axes[3]===-1,"RightAxesUp",r),this.emitEvent(l.axes[3]===1,"RightAxesDown",r)),l.buttons&&(this.emitEvent(l==null?void 0:l.buttons[4].pressed,"A",r),this.emitEvent(l.buttons[5].pressed,"B",r),this.emitEvent(l==null?void 0:l.buttons[0].pressed,"RightTrigger",r),this.emitEvent(l==null?void 0:l.buttons[1].pressed,"RightPinch",r));var p={raycaster:o,axes:{up:l.axes&&l.axes[3]<0?Math.abs(l.axes[3]):0,down:l.axes&&l.axes[3]<0?0:Math.abs(l.axes[3]),left:l.axes&&l.axes[2]<0?Math.abs(l.axes[2]):0,right:l.axes&&l.axes[2]<0?0:Math.abs(l.axes[2])},deltaTime:i};s.right=p,s.buttons.A=l.buttons&&l.buttons[4]?l==null?void 0:l.buttons[4].pressed:!1,s.buttons.B=l.buttons&&l.buttons[5]?l==null?void 0:l.buttons[5].pressed:!1,s.buttons.RightTrigger=l.buttons&&l.buttons[0]?l==null?void 0:l.buttons[0].pressed:!1,s.buttons.RightPinch=l.buttons&&l.buttons[1]?l==null?void 0:l.buttons[1].pressed:!1;break}}this.emit("xr.controller.update",K("xr.controller.update",s))}},t.prototype.emitEvent=function(e,r,i){var a=this.xrControllerRay.left,o=this.xrControllerRay.right;if(e)if(this.xrControllerState[r].touchStart===!1)this.xrControllerState[r].touchStartTime=i,this.xrControllerState[r].touchStart=!0,this.emit("xr.gesture.buttonDown",K("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.xrControllerState[r].touchStartTime;s>Ls&&this.emit("xr.gesture.press",K("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.xrControllerState[r].touchStart===!0){this.emit("xr.gesture.buttonUp",K("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.xrControllerState[r].touchStartTime;if(s<=Ls){var u=this.emit("xr.gesture.tap",K("xr.gesture.tap",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:a,rightRay:o}}}));u||r==="RightTrigger"&&this.checkSelectedPano(this.xrControllerRay.right)}this.xrControllerState[r].touchStart=!1,this.xrControllerState[r].touchStartTime=0}},t}(Ja),Nt={Floorplan:ai,Topview:Qf,Panorama:Ja,VRPanorama:Qh,Model:Uh,DepthPanorama:Xh,Mapview:ap,XRPanorama:Ip},f0=["gesture.pan","gesture.tap","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 Tp(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.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=Tr(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 Pp(){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}function Bp(n){{var t=new d.DirectionalLight(16777215,.5);t.position.copy(new d.Vector3(1,1,1)),n.add(t)}{var t=new d.DirectionalLight(16777215,.3);n.add(t)}{var t=new d.AmbientLight(16777215,.3);n.add(t)}}function Rp(n){for(var t,e,r={},i=n.split(/(\;|\,)/),a=0,o=i;a<o.length;a++){var s=o[a],u=s.split("="),c=(t=u[0])===null||t===void 0?void 0:t.trim(),l=(e=u[1])===null||e===void 0?void 0:e.trim();c&&l&&(r[c]=l)}return r}function h0(){for(var n,t=document.getElementsByTagName("meta"),e=0;e<t.length;e++){var r=t[e];if(r.getAttribute("name")==="viewport"){var i=Rp((n=r.getAttribute("content"))!==null&&n!==void 0?n:""),a=Number(i["initial-scale"]);if(!isNaN(a))return a}}return 1}const Fp="data:image/png;base64,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";var Vs=[351,63],Ns=[20,20],kp=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),Lp=new Float32Array([0,0,1,0,0,1,1,1]),Op=new Uint8Array([0,1,2,1,3,2]),Ti=new d.BufferGeometry;Ti.setAttribute("position",new d.BufferAttribute(kp,3));Ti.setAttribute("uv",new d.BufferAttribute(Lp,2));Ti.setIndex(new d.BufferAttribute(Op,1));var oi=new d.MeshBasicMaterial({transparent:!0,depthTest:!1,depthWrite:!1,stencilWrite:!1,fog:!1}),p0=new d.Mesh(Ti,oi);p0.matrixAutoUpdate=!1;var no=new d.Scene;no.add(p0);no.matrixAutoUpdate=!1;var Un=new d.OrthographicCamera(-.5,.5,.5,-.5,.1,1);Un.position.set(0,0,.5);Un.lookAt(0,0,0);Un.updateMatrixWorld(!0);Un.matrixAutoUpdate=!1;var Vp=new d.Vector4,Np=new d.Vector4;function Qs(n){if(oi.map){var r=n.getViewport(Vp),i=n.getScissor(Np),a=n.getScissorTest(),o=n.autoClear,s=i.x+Ns[0]/3,u=i.y+Ns[1]/3,c=Vs[0]/3,l=Vs[1]/3;n.setViewport(s,u,c,l),n.setScissor(s,u,c,l),n.setScissorTest(!0),n.autoClear=!1,n.render(no,Un),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,oi.needsUpdate=!0,e.onload=Q},e.src=Fp,oi.map=t}}var Qp=800,Dp=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/")},Up=[{name:"Z",transformToUpAxisZ:function(){return new d.Matrix4}},{name:"Y",transformToUpAxisZ:function(){return new d.Matrix4().makeRotationAxis(new d.Vector3(1,0,0),+Math.PI/2)}},{name:"-Y",transformToUpAxisZ:function(){return new d.Matrix4().makeRotationAxis(new d.Vector3(1,0,0),-Math.PI/2)}},{name:"WGS84",transformToEarthCentered:function(){return new d.Matrix4}},{name:"GCJ02",transformToEarthCentered:function(){return new d.Matrix4}},{name:"BD09",transformToEarthCentered:function(){return new d.Matrix4}}],an=new d.Vector2,$n=new d.Frustum,ei=new d.Matrix4,Ds=new WeakMap,Us=new WeakMap,zs=ju([]),v0=function(n){oe(t,n);function t(e){e===void 0&&(e={});var r,i,a,o,s,u,c,l,h,p,v=n.call(this)||this;v.ident=ht(),Ia.instances[v.ident]=v,v.renderSwitch01=0,v.currentMode="Panorama",v.pano={workCode:"",panoIndex:0},v.needsRender=!1,v.onlyRenderIfNeeds=(r=e.onlyRenderIfNeeds)!==null&&r!==void 0?r:!0,v.imageOptions=F({},(i=e.imageOptions)!==null&&i!==void 0?i:{}),v.textureOptions=F({},(a=e.textureOptions)!==null&&a!==void 0?a:{}),v.poweredByRealsee=(o=e.poweredByRealsee)!==null&&o!==void 0?o:!0,v.extraElements=[],v.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),DepthPanorama:Object.assign({},e.depthPanorama),VRPanorama:Object.assign({},e.vrPanorama),XRPanorama:Object.assign({},e.xrPanorama)},v.coordinatesSystemTransformers=rt([],(s=e.coordinatesSystemTransformers)!==null&&s!==void 0?s:[],!0);for(var m=function(L){var k=A.coordinatesSystemTransformers.find(function(O){return O.name===L.name});k||A.coordinatesSystemTransformers.push(F({},L))},A=this,y=0,f=Up;y<f.length;y++){var g=f[y];m(g)}if(v.fps={testCount:0,testTime:ve()},v.info=null,v.modeChangeDuration=(u=e.modeChangeDuration)!==null&&u!==void 0?u:Qp,v.enableWheel=(c=e.enableWheel)!==null&&c!==void 0?c:!0,typeof window!="undefined")if(e.renderer)e.renderer instanceof Hr&&v.throwError(new Error("cannot render a internal renderer")),v.renderer=e.renderer;else try{v.renderer=new Hr({preserveDrawingBuffer:e.preserveDrawingBuffer,backgroundColor:e.backgroundColor,backgroundAlpha:e.backgroundAlpha,antialias:e.antialias,webgl2:e==null?void 0:e.webgl2});var b=h0();v.renderer.setPixelRatio(b===1?window.devicePixelRatio:1),v.renderer.setSize(512,512)}catch(L){L instanceof Error&&v.throwError(L)}v.getPixelsRenderTarget=new d.WebGLRenderTarget(1,1,{encoding:(h=(l=v.renderer)===null||l===void 0?void 0:l.outputEncoding)!==null&&h!==void 0?h:d.sRGBEncoding}),v.scissor=Object.assign({left:0,bottom:0,width:1,height:1},e.scissor),v.camera=new di(90),v.scene=new su,v.xrCustomObjectsScene=new d.Scene,v.scene.add(v.xrCustomObjectsScene),v.scene.matrixAutoUpdate=!1,v.lastLoadWorkTask=Promise.resolve(),v.requestProxy=(p=e.requestProxy)!==null&&p!==void 0?p:Dp,v.networkSubscribe=new _s,v.networkSubscribe.on("network",function(L,k,O,N){var D;v.emit("network.resource",K("network.resource",{source:L,requestType:k,requestState:O,detail:N})),(D=v.analysis)===null||D===void 0||D.network(v.works,L,k,O,N)}),v.boundingMesh=Pf(new d.Box3(new d.Vector3(-.5,-.5,-.5),new d.Vector3(.5,.5,.5))),v.boundingMesh.name="bounding",v.scene.add(v.boundingMesh),v.models=fs(),v.models.push(new xa),v.lastModels=fs(),v.readyCallbacks=[],v.syncingState=!1,v.modelGroup=new d.Group,v.modelGroup.visible=!1,v.modelGroup.name="model",v.modelGroup.matrixAutoUpdate=!1,v.modelGroup.renderOrder=-4,v.scene.add(v.modelGroup),v.helperGroup=new d.Group,v.helperGroup.name="helper",v.helperGroup.matrixAutoUpdate=!1,v.scene.add(v.helperGroup),v.videoTexture=new d.VideoTexture(e.videoInstance||Pp()),Bp(v.scene),v.copyEffect=new Si(v.renderer,v.scene,v.camera,v.models),v.state={mode:v.currentMode,workCode:v.pano.workCode,panoIndex:v.pano.panoIndex,longitude:v.camera.pose.longitude,latitude:v.camera.pose.latitude,fov:v.camera.pose.fov,offset:v.camera.pose.offset.clone(),distance:v.camera.pose.distance},v.stateSynced=!1,v._enableIOSEDR=!1,v.destroyed=!1,v.paused=!0,typeof window!="undefined"&&(e.play!==!1&&v.play(),v.stopAnimationLoop=ot.shared.add(function(L,k){for(var O=[],N=2;N<arguments.length;N++)O[N-2]=arguments[N];v.updateTime.apply(v,rt([L,k],O,!1))},!1,0,10));var E=function(){typeof document!="undefined"&&document.fullscreenElement===null&&v.currentMode==="VRPanorama"&&v.controller.emit("vr.requestExit",K("vr.requestExit",{}))},w=function(){v.needsRender=!0};if(typeof document!="undefined"&&document.addEventListener("fullscreenchange",E,!1),v.renderer&&v.renderer.domElement.addEventListener("webglcontextrestored",w,!1),v.removeEventListeners=function(){typeof document!="undefined"&&document.removeEventListener("fullscreenchange",E,!1),v.renderer&&v.renderer.domElement.removeEventListener("webglcontextrestored",w,!1)},v.plugins={},e.plugins&&e.plugins.length)for(var x=0,M=e.plugins;x<M.length;x++){var C=M[x];if(typeof C=="function")C(v);else if(Array.isArray(C)){var S=C[0],P=C[1],I=C[2];if(typeof S=="function"){var B=S(v,I);typeof P=="string"&&(v.plugins[P]?v.throwError(new Error("plugin name ".concat(P," is exists."))):v.plugins[P]=B)}}}return v.gpuPickingRenderTarget=new d.WebGLRenderTarget(1,1),v.meshReplaceMaterialMap=new Map,v.meshOriginMaterialMap=new Map,Tp(v),v}return Object.defineProperty(t,"version",{get:function(){return"6.0.0-alpha.72"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"dracoPath",{get:function(){return vi.decoderPath},set:function(e){vi.setDecoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t,"ktx2Path",{get:function(){return Fn.transcoderPath},set:function(e){Fn.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(h){if(!(!(h instanceof d.Mesh)||h instanceof Gt)){var p=Object.keys(i).filter(function(m){return m===h.uuid})[0];if(p)if(s.meshOriginMaterialMap.set(p,h.material),s.meshReplaceMaterialMap.get(p))h.material=s.meshReplaceMaterialMap.get(p);else{var v=new d.ShaderMaterial({uniforms:{color:{value:i[p]}},vertexShader:`
|
|
2020
|
+
`},ro=function(n){oe(t,n);function t(e){var r=n.call(this,{uniforms:d.UniformsUtils.clone(aa.uniforms),vertexShader:aa.vertexShader,fragmentShader:aa.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(ro.prototype,{isLineMaterial:!0});var u0=function(n){oe(t,n);function t(e,r){var i=n.call(this)||this;return i.type="LineSegments2",i.geometry=e!==void 0?e:new to,i.material=r!==void 0?r:new ro({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,u=0,c=0,l=r.count;u<l;u++,c+=2)o.fromBufferAttribute(r,u),s.fromBufferAttribute(i,u),a[c]=c===0?0:a[c-1],a[c+1]=a[c]+o.distanceTo(s);var h=new d.InstancedInterleavedBuffer(a,2,1);return e.setAttribute("instanceDistanceStart",new d.InterleavedBufferAttribute(h,1,0)),e.setAttribute("instanceDistanceEnd",new d.InterleavedBufferAttribute(h,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,u=this.material,c=u.resolution,l=u.linewidth,h=s.attributes.instanceStart,p=s.attributes.instanceEnd,v=new d.Vector4,m=new d.Vector4,A=new d.Vector4,y=new d.Vector3,f=new d.Matrix4,g=new d.Line3,b=new d.Vector3;i.at(1,A),A.w=1,A.applyMatrix4(a.matrixWorldInverse),A.applyMatrix4(o),A.multiplyScalar(1/A.w),A.x*=c.x/2,A.y*=c.y/2,A.z=0,y.copy(A);var E=this.matrixWorld;f.multiplyMatrices(a.matrixWorldInverse,E);for(var w=0,x=h.count;w<x;w++){v.fromBufferAttribute(h,w),m.fromBufferAttribute(p,w),v.w=1,m.w=1,v.applyMatrix4(f),m.applyMatrix4(f),v.applyMatrix4(o),m.applyMatrix4(o),v.multiplyScalar(1/v.w),m.multiplyScalar(1/m.w);var M=v.z<-1&&m.z<-1,C=v.z>1&&m.z>1;if(!(M||C)){v.x*=c.x/2,v.y*=c.y/2,m.x*=c.x/2,m.y*=c.y/2,g.start.copy(v),g.start.z=0,g.end.copy(m),g.end.z=0;var S=g.closestPointToPointParameter(y,!0);g.at(S,b);var P=d.MathUtils.lerp(v.z,m.z,S),I=P>=-1&&P<=1,B=y.distanceTo(b)<l*.5;if(I&&B){g.start.fromBufferAttribute(h,w),g.end.fromBufferAttribute(p,w),g.start.applyMatrix4(E),g.end.applyMatrix4(E);var L=new d.Vector3,k=new d.Vector3;i.distanceSqToSegment(g.start,g.end,k,L),r.push({point:k,pointOnLine:L,distance:i.origin.distanceTo(k),object:this,faceIndex:w})}}}},t}(d.Mesh);Object.assign(u0.prototype,{isLineSegments2:!0});var l0=function(n){oe(t,n);function t(e,r){var i=n.call(this,e,r)||this;return i.type="Line2",i}return t}(u0);Object.assign(l0.prototype,{isLine2:!0});var c0=function(n){oe(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}(to);Object.assign(c0.prototype,{isLineGeometry:!0});var lp="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==",Rs=14467195,cp=8,dp=2,fp=20,Fs=null,Sa=function(n){oe(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 c0,o=new ro({color:Rs,linewidth:dp,dashScale:fp,dashed:!1});i.line=new l0(a,o);var s=new d.BufferGeometry,u=new d.PointsMaterial({color:Rs,size:cp,map:Fs||(Fs=new d.TextureLoader().load(lp)),sizeAttenuation:!1,transparent:!0});return i.points=new d.Points(s,u),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.0.0-alpha.73"},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(Sa.prototype,{isFiveLine:!0});var Ue={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 d0(n){return bi(this,void 0,void 0,function(){var t;return wi(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 hp(n){return bi(this,void 0,void 0,function(){var t,e;return wi(this,function(r){switch(r.label){case 0:if(!n)throw new Error("No basePath supplied");return t="profilesList.json",[4,d0("".concat(n,"/").concat(t))];case 1:return e=r.sent(),[2,e]}})})}function pp(n,t,e,r){return e===void 0&&(e=null),r===void 0&&(r=!0),bi(this,void 0,void 0,function(){var i,a,o,s,u,c;return wi(this,function(l){switch(l.label){case 0:if(!n)throw new Error("No xrInputSource supplied");if(!t)throw new Error("No basePath supplied");return[4,hp(t)];case 1:if(i=l.sent(),n.profiles.some(function(h){var p=i[h];return p&&(a={profileId:h,profilePath:"".concat(t,"/").concat(p.path),deprecated:!!p.deprecated}),!!a}),!a){if(!e)throw new Error("No matching profile name found");if(o=i[e],!o)throw new Error('No matching profile name found and default profile "'.concat(e,'" missing.'));a={profileId:e,profilePath:"".concat(t,"/").concat(o.path),deprecated:!!o.deprecated}}return[4,d0(a.profilePath)];case 2:if(s=l.sent(),r){if(c=void 0,c=s.layouts[n.handedness],!c)throw new Error("No matching handedness, ".concat(n.handedness,", in profile ").concat(a.profileId));c.assetPath&&(u=a.profilePath.replace("profile.json",c.assetPath))}return[2,{profile:s,assetPath:u}]}})})}var vp={xAxis:0,yAxis:0,button:0,state:Ue.ComponentState.DEFAULT};function Ap(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 mp=function(){function n(t){this.componentProperty=t.componentProperty,this.states=t.states,this.valueNodeName=t.valueNodeName,this.valueNodeProperty=t.valueNodeProperty,this.valueNodeProperty===Ue.VisualResponseProperty.TRANSFORM&&(this.minNodeName=t.minNodeName,this.maxNodeName=t.maxNodeName),this.value=0,this.updateFromComponent(vp)}return n.prototype.updateFromComponent=function(t){var e=t.xAxis,r=t.yAxis,i=t.button,a=t.state,o=Ap(e,r),s=o.normalizedXAxis,u=o.normalizedYAxis;switch(this.componentProperty){case Ue.ComponentProperty.X_AXIS:this.value=this.states.includes(a)?s:.5;break;case Ue.ComponentProperty.Y_AXIS:this.value=this.states.includes(a)?u:.5;break;case Ue.ComponentProperty.BUTTON:this.value=this.states.includes(a)?i:0;break;case Ue.ComponentProperty.STATE:this.valueNodeProperty===Ue.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}(),gp=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 mp(e.visualResponses[i]);r.visualResponses[i]=a}),this.gamepadIndices=Object.assign({},e.gamepadIndices),this.values={state:Ue.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=F({id:this.id},this.values);return t},enumerable:!1,configurable:!0}),n.prototype.updateFromGamepad=function(t){var e=this;if(this.values.state=Ue.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=Ue.ComponentState.PRESSED:(r.touched||this.values.button>Ue.ButtonTouchThreshold)&&(this.values.state=Ue.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===Ue.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>Ue.AxisTouchThreshold&&(this.values.state=Ue.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===Ue.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>Ue.AxisTouchThreshold&&(this.values.state=Ue.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(function(i){i.updateFromComponent(e.values)})},n}(),yp=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 gp(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}(),bp="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",wp="generic-trigger",Ep=function(n){oe(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,u=i.value,c=i.valueNodeProperty;a&&(c===Ue.VisualResponseProperty.VISIBILITY?a.visible=u:c===Ue.VisualResponseProperty.TRANSFORM&&(a.quaternion.copy(o.quaternion).slerp(s.quaternion,u),a.position.lerpVectors(o.position,s.position,u)))})}))},t}(In.Object3D);function xp(n,t){Object.values(n.components).forEach(function(e){var r=e.type,i=e.touchPointNodeName,a=e.visualResponses;if(r===Ue.ComponentType.TOUCHPAD)if(e.touchPointNode=t.getObjectByName(i),e.touchPointNode){var o=new In.SphereGeometry(.001),s=new In.MeshBasicMaterial({color:255}),u=new In.Mesh(o,s);e.touchPointNode.add(u)}else console.warn("Could not find touch dot, ".concat(e.touchPointNodeName,", in touchpad component ").concat(e.id));Object.values(a).forEach(function(c){var l=c.valueNodeName,h=c.minNodeName,p=c.maxNodeName,v=c.valueNodeProperty;if(v===Ue.VisualResponseProperty.TRANSFORM){if(c.minNode=t.getObjectByName(h),c.maxNode=t.getObjectByName(p),!c.minNode){console.warn("Could not find ".concat(h," in the model"));return}if(!c.maxNode){console.warn("Could not find ".concat(p," in the model"));return}}c.valueNode=t.getObjectByName(l),c.valueNode||console.warn("Could not find ".concat(l," in the model"))})})}function ks(n,t){xp(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 Mp=function(){function n(t){t===void 0&&(t=null),this.gltfLoader=t,this.path=bp,this._assetCache={}}return n.prototype.createControllerModel=function(t){var e=this,r=new Ep,i=null;return t.addEventListener("connected",function(a){var o=a.data;o.targetRayMode!=="tracked-pointer"||!o.gamepad||pp(o,e.path,wp).then(function(s){var u=s.profile,c=s.assetPath;r.motionController=new yp(o,u,c);var l=e._assetCache[r.motionController.assetUrl];if(l)i=l.scene.clone(),ks(r,i);else{if(!e.gltfLoader)throw new Error("GLTFLoader not set.");e.gltfLoader.load(r.motionController.assetUrl,function(h){e._assetCache[r.motionController.assetUrl]=h,i=h.scene.clone(),ks(r,i)})}}).catch(function(s){console.warn(s)})}),t.addEventListener("disconnected",function(){r.motionController=null,r.remove(i),i=null}),r},n}();function Cp(n,t){if(!t)return n;var e=n.match(/\d+_[a-z].png/);return n.substring(0,e.index)+t+"/"+n.substring(e.index)}var Ls=300,Sp=new d.Matrix4().makeRotationAxis(new d.Vector3(0,1,0),Math.PI),Os=new d.Vector3(-1,1,1),Ip=function(n){oe(t,n);function t(e){var r,i=n.call(this,e)||this;i.xrManager=new up(i.renderer,i.renderer.getContext(),{onSessionStart:function(c){i.emit("xr.session.start",K("xr.session.start",{session:c,machineType:i.xrManager.machineType}))},onSessionEnd:function(){i.emit("xr.session.end",K("xr.session.end",{session:null,machineType:i.xrManager.machineType}))}}),i.xrControllerRay={left:new d.Raycaster,right:new d.Raycaster},i.xrControllerRay.left.params.Points={threshold:.1},i.xrControllerRay.right.params.Points={threshold:.1},i.pointerLines={left:new Sa,right:new Sa},i.pointerLines.left.visible=!1,i.pointerLines.right.visible=!0,i.pointerLines.left.setMaterial({color:new d.Vector3(1,1,1)}),i.pointerLines.left.points.material.depthTest=!1,i.pointerLines.right.setMaterial({color:new d.Vector3(1,1,1)}),i.pointerLines.right.points.material.depthTest=!1,i.scene.add(i.pointerLines.left,i.pointerLines.right),i.panoResources={},i.panoResources[i.locationMotion.keyframes[0].key=i.locationMotion.keyframes[1].key=ht()]={panoId:Be(i.currentPano),leftPanoPicture:null,position:i.camera.pose.offset.clone(),effect:"fade"},i.parallaxCameraMatrixs=[],i.onlyUseRightController=(r=e.onlyUseRightController)!==null&&r!==void 0?r:!1;var a=ot.shared.getContext();if(!a)return console.error("获取session失败,请退出重试"),i;i.on("xr.session.end",function(){i.scene.remove(i.pointerLines.left,i.pointerLines.right)}),i.xrManager.setSession(a),i.controllerWrappers=[new d.Group,new d.Group],i.scene.add(i.controllerWrappers[0],i.controllerWrappers[1]);var o=i.xrManager.getController(0);i.controllerWrappers[0].add(o);var s=i.xrManager.getController(1);i.controllerWrappers[1].add(s);var u=new Mp;return u.gltfLoader={load:function(c,l){ui.ajax(c,{responseType:"arraybuffer"}).then(function(h){var p;return Da(h.body,{resourcePath:c.slice(0,c.lastIndexOf("/")+1),search:(p=c.split("?")[1])!==null&&p!==void 0?p:"",fetcher:ui})}).then(function(h){return l(h)})}},i.on("xr.session.start",function(){var c=i.xrManager.getControllerGrip(0);if(c.add(u.createControllerModel(c)),i.controllerWrappers[0].add(c),!i.onlyUseRightController){var l=i.xrManager.getControllerGrip(1);l.add(u.createControllerModel(l)),i.controllerWrappers[1].add(l)}}),i.xrControllerState={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}},i}return t.parseArgs=function(e){if(e instanceof t)return e;var r=F(F({},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 F(F({},i),{mode:"XRPanorama"})},t.prototype.moveToPano=function(e,r,i){var a=this,o,s,u,c;this.userAction=i,this.stopMomentumMovement();var l=this.works.getResolvedObserver(e);if(!l)throw new Error("Invalid PanoIndex");var h=this.imageOptions.size;if(typeof h=="undefined"&&l){var p=l.images.up.match(/\/cube_(\d+)\//);p&&(h=Number(p[1]))}typeof h=="undefined"&&(h=2048);var v=this.imageOptions.transform,m=function(P,I){return Cp(li(P,v,I))},A=F({key:"pano.".concat(l.panoId)},nr(this.imageOptions,["format","size","quality"])),y=l.images,f=(s=(o=l.images.tiles)===null||o===void 0?void 0:o.filter(function(P){return P.size>h}))!==null&&s!==void 0?s:null,g="pano:"+dn([y,A,v]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===g)return;var b=this.pendingTextureTask.panoId;(u=this.panoMeshes[b])===null||u===void 0||u.setProgress(0),this.emit("pano.texture.abort",K("pano.texture.abort",{error:null,progress:0,meta:null,pano:l.pano})),this.pendingTextureTask.onError(new Error("texture aborted"))}var E=this.models.getMaterial()||{},w=E.pano0,x=E.pano1,M;if((w==null?void 0:w.map.name)===g?M=w:(x==null?void 0:x.map.name)===g&&(M=x),M){var C={panoId:l.panoId,effect:(c=r.effect)!==null&&c!==void 0?c:"fade",leftPanoPicture:{map:M.map,luminanceMap:M.luminanceMap,matrix:new d.Matrix4().compose(l.position,l.quaternion,Os)},position:l.position.clone()};this.doMoveToPano(l.pano,C,r);return}var S="move-to-pano-"+l.panoId;this.pending.add(S),this.pendingTextureTask={panoId:l.panoId,hash:g,onLoad:function(P){var I;if(a.pending.delete(S),a.destroyed)P.body.dispose();else{P.body.name=g;var B={panoId:l.panoId,effect:(I=r.effect)!==null&&I!==void 0?I:"fade",leftPanoPicture:{map:P.body,luminanceMap:null,matrix:new d.Matrix4().compose(l.position,l.quaternion,Os)},position:l.position.clone()};a.doMoveToPano(l.pano,B,r)}},onError:function(P){a.pending.delete(S);var I=F(F(F({},l.pano),{mode:a.mode}),Ve(a.camera.pose));a.emit("pano.error",K("pano.error",{error:P,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:I})),a.emit("pano.cancel",K("pano.cancel",{error:null,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:I})),r.moveCancelCallback&&r.moveCancelCallback()}},Promise.all([this.tileLevelForFov&&f&&f.length?this.textureLoader.loadTiledCubeTexture(y,f,{tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:m,options:A},format:d.RGBAFormat,viaAjax:!0,fetcher:ft(l.work)},void 0,void 0,function(P){var I,B;a.emit("pano.texture.progress",K("pano.texture.progress",{error:null,progress:P,meta:null,pano:l.pano})),((I=a.pendingTextureTask)===null||I===void 0?void 0:I.hash)===g&&((B=a.panoMeshes[l.panoId])===null||B===void 0||B.setProgress(P))},this.renderer):this.textureLoader.loadCubeTexture(y,{imageURL:{transform:m,options:A},format:d.RGBAFormat,fetcher:ft(l.work)},void 0,void 0,function(P){var I,B;((I=a.pendingTextureTask)===null||I===void 0?void 0:I.hash)===g&&((B=a.panoMeshes[l.panoId])===null||B===void 0||B.setProgress(P)),a.emit("pano.texture.progress",K("pano.texture.progress",{error:null,progress:P,meta:null,pano:l.pano}))},this.renderer)]).then(function(P){var I,B,L=P[0];((I=a.pendingTextureTask)===null||I===void 0?void 0:I.hash)===g?(a.pendingTextureTask.onLoad(L),(B=a.panoMeshes[l.panoId])===null||B===void 0||B.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.success",K("pano.texture.success",{error:null,progress:1,meta:L.meta,pano:l.pano}))):L.body.dispose()}).catch(function(P){var I,B;((I=a.pendingTextureTask)===null||I===void 0?void 0:I.hash)===g&&(a.pendingTextureTask.onError(P),(B=a.panoMeshes[l.panoId])===null||B===void 0||B.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.error",K("pano.texture.error",{error:P,progress:0,meta:null,pano:l.pano})),a.emit("error",P))}),this.emit("pano.texture.load",K("pano.texture.load",{error:null,progress:0,meta:null,pano:l.pano}))},t.prototype.doMoveToPano=function(e,r,i){var a=this,o,s,u;i===void 0&&(i={});var c=ve(),l=ht();this.panoResources[l]=r;var h=1,p,v,m;if(this.locationMotion.ended){var A=this.locationMotion.getKeyFrameSegment(c);A[0];var y=A[1],f=this.locationMotion.value,g=this.panoResourceFromLocationMotionKeyframe(y).position,b=r.position;p=Math.max(g.distanceTo(b),h),v=[{key:y.key,progress:0,value:F(F({},f),{count:0})},{key:l,progress:1,value:{distance:0,count:1}}],m=0}else{var E=this.locationMotion.getKeyFrameSegment(c),w=E[0],y=E[1],f=this.locationMotion.value,x=this.panoResourceFromLocationMotionKeyframe(w).position,g=this.panoResourceFromLocationMotionKeyframe(y).position,b=r.position,M=y.value.count-f.count,C=Math.max(x.distanceTo(g),h)*M,S=Math.max(g.distanceTo(b),h);p=C+S,v=[{key:w.key,progress:0,value:F({},f)},{key:y.key,progress:C/p,value:y.value},{key:l,progress:1,value:{count:y.value.count+1,distance:0}}];var P=this.locationMotionKeyframesLength(this.locationMotion.keyframes),I=this.locationMotionKeyframesLength(v);m=this.locationMotion.getProgressVelocity(c)*P/I}var B=this.calculateMovingDuration(i.duration,p),L={longitude:i.longitude,latitude:i.latitude,fov:i.fov},k=F(F({},e),{mode:this.mode,longitude:(o=L.longitude)!==null&&o!==void 0?o:this.camera.pose.longitude,latitude:(s=L.latitude)!==null&&s!==void 0?s:this.camera.pose.latitude,fov:(u=L.fov)!==null&&u!==void 0?u:this.camera.pose.fov,offset:r.position.clone(),distance:0}),O=this.currentPano;this.emit("pano.moveTo",K("pano.moveTo",{options:i,prevPano:O,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),this.cameraMotion.set(L,B).catch(Q);var N=this.locationMotion.setKeyframes(v,B,m);N.then(function(){var D,H,z,U=F(F({},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",K("pano.arrived",{options:i,prevPano:O,progress:1,state:U,userAction:a.userAction,error:null})),i.moveEndCallback&&i.moveEndCallback(U);var q=a.works.getResolvedObserver(a.currentPano);if(q&&q.video&&a.videoTexture&&a.videoTexture.image instanceof HTMLVideoElement){var j=Sp.clone().multiply((z=(H=(D=a.models.getMaterial())===null||D===void 0?void 0:D.pano1)===null||H===void 0?void 0:H.matrix)!==null&&z!==void 0?z:new d.Matrix4).multiply(q.video.matrix),_={map:a.videoTexture,size:q.video.size,matrix:j,alpha:1},Z=ht(),W=a.videoTexture.image;W.setAttribute("uuid",Z),Ju().then(function(Y){Y&&q.video&&W.getAttribute("uuid")===Z&&(W.oncanplay=function(){W.oncanplay=Q,W.play()},W.ontimeupdate=function(){W.currentTime>.5&&(W.ontimeupdate=Q,a.panoVideo.setMaterial(_))},W.src=q.video.source)}).catch(function(){W.removeAttribute("uuid")})}},function(){a.emit("pano.cancel",K("pano.cancel",{options:i,prevPano:O,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 u=this.camera.getDirection(new d.Vector3).setY(0),c=null,l=this.works.getResolvedObserver(this.currentPano);if(!l)return null;var h=l.accessibleIds.filter(function(Z){var W=We(Z);if(Tt(W,r.currentPano))return!1;var Y=r.works.getResolvedObserver(W);return!Y||Y.position.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:Y.loadable||Y.active}),p=this.models.intersectRaycaster(e)[0];if(p){var v=Pt(h,function(Z){var W=r.works.getResolvedObserver(Z);if(!W)return 1/0;var Y=W.standingPosition.clone();return Y.distanceTo(p.point)},!0),m=v[0],A=v[1];m&&A<this.panoTapTriggerRadius&&(c=(i=this.works.getResolvedObserver(m))!==null&&i!==void 0?i:null)}if(Ps(c)){var y=this.getForwardObserverOrNot(e);y&&(c=y)}for(var f=0,g=this.locationMotion.keyframes;f<g.length;f++){var b=g[f],E=this.panoResourceFromLocationMotionKeyframe(b);if(!(b.progress<this.locationMotion.progress)&&c&&E.panoId===c.panoId){c=null;break}}if(Ps(c))return this.locationMotion.ended===!0&&this.cameraBounce(),null;if(c&&!c.active){var w=c.panoId;this.panoMeshes[w]&&(this.panoMeshes[w].setDisabled(!1),this.panoMeshes[w].setLoading(!0))}var x={};if(c){x.effect="fade";for(var M=Math.PI/6,C=Math.PI/12,S=new d.Vector3(0,1,0),P=c.position.clone().setY(0).sub(l.position.clone().setY(0)).normalize(),I=P.clone().applyAxisAngle(S,M),B=P.clone().applyAxisAngle(S,-M),L=[],k=[],O=[],N=0,D=c.accessibleIds;N<D.length;N++){var m=D[N],H=We(m);if(!(Tt(H,this.currentPano)||Tt(H,c.pano))){var z=this.works.getResolvedObserver(m);if(z){var U=z.position.clone().sub(c.position).setY(0);P.angleTo(U)<M?O.push(U):I.angleTo(U)<M?L.push(U):B.angleTo(U)<M&&k.push(U)}}}var q=O.length>0?O:rt(rt([],L,!0),k,!0),j=q.slice().sort(function(Z,W){return Z.angleTo(P)-W.angleTo(P)})[0];j&&j.angleTo(u)>C&&(x.longitude=Math.atan2(-j.x,-j.z))}this.cameraMotion.value.latitude<-Math.PI/4&&(x.latitude=ae(0,this.minLatitude,this.maxLatitude)),this.cameraMotion.value.fov<60&&(x.fov=this.defaultFov);var _={workCode:c.pano.workCode,panoIndex:c.pano.panoIndex,mode:this.mode,longitude:(a=x.longitude)!==null&&a!==void 0?a:this.camera.pose.longitude,latitude:(o=x.latitude)!==null&&o!==void 0?o:this.camera.pose.latitude,fov:(s=x.fov)!==null&&s!==void 0?s:this.camera.pose.fov,distance:0,offset:c?c.position.clone():new d.Vector3};return this.emit("pano.select",K("pano.select",{prevPano:this.currentPano,state:_,userAction:!0,options:x,progress:0,error:null})),c&&c.active?(this.emit("pano.request",K("pano.request",{userAction:!0,prevPano:this.currentPano,progress:0,state:_,options:x,error:null})),c.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,u,c,l,h,p,v=[],m=2;m<arguments.length;m++)v[m-2]=arguments[m];this.userAction=!0;var A={},y={},f=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),g=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),b=!1;if(this.cameraMotion.ended===!1&&(this.cameraMotion.update(e),y.longitude=this.cameraMotion.value.longitude,y.latitude=this.cameraMotion.value.latitude,y.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),A.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(ae(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var E=this.locationMotion.getKeyFrameSegment(e),w=E[0],x=E[1],M=this.panoResourceFromLocationMotionKeyframe(w),C=this.panoResourceFromLocationMotionKeyframe(x),S=new d.Vector3().copy(M.position),P=new d.Vector3().copy(C.position),I=this.locationMotion.value.count-x.value.count+1;A.progress=I,C.leftPanoPicture&&(I<1?M.leftPanoPicture&&(A.pano0=M.leftPanoPicture):A.pano0=C.leftPanoPicture,A.pano1=C.leftPanoPicture),b=A.useBlackTransition=C.effect==="instant"||C.effect==="montage",(C.effect==="fade"||C.effect==="montage")&&(A.pano0&&M.leftPanoPicture&&(A.pano0={map:A.pano0.map,luminanceMap:A.pano0.luminanceMap,matrix:M.leftPanoPicture.matrix.clone().setPosition(C.position)}),S.copy(P)),y.distance=this.locationMotion.value.distance,y.offset=new d.Vector3(S.x+(P.x-S.x)*I,S.y+(P.y-S.y)*I,S.z+(P.z-S.z)*I);for(var B=[],L=[],k=0,O=this.locationMotion.keyframes;k<O.length;k++){var N=O[k],D=N.key,H=N.progress;D!==void 0&&(B.push(D),H>=this.locationMotion.progress&&L.push(D))}for(var z=0,U=Object.keys(this.panoResources);z<U.length;z++){var q=U[z];if(!(L.indexOf(q)>=0)){var j=this.panoResources[q];if(j.leftPanoPicture){var _=j.leftPanoPicture.map;if(_){if(_===((a=A.pano0)===null||a===void 0?void 0:a.map)||_===((o=A.pano1)===null||o===void 0?void 0:o.map))continue;_ instanceof Le&&_.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(_.cubeRenderTarget),_.dispose(),j.leftPanoPicture=null}}B.indexOf(q)>=0||delete this.panoResources[q]}}this.currentPano=We(C.panoId),this.emit("pano.moving",K("pano.moving",{userAction:this.userAction,prevPano:We(f.panoId),state:F(F(F(F({},We(g.panoId)),{mode:this.mode}),Ve(this.camera.pose)),y),options:{},progress:this.locationMotion.progress,error:null}))}xt(A)===!1&&(!((s=A.pano0)===null||s===void 0)&&s.map&&A.pano0.map instanceof Le&&!A.pano0.map.cubeRenderTarget&&(A.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((u=A.pano1)===null||u===void 0)&&u.map&&A.pano1.map instanceof Le&&!A.pano1.map.cubeRenderTarget&&(A.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),this.models.setMaterial(A)),xt(y)===!1&&this.setCamera(y);var Z=this.works.getResolvedObserver(this.currentPano),W=v[1];if(!W){console.error("xrFrame丢失,请重试");return}if(!this.xrManager.session){console.error("session丢失,请重试");return}var Y=this.xrManager.referenceSpace;if(Y){var ce=this.xrManager.cameraVR,te=this.xrManager.cameraL,se=this.xrManager.cameraR,ue=[te,se],pe=W.getViewerPose(Y),he=new d.Vector3(0,0,0);if(pe){var de;de=this.xrManager.session.renderState.baseLayer;var be=pe.views;if(!de){console.error("no layer found");return}this.renderer.setFramebuffer(de.framebuffer);var fe=!1;be.length!==ce.cameras.length&&(ce.cameras.length=0,fe=!0),this.parallaxCameraMatrixs=[];var Se=new d.Vector3,ee=new d.Vector3;new d.Matrix4().fromArray(be[0].transform.matrix).decompose(Se,new d.Quaternion,new d.Vector3),new d.Matrix4().fromArray(be[1].transform.matrix).decompose(ee,new d.Quaternion,new d.Vector3),ee.clone().sub(Se).normalize();var le=new d.Vector3,X=new d.Quaternion,Te=new d.Vector3;this.camera.matrix.decompose(le,X,Te);for(var Fe=0;Fe<be.length;Fe++){var Ye=be[Fe],Xe=de.getViewport(Ye),Ge=ue[Fe];Ge.matrix.fromArray(Ye.transform.matrix);var ut=new d.Vector3,Ne=new d.Quaternion,me=new d.Vector3;Ge.matrix.decompose(ut,Ne,me),he.copy(le),Ge.position.copy(le),Ge.quaternion.copy(Ne),Ge.scale.copy(me),Ge.updateMatrix(),Ge.projectionMatrix.fromArray(Ye.projectionMatrix),Ge.viewport.set(Xe.x,Xe.y,Xe.width,Xe.height),fe===!0&&ce.cameras.push(Ge)}pe.views[0].transform.position,pe.views[1].transform.position;for(var Ae=this.xrManager.session.inputSources,Fe=0;Fe<this.xrManager.controllers.length;Fe++){var nt=this.xrManager.controllers[Fe],Ce=Ae[Fe];if(Ce){nt.update(Ce,W,Y);var He=this.xrManager.getController(Fe),Oe=new d.Vector3(0,1.2,0),it=He.position.clone().add(he).sub(Oe);Ce.handedness==="left"?this.xrControllerRay.left.set(it,new d.Vector3(0,0,-1).applyEuler(He.rotation)):Ce.handedness==="right"&&this.xrControllerRay.right.set(it,new d.Vector3(0,0,-1).applyEuler(He.rotation)),this.controllerWrappers[Fe].position.copy(new d.Vector3(0,0,0).add(he).sub(Oe));var qe=this.models.intersectRaycaster(this.xrControllerRay.right);if(qe.length===0&&(qe=this.xrControllerRay.right.intersectObject(this.boundingMesh,!0).map(function(ct){var gt;return F({floor:(gt=Z==null?void 0:Z.floorIndex)!==null&>!==void 0?gt:0},ct)})),qe.length>=1&&qe[0].face)if(Ce.handedness==="right"){var Zt=this.xrControllerRay.right.intersectObject(this.xrCustomObjectsScene,!0),Or=qe[0].face.normal,Je=Or.clone().multiplyScalar(.05),Mt=qe[0].point.clone().add(Je);this.intersectMesh.position.copy(Mt);var _r=Mt.clone().add(Je);if(this.intersectMesh.lookAt(_r),Math.abs(Or.y)>.99){var $e=this.camera.position.clone().sub(Mt);this.intersectMesh.rotation.z=-Math.atan2($e.z,$e.x)}this.intersectMesh.visible=!0,this.needsRender=!0,Zt.length>0?(this.pointerLines.right.setPoints(it,Zt[0].point),this.pointerLines.right.points.visible=!0,this.intersectMesh.visible=!1):(this.pointerLines.right.points.visible=!1,this.pointerLines.right.setPoints(it,qe[0].point));var Bt=qe[0],Rt=K("intersect.update",{raycaster:(c=this.xrControllerRay.right)!==null&&c!==void 0?c:null,intersection:Bt!=null?Bt:null,object:this.intersectMesh});if(this.emit("intersect.update",Rt),Rt.defaultPrevented){this.hideIntersectMesh();return}}else this.pointerLines.left.setPoints(it,qe[0].point)}}if(this.camera.pose.distance>.1||b){if(Z)for(var Ht=0,Yt=Object.keys(this.panoMeshes);Ht<Yt.length;Ht++){var pt=Yt[Ht],Ie=this.panoMeshes[pt];Ie.setOpacity(0),Ie.setCurrent(!1),Ie.updateTime&&Ie.updateTime(e,r)}}else if(Z){var gr=Pt(Z.visibleIds,function(at){var ct=i.works.getResolvedObserver(at);return ct?Z.standingPosition.distanceTo(ct.standingPosition):1/0},!0),Ft=gr[1];Ft=ae(Ft,2.5,1/0);for(var ir=Z.visibleIds.concat(Be(this.currentPano)),kt=this.getForwardObserverOrNot(),mn=this.camera.getDirection(new d.Vector3),Vr=0,Nr=Object.keys(this.panoMeshes);Vr<Nr.length;Vr++){var pt=Nr[Vr],Ie=this.panoMeshes[pt],ar=this.works.getResolvedObserver(pt);if(ir.indexOf(pt)===-1)Ie.setCurrent(!1),Ie.setOpacity(0);else if(!ar)Ie.setCurrent(!1),Ie.setOpacity(0);else if(!ar.loadable&&!ar.active)Ie.setCurrent(!1),Ie.setOpacity(0);else{var or=Ie.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);Ie.setCurrent(!Ie.loading&&Ie.progress===0&&kt!==null&&kt.panoId===pt),Ie.setOpacity(or<.01?0:ae(Ft/or*1.2,.65,.98));var et=this.camera.position.clone().setY(Ie.position.y),Ke=new d.Vector3().copy(Ie.position).sub(et).normalize();if(pt===Be(this.currentPano)){var Lt=ae((.5-et.distanceTo(Ie.position))/.5,0,1);Ke.multiplyScalar(1-Lt).add(mn.clone().multiplyScalar(Lt))}Ke.length()>0&&Ie.quaternion.setFromEuler(new d.Euler(0,Math.atan2(Ke.x,Ke.z),0))}Ie.updateTime&&Ie.updateTime(e,r)}}var sr=function(){if(i.tileLevelForFov===!1)return 0;var at=new d.Vector2(4e3,4e3),ct=g.panoId,gt=i.works.getResolvedObserver(ct),yt=i.imageOptions.size;if(typeof yt=="undefined"&>){var Gn=gt.images.up.match(/\/cube_(\d+)\//);Gn&&(yt=Number(Gn[1]))}typeof yt=="undefined"&&(yt=2048);var Dr=0;yt>=1024&&(Dr=1),yt>=2048&&(Dr=2),yt>=4096&&(Dr=3),yt>=8192&&(Dr=4);var Ur=i.tileLevelForFov(te.fov,at);return Ur>Dr?Ur:0}(),gn=function(){var at=new d.PerspectiveCamera;at.applyMatrix4(ce.matrix),at.position.set(0,0,0);var ct=i.works.getResolvedObserver(g.panoId),gt=ct!=null?ct:Z;gt&&at.quaternion.premultiply(gt.quaternion.clone().inverse()),at.updateProjectionMatrix(),at.updateMatrixWorld(!0);var yt=new d.Frustum().setFromProjectionMatrix(new d.Matrix4().multiplyMatrices(at.projectionMatrix,at.matrixWorldInverse));return yt}();g.panoId===Be(this.currentPano)&&((l=g.leftPanoPicture)===null||l===void 0?void 0:l.map)instanceof Le&&(g.leftPanoPicture.map.update(gn,sr),g.leftPanoPicture.map.needsRender===!0&&(this.needsRender=!0));{var zn=this.tiling.object.visible;if(sr>this.TILED_CUBE_TEXTURE_LEVEL&&this.initAnimationed){var Qr=g.panoId,lt=this.works.getResolvedObserver(Qr);lt?Mi(this.camera.position,lt.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==Qr&&this.tiling.cleanup(),this.tiling.panoId=Qr,this.tiling.setResource((p=(h=lt.images)===null||h===void 0?void 0:h.tiles)!==null&&p!==void 0?p:[],this.enableIOSEDR&<.images.luminance?lt.images.luminance:null),this.tiling.setFetcher(ft(lt.work)),this.tiling.setRotation(lt.quaternion),this.tiling.setPosition(lt.position),this.tiling.update(gn,sr,e)):this.tiling.object.visible=!1:this.tiling.object.visible=!1}else this.tiling.object.visible=!1;zn!==this.tiling.object.visible&&(this.tiling.object.needsRender=!0)}this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e),!(!Ae||Ae.length<1)&&this.updateControllerHelper(Ae,e,r)}}},t.prototype.render=function(){var e=this.xrManager.getCamera(this.camera);this.renderer.render(this.scene,e)},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}},u=0;u<e.length;u++){var c=e[u].handedness,l=e[u].gamepad;switch(c){case"left":l.axes&&(this.emitEvent(l.axes[2]===-1,"LeftAxesLeft",r),this.emitEvent(l.axes[2]===1,"LeftAxesRight",r),this.emitEvent(l.axes[3]===-1,"LeftAxesUp",r),this.emitEvent(l.axes[3]===1,"LeftAxesDown",r)),l!=null&&l.buttons&&(this.emitEvent(l==null?void 0:l.buttons[4].pressed,"X",r),this.emitEvent(l.buttons[5].pressed,"Y",r),this.emitEvent(l==null?void 0:l.buttons[0].pressed,"LeftTrigger",r),this.emitEvent(l==null?void 0:l.buttons[1].pressed,"LeftPinch",r));var h={raycaster:a,axes:{up:l.axes&&l.axes[3]<0?Math.abs(l.axes[3]):0,down:l.axes&&l.axes[3]<0?0:Math.abs(l.axes[3]),left:l.axes&&l.axes[2]<0?Math.abs(l.axes[2]):0,right:l.axes&&l.axes[2]<0?0:Math.abs(l.axes[2])},deltaTime:i};s.buttons.X=l.buttons&&l.buttons[4]?l.buttons[4].pressed:!1,s.buttons.Y=l.buttons&&l.buttons[5]?l==null?void 0:l.buttons[5].pressed:!1,s.buttons.LeftTrigger=l.buttons&&l.buttons[0]?l==null?void 0:l.buttons[0].pressed:!1,s.buttons.LeftPinch=l.buttons&&l.buttons[1]?l==null?void 0:l.buttons[1].pressed:!1,s.left=h;break;case"right":l.axes&&(this.emitEvent(l.axes[2]===-1,"RightAxesLeft",r),this.emitEvent(l.axes[2]===1,"RightAxesRight",r),this.emitEvent(l.axes[3]===-1,"RightAxesUp",r),this.emitEvent(l.axes[3]===1,"RightAxesDown",r)),l.buttons&&(this.emitEvent(l==null?void 0:l.buttons[4].pressed,"A",r),this.emitEvent(l.buttons[5].pressed,"B",r),this.emitEvent(l==null?void 0:l.buttons[0].pressed,"RightTrigger",r),this.emitEvent(l==null?void 0:l.buttons[1].pressed,"RightPinch",r));var p={raycaster:o,axes:{up:l.axes&&l.axes[3]<0?Math.abs(l.axes[3]):0,down:l.axes&&l.axes[3]<0?0:Math.abs(l.axes[3]),left:l.axes&&l.axes[2]<0?Math.abs(l.axes[2]):0,right:l.axes&&l.axes[2]<0?0:Math.abs(l.axes[2])},deltaTime:i};s.right=p,s.buttons.A=l.buttons&&l.buttons[4]?l==null?void 0:l.buttons[4].pressed:!1,s.buttons.B=l.buttons&&l.buttons[5]?l==null?void 0:l.buttons[5].pressed:!1,s.buttons.RightTrigger=l.buttons&&l.buttons[0]?l==null?void 0:l.buttons[0].pressed:!1,s.buttons.RightPinch=l.buttons&&l.buttons[1]?l==null?void 0:l.buttons[1].pressed:!1;break}}this.emit("xr.controller.update",K("xr.controller.update",s))}},t.prototype.emitEvent=function(e,r,i){var a=this.xrControllerRay.left,o=this.xrControllerRay.right;if(e)if(this.xrControllerState[r].touchStart===!1)this.xrControllerState[r].touchStartTime=i,this.xrControllerState[r].touchStart=!0,this.emit("xr.gesture.buttonDown",K("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.xrControllerState[r].touchStartTime;s>Ls&&this.emit("xr.gesture.press",K("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.xrControllerState[r].touchStart===!0){this.emit("xr.gesture.buttonUp",K("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.xrControllerState[r].touchStartTime;if(s<=Ls){var u=this.emit("xr.gesture.tap",K("xr.gesture.tap",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:a,rightRay:o}}}));u||r==="RightTrigger"&&this.checkSelectedPano(this.xrControllerRay.right)}this.xrControllerState[r].touchStart=!1,this.xrControllerState[r].touchStartTime=0}},t}(Ja),Nt={Floorplan:ai,Topview:Qf,Panorama:Ja,VRPanorama:Qh,Model:Uh,DepthPanorama:Xh,Mapview:ap,XRPanorama:Ip},f0=["gesture.pan","gesture.tap","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 Tp(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.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=Tr(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 Pp(){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}function Bp(n){{var t=new d.DirectionalLight(16777215,.5);t.position.copy(new d.Vector3(1,1,1)),n.add(t)}{var t=new d.DirectionalLight(16777215,.3);n.add(t)}{var t=new d.AmbientLight(16777215,.3);n.add(t)}}function Rp(n){for(var t,e,r={},i=n.split(/(\;|\,)/),a=0,o=i;a<o.length;a++){var s=o[a],u=s.split("="),c=(t=u[0])===null||t===void 0?void 0:t.trim(),l=(e=u[1])===null||e===void 0?void 0:e.trim();c&&l&&(r[c]=l)}return r}function h0(){for(var n,t=document.getElementsByTagName("meta"),e=0;e<t.length;e++){var r=t[e];if(r.getAttribute("name")==="viewport"){var i=Rp((n=r.getAttribute("content"))!==null&&n!==void 0?n:""),a=Number(i["initial-scale"]);if(!isNaN(a))return a}}return 1}const Fp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAV8AAAA/CAQAAADtPwPkAAAR+0lEQVR4AezYg3LEQACH8d1cbdu23Q5qG9G47z/TN/h6tn2b/H+TUTLc7yjcOXV46OUAnUs6EbUp022ZBXc1NhoZYYd7fjDRvdcHAwrlK2QBVJ4sgoqONmY45RUT23sZ6H42F2hK5CtkMbjhZlDmUUcvq1zyieUVyjbE4I1GBfItwxG56YaUZTQwyh4P6NgJ4YYYvCuQb5kOyI03pORjiqe4Lwpq5pt1vJqfUwKWJVbSMYfppYconG+maNNQOWBZuwHTzicGel75NtFOkxr5apmV8cikcko0DrDQs863AeGl0cE0+1xy573m0/wf0cEKW6H7BWtggiMG8sy3oHRDpJMw4NWb6am/bv9znkqEzjd61t5oo5clTrjhwevO75EJRBKSRt745Z16ZEjcM73sccZplBPm8PyTcxZAkSRdHm/acJ0Z3JZhHB0BxqDHgWFZFmm0ZbCw87twI/zc3e/Cz93vPneXtU/WdQS3oTviXdY/q5PsJKfoGuQjZuO/0in1qsj85cuXrxqeAOJpGqdJOqrUutgVl2Qb0BWqp/RE8AWWVB7t2KrIzY2Wx2fWKl7yfswgxqj8lYummYa3hfwF9MuQRmbfQE4ocPDjtUWQ6Tq1M2w7gC2EcrMGtWS6xlpGKEDDcb1vUQ25zT4lrC2s0dU4gFPppKkbeIYr7NMpqjStuFg5rNU9epGyt8PXyfX4DE1bKLhR/1XPxwJhp5DAV67T9ZPwFdovhBMIGUYoRBN4wim6S3eoXVEHXdLgmwY0x6BQnO4xPJ0Ar5OVxhQF0L9UslRM4yaQQfQImnBegi8vhY2A1k6YLlrj61TwDdNQnIISwiPvpD7TwYQTssZXK47vg8y9Gp2nxRcATkozOEmdCeObSt3IIo+xf/00IDRKAaZ89PBTkHqpkA5LagKeNZKlIhqX8RcQ95GHtdYA62Y6rOg5LLsOSnoyvk4V38hFhytef+V9/3DER1P48W89o1GxE9o5vns2Mk+F7yiftafEN4nhmUv9DKEeyqI0U+l0CQg+B//sZ5+6lOuqKaTgm0LH41RHw/CsLZRk4huiYxrvP2SNr1OSS+Dr1ulBMR+K9SqHa58Oec49VgL3mXHvDr7QfuM7LMNrH1/IS30Moe64SLYBuFVJ+MbnJY7L+GrVQkFcl4ISx/fEll4ZWnz18DpcSzUCX602LqD9svDLzmdaLkP28P1+VsJjsx/4hmh6x/gmm/i6pbrGneCL9iCOg0dQUvF1UwEdVvG19r2uTXxXLz0J37eLjfZoF++tTtPnU/cWp5e8n3An0m/G+U7qjiy4PpHyV16HKx5flCxAV/H9A88nUnZ7l7KN78SBxPcQgzLAepxEScU3l7pZ6fL2+Dot8fXECfj+QRoGYAwlAfBSPrXQXQri0Pd85NJKcVw8XUdt1LZapk7YRhO1RdpmFJwW8ozekYvx2/fjM5Hr5MfQ95HvcY2a/9hoNK4yEntL+dEuGseTdNmxIPqd5v2YRjeaX8pQ8IW2ohuP7+dTN87RMK4aitx8XPsH0r2oBqNRqrv7+gmjjY7uIr6TBxBfL2MlxNRKSVp8S5CTuGgHXxfkFvh69Pq3LD4pkkd2bdRvHaSNC3/l2sQXAccdlIS+lc57qhPJwxPybT7XSxnUrdqnXuHlJHS+mjZfJfUZR9s2FuQR+EQKdSi9Am8UTnsEvlYS+L6TFwW6kl74Vjr6AFHsX89rgg8njRltK0XPOL7NyDL0IurV4VtMwafB1709vu9X4OjWHoP3z1Ii7eaQdG00Lx5n8HXyDSva/dU0Pq2vZnKYxHYMYRo1WY5ov1G7Vh4r3y+kMdgbilxeOrV0aqOFenFl8GGJig7rG0bbPRqiSRpP2AL0w+yon9dHbi43zFetnKcuw9ZLeSa+7kTw/TDfuFu0Z7Vp/uhyHfPkAZ5ufP9wLIfD49E3clR818rR089Lzyy+VRREPneICnYLX9cT8PVKQs36TbQ3i6NcCwYkxEAQ3phN4CjAvC4mFr5vrlKe7AizBKj8cu33s7i9GbeY7BHYujTjjd3Bx54SSyT4m8mxOoYOAGX/DtwvnGE1M+5v5Bgt1hbkJRW9Cxv9X81GL2i5jqaoJ4avBcCsLYp+Ru+VC5sWPpFhXt8/EPvJL2F/alJDEeIjUhcrP5P45rDeATPj+wKl7gBf1fcq+HpVnfHO1vEf//UCHgt/OxfDE3onj5UkfTaThrg3NCGoBUCtZjvgMnwQB0bG5XENeraJ5XEWvtiHkqSVRqN+uQ4lEx2o+69SeY1dC++Wcsj+LCW+H0ZE4KtDWHkGwCtrxstbFqr51e9wbz42E2fpjRQsqEn50PnM4eumO9IbujCi393Hd+3q72TI+p9DPyyfraF+c3rOx0KJyB2z7Fa1yCO8HoHzlDFhPiWD8XoB3aPppRrUQdRp1D8qE9exdgr+Zbpqf8BLfmZ/bMYbh87k58VCSswCjQoLPPw4Jnp4uFi/YQlfKB5eBd/gr6aqB973zbDAF+v5PN+NZEvm+84bSkhxUPE9C9wqbeJ7Hi+gA9Jr5ZM7x9el4mulyK0Bb2xiMTj3/iBtK77Tnii27H/MlCfsjcJY+2oTg2/U4TYWQERE0r+aCouBcx5zEZzEYrqui8JXsQW/X8FLHJ3IVbWXhQV3zAJCjFQst1F25y1arlXwhRR4Bb4rZ3VPy5d+bHEtHIPF27K16ItYuKXM5kHD10M9DKFeSpbqLlOYAlRiC99yCiDmbUf0206jPPO7b/iud71avBkHf+kQP0OrWHBFrhmt75ZyPzbLg5KmWK9oH4Oq1eFZOm0c6n48mdfer46HcLUZU3pGB8R9IDBbJ+N7v1q0J2xhudZ45tcL8PN16vq9WizwtRLwFQtKER+NDypj4QQOdJNY3NC7GEsaGtiSmDsA+CZhyx+hXFHjYrgGGXpZNvDNpn5gWWuiWkUtyEB0UcrO8Y2L9KI9K+cXLmxqruGd6pcKfycj/ij3URVgu6bPUaycN1qXTHD+KoOmjGORnH57q8rh+e9sTHk5r1+7zpEXk36bp7iiXRrBW61e5k/D0fn+EXF/OxYEypFW3ZH1HzPt4Pv5PN2Rd7VJLDZeboGnbpSPwPDcBw5f6AIysadFOR9Hr7vksoFvE91jdbdYvzpYqyIvdQPU87uKL45u3u213CA8qkYPT6H1YgwIfkz7RI5xJdomfjoV4PXjfjgaRkNGhHwG1mNt1oq0y/j+SaZ5pV0LnrlG89Dl1YkmEsc3nKKzMKskJD+fx6NhlFiohdTe5EsZIig5WPgWUYCC9Dx5TG/sA5x15LCBbzXDtx/+uh74VmMZjLDamh8JvhzQtSsoeVTNNXB/Euv96LRR/qjO+By5xTxxJ683/FB00Pj0fZz9F2GPa70Ld2hbbVptWmjWabbGCl/ZAiTsbJa5hQ9OK/eWFE4xva9nG3z1zwCtnFXjYr6c3ykxPn9QiYWEWPhA4uuiDnzBpt4EMcg0QOm28M0gP76hJuELbIdZi4PqaILpJI+RYz4ZV42y+q49wBcxIbyXTmtXgevRWPl3MmjSSJU5vB3J0TA2Uu8mtP+R5/Au4iiF6NrUUiuCieOiJpnJq8gSXzwFLFiLP8X6bV0bYvzt8TXj75eLtKPRauY1RM1HR7GwEHpFbonIWAPwjxpfqJSCyBVUsk/DFOChhC18kyiPHFvwdVGh6XFbmfLx+RRi4jaqYiCnUDO1wc4u4ovo7pfS+XFD32e9GzndwxJiHcbQ/Vz6JrBMDGYyYK5l7YOsfkS2MVePfGkLsNXLGl9hIVbWXAv9fQ5i/j6UFL1RaQffB9qlwn3tS4WxMhaxETCMz6T9ZTqCk5FznoOKL9SEXMMIUwAZW6dNfCEVX61azdxwmIbg4aHdwtcj5KVBeNiqrb2+g5M8hTskSB6exHZ5bMEIF/wCoOT128zvdXziMLbvuDu/Usmh0oG7doMmafKNSmt8hQWUnmzhjJf/RskXCzQL8aYNfLG/QPGLY5KjKtcuNPGsyGytmj0/kPi6qdXwwJCPvOTYI3zTaICCNEh9FGSWM54OX4+A1UI80RV98czWKceJf65ervsleJm164/7ganACHHn+IPz8Nby1ptcnRztRWbipArvp4/gRchodbIFvsBSWPBaW+CHtzWfauFfcmnKRuyr+Fiu1WbzGKtCPWWMHjIgU1/Mgn2B74GKfbkajHwtVIHy3uBbh0Ocj9oplCC+kIJvYuKvI9bbkUUQ2+JaG7AeknwvhLd0YUxx+SZIf4XkGeqHUCNt9N8sQdvYlwtl9H4hMzqI5dHosMIX2taCl2s6LRowaubPyld/IgcvHBJPnKGnHDLh0ArfqzlYtkv5D8++4RsAvPbwTaJzgDcIDzxIRXuEbx4NIsYupjt7gi/6idL3j1AIqPY+OPH5PGO67x/jUS9NvF6hTte7x2kaCvtSZJiMlxjxMSqEtqXr3GPMn/9y4cXUypS/ymPxbIAvmurtYl9o7dqmBV9KdbLOgsik4B3d6xW/lO7w/kfe+yfx7bFuGkwY3/C6sURDj8584rCxJH5QtnYFVrFQVL35HNoQgO0jvt228XVRC4WQPLtANyiEzb1gD/BNoy5kHa5QEnUmiq/uG2fubeXh+kwuNj8IRxAoOqiLIqfTaNw84SfLWsDmqo08k30prHVKbHuYDo7ez6U7EsLX0oJX1ltV2AOg2KfoMPPA/sTx/ZPMqF9YiN11AsHLFrHgaAT3GBvw7hO+U9TH4bX10rgVx7YgMr0p7Pow4tL8XcY3l1kJMfVQmsA3fa/wFQh3JK9eivtV+tCaD4cUjdZvIRI9BfDUDd6PkkbfKhVbOJf/jUpuQcXXlgVNv68ejr4gTflk5AZ71+jR4AvEdPg6PDNpaz6a2AQm2otoWKvVS+LVTyL4OnaE7wSNUjfdpnZb+KbQdcA7Jr5ek0od8MD9dNjiN43t4etk1v0ITfyw6gS+Q4l5XwGwbXli+u/sj6pWGu9XfyYXx75d18+lf6t0tnau/pXKv8+xzorIkltn0l4r2dYCXlO8XDRbu9xw/9g/Zko2FXSFtKPxOxn3q+caluteK5lJsboXwVP/S27cPVz28X3i3/Ll/v8eDVMPDmzwvDbwddMt+NoROhq3yXcC4D7KpmTyA+XnqEzSFQrawDeLrsNemHrEL2+24r7NlENZUMa2vyxkH2DIs628e669ubdsR4VXC7C9u79eIVJtOwgdgO/dOICHGK6jQHaIwdXN4Lwt0LWHr4d6kX8tV+ozqAs+uYCSmO2w+jd4zGNeUYL4nqZxeN5WKVgooSAClmEaYhqhdit89QC7niSbCEM2sdkBuHYxQg9ri5ZjkuhI6DMP+J7cTvEtokEx0aPscyddoFJKpSZqV7G1GTxcpmEthpnw5058c6GfwqpwzGOtGjXSJI3FLYhc+O+jSr9aGhPWQlRshS8AticLX7wnsgbXxt6gsWCpRBa0vRGQM8oB9dhmP3QAwFX4c079dJNq6Qi5xbuyTmpPSJ1Ur4UtF7GoTtmUL3zxaWqMU8P/k3cXSQ1EQRjHGdzdHTa4u7tzBs7CedhykNwF2/5jq56iU11db6Lv2yTj8hs3JoiU9sZZp5/62J5v1z9NjrDHaSbnbFMf52sHrDUVaidDxNG0o9+uLjfosfdb3jT5d5j757riJgst9NIZQ2Pn+ySZll80vjI6Wz/hQJG4vPG0L/H6poQch/dW3vL3B0u8jl0HvVj5PvHCElEF8DUAFikVYTcvmfBdDzQlvvMXSV5lP5zrXj/fJ54zuWaeeuoqkW8AwCIaqeTZKkmYrpPwR2eqN9X72W7EG57vU67OBeuMV8KXLUzv93UTTj42tvaFS++GVsc5JRyLSLJ8nzO555hFBmiSRCqMr4GwrcmGkib5xSvcwmzFK6e8s7DMa2xH4YZdZumSOwsVzFeBWdr37tpIhOpSwXqONNgZq/2KgvBt54znHN1HzlljTO4oVD5fb+prNIJXQNL1ofDKQisbPLJDv3jNSLq9OkYBEIihKIj3v7S1TRQCX5Kdl1ZQlol7LF+E++fwirfiq2sf4cTXxc6hzxffPuLEeqSWrPGWMF58TWr5viyJAP5/4EV4KePiaSE8eNRgjDy8/tyRW+FZjhS+2tlovNJovtJovNJ0uhK6Wo64SDdxEbM//KesjwAAAABJRU5ErkJggg==";var Vs=[351,63],Ns=[20,20],kp=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),Lp=new Float32Array([0,0,1,0,0,1,1,1]),Op=new Uint8Array([0,1,2,1,3,2]),Ti=new d.BufferGeometry;Ti.setAttribute("position",new d.BufferAttribute(kp,3));Ti.setAttribute("uv",new d.BufferAttribute(Lp,2));Ti.setIndex(new d.BufferAttribute(Op,1));var oi=new d.MeshBasicMaterial({transparent:!0,depthTest:!1,depthWrite:!1,stencilWrite:!1,fog:!1}),p0=new d.Mesh(Ti,oi);p0.matrixAutoUpdate=!1;var no=new d.Scene;no.add(p0);no.matrixAutoUpdate=!1;var Un=new d.OrthographicCamera(-.5,.5,.5,-.5,.1,1);Un.position.set(0,0,.5);Un.lookAt(0,0,0);Un.updateMatrixWorld(!0);Un.matrixAutoUpdate=!1;var Vp=new d.Vector4,Np=new d.Vector4;function Qs(n){if(oi.map){var r=n.getViewport(Vp),i=n.getScissor(Np),a=n.getScissorTest(),o=n.autoClear,s=i.x+Ns[0]/3,u=i.y+Ns[1]/3,c=Vs[0]/3,l=Vs[1]/3;n.setViewport(s,u,c,l),n.setScissor(s,u,c,l),n.setScissorTest(!0),n.autoClear=!1,n.render(no,Un),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,oi.needsUpdate=!0,e.onload=Q},e.src=Fp,oi.map=t}}var Qp=800,Dp=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/")},Up=[{name:"Z",transformToUpAxisZ:function(){return new d.Matrix4}},{name:"Y",transformToUpAxisZ:function(){return new d.Matrix4().makeRotationAxis(new d.Vector3(1,0,0),+Math.PI/2)}},{name:"-Y",transformToUpAxisZ:function(){return new d.Matrix4().makeRotationAxis(new d.Vector3(1,0,0),-Math.PI/2)}},{name:"WGS84",transformToEarthCentered:function(){return new d.Matrix4}},{name:"GCJ02",transformToEarthCentered:function(){return new d.Matrix4}},{name:"BD09",transformToEarthCentered:function(){return new d.Matrix4}}],an=new d.Vector2,$n=new d.Frustum,ei=new d.Matrix4,Ds=new WeakMap,Us=new WeakMap,zs=ju([]),v0=function(n){oe(t,n);function t(e){e===void 0&&(e={});var r,i,a,o,s,u,c,l,h,p,v=n.call(this)||this;v.ident=ht(),Ia.instances[v.ident]=v,v.renderSwitch01=0,v.currentMode="Panorama",v.pano={workCode:"",panoIndex:0},v.needsRender=!1,v.onlyRenderIfNeeds=(r=e.onlyRenderIfNeeds)!==null&&r!==void 0?r:!0,v.imageOptions=F({},(i=e.imageOptions)!==null&&i!==void 0?i:{}),v.textureOptions=F({},(a=e.textureOptions)!==null&&a!==void 0?a:{}),v.poweredByRealsee=(o=e.poweredByRealsee)!==null&&o!==void 0?o:!0,v.extraElements=[],v.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),DepthPanorama:Object.assign({},e.depthPanorama),VRPanorama:Object.assign({},e.vrPanorama),XRPanorama:Object.assign({},e.xrPanorama)},v.coordinatesSystemTransformers=rt([],(s=e.coordinatesSystemTransformers)!==null&&s!==void 0?s:[],!0);for(var m=function(L){var k=A.coordinatesSystemTransformers.find(function(O){return O.name===L.name});k||A.coordinatesSystemTransformers.push(F({},L))},A=this,y=0,f=Up;y<f.length;y++){var g=f[y];m(g)}if(v.fps={testCount:0,testTime:ve()},v.info=null,v.modeChangeDuration=(u=e.modeChangeDuration)!==null&&u!==void 0?u:Qp,v.enableWheel=(c=e.enableWheel)!==null&&c!==void 0?c:!0,typeof window!="undefined")if(e.renderer)e.renderer instanceof Hr&&v.throwError(new Error("cannot render a internal renderer")),v.renderer=e.renderer;else try{v.renderer=new Hr({preserveDrawingBuffer:e.preserveDrawingBuffer,backgroundColor:e.backgroundColor,backgroundAlpha:e.backgroundAlpha,antialias:e.antialias,webgl2:e==null?void 0:e.webgl2});var b=h0();v.renderer.setPixelRatio(b===1?window.devicePixelRatio:1),v.renderer.setSize(512,512)}catch(L){L instanceof Error&&v.throwError(L)}v.getPixelsRenderTarget=new d.WebGLRenderTarget(1,1,{encoding:(h=(l=v.renderer)===null||l===void 0?void 0:l.outputEncoding)!==null&&h!==void 0?h:d.sRGBEncoding}),v.scissor=Object.assign({left:0,bottom:0,width:1,height:1},e.scissor),v.camera=new di(90),v.scene=new su,v.xrCustomObjectsScene=new d.Scene,v.scene.add(v.xrCustomObjectsScene),v.scene.matrixAutoUpdate=!1,v.lastLoadWorkTask=Promise.resolve(),v.requestProxy=(p=e.requestProxy)!==null&&p!==void 0?p:Dp,v.networkSubscribe=new _s,v.networkSubscribe.on("network",function(L,k,O,N){var D;v.emit("network.resource",K("network.resource",{source:L,requestType:k,requestState:O,detail:N})),(D=v.analysis)===null||D===void 0||D.network(v.works,L,k,O,N)}),v.boundingMesh=Pf(new d.Box3(new d.Vector3(-.5,-.5,-.5),new d.Vector3(.5,.5,.5))),v.boundingMesh.name="bounding",v.scene.add(v.boundingMesh),v.models=fs(),v.models.push(new xa),v.lastModels=fs(),v.readyCallbacks=[],v.syncingState=!1,v.modelGroup=new d.Group,v.modelGroup.visible=!1,v.modelGroup.name="model",v.modelGroup.matrixAutoUpdate=!1,v.modelGroup.renderOrder=-4,v.scene.add(v.modelGroup),v.helperGroup=new d.Group,v.helperGroup.name="helper",v.helperGroup.matrixAutoUpdate=!1,v.scene.add(v.helperGroup),v.videoTexture=new d.VideoTexture(e.videoInstance||Pp()),Bp(v.scene),v.copyEffect=new Si(v.renderer,v.scene,v.camera,v.models),v.state={mode:v.currentMode,workCode:v.pano.workCode,panoIndex:v.pano.panoIndex,longitude:v.camera.pose.longitude,latitude:v.camera.pose.latitude,fov:v.camera.pose.fov,offset:v.camera.pose.offset.clone(),distance:v.camera.pose.distance},v.stateSynced=!1,v._enableIOSEDR=!1,v.destroyed=!1,v.paused=!0,typeof window!="undefined"&&(e.play!==!1&&v.play(),v.stopAnimationLoop=ot.shared.add(function(L,k){for(var O=[],N=2;N<arguments.length;N++)O[N-2]=arguments[N];v.updateTime.apply(v,rt([L,k],O,!1))},!1,0,10));var E=function(){typeof document!="undefined"&&document.fullscreenElement===null&&v.currentMode==="VRPanorama"&&v.controller.emit("vr.requestExit",K("vr.requestExit",{}))},w=function(){v.needsRender=!0};if(typeof document!="undefined"&&document.addEventListener("fullscreenchange",E,!1),v.renderer&&v.renderer.domElement.addEventListener("webglcontextrestored",w,!1),v.removeEventListeners=function(){typeof document!="undefined"&&document.removeEventListener("fullscreenchange",E,!1),v.renderer&&v.renderer.domElement.removeEventListener("webglcontextrestored",w,!1)},v.plugins={},e.plugins&&e.plugins.length)for(var x=0,M=e.plugins;x<M.length;x++){var C=M[x];if(typeof C=="function")C(v);else if(Array.isArray(C)){var S=C[0],P=C[1],I=C[2];if(typeof S=="function"){var B=S(v,I);typeof P=="string"&&(v.plugins[P]?v.throwError(new Error("plugin name ".concat(P," is exists."))):v.plugins[P]=B)}}}return v.gpuPickingRenderTarget=new d.WebGLRenderTarget(1,1),v.meshReplaceMaterialMap=new Map,v.meshOriginMaterialMap=new Map,Tp(v),v}return Object.defineProperty(t,"version",{get:function(){return"6.0.0-alpha.73"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"dracoPath",{get:function(){return vi.decoderPath},set:function(e){vi.setDecoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t,"ktx2Path",{get:function(){return Fn.transcoderPath},set:function(e){Fn.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(h){if(!(!(h instanceof d.Mesh)||h instanceof Gt)){var p=Object.keys(i).filter(function(m){return m===h.uuid})[0];if(p)if(s.meshOriginMaterialMap.set(p,h.material),s.meshReplaceMaterialMap.get(p))h.material=s.meshReplaceMaterialMap.get(p);else{var v=new d.ShaderMaterial({uniforms:{color:{value:i[p]}},vertexShader:`
|
|
2021
2021
|
void main() {
|
|
2022
2022
|
vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
|
|
2023
2023
|
gl_Position = projectionMatrix * mvPosition;
|