@epigraph/solutions 1.11.3 → 1.11.4-pre-alpha.1
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/LICENSE +21 -21
- package/README.md +21 -21
- package/dist/epigraph-solutions.js +19 -8
- package/package.json +73 -73
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Epigraph
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Epigraph
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
A collection of solutions offered by Epigraph. The intent of this initiative to provide easy and streamlined access to the offerings we have in a single place. For now, the supported solutions are mentioned below, but more are expected to be added in the future.
|
|
2
|
-
|
|
3
|
-
## `<epigraph-button/>`
|
|
4
|
-
- Quickstart Guide: https://docs.myepigraph.com/docs/epigraph-button-quickstart#/
|
|
5
|
-
- Knowledgebase: https://docs.myepigraph.com/update/docs/epigraph-button-knowledgebase#/
|
|
6
|
-
|
|
7
|
-
## `<epigraph-viewer/>`
|
|
8
|
-
- Quickstart Guide: https://docs.myepigraph.com/docs/epigraph-viewer-quickstart#/
|
|
9
|
-
- Knowledgebase: https://docs.myepigraph.com/update/docs/epigraph-viewer-knowledgebase#/
|
|
10
|
-
|
|
11
|
-
## `<epigraph-tour/>`
|
|
12
|
-
- Quickstart Guide: https://docs.myepigraph.com/docs/epigraph-tour-quickstart#/
|
|
13
|
-
- Knowledgebase: https://docs.myepigraph.com/update/docs/epigraph-tour-knowledgebase#/
|
|
14
|
-
|
|
15
|
-
## `<epigraph-previewer/>`
|
|
16
|
-
- Quickstart Guide: https://docs.myepigraph.com/docs/epigraph-tour-quickstart#/
|
|
17
|
-
- Knowledgebase: https://docs.myepigraph.com/update/docs/epigraph-tour-knowledgebase#/
|
|
18
|
-
|
|
19
|
-
## `<epigraph-hotspot-tool/>`
|
|
20
|
-
- Quickstart Guide: https://docs.myepigraph.com/docs/epigraph-tour-quickstart#/
|
|
21
|
-
- Knowledgebase: https://docs.myepigraph.com/update/docs/epigraph-tour-knowledgebase#/
|
|
1
|
+
A collection of solutions offered by Epigraph. The intent of this initiative to provide easy and streamlined access to the offerings we have in a single place. For now, the supported solutions are mentioned below, but more are expected to be added in the future.
|
|
2
|
+
|
|
3
|
+
## `<epigraph-button/>`
|
|
4
|
+
- Quickstart Guide: https://docs.myepigraph.com/docs/epigraph-button-quickstart#/
|
|
5
|
+
- Knowledgebase: https://docs.myepigraph.com/update/docs/epigraph-button-knowledgebase#/
|
|
6
|
+
|
|
7
|
+
## `<epigraph-viewer/>`
|
|
8
|
+
- Quickstart Guide: https://docs.myepigraph.com/docs/epigraph-viewer-quickstart#/
|
|
9
|
+
- Knowledgebase: https://docs.myepigraph.com/update/docs/epigraph-viewer-knowledgebase#/
|
|
10
|
+
|
|
11
|
+
## `<epigraph-tour/>`
|
|
12
|
+
- Quickstart Guide: https://docs.myepigraph.com/docs/epigraph-tour-quickstart#/
|
|
13
|
+
- Knowledgebase: https://docs.myepigraph.com/update/docs/epigraph-tour-knowledgebase#/
|
|
14
|
+
|
|
15
|
+
## `<epigraph-previewer/>`
|
|
16
|
+
- Quickstart Guide: https://docs.myepigraph.com/docs/epigraph-tour-quickstart#/
|
|
17
|
+
- Knowledgebase: https://docs.myepigraph.com/update/docs/epigraph-tour-knowledgebase#/
|
|
18
|
+
|
|
19
|
+
## `<epigraph-hotspot-tool/>`
|
|
20
|
+
- Quickstart Guide: https://docs.myepigraph.com/docs/epigraph-tour-quickstart#/
|
|
21
|
+
- Knowledgebase: https://docs.myepigraph.com/update/docs/epigraph-tour-knowledgebase#/
|
|
@@ -4410,7 +4410,7 @@ ${l.join(`
|
|
|
4410
4410
|
* https://github.com/yomotsu/camera-controls
|
|
4411
4411
|
* (c) 2017 @yomotsu
|
|
4412
4412
|
* Released under the MIT License.
|
|
4413
|
-
*/const xi={LEFT:1,RIGHT:2,MIDDLE:4},_e=Object.freeze({NONE:0,ROTATE:1,TRUCK:2,SCREEN_PAN:4,OFFSET:8,DOLLY:16,ZOOM:32,TOUCH_ROTATE:64,TOUCH_TRUCK:128,TOUCH_SCREEN_PAN:256,TOUCH_OFFSET:512,TOUCH_DOLLY:1024,TOUCH_ZOOM:2048,TOUCH_DOLLY_TRUCK:4096,TOUCH_DOLLY_SCREEN_PAN:8192,TOUCH_DOLLY_OFFSET:16384,TOUCH_DOLLY_ROTATE:32768,TOUCH_ZOOM_TRUCK:65536,TOUCH_ZOOM_OFFSET:131072,TOUCH_ZOOM_SCREEN_PAN:262144,TOUCH_ZOOM_ROTATE:524288}),gl={NONE:0,IN:1,OUT:-1};function Ha(n){return n.isPerspectiveCamera}function Zr(n){return n.isOrthographicCamera}const Yr=Math.PI*2,ow=Math.PI/2,YM=1e-5,bh=Math.PI/180;function xs(n,e,t){return Math.max(e,Math.min(t,n))}function si(n,e=YM){return Math.abs(n)<e}function qt(n,e,t=YM){return si(n-e,t)}function lw(n,e){return Math.round(n/e)*e}function xh(n){return isFinite(n)?n:n<0?-Number.MAX_VALUE:Number.MAX_VALUE}function wh(n){return Math.abs(n)<Number.MAX_VALUE?n:n*(1/0)}function lf(n,e,t,i,s=1/0,l){i=Math.max(1e-4,i);const h=2/i,u=h*l,f=1/(1+u+.48*u*u+.235*u*u*u);let g=n-e;const A=e,_=s*i;g=xs(g,-_,_),e=n-g;const y=(t.value+h*g)*l;t.value=(t.value-h*y)*f;let v=e+(g+y)*f;return A-n>0==v>A&&(v=A,t.value=(v-A)/l),v}function cw(n,e,t,i,s=1/0,l,h){i=Math.max(1e-4,i);const u=2/i,f=u*l,g=1/(1+f+.48*f*f+.235*f*f*f);let A=e.x,_=e.y,y=e.z,v=n.x-A,w=n.y-_,T=n.z-y;const C=A,E=_,M=y,I=s*i,P=I*I,N=v*v+w*w+T*T;if(N>P){const k=Math.sqrt(N);v=v/k*I,w=w/k*I,T=T/k*I}A=n.x-v,_=n.y-w,y=n.z-T;const $=(t.x+u*v)*l,Q=(t.y+u*w)*l,G=(t.z+u*T)*l;t.x=(t.x-u*$)*g,t.y=(t.y-u*Q)*g,t.z=(t.z-u*G)*g,h.x=A+(v+$)*g,h.y=_+(w+Q)*g,h.z=y+(T+G)*g;const F=C-n.x,z=E-n.y,W=M-n.z,Y=h.x-C,K=h.y-E,a=h.z-M;return F*Y+z*K+W*a>0&&(h.x=C,h.y=E,h.z=M,t.x=(h.x-C)/l,t.y=(h.y-E)/l,t.z=(h.z-M)/l),h}function Km(n,e){e.set(0,0),n.forEach(t=>{e.x+=t.clientX,e.y+=t.clientY}),e.x/=n.length,e.y/=n.length}function Jm(n,e){return Zr(n)?(console.warn(`${e} is not supported in OrthographicCamera`),!0):!1}class Xz{_listeners={};addEventListener(e,t){const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){const i=this._listeners;return i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){const s=this._listeners[e];if(s!==void 0){const l=s.indexOf(t);l!==-1&&s.splice(l,1)}}removeAllEventListeners(e){if(!e){this._listeners={};return}Array.isArray(this._listeners[e])&&(this._listeners[e].length=0)}dispatchEvent(e){const i=this._listeners[e.type];if(i!==void 0){e.target=this;const s=i.slice(0);for(let l=0,h=s.length;l<h;l++)s[l].call(this,e)}}}const Yz="3.1.2",cf=1/8,Kz=/Mac/.test(globalThis?.navigator?.platform);let At,hw,hf,Zm,Ln,bt,Ut,ml,Eh,Os,ks,Va,uw,dw,Gn,Al,_l,fw,eA,pw,tA,iA,uf;class tc extends Xz{static install(e){At=e.THREE,hw=Object.freeze(new At.Vector3(0,0,0)),hf=Object.freeze(new At.Vector3(0,1,0)),Zm=Object.freeze(new At.Vector3(0,0,1)),Ln=new At.Vector2,bt=new At.Vector3,Ut=new At.Vector3,ml=new At.Vector3,Eh=new At.Vector3,Os=new At.Vector3,ks=new At.Vector3,Va=new At.Vector3,uw=new At.Vector3,dw=new At.Vector3,Gn=new At.Spherical,Al=new At.Spherical,_l=new At.Box3,fw=new At.Box3,eA=new At.Sphere,pw=new At.Quaternion,tA=new At.Quaternion,iA=new At.Matrix4,uf=new At.Raycaster}static get ACTION(){return _e}minPolarAngle=0;maxPolarAngle=Math.PI;minAzimuthAngle=-1/0;maxAzimuthAngle=1/0;minDistance=Number.EPSILON;maxDistance=1/0;infinityDolly=!1;minZoom=.01;maxZoom=1/0;smoothTime=.25;draggingSmoothTime=.125;maxSpeed=1/0;azimuthRotateSpeed=1;polarRotateSpeed=1;dollySpeed=1;dollyDragInverted=!1;truckSpeed=2;dollyToCursor=!1;dragToOffset=!1;boundaryFriction=0;restThreshold=.01;colliderMeshes=[];mouseButtons;touches;cancel=()=>{};lockPointer;unlockPointer;_enabled=!0;_camera;_yAxisUpSpace;_yAxisUpSpaceInverse;_state=_e.NONE;_domElement;_viewport=null;_target;_targetEnd;_focalOffset;_focalOffsetEnd;_spherical;_sphericalEnd;_lastDistance;_zoom;_zoomEnd;_lastZoom;_cameraUp0;_target0;_position0;_zoom0;_focalOffset0;_dollyControlCoord;_changedDolly=0;_changedZoom=0;_nearPlaneCorners;_hasRested=!0;_boundary;_boundaryEnclosesCamera=!1;_needsUpdate=!0;_updatedLastTime=!1;_elementRect=new DOMRect;_isDragging=!1;_dragNeedsUpdate=!0;_activePointers=[];_lockedPointer=null;_interactiveArea=new DOMRect(0,0,1,1);_isUserControllingRotate=!1;_isUserControllingDolly=!1;_isUserControllingTruck=!1;_isUserControllingOffset=!1;_isUserControllingZoom=!1;_lastDollyDirection=gl.NONE;_thetaVelocity={value:0};_phiVelocity={value:0};_radiusVelocity={value:0};_targetVelocity=new At.Vector3;_focalOffsetVelocity=new At.Vector3;_zoomVelocity={value:0};set verticalDragToForward(e){console.warn("camera-controls: `verticalDragToForward` was removed. Use `mouseButtons.left = CameraControls.ACTION.SCREEN_PAN` instead.")}constructor(e,t){super(),typeof At>"u"&&console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."),this._camera=e,this._yAxisUpSpace=new At.Quaternion().setFromUnitVectors(this._camera.up,hf),this._yAxisUpSpaceInverse=this._yAxisUpSpace.clone().invert(),this._state=_e.NONE,this._target=new At.Vector3,this._targetEnd=this._target.clone(),this._focalOffset=new At.Vector3,this._focalOffsetEnd=this._focalOffset.clone(),this._spherical=new At.Spherical().setFromVector3(bt.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)),this._sphericalEnd=this._spherical.clone(),this._lastDistance=this._spherical.radius,this._zoom=this._camera.zoom,this._zoomEnd=this._zoom,this._lastZoom=this._zoom,this._nearPlaneCorners=[new At.Vector3,new At.Vector3,new At.Vector3,new At.Vector3],this._updateNearPlaneCorners(),this._boundary=new At.Box3(new At.Vector3(-1/0,-1/0,-1/0),new At.Vector3(1/0,1/0,1/0)),this._cameraUp0=this._camera.up.clone(),this._target0=this._target.clone(),this._position0=this._camera.position.clone(),this._zoom0=this._zoom,this._focalOffset0=this._focalOffset.clone(),this._dollyControlCoord=new At.Vector2,this.mouseButtons={left:_e.ROTATE,middle:_e.DOLLY,right:_e.TRUCK,wheel:Ha(this._camera)?_e.DOLLY:Zr(this._camera)?_e.ZOOM:_e.NONE},this.touches={one:_e.TOUCH_ROTATE,two:Ha(this._camera)?_e.TOUCH_DOLLY_TRUCK:Zr(this._camera)?_e.TOUCH_ZOOM_TRUCK:_e.NONE,three:_e.TOUCH_TRUCK};const i=new At.Vector2,s=new At.Vector2,l=new At.Vector2,h=E=>{if(!this._enabled||!this._domElement)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const P=this._domElement.getBoundingClientRect(),N=E.clientX/P.width,$=E.clientY/P.height;if(N<this._interactiveArea.left||N>this._interactiveArea.right||$<this._interactiveArea.top||$>this._interactiveArea.bottom)return}const M=E.pointerType!=="mouse"?null:(E.buttons&xi.LEFT)===xi.LEFT?xi.LEFT:(E.buttons&xi.MIDDLE)===xi.MIDDLE?xi.MIDDLE:(E.buttons&xi.RIGHT)===xi.RIGHT?xi.RIGHT:null;if(M!==null){const P=this._findPointerByMouseButton(M);P&&this._disposePointer(P)}if((E.buttons&xi.LEFT)===xi.LEFT&&this._lockedPointer)return;const I={pointerId:E.pointerId,clientX:E.clientX,clientY:E.clientY,deltaX:0,deltaY:0,mouseButton:M};this._activePointers.push(I),this._domElement.ownerDocument.removeEventListener("pointermove",u,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",f),this._domElement.ownerDocument.addEventListener("pointermove",u,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",f),this._isDragging=!0,y(E)},u=E=>{E.cancelable&&E.preventDefault();const M=E.pointerId,I=this._lockedPointer||this._findPointerById(M);if(I){if(I.clientX=E.clientX,I.clientY=E.clientY,I.deltaX=E.movementX,I.deltaY=E.movementY,this._state=0,E.pointerType==="touch")switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else(!this._isDragging&&this._lockedPointer||this._isDragging&&(E.buttons&xi.LEFT)===xi.LEFT)&&(this._state=this._state|this.mouseButtons.left),this._isDragging&&(E.buttons&xi.MIDDLE)===xi.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),this._isDragging&&(E.buttons&xi.RIGHT)===xi.RIGHT&&(this._state=this._state|this.mouseButtons.right);v()}},f=E=>{const M=this._findPointerById(E.pointerId);if(!(M&&M===this._lockedPointer)){if(M&&this._disposePointer(M),E.pointerType==="touch")switch(this._activePointers.length){case 0:this._state=_e.NONE;break;case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else this._state=_e.NONE;w()}};let g=-1;const A=E=>{if(!this._domElement||!this._enabled||this.mouseButtons.wheel===_e.NONE)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const Q=this._domElement.getBoundingClientRect(),G=E.clientX/Q.width,F=E.clientY/Q.height;if(G<this._interactiveArea.left||G>this._interactiveArea.right||F<this._interactiveArea.top||F>this._interactiveArea.bottom)return}if(E.preventDefault(),this.dollyToCursor||this.mouseButtons.wheel===_e.ROTATE||this.mouseButtons.wheel===_e.TRUCK){const Q=performance.now();g-Q<1e3&&this._getClientRect(this._elementRect),g=Q}const M=Kz?-1:-3,I=E.deltaMode===1&&!E.ctrlKey?E.deltaY/M:E.deltaY/(M*10),P=this.dollyToCursor?(E.clientX-this._elementRect.x)/this._elementRect.width*2-1:0,N=this.dollyToCursor?(E.clientY-this._elementRect.y)/this._elementRect.height*-2+1:0;switch(E.ctrlKey?_e.ZOOM:this.mouseButtons.wheel){case _e.ROTATE:{this._rotateInternal(E.deltaX,E.deltaY),this._isUserControllingRotate=!0;break}case _e.TRUCK:{this._truckInternal(E.deltaX,E.deltaY,!1,!1),this._isUserControllingTruck=!0;break}case _e.SCREEN_PAN:{this._truckInternal(E.deltaX,E.deltaY,!1,!0),this._isUserControllingTruck=!0;break}case _e.OFFSET:{this._truckInternal(E.deltaX,E.deltaY,!0,!1),this._isUserControllingOffset=!0;break}case _e.DOLLY:{this._dollyInternal(-I,P,N),this._isUserControllingDolly=!0;break}case _e.ZOOM:{this._zoomInternal(-I,P,N),this._isUserControllingZoom=!0;break}}this.dispatchEvent({type:"control"})},_=E=>{if(!(!this._domElement||!this._enabled)){if(this.mouseButtons.right===tc.ACTION.NONE){const M=E instanceof PointerEvent?E.pointerId:0,I=this._findPointerById(M);I&&this._disposePointer(I),this._domElement.ownerDocument.removeEventListener("pointermove",u,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",f);return}E.preventDefault()}},y=E=>{if(!this._enabled)return;if(Km(this._activePointers,Ln),this._getClientRect(this._elementRect),i.copy(Ln),s.copy(Ln),this._activePointers.length>=2){const I=Ln.x-this._activePointers[1].clientX,P=Ln.y-this._activePointers[1].clientY,N=Math.sqrt(I*I+P*P);l.set(0,N);const $=(this._activePointers[0].clientX+this._activePointers[1].clientX)*.5,Q=(this._activePointers[0].clientY+this._activePointers[1].clientY)*.5;s.set($,Q)}if(this._state=0,!E)this._lockedPointer&&(this._state=this._state|this.mouseButtons.left);else if("pointerType"in E&&E.pointerType==="touch")switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else!this._lockedPointer&&(E.buttons&xi.LEFT)===xi.LEFT&&(this._state=this._state|this.mouseButtons.left),(E.buttons&xi.MIDDLE)===xi.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(E.buttons&xi.RIGHT)===xi.RIGHT&&(this._state=this._state|this.mouseButtons.right);((this._state&_e.ROTATE)===_e.ROTATE||(this._state&_e.TOUCH_ROTATE)===_e.TOUCH_ROTATE||(this._state&_e.TOUCH_DOLLY_ROTATE)===_e.TOUCH_DOLLY_ROTATE||(this._state&_e.TOUCH_ZOOM_ROTATE)===_e.TOUCH_ZOOM_ROTATE)&&(this._sphericalEnd.theta=this._spherical.theta,this._sphericalEnd.phi=this._spherical.phi,this._thetaVelocity.value=0,this._phiVelocity.value=0),((this._state&_e.TRUCK)===_e.TRUCK||(this._state&_e.SCREEN_PAN)===_e.SCREEN_PAN||(this._state&_e.TOUCH_TRUCK)===_e.TOUCH_TRUCK||(this._state&_e.TOUCH_SCREEN_PAN)===_e.TOUCH_SCREEN_PAN||(this._state&_e.TOUCH_DOLLY_TRUCK)===_e.TOUCH_DOLLY_TRUCK||(this._state&_e.TOUCH_DOLLY_SCREEN_PAN)===_e.TOUCH_DOLLY_SCREEN_PAN||(this._state&_e.TOUCH_ZOOM_TRUCK)===_e.TOUCH_ZOOM_TRUCK||(this._state&_e.TOUCH_ZOOM_SCREEN_PAN)===_e.TOUCH_DOLLY_SCREEN_PAN)&&(this._targetEnd.copy(this._target),this._targetVelocity.set(0,0,0)),((this._state&_e.DOLLY)===_e.DOLLY||(this._state&_e.TOUCH_DOLLY)===_e.TOUCH_DOLLY||(this._state&_e.TOUCH_DOLLY_TRUCK)===_e.TOUCH_DOLLY_TRUCK||(this._state&_e.TOUCH_DOLLY_SCREEN_PAN)===_e.TOUCH_DOLLY_SCREEN_PAN||(this._state&_e.TOUCH_DOLLY_OFFSET)===_e.TOUCH_DOLLY_OFFSET||(this._state&_e.TOUCH_DOLLY_ROTATE)===_e.TOUCH_DOLLY_ROTATE)&&(this._sphericalEnd.radius=this._spherical.radius,this._radiusVelocity.value=0),((this._state&_e.ZOOM)===_e.ZOOM||(this._state&_e.TOUCH_ZOOM)===_e.TOUCH_ZOOM||(this._state&_e.TOUCH_ZOOM_TRUCK)===_e.TOUCH_ZOOM_TRUCK||(this._state&_e.TOUCH_ZOOM_SCREEN_PAN)===_e.TOUCH_ZOOM_SCREEN_PAN||(this._state&_e.TOUCH_ZOOM_OFFSET)===_e.TOUCH_ZOOM_OFFSET||(this._state&_e.TOUCH_ZOOM_ROTATE)===_e.TOUCH_ZOOM_ROTATE)&&(this._zoomEnd=this._zoom,this._zoomVelocity.value=0),((this._state&_e.OFFSET)===_e.OFFSET||(this._state&_e.TOUCH_OFFSET)===_e.TOUCH_OFFSET||(this._state&_e.TOUCH_DOLLY_OFFSET)===_e.TOUCH_DOLLY_OFFSET||(this._state&_e.TOUCH_ZOOM_OFFSET)===_e.TOUCH_ZOOM_OFFSET)&&(this._focalOffsetEnd.copy(this._focalOffset),this._focalOffsetVelocity.set(0,0,0)),this.dispatchEvent({type:"controlstart"})},v=()=>{if(!this._enabled||!this._dragNeedsUpdate)return;this._dragNeedsUpdate=!1,Km(this._activePointers,Ln);const M=this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement?this._lockedPointer||this._activePointers[0]:null,I=M?-M.deltaX:s.x-Ln.x,P=M?-M.deltaY:s.y-Ln.y;if(s.copy(Ln),((this._state&_e.ROTATE)===_e.ROTATE||(this._state&_e.TOUCH_ROTATE)===_e.TOUCH_ROTATE||(this._state&_e.TOUCH_DOLLY_ROTATE)===_e.TOUCH_DOLLY_ROTATE||(this._state&_e.TOUCH_ZOOM_ROTATE)===_e.TOUCH_ZOOM_ROTATE)&&(this._rotateInternal(I,P),this._isUserControllingRotate=!0),(this._state&_e.DOLLY)===_e.DOLLY||(this._state&_e.ZOOM)===_e.ZOOM){const N=this.dollyToCursor?(i.x-this._elementRect.x)/this._elementRect.width*2-1:0,$=this.dollyToCursor?(i.y-this._elementRect.y)/this._elementRect.height*-2+1:0,Q=this.dollyDragInverted?-1:1;(this._state&_e.DOLLY)===_e.DOLLY?(this._dollyInternal(Q*P*cf,N,$),this._isUserControllingDolly=!0):(this._zoomInternal(Q*P*cf,N,$),this._isUserControllingZoom=!0)}if((this._state&_e.TOUCH_DOLLY)===_e.TOUCH_DOLLY||(this._state&_e.TOUCH_ZOOM)===_e.TOUCH_ZOOM||(this._state&_e.TOUCH_DOLLY_TRUCK)===_e.TOUCH_DOLLY_TRUCK||(this._state&_e.TOUCH_ZOOM_TRUCK)===_e.TOUCH_ZOOM_TRUCK||(this._state&_e.TOUCH_DOLLY_SCREEN_PAN)===_e.TOUCH_DOLLY_SCREEN_PAN||(this._state&_e.TOUCH_ZOOM_SCREEN_PAN)===_e.TOUCH_ZOOM_SCREEN_PAN||(this._state&_e.TOUCH_DOLLY_OFFSET)===_e.TOUCH_DOLLY_OFFSET||(this._state&_e.TOUCH_ZOOM_OFFSET)===_e.TOUCH_ZOOM_OFFSET||(this._state&_e.TOUCH_DOLLY_ROTATE)===_e.TOUCH_DOLLY_ROTATE||(this._state&_e.TOUCH_ZOOM_ROTATE)===_e.TOUCH_ZOOM_ROTATE){const N=Ln.x-this._activePointers[1].clientX,$=Ln.y-this._activePointers[1].clientY,Q=Math.sqrt(N*N+$*$),G=l.y-Q;l.set(0,Q);const F=this.dollyToCursor?(s.x-this._elementRect.x)/this._elementRect.width*2-1:0,z=this.dollyToCursor?(s.y-this._elementRect.y)/this._elementRect.height*-2+1:0;(this._state&_e.TOUCH_DOLLY)===_e.TOUCH_DOLLY||(this._state&_e.TOUCH_DOLLY_ROTATE)===_e.TOUCH_DOLLY_ROTATE||(this._state&_e.TOUCH_DOLLY_TRUCK)===_e.TOUCH_DOLLY_TRUCK||(this._state&_e.TOUCH_DOLLY_SCREEN_PAN)===_e.TOUCH_DOLLY_SCREEN_PAN||(this._state&_e.TOUCH_DOLLY_OFFSET)===_e.TOUCH_DOLLY_OFFSET?(this._dollyInternal(G*cf,F,z),this._isUserControllingDolly=!0):(this._zoomInternal(G*cf,F,z),this._isUserControllingZoom=!0)}((this._state&_e.TRUCK)===_e.TRUCK||(this._state&_e.TOUCH_TRUCK)===_e.TOUCH_TRUCK||(this._state&_e.TOUCH_DOLLY_TRUCK)===_e.TOUCH_DOLLY_TRUCK||(this._state&_e.TOUCH_ZOOM_TRUCK)===_e.TOUCH_ZOOM_TRUCK)&&(this._truckInternal(I,P,!1,!1),this._isUserControllingTruck=!0),((this._state&_e.SCREEN_PAN)===_e.SCREEN_PAN||(this._state&_e.TOUCH_SCREEN_PAN)===_e.TOUCH_SCREEN_PAN||(this._state&_e.TOUCH_DOLLY_SCREEN_PAN)===_e.TOUCH_DOLLY_SCREEN_PAN||(this._state&_e.TOUCH_ZOOM_SCREEN_PAN)===_e.TOUCH_ZOOM_SCREEN_PAN)&&(this._truckInternal(I,P,!1,!0),this._isUserControllingTruck=!0),((this._state&_e.OFFSET)===_e.OFFSET||(this._state&_e.TOUCH_OFFSET)===_e.TOUCH_OFFSET||(this._state&_e.TOUCH_DOLLY_OFFSET)===_e.TOUCH_DOLLY_OFFSET||(this._state&_e.TOUCH_ZOOM_OFFSET)===_e.TOUCH_ZOOM_OFFSET)&&(this._truckInternal(I,P,!0,!1),this._isUserControllingOffset=!0),this.dispatchEvent({type:"control"})},w=()=>{Km(this._activePointers,Ln),s.copy(Ln),this._dragNeedsUpdate=!1,(this._activePointers.length===0||this._activePointers.length===1&&this._activePointers[0]===this._lockedPointer)&&(this._isDragging=!1),this._activePointers.length===0&&this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointermove",u,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",f),this.dispatchEvent({type:"controlend"}))};this.lockPointer=()=>{!this._enabled||!this._domElement||(this.cancel(),this._lockedPointer={pointerId:-1,clientX:0,clientY:0,deltaX:0,deltaY:0,mouseButton:null},this._activePointers.push(this._lockedPointer),this._domElement.ownerDocument.removeEventListener("pointermove",u,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",f),this._domElement.requestPointerLock(),this._domElement.ownerDocument.addEventListener("pointerlockchange",T),this._domElement.ownerDocument.addEventListener("pointerlockerror",C),this._domElement.ownerDocument.addEventListener("pointermove",u,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",f),y())},this.unlockPointer=()=>{this._lockedPointer!==null&&(this._disposePointer(this._lockedPointer),this._lockedPointer=null),this._domElement?.ownerDocument.exitPointerLock(),this._domElement?.ownerDocument.removeEventListener("pointerlockchange",T),this._domElement?.ownerDocument.removeEventListener("pointerlockerror",C),this.cancel()};const T=()=>{this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement||this.unlockPointer()},C=()=>{this.unlockPointer()};this._addAllEventListeners=E=>{this._domElement=E,this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none",this._domElement.addEventListener("pointerdown",h),this._domElement.addEventListener("pointercancel",f),this._domElement.addEventListener("wheel",A,{passive:!1}),this._domElement.addEventListener("contextmenu",_)},this._removeAllEventListeners=()=>{this._domElement&&(this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect="",this._domElement.removeEventListener("pointerdown",h),this._domElement.removeEventListener("pointercancel",f),this._domElement.removeEventListener("wheel",A,{passive:!1}),this._domElement.removeEventListener("contextmenu",_),this._domElement.ownerDocument.removeEventListener("pointermove",u,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",f),this._domElement.ownerDocument.removeEventListener("pointerlockchange",T),this._domElement.ownerDocument.removeEventListener("pointerlockerror",C))},this.cancel=()=>{this._state!==_e.NONE&&(this._state=_e.NONE,this._activePointers.length=0,w())},t&&this.connect(t),this.update(0)}get camera(){return this._camera}set camera(e){this._camera=e,this.updateCameraUp(),this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._domElement&&(e?(this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none"):(this.cancel(),this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect=""))}get active(){return!this._hasRested}get currentAction(){return this._state}get distance(){return this._spherical.radius}set distance(e){this._spherical.radius===e&&this._sphericalEnd.radius===e||(this._spherical.radius=e,this._sphericalEnd.radius=e,this._needsUpdate=!0)}get azimuthAngle(){return this._spherical.theta}set azimuthAngle(e){this._spherical.theta===e&&this._sphericalEnd.theta===e||(this._spherical.theta=e,this._sphericalEnd.theta=e,this._needsUpdate=!0)}get polarAngle(){return this._spherical.phi}set polarAngle(e){this._spherical.phi===e&&this._sphericalEnd.phi===e||(this._spherical.phi=e,this._sphericalEnd.phi=e,this._needsUpdate=!0)}get boundaryEnclosesCamera(){return this._boundaryEnclosesCamera}set boundaryEnclosesCamera(e){this._boundaryEnclosesCamera=e,this._needsUpdate=!0}set interactiveArea(e){this._interactiveArea.width=xs(e.width,0,1),this._interactiveArea.height=xs(e.height,0,1),this._interactiveArea.x=xs(e.x,0,1-this._interactiveArea.width),this._interactiveArea.y=xs(e.y,0,1-this._interactiveArea.height)}addEventListener(e,t){super.addEventListener(e,t)}removeEventListener(e,t){super.removeEventListener(e,t)}rotate(e,t,i=!1){return this.rotateTo(this._sphericalEnd.theta+e,this._sphericalEnd.phi+t,i)}rotateAzimuthTo(e,t=!1){return this.rotateTo(e,this._sphericalEnd.phi,t)}rotatePolarTo(e,t=!1){return this.rotateTo(this._sphericalEnd.theta,e,t)}rotateTo(e,t,i=!1){this._isUserControllingRotate=!1;const s=xs(e,this.minAzimuthAngle,this.maxAzimuthAngle),l=xs(t,this.minPolarAngle,this.maxPolarAngle);this._sphericalEnd.theta=s,this._sphericalEnd.phi=l,this._sphericalEnd.makeSafe(),this._needsUpdate=!0,i||(this._spherical.theta=this._sphericalEnd.theta,this._spherical.phi=this._sphericalEnd.phi);const h=!i||qt(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&qt(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold);return this._createOnRestPromise(h)}dolly(e,t=!1){return this.dollyTo(this._sphericalEnd.radius-e,t)}dollyTo(e,t=!1){return this._isUserControllingDolly=!1,this._lastDollyDirection=gl.NONE,this._changedDolly=0,this._dollyToNoClamp(xs(e,this.minDistance,this.maxDistance),t)}_dollyToNoClamp(e,t=!1){const i=this._sphericalEnd.radius;if(this.colliderMeshes.length>=1){const h=this._collisionTest(),u=qt(h,this._spherical.radius);if(!(i>e)&&u)return Promise.resolve();this._sphericalEnd.radius=Math.min(e,h)}else this._sphericalEnd.radius=e;this._needsUpdate=!0,t||(this._spherical.radius=this._sphericalEnd.radius);const l=!t||qt(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(l)}dollyInFixed(e,t=!1){this._targetEnd.add(this._getCameraDirection(Eh).multiplyScalar(e)),t||this._target.copy(this._targetEnd);const i=!t||qt(this._target.x,this._targetEnd.x,this.restThreshold)&&qt(this._target.y,this._targetEnd.y,this.restThreshold)&&qt(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(i)}zoom(e,t=!1){return this.zoomTo(this._zoomEnd+e,t)}zoomTo(e,t=!1){this._isUserControllingZoom=!1,this._zoomEnd=xs(e,this.minZoom,this.maxZoom),this._needsUpdate=!0,t||(this._zoom=this._zoomEnd);const i=!t||qt(this._zoom,this._zoomEnd,this.restThreshold);return this._changedZoom=0,this._createOnRestPromise(i)}pan(e,t,i=!1){return console.warn("`pan` has been renamed to `truck`"),this.truck(e,t,i)}truck(e,t,i=!1){this._camera.updateMatrix(),Os.setFromMatrixColumn(this._camera.matrix,0),ks.setFromMatrixColumn(this._camera.matrix,1),Os.multiplyScalar(e),ks.multiplyScalar(-t);const s=bt.copy(Os).add(ks),l=Ut.copy(this._targetEnd).add(s);return this.moveTo(l.x,l.y,l.z,i)}forward(e,t=!1){bt.setFromMatrixColumn(this._camera.matrix,0),bt.crossVectors(this._camera.up,bt),bt.multiplyScalar(e);const i=Ut.copy(this._targetEnd).add(bt);return this.moveTo(i.x,i.y,i.z,t)}elevate(e,t=!1){return bt.copy(this._camera.up).multiplyScalar(e),this.moveTo(this._targetEnd.x+bt.x,this._targetEnd.y+bt.y,this._targetEnd.z+bt.z,t)}moveTo(e,t,i,s=!1){this._isUserControllingTruck=!1;const l=bt.set(e,t,i).sub(this._targetEnd);this._encloseToBoundary(this._targetEnd,l,this.boundaryFriction),this._needsUpdate=!0,s||this._target.copy(this._targetEnd);const h=!s||qt(this._target.x,this._targetEnd.x,this.restThreshold)&&qt(this._target.y,this._targetEnd.y,this.restThreshold)&&qt(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(h)}lookInDirectionOf(e,t,i,s=!1){const u=bt.set(e,t,i).sub(this._targetEnd).normalize().multiplyScalar(-this._sphericalEnd.radius).add(this._targetEnd);return this.setPosition(u.x,u.y,u.z,s)}fitToBox(e,t,{cover:i=!1,paddingLeft:s=0,paddingRight:l=0,paddingBottom:h=0,paddingTop:u=0}={}){const f=[],g=e.isBox3?_l.copy(e):_l.setFromObject(e);g.isEmpty()&&(console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"),Promise.resolve());const A=lw(this._sphericalEnd.theta,ow),_=lw(this._sphericalEnd.phi,ow);f.push(this.rotateTo(A,_,t));const y=bt.setFromSpherical(this._sphericalEnd).normalize(),v=pw.setFromUnitVectors(y,Zm),w=qt(Math.abs(y.y),1);w&&v.multiply(tA.setFromAxisAngle(hf,A)),v.multiply(this._yAxisUpSpaceInverse);const T=fw.makeEmpty();Ut.copy(g.min).applyQuaternion(v),T.expandByPoint(Ut),Ut.copy(g.min).setX(g.max.x).applyQuaternion(v),T.expandByPoint(Ut),Ut.copy(g.min).setY(g.max.y).applyQuaternion(v),T.expandByPoint(Ut),Ut.copy(g.max).setZ(g.min.z).applyQuaternion(v),T.expandByPoint(Ut),Ut.copy(g.min).setZ(g.max.z).applyQuaternion(v),T.expandByPoint(Ut),Ut.copy(g.max).setY(g.min.y).applyQuaternion(v),T.expandByPoint(Ut),Ut.copy(g.max).setX(g.min.x).applyQuaternion(v),T.expandByPoint(Ut),Ut.copy(g.max).applyQuaternion(v),T.expandByPoint(Ut),T.min.x-=s,T.min.y-=h,T.max.x+=l,T.max.y+=u,v.setFromUnitVectors(Zm,y),w&&v.premultiply(tA.invert()),v.premultiply(this._yAxisUpSpace);const C=T.getSize(bt),E=T.getCenter(Ut).applyQuaternion(v);if(Ha(this._camera)){const M=this.getDistanceToFitBox(C.x,C.y,C.z,i);f.push(this.moveTo(E.x,E.y,E.z,t)),f.push(this.dollyTo(M,t)),f.push(this.setFocalOffset(0,0,0,t))}else if(Zr(this._camera)){const M=this._camera,I=M.right-M.left,P=M.top-M.bottom,N=i?Math.max(I/C.x,P/C.y):Math.min(I/C.x,P/C.y);f.push(this.moveTo(E.x,E.y,E.z,t)),f.push(this.zoomTo(N,t)),f.push(this.setFocalOffset(0,0,0,t))}return Promise.all(f)}fitToSphere(e,t){const i=[],l="isObject3D"in e?tc.createBoundingSphere(e,eA):eA.copy(e);if(i.push(this.moveTo(l.center.x,l.center.y,l.center.z,t)),Ha(this._camera)){const h=this.getDistanceToFitSphere(l.radius);i.push(this.dollyTo(h,t))}else if(Zr(this._camera)){const h=this._camera.right-this._camera.left,u=this._camera.top-this._camera.bottom,f=2*l.radius,g=Math.min(h/f,u/f);i.push(this.zoomTo(g,t))}return i.push(this.setFocalOffset(0,0,0,t)),Promise.all(i)}setLookAt(e,t,i,s,l,h,u=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=gl.NONE,this._changedDolly=0;const f=Ut.set(s,l,h),g=bt.set(e,t,i);this._targetEnd.copy(f),this._sphericalEnd.setFromVector3(g.sub(f).applyQuaternion(this._yAxisUpSpace)),this._needsUpdate=!0,u||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const A=!u||qt(this._target.x,this._targetEnd.x,this.restThreshold)&&qt(this._target.y,this._targetEnd.y,this.restThreshold)&&qt(this._target.z,this._targetEnd.z,this.restThreshold)&&qt(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&qt(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&qt(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(A)}lerp(e,t,i,s=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=gl.NONE,this._changedDolly=0;const l=bt.set(...e.target);if("spherical"in e)Gn.set(...e.spherical);else{const _=Ut.set(...e.position);Gn.setFromVector3(_.sub(l).applyQuaternion(this._yAxisUpSpace))}const h=ml.set(...t.target);if("spherical"in t)Al.set(...t.spherical);else{const _=Ut.set(...t.position);Al.setFromVector3(_.sub(h).applyQuaternion(this._yAxisUpSpace))}this._targetEnd.copy(l.lerp(h,i));const u=Al.theta-Gn.theta,f=Al.phi-Gn.phi,g=Al.radius-Gn.radius;this._sphericalEnd.set(Gn.radius+g*i,Gn.phi+f*i,Gn.theta+u*i),this._needsUpdate=!0,s||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const A=!s||qt(this._target.x,this._targetEnd.x,this.restThreshold)&&qt(this._target.y,this._targetEnd.y,this.restThreshold)&&qt(this._target.z,this._targetEnd.z,this.restThreshold)&&qt(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&qt(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&qt(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(A)}lerpLookAt(e,t,i,s,l,h,u,f,g,A,_,y,v,w=!1){return this.lerp({position:[e,t,i],target:[s,l,h]},{position:[u,f,g],target:[A,_,y]},v,w)}setPosition(e,t,i,s=!1){return this.setLookAt(e,t,i,this._targetEnd.x,this._targetEnd.y,this._targetEnd.z,s)}setTarget(e,t,i,s=!1){const l=this.getPosition(bt),h=this.setLookAt(l.x,l.y,l.z,e,t,i,s);return this._sphericalEnd.phi=xs(this._sphericalEnd.phi,this.minPolarAngle,this.maxPolarAngle),h}setFocalOffset(e,t,i,s=!1){this._isUserControllingOffset=!1,this._focalOffsetEnd.set(e,t,i),this._needsUpdate=!0,s||this._focalOffset.copy(this._focalOffsetEnd);const l=!s||qt(this._focalOffset.x,this._focalOffsetEnd.x,this.restThreshold)&&qt(this._focalOffset.y,this._focalOffsetEnd.y,this.restThreshold)&&qt(this._focalOffset.z,this._focalOffsetEnd.z,this.restThreshold);return this._createOnRestPromise(l)}setOrbitPoint(e,t,i){this._camera.updateMatrixWorld(),Os.setFromMatrixColumn(this._camera.matrixWorldInverse,0),ks.setFromMatrixColumn(this._camera.matrixWorldInverse,1),Va.setFromMatrixColumn(this._camera.matrixWorldInverse,2);const s=bt.set(e,t,i),l=s.distanceTo(this._camera.position),h=s.sub(this._camera.position);Os.multiplyScalar(h.x),ks.multiplyScalar(h.y),Va.multiplyScalar(h.z),bt.copy(Os).add(ks).add(Va),bt.z=bt.z+l,this.dollyTo(l,!1),this.setFocalOffset(-bt.x,bt.y,-bt.z,!1),this.moveTo(e,t,i,!1)}setBoundary(e){if(!e){this._boundary.min.set(-1/0,-1/0,-1/0),this._boundary.max.set(1/0,1/0,1/0),this._needsUpdate=!0;return}this._boundary.copy(e),this._boundary.clampPoint(this._targetEnd,this._targetEnd),this._needsUpdate=!0}setViewport(e,t,i,s){if(e===null){this._viewport=null;return}this._viewport=this._viewport||new At.Vector4,typeof e=="number"?this._viewport.set(e,t,i,s):this._viewport.copy(e)}getDistanceToFitBox(e,t,i,s=!1){if(Jm(this._camera,"getDistanceToFitBox"))return this._spherical.radius;const l=e/t,h=this._camera.getEffectiveFOV()*bh,u=this._camera.aspect;return((s?l>u:l<u)?t:e/u)*.5/Math.tan(h*.5)+i*.5}getDistanceToFitSphere(e){if(Jm(this._camera,"getDistanceToFitSphere"))return this._spherical.radius;const t=this._camera.getEffectiveFOV()*bh,i=Math.atan(Math.tan(t*.5)*this._camera.aspect)*2,s=1<this._camera.aspect?t:i;return e/Math.sin(s*.5)}getTarget(e,t=!0){return(e&&e.isVector3?e:new At.Vector3).copy(t?this._targetEnd:this._target)}getPosition(e,t=!0){return(e&&e.isVector3?e:new At.Vector3).setFromSpherical(t?this._sphericalEnd:this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(t?this._targetEnd:this._target)}getSpherical(e,t=!0){return(e||new At.Spherical).copy(t?this._sphericalEnd:this._spherical)}getFocalOffset(e,t=!0){return(e&&e.isVector3?e:new At.Vector3).copy(t?this._focalOffsetEnd:this._focalOffset)}normalizeRotations(){return this._sphericalEnd.theta=(this._sphericalEnd.theta%Yr+Yr)%Yr,this._sphericalEnd.theta>Math.PI&&(this._sphericalEnd.theta-=Yr),this._spherical.theta+=Yr*Math.round((this._sphericalEnd.theta-this._spherical.theta)/Yr),this}stop(){this._focalOffset.copy(this._focalOffsetEnd),this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd),this._zoom=this._zoomEnd}reset(e=!1){if(!qt(this._camera.up.x,this._cameraUp0.x)||!qt(this._camera.up.y,this._cameraUp0.y)||!qt(this._camera.up.z,this._cameraUp0.z)){this._camera.up.copy(this._cameraUp0);const i=this.getPosition(bt);this.updateCameraUp(),this.setPosition(i.x,i.y,i.z)}const t=[this.setLookAt(this._position0.x,this._position0.y,this._position0.z,this._target0.x,this._target0.y,this._target0.z,e),this.setFocalOffset(this._focalOffset0.x,this._focalOffset0.y,this._focalOffset0.z,e),this.zoomTo(this._zoom0,e)];return Promise.all(t)}saveState(){this._cameraUp0.copy(this._camera.up),this.getTarget(this._target0),this.getPosition(this._position0),this._zoom0=this._zoom,this._focalOffset0.copy(this._focalOffset)}updateCameraUp(){this._yAxisUpSpace.setFromUnitVectors(this._camera.up,hf),this._yAxisUpSpaceInverse.copy(this._yAxisUpSpace).invert()}applyCameraUp(){const e=bt.subVectors(this._target,this._camera.position).normalize(),t=Ut.crossVectors(e,this._camera.up);this._camera.up.crossVectors(t,e).normalize(),this._camera.updateMatrixWorld();const i=this.getPosition(bt);this.updateCameraUp(),this.setPosition(i.x,i.y,i.z)}update(e){const t=this._sphericalEnd.theta-this._spherical.theta,i=this._sphericalEnd.phi-this._spherical.phi,s=this._sphericalEnd.radius-this._spherical.radius,l=uw.subVectors(this._targetEnd,this._target),h=dw.subVectors(this._focalOffsetEnd,this._focalOffset),u=this._zoomEnd-this._zoom;if(si(t))this._thetaVelocity.value=0,this._spherical.theta=this._sphericalEnd.theta;else{const _=this._isUserControllingRotate?this.draggingSmoothTime:this.smoothTime;this._spherical.theta=lf(this._spherical.theta,this._sphericalEnd.theta,this._thetaVelocity,_,1/0,e),this._needsUpdate=!0}if(si(i))this._phiVelocity.value=0,this._spherical.phi=this._sphericalEnd.phi;else{const _=this._isUserControllingRotate?this.draggingSmoothTime:this.smoothTime;this._spherical.phi=lf(this._spherical.phi,this._sphericalEnd.phi,this._phiVelocity,_,1/0,e),this._needsUpdate=!0}if(si(s))this._radiusVelocity.value=0,this._spherical.radius=this._sphericalEnd.radius;else{const _=this._isUserControllingDolly?this.draggingSmoothTime:this.smoothTime;this._spherical.radius=lf(this._spherical.radius,this._sphericalEnd.radius,this._radiusVelocity,_,this.maxSpeed,e),this._needsUpdate=!0}if(si(l.x)&&si(l.y)&&si(l.z))this._targetVelocity.set(0,0,0),this._target.copy(this._targetEnd);else{const _=this._isUserControllingTruck?this.draggingSmoothTime:this.smoothTime;cw(this._target,this._targetEnd,this._targetVelocity,_,this.maxSpeed,e,this._target),this._needsUpdate=!0}if(si(h.x)&&si(h.y)&&si(h.z))this._focalOffsetVelocity.set(0,0,0),this._focalOffset.copy(this._focalOffsetEnd);else{const _=this._isUserControllingOffset?this.draggingSmoothTime:this.smoothTime;cw(this._focalOffset,this._focalOffsetEnd,this._focalOffsetVelocity,_,this.maxSpeed,e,this._focalOffset),this._needsUpdate=!0}if(si(u))this._zoomVelocity.value=0,this._zoom=this._zoomEnd;else{const _=this._isUserControllingZoom?this.draggingSmoothTime:this.smoothTime;this._zoom=lf(this._zoom,this._zoomEnd,this._zoomVelocity,_,1/0,e)}if(this.dollyToCursor){if(Ha(this._camera)&&this._changedDolly!==0){const _=this._spherical.radius-this._lastDistance,y=this._camera,v=this._getCameraDirection(Eh),w=bt.copy(v).cross(y.up).normalize();w.lengthSq()===0&&(w.x=1);const T=Ut.crossVectors(w,v),C=this._sphericalEnd.radius*Math.tan(y.getEffectiveFOV()*bh*.5),M=(this._sphericalEnd.radius-_-this._sphericalEnd.radius)/this._sphericalEnd.radius,I=ml.copy(this._targetEnd).add(w.multiplyScalar(this._dollyControlCoord.x*C*y.aspect)).add(T.multiplyScalar(this._dollyControlCoord.y*C)),P=bt.copy(this._targetEnd).lerp(I,M),N=this._lastDollyDirection===gl.IN&&this._spherical.radius<=this.minDistance,$=this._lastDollyDirection===gl.OUT&&this.maxDistance<=this._spherical.radius;if(this.infinityDolly&&(N||$)){this._sphericalEnd.radius-=_,this._spherical.radius-=_;const G=Ut.copy(v).multiplyScalar(-_);P.add(G)}this._boundary.clampPoint(P,P);const Q=Ut.subVectors(P,this._targetEnd);this._targetEnd.copy(P),this._target.add(Q),this._changedDolly-=_,si(this._changedDolly)&&(this._changedDolly=0)}else if(Zr(this._camera)&&this._changedZoom!==0){const _=this._zoom-this._lastZoom,y=this._camera,v=bt.set(this._dollyControlCoord.x,this._dollyControlCoord.y,(y.near+y.far)/(y.near-y.far)).unproject(y),w=Ut.set(0,0,-1).applyQuaternion(y.quaternion),T=ml.copy(v).add(w.multiplyScalar(-v.dot(y.up))),E=-(this._zoom-_-this._zoom)/this._zoom,M=this._getCameraDirection(Eh),I=this._targetEnd.dot(M),P=bt.copy(this._targetEnd).lerp(T,E),N=P.dot(M),$=M.multiplyScalar(N-I);P.sub($),this._boundary.clampPoint(P,P);const Q=Ut.subVectors(P,this._targetEnd);this._targetEnd.copy(P),this._target.add(Q),this._changedZoom-=_,si(this._changedZoom)&&(this._changedZoom=0)}}this._camera.zoom!==this._zoom&&(this._camera.zoom=this._zoom,this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0),this._dragNeedsUpdate=!0;const f=this._collisionTest();this._spherical.radius=Math.min(this._spherical.radius,f),this._spherical.makeSafe(),this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target),this._camera.lookAt(this._target),(!si(this._focalOffset.x)||!si(this._focalOffset.y)||!si(this._focalOffset.z))&&(this._camera.matrix.compose(this._camera.position,this._camera.quaternion,this._camera.scale),Os.setFromMatrixColumn(this._camera.matrix,0),ks.setFromMatrixColumn(this._camera.matrix,1),Va.setFromMatrixColumn(this._camera.matrix,2),Os.multiplyScalar(this._focalOffset.x),ks.multiplyScalar(-this._focalOffset.y),Va.multiplyScalar(this._focalOffset.z),bt.copy(Os).add(ks).add(Va),this._camera.position.add(bt),this._camera.updateMatrixWorld()),this._boundaryEnclosesCamera&&this._encloseToBoundary(this._camera.position.copy(this._target),bt.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse),1);const A=this._needsUpdate;return A&&!this._updatedLastTime?(this._hasRested=!1,this.dispatchEvent({type:"wake"}),this.dispatchEvent({type:"update"})):A?(this.dispatchEvent({type:"update"}),si(t,this.restThreshold)&&si(i,this.restThreshold)&&si(s,this.restThreshold)&&si(l.x,this.restThreshold)&&si(l.y,this.restThreshold)&&si(l.z,this.restThreshold)&&si(h.x,this.restThreshold)&&si(h.y,this.restThreshold)&&si(h.z,this.restThreshold)&&si(u,this.restThreshold)&&!this._hasRested&&(this._hasRested=!0,this.dispatchEvent({type:"rest"}))):!A&&this._updatedLastTime&&this.dispatchEvent({type:"sleep"}),this._lastDistance=this._spherical.radius,this._lastZoom=this._zoom,this._updatedLastTime=A,this._needsUpdate=!1,A}toJSON(){return JSON.stringify({enabled:this._enabled,minDistance:this.minDistance,maxDistance:xh(this.maxDistance),minZoom:this.minZoom,maxZoom:xh(this.maxZoom),minPolarAngle:this.minPolarAngle,maxPolarAngle:xh(this.maxPolarAngle),minAzimuthAngle:xh(this.minAzimuthAngle),maxAzimuthAngle:xh(this.maxAzimuthAngle),smoothTime:this.smoothTime,draggingSmoothTime:this.draggingSmoothTime,dollySpeed:this.dollySpeed,truckSpeed:this.truckSpeed,dollyToCursor:this.dollyToCursor,target:this._targetEnd.toArray(),position:bt.setFromSpherical(this._sphericalEnd).add(this._targetEnd).toArray(),zoom:this._zoomEnd,focalOffset:this._focalOffsetEnd.toArray(),target0:this._target0.toArray(),position0:this._position0.toArray(),zoom0:this._zoom0,focalOffset0:this._focalOffset0.toArray()})}fromJSON(e,t=!1){const i=JSON.parse(e);this.enabled=i.enabled,this.minDistance=i.minDistance,this.maxDistance=wh(i.maxDistance),this.minZoom=i.minZoom,this.maxZoom=wh(i.maxZoom),this.minPolarAngle=i.minPolarAngle,this.maxPolarAngle=wh(i.maxPolarAngle),this.minAzimuthAngle=wh(i.minAzimuthAngle),this.maxAzimuthAngle=wh(i.maxAzimuthAngle),this.smoothTime=i.smoothTime,this.draggingSmoothTime=i.draggingSmoothTime,this.dollySpeed=i.dollySpeed,this.truckSpeed=i.truckSpeed,this.dollyToCursor=i.dollyToCursor,this._target0.fromArray(i.target0),this._position0.fromArray(i.position0),this._zoom0=i.zoom0,this._focalOffset0.fromArray(i.focalOffset0),this.moveTo(i.target[0],i.target[1],i.target[2],t),Gn.setFromVector3(bt.fromArray(i.position).sub(this._targetEnd).applyQuaternion(this._yAxisUpSpace)),this.rotateTo(Gn.theta,Gn.phi,t),this.dollyTo(Gn.radius,t),this.zoomTo(i.zoom,t),this.setFocalOffset(i.focalOffset[0],i.focalOffset[1],i.focalOffset[2],t),this._needsUpdate=!0}connect(e){if(this._domElement){console.warn("camera-controls is already connected.");return}e.setAttribute("data-camera-controls-version",Yz),this._addAllEventListeners(e),this._getClientRect(this._elementRect)}disconnect(){this.cancel(),this._removeAllEventListeners(),this._domElement&&(this._domElement.removeAttribute("data-camera-controls-version"),this._domElement=void 0)}dispose(){this.removeAllEventListeners(),this.disconnect()}_getTargetDirection(e){return e.setFromSpherical(this._spherical).divideScalar(this._spherical.radius).applyQuaternion(this._yAxisUpSpaceInverse)}_getCameraDirection(e){return this._getTargetDirection(e).negate()}_findPointerById(e){return this._activePointers.find(t=>t.pointerId===e)}_findPointerByMouseButton(e){return this._activePointers.find(t=>t.mouseButton===e)}_disposePointer(e){this._activePointers.splice(this._activePointers.indexOf(e),1)}_encloseToBoundary(e,t,i){const s=t.lengthSq();if(s===0)return e;const l=Ut.copy(t).add(e),u=this._boundary.clampPoint(l,ml).sub(l),f=u.lengthSq();if(f===0)return e.add(t);if(f===s)return e;if(i===0)return e.add(t).add(u);{const g=1+i*f/t.dot(u);return e.add(Ut.copy(t).multiplyScalar(g)).add(u.multiplyScalar(1-i))}}_updateNearPlaneCorners(){if(Ha(this._camera)){const e=this._camera,t=e.near,i=e.getEffectiveFOV()*bh,s=Math.tan(i*.5)*t,l=s*e.aspect;this._nearPlaneCorners[0].set(-l,-s,0),this._nearPlaneCorners[1].set(l,-s,0),this._nearPlaneCorners[2].set(l,s,0),this._nearPlaneCorners[3].set(-l,s,0)}else if(Zr(this._camera)){const e=this._camera,t=1/e.zoom,i=e.left*t,s=e.right*t,l=e.top*t,h=e.bottom*t;this._nearPlaneCorners[0].set(i,l,0),this._nearPlaneCorners[1].set(s,l,0),this._nearPlaneCorners[2].set(s,h,0),this._nearPlaneCorners[3].set(i,h,0)}}_truckInternal=(e,t,i,s)=>{let l,h;if(Ha(this._camera)){const u=bt.copy(this._camera.position).sub(this._target),f=this._camera.getEffectiveFOV()*bh,g=u.length()*Math.tan(f*.5);l=this.truckSpeed*e*g/this._elementRect.height,h=this.truckSpeed*t*g/this._elementRect.height}else if(Zr(this._camera)){const u=this._camera;l=this.truckSpeed*e*(u.right-u.left)/u.zoom/this._elementRect.width,h=this.truckSpeed*t*(u.top-u.bottom)/u.zoom/this._elementRect.height}else return;s?(i?this.setFocalOffset(this._focalOffsetEnd.x+l,this._focalOffsetEnd.y,this._focalOffsetEnd.z,!0):this.truck(l,0,!0),this.forward(-h,!0)):i?this.setFocalOffset(this._focalOffsetEnd.x+l,this._focalOffsetEnd.y+h,this._focalOffsetEnd.z,!0):this.truck(l,h,!0)};_rotateInternal=(e,t)=>{const i=Yr*this.azimuthRotateSpeed*e/this._elementRect.height,s=Yr*this.polarRotateSpeed*t/this._elementRect.height;this.rotate(i,s,!0)};_dollyInternal=(e,t,i)=>{const s=Math.pow(.95,-e*this.dollySpeed),l=this._sphericalEnd.radius,h=this._sphericalEnd.radius*s,u=xs(h,this.minDistance,this.maxDistance),f=u-h;this.infinityDolly&&this.dollyToCursor?this._dollyToNoClamp(h,!0):this.infinityDolly&&!this.dollyToCursor?(this.dollyInFixed(f,!0),this._dollyToNoClamp(u,!0)):this._dollyToNoClamp(u,!0),this.dollyToCursor&&(this._changedDolly+=(this.infinityDolly?h:u)-l,this._dollyControlCoord.set(t,i)),this._lastDollyDirection=Math.sign(-e)};_zoomInternal=(e,t,i)=>{const s=Math.pow(.95,e*this.dollySpeed),l=this._zoom,h=this._zoom*s;this.zoomTo(h,!0),this.dollyToCursor&&(this._changedZoom+=h-l,this._dollyControlCoord.set(t,i))};_collisionTest(){let e=1/0;if(!(this.colliderMeshes.length>=1)||Jm(this._camera,"_collisionTest"))return e;const i=this._getTargetDirection(Eh);iA.lookAt(hw,i,this._camera.up);for(let s=0;s<4;s++){const l=Ut.copy(this._nearPlaneCorners[s]);l.applyMatrix4(iA);const h=ml.addVectors(this._target,l);uf.set(h,i),uf.far=this._spherical.radius+1;const u=uf.intersectObjects(this.colliderMeshes);u.length!==0&&u[0].distance<e&&(e=u[0].distance)}return e}_getClientRect(e){if(!this._domElement)return;const t=this._domElement.getBoundingClientRect();return e.x=t.left,e.y=t.top,this._viewport?(e.x+=this._viewport.x,e.y+=t.height-this._viewport.w-this._viewport.y,e.width=this._viewport.z,e.height=this._viewport.w):(e.width=t.width,e.height=t.height),e}_createOnRestPromise(e){return e?Promise.resolve():(this._hasRested=!1,this.dispatchEvent({type:"transitionstart"}),new Promise(t=>{const i=()=>{this.removeEventListener("rest",i),t()};this.addEventListener("rest",i)}))}_addAllEventListeners(e){}_removeAllEventListeners(){}get dampingFactor(){return console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead."),0}set dampingFactor(e){console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead.")}get draggingDampingFactor(){return console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead."),0}set draggingDampingFactor(e){console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead.")}static createBoundingSphere(e,t=new At.Sphere){const i=t,s=i.center;_l.makeEmpty(),e.traverseVisible(h=>{h.isMesh&&_l.expandByObject(h)}),_l.getCenter(s);let l=0;return e.traverseVisible(h=>{if(!h.isMesh)return;const u=h;if(!u.geometry)return;const f=u.geometry.clone();f.applyMatrix4(u.matrixWorld);const A=f.attributes.position;for(let _=0,y=A.count;_<y;_++)bt.fromBufferAttribute(A,_),l=Math.max(l,s.distanceToSquared(bt))}),i.radius=Math.sqrt(l),i}}class gw{constructor(e){this.__position=new ee,this.__target=new ee,this.setPosition(e.position.x,e.position.y,e.position.z),this.setTarget(e.target.x,e.target.y,e.target.z)}getPosition(){return this.__position}setPosition(e,t,i){this.__position.setX(e),this.__position.setY(t),this.__position.setZ(i)}getTarget(){return this.__target}setTarget(e,t,i){this.__target.setX(e),this.__target.setY(t),this.__target.setZ(i)}}class $p extends ty{constructor({appWcRef:e}){super({appWcRef:e}),this._loggerContext="CAMERA MANAGER",this.__cameras={},this.__mainRenderer={},this.__mainCameraControls={},this.__cameraDirection=new ee,this.__cameraSpherical=new So,this.__savedCameraState={position:new ee,target:new ee,focalLength:0},this.__currentCameraPosition=new ee,this.__currentTargetPosition=new ee,this.__touchScrollState=null,this.__pointerZoomEnabled=!1,this.__dispatchingSyntheticWheel=!1}static{this.TAU=Math.PI*2}get dollyWithModifierKeyOnly(){return this._appWcRef.productSettings.camera.dollyWithModifierKeyOnly}get cameraActions(){return tc.ACTION}getCameras(){return this.__cameras}get mainCameraControls(){return this.__mainCameraControls}getCurrentCameraTransforms(){return this.__cameras.main.getWorldPosition(this.__currentCameraPosition),this.__mainCameraControls.getTarget(this.__currentTargetPosition),{position:this.__currentCameraPosition,target:this.__currentTargetPosition,focalLength:this.__cameras.main.getFocalLength()}}getCurrentCameraRotation(){return{azimuthAngle:this.__mainCameraControls.azimuthAngle,polarAngle:this.__mainCameraControls.polarAngle,distance:this.__mainCameraControls.distance}}getCameraFocalLength(){return this.__cameras.main.getFocalLength()}setCameraFocalLength(e){this.__cameras.main.setFocalLength(e)}async fitCameraToSceneBounds(e=!0){const t=this._appWcRef.getSceneSphericalBounds().clone();if(t.isEmpty()||t.radius<=0)return;let i=this._appWcRef.productSettings.camera.cameraBoundsMultiplier;return this._appWcRef.cameraBoundsMultiplier!==0&&(i=this._appWcRef.cameraBoundsMultiplier),this._appWcRef.aspectRatio<1&&(i=1),t.radius=t.radius*i,await this.fitCameraToObject({objectToFocus:t,enableTransition:e})}__onMainCameraControlsControlStart(){const e=this.__mainCameraControls,t=e.currentAction===e.mouseButtons?.right||e.currentAction===e.touches?.two;this.__cameraSettings.canPan&&t?this._appWcRef.eventsManager.cameraControlsStart.fire({type:"pan"}):e.currentAction===e.mouseButtons?.left?this._appWcRef.eventsManager.cameraControlsStart.fire({type:"rotate"}):this._appWcRef.eventsManager.cameraControlsStart.fire({type:null}),this._appWcRef.helpOverlayElem.hide()}__onMainCameraControlsControlEnd(){this._appWcRef.eventsManager.inputEnd.fire()}saveCurrentCameraTransforms(){this.__mainCameraControls.getPosition(this.__savedCameraState.position),this.__mainCameraControls.getTarget(this.__savedCameraState.target),this.__savedCameraState.focalLength=this.getCameraFocalLength()}resetCurrentCameraTransformsToLastSavedState(e=!0){this.moveCameraToLocation({newCameraTransforms:this.__savedCameraState,transition:e})}setCameraZoomLimits({minDistance:e,maxDistance:t}){this._appWcRef.productSettings.camera.canZoom===!1&&(e=null,t=null),e===null&&(e=.001),t===null&&(t=1/0);const i=this._appWcRef.getSceneSphericalBounds().radius;i<0||(this.__mainCameraControls.maxDistance=i+t,this.__mainCameraControls.minDistance=Math.min(i+e,i+t))}async zoomIn(e=.1){await this.__mainCameraControls.dolly(e,!0)}async zoomOut(e=.1){await this.__mainCameraControls.dolly(-e,!0)}enableRotationControls(){this.__mainCameraControls.mouseButtons.left=this.cameraActions.ROTATE,this.__mainCameraControls.touches.one=this.cameraActions.TOUCH_ROTATE}disableRotationControls(){this.__mainCameraControls.mouseButtons.left=this.cameraActions.NONE,this.__mainCameraControls.touches.one=this.cameraActions.NONE}enablePanControls(){this.__mainCameraControls.touches.two=this.cameraActions.TOUCH_DOLLY_TRUCK,this.__mainCameraControls.mouseButtons.right=this.cameraActions.TRUCK}disablePanControls(){this.__mainCameraControls.touches.two=this.cameraActions.NONE,this.__mainCameraControls.mouseButtons.right=this.cameraActions.NONE}enableZoomControls(){if(this._appWcRef.disableZoom){this.disableZoomControls();return}this.__pointerZoomEnabled=!0,this.__mainCameraControls.touches.two=this.cameraActions.TOUCH_DOLLY,this.__mainCameraControls.mouseButtons.wheel=this.cameraActions.DOLLY}disableZoomControls(){this.__pointerZoomEnabled=!1,this.__mainCameraControls.touches.two=this.cameraActions.NONE,this.__mainCameraControls.mouseButtons.wheel=this.cameraActions.NONE}enableCameraZoomLimits(e){this.setCameraZoomLimits({minDistance:e.minDistance,maxDistance:e.maxDistance})}disableCameraZoomLimits(){this.setCameraZoomLimits({minDistance:null,maxDistance:null})}enableCameraRotationLimits(e){const{infinitePolarAngle:t,minPolarAngle:i,maxPolarAngle:s,infiniteAzimuthAngle:l,minAzimuthAngle:h,maxAzimuthAngle:u}=e;this.__mainCameraControls.minPolarAngle=t?-1/0:i,this.__mainCameraControls.maxPolarAngle=t?1/0:s,this.__mainCameraControls.minAzimuthAngle=l?-1/0:h,this.__mainCameraControls.maxAzimuthAngle=l?1/0:u}disableCameraRotationLimits(){this.__mainCameraControls.minPolarAngle=-1/0,this.__mainCameraControls.maxPolarAngle=1/0,this.__mainCameraControls.minAzimuthAngle=-1/0,this.__mainCameraControls.maxAzimuthAngle=1/0}updateCameraSettings(e){this.__cameraSettings=JSON.parse(JSON.stringify(e)),this.enableRotationControls();const{canPan:t,canZoom:i}=e;i?this.enableZoomControls():this.disableZoomControls(),t?this.enablePanControls():this.disablePanControls(),this.__mainCameraControls.mouseButtons.middle=this.cameraActions.NONE,this.__mainCameraControls.enabled=!0,this.__cameras.main.setFocalLength(e.focalLength),this.__cameras.main.near=e.nearClip,this.__cameras.main.far=e.farClip,this.enableCameraZoomLimits(e),this.enableCameraRotationLimits(e),this._appWcRef.transparentBackground===!1&&(this.__mainRenderer.setClearColor(e.backgroundColor),this.__mainRenderer.setClearAlpha(e.backgroundAlpha))}normalizeAngle(e){return Dn.euclideanModulo(e,$p.TAU)}absoluteAngle(e,t){const i=e-t;return Dn.euclideanModulo(i+Math.PI,$p.TAU)-Math.PI}async moveCameraToLocation({newCameraTransforms:e,freezeCamera:t=!1,transition:i=!0,targetCameraControlsRef:s=this.__mainCameraControls,ignoreCameraLimits:l=!1}){e instanceof gw||(e=new gw(e));const h=e.getPosition(),u=e.getTarget();if(s.enabled=!1,l===!0)s.setLookAt(h.x,h.y,h.z,u.x,u.y,u.z,i),s.normalizeRotations();else{this.__cameraDirection.set(0,0,0),this.__cameraDirection.subVectors(h,u),this.__cameraDirection.normalize();const f=h.distanceTo(u);this.__cameraSpherical.setFromVector3(this.__cameraDirection);const g=this.absoluteAngle(this.normalizeAngle(this.__cameraSpherical.theta),this.normalizeAngle(s.azimuthAngle)),A=this.absoluteAngle(this.normalizeAngle(this.__cameraSpherical.phi),this.normalizeAngle(s.polarAngle));s.rotate(g,A,i),s.moveTo(u.x,u.y,u.z,i),s.dollyTo(f,i)}t||(s.enabled=!0)}async rotateCameraToLocation({azimuthAngle:e,polarAngle:t,distance:i,transition:s=!0,targetCameraControlsRef:l=this.__mainCameraControls}){e&&l.rotateAzimuthTo(e,s),t&&l.rotatePolarTo(t,s),i&&l.dollyTo(i,s)}async fitCameraToObject({objectToFocus:e,enableTransition:t=!0}){return await this.__mainCameraControls.fitToSphere(e,t)}async wiggleCamera(){const e=this.__mainCameraControls.azimuthAngle,t=[0,.4,-.3,0];for(const i of t){if(!this._appWcRef.playInteractionPrompt)break;await this.__mainCameraControls.rotateAzimuthTo(e+i,!0)}}__onProductSettingsUpdated(){this.updateCameraSettings(this._appWcRef.productSettings.camera),this.fitCameraToSceneBounds()}__onCameraMoveToTransform(e){e.detail.saveFirst&&this.saveCurrentCameraTransforms(),this.moveCameraToLocation({newCameraTransforms:e.detail.cameraTransforms,ignoreCameraLimits:e.detail.ignoreCameraLimits})}__onSceneBoundsChanged(){this.__mainCameraControls.setBoundary(this._appWcRef.getSceneBounds())}__setupTouchScrollDetection(){if(!("ontouchstart"in window||navigator.maxTouchPoints>0))return;const t=this.__mainRenderer.domElement,i=this.__mainCameraControls;t.style.touchAction="pan-y",new MutationObserver(()=>{t.style.touchAction!=="pan-y"&&(t.style.touchAction="pan-y")}).observe(t,{attributeFilter:["style"]});const l=5,h=new Set;t.addEventListener("pointerdown",f=>{if(f.pointerType==="touch"){if(h.add(f.pointerId),h.size>1){this.__touchScrollState=null;return}this.__touchScrollState={startX:f.clientX,startY:f.clientY,decided:!1,isVerticalScroll:!1}}}),document.addEventListener("pointermove",f=>{if(!(!this.__touchScrollState||f.pointerType!=="touch")){if(h.size>1){this.__touchScrollState=null;return}if(!this.__touchScrollState.decided){const g=Math.abs(f.clientX-this.__touchScrollState.startX),A=Math.abs(f.clientY-this.__touchScrollState.startY);if(g<l&&A<l)return;this.__touchScrollState.decided=!0,this.__touchScrollState.isVerticalScroll=A>g,this.__touchScrollState.isVerticalScroll&&i.cancel()}this.__touchScrollState.isVerticalScroll&&f.stopImmediatePropagation()}},{capture:!0});const u=f=>{f.pointerType==="touch"&&(h.delete(f.pointerId),h.size===0&&(this.__touchScrollState=null))};document.addEventListener("pointerup",u,{capture:!0}),document.addEventListener("pointercancel",u,{capture:!0})}__onWheel(e){if(this.__dispatchingSyntheticWheel||!this.__pointerZoomEnabled)return;const t=this._appWcRef.isMac&&e.metaKey||e.ctrlKey;if(this.dollyWithModifierKeyOnly&&!t){e.stopImmediatePropagation(),this._appWcRef.helpOverlayElem.show();return}if(!t)return;e.preventDefault(),e.stopImmediatePropagation();const i=new WheelEvent("wheel",{deltaX:e.deltaX,deltaY:e.deltaY,deltaZ:e.deltaZ,deltaMode:e.deltaMode,clientX:e.clientX,clientY:e.clientY,screenX:e.screenX,screenY:e.screenY,ctrlKey:!1,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:!1,bubbles:e.bubbles,cancelable:e.cancelable});this.__dispatchingSyntheticWheel=!0,e.target?.dispatchEvent(i),this.__dispatchingSyntheticWheel=!1,this._appWcRef.helpOverlayElem.hide()}__setupTrackpadPinchAsDollyHandler(){this.__mainRenderer.domElement.addEventListener("wheel",this.__onWheel.bind(this),{passive:!1})}__setupEventListeners(){this.__setupTouchScrollDetection(),this.__mainCameraControls.addEventListener("controlstart",()=>{this.__onMainCameraControlsControlStart()}),this.__mainCameraControls.addEventListener("controlend",()=>{this.__onMainCameraControlsControlEnd()}),this._appWcRef.addEventListener(this._appWcRef.eventsManager.cameraProductSettingUpdatedEvent.name,this.__onProductSettingsUpdated.bind(this)),this._appWcRef.addEventListener(this._appWcRef.eventsManager.cameraMoveToTransform.name,this.__onCameraMoveToTransform.bind(this)),this._appWcRef.addEventListener(this._appWcRef.eventsManager.sceneBoundsChanged.name,this.__onSceneBoundsChanged.bind(this))}async setup({mainRenderer:e}){this.__mainRenderer=e;const t=new Yi(75,window.innerWidth/window.innerHeight,.1,1e3);this.__cameras={main:t,screenshot:t.clone()},this.__cameras.main.name="MainCamera",this.__cameras.screenshot.name="ScreenshotCamera",this.__cameras.main.position.setZ(1);const i={Vector2:Re,Vector3:ee,Vector4:ri,Quaternion:Zi,Matrix4:pt,Spherical:So,Box3:Di,Sphere:kn,Raycaster:Gv};tc.install({THREE:i}),this.__setupTrackpadPinchAsDollyHandler(),this.__mainCameraControls=new tc(this.__cameras.main,e.domElement),this.__setupEventListeners()}}const Jz='@font-face{font-family:Helvetica Neue;src:url(https://asset.myepigraph.com/design-assets/fonts/HelveticaNeue/HelveticaNeue-Light.otf) format("opentype");font-weight:300;font-style:normal;font-display:swap}@font-face{font-family:PPMori-Regular;src:url(https://asset.myepigraph.com/design-assets/fonts/PPMori/PPMori-Regular.woff2) format("woff2");font-display:swap}@font-face{font-family:PPMori-Bold;src:url(https://asset.myepigraph.com/design-assets/fonts/PPMori/PPMori-Bold.woff2) format("woff2");font-display:swap}@font-face{font-family:Inter;src:url(https://asset.myepigraph.com/design-assets/fonts/Inter/Inter-VariableFont_slnt_wght.ttf) format("truetype");font-weight:300;font-style:normal;font-display:swap}@font-face{font-family:Inter;src:url(https://asset.myepigraph.com/design-assets/fonts/Inter/Inter_18pt-Bold.ttf) format("truetype");font-weight:700;font-style:normal;font-display:swap}',Zz={Color:{Black:{25:{$type:"color",$value:"rgba(0, 0, 0, 0.0000)"},50:{$type:"color",$value:"rgba(0, 0, 0, 0.0500)"},100:{$type:"color",$value:"rgba(0, 0, 0, 0.1000)"},200:{$type:"color",$value:"rgba(0, 0, 0, 0.2000)"},300:{$type:"color",$value:"rgba(0, 0, 0, 0.3000)"},400:{$type:"color",$value:"rgba(0, 0, 0, 0.4000)"},500:{$type:"color",$value:"rgba(0, 0, 0, 0.5000)"},600:{$type:"color",$value:"rgba(0, 0, 0, 0.6000)"},700:{$type:"color",$value:"rgba(0, 0, 0, 0.7000)"},800:{$type:"color",$value:"rgba(0, 0, 0, 0.8000)"},900:{$type:"color",$value:"rgba(0, 0, 0, 0.9000)"},1e3:{$type:"color",$value:"#000000"}},White:{25:{$type:"color",$value:"rgba(255, 255, 255, 0.0250)"},50:{$type:"color",$value:"rgba(255, 255, 255, 0.0500)"},100:{$type:"color",$value:"rgba(255, 255, 255, 0.1000)"},200:{$type:"color",$value:"rgba(255, 255, 255, 0.2000)"},300:{$type:"color",$value:"rgba(255, 255, 255, 0.3000)"},400:{$type:"color",$value:"rgba(255, 255, 255, 0.4000)"},500:{$type:"color",$value:"rgba(255, 255, 255, 0.5000)"},600:{$type:"color",$value:"rgba(255, 255, 255, 0.6000)"},700:{$type:"color",$value:"rgba(255, 255, 255, 0.7000)"},800:{$type:"color",$value:"rgba(255, 255, 255, 0.8000)"},900:{$type:"color",$value:"rgba(255, 255, 255, 0.9000)"},1e3:{$type:"color",$value:"#ffffff"}},Green:{100:{$type:"color",$value:"#ebffee"},200:{$type:"color",$value:"#cff7d3"},300:{$type:"color",$value:"#aff4c6"},400:{$type:"color",$value:"#85e0a3"},500:{$type:"color",$value:"#14ae5c"},600:{$type:"color",$value:"#009951"},700:{$type:"color",$value:"#008043"},800:{$type:"color",$value:"#02542d"},900:{$type:"color",$value:"#024023"},1e3:{$type:"color",$value:"#062d1b"}},Red:{100:{$type:"color",$value:"#fee9e7"},200:{$type:"color",$value:"#fdd3d0"},300:{$type:"color",$value:"#fcb3ad"},400:{$type:"color",$value:"#f4776a"},500:{$type:"color",$value:"#ec221f"},600:{$type:"color",$value:"#c00f0c"},700:{$type:"color",$value:"#900b09"},800:{$type:"color",$value:"#690807"},900:{$type:"color",$value:"#4d0b0a"},1e3:{$type:"color",$value:"#300603"}},Yellow:{100:{$type:"color",$value:"#fffbeb"},200:{$type:"color",$value:"#fff1c2"},300:{$type:"color",$value:"#ffe8a3"},400:{$type:"color",$value:"#e8b931"},500:{$type:"color",$value:"#e5a000"},600:{$type:"color",$value:"#bf6a02"},700:{$type:"color",$value:"#975102"},800:{$type:"color",$value:"#682d03"},900:{$type:"color",$value:"#522504"},1e3:{$type:"color",$value:"#401b01"}},Blue:{100:{$type:"color",$value:"#fbfdff"},200:{$type:"color",$value:"#eaf4ff"},300:{$type:"color",$value:"#d5ebff"},400:{$type:"color",$value:"#c0e1ff"},500:{$type:"color",$value:"#91d0ff"},600:{$type:"color",$value:"#0094d5"},700:{$type:"color",$value:"#00679b"},800:{$type:"color",$value:"#003a5a"},900:{$type:"color",$value:"#003a5a"},1e3:{$type:"color",$value:"#002133"}},Slate:{100:{$type:"color",$value:"#f5f5f5"},200:{$type:"color",$value:"#e3e3e3"},300:{$type:"color",$value:"#cdcdcd"},400:{$type:"color",$value:"#b2b2b2"},500:{$type:"color",$value:"#949494"},600:{$type:"color",$value:"#767676"},700:{$type:"color",$value:"#5a5a5a"},800:{$type:"color",$value:"#434343"},900:{$type:"color",$value:"#303030"},1e3:{$type:"color",$value:"#242424"}},Grey:{25:{$type:"color",$value:"#f5f5f5"},50:{$type:"color",$value:"#f2f2f2"},100:{$type:"color",$value:"#e6e6e6"},200:{$type:"color",$value:"#cccccc"},300:{$type:"color",$value:"#b3b3b3"},400:{$type:"color",$value:"#999999"},500:{$type:"color",$value:"#7b7b7b"},600:{$type:"color",$value:"#666666"},700:{$type:"color",$value:"#4d4d4d"},800:{$type:"color",$value:"#333333"},900:{$type:"color",$value:"#1a1a1a"},1e3:{$type:"color",$value:"#0d0d0d"}},GreyAlpha:{25:{$type:"color",$value:"rgba(248, 248, 248, 0.8000)"},100:{$type:"color",$value:"rgba(242, 242, 242, 0.8000)"},500:{$type:"color",$value:"rgba(204, 204, 204, 0.2000)"},700:{$type:"color",$value:"rgba(204, 204, 204, 0.6000)"},800:{$type:"color",$value:"rgba(186, 186, 186, 0.6000)"},900:{$type:"color",$value:"rgba(50, 50, 50, 0.9000)"},"05":{$type:"color",$value:"rgba(253, 253, 253, 0.8000)"}}},Unit:{Space:{0:{$type:"number",$value:"0px"},100:{$type:"number",$value:"4px"},150:{$type:"number",$value:"6px"},200:{$type:"number",$value:"8px"},300:{$type:"number",$value:"12px"},400:{$type:"number",$value:"16px"},500:{$type:"number",$value:"20px"},600:{$type:"number",$value:"24px"},800:{$type:"number",$value:"32px"},1e3:{$type:"number",$value:"40px"},1200:{$type:"number",$value:"48px"},1600:{$type:"number",$value:"64px"},2e3:{$type:"number",$value:"80px"},2400:{$type:"number",$value:"96px"},2800:{$type:"number",$value:"112px"},3200:{$type:"number",$value:"128px"},3600:{$type:"number",$value:"144px"},4e3:{$type:"number",$value:"160px"},4400:{$type:"number",$value:"176px"},4800:{$type:"number",$value:"192px"},5200:{$type:"number",$value:"208px"},5600:{$type:"number",$value:"224px"},6e3:{$type:"number",$value:"240px"},6400:{$type:"number",$value:"256px"},7200:{$type:"number",$value:"288px"},8e3:{$type:"number",$value:"320px"},9600:{$type:"number",$value:"384px"},"0125":{$type:"number",$value:"0.5px"},"025":{$type:"number",$value:"1px"},"0325":{$type:"number",$value:"1.5px"},"050":{$type:"number",$value:"2px"}},Stack:{100:{$type:"number",$value:"-4px"},200:{$type:"number",$value:"-8px"},300:{$type:"number",$value:"-12px"},400:{$type:"number",$value:"-16px"},800:{$type:"number",$value:"-32px"},1e3:{$type:"number",$value:"-40px"},1600:{$type:"number",$value:"-64px"},2400:{$type:"number",$value:"-96px"},3200:{$type:"number",$value:"-128px"},4e3:{$type:"number",$value:"-160px"},4800:{$type:"number",$value:"-192px"},5600:{$type:"number",$value:"-224px"},7200:{$type:"number",$value:"-288px"},9600:{$type:"number",$value:"-384px"},"0125":{$type:"number",$value:"-0.5px"},"025":{$type:"number",$value:"-1px"},"0325":{$type:"number",$value:"-1.5px"},"050":{$type:"number",$value:"-2px"},"075":{$type:"number",$value:"-3px"}},Size:{4:{$type:"number",$value:"4px"},6:{$type:"number",$value:"6px"},8:{$type:"number",$value:"8px"},10:{$type:"number",$value:"10px"},12:{$type:"number",$value:"12px"},14:{$type:"number",$value:"14px"},16:{$type:"number",$value:"16px"},18:{$type:"number",$value:"18px"},20:{$type:"number",$value:"20px"},22:{$type:"number",$value:"22px"},24:{$type:"number",$value:"24px"},28:{$type:"number",$value:"28px"},30:{$type:"number",$value:"30px"},32:{$type:"number",$value:"32px"},40:{$type:"number",$value:"40px"},48:{$type:"number",$value:"48px"},64:{$type:"number",$value:"64px"},80:{$type:"number",$value:"80px"},96:{$type:"number",$value:"96px"},112:{$type:"number",$value:"112px"},128:{$type:"number",$value:"128px"},144:{$type:"number",$value:"144px"},160:{$type:"number",$value:"160px"},176:{$type:"number",$value:"176px"},224:{$type:"number",$value:"224px"}},Resolution:{XxsmallScreenMin:{$type:"number",$value:"375px"},XsmallScreenMin:{$type:"number",$value:"480px"},SmallScreenMin:{$type:"number",$value:"576px"},MediumScreenMin:{$type:"number",$value:"768px"},LargeScreenMin:{$type:"number",$value:"992px"},XlargeScreenMin:{$type:"number",$value:"1200px"},XxlargeScreenMin:{$type:"number",$value:"1400px"},XxxsmallScreenMax:{$type:"number",$value:"374px"},XxsmallScreenMax:{$type:"number",$value:"479px"},XsmallScreenMax:{$type:"number",$value:"575px"},SmallScreenMax:{$type:"number",$value:"767px"},MediumScreenMax:{$type:"number",$value:"991px"},LargeScreenMax:{$type:"number",$value:"1199px"},XlargeScreenMax:{$type:"number",$value:"1399px"},XxlargeScreenMax:{$type:"number",$value:"1920px"}}},Font:{Family:{Main:{$type:"string",$value:"PP Mori"},Body:{$type:"string",$value:"Helvetica LT Pro"},Epigraph:{$type:"string",$value:"PP Mori"}}}},KM={Color:{Brand:{Base:{$type:"color",$value:"#335166",$web:"var(--color-brand-base)"},BaseSecondary:{$type:"color",$value:"#2b4354",$web:"var(--color-brand-base-secondary)"},BaseTertiary:{$type:"color",$value:"#202f3a",$web:"var(--color-brand-base-tertiary)"},Accent:{$type:"color",$value:"#4276cf",$web:"var(--color-brand-accent)"},AccentSecondary:{$type:"color",$value:"#3761a8",$web:"var(--color-brand-accent-secondary)"},AccentTertiary:{$type:"color",$value:"#3761a8",$web:"var(--color-brand-accent-tertiary)"},Light:{$type:"color",$value:"#f8fbf6",$web:"var(--color-brand-light)"},Dark:{$type:"color",$value:"#111b22",$web:"var(--color-brand-dark)"}}},Font:{Brand:{Heading:{$type:"string",$value:"Helvetica Neue",$web:"var(--font-brand-heading)"},Paragraph:{$type:"string",$value:"Inter",$web:"var(--font-brand-body)"}}},Unit:{Brand:{Radius:{$type:"number",$value:"4px",$web:"var(--unit-brand-radius)"}}}},Ce={Color:{Surface:{Plain:{$value:"{Primitives.Color.White.1000}"},NeutralPrimary:{$value:"{Primitives.Color.Grey.100}"},NeutralSecondary:{$value:"{Primitives.Color.Grey.50}"},NeutralTertiary:{$value:"{Primitives.Color.Grey.25}"},ShadowSecondary:{$value:"{Primitives.Color.Black.200}"}},Fill:{Accent:{$value:"{BrandPrimitives.Color.Brand.Accent}"},AccentHover:{$value:"{BrandPrimitives.Color.Brand.AccentSecondary}"},AccentPress:{$value:"{BrandPrimitives.Color.Brand.AccentTertiary}"},Base:{$value:"{BrandPrimitives.Color.Brand.Base}"},BaseHover:{$value:"{BrandPrimitives.Color.Brand.BaseSecondary}"},BasePress:{$value:"{BrandPrimitives.Color.Brand.BaseTertiary}"},NeutralPrimary:{$value:"{Primitives.Color.Grey.700}"},NeutralSecondary:{$value:"{Primitives.Color.Grey.300}"},NeutralTertiary:{$value:"{Primitives.Color.Grey.100}"},SubtlePrimary:{$value:"{Primitives.Color.GreyAlpha.100}"},SubtleSecondary:{$value:"{Primitives.Color.GreyAlpha.25}"},DangerPrimary:{$value:"{Primitives.Color.Red.600}"},Disabled:{$value:"{Primitives.Color.Grey.200}"},HotspotSecondary:{$value:"{Primitives.Color.GreyAlpha.800}"}},Icon:{NeutralPrimary:{$value:"{Primitives.Color.Grey.800}"}},Text:{Invert:{$value:"{Primitives.Color.White.1000}"},NeutralPrimary:{$value:"{Primitives.Color.Grey.800}"},NeutralSecondary:{$value:"{Primitives.Color.Grey.700}"},Disabled:{$value:"{Primitives.Color.Grey.300}"}},Border:{AltContrast:{$value:"{BrandPrimitives.Color.Brand.Dark}"},SubtlePrimary:{$value:"{Primitives.Color.Grey.300}"},SubtleSecondary:{$value:"{Primitives.Color.GreyAlpha.700}"}}},Size:{Text:{Small:{$value:"{Primitives.Unit.Size.16}"},Medium:{$value:"{Primitives.Unit.Size.18}"},Large:{$value:"{Primitives.Unit.Size.20}"}},Icon:{Small:{$value:"{Primitives.Unit.Size.20}"},Medium:{$value:"{Primitives.Unit.Size.24}"},Large:{$value:"{Primitives.Unit.Size.28}"}},Radius:{Medium:{$value:"{Primitives.Unit.Space.150}"},Full:{$value:"{Primitives.Unit.Space.6000}"}},Stroke:{Regular:{$value:"{Primitives.Unit.Space.025}"},Thick:{$value:"{Primitives.Unit.Space.050}"}},Shadow:{None:{$value:"{Primitives.Unit.Space.0}"},Xsmall:{$value:"{Primitives.Unit.Space.025}"},Small:{$value:"{Primitives.Unit.Space.0325}"}},Blur:{Small:{$value:"{Primitives.Unit.Space.100}"}}},Space:{Padding:{Small:{$value:"{Primitives.Unit.Space.300}"},Medium:{$value:"{Primitives.Unit.Space.400}"},Regular:{$value:"{Primitives.Unit.Space.600}"}},Gap:{Small:{$value:"{Primitives.Unit.Space.200}"},Regular:{$value:"{Primitives.Unit.Space.400}"},Xxlarge:{$value:"{Primitives.Unit.Space.800}"}}},Font:{Family:{CustomH:{$value:"{BrandPrimitives.Font.Brand.Heading}"},CustomP:{$value:"{BrandPrimitives.Font.Brand.Paragraph}"},Main:{$value:"Helvetica Neue"}},Tracking:{Normal:{$value:"{Primitives.Unit.Space.0}"}}}};function Ee(n){const e=/\{Primitives\.(.*?)}/,t=String(n).match(e),i=/\{BrandPrimitives\.(.*?)}/,s=String(n).match(i);let l=n;if(t){const h=t[1].split(".");l=Zz[h[0]][h[1]][h[2]].$value}else if(s){const h=s[1].split("."),u=KM[h[0]][h[1]][h[2]],f=u.$web;l=`${f.substring(0,f.length-1)}, ${u.$value})`}return Mn(l)}const ny={poweredByEpigraphFooterText:"https://asset.myepigraph.com/design-assets/icons/powered-by-epigraph.svg",splashScreenLogo:"https://asset.myepigraph.com/design-assets/icons/default-splash-screen-image.svg",sampleQrCode:"https://asset.myepigraph.com/design-assets/icons/sample-qr-code.png"};function e4(){const n={};for(const[e,t]of Object.entries(KM))for(const[i,s]of Object.entries(t))for(const[l,h]of Object.entries(s)){const u=`${e}${i}${l}`;n[u]={name:Mn(h.$web),defaultValue:h.$value,argType:{control:h.$type}}}return n}const t4=e4(),Tc={size:{name:"size",defaultValue:"small",argType:{options:["small","medium","large"],control:"select"}},theme:{name:"theme",defaultValue:"light",argType:{options:["light","dark"],control:"select"}},disabled:{name:"disabled",defaultValue:!1,argType:{control:"boolean"}}};var i4=Object.defineProperty,Hc=(n,e,t,i)=>{for(var s=void 0,l=n.length-1,h;l>=0;l--)(h=n[l])&&(s=h(e,t,s)||s);return s&&i4(e,t,s),s};const Fo=class JM extends Jl{constructor(){super(),this.epgOnClickEventName="epgonclick",this.disabled=!1,this.theme=Tc.theme.defaultValue.toString(),this.size=Tc.size.defaultValue.toString(),JM.ensureFontsAreLoaded(),this.addEventListener("click",this.doClick),this.addEventListener("pointerover",this.doHoverStart),this.addEventListener("pointerleave",this.doHoverEnd)}static{this.styles=[gt`
|
|
4413
|
+
*/const xi={LEFT:1,RIGHT:2,MIDDLE:4},_e=Object.freeze({NONE:0,ROTATE:1,TRUCK:2,SCREEN_PAN:4,OFFSET:8,DOLLY:16,ZOOM:32,TOUCH_ROTATE:64,TOUCH_TRUCK:128,TOUCH_SCREEN_PAN:256,TOUCH_OFFSET:512,TOUCH_DOLLY:1024,TOUCH_ZOOM:2048,TOUCH_DOLLY_TRUCK:4096,TOUCH_DOLLY_SCREEN_PAN:8192,TOUCH_DOLLY_OFFSET:16384,TOUCH_DOLLY_ROTATE:32768,TOUCH_ZOOM_TRUCK:65536,TOUCH_ZOOM_OFFSET:131072,TOUCH_ZOOM_SCREEN_PAN:262144,TOUCH_ZOOM_ROTATE:524288}),gl={NONE:0,IN:1,OUT:-1};function Ha(n){return n.isPerspectiveCamera}function Zr(n){return n.isOrthographicCamera}const Yr=Math.PI*2,ow=Math.PI/2,YM=1e-5,bh=Math.PI/180;function xs(n,e,t){return Math.max(e,Math.min(t,n))}function si(n,e=YM){return Math.abs(n)<e}function qt(n,e,t=YM){return si(n-e,t)}function lw(n,e){return Math.round(n/e)*e}function xh(n){return isFinite(n)?n:n<0?-Number.MAX_VALUE:Number.MAX_VALUE}function wh(n){return Math.abs(n)<Number.MAX_VALUE?n:n*(1/0)}function lf(n,e,t,i,s=1/0,l){i=Math.max(1e-4,i);const h=2/i,u=h*l,f=1/(1+u+.48*u*u+.235*u*u*u);let g=n-e;const A=e,_=s*i;g=xs(g,-_,_),e=n-g;const y=(t.value+h*g)*l;t.value=(t.value-h*y)*f;let v=e+(g+y)*f;return A-n>0==v>A&&(v=A,t.value=(v-A)/l),v}function cw(n,e,t,i,s=1/0,l,h){i=Math.max(1e-4,i);const u=2/i,f=u*l,g=1/(1+f+.48*f*f+.235*f*f*f);let A=e.x,_=e.y,y=e.z,v=n.x-A,w=n.y-_,T=n.z-y;const C=A,E=_,M=y,I=s*i,P=I*I,N=v*v+w*w+T*T;if(N>P){const k=Math.sqrt(N);v=v/k*I,w=w/k*I,T=T/k*I}A=n.x-v,_=n.y-w,y=n.z-T;const $=(t.x+u*v)*l,Q=(t.y+u*w)*l,G=(t.z+u*T)*l;t.x=(t.x-u*$)*g,t.y=(t.y-u*Q)*g,t.z=(t.z-u*G)*g,h.x=A+(v+$)*g,h.y=_+(w+Q)*g,h.z=y+(T+G)*g;const F=C-n.x,z=E-n.y,W=M-n.z,Y=h.x-C,K=h.y-E,a=h.z-M;return F*Y+z*K+W*a>0&&(h.x=C,h.y=E,h.z=M,t.x=(h.x-C)/l,t.y=(h.y-E)/l,t.z=(h.z-M)/l),h}function Km(n,e){e.set(0,0),n.forEach(t=>{e.x+=t.clientX,e.y+=t.clientY}),e.x/=n.length,e.y/=n.length}function Jm(n,e){return Zr(n)?(console.warn(`${e} is not supported in OrthographicCamera`),!0):!1}class Xz{_listeners={};addEventListener(e,t){const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){const i=this._listeners;return i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){const s=this._listeners[e];if(s!==void 0){const l=s.indexOf(t);l!==-1&&s.splice(l,1)}}removeAllEventListeners(e){if(!e){this._listeners={};return}Array.isArray(this._listeners[e])&&(this._listeners[e].length=0)}dispatchEvent(e){const i=this._listeners[e.type];if(i!==void 0){e.target=this;const s=i.slice(0);for(let l=0,h=s.length;l<h;l++)s[l].call(this,e)}}}const Yz="3.1.2",cf=1/8,Kz=/Mac/.test(globalThis?.navigator?.platform);let At,hw,hf,Zm,Ln,bt,Ut,ml,Eh,Os,ks,Va,uw,dw,Gn,Al,_l,fw,eA,pw,tA,iA,uf;class tc extends Xz{static install(e){At=e.THREE,hw=Object.freeze(new At.Vector3(0,0,0)),hf=Object.freeze(new At.Vector3(0,1,0)),Zm=Object.freeze(new At.Vector3(0,0,1)),Ln=new At.Vector2,bt=new At.Vector3,Ut=new At.Vector3,ml=new At.Vector3,Eh=new At.Vector3,Os=new At.Vector3,ks=new At.Vector3,Va=new At.Vector3,uw=new At.Vector3,dw=new At.Vector3,Gn=new At.Spherical,Al=new At.Spherical,_l=new At.Box3,fw=new At.Box3,eA=new At.Sphere,pw=new At.Quaternion,tA=new At.Quaternion,iA=new At.Matrix4,uf=new At.Raycaster}static get ACTION(){return _e}minPolarAngle=0;maxPolarAngle=Math.PI;minAzimuthAngle=-1/0;maxAzimuthAngle=1/0;minDistance=Number.EPSILON;maxDistance=1/0;infinityDolly=!1;minZoom=.01;maxZoom=1/0;smoothTime=.25;draggingSmoothTime=.125;maxSpeed=1/0;azimuthRotateSpeed=1;polarRotateSpeed=1;dollySpeed=1;dollyDragInverted=!1;truckSpeed=2;dollyToCursor=!1;dragToOffset=!1;boundaryFriction=0;restThreshold=.01;colliderMeshes=[];mouseButtons;touches;cancel=()=>{};lockPointer;unlockPointer;_enabled=!0;_camera;_yAxisUpSpace;_yAxisUpSpaceInverse;_state=_e.NONE;_domElement;_viewport=null;_target;_targetEnd;_focalOffset;_focalOffsetEnd;_spherical;_sphericalEnd;_lastDistance;_zoom;_zoomEnd;_lastZoom;_cameraUp0;_target0;_position0;_zoom0;_focalOffset0;_dollyControlCoord;_changedDolly=0;_changedZoom=0;_nearPlaneCorners;_hasRested=!0;_boundary;_boundaryEnclosesCamera=!1;_needsUpdate=!0;_updatedLastTime=!1;_elementRect=new DOMRect;_isDragging=!1;_dragNeedsUpdate=!0;_activePointers=[];_lockedPointer=null;_interactiveArea=new DOMRect(0,0,1,1);_isUserControllingRotate=!1;_isUserControllingDolly=!1;_isUserControllingTruck=!1;_isUserControllingOffset=!1;_isUserControllingZoom=!1;_lastDollyDirection=gl.NONE;_thetaVelocity={value:0};_phiVelocity={value:0};_radiusVelocity={value:0};_targetVelocity=new At.Vector3;_focalOffsetVelocity=new At.Vector3;_zoomVelocity={value:0};set verticalDragToForward(e){console.warn("camera-controls: `verticalDragToForward` was removed. Use `mouseButtons.left = CameraControls.ACTION.SCREEN_PAN` instead.")}constructor(e,t){super(),typeof At>"u"&&console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."),this._camera=e,this._yAxisUpSpace=new At.Quaternion().setFromUnitVectors(this._camera.up,hf),this._yAxisUpSpaceInverse=this._yAxisUpSpace.clone().invert(),this._state=_e.NONE,this._target=new At.Vector3,this._targetEnd=this._target.clone(),this._focalOffset=new At.Vector3,this._focalOffsetEnd=this._focalOffset.clone(),this._spherical=new At.Spherical().setFromVector3(bt.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)),this._sphericalEnd=this._spherical.clone(),this._lastDistance=this._spherical.radius,this._zoom=this._camera.zoom,this._zoomEnd=this._zoom,this._lastZoom=this._zoom,this._nearPlaneCorners=[new At.Vector3,new At.Vector3,new At.Vector3,new At.Vector3],this._updateNearPlaneCorners(),this._boundary=new At.Box3(new At.Vector3(-1/0,-1/0,-1/0),new At.Vector3(1/0,1/0,1/0)),this._cameraUp0=this._camera.up.clone(),this._target0=this._target.clone(),this._position0=this._camera.position.clone(),this._zoom0=this._zoom,this._focalOffset0=this._focalOffset.clone(),this._dollyControlCoord=new At.Vector2,this.mouseButtons={left:_e.ROTATE,middle:_e.DOLLY,right:_e.TRUCK,wheel:Ha(this._camera)?_e.DOLLY:Zr(this._camera)?_e.ZOOM:_e.NONE},this.touches={one:_e.TOUCH_ROTATE,two:Ha(this._camera)?_e.TOUCH_DOLLY_TRUCK:Zr(this._camera)?_e.TOUCH_ZOOM_TRUCK:_e.NONE,three:_e.TOUCH_TRUCK};const i=new At.Vector2,s=new At.Vector2,l=new At.Vector2,h=E=>{if(!this._enabled||!this._domElement)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const P=this._domElement.getBoundingClientRect(),N=E.clientX/P.width,$=E.clientY/P.height;if(N<this._interactiveArea.left||N>this._interactiveArea.right||$<this._interactiveArea.top||$>this._interactiveArea.bottom)return}const M=E.pointerType!=="mouse"?null:(E.buttons&xi.LEFT)===xi.LEFT?xi.LEFT:(E.buttons&xi.MIDDLE)===xi.MIDDLE?xi.MIDDLE:(E.buttons&xi.RIGHT)===xi.RIGHT?xi.RIGHT:null;if(M!==null){const P=this._findPointerByMouseButton(M);P&&this._disposePointer(P)}if((E.buttons&xi.LEFT)===xi.LEFT&&this._lockedPointer)return;const I={pointerId:E.pointerId,clientX:E.clientX,clientY:E.clientY,deltaX:0,deltaY:0,mouseButton:M};this._activePointers.push(I),this._domElement.ownerDocument.removeEventListener("pointermove",u,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",f),this._domElement.ownerDocument.addEventListener("pointermove",u,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",f),this._isDragging=!0,y(E)},u=E=>{E.cancelable&&E.preventDefault();const M=E.pointerId,I=this._lockedPointer||this._findPointerById(M);if(I){if(I.clientX=E.clientX,I.clientY=E.clientY,I.deltaX=E.movementX,I.deltaY=E.movementY,this._state=0,E.pointerType==="touch")switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else(!this._isDragging&&this._lockedPointer||this._isDragging&&(E.buttons&xi.LEFT)===xi.LEFT)&&(this._state=this._state|this.mouseButtons.left),this._isDragging&&(E.buttons&xi.MIDDLE)===xi.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),this._isDragging&&(E.buttons&xi.RIGHT)===xi.RIGHT&&(this._state=this._state|this.mouseButtons.right);v()}},f=E=>{const M=this._findPointerById(E.pointerId);if(!(M&&M===this._lockedPointer)){if(M&&this._disposePointer(M),E.pointerType==="touch")switch(this._activePointers.length){case 0:this._state=_e.NONE;break;case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else this._state=_e.NONE;w()}};let g=-1;const A=E=>{if(!this._domElement||!this._enabled||this.mouseButtons.wheel===_e.NONE)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const Q=this._domElement.getBoundingClientRect(),G=E.clientX/Q.width,F=E.clientY/Q.height;if(G<this._interactiveArea.left||G>this._interactiveArea.right||F<this._interactiveArea.top||F>this._interactiveArea.bottom)return}if(E.preventDefault(),this.dollyToCursor||this.mouseButtons.wheel===_e.ROTATE||this.mouseButtons.wheel===_e.TRUCK){const Q=performance.now();g-Q<1e3&&this._getClientRect(this._elementRect),g=Q}const M=Kz?-1:-3,I=E.deltaMode===1&&!E.ctrlKey?E.deltaY/M:E.deltaY/(M*10),P=this.dollyToCursor?(E.clientX-this._elementRect.x)/this._elementRect.width*2-1:0,N=this.dollyToCursor?(E.clientY-this._elementRect.y)/this._elementRect.height*-2+1:0;switch(E.ctrlKey?_e.ZOOM:this.mouseButtons.wheel){case _e.ROTATE:{this._rotateInternal(E.deltaX,E.deltaY),this._isUserControllingRotate=!0;break}case _e.TRUCK:{this._truckInternal(E.deltaX,E.deltaY,!1,!1),this._isUserControllingTruck=!0;break}case _e.SCREEN_PAN:{this._truckInternal(E.deltaX,E.deltaY,!1,!0),this._isUserControllingTruck=!0;break}case _e.OFFSET:{this._truckInternal(E.deltaX,E.deltaY,!0,!1),this._isUserControllingOffset=!0;break}case _e.DOLLY:{this._dollyInternal(-I,P,N),this._isUserControllingDolly=!0;break}case _e.ZOOM:{this._zoomInternal(-I,P,N),this._isUserControllingZoom=!0;break}}this.dispatchEvent({type:"control"})},_=E=>{if(!(!this._domElement||!this._enabled)){if(this.mouseButtons.right===tc.ACTION.NONE){const M=E instanceof PointerEvent?E.pointerId:0,I=this._findPointerById(M);I&&this._disposePointer(I),this._domElement.ownerDocument.removeEventListener("pointermove",u,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",f);return}E.preventDefault()}},y=E=>{if(!this._enabled)return;if(Km(this._activePointers,Ln),this._getClientRect(this._elementRect),i.copy(Ln),s.copy(Ln),this._activePointers.length>=2){const I=Ln.x-this._activePointers[1].clientX,P=Ln.y-this._activePointers[1].clientY,N=Math.sqrt(I*I+P*P);l.set(0,N);const $=(this._activePointers[0].clientX+this._activePointers[1].clientX)*.5,Q=(this._activePointers[0].clientY+this._activePointers[1].clientY)*.5;s.set($,Q)}if(this._state=0,!E)this._lockedPointer&&(this._state=this._state|this.mouseButtons.left);else if("pointerType"in E&&E.pointerType==="touch")switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else!this._lockedPointer&&(E.buttons&xi.LEFT)===xi.LEFT&&(this._state=this._state|this.mouseButtons.left),(E.buttons&xi.MIDDLE)===xi.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(E.buttons&xi.RIGHT)===xi.RIGHT&&(this._state=this._state|this.mouseButtons.right);((this._state&_e.ROTATE)===_e.ROTATE||(this._state&_e.TOUCH_ROTATE)===_e.TOUCH_ROTATE||(this._state&_e.TOUCH_DOLLY_ROTATE)===_e.TOUCH_DOLLY_ROTATE||(this._state&_e.TOUCH_ZOOM_ROTATE)===_e.TOUCH_ZOOM_ROTATE)&&(this._sphericalEnd.theta=this._spherical.theta,this._sphericalEnd.phi=this._spherical.phi,this._thetaVelocity.value=0,this._phiVelocity.value=0),((this._state&_e.TRUCK)===_e.TRUCK||(this._state&_e.SCREEN_PAN)===_e.SCREEN_PAN||(this._state&_e.TOUCH_TRUCK)===_e.TOUCH_TRUCK||(this._state&_e.TOUCH_SCREEN_PAN)===_e.TOUCH_SCREEN_PAN||(this._state&_e.TOUCH_DOLLY_TRUCK)===_e.TOUCH_DOLLY_TRUCK||(this._state&_e.TOUCH_DOLLY_SCREEN_PAN)===_e.TOUCH_DOLLY_SCREEN_PAN||(this._state&_e.TOUCH_ZOOM_TRUCK)===_e.TOUCH_ZOOM_TRUCK||(this._state&_e.TOUCH_ZOOM_SCREEN_PAN)===_e.TOUCH_DOLLY_SCREEN_PAN)&&(this._targetEnd.copy(this._target),this._targetVelocity.set(0,0,0)),((this._state&_e.DOLLY)===_e.DOLLY||(this._state&_e.TOUCH_DOLLY)===_e.TOUCH_DOLLY||(this._state&_e.TOUCH_DOLLY_TRUCK)===_e.TOUCH_DOLLY_TRUCK||(this._state&_e.TOUCH_DOLLY_SCREEN_PAN)===_e.TOUCH_DOLLY_SCREEN_PAN||(this._state&_e.TOUCH_DOLLY_OFFSET)===_e.TOUCH_DOLLY_OFFSET||(this._state&_e.TOUCH_DOLLY_ROTATE)===_e.TOUCH_DOLLY_ROTATE)&&(this._sphericalEnd.radius=this._spherical.radius,this._radiusVelocity.value=0),((this._state&_e.ZOOM)===_e.ZOOM||(this._state&_e.TOUCH_ZOOM)===_e.TOUCH_ZOOM||(this._state&_e.TOUCH_ZOOM_TRUCK)===_e.TOUCH_ZOOM_TRUCK||(this._state&_e.TOUCH_ZOOM_SCREEN_PAN)===_e.TOUCH_ZOOM_SCREEN_PAN||(this._state&_e.TOUCH_ZOOM_OFFSET)===_e.TOUCH_ZOOM_OFFSET||(this._state&_e.TOUCH_ZOOM_ROTATE)===_e.TOUCH_ZOOM_ROTATE)&&(this._zoomEnd=this._zoom,this._zoomVelocity.value=0),((this._state&_e.OFFSET)===_e.OFFSET||(this._state&_e.TOUCH_OFFSET)===_e.TOUCH_OFFSET||(this._state&_e.TOUCH_DOLLY_OFFSET)===_e.TOUCH_DOLLY_OFFSET||(this._state&_e.TOUCH_ZOOM_OFFSET)===_e.TOUCH_ZOOM_OFFSET)&&(this._focalOffsetEnd.copy(this._focalOffset),this._focalOffsetVelocity.set(0,0,0)),this.dispatchEvent({type:"controlstart"})},v=()=>{if(!this._enabled||!this._dragNeedsUpdate)return;this._dragNeedsUpdate=!1,Km(this._activePointers,Ln);const M=this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement?this._lockedPointer||this._activePointers[0]:null,I=M?-M.deltaX:s.x-Ln.x,P=M?-M.deltaY:s.y-Ln.y;if(s.copy(Ln),((this._state&_e.ROTATE)===_e.ROTATE||(this._state&_e.TOUCH_ROTATE)===_e.TOUCH_ROTATE||(this._state&_e.TOUCH_DOLLY_ROTATE)===_e.TOUCH_DOLLY_ROTATE||(this._state&_e.TOUCH_ZOOM_ROTATE)===_e.TOUCH_ZOOM_ROTATE)&&(this._rotateInternal(I,P),this._isUserControllingRotate=!0),(this._state&_e.DOLLY)===_e.DOLLY||(this._state&_e.ZOOM)===_e.ZOOM){const N=this.dollyToCursor?(i.x-this._elementRect.x)/this._elementRect.width*2-1:0,$=this.dollyToCursor?(i.y-this._elementRect.y)/this._elementRect.height*-2+1:0,Q=this.dollyDragInverted?-1:1;(this._state&_e.DOLLY)===_e.DOLLY?(this._dollyInternal(Q*P*cf,N,$),this._isUserControllingDolly=!0):(this._zoomInternal(Q*P*cf,N,$),this._isUserControllingZoom=!0)}if((this._state&_e.TOUCH_DOLLY)===_e.TOUCH_DOLLY||(this._state&_e.TOUCH_ZOOM)===_e.TOUCH_ZOOM||(this._state&_e.TOUCH_DOLLY_TRUCK)===_e.TOUCH_DOLLY_TRUCK||(this._state&_e.TOUCH_ZOOM_TRUCK)===_e.TOUCH_ZOOM_TRUCK||(this._state&_e.TOUCH_DOLLY_SCREEN_PAN)===_e.TOUCH_DOLLY_SCREEN_PAN||(this._state&_e.TOUCH_ZOOM_SCREEN_PAN)===_e.TOUCH_ZOOM_SCREEN_PAN||(this._state&_e.TOUCH_DOLLY_OFFSET)===_e.TOUCH_DOLLY_OFFSET||(this._state&_e.TOUCH_ZOOM_OFFSET)===_e.TOUCH_ZOOM_OFFSET||(this._state&_e.TOUCH_DOLLY_ROTATE)===_e.TOUCH_DOLLY_ROTATE||(this._state&_e.TOUCH_ZOOM_ROTATE)===_e.TOUCH_ZOOM_ROTATE){const N=Ln.x-this._activePointers[1].clientX,$=Ln.y-this._activePointers[1].clientY,Q=Math.sqrt(N*N+$*$),G=l.y-Q;l.set(0,Q);const F=this.dollyToCursor?(s.x-this._elementRect.x)/this._elementRect.width*2-1:0,z=this.dollyToCursor?(s.y-this._elementRect.y)/this._elementRect.height*-2+1:0;(this._state&_e.TOUCH_DOLLY)===_e.TOUCH_DOLLY||(this._state&_e.TOUCH_DOLLY_ROTATE)===_e.TOUCH_DOLLY_ROTATE||(this._state&_e.TOUCH_DOLLY_TRUCK)===_e.TOUCH_DOLLY_TRUCK||(this._state&_e.TOUCH_DOLLY_SCREEN_PAN)===_e.TOUCH_DOLLY_SCREEN_PAN||(this._state&_e.TOUCH_DOLLY_OFFSET)===_e.TOUCH_DOLLY_OFFSET?(this._dollyInternal(G*cf,F,z),this._isUserControllingDolly=!0):(this._zoomInternal(G*cf,F,z),this._isUserControllingZoom=!0)}((this._state&_e.TRUCK)===_e.TRUCK||(this._state&_e.TOUCH_TRUCK)===_e.TOUCH_TRUCK||(this._state&_e.TOUCH_DOLLY_TRUCK)===_e.TOUCH_DOLLY_TRUCK||(this._state&_e.TOUCH_ZOOM_TRUCK)===_e.TOUCH_ZOOM_TRUCK)&&(this._truckInternal(I,P,!1,!1),this._isUserControllingTruck=!0),((this._state&_e.SCREEN_PAN)===_e.SCREEN_PAN||(this._state&_e.TOUCH_SCREEN_PAN)===_e.TOUCH_SCREEN_PAN||(this._state&_e.TOUCH_DOLLY_SCREEN_PAN)===_e.TOUCH_DOLLY_SCREEN_PAN||(this._state&_e.TOUCH_ZOOM_SCREEN_PAN)===_e.TOUCH_ZOOM_SCREEN_PAN)&&(this._truckInternal(I,P,!1,!0),this._isUserControllingTruck=!0),((this._state&_e.OFFSET)===_e.OFFSET||(this._state&_e.TOUCH_OFFSET)===_e.TOUCH_OFFSET||(this._state&_e.TOUCH_DOLLY_OFFSET)===_e.TOUCH_DOLLY_OFFSET||(this._state&_e.TOUCH_ZOOM_OFFSET)===_e.TOUCH_ZOOM_OFFSET)&&(this._truckInternal(I,P,!0,!1),this._isUserControllingOffset=!0),this.dispatchEvent({type:"control"})},w=()=>{Km(this._activePointers,Ln),s.copy(Ln),this._dragNeedsUpdate=!1,(this._activePointers.length===0||this._activePointers.length===1&&this._activePointers[0]===this._lockedPointer)&&(this._isDragging=!1),this._activePointers.length===0&&this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointermove",u,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",f),this.dispatchEvent({type:"controlend"}))};this.lockPointer=()=>{!this._enabled||!this._domElement||(this.cancel(),this._lockedPointer={pointerId:-1,clientX:0,clientY:0,deltaX:0,deltaY:0,mouseButton:null},this._activePointers.push(this._lockedPointer),this._domElement.ownerDocument.removeEventListener("pointermove",u,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",f),this._domElement.requestPointerLock(),this._domElement.ownerDocument.addEventListener("pointerlockchange",T),this._domElement.ownerDocument.addEventListener("pointerlockerror",C),this._domElement.ownerDocument.addEventListener("pointermove",u,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",f),y())},this.unlockPointer=()=>{this._lockedPointer!==null&&(this._disposePointer(this._lockedPointer),this._lockedPointer=null),this._domElement?.ownerDocument.exitPointerLock(),this._domElement?.ownerDocument.removeEventListener("pointerlockchange",T),this._domElement?.ownerDocument.removeEventListener("pointerlockerror",C),this.cancel()};const T=()=>{this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement||this.unlockPointer()},C=()=>{this.unlockPointer()};this._addAllEventListeners=E=>{this._domElement=E,this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none",this._domElement.addEventListener("pointerdown",h),this._domElement.addEventListener("pointercancel",f),this._domElement.addEventListener("wheel",A,{passive:!1}),this._domElement.addEventListener("contextmenu",_)},this._removeAllEventListeners=()=>{this._domElement&&(this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect="",this._domElement.removeEventListener("pointerdown",h),this._domElement.removeEventListener("pointercancel",f),this._domElement.removeEventListener("wheel",A,{passive:!1}),this._domElement.removeEventListener("contextmenu",_),this._domElement.ownerDocument.removeEventListener("pointermove",u,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",f),this._domElement.ownerDocument.removeEventListener("pointerlockchange",T),this._domElement.ownerDocument.removeEventListener("pointerlockerror",C))},this.cancel=()=>{this._state!==_e.NONE&&(this._state=_e.NONE,this._activePointers.length=0,w())},t&&this.connect(t),this.update(0)}get camera(){return this._camera}set camera(e){this._camera=e,this.updateCameraUp(),this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._domElement&&(e?(this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none"):(this.cancel(),this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect=""))}get active(){return!this._hasRested}get currentAction(){return this._state}get distance(){return this._spherical.radius}set distance(e){this._spherical.radius===e&&this._sphericalEnd.radius===e||(this._spherical.radius=e,this._sphericalEnd.radius=e,this._needsUpdate=!0)}get azimuthAngle(){return this._spherical.theta}set azimuthAngle(e){this._spherical.theta===e&&this._sphericalEnd.theta===e||(this._spherical.theta=e,this._sphericalEnd.theta=e,this._needsUpdate=!0)}get polarAngle(){return this._spherical.phi}set polarAngle(e){this._spherical.phi===e&&this._sphericalEnd.phi===e||(this._spherical.phi=e,this._sphericalEnd.phi=e,this._needsUpdate=!0)}get boundaryEnclosesCamera(){return this._boundaryEnclosesCamera}set boundaryEnclosesCamera(e){this._boundaryEnclosesCamera=e,this._needsUpdate=!0}set interactiveArea(e){this._interactiveArea.width=xs(e.width,0,1),this._interactiveArea.height=xs(e.height,0,1),this._interactiveArea.x=xs(e.x,0,1-this._interactiveArea.width),this._interactiveArea.y=xs(e.y,0,1-this._interactiveArea.height)}addEventListener(e,t){super.addEventListener(e,t)}removeEventListener(e,t){super.removeEventListener(e,t)}rotate(e,t,i=!1){return this.rotateTo(this._sphericalEnd.theta+e,this._sphericalEnd.phi+t,i)}rotateAzimuthTo(e,t=!1){return this.rotateTo(e,this._sphericalEnd.phi,t)}rotatePolarTo(e,t=!1){return this.rotateTo(this._sphericalEnd.theta,e,t)}rotateTo(e,t,i=!1){this._isUserControllingRotate=!1;const s=xs(e,this.minAzimuthAngle,this.maxAzimuthAngle),l=xs(t,this.minPolarAngle,this.maxPolarAngle);this._sphericalEnd.theta=s,this._sphericalEnd.phi=l,this._sphericalEnd.makeSafe(),this._needsUpdate=!0,i||(this._spherical.theta=this._sphericalEnd.theta,this._spherical.phi=this._sphericalEnd.phi);const h=!i||qt(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&qt(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold);return this._createOnRestPromise(h)}dolly(e,t=!1){return this.dollyTo(this._sphericalEnd.radius-e,t)}dollyTo(e,t=!1){return this._isUserControllingDolly=!1,this._lastDollyDirection=gl.NONE,this._changedDolly=0,this._dollyToNoClamp(xs(e,this.minDistance,this.maxDistance),t)}_dollyToNoClamp(e,t=!1){const i=this._sphericalEnd.radius;if(this.colliderMeshes.length>=1){const h=this._collisionTest(),u=qt(h,this._spherical.radius);if(!(i>e)&&u)return Promise.resolve();this._sphericalEnd.radius=Math.min(e,h)}else this._sphericalEnd.radius=e;this._needsUpdate=!0,t||(this._spherical.radius=this._sphericalEnd.radius);const l=!t||qt(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(l)}dollyInFixed(e,t=!1){this._targetEnd.add(this._getCameraDirection(Eh).multiplyScalar(e)),t||this._target.copy(this._targetEnd);const i=!t||qt(this._target.x,this._targetEnd.x,this.restThreshold)&&qt(this._target.y,this._targetEnd.y,this.restThreshold)&&qt(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(i)}zoom(e,t=!1){return this.zoomTo(this._zoomEnd+e,t)}zoomTo(e,t=!1){this._isUserControllingZoom=!1,this._zoomEnd=xs(e,this.minZoom,this.maxZoom),this._needsUpdate=!0,t||(this._zoom=this._zoomEnd);const i=!t||qt(this._zoom,this._zoomEnd,this.restThreshold);return this._changedZoom=0,this._createOnRestPromise(i)}pan(e,t,i=!1){return console.warn("`pan` has been renamed to `truck`"),this.truck(e,t,i)}truck(e,t,i=!1){this._camera.updateMatrix(),Os.setFromMatrixColumn(this._camera.matrix,0),ks.setFromMatrixColumn(this._camera.matrix,1),Os.multiplyScalar(e),ks.multiplyScalar(-t);const s=bt.copy(Os).add(ks),l=Ut.copy(this._targetEnd).add(s);return this.moveTo(l.x,l.y,l.z,i)}forward(e,t=!1){bt.setFromMatrixColumn(this._camera.matrix,0),bt.crossVectors(this._camera.up,bt),bt.multiplyScalar(e);const i=Ut.copy(this._targetEnd).add(bt);return this.moveTo(i.x,i.y,i.z,t)}elevate(e,t=!1){return bt.copy(this._camera.up).multiplyScalar(e),this.moveTo(this._targetEnd.x+bt.x,this._targetEnd.y+bt.y,this._targetEnd.z+bt.z,t)}moveTo(e,t,i,s=!1){this._isUserControllingTruck=!1;const l=bt.set(e,t,i).sub(this._targetEnd);this._encloseToBoundary(this._targetEnd,l,this.boundaryFriction),this._needsUpdate=!0,s||this._target.copy(this._targetEnd);const h=!s||qt(this._target.x,this._targetEnd.x,this.restThreshold)&&qt(this._target.y,this._targetEnd.y,this.restThreshold)&&qt(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(h)}lookInDirectionOf(e,t,i,s=!1){const u=bt.set(e,t,i).sub(this._targetEnd).normalize().multiplyScalar(-this._sphericalEnd.radius).add(this._targetEnd);return this.setPosition(u.x,u.y,u.z,s)}fitToBox(e,t,{cover:i=!1,paddingLeft:s=0,paddingRight:l=0,paddingBottom:h=0,paddingTop:u=0}={}){const f=[],g=e.isBox3?_l.copy(e):_l.setFromObject(e);g.isEmpty()&&(console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"),Promise.resolve());const A=lw(this._sphericalEnd.theta,ow),_=lw(this._sphericalEnd.phi,ow);f.push(this.rotateTo(A,_,t));const y=bt.setFromSpherical(this._sphericalEnd).normalize(),v=pw.setFromUnitVectors(y,Zm),w=qt(Math.abs(y.y),1);w&&v.multiply(tA.setFromAxisAngle(hf,A)),v.multiply(this._yAxisUpSpaceInverse);const T=fw.makeEmpty();Ut.copy(g.min).applyQuaternion(v),T.expandByPoint(Ut),Ut.copy(g.min).setX(g.max.x).applyQuaternion(v),T.expandByPoint(Ut),Ut.copy(g.min).setY(g.max.y).applyQuaternion(v),T.expandByPoint(Ut),Ut.copy(g.max).setZ(g.min.z).applyQuaternion(v),T.expandByPoint(Ut),Ut.copy(g.min).setZ(g.max.z).applyQuaternion(v),T.expandByPoint(Ut),Ut.copy(g.max).setY(g.min.y).applyQuaternion(v),T.expandByPoint(Ut),Ut.copy(g.max).setX(g.min.x).applyQuaternion(v),T.expandByPoint(Ut),Ut.copy(g.max).applyQuaternion(v),T.expandByPoint(Ut),T.min.x-=s,T.min.y-=h,T.max.x+=l,T.max.y+=u,v.setFromUnitVectors(Zm,y),w&&v.premultiply(tA.invert()),v.premultiply(this._yAxisUpSpace);const C=T.getSize(bt),E=T.getCenter(Ut).applyQuaternion(v);if(Ha(this._camera)){const M=this.getDistanceToFitBox(C.x,C.y,C.z,i);f.push(this.moveTo(E.x,E.y,E.z,t)),f.push(this.dollyTo(M,t)),f.push(this.setFocalOffset(0,0,0,t))}else if(Zr(this._camera)){const M=this._camera,I=M.right-M.left,P=M.top-M.bottom,N=i?Math.max(I/C.x,P/C.y):Math.min(I/C.x,P/C.y);f.push(this.moveTo(E.x,E.y,E.z,t)),f.push(this.zoomTo(N,t)),f.push(this.setFocalOffset(0,0,0,t))}return Promise.all(f)}fitToSphere(e,t){const i=[],l="isObject3D"in e?tc.createBoundingSphere(e,eA):eA.copy(e);if(i.push(this.moveTo(l.center.x,l.center.y,l.center.z,t)),Ha(this._camera)){const h=this.getDistanceToFitSphere(l.radius);i.push(this.dollyTo(h,t))}else if(Zr(this._camera)){const h=this._camera.right-this._camera.left,u=this._camera.top-this._camera.bottom,f=2*l.radius,g=Math.min(h/f,u/f);i.push(this.zoomTo(g,t))}return i.push(this.setFocalOffset(0,0,0,t)),Promise.all(i)}setLookAt(e,t,i,s,l,h,u=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=gl.NONE,this._changedDolly=0;const f=Ut.set(s,l,h),g=bt.set(e,t,i);this._targetEnd.copy(f),this._sphericalEnd.setFromVector3(g.sub(f).applyQuaternion(this._yAxisUpSpace)),this._needsUpdate=!0,u||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const A=!u||qt(this._target.x,this._targetEnd.x,this.restThreshold)&&qt(this._target.y,this._targetEnd.y,this.restThreshold)&&qt(this._target.z,this._targetEnd.z,this.restThreshold)&&qt(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&qt(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&qt(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(A)}lerp(e,t,i,s=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=gl.NONE,this._changedDolly=0;const l=bt.set(...e.target);if("spherical"in e)Gn.set(...e.spherical);else{const _=Ut.set(...e.position);Gn.setFromVector3(_.sub(l).applyQuaternion(this._yAxisUpSpace))}const h=ml.set(...t.target);if("spherical"in t)Al.set(...t.spherical);else{const _=Ut.set(...t.position);Al.setFromVector3(_.sub(h).applyQuaternion(this._yAxisUpSpace))}this._targetEnd.copy(l.lerp(h,i));const u=Al.theta-Gn.theta,f=Al.phi-Gn.phi,g=Al.radius-Gn.radius;this._sphericalEnd.set(Gn.radius+g*i,Gn.phi+f*i,Gn.theta+u*i),this._needsUpdate=!0,s||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const A=!s||qt(this._target.x,this._targetEnd.x,this.restThreshold)&&qt(this._target.y,this._targetEnd.y,this.restThreshold)&&qt(this._target.z,this._targetEnd.z,this.restThreshold)&&qt(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&qt(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&qt(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(A)}lerpLookAt(e,t,i,s,l,h,u,f,g,A,_,y,v,w=!1){return this.lerp({position:[e,t,i],target:[s,l,h]},{position:[u,f,g],target:[A,_,y]},v,w)}setPosition(e,t,i,s=!1){return this.setLookAt(e,t,i,this._targetEnd.x,this._targetEnd.y,this._targetEnd.z,s)}setTarget(e,t,i,s=!1){const l=this.getPosition(bt),h=this.setLookAt(l.x,l.y,l.z,e,t,i,s);return this._sphericalEnd.phi=xs(this._sphericalEnd.phi,this.minPolarAngle,this.maxPolarAngle),h}setFocalOffset(e,t,i,s=!1){this._isUserControllingOffset=!1,this._focalOffsetEnd.set(e,t,i),this._needsUpdate=!0,s||this._focalOffset.copy(this._focalOffsetEnd);const l=!s||qt(this._focalOffset.x,this._focalOffsetEnd.x,this.restThreshold)&&qt(this._focalOffset.y,this._focalOffsetEnd.y,this.restThreshold)&&qt(this._focalOffset.z,this._focalOffsetEnd.z,this.restThreshold);return this._createOnRestPromise(l)}setOrbitPoint(e,t,i){this._camera.updateMatrixWorld(),Os.setFromMatrixColumn(this._camera.matrixWorldInverse,0),ks.setFromMatrixColumn(this._camera.matrixWorldInverse,1),Va.setFromMatrixColumn(this._camera.matrixWorldInverse,2);const s=bt.set(e,t,i),l=s.distanceTo(this._camera.position),h=s.sub(this._camera.position);Os.multiplyScalar(h.x),ks.multiplyScalar(h.y),Va.multiplyScalar(h.z),bt.copy(Os).add(ks).add(Va),bt.z=bt.z+l,this.dollyTo(l,!1),this.setFocalOffset(-bt.x,bt.y,-bt.z,!1),this.moveTo(e,t,i,!1)}setBoundary(e){if(!e){this._boundary.min.set(-1/0,-1/0,-1/0),this._boundary.max.set(1/0,1/0,1/0),this._needsUpdate=!0;return}this._boundary.copy(e),this._boundary.clampPoint(this._targetEnd,this._targetEnd),this._needsUpdate=!0}setViewport(e,t,i,s){if(e===null){this._viewport=null;return}this._viewport=this._viewport||new At.Vector4,typeof e=="number"?this._viewport.set(e,t,i,s):this._viewport.copy(e)}getDistanceToFitBox(e,t,i,s=!1){if(Jm(this._camera,"getDistanceToFitBox"))return this._spherical.radius;const l=e/t,h=this._camera.getEffectiveFOV()*bh,u=this._camera.aspect;return((s?l>u:l<u)?t:e/u)*.5/Math.tan(h*.5)+i*.5}getDistanceToFitSphere(e){if(Jm(this._camera,"getDistanceToFitSphere"))return this._spherical.radius;const t=this._camera.getEffectiveFOV()*bh,i=Math.atan(Math.tan(t*.5)*this._camera.aspect)*2,s=1<this._camera.aspect?t:i;return e/Math.sin(s*.5)}getTarget(e,t=!0){return(e&&e.isVector3?e:new At.Vector3).copy(t?this._targetEnd:this._target)}getPosition(e,t=!0){return(e&&e.isVector3?e:new At.Vector3).setFromSpherical(t?this._sphericalEnd:this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(t?this._targetEnd:this._target)}getSpherical(e,t=!0){return(e||new At.Spherical).copy(t?this._sphericalEnd:this._spherical)}getFocalOffset(e,t=!0){return(e&&e.isVector3?e:new At.Vector3).copy(t?this._focalOffsetEnd:this._focalOffset)}normalizeRotations(){return this._sphericalEnd.theta=(this._sphericalEnd.theta%Yr+Yr)%Yr,this._sphericalEnd.theta>Math.PI&&(this._sphericalEnd.theta-=Yr),this._spherical.theta+=Yr*Math.round((this._sphericalEnd.theta-this._spherical.theta)/Yr),this}stop(){this._focalOffset.copy(this._focalOffsetEnd),this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd),this._zoom=this._zoomEnd}reset(e=!1){if(!qt(this._camera.up.x,this._cameraUp0.x)||!qt(this._camera.up.y,this._cameraUp0.y)||!qt(this._camera.up.z,this._cameraUp0.z)){this._camera.up.copy(this._cameraUp0);const i=this.getPosition(bt);this.updateCameraUp(),this.setPosition(i.x,i.y,i.z)}const t=[this.setLookAt(this._position0.x,this._position0.y,this._position0.z,this._target0.x,this._target0.y,this._target0.z,e),this.setFocalOffset(this._focalOffset0.x,this._focalOffset0.y,this._focalOffset0.z,e),this.zoomTo(this._zoom0,e)];return Promise.all(t)}saveState(){this._cameraUp0.copy(this._camera.up),this.getTarget(this._target0),this.getPosition(this._position0),this._zoom0=this._zoom,this._focalOffset0.copy(this._focalOffset)}updateCameraUp(){this._yAxisUpSpace.setFromUnitVectors(this._camera.up,hf),this._yAxisUpSpaceInverse.copy(this._yAxisUpSpace).invert()}applyCameraUp(){const e=bt.subVectors(this._target,this._camera.position).normalize(),t=Ut.crossVectors(e,this._camera.up);this._camera.up.crossVectors(t,e).normalize(),this._camera.updateMatrixWorld();const i=this.getPosition(bt);this.updateCameraUp(),this.setPosition(i.x,i.y,i.z)}update(e){const t=this._sphericalEnd.theta-this._spherical.theta,i=this._sphericalEnd.phi-this._spherical.phi,s=this._sphericalEnd.radius-this._spherical.radius,l=uw.subVectors(this._targetEnd,this._target),h=dw.subVectors(this._focalOffsetEnd,this._focalOffset),u=this._zoomEnd-this._zoom;if(si(t))this._thetaVelocity.value=0,this._spherical.theta=this._sphericalEnd.theta;else{const _=this._isUserControllingRotate?this.draggingSmoothTime:this.smoothTime;this._spherical.theta=lf(this._spherical.theta,this._sphericalEnd.theta,this._thetaVelocity,_,1/0,e),this._needsUpdate=!0}if(si(i))this._phiVelocity.value=0,this._spherical.phi=this._sphericalEnd.phi;else{const _=this._isUserControllingRotate?this.draggingSmoothTime:this.smoothTime;this._spherical.phi=lf(this._spherical.phi,this._sphericalEnd.phi,this._phiVelocity,_,1/0,e),this._needsUpdate=!0}if(si(s))this._radiusVelocity.value=0,this._spherical.radius=this._sphericalEnd.radius;else{const _=this._isUserControllingDolly?this.draggingSmoothTime:this.smoothTime;this._spherical.radius=lf(this._spherical.radius,this._sphericalEnd.radius,this._radiusVelocity,_,this.maxSpeed,e),this._needsUpdate=!0}if(si(l.x)&&si(l.y)&&si(l.z))this._targetVelocity.set(0,0,0),this._target.copy(this._targetEnd);else{const _=this._isUserControllingTruck?this.draggingSmoothTime:this.smoothTime;cw(this._target,this._targetEnd,this._targetVelocity,_,this.maxSpeed,e,this._target),this._needsUpdate=!0}if(si(h.x)&&si(h.y)&&si(h.z))this._focalOffsetVelocity.set(0,0,0),this._focalOffset.copy(this._focalOffsetEnd);else{const _=this._isUserControllingOffset?this.draggingSmoothTime:this.smoothTime;cw(this._focalOffset,this._focalOffsetEnd,this._focalOffsetVelocity,_,this.maxSpeed,e,this._focalOffset),this._needsUpdate=!0}if(si(u))this._zoomVelocity.value=0,this._zoom=this._zoomEnd;else{const _=this._isUserControllingZoom?this.draggingSmoothTime:this.smoothTime;this._zoom=lf(this._zoom,this._zoomEnd,this._zoomVelocity,_,1/0,e)}if(this.dollyToCursor){if(Ha(this._camera)&&this._changedDolly!==0){const _=this._spherical.radius-this._lastDistance,y=this._camera,v=this._getCameraDirection(Eh),w=bt.copy(v).cross(y.up).normalize();w.lengthSq()===0&&(w.x=1);const T=Ut.crossVectors(w,v),C=this._sphericalEnd.radius*Math.tan(y.getEffectiveFOV()*bh*.5),M=(this._sphericalEnd.radius-_-this._sphericalEnd.radius)/this._sphericalEnd.radius,I=ml.copy(this._targetEnd).add(w.multiplyScalar(this._dollyControlCoord.x*C*y.aspect)).add(T.multiplyScalar(this._dollyControlCoord.y*C)),P=bt.copy(this._targetEnd).lerp(I,M),N=this._lastDollyDirection===gl.IN&&this._spherical.radius<=this.minDistance,$=this._lastDollyDirection===gl.OUT&&this.maxDistance<=this._spherical.radius;if(this.infinityDolly&&(N||$)){this._sphericalEnd.radius-=_,this._spherical.radius-=_;const G=Ut.copy(v).multiplyScalar(-_);P.add(G)}this._boundary.clampPoint(P,P);const Q=Ut.subVectors(P,this._targetEnd);this._targetEnd.copy(P),this._target.add(Q),this._changedDolly-=_,si(this._changedDolly)&&(this._changedDolly=0)}else if(Zr(this._camera)&&this._changedZoom!==0){const _=this._zoom-this._lastZoom,y=this._camera,v=bt.set(this._dollyControlCoord.x,this._dollyControlCoord.y,(y.near+y.far)/(y.near-y.far)).unproject(y),w=Ut.set(0,0,-1).applyQuaternion(y.quaternion),T=ml.copy(v).add(w.multiplyScalar(-v.dot(y.up))),E=-(this._zoom-_-this._zoom)/this._zoom,M=this._getCameraDirection(Eh),I=this._targetEnd.dot(M),P=bt.copy(this._targetEnd).lerp(T,E),N=P.dot(M),$=M.multiplyScalar(N-I);P.sub($),this._boundary.clampPoint(P,P);const Q=Ut.subVectors(P,this._targetEnd);this._targetEnd.copy(P),this._target.add(Q),this._changedZoom-=_,si(this._changedZoom)&&(this._changedZoom=0)}}this._camera.zoom!==this._zoom&&(this._camera.zoom=this._zoom,this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0),this._dragNeedsUpdate=!0;const f=this._collisionTest();this._spherical.radius=Math.min(this._spherical.radius,f),this._spherical.makeSafe(),this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target),this._camera.lookAt(this._target),(!si(this._focalOffset.x)||!si(this._focalOffset.y)||!si(this._focalOffset.z))&&(this._camera.matrix.compose(this._camera.position,this._camera.quaternion,this._camera.scale),Os.setFromMatrixColumn(this._camera.matrix,0),ks.setFromMatrixColumn(this._camera.matrix,1),Va.setFromMatrixColumn(this._camera.matrix,2),Os.multiplyScalar(this._focalOffset.x),ks.multiplyScalar(-this._focalOffset.y),Va.multiplyScalar(this._focalOffset.z),bt.copy(Os).add(ks).add(Va),this._camera.position.add(bt),this._camera.updateMatrixWorld()),this._boundaryEnclosesCamera&&this._encloseToBoundary(this._camera.position.copy(this._target),bt.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse),1);const A=this._needsUpdate;return A&&!this._updatedLastTime?(this._hasRested=!1,this.dispatchEvent({type:"wake"}),this.dispatchEvent({type:"update"})):A?(this.dispatchEvent({type:"update"}),si(t,this.restThreshold)&&si(i,this.restThreshold)&&si(s,this.restThreshold)&&si(l.x,this.restThreshold)&&si(l.y,this.restThreshold)&&si(l.z,this.restThreshold)&&si(h.x,this.restThreshold)&&si(h.y,this.restThreshold)&&si(h.z,this.restThreshold)&&si(u,this.restThreshold)&&!this._hasRested&&(this._hasRested=!0,this.dispatchEvent({type:"rest"}))):!A&&this._updatedLastTime&&this.dispatchEvent({type:"sleep"}),this._lastDistance=this._spherical.radius,this._lastZoom=this._zoom,this._updatedLastTime=A,this._needsUpdate=!1,A}toJSON(){return JSON.stringify({enabled:this._enabled,minDistance:this.minDistance,maxDistance:xh(this.maxDistance),minZoom:this.minZoom,maxZoom:xh(this.maxZoom),minPolarAngle:this.minPolarAngle,maxPolarAngle:xh(this.maxPolarAngle),minAzimuthAngle:xh(this.minAzimuthAngle),maxAzimuthAngle:xh(this.maxAzimuthAngle),smoothTime:this.smoothTime,draggingSmoothTime:this.draggingSmoothTime,dollySpeed:this.dollySpeed,truckSpeed:this.truckSpeed,dollyToCursor:this.dollyToCursor,target:this._targetEnd.toArray(),position:bt.setFromSpherical(this._sphericalEnd).add(this._targetEnd).toArray(),zoom:this._zoomEnd,focalOffset:this._focalOffsetEnd.toArray(),target0:this._target0.toArray(),position0:this._position0.toArray(),zoom0:this._zoom0,focalOffset0:this._focalOffset0.toArray()})}fromJSON(e,t=!1){const i=JSON.parse(e);this.enabled=i.enabled,this.minDistance=i.minDistance,this.maxDistance=wh(i.maxDistance),this.minZoom=i.minZoom,this.maxZoom=wh(i.maxZoom),this.minPolarAngle=i.minPolarAngle,this.maxPolarAngle=wh(i.maxPolarAngle),this.minAzimuthAngle=wh(i.minAzimuthAngle),this.maxAzimuthAngle=wh(i.maxAzimuthAngle),this.smoothTime=i.smoothTime,this.draggingSmoothTime=i.draggingSmoothTime,this.dollySpeed=i.dollySpeed,this.truckSpeed=i.truckSpeed,this.dollyToCursor=i.dollyToCursor,this._target0.fromArray(i.target0),this._position0.fromArray(i.position0),this._zoom0=i.zoom0,this._focalOffset0.fromArray(i.focalOffset0),this.moveTo(i.target[0],i.target[1],i.target[2],t),Gn.setFromVector3(bt.fromArray(i.position).sub(this._targetEnd).applyQuaternion(this._yAxisUpSpace)),this.rotateTo(Gn.theta,Gn.phi,t),this.dollyTo(Gn.radius,t),this.zoomTo(i.zoom,t),this.setFocalOffset(i.focalOffset[0],i.focalOffset[1],i.focalOffset[2],t),this._needsUpdate=!0}connect(e){if(this._domElement){console.warn("camera-controls is already connected.");return}e.setAttribute("data-camera-controls-version",Yz),this._addAllEventListeners(e),this._getClientRect(this._elementRect)}disconnect(){this.cancel(),this._removeAllEventListeners(),this._domElement&&(this._domElement.removeAttribute("data-camera-controls-version"),this._domElement=void 0)}dispose(){this.removeAllEventListeners(),this.disconnect()}_getTargetDirection(e){return e.setFromSpherical(this._spherical).divideScalar(this._spherical.radius).applyQuaternion(this._yAxisUpSpaceInverse)}_getCameraDirection(e){return this._getTargetDirection(e).negate()}_findPointerById(e){return this._activePointers.find(t=>t.pointerId===e)}_findPointerByMouseButton(e){return this._activePointers.find(t=>t.mouseButton===e)}_disposePointer(e){this._activePointers.splice(this._activePointers.indexOf(e),1)}_encloseToBoundary(e,t,i){const s=t.lengthSq();if(s===0)return e;const l=Ut.copy(t).add(e),u=this._boundary.clampPoint(l,ml).sub(l),f=u.lengthSq();if(f===0)return e.add(t);if(f===s)return e;if(i===0)return e.add(t).add(u);{const g=1+i*f/t.dot(u);return e.add(Ut.copy(t).multiplyScalar(g)).add(u.multiplyScalar(1-i))}}_updateNearPlaneCorners(){if(Ha(this._camera)){const e=this._camera,t=e.near,i=e.getEffectiveFOV()*bh,s=Math.tan(i*.5)*t,l=s*e.aspect;this._nearPlaneCorners[0].set(-l,-s,0),this._nearPlaneCorners[1].set(l,-s,0),this._nearPlaneCorners[2].set(l,s,0),this._nearPlaneCorners[3].set(-l,s,0)}else if(Zr(this._camera)){const e=this._camera,t=1/e.zoom,i=e.left*t,s=e.right*t,l=e.top*t,h=e.bottom*t;this._nearPlaneCorners[0].set(i,l,0),this._nearPlaneCorners[1].set(s,l,0),this._nearPlaneCorners[2].set(s,h,0),this._nearPlaneCorners[3].set(i,h,0)}}_truckInternal=(e,t,i,s)=>{let l,h;if(Ha(this._camera)){const u=bt.copy(this._camera.position).sub(this._target),f=this._camera.getEffectiveFOV()*bh,g=u.length()*Math.tan(f*.5);l=this.truckSpeed*e*g/this._elementRect.height,h=this.truckSpeed*t*g/this._elementRect.height}else if(Zr(this._camera)){const u=this._camera;l=this.truckSpeed*e*(u.right-u.left)/u.zoom/this._elementRect.width,h=this.truckSpeed*t*(u.top-u.bottom)/u.zoom/this._elementRect.height}else return;s?(i?this.setFocalOffset(this._focalOffsetEnd.x+l,this._focalOffsetEnd.y,this._focalOffsetEnd.z,!0):this.truck(l,0,!0),this.forward(-h,!0)):i?this.setFocalOffset(this._focalOffsetEnd.x+l,this._focalOffsetEnd.y+h,this._focalOffsetEnd.z,!0):this.truck(l,h,!0)};_rotateInternal=(e,t)=>{const i=Yr*this.azimuthRotateSpeed*e/this._elementRect.height,s=Yr*this.polarRotateSpeed*t/this._elementRect.height;this.rotate(i,s,!0)};_dollyInternal=(e,t,i)=>{const s=Math.pow(.95,-e*this.dollySpeed),l=this._sphericalEnd.radius,h=this._sphericalEnd.radius*s,u=xs(h,this.minDistance,this.maxDistance),f=u-h;this.infinityDolly&&this.dollyToCursor?this._dollyToNoClamp(h,!0):this.infinityDolly&&!this.dollyToCursor?(this.dollyInFixed(f,!0),this._dollyToNoClamp(u,!0)):this._dollyToNoClamp(u,!0),this.dollyToCursor&&(this._changedDolly+=(this.infinityDolly?h:u)-l,this._dollyControlCoord.set(t,i)),this._lastDollyDirection=Math.sign(-e)};_zoomInternal=(e,t,i)=>{const s=Math.pow(.95,e*this.dollySpeed),l=this._zoom,h=this._zoom*s;this.zoomTo(h,!0),this.dollyToCursor&&(this._changedZoom+=h-l,this._dollyControlCoord.set(t,i))};_collisionTest(){let e=1/0;if(!(this.colliderMeshes.length>=1)||Jm(this._camera,"_collisionTest"))return e;const i=this._getTargetDirection(Eh);iA.lookAt(hw,i,this._camera.up);for(let s=0;s<4;s++){const l=Ut.copy(this._nearPlaneCorners[s]);l.applyMatrix4(iA);const h=ml.addVectors(this._target,l);uf.set(h,i),uf.far=this._spherical.radius+1;const u=uf.intersectObjects(this.colliderMeshes);u.length!==0&&u[0].distance<e&&(e=u[0].distance)}return e}_getClientRect(e){if(!this._domElement)return;const t=this._domElement.getBoundingClientRect();return e.x=t.left,e.y=t.top,this._viewport?(e.x+=this._viewport.x,e.y+=t.height-this._viewport.w-this._viewport.y,e.width=this._viewport.z,e.height=this._viewport.w):(e.width=t.width,e.height=t.height),e}_createOnRestPromise(e){return e?Promise.resolve():(this._hasRested=!1,this.dispatchEvent({type:"transitionstart"}),new Promise(t=>{const i=()=>{this.removeEventListener("rest",i),t()};this.addEventListener("rest",i)}))}_addAllEventListeners(e){}_removeAllEventListeners(){}get dampingFactor(){return console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead."),0}set dampingFactor(e){console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead.")}get draggingDampingFactor(){return console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead."),0}set draggingDampingFactor(e){console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead.")}static createBoundingSphere(e,t=new At.Sphere){const i=t,s=i.center;_l.makeEmpty(),e.traverseVisible(h=>{h.isMesh&&_l.expandByObject(h)}),_l.getCenter(s);let l=0;return e.traverseVisible(h=>{if(!h.isMesh)return;const u=h;if(!u.geometry)return;const f=u.geometry.clone();f.applyMatrix4(u.matrixWorld);const A=f.attributes.position;for(let _=0,y=A.count;_<y;_++)bt.fromBufferAttribute(A,_),l=Math.max(l,s.distanceToSquared(bt))}),i.radius=Math.sqrt(l),i}}class gw{constructor(e){this.__position=new ee,this.__target=new ee,this.setPosition(e.position.x,e.position.y,e.position.z),this.setTarget(e.target.x,e.target.y,e.target.z)}getPosition(){return this.__position}setPosition(e,t,i){this.__position.setX(e),this.__position.setY(t),this.__position.setZ(i)}getTarget(){return this.__target}setTarget(e,t,i){this.__target.setX(e),this.__target.setY(t),this.__target.setZ(i)}}class $p extends ty{constructor({appWcRef:e}){super({appWcRef:e}),this._loggerContext="CAMERA MANAGER",this.__cameras={},this.__mainRenderer={},this.__mainCameraControls={},this.__cameraDirection=new ee,this.__cameraSpherical=new So,this.__savedCameraState={position:new ee,target:new ee,focalLength:0},this.__currentCameraPosition=new ee,this.__currentTargetPosition=new ee,this.__touchScrollState=null,this.__pointerZoomEnabled=!1,this.__dispatchingSyntheticWheel=!1}static{this.TAU=Math.PI*2}get dollyWithModifierKeyOnly(){return this._appWcRef.productSettings.camera.dollyWithModifierKeyOnly}get cameraActions(){return tc.ACTION}getCameras(){return this.__cameras}get mainCameraControls(){return this.__mainCameraControls}getCurrentCameraTransforms(){return this.__cameras.main.getWorldPosition(this.__currentCameraPosition),this.__mainCameraControls.getTarget(this.__currentTargetPosition),{position:this.__currentCameraPosition,target:this.__currentTargetPosition,focalLength:this.__cameras.main.getFocalLength()}}getCurrentCameraRotation(){return{azimuthAngle:this.__mainCameraControls.azimuthAngle,polarAngle:this.__mainCameraControls.polarAngle,distance:this.__mainCameraControls.distance}}getCameraFocalLength(){return this.__cameras.main.getFocalLength()}setCameraFocalLength(e){this.__cameras.main.setFocalLength(e)}async fitCameraToSceneBounds(e=!0){const t=this._appWcRef.getSceneSphericalBounds().clone();if(t.isEmpty()||t.radius<=0)return;let i=this._appWcRef.productSettings.camera.cameraBoundsMultiplier;return this._appWcRef.cameraBoundsMultiplier!==0&&(i=this._appWcRef.cameraBoundsMultiplier),this._appWcRef.aspectRatio<1&&(i=1),t.radius=t.radius*i,await this.fitCameraToObject({objectToFocus:t,enableTransition:e})}__onMainCameraControlsControlStart(){const e=this.__mainCameraControls,t=e.currentAction===e.mouseButtons?.right||e.currentAction===e.touches?.two;this.__cameraSettings.canPan&&t?this._appWcRef.eventsManager.cameraControlsStart.fire({type:"pan"}):e.currentAction===e.mouseButtons?.left?this._appWcRef.eventsManager.cameraControlsStart.fire({type:"rotate"}):this._appWcRef.eventsManager.cameraControlsStart.fire({type:null}),this._appWcRef.helpOverlayElem.hide()}__onMainCameraControlsControlEnd(){this._appWcRef.eventsManager.inputEnd.fire()}saveCurrentCameraTransforms(){this.__mainCameraControls.getPosition(this.__savedCameraState.position),this.__mainCameraControls.getTarget(this.__savedCameraState.target),this.__savedCameraState.focalLength=this.getCameraFocalLength()}resetCurrentCameraTransformsToLastSavedState(e=!0){this.moveCameraToLocation({newCameraTransforms:this.__savedCameraState,transition:e})}setCameraZoomLimits({minDistance:e,maxDistance:t}){this._appWcRef.productSettings.camera.canZoom===!1&&(e=null,t=null),e===null&&(e=.001),t===null&&(t=1/0);const i=this._appWcRef.getSceneSphericalBounds().radius;i<0||(this.__mainCameraControls.maxDistance=i+t,this.__mainCameraControls.minDistance=Math.min(i+e,i+t))}async zoomIn(e=.1){await this.__mainCameraControls.dolly(e,!0)}async zoomOut(e=.1){await this.__mainCameraControls.dolly(-e,!0)}enableRotationControls(){this.__mainCameraControls.mouseButtons.left=this.cameraActions.ROTATE,this.__mainCameraControls.touches.one=this.cameraActions.TOUCH_ROTATE}disableRotationControls(){this.__mainCameraControls.mouseButtons.left=this.cameraActions.NONE,this.__mainCameraControls.touches.one=this.cameraActions.NONE}enablePanControls(){this.__mainCameraControls.touches.two=this.cameraActions.TOUCH_DOLLY_TRUCK,this.__mainCameraControls.mouseButtons.right=this.cameraActions.TRUCK}disablePanControls(){this.__mainCameraControls.touches.two=this.cameraActions.NONE,this.__mainCameraControls.mouseButtons.right=this.cameraActions.NONE}enableZoomControls(){if(this._appWcRef.disableZoom){this.disableZoomControls();return}this.__pointerZoomEnabled=!0,this.__mainCameraControls.touches.two=this.cameraActions.TOUCH_DOLLY,this.__mainCameraControls.mouseButtons.wheel=this.cameraActions.DOLLY}disableZoomControls(){this.__pointerZoomEnabled=!1,this.__mainCameraControls.touches.two=this.cameraActions.NONE,this.__mainCameraControls.mouseButtons.wheel=this.cameraActions.NONE}enableCameraZoomLimits(e){this.setCameraZoomLimits({minDistance:e.minDistance,maxDistance:e.maxDistance})}disableCameraZoomLimits(){this.setCameraZoomLimits({minDistance:null,maxDistance:null})}enableCameraRotationLimits(e){const{infinitePolarAngle:t,minPolarAngle:i,maxPolarAngle:s,infiniteAzimuthAngle:l,minAzimuthAngle:h,maxAzimuthAngle:u}=e;this.__mainCameraControls.minPolarAngle=t?-1/0:i,this.__mainCameraControls.maxPolarAngle=t?1/0:s,this.__mainCameraControls.minAzimuthAngle=l?-1/0:h,this.__mainCameraControls.maxAzimuthAngle=l?1/0:u}disableCameraRotationLimits(){this.__mainCameraControls.minPolarAngle=-1/0,this.__mainCameraControls.maxPolarAngle=1/0,this.__mainCameraControls.minAzimuthAngle=-1/0,this.__mainCameraControls.maxAzimuthAngle=1/0}updateCameraSettings(e){this.__cameraSettings=JSON.parse(JSON.stringify(e)),this.enableRotationControls();const{canPan:t,canZoom:i}=e;i?this.enableZoomControls():this.disableZoomControls(),t?this.enablePanControls():this.disablePanControls(),this.__mainCameraControls.mouseButtons.middle=this.cameraActions.NONE,this.__mainCameraControls.enabled=!0,this.__cameras.main.setFocalLength(e.focalLength),this.__cameras.main.near=e.nearClip,this.__cameras.main.far=e.farClip,this.enableCameraZoomLimits(e),this.enableCameraRotationLimits(e),this._appWcRef.transparentBackground===!1&&(this.__mainRenderer.setClearColor(e.backgroundColor),this.__mainRenderer.setClearAlpha(e.backgroundAlpha))}normalizeAngle(e){return Dn.euclideanModulo(e,$p.TAU)}absoluteAngle(e,t){const i=e-t;return Dn.euclideanModulo(i+Math.PI,$p.TAU)-Math.PI}async moveCameraToLocation({newCameraTransforms:e,freezeCamera:t=!1,transition:i=!0,targetCameraControlsRef:s=this.__mainCameraControls,ignoreCameraLimits:l=!1}){e instanceof gw||(e=new gw(e));const h=e.getPosition(),u=e.getTarget();if(s.enabled=!1,l===!0)s.setLookAt(h.x,h.y,h.z,u.x,u.y,u.z,i),s.normalizeRotations();else{this.__cameraDirection.set(0,0,0),this.__cameraDirection.subVectors(h,u),this.__cameraDirection.normalize();const f=h.distanceTo(u);this.__cameraSpherical.setFromVector3(this.__cameraDirection);const g=this.absoluteAngle(this.normalizeAngle(this.__cameraSpherical.theta),this.normalizeAngle(s.azimuthAngle)),A=this.absoluteAngle(this.normalizeAngle(this.__cameraSpherical.phi),this.normalizeAngle(s.polarAngle));s.rotate(g,A,i),s.moveTo(u.x,u.y,u.z,i),s.dollyTo(f,i)}t||(s.enabled=!0)}async rotateCameraToLocation({azimuthAngle:e,polarAngle:t,distance:i,transition:s=!0,targetCameraControlsRef:l=this.__mainCameraControls}){e&&l.rotateAzimuthTo(e,s),t&&l.rotatePolarTo(t,s),i&&l.dollyTo(i,s)}async fitCameraToObject({objectToFocus:e,enableTransition:t=!0}){return await this.__mainCameraControls.fitToSphere(e,t)}async wiggleCamera(){const e=this.__mainCameraControls.azimuthAngle,t=[0,.4,-.3,0];for(const i of t){if(!this._appWcRef.playInteractionPrompt)break;await this.__mainCameraControls.rotateAzimuthTo(e+i,!0)}}__onProductSettingsUpdated(){this.updateCameraSettings(this._appWcRef.productSettings.camera),this.fitCameraToSceneBounds()}__onCameraMoveToTransform(e){e.detail.saveFirst&&this.saveCurrentCameraTransforms(),this.moveCameraToLocation({newCameraTransforms:e.detail.cameraTransforms,ignoreCameraLimits:e.detail.ignoreCameraLimits})}__onSceneBoundsChanged(){this.__mainCameraControls.setBoundary(this._appWcRef.getSceneBounds())}__setupTouchScrollDetection(){if(!("ontouchstart"in window||navigator.maxTouchPoints>0))return;const t=this.__mainRenderer.domElement,i=this.__mainCameraControls;t.style.touchAction="pan-y",new MutationObserver(()=>{t.style.touchAction!=="pan-y"&&(t.style.touchAction="pan-y")}).observe(t,{attributeFilter:["style"]}),t.addEventListener("touchmove",f=>{f.touches.length>1&&f.cancelable&&f.preventDefault()},{passive:!1}),t.addEventListener("gesturestart",f=>f.preventDefault()),t.addEventListener("gesturechange",f=>f.preventDefault());const l=5,h=new Set;t.addEventListener("pointerdown",f=>{if(f.pointerType==="touch"){if(h.add(f.pointerId),h.size>1){this.__touchScrollState=null;return}this.__touchScrollState={startX:f.clientX,startY:f.clientY,decided:!1,isVerticalScroll:!1}}}),document.addEventListener("pointermove",f=>{if(!(!this.__touchScrollState||f.pointerType!=="touch")){if(h.size>1){this.__touchScrollState=null;return}if(!this.__touchScrollState.decided){const g=Math.abs(f.clientX-this.__touchScrollState.startX),A=Math.abs(f.clientY-this.__touchScrollState.startY);if(g<l&&A<l)return;this.__touchScrollState.decided=!0,this.__touchScrollState.isVerticalScroll=A>g,this.__touchScrollState.isVerticalScroll&&i.cancel()}this.__touchScrollState.isVerticalScroll&&f.stopImmediatePropagation()}},{capture:!0});const u=f=>{f.pointerType==="touch"&&(h.delete(f.pointerId),h.size===0&&(this.__touchScrollState=null))};document.addEventListener("pointerup",u,{capture:!0}),document.addEventListener("pointercancel",u,{capture:!0})}__onWheel(e){if(this.__dispatchingSyntheticWheel||!this.__pointerZoomEnabled)return;const t=this._appWcRef.isMac&&e.metaKey||e.ctrlKey;if(this.dollyWithModifierKeyOnly&&!t){e.stopImmediatePropagation(),this._appWcRef.helpOverlayElem.show();return}if(!t)return;e.preventDefault(),e.stopImmediatePropagation();const i=new WheelEvent("wheel",{deltaX:e.deltaX,deltaY:e.deltaY,deltaZ:e.deltaZ,deltaMode:e.deltaMode,clientX:e.clientX,clientY:e.clientY,screenX:e.screenX,screenY:e.screenY,ctrlKey:!1,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:!1,bubbles:e.bubbles,cancelable:e.cancelable});this.__dispatchingSyntheticWheel=!0,e.target?.dispatchEvent(i),this.__dispatchingSyntheticWheel=!1,this._appWcRef.helpOverlayElem.hide()}__setupTrackpadPinchAsDollyHandler(){this.__mainRenderer.domElement.addEventListener("wheel",this.__onWheel.bind(this),{passive:!1})}__setupEventListeners(){this.__setupTouchScrollDetection(),this.__mainCameraControls.addEventListener("controlstart",()=>{this.__onMainCameraControlsControlStart()}),this.__mainCameraControls.addEventListener("controlend",()=>{this.__onMainCameraControlsControlEnd()}),this._appWcRef.addEventListener(this._appWcRef.eventsManager.cameraProductSettingUpdatedEvent.name,this.__onProductSettingsUpdated.bind(this)),this._appWcRef.addEventListener(this._appWcRef.eventsManager.cameraMoveToTransform.name,this.__onCameraMoveToTransform.bind(this)),this._appWcRef.addEventListener(this._appWcRef.eventsManager.sceneBoundsChanged.name,this.__onSceneBoundsChanged.bind(this))}async setup({mainRenderer:e}){this.__mainRenderer=e;const t=new Yi(75,window.innerWidth/window.innerHeight,.1,1e3);this.__cameras={main:t,screenshot:t.clone()},this.__cameras.main.name="MainCamera",this.__cameras.screenshot.name="ScreenshotCamera",this.__cameras.main.position.setZ(1);const i={Vector2:Re,Vector3:ee,Vector4:ri,Quaternion:Zi,Matrix4:pt,Spherical:So,Box3:Di,Sphere:kn,Raycaster:Gv};tc.install({THREE:i}),this.__setupTrackpadPinchAsDollyHandler(),this.__mainCameraControls=new tc(this.__cameras.main,e.domElement),this.__setupEventListeners()}}const Jz='@font-face{font-family:Helvetica Neue;src:url(https://asset.myepigraph.com/design-assets/fonts/HelveticaNeue/HelveticaNeue-Light.otf) format("opentype");font-weight:300;font-style:normal;font-display:swap}@font-face{font-family:PPMori-Regular;src:url(https://asset.myepigraph.com/design-assets/fonts/PPMori/PPMori-Regular.woff2) format("woff2");font-display:swap}@font-face{font-family:PPMori-Bold;src:url(https://asset.myepigraph.com/design-assets/fonts/PPMori/PPMori-Bold.woff2) format("woff2");font-display:swap}@font-face{font-family:Inter;src:url(https://asset.myepigraph.com/design-assets/fonts/Inter/Inter-VariableFont_slnt_wght.ttf) format("truetype");font-weight:300;font-style:normal;font-display:swap}@font-face{font-family:Inter;src:url(https://asset.myepigraph.com/design-assets/fonts/Inter/Inter_18pt-Bold.ttf) format("truetype");font-weight:700;font-style:normal;font-display:swap}',Zz={Color:{Black:{25:{$type:"color",$value:"rgba(0, 0, 0, 0.0000)"},50:{$type:"color",$value:"rgba(0, 0, 0, 0.0500)"},100:{$type:"color",$value:"rgba(0, 0, 0, 0.1000)"},200:{$type:"color",$value:"rgba(0, 0, 0, 0.2000)"},300:{$type:"color",$value:"rgba(0, 0, 0, 0.3000)"},400:{$type:"color",$value:"rgba(0, 0, 0, 0.4000)"},500:{$type:"color",$value:"rgba(0, 0, 0, 0.5000)"},600:{$type:"color",$value:"rgba(0, 0, 0, 0.6000)"},700:{$type:"color",$value:"rgba(0, 0, 0, 0.7000)"},800:{$type:"color",$value:"rgba(0, 0, 0, 0.8000)"},900:{$type:"color",$value:"rgba(0, 0, 0, 0.9000)"},1e3:{$type:"color",$value:"#000000"}},White:{25:{$type:"color",$value:"rgba(255, 255, 255, 0.0250)"},50:{$type:"color",$value:"rgba(255, 255, 255, 0.0500)"},100:{$type:"color",$value:"rgba(255, 255, 255, 0.1000)"},200:{$type:"color",$value:"rgba(255, 255, 255, 0.2000)"},300:{$type:"color",$value:"rgba(255, 255, 255, 0.3000)"},400:{$type:"color",$value:"rgba(255, 255, 255, 0.4000)"},500:{$type:"color",$value:"rgba(255, 255, 255, 0.5000)"},600:{$type:"color",$value:"rgba(255, 255, 255, 0.6000)"},700:{$type:"color",$value:"rgba(255, 255, 255, 0.7000)"},800:{$type:"color",$value:"rgba(255, 255, 255, 0.8000)"},900:{$type:"color",$value:"rgba(255, 255, 255, 0.9000)"},1e3:{$type:"color",$value:"#ffffff"}},Green:{100:{$type:"color",$value:"#ebffee"},200:{$type:"color",$value:"#cff7d3"},300:{$type:"color",$value:"#aff4c6"},400:{$type:"color",$value:"#85e0a3"},500:{$type:"color",$value:"#14ae5c"},600:{$type:"color",$value:"#009951"},700:{$type:"color",$value:"#008043"},800:{$type:"color",$value:"#02542d"},900:{$type:"color",$value:"#024023"},1e3:{$type:"color",$value:"#062d1b"}},Red:{100:{$type:"color",$value:"#fee9e7"},200:{$type:"color",$value:"#fdd3d0"},300:{$type:"color",$value:"#fcb3ad"},400:{$type:"color",$value:"#f4776a"},500:{$type:"color",$value:"#ec221f"},600:{$type:"color",$value:"#c00f0c"},700:{$type:"color",$value:"#900b09"},800:{$type:"color",$value:"#690807"},900:{$type:"color",$value:"#4d0b0a"},1e3:{$type:"color",$value:"#300603"}},Yellow:{100:{$type:"color",$value:"#fffbeb"},200:{$type:"color",$value:"#fff1c2"},300:{$type:"color",$value:"#ffe8a3"},400:{$type:"color",$value:"#e8b931"},500:{$type:"color",$value:"#e5a000"},600:{$type:"color",$value:"#bf6a02"},700:{$type:"color",$value:"#975102"},800:{$type:"color",$value:"#682d03"},900:{$type:"color",$value:"#522504"},1e3:{$type:"color",$value:"#401b01"}},Blue:{100:{$type:"color",$value:"#fbfdff"},200:{$type:"color",$value:"#eaf4ff"},300:{$type:"color",$value:"#d5ebff"},400:{$type:"color",$value:"#c0e1ff"},500:{$type:"color",$value:"#91d0ff"},600:{$type:"color",$value:"#0094d5"},700:{$type:"color",$value:"#00679b"},800:{$type:"color",$value:"#003a5a"},900:{$type:"color",$value:"#003a5a"},1e3:{$type:"color",$value:"#002133"}},Slate:{100:{$type:"color",$value:"#f5f5f5"},200:{$type:"color",$value:"#e3e3e3"},300:{$type:"color",$value:"#cdcdcd"},400:{$type:"color",$value:"#b2b2b2"},500:{$type:"color",$value:"#949494"},600:{$type:"color",$value:"#767676"},700:{$type:"color",$value:"#5a5a5a"},800:{$type:"color",$value:"#434343"},900:{$type:"color",$value:"#303030"},1e3:{$type:"color",$value:"#242424"}},Grey:{25:{$type:"color",$value:"#f5f5f5"},50:{$type:"color",$value:"#f2f2f2"},100:{$type:"color",$value:"#e6e6e6"},200:{$type:"color",$value:"#cccccc"},300:{$type:"color",$value:"#b3b3b3"},400:{$type:"color",$value:"#999999"},500:{$type:"color",$value:"#7b7b7b"},600:{$type:"color",$value:"#666666"},700:{$type:"color",$value:"#4d4d4d"},800:{$type:"color",$value:"#333333"},900:{$type:"color",$value:"#1a1a1a"},1e3:{$type:"color",$value:"#0d0d0d"}},GreyAlpha:{25:{$type:"color",$value:"rgba(248, 248, 248, 0.8000)"},100:{$type:"color",$value:"rgba(242, 242, 242, 0.8000)"},500:{$type:"color",$value:"rgba(204, 204, 204, 0.2000)"},700:{$type:"color",$value:"rgba(204, 204, 204, 0.6000)"},800:{$type:"color",$value:"rgba(186, 186, 186, 0.6000)"},900:{$type:"color",$value:"rgba(50, 50, 50, 0.9000)"},"05":{$type:"color",$value:"rgba(253, 253, 253, 0.8000)"}}},Unit:{Space:{0:{$type:"number",$value:"0px"},100:{$type:"number",$value:"4px"},150:{$type:"number",$value:"6px"},200:{$type:"number",$value:"8px"},300:{$type:"number",$value:"12px"},400:{$type:"number",$value:"16px"},500:{$type:"number",$value:"20px"},600:{$type:"number",$value:"24px"},800:{$type:"number",$value:"32px"},1e3:{$type:"number",$value:"40px"},1200:{$type:"number",$value:"48px"},1600:{$type:"number",$value:"64px"},2e3:{$type:"number",$value:"80px"},2400:{$type:"number",$value:"96px"},2800:{$type:"number",$value:"112px"},3200:{$type:"number",$value:"128px"},3600:{$type:"number",$value:"144px"},4e3:{$type:"number",$value:"160px"},4400:{$type:"number",$value:"176px"},4800:{$type:"number",$value:"192px"},5200:{$type:"number",$value:"208px"},5600:{$type:"number",$value:"224px"},6e3:{$type:"number",$value:"240px"},6400:{$type:"number",$value:"256px"},7200:{$type:"number",$value:"288px"},8e3:{$type:"number",$value:"320px"},9600:{$type:"number",$value:"384px"},"0125":{$type:"number",$value:"0.5px"},"025":{$type:"number",$value:"1px"},"0325":{$type:"number",$value:"1.5px"},"050":{$type:"number",$value:"2px"}},Stack:{100:{$type:"number",$value:"-4px"},200:{$type:"number",$value:"-8px"},300:{$type:"number",$value:"-12px"},400:{$type:"number",$value:"-16px"},800:{$type:"number",$value:"-32px"},1e3:{$type:"number",$value:"-40px"},1600:{$type:"number",$value:"-64px"},2400:{$type:"number",$value:"-96px"},3200:{$type:"number",$value:"-128px"},4e3:{$type:"number",$value:"-160px"},4800:{$type:"number",$value:"-192px"},5600:{$type:"number",$value:"-224px"},7200:{$type:"number",$value:"-288px"},9600:{$type:"number",$value:"-384px"},"0125":{$type:"number",$value:"-0.5px"},"025":{$type:"number",$value:"-1px"},"0325":{$type:"number",$value:"-1.5px"},"050":{$type:"number",$value:"-2px"},"075":{$type:"number",$value:"-3px"}},Size:{4:{$type:"number",$value:"4px"},6:{$type:"number",$value:"6px"},8:{$type:"number",$value:"8px"},10:{$type:"number",$value:"10px"},12:{$type:"number",$value:"12px"},14:{$type:"number",$value:"14px"},16:{$type:"number",$value:"16px"},18:{$type:"number",$value:"18px"},20:{$type:"number",$value:"20px"},22:{$type:"number",$value:"22px"},24:{$type:"number",$value:"24px"},28:{$type:"number",$value:"28px"},30:{$type:"number",$value:"30px"},32:{$type:"number",$value:"32px"},40:{$type:"number",$value:"40px"},48:{$type:"number",$value:"48px"},64:{$type:"number",$value:"64px"},80:{$type:"number",$value:"80px"},96:{$type:"number",$value:"96px"},112:{$type:"number",$value:"112px"},128:{$type:"number",$value:"128px"},144:{$type:"number",$value:"144px"},160:{$type:"number",$value:"160px"},176:{$type:"number",$value:"176px"},224:{$type:"number",$value:"224px"}},Resolution:{XxsmallScreenMin:{$type:"number",$value:"375px"},XsmallScreenMin:{$type:"number",$value:"480px"},SmallScreenMin:{$type:"number",$value:"576px"},MediumScreenMin:{$type:"number",$value:"768px"},LargeScreenMin:{$type:"number",$value:"992px"},XlargeScreenMin:{$type:"number",$value:"1200px"},XxlargeScreenMin:{$type:"number",$value:"1400px"},XxxsmallScreenMax:{$type:"number",$value:"374px"},XxsmallScreenMax:{$type:"number",$value:"479px"},XsmallScreenMax:{$type:"number",$value:"575px"},SmallScreenMax:{$type:"number",$value:"767px"},MediumScreenMax:{$type:"number",$value:"991px"},LargeScreenMax:{$type:"number",$value:"1199px"},XlargeScreenMax:{$type:"number",$value:"1399px"},XxlargeScreenMax:{$type:"number",$value:"1920px"}}},Font:{Family:{Main:{$type:"string",$value:"PP Mori"},Body:{$type:"string",$value:"Helvetica LT Pro"},Epigraph:{$type:"string",$value:"PP Mori"}}}},KM={Color:{Brand:{Base:{$type:"color",$value:"#335166",$web:"var(--color-brand-base)"},BaseSecondary:{$type:"color",$value:"#2b4354",$web:"var(--color-brand-base-secondary)"},BaseTertiary:{$type:"color",$value:"#202f3a",$web:"var(--color-brand-base-tertiary)"},Accent:{$type:"color",$value:"#4276cf",$web:"var(--color-brand-accent)"},AccentSecondary:{$type:"color",$value:"#3761a8",$web:"var(--color-brand-accent-secondary)"},AccentTertiary:{$type:"color",$value:"#3761a8",$web:"var(--color-brand-accent-tertiary)"},Light:{$type:"color",$value:"#f8fbf6",$web:"var(--color-brand-light)"},Dark:{$type:"color",$value:"#111b22",$web:"var(--color-brand-dark)"}}},Font:{Brand:{Heading:{$type:"string",$value:"Helvetica Neue",$web:"var(--font-brand-heading)"},Paragraph:{$type:"string",$value:"Inter",$web:"var(--font-brand-body)"}}},Unit:{Brand:{Radius:{$type:"number",$value:"4px",$web:"var(--unit-brand-radius)"}}}},Ce={Color:{Surface:{Plain:{$value:"{Primitives.Color.White.1000}"},NeutralPrimary:{$value:"{Primitives.Color.Grey.100}"},NeutralSecondary:{$value:"{Primitives.Color.Grey.50}"},NeutralTertiary:{$value:"{Primitives.Color.Grey.25}"},ShadowSecondary:{$value:"{Primitives.Color.Black.200}"}},Fill:{Accent:{$value:"{BrandPrimitives.Color.Brand.Accent}"},AccentHover:{$value:"{BrandPrimitives.Color.Brand.AccentSecondary}"},AccentPress:{$value:"{BrandPrimitives.Color.Brand.AccentTertiary}"},Base:{$value:"{BrandPrimitives.Color.Brand.Base}"},BaseHover:{$value:"{BrandPrimitives.Color.Brand.BaseSecondary}"},BasePress:{$value:"{BrandPrimitives.Color.Brand.BaseTertiary}"},NeutralPrimary:{$value:"{Primitives.Color.Grey.700}"},NeutralSecondary:{$value:"{Primitives.Color.Grey.300}"},NeutralTertiary:{$value:"{Primitives.Color.Grey.100}"},SubtlePrimary:{$value:"{Primitives.Color.GreyAlpha.100}"},SubtleSecondary:{$value:"{Primitives.Color.GreyAlpha.25}"},DangerPrimary:{$value:"{Primitives.Color.Red.600}"},Disabled:{$value:"{Primitives.Color.Grey.200}"},HotspotSecondary:{$value:"{Primitives.Color.GreyAlpha.800}"}},Icon:{NeutralPrimary:{$value:"{Primitives.Color.Grey.800}"}},Text:{Invert:{$value:"{Primitives.Color.White.1000}"},NeutralPrimary:{$value:"{Primitives.Color.Grey.800}"},NeutralSecondary:{$value:"{Primitives.Color.Grey.700}"},Disabled:{$value:"{Primitives.Color.Grey.300}"}},Border:{AltContrast:{$value:"{BrandPrimitives.Color.Brand.Dark}"},SubtlePrimary:{$value:"{Primitives.Color.Grey.300}"},SubtleSecondary:{$value:"{Primitives.Color.GreyAlpha.700}"}}},Size:{Text:{Small:{$value:"{Primitives.Unit.Size.16}"},Medium:{$value:"{Primitives.Unit.Size.18}"},Large:{$value:"{Primitives.Unit.Size.20}"}},Icon:{Small:{$value:"{Primitives.Unit.Size.20}"},Medium:{$value:"{Primitives.Unit.Size.24}"},Large:{$value:"{Primitives.Unit.Size.28}"}},Radius:{Medium:{$value:"{Primitives.Unit.Space.150}"},Full:{$value:"{Primitives.Unit.Space.6000}"}},Stroke:{Regular:{$value:"{Primitives.Unit.Space.025}"},Thick:{$value:"{Primitives.Unit.Space.050}"}},Shadow:{None:{$value:"{Primitives.Unit.Space.0}"},Xsmall:{$value:"{Primitives.Unit.Space.025}"},Small:{$value:"{Primitives.Unit.Space.0325}"}},Blur:{Small:{$value:"{Primitives.Unit.Space.100}"}}},Space:{Padding:{Small:{$value:"{Primitives.Unit.Space.300}"},Medium:{$value:"{Primitives.Unit.Space.400}"},Regular:{$value:"{Primitives.Unit.Space.600}"}},Gap:{Small:{$value:"{Primitives.Unit.Space.200}"},Regular:{$value:"{Primitives.Unit.Space.400}"},Xxlarge:{$value:"{Primitives.Unit.Space.800}"}}},Font:{Family:{CustomH:{$value:"{BrandPrimitives.Font.Brand.Heading}"},CustomP:{$value:"{BrandPrimitives.Font.Brand.Paragraph}"},Main:{$value:"Helvetica Neue"}},Tracking:{Normal:{$value:"{Primitives.Unit.Space.0}"}}}};function Ee(n){const e=/\{Primitives\.(.*?)}/,t=String(n).match(e),i=/\{BrandPrimitives\.(.*?)}/,s=String(n).match(i);let l=n;if(t){const h=t[1].split(".");l=Zz[h[0]][h[1]][h[2]].$value}else if(s){const h=s[1].split("."),u=KM[h[0]][h[1]][h[2]],f=u.$web;l=`${f.substring(0,f.length-1)}, ${u.$value})`}return Mn(l)}const ny={poweredByEpigraphFooterText:"https://asset.myepigraph.com/design-assets/icons/powered-by-epigraph.svg",splashScreenLogo:"https://asset.myepigraph.com/design-assets/icons/default-splash-screen-image.svg",sampleQrCode:"https://asset.myepigraph.com/design-assets/icons/sample-qr-code.png"};function e4(){const n={};for(const[e,t]of Object.entries(KM))for(const[i,s]of Object.entries(t))for(const[l,h]of Object.entries(s)){const u=`${e}${i}${l}`;n[u]={name:Mn(h.$web),defaultValue:h.$value,argType:{control:h.$type}}}return n}const t4=e4(),Tc={size:{name:"size",defaultValue:"small",argType:{options:["small","medium","large"],control:"select"}},theme:{name:"theme",defaultValue:"light",argType:{options:["light","dark"],control:"select"}},disabled:{name:"disabled",defaultValue:!1,argType:{control:"boolean"}}};var i4=Object.defineProperty,Hc=(n,e,t,i)=>{for(var s=void 0,l=n.length-1,h;l>=0;l--)(h=n[l])&&(s=h(e,t,s)||s);return s&&i4(e,t,s),s};const Fo=class JM extends Jl{constructor(){super(),this.epgOnClickEventName="epgonclick",this.disabled=!1,this.theme=Tc.theme.defaultValue.toString(),this.size=Tc.size.defaultValue.toString(),JM.ensureFontsAreLoaded(),this.addEventListener("click",this.doClick),this.addEventListener("pointerover",this.doHoverStart),this.addEventListener("pointerleave",this.doHoverEnd)}static{this.styles=[gt`
|
|
4414
4414
|
:host {
|
|
4415
4415
|
font-family: ${Ee(Ce.Font.Family.Main.$value)};
|
|
4416
4416
|
letter-spacing: 0.5px;
|
|
@@ -4443,7 +4443,7 @@ ${l.join(`
|
|
|
4443
4443
|
.hide {
|
|
4444
4444
|
display: none;
|
|
4445
4445
|
}
|
|
4446
|
-
`]}firstUpdated(e){super.firstUpdated(e)}static ensureFontsAreLoaded(){const e="epigraphFonts";document.head.querySelector(`#${e}`)||document.head.insertAdjacentHTML("beforeend",`<style id=${e}>${Jz}</style>`)}_getSlottedElements(e){const t=e.assignedElements();return[...t.length>0?t:e.children]}doHoverStart(){if(this.disabled)return;typeof this.onHoverStartCallback=="function"&&this.onHoverStartCallback(),this.shadowRoot?.host.classList.add("hover");const
|
|
4446
|
+
`]}firstUpdated(e){super.firstUpdated(e)}static ensureFontsAreLoaded(){const e="epigraphFonts";document.head.querySelector(`#${e}`)||document.head.insertAdjacentHTML("beforeend",`<style id=${e}>${Jz}</style>`)}_getSlottedElements(e){const t=e.assignedElements();return[...t.length>0?t:e.children]}doHoverStart(e){if(this.disabled)return;typeof this.onHoverStartCallback=="function"&&this.onHoverStartCallback(),this.shadowRoot?.host.classList.add("hover");const t=new CustomEvent("epgonhoverstart");this.dispatchEvent(t)}doHoverEnd(){if(this.disabled)return;typeof this.onHoverEndCallback=="function"&&this.onHoverEndCallback(),this.shadowRoot?.host.classList.remove("hover");const e=new CustomEvent("epgonhoverend");this.dispatchEvent(e)}doClick(){if(this.disabled)return;typeof this.onClickCallback=="function"&&this.onClickCallback();const e=new CustomEvent("epgonclick");this.dispatchEvent(e)}_showElement(e){const t=e.target;t&&(t.classList.remove("hide"),t.ariaHidden="true")}_hideElement(e){const t=e.target;t&&(t.classList.add("hide"),t.ariaHidden="true")}_showPlaceholderImage(e){const t=e.target;t&&(t.src="https://placehold.co/100")}render(){return de`
|
|
4447
4447
|
${Vt.getCustomStylesTemplate()}
|
|
4448
4448
|
`}};Hc([le({type:Boolean,attribute:Tc.disabled.name,reflect:!0})],Fo.prototype,"disabled");Hc([le({attribute:Tc.theme.name,type:String,reflect:!0})],Fo.prototype,"theme");Hc([le({attribute:Tc.size.name,type:String,reflect:!0})],Fo.prototype,"size");Hc([le({attribute:!1})],Fo.prototype,"onClickCallback");Hc([le({attribute:!1})],Fo.prototype,"onHoverStartCallback");Hc([le({attribute:!1})],Fo.prototype,"onHoverEndCallback");let dn=Fo;const mw="epg-dimension-label",zp={label:{name:"label",defaultValue:"6.5"},unitSymbol:{name:"unit-symbol",defaultValue:"”"}};var n4=Object.defineProperty,ZM=(n,e,t,i)=>{for(var s=void 0,l=n.length-1,h;l>=0;l--)(h=n[l])&&(s=h(e,t,s)||s);return s&&n4(e,t,s),s};class sy extends dn{constructor(){super(...arguments),this.label=zp.label.defaultValue.toString(),this.unitSymbol=zp.unitSymbol.defaultValue.toString()}static{this.styles=[super.styles,gt`
|
|
4449
4449
|
:host {
|
|
@@ -5044,7 +5044,10 @@ ${l.join(`
|
|
|
5044
5044
|
height: 30%;
|
|
5045
5045
|
border-radius: 50%;
|
|
5046
5046
|
background-color: white;
|
|
5047
|
-
transition:
|
|
5047
|
+
transition:
|
|
5048
|
+
width 0.2s ease-in-out,
|
|
5049
|
+
height 0.2s ease-in-out,
|
|
5050
|
+
opacity 0.2s ease-in-out;
|
|
5048
5051
|
}
|
|
5049
5052
|
|
|
5050
5053
|
:host .hotspot-ripple-circle {
|
|
@@ -5053,7 +5056,10 @@ ${l.join(`
|
|
|
5053
5056
|
border-radius: 50%;
|
|
5054
5057
|
background-color: white;
|
|
5055
5058
|
position: absolute;
|
|
5056
|
-
transition:
|
|
5059
|
+
transition:
|
|
5060
|
+
width 0.2s ease-in-out,
|
|
5061
|
+
height 0.2s ease-in-out,
|
|
5062
|
+
opacity 0.2s ease-in-out;
|
|
5057
5063
|
}
|
|
5058
5064
|
|
|
5059
5065
|
:host(:disabled) {
|
|
@@ -5103,7 +5109,7 @@ ${l.join(`
|
|
|
5103
5109
|
width: 0%;
|
|
5104
5110
|
height: 0%;
|
|
5105
5111
|
}
|
|
5106
|
-
|
|
5112
|
+
|
|
5107
5113
|
75% {
|
|
5108
5114
|
width: 100%;
|
|
5109
5115
|
height: 100%;
|
|
@@ -5113,8 +5119,13 @@ ${l.join(`
|
|
|
5113
5119
|
opacity: 0;
|
|
5114
5120
|
}
|
|
5115
5121
|
}
|
|
5116
|
-
`]}doClick(){if(this.disabled)return;this.togglable&&(this.active=!this.active),typeof this.onClickCallback=="function"&&this.onClickCallback.bind(this);const e=new CustomEvent("epgonclick");this.dispatchEvent(e)}ripple(){this.__rippleElement&&(this.__rippleElement.style.animation="none",this.__rippleElement.style.animation="ripple 1500ms ease-out")}updated(e){super.updated(e),e.has("active")&&this.shadowRoot?.host.toggleAttribute("active",this.active)}_renderTooltip(){const e=this.tooltipLabel?de`<div slot="replace-all">${this.tooltipLabel}</div>`:De;return de`
|
|
5117
|
-
<epg-tooltip
|
|
5122
|
+
`]}doClick(){if(this.disabled)return;this.togglable&&(this.active=!this.active),typeof this.onClickCallback=="function"&&this.onClickCallback.bind(this);const e=new CustomEvent("epgonclick");this.dispatchEvent(e)}doHoverStart(e){e.pointerType!=="touch"&&super.doHoverStart()}ripple(){this.__rippleElement&&(this.__rippleElement.style.animation="none",this.__rippleElement.style.animation="ripple 1500ms ease-out")}updated(e){super.updated(e),e.has("active")&&this.shadowRoot?.host.toggleAttribute("active",this.active)}_renderTooltip(){const e=this.tooltipLabel?de`<div slot="replace-all">${this.tooltipLabel}</div>`:De;return de`
|
|
5123
|
+
<epg-tooltip
|
|
5124
|
+
class="tooltip ${this.tooltipPlacement}"
|
|
5125
|
+
?disabled=${this.tooltipPlacement==="none"}
|
|
5126
|
+
placement=${this.tooltipPlacement}
|
|
5127
|
+
theme="light"
|
|
5128
|
+
>
|
|
5118
5129
|
${e}
|
|
5119
5130
|
</epg-tooltip>
|
|
5120
5131
|
`}_defaultContents(){return de`
|
|
@@ -9620,7 +9631,7 @@ Arguments: [`+R+"]"}},a.fz.prototype={k(r){return"Unsupported operation: "+this.
|
|
|
9620
9631
|
${this.__renderBody()}
|
|
9621
9632
|
</div>
|
|
9622
9633
|
</epg-modal>
|
|
9623
|
-
`}};pd([le({attribute:!1})],th.prototype,"report");pd([bi()],th.prototype,"__activeTab");pd([bi()],th.prototype,"__gpuSnapshot");pd([bi()],th.prototype,"__validationProgress");pd([kt("#validationsModal")],th.prototype,"__modalRef");let p6=th;var g6=Object.defineProperty,ut=(n,e,t,i)=>{for(var s=void 0,l=n.length-1,h;l>=0;l--)(h=n[l])&&(s=h(e,t,s)||s);return s&&g6(e,t,s),s},kl=(n=>(n.NONE="",n.SKU="sku",n.SHOPIFY_VARIANT_ID="shopify_variant_id",n.ASIN="asin",n.UPC="upc",n.PRODUCT_VARIANT_UUID="product_variant_uuid",n))(kl||{});const lt=class au extends qR{constructor(){let e=ou.PRODUCTION;super("1.11.
|
|
9634
|
+
`}};pd([le({attribute:!1})],th.prototype,"report");pd([bi()],th.prototype,"__activeTab");pd([bi()],th.prototype,"__gpuSnapshot");pd([bi()],th.prototype,"__validationProgress");pd([kt("#validationsModal")],th.prototype,"__modalRef");let p6=th;var g6=Object.defineProperty,ut=(n,e,t,i)=>{for(var s=void 0,l=n.length-1,h;l>=0;l--)(h=n[l])&&(s=h(e,t,s)||s);return s&&g6(e,t,s),s},kl=(n=>(n.NONE="",n.SKU="sku",n.SHOPIFY_VARIANT_ID="shopify_variant_id",n.ASIN="asin",n.UPC="upc",n.PRODUCT_VARIANT_UUID="product_variant_uuid",n))(kl||{});const lt=class au extends qR{constructor(){let e=ou.PRODUCTION;super("1.11.4-pre-alpha.1",e),this.isMac=/Mac/i.test(navigator.userAgent),this.epigraphWebsiteRedirectUrls={icon:"https://www.epigraph.us",modal:"https://www.epigraph.us"},this.sessionState="default",this.isAppReady=!1,this.sku=zt.sku.defaultValue.toString(),this.shopify_variant_id=zt.shopifyVariantId.defaultValue.toString(),this.upc=zt.upc.defaultValue.toString(),this.asin=zt.asin.defaultValue.toString(),this.product_variant_uuid=zt.productVariantUuid.defaultValue.toString(),this.customVersionId="",this.gaMeasurementId="",this.disableZoom=!1,this.modalView=!1,this.hide=!1,this.isLoading=!0,this.apiMode="production",this.debug=!1,this.showSettings=!1,this.dimensionsUnit=zt.dimensionsUnit.defaultValue.toString(),this.dimensionsUnitSymbol=zt.dimensionsUnitSymbol.defaultValue.toString(),this.areDimensionsActive=!1,this.areHotspotsActive=!1,this.variantSwitchMode=zt.variantSwitchMode.defaultValue.toString(),this.areCommentsActive=!1,this.isHelpVisible=!1,this.baseUrlOverride=zt.baseUrlOverride.defaultValue.toString(),this.cameraBoundsMultiplier=1,this.isPortraitOrientation=!1,this.didARAutoLaunch=!1,this.transparentBackground=!1,this.splashScreenLogo=zt.splashScreenLogo.defaultValue.toString(),this.splashScreenText=zt.splashScreenText.defaultValue.toString(),this.hideUi=!1,this.playInteractionPrompt=!1,this.featuresToEnable={viewer:!0,hotspots:!0,dimensions:!0,viewInYourSpace:!0,sceneManager:!0,comments:!1,debugManager:!1,validationsManager:!1},this._hasActiveHotspot=!1,this._isToolsetLargerThanTheLeftBottomQuadrant=!1,this._loadingProgress=0,this._loadTimeBegin=performance.now(),this._loggerContext="EPIGRAPH THREED CODE",this._epigraphAnalytics=new n2(null,null),this._identifier="",this._identifierType="",this._isDevEnv=!1,this._isStagingEnv=!1,this._productSettings=new V8,this._boundingSphereCenter=new ee,this._loaders=new wu,this._activeAnimations=new Map,this._animationFadeDurationInMiliseconds=1e3,this._isSceneInteractedWith=!1,this.__isLoadingForTheFirstTime=!0,this.__glbBlobUrl="",this.__usdzBlobUrl="",this.__hasSceneChanged=!1,this.__canvasSize={width:0,height:0},this.__raycaster=new Gv,this.__pointer=new Re,this.__viewStateGrid=new H1(40,190,0,12829635),this.__interactionPlayCount=0}static{this.webComponentName="epigraph-threed-core"}static setupWebComponent(){window.customElements.get(au.webComponentName)||window.customElements.define(au.webComponentName,au)}static{this.styles=[gt`
|
|
9624
9635
|
:host {
|
|
9625
9636
|
all: initial;
|
|
9626
9637
|
display: flex;
|
package/package.json
CHANGED
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@epigraph/solutions",
|
|
3
|
-
"version": "1.11.
|
|
4
|
-
"type": "module",
|
|
5
|
-
"main": "./dist/epigraph-solutions.js",
|
|
6
|
-
"files": [
|
|
7
|
-
"dist"
|
|
8
|
-
],
|
|
9
|
-
"scripts": {
|
|
10
|
-
"component:create": "node ./npm-scripts/createNewUiComponent.js",
|
|
11
|
-
"dev": "vite --force",
|
|
12
|
-
"build:ui-components": "cross-env NODE_ENV=production && tsc && vite build --config ui-components-vite.config.ts",
|
|
13
|
-
"build:epigraph-solutions": "cross-env NODE_ENV=production && tsc && vite build",
|
|
14
|
-
"build:epigraph-previewer": "cross-env NODE_ENV=production && tsc && vite build --config epigraph-previewer-vite.config.ts",
|
|
15
|
-
"build:demo-pages": "cross-env NODE_ENV=production && tsc && vite build --config demo-pages-vite.config.ts",
|
|
16
|
-
"build": "npm run build:ui-components && npm run build:epigraph-solutions && npm run build:epigraph-previewer",
|
|
17
|
-
"docs": "typedoc ./lib/solutions/Solutions/**/*.api.ts",
|
|
18
|
-
"chromatic": "cross-env NODE_ENV=production && npx chromatic --project-token=chpt_cb7e103f37516af",
|
|
19
|
-
"preview": "vite preview",
|
|
20
|
-
"prepublishOnly": "npm run build:epigraph-solutions",
|
|
21
|
-
"storybook": "storybook dev -p 6007",
|
|
22
|
-
"build-storybook": "storybook build",
|
|
23
|
-
"format": "tsc --noEmit && prettier . --write && eslint . --fix"
|
|
24
|
-
},
|
|
25
|
-
"husky": {
|
|
26
|
-
"hooks": {
|
|
27
|
-
"pre-commit": "npm run format"
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
"lint-staged": {
|
|
31
|
-
"*.{js,jsx,ts,tsx,json,css,md}": [
|
|
32
|
-
"npm run format"
|
|
33
|
-
]
|
|
34
|
-
},
|
|
35
|
-
"devDependencies": {
|
|
36
|
-
"@babel/core": "^7.26.0",
|
|
37
|
-
"@chromatic-com/storybook": "^5.2.1",
|
|
38
|
-
"@epigraph/epigraph-std-lib": "5.0.0-alpha.14",
|
|
39
|
-
"@gltf-transform/functions": "^4.1.3",
|
|
40
|
-
"@google/model-viewer": "4.2.0",
|
|
41
|
-
"@storybook/addon-docs": "^10.4.6",
|
|
42
|
-
"@storybook/addon-links": "^10.4.6",
|
|
43
|
-
"@storybook/builder-vite": "^10.4.6",
|
|
44
|
-
"@storybook/web-components": "^10.4.6",
|
|
45
|
-
"@storybook/web-components-vite": "^10.4.6",
|
|
46
|
-
"@tweenjs/tween.js": "^25.0.0",
|
|
47
|
-
"@types/node": "^22.14.0",
|
|
48
|
-
"@types/three": "0.182.0",
|
|
49
|
-
"babel-loader": "^8.2.3",
|
|
50
|
-
"camera-controls": "^3.1.0",
|
|
51
|
-
"chromatic": "^17.8.0",
|
|
52
|
-
"eslint": "^9.26.0",
|
|
53
|
-
"gltf-validator": "^2.0.0-dev.3.10",
|
|
54
|
-
"inquirer": "^12.4.1",
|
|
55
|
-
"playcanvas": "^2.20.0",
|
|
56
|
-
"prettier": "^3.5.3",
|
|
57
|
-
"storybook": "^10.4.6",
|
|
58
|
-
"three": "0.182.0",
|
|
59
|
-
"typedoc": "^0.28.16",
|
|
60
|
-
"typedoc-plugin-markdown": "^4.9.0",
|
|
61
|
-
"typescript": "^5.8.2",
|
|
62
|
-
"vite": "^6.2.0",
|
|
63
|
-
"vite-plugin-dts": "^4.5.4"
|
|
64
|
-
},
|
|
65
|
-
"dependencies": {
|
|
66
|
-
"@pmndrs/vanilla": "^1.25.0",
|
|
67
|
-
"@typescript-eslint/eslint-plugin": "^8.32.1",
|
|
68
|
-
"cross-env": "^7.0.3",
|
|
69
|
-
"dompurify": "^3.2.6",
|
|
70
|
-
"lit": "^3.3.0",
|
|
71
|
-
"swiper": "^12.1.3"
|
|
72
|
-
}
|
|
73
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@epigraph/solutions",
|
|
3
|
+
"version": "1.11.4-pre-alpha.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/epigraph-solutions.js",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist"
|
|
8
|
+
],
|
|
9
|
+
"scripts": {
|
|
10
|
+
"component:create": "node ./npm-scripts/createNewUiComponent.js",
|
|
11
|
+
"dev": "vite --force",
|
|
12
|
+
"build:ui-components": "cross-env NODE_ENV=production && tsc && vite build --config ui-components-vite.config.ts",
|
|
13
|
+
"build:epigraph-solutions": "cross-env NODE_ENV=production && tsc && vite build",
|
|
14
|
+
"build:epigraph-previewer": "cross-env NODE_ENV=production && tsc && vite build --config epigraph-previewer-vite.config.ts",
|
|
15
|
+
"build:demo-pages": "cross-env NODE_ENV=production && tsc && vite build --config demo-pages-vite.config.ts",
|
|
16
|
+
"build": "npm run build:ui-components && npm run build:epigraph-solutions && npm run build:epigraph-previewer",
|
|
17
|
+
"docs": "typedoc ./lib/solutions/Solutions/**/*.api.ts",
|
|
18
|
+
"chromatic": "cross-env NODE_ENV=production && npx chromatic --project-token=chpt_cb7e103f37516af",
|
|
19
|
+
"preview": "vite preview",
|
|
20
|
+
"prepublishOnly": "npm run build:epigraph-solutions",
|
|
21
|
+
"storybook": "storybook dev -p 6007",
|
|
22
|
+
"build-storybook": "storybook build",
|
|
23
|
+
"format": "tsc --noEmit && prettier . --write && eslint . --fix"
|
|
24
|
+
},
|
|
25
|
+
"husky": {
|
|
26
|
+
"hooks": {
|
|
27
|
+
"pre-commit": "npm run format"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"lint-staged": {
|
|
31
|
+
"*.{js,jsx,ts,tsx,json,css,md}": [
|
|
32
|
+
"npm run format"
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@babel/core": "^7.26.0",
|
|
37
|
+
"@chromatic-com/storybook": "^5.2.1",
|
|
38
|
+
"@epigraph/epigraph-std-lib": "5.0.0-alpha.14",
|
|
39
|
+
"@gltf-transform/functions": "^4.1.3",
|
|
40
|
+
"@google/model-viewer": "4.2.0",
|
|
41
|
+
"@storybook/addon-docs": "^10.4.6",
|
|
42
|
+
"@storybook/addon-links": "^10.4.6",
|
|
43
|
+
"@storybook/builder-vite": "^10.4.6",
|
|
44
|
+
"@storybook/web-components": "^10.4.6",
|
|
45
|
+
"@storybook/web-components-vite": "^10.4.6",
|
|
46
|
+
"@tweenjs/tween.js": "^25.0.0",
|
|
47
|
+
"@types/node": "^22.14.0",
|
|
48
|
+
"@types/three": "0.182.0",
|
|
49
|
+
"babel-loader": "^8.2.3",
|
|
50
|
+
"camera-controls": "^3.1.0",
|
|
51
|
+
"chromatic": "^17.8.0",
|
|
52
|
+
"eslint": "^9.26.0",
|
|
53
|
+
"gltf-validator": "^2.0.0-dev.3.10",
|
|
54
|
+
"inquirer": "^12.4.1",
|
|
55
|
+
"playcanvas": "^2.20.0",
|
|
56
|
+
"prettier": "^3.5.3",
|
|
57
|
+
"storybook": "^10.4.6",
|
|
58
|
+
"three": "0.182.0",
|
|
59
|
+
"typedoc": "^0.28.16",
|
|
60
|
+
"typedoc-plugin-markdown": "^4.9.0",
|
|
61
|
+
"typescript": "^5.8.2",
|
|
62
|
+
"vite": "^6.2.0",
|
|
63
|
+
"vite-plugin-dts": "^4.5.4"
|
|
64
|
+
},
|
|
65
|
+
"dependencies": {
|
|
66
|
+
"@pmndrs/vanilla": "^1.25.0",
|
|
67
|
+
"@typescript-eslint/eslint-plugin": "^8.32.1",
|
|
68
|
+
"cross-env": "^7.0.3",
|
|
69
|
+
"dompurify": "^3.2.6",
|
|
70
|
+
"lit": "^3.3.0",
|
|
71
|
+
"swiper": "^12.1.3"
|
|
72
|
+
}
|
|
73
|
+
}
|