@reall3d/reall3dviewer 0.0.7 → 0.0.8
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/dist/pkg.d.ts +15 -15
- package/dist/pkg.js +3 -3
- package/dist/pkg.umd.cjs +1 -1
- package/package.json +2 -2
package/dist/pkg.d.ts
CHANGED
|
@@ -399,7 +399,7 @@ export declare class SplatMesh extends Mesh {
|
|
|
399
399
|
* @param opts 高斯模型选项
|
|
400
400
|
* @param meta 元数据
|
|
401
401
|
*/
|
|
402
|
-
addModel(opts: ModelOptions, meta
|
|
402
|
+
addModel(opts: ModelOptions, meta?: MetaData): Promise<void>;
|
|
403
403
|
fire(key: number, ...args: any): any;
|
|
404
404
|
/**
|
|
405
405
|
* 销毁
|
|
@@ -430,15 +430,15 @@ export declare interface SplatMeshOptions {
|
|
|
430
430
|
/**
|
|
431
431
|
* 模型矩阵
|
|
432
432
|
*/
|
|
433
|
-
matrix?: Matrix4
|
|
433
|
+
matrix?: Matrix4;
|
|
434
434
|
/**
|
|
435
435
|
* 渲染器事件管理器
|
|
436
436
|
*/
|
|
437
|
-
viewerEvents?: Events
|
|
437
|
+
viewerEvents?: Events;
|
|
438
438
|
/**
|
|
439
439
|
* 是否调试模式,生产环境默认false
|
|
440
440
|
*/
|
|
441
|
-
debugMode?: boolean
|
|
441
|
+
debugMode?: boolean;
|
|
442
442
|
/**
|
|
443
443
|
* 是否大场景模式,初始化后不可修改
|
|
444
444
|
*/
|
|
@@ -447,29 +447,29 @@ export declare interface SplatMeshOptions {
|
|
|
447
447
|
* 是否点云模式渲染,默认为true
|
|
448
448
|
* 支持通过viewer.options()动态更新
|
|
449
449
|
*/
|
|
450
|
-
pointcloudMode?: boolean
|
|
450
|
+
pointcloudMode?: boolean;
|
|
451
451
|
/**
|
|
452
|
-
*
|
|
452
|
+
* 移动端可渲染的高斯点数量限制
|
|
453
453
|
* 支持通过viewer.options()动态更新
|
|
454
454
|
*/
|
|
455
|
-
maxRenderCountOfMobile?: number
|
|
455
|
+
maxRenderCountOfMobile?: number;
|
|
456
456
|
/**
|
|
457
|
-
* PC
|
|
457
|
+
* PC端可渲染的高斯点数量限制
|
|
458
458
|
* 支持通过viewer.options()动态更新
|
|
459
459
|
*/
|
|
460
|
-
maxRenderCountOfPc?: number
|
|
460
|
+
maxRenderCountOfPc?: number;
|
|
461
461
|
/**
|
|
462
|
-
* 颜色亮度系数,默认1.
|
|
462
|
+
* 颜色亮度系数,默认1.0
|
|
463
463
|
*/
|
|
464
|
-
lightFactor?: number
|
|
464
|
+
lightFactor?: number;
|
|
465
465
|
/**
|
|
466
|
-
*
|
|
466
|
+
* 是否显示水印,默认true
|
|
467
467
|
*/
|
|
468
|
-
showWatermark?: boolean
|
|
468
|
+
showWatermark?: boolean;
|
|
469
469
|
/**
|
|
470
|
-
*
|
|
470
|
+
* 球谐系数的渲染级别,默认0
|
|
471
471
|
*/
|
|
472
|
-
shDegree?: number
|
|
472
|
+
shDegree?: number;
|
|
473
473
|
/**
|
|
474
474
|
* 是否开启深度测试,默认true
|
|
475
475
|
*/
|
package/dist/pkg.js
CHANGED
|
@@ -1471,11 +1471,11 @@ function Yo(i) {
|
|
|
1471
1471
|
}
|
|
1472
1472
|
function Vo(i) {
|
|
1473
1473
|
const e = { ...i };
|
|
1474
|
-
return e.bigSceneMode ?? (e.bigSceneMode = !1), e.pointcloudMode ?? (e.pointcloudMode = !e.bigSceneMode), e.lightFactor ?? (e.lightFactor = 1), e.name ?? (e.name = ""), e.showWatermark ?? (e.showWatermark = !0), e;
|
|
1474
|
+
return e.bigSceneMode ?? (e.bigSceneMode = !1), e.pointcloudMode ?? (e.pointcloudMode = !e.bigSceneMode), e.lightFactor ?? (e.lightFactor = 1), e.name ?? (e.name = ""), e.showWatermark ?? (e.showWatermark = !0), e.shDegree ?? (e.shDegree = 0), e.depthTest ?? (e.depthTest = !0), e.debugMode ?? (e.debugMode = !1), e.maxRenderCountOfMobile ?? (e.maxRenderCountOfMobile = e.bigSceneMode ? 256 * 1e4 : 384 * 10240), e.maxRenderCountOfPc ?? (e.maxRenderCountOfPc = e.bigSceneMode ? 320 * 1e4 : 384 * 1e4), e;
|
|
1475
1475
|
}
|
|
1476
1476
|
function Vi(i) {
|
|
1477
1477
|
const e = { ...i };
|
|
1478
|
-
return e.position = e.position ? [...e.position] : [0, -5, 15], e.lookAt = e.lookAt ? [...e.lookAt] : [0, 0, 0], e.lookUp = e.lookUp ? [...e.lookUp] : [0, -1, 0], e.fov ?? (e.fov = 45), e.near ?? (e.near = 1e-3), e.far ?? (e.far = 1e3), e.enableDamping ?? (e.enableDamping = !0), e.autoRotate ?? (e.autoRotate = !0), e.enableZoom ?? (e.enableZoom = !0), e.enableRotate ?? (e.enableRotate = !0), e.enablePan ?? (e.enablePan = !0), e.enableKeyboard ?? (e.enableKeyboard = !0), e.bigSceneMode ?? (e.bigSceneMode = !1), e.pointcloudMode ?? (e.pointcloudMode = !e.bigSceneMode), e.lightFactor ?? (e.lightFactor = 1.1), e.
|
|
1478
|
+
return e.position = e.position ? [...e.position] : [0, -5, 15], e.lookAt = e.lookAt ? [...e.lookAt] : [0, 0, 0], e.lookUp = e.lookUp ? [...e.lookUp] : [0, -1, 0], e.fov ?? (e.fov = 45), e.near ?? (e.near = 1e-3), e.far ?? (e.far = 1e3), e.enableDamping ?? (e.enableDamping = !0), e.autoRotate ?? (e.autoRotate = !0), e.enableZoom ?? (e.enableZoom = !0), e.enableRotate ?? (e.enableRotate = !0), e.enablePan ?? (e.enablePan = !0), e.enableKeyboard ?? (e.enableKeyboard = !0), e.bigSceneMode ?? (e.bigSceneMode = !1), e.pointcloudMode ?? (e.pointcloudMode = !e.bigSceneMode), e.lightFactor ?? (e.lightFactor = 1.1), e.debugMode ?? (e.debugMode = location.protocol === "http:" || /^test\./.test(location.host)), e.markMode ?? (e.markMode = !1), e.markVisible ?? (e.markVisible = !0), e.meterScale ?? (e.meterScale = 1), e.background ?? (e.background = "#000000"), e;
|
|
1479
1479
|
}
|
|
1480
1480
|
function Go(i) {
|
|
1481
1481
|
let e;
|
|
@@ -1529,7 +1529,7 @@ class pe extends te {
|
|
|
1529
1529
|
* @param opts 高斯模型选项
|
|
1530
1530
|
* @param meta 元数据
|
|
1531
1531
|
*/
|
|
1532
|
-
async addModel(e, t) {
|
|
1532
|
+
async addModel(e, t = {}) {
|
|
1533
1533
|
this.disposed || (this.meta = t, await this.events.fire(vs, e, t));
|
|
1534
1534
|
}
|
|
1535
1535
|
fire(e, ...t) {
|
package/dist/pkg.umd.cjs
CHANGED
|
@@ -335,7 +335,7 @@
|
|
|
335
335
|
|
|
336
336
|
gl_FragColor = vec4(cycleColor.rgb, alpha * opacity);
|
|
337
337
|
}
|
|
338
|
-
`}const Ni="currentVisibleRadius",Xi="currentLightRadius",$i="realFocusPosition",gn="splatShTexture12",mn="splatShTexture3",Ki="performanceNow",Ma="waterMarkColor",Zi="showWaterMark",yn="splatTexture0",An="splatTexture1",ji="bigSceneMode",qi="lightFactor",Ji="debugEffect",ts="usingIndex",Ta="cycleColor",ka="splatIndex",es="pointMode",ns="markPoint",is="shDegree",jt="viewport",wn="opacity",ss="focal",as="topY";let z=0;z++;const os=`$${z++}`;z++,z++,z++;const rs=`$${z++}`,Ea=`$${z++}`,cs=`$${z++}`,Ia=`$${z++}`,_a=`$${z++}`,Da=`$${z++}`,Pa=`$${z++}`,La=`$${z++}`;z++;const Ra=`$${z++}`,Fa=`$${z++}`;z++;const Ba=`$${z++}`;z++;const Ua=`$${z++}`;z++;const Oa=`$${z++}`,Va=`$${z++}`,za=`$${z++}`,Qa=`$${z++}`,Ha=`$${z++}`,Wa=`$${z++}`,Ga=`$${z++}`,Ya=`$${z++}`;z++;function Na(i){let t=!1;const e=(l,f,g)=>i.on(l,f,g),n=(l,...f)=>i.fire(l,...f);let a=0,o=0;const s=[];let r=0;e(Pi,()=>r),e(Wn,async()=>{const l=new u.InstancedBufferGeometry;l.setIndex([0,1,2,0,2,3]);const f=new Float32Array(4*3),g=new u.BufferAttribute(f,3);l.setAttribute("position",g),g.setXYZ(0,-2,-2,0),g.setXYZ(1,-2,2,0),g.setXYZ(2,2,2,0),g.setXYZ(3,2,-2,0),g.needsUpdate=!0;let h=new u.InstancedBufferGeometry().copy(l);const A=await n(Vt);if(t)return;const m=new Uint32Array(A),y=new u.InstancedBufferAttribute(m,1,!1);return y.setUsage(u.DynamicDrawUsage),y.needsUpdate=!0,h.setAttribute(ka,y),h.instanceCount=0,e(Xn,(M,b,S,k)=>{n(Kn,b),m.set(M,0),y.clearUpdateRanges(),y.addUpdateRange(0,M.length),y.needsUpdate=!0,h.instanceCount=M.length,n(Y),n(nt,{sortTime:`${S} / ${Date.now()-k}`})}),e(Ls,()=>h),e(Jn,()=>{y.array=null,h.dispose()}),h}),e(Gn,async()=>{const l=await n(Vt);if(t)return;const f=1024*2,g=Math.ceil(2*l/f),h=n(_),A=new u.ShaderMaterial({uniforms:n(Hn),vertexShader:Sa(),fragmentShader:ba(),transparent:!0,alphaTest:1,blending:u.NormalBlending,depthTest:h.depthTest!==!1,depthWrite:!1,side:u.DoubleSide}),m=new Uint32Array(f*g*4);let y=new u.DataTexture(m,f,g,u.RGBAIntegerFormat,u.UnsignedIntType);y.internalFormat="RGBA32UI",y.needsUpdate=!0,A.uniforms[yn].value=y;const M=n(J)?g:1,b=new Uint32Array(f*M*4);let S=new u.DataTexture(b,f,M,u.RGBAIntegerFormat,u.UnsignedIntType);S.internalFormat="RGBA32UI",S.needsUpdate=!0,A.uniforms[An].value=S;const k=await n($t,1),x=new Uint32Array(f*k*4);let C=new u.DataTexture(x,f,k,u.RGBAIntegerFormat,u.UnsignedIntType);C.internalFormat="RGBA32UI",C.needsUpdate=!0,A.uniforms[gn].value=C;const v=await n($t,3),D=new Uint32Array(f*v*4);let I=new u.DataTexture(D,f,v,u.RGBAIntegerFormat,u.UnsignedIntType);I.internalFormat="RGBA32UI",I.needsUpdate=!0,A.uniforms[mn].value=I,A.needsUpdate=!0;let T=!1;e($n,E=>{if(!n(J)){if(T&&!E.renderSplatCount)return;T=!E.renderSplatCount}const P=E.txdata;E.txdata=null;const U=new u.DataTexture(P,f,g,u.RGBAIntegerFormat,u.UnsignedIntType);U.onUpdate=()=>{E.textureReady=!0,E.textureReadyTime=Date.now(),d(E),n(di,E.renderSplatCount)},U.internalFormat="RGBA32UI",U.needsUpdate=!0,E.index?(A.uniforms[An].value=U,S=U):(A.uniforms[yn].value=U,y=U),A.needsUpdate=!0,n(Y)}),e(_i,async E=>{if(n(J)||!E||!E.length)return;const P=new Uint32Array(f*await n($t,1)*4),U=new Uint8Array(P.buffer);for(let H=0,st=0;H<E.length;H++)U.set(E[H],st),st+=E[H].byteLength;const O=new u.DataTexture(P,f,k,u.RGBAIntegerFormat,u.UnsignedIntType);O.internalFormat="RGBA32UI",O.needsUpdate=!0,A.uniforms[gn].value=O,A.needsUpdate=!0,n(Y)}),e(Di,async E=>{if(n(J)||!E||!E.length)return;const P=new Uint32Array(f*await n($t,3)*4),U=new Uint8Array(P.buffer);for(let H=0,st=0;H<E.length;H++)U.set(E[H],st),st+=E[H].byteLength;const O=new u.DataTexture(P,f,k,u.RGBAIntegerFormat,u.UnsignedIntType);O.internalFormat="RGBA32UI",O.needsUpdate=!0,A.uniforms[mn].value=O,A.needsUpdate=!0,n(Y)}),e(Nn,()=>A),e(Le,()=>{const E=n(G),{width:P,height:U}=n(xt),O=Math.abs(E.projectionMatrix.elements[0])*.5*P,H=Math.abs(E.projectionMatrix.elements[5])*.5*U,st=n(Nn);st.uniforms[ss].value.set(O,H),st.uniformsNeedUpdate=!0,n(Y)}),e(Re,()=>{const{width:E,height:P}=n(xt);A.uniforms[jt].value.set(E,P),A.uniformsNeedUpdate=!0,n(Y)}),e(Kn,E=>{A.uniforms[ts].value=E,A.uniformsNeedUpdate=!0,n(Y)}),e(zt,E=>{const P=n(_);E===void 0&&(E=!P.pointcloudMode),A.uniforms[es].value=E?1:0,A.uniformsNeedUpdate=!0,P.pointcloudMode=E,n(Y),P.viewerEvents&&(P.viewerEvents.fire(_).pointcloudMode=E)}),e(Zn,E=>{A.uniforms[ji].value=E?1:0,A.uniformsNeedUpdate=!0;const P=n(_);P.bigSceneMode=E,n(Y)}),e(Qt,E=>{A.uniforms[qi].value=E,A.uniformsNeedUpdate=!0;const P=n(_);P.lightFactor=E,n(Y)});let R=!1;return e(jn,E=>{n(J)||R||(R=!0,A.uniforms[as].value=E,A.uniformsNeedUpdate=!0,n(Y))}),e(te,E=>{A.uniforms[Ni].value=E,A.uniformsNeedUpdate=!0,n(Y)}),e(Fe,E=>{A.uniforms[Xi].value=E,A.uniformsNeedUpdate=!0,n(Y)}),e(ee,(E,P,U,O)=>{A.uniforms[ns].value=[E,P,U,O?1:-1],A.uniformsNeedUpdate=!0,n(Y)}),e(Be,(E=!0)=>{A.uniforms[Zi].value=E?1:0,A.uniformsNeedUpdate=!0,n(Y)}),e(qn,E=>{A.uniforms[Ki].value=E,A.uniformsNeedUpdate=!0}),e(Rs,E=>{A.uniforms[Ji].value=E,A.uniformsNeedUpdate=!0}),e(Ue,async E=>{if(n(J))return;const P=await n(en);E<0&&(E=0),E>P&&(E=P),r=E,A.uniforms[is].value=E,A.uniformsNeedUpdate=!0,n(nt,{shDegree:`${E} / max ${P}`}),n(Y)}),e(ti,()=>{A.dispose(),y&&y.dispose(),S&&S.dispose(),C&&C.dispose(),I&&I.dispose()}),A}),e(Yn,async()=>{const l=new u.Mesh(await n(Wn),await n(Gn));return n(Le),n(Re),n(Zn,n(J)),n(zt,n(Ve)),l});function c(){n(Le),n(Re)}window.addEventListener("resize",c),e(oi,()=>{t=!0,window.removeEventListener("resize",c),n(Jn),n(ti)}),e(ri,async()=>{if(n(J))return;let l=.01,f=.01,g=!1,h=0;n(te,f),n(Ut,()=>{if(t||o<=f)return;f+=(o-f)*l,n(te,f);let A=n(ui);A&&!h&&(h=Date.now());let m=f/a;A&&(m>.9||Date.now()-h>2500)?(n(Ve)&&n(ze,!0),n(te,0),g=!0):A&&m>.7?l=Math.min(l*1.2,.3):A&&m>.5?l=Math.min(l*1.2,.2):m>.4&&(l=Math.min(l*1.05,.1))},()=>!t&&!g,3)}),e(ze,(l=!1)=>{if(n(J))return;for(;s.length;)s.pop().stop=!0;const f=n(_),g=a*.001;let h={currentPointMode:f.pointcloudMode,stepRate:.0015,currentLightRadius:g,stop:!1};s.push(h),n(Ut,()=>{t||(h.currentLightRadius+=a*h.stepRate,n(Fe,h.currentLightRadius),h.currentLightRadius>a?(n(zt,!h.currentPointMode),n(Fe,0),h.stop=!0,s.length===1&&s[0]===h&&s.pop(),l&&n(_)?.viewerEvents?.fire(Nt),n(_)?.viewerEvents?.fire(Ti)):h.currentLightRadius/a<.4?h.stepRate=Math.min(h.stepRate*1.02,.03):h.stepRate*=1.04)},()=>!t&&!h.stop)}),e(Hn,()=>({[yn]:{type:"t",value:null},[An]:{type:"t",value:null},[gn]:{type:"t",value:null},[mn]:{type:"t",value:null},[ss]:{type:"v2",value:new u.Vector2},[jt]:{type:"v2",value:new u.Vector2},[ts]:{type:"int",value:0},[es]:{type:"int",value:0},[Ji]:{type:"int",value:1},[ji]:{type:"int",value:0},[is]:{type:"int",value:0},[qi]:{type:"float",value:1},[as]:{type:"float",value:0},[Ni]:{type:"float",value:0},[Xi]:{type:"float",value:0},[ns]:{type:"v4",value:new u.Vector4(0,0,0,-1)},[Ki]:{type:"float",value:performance.now()},[Ma]:{type:"v4",value:new u.Vector4(1,1,0,.5)},[Zi]:{type:"int",value:1}}));const p=n(Rn);p.onmessage=l=>{const f=l.data;f[os]&&n(Xn,f[os],f[rs],f[Pa],f[Da],f[cs])},e(Ii,(l,f,g)=>{n(J)||(o=f,a=g),n($n,l)});function d(l){const f=l.xyz.slice(0);p.postMessage({[La]:!0,[Ua]:f,[Ya]:l.watermarkCount,[rs]:l.index,[Ea]:l.version,[cs]:l.renderSplatCount,[Ia]:l.visibleSplatCount,[_a]:l.modelSplatCount,[Oa]:l.minX,[Va]:l.maxX,[za]:l.minY,[Qa]:l.maxY,[Ha]:l.minZ,[Wa]:l.maxZ},[f.buffer])}}function Xa(i){const t=(a,...o)=>i.fire(a,...o),e=(a,o,s)=>i.on(a,o,s),n=new Set(ea.split(""));e(xi,async(a="",o=!0,s=!0)=>{const r=a.trim().substring(0,100);let c=await t(Pn,r),p=[];for(let b=0;b<c.length;b++){let S=[],k=c[b];for(let x=0;x<k.length;x++)S.push([(k[x]%20-10)*.02,((k[x]/20|0)-10)*.02]);p.push(S)}let d=[],l=r.split("");for(let b=0;b<l.length;b++)d[b]=n.has(l[b])?.22:.4;let f=l.length/2|0,g=d[f]/2,h=!(l.length%2),A=h?0:-g;for(let b=f-1;b>=0;b--){A-=d[b]/2;for(let S of p[b])S[0]+=A;A-=d[b]/2}g=d[f]/2,A=h?0:g;for(let b=p.length-f;b<p.length;b++){A+=d[b]/2;for(let S of p[b])S[0]+=A;A+=d[b]/2}let m=0;for(let b of p)m+=b.length;const y=new Uint8Array(m*F);let M=0;for(let b of p)for(let S of b)y.set(await ua(S[0],S[1],o,s),F*M++);return y})}function vn(i){const t=(e,n,a)=>i.on(e,n,a);t(St,e=>{e.url;const n={...e};delete n.url;const a=JSON.stringify(n,null,2);console.info(a)}),t(Pn,(e="")=>{const n="https://reall3d.com/gsfont/api/getGaussianText",a=new FormData;return a.append("text",e.substring(0,100)),a.append("ver",Ae),new Promise(o=>{fetch(n,{method:"POST",body:a}).then(s=>s.ok?s.json():{}).then(s=>s.success?o(JSON.parse(s.data)):o([])).catch(s=>o([]))})})}function $a(i){let t=!1;const e=(r,c,p)=>i.on(r,c,p),n=(r,...c)=>i.fire(r,...c);e(ei,()=>t=!0);const a=new Map,o=new Map;e(ne,()=>n(at)&&a.set(Date.now(),1)),e(ie,()=>n(at)&&n(_t,a)),e(se,()=>n(at)&&o.set(Date.now(),1)),e(ae,()=>n(at)&&n(_t,o)),e(Mt,()=>{t||(n(se),n(at)&&n(nt,{fov:n(Ot),position:n(Ct,n(bt)),lookAt:n(Ct,n(yt)),lookUp:n(Ct,n(It))}))},!0);let s=0;e(Dt,()=>{t||(n(Bn),n(at)&&(n(ne),!(s++%5)&&n(nt,{fps:n(ie),realFps:n(ae)})))},!0),e(_t,r=>{let c=[],p=Date.now(),d=0;for(const l of r.keys())p-l<=1e3?d++:c.push(l);return c.forEach(l=>r.delete(l)),Math.min(d,30)}),window.addEventListener("beforeunload",()=>n(oe))}function Ka(i){const t={...i};return t.bigSceneMode??(t.bigSceneMode=!1),t.pointcloudMode??(t.pointcloudMode=!t.bigSceneMode),t.lightFactor??(t.lightFactor=1),t.name??(t.name=""),t.showWatermark??(t.showWatermark=!0),t}function ls(i){const t={...i};return t.position=t.position?[...t.position]:[0,-5,15],t.lookAt=t.lookAt?[...t.lookAt]:[0,0,0],t.lookUp=t.lookUp?[...t.lookUp]:[0,-1,0],t.fov??(t.fov=45),t.near??(t.near=.001),t.far??(t.far=1e3),t.enableDamping??(t.enableDamping=!0),t.autoRotate??(t.autoRotate=!0),t.enableZoom??(t.enableZoom=!0),t.enableRotate??(t.enableRotate=!0),t.enablePan??(t.enablePan=!0),t.enableKeyboard??(t.enableKeyboard=!0),t.bigSceneMode??(t.bigSceneMode=!1),t.pointcloudMode??(t.pointcloudMode=!t.bigSceneMode),t.lightFactor??(t.lightFactor=1.1),t.maxRenderCountOfMobile??(t.maxRenderCountOfMobile=t.bigSceneMode?256*1e4:384*10240),t.maxRenderCountOfPc??(t.maxRenderCountOfPc=t.bigSceneMode?320*1e4:384*1e4),t.debugMode??(t.debugMode=location.protocol==="http:"||/^test\./.test(location.host)),t.markMode??(t.markMode=!1),t.markVisible??(t.markVisible=!0),t.meterScale??(t.meterScale=1),t.background??(t.background="#000000"),t}function Za(i){let t;i.root?t=typeof i.root=="string"?document.querySelector(i.root)||document.querySelector("#gsviewer"):i.root:t=document.querySelector("#gsviewer"),t||(t=document.createElement("div"),t.id="gsviewer",document.body.appendChild(t));let e=null;return i.renderer?e=i.renderer:(e=new u.WebGLRenderer({antialias:!1,stencil:!0,logarithmicDepthBuffer:!0,precision:"highp"}),e.setSize(t.clientWidth,t.clientHeight),e.setPixelRatio(Math.min(devicePixelRatio,2)),i.renderer=e),e.domElement.classList.add("gsviewer-canvas"),t.appendChild(e.domElement),e}function ja(i){let t=i.camera;if(!t){const e=i.renderer.domElement,n=e.width/e.height;let a=new u.Vector3().fromArray(i.lookUp),o=new u.Vector3().fromArray(i.lookAt),s=new u.Vector3().fromArray(i.position);t=new u.PerspectiveCamera(i.fov,n,i.near,i.far),t.position.copy(s),t.up.copy(a).normalize(),t.lookAt(o),i.camera=t}return i.camera}function qa(i){const{renderer:t,scene:e}=i,n={renderer:t,scene:e};return n.viewerEvents=i.viewerEvents,n.debugMode=i.debugMode,n.renderer=i.renderer,n.scene=i.scene,n.controls=i.controls,n.bigSceneMode=i.bigSceneMode,n.pointcloudMode=i.pointcloudMode,n.maxRenderCountOfMobile=i.maxRenderCountOfMobile,n.maxRenderCountOfPc=i.maxRenderCountOfPc,n.lightFactor=i.lightFactor,n.shDegree=i.shDegree,n}function Ja(i){const t=(s,r,c)=>i.on(s,r,c),e=(s,...r)=>i.fire(s,...r),n="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2xldCBpPTA7aSsrO2NvbnN0IEQ9YCQke2krK31gO2krKyxpKyssaSsrO2NvbnN0IFc9YCQke2krK31gLHA9YCQke2krK31gLFM9YCQke2krK31gLHk9YCQke2krK31gLEM9YCQke2krK31gLEE9YCQke2krK31gLFI9YCQke2krK31gLEc9YCQke2krK31gO2krKztjb25zdCBIPWAkJHtpKyt9YCxKPWAkJHtpKyt9YDtpKys7Y29uc3QgVD1gJCR7aSsrfWA7aSsrO2NvbnN0IEs9YCQke2krK31gO2krKztjb25zdCBMPWAkJHtpKyt9YCxOPWAkJHtpKyt9YCxPPWAkJHtpKyt9YCxRPWAkJHtpKyt9YCxfPWAkJHtpKyt9YCxWPWAkJHtpKyt9YCxqPWAkJHtpKyt9YCxQPWAkJHtpKyt9YDtpKys7Y29uc3Qgbm49bmF2aWdhdG9yLnVzZXJBZ2VudC5pbmNsdWRlcygiTW9iaSIpLGI9c2VsZjtsZXQgWD17aW5kZXg6MCx2ZXJzaW9uOjB9LFk9e2luZGV4OjEsdmVyc2lvbjowfSx3PSExLFo7Y29uc3QgdG49LjI7bGV0IGssZj1bXSxNLHo9MCxCO2Z1bmN0aW9uIGFuKG4pe2lmKCF3KXJldHVybjtsZXQgYT1YLnZlcnNpb24+WS52ZXJzaW9uP1g6WTtpZighYS52ZXJzaW9uKXJldHVybjtjb25zdHt4eXo6dCxyZW5kZXJTcGxhdENvdW50Om8sdmlzaWJsZVNwbGF0Q291bnQ6bSxtb2RlbFNwbGF0Q291bnQ6RSx3YXRlcm1hcmtDb3VudDp4LGluZGV4OkYsdmVyc2lvbjp1fT1hO2lmKHo9PT11JiZNYXRoLmFicyhmWzJdLW5bMl0pK01hdGguYWJzKGZbNl0tbls2XSkrTWF0aC5hYnMoZlsxMF0tblsxMF0pK01hdGguYWJzKGZbMTRdLW5bMTRdKTx0bilyZXR1cm47Zj1uLHo9dTtsZXQgST1EYXRlLm5vdygpLGw7aWYoIW8pe2w9bmV3IFVpbnQzMkFycmF5KDApLGIucG9zdE1lc3NhZ2Uoe1tEXTpsLFtTXTpvLFt5XTptLFtDXTpFLFtXXTpGLFtwXTp1LFtSXTowLFtBXTpJfSxbbC5idWZmZXJdKTtyZXR1cm59bGV0IHE9MDtjb25zdCByPW8teDtsPW5ldyBVaW50MzJBcnJheShvKTtjb25zdHttYXhEZXB0aDp2LG1pbkRlcHRoOmR9PWVuKGEsayk7aWYodi1kPD0xZS01KWZvcihsZXQgcz0wO3M8bztzKyspbFtzXT1zO2Vsc2V7bGV0IHM9TWF0aC5taW4ociw2NTUzNSksZz0ocy0xKS8odi1kKSxjPW5ldyBJbnQzMkFycmF5KHMpO2ZvcihsZXQgZT0wLGg9MDtlPHI7ZSsrKWg9KCQobix0WzMqZV0sdFszKmUrMV0sdFszKmUrMl0pLWQpKmd8MCxjW01bZV09aF0rKztmb3IobGV0IGU9MTtlPHM7ZSsrKWNbZV0rPWNbZS0xXTtmb3IobGV0IGU9MDtlPHI7ZSsrKWxbLS1jW01bZV1dXT1lO2lmKHgpe3M9TWF0aC5taW4oTWF0aC5tYXgoeC84fDAsNTEyKSw2NTUzNSksZz0ocy0xKS8odi1kKSxjPW5ldyBJbnQzMkFycmF5KHMpO2ZvcihsZXQgZT1yLGg9MDtlPG87ZSsrKWg9KCQobix0WzMqZV0sdFszKmUrMV0sdFszKmUrMl0pLWQpKmd8MCxjW01bZS1yXT1oXSsrO2ZvcihsZXQgZT0xO2U8cztlKyspY1tlXSs9Y1tlLTFdO2ZvcihsZXQgZT0wO2U8eDtlKyspbFtyKy0tY1tNW2VdXV09citlfX1xPURhdGUubm93KCktSSxiLnBvc3RNZXNzYWdlKHtbRF06bCxbU106byxbeV06bSxbQ106RSxbV106RixbcF06dSxbQV06SSxbUl06cX0sW2wuYnVmZmVyXSl9ZnVuY3Rpb24gJChuLGEsdCxvKXtyZXR1cm4tKG5bMl0qYStuWzZdKnQrblsxMF0qbyl9ZnVuY3Rpb24gZW4obixhKXtsZXQgdD0tMS8wLG89MS8wLG09MDtyZXR1cm4gbT0kKGEsbi5taW5YLG4ubWluWSxuLm1pblopLHQ9TWF0aC5tYXgodCxtKSxvPU1hdGgubWluKG8sbSksbT0kKGEsbi5taW5YLG4ubWluWSxuLm1heFopLHQ9TWF0aC5tYXgodCxtKSxvPU1hdGgubWluKG8sbSksbT0kKGEsbi5taW5YLG4ubWF4WSxuLm1pblopLHQ9TWF0aC5tYXgodCxtKSxvPU1hdGgubWluKG8sbSksbT0kKGEsbi5taW5YLG4ubWF4WSxuLm1heFopLHQ9TWF0aC5tYXgodCxtKSxvPU1hdGgubWluKG8sbSksbT0kKGEsbi5tYXhYLG4ubWluWSxuLm1pblopLHQ9TWF0aC5tYXgodCxtKSxvPU1hdGgubWluKG8sbSksbT0kKGEsbi5tYXhYLG4ubWluWSxuLm1heFopLHQ9TWF0aC5tYXgodCxtKSxvPU1hdGgubWluKG8sbSksbT0kKGEsbi5tYXhYLG4ubWF4WSxuLm1pblopLHQ9TWF0aC5tYXgodCxtKSxvPU1hdGgubWluKG8sbSksbT0kKGEsbi5tYXhYLG4ubWF4WSxuLm1heFopLHQ9TWF0aC5tYXgodCxtKSxvPU1hdGgubWluKG8sbSkse21heERlcHRoOnQsbWluRGVwdGg6b319Y29uc3QgVT0oKT0+e2lmKCFaKXtaPSEwO2NvbnN0IG49azthbihuKSxzZXRUaW1lb3V0KCgpPT4hKFo9ITEpJiZuIT09ayYmVSgpKX19O2Iub25tZXNzYWdlPW49Pntjb25zdCBhPW4uZGF0YTtpZihhW0ddKXtsZXQgdD0hQnx8YVtXXT09PTA/WDpZO3QubWluWD1hW0xdLHQubWF4WD1hW05dLHQubWluWT1hW09dLHQubWF4WT1hW1FdLHQubWluWj1hW19dLHQubWF4Wj1hW1ZdLHQueHl6PW5ldyBGbG9hdDMyQXJyYXkoYVtLXS5idWZmZXIpLHQud2F0ZXJtYXJrQ291bnQ9YVtQXSx0LnZlcnNpb249YVtwXSx0LnJlbmRlclNwbGF0Q291bnQ9YVtTXSx0LnZpc2libGVTcGxhdENvdW50PWFbeV0sdC5tb2RlbFNwbGF0Q291bnQ9YVtDXSx0LnRleHR1cmVSZWFkeT0hMCx0LnRleHR1cmVSZWFkeVRpbWU9RGF0ZS5ub3coKX1lbHNlIGFbVF0/KGs9YVtUXSxVKCkpOmFbal0mJihCPWFbSF0sTT1uZXcgSW50MzJBcnJheShhW0pdKSx3PSEwKX19KSgpOwo=",a=URL.createObjectURL(new Blob([atob(n)],{type:"text/javascript"})),o=new Worker(new URL(a,typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Te&&Te.tagName.toUpperCase()==="SCRIPT"&&Te.src||new URL("pkg.umd.cjs",document.baseURI).href),{type:"module"});t(Rn,()=>o),t(Vn,()=>o.postMessage({[Ba]:e(On)})),t(zn,()=>o.terminate()),(async()=>o.postMessage({[Ga]:!0,[Fa]:await e(Vt),[Ra]:e(J)}))()}class ct extends u.Mesh{constructor(t){super(),this.isSplatMesh=!0,this.disposed=!1;const e=new on,n=(r,c,p)=>e.on(r,c,p),a=(r,...c)=>e.fire(r,...c),o=Ka(t),s=o.controls.object;n(_,()=>o),n(Et,()=>o.renderer.domElement),n(G,()=>s),n(Ot,()=>s.fov),n(bt,(r=!1)=>r?s.position.clone():s.position),n(yt,(r=!1)=>r?o.controls.target.clone():o.controls.target),n(On,()=>s.projectionMatrix.clone().multiply(s.matrixWorldInverse).multiply(this.matrix).toArray()),n(_s,()=>s.projectionMatrix.clone().multiply(s.matrixWorldInverse)),n(Ns,()=>s.getWorldDirection(new u.Vector3).toArray()),n(Ht,()=>o.renderer),n(B,()=>o.scene),n(J,()=>o.bigSceneMode),n(Ve,()=>o.pointcloudMode),n(mt,()=>this),n(Y,()=>o.viewerEvents?.fire(K)),pn(e),vn(e),va(e),Ja(e),Na(e),Xa(e),this.name=`${o.name||this.id}`,this.events=e,this.opts=o,(async()=>(this.copy(await e.fire(Yn)),o.matrix&&this.applyMatrix4(o.matrix),this.frustumCulled=!1,this.onBeforeRender=()=>{a(Vn),a(qn,performance.now())},this.onAfterRender=()=>{a(si,1e4)&&a(Y)}))()}options(t){if(this.disposed)return;const e=(a,...o)=>this.events.fire(a,...o),n=this.opts;return t&&(t.pointcloudMode!==void 0&&e(zt,t.pointcloudMode),t.lightFactor!==void 0&&e(Qt,t.lightFactor),t.maxRenderCountOfMobile!==void 0&&(n.maxRenderCountOfMobile=t.maxRenderCountOfMobile),t.maxRenderCountOfPc!==void 0&&(n.maxRenderCountOfPc=t.maxRenderCountOfPc),e(Y)),{...n}}async addModel(t,e){this.disposed||(this.meta=e,await this.events.fire(ii,t,e))}fire(t,...e){if(!this.disposed)return this.events.fire(t,...e)}dispose(){if(this.disposed)return;this.disposed=!0;const t=(e,...n)=>this.events.fire(e,...n);t(vt,this),t(B).remove(this),t(Oe),t(ai),t(zn),t(oi),this.events.clear(),this.events=null,this.opts=null,this.onAfterRender=null}}class to extends u.Object3D{constructor(t=new u.Vector3(0,0,1),e=new u.Vector3(0,0,0),n=1,a=.1,o=16776960,s=n*.2,r=s*.2){super(),this._axis=new u.Vector3,this.type="ArrowHelper";const c=new u.CylinderGeometry(a,a,n,32);c.translate(0,n/2,0);const p=new u.CylinderGeometry(0,r,s,32);p.translate(0,n,0),this.position.copy(e);const d=new u.MeshBasicMaterial({color:o,toneMapped:!1});d.side=u.DoubleSide,this.line=new u.Mesh(c,d),this.line.matrixAutoUpdate=!1,this.line.ignoreIntersect=!0,this.add(this.line);const l=new u.MeshBasicMaterial({color:o,toneMapped:!1});l.side=u.DoubleSide,this.cone=new u.Mesh(p,l),this.cone.matrixAutoUpdate=!1,this.cone.ignoreIntersect=!0,this.add(this.cone),this.setDirection(t),this.renderOrder=99999}setDirection(t){if(t.y>.99999)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{this._axis.set(t.z,0,-t.x).normalize();const e=Math.acos(t.y);this.quaternion.setFromAxisAngle(this._axis,e)}}setColor(t){this.line.material.color.set(t),this.cone.material.color.set(t)}copy(t){return super.copy(t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}function eo(i){const t=(A,m,y)=>i.on(A,m,y),e=(A,...m)=>i.fire(A,...m),n=new u.PlaneGeometry(1,1);n.rotateX(-Math.PI/2);const a=new u.MeshBasicMaterial({color:16777215});a.transparent=!0,a.opacity=.6,a.depthTest=!1,a.depthWrite=!1,a.side=u.DoubleSide;const o=new u.Mesh(n,a);o.ignoreIntersect=!0;const s=new u.Vector3(0,-1,0);s.normalize();const r=new u.Vector3(0,0,0),c=.5,p=.01,d=16777062,l=.1,f=.03,g=new to(s,r,c,p,d,l,f),h=new u.Object3D;h.add(o),h.add(g),h.renderOrder=99999,o.renderOrder=99999,h.visible=!1,e(B).add(h),t(Vs,()=>h),t(de,A=>{e(ue,!0),h.visible=A===void 0?!h.visible:A,e(K)}),t(Ye,()=>h.visible),t(ue,(A=!1)=>{if(A||h.visible){const m=new u.Quaternion,y=new u.Vector3(0,-1,0);m.setFromUnitVectors(y,e(It)),h.position.copy(e(yt)),h.quaternion.copy(m)}})}const ds={type:"change"},Sn={type:"start"},us={type:"end"},be=new u.Ray,ps=new u.Plane,no=Math.cos(70*u.MathUtils.DEG2RAD),X=new u.Vector3,it=2*Math.PI,Q={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},bn=1e-6;class fs extends u.Controls{constructor(t,e=null){super(t,e),this.state=Q.NONE,this.enabled=!0,this.target=new u.Vector3,this.cursor=new u.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:u.MOUSE.ROTATE,MIDDLE:u.MOUSE.DOLLY,RIGHT:u.MOUSE.PAN},this.touches={ONE:u.TOUCH.ROTATE,TWO:u.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new u.Vector3,this._lastQuaternion=new u.Quaternion,this._lastTargetPosition=new u.Vector3,this._quat=new u.Quaternion().setFromUnitVectors(t.up,new u.Vector3(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new u.Spherical,this._sphericalDelta=new u.Spherical,this._scale=1,this._panOffset=new u.Vector3,this._rotateStart=new u.Vector2,this._rotateEnd=new u.Vector2,this._rotateDelta=new u.Vector2,this._panStart=new u.Vector2,this._panEnd=new u.Vector2,this._panDelta=new u.Vector2,this._dollyStart=new u.Vector2,this._dollyEnd=new u.Vector2,this._dollyDelta=new u.Vector2,this._dollyDirection=new u.Vector3,this._mouse=new u.Vector2,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=so.bind(this),this._onPointerDown=io.bind(this),this._onPointerUp=ao.bind(this),this._onContextMenu=fo.bind(this),this._onMouseWheel=co.bind(this),this._onKeyDown=lo.bind(this),this._onTouchStart=uo.bind(this),this._onTouchMove=po.bind(this),this._onMouseDown=oo.bind(this),this._onMouseMove=ro.bind(this),this._interceptControlDown=ho.bind(this),this._interceptControlUp=go.bind(this),this.domElement!==null&&this.connect(),this.update()}connect(){this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerUp),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener("keydown",this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(t){t.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=t}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(ds),this.update(),this.state=Q.NONE}update(t=null){const e=this.object.position;X.copy(e).sub(this.target),X.applyQuaternion(this._quat),this._spherical.setFromVector3(X),this.autoRotate&&this.state===Q.NONE&&this._rotateLeft(this._getAutoRotationAngle(t)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let n=this.minAzimuthAngle,a=this.maxAzimuthAngle;isFinite(n)&&isFinite(a)&&(n<-Math.PI?n+=it:n>Math.PI&&(n-=it),a<-Math.PI?a+=it:a>Math.PI&&(a-=it),n<=a?this._spherical.theta=Math.max(n,Math.min(a,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(n+a)/2?Math.max(n,this._spherical.theta):Math.min(a,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let o=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const s=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),o=s!=this._spherical.radius}if(X.setFromSpherical(this._spherical),X.applyQuaternion(this._quatInverse),e.copy(this.target).add(X),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let s=null;if(this.object.isPerspectiveCamera){const r=X.length();s=this._clampDistance(r*this._scale);const c=r-s;this.object.position.addScaledVector(this._dollyDirection,c),this.object.updateMatrixWorld(),o=!!c}else if(this.object.isOrthographicCamera){const r=new u.Vector3(this._mouse.x,this._mouse.y,0);r.unproject(this.object);const c=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),o=c!==this.object.zoom;const p=new u.Vector3(this._mouse.x,this._mouse.y,0);p.unproject(this.object),this.object.position.sub(p).add(r),this.object.updateMatrixWorld(),s=X.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;s!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(s).add(this.object.position):(be.origin.copy(this.object.position),be.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(be.direction))<no?this.object.lookAt(this.target):(ps.setFromNormalAndCoplanarPoint(this.object.up,this.target),be.intersectPlane(ps,this.target))))}else if(this.object.isOrthographicCamera){const s=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),s!==this.object.zoom&&(this.object.updateProjectionMatrix(),o=!0)}return this._scale=1,this._performCursorZoom=!1,o||this._lastPosition.distanceToSquared(this.object.position)>bn||8*(1-this._lastQuaternion.dot(this.object.quaternion))>bn||this._lastTargetPosition.distanceToSquared(this.target)>bn?(this.dispatchEvent(ds),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(t){return t!==null?it/60*this.autoRotateSpeed*t:it/60/60*this.autoRotateSpeed}_getZoomScale(t){const e=Math.abs(t*.01);return Math.pow(.95,this.zoomSpeed*e)}_rotateLeft(t){this._sphericalDelta.theta-=t}_rotateUp(t){this._sphericalDelta.phi-=t}_panLeft(t,e){X.setFromMatrixColumn(e,0),X.multiplyScalar(-t),this._panOffset.add(X)}_panUp(t,e){this.screenSpacePanning===!0?X.setFromMatrixColumn(e,1):(X.setFromMatrixColumn(e,0),X.crossVectors(this.object.up,X)),X.multiplyScalar(t),this._panOffset.add(X)}_pan(t,e){const n=this.domElement;if(this.object.isPerspectiveCamera){const a=this.object.position;X.copy(a).sub(this.target);let o=X.length();o*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*t*o/n.clientHeight,this.object.matrix),this._panUp(2*e*o/n.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(t*(this.object.right-this.object.left)/this.object.zoom/n.clientWidth,this.object.matrix),this._panUp(e*(this.object.top-this.object.bottom)/this.object.zoom/n.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(t,e){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const n=this.domElement.getBoundingClientRect(),a=t-n.left,o=e-n.top,s=n.width,r=n.height;this._mouse.x=a/s*2-1,this._mouse.y=-(o/r)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(t){return Math.max(this.minDistance,Math.min(this.maxDistance,t))}_handleMouseDownRotate(t){this._rotateStart.set(t.clientX,t.clientY)}_handleMouseDownDolly(t){this._updateZoomParameters(t.clientX,t.clientX),this._dollyStart.set(t.clientX,t.clientY)}_handleMouseDownPan(t){this._panStart.set(t.clientX,t.clientY)}_handleMouseMoveRotate(t){this._rotateEnd.set(t.clientX,t.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(it*this._rotateDelta.x/e.clientHeight),this._rotateUp(it*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(t){this._dollyEnd.set(t.clientX,t.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(t){this._panEnd.set(t.clientX,t.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(t){this._updateZoomParameters(t.clientX,t.clientY),t.deltaY<0?this._dollyIn(this._getZoomScale(t.deltaY)):t.deltaY>0&&this._dollyOut(this._getZoomScale(t.deltaY)),this.update()}_handleKeyDown(t){let e=!1;switch(t.code){case this.keys.UP:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(it*this.rotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),e=!0;break;case this.keys.BOTTOM:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(-it*this.rotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),e=!0;break;case this.keys.LEFT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(it*this.rotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),e=!0;break;case this.keys.RIGHT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(-it*this.rotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),e=!0;break}e&&(t.preventDefault(),this.update())}_handleTouchStartRotate(t){if(this._pointers.length===1)this._rotateStart.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),n=.5*(t.pageX+e.x),a=.5*(t.pageY+e.y);this._rotateStart.set(n,a)}}_handleTouchStartPan(t){if(this._pointers.length===1)this._panStart.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),n=.5*(t.pageX+e.x),a=.5*(t.pageY+e.y);this._panStart.set(n,a)}}_handleTouchStartDolly(t){const e=this._getSecondPointerPosition(t),n=t.pageX-e.x,a=t.pageY-e.y,o=Math.sqrt(n*n+a*a);this._dollyStart.set(0,o)}_handleTouchStartDollyPan(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enablePan&&this._handleTouchStartPan(t)}_handleTouchStartDollyRotate(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enableRotate&&this._handleTouchStartRotate(t)}_handleTouchMoveRotate(t){if(this._pointers.length==1)this._rotateEnd.set(t.pageX,t.pageY);else{const n=this._getSecondPointerPosition(t),a=.5*(t.pageX+n.x),o=.5*(t.pageY+n.y);this._rotateEnd.set(a,o)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(it*this._rotateDelta.x/e.clientHeight),this._rotateUp(it*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(t){if(this._pointers.length===1)this._panEnd.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),n=.5*(t.pageX+e.x),a=.5*(t.pageY+e.y);this._panEnd.set(n,a)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(t){const e=this._getSecondPointerPosition(t),n=t.pageX-e.x,a=t.pageY-e.y,o=Math.sqrt(n*n+a*a);this._dollyEnd.set(0,o),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const s=(t.pageX+e.x)*.5,r=(t.pageY+e.y)*.5;this._updateZoomParameters(s,r)}_handleTouchMoveDollyPan(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enablePan&&this._handleTouchMovePan(t)}_handleTouchMoveDollyRotate(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enableRotate&&this._handleTouchMoveRotate(t)}_addPointer(t){this._pointers.push(t.pointerId)}_removePointer(t){delete this._pointerPositions[t.pointerId];for(let e=0;e<this._pointers.length;e++)if(this._pointers[e]==t.pointerId){this._pointers.splice(e,1);return}}_isTrackingPointer(t){for(let e=0;e<this._pointers.length;e++)if(this._pointers[e]==t.pointerId)return!0;return!1}_trackPointer(t){let e=this._pointerPositions[t.pointerId];e===void 0&&(e=new u.Vector2,this._pointerPositions[t.pointerId]=e),e.set(t.pageX,t.pageY)}_getSecondPointerPosition(t){const e=t.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[e]}_customWheelEvent(t){const e=t.deltaMode,n={clientX:t.clientX,clientY:t.clientY,deltaY:t.deltaY};switch(e){case 1:n.deltaY*=16;break;case 2:n.deltaY*=100;break}return t.ctrlKey&&!this._controlActive&&(n.deltaY*=10),n}}function io(i){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(i.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerup",this._onPointerUp)),!this._isTrackingPointer(i)&&(this._addPointer(i),i.pointerType==="touch"?this._onTouchStart(i):this._onMouseDown(i)))}function so(i){this.enabled!==!1&&(i.pointerType==="touch"?this._onTouchMove(i):this._onMouseMove(i))}function ao(i){switch(this._removePointer(i),this._pointers.length){case 0:this.domElement.releasePointerCapture(i.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(us),this.state=Q.NONE;break;case 1:const t=this._pointers[0],e=this._pointerPositions[t];this._onTouchStart({pointerId:t,pageX:e.x,pageY:e.y});break}}function oo(i){let t;switch(i.button){case 0:t=this.mouseButtons.LEFT;break;case 1:t=this.mouseButtons.MIDDLE;break;case 2:t=this.mouseButtons.RIGHT;break;default:t=-1}switch(t){case u.MOUSE.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(i),this.state=Q.DOLLY;break;case u.MOUSE.ROTATE:if(i.ctrlKey||i.metaKey||i.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(i),this.state=Q.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(i),this.state=Q.ROTATE}break;case u.MOUSE.PAN:if(i.ctrlKey||i.metaKey||i.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(i),this.state=Q.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(i),this.state=Q.PAN}break;default:this.state=Q.NONE}this.state!==Q.NONE&&this.dispatchEvent(Sn)}function ro(i){switch(this.state){case Q.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(i);break;case Q.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(i);break;case Q.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(i);break}}function co(i){this.enabled===!1||this.enableZoom===!1||this.state!==Q.NONE||(i.preventDefault(),this.dispatchEvent(Sn),this._handleMouseWheel(this._customWheelEvent(i)),this.dispatchEvent(us))}function lo(i){this.enabled!==!1&&this._handleKeyDown(i)}function uo(i){switch(this._trackPointer(i),this._pointers.length){case 1:switch(this.touches.ONE){case u.TOUCH.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(i),this.state=Q.TOUCH_ROTATE;break;case u.TOUCH.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(i),this.state=Q.TOUCH_PAN;break;default:this.state=Q.NONE}break;case 2:switch(this.touches.TWO){case u.TOUCH.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(i),this.state=Q.TOUCH_DOLLY_PAN;break;case u.TOUCH.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(i),this.state=Q.TOUCH_DOLLY_ROTATE;break;default:this.state=Q.NONE}break;default:this.state=Q.NONE}this.state!==Q.NONE&&this.dispatchEvent(Sn)}function po(i){switch(this._trackPointer(i),this.state){case Q.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(i),this.update();break;case Q.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(i),this.update();break;case Q.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(i),this.update();break;case Q.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(i),this.update();break;default:this.state=Q.NONE}}function fo(i){this.enabled!==!1&&i.preventDefault()}function ho(i){i.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function go(i){i.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}class mo extends fs{constructor(t){const e=t.camera;super(e,t.renderer.domElement);const n=this;n.dampingFactor=.1,n.rotateSpeed=.4,n.updateByOptions(t)}updateByOptions(t={}){const e=this;t.enableDamping!==void 0&&(e.enableDamping=t.enableDamping),t.autoRotate!==void 0&&(e.autoRotate=t.autoRotate),t.enableZoom!==void 0&&(e.enableZoom=t.enableZoom),t.enableRotate!==void 0&&(e.enableRotate=t.enableRotate),t.enablePan!==void 0&&(e.enablePan=t.enablePan),t.minDistance!==void 0&&(e.minDistance=t.minDistance),t.maxDistance!==void 0&&(e.maxDistance=t.maxDistance),t.minPolarAngle!==void 0&&(e.minPolarAngle=t.minPolarAngle),t.maxPolarAngle!==void 0&&(e.maxPolarAngle=t.maxPolarAngle),t.fov!==void 0&&(e.object.fov=t.fov),t.near!==void 0&&(e.object.near=t.near),t.far!==void 0&&(e.object.far=t.far),t.position&&e.object.position.fromArray(t.position),t.lookAt&&e.target.fromArray(t.lookAt),t.lookUp&&e.object.up.fromArray(t.lookUp),rt&&e._dollyOut?.(.75),e.updateRotateAxis(),e.update()}updateRotateAxis(){this._quat?.setFromUnitVectors?.(this.object.up,new u.Vector3(0,1,0)),this._quatInverse=this._quat?.clone?.()?.invert?.()}}class yo extends fs{constructor(t,e){super(t,e),this.screenSpacePanning=!1,this.mouseButtons={LEFT:u.MOUSE.PAN,MIDDLE:u.MOUSE.DOLLY,RIGHT:u.MOUSE.ROTATE},this.touches={ONE:u.TOUCH.PAN,TWO:u.TOUCH.DOLLY_ROTATE}}}const hs=new u.Box3,xe=new u.Vector3;class gs extends u.InstancedBufferGeometry{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const t=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],e=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],n=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(n),this.setAttribute("position",new u.Float32BufferAttribute(t,3)),this.setAttribute("uv",new u.Float32BufferAttribute(e,2))}applyMatrix4(t){const e=this.attributes.instanceStart,n=this.attributes.instanceEnd;return e!==void 0&&(e.applyMatrix4(t),n.applyMatrix4(t),e.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(t){let e;t instanceof Float32Array?e=t:Array.isArray(t)&&(e=new Float32Array(t));const n=new u.InstancedInterleavedBuffer(e,6,1);return this.setAttribute("instanceStart",new u.InterleavedBufferAttribute(n,3,0)),this.setAttribute("instanceEnd",new u.InterleavedBufferAttribute(n,3,3)),this.instanceCount=this.attributes.instanceStart.count,this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(t){let e;t instanceof Float32Array?e=t:Array.isArray(t)&&(e=new Float32Array(t));const n=new u.InstancedInterleavedBuffer(e,6,1);return this.setAttribute("instanceColorStart",new u.InterleavedBufferAttribute(n,3,0)),this.setAttribute("instanceColorEnd",new u.InterleavedBufferAttribute(n,3,3)),this}fromWireframeGeometry(t){return this.setPositions(t.attributes.position.array),this}fromEdgesGeometry(t){return this.setPositions(t.attributes.position.array),this}fromMesh(t){return this.fromWireframeGeometry(new u.WireframeGeometry(t.geometry)),this}fromLineSegments(t){const e=t.geometry;return this.setPositions(e.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new u.Box3);const t=this.attributes.instanceStart,e=this.attributes.instanceEnd;t!==void 0&&e!==void 0&&(this.boundingBox.setFromBufferAttribute(t),hs.setFromBufferAttribute(e),this.boundingBox.union(hs))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new u.Sphere),this.boundingBox===null&&this.computeBoundingBox();const t=this.attributes.instanceStart,e=this.attributes.instanceEnd;if(t!==void 0&&e!==void 0){const n=this.boundingSphere.center;this.boundingBox.getCenter(n);let a=0;for(let o=0,s=t.count;o<s;o++)xe.fromBufferAttribute(t,o),a=Math.max(a,n.distanceToSquared(xe)),xe.fromBufferAttribute(e,o),a=Math.max(a,n.distanceToSquared(xe));this.boundingSphere.radius=Math.sqrt(a),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(t){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(t)}}u.UniformsLib.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new u.Vector2(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}},u.ShaderLib.line={uniforms:u.UniformsUtils.merge([u.UniformsLib.common,u.UniformsLib.fog,u.UniformsLib.line]),vertexShader:`
|
|
338
|
+
`}const Ni="currentVisibleRadius",Xi="currentLightRadius",$i="realFocusPosition",gn="splatShTexture12",mn="splatShTexture3",Ki="performanceNow",Ma="waterMarkColor",Zi="showWaterMark",yn="splatTexture0",An="splatTexture1",ji="bigSceneMode",qi="lightFactor",Ji="debugEffect",ts="usingIndex",Ta="cycleColor",ka="splatIndex",es="pointMode",ns="markPoint",is="shDegree",jt="viewport",wn="opacity",ss="focal",as="topY";let z=0;z++;const os=`$${z++}`;z++,z++,z++;const rs=`$${z++}`,Ea=`$${z++}`,cs=`$${z++}`,Ia=`$${z++}`,_a=`$${z++}`,Da=`$${z++}`,Pa=`$${z++}`,La=`$${z++}`;z++;const Ra=`$${z++}`,Fa=`$${z++}`;z++;const Ba=`$${z++}`;z++;const Ua=`$${z++}`;z++;const Oa=`$${z++}`,Va=`$${z++}`,za=`$${z++}`,Qa=`$${z++}`,Ha=`$${z++}`,Wa=`$${z++}`,Ga=`$${z++}`,Ya=`$${z++}`;z++;function Na(i){let t=!1;const e=(l,f,g)=>i.on(l,f,g),n=(l,...f)=>i.fire(l,...f);let a=0,o=0;const s=[];let r=0;e(Pi,()=>r),e(Wn,async()=>{const l=new u.InstancedBufferGeometry;l.setIndex([0,1,2,0,2,3]);const f=new Float32Array(4*3),g=new u.BufferAttribute(f,3);l.setAttribute("position",g),g.setXYZ(0,-2,-2,0),g.setXYZ(1,-2,2,0),g.setXYZ(2,2,2,0),g.setXYZ(3,2,-2,0),g.needsUpdate=!0;let h=new u.InstancedBufferGeometry().copy(l);const A=await n(Vt);if(t)return;const m=new Uint32Array(A),y=new u.InstancedBufferAttribute(m,1,!1);return y.setUsage(u.DynamicDrawUsage),y.needsUpdate=!0,h.setAttribute(ka,y),h.instanceCount=0,e(Xn,(M,b,S,k)=>{n(Kn,b),m.set(M,0),y.clearUpdateRanges(),y.addUpdateRange(0,M.length),y.needsUpdate=!0,h.instanceCount=M.length,n(Y),n(nt,{sortTime:`${S} / ${Date.now()-k}`})}),e(Ls,()=>h),e(Jn,()=>{y.array=null,h.dispose()}),h}),e(Gn,async()=>{const l=await n(Vt);if(t)return;const f=1024*2,g=Math.ceil(2*l/f),h=n(_),A=new u.ShaderMaterial({uniforms:n(Hn),vertexShader:Sa(),fragmentShader:ba(),transparent:!0,alphaTest:1,blending:u.NormalBlending,depthTest:h.depthTest!==!1,depthWrite:!1,side:u.DoubleSide}),m=new Uint32Array(f*g*4);let y=new u.DataTexture(m,f,g,u.RGBAIntegerFormat,u.UnsignedIntType);y.internalFormat="RGBA32UI",y.needsUpdate=!0,A.uniforms[yn].value=y;const M=n(J)?g:1,b=new Uint32Array(f*M*4);let S=new u.DataTexture(b,f,M,u.RGBAIntegerFormat,u.UnsignedIntType);S.internalFormat="RGBA32UI",S.needsUpdate=!0,A.uniforms[An].value=S;const k=await n($t,1),x=new Uint32Array(f*k*4);let C=new u.DataTexture(x,f,k,u.RGBAIntegerFormat,u.UnsignedIntType);C.internalFormat="RGBA32UI",C.needsUpdate=!0,A.uniforms[gn].value=C;const v=await n($t,3),D=new Uint32Array(f*v*4);let I=new u.DataTexture(D,f,v,u.RGBAIntegerFormat,u.UnsignedIntType);I.internalFormat="RGBA32UI",I.needsUpdate=!0,A.uniforms[mn].value=I,A.needsUpdate=!0;let T=!1;e($n,E=>{if(!n(J)){if(T&&!E.renderSplatCount)return;T=!E.renderSplatCount}const P=E.txdata;E.txdata=null;const U=new u.DataTexture(P,f,g,u.RGBAIntegerFormat,u.UnsignedIntType);U.onUpdate=()=>{E.textureReady=!0,E.textureReadyTime=Date.now(),d(E),n(di,E.renderSplatCount)},U.internalFormat="RGBA32UI",U.needsUpdate=!0,E.index?(A.uniforms[An].value=U,S=U):(A.uniforms[yn].value=U,y=U),A.needsUpdate=!0,n(Y)}),e(_i,async E=>{if(n(J)||!E||!E.length)return;const P=new Uint32Array(f*await n($t,1)*4),U=new Uint8Array(P.buffer);for(let H=0,st=0;H<E.length;H++)U.set(E[H],st),st+=E[H].byteLength;const O=new u.DataTexture(P,f,k,u.RGBAIntegerFormat,u.UnsignedIntType);O.internalFormat="RGBA32UI",O.needsUpdate=!0,A.uniforms[gn].value=O,A.needsUpdate=!0,n(Y)}),e(Di,async E=>{if(n(J)||!E||!E.length)return;const P=new Uint32Array(f*await n($t,3)*4),U=new Uint8Array(P.buffer);for(let H=0,st=0;H<E.length;H++)U.set(E[H],st),st+=E[H].byteLength;const O=new u.DataTexture(P,f,k,u.RGBAIntegerFormat,u.UnsignedIntType);O.internalFormat="RGBA32UI",O.needsUpdate=!0,A.uniforms[mn].value=O,A.needsUpdate=!0,n(Y)}),e(Nn,()=>A),e(Le,()=>{const E=n(G),{width:P,height:U}=n(xt),O=Math.abs(E.projectionMatrix.elements[0])*.5*P,H=Math.abs(E.projectionMatrix.elements[5])*.5*U,st=n(Nn);st.uniforms[ss].value.set(O,H),st.uniformsNeedUpdate=!0,n(Y)}),e(Re,()=>{const{width:E,height:P}=n(xt);A.uniforms[jt].value.set(E,P),A.uniformsNeedUpdate=!0,n(Y)}),e(Kn,E=>{A.uniforms[ts].value=E,A.uniformsNeedUpdate=!0,n(Y)}),e(zt,E=>{const P=n(_);E===void 0&&(E=!P.pointcloudMode),A.uniforms[es].value=E?1:0,A.uniformsNeedUpdate=!0,P.pointcloudMode=E,n(Y),P.viewerEvents&&(P.viewerEvents.fire(_).pointcloudMode=E)}),e(Zn,E=>{A.uniforms[ji].value=E?1:0,A.uniformsNeedUpdate=!0;const P=n(_);P.bigSceneMode=E,n(Y)}),e(Qt,E=>{A.uniforms[qi].value=E,A.uniformsNeedUpdate=!0;const P=n(_);P.lightFactor=E,n(Y)});let R=!1;return e(jn,E=>{n(J)||R||(R=!0,A.uniforms[as].value=E,A.uniformsNeedUpdate=!0,n(Y))}),e(te,E=>{A.uniforms[Ni].value=E,A.uniformsNeedUpdate=!0,n(Y)}),e(Fe,E=>{A.uniforms[Xi].value=E,A.uniformsNeedUpdate=!0,n(Y)}),e(ee,(E,P,U,O)=>{A.uniforms[ns].value=[E,P,U,O?1:-1],A.uniformsNeedUpdate=!0,n(Y)}),e(Be,(E=!0)=>{A.uniforms[Zi].value=E?1:0,A.uniformsNeedUpdate=!0,n(Y)}),e(qn,E=>{A.uniforms[Ki].value=E,A.uniformsNeedUpdate=!0}),e(Rs,E=>{A.uniforms[Ji].value=E,A.uniformsNeedUpdate=!0}),e(Ue,async E=>{if(n(J))return;const P=await n(en);E<0&&(E=0),E>P&&(E=P),r=E,A.uniforms[is].value=E,A.uniformsNeedUpdate=!0,n(nt,{shDegree:`${E} / max ${P}`}),n(Y)}),e(ti,()=>{A.dispose(),y&&y.dispose(),S&&S.dispose(),C&&C.dispose(),I&&I.dispose()}),A}),e(Yn,async()=>{const l=new u.Mesh(await n(Wn),await n(Gn));return n(Le),n(Re),n(Zn,n(J)),n(zt,n(Ve)),l});function c(){n(Le),n(Re)}window.addEventListener("resize",c),e(oi,()=>{t=!0,window.removeEventListener("resize",c),n(Jn),n(ti)}),e(ri,async()=>{if(n(J))return;let l=.01,f=.01,g=!1,h=0;n(te,f),n(Ut,()=>{if(t||o<=f)return;f+=(o-f)*l,n(te,f);let A=n(ui);A&&!h&&(h=Date.now());let m=f/a;A&&(m>.9||Date.now()-h>2500)?(n(Ve)&&n(ze,!0),n(te,0),g=!0):A&&m>.7?l=Math.min(l*1.2,.3):A&&m>.5?l=Math.min(l*1.2,.2):m>.4&&(l=Math.min(l*1.05,.1))},()=>!t&&!g,3)}),e(ze,(l=!1)=>{if(n(J))return;for(;s.length;)s.pop().stop=!0;const f=n(_),g=a*.001;let h={currentPointMode:f.pointcloudMode,stepRate:.0015,currentLightRadius:g,stop:!1};s.push(h),n(Ut,()=>{t||(h.currentLightRadius+=a*h.stepRate,n(Fe,h.currentLightRadius),h.currentLightRadius>a?(n(zt,!h.currentPointMode),n(Fe,0),h.stop=!0,s.length===1&&s[0]===h&&s.pop(),l&&n(_)?.viewerEvents?.fire(Nt),n(_)?.viewerEvents?.fire(Ti)):h.currentLightRadius/a<.4?h.stepRate=Math.min(h.stepRate*1.02,.03):h.stepRate*=1.04)},()=>!t&&!h.stop)}),e(Hn,()=>({[yn]:{type:"t",value:null},[An]:{type:"t",value:null},[gn]:{type:"t",value:null},[mn]:{type:"t",value:null},[ss]:{type:"v2",value:new u.Vector2},[jt]:{type:"v2",value:new u.Vector2},[ts]:{type:"int",value:0},[es]:{type:"int",value:0},[Ji]:{type:"int",value:1},[ji]:{type:"int",value:0},[is]:{type:"int",value:0},[qi]:{type:"float",value:1},[as]:{type:"float",value:0},[Ni]:{type:"float",value:0},[Xi]:{type:"float",value:0},[ns]:{type:"v4",value:new u.Vector4(0,0,0,-1)},[Ki]:{type:"float",value:performance.now()},[Ma]:{type:"v4",value:new u.Vector4(1,1,0,.5)},[Zi]:{type:"int",value:1}}));const p=n(Rn);p.onmessage=l=>{const f=l.data;f[os]&&n(Xn,f[os],f[rs],f[Pa],f[Da],f[cs])},e(Ii,(l,f,g)=>{n(J)||(o=f,a=g),n($n,l)});function d(l){const f=l.xyz.slice(0);p.postMessage({[La]:!0,[Ua]:f,[Ya]:l.watermarkCount,[rs]:l.index,[Ea]:l.version,[cs]:l.renderSplatCount,[Ia]:l.visibleSplatCount,[_a]:l.modelSplatCount,[Oa]:l.minX,[Va]:l.maxX,[za]:l.minY,[Qa]:l.maxY,[Ha]:l.minZ,[Wa]:l.maxZ},[f.buffer])}}function Xa(i){const t=(a,...o)=>i.fire(a,...o),e=(a,o,s)=>i.on(a,o,s),n=new Set(ea.split(""));e(xi,async(a="",o=!0,s=!0)=>{const r=a.trim().substring(0,100);let c=await t(Pn,r),p=[];for(let b=0;b<c.length;b++){let S=[],k=c[b];for(let x=0;x<k.length;x++)S.push([(k[x]%20-10)*.02,((k[x]/20|0)-10)*.02]);p.push(S)}let d=[],l=r.split("");for(let b=0;b<l.length;b++)d[b]=n.has(l[b])?.22:.4;let f=l.length/2|0,g=d[f]/2,h=!(l.length%2),A=h?0:-g;for(let b=f-1;b>=0;b--){A-=d[b]/2;for(let S of p[b])S[0]+=A;A-=d[b]/2}g=d[f]/2,A=h?0:g;for(let b=p.length-f;b<p.length;b++){A+=d[b]/2;for(let S of p[b])S[0]+=A;A+=d[b]/2}let m=0;for(let b of p)m+=b.length;const y=new Uint8Array(m*F);let M=0;for(let b of p)for(let S of b)y.set(await ua(S[0],S[1],o,s),F*M++);return y})}function vn(i){const t=(e,n,a)=>i.on(e,n,a);t(St,e=>{e.url;const n={...e};delete n.url;const a=JSON.stringify(n,null,2);console.info(a)}),t(Pn,(e="")=>{const n="https://reall3d.com/gsfont/api/getGaussianText",a=new FormData;return a.append("text",e.substring(0,100)),a.append("ver",Ae),new Promise(o=>{fetch(n,{method:"POST",body:a}).then(s=>s.ok?s.json():{}).then(s=>s.success?o(JSON.parse(s.data)):o([])).catch(s=>o([]))})})}function $a(i){let t=!1;const e=(r,c,p)=>i.on(r,c,p),n=(r,...c)=>i.fire(r,...c);e(ei,()=>t=!0);const a=new Map,o=new Map;e(ne,()=>n(at)&&a.set(Date.now(),1)),e(ie,()=>n(at)&&n(_t,a)),e(se,()=>n(at)&&o.set(Date.now(),1)),e(ae,()=>n(at)&&n(_t,o)),e(Mt,()=>{t||(n(se),n(at)&&n(nt,{fov:n(Ot),position:n(Ct,n(bt)),lookAt:n(Ct,n(yt)),lookUp:n(Ct,n(It))}))},!0);let s=0;e(Dt,()=>{t||(n(Bn),n(at)&&(n(ne),!(s++%5)&&n(nt,{fps:n(ie),realFps:n(ae)})))},!0),e(_t,r=>{let c=[],p=Date.now(),d=0;for(const l of r.keys())p-l<=1e3?d++:c.push(l);return c.forEach(l=>r.delete(l)),Math.min(d,30)}),window.addEventListener("beforeunload",()=>n(oe))}function Ka(i){const t={...i};return t.bigSceneMode??(t.bigSceneMode=!1),t.pointcloudMode??(t.pointcloudMode=!t.bigSceneMode),t.lightFactor??(t.lightFactor=1),t.name??(t.name=""),t.showWatermark??(t.showWatermark=!0),t.shDegree??(t.shDegree=0),t.depthTest??(t.depthTest=!0),t.debugMode??(t.debugMode=!1),t.maxRenderCountOfMobile??(t.maxRenderCountOfMobile=t.bigSceneMode?256*1e4:384*10240),t.maxRenderCountOfPc??(t.maxRenderCountOfPc=t.bigSceneMode?320*1e4:384*1e4),t}function ls(i){const t={...i};return t.position=t.position?[...t.position]:[0,-5,15],t.lookAt=t.lookAt?[...t.lookAt]:[0,0,0],t.lookUp=t.lookUp?[...t.lookUp]:[0,-1,0],t.fov??(t.fov=45),t.near??(t.near=.001),t.far??(t.far=1e3),t.enableDamping??(t.enableDamping=!0),t.autoRotate??(t.autoRotate=!0),t.enableZoom??(t.enableZoom=!0),t.enableRotate??(t.enableRotate=!0),t.enablePan??(t.enablePan=!0),t.enableKeyboard??(t.enableKeyboard=!0),t.bigSceneMode??(t.bigSceneMode=!1),t.pointcloudMode??(t.pointcloudMode=!t.bigSceneMode),t.lightFactor??(t.lightFactor=1.1),t.debugMode??(t.debugMode=location.protocol==="http:"||/^test\./.test(location.host)),t.markMode??(t.markMode=!1),t.markVisible??(t.markVisible=!0),t.meterScale??(t.meterScale=1),t.background??(t.background="#000000"),t}function Za(i){let t;i.root?t=typeof i.root=="string"?document.querySelector(i.root)||document.querySelector("#gsviewer"):i.root:t=document.querySelector("#gsviewer"),t||(t=document.createElement("div"),t.id="gsviewer",document.body.appendChild(t));let e=null;return i.renderer?e=i.renderer:(e=new u.WebGLRenderer({antialias:!1,stencil:!0,logarithmicDepthBuffer:!0,precision:"highp"}),e.setSize(t.clientWidth,t.clientHeight),e.setPixelRatio(Math.min(devicePixelRatio,2)),i.renderer=e),e.domElement.classList.add("gsviewer-canvas"),t.appendChild(e.domElement),e}function ja(i){let t=i.camera;if(!t){const e=i.renderer.domElement,n=e.width/e.height;let a=new u.Vector3().fromArray(i.lookUp),o=new u.Vector3().fromArray(i.lookAt),s=new u.Vector3().fromArray(i.position);t=new u.PerspectiveCamera(i.fov,n,i.near,i.far),t.position.copy(s),t.up.copy(a).normalize(),t.lookAt(o),i.camera=t}return i.camera}function qa(i){const{renderer:t,scene:e}=i,n={renderer:t,scene:e};return n.viewerEvents=i.viewerEvents,n.debugMode=i.debugMode,n.renderer=i.renderer,n.scene=i.scene,n.controls=i.controls,n.bigSceneMode=i.bigSceneMode,n.pointcloudMode=i.pointcloudMode,n.maxRenderCountOfMobile=i.maxRenderCountOfMobile,n.maxRenderCountOfPc=i.maxRenderCountOfPc,n.lightFactor=i.lightFactor,n.shDegree=i.shDegree,n}function Ja(i){const t=(s,r,c)=>i.on(s,r,c),e=(s,...r)=>i.fire(s,...r),n="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2xldCBpPTA7aSsrO2NvbnN0IEQ9YCQke2krK31gO2krKyxpKyssaSsrO2NvbnN0IFc9YCQke2krK31gLHA9YCQke2krK31gLFM9YCQke2krK31gLHk9YCQke2krK31gLEM9YCQke2krK31gLEE9YCQke2krK31gLFI9YCQke2krK31gLEc9YCQke2krK31gO2krKztjb25zdCBIPWAkJHtpKyt9YCxKPWAkJHtpKyt9YDtpKys7Y29uc3QgVD1gJCR7aSsrfWA7aSsrO2NvbnN0IEs9YCQke2krK31gO2krKztjb25zdCBMPWAkJHtpKyt9YCxOPWAkJHtpKyt9YCxPPWAkJHtpKyt9YCxRPWAkJHtpKyt9YCxfPWAkJHtpKyt9YCxWPWAkJHtpKyt9YCxqPWAkJHtpKyt9YCxQPWAkJHtpKyt9YDtpKys7Y29uc3Qgbm49bmF2aWdhdG9yLnVzZXJBZ2VudC5pbmNsdWRlcygiTW9iaSIpLGI9c2VsZjtsZXQgWD17aW5kZXg6MCx2ZXJzaW9uOjB9LFk9e2luZGV4OjEsdmVyc2lvbjowfSx3PSExLFo7Y29uc3QgdG49LjI7bGV0IGssZj1bXSxNLHo9MCxCO2Z1bmN0aW9uIGFuKG4pe2lmKCF3KXJldHVybjtsZXQgYT1YLnZlcnNpb24+WS52ZXJzaW9uP1g6WTtpZighYS52ZXJzaW9uKXJldHVybjtjb25zdHt4eXo6dCxyZW5kZXJTcGxhdENvdW50Om8sdmlzaWJsZVNwbGF0Q291bnQ6bSxtb2RlbFNwbGF0Q291bnQ6RSx3YXRlcm1hcmtDb3VudDp4LGluZGV4OkYsdmVyc2lvbjp1fT1hO2lmKHo9PT11JiZNYXRoLmFicyhmWzJdLW5bMl0pK01hdGguYWJzKGZbNl0tbls2XSkrTWF0aC5hYnMoZlsxMF0tblsxMF0pK01hdGguYWJzKGZbMTRdLW5bMTRdKTx0bilyZXR1cm47Zj1uLHo9dTtsZXQgST1EYXRlLm5vdygpLGw7aWYoIW8pe2w9bmV3IFVpbnQzMkFycmF5KDApLGIucG9zdE1lc3NhZ2Uoe1tEXTpsLFtTXTpvLFt5XTptLFtDXTpFLFtXXTpGLFtwXTp1LFtSXTowLFtBXTpJfSxbbC5idWZmZXJdKTtyZXR1cm59bGV0IHE9MDtjb25zdCByPW8teDtsPW5ldyBVaW50MzJBcnJheShvKTtjb25zdHttYXhEZXB0aDp2LG1pbkRlcHRoOmR9PWVuKGEsayk7aWYodi1kPD0xZS01KWZvcihsZXQgcz0wO3M8bztzKyspbFtzXT1zO2Vsc2V7bGV0IHM9TWF0aC5taW4ociw2NTUzNSksZz0ocy0xKS8odi1kKSxjPW5ldyBJbnQzMkFycmF5KHMpO2ZvcihsZXQgZT0wLGg9MDtlPHI7ZSsrKWg9KCQobix0WzMqZV0sdFszKmUrMV0sdFszKmUrMl0pLWQpKmd8MCxjW01bZV09aF0rKztmb3IobGV0IGU9MTtlPHM7ZSsrKWNbZV0rPWNbZS0xXTtmb3IobGV0IGU9MDtlPHI7ZSsrKWxbLS1jW01bZV1dXT1lO2lmKHgpe3M9TWF0aC5taW4oTWF0aC5tYXgoeC84fDAsNTEyKSw2NTUzNSksZz0ocy0xKS8odi1kKSxjPW5ldyBJbnQzMkFycmF5KHMpO2ZvcihsZXQgZT1yLGg9MDtlPG87ZSsrKWg9KCQobix0WzMqZV0sdFszKmUrMV0sdFszKmUrMl0pLWQpKmd8MCxjW01bZS1yXT1oXSsrO2ZvcihsZXQgZT0xO2U8cztlKyspY1tlXSs9Y1tlLTFdO2ZvcihsZXQgZT0wO2U8eDtlKyspbFtyKy0tY1tNW2VdXV09citlfX1xPURhdGUubm93KCktSSxiLnBvc3RNZXNzYWdlKHtbRF06bCxbU106byxbeV06bSxbQ106RSxbV106RixbcF06dSxbQV06SSxbUl06cX0sW2wuYnVmZmVyXSl9ZnVuY3Rpb24gJChuLGEsdCxvKXtyZXR1cm4tKG5bMl0qYStuWzZdKnQrblsxMF0qbyl9ZnVuY3Rpb24gZW4obixhKXtsZXQgdD0tMS8wLG89MS8wLG09MDtyZXR1cm4gbT0kKGEsbi5taW5YLG4ubWluWSxuLm1pblopLHQ9TWF0aC5tYXgodCxtKSxvPU1hdGgubWluKG8sbSksbT0kKGEsbi5taW5YLG4ubWluWSxuLm1heFopLHQ9TWF0aC5tYXgodCxtKSxvPU1hdGgubWluKG8sbSksbT0kKGEsbi5taW5YLG4ubWF4WSxuLm1pblopLHQ9TWF0aC5tYXgodCxtKSxvPU1hdGgubWluKG8sbSksbT0kKGEsbi5taW5YLG4ubWF4WSxuLm1heFopLHQ9TWF0aC5tYXgodCxtKSxvPU1hdGgubWluKG8sbSksbT0kKGEsbi5tYXhYLG4ubWluWSxuLm1pblopLHQ9TWF0aC5tYXgodCxtKSxvPU1hdGgubWluKG8sbSksbT0kKGEsbi5tYXhYLG4ubWluWSxuLm1heFopLHQ9TWF0aC5tYXgodCxtKSxvPU1hdGgubWluKG8sbSksbT0kKGEsbi5tYXhYLG4ubWF4WSxuLm1pblopLHQ9TWF0aC5tYXgodCxtKSxvPU1hdGgubWluKG8sbSksbT0kKGEsbi5tYXhYLG4ubWF4WSxuLm1heFopLHQ9TWF0aC5tYXgodCxtKSxvPU1hdGgubWluKG8sbSkse21heERlcHRoOnQsbWluRGVwdGg6b319Y29uc3QgVT0oKT0+e2lmKCFaKXtaPSEwO2NvbnN0IG49azthbihuKSxzZXRUaW1lb3V0KCgpPT4hKFo9ITEpJiZuIT09ayYmVSgpKX19O2Iub25tZXNzYWdlPW49Pntjb25zdCBhPW4uZGF0YTtpZihhW0ddKXtsZXQgdD0hQnx8YVtXXT09PTA/WDpZO3QubWluWD1hW0xdLHQubWF4WD1hW05dLHQubWluWT1hW09dLHQubWF4WT1hW1FdLHQubWluWj1hW19dLHQubWF4Wj1hW1ZdLHQueHl6PW5ldyBGbG9hdDMyQXJyYXkoYVtLXS5idWZmZXIpLHQud2F0ZXJtYXJrQ291bnQ9YVtQXSx0LnZlcnNpb249YVtwXSx0LnJlbmRlclNwbGF0Q291bnQ9YVtTXSx0LnZpc2libGVTcGxhdENvdW50PWFbeV0sdC5tb2RlbFNwbGF0Q291bnQ9YVtDXSx0LnRleHR1cmVSZWFkeT0hMCx0LnRleHR1cmVSZWFkeVRpbWU9RGF0ZS5ub3coKX1lbHNlIGFbVF0/KGs9YVtUXSxVKCkpOmFbal0mJihCPWFbSF0sTT1uZXcgSW50MzJBcnJheShhW0pdKSx3PSEwKX19KSgpOwo=",a=URL.createObjectURL(new Blob([atob(n)],{type:"text/javascript"})),o=new Worker(new URL(a,typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Te&&Te.tagName.toUpperCase()==="SCRIPT"&&Te.src||new URL("pkg.umd.cjs",document.baseURI).href),{type:"module"});t(Rn,()=>o),t(Vn,()=>o.postMessage({[Ba]:e(On)})),t(zn,()=>o.terminate()),(async()=>o.postMessage({[Ga]:!0,[Fa]:await e(Vt),[Ra]:e(J)}))()}class ct extends u.Mesh{constructor(t){super(),this.isSplatMesh=!0,this.disposed=!1;const e=new on,n=(r,c,p)=>e.on(r,c,p),a=(r,...c)=>e.fire(r,...c),o=Ka(t),s=o.controls.object;n(_,()=>o),n(Et,()=>o.renderer.domElement),n(G,()=>s),n(Ot,()=>s.fov),n(bt,(r=!1)=>r?s.position.clone():s.position),n(yt,(r=!1)=>r?o.controls.target.clone():o.controls.target),n(On,()=>s.projectionMatrix.clone().multiply(s.matrixWorldInverse).multiply(this.matrix).toArray()),n(_s,()=>s.projectionMatrix.clone().multiply(s.matrixWorldInverse)),n(Ns,()=>s.getWorldDirection(new u.Vector3).toArray()),n(Ht,()=>o.renderer),n(B,()=>o.scene),n(J,()=>o.bigSceneMode),n(Ve,()=>o.pointcloudMode),n(mt,()=>this),n(Y,()=>o.viewerEvents?.fire(K)),pn(e),vn(e),va(e),Ja(e),Na(e),Xa(e),this.name=`${o.name||this.id}`,this.events=e,this.opts=o,(async()=>(this.copy(await e.fire(Yn)),o.matrix&&this.applyMatrix4(o.matrix),this.frustumCulled=!1,this.onBeforeRender=()=>{a(Vn),a(qn,performance.now())},this.onAfterRender=()=>{a(si,1e4)&&a(Y)}))()}options(t){if(this.disposed)return;const e=(a,...o)=>this.events.fire(a,...o),n=this.opts;return t&&(t.pointcloudMode!==void 0&&e(zt,t.pointcloudMode),t.lightFactor!==void 0&&e(Qt,t.lightFactor),t.maxRenderCountOfMobile!==void 0&&(n.maxRenderCountOfMobile=t.maxRenderCountOfMobile),t.maxRenderCountOfPc!==void 0&&(n.maxRenderCountOfPc=t.maxRenderCountOfPc),e(Y)),{...n}}async addModel(t,e={}){this.disposed||(this.meta=e,await this.events.fire(ii,t,e))}fire(t,...e){if(!this.disposed)return this.events.fire(t,...e)}dispose(){if(this.disposed)return;this.disposed=!0;const t=(e,...n)=>this.events.fire(e,...n);t(vt,this),t(B).remove(this),t(Oe),t(ai),t(zn),t(oi),this.events.clear(),this.events=null,this.opts=null,this.onAfterRender=null}}class to extends u.Object3D{constructor(t=new u.Vector3(0,0,1),e=new u.Vector3(0,0,0),n=1,a=.1,o=16776960,s=n*.2,r=s*.2){super(),this._axis=new u.Vector3,this.type="ArrowHelper";const c=new u.CylinderGeometry(a,a,n,32);c.translate(0,n/2,0);const p=new u.CylinderGeometry(0,r,s,32);p.translate(0,n,0),this.position.copy(e);const d=new u.MeshBasicMaterial({color:o,toneMapped:!1});d.side=u.DoubleSide,this.line=new u.Mesh(c,d),this.line.matrixAutoUpdate=!1,this.line.ignoreIntersect=!0,this.add(this.line);const l=new u.MeshBasicMaterial({color:o,toneMapped:!1});l.side=u.DoubleSide,this.cone=new u.Mesh(p,l),this.cone.matrixAutoUpdate=!1,this.cone.ignoreIntersect=!0,this.add(this.cone),this.setDirection(t),this.renderOrder=99999}setDirection(t){if(t.y>.99999)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{this._axis.set(t.z,0,-t.x).normalize();const e=Math.acos(t.y);this.quaternion.setFromAxisAngle(this._axis,e)}}setColor(t){this.line.material.color.set(t),this.cone.material.color.set(t)}copy(t){return super.copy(t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}function eo(i){const t=(A,m,y)=>i.on(A,m,y),e=(A,...m)=>i.fire(A,...m),n=new u.PlaneGeometry(1,1);n.rotateX(-Math.PI/2);const a=new u.MeshBasicMaterial({color:16777215});a.transparent=!0,a.opacity=.6,a.depthTest=!1,a.depthWrite=!1,a.side=u.DoubleSide;const o=new u.Mesh(n,a);o.ignoreIntersect=!0;const s=new u.Vector3(0,-1,0);s.normalize();const r=new u.Vector3(0,0,0),c=.5,p=.01,d=16777062,l=.1,f=.03,g=new to(s,r,c,p,d,l,f),h=new u.Object3D;h.add(o),h.add(g),h.renderOrder=99999,o.renderOrder=99999,h.visible=!1,e(B).add(h),t(Vs,()=>h),t(de,A=>{e(ue,!0),h.visible=A===void 0?!h.visible:A,e(K)}),t(Ye,()=>h.visible),t(ue,(A=!1)=>{if(A||h.visible){const m=new u.Quaternion,y=new u.Vector3(0,-1,0);m.setFromUnitVectors(y,e(It)),h.position.copy(e(yt)),h.quaternion.copy(m)}})}const ds={type:"change"},Sn={type:"start"},us={type:"end"},be=new u.Ray,ps=new u.Plane,no=Math.cos(70*u.MathUtils.DEG2RAD),X=new u.Vector3,it=2*Math.PI,Q={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},bn=1e-6;class fs extends u.Controls{constructor(t,e=null){super(t,e),this.state=Q.NONE,this.enabled=!0,this.target=new u.Vector3,this.cursor=new u.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:u.MOUSE.ROTATE,MIDDLE:u.MOUSE.DOLLY,RIGHT:u.MOUSE.PAN},this.touches={ONE:u.TOUCH.ROTATE,TWO:u.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new u.Vector3,this._lastQuaternion=new u.Quaternion,this._lastTargetPosition=new u.Vector3,this._quat=new u.Quaternion().setFromUnitVectors(t.up,new u.Vector3(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new u.Spherical,this._sphericalDelta=new u.Spherical,this._scale=1,this._panOffset=new u.Vector3,this._rotateStart=new u.Vector2,this._rotateEnd=new u.Vector2,this._rotateDelta=new u.Vector2,this._panStart=new u.Vector2,this._panEnd=new u.Vector2,this._panDelta=new u.Vector2,this._dollyStart=new u.Vector2,this._dollyEnd=new u.Vector2,this._dollyDelta=new u.Vector2,this._dollyDirection=new u.Vector3,this._mouse=new u.Vector2,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=so.bind(this),this._onPointerDown=io.bind(this),this._onPointerUp=ao.bind(this),this._onContextMenu=fo.bind(this),this._onMouseWheel=co.bind(this),this._onKeyDown=lo.bind(this),this._onTouchStart=uo.bind(this),this._onTouchMove=po.bind(this),this._onMouseDown=oo.bind(this),this._onMouseMove=ro.bind(this),this._interceptControlDown=ho.bind(this),this._interceptControlUp=go.bind(this),this.domElement!==null&&this.connect(),this.update()}connect(){this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerUp),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener("keydown",this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(t){t.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=t}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(ds),this.update(),this.state=Q.NONE}update(t=null){const e=this.object.position;X.copy(e).sub(this.target),X.applyQuaternion(this._quat),this._spherical.setFromVector3(X),this.autoRotate&&this.state===Q.NONE&&this._rotateLeft(this._getAutoRotationAngle(t)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let n=this.minAzimuthAngle,a=this.maxAzimuthAngle;isFinite(n)&&isFinite(a)&&(n<-Math.PI?n+=it:n>Math.PI&&(n-=it),a<-Math.PI?a+=it:a>Math.PI&&(a-=it),n<=a?this._spherical.theta=Math.max(n,Math.min(a,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(n+a)/2?Math.max(n,this._spherical.theta):Math.min(a,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let o=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const s=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),o=s!=this._spherical.radius}if(X.setFromSpherical(this._spherical),X.applyQuaternion(this._quatInverse),e.copy(this.target).add(X),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let s=null;if(this.object.isPerspectiveCamera){const r=X.length();s=this._clampDistance(r*this._scale);const c=r-s;this.object.position.addScaledVector(this._dollyDirection,c),this.object.updateMatrixWorld(),o=!!c}else if(this.object.isOrthographicCamera){const r=new u.Vector3(this._mouse.x,this._mouse.y,0);r.unproject(this.object);const c=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),o=c!==this.object.zoom;const p=new u.Vector3(this._mouse.x,this._mouse.y,0);p.unproject(this.object),this.object.position.sub(p).add(r),this.object.updateMatrixWorld(),s=X.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;s!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(s).add(this.object.position):(be.origin.copy(this.object.position),be.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(be.direction))<no?this.object.lookAt(this.target):(ps.setFromNormalAndCoplanarPoint(this.object.up,this.target),be.intersectPlane(ps,this.target))))}else if(this.object.isOrthographicCamera){const s=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),s!==this.object.zoom&&(this.object.updateProjectionMatrix(),o=!0)}return this._scale=1,this._performCursorZoom=!1,o||this._lastPosition.distanceToSquared(this.object.position)>bn||8*(1-this._lastQuaternion.dot(this.object.quaternion))>bn||this._lastTargetPosition.distanceToSquared(this.target)>bn?(this.dispatchEvent(ds),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(t){return t!==null?it/60*this.autoRotateSpeed*t:it/60/60*this.autoRotateSpeed}_getZoomScale(t){const e=Math.abs(t*.01);return Math.pow(.95,this.zoomSpeed*e)}_rotateLeft(t){this._sphericalDelta.theta-=t}_rotateUp(t){this._sphericalDelta.phi-=t}_panLeft(t,e){X.setFromMatrixColumn(e,0),X.multiplyScalar(-t),this._panOffset.add(X)}_panUp(t,e){this.screenSpacePanning===!0?X.setFromMatrixColumn(e,1):(X.setFromMatrixColumn(e,0),X.crossVectors(this.object.up,X)),X.multiplyScalar(t),this._panOffset.add(X)}_pan(t,e){const n=this.domElement;if(this.object.isPerspectiveCamera){const a=this.object.position;X.copy(a).sub(this.target);let o=X.length();o*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*t*o/n.clientHeight,this.object.matrix),this._panUp(2*e*o/n.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(t*(this.object.right-this.object.left)/this.object.zoom/n.clientWidth,this.object.matrix),this._panUp(e*(this.object.top-this.object.bottom)/this.object.zoom/n.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(t,e){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const n=this.domElement.getBoundingClientRect(),a=t-n.left,o=e-n.top,s=n.width,r=n.height;this._mouse.x=a/s*2-1,this._mouse.y=-(o/r)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(t){return Math.max(this.minDistance,Math.min(this.maxDistance,t))}_handleMouseDownRotate(t){this._rotateStart.set(t.clientX,t.clientY)}_handleMouseDownDolly(t){this._updateZoomParameters(t.clientX,t.clientX),this._dollyStart.set(t.clientX,t.clientY)}_handleMouseDownPan(t){this._panStart.set(t.clientX,t.clientY)}_handleMouseMoveRotate(t){this._rotateEnd.set(t.clientX,t.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(it*this._rotateDelta.x/e.clientHeight),this._rotateUp(it*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(t){this._dollyEnd.set(t.clientX,t.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(t){this._panEnd.set(t.clientX,t.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(t){this._updateZoomParameters(t.clientX,t.clientY),t.deltaY<0?this._dollyIn(this._getZoomScale(t.deltaY)):t.deltaY>0&&this._dollyOut(this._getZoomScale(t.deltaY)),this.update()}_handleKeyDown(t){let e=!1;switch(t.code){case this.keys.UP:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(it*this.rotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),e=!0;break;case this.keys.BOTTOM:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(-it*this.rotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),e=!0;break;case this.keys.LEFT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(it*this.rotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),e=!0;break;case this.keys.RIGHT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(-it*this.rotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),e=!0;break}e&&(t.preventDefault(),this.update())}_handleTouchStartRotate(t){if(this._pointers.length===1)this._rotateStart.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),n=.5*(t.pageX+e.x),a=.5*(t.pageY+e.y);this._rotateStart.set(n,a)}}_handleTouchStartPan(t){if(this._pointers.length===1)this._panStart.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),n=.5*(t.pageX+e.x),a=.5*(t.pageY+e.y);this._panStart.set(n,a)}}_handleTouchStartDolly(t){const e=this._getSecondPointerPosition(t),n=t.pageX-e.x,a=t.pageY-e.y,o=Math.sqrt(n*n+a*a);this._dollyStart.set(0,o)}_handleTouchStartDollyPan(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enablePan&&this._handleTouchStartPan(t)}_handleTouchStartDollyRotate(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enableRotate&&this._handleTouchStartRotate(t)}_handleTouchMoveRotate(t){if(this._pointers.length==1)this._rotateEnd.set(t.pageX,t.pageY);else{const n=this._getSecondPointerPosition(t),a=.5*(t.pageX+n.x),o=.5*(t.pageY+n.y);this._rotateEnd.set(a,o)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(it*this._rotateDelta.x/e.clientHeight),this._rotateUp(it*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(t){if(this._pointers.length===1)this._panEnd.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),n=.5*(t.pageX+e.x),a=.5*(t.pageY+e.y);this._panEnd.set(n,a)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(t){const e=this._getSecondPointerPosition(t),n=t.pageX-e.x,a=t.pageY-e.y,o=Math.sqrt(n*n+a*a);this._dollyEnd.set(0,o),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const s=(t.pageX+e.x)*.5,r=(t.pageY+e.y)*.5;this._updateZoomParameters(s,r)}_handleTouchMoveDollyPan(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enablePan&&this._handleTouchMovePan(t)}_handleTouchMoveDollyRotate(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enableRotate&&this._handleTouchMoveRotate(t)}_addPointer(t){this._pointers.push(t.pointerId)}_removePointer(t){delete this._pointerPositions[t.pointerId];for(let e=0;e<this._pointers.length;e++)if(this._pointers[e]==t.pointerId){this._pointers.splice(e,1);return}}_isTrackingPointer(t){for(let e=0;e<this._pointers.length;e++)if(this._pointers[e]==t.pointerId)return!0;return!1}_trackPointer(t){let e=this._pointerPositions[t.pointerId];e===void 0&&(e=new u.Vector2,this._pointerPositions[t.pointerId]=e),e.set(t.pageX,t.pageY)}_getSecondPointerPosition(t){const e=t.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[e]}_customWheelEvent(t){const e=t.deltaMode,n={clientX:t.clientX,clientY:t.clientY,deltaY:t.deltaY};switch(e){case 1:n.deltaY*=16;break;case 2:n.deltaY*=100;break}return t.ctrlKey&&!this._controlActive&&(n.deltaY*=10),n}}function io(i){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(i.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerup",this._onPointerUp)),!this._isTrackingPointer(i)&&(this._addPointer(i),i.pointerType==="touch"?this._onTouchStart(i):this._onMouseDown(i)))}function so(i){this.enabled!==!1&&(i.pointerType==="touch"?this._onTouchMove(i):this._onMouseMove(i))}function ao(i){switch(this._removePointer(i),this._pointers.length){case 0:this.domElement.releasePointerCapture(i.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(us),this.state=Q.NONE;break;case 1:const t=this._pointers[0],e=this._pointerPositions[t];this._onTouchStart({pointerId:t,pageX:e.x,pageY:e.y});break}}function oo(i){let t;switch(i.button){case 0:t=this.mouseButtons.LEFT;break;case 1:t=this.mouseButtons.MIDDLE;break;case 2:t=this.mouseButtons.RIGHT;break;default:t=-1}switch(t){case u.MOUSE.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(i),this.state=Q.DOLLY;break;case u.MOUSE.ROTATE:if(i.ctrlKey||i.metaKey||i.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(i),this.state=Q.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(i),this.state=Q.ROTATE}break;case u.MOUSE.PAN:if(i.ctrlKey||i.metaKey||i.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(i),this.state=Q.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(i),this.state=Q.PAN}break;default:this.state=Q.NONE}this.state!==Q.NONE&&this.dispatchEvent(Sn)}function ro(i){switch(this.state){case Q.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(i);break;case Q.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(i);break;case Q.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(i);break}}function co(i){this.enabled===!1||this.enableZoom===!1||this.state!==Q.NONE||(i.preventDefault(),this.dispatchEvent(Sn),this._handleMouseWheel(this._customWheelEvent(i)),this.dispatchEvent(us))}function lo(i){this.enabled!==!1&&this._handleKeyDown(i)}function uo(i){switch(this._trackPointer(i),this._pointers.length){case 1:switch(this.touches.ONE){case u.TOUCH.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(i),this.state=Q.TOUCH_ROTATE;break;case u.TOUCH.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(i),this.state=Q.TOUCH_PAN;break;default:this.state=Q.NONE}break;case 2:switch(this.touches.TWO){case u.TOUCH.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(i),this.state=Q.TOUCH_DOLLY_PAN;break;case u.TOUCH.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(i),this.state=Q.TOUCH_DOLLY_ROTATE;break;default:this.state=Q.NONE}break;default:this.state=Q.NONE}this.state!==Q.NONE&&this.dispatchEvent(Sn)}function po(i){switch(this._trackPointer(i),this.state){case Q.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(i),this.update();break;case Q.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(i),this.update();break;case Q.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(i),this.update();break;case Q.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(i),this.update();break;default:this.state=Q.NONE}}function fo(i){this.enabled!==!1&&i.preventDefault()}function ho(i){i.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function go(i){i.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}class mo extends fs{constructor(t){const e=t.camera;super(e,t.renderer.domElement);const n=this;n.dampingFactor=.1,n.rotateSpeed=.4,n.updateByOptions(t)}updateByOptions(t={}){const e=this;t.enableDamping!==void 0&&(e.enableDamping=t.enableDamping),t.autoRotate!==void 0&&(e.autoRotate=t.autoRotate),t.enableZoom!==void 0&&(e.enableZoom=t.enableZoom),t.enableRotate!==void 0&&(e.enableRotate=t.enableRotate),t.enablePan!==void 0&&(e.enablePan=t.enablePan),t.minDistance!==void 0&&(e.minDistance=t.minDistance),t.maxDistance!==void 0&&(e.maxDistance=t.maxDistance),t.minPolarAngle!==void 0&&(e.minPolarAngle=t.minPolarAngle),t.maxPolarAngle!==void 0&&(e.maxPolarAngle=t.maxPolarAngle),t.fov!==void 0&&(e.object.fov=t.fov),t.near!==void 0&&(e.object.near=t.near),t.far!==void 0&&(e.object.far=t.far),t.position&&e.object.position.fromArray(t.position),t.lookAt&&e.target.fromArray(t.lookAt),t.lookUp&&e.object.up.fromArray(t.lookUp),rt&&e._dollyOut?.(.75),e.updateRotateAxis(),e.update()}updateRotateAxis(){this._quat?.setFromUnitVectors?.(this.object.up,new u.Vector3(0,1,0)),this._quatInverse=this._quat?.clone?.()?.invert?.()}}class yo extends fs{constructor(t,e){super(t,e),this.screenSpacePanning=!1,this.mouseButtons={LEFT:u.MOUSE.PAN,MIDDLE:u.MOUSE.DOLLY,RIGHT:u.MOUSE.ROTATE},this.touches={ONE:u.TOUCH.PAN,TWO:u.TOUCH.DOLLY_ROTATE}}}const hs=new u.Box3,xe=new u.Vector3;class gs extends u.InstancedBufferGeometry{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const t=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],e=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],n=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(n),this.setAttribute("position",new u.Float32BufferAttribute(t,3)),this.setAttribute("uv",new u.Float32BufferAttribute(e,2))}applyMatrix4(t){const e=this.attributes.instanceStart,n=this.attributes.instanceEnd;return e!==void 0&&(e.applyMatrix4(t),n.applyMatrix4(t),e.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(t){let e;t instanceof Float32Array?e=t:Array.isArray(t)&&(e=new Float32Array(t));const n=new u.InstancedInterleavedBuffer(e,6,1);return this.setAttribute("instanceStart",new u.InterleavedBufferAttribute(n,3,0)),this.setAttribute("instanceEnd",new u.InterleavedBufferAttribute(n,3,3)),this.instanceCount=this.attributes.instanceStart.count,this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(t){let e;t instanceof Float32Array?e=t:Array.isArray(t)&&(e=new Float32Array(t));const n=new u.InstancedInterleavedBuffer(e,6,1);return this.setAttribute("instanceColorStart",new u.InterleavedBufferAttribute(n,3,0)),this.setAttribute("instanceColorEnd",new u.InterleavedBufferAttribute(n,3,3)),this}fromWireframeGeometry(t){return this.setPositions(t.attributes.position.array),this}fromEdgesGeometry(t){return this.setPositions(t.attributes.position.array),this}fromMesh(t){return this.fromWireframeGeometry(new u.WireframeGeometry(t.geometry)),this}fromLineSegments(t){const e=t.geometry;return this.setPositions(e.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new u.Box3);const t=this.attributes.instanceStart,e=this.attributes.instanceEnd;t!==void 0&&e!==void 0&&(this.boundingBox.setFromBufferAttribute(t),hs.setFromBufferAttribute(e),this.boundingBox.union(hs))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new u.Sphere),this.boundingBox===null&&this.computeBoundingBox();const t=this.attributes.instanceStart,e=this.attributes.instanceEnd;if(t!==void 0&&e!==void 0){const n=this.boundingSphere.center;this.boundingBox.getCenter(n);let a=0;for(let o=0,s=t.count;o<s;o++)xe.fromBufferAttribute(t,o),a=Math.max(a,n.distanceToSquared(xe)),xe.fromBufferAttribute(e,o),a=Math.max(a,n.distanceToSquared(xe));this.boundingSphere.radius=Math.sqrt(a),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(t){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(t)}}u.UniformsLib.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new u.Vector2(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}},u.ShaderLib.line={uniforms:u.UniformsUtils.merge([u.UniformsLib.common,u.UniformsLib.fog,u.UniformsLib.line]),vertexShader:`
|
|
339
339
|
#include <common>
|
|
340
340
|
#include <color_pars_vertex>
|
|
341
341
|
#include <fog_pars_vertex>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reall3d/reall3dviewer",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"./dist/style.css": "./dist/style.css"
|
|
18
18
|
},
|
|
19
|
-
"
|
|
19
|
+
"peerDependencies": {
|
|
20
20
|
"@gotoeasy/three-tile": "^0.8.7",
|
|
21
21
|
"@tweenjs/tween.js": "^25.0.0",
|
|
22
22
|
"three": "^0.171.0"
|