gralobe 1.0.11 → 1.0.13

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.
@@ -1,4 +1,4 @@
1
- (function(ae,A){typeof exports=="object"&&typeof module<"u"?A(exports,require("three")):typeof define=="function"&&define.amd?define(["exports","three"],A):(ae=typeof globalThis<"u"?globalThis:ae||self,A(ae.Gralobe={},ae.THREE))})(this,(function(ae,A){"use strict";function Or(a){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const t in a)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(a,t);Object.defineProperty(e,t,i.get?i:{enumerable:!0,get:()=>a[t]})}}return e.default=a,Object.freeze(e)}const D=Or(A),Hi={type:"change"},Kt={type:"start"},Zi={type:"end"},Tt=new A.Ray,Ki=new A.Plane,Rr=Math.cos(70*A.MathUtils.DEG2RAD),Z=new A.Vector3,J=2*Math.PI,L={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},Xt=1e-6;class Ir extends A.Controls{constructor(e,t=null){super(e,t),this.state=L.NONE,this.target=new A.Vector3,this.cursor=new A.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.keyRotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:A.MOUSE.ROTATE,MIDDLE:A.MOUSE.DOLLY,RIGHT:A.MOUSE.PAN},this.touches={ONE:A.TOUCH.ROTATE,TWO:A.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new A.Vector3,this._lastQuaternion=new A.Quaternion,this._lastTargetPosition=new A.Vector3,this._quat=new A.Quaternion().setFromUnitVectors(e.up,new A.Vector3(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new A.Spherical,this._sphericalDelta=new A.Spherical,this._scale=1,this._panOffset=new A.Vector3,this._rotateStart=new A.Vector2,this._rotateEnd=new A.Vector2,this._rotateDelta=new A.Vector2,this._panStart=new A.Vector2,this._panEnd=new A.Vector2,this._panDelta=new A.Vector2,this._dollyStart=new A.Vector2,this._dollyEnd=new A.Vector2,this._dollyDelta=new A.Vector2,this._dollyDirection=new A.Vector3,this._mouse=new A.Vector2,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=kr.bind(this),this._onPointerDown=Lr.bind(this),this._onPointerUp=Ur.bind(this),this._onContextMenu=Gr.bind(this),this._onMouseWheel=Nr.bind(this),this._onKeyDown=$r.bind(this),this._onTouchStart=Br.bind(this),this._onTouchMove=Vr.bind(this),this._onMouseDown=Fr.bind(this),this._onMouseMove=zr.bind(this),this._interceptControlDown=jr.bind(this),this._interceptControlUp=Yr.bind(this),this.domElement!==null&&this.connect(this.domElement),this.update()}connect(e){super.connect(e),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerUp),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener("keydown",this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(e){e.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=e}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(Hi),this.update(),this.state=L.NONE}update(e=null){const t=this.object.position;Z.copy(t).sub(this.target),Z.applyQuaternion(this._quat),this._spherical.setFromVector3(Z),this.autoRotate&&this.state===L.NONE&&this._rotateLeft(this._getAutoRotationAngle(e)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let i=this.minAzimuthAngle,n=this.maxAzimuthAngle;isFinite(i)&&isFinite(n)&&(i<-Math.PI?i+=J:i>Math.PI&&(i-=J),n<-Math.PI?n+=J:n>Math.PI&&(n-=J),i<=n?this._spherical.theta=Math.max(i,Math.min(n,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(i+n)/2?Math.max(i,this._spherical.theta):Math.min(n,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let r=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const s=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),r=s!=this._spherical.radius}if(Z.setFromSpherical(this._spherical),Z.applyQuaternion(this._quatInverse),t.copy(this.target).add(Z),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let s=null;if(this.object.isPerspectiveCamera){const o=Z.length();s=this._clampDistance(o*this._scale);const l=o-s;this.object.position.addScaledVector(this._dollyDirection,l),this.object.updateMatrixWorld(),r=!!l}else if(this.object.isOrthographicCamera){const o=new A.Vector3(this._mouse.x,this._mouse.y,0);o.unproject(this.object);const l=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),r=l!==this.object.zoom;const h=new A.Vector3(this._mouse.x,this._mouse.y,0);h.unproject(this.object),this.object.position.sub(h).add(o),this.object.updateMatrixWorld(),s=Z.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;s!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(s).add(this.object.position):(Tt.origin.copy(this.object.position),Tt.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(Tt.direction))<Rr?this.object.lookAt(this.target):(Ki.setFromNormalAndCoplanarPoint(this.object.up,this.target),Tt.intersectPlane(Ki,this.target))))}else if(this.object.isOrthographicCamera){const s=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),s!==this.object.zoom&&(this.object.updateProjectionMatrix(),r=!0)}return this._scale=1,this._performCursorZoom=!1,r||this._lastPosition.distanceToSquared(this.object.position)>Xt||8*(1-this._lastQuaternion.dot(this.object.quaternion))>Xt||this._lastTargetPosition.distanceToSquared(this.target)>Xt?(this.dispatchEvent(Hi),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(e){return e!==null?J/60*this.autoRotateSpeed*e:J/60/60*this.autoRotateSpeed}_getZoomScale(e){const t=Math.abs(e*.01);return Math.pow(.95,this.zoomSpeed*t)}_rotateLeft(e){this._sphericalDelta.theta-=e}_rotateUp(e){this._sphericalDelta.phi-=e}_panLeft(e,t){Z.setFromMatrixColumn(t,0),Z.multiplyScalar(-e),this._panOffset.add(Z)}_panUp(e,t){this.screenSpacePanning===!0?Z.setFromMatrixColumn(t,1):(Z.setFromMatrixColumn(t,0),Z.crossVectors(this.object.up,Z)),Z.multiplyScalar(e),this._panOffset.add(Z)}_pan(e,t){const i=this.domElement;if(this.object.isPerspectiveCamera){const n=this.object.position;Z.copy(n).sub(this.target);let r=Z.length();r*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*e*r/i.clientHeight,this.object.matrix),this._panUp(2*t*r/i.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(e*(this.object.right-this.object.left)/this.object.zoom/i.clientWidth,this.object.matrix),this._panUp(t*(this.object.top-this.object.bottom)/this.object.zoom/i.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(e,t){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const i=this.domElement.getBoundingClientRect(),n=e-i.left,r=t-i.top,s=i.width,o=i.height;this._mouse.x=n/s*2-1,this._mouse.y=-(r/o)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(e){return Math.max(this.minDistance,Math.min(this.maxDistance,e))}_handleMouseDownRotate(e){this._rotateStart.set(e.clientX,e.clientY)}_handleMouseDownDolly(e){this._updateZoomParameters(e.clientX,e.clientX),this._dollyStart.set(e.clientX,e.clientY)}_handleMouseDownPan(e){this._panStart.set(e.clientX,e.clientY)}_handleMouseMoveRotate(e){this._rotateEnd.set(e.clientX,e.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const t=this.domElement;this._rotateLeft(J*this._rotateDelta.x/t.clientHeight),this._rotateUp(J*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(e){this._dollyEnd.set(e.clientX,e.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(e){this._panEnd.set(e.clientX,e.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(e){this._updateZoomParameters(e.clientX,e.clientY),e.deltaY<0?this._dollyIn(this._getZoomScale(e.deltaY)):e.deltaY>0&&this._dollyOut(this._getZoomScale(e.deltaY)),this.update()}_handleKeyDown(e){let t=!1;switch(e.code){case this.keys.UP:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(J*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),t=!0;break;case this.keys.BOTTOM:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(-J*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),t=!0;break;case this.keys.LEFT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(J*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),t=!0;break;case this.keys.RIGHT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(-J*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),t=!0;break}t&&(e.preventDefault(),this.update())}_handleTouchStartRotate(e){if(this._pointers.length===1)this._rotateStart.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),i=.5*(e.pageX+t.x),n=.5*(e.pageY+t.y);this._rotateStart.set(i,n)}}_handleTouchStartPan(e){if(this._pointers.length===1)this._panStart.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),i=.5*(e.pageX+t.x),n=.5*(e.pageY+t.y);this._panStart.set(i,n)}}_handleTouchStartDolly(e){const t=this._getSecondPointerPosition(e),i=e.pageX-t.x,n=e.pageY-t.y,r=Math.sqrt(i*i+n*n);this._dollyStart.set(0,r)}_handleTouchStartDollyPan(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enablePan&&this._handleTouchStartPan(e)}_handleTouchStartDollyRotate(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enableRotate&&this._handleTouchStartRotate(e)}_handleTouchMoveRotate(e){if(this._pointers.length==1)this._rotateEnd.set(e.pageX,e.pageY);else{const i=this._getSecondPointerPosition(e),n=.5*(e.pageX+i.x),r=.5*(e.pageY+i.y);this._rotateEnd.set(n,r)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const t=this.domElement;this._rotateLeft(J*this._rotateDelta.x/t.clientHeight),this._rotateUp(J*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(e){if(this._pointers.length===1)this._panEnd.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),i=.5*(e.pageX+t.x),n=.5*(e.pageY+t.y);this._panEnd.set(i,n)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(e){const t=this._getSecondPointerPosition(e),i=e.pageX-t.x,n=e.pageY-t.y,r=Math.sqrt(i*i+n*n);this._dollyEnd.set(0,r),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const s=(e.pageX+t.x)*.5,o=(e.pageY+t.y)*.5;this._updateZoomParameters(s,o)}_handleTouchMoveDollyPan(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enablePan&&this._handleTouchMovePan(e)}_handleTouchMoveDollyRotate(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enableRotate&&this._handleTouchMoveRotate(e)}_addPointer(e){this._pointers.push(e.pointerId)}_removePointer(e){delete this._pointerPositions[e.pointerId];for(let t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId){this._pointers.splice(t,1);return}}_isTrackingPointer(e){for(let t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId)return!0;return!1}_trackPointer(e){let t=this._pointerPositions[e.pointerId];t===void 0&&(t=new A.Vector2,this._pointerPositions[e.pointerId]=t),t.set(e.pageX,e.pageY)}_getSecondPointerPosition(e){const t=e.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[t]}_customWheelEvent(e){const t=e.deltaMode,i={clientX:e.clientX,clientY:e.clientY,deltaY:e.deltaY};switch(t){case 1:i.deltaY*=16;break;case 2:i.deltaY*=100;break}return e.ctrlKey&&!this._controlActive&&(i.deltaY*=10),i}}function Lr(a){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(a.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerup",this._onPointerUp)),!this._isTrackingPointer(a)&&(this._addPointer(a),a.pointerType==="touch"?this._onTouchStart(a):this._onMouseDown(a)))}function kr(a){this.enabled!==!1&&(a.pointerType==="touch"?this._onTouchMove(a):this._onMouseMove(a))}function Ur(a){switch(this._removePointer(a),this._pointers.length){case 0:this.domElement.releasePointerCapture(a.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(Zi),this.state=L.NONE;break;case 1:const e=this._pointers[0],t=this._pointerPositions[e];this._onTouchStart({pointerId:e,pageX:t.x,pageY:t.y});break}}function Fr(a){let e;switch(a.button){case 0:e=this.mouseButtons.LEFT;break;case 1:e=this.mouseButtons.MIDDLE;break;case 2:e=this.mouseButtons.RIGHT;break;default:e=-1}switch(e){case A.MOUSE.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(a),this.state=L.DOLLY;break;case A.MOUSE.ROTATE:if(a.ctrlKey||a.metaKey||a.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(a),this.state=L.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(a),this.state=L.ROTATE}break;case A.MOUSE.PAN:if(a.ctrlKey||a.metaKey||a.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(a),this.state=L.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(a),this.state=L.PAN}break;default:this.state=L.NONE}this.state!==L.NONE&&this.dispatchEvent(Kt)}function zr(a){switch(this.state){case L.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(a);break;case L.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(a);break;case L.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(a);break}}function Nr(a){this.enabled===!1||this.enableZoom===!1||this.state!==L.NONE||(a.preventDefault(),this.dispatchEvent(Kt),this._handleMouseWheel(this._customWheelEvent(a)),this.dispatchEvent(Zi))}function $r(a){this.enabled!==!1&&this._handleKeyDown(a)}function Br(a){switch(this._trackPointer(a),this._pointers.length){case 1:switch(this.touches.ONE){case A.TOUCH.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(a),this.state=L.TOUCH_ROTATE;break;case A.TOUCH.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(a),this.state=L.TOUCH_PAN;break;default:this.state=L.NONE}break;case 2:switch(this.touches.TWO){case A.TOUCH.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(a),this.state=L.TOUCH_DOLLY_PAN;break;case A.TOUCH.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(a),this.state=L.TOUCH_DOLLY_ROTATE;break;default:this.state=L.NONE}break;default:this.state=L.NONE}this.state!==L.NONE&&this.dispatchEvent(Kt)}function Vr(a){switch(this._trackPointer(a),this.state){case L.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(a),this.update();break;case L.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(a),this.update();break;case L.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(a),this.update();break;case L.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(a),this.update();break;default:this.state=L.NONE}}function Gr(a){this.enabled!==!1&&a.preventDefault()}function jr(a){a.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function Yr(a){a.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function Ee(a){if(a===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function Xi(a,e){a.prototype=Object.create(e.prototype),a.prototype.constructor=a,a.__proto__=e}var oe={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},We={duration:.5,overwrite:!1,delay:0},Wt,X,z,pe=1e8,k=1/pe,qt=Math.PI*2,Hr=qt/4,Zr=0,Wi=Math.sqrt,Kr=Math.cos,Xr=Math.sin,K=function(e){return typeof e=="string"},V=function(e){return typeof e=="function"},we=function(e){return typeof e=="number"},Qt=function(e){return typeof e>"u"},_e=function(e){return typeof e=="object"},ee=function(e){return e!==!1},Jt=function(){return typeof window<"u"},Dt=function(e){return V(e)||K(e)},qi=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},W=Array.isArray,ei=/(?:-?\.?\d|\.)+/gi,Qi=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,qe=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,ti=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,Ji=/[+-]=-?[.\d]+/,en=/[^,'"\[\]\s]+/gi,Wr=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,$,ye,ii,ni,le={},Mt={},tn,nn=function(e){return(Mt=Je(e,le))&&ne},ri=function(e,t){return console.warn("Invalid property",e,"set to",t,"Missing plugin? gsap.registerPlugin()")},ct=function(e,t){return!t&&console.warn(e)},rn=function(e,t){return e&&(le[e]=t)&&Mt&&(Mt[e]=t)||le},ht=function(){return 0},qr={suppressEvents:!0,isStart:!0,kill:!1},Ot={suppressEvents:!0,kill:!1},Qr={suppressEvents:!0},si={},Se=[],ai={},sn,ce={},oi={},an=30,Rt=[],li="",ci=function(e){var t=e[0],i,n;if(_e(t)||V(t)||(e=[e]),!(i=(t._gsap||{}).harness)){for(n=Rt.length;n--&&!Rt[n].targetTest(t););i=Rt[n]}for(n=e.length;n--;)e[n]&&(e[n]._gsap||(e[n]._gsap=new kn(e[n],i)))||e.splice(n,1);return e},Ue=function(e){return e._gsap||ci(me(e))[0]._gsap},on=function(e,t,i){return(i=e[t])&&V(i)?e[t]():Qt(i)&&e.getAttribute&&e.getAttribute(t)||i},te=function(e,t){return(e=e.split(",")).forEach(t)||e},j=function(e){return Math.round(e*1e5)/1e5||0},Y=function(e){return Math.round(e*1e7)/1e7||0},Qe=function(e,t){var i=t.charAt(0),n=parseFloat(t.substr(2));return e=parseFloat(e),i==="+"?e+n:i==="-"?e-n:i==="*"?e*n:e/n},Jr=function(e,t){for(var i=t.length,n=0;e.indexOf(t[n])<0&&++n<i;);return n<i},It=function(){var e=Se.length,t=Se.slice(0),i,n;for(ai={},Se.length=0,i=0;i<e;i++)n=t[i],n&&n._lazy&&(n.render(n._lazy[0],n._lazy[1],!0)._lazy=0)},hi=function(e){return!!(e._initted||e._startAt||e.add)},ln=function(e,t,i,n){Se.length&&!X&&It(),e.render(t,i,!!(X&&t<0&&hi(e))),Se.length&&!X&&It()},cn=function(e){var t=parseFloat(e);return(t||t===0)&&(e+"").match(en).length<2?t:K(e)?e.trim():e},hn=function(e){return e},he=function(e,t){for(var i in t)i in e||(e[i]=t[i]);return e},es=function(e){return function(t,i){for(var n in i)n in t||n==="duration"&&e||n==="ease"||(t[n]=i[n])}},Je=function(e,t){for(var i in t)e[i]=t[i];return e},un=function a(e,t){for(var i in t)i!=="__proto__"&&i!=="constructor"&&i!=="prototype"&&(e[i]=_e(t[i])?a(e[i]||(e[i]={}),t[i]):t[i]);return e},Lt=function(e,t){var i={},n;for(n in e)n in t||(i[n]=e[n]);return i},ut=function(e){var t=e.parent||$,i=e.keyframes?es(W(e.keyframes)):he;if(ee(e.inherit))for(;t;)i(e,t.vars.defaults),t=t.parent||t._dp;return e},ts=function(e,t){for(var i=e.length,n=i===t.length;n&&i--&&e[i]===t[i];);return i<0},dn=function(e,t,i,n,r){var s=e[n],o;if(r)for(o=t[r];s&&s[r]>o;)s=s._prev;return s?(t._next=s._next,s._next=t):(t._next=e[i],e[i]=t),t._next?t._next._prev=t:e[n]=t,t._prev=s,t.parent=t._dp=e,t},kt=function(e,t,i,n){i===void 0&&(i="_first"),n===void 0&&(n="_last");var r=t._prev,s=t._next;r?r._next=s:e[i]===t&&(e[i]=s),s?s._prev=r:e[n]===t&&(e[n]=r),t._next=t._prev=t.parent=null},Te=function(e,t){e.parent&&(!t||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},Fe=function(e,t){if(e&&(!t||t._end>e._dur||t._start<0))for(var i=e;i;)i._dirty=1,i=i.parent;return e},is=function(e){for(var t=e.parent;t&&t.parent;)t._dirty=1,t.totalDuration(),t=t.parent;return e},ui=function(e,t,i,n){return e._startAt&&(X?e._startAt.revert(Ot):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(t,!0,n))},ns=function a(e){return!e||e._ts&&a(e.parent)},pn=function(e){return e._repeat?et(e._tTime,e=e.duration()+e._rDelay)*e:0},et=function(e,t){var i=Math.floor(e=Y(e/t));return e&&i===e?i-1:i},Ut=function(e,t){return(e-t._start)*t._ts+(t._ts>=0?0:t._dirty?t.totalDuration():t._tDur)},Ft=function(e){return e._end=Y(e._start+(e._tDur/Math.abs(e._ts||e._rts||k)||0))},zt=function(e,t){var i=e._dp;return i&&i.smoothChildTiming&&e._ts&&(e._start=Y(i._time-(e._ts>0?t/e._ts:((e._dirty?e.totalDuration():e._tDur)-t)/-e._ts)),Ft(e),i._dirty||Fe(i,e)),e},fn=function(e,t){var i;if((t._time||!t._dur&&t._initted||t._start<e._time&&(t._dur||!t.add))&&(i=Ut(e.rawTime(),t),(!t._dur||pt(0,t.totalDuration(),i)-t._tTime>k)&&t.render(i,!0)),Fe(e,t)._dp&&e._initted&&e._time>=e._dur&&e._ts){if(e._dur<e.duration())for(i=e;i._dp;)i.rawTime()>=0&&i.totalTime(i._tTime),i=i._dp;e._zTime=-k}},be=function(e,t,i,n){return t.parent&&Te(t),t._start=Y((we(i)?i:i||e!==$?fe(e,i,t):e._time)+t._delay),t._end=Y(t._start+(t.totalDuration()/Math.abs(t.timeScale())||0)),dn(e,t,"_first","_last",e._sort?"_start":0),di(t)||(e._recent=t),n||fn(e,t),e._ts<0&&zt(e,e._tTime),e},mn=function(e,t){return(le.ScrollTrigger||ri("scrollTrigger",t))&&le.ScrollTrigger.create(t,e)},gn=function(e,t,i,n,r){if(vi(e,t,r),!e._initted)return 1;if(!i&&e._pt&&!X&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&sn!==de.frame)return Se.push(e),e._lazy=[r,n],1},rs=function a(e){var t=e.parent;return t&&t._ts&&t._initted&&!t._lock&&(t.rawTime()<0||a(t))},di=function(e){var t=e.data;return t==="isFromStart"||t==="isStart"},ss=function(e,t,i,n){var r=e.ratio,s=t<0||!t&&(!e._start&&rs(e)&&!(!e._initted&&di(e))||(e._ts<0||e._dp._ts<0)&&!di(e))?0:1,o=e._rDelay,l=0,h,c,u;if(o&&e._repeat&&(l=pt(0,e._tDur,t),c=et(l,o),e._yoyo&&c&1&&(s=1-s),c!==et(e._tTime,o)&&(r=1-s,e.vars.repeatRefresh&&e._initted&&e.invalidate())),s!==r||X||n||e._zTime===k||!t&&e._zTime){if(!e._initted&&gn(e,t,n,i,l))return;for(u=e._zTime,e._zTime=t||(i?k:0),i||(i=t&&!u),e.ratio=s,e._from&&(s=1-s),e._time=0,e._tTime=l,h=e._pt;h;)h.r(s,h.d),h=h._next;t<0&&ui(e,t,i,!0),e._onUpdate&&!i&&ue(e,"onUpdate"),l&&e._repeat&&!i&&e.parent&&ue(e,"onRepeat"),(t>=e._tDur||t<0)&&e.ratio===s&&(s&&Te(e,1),!i&&!X&&(ue(e,s?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=t)},as=function(e,t,i){var n;if(i>t)for(n=e._first;n&&n._start<=i;){if(n.data==="isPause"&&n._start>t)return n;n=n._next}else for(n=e._last;n&&n._start>=i;){if(n.data==="isPause"&&n._start<t)return n;n=n._prev}},tt=function(e,t,i,n){var r=e._repeat,s=Y(t)||0,o=e._tTime/e._tDur;return o&&!n&&(e._time*=s/e._dur),e._dur=s,e._tDur=r?r<0?1e10:Y(s*(r+1)+e._rDelay*r):s,o>0&&!n&&zt(e,e._tTime=e._tDur*o),e.parent&&Ft(e),i||Fe(e.parent,e),e},_n=function(e){return e instanceof Q?Fe(e):tt(e,e._dur)},os={_start:0,endTime:ht,totalDuration:ht},fe=function a(e,t,i){var n=e.labels,r=e._recent||os,s=e.duration()>=pe?r.endTime(!1):e._dur,o,l,h;return K(t)&&(isNaN(t)||t in n)?(l=t.charAt(0),h=t.substr(-1)==="%",o=t.indexOf("="),l==="<"||l===">"?(o>=0&&(t=t.replace(/=/,"")),(l==="<"?r._start:r.endTime(r._repeat>=0))+(parseFloat(t.substr(1))||0)*(h?(o<0?r:i).totalDuration()/100:1)):o<0?(t in n||(n[t]=s),n[t]):(l=parseFloat(t.charAt(o-1)+t.substr(o+1)),h&&i&&(l=l/100*(W(i)?i[0]:i).totalDuration()),o>1?a(e,t.substr(0,o-1),i)+l:s+l)):t==null?s:+t},dt=function(e,t,i){var n=we(t[1]),r=(n?2:1)+(e<2?0:1),s=t[r],o,l;if(n&&(s.duration=t[1]),s.parent=i,e){for(o=s,l=i;l&&!("immediateRender"in o);)o=l.vars.defaults||{},l=ee(l.vars.inherit)&&l.parent;s.immediateRender=ee(o.immediateRender),e<2?s.runBackwards=1:s.startAt=t[r-1]}return new H(t[0],s,t[r+1])},De=function(e,t){return e||e===0?t(e):t},pt=function(e,t,i){return i<e?e:i>t?t:i},q=function(e,t){return!K(e)||!(t=Wr.exec(e))?"":t[1]},ls=function(e,t,i){return De(i,function(n){return pt(e,t,n)})},pi=[].slice,yn=function(e,t){return e&&_e(e)&&"length"in e&&(!t&&!e.length||e.length-1 in e&&_e(e[0]))&&!e.nodeType&&e!==ye},cs=function(e,t,i){return i===void 0&&(i=[]),e.forEach(function(n){var r;return K(n)&&!t||yn(n,1)?(r=i).push.apply(r,me(n)):i.push(n)})||i},me=function(e,t,i){return z&&!t&&z.selector?z.selector(e):K(e)&&!i&&(ii||!nt())?pi.call((t||ni).querySelectorAll(e),0):W(e)?cs(e,i):yn(e)?pi.call(e,0):e?[e]:[]},fi=function(e){return e=me(e)[0]||ct("Invalid scope")||{},function(t){var i=e.current||e.nativeElement||e;return me(t,i.querySelectorAll?i:i===e?ct("Invalid scope")||ni.createElement("div"):e)}},bn=function(e){return e.sort(function(){return .5-Math.random()})},xn=function(e){if(V(e))return e;var t=_e(e)?e:{each:e},i=ze(t.ease),n=t.from||0,r=parseFloat(t.base)||0,s={},o=n>0&&n<1,l=isNaN(n)||o,h=t.axis,c=n,u=n;return K(n)?c=u={center:.5,edges:.5,end:1}[n]||0:!o&&l&&(c=n[0],u=n[1]),function(p,m,f){var d=(f||t).length,g=s[d],_,y,b,v,x,C,E,P,w;if(!g){if(w=t.grid==="auto"?0:(t.grid||[1,pe])[1],!w){for(E=-pe;E<(E=f[w++].getBoundingClientRect().left)&&w<d;);w<d&&w--}for(g=s[d]=[],_=l?Math.min(w,d)*c-.5:n%w,y=w===pe?0:l?d*u/w-.5:n/w|0,E=0,P=pe,C=0;C<d;C++)b=C%w-_,v=y-(C/w|0),g[C]=x=h?Math.abs(h==="y"?v:b):Wi(b*b+v*v),x>E&&(E=x),x<P&&(P=x);n==="random"&&bn(g),g.max=E-P,g.min=P,g.v=d=(parseFloat(t.amount)||parseFloat(t.each)*(w>d?d-1:h?h==="y"?d/w:w:Math.max(w,d/w))||0)*(n==="edges"?-1:1),g.b=d<0?r-d:r,g.u=q(t.amount||t.each)||0,i=i&&d<0?Rn(i):i}return d=(g[p]-g.min)/g.max||0,Y(g.b+(i?i(d):d)*g.v)+g.u}},mi=function(e){var t=Math.pow(10,((e+"").split(".")[1]||"").length);return function(i){var n=Y(Math.round(parseFloat(i)/e)*e*t);return(n-n%1)/t+(we(i)?0:q(i))}},vn=function(e,t){var i=W(e),n,r;return!i&&_e(e)&&(n=i=e.radius||pe,e.values?(e=me(e.values),(r=!we(e[0]))&&(n*=n)):e=mi(e.increment)),De(t,i?V(e)?function(s){return r=e(s),Math.abs(r-s)<=n?r:s}:function(s){for(var o=parseFloat(r?s.x:s),l=parseFloat(r?s.y:0),h=pe,c=0,u=e.length,p,m;u--;)r?(p=e[u].x-o,m=e[u].y-l,p=p*p+m*m):p=Math.abs(e[u]-o),p<h&&(h=p,c=u);return c=!n||h<=n?e[c]:s,r||c===s||we(s)?c:c+q(s)}:mi(e))},En=function(e,t,i,n){return De(W(e)?!t:i===!0?!!(i=0):!n,function(){return W(e)?e[~~(Math.random()*e.length)]:(i=i||1e-5)&&(n=i<1?Math.pow(10,(i+"").length-2):1)&&Math.floor(Math.round((e-i/2+Math.random()*(t-e+i*.99))/i)*i*n)/n})},hs=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return function(n){return t.reduce(function(r,s){return s(r)},n)}},us=function(e,t){return function(i){return e(parseFloat(i))+(t||q(i))}},ds=function(e,t,i){return Cn(e,t,0,1,i)},wn=function(e,t,i){return De(i,function(n){return e[~~t(n)]})},ps=function a(e,t,i){var n=t-e;return W(e)?wn(e,a(0,e.length),t):De(i,function(r){return(n+(r-e)%n)%n+e})},fs=function a(e,t,i){var n=t-e,r=n*2;return W(e)?wn(e,a(0,e.length-1),t):De(i,function(s){return s=(r+(s-e)%r)%r||0,e+(s>n?r-s:s)})},ft=function(e){for(var t=0,i="",n,r,s,o;~(n=e.indexOf("random(",t));)s=e.indexOf(")",n),o=e.charAt(n+7)==="[",r=e.substr(n+7,s-n-7).match(o?en:ei),i+=e.substr(t,n-t)+En(o?r:+r[0],o?0:+r[1],+r[2]||1e-5),t=s+1;return i+e.substr(t,e.length-t)},Cn=function(e,t,i,n,r){var s=t-e,o=n-i;return De(r,function(l){return i+((l-e)/s*o||0)})},ms=function a(e,t,i,n){var r=isNaN(e+t)?0:function(m){return(1-m)*e+m*t};if(!r){var s=K(e),o={},l,h,c,u,p;if(i===!0&&(n=1)&&(i=null),s)e={p:e},t={p:t};else if(W(e)&&!W(t)){for(c=[],u=e.length,p=u-2,h=1;h<u;h++)c.push(a(e[h-1],e[h]));u--,r=function(f){f*=u;var d=Math.min(p,~~f);return c[d](f-d)},i=t}else n||(e=Je(W(e)?[]:{},e));if(!c){for(l in t)bi.call(o,e,l,"get",t[l]);r=function(f){return Ci(f,o)||(s?e.p:e)}}}return De(i,r)},Pn=function(e,t,i){var n=e.labels,r=pe,s,o,l;for(s in n)o=n[s]-t,o<0==!!i&&o&&r>(o=Math.abs(o))&&(l=s,r=o);return l},ue=function(e,t,i){var n=e.vars,r=n[t],s=z,o=e._ctx,l,h,c;if(r)return l=n[t+"Params"],h=n.callbackScope||e,i&&Se.length&&It(),o&&(z=o),c=l?r.apply(h,l):r.call(h),z=s,c},mt=function(e){return Te(e),e.scrollTrigger&&e.scrollTrigger.kill(!!X),e.progress()<1&&ue(e,"onInterrupt"),e},it,An=[],Sn=function(e){if(e)if(e=!e.name&&e.default||e,Jt()||e.headless){var t=e.name,i=V(e),n=t&&!i&&e.init?function(){this._props=[]}:e,r={init:ht,render:Ci,add:bi,kill:Os,modifier:Ms,rawVars:0},s={targetTest:0,get:0,getSetter:wi,aliases:{},register:0};if(nt(),e!==n){if(ce[t])return;he(n,he(Lt(e,r),s)),Je(n.prototype,Je(r,Lt(e,s))),ce[n.prop=t]=n,e.targetTest&&(Rt.push(n),si[t]=1),t=(t==="css"?"CSS":t.charAt(0).toUpperCase()+t.substr(1))+"Plugin"}rn(t,n),e.register&&e.register(ne,n,ie)}else An.push(e)},U=255,gt={aqua:[0,U,U],lime:[0,U,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,U],navy:[0,0,128],white:[U,U,U],olive:[128,128,0],yellow:[U,U,0],orange:[U,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[U,0,0],pink:[U,192,203],cyan:[0,U,U],transparent:[U,U,U,0]},gi=function(e,t,i){return e+=e<0?1:e>1?-1:0,(e*6<1?t+(i-t)*e*6:e<.5?i:e*3<2?t+(i-t)*(2/3-e)*6:t)*U+.5|0},Tn=function(e,t,i){var n=e?we(e)?[e>>16,e>>8&U,e&U]:0:gt.black,r,s,o,l,h,c,u,p,m,f;if(!n){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),gt[e])n=gt[e];else if(e.charAt(0)==="#"){if(e.length<6&&(r=e.charAt(1),s=e.charAt(2),o=e.charAt(3),e="#"+r+r+s+s+o+o+(e.length===5?e.charAt(4)+e.charAt(4):"")),e.length===9)return n=parseInt(e.substr(1,6),16),[n>>16,n>>8&U,n&U,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),n=[e>>16,e>>8&U,e&U]}else if(e.substr(0,3)==="hsl"){if(n=f=e.match(ei),!t)l=+n[0]%360/360,h=+n[1]/100,c=+n[2]/100,s=c<=.5?c*(h+1):c+h-c*h,r=c*2-s,n.length>3&&(n[3]*=1),n[0]=gi(l+1/3,r,s),n[1]=gi(l,r,s),n[2]=gi(l-1/3,r,s);else if(~e.indexOf("="))return n=e.match(Qi),i&&n.length<4&&(n[3]=1),n}else n=e.match(ei)||gt.transparent;n=n.map(Number)}return t&&!f&&(r=n[0]/U,s=n[1]/U,o=n[2]/U,u=Math.max(r,s,o),p=Math.min(r,s,o),c=(u+p)/2,u===p?l=h=0:(m=u-p,h=c>.5?m/(2-u-p):m/(u+p),l=u===r?(s-o)/m+(s<o?6:0):u===s?(o-r)/m+2:(r-s)/m+4,l*=60),n[0]=~~(l+.5),n[1]=~~(h*100+.5),n[2]=~~(c*100+.5)),i&&n.length<4&&(n[3]=1),n},Dn=function(e){var t=[],i=[],n=-1;return e.split(Me).forEach(function(r){var s=r.match(qe)||[];t.push.apply(t,s),i.push(n+=s.length+1)}),t.c=i,t},Mn=function(e,t,i){var n="",r=(e+n).match(Me),s=t?"hsla(":"rgba(",o=0,l,h,c,u;if(!r)return e;if(r=r.map(function(p){return(p=Tn(p,t,1))&&s+(t?p[0]+","+p[1]+"%,"+p[2]+"%,"+p[3]:p.join(","))+")"}),i&&(c=Dn(e),l=i.c,l.join(n)!==c.c.join(n)))for(h=e.replace(Me,"1").split(qe),u=h.length-1;o<u;o++)n+=h[o]+(~l.indexOf(o)?r.shift()||s+"0,0,0,0)":(c.length?c:r.length?r:i).shift());if(!h)for(h=e.split(Me),u=h.length-1;o<u;o++)n+=h[o]+r[o];return n+h[u]},Me=(function(){var a="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in gt)a+="|"+e+"\\b";return new RegExp(a+")","gi")})(),gs=/hsl[a]?\(/,On=function(e){var t=e.join(" "),i;if(Me.lastIndex=0,Me.test(t))return i=gs.test(t),e[1]=Mn(e[1],i),e[0]=Mn(e[0],i,Dn(e[1])),!0},_t,de=(function(){var a=Date.now,e=500,t=33,i=a(),n=i,r=1e3/240,s=r,o=[],l,h,c,u,p,m,f=function d(g){var _=a()-n,y=g===!0,b,v,x,C;if((_>e||_<0)&&(i+=_-t),n+=_,x=n-i,b=x-s,(b>0||y)&&(C=++u.frame,p=x-u.time*1e3,u.time=x=x/1e3,s+=b+(b>=r?4:r-b),v=1),y||(l=h(d)),v)for(m=0;m<o.length;m++)o[m](x,p,C,g)};return u={time:0,frame:0,tick:function(){f(!0)},deltaRatio:function(g){return p/(1e3/(g||60))},wake:function(){tn&&(!ii&&Jt()&&(ye=ii=window,ni=ye.document||{},le.gsap=ne,(ye.gsapVersions||(ye.gsapVersions=[])).push(ne.version),nn(Mt||ye.GreenSockGlobals||!ye.gsap&&ye||{}),An.forEach(Sn)),c=typeof requestAnimationFrame<"u"&&requestAnimationFrame,l&&u.sleep(),h=c||function(g){return setTimeout(g,s-u.time*1e3+1|0)},_t=1,f(2))},sleep:function(){(c?cancelAnimationFrame:clearTimeout)(l),_t=0,h=ht},lagSmoothing:function(g,_){e=g||1/0,t=Math.min(_||33,e)},fps:function(g){r=1e3/(g||240),s=u.time*1e3+r},add:function(g,_,y){var b=_?function(v,x,C,E){g(v,x,C,E),u.remove(b)}:g;return u.remove(g),o[y?"unshift":"push"](b),nt(),b},remove:function(g,_){~(_=o.indexOf(g))&&o.splice(_,1)&&m>=_&&m--},_listeners:o},u})(),nt=function(){return!_t&&de.wake()},M={},_s=/^[\d.\-M][\d.\-,\s]/,ys=/["']/g,bs=function(e){for(var t={},i=e.substr(1,e.length-3).split(":"),n=i[0],r=1,s=i.length,o,l,h;r<s;r++)l=i[r],o=r!==s-1?l.lastIndexOf(","):l.length,h=l.substr(0,o),t[n]=isNaN(h)?h.replace(ys,"").trim():+h,n=l.substr(o+1).trim();return t},xs=function(e){var t=e.indexOf("(")+1,i=e.indexOf(")"),n=e.indexOf("(",t);return e.substring(t,~n&&n<i?e.indexOf(")",i+1):i)},vs=function(e){var t=(e+"").split("("),i=M[t[0]];return i&&t.length>1&&i.config?i.config.apply(null,~e.indexOf("{")?[bs(t[1])]:xs(e).split(",").map(cn)):M._CE&&_s.test(e)?M._CE("",e):i},Rn=function(e){return function(t){return 1-e(1-t)}},In=function a(e,t){for(var i=e._first,n;i;)i instanceof Q?a(i,t):i.vars.yoyoEase&&(!i._yoyo||!i._repeat)&&i._yoyo!==t&&(i.timeline?a(i.timeline,t):(n=i._ease,i._ease=i._yEase,i._yEase=n,i._yoyo=t)),i=i._next},ze=function(e,t){return e&&(V(e)?e:M[e]||vs(e))||t},Ne=function(e,t,i,n){i===void 0&&(i=function(l){return 1-t(1-l)}),n===void 0&&(n=function(l){return l<.5?t(l*2)/2:1-t((1-l)*2)/2});var r={easeIn:t,easeOut:i,easeInOut:n},s;return te(e,function(o){M[o]=le[o]=r,M[s=o.toLowerCase()]=i;for(var l in r)M[s+(l==="easeIn"?".in":l==="easeOut"?".out":".inOut")]=M[o+"."+l]=r[l]}),r},Ln=function(e){return function(t){return t<.5?(1-e(1-t*2))/2:.5+e((t-.5)*2)/2}},_i=function a(e,t,i){var n=t>=1?t:1,r=(i||(e?.3:.45))/(t<1?t:1),s=r/qt*(Math.asin(1/n)||0),o=function(c){return c===1?1:n*Math.pow(2,-10*c)*Xr((c-s)*r)+1},l=e==="out"?o:e==="in"?function(h){return 1-o(1-h)}:Ln(o);return r=qt/r,l.config=function(h,c){return a(e,h,c)},l},yi=function a(e,t){t===void 0&&(t=1.70158);var i=function(s){return s?--s*s*((t+1)*s+t)+1:0},n=e==="out"?i:e==="in"?function(r){return 1-i(1-r)}:Ln(i);return n.config=function(r){return a(e,r)},n};te("Linear,Quad,Cubic,Quart,Quint,Strong",function(a,e){var t=e<5?e+1:e;Ne(a+",Power"+(t-1),e?function(i){return Math.pow(i,t)}:function(i){return i},function(i){return 1-Math.pow(1-i,t)},function(i){return i<.5?Math.pow(i*2,t)/2:1-Math.pow((1-i)*2,t)/2})}),M.Linear.easeNone=M.none=M.Linear.easeIn,Ne("Elastic",_i("in"),_i("out"),_i()),(function(a,e){var t=1/e,i=2*t,n=2.5*t,r=function(o){return o<t?a*o*o:o<i?a*Math.pow(o-1.5/e,2)+.75:o<n?a*(o-=2.25/e)*o+.9375:a*Math.pow(o-2.625/e,2)+.984375};Ne("Bounce",function(s){return 1-r(1-s)},r)})(7.5625,2.75),Ne("Expo",function(a){return Math.pow(2,10*(a-1))*a+a*a*a*a*a*a*(1-a)}),Ne("Circ",function(a){return-(Wi(1-a*a)-1)}),Ne("Sine",function(a){return a===1?1:-Kr(a*Hr)+1}),Ne("Back",yi("in"),yi("out"),yi()),M.SteppedEase=M.steps=le.SteppedEase={config:function(e,t){e===void 0&&(e=1);var i=1/e,n=e+(t?0:1),r=t?1:0,s=1-k;return function(o){return((n*pt(0,s,o)|0)+r)*i}}},We.ease=M["quad.out"],te("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(a){return li+=a+","+a+"Params,"});var kn=function(e,t){this.id=Zr++,e._gsap=this,this.target=e,this.harness=t,this.get=t?t.get:on,this.set=t?t.getSetter:wi},yt=(function(){function a(t){this.vars=t,this._delay=+t.delay||0,(this._repeat=t.repeat===1/0?-2:t.repeat||0)&&(this._rDelay=t.repeatDelay||0,this._yoyo=!!t.yoyo||!!t.yoyoEase),this._ts=1,tt(this,+t.duration,1,1),this.data=t.data,z&&(this._ctx=z,z.data.push(this)),_t||de.wake()}var e=a.prototype;return e.delay=function(i){return i||i===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+i-this._delay),this._delay=i,this):this._delay},e.duration=function(i){return arguments.length?this.totalDuration(this._repeat>0?i+(i+this._rDelay)*this._repeat:i):this.totalDuration()&&this._dur},e.totalDuration=function(i){return arguments.length?(this._dirty=0,tt(this,this._repeat<0?i:(i-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(i,n){if(nt(),!arguments.length)return this._tTime;var r=this._dp;if(r&&r.smoothChildTiming&&this._ts){for(zt(this,i),!r._dp||r.parent||fn(r,this);r&&r.parent;)r.parent._time!==r._start+(r._ts>=0?r._tTime/r._ts:(r.totalDuration()-r._tTime)/-r._ts)&&r.totalTime(r._tTime,!0),r=r.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&i<this._tDur||this._ts<0&&i>0||!this._tDur&&!i)&&be(this._dp,this,this._start-this._delay)}return(this._tTime!==i||!this._dur&&!n||this._initted&&Math.abs(this._zTime)===k||!i&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=i),ln(this,i,n)),this},e.time=function(i,n){return arguments.length?this.totalTime(Math.min(this.totalDuration(),i+pn(this))%(this._dur+this._rDelay)||(i?this._dur:0),n):this._time},e.totalProgress=function(i,n){return arguments.length?this.totalTime(this.totalDuration()*i,n):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0},e.progress=function(i,n){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-i:i)+pn(this),n):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},e.iteration=function(i,n){var r=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(i-1)*r,n):this._repeat?et(this._tTime,r)+1:1},e.timeScale=function(i,n){if(!arguments.length)return this._rts===-k?0:this._rts;if(this._rts===i)return this;var r=this.parent&&this._ts?Ut(this.parent._time,this):this._tTime;return this._rts=+i||0,this._ts=this._ps||i===-k?0:this._rts,this.totalTime(pt(-Math.abs(this._delay),this.totalDuration(),r),n!==!1),Ft(this),is(this)},e.paused=function(i){return arguments.length?(this._ps!==i&&(this._ps=i,i?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(nt(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==k&&(this._tTime-=k)))),this):this._ps},e.startTime=function(i){if(arguments.length){this._start=i;var n=this.parent||this._dp;return n&&(n._sort||!this.parent)&&be(n,this,i-this._delay),this}return this._start},e.endTime=function(i){return this._start+(ee(i)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},e.rawTime=function(i){var n=this.parent||this._dp;return n?i&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?Ut(n.rawTime(i),this):this._tTime:this._tTime},e.revert=function(i){i===void 0&&(i=Qr);var n=X;return X=i,hi(this)&&(this.timeline&&this.timeline.revert(i),this.totalTime(-.01,i.suppressEvents)),this.data!=="nested"&&i.kill!==!1&&this.kill(),X=n,this},e.globalTime=function(i){for(var n=this,r=arguments.length?i:n.rawTime();n;)r=n._start+r/(Math.abs(n._ts)||1),n=n._dp;return!this.parent&&this._sat?this._sat.globalTime(i):r},e.repeat=function(i){return arguments.length?(this._repeat=i===1/0?-2:i,_n(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(i){if(arguments.length){var n=this._time;return this._rDelay=i,_n(this),n?this.time(n):this}return this._rDelay},e.yoyo=function(i){return arguments.length?(this._yoyo=i,this):this._yoyo},e.seek=function(i,n){return this.totalTime(fe(this,i),ee(n))},e.restart=function(i,n){return this.play().totalTime(i?-this._delay:0,ee(n)),this._dur||(this._zTime=-k),this},e.play=function(i,n){return i!=null&&this.seek(i,n),this.reversed(!1).paused(!1)},e.reverse=function(i,n){return i!=null&&this.seek(i||this.totalDuration(),n),this.reversed(!0).paused(!1)},e.pause=function(i,n){return i!=null&&this.seek(i,n),this.paused(!0)},e.resume=function(){return this.paused(!1)},e.reversed=function(i){return arguments.length?(!!i!==this.reversed()&&this.timeScale(-this._rts||(i?-k:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-k,this},e.isActive=function(){var i=this.parent||this._dp,n=this._start,r;return!!(!i||this._ts&&this._initted&&i.isActive()&&(r=i.rawTime(!0))>=n&&r<this.endTime(!0)-k)},e.eventCallback=function(i,n,r){var s=this.vars;return arguments.length>1?(n?(s[i]=n,r&&(s[i+"Params"]=r),i==="onUpdate"&&(this._onUpdate=n)):delete s[i],this):s[i]},e.then=function(i){var n=this;return new Promise(function(r){var s=V(i)?i:hn,o=function(){var h=n.then;n.then=null,V(s)&&(s=s(n))&&(s.then||s===n)&&(n.then=h),r(s),n.then=h};n._initted&&n.totalProgress()===1&&n._ts>=0||!n._tTime&&n._ts<0?o():n._prom=o})},e.kill=function(){mt(this)},a})();he(yt.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-k,_prom:0,_ps:!1,_rts:1});var Q=(function(a){Xi(e,a);function e(i,n){var r;return i===void 0&&(i={}),r=a.call(this,i)||this,r.labels={},r.smoothChildTiming=!!i.smoothChildTiming,r.autoRemoveChildren=!!i.autoRemoveChildren,r._sort=ee(i.sortChildren),$&&be(i.parent||$,Ee(r),n),i.reversed&&r.reverse(),i.paused&&r.paused(!0),i.scrollTrigger&&mn(Ee(r),i.scrollTrigger),r}var t=e.prototype;return t.to=function(n,r,s){return dt(0,arguments,this),this},t.from=function(n,r,s){return dt(1,arguments,this),this},t.fromTo=function(n,r,s,o){return dt(2,arguments,this),this},t.set=function(n,r,s){return r.duration=0,r.parent=this,ut(r).repeatDelay||(r.repeat=0),r.immediateRender=!!r.immediateRender,new H(n,r,fe(this,s),1),this},t.call=function(n,r,s){return be(this,H.delayedCall(0,n,r),s)},t.staggerTo=function(n,r,s,o,l,h,c){return s.duration=r,s.stagger=s.stagger||o,s.onComplete=h,s.onCompleteParams=c,s.parent=this,new H(n,s,fe(this,l)),this},t.staggerFrom=function(n,r,s,o,l,h,c){return s.runBackwards=1,ut(s).immediateRender=ee(s.immediateRender),this.staggerTo(n,r,s,o,l,h,c)},t.staggerFromTo=function(n,r,s,o,l,h,c,u){return o.startAt=s,ut(o).immediateRender=ee(o.immediateRender),this.staggerTo(n,r,o,l,h,c,u)},t.render=function(n,r,s){var o=this._time,l=this._dirty?this.totalDuration():this._tDur,h=this._dur,c=n<=0?0:Y(n),u=this._zTime<0!=n<0&&(this._initted||!h),p,m,f,d,g,_,y,b,v,x,C,E;if(this!==$&&c>l&&n>=0&&(c=l),c!==this._tTime||s||u){if(o!==this._time&&h&&(c+=this._time-o,n+=this._time-o),p=c,v=this._start,b=this._ts,_=!b,u&&(h||(o=this._zTime),(n||!r)&&(this._zTime=n)),this._repeat){if(C=this._yoyo,g=h+this._rDelay,this._repeat<-1&&n<0)return this.totalTime(g*100+n,r,s);if(p=Y(c%g),c===l?(d=this._repeat,p=h):(x=Y(c/g),d=~~x,d&&d===x&&(p=h,d--),p>h&&(p=h)),x=et(this._tTime,g),!o&&this._tTime&&x!==d&&this._tTime-x*g-this._dur<=0&&(x=d),C&&d&1&&(p=h-p,E=1),d!==x&&!this._lock){var P=C&&x&1,w=P===(C&&d&1);if(d<x&&(P=!P),o=P?0:c%h?h:c,this._lock=1,this.render(o||(E?0:Y(d*g)),r,!h)._lock=0,this._tTime=c,!r&&this.parent&&ue(this,"onRepeat"),this.vars.repeatRefresh&&!E&&(this.invalidate()._lock=1),o&&o!==this._time||_!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(h=this._dur,l=this._tDur,w&&(this._lock=2,o=P?h:-1e-4,this.render(o,!0),this.vars.repeatRefresh&&!E&&this.invalidate()),this._lock=0,!this._ts&&!_)return this;In(this,E)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(y=as(this,Y(o),Y(p)),y&&(c-=p-(p=y._start))),this._tTime=c,this._time=p,this._act=!b,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=n,o=0),!o&&c&&!r&&!x&&(ue(this,"onStart"),this._tTime!==c))return this;if(p>=o&&n>=0)for(m=this._first;m;){if(f=m._next,(m._act||p>=m._start)&&m._ts&&y!==m){if(m.parent!==this)return this.render(n,r,s);if(m.render(m._ts>0?(p-m._start)*m._ts:(m._dirty?m.totalDuration():m._tDur)+(p-m._start)*m._ts,r,s),p!==this._time||!this._ts&&!_){y=0,f&&(c+=this._zTime=-k);break}}m=f}else{m=this._last;for(var T=n<0?n:p;m;){if(f=m._prev,(m._act||T<=m._end)&&m._ts&&y!==m){if(m.parent!==this)return this.render(n,r,s);if(m.render(m._ts>0?(T-m._start)*m._ts:(m._dirty?m.totalDuration():m._tDur)+(T-m._start)*m._ts,r,s||X&&hi(m)),p!==this._time||!this._ts&&!_){y=0,f&&(c+=this._zTime=T?-k:k);break}}m=f}}if(y&&!r&&(this.pause(),y.render(p>=o?0:-k)._zTime=p>=o?1:-1,this._ts))return this._start=v,Ft(this),this.render(n,r,s);this._onUpdate&&!r&&ue(this,"onUpdate",!0),(c===l&&this._tTime>=this.totalDuration()||!c&&o)&&(v===this._start||Math.abs(b)!==Math.abs(this._ts))&&(this._lock||((n||!h)&&(c===l&&this._ts>0||!c&&this._ts<0)&&Te(this,1),!r&&!(n<0&&!o)&&(c||o||!l)&&(ue(this,c===l&&n>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(c<l&&this.timeScale()>0)&&this._prom())))}return this},t.add=function(n,r){var s=this;if(we(r)||(r=fe(this,r,n)),!(n instanceof yt)){if(W(n))return n.forEach(function(o){return s.add(o,r)}),this;if(K(n))return this.addLabel(n,r);if(V(n))n=H.delayedCall(0,n);else return this}return this!==n?be(this,n,r):this},t.getChildren=function(n,r,s,o){n===void 0&&(n=!0),r===void 0&&(r=!0),s===void 0&&(s=!0),o===void 0&&(o=-pe);for(var l=[],h=this._first;h;)h._start>=o&&(h instanceof H?r&&l.push(h):(s&&l.push(h),n&&l.push.apply(l,h.getChildren(!0,r,s)))),h=h._next;return l},t.getById=function(n){for(var r=this.getChildren(1,1,1),s=r.length;s--;)if(r[s].vars.id===n)return r[s]},t.remove=function(n){return K(n)?this.removeLabel(n):V(n)?this.killTweensOf(n):(n.parent===this&&kt(this,n),n===this._recent&&(this._recent=this._last),Fe(this))},t.totalTime=function(n,r){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Y(de.time-(this._ts>0?n/this._ts:(this.totalDuration()-n)/-this._ts))),a.prototype.totalTime.call(this,n,r),this._forcing=0,this):this._tTime},t.addLabel=function(n,r){return this.labels[n]=fe(this,r),this},t.removeLabel=function(n){return delete this.labels[n],this},t.addPause=function(n,r,s){var o=H.delayedCall(0,r||ht,s);return o.data="isPause",this._hasPause=1,be(this,o,fe(this,n))},t.removePause=function(n){var r=this._first;for(n=fe(this,n);r;)r._start===n&&r.data==="isPause"&&Te(r),r=r._next},t.killTweensOf=function(n,r,s){for(var o=this.getTweensOf(n,s),l=o.length;l--;)Oe!==o[l]&&o[l].kill(n,r);return this},t.getTweensOf=function(n,r){for(var s=[],o=me(n),l=this._first,h=we(r),c;l;)l instanceof H?Jr(l._targets,o)&&(h?(!Oe||l._initted&&l._ts)&&l.globalTime(0)<=r&&l.globalTime(l.totalDuration())>r:!r||l.isActive())&&s.push(l):(c=l.getTweensOf(o,r)).length&&s.push.apply(s,c),l=l._next;return s},t.tweenTo=function(n,r){r=r||{};var s=this,o=fe(s,n),l=r,h=l.startAt,c=l.onStart,u=l.onStartParams,p=l.immediateRender,m,f=H.to(s,he({ease:r.ease||"none",lazy:!1,immediateRender:!1,time:o,overwrite:"auto",duration:r.duration||Math.abs((o-(h&&"time"in h?h.time:s._time))/s.timeScale())||k,onStart:function(){if(s.pause(),!m){var g=r.duration||Math.abs((o-(h&&"time"in h?h.time:s._time))/s.timeScale());f._dur!==g&&tt(f,g,0,1).render(f._time,!0,!0),m=1}c&&c.apply(f,u||[])}},r));return p?f.render(0):f},t.tweenFromTo=function(n,r,s){return this.tweenTo(r,he({startAt:{time:fe(this,n)}},s))},t.recent=function(){return this._recent},t.nextLabel=function(n){return n===void 0&&(n=this._time),Pn(this,fe(this,n))},t.previousLabel=function(n){return n===void 0&&(n=this._time),Pn(this,fe(this,n),1)},t.currentLabel=function(n){return arguments.length?this.seek(n,!0):this.previousLabel(this._time+k)},t.shiftChildren=function(n,r,s){s===void 0&&(s=0);for(var o=this._first,l=this.labels,h;o;)o._start>=s&&(o._start+=n,o._end+=n),o=o._next;if(r)for(h in l)l[h]>=s&&(l[h]+=n);return Fe(this)},t.invalidate=function(n){var r=this._first;for(this._lock=0;r;)r.invalidate(n),r=r._next;return a.prototype.invalidate.call(this,n)},t.clear=function(n){n===void 0&&(n=!0);for(var r=this._first,s;r;)s=r._next,this.remove(r),r=s;return this._dp&&(this._time=this._tTime=this._pTime=0),n&&(this.labels={}),Fe(this)},t.totalDuration=function(n){var r=0,s=this,o=s._last,l=pe,h,c,u;if(arguments.length)return s.timeScale((s._repeat<0?s.duration():s.totalDuration())/(s.reversed()?-n:n));if(s._dirty){for(u=s.parent;o;)h=o._prev,o._dirty&&o.totalDuration(),c=o._start,c>l&&s._sort&&o._ts&&!s._lock?(s._lock=1,be(s,o,c-o._delay,1)._lock=0):l=c,c<0&&o._ts&&(r-=c,(!u&&!s._dp||u&&u.smoothChildTiming)&&(s._start+=c/s._ts,s._time-=c,s._tTime-=c),s.shiftChildren(-c,!1,-1/0),l=0),o._end>r&&o._ts&&(r=o._end),o=h;tt(s,s===$&&s._time>r?s._time:r,1,1),s._dirty=0}return s._tDur},e.updateRoot=function(n){if($._ts&&(ln($,Ut(n,$)),sn=de.frame),de.frame>=an){an+=oe.autoSleep||120;var r=$._first;if((!r||!r._ts)&&oe.autoSleep&&de._listeners.length<2){for(;r&&!r._ts;)r=r._next;r||de.sleep()}}},e})(yt);he(Q.prototype,{_lock:0,_hasPause:0,_forcing:0});var Es=function(e,t,i,n,r,s,o){var l=new ie(this._pt,e,t,0,1,Bn,null,r),h=0,c=0,u,p,m,f,d,g,_,y;for(l.b=i,l.e=n,i+="",n+="",(_=~n.indexOf("random("))&&(n=ft(n)),s&&(y=[i,n],s(y,e,t),i=y[0],n=y[1]),p=i.match(ti)||[];u=ti.exec(n);)f=u[0],d=n.substring(h,u.index),m?m=(m+1)%5:d.substr(-5)==="rgba("&&(m=1),f!==p[c++]&&(g=parseFloat(p[c-1])||0,l._pt={_next:l._pt,p:d||c===1?d:",",s:g,c:f.charAt(1)==="="?Qe(g,f)-g:parseFloat(f)-g,m:m&&m<4?Math.round:0},h=ti.lastIndex);return l.c=h<n.length?n.substring(h,n.length):"",l.fp=o,(Ji.test(n)||_)&&(l.e=0),this._pt=l,l},bi=function(e,t,i,n,r,s,o,l,h,c){V(n)&&(n=n(r||0,e,s));var u=e[t],p=i!=="get"?i:V(u)?h?e[t.indexOf("set")||!V(e["get"+t.substr(3)])?t:"get"+t.substr(3)](h):e[t]():u,m=V(u)?h?Ss:Nn:Ei,f;if(K(n)&&(~n.indexOf("random(")&&(n=ft(n)),n.charAt(1)==="="&&(f=Qe(p,n)+(q(p)||0),(f||f===0)&&(n=f))),!c||p!==n||xi)return!isNaN(p*n)&&n!==""?(f=new ie(this._pt,e,t,+p||0,n-(p||0),typeof u=="boolean"?Ds:$n,0,m),h&&(f.fp=h),o&&f.modifier(o,this,e),this._pt=f):(!u&&!(t in e)&&ri(t,n),Es.call(this,e,t,p,n,m,l||oe.stringFilter,h))},ws=function(e,t,i,n,r){if(V(e)&&(e=bt(e,r,t,i,n)),!_e(e)||e.style&&e.nodeType||W(e)||qi(e))return K(e)?bt(e,r,t,i,n):e;var s={},o;for(o in e)s[o]=bt(e[o],r,t,i,n);return s},Un=function(e,t,i,n,r,s){var o,l,h,c;if(ce[e]&&(o=new ce[e]).init(r,o.rawVars?t[e]:ws(t[e],n,r,s,i),i,n,s)!==!1&&(i._pt=l=new ie(i._pt,r,e,0,1,o.render,o,0,o.priority),i!==it))for(h=i._ptLookup[i._targets.indexOf(r)],c=o._props.length;c--;)h[o._props[c]]=l;return o},Oe,xi,vi=function a(e,t,i){var n=e.vars,r=n.ease,s=n.startAt,o=n.immediateRender,l=n.lazy,h=n.onUpdate,c=n.runBackwards,u=n.yoyoEase,p=n.keyframes,m=n.autoRevert,f=e._dur,d=e._startAt,g=e._targets,_=e.parent,y=_&&_.data==="nested"?_.vars.targets:g,b=e._overwrite==="auto"&&!Wt,v=e.timeline,x,C,E,P,w,T,O,S,R,I,G,N,F;if(v&&(!p||!r)&&(r="none"),e._ease=ze(r,We.ease),e._yEase=u?Rn(ze(u===!0?r:u,We.ease)):0,u&&e._yoyo&&!e._repeat&&(u=e._yEase,e._yEase=e._ease,e._ease=u),e._from=!v&&!!n.runBackwards,!v||p&&!n.stagger){if(S=g[0]?Ue(g[0]).harness:0,N=S&&n[S.prop],x=Lt(n,si),d&&(d._zTime<0&&d.progress(1),t<0&&c&&o&&!m?d.render(-1,!0):d.revert(c&&f?Ot:qr),d._lazy=0),s){if(Te(e._startAt=H.set(g,he({data:"isStart",overwrite:!1,parent:_,immediateRender:!0,lazy:!d&&ee(l),startAt:null,delay:0,onUpdate:h&&function(){return ue(e,"onUpdate")},stagger:0},s))),e._startAt._dp=0,e._startAt._sat=e,t<0&&(X||!o&&!m)&&e._startAt.revert(Ot),o&&f&&t<=0&&i<=0){t&&(e._zTime=t);return}}else if(c&&f&&!d){if(t&&(o=!1),E=he({overwrite:!1,data:"isFromStart",lazy:o&&!d&&ee(l),immediateRender:o,stagger:0,parent:_},x),N&&(E[S.prop]=N),Te(e._startAt=H.set(g,E)),e._startAt._dp=0,e._startAt._sat=e,t<0&&(X?e._startAt.revert(Ot):e._startAt.render(-1,!0)),e._zTime=t,!o)a(e._startAt,k,k);else if(!t)return}for(e._pt=e._ptCache=0,l=f&&ee(l)||l&&!f,C=0;C<g.length;C++){if(w=g[C],O=w._gsap||ci(g)[C]._gsap,e._ptLookup[C]=I={},ai[O.id]&&Se.length&&It(),G=y===g?C:y.indexOf(w),S&&(R=new S).init(w,N||x,e,G,y)!==!1&&(e._pt=P=new ie(e._pt,w,R.name,0,1,R.render,R,0,R.priority),R._props.forEach(function(se){I[se]=P}),R.priority&&(T=1)),!S||N)for(E in x)ce[E]&&(R=Un(E,x,e,G,w,y))?R.priority&&(T=1):I[E]=P=bi.call(e,w,E,"get",x[E],G,y,0,n.stringFilter);e._op&&e._op[C]&&e.kill(w,e._op[C]),b&&e._pt&&(Oe=e,$.killTweensOf(w,I,e.globalTime(t)),F=!e.parent,Oe=0),e._pt&&l&&(ai[O.id]=1)}T&&Vn(e),e._onInit&&e._onInit(e)}e._onUpdate=h,e._initted=(!e._op||e._pt)&&!F,p&&t<=0&&v.render(pe,!0,!0)},Cs=function(e,t,i,n,r,s,o,l){var h=(e._pt&&e._ptCache||(e._ptCache={}))[t],c,u,p,m;if(!h)for(h=e._ptCache[t]=[],p=e._ptLookup,m=e._targets.length;m--;){if(c=p[m][t],c&&c.d&&c.d._pt)for(c=c.d._pt;c&&c.p!==t&&c.fp!==t;)c=c._next;if(!c)return xi=1,e.vars[t]="+=0",vi(e,o),xi=0,l?ct(t+" not eligible for reset"):1;h.push(c)}for(m=h.length;m--;)u=h[m],c=u._pt||u,c.s=(n||n===0)&&!r?n:c.s+(n||0)+s*c.c,c.c=i-c.s,u.e&&(u.e=j(i)+q(u.e)),u.b&&(u.b=c.s+q(u.b))},Ps=function(e,t){var i=e[0]?Ue(e[0]).harness:0,n=i&&i.aliases,r,s,o,l;if(!n)return t;r=Je({},t);for(s in n)if(s in r)for(l=n[s].split(","),o=l.length;o--;)r[l[o]]=r[s];return r},As=function(e,t,i,n){var r=t.ease||n||"power1.inOut",s,o;if(W(t))o=i[e]||(i[e]=[]),t.forEach(function(l,h){return o.push({t:h/(t.length-1)*100,v:l,e:r})});else for(s in t)o=i[s]||(i[s]=[]),s==="ease"||o.push({t:parseFloat(e),v:t[s],e:r})},bt=function(e,t,i,n,r){return V(e)?e.call(t,i,n,r):K(e)&&~e.indexOf("random(")?ft(e):e},Fn=li+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",zn={};te(Fn+",id,stagger,delay,duration,paused,scrollTrigger",function(a){return zn[a]=1});var H=(function(a){Xi(e,a);function e(i,n,r,s){var o;typeof n=="number"&&(r.duration=n,n=r,r=null),o=a.call(this,s?n:ut(n))||this;var l=o.vars,h=l.duration,c=l.delay,u=l.immediateRender,p=l.stagger,m=l.overwrite,f=l.keyframes,d=l.defaults,g=l.scrollTrigger,_=l.yoyoEase,y=n.parent||$,b=(W(i)||qi(i)?we(i[0]):"length"in n)?[i]:me(i),v,x,C,E,P,w,T,O;if(o._targets=b.length?ci(b):ct("GSAP target "+i+" not found. https://gsap.com",!oe.nullTargetWarn)||[],o._ptLookup=[],o._overwrite=m,f||p||Dt(h)||Dt(c)){if(n=o.vars,v=o.timeline=new Q({data:"nested",defaults:d||{},targets:y&&y.data==="nested"?y.vars.targets:b}),v.kill(),v.parent=v._dp=Ee(o),v._start=0,p||Dt(h)||Dt(c)){if(E=b.length,T=p&&xn(p),_e(p))for(P in p)~Fn.indexOf(P)&&(O||(O={}),O[P]=p[P]);for(x=0;x<E;x++)C=Lt(n,zn),C.stagger=0,_&&(C.yoyoEase=_),O&&Je(C,O),w=b[x],C.duration=+bt(h,Ee(o),x,w,b),C.delay=(+bt(c,Ee(o),x,w,b)||0)-o._delay,!p&&E===1&&C.delay&&(o._delay=c=C.delay,o._start+=c,C.delay=0),v.to(w,C,T?T(x,w,b):0),v._ease=M.none;v.duration()?h=c=0:o.timeline=0}else if(f){ut(he(v.vars.defaults,{ease:"none"})),v._ease=ze(f.ease||n.ease||"none");var S=0,R,I,G;if(W(f))f.forEach(function(N){return v.to(b,N,">")}),v.duration();else{C={};for(P in f)P==="ease"||P==="easeEach"||As(P,f[P],C,f.easeEach);for(P in C)for(R=C[P].sort(function(N,F){return N.t-F.t}),S=0,x=0;x<R.length;x++)I=R[x],G={ease:I.e,duration:(I.t-(x?R[x-1].t:0))/100*h},G[P]=I.v,v.to(b,G,S),S+=G.duration;v.duration()<h&&v.to({},{duration:h-v.duration()})}}h||o.duration(h=v.duration())}else o.timeline=0;return m===!0&&!Wt&&(Oe=Ee(o),$.killTweensOf(b),Oe=0),be(y,Ee(o),r),n.reversed&&o.reverse(),n.paused&&o.paused(!0),(u||!h&&!f&&o._start===Y(y._time)&&ee(u)&&ns(Ee(o))&&y.data!=="nested")&&(o._tTime=-k,o.render(Math.max(0,-c)||0)),g&&mn(Ee(o),g),o}var t=e.prototype;return t.render=function(n,r,s){var o=this._time,l=this._tDur,h=this._dur,c=n<0,u=n>l-k&&!c?l:n<k?0:n,p,m,f,d,g,_,y,b,v;if(!h)ss(this,n,r,s);else if(u!==this._tTime||!n||s||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==c||this._lazy){if(p=u,b=this.timeline,this._repeat){if(d=h+this._rDelay,this._repeat<-1&&c)return this.totalTime(d*100+n,r,s);if(p=Y(u%d),u===l?(f=this._repeat,p=h):(g=Y(u/d),f=~~g,f&&f===g?(p=h,f--):p>h&&(p=h)),_=this._yoyo&&f&1,_&&(v=this._yEase,p=h-p),g=et(this._tTime,d),p===o&&!s&&this._initted&&f===g)return this._tTime=u,this;f!==g&&(b&&this._yEase&&In(b,_),this.vars.repeatRefresh&&!_&&!this._lock&&p!==d&&this._initted&&(this._lock=s=1,this.render(Y(d*f),!0).invalidate()._lock=0))}if(!this._initted){if(gn(this,c?n:p,s,r,u))return this._tTime=0,this;if(o!==this._time&&!(s&&this.vars.repeatRefresh&&f!==g))return this;if(h!==this._dur)return this.render(n,r,s)}if(this._tTime=u,this._time=p,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=y=(v||this._ease)(p/h),this._from&&(this.ratio=y=1-y),!o&&u&&!r&&!g&&(ue(this,"onStart"),this._tTime!==u))return this;for(m=this._pt;m;)m.r(y,m.d),m=m._next;b&&b.render(n<0?n:b._dur*b._ease(p/this._dur),r,s)||this._startAt&&(this._zTime=n),this._onUpdate&&!r&&(c&&ui(this,n,r,s),ue(this,"onUpdate")),this._repeat&&f!==g&&this.vars.onRepeat&&!r&&this.parent&&ue(this,"onRepeat"),(u===this._tDur||!u)&&this._tTime===u&&(c&&!this._onUpdate&&ui(this,n,!0,!0),(n||!h)&&(u===this._tDur&&this._ts>0||!u&&this._ts<0)&&Te(this,1),!r&&!(c&&!o)&&(u||o||_)&&(ue(this,u===l?"onComplete":"onReverseComplete",!0),this._prom&&!(u<l&&this.timeScale()>0)&&this._prom()))}return this},t.targets=function(){return this._targets},t.invalidate=function(n){return(!n||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(n),a.prototype.invalidate.call(this,n)},t.resetTo=function(n,r,s,o,l){_t||de.wake(),this._ts||this.play();var h=Math.min(this._dur,(this._dp._time-this._start)*this._ts),c;return this._initted||vi(this,h),c=this._ease(h/this._dur),Cs(this,n,r,s,o,c,h,l)?this.resetTo(n,r,s,o,1):(zt(this,0),this.parent||dn(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},t.kill=function(n,r){if(r===void 0&&(r="all"),!n&&(!r||r==="all"))return this._lazy=this._pt=0,this.parent?mt(this):this.scrollTrigger&&this.scrollTrigger.kill(!!X),this;if(this.timeline){var s=this.timeline.totalDuration();return this.timeline.killTweensOf(n,r,Oe&&Oe.vars.overwrite!==!0)._first||mt(this),this.parent&&s!==this.timeline.totalDuration()&&tt(this,this._dur*this.timeline._tDur/s,0,1),this}var o=this._targets,l=n?me(n):o,h=this._ptLookup,c=this._pt,u,p,m,f,d,g,_;if((!r||r==="all")&&ts(o,l))return r==="all"&&(this._pt=0),mt(this);for(u=this._op=this._op||[],r!=="all"&&(K(r)&&(d={},te(r,function(y){return d[y]=1}),r=d),r=Ps(o,r)),_=o.length;_--;)if(~l.indexOf(o[_])){p=h[_],r==="all"?(u[_]=r,f=p,m={}):(m=u[_]=u[_]||{},f=r);for(d in f)g=p&&p[d],g&&((!("kill"in g.d)||g.d.kill(d)===!0)&&kt(this,g,"_pt"),delete p[d]),m!=="all"&&(m[d]=1)}return this._initted&&!this._pt&&c&&mt(this),this},e.to=function(n,r){return new e(n,r,arguments[2])},e.from=function(n,r){return dt(1,arguments)},e.delayedCall=function(n,r,s,o){return new e(r,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:n,onComplete:r,onReverseComplete:r,onCompleteParams:s,onReverseCompleteParams:s,callbackScope:o})},e.fromTo=function(n,r,s){return dt(2,arguments)},e.set=function(n,r){return r.duration=0,r.repeatDelay||(r.repeat=0),new e(n,r)},e.killTweensOf=function(n,r,s){return $.killTweensOf(n,r,s)},e})(yt);he(H.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),te("staggerTo,staggerFrom,staggerFromTo",function(a){H[a]=function(){var e=new Q,t=pi.call(arguments,0);return t.splice(a==="staggerFromTo"?5:4,0,0),e[a].apply(e,t)}});var Ei=function(e,t,i){return e[t]=i},Nn=function(e,t,i){return e[t](i)},Ss=function(e,t,i,n){return e[t](n.fp,i)},Ts=function(e,t,i){return e.setAttribute(t,i)},wi=function(e,t){return V(e[t])?Nn:Qt(e[t])&&e.setAttribute?Ts:Ei},$n=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e6)/1e6,t)},Ds=function(e,t){return t.set(t.t,t.p,!!(t.s+t.c*e),t)},Bn=function(e,t){var i=t._pt,n="";if(!e&&t.b)n=t.b;else if(e===1&&t.e)n=t.e;else{for(;i;)n=i.p+(i.m?i.m(i.s+i.c*e):Math.round((i.s+i.c*e)*1e4)/1e4)+n,i=i._next;n+=t.c}t.set(t.t,t.p,n,t)},Ci=function(e,t){for(var i=t._pt;i;)i.r(e,i.d),i=i._next},Ms=function(e,t,i,n){for(var r=this._pt,s;r;)s=r._next,r.p===n&&r.modifier(e,t,i),r=s},Os=function(e){for(var t=this._pt,i,n;t;)n=t._next,t.p===e&&!t.op||t.op===e?kt(this,t,"_pt"):t.dep||(i=1),t=n;return!i},Rs=function(e,t,i,n){n.mSet(e,t,n.m.call(n.tween,i,n.mt),n)},Vn=function(e){for(var t=e._pt,i,n,r,s;t;){for(i=t._next,n=r;n&&n.pr>t.pr;)n=n._next;(t._prev=n?n._prev:s)?t._prev._next=t:r=t,(t._next=n)?n._prev=t:s=t,t=i}e._pt=r},ie=(function(){function a(t,i,n,r,s,o,l,h,c){this.t=i,this.s=r,this.c=s,this.p=n,this.r=o||$n,this.d=l||this,this.set=h||Ei,this.pr=c||0,this._next=t,t&&(t._prev=this)}var e=a.prototype;return e.modifier=function(i,n,r){this.mSet=this.mSet||this.set,this.set=Rs,this.m=i,this.mt=r,this.tween=n},a})();te(li+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",function(a){return si[a]=1}),le.TweenMax=le.TweenLite=H,le.TimelineLite=le.TimelineMax=Q,$=new Q({sortChildren:!1,defaults:We,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),oe.stringFilter=On;var $e=[],Nt={},Is=[],Gn=0,Ls=0,Pi=function(e){return(Nt[e]||Is).map(function(t){return t()})},Ai=function(){var e=Date.now(),t=[];e-Gn>2&&(Pi("matchMediaInit"),$e.forEach(function(i){var n=i.queries,r=i.conditions,s,o,l,h;for(o in n)s=ye.matchMedia(n[o]).matches,s&&(l=1),s!==r[o]&&(r[o]=s,h=1);h&&(i.revert(),l&&t.push(i))}),Pi("matchMediaRevert"),t.forEach(function(i){return i.onMatch(i,function(n){return i.add(null,n)})}),Gn=e,Pi("matchMedia"))},jn=(function(){function a(t,i){this.selector=i&&fi(i),this.data=[],this._r=[],this.isReverted=!1,this.id=Ls++,t&&this.add(t)}var e=a.prototype;return e.add=function(i,n,r){V(i)&&(r=n,n=i,i=V);var s=this,o=function(){var h=z,c=s.selector,u;return h&&h!==s&&h.data.push(s),r&&(s.selector=fi(r)),z=s,u=n.apply(s,arguments),V(u)&&s._r.push(u),z=h,s.selector=c,s.isReverted=!1,u};return s.last=o,i===V?o(s,function(l){return s.add(null,l)}):i?s[i]=o:o},e.ignore=function(i){var n=z;z=null,i(this),z=n},e.getTweens=function(){var i=[];return this.data.forEach(function(n){return n instanceof a?i.push.apply(i,n.getTweens()):n instanceof H&&!(n.parent&&n.parent.data==="nested")&&i.push(n)}),i},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(i,n){var r=this;if(i?(function(){for(var o=r.getTweens(),l=r.data.length,h;l--;)h=r.data[l],h.data==="isFlip"&&(h.revert(),h.getChildren(!0,!0,!1).forEach(function(c){return o.splice(o.indexOf(c),1)}));for(o.map(function(c){return{g:c._dur||c._delay||c._sat&&!c._sat.vars.immediateRender?c.globalTime(0):-1/0,t:c}}).sort(function(c,u){return u.g-c.g||-1/0}).forEach(function(c){return c.t.revert(i)}),l=r.data.length;l--;)h=r.data[l],h instanceof Q?h.data!=="nested"&&(h.scrollTrigger&&h.scrollTrigger.revert(),h.kill()):!(h instanceof H)&&h.revert&&h.revert(i);r._r.forEach(function(c){return c(i,r)}),r.isReverted=!0})():this.data.forEach(function(o){return o.kill&&o.kill()}),this.clear(),n)for(var s=$e.length;s--;)$e[s].id===this.id&&$e.splice(s,1)},e.revert=function(i){this.kill(i||{})},a})(),ks=(function(){function a(t){this.contexts=[],this.scope=t,z&&z.data.push(this)}var e=a.prototype;return e.add=function(i,n,r){_e(i)||(i={matches:i});var s=new jn(0,r||this.scope),o=s.conditions={},l,h,c;z&&!s.selector&&(s.selector=z.selector),this.contexts.push(s),n=s.add("onMatch",n),s.queries=i;for(h in i)h==="all"?c=1:(l=ye.matchMedia(i[h]),l&&($e.indexOf(s)<0&&$e.push(s),(o[h]=l.matches)&&(c=1),l.addListener?l.addListener(Ai):l.addEventListener("change",Ai)));return c&&n(s,function(u){return s.add(null,u)}),this},e.revert=function(i){this.kill(i||{})},e.kill=function(i){this.contexts.forEach(function(n){return n.kill(i,!0)})},a})(),$t={registerPlugin:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];t.forEach(function(n){return Sn(n)})},timeline:function(e){return new Q(e)},getTweensOf:function(e,t){return $.getTweensOf(e,t)},getProperty:function(e,t,i,n){K(e)&&(e=me(e)[0]);var r=Ue(e||{}).get,s=i?hn:cn;return i==="native"&&(i=""),e&&(t?s((ce[t]&&ce[t].get||r)(e,t,i,n)):function(o,l,h){return s((ce[o]&&ce[o].get||r)(e,o,l,h))})},quickSetter:function(e,t,i){if(e=me(e),e.length>1){var n=e.map(function(c){return ne.quickSetter(c,t,i)}),r=n.length;return function(c){for(var u=r;u--;)n[u](c)}}e=e[0]||{};var s=ce[t],o=Ue(e),l=o.harness&&(o.harness.aliases||{})[t]||t,h=s?function(c){var u=new s;it._pt=0,u.init(e,i?c+i:c,it,0,[e]),u.render(1,u),it._pt&&Ci(1,it)}:o.set(e,l);return s?h:function(c){return h(e,l,i?c+i:c,o,1)}},quickTo:function(e,t,i){var n,r=ne.to(e,he((n={},n[t]="+=0.1",n.paused=!0,n.stagger=0,n),i||{})),s=function(l,h,c){return r.resetTo(t,l,h,c)};return s.tween=r,s},isTweening:function(e){return $.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=ze(e.ease,We.ease)),un(We,e||{})},config:function(e){return un(oe,e||{})},registerEffect:function(e){var t=e.name,i=e.effect,n=e.plugins,r=e.defaults,s=e.extendTimeline;(n||"").split(",").forEach(function(o){return o&&!ce[o]&&!le[o]&&ct(t+" effect requires "+o+" plugin.")}),oi[t]=function(o,l,h){return i(me(o),he(l||{},r),h)},s&&(Q.prototype[t]=function(o,l,h){return this.add(oi[t](o,_e(l)?l:(h=l)&&{},this),h)})},registerEase:function(e,t){M[e]=ze(t)},parseEase:function(e,t){return arguments.length?ze(e,t):M},getById:function(e){return $.getById(e)},exportRoot:function(e,t){e===void 0&&(e={});var i=new Q(e),n,r;for(i.smoothChildTiming=ee(e.smoothChildTiming),$.remove(i),i._dp=0,i._time=i._tTime=$._time,n=$._first;n;)r=n._next,(t||!(!n._dur&&n instanceof H&&n.vars.onComplete===n._targets[0]))&&be(i,n,n._start-n._delay),n=r;return be($,i,0),i},context:function(e,t){return e?new jn(e,t):z},matchMedia:function(e){return new ks(e)},matchMediaRefresh:function(){return $e.forEach(function(e){var t=e.conditions,i,n;for(n in t)t[n]&&(t[n]=!1,i=1);i&&e.revert()})||Ai()},addEventListener:function(e,t){var i=Nt[e]||(Nt[e]=[]);~i.indexOf(t)||i.push(t)},removeEventListener:function(e,t){var i=Nt[e],n=i&&i.indexOf(t);n>=0&&i.splice(n,1)},utils:{wrap:ps,wrapYoyo:fs,distribute:xn,random:En,snap:vn,normalize:ds,getUnit:q,clamp:ls,splitColor:Tn,toArray:me,selector:fi,mapRange:Cn,pipe:hs,unitize:us,interpolate:ms,shuffle:bn},install:nn,effects:oi,ticker:de,updateRoot:Q.updateRoot,plugins:ce,globalTimeline:$,core:{PropTween:ie,globals:rn,Tween:H,Timeline:Q,Animation:yt,getCache:Ue,_removeLinkedListItem:kt,reverting:function(){return X},context:function(e){return e&&z&&(z.data.push(e),e._ctx=z),z},suppressOverwrites:function(e){return Wt=e}}};te("to,from,fromTo,delayedCall,set,killTweensOf",function(a){return $t[a]=H[a]}),de.add(Q.updateRoot),it=$t.to({},{duration:0});var Us=function(e,t){for(var i=e._pt;i&&i.p!==t&&i.op!==t&&i.fp!==t;)i=i._next;return i},Fs=function(e,t){var i=e._targets,n,r,s;for(n in t)for(r=i.length;r--;)s=e._ptLookup[r][n],s&&(s=s.d)&&(s._pt&&(s=Us(s,n)),s&&s.modifier&&s.modifier(t[n],e,i[r],n))},Si=function(e,t){return{name:e,headless:1,rawVars:1,init:function(n,r,s){s._onInit=function(o){var l,h;if(K(r)&&(l={},te(r,function(c){return l[c]=1}),r=l),t){l={};for(h in r)l[h]=t(r[h]);r=l}Fs(o,r)}}}},ne=$t.registerPlugin({name:"attr",init:function(e,t,i,n,r){var s,o,l;this.tween=i;for(s in t)l=e.getAttribute(s)||"",o=this.add(e,"setAttribute",(l||0)+"",t[s],n,r,0,0,s),o.op=s,o.b=l,this._props.push(s)},render:function(e,t){for(var i=t._pt;i;)X?i.set(i.t,i.p,i.b,i):i.r(e,i.d),i=i._next}},{name:"endArray",headless:1,init:function(e,t){for(var i=t.length;i--;)this.add(e,i,e[i]||0,t[i],0,0,0,0,0,1)}},Si("roundProps",mi),Si("modifiers"),Si("snap",vn))||$t;H.version=Q.version=ne.version="3.13.0",tn=1,Jt()&&nt(),M.Power0,M.Power1,M.Power2,M.Power3,M.Power4,M.Linear,M.Quad,M.Cubic,M.Quart,M.Quint,M.Strong,M.Elastic,M.Back,M.SteppedEase,M.Bounce,M.Sine,M.Expo,M.Circ;var Yn,Re,rt,Ti,Be,Hn,Di,zs=function(){return typeof window<"u"},Ce={},Ve=180/Math.PI,st=Math.PI/180,at=Math.atan2,Zn=1e8,Mi=/([A-Z])/g,Ns=/(left|right|width|margin|padding|x)/i,$s=/[\s,\(]\S/,xe={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},Oi=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},Bs=function(e,t){return t.set(t.t,t.p,e===1?t.e:Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},Vs=function(e,t){return t.set(t.t,t.p,e?Math.round((t.s+t.c*e)*1e4)/1e4+t.u:t.b,t)},Gs=function(e,t){var i=t.s+t.c*e;t.set(t.t,t.p,~~(i+(i<0?-.5:.5))+t.u,t)},Kn=function(e,t){return t.set(t.t,t.p,e?t.e:t.b,t)},Xn=function(e,t){return t.set(t.t,t.p,e!==1?t.b:t.e,t)},js=function(e,t,i){return e.style[t]=i},Ys=function(e,t,i){return e.style.setProperty(t,i)},Hs=function(e,t,i){return e._gsap[t]=i},Zs=function(e,t,i){return e._gsap.scaleX=e._gsap.scaleY=i},Ks=function(e,t,i,n,r){var s=e._gsap;s.scaleX=s.scaleY=i,s.renderTransform(r,s)},Xs=function(e,t,i,n,r){var s=e._gsap;s[t]=i,s.renderTransform(r,s)},B="transform",re=B+"Origin",Ws=function a(e,t){var i=this,n=this.target,r=n.style,s=n._gsap;if(e in Ce&&r){if(this.tfm=this.tfm||{},e!=="transform")e=xe[e]||e,~e.indexOf(",")?e.split(",").forEach(function(o){return i.tfm[o]=Pe(n,o)}):this.tfm[e]=s.x?s[e]:Pe(n,e),e===re&&(this.tfm.zOrigin=s.zOrigin);else return xe.transform.split(",").forEach(function(o){return a.call(i,o,t)});if(this.props.indexOf(B)>=0)return;s.svg&&(this.svgo=n.getAttribute("data-svg-origin"),this.props.push(re,t,"")),e=B}(r||t)&&this.props.push(e,t,r[e])},Wn=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},qs=function(){var e=this.props,t=this.target,i=t.style,n=t._gsap,r,s;for(r=0;r<e.length;r+=3)e[r+1]?e[r+1]===2?t[e[r]](e[r+2]):t[e[r]]=e[r+2]:e[r+2]?i[e[r]]=e[r+2]:i.removeProperty(e[r].substr(0,2)==="--"?e[r]:e[r].replace(Mi,"-$1").toLowerCase());if(this.tfm){for(s in this.tfm)n[s]=this.tfm[s];n.svg&&(n.renderTransform(),t.setAttribute("data-svg-origin",this.svgo||"")),r=Di(),(!r||!r.isStart)&&!i[B]&&(Wn(i),n.zOrigin&&i[re]&&(i[re]+=" "+n.zOrigin+"px",n.zOrigin=0,n.renderTransform()),n.uncache=1)}},qn=function(e,t){var i={target:e,props:[],revert:qs,save:Ws};return e._gsap||ne.core.getCache(e),t&&e.style&&e.nodeType&&t.split(",").forEach(function(n){return i.save(n)}),i},Qn,Ri=function(e,t){var i=Re.createElementNS?Re.createElementNS((t||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):Re.createElement(e);return i&&i.style?i:Re.createElement(e)},ge=function a(e,t,i){var n=getComputedStyle(e);return n[t]||n.getPropertyValue(t.replace(Mi,"-$1").toLowerCase())||n.getPropertyValue(t)||!i&&a(e,ot(t)||t,1)||""},Jn="O,Moz,ms,Ms,Webkit".split(","),ot=function(e,t,i){var n=t||Be,r=n.style,s=5;if(e in r&&!i)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);s--&&!(Jn[s]+e in r););return s<0?null:(s===3?"ms":s>=0?Jn[s]:"")+e},Ii=function(){zs()&&window.document&&(Yn=window,Re=Yn.document,rt=Re.documentElement,Be=Ri("div")||{style:{}},Ri("div"),B=ot(B),re=B+"Origin",Be.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",Qn=!!ot("perspective"),Di=ne.core.reverting,Ti=1)},er=function(e){var t=e.ownerSVGElement,i=Ri("svg",t&&t.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),n=e.cloneNode(!0),r;n.style.display="block",i.appendChild(n),rt.appendChild(i);try{r=n.getBBox()}catch{}return i.removeChild(n),rt.removeChild(i),r},tr=function(e,t){for(var i=t.length;i--;)if(e.hasAttribute(t[i]))return e.getAttribute(t[i])},ir=function(e){var t,i;try{t=e.getBBox()}catch{t=er(e),i=1}return t&&(t.width||t.height)||i||(t=er(e)),t&&!t.width&&!t.x&&!t.y?{x:+tr(e,["x","cx","x1"])||0,y:+tr(e,["y","cy","y1"])||0,width:0,height:0}:t},nr=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&ir(e))},Ge=function(e,t){if(t){var i=e.style,n;t in Ce&&t!==re&&(t=B),i.removeProperty?(n=t.substr(0,2),(n==="ms"||t.substr(0,6)==="webkit")&&(t="-"+t),i.removeProperty(n==="--"?t:t.replace(Mi,"-$1").toLowerCase())):i.removeAttribute(t)}},Ie=function(e,t,i,n,r,s){var o=new ie(e._pt,t,i,0,1,s?Xn:Kn);return e._pt=o,o.b=n,o.e=r,e._props.push(i),o},rr={deg:1,rad:1,turn:1},Qs={grid:1,flex:1},Le=function a(e,t,i,n){var r=parseFloat(i)||0,s=(i+"").trim().substr((r+"").length)||"px",o=Be.style,l=Ns.test(t),h=e.tagName.toLowerCase()==="svg",c=(h?"client":"offset")+(l?"Width":"Height"),u=100,p=n==="px",m=n==="%",f,d,g,_;if(n===s||!r||rr[n]||rr[s])return r;if(s!=="px"&&!p&&(r=a(e,t,i,"px")),_=e.getCTM&&nr(e),(m||s==="%")&&(Ce[t]||~t.indexOf("adius")))return f=_?e.getBBox()[l?"width":"height"]:e[c],j(m?r/f*u:r/100*f);if(o[l?"width":"height"]=u+(p?s:n),d=n!=="rem"&&~t.indexOf("adius")||n==="em"&&e.appendChild&&!h?e:e.parentNode,_&&(d=(e.ownerSVGElement||{}).parentNode),(!d||d===Re||!d.appendChild)&&(d=Re.body),g=d._gsap,g&&m&&g.width&&l&&g.time===de.time&&!g.uncache)return j(r/g.width*u);if(m&&(t==="height"||t==="width")){var y=e.style[t];e.style[t]=u+n,f=e[c],y?e.style[t]=y:Ge(e,t)}else(m||s==="%")&&!Qs[ge(d,"display")]&&(o.position=ge(e,"position")),d===e&&(o.position="static"),d.appendChild(Be),f=Be[c],d.removeChild(Be),o.position="absolute";return l&&m&&(g=Ue(d),g.time=de.time,g.width=d[c]),j(p?f*r/u:f&&r?u/f*r:0)},Pe=function(e,t,i,n){var r;return Ti||Ii(),t in xe&&t!=="transform"&&(t=xe[t],~t.indexOf(",")&&(t=t.split(",")[0])),Ce[t]&&t!=="transform"?(r=vt(e,n),r=t!=="transformOrigin"?r[t]:r.svg?r.origin:Vt(ge(e,re))+" "+r.zOrigin+"px"):(r=e.style[t],(!r||r==="auto"||n||~(r+"").indexOf("calc("))&&(r=Bt[t]&&Bt[t](e,t,i)||ge(e,t)||on(e,t)||(t==="opacity"?1:0))),i&&!~(r+"").trim().indexOf(" ")?Le(e,t,r,i)+i:r},Js=function(e,t,i,n){if(!i||i==="none"){var r=ot(t,e,1),s=r&&ge(e,r,1);s&&s!==i?(t=r,i=s):t==="borderColor"&&(i=ge(e,"borderTopColor"))}var o=new ie(this._pt,e.style,t,0,1,Bn),l=0,h=0,c,u,p,m,f,d,g,_,y,b,v,x;if(o.b=i,o.e=n,i+="",n+="",n.substring(0,6)==="var(--"&&(n=ge(e,n.substring(4,n.indexOf(")")))),n==="auto"&&(d=e.style[t],e.style[t]=n,n=ge(e,t)||n,d?e.style[t]=d:Ge(e,t)),c=[i,n],On(c),i=c[0],n=c[1],p=i.match(qe)||[],x=n.match(qe)||[],x.length){for(;u=qe.exec(n);)g=u[0],y=n.substring(l,u.index),f?f=(f+1)%5:(y.substr(-5)==="rgba("||y.substr(-5)==="hsla(")&&(f=1),g!==(d=p[h++]||"")&&(m=parseFloat(d)||0,v=d.substr((m+"").length),g.charAt(1)==="="&&(g=Qe(m,g)+v),_=parseFloat(g),b=g.substr((_+"").length),l=qe.lastIndex-b.length,b||(b=b||oe.units[t]||v,l===n.length&&(n+=b,o.e+=b)),v!==b&&(m=Le(e,t,d,b)||0),o._pt={_next:o._pt,p:y||h===1?y:",",s:m,c:_-m,m:f&&f<4||t==="zIndex"?Math.round:0});o.c=l<n.length?n.substring(l,n.length):""}else o.r=t==="display"&&n==="none"?Xn:Kn;return Ji.test(n)&&(o.e=0),this._pt=o,o},sr={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},ea=function(e){var t=e.split(" "),i=t[0],n=t[1]||"50%";return(i==="top"||i==="bottom"||n==="left"||n==="right")&&(e=i,i=n,n=e),t[0]=sr[i]||i,t[1]=sr[n]||n,t.join(" ")},ta=function(e,t){if(t.tween&&t.tween._time===t.tween._dur){var i=t.t,n=i.style,r=t.u,s=i._gsap,o,l,h;if(r==="all"||r===!0)n.cssText="",l=1;else for(r=r.split(","),h=r.length;--h>-1;)o=r[h],Ce[o]&&(l=1,o=o==="transformOrigin"?re:B),Ge(i,o);l&&(Ge(i,B),s&&(s.svg&&i.removeAttribute("transform"),n.scale=n.rotate=n.translate="none",vt(i,1),s.uncache=1,Wn(n)))}},Bt={clearProps:function(e,t,i,n,r){if(r.data!=="isFromStart"){var s=e._pt=new ie(e._pt,t,i,0,0,ta);return s.u=n,s.pr=-10,s.tween=r,e._props.push(i),1}}},xt=[1,0,0,1,0,0],ar={},or=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},lr=function(e){var t=ge(e,B);return or(t)?xt:t.substr(7).match(Qi).map(j)},Li=function(e,t){var i=e._gsap||Ue(e),n=e.style,r=lr(e),s,o,l,h;return i.svg&&e.getAttribute("transform")?(l=e.transform.baseVal.consolidate().matrix,r=[l.a,l.b,l.c,l.d,l.e,l.f],r.join(",")==="1,0,0,1,0,0"?xt:r):(r===xt&&!e.offsetParent&&e!==rt&&!i.svg&&(l=n.display,n.display="block",s=e.parentNode,(!s||!e.offsetParent&&!e.getBoundingClientRect().width)&&(h=1,o=e.nextElementSibling,rt.appendChild(e)),r=lr(e),l?n.display=l:Ge(e,"display"),h&&(o?s.insertBefore(e,o):s?s.appendChild(e):rt.removeChild(e))),t&&r.length>6?[r[0],r[1],r[4],r[5],r[12],r[13]]:r)},ki=function(e,t,i,n,r,s){var o=e._gsap,l=r||Li(e,!0),h=o.xOrigin||0,c=o.yOrigin||0,u=o.xOffset||0,p=o.yOffset||0,m=l[0],f=l[1],d=l[2],g=l[3],_=l[4],y=l[5],b=t.split(" "),v=parseFloat(b[0])||0,x=parseFloat(b[1])||0,C,E,P,w;i?l!==xt&&(E=m*g-f*d)&&(P=v*(g/E)+x*(-d/E)+(d*y-g*_)/E,w=v*(-f/E)+x*(m/E)-(m*y-f*_)/E,v=P,x=w):(C=ir(e),v=C.x+(~b[0].indexOf("%")?v/100*C.width:v),x=C.y+(~(b[1]||b[0]).indexOf("%")?x/100*C.height:x)),n||n!==!1&&o.smooth?(_=v-h,y=x-c,o.xOffset=u+(_*m+y*d)-_,o.yOffset=p+(_*f+y*g)-y):o.xOffset=o.yOffset=0,o.xOrigin=v,o.yOrigin=x,o.smooth=!!n,o.origin=t,o.originIsAbsolute=!!i,e.style[re]="0px 0px",s&&(Ie(s,o,"xOrigin",h,v),Ie(s,o,"yOrigin",c,x),Ie(s,o,"xOffset",u,o.xOffset),Ie(s,o,"yOffset",p,o.yOffset)),e.setAttribute("data-svg-origin",v+" "+x)},vt=function(e,t){var i=e._gsap||new kn(e);if("x"in i&&!t&&!i.uncache)return i;var n=e.style,r=i.scaleX<0,s="px",o="deg",l=getComputedStyle(e),h=ge(e,re)||"0",c,u,p,m,f,d,g,_,y,b,v,x,C,E,P,w,T,O,S,R,I,G,N,F,se,Pt,At,St,Ke,Mr,Ae,Xe;return c=u=p=d=g=_=y=b=v=0,m=f=1,i.svg=!!(e.getCTM&&nr(e)),l.translate&&((l.translate!=="none"||l.scale!=="none"||l.rotate!=="none")&&(n[B]=(l.translate!=="none"?"translate3d("+(l.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(l.rotate!=="none"?"rotate("+l.rotate+") ":"")+(l.scale!=="none"?"scale("+l.scale.split(" ").join(",")+") ":"")+(l[B]!=="none"?l[B]:"")),n.scale=n.rotate=n.translate="none"),E=Li(e,i.svg),i.svg&&(i.uncache?(se=e.getBBox(),h=i.xOrigin-se.x+"px "+(i.yOrigin-se.y)+"px",F=""):F=!t&&e.getAttribute("data-svg-origin"),ki(e,F||h,!!F||i.originIsAbsolute,i.smooth!==!1,E)),x=i.xOrigin||0,C=i.yOrigin||0,E!==xt&&(O=E[0],S=E[1],R=E[2],I=E[3],c=G=E[4],u=N=E[5],E.length===6?(m=Math.sqrt(O*O+S*S),f=Math.sqrt(I*I+R*R),d=O||S?at(S,O)*Ve:0,y=R||I?at(R,I)*Ve+d:0,y&&(f*=Math.abs(Math.cos(y*st))),i.svg&&(c-=x-(x*O+C*R),u-=C-(x*S+C*I))):(Xe=E[6],Mr=E[7],At=E[8],St=E[9],Ke=E[10],Ae=E[11],c=E[12],u=E[13],p=E[14],P=at(Xe,Ke),g=P*Ve,P&&(w=Math.cos(-P),T=Math.sin(-P),F=G*w+At*T,se=N*w+St*T,Pt=Xe*w+Ke*T,At=G*-T+At*w,St=N*-T+St*w,Ke=Xe*-T+Ke*w,Ae=Mr*-T+Ae*w,G=F,N=se,Xe=Pt),P=at(-R,Ke),_=P*Ve,P&&(w=Math.cos(-P),T=Math.sin(-P),F=O*w-At*T,se=S*w-St*T,Pt=R*w-Ke*T,Ae=I*T+Ae*w,O=F,S=se,R=Pt),P=at(S,O),d=P*Ve,P&&(w=Math.cos(P),T=Math.sin(P),F=O*w+S*T,se=G*w+N*T,S=S*w-O*T,N=N*w-G*T,O=F,G=se),g&&Math.abs(g)+Math.abs(d)>359.9&&(g=d=0,_=180-_),m=j(Math.sqrt(O*O+S*S+R*R)),f=j(Math.sqrt(N*N+Xe*Xe)),P=at(G,N),y=Math.abs(P)>2e-4?P*Ve:0,v=Ae?1/(Ae<0?-Ae:Ae):0),i.svg&&(F=e.getAttribute("transform"),i.forceCSS=e.setAttribute("transform","")||!or(ge(e,B)),F&&e.setAttribute("transform",F))),Math.abs(y)>90&&Math.abs(y)<270&&(r?(m*=-1,y+=d<=0?180:-180,d+=d<=0?180:-180):(f*=-1,y+=y<=0?180:-180)),t=t||i.uncache,i.x=c-((i.xPercent=c&&(!t&&i.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-c)?-50:0)))?e.offsetWidth*i.xPercent/100:0)+s,i.y=u-((i.yPercent=u&&(!t&&i.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-u)?-50:0)))?e.offsetHeight*i.yPercent/100:0)+s,i.z=p+s,i.scaleX=j(m),i.scaleY=j(f),i.rotation=j(d)+o,i.rotationX=j(g)+o,i.rotationY=j(_)+o,i.skewX=y+o,i.skewY=b+o,i.transformPerspective=v+s,(i.zOrigin=parseFloat(h.split(" ")[2])||!t&&i.zOrigin||0)&&(n[re]=Vt(h)),i.xOffset=i.yOffset=0,i.force3D=oe.force3D,i.renderTransform=i.svg?na:Qn?cr:ia,i.uncache=0,i},Vt=function(e){return(e=e.split(" "))[0]+" "+e[1]},Ui=function(e,t,i){var n=q(t);return j(parseFloat(t)+parseFloat(Le(e,"x",i+"px",n)))+n},ia=function(e,t){t.z="0px",t.rotationY=t.rotationX="0deg",t.force3D=0,cr(e,t)},je="0deg",Et="0px",Ye=") ",cr=function(e,t){var i=t||this,n=i.xPercent,r=i.yPercent,s=i.x,o=i.y,l=i.z,h=i.rotation,c=i.rotationY,u=i.rotationX,p=i.skewX,m=i.skewY,f=i.scaleX,d=i.scaleY,g=i.transformPerspective,_=i.force3D,y=i.target,b=i.zOrigin,v="",x=_==="auto"&&e&&e!==1||_===!0;if(b&&(u!==je||c!==je)){var C=parseFloat(c)*st,E=Math.sin(C),P=Math.cos(C),w;C=parseFloat(u)*st,w=Math.cos(C),s=Ui(y,s,E*w*-b),o=Ui(y,o,-Math.sin(C)*-b),l=Ui(y,l,P*w*-b+b)}g!==Et&&(v+="perspective("+g+Ye),(n||r)&&(v+="translate("+n+"%, "+r+"%) "),(x||s!==Et||o!==Et||l!==Et)&&(v+=l!==Et||x?"translate3d("+s+", "+o+", "+l+") ":"translate("+s+", "+o+Ye),h!==je&&(v+="rotate("+h+Ye),c!==je&&(v+="rotateY("+c+Ye),u!==je&&(v+="rotateX("+u+Ye),(p!==je||m!==je)&&(v+="skew("+p+", "+m+Ye),(f!==1||d!==1)&&(v+="scale("+f+", "+d+Ye),y.style[B]=v||"translate(0, 0)"},na=function(e,t){var i=t||this,n=i.xPercent,r=i.yPercent,s=i.x,o=i.y,l=i.rotation,h=i.skewX,c=i.skewY,u=i.scaleX,p=i.scaleY,m=i.target,f=i.xOrigin,d=i.yOrigin,g=i.xOffset,_=i.yOffset,y=i.forceCSS,b=parseFloat(s),v=parseFloat(o),x,C,E,P,w;l=parseFloat(l),h=parseFloat(h),c=parseFloat(c),c&&(c=parseFloat(c),h+=c,l+=c),l||h?(l*=st,h*=st,x=Math.cos(l)*u,C=Math.sin(l)*u,E=Math.sin(l-h)*-p,P=Math.cos(l-h)*p,h&&(c*=st,w=Math.tan(h-c),w=Math.sqrt(1+w*w),E*=w,P*=w,c&&(w=Math.tan(c),w=Math.sqrt(1+w*w),x*=w,C*=w)),x=j(x),C=j(C),E=j(E),P=j(P)):(x=u,P=p,C=E=0),(b&&!~(s+"").indexOf("px")||v&&!~(o+"").indexOf("px"))&&(b=Le(m,"x",s,"px"),v=Le(m,"y",o,"px")),(f||d||g||_)&&(b=j(b+f-(f*x+d*E)+g),v=j(v+d-(f*C+d*P)+_)),(n||r)&&(w=m.getBBox(),b=j(b+n/100*w.width),v=j(v+r/100*w.height)),w="matrix("+x+","+C+","+E+","+P+","+b+","+v+")",m.setAttribute("transform",w),y&&(m.style[B]=w)},ra=function(e,t,i,n,r){var s=360,o=K(r),l=parseFloat(r)*(o&&~r.indexOf("rad")?Ve:1),h=l-n,c=n+h+"deg",u,p;return o&&(u=r.split("_")[1],u==="short"&&(h%=s,h!==h%(s/2)&&(h+=h<0?s:-s)),u==="cw"&&h<0?h=(h+s*Zn)%s-~~(h/s)*s:u==="ccw"&&h>0&&(h=(h-s*Zn)%s-~~(h/s)*s)),e._pt=p=new ie(e._pt,t,i,n,h,Bs),p.e=c,p.u="deg",e._props.push(i),p},hr=function(e,t){for(var i in t)e[i]=t[i];return e},sa=function(e,t,i){var n=hr({},i._gsap),r="perspective,force3D,transformOrigin,svgOrigin",s=i.style,o,l,h,c,u,p,m,f;n.svg?(h=i.getAttribute("transform"),i.setAttribute("transform",""),s[B]=t,o=vt(i,1),Ge(i,B),i.setAttribute("transform",h)):(h=getComputedStyle(i)[B],s[B]=t,o=vt(i,1),s[B]=h);for(l in Ce)h=n[l],c=o[l],h!==c&&r.indexOf(l)<0&&(m=q(h),f=q(c),u=m!==f?Le(i,l,h,f):parseFloat(h),p=parseFloat(c),e._pt=new ie(e._pt,o,l,u,p-u,Oi),e._pt.u=f||0,e._props.push(l));hr(o,n)};te("padding,margin,Width,Radius",function(a,e){var t="Top",i="Right",n="Bottom",r="Left",s=(e<3?[t,i,n,r]:[t+r,t+i,n+i,n+r]).map(function(o){return e<2?a+o:"border"+o+a});Bt[e>1?"border"+a:a]=function(o,l,h,c,u){var p,m;if(arguments.length<4)return p=s.map(function(f){return Pe(o,f,h)}),m=p.join(" "),m.split(p[0]).length===5?p[0]:m;p=(c+"").split(" "),m={},s.forEach(function(f,d){return m[f]=p[d]=p[d]||p[(d-1)/2|0]}),o.init(l,m,u)}});var ur={name:"css",register:Ii,targetTest:function(e){return e.style&&e.nodeType},init:function(e,t,i,n,r){var s=this._props,o=e.style,l=i.vars.startAt,h,c,u,p,m,f,d,g,_,y,b,v,x,C,E,P;Ti||Ii(),this.styles=this.styles||qn(e),P=this.styles.props,this.tween=i;for(d in t)if(d!=="autoRound"&&(c=t[d],!(ce[d]&&Un(d,t,i,n,e,r)))){if(m=typeof c,f=Bt[d],m==="function"&&(c=c.call(i,n,e,r),m=typeof c),m==="string"&&~c.indexOf("random(")&&(c=ft(c)),f)f(this,e,d,c,i)&&(E=1);else if(d.substr(0,2)==="--")h=(getComputedStyle(e).getPropertyValue(d)+"").trim(),c+="",Me.lastIndex=0,Me.test(h)||(g=q(h),_=q(c)),_?g!==_&&(h=Le(e,d,h,_)+_):g&&(c+=g),this.add(o,"setProperty",h,c,n,r,0,0,d),s.push(d),P.push(d,0,o[d]);else if(m!=="undefined"){if(l&&d in l?(h=typeof l[d]=="function"?l[d].call(i,n,e,r):l[d],K(h)&&~h.indexOf("random(")&&(h=ft(h)),q(h+"")||h==="auto"||(h+=oe.units[d]||q(Pe(e,d))||""),(h+"").charAt(1)==="="&&(h=Pe(e,d))):h=Pe(e,d),p=parseFloat(h),y=m==="string"&&c.charAt(1)==="="&&c.substr(0,2),y&&(c=c.substr(2)),u=parseFloat(c),d in xe&&(d==="autoAlpha"&&(p===1&&Pe(e,"visibility")==="hidden"&&u&&(p=0),P.push("visibility",0,o.visibility),Ie(this,o,"visibility",p?"inherit":"hidden",u?"inherit":"hidden",!u)),d!=="scale"&&d!=="transform"&&(d=xe[d],~d.indexOf(",")&&(d=d.split(",")[0]))),b=d in Ce,b){if(this.styles.save(d),m==="string"&&c.substring(0,6)==="var(--"&&(c=ge(e,c.substring(4,c.indexOf(")"))),u=parseFloat(c)),v||(x=e._gsap,x.renderTransform&&!t.parseTransform||vt(e,t.parseTransform),C=t.smoothOrigin!==!1&&x.smooth,v=this._pt=new ie(this._pt,o,B,0,1,x.renderTransform,x,0,-1),v.dep=1),d==="scale")this._pt=new ie(this._pt,x,"scaleY",x.scaleY,(y?Qe(x.scaleY,y+u):u)-x.scaleY||0,Oi),this._pt.u=0,s.push("scaleY",d),d+="X";else if(d==="transformOrigin"){P.push(re,0,o[re]),c=ea(c),x.svg?ki(e,c,0,C,0,this):(_=parseFloat(c.split(" ")[2])||0,_!==x.zOrigin&&Ie(this,x,"zOrigin",x.zOrigin,_),Ie(this,o,d,Vt(h),Vt(c)));continue}else if(d==="svgOrigin"){ki(e,c,1,C,0,this);continue}else if(d in ar){ra(this,x,d,p,y?Qe(p,y+c):c);continue}else if(d==="smoothOrigin"){Ie(this,x,"smooth",x.smooth,c);continue}else if(d==="force3D"){x[d]=c;continue}else if(d==="transform"){sa(this,c,e);continue}}else d in o||(d=ot(d)||d);if(b||(u||u===0)&&(p||p===0)&&!$s.test(c)&&d in o)g=(h+"").substr((p+"").length),u||(u=0),_=q(c)||(d in oe.units?oe.units[d]:g),g!==_&&(p=Le(e,d,h,_)),this._pt=new ie(this._pt,b?x:o,d,p,(y?Qe(p,y+u):u)-p,!b&&(_==="px"||d==="zIndex")&&t.autoRound!==!1?Gs:Oi),this._pt.u=_||0,g!==_&&_!=="%"&&(this._pt.b=h,this._pt.r=Vs);else if(d in o)Js.call(this,e,d,h,y?y+c:c);else if(d in e)this.add(e,d,h||e[d],y?y+c:c,n,r);else if(d!=="parseTransform"){ri(d,c);continue}b||(d in o?P.push(d,0,o[d]):typeof e[d]=="function"?P.push(d,2,e[d]()):P.push(d,1,h||e[d])),s.push(d)}}E&&Vn(this)},render:function(e,t){if(t.tween._time||!Di())for(var i=t._pt;i;)i.r(e,i.d),i=i._next;else t.styles.revert()},get:Pe,aliases:xe,getSetter:function(e,t,i){var n=xe[t];return n&&n.indexOf(",")<0&&(t=n),t in Ce&&t!==re&&(e._gsap.x||Pe(e,"x"))?i&&Hn===i?t==="scale"?Zs:Hs:(Hn=i||{})&&(t==="scale"?Ks:Xs):e.style&&!Qt(e.style[t])?js:~t.indexOf("-")?Ys:wi(e,t)},core:{_removeProperty:Ge,_getMatrix:Li}};ne.utils.checkPrefix=ot,ne.core.getStyleSaver=qn,(function(a,e,t,i){var n=te(a+","+e+","+t,function(r){Ce[r]=1});te(e,function(r){oe.units[r]="deg",ar[r]=1}),xe[n[13]]=a+","+e,te(i,function(r){var s=r.split(":");xe[s[1]]=n[s[0]]})})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY"),te("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(a){oe.units[a]="px"}),ne.registerPlugin(ur);var wt=ne.registerPlugin(ur)||ne;wt.core.Tween;class ve{constructor(e,t,i,n,r="div"){this.parent=e,this.object=t,this.property=i,this._disabled=!1,this._hidden=!1,this.initialValue=this.getValue(),this.domElement=document.createElement(r),this.domElement.classList.add("lil-controller"),this.domElement.classList.add(n),this.$name=document.createElement("div"),this.$name.classList.add("lil-name"),ve.nextNameID=ve.nextNameID||0,this.$name.id=`lil-gui-name-${++ve.nextNameID}`,this.$widget=document.createElement("div"),this.$widget.classList.add("lil-widget"),this.$disable=this.$widget,this.domElement.appendChild(this.$name),this.domElement.appendChild(this.$widget),this.domElement.addEventListener("keydown",s=>s.stopPropagation()),this.domElement.addEventListener("keyup",s=>s.stopPropagation()),this.parent.children.push(this),this.parent.controllers.push(this),this.parent.$children.appendChild(this.domElement),this._listenCallback=this._listenCallback.bind(this),this.name(i)}name(e){return this._name=e,this.$name.textContent=e,this}onChange(e){return this._onChange=e,this}_callOnChange(){this.parent._callOnChange(this),this._onChange!==void 0&&this._onChange.call(this,this.getValue()),this._changed=!0}onFinishChange(e){return this._onFinishChange=e,this}_callOnFinishChange(){this._changed&&(this.parent._callOnFinishChange(this),this._onFinishChange!==void 0&&this._onFinishChange.call(this,this.getValue())),this._changed=!1}reset(){return this.setValue(this.initialValue),this._callOnFinishChange(),this}enable(e=!0){return this.disable(!e)}disable(e=!0){return e===this._disabled?this:(this._disabled=e,this.domElement.classList.toggle("lil-disabled",e),this.$disable.toggleAttribute("disabled",e),this)}show(e=!0){return this._hidden=!e,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}options(e){const t=this.parent.add(this.object,this.property,e);return t.name(this._name),this.destroy(),t}min(e){return this}max(e){return this}step(e){return this}decimals(e){return this}listen(e=!0){return this._listening=e,this._listenCallbackID!==void 0&&(cancelAnimationFrame(this._listenCallbackID),this._listenCallbackID=void 0),this._listening&&this._listenCallback(),this}_listenCallback(){this._listenCallbackID=requestAnimationFrame(this._listenCallback);const e=this.save();e!==this._listenPrevValue&&this.updateDisplay(),this._listenPrevValue=e}getValue(){return this.object[this.property]}setValue(e){return this.getValue()!==e&&(this.object[this.property]=e,this._callOnChange(),this.updateDisplay()),this}updateDisplay(){return this}load(e){return this.setValue(e),this._callOnFinishChange(),this}save(){return this.getValue()}destroy(){this.listen(!1),this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.controllers.splice(this.parent.controllers.indexOf(this),1),this.parent.$children.removeChild(this.domElement)}}class aa extends ve{constructor(e,t,i){super(e,t,i,"lil-boolean","label"),this.$input=document.createElement("input"),this.$input.setAttribute("type","checkbox"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$widget.appendChild(this.$input),this.$input.addEventListener("change",()=>{this.setValue(this.$input.checked),this._callOnFinishChange()}),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.checked=this.getValue(),this}}function Fi(a){let e,t;return(e=a.match(/(#|0x)?([a-f0-9]{6})/i))?t=e[2]:(e=a.match(/rgb\(\s*(\d*)\s*,\s*(\d*)\s*,\s*(\d*)\s*\)/))?t=parseInt(e[1]).toString(16).padStart(2,0)+parseInt(e[2]).toString(16).padStart(2,0)+parseInt(e[3]).toString(16).padStart(2,0):(e=a.match(/^#?([a-f0-9])([a-f0-9])([a-f0-9])$/i))&&(t=e[1]+e[1]+e[2]+e[2]+e[3]+e[3]),t?"#"+t:!1}const oa={isPrimitive:!0,match:a=>typeof a=="string",fromHexString:Fi,toHexString:Fi},Ct={isPrimitive:!0,match:a=>typeof a=="number",fromHexString:a=>parseInt(a.substring(1),16),toHexString:a=>"#"+a.toString(16).padStart(6,0)},la=[oa,Ct,{isPrimitive:!1,match:a=>Array.isArray(a)||ArrayBuffer.isView(a),fromHexString(a,e,t=1){const i=Ct.fromHexString(a);e[0]=(i>>16&255)/255*t,e[1]=(i>>8&255)/255*t,e[2]=(i&255)/255*t},toHexString([a,e,t],i=1){i=255/i;const n=a*i<<16^e*i<<8^t*i<<0;return Ct.toHexString(n)}},{isPrimitive:!1,match:a=>Object(a)===a,fromHexString(a,e,t=1){const i=Ct.fromHexString(a);e.r=(i>>16&255)/255*t,e.g=(i>>8&255)/255*t,e.b=(i&255)/255*t},toHexString({r:a,g:e,b:t},i=1){i=255/i;const n=a*i<<16^e*i<<8^t*i<<0;return Ct.toHexString(n)}}];function ca(a){return la.find(e=>e.match(a))}class ha extends ve{constructor(e,t,i,n){super(e,t,i,"lil-color"),this.$input=document.createElement("input"),this.$input.setAttribute("type","color"),this.$input.setAttribute("tabindex",-1),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$text=document.createElement("input"),this.$text.setAttribute("type","text"),this.$text.setAttribute("spellcheck","false"),this.$text.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("lil-display"),this.$display.appendChild(this.$input),this.$widget.appendChild(this.$display),this.$widget.appendChild(this.$text),this._format=ca(this.initialValue),this._rgbScale=n,this._initialValueHexString=this.save(),this._textFocused=!1,this.$input.addEventListener("input",()=>{this._setValueFromHexString(this.$input.value)}),this.$input.addEventListener("blur",()=>{this._callOnFinishChange()}),this.$text.addEventListener("input",()=>{const r=Fi(this.$text.value);r&&this._setValueFromHexString(r)}),this.$text.addEventListener("focus",()=>{this._textFocused=!0,this.$text.select()}),this.$text.addEventListener("blur",()=>{this._textFocused=!1,this.updateDisplay(),this._callOnFinishChange()}),this.$disable=this.$text,this.updateDisplay()}reset(){return this._setValueFromHexString(this._initialValueHexString),this}_setValueFromHexString(e){if(this._format.isPrimitive){const t=this._format.fromHexString(e);this.setValue(t)}else this._format.fromHexString(e,this.getValue(),this._rgbScale),this._callOnChange(),this.updateDisplay()}save(){return this._format.toHexString(this.getValue(),this._rgbScale)}load(e){return this._setValueFromHexString(e),this._callOnFinishChange(),this}updateDisplay(){return this.$input.value=this._format.toHexString(this.getValue(),this._rgbScale),this._textFocused||(this.$text.value=this.$input.value.substring(1)),this.$display.style.backgroundColor=this.$input.value,this}}class zi extends ve{constructor(e,t,i){super(e,t,i,"lil-function"),this.$button=document.createElement("button"),this.$button.appendChild(this.$name),this.$widget.appendChild(this.$button),this.$button.addEventListener("click",n=>{n.preventDefault(),this.getValue().call(this.object),this._callOnChange()}),this.$button.addEventListener("touchstart",()=>{},{passive:!0}),this.$disable=this.$button}}class ua extends ve{constructor(e,t,i,n,r,s){super(e,t,i,"lil-number"),this._initInput(),this.min(n),this.max(r);const o=s!==void 0;this.step(o?s:this._getImplicitStep(),o),this.updateDisplay()}decimals(e){return this._decimals=e,this.updateDisplay(),this}min(e){return this._min=e,this._onUpdateMinMax(),this}max(e){return this._max=e,this._onUpdateMinMax(),this}step(e,t=!0){return this._step=e,this._stepExplicit=t,this}updateDisplay(){const e=this.getValue();if(this._hasSlider){let t=(e-this._min)/(this._max-this._min);t=Math.max(0,Math.min(t,1)),this.$fill.style.width=t*100+"%"}return this._inputFocused||(this.$input.value=this._decimals===void 0?e:e.toFixed(this._decimals)),this}_initInput(){this.$input=document.createElement("input"),this.$input.setAttribute("type","text"),this.$input.setAttribute("aria-labelledby",this.$name.id),window.matchMedia("(pointer: coarse)").matches&&(this.$input.setAttribute("type","number"),this.$input.setAttribute("step","any")),this.$widget.appendChild(this.$input),this.$disable=this.$input;const t=()=>{let y=parseFloat(this.$input.value);isNaN(y)||(this._stepExplicit&&(y=this._snap(y)),this.setValue(this._clamp(y)))},i=y=>{const b=parseFloat(this.$input.value);isNaN(b)||(this._snapClampSetValue(b+y),this.$input.value=this.getValue())},n=y=>{y.key==="Enter"&&this.$input.blur(),y.code==="ArrowUp"&&(y.preventDefault(),i(this._step*this._arrowKeyMultiplier(y))),y.code==="ArrowDown"&&(y.preventDefault(),i(this._step*this._arrowKeyMultiplier(y)*-1))},r=y=>{this._inputFocused&&(y.preventDefault(),i(this._step*this._normalizeMouseWheel(y)))};let s=!1,o,l,h,c,u;const p=5,m=y=>{o=y.clientX,l=h=y.clientY,s=!0,c=this.getValue(),u=0,window.addEventListener("mousemove",f),window.addEventListener("mouseup",d)},f=y=>{if(s){const b=y.clientX-o,v=y.clientY-l;Math.abs(v)>p?(y.preventDefault(),this.$input.blur(),s=!1,this._setDraggingStyle(!0,"vertical")):Math.abs(b)>p&&d()}if(!s){const b=y.clientY-h;u-=b*this._step*this._arrowKeyMultiplier(y),c+u>this._max?u=this._max-c:c+u<this._min&&(u=this._min-c),this._snapClampSetValue(c+u)}h=y.clientY},d=()=>{this._setDraggingStyle(!1,"vertical"),this._callOnFinishChange(),window.removeEventListener("mousemove",f),window.removeEventListener("mouseup",d)},g=()=>{this._inputFocused=!0},_=()=>{this._inputFocused=!1,this.updateDisplay(),this._callOnFinishChange()};this.$input.addEventListener("input",t),this.$input.addEventListener("keydown",n),this.$input.addEventListener("wheel",r,{passive:!1}),this.$input.addEventListener("mousedown",m),this.$input.addEventListener("focus",g),this.$input.addEventListener("blur",_)}_initSlider(){this._hasSlider=!0,this.$slider=document.createElement("div"),this.$slider.classList.add("lil-slider"),this.$fill=document.createElement("div"),this.$fill.classList.add("lil-fill"),this.$slider.appendChild(this.$fill),this.$widget.insertBefore(this.$slider,this.$input),this.domElement.classList.add("lil-has-slider");const e=(_,y,b,v,x)=>(_-y)/(b-y)*(x-v)+v,t=_=>{const y=this.$slider.getBoundingClientRect();let b=e(_,y.left,y.right,this._min,this._max);this._snapClampSetValue(b)},i=_=>{this._setDraggingStyle(!0),t(_.clientX),window.addEventListener("mousemove",n),window.addEventListener("mouseup",r)},n=_=>{t(_.clientX)},r=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("mousemove",n),window.removeEventListener("mouseup",r)};let s=!1,o,l;const h=_=>{_.preventDefault(),this._setDraggingStyle(!0),t(_.touches[0].clientX),s=!1},c=_=>{_.touches.length>1||(this._hasScrollBar?(o=_.touches[0].clientX,l=_.touches[0].clientY,s=!0):h(_),window.addEventListener("touchmove",u,{passive:!1}),window.addEventListener("touchend",p))},u=_=>{if(s){const y=_.touches[0].clientX-o,b=_.touches[0].clientY-l;Math.abs(y)>Math.abs(b)?h(_):(window.removeEventListener("touchmove",u),window.removeEventListener("touchend",p))}else _.preventDefault(),t(_.touches[0].clientX)},p=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("touchmove",u),window.removeEventListener("touchend",p)},m=this._callOnFinishChange.bind(this),f=400;let d;const g=_=>{if(Math.abs(_.deltaX)<Math.abs(_.deltaY)&&this._hasScrollBar)return;_.preventDefault();const b=this._normalizeMouseWheel(_)*this._step;this._snapClampSetValue(this.getValue()+b),this.$input.value=this.getValue(),clearTimeout(d),d=setTimeout(m,f)};this.$slider.addEventListener("mousedown",i),this.$slider.addEventListener("touchstart",c,{passive:!1}),this.$slider.addEventListener("wheel",g,{passive:!1})}_setDraggingStyle(e,t="horizontal"){this.$slider&&this.$slider.classList.toggle("lil-active",e),document.body.classList.toggle("lil-dragging",e),document.body.classList.toggle(`lil-${t}`,e)}_getImplicitStep(){return this._hasMin&&this._hasMax?(this._max-this._min)/1e3:.1}_onUpdateMinMax(){!this._hasSlider&&this._hasMin&&this._hasMax&&(this._stepExplicit||this.step(this._getImplicitStep(),!1),this._initSlider(),this.updateDisplay())}_normalizeMouseWheel(e){let{deltaX:t,deltaY:i}=e;return Math.floor(e.deltaY)!==e.deltaY&&e.wheelDelta&&(t=0,i=-e.wheelDelta/120,i*=this._stepExplicit?1:10),t+-i}_arrowKeyMultiplier(e){let t=this._stepExplicit?1:10;return e.shiftKey?t*=10:e.altKey&&(t/=10),t}_snap(e){let t=0;return this._hasMin?t=this._min:this._hasMax&&(t=this._max),e-=t,e=Math.round(e/this._step)*this._step,e+=t,e=parseFloat(e.toPrecision(15)),e}_clamp(e){return e<this._min&&(e=this._min),e>this._max&&(e=this._max),e}_snapClampSetValue(e){this.setValue(this._clamp(this._snap(e)))}get _hasScrollBar(){const e=this.parent.root.$children;return e.scrollHeight>e.clientHeight}get _hasMin(){return this._min!==void 0}get _hasMax(){return this._max!==void 0}}class da extends ve{constructor(e,t,i,n){super(e,t,i,"lil-option"),this.$select=document.createElement("select"),this.$select.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("lil-display"),this.$select.addEventListener("change",()=>{this.setValue(this._values[this.$select.selectedIndex]),this._callOnFinishChange()}),this.$select.addEventListener("focus",()=>{this.$display.classList.add("lil-focus")}),this.$select.addEventListener("blur",()=>{this.$display.classList.remove("lil-focus")}),this.$widget.appendChild(this.$select),this.$widget.appendChild(this.$display),this.$disable=this.$select,this.options(n)}options(e){return this._values=Array.isArray(e)?e:Object.values(e),this._names=Array.isArray(e)?e:Object.keys(e),this.$select.replaceChildren(),this._names.forEach(t=>{const i=document.createElement("option");i.textContent=t,this.$select.appendChild(i)}),this.updateDisplay(),this}updateDisplay(){const e=this.getValue(),t=this._values.indexOf(e);return this.$select.selectedIndex=t,this.$display.textContent=t===-1?e:this._names[t],this}}class pa extends ve{constructor(e,t,i){super(e,t,i,"lil-string"),this.$input=document.createElement("input"),this.$input.setAttribute("type","text"),this.$input.setAttribute("spellcheck","false"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$input.addEventListener("input",()=>{this.setValue(this.$input.value)}),this.$input.addEventListener("keydown",n=>{n.code==="Enter"&&this.$input.blur()}),this.$input.addEventListener("blur",()=>{this._callOnFinishChange()}),this.$widget.appendChild(this.$input),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.value=this.getValue(),this}}var fa=`.lil-gui {
1
+ (function(ae,A){typeof exports=="object"&&typeof module<"u"?A(exports,require("three")):typeof define=="function"&&define.amd?define(["exports","three"],A):(ae=typeof globalThis<"u"?globalThis:ae||self,A(ae.Gralobe={},ae.THREE))})(this,(function(ae,A){"use strict";function Or(a){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const t in a)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(a,t);Object.defineProperty(e,t,i.get?i:{enumerable:!0,get:()=>a[t]})}}return e.default=a,Object.freeze(e)}const D=Or(A),Hi={type:"change"},Kt={type:"start"},Zi={type:"end"},Tt=new A.Ray,Ki=new A.Plane,Rr=Math.cos(70*A.MathUtils.DEG2RAD),Z=new A.Vector3,J=2*Math.PI,L={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},Xt=1e-6;class Ir extends A.Controls{constructor(e,t=null){super(e,t),this.state=L.NONE,this.target=new A.Vector3,this.cursor=new A.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.keyRotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:A.MOUSE.ROTATE,MIDDLE:A.MOUSE.DOLLY,RIGHT:A.MOUSE.PAN},this.touches={ONE:A.TOUCH.ROTATE,TWO:A.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new A.Vector3,this._lastQuaternion=new A.Quaternion,this._lastTargetPosition=new A.Vector3,this._quat=new A.Quaternion().setFromUnitVectors(e.up,new A.Vector3(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new A.Spherical,this._sphericalDelta=new A.Spherical,this._scale=1,this._panOffset=new A.Vector3,this._rotateStart=new A.Vector2,this._rotateEnd=new A.Vector2,this._rotateDelta=new A.Vector2,this._panStart=new A.Vector2,this._panEnd=new A.Vector2,this._panDelta=new A.Vector2,this._dollyStart=new A.Vector2,this._dollyEnd=new A.Vector2,this._dollyDelta=new A.Vector2,this._dollyDirection=new A.Vector3,this._mouse=new A.Vector2,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=kr.bind(this),this._onPointerDown=Lr.bind(this),this._onPointerUp=Ur.bind(this),this._onContextMenu=Gr.bind(this),this._onMouseWheel=Nr.bind(this),this._onKeyDown=$r.bind(this),this._onTouchStart=Br.bind(this),this._onTouchMove=Vr.bind(this),this._onMouseDown=Fr.bind(this),this._onMouseMove=zr.bind(this),this._interceptControlDown=jr.bind(this),this._interceptControlUp=Yr.bind(this),this.domElement!==null&&this.connect(this.domElement),this.update()}connect(e){super.connect(e),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerUp),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener("keydown",this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(e){e.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=e}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(Hi),this.update(),this.state=L.NONE}update(e=null){const t=this.object.position;Z.copy(t).sub(this.target),Z.applyQuaternion(this._quat),this._spherical.setFromVector3(Z),this.autoRotate&&this.state===L.NONE&&this._rotateLeft(this._getAutoRotationAngle(e)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let i=this.minAzimuthAngle,n=this.maxAzimuthAngle;isFinite(i)&&isFinite(n)&&(i<-Math.PI?i+=J:i>Math.PI&&(i-=J),n<-Math.PI?n+=J:n>Math.PI&&(n-=J),i<=n?this._spherical.theta=Math.max(i,Math.min(n,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(i+n)/2?Math.max(i,this._spherical.theta):Math.min(n,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let r=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const s=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),r=s!=this._spherical.radius}if(Z.setFromSpherical(this._spherical),Z.applyQuaternion(this._quatInverse),t.copy(this.target).add(Z),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let s=null;if(this.object.isPerspectiveCamera){const o=Z.length();s=this._clampDistance(o*this._scale);const l=o-s;this.object.position.addScaledVector(this._dollyDirection,l),this.object.updateMatrixWorld(),r=!!l}else if(this.object.isOrthographicCamera){const o=new A.Vector3(this._mouse.x,this._mouse.y,0);o.unproject(this.object);const l=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),r=l!==this.object.zoom;const c=new A.Vector3(this._mouse.x,this._mouse.y,0);c.unproject(this.object),this.object.position.sub(c).add(o),this.object.updateMatrixWorld(),s=Z.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;s!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(s).add(this.object.position):(Tt.origin.copy(this.object.position),Tt.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(Tt.direction))<Rr?this.object.lookAt(this.target):(Ki.setFromNormalAndCoplanarPoint(this.object.up,this.target),Tt.intersectPlane(Ki,this.target))))}else if(this.object.isOrthographicCamera){const s=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),s!==this.object.zoom&&(this.object.updateProjectionMatrix(),r=!0)}return this._scale=1,this._performCursorZoom=!1,r||this._lastPosition.distanceToSquared(this.object.position)>Xt||8*(1-this._lastQuaternion.dot(this.object.quaternion))>Xt||this._lastTargetPosition.distanceToSquared(this.target)>Xt?(this.dispatchEvent(Hi),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(e){return e!==null?J/60*this.autoRotateSpeed*e:J/60/60*this.autoRotateSpeed}_getZoomScale(e){const t=Math.abs(e*.01);return Math.pow(.95,this.zoomSpeed*t)}_rotateLeft(e){this._sphericalDelta.theta-=e}_rotateUp(e){this._sphericalDelta.phi-=e}_panLeft(e,t){Z.setFromMatrixColumn(t,0),Z.multiplyScalar(-e),this._panOffset.add(Z)}_panUp(e,t){this.screenSpacePanning===!0?Z.setFromMatrixColumn(t,1):(Z.setFromMatrixColumn(t,0),Z.crossVectors(this.object.up,Z)),Z.multiplyScalar(e),this._panOffset.add(Z)}_pan(e,t){const i=this.domElement;if(this.object.isPerspectiveCamera){const n=this.object.position;Z.copy(n).sub(this.target);let r=Z.length();r*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*e*r/i.clientHeight,this.object.matrix),this._panUp(2*t*r/i.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(e*(this.object.right-this.object.left)/this.object.zoom/i.clientWidth,this.object.matrix),this._panUp(t*(this.object.top-this.object.bottom)/this.object.zoom/i.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(e,t){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const i=this.domElement.getBoundingClientRect(),n=e-i.left,r=t-i.top,s=i.width,o=i.height;this._mouse.x=n/s*2-1,this._mouse.y=-(r/o)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(e){return Math.max(this.minDistance,Math.min(this.maxDistance,e))}_handleMouseDownRotate(e){this._rotateStart.set(e.clientX,e.clientY)}_handleMouseDownDolly(e){this._updateZoomParameters(e.clientX,e.clientX),this._dollyStart.set(e.clientX,e.clientY)}_handleMouseDownPan(e){this._panStart.set(e.clientX,e.clientY)}_handleMouseMoveRotate(e){this._rotateEnd.set(e.clientX,e.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const t=this.domElement;this._rotateLeft(J*this._rotateDelta.x/t.clientHeight),this._rotateUp(J*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(e){this._dollyEnd.set(e.clientX,e.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(e){this._panEnd.set(e.clientX,e.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(e){this._updateZoomParameters(e.clientX,e.clientY),e.deltaY<0?this._dollyIn(this._getZoomScale(e.deltaY)):e.deltaY>0&&this._dollyOut(this._getZoomScale(e.deltaY)),this.update()}_handleKeyDown(e){let t=!1;switch(e.code){case this.keys.UP:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(J*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),t=!0;break;case this.keys.BOTTOM:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(-J*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),t=!0;break;case this.keys.LEFT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(J*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),t=!0;break;case this.keys.RIGHT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(-J*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),t=!0;break}t&&(e.preventDefault(),this.update())}_handleTouchStartRotate(e){if(this._pointers.length===1)this._rotateStart.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),i=.5*(e.pageX+t.x),n=.5*(e.pageY+t.y);this._rotateStart.set(i,n)}}_handleTouchStartPan(e){if(this._pointers.length===1)this._panStart.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),i=.5*(e.pageX+t.x),n=.5*(e.pageY+t.y);this._panStart.set(i,n)}}_handleTouchStartDolly(e){const t=this._getSecondPointerPosition(e),i=e.pageX-t.x,n=e.pageY-t.y,r=Math.sqrt(i*i+n*n);this._dollyStart.set(0,r)}_handleTouchStartDollyPan(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enablePan&&this._handleTouchStartPan(e)}_handleTouchStartDollyRotate(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enableRotate&&this._handleTouchStartRotate(e)}_handleTouchMoveRotate(e){if(this._pointers.length==1)this._rotateEnd.set(e.pageX,e.pageY);else{const i=this._getSecondPointerPosition(e),n=.5*(e.pageX+i.x),r=.5*(e.pageY+i.y);this._rotateEnd.set(n,r)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const t=this.domElement;this._rotateLeft(J*this._rotateDelta.x/t.clientHeight),this._rotateUp(J*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(e){if(this._pointers.length===1)this._panEnd.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),i=.5*(e.pageX+t.x),n=.5*(e.pageY+t.y);this._panEnd.set(i,n)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(e){const t=this._getSecondPointerPosition(e),i=e.pageX-t.x,n=e.pageY-t.y,r=Math.sqrt(i*i+n*n);this._dollyEnd.set(0,r),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const s=(e.pageX+t.x)*.5,o=(e.pageY+t.y)*.5;this._updateZoomParameters(s,o)}_handleTouchMoveDollyPan(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enablePan&&this._handleTouchMovePan(e)}_handleTouchMoveDollyRotate(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enableRotate&&this._handleTouchMoveRotate(e)}_addPointer(e){this._pointers.push(e.pointerId)}_removePointer(e){delete this._pointerPositions[e.pointerId];for(let t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId){this._pointers.splice(t,1);return}}_isTrackingPointer(e){for(let t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId)return!0;return!1}_trackPointer(e){let t=this._pointerPositions[e.pointerId];t===void 0&&(t=new A.Vector2,this._pointerPositions[e.pointerId]=t),t.set(e.pageX,e.pageY)}_getSecondPointerPosition(e){const t=e.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[t]}_customWheelEvent(e){const t=e.deltaMode,i={clientX:e.clientX,clientY:e.clientY,deltaY:e.deltaY};switch(t){case 1:i.deltaY*=16;break;case 2:i.deltaY*=100;break}return e.ctrlKey&&!this._controlActive&&(i.deltaY*=10),i}}function Lr(a){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(a.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerup",this._onPointerUp)),!this._isTrackingPointer(a)&&(this._addPointer(a),a.pointerType==="touch"?this._onTouchStart(a):this._onMouseDown(a)))}function kr(a){this.enabled!==!1&&(a.pointerType==="touch"?this._onTouchMove(a):this._onMouseMove(a))}function Ur(a){switch(this._removePointer(a),this._pointers.length){case 0:this.domElement.releasePointerCapture(a.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(Zi),this.state=L.NONE;break;case 1:const e=this._pointers[0],t=this._pointerPositions[e];this._onTouchStart({pointerId:e,pageX:t.x,pageY:t.y});break}}function Fr(a){let e;switch(a.button){case 0:e=this.mouseButtons.LEFT;break;case 1:e=this.mouseButtons.MIDDLE;break;case 2:e=this.mouseButtons.RIGHT;break;default:e=-1}switch(e){case A.MOUSE.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(a),this.state=L.DOLLY;break;case A.MOUSE.ROTATE:if(a.ctrlKey||a.metaKey||a.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(a),this.state=L.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(a),this.state=L.ROTATE}break;case A.MOUSE.PAN:if(a.ctrlKey||a.metaKey||a.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(a),this.state=L.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(a),this.state=L.PAN}break;default:this.state=L.NONE}this.state!==L.NONE&&this.dispatchEvent(Kt)}function zr(a){switch(this.state){case L.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(a);break;case L.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(a);break;case L.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(a);break}}function Nr(a){this.enabled===!1||this.enableZoom===!1||this.state!==L.NONE||(a.preventDefault(),this.dispatchEvent(Kt),this._handleMouseWheel(this._customWheelEvent(a)),this.dispatchEvent(Zi))}function $r(a){this.enabled!==!1&&this._handleKeyDown(a)}function Br(a){switch(this._trackPointer(a),this._pointers.length){case 1:switch(this.touches.ONE){case A.TOUCH.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(a),this.state=L.TOUCH_ROTATE;break;case A.TOUCH.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(a),this.state=L.TOUCH_PAN;break;default:this.state=L.NONE}break;case 2:switch(this.touches.TWO){case A.TOUCH.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(a),this.state=L.TOUCH_DOLLY_PAN;break;case A.TOUCH.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(a),this.state=L.TOUCH_DOLLY_ROTATE;break;default:this.state=L.NONE}break;default:this.state=L.NONE}this.state!==L.NONE&&this.dispatchEvent(Kt)}function Vr(a){switch(this._trackPointer(a),this.state){case L.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(a),this.update();break;case L.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(a),this.update();break;case L.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(a),this.update();break;case L.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(a),this.update();break;default:this.state=L.NONE}}function Gr(a){this.enabled!==!1&&a.preventDefault()}function jr(a){a.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function Yr(a){a.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function Ee(a){if(a===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function Xi(a,e){a.prototype=Object.create(e.prototype),a.prototype.constructor=a,a.__proto__=e}var oe={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},We={duration:.5,overwrite:!1,delay:0},Wt,X,z,pe=1e8,k=1/pe,qt=Math.PI*2,Hr=qt/4,Zr=0,Wi=Math.sqrt,Kr=Math.cos,Xr=Math.sin,K=function(e){return typeof e=="string"},V=function(e){return typeof e=="function"},we=function(e){return typeof e=="number"},Qt=function(e){return typeof e>"u"},_e=function(e){return typeof e=="object"},ee=function(e){return e!==!1},Jt=function(){return typeof window<"u"},Dt=function(e){return V(e)||K(e)},qi=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},W=Array.isArray,ei=/(?:-?\.?\d|\.)+/gi,Qi=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,qe=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,ti=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,Ji=/[+-]=-?[.\d]+/,en=/[^,'"\[\]\s]+/gi,Wr=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,$,ye,ii,ni,le={},Mt={},tn,nn=function(e){return(Mt=Je(e,le))&&ne},ri=function(e,t){return console.warn("Invalid property",e,"set to",t,"Missing plugin? gsap.registerPlugin()")},ht=function(e,t){return!t&&console.warn(e)},rn=function(e,t){return e&&(le[e]=t)&&Mt&&(Mt[e]=t)||le},ct=function(){return 0},qr={suppressEvents:!0,isStart:!0,kill:!1},Ot={suppressEvents:!0,kill:!1},Qr={suppressEvents:!0},si={},Se=[],ai={},sn,he={},oi={},an=30,Rt=[],li="",hi=function(e){var t=e[0],i,n;if(_e(t)||V(t)||(e=[e]),!(i=(t._gsap||{}).harness)){for(n=Rt.length;n--&&!Rt[n].targetTest(t););i=Rt[n]}for(n=e.length;n--;)e[n]&&(e[n]._gsap||(e[n]._gsap=new kn(e[n],i)))||e.splice(n,1);return e},Ue=function(e){return e._gsap||hi(me(e))[0]._gsap},on=function(e,t,i){return(i=e[t])&&V(i)?e[t]():Qt(i)&&e.getAttribute&&e.getAttribute(t)||i},te=function(e,t){return(e=e.split(",")).forEach(t)||e},j=function(e){return Math.round(e*1e5)/1e5||0},Y=function(e){return Math.round(e*1e7)/1e7||0},Qe=function(e,t){var i=t.charAt(0),n=parseFloat(t.substr(2));return e=parseFloat(e),i==="+"?e+n:i==="-"?e-n:i==="*"?e*n:e/n},Jr=function(e,t){for(var i=t.length,n=0;e.indexOf(t[n])<0&&++n<i;);return n<i},It=function(){var e=Se.length,t=Se.slice(0),i,n;for(ai={},Se.length=0,i=0;i<e;i++)n=t[i],n&&n._lazy&&(n.render(n._lazy[0],n._lazy[1],!0)._lazy=0)},ci=function(e){return!!(e._initted||e._startAt||e.add)},ln=function(e,t,i,n){Se.length&&!X&&It(),e.render(t,i,!!(X&&t<0&&ci(e))),Se.length&&!X&&It()},hn=function(e){var t=parseFloat(e);return(t||t===0)&&(e+"").match(en).length<2?t:K(e)?e.trim():e},cn=function(e){return e},ce=function(e,t){for(var i in t)i in e||(e[i]=t[i]);return e},es=function(e){return function(t,i){for(var n in i)n in t||n==="duration"&&e||n==="ease"||(t[n]=i[n])}},Je=function(e,t){for(var i in t)e[i]=t[i];return e},un=function a(e,t){for(var i in t)i!=="__proto__"&&i!=="constructor"&&i!=="prototype"&&(e[i]=_e(t[i])?a(e[i]||(e[i]={}),t[i]):t[i]);return e},Lt=function(e,t){var i={},n;for(n in e)n in t||(i[n]=e[n]);return i},ut=function(e){var t=e.parent||$,i=e.keyframes?es(W(e.keyframes)):ce;if(ee(e.inherit))for(;t;)i(e,t.vars.defaults),t=t.parent||t._dp;return e},ts=function(e,t){for(var i=e.length,n=i===t.length;n&&i--&&e[i]===t[i];);return i<0},dn=function(e,t,i,n,r){var s=e[n],o;if(r)for(o=t[r];s&&s[r]>o;)s=s._prev;return s?(t._next=s._next,s._next=t):(t._next=e[i],e[i]=t),t._next?t._next._prev=t:e[n]=t,t._prev=s,t.parent=t._dp=e,t},kt=function(e,t,i,n){i===void 0&&(i="_first"),n===void 0&&(n="_last");var r=t._prev,s=t._next;r?r._next=s:e[i]===t&&(e[i]=s),s?s._prev=r:e[n]===t&&(e[n]=r),t._next=t._prev=t.parent=null},Te=function(e,t){e.parent&&(!t||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},Fe=function(e,t){if(e&&(!t||t._end>e._dur||t._start<0))for(var i=e;i;)i._dirty=1,i=i.parent;return e},is=function(e){for(var t=e.parent;t&&t.parent;)t._dirty=1,t.totalDuration(),t=t.parent;return e},ui=function(e,t,i,n){return e._startAt&&(X?e._startAt.revert(Ot):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(t,!0,n))},ns=function a(e){return!e||e._ts&&a(e.parent)},pn=function(e){return e._repeat?et(e._tTime,e=e.duration()+e._rDelay)*e:0},et=function(e,t){var i=Math.floor(e=Y(e/t));return e&&i===e?i-1:i},Ut=function(e,t){return(e-t._start)*t._ts+(t._ts>=0?0:t._dirty?t.totalDuration():t._tDur)},Ft=function(e){return e._end=Y(e._start+(e._tDur/Math.abs(e._ts||e._rts||k)||0))},zt=function(e,t){var i=e._dp;return i&&i.smoothChildTiming&&e._ts&&(e._start=Y(i._time-(e._ts>0?t/e._ts:((e._dirty?e.totalDuration():e._tDur)-t)/-e._ts)),Ft(e),i._dirty||Fe(i,e)),e},fn=function(e,t){var i;if((t._time||!t._dur&&t._initted||t._start<e._time&&(t._dur||!t.add))&&(i=Ut(e.rawTime(),t),(!t._dur||pt(0,t.totalDuration(),i)-t._tTime>k)&&t.render(i,!0)),Fe(e,t)._dp&&e._initted&&e._time>=e._dur&&e._ts){if(e._dur<e.duration())for(i=e;i._dp;)i.rawTime()>=0&&i.totalTime(i._tTime),i=i._dp;e._zTime=-k}},xe=function(e,t,i,n){return t.parent&&Te(t),t._start=Y((we(i)?i:i||e!==$?fe(e,i,t):e._time)+t._delay),t._end=Y(t._start+(t.totalDuration()/Math.abs(t.timeScale())||0)),dn(e,t,"_first","_last",e._sort?"_start":0),di(t)||(e._recent=t),n||fn(e,t),e._ts<0&&zt(e,e._tTime),e},mn=function(e,t){return(le.ScrollTrigger||ri("scrollTrigger",t))&&le.ScrollTrigger.create(t,e)},gn=function(e,t,i,n,r){if(vi(e,t,r),!e._initted)return 1;if(!i&&e._pt&&!X&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&sn!==de.frame)return Se.push(e),e._lazy=[r,n],1},rs=function a(e){var t=e.parent;return t&&t._ts&&t._initted&&!t._lock&&(t.rawTime()<0||a(t))},di=function(e){var t=e.data;return t==="isFromStart"||t==="isStart"},ss=function(e,t,i,n){var r=e.ratio,s=t<0||!t&&(!e._start&&rs(e)&&!(!e._initted&&di(e))||(e._ts<0||e._dp._ts<0)&&!di(e))?0:1,o=e._rDelay,l=0,c,h,u;if(o&&e._repeat&&(l=pt(0,e._tDur,t),h=et(l,o),e._yoyo&&h&1&&(s=1-s),h!==et(e._tTime,o)&&(r=1-s,e.vars.repeatRefresh&&e._initted&&e.invalidate())),s!==r||X||n||e._zTime===k||!t&&e._zTime){if(!e._initted&&gn(e,t,n,i,l))return;for(u=e._zTime,e._zTime=t||(i?k:0),i||(i=t&&!u),e.ratio=s,e._from&&(s=1-s),e._time=0,e._tTime=l,c=e._pt;c;)c.r(s,c.d),c=c._next;t<0&&ui(e,t,i,!0),e._onUpdate&&!i&&ue(e,"onUpdate"),l&&e._repeat&&!i&&e.parent&&ue(e,"onRepeat"),(t>=e._tDur||t<0)&&e.ratio===s&&(s&&Te(e,1),!i&&!X&&(ue(e,s?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=t)},as=function(e,t,i){var n;if(i>t)for(n=e._first;n&&n._start<=i;){if(n.data==="isPause"&&n._start>t)return n;n=n._next}else for(n=e._last;n&&n._start>=i;){if(n.data==="isPause"&&n._start<t)return n;n=n._prev}},tt=function(e,t,i,n){var r=e._repeat,s=Y(t)||0,o=e._tTime/e._tDur;return o&&!n&&(e._time*=s/e._dur),e._dur=s,e._tDur=r?r<0?1e10:Y(s*(r+1)+e._rDelay*r):s,o>0&&!n&&zt(e,e._tTime=e._tDur*o),e.parent&&Ft(e),i||Fe(e.parent,e),e},_n=function(e){return e instanceof Q?Fe(e):tt(e,e._dur)},os={_start:0,endTime:ct,totalDuration:ct},fe=function a(e,t,i){var n=e.labels,r=e._recent||os,s=e.duration()>=pe?r.endTime(!1):e._dur,o,l,c;return K(t)&&(isNaN(t)||t in n)?(l=t.charAt(0),c=t.substr(-1)==="%",o=t.indexOf("="),l==="<"||l===">"?(o>=0&&(t=t.replace(/=/,"")),(l==="<"?r._start:r.endTime(r._repeat>=0))+(parseFloat(t.substr(1))||0)*(c?(o<0?r:i).totalDuration()/100:1)):o<0?(t in n||(n[t]=s),n[t]):(l=parseFloat(t.charAt(o-1)+t.substr(o+1)),c&&i&&(l=l/100*(W(i)?i[0]:i).totalDuration()),o>1?a(e,t.substr(0,o-1),i)+l:s+l)):t==null?s:+t},dt=function(e,t,i){var n=we(t[1]),r=(n?2:1)+(e<2?0:1),s=t[r],o,l;if(n&&(s.duration=t[1]),s.parent=i,e){for(o=s,l=i;l&&!("immediateRender"in o);)o=l.vars.defaults||{},l=ee(l.vars.inherit)&&l.parent;s.immediateRender=ee(o.immediateRender),e<2?s.runBackwards=1:s.startAt=t[r-1]}return new H(t[0],s,t[r+1])},De=function(e,t){return e||e===0?t(e):t},pt=function(e,t,i){return i<e?e:i>t?t:i},q=function(e,t){return!K(e)||!(t=Wr.exec(e))?"":t[1]},ls=function(e,t,i){return De(i,function(n){return pt(e,t,n)})},pi=[].slice,yn=function(e,t){return e&&_e(e)&&"length"in e&&(!t&&!e.length||e.length-1 in e&&_e(e[0]))&&!e.nodeType&&e!==ye},hs=function(e,t,i){return i===void 0&&(i=[]),e.forEach(function(n){var r;return K(n)&&!t||yn(n,1)?(r=i).push.apply(r,me(n)):i.push(n)})||i},me=function(e,t,i){return z&&!t&&z.selector?z.selector(e):K(e)&&!i&&(ii||!nt())?pi.call((t||ni).querySelectorAll(e),0):W(e)?hs(e,i):yn(e)?pi.call(e,0):e?[e]:[]},fi=function(e){return e=me(e)[0]||ht("Invalid scope")||{},function(t){var i=e.current||e.nativeElement||e;return me(t,i.querySelectorAll?i:i===e?ht("Invalid scope")||ni.createElement("div"):e)}},xn=function(e){return e.sort(function(){return .5-Math.random()})},bn=function(e){if(V(e))return e;var t=_e(e)?e:{each:e},i=ze(t.ease),n=t.from||0,r=parseFloat(t.base)||0,s={},o=n>0&&n<1,l=isNaN(n)||o,c=t.axis,h=n,u=n;return K(n)?h=u={center:.5,edges:.5,end:1}[n]||0:!o&&l&&(h=n[0],u=n[1]),function(p,m,f){var d=(f||t).length,g=s[d],_,y,x,v,b,C,E,P,w;if(!g){if(w=t.grid==="auto"?0:(t.grid||[1,pe])[1],!w){for(E=-pe;E<(E=f[w++].getBoundingClientRect().left)&&w<d;);w<d&&w--}for(g=s[d]=[],_=l?Math.min(w,d)*h-.5:n%w,y=w===pe?0:l?d*u/w-.5:n/w|0,E=0,P=pe,C=0;C<d;C++)x=C%w-_,v=y-(C/w|0),g[C]=b=c?Math.abs(c==="y"?v:x):Wi(x*x+v*v),b>E&&(E=b),b<P&&(P=b);n==="random"&&xn(g),g.max=E-P,g.min=P,g.v=d=(parseFloat(t.amount)||parseFloat(t.each)*(w>d?d-1:c?c==="y"?d/w:w:Math.max(w,d/w))||0)*(n==="edges"?-1:1),g.b=d<0?r-d:r,g.u=q(t.amount||t.each)||0,i=i&&d<0?Rn(i):i}return d=(g[p]-g.min)/g.max||0,Y(g.b+(i?i(d):d)*g.v)+g.u}},mi=function(e){var t=Math.pow(10,((e+"").split(".")[1]||"").length);return function(i){var n=Y(Math.round(parseFloat(i)/e)*e*t);return(n-n%1)/t+(we(i)?0:q(i))}},vn=function(e,t){var i=W(e),n,r;return!i&&_e(e)&&(n=i=e.radius||pe,e.values?(e=me(e.values),(r=!we(e[0]))&&(n*=n)):e=mi(e.increment)),De(t,i?V(e)?function(s){return r=e(s),Math.abs(r-s)<=n?r:s}:function(s){for(var o=parseFloat(r?s.x:s),l=parseFloat(r?s.y:0),c=pe,h=0,u=e.length,p,m;u--;)r?(p=e[u].x-o,m=e[u].y-l,p=p*p+m*m):p=Math.abs(e[u]-o),p<c&&(c=p,h=u);return h=!n||c<=n?e[h]:s,r||h===s||we(s)?h:h+q(s)}:mi(e))},En=function(e,t,i,n){return De(W(e)?!t:i===!0?!!(i=0):!n,function(){return W(e)?e[~~(Math.random()*e.length)]:(i=i||1e-5)&&(n=i<1?Math.pow(10,(i+"").length-2):1)&&Math.floor(Math.round((e-i/2+Math.random()*(t-e+i*.99))/i)*i*n)/n})},cs=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return function(n){return t.reduce(function(r,s){return s(r)},n)}},us=function(e,t){return function(i){return e(parseFloat(i))+(t||q(i))}},ds=function(e,t,i){return Cn(e,t,0,1,i)},wn=function(e,t,i){return De(i,function(n){return e[~~t(n)]})},ps=function a(e,t,i){var n=t-e;return W(e)?wn(e,a(0,e.length),t):De(i,function(r){return(n+(r-e)%n)%n+e})},fs=function a(e,t,i){var n=t-e,r=n*2;return W(e)?wn(e,a(0,e.length-1),t):De(i,function(s){return s=(r+(s-e)%r)%r||0,e+(s>n?r-s:s)})},ft=function(e){for(var t=0,i="",n,r,s,o;~(n=e.indexOf("random(",t));)s=e.indexOf(")",n),o=e.charAt(n+7)==="[",r=e.substr(n+7,s-n-7).match(o?en:ei),i+=e.substr(t,n-t)+En(o?r:+r[0],o?0:+r[1],+r[2]||1e-5),t=s+1;return i+e.substr(t,e.length-t)},Cn=function(e,t,i,n,r){var s=t-e,o=n-i;return De(r,function(l){return i+((l-e)/s*o||0)})},ms=function a(e,t,i,n){var r=isNaN(e+t)?0:function(m){return(1-m)*e+m*t};if(!r){var s=K(e),o={},l,c,h,u,p;if(i===!0&&(n=1)&&(i=null),s)e={p:e},t={p:t};else if(W(e)&&!W(t)){for(h=[],u=e.length,p=u-2,c=1;c<u;c++)h.push(a(e[c-1],e[c]));u--,r=function(f){f*=u;var d=Math.min(p,~~f);return h[d](f-d)},i=t}else n||(e=Je(W(e)?[]:{},e));if(!h){for(l in t)xi.call(o,e,l,"get",t[l]);r=function(f){return Ci(f,o)||(s?e.p:e)}}}return De(i,r)},Pn=function(e,t,i){var n=e.labels,r=pe,s,o,l;for(s in n)o=n[s]-t,o<0==!!i&&o&&r>(o=Math.abs(o))&&(l=s,r=o);return l},ue=function(e,t,i){var n=e.vars,r=n[t],s=z,o=e._ctx,l,c,h;if(r)return l=n[t+"Params"],c=n.callbackScope||e,i&&Se.length&&It(),o&&(z=o),h=l?r.apply(c,l):r.call(c),z=s,h},mt=function(e){return Te(e),e.scrollTrigger&&e.scrollTrigger.kill(!!X),e.progress()<1&&ue(e,"onInterrupt"),e},it,An=[],Sn=function(e){if(e)if(e=!e.name&&e.default||e,Jt()||e.headless){var t=e.name,i=V(e),n=t&&!i&&e.init?function(){this._props=[]}:e,r={init:ct,render:Ci,add:xi,kill:Os,modifier:Ms,rawVars:0},s={targetTest:0,get:0,getSetter:wi,aliases:{},register:0};if(nt(),e!==n){if(he[t])return;ce(n,ce(Lt(e,r),s)),Je(n.prototype,Je(r,Lt(e,s))),he[n.prop=t]=n,e.targetTest&&(Rt.push(n),si[t]=1),t=(t==="css"?"CSS":t.charAt(0).toUpperCase()+t.substr(1))+"Plugin"}rn(t,n),e.register&&e.register(ne,n,ie)}else An.push(e)},U=255,gt={aqua:[0,U,U],lime:[0,U,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,U],navy:[0,0,128],white:[U,U,U],olive:[128,128,0],yellow:[U,U,0],orange:[U,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[U,0,0],pink:[U,192,203],cyan:[0,U,U],transparent:[U,U,U,0]},gi=function(e,t,i){return e+=e<0?1:e>1?-1:0,(e*6<1?t+(i-t)*e*6:e<.5?i:e*3<2?t+(i-t)*(2/3-e)*6:t)*U+.5|0},Tn=function(e,t,i){var n=e?we(e)?[e>>16,e>>8&U,e&U]:0:gt.black,r,s,o,l,c,h,u,p,m,f;if(!n){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),gt[e])n=gt[e];else if(e.charAt(0)==="#"){if(e.length<6&&(r=e.charAt(1),s=e.charAt(2),o=e.charAt(3),e="#"+r+r+s+s+o+o+(e.length===5?e.charAt(4)+e.charAt(4):"")),e.length===9)return n=parseInt(e.substr(1,6),16),[n>>16,n>>8&U,n&U,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),n=[e>>16,e>>8&U,e&U]}else if(e.substr(0,3)==="hsl"){if(n=f=e.match(ei),!t)l=+n[0]%360/360,c=+n[1]/100,h=+n[2]/100,s=h<=.5?h*(c+1):h+c-h*c,r=h*2-s,n.length>3&&(n[3]*=1),n[0]=gi(l+1/3,r,s),n[1]=gi(l,r,s),n[2]=gi(l-1/3,r,s);else if(~e.indexOf("="))return n=e.match(Qi),i&&n.length<4&&(n[3]=1),n}else n=e.match(ei)||gt.transparent;n=n.map(Number)}return t&&!f&&(r=n[0]/U,s=n[1]/U,o=n[2]/U,u=Math.max(r,s,o),p=Math.min(r,s,o),h=(u+p)/2,u===p?l=c=0:(m=u-p,c=h>.5?m/(2-u-p):m/(u+p),l=u===r?(s-o)/m+(s<o?6:0):u===s?(o-r)/m+2:(r-s)/m+4,l*=60),n[0]=~~(l+.5),n[1]=~~(c*100+.5),n[2]=~~(h*100+.5)),i&&n.length<4&&(n[3]=1),n},Dn=function(e){var t=[],i=[],n=-1;return e.split(Me).forEach(function(r){var s=r.match(qe)||[];t.push.apply(t,s),i.push(n+=s.length+1)}),t.c=i,t},Mn=function(e,t,i){var n="",r=(e+n).match(Me),s=t?"hsla(":"rgba(",o=0,l,c,h,u;if(!r)return e;if(r=r.map(function(p){return(p=Tn(p,t,1))&&s+(t?p[0]+","+p[1]+"%,"+p[2]+"%,"+p[3]:p.join(","))+")"}),i&&(h=Dn(e),l=i.c,l.join(n)!==h.c.join(n)))for(c=e.replace(Me,"1").split(qe),u=c.length-1;o<u;o++)n+=c[o]+(~l.indexOf(o)?r.shift()||s+"0,0,0,0)":(h.length?h:r.length?r:i).shift());if(!c)for(c=e.split(Me),u=c.length-1;o<u;o++)n+=c[o]+r[o];return n+c[u]},Me=(function(){var a="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in gt)a+="|"+e+"\\b";return new RegExp(a+")","gi")})(),gs=/hsl[a]?\(/,On=function(e){var t=e.join(" "),i;if(Me.lastIndex=0,Me.test(t))return i=gs.test(t),e[1]=Mn(e[1],i),e[0]=Mn(e[0],i,Dn(e[1])),!0},_t,de=(function(){var a=Date.now,e=500,t=33,i=a(),n=i,r=1e3/240,s=r,o=[],l,c,h,u,p,m,f=function d(g){var _=a()-n,y=g===!0,x,v,b,C;if((_>e||_<0)&&(i+=_-t),n+=_,b=n-i,x=b-s,(x>0||y)&&(C=++u.frame,p=b-u.time*1e3,u.time=b=b/1e3,s+=x+(x>=r?4:r-x),v=1),y||(l=c(d)),v)for(m=0;m<o.length;m++)o[m](b,p,C,g)};return u={time:0,frame:0,tick:function(){f(!0)},deltaRatio:function(g){return p/(1e3/(g||60))},wake:function(){tn&&(!ii&&Jt()&&(ye=ii=window,ni=ye.document||{},le.gsap=ne,(ye.gsapVersions||(ye.gsapVersions=[])).push(ne.version),nn(Mt||ye.GreenSockGlobals||!ye.gsap&&ye||{}),An.forEach(Sn)),h=typeof requestAnimationFrame<"u"&&requestAnimationFrame,l&&u.sleep(),c=h||function(g){return setTimeout(g,s-u.time*1e3+1|0)},_t=1,f(2))},sleep:function(){(h?cancelAnimationFrame:clearTimeout)(l),_t=0,c=ct},lagSmoothing:function(g,_){e=g||1/0,t=Math.min(_||33,e)},fps:function(g){r=1e3/(g||240),s=u.time*1e3+r},add:function(g,_,y){var x=_?function(v,b,C,E){g(v,b,C,E),u.remove(x)}:g;return u.remove(g),o[y?"unshift":"push"](x),nt(),x},remove:function(g,_){~(_=o.indexOf(g))&&o.splice(_,1)&&m>=_&&m--},_listeners:o},u})(),nt=function(){return!_t&&de.wake()},M={},_s=/^[\d.\-M][\d.\-,\s]/,ys=/["']/g,xs=function(e){for(var t={},i=e.substr(1,e.length-3).split(":"),n=i[0],r=1,s=i.length,o,l,c;r<s;r++)l=i[r],o=r!==s-1?l.lastIndexOf(","):l.length,c=l.substr(0,o),t[n]=isNaN(c)?c.replace(ys,"").trim():+c,n=l.substr(o+1).trim();return t},bs=function(e){var t=e.indexOf("(")+1,i=e.indexOf(")"),n=e.indexOf("(",t);return e.substring(t,~n&&n<i?e.indexOf(")",i+1):i)},vs=function(e){var t=(e+"").split("("),i=M[t[0]];return i&&t.length>1&&i.config?i.config.apply(null,~e.indexOf("{")?[xs(t[1])]:bs(e).split(",").map(hn)):M._CE&&_s.test(e)?M._CE("",e):i},Rn=function(e){return function(t){return 1-e(1-t)}},In=function a(e,t){for(var i=e._first,n;i;)i instanceof Q?a(i,t):i.vars.yoyoEase&&(!i._yoyo||!i._repeat)&&i._yoyo!==t&&(i.timeline?a(i.timeline,t):(n=i._ease,i._ease=i._yEase,i._yEase=n,i._yoyo=t)),i=i._next},ze=function(e,t){return e&&(V(e)?e:M[e]||vs(e))||t},Ne=function(e,t,i,n){i===void 0&&(i=function(l){return 1-t(1-l)}),n===void 0&&(n=function(l){return l<.5?t(l*2)/2:1-t((1-l)*2)/2});var r={easeIn:t,easeOut:i,easeInOut:n},s;return te(e,function(o){M[o]=le[o]=r,M[s=o.toLowerCase()]=i;for(var l in r)M[s+(l==="easeIn"?".in":l==="easeOut"?".out":".inOut")]=M[o+"."+l]=r[l]}),r},Ln=function(e){return function(t){return t<.5?(1-e(1-t*2))/2:.5+e((t-.5)*2)/2}},_i=function a(e,t,i){var n=t>=1?t:1,r=(i||(e?.3:.45))/(t<1?t:1),s=r/qt*(Math.asin(1/n)||0),o=function(h){return h===1?1:n*Math.pow(2,-10*h)*Xr((h-s)*r)+1},l=e==="out"?o:e==="in"?function(c){return 1-o(1-c)}:Ln(o);return r=qt/r,l.config=function(c,h){return a(e,c,h)},l},yi=function a(e,t){t===void 0&&(t=1.70158);var i=function(s){return s?--s*s*((t+1)*s+t)+1:0},n=e==="out"?i:e==="in"?function(r){return 1-i(1-r)}:Ln(i);return n.config=function(r){return a(e,r)},n};te("Linear,Quad,Cubic,Quart,Quint,Strong",function(a,e){var t=e<5?e+1:e;Ne(a+",Power"+(t-1),e?function(i){return Math.pow(i,t)}:function(i){return i},function(i){return 1-Math.pow(1-i,t)},function(i){return i<.5?Math.pow(i*2,t)/2:1-Math.pow((1-i)*2,t)/2})}),M.Linear.easeNone=M.none=M.Linear.easeIn,Ne("Elastic",_i("in"),_i("out"),_i()),(function(a,e){var t=1/e,i=2*t,n=2.5*t,r=function(o){return o<t?a*o*o:o<i?a*Math.pow(o-1.5/e,2)+.75:o<n?a*(o-=2.25/e)*o+.9375:a*Math.pow(o-2.625/e,2)+.984375};Ne("Bounce",function(s){return 1-r(1-s)},r)})(7.5625,2.75),Ne("Expo",function(a){return Math.pow(2,10*(a-1))*a+a*a*a*a*a*a*(1-a)}),Ne("Circ",function(a){return-(Wi(1-a*a)-1)}),Ne("Sine",function(a){return a===1?1:-Kr(a*Hr)+1}),Ne("Back",yi("in"),yi("out"),yi()),M.SteppedEase=M.steps=le.SteppedEase={config:function(e,t){e===void 0&&(e=1);var i=1/e,n=e+(t?0:1),r=t?1:0,s=1-k;return function(o){return((n*pt(0,s,o)|0)+r)*i}}},We.ease=M["quad.out"],te("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(a){return li+=a+","+a+"Params,"});var kn=function(e,t){this.id=Zr++,e._gsap=this,this.target=e,this.harness=t,this.get=t?t.get:on,this.set=t?t.getSetter:wi},yt=(function(){function a(t){this.vars=t,this._delay=+t.delay||0,(this._repeat=t.repeat===1/0?-2:t.repeat||0)&&(this._rDelay=t.repeatDelay||0,this._yoyo=!!t.yoyo||!!t.yoyoEase),this._ts=1,tt(this,+t.duration,1,1),this.data=t.data,z&&(this._ctx=z,z.data.push(this)),_t||de.wake()}var e=a.prototype;return e.delay=function(i){return i||i===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+i-this._delay),this._delay=i,this):this._delay},e.duration=function(i){return arguments.length?this.totalDuration(this._repeat>0?i+(i+this._rDelay)*this._repeat:i):this.totalDuration()&&this._dur},e.totalDuration=function(i){return arguments.length?(this._dirty=0,tt(this,this._repeat<0?i:(i-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(i,n){if(nt(),!arguments.length)return this._tTime;var r=this._dp;if(r&&r.smoothChildTiming&&this._ts){for(zt(this,i),!r._dp||r.parent||fn(r,this);r&&r.parent;)r.parent._time!==r._start+(r._ts>=0?r._tTime/r._ts:(r.totalDuration()-r._tTime)/-r._ts)&&r.totalTime(r._tTime,!0),r=r.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&i<this._tDur||this._ts<0&&i>0||!this._tDur&&!i)&&xe(this._dp,this,this._start-this._delay)}return(this._tTime!==i||!this._dur&&!n||this._initted&&Math.abs(this._zTime)===k||!i&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=i),ln(this,i,n)),this},e.time=function(i,n){return arguments.length?this.totalTime(Math.min(this.totalDuration(),i+pn(this))%(this._dur+this._rDelay)||(i?this._dur:0),n):this._time},e.totalProgress=function(i,n){return arguments.length?this.totalTime(this.totalDuration()*i,n):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0},e.progress=function(i,n){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-i:i)+pn(this),n):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},e.iteration=function(i,n){var r=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(i-1)*r,n):this._repeat?et(this._tTime,r)+1:1},e.timeScale=function(i,n){if(!arguments.length)return this._rts===-k?0:this._rts;if(this._rts===i)return this;var r=this.parent&&this._ts?Ut(this.parent._time,this):this._tTime;return this._rts=+i||0,this._ts=this._ps||i===-k?0:this._rts,this.totalTime(pt(-Math.abs(this._delay),this.totalDuration(),r),n!==!1),Ft(this),is(this)},e.paused=function(i){return arguments.length?(this._ps!==i&&(this._ps=i,i?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(nt(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==k&&(this._tTime-=k)))),this):this._ps},e.startTime=function(i){if(arguments.length){this._start=i;var n=this.parent||this._dp;return n&&(n._sort||!this.parent)&&xe(n,this,i-this._delay),this}return this._start},e.endTime=function(i){return this._start+(ee(i)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},e.rawTime=function(i){var n=this.parent||this._dp;return n?i&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?Ut(n.rawTime(i),this):this._tTime:this._tTime},e.revert=function(i){i===void 0&&(i=Qr);var n=X;return X=i,ci(this)&&(this.timeline&&this.timeline.revert(i),this.totalTime(-.01,i.suppressEvents)),this.data!=="nested"&&i.kill!==!1&&this.kill(),X=n,this},e.globalTime=function(i){for(var n=this,r=arguments.length?i:n.rawTime();n;)r=n._start+r/(Math.abs(n._ts)||1),n=n._dp;return!this.parent&&this._sat?this._sat.globalTime(i):r},e.repeat=function(i){return arguments.length?(this._repeat=i===1/0?-2:i,_n(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(i){if(arguments.length){var n=this._time;return this._rDelay=i,_n(this),n?this.time(n):this}return this._rDelay},e.yoyo=function(i){return arguments.length?(this._yoyo=i,this):this._yoyo},e.seek=function(i,n){return this.totalTime(fe(this,i),ee(n))},e.restart=function(i,n){return this.play().totalTime(i?-this._delay:0,ee(n)),this._dur||(this._zTime=-k),this},e.play=function(i,n){return i!=null&&this.seek(i,n),this.reversed(!1).paused(!1)},e.reverse=function(i,n){return i!=null&&this.seek(i||this.totalDuration(),n),this.reversed(!0).paused(!1)},e.pause=function(i,n){return i!=null&&this.seek(i,n),this.paused(!0)},e.resume=function(){return this.paused(!1)},e.reversed=function(i){return arguments.length?(!!i!==this.reversed()&&this.timeScale(-this._rts||(i?-k:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-k,this},e.isActive=function(){var i=this.parent||this._dp,n=this._start,r;return!!(!i||this._ts&&this._initted&&i.isActive()&&(r=i.rawTime(!0))>=n&&r<this.endTime(!0)-k)},e.eventCallback=function(i,n,r){var s=this.vars;return arguments.length>1?(n?(s[i]=n,r&&(s[i+"Params"]=r),i==="onUpdate"&&(this._onUpdate=n)):delete s[i],this):s[i]},e.then=function(i){var n=this;return new Promise(function(r){var s=V(i)?i:cn,o=function(){var c=n.then;n.then=null,V(s)&&(s=s(n))&&(s.then||s===n)&&(n.then=c),r(s),n.then=c};n._initted&&n.totalProgress()===1&&n._ts>=0||!n._tTime&&n._ts<0?o():n._prom=o})},e.kill=function(){mt(this)},a})();ce(yt.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-k,_prom:0,_ps:!1,_rts:1});var Q=(function(a){Xi(e,a);function e(i,n){var r;return i===void 0&&(i={}),r=a.call(this,i)||this,r.labels={},r.smoothChildTiming=!!i.smoothChildTiming,r.autoRemoveChildren=!!i.autoRemoveChildren,r._sort=ee(i.sortChildren),$&&xe(i.parent||$,Ee(r),n),i.reversed&&r.reverse(),i.paused&&r.paused(!0),i.scrollTrigger&&mn(Ee(r),i.scrollTrigger),r}var t=e.prototype;return t.to=function(n,r,s){return dt(0,arguments,this),this},t.from=function(n,r,s){return dt(1,arguments,this),this},t.fromTo=function(n,r,s,o){return dt(2,arguments,this),this},t.set=function(n,r,s){return r.duration=0,r.parent=this,ut(r).repeatDelay||(r.repeat=0),r.immediateRender=!!r.immediateRender,new H(n,r,fe(this,s),1),this},t.call=function(n,r,s){return xe(this,H.delayedCall(0,n,r),s)},t.staggerTo=function(n,r,s,o,l,c,h){return s.duration=r,s.stagger=s.stagger||o,s.onComplete=c,s.onCompleteParams=h,s.parent=this,new H(n,s,fe(this,l)),this},t.staggerFrom=function(n,r,s,o,l,c,h){return s.runBackwards=1,ut(s).immediateRender=ee(s.immediateRender),this.staggerTo(n,r,s,o,l,c,h)},t.staggerFromTo=function(n,r,s,o,l,c,h,u){return o.startAt=s,ut(o).immediateRender=ee(o.immediateRender),this.staggerTo(n,r,o,l,c,h,u)},t.render=function(n,r,s){var o=this._time,l=this._dirty?this.totalDuration():this._tDur,c=this._dur,h=n<=0?0:Y(n),u=this._zTime<0!=n<0&&(this._initted||!c),p,m,f,d,g,_,y,x,v,b,C,E;if(this!==$&&h>l&&n>=0&&(h=l),h!==this._tTime||s||u){if(o!==this._time&&c&&(h+=this._time-o,n+=this._time-o),p=h,v=this._start,x=this._ts,_=!x,u&&(c||(o=this._zTime),(n||!r)&&(this._zTime=n)),this._repeat){if(C=this._yoyo,g=c+this._rDelay,this._repeat<-1&&n<0)return this.totalTime(g*100+n,r,s);if(p=Y(h%g),h===l?(d=this._repeat,p=c):(b=Y(h/g),d=~~b,d&&d===b&&(p=c,d--),p>c&&(p=c)),b=et(this._tTime,g),!o&&this._tTime&&b!==d&&this._tTime-b*g-this._dur<=0&&(b=d),C&&d&1&&(p=c-p,E=1),d!==b&&!this._lock){var P=C&&b&1,w=P===(C&&d&1);if(d<b&&(P=!P),o=P?0:h%c?c:h,this._lock=1,this.render(o||(E?0:Y(d*g)),r,!c)._lock=0,this._tTime=h,!r&&this.parent&&ue(this,"onRepeat"),this.vars.repeatRefresh&&!E&&(this.invalidate()._lock=1),o&&o!==this._time||_!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(c=this._dur,l=this._tDur,w&&(this._lock=2,o=P?c:-1e-4,this.render(o,!0),this.vars.repeatRefresh&&!E&&this.invalidate()),this._lock=0,!this._ts&&!_)return this;In(this,E)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(y=as(this,Y(o),Y(p)),y&&(h-=p-(p=y._start))),this._tTime=h,this._time=p,this._act=!x,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=n,o=0),!o&&h&&!r&&!b&&(ue(this,"onStart"),this._tTime!==h))return this;if(p>=o&&n>=0)for(m=this._first;m;){if(f=m._next,(m._act||p>=m._start)&&m._ts&&y!==m){if(m.parent!==this)return this.render(n,r,s);if(m.render(m._ts>0?(p-m._start)*m._ts:(m._dirty?m.totalDuration():m._tDur)+(p-m._start)*m._ts,r,s),p!==this._time||!this._ts&&!_){y=0,f&&(h+=this._zTime=-k);break}}m=f}else{m=this._last;for(var T=n<0?n:p;m;){if(f=m._prev,(m._act||T<=m._end)&&m._ts&&y!==m){if(m.parent!==this)return this.render(n,r,s);if(m.render(m._ts>0?(T-m._start)*m._ts:(m._dirty?m.totalDuration():m._tDur)+(T-m._start)*m._ts,r,s||X&&ci(m)),p!==this._time||!this._ts&&!_){y=0,f&&(h+=this._zTime=T?-k:k);break}}m=f}}if(y&&!r&&(this.pause(),y.render(p>=o?0:-k)._zTime=p>=o?1:-1,this._ts))return this._start=v,Ft(this),this.render(n,r,s);this._onUpdate&&!r&&ue(this,"onUpdate",!0),(h===l&&this._tTime>=this.totalDuration()||!h&&o)&&(v===this._start||Math.abs(x)!==Math.abs(this._ts))&&(this._lock||((n||!c)&&(h===l&&this._ts>0||!h&&this._ts<0)&&Te(this,1),!r&&!(n<0&&!o)&&(h||o||!l)&&(ue(this,h===l&&n>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(h<l&&this.timeScale()>0)&&this._prom())))}return this},t.add=function(n,r){var s=this;if(we(r)||(r=fe(this,r,n)),!(n instanceof yt)){if(W(n))return n.forEach(function(o){return s.add(o,r)}),this;if(K(n))return this.addLabel(n,r);if(V(n))n=H.delayedCall(0,n);else return this}return this!==n?xe(this,n,r):this},t.getChildren=function(n,r,s,o){n===void 0&&(n=!0),r===void 0&&(r=!0),s===void 0&&(s=!0),o===void 0&&(o=-pe);for(var l=[],c=this._first;c;)c._start>=o&&(c instanceof H?r&&l.push(c):(s&&l.push(c),n&&l.push.apply(l,c.getChildren(!0,r,s)))),c=c._next;return l},t.getById=function(n){for(var r=this.getChildren(1,1,1),s=r.length;s--;)if(r[s].vars.id===n)return r[s]},t.remove=function(n){return K(n)?this.removeLabel(n):V(n)?this.killTweensOf(n):(n.parent===this&&kt(this,n),n===this._recent&&(this._recent=this._last),Fe(this))},t.totalTime=function(n,r){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Y(de.time-(this._ts>0?n/this._ts:(this.totalDuration()-n)/-this._ts))),a.prototype.totalTime.call(this,n,r),this._forcing=0,this):this._tTime},t.addLabel=function(n,r){return this.labels[n]=fe(this,r),this},t.removeLabel=function(n){return delete this.labels[n],this},t.addPause=function(n,r,s){var o=H.delayedCall(0,r||ct,s);return o.data="isPause",this._hasPause=1,xe(this,o,fe(this,n))},t.removePause=function(n){var r=this._first;for(n=fe(this,n);r;)r._start===n&&r.data==="isPause"&&Te(r),r=r._next},t.killTweensOf=function(n,r,s){for(var o=this.getTweensOf(n,s),l=o.length;l--;)Oe!==o[l]&&o[l].kill(n,r);return this},t.getTweensOf=function(n,r){for(var s=[],o=me(n),l=this._first,c=we(r),h;l;)l instanceof H?Jr(l._targets,o)&&(c?(!Oe||l._initted&&l._ts)&&l.globalTime(0)<=r&&l.globalTime(l.totalDuration())>r:!r||l.isActive())&&s.push(l):(h=l.getTweensOf(o,r)).length&&s.push.apply(s,h),l=l._next;return s},t.tweenTo=function(n,r){r=r||{};var s=this,o=fe(s,n),l=r,c=l.startAt,h=l.onStart,u=l.onStartParams,p=l.immediateRender,m,f=H.to(s,ce({ease:r.ease||"none",lazy:!1,immediateRender:!1,time:o,overwrite:"auto",duration:r.duration||Math.abs((o-(c&&"time"in c?c.time:s._time))/s.timeScale())||k,onStart:function(){if(s.pause(),!m){var g=r.duration||Math.abs((o-(c&&"time"in c?c.time:s._time))/s.timeScale());f._dur!==g&&tt(f,g,0,1).render(f._time,!0,!0),m=1}h&&h.apply(f,u||[])}},r));return p?f.render(0):f},t.tweenFromTo=function(n,r,s){return this.tweenTo(r,ce({startAt:{time:fe(this,n)}},s))},t.recent=function(){return this._recent},t.nextLabel=function(n){return n===void 0&&(n=this._time),Pn(this,fe(this,n))},t.previousLabel=function(n){return n===void 0&&(n=this._time),Pn(this,fe(this,n),1)},t.currentLabel=function(n){return arguments.length?this.seek(n,!0):this.previousLabel(this._time+k)},t.shiftChildren=function(n,r,s){s===void 0&&(s=0);for(var o=this._first,l=this.labels,c;o;)o._start>=s&&(o._start+=n,o._end+=n),o=o._next;if(r)for(c in l)l[c]>=s&&(l[c]+=n);return Fe(this)},t.invalidate=function(n){var r=this._first;for(this._lock=0;r;)r.invalidate(n),r=r._next;return a.prototype.invalidate.call(this,n)},t.clear=function(n){n===void 0&&(n=!0);for(var r=this._first,s;r;)s=r._next,this.remove(r),r=s;return this._dp&&(this._time=this._tTime=this._pTime=0),n&&(this.labels={}),Fe(this)},t.totalDuration=function(n){var r=0,s=this,o=s._last,l=pe,c,h,u;if(arguments.length)return s.timeScale((s._repeat<0?s.duration():s.totalDuration())/(s.reversed()?-n:n));if(s._dirty){for(u=s.parent;o;)c=o._prev,o._dirty&&o.totalDuration(),h=o._start,h>l&&s._sort&&o._ts&&!s._lock?(s._lock=1,xe(s,o,h-o._delay,1)._lock=0):l=h,h<0&&o._ts&&(r-=h,(!u&&!s._dp||u&&u.smoothChildTiming)&&(s._start+=h/s._ts,s._time-=h,s._tTime-=h),s.shiftChildren(-h,!1,-1/0),l=0),o._end>r&&o._ts&&(r=o._end),o=c;tt(s,s===$&&s._time>r?s._time:r,1,1),s._dirty=0}return s._tDur},e.updateRoot=function(n){if($._ts&&(ln($,Ut(n,$)),sn=de.frame),de.frame>=an){an+=oe.autoSleep||120;var r=$._first;if((!r||!r._ts)&&oe.autoSleep&&de._listeners.length<2){for(;r&&!r._ts;)r=r._next;r||de.sleep()}}},e})(yt);ce(Q.prototype,{_lock:0,_hasPause:0,_forcing:0});var Es=function(e,t,i,n,r,s,o){var l=new ie(this._pt,e,t,0,1,Bn,null,r),c=0,h=0,u,p,m,f,d,g,_,y;for(l.b=i,l.e=n,i+="",n+="",(_=~n.indexOf("random("))&&(n=ft(n)),s&&(y=[i,n],s(y,e,t),i=y[0],n=y[1]),p=i.match(ti)||[];u=ti.exec(n);)f=u[0],d=n.substring(c,u.index),m?m=(m+1)%5:d.substr(-5)==="rgba("&&(m=1),f!==p[h++]&&(g=parseFloat(p[h-1])||0,l._pt={_next:l._pt,p:d||h===1?d:",",s:g,c:f.charAt(1)==="="?Qe(g,f)-g:parseFloat(f)-g,m:m&&m<4?Math.round:0},c=ti.lastIndex);return l.c=c<n.length?n.substring(c,n.length):"",l.fp=o,(Ji.test(n)||_)&&(l.e=0),this._pt=l,l},xi=function(e,t,i,n,r,s,o,l,c,h){V(n)&&(n=n(r||0,e,s));var u=e[t],p=i!=="get"?i:V(u)?c?e[t.indexOf("set")||!V(e["get"+t.substr(3)])?t:"get"+t.substr(3)](c):e[t]():u,m=V(u)?c?Ss:Nn:Ei,f;if(K(n)&&(~n.indexOf("random(")&&(n=ft(n)),n.charAt(1)==="="&&(f=Qe(p,n)+(q(p)||0),(f||f===0)&&(n=f))),!h||p!==n||bi)return!isNaN(p*n)&&n!==""?(f=new ie(this._pt,e,t,+p||0,n-(p||0),typeof u=="boolean"?Ds:$n,0,m),c&&(f.fp=c),o&&f.modifier(o,this,e),this._pt=f):(!u&&!(t in e)&&ri(t,n),Es.call(this,e,t,p,n,m,l||oe.stringFilter,c))},ws=function(e,t,i,n,r){if(V(e)&&(e=xt(e,r,t,i,n)),!_e(e)||e.style&&e.nodeType||W(e)||qi(e))return K(e)?xt(e,r,t,i,n):e;var s={},o;for(o in e)s[o]=xt(e[o],r,t,i,n);return s},Un=function(e,t,i,n,r,s){var o,l,c,h;if(he[e]&&(o=new he[e]).init(r,o.rawVars?t[e]:ws(t[e],n,r,s,i),i,n,s)!==!1&&(i._pt=l=new ie(i._pt,r,e,0,1,o.render,o,0,o.priority),i!==it))for(c=i._ptLookup[i._targets.indexOf(r)],h=o._props.length;h--;)c[o._props[h]]=l;return o},Oe,bi,vi=function a(e,t,i){var n=e.vars,r=n.ease,s=n.startAt,o=n.immediateRender,l=n.lazy,c=n.onUpdate,h=n.runBackwards,u=n.yoyoEase,p=n.keyframes,m=n.autoRevert,f=e._dur,d=e._startAt,g=e._targets,_=e.parent,y=_&&_.data==="nested"?_.vars.targets:g,x=e._overwrite==="auto"&&!Wt,v=e.timeline,b,C,E,P,w,T,O,S,R,I,G,N,F;if(v&&(!p||!r)&&(r="none"),e._ease=ze(r,We.ease),e._yEase=u?Rn(ze(u===!0?r:u,We.ease)):0,u&&e._yoyo&&!e._repeat&&(u=e._yEase,e._yEase=e._ease,e._ease=u),e._from=!v&&!!n.runBackwards,!v||p&&!n.stagger){if(S=g[0]?Ue(g[0]).harness:0,N=S&&n[S.prop],b=Lt(n,si),d&&(d._zTime<0&&d.progress(1),t<0&&h&&o&&!m?d.render(-1,!0):d.revert(h&&f?Ot:qr),d._lazy=0),s){if(Te(e._startAt=H.set(g,ce({data:"isStart",overwrite:!1,parent:_,immediateRender:!0,lazy:!d&&ee(l),startAt:null,delay:0,onUpdate:c&&function(){return ue(e,"onUpdate")},stagger:0},s))),e._startAt._dp=0,e._startAt._sat=e,t<0&&(X||!o&&!m)&&e._startAt.revert(Ot),o&&f&&t<=0&&i<=0){t&&(e._zTime=t);return}}else if(h&&f&&!d){if(t&&(o=!1),E=ce({overwrite:!1,data:"isFromStart",lazy:o&&!d&&ee(l),immediateRender:o,stagger:0,parent:_},b),N&&(E[S.prop]=N),Te(e._startAt=H.set(g,E)),e._startAt._dp=0,e._startAt._sat=e,t<0&&(X?e._startAt.revert(Ot):e._startAt.render(-1,!0)),e._zTime=t,!o)a(e._startAt,k,k);else if(!t)return}for(e._pt=e._ptCache=0,l=f&&ee(l)||l&&!f,C=0;C<g.length;C++){if(w=g[C],O=w._gsap||hi(g)[C]._gsap,e._ptLookup[C]=I={},ai[O.id]&&Se.length&&It(),G=y===g?C:y.indexOf(w),S&&(R=new S).init(w,N||b,e,G,y)!==!1&&(e._pt=P=new ie(e._pt,w,R.name,0,1,R.render,R,0,R.priority),R._props.forEach(function(se){I[se]=P}),R.priority&&(T=1)),!S||N)for(E in b)he[E]&&(R=Un(E,b,e,G,w,y))?R.priority&&(T=1):I[E]=P=xi.call(e,w,E,"get",b[E],G,y,0,n.stringFilter);e._op&&e._op[C]&&e.kill(w,e._op[C]),x&&e._pt&&(Oe=e,$.killTweensOf(w,I,e.globalTime(t)),F=!e.parent,Oe=0),e._pt&&l&&(ai[O.id]=1)}T&&Vn(e),e._onInit&&e._onInit(e)}e._onUpdate=c,e._initted=(!e._op||e._pt)&&!F,p&&t<=0&&v.render(pe,!0,!0)},Cs=function(e,t,i,n,r,s,o,l){var c=(e._pt&&e._ptCache||(e._ptCache={}))[t],h,u,p,m;if(!c)for(c=e._ptCache[t]=[],p=e._ptLookup,m=e._targets.length;m--;){if(h=p[m][t],h&&h.d&&h.d._pt)for(h=h.d._pt;h&&h.p!==t&&h.fp!==t;)h=h._next;if(!h)return bi=1,e.vars[t]="+=0",vi(e,o),bi=0,l?ht(t+" not eligible for reset"):1;c.push(h)}for(m=c.length;m--;)u=c[m],h=u._pt||u,h.s=(n||n===0)&&!r?n:h.s+(n||0)+s*h.c,h.c=i-h.s,u.e&&(u.e=j(i)+q(u.e)),u.b&&(u.b=h.s+q(u.b))},Ps=function(e,t){var i=e[0]?Ue(e[0]).harness:0,n=i&&i.aliases,r,s,o,l;if(!n)return t;r=Je({},t);for(s in n)if(s in r)for(l=n[s].split(","),o=l.length;o--;)r[l[o]]=r[s];return r},As=function(e,t,i,n){var r=t.ease||n||"power1.inOut",s,o;if(W(t))o=i[e]||(i[e]=[]),t.forEach(function(l,c){return o.push({t:c/(t.length-1)*100,v:l,e:r})});else for(s in t)o=i[s]||(i[s]=[]),s==="ease"||o.push({t:parseFloat(e),v:t[s],e:r})},xt=function(e,t,i,n,r){return V(e)?e.call(t,i,n,r):K(e)&&~e.indexOf("random(")?ft(e):e},Fn=li+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",zn={};te(Fn+",id,stagger,delay,duration,paused,scrollTrigger",function(a){return zn[a]=1});var H=(function(a){Xi(e,a);function e(i,n,r,s){var o;typeof n=="number"&&(r.duration=n,n=r,r=null),o=a.call(this,s?n:ut(n))||this;var l=o.vars,c=l.duration,h=l.delay,u=l.immediateRender,p=l.stagger,m=l.overwrite,f=l.keyframes,d=l.defaults,g=l.scrollTrigger,_=l.yoyoEase,y=n.parent||$,x=(W(i)||qi(i)?we(i[0]):"length"in n)?[i]:me(i),v,b,C,E,P,w,T,O;if(o._targets=x.length?hi(x):ht("GSAP target "+i+" not found. https://gsap.com",!oe.nullTargetWarn)||[],o._ptLookup=[],o._overwrite=m,f||p||Dt(c)||Dt(h)){if(n=o.vars,v=o.timeline=new Q({data:"nested",defaults:d||{},targets:y&&y.data==="nested"?y.vars.targets:x}),v.kill(),v.parent=v._dp=Ee(o),v._start=0,p||Dt(c)||Dt(h)){if(E=x.length,T=p&&bn(p),_e(p))for(P in p)~Fn.indexOf(P)&&(O||(O={}),O[P]=p[P]);for(b=0;b<E;b++)C=Lt(n,zn),C.stagger=0,_&&(C.yoyoEase=_),O&&Je(C,O),w=x[b],C.duration=+xt(c,Ee(o),b,w,x),C.delay=(+xt(h,Ee(o),b,w,x)||0)-o._delay,!p&&E===1&&C.delay&&(o._delay=h=C.delay,o._start+=h,C.delay=0),v.to(w,C,T?T(b,w,x):0),v._ease=M.none;v.duration()?c=h=0:o.timeline=0}else if(f){ut(ce(v.vars.defaults,{ease:"none"})),v._ease=ze(f.ease||n.ease||"none");var S=0,R,I,G;if(W(f))f.forEach(function(N){return v.to(x,N,">")}),v.duration();else{C={};for(P in f)P==="ease"||P==="easeEach"||As(P,f[P],C,f.easeEach);for(P in C)for(R=C[P].sort(function(N,F){return N.t-F.t}),S=0,b=0;b<R.length;b++)I=R[b],G={ease:I.e,duration:(I.t-(b?R[b-1].t:0))/100*c},G[P]=I.v,v.to(x,G,S),S+=G.duration;v.duration()<c&&v.to({},{duration:c-v.duration()})}}c||o.duration(c=v.duration())}else o.timeline=0;return m===!0&&!Wt&&(Oe=Ee(o),$.killTweensOf(x),Oe=0),xe(y,Ee(o),r),n.reversed&&o.reverse(),n.paused&&o.paused(!0),(u||!c&&!f&&o._start===Y(y._time)&&ee(u)&&ns(Ee(o))&&y.data!=="nested")&&(o._tTime=-k,o.render(Math.max(0,-h)||0)),g&&mn(Ee(o),g),o}var t=e.prototype;return t.render=function(n,r,s){var o=this._time,l=this._tDur,c=this._dur,h=n<0,u=n>l-k&&!h?l:n<k?0:n,p,m,f,d,g,_,y,x,v;if(!c)ss(this,n,r,s);else if(u!==this._tTime||!n||s||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==h||this._lazy){if(p=u,x=this.timeline,this._repeat){if(d=c+this._rDelay,this._repeat<-1&&h)return this.totalTime(d*100+n,r,s);if(p=Y(u%d),u===l?(f=this._repeat,p=c):(g=Y(u/d),f=~~g,f&&f===g?(p=c,f--):p>c&&(p=c)),_=this._yoyo&&f&1,_&&(v=this._yEase,p=c-p),g=et(this._tTime,d),p===o&&!s&&this._initted&&f===g)return this._tTime=u,this;f!==g&&(x&&this._yEase&&In(x,_),this.vars.repeatRefresh&&!_&&!this._lock&&p!==d&&this._initted&&(this._lock=s=1,this.render(Y(d*f),!0).invalidate()._lock=0))}if(!this._initted){if(gn(this,h?n:p,s,r,u))return this._tTime=0,this;if(o!==this._time&&!(s&&this.vars.repeatRefresh&&f!==g))return this;if(c!==this._dur)return this.render(n,r,s)}if(this._tTime=u,this._time=p,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=y=(v||this._ease)(p/c),this._from&&(this.ratio=y=1-y),!o&&u&&!r&&!g&&(ue(this,"onStart"),this._tTime!==u))return this;for(m=this._pt;m;)m.r(y,m.d),m=m._next;x&&x.render(n<0?n:x._dur*x._ease(p/this._dur),r,s)||this._startAt&&(this._zTime=n),this._onUpdate&&!r&&(h&&ui(this,n,r,s),ue(this,"onUpdate")),this._repeat&&f!==g&&this.vars.onRepeat&&!r&&this.parent&&ue(this,"onRepeat"),(u===this._tDur||!u)&&this._tTime===u&&(h&&!this._onUpdate&&ui(this,n,!0,!0),(n||!c)&&(u===this._tDur&&this._ts>0||!u&&this._ts<0)&&Te(this,1),!r&&!(h&&!o)&&(u||o||_)&&(ue(this,u===l?"onComplete":"onReverseComplete",!0),this._prom&&!(u<l&&this.timeScale()>0)&&this._prom()))}return this},t.targets=function(){return this._targets},t.invalidate=function(n){return(!n||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(n),a.prototype.invalidate.call(this,n)},t.resetTo=function(n,r,s,o,l){_t||de.wake(),this._ts||this.play();var c=Math.min(this._dur,(this._dp._time-this._start)*this._ts),h;return this._initted||vi(this,c),h=this._ease(c/this._dur),Cs(this,n,r,s,o,h,c,l)?this.resetTo(n,r,s,o,1):(zt(this,0),this.parent||dn(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},t.kill=function(n,r){if(r===void 0&&(r="all"),!n&&(!r||r==="all"))return this._lazy=this._pt=0,this.parent?mt(this):this.scrollTrigger&&this.scrollTrigger.kill(!!X),this;if(this.timeline){var s=this.timeline.totalDuration();return this.timeline.killTweensOf(n,r,Oe&&Oe.vars.overwrite!==!0)._first||mt(this),this.parent&&s!==this.timeline.totalDuration()&&tt(this,this._dur*this.timeline._tDur/s,0,1),this}var o=this._targets,l=n?me(n):o,c=this._ptLookup,h=this._pt,u,p,m,f,d,g,_;if((!r||r==="all")&&ts(o,l))return r==="all"&&(this._pt=0),mt(this);for(u=this._op=this._op||[],r!=="all"&&(K(r)&&(d={},te(r,function(y){return d[y]=1}),r=d),r=Ps(o,r)),_=o.length;_--;)if(~l.indexOf(o[_])){p=c[_],r==="all"?(u[_]=r,f=p,m={}):(m=u[_]=u[_]||{},f=r);for(d in f)g=p&&p[d],g&&((!("kill"in g.d)||g.d.kill(d)===!0)&&kt(this,g,"_pt"),delete p[d]),m!=="all"&&(m[d]=1)}return this._initted&&!this._pt&&h&&mt(this),this},e.to=function(n,r){return new e(n,r,arguments[2])},e.from=function(n,r){return dt(1,arguments)},e.delayedCall=function(n,r,s,o){return new e(r,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:n,onComplete:r,onReverseComplete:r,onCompleteParams:s,onReverseCompleteParams:s,callbackScope:o})},e.fromTo=function(n,r,s){return dt(2,arguments)},e.set=function(n,r){return r.duration=0,r.repeatDelay||(r.repeat=0),new e(n,r)},e.killTweensOf=function(n,r,s){return $.killTweensOf(n,r,s)},e})(yt);ce(H.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),te("staggerTo,staggerFrom,staggerFromTo",function(a){H[a]=function(){var e=new Q,t=pi.call(arguments,0);return t.splice(a==="staggerFromTo"?5:4,0,0),e[a].apply(e,t)}});var Ei=function(e,t,i){return e[t]=i},Nn=function(e,t,i){return e[t](i)},Ss=function(e,t,i,n){return e[t](n.fp,i)},Ts=function(e,t,i){return e.setAttribute(t,i)},wi=function(e,t){return V(e[t])?Nn:Qt(e[t])&&e.setAttribute?Ts:Ei},$n=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e6)/1e6,t)},Ds=function(e,t){return t.set(t.t,t.p,!!(t.s+t.c*e),t)},Bn=function(e,t){var i=t._pt,n="";if(!e&&t.b)n=t.b;else if(e===1&&t.e)n=t.e;else{for(;i;)n=i.p+(i.m?i.m(i.s+i.c*e):Math.round((i.s+i.c*e)*1e4)/1e4)+n,i=i._next;n+=t.c}t.set(t.t,t.p,n,t)},Ci=function(e,t){for(var i=t._pt;i;)i.r(e,i.d),i=i._next},Ms=function(e,t,i,n){for(var r=this._pt,s;r;)s=r._next,r.p===n&&r.modifier(e,t,i),r=s},Os=function(e){for(var t=this._pt,i,n;t;)n=t._next,t.p===e&&!t.op||t.op===e?kt(this,t,"_pt"):t.dep||(i=1),t=n;return!i},Rs=function(e,t,i,n){n.mSet(e,t,n.m.call(n.tween,i,n.mt),n)},Vn=function(e){for(var t=e._pt,i,n,r,s;t;){for(i=t._next,n=r;n&&n.pr>t.pr;)n=n._next;(t._prev=n?n._prev:s)?t._prev._next=t:r=t,(t._next=n)?n._prev=t:s=t,t=i}e._pt=r},ie=(function(){function a(t,i,n,r,s,o,l,c,h){this.t=i,this.s=r,this.c=s,this.p=n,this.r=o||$n,this.d=l||this,this.set=c||Ei,this.pr=h||0,this._next=t,t&&(t._prev=this)}var e=a.prototype;return e.modifier=function(i,n,r){this.mSet=this.mSet||this.set,this.set=Rs,this.m=i,this.mt=r,this.tween=n},a})();te(li+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",function(a){return si[a]=1}),le.TweenMax=le.TweenLite=H,le.TimelineLite=le.TimelineMax=Q,$=new Q({sortChildren:!1,defaults:We,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),oe.stringFilter=On;var $e=[],Nt={},Is=[],Gn=0,Ls=0,Pi=function(e){return(Nt[e]||Is).map(function(t){return t()})},Ai=function(){var e=Date.now(),t=[];e-Gn>2&&(Pi("matchMediaInit"),$e.forEach(function(i){var n=i.queries,r=i.conditions,s,o,l,c;for(o in n)s=ye.matchMedia(n[o]).matches,s&&(l=1),s!==r[o]&&(r[o]=s,c=1);c&&(i.revert(),l&&t.push(i))}),Pi("matchMediaRevert"),t.forEach(function(i){return i.onMatch(i,function(n){return i.add(null,n)})}),Gn=e,Pi("matchMedia"))},jn=(function(){function a(t,i){this.selector=i&&fi(i),this.data=[],this._r=[],this.isReverted=!1,this.id=Ls++,t&&this.add(t)}var e=a.prototype;return e.add=function(i,n,r){V(i)&&(r=n,n=i,i=V);var s=this,o=function(){var c=z,h=s.selector,u;return c&&c!==s&&c.data.push(s),r&&(s.selector=fi(r)),z=s,u=n.apply(s,arguments),V(u)&&s._r.push(u),z=c,s.selector=h,s.isReverted=!1,u};return s.last=o,i===V?o(s,function(l){return s.add(null,l)}):i?s[i]=o:o},e.ignore=function(i){var n=z;z=null,i(this),z=n},e.getTweens=function(){var i=[];return this.data.forEach(function(n){return n instanceof a?i.push.apply(i,n.getTweens()):n instanceof H&&!(n.parent&&n.parent.data==="nested")&&i.push(n)}),i},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(i,n){var r=this;if(i?(function(){for(var o=r.getTweens(),l=r.data.length,c;l--;)c=r.data[l],c.data==="isFlip"&&(c.revert(),c.getChildren(!0,!0,!1).forEach(function(h){return o.splice(o.indexOf(h),1)}));for(o.map(function(h){return{g:h._dur||h._delay||h._sat&&!h._sat.vars.immediateRender?h.globalTime(0):-1/0,t:h}}).sort(function(h,u){return u.g-h.g||-1/0}).forEach(function(h){return h.t.revert(i)}),l=r.data.length;l--;)c=r.data[l],c instanceof Q?c.data!=="nested"&&(c.scrollTrigger&&c.scrollTrigger.revert(),c.kill()):!(c instanceof H)&&c.revert&&c.revert(i);r._r.forEach(function(h){return h(i,r)}),r.isReverted=!0})():this.data.forEach(function(o){return o.kill&&o.kill()}),this.clear(),n)for(var s=$e.length;s--;)$e[s].id===this.id&&$e.splice(s,1)},e.revert=function(i){this.kill(i||{})},a})(),ks=(function(){function a(t){this.contexts=[],this.scope=t,z&&z.data.push(this)}var e=a.prototype;return e.add=function(i,n,r){_e(i)||(i={matches:i});var s=new jn(0,r||this.scope),o=s.conditions={},l,c,h;z&&!s.selector&&(s.selector=z.selector),this.contexts.push(s),n=s.add("onMatch",n),s.queries=i;for(c in i)c==="all"?h=1:(l=ye.matchMedia(i[c]),l&&($e.indexOf(s)<0&&$e.push(s),(o[c]=l.matches)&&(h=1),l.addListener?l.addListener(Ai):l.addEventListener("change",Ai)));return h&&n(s,function(u){return s.add(null,u)}),this},e.revert=function(i){this.kill(i||{})},e.kill=function(i){this.contexts.forEach(function(n){return n.kill(i,!0)})},a})(),$t={registerPlugin:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];t.forEach(function(n){return Sn(n)})},timeline:function(e){return new Q(e)},getTweensOf:function(e,t){return $.getTweensOf(e,t)},getProperty:function(e,t,i,n){K(e)&&(e=me(e)[0]);var r=Ue(e||{}).get,s=i?cn:hn;return i==="native"&&(i=""),e&&(t?s((he[t]&&he[t].get||r)(e,t,i,n)):function(o,l,c){return s((he[o]&&he[o].get||r)(e,o,l,c))})},quickSetter:function(e,t,i){if(e=me(e),e.length>1){var n=e.map(function(h){return ne.quickSetter(h,t,i)}),r=n.length;return function(h){for(var u=r;u--;)n[u](h)}}e=e[0]||{};var s=he[t],o=Ue(e),l=o.harness&&(o.harness.aliases||{})[t]||t,c=s?function(h){var u=new s;it._pt=0,u.init(e,i?h+i:h,it,0,[e]),u.render(1,u),it._pt&&Ci(1,it)}:o.set(e,l);return s?c:function(h){return c(e,l,i?h+i:h,o,1)}},quickTo:function(e,t,i){var n,r=ne.to(e,ce((n={},n[t]="+=0.1",n.paused=!0,n.stagger=0,n),i||{})),s=function(l,c,h){return r.resetTo(t,l,c,h)};return s.tween=r,s},isTweening:function(e){return $.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=ze(e.ease,We.ease)),un(We,e||{})},config:function(e){return un(oe,e||{})},registerEffect:function(e){var t=e.name,i=e.effect,n=e.plugins,r=e.defaults,s=e.extendTimeline;(n||"").split(",").forEach(function(o){return o&&!he[o]&&!le[o]&&ht(t+" effect requires "+o+" plugin.")}),oi[t]=function(o,l,c){return i(me(o),ce(l||{},r),c)},s&&(Q.prototype[t]=function(o,l,c){return this.add(oi[t](o,_e(l)?l:(c=l)&&{},this),c)})},registerEase:function(e,t){M[e]=ze(t)},parseEase:function(e,t){return arguments.length?ze(e,t):M},getById:function(e){return $.getById(e)},exportRoot:function(e,t){e===void 0&&(e={});var i=new Q(e),n,r;for(i.smoothChildTiming=ee(e.smoothChildTiming),$.remove(i),i._dp=0,i._time=i._tTime=$._time,n=$._first;n;)r=n._next,(t||!(!n._dur&&n instanceof H&&n.vars.onComplete===n._targets[0]))&&xe(i,n,n._start-n._delay),n=r;return xe($,i,0),i},context:function(e,t){return e?new jn(e,t):z},matchMedia:function(e){return new ks(e)},matchMediaRefresh:function(){return $e.forEach(function(e){var t=e.conditions,i,n;for(n in t)t[n]&&(t[n]=!1,i=1);i&&e.revert()})||Ai()},addEventListener:function(e,t){var i=Nt[e]||(Nt[e]=[]);~i.indexOf(t)||i.push(t)},removeEventListener:function(e,t){var i=Nt[e],n=i&&i.indexOf(t);n>=0&&i.splice(n,1)},utils:{wrap:ps,wrapYoyo:fs,distribute:bn,random:En,snap:vn,normalize:ds,getUnit:q,clamp:ls,splitColor:Tn,toArray:me,selector:fi,mapRange:Cn,pipe:cs,unitize:us,interpolate:ms,shuffle:xn},install:nn,effects:oi,ticker:de,updateRoot:Q.updateRoot,plugins:he,globalTimeline:$,core:{PropTween:ie,globals:rn,Tween:H,Timeline:Q,Animation:yt,getCache:Ue,_removeLinkedListItem:kt,reverting:function(){return X},context:function(e){return e&&z&&(z.data.push(e),e._ctx=z),z},suppressOverwrites:function(e){return Wt=e}}};te("to,from,fromTo,delayedCall,set,killTweensOf",function(a){return $t[a]=H[a]}),de.add(Q.updateRoot),it=$t.to({},{duration:0});var Us=function(e,t){for(var i=e._pt;i&&i.p!==t&&i.op!==t&&i.fp!==t;)i=i._next;return i},Fs=function(e,t){var i=e._targets,n,r,s;for(n in t)for(r=i.length;r--;)s=e._ptLookup[r][n],s&&(s=s.d)&&(s._pt&&(s=Us(s,n)),s&&s.modifier&&s.modifier(t[n],e,i[r],n))},Si=function(e,t){return{name:e,headless:1,rawVars:1,init:function(n,r,s){s._onInit=function(o){var l,c;if(K(r)&&(l={},te(r,function(h){return l[h]=1}),r=l),t){l={};for(c in r)l[c]=t(r[c]);r=l}Fs(o,r)}}}},ne=$t.registerPlugin({name:"attr",init:function(e,t,i,n,r){var s,o,l;this.tween=i;for(s in t)l=e.getAttribute(s)||"",o=this.add(e,"setAttribute",(l||0)+"",t[s],n,r,0,0,s),o.op=s,o.b=l,this._props.push(s)},render:function(e,t){for(var i=t._pt;i;)X?i.set(i.t,i.p,i.b,i):i.r(e,i.d),i=i._next}},{name:"endArray",headless:1,init:function(e,t){for(var i=t.length;i--;)this.add(e,i,e[i]||0,t[i],0,0,0,0,0,1)}},Si("roundProps",mi),Si("modifiers"),Si("snap",vn))||$t;H.version=Q.version=ne.version="3.13.0",tn=1,Jt()&&nt(),M.Power0,M.Power1,M.Power2,M.Power3,M.Power4,M.Linear,M.Quad,M.Cubic,M.Quart,M.Quint,M.Strong,M.Elastic,M.Back,M.SteppedEase,M.Bounce,M.Sine,M.Expo,M.Circ;var Yn,Re,rt,Ti,Be,Hn,Di,zs=function(){return typeof window<"u"},Ce={},Ve=180/Math.PI,st=Math.PI/180,at=Math.atan2,Zn=1e8,Mi=/([A-Z])/g,Ns=/(left|right|width|margin|padding|x)/i,$s=/[\s,\(]\S/,be={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},Oi=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},Bs=function(e,t){return t.set(t.t,t.p,e===1?t.e:Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},Vs=function(e,t){return t.set(t.t,t.p,e?Math.round((t.s+t.c*e)*1e4)/1e4+t.u:t.b,t)},Gs=function(e,t){var i=t.s+t.c*e;t.set(t.t,t.p,~~(i+(i<0?-.5:.5))+t.u,t)},Kn=function(e,t){return t.set(t.t,t.p,e?t.e:t.b,t)},Xn=function(e,t){return t.set(t.t,t.p,e!==1?t.b:t.e,t)},js=function(e,t,i){return e.style[t]=i},Ys=function(e,t,i){return e.style.setProperty(t,i)},Hs=function(e,t,i){return e._gsap[t]=i},Zs=function(e,t,i){return e._gsap.scaleX=e._gsap.scaleY=i},Ks=function(e,t,i,n,r){var s=e._gsap;s.scaleX=s.scaleY=i,s.renderTransform(r,s)},Xs=function(e,t,i,n,r){var s=e._gsap;s[t]=i,s.renderTransform(r,s)},B="transform",re=B+"Origin",Ws=function a(e,t){var i=this,n=this.target,r=n.style,s=n._gsap;if(e in Ce&&r){if(this.tfm=this.tfm||{},e!=="transform")e=be[e]||e,~e.indexOf(",")?e.split(",").forEach(function(o){return i.tfm[o]=Pe(n,o)}):this.tfm[e]=s.x?s[e]:Pe(n,e),e===re&&(this.tfm.zOrigin=s.zOrigin);else return be.transform.split(",").forEach(function(o){return a.call(i,o,t)});if(this.props.indexOf(B)>=0)return;s.svg&&(this.svgo=n.getAttribute("data-svg-origin"),this.props.push(re,t,"")),e=B}(r||t)&&this.props.push(e,t,r[e])},Wn=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},qs=function(){var e=this.props,t=this.target,i=t.style,n=t._gsap,r,s;for(r=0;r<e.length;r+=3)e[r+1]?e[r+1]===2?t[e[r]](e[r+2]):t[e[r]]=e[r+2]:e[r+2]?i[e[r]]=e[r+2]:i.removeProperty(e[r].substr(0,2)==="--"?e[r]:e[r].replace(Mi,"-$1").toLowerCase());if(this.tfm){for(s in this.tfm)n[s]=this.tfm[s];n.svg&&(n.renderTransform(),t.setAttribute("data-svg-origin",this.svgo||"")),r=Di(),(!r||!r.isStart)&&!i[B]&&(Wn(i),n.zOrigin&&i[re]&&(i[re]+=" "+n.zOrigin+"px",n.zOrigin=0,n.renderTransform()),n.uncache=1)}},qn=function(e,t){var i={target:e,props:[],revert:qs,save:Ws};return e._gsap||ne.core.getCache(e),t&&e.style&&e.nodeType&&t.split(",").forEach(function(n){return i.save(n)}),i},Qn,Ri=function(e,t){var i=Re.createElementNS?Re.createElementNS((t||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):Re.createElement(e);return i&&i.style?i:Re.createElement(e)},ge=function a(e,t,i){var n=getComputedStyle(e);return n[t]||n.getPropertyValue(t.replace(Mi,"-$1").toLowerCase())||n.getPropertyValue(t)||!i&&a(e,ot(t)||t,1)||""},Jn="O,Moz,ms,Ms,Webkit".split(","),ot=function(e,t,i){var n=t||Be,r=n.style,s=5;if(e in r&&!i)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);s--&&!(Jn[s]+e in r););return s<0?null:(s===3?"ms":s>=0?Jn[s]:"")+e},Ii=function(){zs()&&window.document&&(Yn=window,Re=Yn.document,rt=Re.documentElement,Be=Ri("div")||{style:{}},Ri("div"),B=ot(B),re=B+"Origin",Be.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",Qn=!!ot("perspective"),Di=ne.core.reverting,Ti=1)},er=function(e){var t=e.ownerSVGElement,i=Ri("svg",t&&t.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),n=e.cloneNode(!0),r;n.style.display="block",i.appendChild(n),rt.appendChild(i);try{r=n.getBBox()}catch{}return i.removeChild(n),rt.removeChild(i),r},tr=function(e,t){for(var i=t.length;i--;)if(e.hasAttribute(t[i]))return e.getAttribute(t[i])},ir=function(e){var t,i;try{t=e.getBBox()}catch{t=er(e),i=1}return t&&(t.width||t.height)||i||(t=er(e)),t&&!t.width&&!t.x&&!t.y?{x:+tr(e,["x","cx","x1"])||0,y:+tr(e,["y","cy","y1"])||0,width:0,height:0}:t},nr=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&ir(e))},Ge=function(e,t){if(t){var i=e.style,n;t in Ce&&t!==re&&(t=B),i.removeProperty?(n=t.substr(0,2),(n==="ms"||t.substr(0,6)==="webkit")&&(t="-"+t),i.removeProperty(n==="--"?t:t.replace(Mi,"-$1").toLowerCase())):i.removeAttribute(t)}},Ie=function(e,t,i,n,r,s){var o=new ie(e._pt,t,i,0,1,s?Xn:Kn);return e._pt=o,o.b=n,o.e=r,e._props.push(i),o},rr={deg:1,rad:1,turn:1},Qs={grid:1,flex:1},Le=function a(e,t,i,n){var r=parseFloat(i)||0,s=(i+"").trim().substr((r+"").length)||"px",o=Be.style,l=Ns.test(t),c=e.tagName.toLowerCase()==="svg",h=(c?"client":"offset")+(l?"Width":"Height"),u=100,p=n==="px",m=n==="%",f,d,g,_;if(n===s||!r||rr[n]||rr[s])return r;if(s!=="px"&&!p&&(r=a(e,t,i,"px")),_=e.getCTM&&nr(e),(m||s==="%")&&(Ce[t]||~t.indexOf("adius")))return f=_?e.getBBox()[l?"width":"height"]:e[h],j(m?r/f*u:r/100*f);if(o[l?"width":"height"]=u+(p?s:n),d=n!=="rem"&&~t.indexOf("adius")||n==="em"&&e.appendChild&&!c?e:e.parentNode,_&&(d=(e.ownerSVGElement||{}).parentNode),(!d||d===Re||!d.appendChild)&&(d=Re.body),g=d._gsap,g&&m&&g.width&&l&&g.time===de.time&&!g.uncache)return j(r/g.width*u);if(m&&(t==="height"||t==="width")){var y=e.style[t];e.style[t]=u+n,f=e[h],y?e.style[t]=y:Ge(e,t)}else(m||s==="%")&&!Qs[ge(d,"display")]&&(o.position=ge(e,"position")),d===e&&(o.position="static"),d.appendChild(Be),f=Be[h],d.removeChild(Be),o.position="absolute";return l&&m&&(g=Ue(d),g.time=de.time,g.width=d[h]),j(p?f*r/u:f&&r?u/f*r:0)},Pe=function(e,t,i,n){var r;return Ti||Ii(),t in be&&t!=="transform"&&(t=be[t],~t.indexOf(",")&&(t=t.split(",")[0])),Ce[t]&&t!=="transform"?(r=vt(e,n),r=t!=="transformOrigin"?r[t]:r.svg?r.origin:Vt(ge(e,re))+" "+r.zOrigin+"px"):(r=e.style[t],(!r||r==="auto"||n||~(r+"").indexOf("calc("))&&(r=Bt[t]&&Bt[t](e,t,i)||ge(e,t)||on(e,t)||(t==="opacity"?1:0))),i&&!~(r+"").trim().indexOf(" ")?Le(e,t,r,i)+i:r},Js=function(e,t,i,n){if(!i||i==="none"){var r=ot(t,e,1),s=r&&ge(e,r,1);s&&s!==i?(t=r,i=s):t==="borderColor"&&(i=ge(e,"borderTopColor"))}var o=new ie(this._pt,e.style,t,0,1,Bn),l=0,c=0,h,u,p,m,f,d,g,_,y,x,v,b;if(o.b=i,o.e=n,i+="",n+="",n.substring(0,6)==="var(--"&&(n=ge(e,n.substring(4,n.indexOf(")")))),n==="auto"&&(d=e.style[t],e.style[t]=n,n=ge(e,t)||n,d?e.style[t]=d:Ge(e,t)),h=[i,n],On(h),i=h[0],n=h[1],p=i.match(qe)||[],b=n.match(qe)||[],b.length){for(;u=qe.exec(n);)g=u[0],y=n.substring(l,u.index),f?f=(f+1)%5:(y.substr(-5)==="rgba("||y.substr(-5)==="hsla(")&&(f=1),g!==(d=p[c++]||"")&&(m=parseFloat(d)||0,v=d.substr((m+"").length),g.charAt(1)==="="&&(g=Qe(m,g)+v),_=parseFloat(g),x=g.substr((_+"").length),l=qe.lastIndex-x.length,x||(x=x||oe.units[t]||v,l===n.length&&(n+=x,o.e+=x)),v!==x&&(m=Le(e,t,d,x)||0),o._pt={_next:o._pt,p:y||c===1?y:",",s:m,c:_-m,m:f&&f<4||t==="zIndex"?Math.round:0});o.c=l<n.length?n.substring(l,n.length):""}else o.r=t==="display"&&n==="none"?Xn:Kn;return Ji.test(n)&&(o.e=0),this._pt=o,o},sr={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},ea=function(e){var t=e.split(" "),i=t[0],n=t[1]||"50%";return(i==="top"||i==="bottom"||n==="left"||n==="right")&&(e=i,i=n,n=e),t[0]=sr[i]||i,t[1]=sr[n]||n,t.join(" ")},ta=function(e,t){if(t.tween&&t.tween._time===t.tween._dur){var i=t.t,n=i.style,r=t.u,s=i._gsap,o,l,c;if(r==="all"||r===!0)n.cssText="",l=1;else for(r=r.split(","),c=r.length;--c>-1;)o=r[c],Ce[o]&&(l=1,o=o==="transformOrigin"?re:B),Ge(i,o);l&&(Ge(i,B),s&&(s.svg&&i.removeAttribute("transform"),n.scale=n.rotate=n.translate="none",vt(i,1),s.uncache=1,Wn(n)))}},Bt={clearProps:function(e,t,i,n,r){if(r.data!=="isFromStart"){var s=e._pt=new ie(e._pt,t,i,0,0,ta);return s.u=n,s.pr=-10,s.tween=r,e._props.push(i),1}}},bt=[1,0,0,1,0,0],ar={},or=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},lr=function(e){var t=ge(e,B);return or(t)?bt:t.substr(7).match(Qi).map(j)},Li=function(e,t){var i=e._gsap||Ue(e),n=e.style,r=lr(e),s,o,l,c;return i.svg&&e.getAttribute("transform")?(l=e.transform.baseVal.consolidate().matrix,r=[l.a,l.b,l.c,l.d,l.e,l.f],r.join(",")==="1,0,0,1,0,0"?bt:r):(r===bt&&!e.offsetParent&&e!==rt&&!i.svg&&(l=n.display,n.display="block",s=e.parentNode,(!s||!e.offsetParent&&!e.getBoundingClientRect().width)&&(c=1,o=e.nextElementSibling,rt.appendChild(e)),r=lr(e),l?n.display=l:Ge(e,"display"),c&&(o?s.insertBefore(e,o):s?s.appendChild(e):rt.removeChild(e))),t&&r.length>6?[r[0],r[1],r[4],r[5],r[12],r[13]]:r)},ki=function(e,t,i,n,r,s){var o=e._gsap,l=r||Li(e,!0),c=o.xOrigin||0,h=o.yOrigin||0,u=o.xOffset||0,p=o.yOffset||0,m=l[0],f=l[1],d=l[2],g=l[3],_=l[4],y=l[5],x=t.split(" "),v=parseFloat(x[0])||0,b=parseFloat(x[1])||0,C,E,P,w;i?l!==bt&&(E=m*g-f*d)&&(P=v*(g/E)+b*(-d/E)+(d*y-g*_)/E,w=v*(-f/E)+b*(m/E)-(m*y-f*_)/E,v=P,b=w):(C=ir(e),v=C.x+(~x[0].indexOf("%")?v/100*C.width:v),b=C.y+(~(x[1]||x[0]).indexOf("%")?b/100*C.height:b)),n||n!==!1&&o.smooth?(_=v-c,y=b-h,o.xOffset=u+(_*m+y*d)-_,o.yOffset=p+(_*f+y*g)-y):o.xOffset=o.yOffset=0,o.xOrigin=v,o.yOrigin=b,o.smooth=!!n,o.origin=t,o.originIsAbsolute=!!i,e.style[re]="0px 0px",s&&(Ie(s,o,"xOrigin",c,v),Ie(s,o,"yOrigin",h,b),Ie(s,o,"xOffset",u,o.xOffset),Ie(s,o,"yOffset",p,o.yOffset)),e.setAttribute("data-svg-origin",v+" "+b)},vt=function(e,t){var i=e._gsap||new kn(e);if("x"in i&&!t&&!i.uncache)return i;var n=e.style,r=i.scaleX<0,s="px",o="deg",l=getComputedStyle(e),c=ge(e,re)||"0",h,u,p,m,f,d,g,_,y,x,v,b,C,E,P,w,T,O,S,R,I,G,N,F,se,Pt,At,St,Ke,Mr,Ae,Xe;return h=u=p=d=g=_=y=x=v=0,m=f=1,i.svg=!!(e.getCTM&&nr(e)),l.translate&&((l.translate!=="none"||l.scale!=="none"||l.rotate!=="none")&&(n[B]=(l.translate!=="none"?"translate3d("+(l.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(l.rotate!=="none"?"rotate("+l.rotate+") ":"")+(l.scale!=="none"?"scale("+l.scale.split(" ").join(",")+") ":"")+(l[B]!=="none"?l[B]:"")),n.scale=n.rotate=n.translate="none"),E=Li(e,i.svg),i.svg&&(i.uncache?(se=e.getBBox(),c=i.xOrigin-se.x+"px "+(i.yOrigin-se.y)+"px",F=""):F=!t&&e.getAttribute("data-svg-origin"),ki(e,F||c,!!F||i.originIsAbsolute,i.smooth!==!1,E)),b=i.xOrigin||0,C=i.yOrigin||0,E!==bt&&(O=E[0],S=E[1],R=E[2],I=E[3],h=G=E[4],u=N=E[5],E.length===6?(m=Math.sqrt(O*O+S*S),f=Math.sqrt(I*I+R*R),d=O||S?at(S,O)*Ve:0,y=R||I?at(R,I)*Ve+d:0,y&&(f*=Math.abs(Math.cos(y*st))),i.svg&&(h-=b-(b*O+C*R),u-=C-(b*S+C*I))):(Xe=E[6],Mr=E[7],At=E[8],St=E[9],Ke=E[10],Ae=E[11],h=E[12],u=E[13],p=E[14],P=at(Xe,Ke),g=P*Ve,P&&(w=Math.cos(-P),T=Math.sin(-P),F=G*w+At*T,se=N*w+St*T,Pt=Xe*w+Ke*T,At=G*-T+At*w,St=N*-T+St*w,Ke=Xe*-T+Ke*w,Ae=Mr*-T+Ae*w,G=F,N=se,Xe=Pt),P=at(-R,Ke),_=P*Ve,P&&(w=Math.cos(-P),T=Math.sin(-P),F=O*w-At*T,se=S*w-St*T,Pt=R*w-Ke*T,Ae=I*T+Ae*w,O=F,S=se,R=Pt),P=at(S,O),d=P*Ve,P&&(w=Math.cos(P),T=Math.sin(P),F=O*w+S*T,se=G*w+N*T,S=S*w-O*T,N=N*w-G*T,O=F,G=se),g&&Math.abs(g)+Math.abs(d)>359.9&&(g=d=0,_=180-_),m=j(Math.sqrt(O*O+S*S+R*R)),f=j(Math.sqrt(N*N+Xe*Xe)),P=at(G,N),y=Math.abs(P)>2e-4?P*Ve:0,v=Ae?1/(Ae<0?-Ae:Ae):0),i.svg&&(F=e.getAttribute("transform"),i.forceCSS=e.setAttribute("transform","")||!or(ge(e,B)),F&&e.setAttribute("transform",F))),Math.abs(y)>90&&Math.abs(y)<270&&(r?(m*=-1,y+=d<=0?180:-180,d+=d<=0?180:-180):(f*=-1,y+=y<=0?180:-180)),t=t||i.uncache,i.x=h-((i.xPercent=h&&(!t&&i.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-h)?-50:0)))?e.offsetWidth*i.xPercent/100:0)+s,i.y=u-((i.yPercent=u&&(!t&&i.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-u)?-50:0)))?e.offsetHeight*i.yPercent/100:0)+s,i.z=p+s,i.scaleX=j(m),i.scaleY=j(f),i.rotation=j(d)+o,i.rotationX=j(g)+o,i.rotationY=j(_)+o,i.skewX=y+o,i.skewY=x+o,i.transformPerspective=v+s,(i.zOrigin=parseFloat(c.split(" ")[2])||!t&&i.zOrigin||0)&&(n[re]=Vt(c)),i.xOffset=i.yOffset=0,i.force3D=oe.force3D,i.renderTransform=i.svg?na:Qn?hr:ia,i.uncache=0,i},Vt=function(e){return(e=e.split(" "))[0]+" "+e[1]},Ui=function(e,t,i){var n=q(t);return j(parseFloat(t)+parseFloat(Le(e,"x",i+"px",n)))+n},ia=function(e,t){t.z="0px",t.rotationY=t.rotationX="0deg",t.force3D=0,hr(e,t)},je="0deg",Et="0px",Ye=") ",hr=function(e,t){var i=t||this,n=i.xPercent,r=i.yPercent,s=i.x,o=i.y,l=i.z,c=i.rotation,h=i.rotationY,u=i.rotationX,p=i.skewX,m=i.skewY,f=i.scaleX,d=i.scaleY,g=i.transformPerspective,_=i.force3D,y=i.target,x=i.zOrigin,v="",b=_==="auto"&&e&&e!==1||_===!0;if(x&&(u!==je||h!==je)){var C=parseFloat(h)*st,E=Math.sin(C),P=Math.cos(C),w;C=parseFloat(u)*st,w=Math.cos(C),s=Ui(y,s,E*w*-x),o=Ui(y,o,-Math.sin(C)*-x),l=Ui(y,l,P*w*-x+x)}g!==Et&&(v+="perspective("+g+Ye),(n||r)&&(v+="translate("+n+"%, "+r+"%) "),(b||s!==Et||o!==Et||l!==Et)&&(v+=l!==Et||b?"translate3d("+s+", "+o+", "+l+") ":"translate("+s+", "+o+Ye),c!==je&&(v+="rotate("+c+Ye),h!==je&&(v+="rotateY("+h+Ye),u!==je&&(v+="rotateX("+u+Ye),(p!==je||m!==je)&&(v+="skew("+p+", "+m+Ye),(f!==1||d!==1)&&(v+="scale("+f+", "+d+Ye),y.style[B]=v||"translate(0, 0)"},na=function(e,t){var i=t||this,n=i.xPercent,r=i.yPercent,s=i.x,o=i.y,l=i.rotation,c=i.skewX,h=i.skewY,u=i.scaleX,p=i.scaleY,m=i.target,f=i.xOrigin,d=i.yOrigin,g=i.xOffset,_=i.yOffset,y=i.forceCSS,x=parseFloat(s),v=parseFloat(o),b,C,E,P,w;l=parseFloat(l),c=parseFloat(c),h=parseFloat(h),h&&(h=parseFloat(h),c+=h,l+=h),l||c?(l*=st,c*=st,b=Math.cos(l)*u,C=Math.sin(l)*u,E=Math.sin(l-c)*-p,P=Math.cos(l-c)*p,c&&(h*=st,w=Math.tan(c-h),w=Math.sqrt(1+w*w),E*=w,P*=w,h&&(w=Math.tan(h),w=Math.sqrt(1+w*w),b*=w,C*=w)),b=j(b),C=j(C),E=j(E),P=j(P)):(b=u,P=p,C=E=0),(x&&!~(s+"").indexOf("px")||v&&!~(o+"").indexOf("px"))&&(x=Le(m,"x",s,"px"),v=Le(m,"y",o,"px")),(f||d||g||_)&&(x=j(x+f-(f*b+d*E)+g),v=j(v+d-(f*C+d*P)+_)),(n||r)&&(w=m.getBBox(),x=j(x+n/100*w.width),v=j(v+r/100*w.height)),w="matrix("+b+","+C+","+E+","+P+","+x+","+v+")",m.setAttribute("transform",w),y&&(m.style[B]=w)},ra=function(e,t,i,n,r){var s=360,o=K(r),l=parseFloat(r)*(o&&~r.indexOf("rad")?Ve:1),c=l-n,h=n+c+"deg",u,p;return o&&(u=r.split("_")[1],u==="short"&&(c%=s,c!==c%(s/2)&&(c+=c<0?s:-s)),u==="cw"&&c<0?c=(c+s*Zn)%s-~~(c/s)*s:u==="ccw"&&c>0&&(c=(c-s*Zn)%s-~~(c/s)*s)),e._pt=p=new ie(e._pt,t,i,n,c,Bs),p.e=h,p.u="deg",e._props.push(i),p},cr=function(e,t){for(var i in t)e[i]=t[i];return e},sa=function(e,t,i){var n=cr({},i._gsap),r="perspective,force3D,transformOrigin,svgOrigin",s=i.style,o,l,c,h,u,p,m,f;n.svg?(c=i.getAttribute("transform"),i.setAttribute("transform",""),s[B]=t,o=vt(i,1),Ge(i,B),i.setAttribute("transform",c)):(c=getComputedStyle(i)[B],s[B]=t,o=vt(i,1),s[B]=c);for(l in Ce)c=n[l],h=o[l],c!==h&&r.indexOf(l)<0&&(m=q(c),f=q(h),u=m!==f?Le(i,l,c,f):parseFloat(c),p=parseFloat(h),e._pt=new ie(e._pt,o,l,u,p-u,Oi),e._pt.u=f||0,e._props.push(l));cr(o,n)};te("padding,margin,Width,Radius",function(a,e){var t="Top",i="Right",n="Bottom",r="Left",s=(e<3?[t,i,n,r]:[t+r,t+i,n+i,n+r]).map(function(o){return e<2?a+o:"border"+o+a});Bt[e>1?"border"+a:a]=function(o,l,c,h,u){var p,m;if(arguments.length<4)return p=s.map(function(f){return Pe(o,f,c)}),m=p.join(" "),m.split(p[0]).length===5?p[0]:m;p=(h+"").split(" "),m={},s.forEach(function(f,d){return m[f]=p[d]=p[d]||p[(d-1)/2|0]}),o.init(l,m,u)}});var ur={name:"css",register:Ii,targetTest:function(e){return e.style&&e.nodeType},init:function(e,t,i,n,r){var s=this._props,o=e.style,l=i.vars.startAt,c,h,u,p,m,f,d,g,_,y,x,v,b,C,E,P;Ti||Ii(),this.styles=this.styles||qn(e),P=this.styles.props,this.tween=i;for(d in t)if(d!=="autoRound"&&(h=t[d],!(he[d]&&Un(d,t,i,n,e,r)))){if(m=typeof h,f=Bt[d],m==="function"&&(h=h.call(i,n,e,r),m=typeof h),m==="string"&&~h.indexOf("random(")&&(h=ft(h)),f)f(this,e,d,h,i)&&(E=1);else if(d.substr(0,2)==="--")c=(getComputedStyle(e).getPropertyValue(d)+"").trim(),h+="",Me.lastIndex=0,Me.test(c)||(g=q(c),_=q(h)),_?g!==_&&(c=Le(e,d,c,_)+_):g&&(h+=g),this.add(o,"setProperty",c,h,n,r,0,0,d),s.push(d),P.push(d,0,o[d]);else if(m!=="undefined"){if(l&&d in l?(c=typeof l[d]=="function"?l[d].call(i,n,e,r):l[d],K(c)&&~c.indexOf("random(")&&(c=ft(c)),q(c+"")||c==="auto"||(c+=oe.units[d]||q(Pe(e,d))||""),(c+"").charAt(1)==="="&&(c=Pe(e,d))):c=Pe(e,d),p=parseFloat(c),y=m==="string"&&h.charAt(1)==="="&&h.substr(0,2),y&&(h=h.substr(2)),u=parseFloat(h),d in be&&(d==="autoAlpha"&&(p===1&&Pe(e,"visibility")==="hidden"&&u&&(p=0),P.push("visibility",0,o.visibility),Ie(this,o,"visibility",p?"inherit":"hidden",u?"inherit":"hidden",!u)),d!=="scale"&&d!=="transform"&&(d=be[d],~d.indexOf(",")&&(d=d.split(",")[0]))),x=d in Ce,x){if(this.styles.save(d),m==="string"&&h.substring(0,6)==="var(--"&&(h=ge(e,h.substring(4,h.indexOf(")"))),u=parseFloat(h)),v||(b=e._gsap,b.renderTransform&&!t.parseTransform||vt(e,t.parseTransform),C=t.smoothOrigin!==!1&&b.smooth,v=this._pt=new ie(this._pt,o,B,0,1,b.renderTransform,b,0,-1),v.dep=1),d==="scale")this._pt=new ie(this._pt,b,"scaleY",b.scaleY,(y?Qe(b.scaleY,y+u):u)-b.scaleY||0,Oi),this._pt.u=0,s.push("scaleY",d),d+="X";else if(d==="transformOrigin"){P.push(re,0,o[re]),h=ea(h),b.svg?ki(e,h,0,C,0,this):(_=parseFloat(h.split(" ")[2])||0,_!==b.zOrigin&&Ie(this,b,"zOrigin",b.zOrigin,_),Ie(this,o,d,Vt(c),Vt(h)));continue}else if(d==="svgOrigin"){ki(e,h,1,C,0,this);continue}else if(d in ar){ra(this,b,d,p,y?Qe(p,y+h):h);continue}else if(d==="smoothOrigin"){Ie(this,b,"smooth",b.smooth,h);continue}else if(d==="force3D"){b[d]=h;continue}else if(d==="transform"){sa(this,h,e);continue}}else d in o||(d=ot(d)||d);if(x||(u||u===0)&&(p||p===0)&&!$s.test(h)&&d in o)g=(c+"").substr((p+"").length),u||(u=0),_=q(h)||(d in oe.units?oe.units[d]:g),g!==_&&(p=Le(e,d,c,_)),this._pt=new ie(this._pt,x?b:o,d,p,(y?Qe(p,y+u):u)-p,!x&&(_==="px"||d==="zIndex")&&t.autoRound!==!1?Gs:Oi),this._pt.u=_||0,g!==_&&_!=="%"&&(this._pt.b=c,this._pt.r=Vs);else if(d in o)Js.call(this,e,d,c,y?y+h:h);else if(d in e)this.add(e,d,c||e[d],y?y+h:h,n,r);else if(d!=="parseTransform"){ri(d,h);continue}x||(d in o?P.push(d,0,o[d]):typeof e[d]=="function"?P.push(d,2,e[d]()):P.push(d,1,c||e[d])),s.push(d)}}E&&Vn(this)},render:function(e,t){if(t.tween._time||!Di())for(var i=t._pt;i;)i.r(e,i.d),i=i._next;else t.styles.revert()},get:Pe,aliases:be,getSetter:function(e,t,i){var n=be[t];return n&&n.indexOf(",")<0&&(t=n),t in Ce&&t!==re&&(e._gsap.x||Pe(e,"x"))?i&&Hn===i?t==="scale"?Zs:Hs:(Hn=i||{})&&(t==="scale"?Ks:Xs):e.style&&!Qt(e.style[t])?js:~t.indexOf("-")?Ys:wi(e,t)},core:{_removeProperty:Ge,_getMatrix:Li}};ne.utils.checkPrefix=ot,ne.core.getStyleSaver=qn,(function(a,e,t,i){var n=te(a+","+e+","+t,function(r){Ce[r]=1});te(e,function(r){oe.units[r]="deg",ar[r]=1}),be[n[13]]=a+","+e,te(i,function(r){var s=r.split(":");be[s[1]]=n[s[0]]})})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY"),te("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(a){oe.units[a]="px"}),ne.registerPlugin(ur);var wt=ne.registerPlugin(ur)||ne;wt.core.Tween;class ve{constructor(e,t,i,n,r="div"){this.parent=e,this.object=t,this.property=i,this._disabled=!1,this._hidden=!1,this.initialValue=this.getValue(),this.domElement=document.createElement(r),this.domElement.classList.add("lil-controller"),this.domElement.classList.add(n),this.$name=document.createElement("div"),this.$name.classList.add("lil-name"),ve.nextNameID=ve.nextNameID||0,this.$name.id=`lil-gui-name-${++ve.nextNameID}`,this.$widget=document.createElement("div"),this.$widget.classList.add("lil-widget"),this.$disable=this.$widget,this.domElement.appendChild(this.$name),this.domElement.appendChild(this.$widget),this.domElement.addEventListener("keydown",s=>s.stopPropagation()),this.domElement.addEventListener("keyup",s=>s.stopPropagation()),this.parent.children.push(this),this.parent.controllers.push(this),this.parent.$children.appendChild(this.domElement),this._listenCallback=this._listenCallback.bind(this),this.name(i)}name(e){return this._name=e,this.$name.textContent=e,this}onChange(e){return this._onChange=e,this}_callOnChange(){this.parent._callOnChange(this),this._onChange!==void 0&&this._onChange.call(this,this.getValue()),this._changed=!0}onFinishChange(e){return this._onFinishChange=e,this}_callOnFinishChange(){this._changed&&(this.parent._callOnFinishChange(this),this._onFinishChange!==void 0&&this._onFinishChange.call(this,this.getValue())),this._changed=!1}reset(){return this.setValue(this.initialValue),this._callOnFinishChange(),this}enable(e=!0){return this.disable(!e)}disable(e=!0){return e===this._disabled?this:(this._disabled=e,this.domElement.classList.toggle("lil-disabled",e),this.$disable.toggleAttribute("disabled",e),this)}show(e=!0){return this._hidden=!e,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}options(e){const t=this.parent.add(this.object,this.property,e);return t.name(this._name),this.destroy(),t}min(e){return this}max(e){return this}step(e){return this}decimals(e){return this}listen(e=!0){return this._listening=e,this._listenCallbackID!==void 0&&(cancelAnimationFrame(this._listenCallbackID),this._listenCallbackID=void 0),this._listening&&this._listenCallback(),this}_listenCallback(){this._listenCallbackID=requestAnimationFrame(this._listenCallback);const e=this.save();e!==this._listenPrevValue&&this.updateDisplay(),this._listenPrevValue=e}getValue(){return this.object[this.property]}setValue(e){return this.getValue()!==e&&(this.object[this.property]=e,this._callOnChange(),this.updateDisplay()),this}updateDisplay(){return this}load(e){return this.setValue(e),this._callOnFinishChange(),this}save(){return this.getValue()}destroy(){this.listen(!1),this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.controllers.splice(this.parent.controllers.indexOf(this),1),this.parent.$children.removeChild(this.domElement)}}class aa extends ve{constructor(e,t,i){super(e,t,i,"lil-boolean","label"),this.$input=document.createElement("input"),this.$input.setAttribute("type","checkbox"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$widget.appendChild(this.$input),this.$input.addEventListener("change",()=>{this.setValue(this.$input.checked),this._callOnFinishChange()}),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.checked=this.getValue(),this}}function Fi(a){let e,t;return(e=a.match(/(#|0x)?([a-f0-9]{6})/i))?t=e[2]:(e=a.match(/rgb\(\s*(\d*)\s*,\s*(\d*)\s*,\s*(\d*)\s*\)/))?t=parseInt(e[1]).toString(16).padStart(2,0)+parseInt(e[2]).toString(16).padStart(2,0)+parseInt(e[3]).toString(16).padStart(2,0):(e=a.match(/^#?([a-f0-9])([a-f0-9])([a-f0-9])$/i))&&(t=e[1]+e[1]+e[2]+e[2]+e[3]+e[3]),t?"#"+t:!1}const oa={isPrimitive:!0,match:a=>typeof a=="string",fromHexString:Fi,toHexString:Fi},Ct={isPrimitive:!0,match:a=>typeof a=="number",fromHexString:a=>parseInt(a.substring(1),16),toHexString:a=>"#"+a.toString(16).padStart(6,0)},la=[oa,Ct,{isPrimitive:!1,match:a=>Array.isArray(a)||ArrayBuffer.isView(a),fromHexString(a,e,t=1){const i=Ct.fromHexString(a);e[0]=(i>>16&255)/255*t,e[1]=(i>>8&255)/255*t,e[2]=(i&255)/255*t},toHexString([a,e,t],i=1){i=255/i;const n=a*i<<16^e*i<<8^t*i<<0;return Ct.toHexString(n)}},{isPrimitive:!1,match:a=>Object(a)===a,fromHexString(a,e,t=1){const i=Ct.fromHexString(a);e.r=(i>>16&255)/255*t,e.g=(i>>8&255)/255*t,e.b=(i&255)/255*t},toHexString({r:a,g:e,b:t},i=1){i=255/i;const n=a*i<<16^e*i<<8^t*i<<0;return Ct.toHexString(n)}}];function ha(a){return la.find(e=>e.match(a))}class ca extends ve{constructor(e,t,i,n){super(e,t,i,"lil-color"),this.$input=document.createElement("input"),this.$input.setAttribute("type","color"),this.$input.setAttribute("tabindex",-1),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$text=document.createElement("input"),this.$text.setAttribute("type","text"),this.$text.setAttribute("spellcheck","false"),this.$text.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("lil-display"),this.$display.appendChild(this.$input),this.$widget.appendChild(this.$display),this.$widget.appendChild(this.$text),this._format=ha(this.initialValue),this._rgbScale=n,this._initialValueHexString=this.save(),this._textFocused=!1,this.$input.addEventListener("input",()=>{this._setValueFromHexString(this.$input.value)}),this.$input.addEventListener("blur",()=>{this._callOnFinishChange()}),this.$text.addEventListener("input",()=>{const r=Fi(this.$text.value);r&&this._setValueFromHexString(r)}),this.$text.addEventListener("focus",()=>{this._textFocused=!0,this.$text.select()}),this.$text.addEventListener("blur",()=>{this._textFocused=!1,this.updateDisplay(),this._callOnFinishChange()}),this.$disable=this.$text,this.updateDisplay()}reset(){return this._setValueFromHexString(this._initialValueHexString),this}_setValueFromHexString(e){if(this._format.isPrimitive){const t=this._format.fromHexString(e);this.setValue(t)}else this._format.fromHexString(e,this.getValue(),this._rgbScale),this._callOnChange(),this.updateDisplay()}save(){return this._format.toHexString(this.getValue(),this._rgbScale)}load(e){return this._setValueFromHexString(e),this._callOnFinishChange(),this}updateDisplay(){return this.$input.value=this._format.toHexString(this.getValue(),this._rgbScale),this._textFocused||(this.$text.value=this.$input.value.substring(1)),this.$display.style.backgroundColor=this.$input.value,this}}class zi extends ve{constructor(e,t,i){super(e,t,i,"lil-function"),this.$button=document.createElement("button"),this.$button.appendChild(this.$name),this.$widget.appendChild(this.$button),this.$button.addEventListener("click",n=>{n.preventDefault(),this.getValue().call(this.object),this._callOnChange()}),this.$button.addEventListener("touchstart",()=>{},{passive:!0}),this.$disable=this.$button}}class ua extends ve{constructor(e,t,i,n,r,s){super(e,t,i,"lil-number"),this._initInput(),this.min(n),this.max(r);const o=s!==void 0;this.step(o?s:this._getImplicitStep(),o),this.updateDisplay()}decimals(e){return this._decimals=e,this.updateDisplay(),this}min(e){return this._min=e,this._onUpdateMinMax(),this}max(e){return this._max=e,this._onUpdateMinMax(),this}step(e,t=!0){return this._step=e,this._stepExplicit=t,this}updateDisplay(){const e=this.getValue();if(this._hasSlider){let t=(e-this._min)/(this._max-this._min);t=Math.max(0,Math.min(t,1)),this.$fill.style.width=t*100+"%"}return this._inputFocused||(this.$input.value=this._decimals===void 0?e:e.toFixed(this._decimals)),this}_initInput(){this.$input=document.createElement("input"),this.$input.setAttribute("type","text"),this.$input.setAttribute("aria-labelledby",this.$name.id),window.matchMedia("(pointer: coarse)").matches&&(this.$input.setAttribute("type","number"),this.$input.setAttribute("step","any")),this.$widget.appendChild(this.$input),this.$disable=this.$input;const t=()=>{let y=parseFloat(this.$input.value);isNaN(y)||(this._stepExplicit&&(y=this._snap(y)),this.setValue(this._clamp(y)))},i=y=>{const x=parseFloat(this.$input.value);isNaN(x)||(this._snapClampSetValue(x+y),this.$input.value=this.getValue())},n=y=>{y.key==="Enter"&&this.$input.blur(),y.code==="ArrowUp"&&(y.preventDefault(),i(this._step*this._arrowKeyMultiplier(y))),y.code==="ArrowDown"&&(y.preventDefault(),i(this._step*this._arrowKeyMultiplier(y)*-1))},r=y=>{this._inputFocused&&(y.preventDefault(),i(this._step*this._normalizeMouseWheel(y)))};let s=!1,o,l,c,h,u;const p=5,m=y=>{o=y.clientX,l=c=y.clientY,s=!0,h=this.getValue(),u=0,window.addEventListener("mousemove",f),window.addEventListener("mouseup",d)},f=y=>{if(s){const x=y.clientX-o,v=y.clientY-l;Math.abs(v)>p?(y.preventDefault(),this.$input.blur(),s=!1,this._setDraggingStyle(!0,"vertical")):Math.abs(x)>p&&d()}if(!s){const x=y.clientY-c;u-=x*this._step*this._arrowKeyMultiplier(y),h+u>this._max?u=this._max-h:h+u<this._min&&(u=this._min-h),this._snapClampSetValue(h+u)}c=y.clientY},d=()=>{this._setDraggingStyle(!1,"vertical"),this._callOnFinishChange(),window.removeEventListener("mousemove",f),window.removeEventListener("mouseup",d)},g=()=>{this._inputFocused=!0},_=()=>{this._inputFocused=!1,this.updateDisplay(),this._callOnFinishChange()};this.$input.addEventListener("input",t),this.$input.addEventListener("keydown",n),this.$input.addEventListener("wheel",r,{passive:!1}),this.$input.addEventListener("mousedown",m),this.$input.addEventListener("focus",g),this.$input.addEventListener("blur",_)}_initSlider(){this._hasSlider=!0,this.$slider=document.createElement("div"),this.$slider.classList.add("lil-slider"),this.$fill=document.createElement("div"),this.$fill.classList.add("lil-fill"),this.$slider.appendChild(this.$fill),this.$widget.insertBefore(this.$slider,this.$input),this.domElement.classList.add("lil-has-slider");const e=(_,y,x,v,b)=>(_-y)/(x-y)*(b-v)+v,t=_=>{const y=this.$slider.getBoundingClientRect();let x=e(_,y.left,y.right,this._min,this._max);this._snapClampSetValue(x)},i=_=>{this._setDraggingStyle(!0),t(_.clientX),window.addEventListener("mousemove",n),window.addEventListener("mouseup",r)},n=_=>{t(_.clientX)},r=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("mousemove",n),window.removeEventListener("mouseup",r)};let s=!1,o,l;const c=_=>{_.preventDefault(),this._setDraggingStyle(!0),t(_.touches[0].clientX),s=!1},h=_=>{_.touches.length>1||(this._hasScrollBar?(o=_.touches[0].clientX,l=_.touches[0].clientY,s=!0):c(_),window.addEventListener("touchmove",u,{passive:!1}),window.addEventListener("touchend",p))},u=_=>{if(s){const y=_.touches[0].clientX-o,x=_.touches[0].clientY-l;Math.abs(y)>Math.abs(x)?c(_):(window.removeEventListener("touchmove",u),window.removeEventListener("touchend",p))}else _.preventDefault(),t(_.touches[0].clientX)},p=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("touchmove",u),window.removeEventListener("touchend",p)},m=this._callOnFinishChange.bind(this),f=400;let d;const g=_=>{if(Math.abs(_.deltaX)<Math.abs(_.deltaY)&&this._hasScrollBar)return;_.preventDefault();const x=this._normalizeMouseWheel(_)*this._step;this._snapClampSetValue(this.getValue()+x),this.$input.value=this.getValue(),clearTimeout(d),d=setTimeout(m,f)};this.$slider.addEventListener("mousedown",i),this.$slider.addEventListener("touchstart",h,{passive:!1}),this.$slider.addEventListener("wheel",g,{passive:!1})}_setDraggingStyle(e,t="horizontal"){this.$slider&&this.$slider.classList.toggle("lil-active",e),document.body.classList.toggle("lil-dragging",e),document.body.classList.toggle(`lil-${t}`,e)}_getImplicitStep(){return this._hasMin&&this._hasMax?(this._max-this._min)/1e3:.1}_onUpdateMinMax(){!this._hasSlider&&this._hasMin&&this._hasMax&&(this._stepExplicit||this.step(this._getImplicitStep(),!1),this._initSlider(),this.updateDisplay())}_normalizeMouseWheel(e){let{deltaX:t,deltaY:i}=e;return Math.floor(e.deltaY)!==e.deltaY&&e.wheelDelta&&(t=0,i=-e.wheelDelta/120,i*=this._stepExplicit?1:10),t+-i}_arrowKeyMultiplier(e){let t=this._stepExplicit?1:10;return e.shiftKey?t*=10:e.altKey&&(t/=10),t}_snap(e){let t=0;return this._hasMin?t=this._min:this._hasMax&&(t=this._max),e-=t,e=Math.round(e/this._step)*this._step,e+=t,e=parseFloat(e.toPrecision(15)),e}_clamp(e){return e<this._min&&(e=this._min),e>this._max&&(e=this._max),e}_snapClampSetValue(e){this.setValue(this._clamp(this._snap(e)))}get _hasScrollBar(){const e=this.parent.root.$children;return e.scrollHeight>e.clientHeight}get _hasMin(){return this._min!==void 0}get _hasMax(){return this._max!==void 0}}class da extends ve{constructor(e,t,i,n){super(e,t,i,"lil-option"),this.$select=document.createElement("select"),this.$select.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("lil-display"),this.$select.addEventListener("change",()=>{this.setValue(this._values[this.$select.selectedIndex]),this._callOnFinishChange()}),this.$select.addEventListener("focus",()=>{this.$display.classList.add("lil-focus")}),this.$select.addEventListener("blur",()=>{this.$display.classList.remove("lil-focus")}),this.$widget.appendChild(this.$select),this.$widget.appendChild(this.$display),this.$disable=this.$select,this.options(n)}options(e){return this._values=Array.isArray(e)?e:Object.values(e),this._names=Array.isArray(e)?e:Object.keys(e),this.$select.replaceChildren(),this._names.forEach(t=>{const i=document.createElement("option");i.textContent=t,this.$select.appendChild(i)}),this.updateDisplay(),this}updateDisplay(){const e=this.getValue(),t=this._values.indexOf(e);return this.$select.selectedIndex=t,this.$display.textContent=t===-1?e:this._names[t],this}}class pa extends ve{constructor(e,t,i){super(e,t,i,"lil-string"),this.$input=document.createElement("input"),this.$input.setAttribute("type","text"),this.$input.setAttribute("spellcheck","false"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$input.addEventListener("input",()=>{this.setValue(this.$input.value)}),this.$input.addEventListener("keydown",n=>{n.code==="Enter"&&this.$input.blur()}),this.$input.addEventListener("blur",()=>{this._callOnFinishChange()}),this.$widget.appendChild(this.$input),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.value=this.getValue(),this}}var fa=`.lil-gui {
2
2
  font-family: var(--font-family);
3
3
  font-size: var(--font-size);
4
4
  line-height: 1;
@@ -422,7 +422,7 @@
422
422
  }`;function ma(a){const e=document.createElement("style");e.innerHTML=a;const t=document.querySelector("head link[rel=stylesheet], head style");t?document.head.insertBefore(e,t):document.head.appendChild(e)}let dr=!1;class Ni{constructor({parent:e,autoPlace:t=e===void 0,container:i,width:n,title:r="Controls",closeFolders:s=!1,injectStyles:o=!0,touchStyles:l=!0}={}){if(this.parent=e,this.root=e?e.root:this,this.children=[],this.controllers=[],this.folders=[],this._closed=!1,this._hidden=!1,this.domElement=document.createElement("div"),this.domElement.classList.add("lil-gui"),this.$title=document.createElement("button"),this.$title.classList.add("lil-title"),this.$title.setAttribute("aria-expanded",!0),this.$title.addEventListener("click",()=>this.openAnimated(this._closed)),this.$title.addEventListener("touchstart",()=>{},{passive:!0}),this.$children=document.createElement("div"),this.$children.classList.add("lil-children"),this.domElement.appendChild(this.$title),this.domElement.appendChild(this.$children),this.title(r),this.parent){this.parent.children.push(this),this.parent.folders.push(this),this.parent.$children.appendChild(this.domElement);return}this.domElement.classList.add("lil-root"),l&&this.domElement.classList.add("lil-allow-touch-styles"),!dr&&o&&(ma(fa),dr=!0),i?i.appendChild(this.domElement):t&&(this.domElement.classList.add("lil-auto-place","autoPlace"),document.body.appendChild(this.domElement)),n&&this.domElement.style.setProperty("--width",n+"px"),this._closeFolders=s}add(e,t,i,n,r){if(Object(i)===i)return new da(this,e,t,i);const s=e[t];switch(typeof s){case"number":return new ua(this,e,t,i,n,r);case"boolean":return new aa(this,e,t);case"string":return new pa(this,e,t);case"function":return new zi(this,e,t)}console.error(`gui.add failed
423
423
  property:`,t,`
424
424
  object:`,e,`
425
- value:`,s)}addColor(e,t,i=1){return new ha(this,e,t,i)}addFolder(e){const t=new Ni({parent:this,title:e});return this.root._closeFolders&&t.close(),t}load(e,t=!0){return e.controllers&&this.controllers.forEach(i=>{i instanceof zi||i._name in e.controllers&&i.load(e.controllers[i._name])}),t&&e.folders&&this.folders.forEach(i=>{i._title in e.folders&&i.load(e.folders[i._title])}),this}save(e=!0){const t={controllers:{},folders:{}};return this.controllers.forEach(i=>{if(!(i instanceof zi)){if(i._name in t.controllers)throw new Error(`Cannot save GUI with duplicate property "${i._name}"`);t.controllers[i._name]=i.save()}}),e&&this.folders.forEach(i=>{if(i._title in t.folders)throw new Error(`Cannot save GUI with duplicate folder "${i._title}"`);t.folders[i._title]=i.save()}),t}open(e=!0){return this._setClosed(!e),this.$title.setAttribute("aria-expanded",!this._closed),this.domElement.classList.toggle("lil-closed",this._closed),this}close(){return this.open(!1)}_setClosed(e){this._closed!==e&&(this._closed=e,this._callOnOpenClose(this))}show(e=!0){return this._hidden=!e,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}openAnimated(e=!0){return this._setClosed(!e),this.$title.setAttribute("aria-expanded",!this._closed),requestAnimationFrame(()=>{const t=this.$children.clientHeight;this.$children.style.height=t+"px",this.domElement.classList.add("lil-transition");const i=r=>{r.target===this.$children&&(this.$children.style.height="",this.domElement.classList.remove("lil-transition"),this.$children.removeEventListener("transitionend",i))};this.$children.addEventListener("transitionend",i);const n=e?this.$children.scrollHeight:0;this.domElement.classList.toggle("lil-closed",!e),requestAnimationFrame(()=>{this.$children.style.height=n+"px"})}),this}title(e){return this._title=e,this.$title.textContent=e,this}reset(e=!0){return(e?this.controllersRecursive():this.controllers).forEach(i=>i.reset()),this}onChange(e){return this._onChange=e,this}_callOnChange(e){this.parent&&this.parent._callOnChange(e),this._onChange!==void 0&&this._onChange.call(this,{object:e.object,property:e.property,value:e.getValue(),controller:e})}onFinishChange(e){return this._onFinishChange=e,this}_callOnFinishChange(e){this.parent&&this.parent._callOnFinishChange(e),this._onFinishChange!==void 0&&this._onFinishChange.call(this,{object:e.object,property:e.property,value:e.getValue(),controller:e})}onOpenClose(e){return this._onOpenClose=e,this}_callOnOpenClose(e){this.parent&&this.parent._callOnOpenClose(e),this._onOpenClose!==void 0&&this._onOpenClose.call(this,e)}destroy(){this.parent&&(this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.folders.splice(this.parent.folders.indexOf(this),1)),this.domElement.parentElement&&this.domElement.parentElement.removeChild(this.domElement),Array.from(this.children).forEach(e=>e.destroy())}controllersRecursive(){let e=Array.from(this.controllers);return this.folders.forEach(t=>{e=e.concat(t.controllersRecursive())}),e}foldersRecursive(){let e=Array.from(this.folders);return this.folders.forEach(t=>{e=e.concat(t.foldersRecursive())}),e}}function ga(a){return a}function _a(a){if(a==null)return ga;var e,t,i=a.scale[0],n=a.scale[1],r=a.translate[0],s=a.translate[1];return function(o,l){l||(e=t=0);var h=2,c=o.length,u=new Array(c);for(u[0]=(e+=o[0])*i+r,u[1]=(t+=o[1])*n+s;h<c;)u[h]=o[h],++h;return u}}function ya(a,e){for(var t,i=a.length,n=i-e;n<--i;)t=a[n],a[n++]=a[i],a[i]=t}function ba(a,e){return typeof e=="string"&&(e=a.objects[e]),e.type==="GeometryCollection"?{type:"FeatureCollection",features:e.geometries.map(function(t){return pr(a,t)})}:pr(a,e)}function pr(a,e){var t=e.id,i=e.bbox,n=e.properties==null?{}:e.properties,r=xa(a,e);return t==null&&i==null?{type:"Feature",properties:n,geometry:r}:i==null?{type:"Feature",id:t,properties:n,geometry:r}:{type:"Feature",id:t,bbox:i,properties:n,geometry:r}}function xa(a,e){var t=_a(a.transform),i=a.arcs;function n(c,u){u.length&&u.pop();for(var p=i[c<0?~c:c],m=0,f=p.length;m<f;++m)u.push(t(p[m],m));c<0&&ya(u,f)}function r(c){return t(c)}function s(c){for(var u=[],p=0,m=c.length;p<m;++p)n(c[p],u);return u.length<2&&u.push(u[0]),u}function o(c){for(var u=s(c);u.length<4;)u.push(u[0]);return u}function l(c){return c.map(o)}function h(c){var u=c.type,p;switch(u){case"GeometryCollection":return{type:u,geometries:c.geometries.map(h)};case"Point":p=r(c.coordinates);break;case"MultiPoint":p=c.coordinates.map(r);break;case"LineString":p=s(c.arcs);break;case"MultiLineString":p=c.arcs.map(s);break;case"Polygon":p=l(c.arcs);break;case"MultiPolygon":p=c.arcs.map(l);break;default:return null}return{type:u,coordinates:p}}return h(e)}const $i=[{id:"156",code:"CN",name:"China",population:1412,gdpPerCapita:21476,co2Emissions:8,lifeExpectancy:78.2,humanDevIndex:.768,internetUsers:73,renewableEnergy:15,urbanPopulation:64.7,healthExpenditure:5.4,educationExpenditure:3.6,forestArea:23.3,accessElectricity:100},{id:"356",code:"IN",name:"India",population:1408,gdpPerCapita:8379,co2Emissions:1.9,lifeExpectancy:70.8,humanDevIndex:.633,internetUsers:47,renewableEnergy:38,urbanPopulation:35.9,healthExpenditure:3,educationExpenditure:4.5,forestArea:24.3,accessElectricity:99.6},{id:"840",code:"US",name:"United States",population:332,gdpPerCapita:76399,co2Emissions:14.4,lifeExpectancy:77.5,humanDevIndex:.921,internetUsers:92,renewableEnergy:13,urbanPopulation:83.1,healthExpenditure:18.3,educationExpenditure:6.1,forestArea:33.9,accessElectricity:100},{id:"360",code:"ID",name:"Indonesia",population:276,gdpPerCapita:14535,co2Emissions:2.3,lifeExpectancy:71.9,humanDevIndex:.705,internetUsers:62,renewableEnergy:12,urbanPopulation:57.9,healthExpenditure:2.9,educationExpenditure:3.5,forestArea:49.1,accessElectricity:99},{id:"586",code:"PK",name:"Pakistan",population:225,gdpPerCapita:6470,co2Emissions:1,lifeExpectancy:67.3,humanDevIndex:.544,internetUsers:21,renewableEnergy:34,urbanPopulation:37.4,healthExpenditure:2.8,educationExpenditure:2.3,forestArea:1.9,accessElectricity:95},{id:"076",code:"BR",name:"Brazil",population:215,gdpPerCapita:16154,co2Emissions:2.2,lifeExpectancy:76,humanDevIndex:.754,internetUsers:81,renewableEnergy:47,urbanPopulation:87.6,healthExpenditure:10.3,educationExpenditure:6.3,forestArea:59.4,accessElectricity:100},{id:"566",code:"NG",name:"Nigeria",population:219,gdpPerCapita:5860,co2Emissions:.6,lifeExpectancy:53.9,humanDevIndex:.535,internetUsers:36,renewableEnergy:86,urbanPopulation:53,healthExpenditure:3,educationExpenditure:.5,forestArea:7.2,accessElectricity:59.5},{id:"050",code:"BD",name:"Bangladesh",population:167,gdpPerCapita:7066,co2Emissions:.6,lifeExpectancy:73.2,humanDevIndex:.661,internetUsers:39,renewableEnergy:3,urbanPopulation:39.4,healthExpenditure:2.3,educationExpenditure:1.8,forestArea:11.2,accessElectricity:99.4},{id:"643",code:"RU",name:"Russia",population:144,gdpPerCapita:30820,co2Emissions:11.4,lifeExpectancy:72.8,humanDevIndex:.822,internetUsers:85,renewableEnergy:7,urbanPopulation:75.1,healthExpenditure:5.6,educationExpenditure:3.7,forestArea:49.8,accessElectricity:100},{id:"484",code:"MX",name:"Mexico",population:130,gdpPerCapita:20824,co2Emissions:3.5,lifeExpectancy:75.1,humanDevIndex:.758,internetUsers:72,renewableEnergy:9,urbanPopulation:81,healthExpenditure:5.4,educationExpenditure:4.3,forestArea:33.6,accessElectricity:100},{id:"392",code:"JP",name:"Japan",population:125,gdpPerCapita:45546,co2Emissions:8.5,lifeExpectancy:84.6,humanDevIndex:.925,internetUsers:93,renewableEnergy:12,urbanPopulation:91.9,healthExpenditure:11,educationExpenditure:3.4,forestArea:68.4,accessElectricity:100},{id:"231",code:"ET",name:"Ethiopia",population:121,gdpPerCapita:2771,co2Emissions:.2,lifeExpectancy:66.6,humanDevIndex:.498,internetUsers:17,renewableEnergy:93,urbanPopulation:22.2,healthExpenditure:3.5,educationExpenditure:4.5,forestArea:12.5,accessElectricity:51.1},{id:"608",code:"PH",name:"Philippines",population:115,gdpPerCapita:9746,co2Emissions:1.3,lifeExpectancy:72.1,humanDevIndex:.699,internetUsers:53,renewableEnergy:29,urbanPopulation:47.7,healthExpenditure:5.1,educationExpenditure:3.6,forestArea:27,accessElectricity:97.2},{id:"818",code:"EG",name:"Egypt",population:106,gdpPerCapita:14927,co2Emissions:2.4,lifeExpectancy:72,humanDevIndex:.731,internetUsers:72,renewableEnergy:10,urbanPopulation:42.8,healthExpenditure:4.6,educationExpenditure:4,forestArea:.1,accessElectricity:100},{id:"704",code:"VN",name:"Vietnam",population:99,gdpPerCapita:12756,co2Emissions:3.5,lifeExpectancy:75.8,humanDevIndex:.703,internetUsers:70,renewableEnergy:21,urbanPopulation:38.1,healthExpenditure:4.7,educationExpenditure:4.2,forestArea:47.6,accessElectricity:100},{id:"276",code:"DE",name:"Germany",population:84,gdpPerCapita:58780,co2Emissions:8.1,lifeExpectancy:81.4,humanDevIndex:.942,internetUsers:93,renewableEnergy:20,urbanPopulation:77.6,healthExpenditure:12.8,educationExpenditure:4.9,forestArea:32.7,accessElectricity:100},{id:"792",code:"TR",name:"Turkey",population:85,gdpPerCapita:36879,co2Emissions:4.8,lifeExpectancy:78.6,humanDevIndex:.838,internetUsers:83,renewableEnergy:17,urbanPopulation:76.6,healthExpenditure:4.3,educationExpenditure:3.1,forestArea:28.6,accessElectricity:100},{id:"364",code:"IR",name:"Iran",population:87,gdpPerCapita:16261,co2Emissions:8.3,lifeExpectancy:76.7,humanDevIndex:.774,internetUsers:78,renewableEnergy:6,urbanPopulation:76.3,healthExpenditure:5.2,educationExpenditure:3.6,forestArea:6.6,accessElectricity:100},{id:"764",code:"TH",name:"Thailand",population:70,gdpPerCapita:19169,co2Emissions:3.8,lifeExpectancy:79.3,humanDevIndex:.8,internetUsers:78,renewableEnergy:15,urbanPopulation:52.2,healthExpenditure:3.8,educationExpenditure:2.9,forestArea:38.8,accessElectricity:100},{id:"826",code:"GB",name:"United Kingdom",population:68,gdpPerCapita:49675,co2Emissions:4.7,lifeExpectancy:81.8,humanDevIndex:.929,internetUsers:97,renewableEnergy:15,urbanPopulation:84.2,healthExpenditure:12,educationExpenditure:5.5,forestArea:13.2,accessElectricity:100},{id:"250",code:"FR",name:"France",population:68,gdpPerCapita:50728,co2Emissions:4.3,lifeExpectancy:82.7,humanDevIndex:.903,internetUsers:91,renewableEnergy:12,urbanPopulation:81.5,healthExpenditure:12.2,educationExpenditure:5.5,forestArea:31.4,accessElectricity:100},{id:"380",code:"IT",name:"Italy",population:59,gdpPerCapita:45936,co2Emissions:5.3,lifeExpectancy:83.5,humanDevIndex:.895,internetUsers:86,renewableEnergy:20,urbanPopulation:71.3,healthExpenditure:8.7,educationExpenditure:4.3,forestArea:32.1,accessElectricity:100},{id:"710",code:"ZA",name:"South Africa",population:60,gdpPerCapita:15e3,co2Emissions:6.7,lifeExpectancy:65.3,humanDevIndex:.713,internetUsers:70,renewableEnergy:6,urbanPopulation:68,healthExpenditure:8.1,educationExpenditure:6.6,forestArea:7.6,accessElectricity:85},{id:"834",code:"TZ",name:"Tanzania",population:63,gdpPerCapita:2990,co2Emissions:.2,lifeExpectancy:66.2,humanDevIndex:.549,internetUsers:25,renewableEnergy:85,urbanPopulation:37,healthExpenditure:3.8,educationExpenditure:3.4,forestArea:48.1,accessElectricity:42.7},{id:"404",code:"KE",name:"Kenya",population:55,gdpPerCapita:5494,co2Emissions:.4,lifeExpectancy:67,humanDevIndex:.575,internetUsers:29,renewableEnergy:75,urbanPopulation:28.5,healthExpenditure:4.3,educationExpenditure:5.1,forestArea:7.8,accessElectricity:75},{id:"410",code:"KR",name:"South Korea",population:52,gdpPerCapita:50071,co2Emissions:11.5,lifeExpectancy:83.7,humanDevIndex:.925,internetUsers:97,renewableEnergy:4,urbanPopulation:81.4,healthExpenditure:8.4,educationExpenditure:5.1,forestArea:63.4,accessElectricity:100},{id:"170",code:"CO",name:"Colombia",population:52,gdpPerCapita:17063,co2Emissions:1.8,lifeExpectancy:77.3,humanDevIndex:.752,internetUsers:73,renewableEnergy:27,urbanPopulation:81.7,healthExpenditure:7.7,educationExpenditure:4.5,forestArea:52.7,accessElectricity:100},{id:"724",code:"ES",name:"Spain",population:47,gdpPerCapita:42190,co2Emissions:5,lifeExpectancy:83.6,humanDevIndex:.905,internetUsers:94,renewableEnergy:21,urbanPopulation:81.1,healthExpenditure:10.7,educationExpenditure:4.8,forestArea:37.4,accessElectricity:100},{id:"032",code:"AR",name:"Argentina",population:46,gdpPerCapita:24678,co2Emissions:3.8,lifeExpectancy:77.1,humanDevIndex:.842,internetUsers:87,renewableEnergy:13,urbanPopulation:92.2,healthExpenditure:10,educationExpenditure:5,forestArea:10.5,accessElectricity:100},{id:"800",code:"UG",name:"Uganda",population:48,gdpPerCapita:2566,co2Emissions:.1,lifeExpectancy:64.4,humanDevIndex:.525,internetUsers:18,renewableEnergy:89,urbanPopulation:25.6,healthExpenditure:3.8,educationExpenditure:2.7,forestArea:9.7,accessElectricity:46},{id:"012",code:"DZ",name:"Algeria",population:45,gdpPerCapita:12667,co2Emissions:3.7,lifeExpectancy:77.1,humanDevIndex:.745,internetUsers:71,renewableEnergy:1,urbanPopulation:74.3,healthExpenditure:5.3,educationExpenditure:5.6,forestArea:.8,accessElectricity:100},{id:"804",code:"UA",name:"Ukraine",population:41,gdpPerCapita:14220,co2Emissions:4.5,lifeExpectancy:72.1,humanDevIndex:.773,internetUsers:75,renewableEnergy:8,urbanPopulation:69.6,healthExpenditure:7,educationExpenditure:5.4,forestArea:16.7,accessElectricity:100},{id:"368",code:"IQ",name:"Iraq",population:43,gdpPerCapita:10474,co2Emissions:4,lifeExpectancy:71.1,humanDevIndex:.686,internetUsers:75,renewableEnergy:3,urbanPopulation:71.1,healthExpenditure:4.6,educationExpenditure:4.7,forestArea:1.9,accessElectricity:100},{id:"616",code:"PL",name:"Poland",population:38,gdpPerCapita:40343,co2Emissions:8,lifeExpectancy:78.7,humanDevIndex:.876,internetUsers:87,renewableEnergy:17,urbanPopulation:60,healthExpenditure:6.5,educationExpenditure:4.6,forestArea:30.9,accessElectricity:100},{id:"124",code:"CA",name:"Canada",population:39,gdpPerCapita:54966,co2Emissions:14.3,lifeExpectancy:82.4,humanDevIndex:.936,internetUsers:93,renewableEnergy:18,urbanPopulation:81.8,healthExpenditure:12.8,educationExpenditure:5.3,forestArea:38.7,accessElectricity:100},{id:"504",code:"MA",name:"Morocco",population:37,gdpPerCapita:9339,co2Emissions:1.9,lifeExpectancy:77,humanDevIndex:.683,internetUsers:84,renewableEnergy:13,urbanPopulation:64.6,healthExpenditure:5.3,educationExpenditure:6.8,forestArea:12.8,accessElectricity:100},{id:"682",code:"SA",name:"Saudi Arabia",population:36,gdpPerCapita:56817,co2Emissions:15.3,lifeExpectancy:76.9,humanDevIndex:.875,internetUsers:98,renewableEnergy:0,urbanPopulation:84.7,healthExpenditure:6.4,educationExpenditure:5.1,forestArea:.5,accessElectricity:100},{id:"604",code:"PE",name:"Peru",population:34,gdpPerCapita:14225,co2Emissions:1.6,lifeExpectancy:77.4,humanDevIndex:.762,internetUsers:71,renewableEnergy:25,urbanPopulation:78.6,healthExpenditure:5.2,educationExpenditure:4,forestArea:57.3,accessElectricity:97},{id:"036",code:"AU",name:"Australia",population:26,gdpPerCapita:59934,co2Emissions:15,lifeExpectancy:84,humanDevIndex:.951,internetUsers:96,renewableEnergy:12,urbanPopulation:86.4,healthExpenditure:10.7,educationExpenditure:6.1,forestArea:17.4,accessElectricity:100},{id:"458",code:"MY",name:"Malaysia",population:34,gdpPerCapita:33550,co2Emissions:7.6,lifeExpectancy:76.9,humanDevIndex:.803,internetUsers:90,renewableEnergy:8,urbanPopulation:78,healthExpenditure:3.8,educationExpenditure:3.9,forestArea:57.7,accessElectricity:100},{id:"288",code:"GH",name:"Ghana",population:33,gdpPerCapita:6754,co2Emissions:.6,lifeExpectancy:64.9,humanDevIndex:.632,internetUsers:53,renewableEnergy:42,urbanPopulation:58,healthExpenditure:3.4,educationExpenditure:4,forestArea:34.5,accessElectricity:85.9},{id:"524",code:"NP",name:"Nepal",population:30,gdpPerCapita:4199,co2Emissions:.5,lifeExpectancy:71.7,humanDevIndex:.602,internetUsers:48,renewableEnergy:86,urbanPopulation:21,healthExpenditure:4.4,educationExpenditure:4.2,forestArea:25.4,accessElectricity:90},{id:"862",code:"VE",name:"Venezuela",population:29,gdpPerCapita:7045,co2Emissions:3.1,lifeExpectancy:72.1,humanDevIndex:.691,internetUsers:72,renewableEnergy:68,urbanPopulation:88.3,healthExpenditure:3.9,educationExpenditure:6.9,forestArea:52.1,accessElectricity:99.9},{id:"450",code:"MG",name:"Madagascar",population:29,gdpPerCapita:1724,co2Emissions:.2,lifeExpectancy:67,humanDevIndex:.501,internetUsers:10,renewableEnergy:68,urbanPopulation:39.5,healthExpenditure:3.9,educationExpenditure:2.9,forestArea:21.4,accessElectricity:34},{id:"120",code:"CM",name:"Cameroon",population:28,gdpPerCapita:3977,co2Emissions:.4,lifeExpectancy:60.3,humanDevIndex:.576,internetUsers:34,renewableEnergy:74,urbanPopulation:58.4,healthExpenditure:3.3,educationExpenditure:3.2,forestArea:45.6,accessElectricity:65},{id:"528",code:"NL",name:"Netherlands",population:18,gdpPerCapita:64654,co2Emissions:8.1,lifeExpectancy:82.3,humanDevIndex:.941,internetUsers:98,renewableEnergy:13,urbanPopulation:92.5,healthExpenditure:11.2,educationExpenditure:5.3,forestArea:11.2,accessElectricity:100},{id:"152",code:"CL",name:"Chile",population:19,gdpPerCapita:28526,co2Emissions:4.3,lifeExpectancy:80.7,humanDevIndex:.855,internetUsers:88,renewableEnergy:27,urbanPopulation:87.9,healthExpenditure:9.3,educationExpenditure:5.4,forestArea:24.4,accessElectricity:100},{id:"752",code:"SE",name:"Sweden",population:10,gdpPerCapita:60239,co2Emissions:3.5,lifeExpectancy:83.2,humanDevIndex:.947,internetUsers:96,renewableEnergy:56,urbanPopulation:88.2,healthExpenditure:11.4,educationExpenditure:7.6,forestArea:68.9,accessElectricity:100},{id:"578",code:"NO",name:"Norway",population:5,gdpPerCapita:82236,co2Emissions:7.5,lifeExpectancy:83.2,humanDevIndex:.961,internetUsers:98,renewableEnergy:72,urbanPopulation:83.4,healthExpenditure:11.4,educationExpenditure:7.9,forestArea:33.2,accessElectricity:100},{id:"702",code:"SG",name:"Singapore",population:6,gdpPerCapita:116527,co2Emissions:8.9,lifeExpectancy:84.1,humanDevIndex:.939,internetUsers:96,renewableEnergy:2,urbanPopulation:100,healthExpenditure:6.1,educationExpenditure:2.9,forestArea:22.5,accessElectricity:100},{id:"554",code:"NZ",name:"New Zealand",population:5,gdpPerCapita:48249,co2Emissions:6.8,lifeExpectancy:82.5,humanDevIndex:.937,internetUsers:95,renewableEnergy:40,urbanPopulation:86.7,healthExpenditure:9.7,educationExpenditure:6.3,forestArea:38.6,accessElectricity:100},{id:"372",code:"IE",name:"Ireland",population:5,gdpPerCapita:106998,co2Emissions:7.3,lifeExpectancy:82.8,humanDevIndex:.945,internetUsers:94,renewableEnergy:14,urbanPopulation:64.2,healthExpenditure:7.1,educationExpenditure:3.5,forestArea:11,accessElectricity:100},{id:"376",code:"IL",name:"Israel",population:9,gdpPerCapita:52170,co2Emissions:6.9,lifeExpectancy:83.5,humanDevIndex:.919,internetUsers:90,renewableEnergy:6,urbanPopulation:92.8,healthExpenditure:7.5,educationExpenditure:7.1,forestArea:7.6,accessElectricity:100},{id:"784",code:"AE",name:"United Arab Emirates",population:10,gdpPerCapita:77272,co2Emissions:20.7,lifeExpectancy:78.7,humanDevIndex:.911,internetUsers:100,renewableEnergy:1,urbanPopulation:87.4,healthExpenditure:5,educationExpenditure:3.9,forestArea:4.5,accessElectricity:100},{id:"756",code:"CH",name:"Switzerland",population:9,gdpPerCapita:81867,co2Emissions:4,lifeExpectancy:84,humanDevIndex:.962,internetUsers:96,renewableEnergy:28,urbanPopulation:74,healthExpenditure:11.3,educationExpenditure:5,forestArea:31.9,accessElectricity:100},{id:"040",code:"AT",name:"Austria",population:9,gdpPerCapita:58013,co2Emissions:6.8,lifeExpectancy:82,humanDevIndex:.916,internetUsers:93,renewableEnergy:36,urbanPopulation:59,healthExpenditure:10.4,educationExpenditure:5.4,forestArea:47.3,accessElectricity:100},{id:"620",code:"PT",name:"Portugal",population:10,gdpPerCapita:38147,co2Emissions:4,lifeExpectancy:82.6,humanDevIndex:.866,internetUsers:85,renewableEnergy:34,urbanPopulation:66.8,healthExpenditure:10.6,educationExpenditure:5,forestArea:36.1,accessElectricity:100},{id:"300",code:"GR",name:"Greece",population:10,gdpPerCapita:33393,co2Emissions:5.3,lifeExpectancy:81.4,humanDevIndex:.887,internetUsers:79,renewableEnergy:22,urbanPopulation:80.1,healthExpenditure:7.8,educationExpenditure:4.4,forestArea:32.5,accessElectricity:100},{id:"203",code:"CZ",name:"Czech Republic",population:11,gdpPerCapita:45499,co2Emissions:9.3,lifeExpectancy:79.4,humanDevIndex:.889,internetUsers:88,renewableEnergy:17,urbanPopulation:74.1,healthExpenditure:9.2,educationExpenditure:4.4,forestArea:34.7,accessElectricity:100},{id:"056",code:"BE",name:"Belgium",population:12,gdpPerCapita:55521,co2Emissions:8,lifeExpectancy:82.2,humanDevIndex:.937,internetUsers:94,renewableEnergy:13,urbanPopulation:98.1,healthExpenditure:11.1,educationExpenditure:6.4,forestArea:22.8,accessElectricity:100},{id:"348",code:"HU",name:"Hungary",population:10,gdpPerCapita:37935,co2Emissions:4.6,lifeExpectancy:77,humanDevIndex:.846,internetUsers:89,renewableEnergy:14,urbanPopulation:72.3,healthExpenditure:6.4,educationExpenditure:4.6,forestArea:22.9,accessElectricity:100},{id:"246",code:"FI",name:"Finland",population:6,gdpPerCapita:53654,co2Emissions:6.5,lifeExpectancy:82.2,humanDevIndex:.94,internetUsers:96,renewableEnergy:44,urbanPopulation:85.5,healthExpenditure:9.6,educationExpenditure:6.3,forestArea:73.7,accessElectricity:100},{id:"208",code:"DK",name:"Denmark",population:6,gdpPerCapita:67803,co2Emissions:4.4,lifeExpectancy:81.6,humanDevIndex:.948,internetUsers:98,renewableEnergy:40,urbanPopulation:88.2,healthExpenditure:10.5,educationExpenditure:6.9,forestArea:14.7,accessElectricity:100},{id:"352",code:"IS",name:"Iceland",population:.4,gdpPerCapita:68727,co2Emissions:9.7,lifeExpectancy:83.1,humanDevIndex:.959,internetUsers:99,renewableEnergy:85,urbanPopulation:93.9,healthExpenditure:8.9,educationExpenditure:7.7,forestArea:.5,accessElectricity:100},{id:"180",code:"CD",name:"DR Congo",population:99,gdpPerCapita:1099,co2Emissions:.04,lifeExpectancy:60.7,humanDevIndex:.479,internetUsers:9,renewableEnergy:97,urbanPopulation:46.2,healthExpenditure:3.3,educationExpenditure:1.5,forestArea:67.3,accessElectricity:19.1},{id:"729",code:"SD",name:"Sudan",population:46,gdpPerCapita:4232,co2Emissions:.5,lifeExpectancy:66.1,humanDevIndex:.508,internetUsers:31,renewableEnergy:62,urbanPopulation:35.6,healthExpenditure:4.5,educationExpenditure:2.2,forestArea:9.7,accessElectricity:55.5},{id:"024",code:"AO",name:"Angola",population:35,gdpPerCapita:6938,co2Emissions:.8,lifeExpectancy:62,humanDevIndex:.586,internetUsers:36,renewableEnergy:55,urbanPopulation:68.1,healthExpenditure:2.6,educationExpenditure:2.4,forestArea:46.3,accessElectricity:46},{id:"508",code:"MZ",name:"Mozambique",population:33,gdpPerCapita:1346,co2Emissions:.2,lifeExpectancy:60.9,humanDevIndex:.456,internetUsers:10,renewableEnergy:79,urbanPopulation:38,healthExpenditure:7.5,educationExpenditure:5.5,forestArea:48.2,accessElectricity:31},{id:"384",code:"CI",name:"Ivory Coast",population:28,gdpPerCapita:5972,co2Emissions:.4,lifeExpectancy:59.3,humanDevIndex:.55,internetUsers:45,renewableEnergy:68,urbanPopulation:52.7,healthExpenditure:3.3,educationExpenditure:3.4,forestArea:9.3,accessElectricity:70},{id:"562",code:"NE",name:"Niger",population:26,gdpPerCapita:1318,co2Emissions:.1,lifeExpectancy:63,humanDevIndex:.4,internetUsers:5,renewableEnergy:80,urbanPopulation:16.8,healthExpenditure:5.2,educationExpenditure:3.5,forestArea:.9,accessElectricity:19.3},{id:"854",code:"BF",name:"Burkina Faso",population:22,gdpPerCapita:2445,co2Emissions:.2,lifeExpectancy:62.7,humanDevIndex:.449,internetUsers:18,renewableEnergy:79,urbanPopulation:31.5,healthExpenditure:5.6,educationExpenditure:5.4,forestArea:19.3,accessElectricity:19},{id:"466",code:"ML",name:"Mali",population:22,gdpPerCapita:2462,co2Emissions:.2,lifeExpectancy:59.3,humanDevIndex:.428,internetUsers:27,renewableEnergy:76,urbanPopulation:44.6,healthExpenditure:3.8,educationExpenditure:3.8,forestArea:3.9,accessElectricity:53},{id:"686",code:"SN",name:"Senegal",population:17,gdpPerCapita:3942,co2Emissions:.7,lifeExpectancy:68.6,humanDevIndex:.511,internetUsers:58,renewableEnergy:47,urbanPopulation:48.6,healthExpenditure:3.5,educationExpenditure:5.5,forestArea:42.5,accessElectricity:70.4},{id:"894",code:"ZM",name:"Zambia",population:20,gdpPerCapita:3574,co2Emissions:.4,lifeExpectancy:65,humanDevIndex:.565,internetUsers:16,renewableEnergy:88,urbanPopulation:45.2,healthExpenditure:4.9,educationExpenditure:4.6,forestArea:59.8,accessElectricity:43},{id:"716",code:"ZW",name:"Zimbabwe",population:16,gdpPerCapita:2622,co2Emissions:.8,lifeExpectancy:61.5,humanDevIndex:.593,internetUsers:35,renewableEnergy:78,urbanPopulation:32.2,healthExpenditure:3.4,educationExpenditure:5,forestArea:36.4,accessElectricity:49},{id:"646",code:"RW",name:"Rwanda",population:14,gdpPerCapita:2359,co2Emissions:.1,lifeExpectancy:69.6,humanDevIndex:.534,internetUsers:30,renewableEnergy:84,urbanPopulation:17.6,healthExpenditure:7.5,educationExpenditure:3.1,forestArea:28.8,accessElectricity:48},{id:"004",code:"AF",name:"Afghanistan",population:41,gdpPerCapita:2065,co2Emissions:.2,lifeExpectancy:62,humanDevIndex:.478,internetUsers:18,renewableEnergy:45,urbanPopulation:26.3,healthExpenditure:18.2,educationExpenditure:4.1,forestArea:1.9,accessElectricity:97.7},{id:"104",code:"MM",name:"Myanmar",population:55,gdpPerCapita:5699,co2Emissions:.6,lifeExpectancy:67.8,humanDevIndex:.585,internetUsers:44,renewableEnergy:51,urbanPopulation:31.4,healthExpenditure:4.8,educationExpenditure:2,forestArea:42.2,accessElectricity:70},{id:"408",code:"KP",name:"North Korea",population:26,gdpPerCapita:1800,co2Emissions:2,lifeExpectancy:72.6,humanDevIndex:.733,internetUsers:0,renewableEnergy:12,urbanPopulation:63,healthExpenditure:6,educationExpenditure:4,forestArea:41,accessElectricity:26},{id:"496",code:"MN",name:"Mongolia",population:3.4,gdpPerCapita:12896,co2Emissions:14,lifeExpectancy:70.9,humanDevIndex:.739,internetUsers:84,renewableEnergy:7,urbanPopulation:68.8,healthExpenditure:4,educationExpenditure:4.7,forestArea:7.1,accessElectricity:100},{id:"144",code:"LK",name:"Sri Lanka",population:22,gdpPerCapita:14509,co2Emissions:1,lifeExpectancy:77.4,humanDevIndex:.782,internetUsers:47,renewableEnergy:51,urbanPopulation:18.9,healthExpenditure:3.8,educationExpenditure:2.1,forestArea:29.4,accessElectricity:100},{id:"398",code:"KZ",name:"Kazakhstan",population:19,gdpPerCapita:30500,co2Emissions:13.2,lifeExpectancy:74.4,humanDevIndex:.811,internetUsers:91,renewableEnergy:2,urbanPopulation:57.8,healthExpenditure:2.8,educationExpenditure:2.9,forestArea:1.2,accessElectricity:100},{id:"860",code:"UZ",name:"Uzbekistan",population:35,gdpPerCapita:9127,co2Emissions:3.5,lifeExpectancy:73.8,humanDevIndex:.727,internetUsers:71,renewableEnergy:11,urbanPopulation:50.4,healthExpenditure:6.8,educationExpenditure:5.3,forestArea:7.7,accessElectricity:100},{id:"192",code:"CU",name:"Cuba",population:11,gdpPerCapita:9478,co2Emissions:2.3,lifeExpectancy:79,humanDevIndex:.764,internetUsers:71,renewableEnergy:32,urbanPopulation:77.2,healthExpenditure:11.7,educationExpenditure:12.8,forestArea:33,accessElectricity:100},{id:"218",code:"EC",name:"Ecuador",population:18,gdpPerCapita:12171,co2Emissions:2.3,lifeExpectancy:77.9,humanDevIndex:.74,internetUsers:70,renewableEnergy:31,urbanPopulation:64.2,healthExpenditure:8.3,educationExpenditure:4.4,forestArea:50.1,accessElectricity:100},{id:"320",code:"GT",name:"Guatemala",population:18,gdpPerCapita:9547,co2Emissions:1,lifeExpectancy:74.3,humanDevIndex:.627,internetUsers:51,renewableEnergy:62,urbanPopulation:52.4,healthExpenditure:5.8,educationExpenditure:3.4,forestArea:33,accessElectricity:98},{id:"068",code:"BO",name:"Bolivia",population:12,gdpPerCapita:9484,co2Emissions:1.8,lifeExpectancy:72.1,humanDevIndex:.692,internetUsers:66,renewableEnergy:24,urbanPopulation:70.4,healthExpenditure:6.9,educationExpenditure:7.3,forestArea:50.1,accessElectricity:99.3},{id:"340",code:"HN",name:"Honduras",population:10,gdpPerCapita:6289,co2Emissions:1,lifeExpectancy:75.3,humanDevIndex:.621,internetUsers:48,renewableEnergy:61,urbanPopulation:59,healthExpenditure:7.9,educationExpenditure:6.1,forestArea:38.1,accessElectricity:94},{id:"600",code:"PY",name:"Paraguay",population:7,gdpPerCapita:15030,co2Emissions:1.1,lifeExpectancy:74.3,humanDevIndex:.717,internetUsers:77,renewableEnergy:78,urbanPopulation:62.5,healthExpenditure:7.6,educationExpenditure:3.4,forestArea:38.6,accessElectricity:100},{id:"858",code:"UY",name:"Uruguay",population:3.5,gdpPerCapita:25041,co2Emissions:2,lifeExpectancy:78.4,humanDevIndex:.83,internetUsers:87,renewableEnergy:55,urbanPopulation:95.6,healthExpenditure:9.3,educationExpenditure:5,forestArea:10.5,accessElectricity:100},{id:"188",code:"CR",name:"Costa Rica",population:5,gdpPerCapita:23101,co2Emissions:1.5,lifeExpectancy:80.8,humanDevIndex:.809,internetUsers:81,renewableEnergy:73,urbanPopulation:81.4,healthExpenditure:7.3,educationExpenditure:6.7,forestArea:59,accessElectricity:100},{id:"591",code:"PA",name:"Panama",population:4.4,gdpPerCapita:35317,co2Emissions:2.5,lifeExpectancy:79.2,humanDevIndex:.805,internetUsers:68,renewableEnergy:35,urbanPopulation:68.4,healthExpenditure:7.3,educationExpenditure:3.2,forestArea:62.1,accessElectricity:95}],va=[{id:"humanDevIndex",name:"Human Development Index",unit:"",description:"UN composite index of life expectancy, education, and income",colorScale:["#fee5d9","#fcae91","#cb181d"],domain:[.4,1],accessor:a=>a.humanDevIndex,format:a=>a.toFixed(3)},{id:"gdpPerCapita",name:"GDP per Capita (PPP)",unit:"$",description:"Purchasing power parity adjusted GDP per person",colorScale:["#edf8e9","#74c476","#006d2c"],domain:[1e3,8e4],accessor:a=>a.gdpPerCapita,format:a=>`$${(a/1e3).toFixed(1)}k`},{id:"co2Emissions",name:"CO₂ Emissions",unit:"t/capita",description:"Carbon dioxide emissions per capita",colorScale:["#f7fbff","#6baed6","#08306b"],domain:[0,20],accessor:a=>a.co2Emissions,format:a=>`${a.toFixed(1)}t`},{id:"lifeExpectancy",name:"Life Expectancy",unit:"years",description:"Average life expectancy at birth",colorScale:["#feedde","#fdbe85","#d94701"],domain:[55,85],accessor:a=>a.lifeExpectancy,format:a=>`${a.toFixed(1)} yrs`},{id:"renewableEnergy",name:"Renewable Energy",unit:"%",description:"Share of renewable energy in total energy consumption",colorScale:["#f7fcf5","#74c476","#00441b"],domain:[0,100],accessor:a=>a.renewableEnergy,format:a=>`${a.toFixed(0)}%`},{id:"internetUsers",name:"Internet Penetration",unit:"%",description:"Percentage of population using the internet",colorScale:["#f2f0f7","#9e9ac8","#54278f"],domain:[0,100],accessor:a=>a.internetUsers,format:a=>`${a.toFixed(0)}%`},{id:"urbanPopulation",name:"Urbanization",unit:"%",description:"Percentage of population living in urban areas",colorScale:["#fff5eb","#fd8d3c","#7f2704"],domain:[15,100],accessor:a=>a.urbanPopulation,format:a=>`${a.toFixed(0)}%`},{id:"healthExpenditure",name:"Health Spending",unit:"% GDP",description:"Total health expenditure as percentage of GDP",colorScale:["#fff5f0","#fb6a4a","#99000d"],domain:[2,18],accessor:a=>a.healthExpenditure,format:a=>`${a.toFixed(1)}%`},{id:"forestArea",name:"Forest Coverage",unit:"%",description:"Forest area as percentage of total land area",colorScale:["#f7fcf5","#41ab5d","#00441b"],domain:[0,75],accessor:a=>a.forestArea,format:a=>`${a.toFixed(0)}%`},{id:"accessElectricity",name:"Electricity Access",unit:"%",description:"Percentage of population with access to electricity",colorScale:["#ffffd4","#fed98e","#cc4c02"],domain:[15,100],accessor:a=>a.accessElectricity,format:a=>`${a.toFixed(0)}%`}];function Ea(a,e){const[t,i]=a.domain;return Math.max(0,Math.min(1,(e-t)/(i-t)))}const wa={US:"840",USA:"840","UNITED STATES":"840",AMERICA:"840",CA:"124",CAN:"124",CANADA:"124",MX:"484",MEX:"484",MEXICO:"484",DE:"276",DEU:"276",GERMANY:"276",DEUTSCHLAND:"276",FR:"250",FRA:"250",FRANCE:"250",GB:"826",GBR:"826",UK:"826","UNITED KINGDOM":"826",BRITAIN:"826",ENGLAND:"826",IT:"380",ITA:"380",ITALY:"380",ES:"724",ESP:"724",SPAIN:"724",PT:"620",PRT:"620",PORTUGAL:"620",NL:"528",NLD:"528",NETHERLANDS:"528",HOLLAND:"528",BE:"056",BEL:"056",BELGIUM:"056",AT:"040",AUT:"040",AUSTRIA:"040",CH:"756",CHE:"756",SWITZERLAND:"756",PL:"616",POL:"616",POLAND:"616",SE:"752",SWE:"752",SWEDEN:"752",NO:"578",NOR:"578",NORWAY:"578",DK:"208",DNK:"208",DENMARK:"208",FI:"246",FIN:"246",FINLAND:"246",IE:"372",IRL:"372",IRELAND:"372",GR:"300",GRC:"300",GREECE:"300",CZ:"203",CZE:"203","CZECH REPUBLIC":"203",CZECHIA:"203",RO:"642",ROU:"642",ROMANIA:"642",HU:"348",HUN:"348",HUNGARY:"348",UA:"804",UKR:"804",UKRAINE:"804",RU:"643",RUS:"643",RUSSIA:"643","RUSSIAN FEDERATION":"643",CN:"156",CHN:"156",CHINA:"156",JP:"392",JPN:"392",JAPAN:"392",KR:"410",KOR:"410","SOUTH KOREA":"410",KOREA:"410",IN:"356",IND:"356",INDIA:"356",ID:"360",IDN:"360",INDONESIA:"360",TH:"764",THA:"764",THAILAND:"764",VN:"704",VNM:"704",VIETNAM:"704",PH:"608",PHL:"608",PHILIPPINES:"608",MY:"458",MYS:"458",MALAYSIA:"458",SG:"702",SGP:"702",SINGAPORE:"702",PK:"586",PAK:"586",PAKISTAN:"586",BD:"050",BGD:"050",BANGLADESH:"050",TR:"792",TUR:"792",TURKEY:"792",TURKIYE:"792",SA:"682",SAU:"682","SAUDI ARABIA":"682",AE:"784",ARE:"784",UAE:"784","UNITED ARAB EMIRATES":"784",IL:"376",ISR:"376",ISRAEL:"376",IR:"364",IRN:"364",IRAN:"364",IQ:"368",IRQ:"368",IRAQ:"368",AU:"036",AUS:"036",AUSTRALIA:"036",NZ:"554",NZL:"554","NEW ZEALAND":"554",BR:"076",BRA:"076",BRAZIL:"076",AR:"032",ARG:"032",ARGENTINA:"032",CL:"152",CHL:"152",CHILE:"152",CO:"170",COL:"170",COLOMBIA:"170",PE:"604",PER:"604",PERU:"604",VE:"862",VEN:"862",VENEZUELA:"862",ZA:"710",ZAF:"710","SOUTH AFRICA":"710",EG:"818",EGY:"818",EGYPT:"818",NG:"566",NGA:"566",NIGERIA:"566",KE:"404",KEN:"404",KENYA:"404",ET:"231",ETH:"231",ETHIOPIA:"231",MA:"504",MAR:"504",MOROCCO:"504",DZ:"012",DZA:"012",ALGERIA:"012",TN:"788",TUN:"788",TUNISIA:"788",GH:"288",GHA:"288",GHANA:"288"};function Bi(a){const e=a.toUpperCase().trim();return/^\d{1,3}$/.test(a)?a.padStart(3,"0"):wa[e]||a}function fr(a){const e={};return a instanceof Map?a.forEach((t,i)=>{e[Bi(i)]=t}):Object.entries(a).forEach(([t,i])=>{e[Bi(t)]=i}),e}const Gt=2048,jt=1024;class Ca{canvas;ctx;countries=[];loaded=!1;statsMap;constructor(){this.canvas=document.createElement("canvas"),this.canvas.width=Gt,this.canvas.height=jt,this.ctx=this.canvas.getContext("2d"),this.statsMap=new Map,$i.forEach(e=>{this.statsMap.set(e.id,e)}),this.loadCountries()}async loadCountries(){try{const t=await(await fetch("https://cdn.jsdelivr.net/npm/world-atlas@2/countries-110m.json")).json(),i=ba(t,t.objects.countries);this.countries=i.features,this.loaded=!0,console.log(`Loaded ${this.countries.length} country boundaries`)}catch(e){console.error("Failed to load country boundaries:",e)}}async waitForLoad(){for(;!this.loaded;)await new Promise(e=>setTimeout(e,100))}renderTexture(e){return this.ctx.fillStyle="#1a3a5c",this.ctx.fillRect(0,0,Gt,jt),this.loaded?(this.countries.forEach(t=>{const i=this.statsMap.get(t.id);if(i){const n=e.accessor(i),r=Ea(e,n),s=this.interpolateColor(e.colorScale,r);this.ctx.fillStyle=s}else this.ctx.fillStyle="#2a2a2a";this.drawCountry(t)}),this.ctx.strokeStyle="rgba(0, 0, 0, 0.3)",this.ctx.lineWidth=.5,this.countries.forEach(t=>{this.strokeCountry(t)}),this.canvas):this.canvas}drawCountry(e){const{geometry:t}=e;t.type==="Polygon"?this.drawPolygon(t.coordinates):t.type==="MultiPolygon"&&t.coordinates.forEach(i=>{this.drawPolygon(i)})}strokeCountry(e){const{geometry:t}=e;t.type==="Polygon"?this.strokePolygon(t.coordinates):t.type==="MultiPolygon"&&t.coordinates.forEach(i=>{this.strokePolygon(i)})}drawPolygon(e){this.ctx.beginPath(),e.forEach(t=>{let i=null;t.forEach((n,r)=>{const s=n[0],o=n[1],[l,h]=this.projectPoint(s,o),c=i!==null&&Math.abs(s-i)>180;r===0?this.ctx.moveTo(l,h):c?this.ctx.moveTo(l,h):this.ctx.lineTo(l,h),i=s}),this.ctx.closePath()}),this.ctx.fill("evenodd")}strokePolygon(e){e.forEach(t=>{this.ctx.beginPath();let i=null;t.forEach((n,r)=>{const s=n[0],o=n[1],[l,h]=this.projectPoint(s,o),c=i!==null&&Math.abs(s-i)>180;r===0?this.ctx.moveTo(l,h):c?(this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(l,h)):this.ctx.lineTo(l,h),i=s}),this.ctx.stroke()})}projectPoint(e,t){const i=(e+180)/360*Gt,n=(90-t)/180*jt;return[i,n]}interpolateColor(e,t){const i=c=>({r:parseInt(c.slice(1,3),16),g:parseInt(c.slice(3,5),16),b:parseInt(c.slice(5,7),16)}),[n,r,s]=e.map(i);let o,l,h;if(t<.5){const c=t*2;o=Math.round(n.r+(r.r-n.r)*c),l=Math.round(n.g+(r.g-n.g)*c),h=Math.round(n.b+(r.b-n.b)*c)}else{const c=(t-.5)*2;o=Math.round(r.r+(s.r-r.r)*c),l=Math.round(r.g+(s.g-r.g)*c),h=Math.round(r.b+(s.b-r.b)*c)}return`rgb(${o}, ${l}, ${h})`}renderCustomTexture(e,t,i){if(this.ctx.fillStyle="#1a3a5c",this.ctx.fillRect(0,0,Gt,jt),!this.loaded)return this.canvas;const n=fr(e);return this.countries.forEach(r=>{const s=n[r.id];if(s!==void 0){const o=Math.max(0,Math.min(1,(s-i[0])/(i[1]-i[0]))),l=this.interpolateColor(t,o);this.ctx.fillStyle=l}else this.ctx.fillStyle="#2a2a2a";this.drawCountry(r)}),this.ctx.strokeStyle="rgba(0, 0, 0, 0.3)",this.ctx.lineWidth=.5,this.countries.forEach(r=>{this.strokeCountry(r)}),this.canvas}getCanvas(){return this.canvas}getDataURL(){return this.canvas.toDataURL("image/png")}}function Vi(a){return a==="%"?e=>`${e.toFixed(1)}%`:a==="$"?e=>`$${e.toLocaleString()}`:a==="years"?e=>`${e.toFixed(1)} yrs`:a.includes("per capita")||a.includes("per 100")||a.includes("per 1000")?e=>`${e.toFixed(1)}`:a==="% GDP"||a==="% of GDP"?e=>`${e.toFixed(1)}%`:a===""||a==="index"?e=>e.toFixed(3):e=>{const t=Number.isInteger(e)?e.toLocaleString():e.toFixed(1);return a?`${t} ${a}`:t}}function Pa(a,e,t){return(t??Vi(e))(a)}let mr=!1;function Aa(){if(mr)return;mr=!0;const a=document.createElement("style");a.setAttribute("data-gralobe-legend","true"),a.textContent=`
425
+ value:`,s)}addColor(e,t,i=1){return new ca(this,e,t,i)}addFolder(e){const t=new Ni({parent:this,title:e});return this.root._closeFolders&&t.close(),t}load(e,t=!0){return e.controllers&&this.controllers.forEach(i=>{i instanceof zi||i._name in e.controllers&&i.load(e.controllers[i._name])}),t&&e.folders&&this.folders.forEach(i=>{i._title in e.folders&&i.load(e.folders[i._title])}),this}save(e=!0){const t={controllers:{},folders:{}};return this.controllers.forEach(i=>{if(!(i instanceof zi)){if(i._name in t.controllers)throw new Error(`Cannot save GUI with duplicate property "${i._name}"`);t.controllers[i._name]=i.save()}}),e&&this.folders.forEach(i=>{if(i._title in t.folders)throw new Error(`Cannot save GUI with duplicate folder "${i._title}"`);t.folders[i._title]=i.save()}),t}open(e=!0){return this._setClosed(!e),this.$title.setAttribute("aria-expanded",!this._closed),this.domElement.classList.toggle("lil-closed",this._closed),this}close(){return this.open(!1)}_setClosed(e){this._closed!==e&&(this._closed=e,this._callOnOpenClose(this))}show(e=!0){return this._hidden=!e,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}openAnimated(e=!0){return this._setClosed(!e),this.$title.setAttribute("aria-expanded",!this._closed),requestAnimationFrame(()=>{const t=this.$children.clientHeight;this.$children.style.height=t+"px",this.domElement.classList.add("lil-transition");const i=r=>{r.target===this.$children&&(this.$children.style.height="",this.domElement.classList.remove("lil-transition"),this.$children.removeEventListener("transitionend",i))};this.$children.addEventListener("transitionend",i);const n=e?this.$children.scrollHeight:0;this.domElement.classList.toggle("lil-closed",!e),requestAnimationFrame(()=>{this.$children.style.height=n+"px"})}),this}title(e){return this._title=e,this.$title.textContent=e,this}reset(e=!0){return(e?this.controllersRecursive():this.controllers).forEach(i=>i.reset()),this}onChange(e){return this._onChange=e,this}_callOnChange(e){this.parent&&this.parent._callOnChange(e),this._onChange!==void 0&&this._onChange.call(this,{object:e.object,property:e.property,value:e.getValue(),controller:e})}onFinishChange(e){return this._onFinishChange=e,this}_callOnFinishChange(e){this.parent&&this.parent._callOnFinishChange(e),this._onFinishChange!==void 0&&this._onFinishChange.call(this,{object:e.object,property:e.property,value:e.getValue(),controller:e})}onOpenClose(e){return this._onOpenClose=e,this}_callOnOpenClose(e){this.parent&&this.parent._callOnOpenClose(e),this._onOpenClose!==void 0&&this._onOpenClose.call(this,e)}destroy(){this.parent&&(this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.folders.splice(this.parent.folders.indexOf(this),1)),this.domElement.parentElement&&this.domElement.parentElement.removeChild(this.domElement),Array.from(this.children).forEach(e=>e.destroy())}controllersRecursive(){let e=Array.from(this.controllers);return this.folders.forEach(t=>{e=e.concat(t.controllersRecursive())}),e}foldersRecursive(){let e=Array.from(this.folders);return this.folders.forEach(t=>{e=e.concat(t.foldersRecursive())}),e}}function ga(a){return a}function _a(a){if(a==null)return ga;var e,t,i=a.scale[0],n=a.scale[1],r=a.translate[0],s=a.translate[1];return function(o,l){l||(e=t=0);var c=2,h=o.length,u=new Array(h);for(u[0]=(e+=o[0])*i+r,u[1]=(t+=o[1])*n+s;c<h;)u[c]=o[c],++c;return u}}function ya(a,e){for(var t,i=a.length,n=i-e;n<--i;)t=a[n],a[n++]=a[i],a[i]=t}function xa(a,e){return typeof e=="string"&&(e=a.objects[e]),e.type==="GeometryCollection"?{type:"FeatureCollection",features:e.geometries.map(function(t){return pr(a,t)})}:pr(a,e)}function pr(a,e){var t=e.id,i=e.bbox,n=e.properties==null?{}:e.properties,r=ba(a,e);return t==null&&i==null?{type:"Feature",properties:n,geometry:r}:i==null?{type:"Feature",id:t,properties:n,geometry:r}:{type:"Feature",id:t,bbox:i,properties:n,geometry:r}}function ba(a,e){var t=_a(a.transform),i=a.arcs;function n(h,u){u.length&&u.pop();for(var p=i[h<0?~h:h],m=0,f=p.length;m<f;++m)u.push(t(p[m],m));h<0&&ya(u,f)}function r(h){return t(h)}function s(h){for(var u=[],p=0,m=h.length;p<m;++p)n(h[p],u);return u.length<2&&u.push(u[0]),u}function o(h){for(var u=s(h);u.length<4;)u.push(u[0]);return u}function l(h){return h.map(o)}function c(h){var u=h.type,p;switch(u){case"GeometryCollection":return{type:u,geometries:h.geometries.map(c)};case"Point":p=r(h.coordinates);break;case"MultiPoint":p=h.coordinates.map(r);break;case"LineString":p=s(h.arcs);break;case"MultiLineString":p=h.arcs.map(s);break;case"Polygon":p=l(h.arcs);break;case"MultiPolygon":p=h.arcs.map(l);break;default:return null}return{type:u,coordinates:p}}return c(e)}const $i=[{id:"156",code:"CN",name:"China",population:1412,gdpPerCapita:21476,co2Emissions:8,lifeExpectancy:78.2,humanDevIndex:.768,internetUsers:73,renewableEnergy:15,urbanPopulation:64.7,healthExpenditure:5.4,educationExpenditure:3.6,forestArea:23.3,accessElectricity:100},{id:"356",code:"IN",name:"India",population:1408,gdpPerCapita:8379,co2Emissions:1.9,lifeExpectancy:70.8,humanDevIndex:.633,internetUsers:47,renewableEnergy:38,urbanPopulation:35.9,healthExpenditure:3,educationExpenditure:4.5,forestArea:24.3,accessElectricity:99.6},{id:"840",code:"US",name:"United States",population:332,gdpPerCapita:76399,co2Emissions:14.4,lifeExpectancy:77.5,humanDevIndex:.921,internetUsers:92,renewableEnergy:13,urbanPopulation:83.1,healthExpenditure:18.3,educationExpenditure:6.1,forestArea:33.9,accessElectricity:100},{id:"360",code:"ID",name:"Indonesia",population:276,gdpPerCapita:14535,co2Emissions:2.3,lifeExpectancy:71.9,humanDevIndex:.705,internetUsers:62,renewableEnergy:12,urbanPopulation:57.9,healthExpenditure:2.9,educationExpenditure:3.5,forestArea:49.1,accessElectricity:99},{id:"586",code:"PK",name:"Pakistan",population:225,gdpPerCapita:6470,co2Emissions:1,lifeExpectancy:67.3,humanDevIndex:.544,internetUsers:21,renewableEnergy:34,urbanPopulation:37.4,healthExpenditure:2.8,educationExpenditure:2.3,forestArea:1.9,accessElectricity:95},{id:"076",code:"BR",name:"Brazil",population:215,gdpPerCapita:16154,co2Emissions:2.2,lifeExpectancy:76,humanDevIndex:.754,internetUsers:81,renewableEnergy:47,urbanPopulation:87.6,healthExpenditure:10.3,educationExpenditure:6.3,forestArea:59.4,accessElectricity:100},{id:"566",code:"NG",name:"Nigeria",population:219,gdpPerCapita:5860,co2Emissions:.6,lifeExpectancy:53.9,humanDevIndex:.535,internetUsers:36,renewableEnergy:86,urbanPopulation:53,healthExpenditure:3,educationExpenditure:.5,forestArea:7.2,accessElectricity:59.5},{id:"050",code:"BD",name:"Bangladesh",population:167,gdpPerCapita:7066,co2Emissions:.6,lifeExpectancy:73.2,humanDevIndex:.661,internetUsers:39,renewableEnergy:3,urbanPopulation:39.4,healthExpenditure:2.3,educationExpenditure:1.8,forestArea:11.2,accessElectricity:99.4},{id:"643",code:"RU",name:"Russia",population:144,gdpPerCapita:30820,co2Emissions:11.4,lifeExpectancy:72.8,humanDevIndex:.822,internetUsers:85,renewableEnergy:7,urbanPopulation:75.1,healthExpenditure:5.6,educationExpenditure:3.7,forestArea:49.8,accessElectricity:100},{id:"484",code:"MX",name:"Mexico",population:130,gdpPerCapita:20824,co2Emissions:3.5,lifeExpectancy:75.1,humanDevIndex:.758,internetUsers:72,renewableEnergy:9,urbanPopulation:81,healthExpenditure:5.4,educationExpenditure:4.3,forestArea:33.6,accessElectricity:100},{id:"392",code:"JP",name:"Japan",population:125,gdpPerCapita:45546,co2Emissions:8.5,lifeExpectancy:84.6,humanDevIndex:.925,internetUsers:93,renewableEnergy:12,urbanPopulation:91.9,healthExpenditure:11,educationExpenditure:3.4,forestArea:68.4,accessElectricity:100},{id:"231",code:"ET",name:"Ethiopia",population:121,gdpPerCapita:2771,co2Emissions:.2,lifeExpectancy:66.6,humanDevIndex:.498,internetUsers:17,renewableEnergy:93,urbanPopulation:22.2,healthExpenditure:3.5,educationExpenditure:4.5,forestArea:12.5,accessElectricity:51.1},{id:"608",code:"PH",name:"Philippines",population:115,gdpPerCapita:9746,co2Emissions:1.3,lifeExpectancy:72.1,humanDevIndex:.699,internetUsers:53,renewableEnergy:29,urbanPopulation:47.7,healthExpenditure:5.1,educationExpenditure:3.6,forestArea:27,accessElectricity:97.2},{id:"818",code:"EG",name:"Egypt",population:106,gdpPerCapita:14927,co2Emissions:2.4,lifeExpectancy:72,humanDevIndex:.731,internetUsers:72,renewableEnergy:10,urbanPopulation:42.8,healthExpenditure:4.6,educationExpenditure:4,forestArea:.1,accessElectricity:100},{id:"704",code:"VN",name:"Vietnam",population:99,gdpPerCapita:12756,co2Emissions:3.5,lifeExpectancy:75.8,humanDevIndex:.703,internetUsers:70,renewableEnergy:21,urbanPopulation:38.1,healthExpenditure:4.7,educationExpenditure:4.2,forestArea:47.6,accessElectricity:100},{id:"276",code:"DE",name:"Germany",population:84,gdpPerCapita:58780,co2Emissions:8.1,lifeExpectancy:81.4,humanDevIndex:.942,internetUsers:93,renewableEnergy:20,urbanPopulation:77.6,healthExpenditure:12.8,educationExpenditure:4.9,forestArea:32.7,accessElectricity:100},{id:"792",code:"TR",name:"Turkey",population:85,gdpPerCapita:36879,co2Emissions:4.8,lifeExpectancy:78.6,humanDevIndex:.838,internetUsers:83,renewableEnergy:17,urbanPopulation:76.6,healthExpenditure:4.3,educationExpenditure:3.1,forestArea:28.6,accessElectricity:100},{id:"364",code:"IR",name:"Iran",population:87,gdpPerCapita:16261,co2Emissions:8.3,lifeExpectancy:76.7,humanDevIndex:.774,internetUsers:78,renewableEnergy:6,urbanPopulation:76.3,healthExpenditure:5.2,educationExpenditure:3.6,forestArea:6.6,accessElectricity:100},{id:"764",code:"TH",name:"Thailand",population:70,gdpPerCapita:19169,co2Emissions:3.8,lifeExpectancy:79.3,humanDevIndex:.8,internetUsers:78,renewableEnergy:15,urbanPopulation:52.2,healthExpenditure:3.8,educationExpenditure:2.9,forestArea:38.8,accessElectricity:100},{id:"826",code:"GB",name:"United Kingdom",population:68,gdpPerCapita:49675,co2Emissions:4.7,lifeExpectancy:81.8,humanDevIndex:.929,internetUsers:97,renewableEnergy:15,urbanPopulation:84.2,healthExpenditure:12,educationExpenditure:5.5,forestArea:13.2,accessElectricity:100},{id:"250",code:"FR",name:"France",population:68,gdpPerCapita:50728,co2Emissions:4.3,lifeExpectancy:82.7,humanDevIndex:.903,internetUsers:91,renewableEnergy:12,urbanPopulation:81.5,healthExpenditure:12.2,educationExpenditure:5.5,forestArea:31.4,accessElectricity:100},{id:"380",code:"IT",name:"Italy",population:59,gdpPerCapita:45936,co2Emissions:5.3,lifeExpectancy:83.5,humanDevIndex:.895,internetUsers:86,renewableEnergy:20,urbanPopulation:71.3,healthExpenditure:8.7,educationExpenditure:4.3,forestArea:32.1,accessElectricity:100},{id:"710",code:"ZA",name:"South Africa",population:60,gdpPerCapita:15e3,co2Emissions:6.7,lifeExpectancy:65.3,humanDevIndex:.713,internetUsers:70,renewableEnergy:6,urbanPopulation:68,healthExpenditure:8.1,educationExpenditure:6.6,forestArea:7.6,accessElectricity:85},{id:"834",code:"TZ",name:"Tanzania",population:63,gdpPerCapita:2990,co2Emissions:.2,lifeExpectancy:66.2,humanDevIndex:.549,internetUsers:25,renewableEnergy:85,urbanPopulation:37,healthExpenditure:3.8,educationExpenditure:3.4,forestArea:48.1,accessElectricity:42.7},{id:"404",code:"KE",name:"Kenya",population:55,gdpPerCapita:5494,co2Emissions:.4,lifeExpectancy:67,humanDevIndex:.575,internetUsers:29,renewableEnergy:75,urbanPopulation:28.5,healthExpenditure:4.3,educationExpenditure:5.1,forestArea:7.8,accessElectricity:75},{id:"410",code:"KR",name:"South Korea",population:52,gdpPerCapita:50071,co2Emissions:11.5,lifeExpectancy:83.7,humanDevIndex:.925,internetUsers:97,renewableEnergy:4,urbanPopulation:81.4,healthExpenditure:8.4,educationExpenditure:5.1,forestArea:63.4,accessElectricity:100},{id:"170",code:"CO",name:"Colombia",population:52,gdpPerCapita:17063,co2Emissions:1.8,lifeExpectancy:77.3,humanDevIndex:.752,internetUsers:73,renewableEnergy:27,urbanPopulation:81.7,healthExpenditure:7.7,educationExpenditure:4.5,forestArea:52.7,accessElectricity:100},{id:"724",code:"ES",name:"Spain",population:47,gdpPerCapita:42190,co2Emissions:5,lifeExpectancy:83.6,humanDevIndex:.905,internetUsers:94,renewableEnergy:21,urbanPopulation:81.1,healthExpenditure:10.7,educationExpenditure:4.8,forestArea:37.4,accessElectricity:100},{id:"032",code:"AR",name:"Argentina",population:46,gdpPerCapita:24678,co2Emissions:3.8,lifeExpectancy:77.1,humanDevIndex:.842,internetUsers:87,renewableEnergy:13,urbanPopulation:92.2,healthExpenditure:10,educationExpenditure:5,forestArea:10.5,accessElectricity:100},{id:"800",code:"UG",name:"Uganda",population:48,gdpPerCapita:2566,co2Emissions:.1,lifeExpectancy:64.4,humanDevIndex:.525,internetUsers:18,renewableEnergy:89,urbanPopulation:25.6,healthExpenditure:3.8,educationExpenditure:2.7,forestArea:9.7,accessElectricity:46},{id:"012",code:"DZ",name:"Algeria",population:45,gdpPerCapita:12667,co2Emissions:3.7,lifeExpectancy:77.1,humanDevIndex:.745,internetUsers:71,renewableEnergy:1,urbanPopulation:74.3,healthExpenditure:5.3,educationExpenditure:5.6,forestArea:.8,accessElectricity:100},{id:"804",code:"UA",name:"Ukraine",population:41,gdpPerCapita:14220,co2Emissions:4.5,lifeExpectancy:72.1,humanDevIndex:.773,internetUsers:75,renewableEnergy:8,urbanPopulation:69.6,healthExpenditure:7,educationExpenditure:5.4,forestArea:16.7,accessElectricity:100},{id:"368",code:"IQ",name:"Iraq",population:43,gdpPerCapita:10474,co2Emissions:4,lifeExpectancy:71.1,humanDevIndex:.686,internetUsers:75,renewableEnergy:3,urbanPopulation:71.1,healthExpenditure:4.6,educationExpenditure:4.7,forestArea:1.9,accessElectricity:100},{id:"616",code:"PL",name:"Poland",population:38,gdpPerCapita:40343,co2Emissions:8,lifeExpectancy:78.7,humanDevIndex:.876,internetUsers:87,renewableEnergy:17,urbanPopulation:60,healthExpenditure:6.5,educationExpenditure:4.6,forestArea:30.9,accessElectricity:100},{id:"124",code:"CA",name:"Canada",population:39,gdpPerCapita:54966,co2Emissions:14.3,lifeExpectancy:82.4,humanDevIndex:.936,internetUsers:93,renewableEnergy:18,urbanPopulation:81.8,healthExpenditure:12.8,educationExpenditure:5.3,forestArea:38.7,accessElectricity:100},{id:"504",code:"MA",name:"Morocco",population:37,gdpPerCapita:9339,co2Emissions:1.9,lifeExpectancy:77,humanDevIndex:.683,internetUsers:84,renewableEnergy:13,urbanPopulation:64.6,healthExpenditure:5.3,educationExpenditure:6.8,forestArea:12.8,accessElectricity:100},{id:"682",code:"SA",name:"Saudi Arabia",population:36,gdpPerCapita:56817,co2Emissions:15.3,lifeExpectancy:76.9,humanDevIndex:.875,internetUsers:98,renewableEnergy:0,urbanPopulation:84.7,healthExpenditure:6.4,educationExpenditure:5.1,forestArea:.5,accessElectricity:100},{id:"604",code:"PE",name:"Peru",population:34,gdpPerCapita:14225,co2Emissions:1.6,lifeExpectancy:77.4,humanDevIndex:.762,internetUsers:71,renewableEnergy:25,urbanPopulation:78.6,healthExpenditure:5.2,educationExpenditure:4,forestArea:57.3,accessElectricity:97},{id:"036",code:"AU",name:"Australia",population:26,gdpPerCapita:59934,co2Emissions:15,lifeExpectancy:84,humanDevIndex:.951,internetUsers:96,renewableEnergy:12,urbanPopulation:86.4,healthExpenditure:10.7,educationExpenditure:6.1,forestArea:17.4,accessElectricity:100},{id:"458",code:"MY",name:"Malaysia",population:34,gdpPerCapita:33550,co2Emissions:7.6,lifeExpectancy:76.9,humanDevIndex:.803,internetUsers:90,renewableEnergy:8,urbanPopulation:78,healthExpenditure:3.8,educationExpenditure:3.9,forestArea:57.7,accessElectricity:100},{id:"288",code:"GH",name:"Ghana",population:33,gdpPerCapita:6754,co2Emissions:.6,lifeExpectancy:64.9,humanDevIndex:.632,internetUsers:53,renewableEnergy:42,urbanPopulation:58,healthExpenditure:3.4,educationExpenditure:4,forestArea:34.5,accessElectricity:85.9},{id:"524",code:"NP",name:"Nepal",population:30,gdpPerCapita:4199,co2Emissions:.5,lifeExpectancy:71.7,humanDevIndex:.602,internetUsers:48,renewableEnergy:86,urbanPopulation:21,healthExpenditure:4.4,educationExpenditure:4.2,forestArea:25.4,accessElectricity:90},{id:"862",code:"VE",name:"Venezuela",population:29,gdpPerCapita:7045,co2Emissions:3.1,lifeExpectancy:72.1,humanDevIndex:.691,internetUsers:72,renewableEnergy:68,urbanPopulation:88.3,healthExpenditure:3.9,educationExpenditure:6.9,forestArea:52.1,accessElectricity:99.9},{id:"450",code:"MG",name:"Madagascar",population:29,gdpPerCapita:1724,co2Emissions:.2,lifeExpectancy:67,humanDevIndex:.501,internetUsers:10,renewableEnergy:68,urbanPopulation:39.5,healthExpenditure:3.9,educationExpenditure:2.9,forestArea:21.4,accessElectricity:34},{id:"120",code:"CM",name:"Cameroon",population:28,gdpPerCapita:3977,co2Emissions:.4,lifeExpectancy:60.3,humanDevIndex:.576,internetUsers:34,renewableEnergy:74,urbanPopulation:58.4,healthExpenditure:3.3,educationExpenditure:3.2,forestArea:45.6,accessElectricity:65},{id:"528",code:"NL",name:"Netherlands",population:18,gdpPerCapita:64654,co2Emissions:8.1,lifeExpectancy:82.3,humanDevIndex:.941,internetUsers:98,renewableEnergy:13,urbanPopulation:92.5,healthExpenditure:11.2,educationExpenditure:5.3,forestArea:11.2,accessElectricity:100},{id:"152",code:"CL",name:"Chile",population:19,gdpPerCapita:28526,co2Emissions:4.3,lifeExpectancy:80.7,humanDevIndex:.855,internetUsers:88,renewableEnergy:27,urbanPopulation:87.9,healthExpenditure:9.3,educationExpenditure:5.4,forestArea:24.4,accessElectricity:100},{id:"752",code:"SE",name:"Sweden",population:10,gdpPerCapita:60239,co2Emissions:3.5,lifeExpectancy:83.2,humanDevIndex:.947,internetUsers:96,renewableEnergy:56,urbanPopulation:88.2,healthExpenditure:11.4,educationExpenditure:7.6,forestArea:68.9,accessElectricity:100},{id:"578",code:"NO",name:"Norway",population:5,gdpPerCapita:82236,co2Emissions:7.5,lifeExpectancy:83.2,humanDevIndex:.961,internetUsers:98,renewableEnergy:72,urbanPopulation:83.4,healthExpenditure:11.4,educationExpenditure:7.9,forestArea:33.2,accessElectricity:100},{id:"702",code:"SG",name:"Singapore",population:6,gdpPerCapita:116527,co2Emissions:8.9,lifeExpectancy:84.1,humanDevIndex:.939,internetUsers:96,renewableEnergy:2,urbanPopulation:100,healthExpenditure:6.1,educationExpenditure:2.9,forestArea:22.5,accessElectricity:100},{id:"554",code:"NZ",name:"New Zealand",population:5,gdpPerCapita:48249,co2Emissions:6.8,lifeExpectancy:82.5,humanDevIndex:.937,internetUsers:95,renewableEnergy:40,urbanPopulation:86.7,healthExpenditure:9.7,educationExpenditure:6.3,forestArea:38.6,accessElectricity:100},{id:"372",code:"IE",name:"Ireland",population:5,gdpPerCapita:106998,co2Emissions:7.3,lifeExpectancy:82.8,humanDevIndex:.945,internetUsers:94,renewableEnergy:14,urbanPopulation:64.2,healthExpenditure:7.1,educationExpenditure:3.5,forestArea:11,accessElectricity:100},{id:"376",code:"IL",name:"Israel",population:9,gdpPerCapita:52170,co2Emissions:6.9,lifeExpectancy:83.5,humanDevIndex:.919,internetUsers:90,renewableEnergy:6,urbanPopulation:92.8,healthExpenditure:7.5,educationExpenditure:7.1,forestArea:7.6,accessElectricity:100},{id:"784",code:"AE",name:"United Arab Emirates",population:10,gdpPerCapita:77272,co2Emissions:20.7,lifeExpectancy:78.7,humanDevIndex:.911,internetUsers:100,renewableEnergy:1,urbanPopulation:87.4,healthExpenditure:5,educationExpenditure:3.9,forestArea:4.5,accessElectricity:100},{id:"756",code:"CH",name:"Switzerland",population:9,gdpPerCapita:81867,co2Emissions:4,lifeExpectancy:84,humanDevIndex:.962,internetUsers:96,renewableEnergy:28,urbanPopulation:74,healthExpenditure:11.3,educationExpenditure:5,forestArea:31.9,accessElectricity:100},{id:"040",code:"AT",name:"Austria",population:9,gdpPerCapita:58013,co2Emissions:6.8,lifeExpectancy:82,humanDevIndex:.916,internetUsers:93,renewableEnergy:36,urbanPopulation:59,healthExpenditure:10.4,educationExpenditure:5.4,forestArea:47.3,accessElectricity:100},{id:"620",code:"PT",name:"Portugal",population:10,gdpPerCapita:38147,co2Emissions:4,lifeExpectancy:82.6,humanDevIndex:.866,internetUsers:85,renewableEnergy:34,urbanPopulation:66.8,healthExpenditure:10.6,educationExpenditure:5,forestArea:36.1,accessElectricity:100},{id:"300",code:"GR",name:"Greece",population:10,gdpPerCapita:33393,co2Emissions:5.3,lifeExpectancy:81.4,humanDevIndex:.887,internetUsers:79,renewableEnergy:22,urbanPopulation:80.1,healthExpenditure:7.8,educationExpenditure:4.4,forestArea:32.5,accessElectricity:100},{id:"203",code:"CZ",name:"Czech Republic",population:11,gdpPerCapita:45499,co2Emissions:9.3,lifeExpectancy:79.4,humanDevIndex:.889,internetUsers:88,renewableEnergy:17,urbanPopulation:74.1,healthExpenditure:9.2,educationExpenditure:4.4,forestArea:34.7,accessElectricity:100},{id:"056",code:"BE",name:"Belgium",population:12,gdpPerCapita:55521,co2Emissions:8,lifeExpectancy:82.2,humanDevIndex:.937,internetUsers:94,renewableEnergy:13,urbanPopulation:98.1,healthExpenditure:11.1,educationExpenditure:6.4,forestArea:22.8,accessElectricity:100},{id:"348",code:"HU",name:"Hungary",population:10,gdpPerCapita:37935,co2Emissions:4.6,lifeExpectancy:77,humanDevIndex:.846,internetUsers:89,renewableEnergy:14,urbanPopulation:72.3,healthExpenditure:6.4,educationExpenditure:4.6,forestArea:22.9,accessElectricity:100},{id:"246",code:"FI",name:"Finland",population:6,gdpPerCapita:53654,co2Emissions:6.5,lifeExpectancy:82.2,humanDevIndex:.94,internetUsers:96,renewableEnergy:44,urbanPopulation:85.5,healthExpenditure:9.6,educationExpenditure:6.3,forestArea:73.7,accessElectricity:100},{id:"208",code:"DK",name:"Denmark",population:6,gdpPerCapita:67803,co2Emissions:4.4,lifeExpectancy:81.6,humanDevIndex:.948,internetUsers:98,renewableEnergy:40,urbanPopulation:88.2,healthExpenditure:10.5,educationExpenditure:6.9,forestArea:14.7,accessElectricity:100},{id:"352",code:"IS",name:"Iceland",population:.4,gdpPerCapita:68727,co2Emissions:9.7,lifeExpectancy:83.1,humanDevIndex:.959,internetUsers:99,renewableEnergy:85,urbanPopulation:93.9,healthExpenditure:8.9,educationExpenditure:7.7,forestArea:.5,accessElectricity:100},{id:"180",code:"CD",name:"DR Congo",population:99,gdpPerCapita:1099,co2Emissions:.04,lifeExpectancy:60.7,humanDevIndex:.479,internetUsers:9,renewableEnergy:97,urbanPopulation:46.2,healthExpenditure:3.3,educationExpenditure:1.5,forestArea:67.3,accessElectricity:19.1},{id:"729",code:"SD",name:"Sudan",population:46,gdpPerCapita:4232,co2Emissions:.5,lifeExpectancy:66.1,humanDevIndex:.508,internetUsers:31,renewableEnergy:62,urbanPopulation:35.6,healthExpenditure:4.5,educationExpenditure:2.2,forestArea:9.7,accessElectricity:55.5},{id:"024",code:"AO",name:"Angola",population:35,gdpPerCapita:6938,co2Emissions:.8,lifeExpectancy:62,humanDevIndex:.586,internetUsers:36,renewableEnergy:55,urbanPopulation:68.1,healthExpenditure:2.6,educationExpenditure:2.4,forestArea:46.3,accessElectricity:46},{id:"508",code:"MZ",name:"Mozambique",population:33,gdpPerCapita:1346,co2Emissions:.2,lifeExpectancy:60.9,humanDevIndex:.456,internetUsers:10,renewableEnergy:79,urbanPopulation:38,healthExpenditure:7.5,educationExpenditure:5.5,forestArea:48.2,accessElectricity:31},{id:"384",code:"CI",name:"Ivory Coast",population:28,gdpPerCapita:5972,co2Emissions:.4,lifeExpectancy:59.3,humanDevIndex:.55,internetUsers:45,renewableEnergy:68,urbanPopulation:52.7,healthExpenditure:3.3,educationExpenditure:3.4,forestArea:9.3,accessElectricity:70},{id:"562",code:"NE",name:"Niger",population:26,gdpPerCapita:1318,co2Emissions:.1,lifeExpectancy:63,humanDevIndex:.4,internetUsers:5,renewableEnergy:80,urbanPopulation:16.8,healthExpenditure:5.2,educationExpenditure:3.5,forestArea:.9,accessElectricity:19.3},{id:"854",code:"BF",name:"Burkina Faso",population:22,gdpPerCapita:2445,co2Emissions:.2,lifeExpectancy:62.7,humanDevIndex:.449,internetUsers:18,renewableEnergy:79,urbanPopulation:31.5,healthExpenditure:5.6,educationExpenditure:5.4,forestArea:19.3,accessElectricity:19},{id:"466",code:"ML",name:"Mali",population:22,gdpPerCapita:2462,co2Emissions:.2,lifeExpectancy:59.3,humanDevIndex:.428,internetUsers:27,renewableEnergy:76,urbanPopulation:44.6,healthExpenditure:3.8,educationExpenditure:3.8,forestArea:3.9,accessElectricity:53},{id:"686",code:"SN",name:"Senegal",population:17,gdpPerCapita:3942,co2Emissions:.7,lifeExpectancy:68.6,humanDevIndex:.511,internetUsers:58,renewableEnergy:47,urbanPopulation:48.6,healthExpenditure:3.5,educationExpenditure:5.5,forestArea:42.5,accessElectricity:70.4},{id:"894",code:"ZM",name:"Zambia",population:20,gdpPerCapita:3574,co2Emissions:.4,lifeExpectancy:65,humanDevIndex:.565,internetUsers:16,renewableEnergy:88,urbanPopulation:45.2,healthExpenditure:4.9,educationExpenditure:4.6,forestArea:59.8,accessElectricity:43},{id:"716",code:"ZW",name:"Zimbabwe",population:16,gdpPerCapita:2622,co2Emissions:.8,lifeExpectancy:61.5,humanDevIndex:.593,internetUsers:35,renewableEnergy:78,urbanPopulation:32.2,healthExpenditure:3.4,educationExpenditure:5,forestArea:36.4,accessElectricity:49},{id:"646",code:"RW",name:"Rwanda",population:14,gdpPerCapita:2359,co2Emissions:.1,lifeExpectancy:69.6,humanDevIndex:.534,internetUsers:30,renewableEnergy:84,urbanPopulation:17.6,healthExpenditure:7.5,educationExpenditure:3.1,forestArea:28.8,accessElectricity:48},{id:"004",code:"AF",name:"Afghanistan",population:41,gdpPerCapita:2065,co2Emissions:.2,lifeExpectancy:62,humanDevIndex:.478,internetUsers:18,renewableEnergy:45,urbanPopulation:26.3,healthExpenditure:18.2,educationExpenditure:4.1,forestArea:1.9,accessElectricity:97.7},{id:"104",code:"MM",name:"Myanmar",population:55,gdpPerCapita:5699,co2Emissions:.6,lifeExpectancy:67.8,humanDevIndex:.585,internetUsers:44,renewableEnergy:51,urbanPopulation:31.4,healthExpenditure:4.8,educationExpenditure:2,forestArea:42.2,accessElectricity:70},{id:"408",code:"KP",name:"North Korea",population:26,gdpPerCapita:1800,co2Emissions:2,lifeExpectancy:72.6,humanDevIndex:.733,internetUsers:0,renewableEnergy:12,urbanPopulation:63,healthExpenditure:6,educationExpenditure:4,forestArea:41,accessElectricity:26},{id:"496",code:"MN",name:"Mongolia",population:3.4,gdpPerCapita:12896,co2Emissions:14,lifeExpectancy:70.9,humanDevIndex:.739,internetUsers:84,renewableEnergy:7,urbanPopulation:68.8,healthExpenditure:4,educationExpenditure:4.7,forestArea:7.1,accessElectricity:100},{id:"144",code:"LK",name:"Sri Lanka",population:22,gdpPerCapita:14509,co2Emissions:1,lifeExpectancy:77.4,humanDevIndex:.782,internetUsers:47,renewableEnergy:51,urbanPopulation:18.9,healthExpenditure:3.8,educationExpenditure:2.1,forestArea:29.4,accessElectricity:100},{id:"398",code:"KZ",name:"Kazakhstan",population:19,gdpPerCapita:30500,co2Emissions:13.2,lifeExpectancy:74.4,humanDevIndex:.811,internetUsers:91,renewableEnergy:2,urbanPopulation:57.8,healthExpenditure:2.8,educationExpenditure:2.9,forestArea:1.2,accessElectricity:100},{id:"860",code:"UZ",name:"Uzbekistan",population:35,gdpPerCapita:9127,co2Emissions:3.5,lifeExpectancy:73.8,humanDevIndex:.727,internetUsers:71,renewableEnergy:11,urbanPopulation:50.4,healthExpenditure:6.8,educationExpenditure:5.3,forestArea:7.7,accessElectricity:100},{id:"192",code:"CU",name:"Cuba",population:11,gdpPerCapita:9478,co2Emissions:2.3,lifeExpectancy:79,humanDevIndex:.764,internetUsers:71,renewableEnergy:32,urbanPopulation:77.2,healthExpenditure:11.7,educationExpenditure:12.8,forestArea:33,accessElectricity:100},{id:"218",code:"EC",name:"Ecuador",population:18,gdpPerCapita:12171,co2Emissions:2.3,lifeExpectancy:77.9,humanDevIndex:.74,internetUsers:70,renewableEnergy:31,urbanPopulation:64.2,healthExpenditure:8.3,educationExpenditure:4.4,forestArea:50.1,accessElectricity:100},{id:"320",code:"GT",name:"Guatemala",population:18,gdpPerCapita:9547,co2Emissions:1,lifeExpectancy:74.3,humanDevIndex:.627,internetUsers:51,renewableEnergy:62,urbanPopulation:52.4,healthExpenditure:5.8,educationExpenditure:3.4,forestArea:33,accessElectricity:98},{id:"068",code:"BO",name:"Bolivia",population:12,gdpPerCapita:9484,co2Emissions:1.8,lifeExpectancy:72.1,humanDevIndex:.692,internetUsers:66,renewableEnergy:24,urbanPopulation:70.4,healthExpenditure:6.9,educationExpenditure:7.3,forestArea:50.1,accessElectricity:99.3},{id:"340",code:"HN",name:"Honduras",population:10,gdpPerCapita:6289,co2Emissions:1,lifeExpectancy:75.3,humanDevIndex:.621,internetUsers:48,renewableEnergy:61,urbanPopulation:59,healthExpenditure:7.9,educationExpenditure:6.1,forestArea:38.1,accessElectricity:94},{id:"600",code:"PY",name:"Paraguay",population:7,gdpPerCapita:15030,co2Emissions:1.1,lifeExpectancy:74.3,humanDevIndex:.717,internetUsers:77,renewableEnergy:78,urbanPopulation:62.5,healthExpenditure:7.6,educationExpenditure:3.4,forestArea:38.6,accessElectricity:100},{id:"858",code:"UY",name:"Uruguay",population:3.5,gdpPerCapita:25041,co2Emissions:2,lifeExpectancy:78.4,humanDevIndex:.83,internetUsers:87,renewableEnergy:55,urbanPopulation:95.6,healthExpenditure:9.3,educationExpenditure:5,forestArea:10.5,accessElectricity:100},{id:"188",code:"CR",name:"Costa Rica",population:5,gdpPerCapita:23101,co2Emissions:1.5,lifeExpectancy:80.8,humanDevIndex:.809,internetUsers:81,renewableEnergy:73,urbanPopulation:81.4,healthExpenditure:7.3,educationExpenditure:6.7,forestArea:59,accessElectricity:100},{id:"591",code:"PA",name:"Panama",population:4.4,gdpPerCapita:35317,co2Emissions:2.5,lifeExpectancy:79.2,humanDevIndex:.805,internetUsers:68,renewableEnergy:35,urbanPopulation:68.4,healthExpenditure:7.3,educationExpenditure:3.2,forestArea:62.1,accessElectricity:95}],va=[{id:"humanDevIndex",name:"Human Development Index",unit:"",description:"UN composite index of life expectancy, education, and income",colorScale:["#fee5d9","#fcae91","#cb181d"],domain:[.4,1],accessor:a=>a.humanDevIndex,format:a=>a.toFixed(3)},{id:"gdpPerCapita",name:"GDP per Capita (PPP)",unit:"$",description:"Purchasing power parity adjusted GDP per person",colorScale:["#edf8e9","#74c476","#006d2c"],domain:[1e3,8e4],accessor:a=>a.gdpPerCapita,format:a=>`$${(a/1e3).toFixed(1)}k`},{id:"co2Emissions",name:"CO₂ Emissions",unit:"t/capita",description:"Carbon dioxide emissions per capita",colorScale:["#f7fbff","#6baed6","#08306b"],domain:[0,20],accessor:a=>a.co2Emissions,format:a=>`${a.toFixed(1)}t`},{id:"lifeExpectancy",name:"Life Expectancy",unit:"years",description:"Average life expectancy at birth",colorScale:["#feedde","#fdbe85","#d94701"],domain:[55,85],accessor:a=>a.lifeExpectancy,format:a=>`${a.toFixed(1)} yrs`},{id:"renewableEnergy",name:"Renewable Energy",unit:"%",description:"Share of renewable energy in total energy consumption",colorScale:["#f7fcf5","#74c476","#00441b"],domain:[0,100],accessor:a=>a.renewableEnergy,format:a=>`${a.toFixed(0)}%`},{id:"internetUsers",name:"Internet Penetration",unit:"%",description:"Percentage of population using the internet",colorScale:["#f2f0f7","#9e9ac8","#54278f"],domain:[0,100],accessor:a=>a.internetUsers,format:a=>`${a.toFixed(0)}%`},{id:"urbanPopulation",name:"Urbanization",unit:"%",description:"Percentage of population living in urban areas",colorScale:["#fff5eb","#fd8d3c","#7f2704"],domain:[15,100],accessor:a=>a.urbanPopulation,format:a=>`${a.toFixed(0)}%`},{id:"healthExpenditure",name:"Health Spending",unit:"% GDP",description:"Total health expenditure as percentage of GDP",colorScale:["#fff5f0","#fb6a4a","#99000d"],domain:[2,18],accessor:a=>a.healthExpenditure,format:a=>`${a.toFixed(1)}%`},{id:"forestArea",name:"Forest Coverage",unit:"%",description:"Forest area as percentage of total land area",colorScale:["#f7fcf5","#41ab5d","#00441b"],domain:[0,75],accessor:a=>a.forestArea,format:a=>`${a.toFixed(0)}%`},{id:"accessElectricity",name:"Electricity Access",unit:"%",description:"Percentage of population with access to electricity",colorScale:["#ffffd4","#fed98e","#cc4c02"],domain:[15,100],accessor:a=>a.accessElectricity,format:a=>`${a.toFixed(0)}%`}];function Ea(a,e){const[t,i]=a.domain;return Math.max(0,Math.min(1,(e-t)/(i-t)))}const wa={US:"840",USA:"840","UNITED STATES":"840",AMERICA:"840",CA:"124",CAN:"124",CANADA:"124",MX:"484",MEX:"484",MEXICO:"484",DE:"276",DEU:"276",GERMANY:"276",DEUTSCHLAND:"276",FR:"250",FRA:"250",FRANCE:"250",GB:"826",GBR:"826",UK:"826","UNITED KINGDOM":"826",BRITAIN:"826",ENGLAND:"826",IT:"380",ITA:"380",ITALY:"380",ES:"724",ESP:"724",SPAIN:"724",PT:"620",PRT:"620",PORTUGAL:"620",NL:"528",NLD:"528",NETHERLANDS:"528",HOLLAND:"528",BE:"056",BEL:"056",BELGIUM:"056",AT:"040",AUT:"040",AUSTRIA:"040",CH:"756",CHE:"756",SWITZERLAND:"756",PL:"616",POL:"616",POLAND:"616",SE:"752",SWE:"752",SWEDEN:"752",NO:"578",NOR:"578",NORWAY:"578",DK:"208",DNK:"208",DENMARK:"208",FI:"246",FIN:"246",FINLAND:"246",IE:"372",IRL:"372",IRELAND:"372",GR:"300",GRC:"300",GREECE:"300",CZ:"203",CZE:"203","CZECH REPUBLIC":"203",CZECHIA:"203",RO:"642",ROU:"642",ROMANIA:"642",HU:"348",HUN:"348",HUNGARY:"348",UA:"804",UKR:"804",UKRAINE:"804",RU:"643",RUS:"643",RUSSIA:"643","RUSSIAN FEDERATION":"643",CN:"156",CHN:"156",CHINA:"156",JP:"392",JPN:"392",JAPAN:"392",KR:"410",KOR:"410","SOUTH KOREA":"410",KOREA:"410",IN:"356",IND:"356",INDIA:"356",ID:"360",IDN:"360",INDONESIA:"360",TH:"764",THA:"764",THAILAND:"764",VN:"704",VNM:"704",VIETNAM:"704",PH:"608",PHL:"608",PHILIPPINES:"608",MY:"458",MYS:"458",MALAYSIA:"458",SG:"702",SGP:"702",SINGAPORE:"702",PK:"586",PAK:"586",PAKISTAN:"586",BD:"050",BGD:"050",BANGLADESH:"050",TR:"792",TUR:"792",TURKEY:"792",TURKIYE:"792",SA:"682",SAU:"682","SAUDI ARABIA":"682",AE:"784",ARE:"784",UAE:"784","UNITED ARAB EMIRATES":"784",IL:"376",ISR:"376",ISRAEL:"376",IR:"364",IRN:"364",IRAN:"364",IQ:"368",IRQ:"368",IRAQ:"368",AU:"036",AUS:"036",AUSTRALIA:"036",NZ:"554",NZL:"554","NEW ZEALAND":"554",BR:"076",BRA:"076",BRAZIL:"076",AR:"032",ARG:"032",ARGENTINA:"032",CL:"152",CHL:"152",CHILE:"152",CO:"170",COL:"170",COLOMBIA:"170",PE:"604",PER:"604",PERU:"604",VE:"862",VEN:"862",VENEZUELA:"862",ZA:"710",ZAF:"710","SOUTH AFRICA":"710",EG:"818",EGY:"818",EGYPT:"818",NG:"566",NGA:"566",NIGERIA:"566",KE:"404",KEN:"404",KENYA:"404",ET:"231",ETH:"231",ETHIOPIA:"231",MA:"504",MAR:"504",MOROCCO:"504",DZ:"012",DZA:"012",ALGERIA:"012",TN:"788",TUN:"788",TUNISIA:"788",GH:"288",GHA:"288",GHANA:"288"};function Bi(a){const e=a.toUpperCase().trim();return/^\d{1,3}$/.test(a)?a.padStart(3,"0"):wa[e]||a}function fr(a){const e={};return a instanceof Map?a.forEach((t,i)=>{e[Bi(i)]=t}):Object.entries(a).forEach(([t,i])=>{e[Bi(t)]=i}),e}const Gt=2048,jt=1024;class Ca{canvas;ctx;countries=[];loaded=!1;statsMap;constructor(){this.canvas=document.createElement("canvas"),this.canvas.width=Gt,this.canvas.height=jt,this.ctx=this.canvas.getContext("2d"),this.statsMap=new Map,$i.forEach(e=>{this.statsMap.set(e.id,e)}),this.loadCountries()}async loadCountries(){try{const t=await(await fetch("https://cdn.jsdelivr.net/npm/world-atlas@2/countries-110m.json")).json(),i=xa(t,t.objects.countries);this.countries=i.features,this.loaded=!0,console.log(`Loaded ${this.countries.length} country boundaries`)}catch(e){console.error("Failed to load country boundaries:",e)}}async waitForLoad(){for(;!this.loaded;)await new Promise(e=>setTimeout(e,100))}renderTexture(e){return this.ctx.fillStyle="#1a3a5c",this.ctx.fillRect(0,0,Gt,jt),this.loaded?(this.countries.forEach(t=>{const i=this.statsMap.get(t.id);if(i){const n=e.accessor(i),r=Ea(e,n),s=this.interpolateColor(e.colorScale,r);this.ctx.fillStyle=s}else this.ctx.fillStyle="#2a2a2a";this.drawCountry(t)}),this.ctx.strokeStyle="rgba(0, 0, 0, 0.3)",this.ctx.lineWidth=.5,this.countries.forEach(t=>{this.strokeCountry(t)}),this.canvas):this.canvas}drawCountry(e){const{geometry:t}=e;t.type==="Polygon"?this.drawPolygon(t.coordinates):t.type==="MultiPolygon"&&t.coordinates.forEach(i=>{this.drawPolygon(i)})}strokeCountry(e){const{geometry:t}=e;t.type==="Polygon"?this.strokePolygon(t.coordinates):t.type==="MultiPolygon"&&t.coordinates.forEach(i=>{this.strokePolygon(i)})}drawPolygon(e){this.ctx.beginPath(),e.forEach(t=>{let i=null;t.forEach((n,r)=>{const s=n[0],o=n[1],[l,c]=this.projectPoint(s,o),h=i!==null&&Math.abs(s-i)>180;r===0?this.ctx.moveTo(l,c):h?this.ctx.moveTo(l,c):this.ctx.lineTo(l,c),i=s}),this.ctx.closePath()}),this.ctx.fill("evenodd")}strokePolygon(e){e.forEach(t=>{this.ctx.beginPath();let i=null;t.forEach((n,r)=>{const s=n[0],o=n[1],[l,c]=this.projectPoint(s,o),h=i!==null&&Math.abs(s-i)>180;r===0?this.ctx.moveTo(l,c):h?(this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(l,c)):this.ctx.lineTo(l,c),i=s}),this.ctx.stroke()})}projectPoint(e,t){const i=(e+180)/360*Gt,n=(90-t)/180*jt;return[i,n]}interpolateColor(e,t){const i=h=>({r:parseInt(h.slice(1,3),16),g:parseInt(h.slice(3,5),16),b:parseInt(h.slice(5,7),16)}),[n,r,s]=e.map(i);let o,l,c;if(t<.5){const h=t*2;o=Math.round(n.r+(r.r-n.r)*h),l=Math.round(n.g+(r.g-n.g)*h),c=Math.round(n.b+(r.b-n.b)*h)}else{const h=(t-.5)*2;o=Math.round(r.r+(s.r-r.r)*h),l=Math.round(r.g+(s.g-r.g)*h),c=Math.round(r.b+(s.b-r.b)*h)}return`rgb(${o}, ${l}, ${c})`}renderCustomTexture(e,t,i){if(this.ctx.fillStyle="#1a3a5c",this.ctx.fillRect(0,0,Gt,jt),!this.loaded)return this.canvas;const n=fr(e);return this.countries.forEach(r=>{const s=n[r.id];if(s!==void 0){const o=Math.max(0,Math.min(1,(s-i[0])/(i[1]-i[0]))),l=this.interpolateColor(t,o);this.ctx.fillStyle=l}else this.ctx.fillStyle="#2a2a2a";this.drawCountry(r)}),this.ctx.strokeStyle="rgba(0, 0, 0, 0.3)",this.ctx.lineWidth=.5,this.countries.forEach(r=>{this.strokeCountry(r)}),this.canvas}getCanvas(){return this.canvas}getDataURL(){return this.canvas.toDataURL("image/png")}}function Vi(a){return a==="%"?e=>`${e.toFixed(1)}%`:a==="$"?e=>`$${e.toLocaleString()}`:a==="years"?e=>`${e.toFixed(1)} yrs`:a.includes("per capita")||a.includes("per 100")||a.includes("per 1000")?e=>`${e.toFixed(1)}`:a==="% GDP"||a==="% of GDP"?e=>`${e.toFixed(1)}%`:a===""||a==="index"?e=>e.toFixed(3):e=>{const t=Number.isInteger(e)?e.toLocaleString():e.toFixed(1);return a?`${t} ${a}`:t}}function Pa(a,e,t){return(t??Vi(e))(a)}let mr=!1;function Aa(){if(mr)return;mr=!0;const a=document.createElement("style");a.setAttribute("data-gralobe-legend","true"),a.textContent=`
426
426
  .gralobe-legend {
427
427
  position: absolute;
428
428
  bottom: 10px;
@@ -538,7 +538,7 @@
538
538
  <span class="gralobe-legend-max" data-testid="legend-max"></span>
539
539
  </div>
540
540
  <div class="gralobe-legend-description" data-testid="legend-description"></div>
541
- `,e.appendChild(this.element),this.updateSize(),this.resizeObserver=new ResizeObserver(()=>this.updateSize()),this.resizeObserver.observe(e)}getSizeClass(e,t){const i=Math.min(e,t);return i<200?"xs":i<300?"sm":i<450?"md":"lg"}updateSize(){const e=this.parentContainer.clientWidth,t=this.parentContainer.clientHeight,i=this.getSizeClass(e,t);this.element.classList.remove("size-xs","size-sm","size-md","size-lg"),this.element.classList.add(`size-${i}`)}show(e){const t=this.element.querySelector(".gralobe-legend-title"),i=this.element.querySelector(".gralobe-legend-gradient"),n=this.element.querySelector(".gralobe-legend-min"),r=this.element.querySelector(".gralobe-legend-max"),s=this.element.querySelector(".gralobe-legend-description");t.textContent=e.name,s.textContent=e.description;const[o,l,h]=e.colorScale;i.style.background=`linear-gradient(to right, ${o}, ${l}, ${h})`;const c=e.format??Vi(e.unit);n.textContent=c(e.domain[0]),r.textContent=c(e.domain[1]),this.element.classList.add("visible"),this.visible=!0}hide(){this.element.classList.remove("visible"),this.visible=!1}isVisible(){return this.visible}getElement(){return this.element}dispose(){this.resizeObserver?.disconnect(),this.element.remove()}}var Ta={trailer:59};function gr(a=256){let e=0,t=new Uint8Array(a);return{get buffer(){return t.buffer},reset(){e=0},bytesView(){return t.subarray(0,e)},bytes(){return t.slice(0,e)},writeByte(n){i(e+1),t[e]=n,e++},writeBytes(n,r=0,s=n.length){i(e+s);for(let o=0;o<s;o++)t[e++]=n[o+r]},writeBytesView(n,r=0,s=n.byteLength){i(e+s),t.set(n.subarray(r,r+s),e),e+=s}};function i(n){var r=t.length;if(r>=n)return;var s=1024*1024;n=Math.max(n,r*(r<s?2:1.125)>>>0),r!=0&&(n=Math.max(n,256));let o=t;t=new Uint8Array(n),e>0&&t.set(o.subarray(0,e),0)}}var Gi=12,_r=5003,Da=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];function Ma(a,e,t,i,n=gr(512),r=new Uint8Array(256),s=new Int32Array(_r),o=new Int32Array(_r)){let l=s.length,h=Math.max(2,i);r.fill(0),o.fill(0),s.fill(-1);let c=0,u=0,p=h+1,m=p,f=!1,d=m,g=(1<<d)-1,_=1<<p-1,y=_+1,b=_+2,v=0,x=t[0],C=0;for(let w=l;w<65536;w*=2)++C;C=8-C,n.writeByte(h),P(_);let E=t.length;for(let w=1;w<E;w++)e:{let T=t[w],O=(T<<Gi)+x,S=T<<C^x;if(s[S]===O){x=o[S];break e}let R=S===0?1:l-S;for(;s[S]>=0;)if(S-=R,S<0&&(S+=l),s[S]===O){x=o[S];break e}P(x),x=T,b<1<<Gi?(o[S]=b++,s[S]=O):(s.fill(-1),b=_+2,f=!0,P(_))}return P(x),P(y),n.writeByte(0),n.bytesView();function P(w){for(c&=Da[u],u>0?c|=w<<u:c=w,u+=d;u>=8;)r[v++]=c&255,v>=254&&(n.writeByte(v),n.writeBytesView(r,0,v),v=0),c>>=8,u-=8;if((b>g||f)&&(f?(d=m,g=(1<<d)-1,f=!1):(++d,g=d===Gi?1<<d:(1<<d)-1)),w==y){for(;u>0;)r[v++]=c&255,v>=254&&(n.writeByte(v),n.writeBytesView(r,0,v),v=0),c>>=8,u-=8;v>0&&(n.writeByte(v),n.writeBytesView(r,0,v),v=0)}}}var Oa=Ma;function yr(a,e,t){return a<<8&63488|e<<2&992|t>>3}function br(a,e,t,i){return a>>4|e&240|(t&240)<<4|(i&240)<<8}function xr(a,e,t){return a>>4<<8|e&240|t>>4}function Yt(a,e,t){return a<e?e:a>t?t:a}function Ht(a){return a*a}function vr(a,e,t){var i=0,n=1e100;let r=a[e],s=r.cnt;r.ac;let o=r.rc,l=r.gc,h=r.bc;for(var c=r.fw;c!=0;c=a[c].fw){let p=a[c],m=p.cnt,f=s*m/(s+m);if(!(f>=n)){var u=0;u+=f*Ht(p.rc-o),!(u>=n)&&(u+=f*Ht(p.gc-l),!(u>=n)&&(u+=f*Ht(p.bc-h),!(u>=n)&&(n=u,i=c)))}}r.err=n,r.nn=i}function ji(){return{ac:0,rc:0,gc:0,bc:0,cnt:0,nn:0,fw:0,bk:0,tm:0,mtm:0,err:0}}function Ra(a,e){let t=e==="rgb444"?4096:65536,i=new Array(t),n=a.length;if(e==="rgba4444")for(let r=0;r<n;++r){let s=a[r],o=s>>24&255,l=s>>16&255,h=s>>8&255,c=s&255,u=br(c,h,l,o),p=u in i?i[u]:i[u]=ji();p.rc+=c,p.gc+=h,p.bc+=l,p.ac+=o,p.cnt++}else if(e==="rgb444")for(let r=0;r<n;++r){let s=a[r],o=s>>16&255,l=s>>8&255,h=s&255,c=xr(h,l,o),u=c in i?i[c]:i[c]=ji();u.rc+=h,u.gc+=l,u.bc+=o,u.cnt++}else for(let r=0;r<n;++r){let s=a[r],o=s>>16&255,l=s>>8&255,h=s&255,c=yr(h,l,o),u=c in i?i[c]:i[c]=ji();u.rc+=h,u.gc+=l,u.bc+=o,u.cnt++}return i}function Ia(a,e,t={}){let{format:i="rgb565",clearAlpha:n=!0,clearAlphaColor:r=0,clearAlphaThreshold:s=0,oneBitAlpha:o=!1}=t;if(!a||!a.buffer)throw new Error("quantize() expected RGBA Uint8Array data");if(!(a instanceof Uint8Array)&&!(a instanceof Uint8ClampedArray))throw new Error("quantize() expected RGBA Uint8Array data");let l=new Uint32Array(a.buffer),h=t.useSqrt!==!1,c=i==="rgba4444",u=Ra(l,i),p=u.length,m=p-1,f=new Uint32Array(p+1);for(var d=0,g=0;g<p;++g){let I=u[g];if(I!=null){var _=1/I.cnt;c&&(I.ac*=_),I.rc*=_,I.gc*=_,I.bc*=_,u[d++]=I}}Ht(e)/d<.022&&(h=!1);for(var g=0;g<d-1;++g)u[g].fw=g+1,u[g+1].bk=g,h&&(u[g].cnt=Math.sqrt(u[g].cnt));h&&(u[g].cnt=Math.sqrt(u[g].cnt));var y,b,v;for(g=0;g<d;++g){vr(u,g);var x=u[g].err;for(b=++f[0];b>1&&(v=b>>1,!(u[y=f[v]].err<=x));b=v)f[b]=y;f[b]=g}var C=d-e;for(g=0;g<C;){for(var E;;){var P=f[1];if(E=u[P],E.tm>=E.mtm&&u[E.nn].mtm<=E.tm)break;E.mtm==m?P=f[1]=f[f[0]--]:(vr(u,P),E.tm=g);var x=u[P].err;for(b=1;(v=b+b)<=f[0]&&(v<f[0]&&u[f[v]].err>u[f[v+1]].err&&v++,!(x<=u[y=f[v]].err));b=v)f[b]=y;f[b]=P}var w=u[E.nn],T=E.cnt,O=w.cnt,_=1/(T+O);c&&(E.ac=_*(T*E.ac+O*w.ac)),E.rc=_*(T*E.rc+O*w.rc),E.gc=_*(T*E.gc+O*w.gc),E.bc=_*(T*E.bc+O*w.bc),E.cnt+=w.cnt,E.mtm=++g,u[w.bk].fw=w.fw,u[w.fw].bk=w.bk,w.mtm=m}let S=[];var R=0;for(g=0;;++R){let I=Yt(Math.round(u[g].rc),0,255),G=Yt(Math.round(u[g].gc),0,255),N=Yt(Math.round(u[g].bc),0,255),F=255;c&&(F=Yt(Math.round(u[g].ac),0,255),o&&(F=F<=(typeof o=="number"?o:127)?0:255),n&&F<=s&&(I=G=N=r,F=0));let se=c?[I,G,N,F]:[I,G,N];if(La(S,se)||S.push(se),(g=u[g].fw)==0)break}return S}function La(a,e){for(let t=0;t<a.length;t++){let i=a[t],n=i[0]===e[0]&&i[1]===e[1]&&i[2]===e[2],r=i.length>=4&&e.length>=4?i[3]===e[3]:!0;if(n&&r)return!0}return!1}function ka(a,e,t="rgb565"){if(!a||!a.buffer)throw new Error("quantize() expected RGBA Uint8Array data");if(!(a instanceof Uint8Array)&&!(a instanceof Uint8ClampedArray))throw new Error("quantize() expected RGBA Uint8Array data");if(e.length>256)throw new Error("applyPalette() only works with 256 colors or less");let i=new Uint32Array(a.buffer),n=i.length,r=t==="rgb444"?4096:65536,s=new Uint8Array(n),o=new Array(r);if(t==="rgba4444")for(let l=0;l<n;l++){let h=i[l],c=h>>24&255,u=h>>16&255,p=h>>8&255,m=h&255,f=br(m,p,u,c),d=f in o?o[f]:o[f]=Ua(m,p,u,c,e);s[l]=d}else{let l=t==="rgb444"?xr:yr;for(let h=0;h<n;h++){let c=i[h],u=c>>16&255,p=c>>8&255,m=c&255,f=l(m,p,u),d=f in o?o[f]:o[f]=Fa(m,p,u,e);s[h]=d}}return s}function Ua(a,e,t,i,n){let r=0,s=1e100;for(let o=0;o<n.length;o++){let l=n[o],h=l[3],c=He(h-i);if(c>s)continue;let u=l[0];if(c+=He(u-a),c>s)continue;let p=l[1];if(c+=He(p-e),c>s)continue;let m=l[2];c+=He(m-t),!(c>s)&&(s=c,r=o)}return r}function Fa(a,e,t,i){let n=0,r=1e100;for(let s=0;s<i.length;s++){let o=i[s],l=o[0],h=He(l-a);if(h>r)continue;let c=o[1];if(h+=He(c-e),h>r)continue;let u=o[2];h+=He(u-t),!(h>r)&&(r=h,n=s)}return n}function He(a){return a*a}function za(a={}){let{initialCapacity:e=4096,auto:t=!0}=a,i=gr(e),n=5003,r=new Uint8Array(256),s=new Int32Array(n),o=new Int32Array(n),l=!1;return{reset(){i.reset(),l=!1},finish(){i.writeByte(Ta.trailer)},bytes(){return i.bytes()},bytesView(){return i.bytesView()},get buffer(){return i.buffer},get stream(){return i},writeHeader:h,writeFrame(c,u,p,m={}){let{transparent:f=!1,transparentIndex:d=0,delay:g=0,palette:_=null,repeat:y=0,colorDepth:b=8,dispose:v=-1}=m,x=!1;if(t?l||(x=!0,h(),l=!0):x=!!m.first,u=Math.max(0,Math.floor(u)),p=Math.max(0,Math.floor(p)),x){if(!_)throw new Error("First frame must include a { palette } option");$a(i,u,p,_,b),Er(i,_),y>=0&&Ba(i,y)}let C=Math.round(g/10);Na(i,v,C,f,d);let E=!!_&&!x;Va(i,u,p,E?_:null),E&&Er(i,_),Ga(i,c,u,p,b,r,s,o)}};function h(){wr(i,"GIF89a")}}function Na(a,e,t,i,n){a.writeByte(33),a.writeByte(249),a.writeByte(4),n<0&&(n=0,i=!1);var r,s;i?(r=1,s=2):(r=0,s=0),e>=0&&(s=e&7),s<<=2,a.writeByte(0|s|0|r),ke(a,t),a.writeByte(n||0),a.writeByte(0)}function $a(a,e,t,i,n=8){let r=1,s=0,o=Yi(i.length)-1,l=r<<7|n-1<<4|s<<3|o;ke(a,e),ke(a,t),a.writeBytes([l,0,0])}function Ba(a,e){a.writeByte(33),a.writeByte(255),a.writeByte(11),wr(a,"NETSCAPE2.0"),a.writeByte(3),a.writeByte(1),ke(a,e),a.writeByte(0)}function Er(a,e){let t=1<<Yi(e.length);for(let i=0;i<t;i++){let n=[0,0,0];i<e.length&&(n=e[i]),a.writeByte(n[0]),a.writeByte(n[1]),a.writeByte(n[2])}}function Va(a,e,t,i){if(a.writeByte(44),ke(a,0),ke(a,0),ke(a,e),ke(a,t),i){let n=0,r=0,s=Yi(i.length)-1;a.writeByte(128|n|r|0|s)}else a.writeByte(0)}function Ga(a,e,t,i,n=8,r,s,o){Oa(t,i,e,n,a,r,s,o)}function ke(a,e){a.writeByte(e&255),a.writeByte(e>>8&255)}function wr(a,e){for(var t=0;t<e.length;t++)a.writeByte(e.charCodeAt(t))}function Yi(a){return Math.max(Math.ceil(Math.log2(a)),1)}class ja{renderer;scene;camera;isRecording=!1;frames=[];mediaRecorder=null;recordedChunks=[];captureCanvas;captureCtx;compositeCanvas;compositeCtx;gifWidth=480;gifHeight=270;legendElement=null;countryLabels=null;constructor(e,t,i){this.renderer=e,this.scene=t,this.camera=i,this.captureCanvas=document.createElement("canvas"),this.captureCtx=this.captureCanvas.getContext("2d",{willReadFrequently:!0}),this.compositeCanvas=document.createElement("canvas"),this.compositeCtx=this.compositeCanvas.getContext("2d")}setLegendElement(e){this.legendElement=e}setCountryLabels(e){this.countryLabels=e}drawCountryLabelsOnCanvas(e,t,i){if(this.countryLabels)try{this.countryLabels.getVisibleLabelsForCanvas(this.camera,t,i).forEach(r=>{e.save(),e.globalAlpha=r.opacity,e.font="bold 12px Arial, sans-serif",e.textAlign="center",e.textBaseline="middle",e.strokeStyle="rgba(0, 0, 0, 0.8)",e.lineWidth=3,e.strokeText(r.text,r.x,r.y),e.fillStyle="#ffffff",e.fillText(r.text,r.x,r.y),e.restore()})}catch(n){console.warn("Failed to draw country labels:",n)}}drawOverlaysOnCanvas(e,t,i){this.drawCountryLabelsOnCanvas(e,t,i),this.drawLegendOnCanvas(e,t,i)}drawLegendOnCanvas(e,t,i){try{if(!this.legendElement||!this.legendElement.classList.contains("visible"))return;const n=this.legendElement,r=n.querySelector(".legend-title"),s=n.querySelector(".legend-gradient"),o=n.querySelector(".legend-min"),l=n.querySelector(".legend-max"),h=n.querySelector(".legend-description");if(!r||!s)return;const c=280,u=100,p=20,m=t-c-p,f=i-u-p,d=12;e.fillStyle="rgba(0, 10, 20, 0.9)",e.strokeStyle="rgba(100, 170, 255, 0.5)",e.lineWidth=2,e.beginPath(),e.roundRect?e.roundRect(m,f,c,u,d):e.rect(m,f,c,u),e.fill(),e.stroke(),e.fillStyle="#44aaff",e.font="bold 18px Arial, sans-serif",e.fillText(r.textContent||"",m+16,f+28);const g=m+16,_=f+40,y=c-32,b=20,v=s.style.background||"";let x=[];const C=v.match(/rgba?\([^)]+\)/g);if(C&&C.length>=2)x=C;else{const E=v.match(/#[0-9a-fA-F]{3,8}/g);E&&E.length>=2&&(x=E)}if(x.length>=2){const E=e.createLinearGradient(g,0,g+y,0);E.addColorStop(0,x[0]),x.length>=3?(E.addColorStop(.5,x[1]),E.addColorStop(1,x[2])):E.addColorStop(1,x[1]),e.fillStyle=E,e.beginPath(),e.roundRect?e.roundRect(g,_,y,b,4):e.rect(g,_,y,b),e.fill()}else{const E=e.createLinearGradient(g,0,g+y,0);E.addColorStop(0,"#cc6600"),E.addColorStop(.5,"#ffaa44"),E.addColorStop(1,"#ffeecc"),e.fillStyle=E,e.beginPath(),e.roundRect?e.roundRect(g,_,y,b,4):e.rect(g,_,y,b),e.fill(),console.log("Legend gradient style:",v)}if(e.fillStyle="#cccccc",e.font="14px Arial, sans-serif",o&&e.fillText(o.textContent||"",g,f+78),l){const E=l.textContent||"",P=e.measureText(E).width;e.fillText(E,g+y-P,f+78)}h&&h.textContent&&(e.fillStyle="#888888",e.font="italic 12px Arial, sans-serif",e.fillText(h.textContent,g,f+95))}catch(n){console.warn("Failed to draw legend on canvas:",n)}}screenshot(e={}){const{width:t=1920,height:i=1080}=e,n=this.renderer.domElement.width,r=this.renderer.domElement.height;this.renderer.setSize(t,i),this.camera.aspect=t/i,this.camera.updateProjectionMatrix(),this.renderer.render(this.scene,this.camera),this.compositeCanvas.width=t,this.compositeCanvas.height=i,this.compositeCtx.drawImage(this.renderer.domElement,0,0),this.drawOverlaysOnCanvas(this.compositeCtx,t,i);const s=this.compositeCanvas.toDataURL("image/png");this.renderer.setSize(n,r),this.camera.aspect=n/r,this.camera.updateProjectionMatrix(),this.downloadFile(s,`globe-${Date.now()}.png`)}startVideoRecording(e={}){return new Promise(t=>{if(this.isRecording){t();return}const i=this.renderer.domElement;this.compositeCanvas.width=i.width,this.compositeCanvas.height=i.height,this.compositeCtx.drawImage(i,0,0),this.drawOverlaysOnCanvas(this.compositeCtx,this.compositeCanvas.width,this.compositeCanvas.height);const n=this.compositeCanvas.captureStream(60),r=[{mime:"video/mp4;codecs=avc1",ext:"mp4"},{mime:"video/mp4",ext:"mp4"},{mime:"video/webm;codecs=h264",ext:"webm"},{mime:"video/webm;codecs=vp9",ext:"webm"},{mime:"video/webm;codecs=vp8",ext:"webm"},{mime:"video/webm",ext:"webm"}];let s="video/webm",o="webm";for(const{mime:h,ext:c}of r)if(MediaRecorder.isTypeSupported(h)){s=h,o=c,console.log(`Video recording using: ${h}`);break}this.mediaRecorder=new MediaRecorder(n,{mimeType:s,videoBitsPerSecond:8e6}),this.recordedChunks=[];const l=o;this.mediaRecorder.ondataavailable=h=>{h.data.size>0&&this.recordedChunks.push(h.data)},this.mediaRecorder.onstop=()=>{const h=s.split(";")[0],c=new Blob(this.recordedChunks,{type:h}),u=URL.createObjectURL(c);this.downloadFile(u,`globe-${Date.now()}.${l}`),URL.revokeObjectURL(u)},this.mediaRecorder.onstart=()=>{this.isRecording=!0,setTimeout(()=>t(),50)},this.mediaRecorder.start(100)})}updateVideoFrame(){if(!this.isRecording||!this.mediaRecorder)return;const e=this.compositeCanvas.width,t=this.compositeCanvas.height;this.compositeCtx.drawImage(this.renderer.domElement,0,0,e,t),this.drawOverlaysOnCanvas(this.compositeCtx,e,t)}stopVideoRecording(){!this.isRecording||!this.mediaRecorder||(this.mediaRecorder.stop(),this.isRecording=!1)}startGifCapture(e={}){if(this.isRecording)return;this.frames=[],this.isRecording=!0;const{width:t=480,height:i=270}=e;this.gifWidth=t,this.gifHeight=i,this.captureCanvas.width=t,this.captureCanvas.height=i}captureGifFrame(){if(!this.isRecording)return;const e=this.renderer.domElement,t=this.gifWidth,i=this.gifHeight;this.captureCtx.drawImage(e,0,0,t,i),this.drawOverlaysOnCanvas(this.captureCtx,t,i);const n=this.captureCtx.getImageData(0,0,t,i);this.frames.push({data:new Uint8ClampedArray(n.data),width:t,height:i})}async stopGifCapture(e={}){if(!this.isRecording)return;if(this.isRecording=!1,this.frames.length===0){console.warn("No frames captured for GIF");return}const{fps:t=20,filename:i}=e,n=Math.round(1e3/t);console.log(`Generating GIF with ${this.frames.length} frames at ${t} fps...`);try{const r=this.frames[0],s=r.width,o=r.height,l=Ia(r.data,256),h=za();for(let f=0;f<this.frames.length;f++){const d=this.frames[f],g=ka(d.data,l);h.writeFrame(g,s,o,{palette:f===0?l:void 0,delay:n,repeat:f===0?0:void 0}),f%10===0&&await new Promise(_=>setTimeout(_,0))}h.finish();const c=h.bytes(),u=new Blob([c],{type:"image/gif"}),p=URL.createObjectURL(u),m=i||`globe-${Date.now()}.gif`;this.downloadFile(p,m),setTimeout(()=>URL.revokeObjectURL(p),1e3),console.log(`GIF saved: ${m} (${this.frames.length} frames, ${(u.size/1024).toFixed(1)}KB)`)}catch(r){console.error("Failed to generate GIF:",r)}this.frames=[]}getIsRecording(){return this.isRecording}getFrameCount(){return this.frames.length}downloadFile(e,t){const i=document.createElement("a");i.href=e,i.download=t,i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i)}}class Ya extends A.Object3D{constructor(e=document.createElement("div")){super(),this.isCSS2DObject=!0,this.element=e,this.element.style.position="absolute",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.center=new A.Vector2(.5,.5),this.addEventListener("removed",function(){this.traverse(function(t){t.element&&t.element instanceof t.element.ownerDocument.defaultView.Element&&t.element.parentNode!==null&&t.element.remove()})})}copy(e,t){return super.copy(e,t),this.element=e.element.cloneNode(!0),this.center=e.center,this}}const lt=new A.Vector3,Cr=new A.Matrix4,Pr=new A.Matrix4,Ar=new A.Vector3,Sr=new A.Vector3;class Ha{constructor(e={}){const t=this;let i,n,r,s;const o={objects:new WeakMap},l=e.element!==void 0?e.element:document.createElement("div");l.style.overflow="hidden",this.domElement=l,this.sortObjects=!0,this.getSize=function(){return{width:i,height:n}},this.render=function(f,d){f.matrixWorldAutoUpdate===!0&&f.updateMatrixWorld(),d.parent===null&&d.matrixWorldAutoUpdate===!0&&d.updateMatrixWorld(),Cr.copy(d.matrixWorldInverse),Pr.multiplyMatrices(d.projectionMatrix,Cr),c(f,f,d),this.sortObjects&&m(f)},this.setSize=function(f,d){i=f,n=d,r=i/2,s=n/2,l.style.width=f+"px",l.style.height=d+"px"};function h(f){f.isCSS2DObject&&(f.element.style.display="none");for(let d=0,g=f.children.length;d<g;d++)h(f.children[d])}function c(f,d,g){if(f.visible===!1){h(f);return}if(f.isCSS2DObject){lt.setFromMatrixPosition(f.matrixWorld),lt.applyMatrix4(Pr);const _=lt.z>=-1&&lt.z<=1&&f.layers.test(g.layers)===!0,y=f.element;y.style.display=_===!0?"":"none",_===!0&&(f.onBeforeRender(t,d,g),y.style.transform="translate("+-100*f.center.x+"%,"+-100*f.center.y+"%)translate("+(lt.x*r+r)+"px,"+(-lt.y*s+s)+"px)",y.parentNode!==l&&l.appendChild(y),f.onAfterRender(t,d,g));const b={distanceToCameraSquared:u(g,f)};o.objects.set(f,b)}for(let _=0,y=f.children.length;_<y;_++)c(f.children[_],d,g)}function u(f,d){return Ar.setFromMatrixPosition(f.matrixWorld),Sr.setFromMatrixPosition(d.matrixWorld),Ar.distanceToSquared(Sr)}function p(f){const d=[];return f.traverseVisible(function(g){g.isCSS2DObject&&d.push(g)}),d}function m(f){const d=p(f).sort(function(_,y){if(_.renderOrder!==y.renderOrder)return y.renderOrder-_.renderOrder;const b=o.objects.get(_).distanceToCameraSquared,v=o.objects.get(y).distanceToCameraSquared;return b-v}),g=d.length;for(let _=0,y=d.length;_<y;_++)d[_].element.style.zIndex=g-_}}}const Za={CN:[35,105],IN:[22,78],US:[39,-98],ID:[-2,118],PK:[30,70],BR:[-10,-55],NG:[9,8],BD:[24,90],RU:[60,100],MX:[23,-102],JP:[36,138],ET:[9,38.5],PH:[12,122],EG:[27,30],VN:[16,108],DE:[51,10],TR:[39,35],IR:[32,53],TH:[15,101],GB:[54,-2],FR:[46,2],IT:[42.5,12.5],ZA:[-29,24],TZ:[-6,35],KE:[0,38],KR:[36,128],CO:[4,-72],ES:[40,-4],AR:[-34,-64],UG:[1,32],DZ:[28,3],UA:[49,32],IQ:[33,44],PL:[52,20],CA:[56,-106],MA:[32,-5],SA:[24,45],PE:[-10,-76],AU:[-25,134],MY:[4,109.5],GH:[8,-1],NP:[28,84],VE:[7,-66],MG:[-19,47],CM:[6,12],NL:[52.5,5.5],CL:[-34,-71],SE:[62,15],NO:[64,10],SG:[1.3,103.8],NZ:[-42,174],IE:[53,-8],IL:[31,35],AE:[24,54],CH:[47,8],AT:[47.5,14.5],PT:[39.5,-8],GR:[39,22],CZ:[49.8,15.5],BE:[50.8,4],HU:[47,20],FI:[64,26],DK:[56,10],IS:[65,-18],CD:[-3,22],SD:[16,30],AO:[-12.5,18.5],MZ:[-18,35],CI:[7.5,-5.5],NE:[17,10],BF:[12,-1.5],ML:[17,-4],SN:[14.5,-14.5],ZM:[-15,28],ZW:[-19,29.5],RW:[-2,30],AF:[33,65],MM:[21,96],KP:[40,127],MN:[46,105],LK:[7.8,80.8],KZ:[48,67],UZ:[41,64],CU:[22,-79.5],EC:[-1.5,-78.5],GT:[15.5,-90.3],BO:[-17,-65],HN:[15,-86.5],PY:[-23,-58],UY:[-33,-56],CR:[10,-84],PA:[9,-80]},Ka=new Set(["CN","IN","US","BR","RU","JP","DE","GB","FR","AU","CA","MX","ID","SA","ZA","EG","NG","AR","IT","ES","KR","TR","PL","NL","CH","SE","NO","PK","BD","VN"]),Xa=new Set(["CN","IN","US","BR","RU","AU","CA"]),Wa=new Set(["RU","CA","US","CN","BR","AU"]),qa=new Set(["IN","AR","KZ","DZ","CD","SA","MX","ID","SD","LY","IR","MN","PE","TD","NE","AO","ML","ZA","CO","ET","BO","MR","EG","TZ","NG","VE","PK","TR","CL","MM"]),Qa=new Set(["AF","UA","MG","MZ","FR","ES","TH","CM","PG","JP","DE","VN","MY","CI","PL","IT","PH","EC","BF","NZ","GB","GH","RO","LA","GY","OM","BY","KH","SN","UG","NO","SE","FI","MR","ZM","ZW","NP","MA","IQ","BD"]);class Ja{labelRenderer;labels=[];labelGroup;currentStyle="none";sphereRadius;currentMorph=0;globe=null;camera=null;constructor(e,t){this.sphereRadius=t,this.labelRenderer=new Ha;const i=e.clientWidth||800,n=e.clientHeight||600;this.labelRenderer.setSize(i,n),this.labelRenderer.domElement.style.position="absolute",this.labelRenderer.domElement.style.top="0",this.labelRenderer.domElement.style.left="0",this.labelRenderer.domElement.style.pointerEvents="none",e.appendChild(this.labelRenderer.domElement),this.labelGroup=new D.Group,this.injectStyles(),this.createLabels()}injectStyles(){const e=document.createElement("style");e.textContent=`
541
+ `,e.appendChild(this.element),this.updateSize(),this.resizeObserver=new ResizeObserver(()=>this.updateSize()),this.resizeObserver.observe(e)}getSizeClass(e,t){const i=Math.min(e,t);return i<200?"xs":i<300?"sm":i<450?"md":"lg"}updateSize(){const e=this.parentContainer.clientWidth,t=this.parentContainer.clientHeight,i=this.getSizeClass(e,t);this.element.classList.remove("size-xs","size-sm","size-md","size-lg"),this.element.classList.add(`size-${i}`)}show(e){const t=this.element.querySelector(".gralobe-legend-title"),i=this.element.querySelector(".gralobe-legend-gradient"),n=this.element.querySelector(".gralobe-legend-min"),r=this.element.querySelector(".gralobe-legend-max"),s=this.element.querySelector(".gralobe-legend-description");t.textContent=e.name,s.textContent=e.description;const[o,l,c]=e.colorScale;i.style.background=`linear-gradient(to right, ${o}, ${l}, ${c})`;const h=e.format??Vi(e.unit);n.textContent=h(e.domain[0]),r.textContent=h(e.domain[1]),this.element.classList.add("visible"),this.visible=!0}hide(){this.element.classList.remove("visible"),this.visible=!1}isVisible(){return this.visible}getElement(){return this.element}dispose(){this.resizeObserver?.disconnect(),this.element.remove()}}var Ta={trailer:59};function gr(a=256){let e=0,t=new Uint8Array(a);return{get buffer(){return t.buffer},reset(){e=0},bytesView(){return t.subarray(0,e)},bytes(){return t.slice(0,e)},writeByte(n){i(e+1),t[e]=n,e++},writeBytes(n,r=0,s=n.length){i(e+s);for(let o=0;o<s;o++)t[e++]=n[o+r]},writeBytesView(n,r=0,s=n.byteLength){i(e+s),t.set(n.subarray(r,r+s),e),e+=s}};function i(n){var r=t.length;if(r>=n)return;var s=1024*1024;n=Math.max(n,r*(r<s?2:1.125)>>>0),r!=0&&(n=Math.max(n,256));let o=t;t=new Uint8Array(n),e>0&&t.set(o.subarray(0,e),0)}}var Gi=12,_r=5003,Da=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];function Ma(a,e,t,i,n=gr(512),r=new Uint8Array(256),s=new Int32Array(_r),o=new Int32Array(_r)){let l=s.length,c=Math.max(2,i);r.fill(0),o.fill(0),s.fill(-1);let h=0,u=0,p=c+1,m=p,f=!1,d=m,g=(1<<d)-1,_=1<<p-1,y=_+1,x=_+2,v=0,b=t[0],C=0;for(let w=l;w<65536;w*=2)++C;C=8-C,n.writeByte(c),P(_);let E=t.length;for(let w=1;w<E;w++)e:{let T=t[w],O=(T<<Gi)+b,S=T<<C^b;if(s[S]===O){b=o[S];break e}let R=S===0?1:l-S;for(;s[S]>=0;)if(S-=R,S<0&&(S+=l),s[S]===O){b=o[S];break e}P(b),b=T,x<1<<Gi?(o[S]=x++,s[S]=O):(s.fill(-1),x=_+2,f=!0,P(_))}return P(b),P(y),n.writeByte(0),n.bytesView();function P(w){for(h&=Da[u],u>0?h|=w<<u:h=w,u+=d;u>=8;)r[v++]=h&255,v>=254&&(n.writeByte(v),n.writeBytesView(r,0,v),v=0),h>>=8,u-=8;if((x>g||f)&&(f?(d=m,g=(1<<d)-1,f=!1):(++d,g=d===Gi?1<<d:(1<<d)-1)),w==y){for(;u>0;)r[v++]=h&255,v>=254&&(n.writeByte(v),n.writeBytesView(r,0,v),v=0),h>>=8,u-=8;v>0&&(n.writeByte(v),n.writeBytesView(r,0,v),v=0)}}}var Oa=Ma;function yr(a,e,t){return a<<8&63488|e<<2&992|t>>3}function xr(a,e,t,i){return a>>4|e&240|(t&240)<<4|(i&240)<<8}function br(a,e,t){return a>>4<<8|e&240|t>>4}function Yt(a,e,t){return a<e?e:a>t?t:a}function Ht(a){return a*a}function vr(a,e,t){var i=0,n=1e100;let r=a[e],s=r.cnt;r.ac;let o=r.rc,l=r.gc,c=r.bc;for(var h=r.fw;h!=0;h=a[h].fw){let p=a[h],m=p.cnt,f=s*m/(s+m);if(!(f>=n)){var u=0;u+=f*Ht(p.rc-o),!(u>=n)&&(u+=f*Ht(p.gc-l),!(u>=n)&&(u+=f*Ht(p.bc-c),!(u>=n)&&(n=u,i=h)))}}r.err=n,r.nn=i}function ji(){return{ac:0,rc:0,gc:0,bc:0,cnt:0,nn:0,fw:0,bk:0,tm:0,mtm:0,err:0}}function Ra(a,e){let t=e==="rgb444"?4096:65536,i=new Array(t),n=a.length;if(e==="rgba4444")for(let r=0;r<n;++r){let s=a[r],o=s>>24&255,l=s>>16&255,c=s>>8&255,h=s&255,u=xr(h,c,l,o),p=u in i?i[u]:i[u]=ji();p.rc+=h,p.gc+=c,p.bc+=l,p.ac+=o,p.cnt++}else if(e==="rgb444")for(let r=0;r<n;++r){let s=a[r],o=s>>16&255,l=s>>8&255,c=s&255,h=br(c,l,o),u=h in i?i[h]:i[h]=ji();u.rc+=c,u.gc+=l,u.bc+=o,u.cnt++}else for(let r=0;r<n;++r){let s=a[r],o=s>>16&255,l=s>>8&255,c=s&255,h=yr(c,l,o),u=h in i?i[h]:i[h]=ji();u.rc+=c,u.gc+=l,u.bc+=o,u.cnt++}return i}function Ia(a,e,t={}){let{format:i="rgb565",clearAlpha:n=!0,clearAlphaColor:r=0,clearAlphaThreshold:s=0,oneBitAlpha:o=!1}=t;if(!a||!a.buffer)throw new Error("quantize() expected RGBA Uint8Array data");if(!(a instanceof Uint8Array)&&!(a instanceof Uint8ClampedArray))throw new Error("quantize() expected RGBA Uint8Array data");let l=new Uint32Array(a.buffer),c=t.useSqrt!==!1,h=i==="rgba4444",u=Ra(l,i),p=u.length,m=p-1,f=new Uint32Array(p+1);for(var d=0,g=0;g<p;++g){let I=u[g];if(I!=null){var _=1/I.cnt;h&&(I.ac*=_),I.rc*=_,I.gc*=_,I.bc*=_,u[d++]=I}}Ht(e)/d<.022&&(c=!1);for(var g=0;g<d-1;++g)u[g].fw=g+1,u[g+1].bk=g,c&&(u[g].cnt=Math.sqrt(u[g].cnt));c&&(u[g].cnt=Math.sqrt(u[g].cnt));var y,x,v;for(g=0;g<d;++g){vr(u,g);var b=u[g].err;for(x=++f[0];x>1&&(v=x>>1,!(u[y=f[v]].err<=b));x=v)f[x]=y;f[x]=g}var C=d-e;for(g=0;g<C;){for(var E;;){var P=f[1];if(E=u[P],E.tm>=E.mtm&&u[E.nn].mtm<=E.tm)break;E.mtm==m?P=f[1]=f[f[0]--]:(vr(u,P),E.tm=g);var b=u[P].err;for(x=1;(v=x+x)<=f[0]&&(v<f[0]&&u[f[v]].err>u[f[v+1]].err&&v++,!(b<=u[y=f[v]].err));x=v)f[x]=y;f[x]=P}var w=u[E.nn],T=E.cnt,O=w.cnt,_=1/(T+O);h&&(E.ac=_*(T*E.ac+O*w.ac)),E.rc=_*(T*E.rc+O*w.rc),E.gc=_*(T*E.gc+O*w.gc),E.bc=_*(T*E.bc+O*w.bc),E.cnt+=w.cnt,E.mtm=++g,u[w.bk].fw=w.fw,u[w.fw].bk=w.bk,w.mtm=m}let S=[];var R=0;for(g=0;;++R){let I=Yt(Math.round(u[g].rc),0,255),G=Yt(Math.round(u[g].gc),0,255),N=Yt(Math.round(u[g].bc),0,255),F=255;h&&(F=Yt(Math.round(u[g].ac),0,255),o&&(F=F<=(typeof o=="number"?o:127)?0:255),n&&F<=s&&(I=G=N=r,F=0));let se=h?[I,G,N,F]:[I,G,N];if(La(S,se)||S.push(se),(g=u[g].fw)==0)break}return S}function La(a,e){for(let t=0;t<a.length;t++){let i=a[t],n=i[0]===e[0]&&i[1]===e[1]&&i[2]===e[2],r=i.length>=4&&e.length>=4?i[3]===e[3]:!0;if(n&&r)return!0}return!1}function ka(a,e,t="rgb565"){if(!a||!a.buffer)throw new Error("quantize() expected RGBA Uint8Array data");if(!(a instanceof Uint8Array)&&!(a instanceof Uint8ClampedArray))throw new Error("quantize() expected RGBA Uint8Array data");if(e.length>256)throw new Error("applyPalette() only works with 256 colors or less");let i=new Uint32Array(a.buffer),n=i.length,r=t==="rgb444"?4096:65536,s=new Uint8Array(n),o=new Array(r);if(t==="rgba4444")for(let l=0;l<n;l++){let c=i[l],h=c>>24&255,u=c>>16&255,p=c>>8&255,m=c&255,f=xr(m,p,u,h),d=f in o?o[f]:o[f]=Ua(m,p,u,h,e);s[l]=d}else{let l=t==="rgb444"?br:yr;for(let c=0;c<n;c++){let h=i[c],u=h>>16&255,p=h>>8&255,m=h&255,f=l(m,p,u),d=f in o?o[f]:o[f]=Fa(m,p,u,e);s[c]=d}}return s}function Ua(a,e,t,i,n){let r=0,s=1e100;for(let o=0;o<n.length;o++){let l=n[o],c=l[3],h=He(c-i);if(h>s)continue;let u=l[0];if(h+=He(u-a),h>s)continue;let p=l[1];if(h+=He(p-e),h>s)continue;let m=l[2];h+=He(m-t),!(h>s)&&(s=h,r=o)}return r}function Fa(a,e,t,i){let n=0,r=1e100;for(let s=0;s<i.length;s++){let o=i[s],l=o[0],c=He(l-a);if(c>r)continue;let h=o[1];if(c+=He(h-e),c>r)continue;let u=o[2];c+=He(u-t),!(c>r)&&(r=c,n=s)}return n}function He(a){return a*a}function za(a={}){let{initialCapacity:e=4096,auto:t=!0}=a,i=gr(e),n=5003,r=new Uint8Array(256),s=new Int32Array(n),o=new Int32Array(n),l=!1;return{reset(){i.reset(),l=!1},finish(){i.writeByte(Ta.trailer)},bytes(){return i.bytes()},bytesView(){return i.bytesView()},get buffer(){return i.buffer},get stream(){return i},writeHeader:c,writeFrame(h,u,p,m={}){let{transparent:f=!1,transparentIndex:d=0,delay:g=0,palette:_=null,repeat:y=0,colorDepth:x=8,dispose:v=-1}=m,b=!1;if(t?l||(b=!0,c(),l=!0):b=!!m.first,u=Math.max(0,Math.floor(u)),p=Math.max(0,Math.floor(p)),b){if(!_)throw new Error("First frame must include a { palette } option");$a(i,u,p,_,x),Er(i,_),y>=0&&Ba(i,y)}let C=Math.round(g/10);Na(i,v,C,f,d);let E=!!_&&!b;Va(i,u,p,E?_:null),E&&Er(i,_),Ga(i,h,u,p,x,r,s,o)}};function c(){wr(i,"GIF89a")}}function Na(a,e,t,i,n){a.writeByte(33),a.writeByte(249),a.writeByte(4),n<0&&(n=0,i=!1);var r,s;i?(r=1,s=2):(r=0,s=0),e>=0&&(s=e&7),s<<=2,a.writeByte(0|s|0|r),ke(a,t),a.writeByte(n||0),a.writeByte(0)}function $a(a,e,t,i,n=8){let r=1,s=0,o=Yi(i.length)-1,l=r<<7|n-1<<4|s<<3|o;ke(a,e),ke(a,t),a.writeBytes([l,0,0])}function Ba(a,e){a.writeByte(33),a.writeByte(255),a.writeByte(11),wr(a,"NETSCAPE2.0"),a.writeByte(3),a.writeByte(1),ke(a,e),a.writeByte(0)}function Er(a,e){let t=1<<Yi(e.length);for(let i=0;i<t;i++){let n=[0,0,0];i<e.length&&(n=e[i]),a.writeByte(n[0]),a.writeByte(n[1]),a.writeByte(n[2])}}function Va(a,e,t,i){if(a.writeByte(44),ke(a,0),ke(a,0),ke(a,e),ke(a,t),i){let n=0,r=0,s=Yi(i.length)-1;a.writeByte(128|n|r|0|s)}else a.writeByte(0)}function Ga(a,e,t,i,n=8,r,s,o){Oa(t,i,e,n,a,r,s,o)}function ke(a,e){a.writeByte(e&255),a.writeByte(e>>8&255)}function wr(a,e){for(var t=0;t<e.length;t++)a.writeByte(e.charCodeAt(t))}function Yi(a){return Math.max(Math.ceil(Math.log2(a)),1)}class ja{renderer;scene;camera;isRecording=!1;frames=[];mediaRecorder=null;recordedChunks=[];captureCanvas;captureCtx;compositeCanvas;compositeCtx;gifWidth=480;gifHeight=270;legendElement=null;countryLabels=null;constructor(e,t,i){this.renderer=e,this.scene=t,this.camera=i,this.captureCanvas=document.createElement("canvas"),this.captureCtx=this.captureCanvas.getContext("2d",{willReadFrequently:!0}),this.compositeCanvas=document.createElement("canvas"),this.compositeCtx=this.compositeCanvas.getContext("2d")}setLegendElement(e){this.legendElement=e}setCountryLabels(e){this.countryLabels=e}drawCountryLabelsOnCanvas(e,t,i){if(this.countryLabels)try{this.countryLabels.getVisibleLabelsForCanvas(this.camera,t,i).forEach(r=>{e.save(),e.globalAlpha=r.opacity,e.font="bold 12px Arial, sans-serif",e.textAlign="center",e.textBaseline="middle",e.strokeStyle="rgba(0, 0, 0, 0.8)",e.lineWidth=3,e.strokeText(r.text,r.x,r.y),e.fillStyle="#ffffff",e.fillText(r.text,r.x,r.y),e.restore()})}catch(n){console.warn("Failed to draw country labels:",n)}}drawOverlaysOnCanvas(e,t,i){this.drawCountryLabelsOnCanvas(e,t,i),this.drawLegendOnCanvas(e,t,i)}drawLegendOnCanvas(e,t,i){try{if(!this.legendElement||!this.legendElement.classList.contains("visible"))return;const n=this.legendElement,r=n.querySelector(".legend-title"),s=n.querySelector(".legend-gradient"),o=n.querySelector(".legend-min"),l=n.querySelector(".legend-max"),c=n.querySelector(".legend-description");if(!r||!s)return;const h=280,u=100,p=20,m=t-h-p,f=i-u-p,d=12;e.fillStyle="rgba(0, 10, 20, 0.9)",e.strokeStyle="rgba(100, 170, 255, 0.5)",e.lineWidth=2,e.beginPath(),e.roundRect?e.roundRect(m,f,h,u,d):e.rect(m,f,h,u),e.fill(),e.stroke(),e.fillStyle="#44aaff",e.font="bold 18px Arial, sans-serif",e.fillText(r.textContent||"",m+16,f+28);const g=m+16,_=f+40,y=h-32,x=20,v=s.style.background||"";let b=[];const C=v.match(/rgba?\([^)]+\)/g);if(C&&C.length>=2)b=C;else{const E=v.match(/#[0-9a-fA-F]{3,8}/g);E&&E.length>=2&&(b=E)}if(b.length>=2){const E=e.createLinearGradient(g,0,g+y,0);E.addColorStop(0,b[0]),b.length>=3?(E.addColorStop(.5,b[1]),E.addColorStop(1,b[2])):E.addColorStop(1,b[1]),e.fillStyle=E,e.beginPath(),e.roundRect?e.roundRect(g,_,y,x,4):e.rect(g,_,y,x),e.fill()}else{const E=e.createLinearGradient(g,0,g+y,0);E.addColorStop(0,"#cc6600"),E.addColorStop(.5,"#ffaa44"),E.addColorStop(1,"#ffeecc"),e.fillStyle=E,e.beginPath(),e.roundRect?e.roundRect(g,_,y,x,4):e.rect(g,_,y,x),e.fill(),console.log("Legend gradient style:",v)}if(e.fillStyle="#cccccc",e.font="14px Arial, sans-serif",o&&e.fillText(o.textContent||"",g,f+78),l){const E=l.textContent||"",P=e.measureText(E).width;e.fillText(E,g+y-P,f+78)}c&&c.textContent&&(e.fillStyle="#888888",e.font="italic 12px Arial, sans-serif",e.fillText(c.textContent,g,f+95))}catch(n){console.warn("Failed to draw legend on canvas:",n)}}screenshot(e={}){const{width:t=1920,height:i=1080}=e,n=this.renderer.domElement.width,r=this.renderer.domElement.height;this.renderer.setSize(t,i),this.camera.aspect=t/i,this.camera.updateProjectionMatrix(),this.renderer.render(this.scene,this.camera),this.compositeCanvas.width=t,this.compositeCanvas.height=i,this.compositeCtx.drawImage(this.renderer.domElement,0,0),this.drawOverlaysOnCanvas(this.compositeCtx,t,i);const s=this.compositeCanvas.toDataURL("image/png");this.renderer.setSize(n,r),this.camera.aspect=n/r,this.camera.updateProjectionMatrix(),this.downloadFile(s,`globe-${Date.now()}.png`)}startVideoRecording(e={}){return new Promise(t=>{if(this.isRecording){t();return}const i=this.renderer.domElement;this.compositeCanvas.width=i.width,this.compositeCanvas.height=i.height,this.compositeCtx.drawImage(i,0,0),this.drawOverlaysOnCanvas(this.compositeCtx,this.compositeCanvas.width,this.compositeCanvas.height);const n=this.compositeCanvas.captureStream(60),r=[{mime:"video/mp4;codecs=avc1",ext:"mp4"},{mime:"video/mp4",ext:"mp4"},{mime:"video/webm;codecs=h264",ext:"webm"},{mime:"video/webm;codecs=vp9",ext:"webm"},{mime:"video/webm;codecs=vp8",ext:"webm"},{mime:"video/webm",ext:"webm"}];let s="video/webm",o="webm";for(const{mime:c,ext:h}of r)if(MediaRecorder.isTypeSupported(c)){s=c,o=h,console.log(`Video recording using: ${c}`);break}this.mediaRecorder=new MediaRecorder(n,{mimeType:s,videoBitsPerSecond:8e6}),this.recordedChunks=[];const l=o;this.mediaRecorder.ondataavailable=c=>{c.data.size>0&&this.recordedChunks.push(c.data)},this.mediaRecorder.onstop=()=>{const c=s.split(";")[0],h=new Blob(this.recordedChunks,{type:c}),u=URL.createObjectURL(h);this.downloadFile(u,`globe-${Date.now()}.${l}`),URL.revokeObjectURL(u)},this.mediaRecorder.onstart=()=>{this.isRecording=!0,setTimeout(()=>t(),50)},this.mediaRecorder.start(100)})}updateVideoFrame(){if(!this.isRecording||!this.mediaRecorder)return;const e=this.compositeCanvas.width,t=this.compositeCanvas.height;this.compositeCtx.drawImage(this.renderer.domElement,0,0,e,t),this.drawOverlaysOnCanvas(this.compositeCtx,e,t)}stopVideoRecording(){!this.isRecording||!this.mediaRecorder||(this.mediaRecorder.stop(),this.isRecording=!1)}startGifCapture(e={}){if(this.isRecording)return;this.frames=[],this.isRecording=!0;const{width:t=480,height:i=270}=e;this.gifWidth=t,this.gifHeight=i,this.captureCanvas.width=t,this.captureCanvas.height=i}captureGifFrame(){if(!this.isRecording)return;const e=this.renderer.domElement,t=this.gifWidth,i=this.gifHeight;this.captureCtx.drawImage(e,0,0,t,i),this.drawOverlaysOnCanvas(this.captureCtx,t,i);const n=this.captureCtx.getImageData(0,0,t,i);this.frames.push({data:new Uint8ClampedArray(n.data),width:t,height:i})}async stopGifCapture(e={}){if(!this.isRecording)return;if(this.isRecording=!1,this.frames.length===0){console.warn("No frames captured for GIF");return}const{fps:t=20,filename:i}=e,n=Math.round(1e3/t);console.log(`Generating GIF with ${this.frames.length} frames at ${t} fps...`);try{const r=this.frames[0],s=r.width,o=r.height,l=Ia(r.data,256),c=za();for(let f=0;f<this.frames.length;f++){const d=this.frames[f],g=ka(d.data,l);c.writeFrame(g,s,o,{palette:f===0?l:void 0,delay:n,repeat:f===0?0:void 0}),f%10===0&&await new Promise(_=>setTimeout(_,0))}c.finish();const h=c.bytes(),u=new Blob([h],{type:"image/gif"}),p=URL.createObjectURL(u),m=i||`globe-${Date.now()}.gif`;this.downloadFile(p,m),setTimeout(()=>URL.revokeObjectURL(p),1e3),console.log(`GIF saved: ${m} (${this.frames.length} frames, ${(u.size/1024).toFixed(1)}KB)`)}catch(r){console.error("Failed to generate GIF:",r)}this.frames=[]}getIsRecording(){return this.isRecording}getFrameCount(){return this.frames.length}downloadFile(e,t){const i=document.createElement("a");i.href=e,i.download=t,i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i)}}class Ya extends A.Object3D{constructor(e=document.createElement("div")){super(),this.isCSS2DObject=!0,this.element=e,this.element.style.position="absolute",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.center=new A.Vector2(.5,.5),this.addEventListener("removed",function(){this.traverse(function(t){t.element&&t.element instanceof t.element.ownerDocument.defaultView.Element&&t.element.parentNode!==null&&t.element.remove()})})}copy(e,t){return super.copy(e,t),this.element=e.element.cloneNode(!0),this.center=e.center,this}}const lt=new A.Vector3,Cr=new A.Matrix4,Pr=new A.Matrix4,Ar=new A.Vector3,Sr=new A.Vector3;class Ha{constructor(e={}){const t=this;let i,n,r,s;const o={objects:new WeakMap},l=e.element!==void 0?e.element:document.createElement("div");l.style.overflow="hidden",this.domElement=l,this.sortObjects=!0,this.getSize=function(){return{width:i,height:n}},this.render=function(f,d){f.matrixWorldAutoUpdate===!0&&f.updateMatrixWorld(),d.parent===null&&d.matrixWorldAutoUpdate===!0&&d.updateMatrixWorld(),Cr.copy(d.matrixWorldInverse),Pr.multiplyMatrices(d.projectionMatrix,Cr),h(f,f,d),this.sortObjects&&m(f)},this.setSize=function(f,d){i=f,n=d,r=i/2,s=n/2,l.style.width=f+"px",l.style.height=d+"px"};function c(f){f.isCSS2DObject&&(f.element.style.display="none");for(let d=0,g=f.children.length;d<g;d++)c(f.children[d])}function h(f,d,g){if(f.visible===!1){c(f);return}if(f.isCSS2DObject){lt.setFromMatrixPosition(f.matrixWorld),lt.applyMatrix4(Pr);const _=lt.z>=-1&&lt.z<=1&&f.layers.test(g.layers)===!0,y=f.element;y.style.display=_===!0?"":"none",_===!0&&(f.onBeforeRender(t,d,g),y.style.transform="translate("+-100*f.center.x+"%,"+-100*f.center.y+"%)translate("+(lt.x*r+r)+"px,"+(-lt.y*s+s)+"px)",y.parentNode!==l&&l.appendChild(y),f.onAfterRender(t,d,g));const x={distanceToCameraSquared:u(g,f)};o.objects.set(f,x)}for(let _=0,y=f.children.length;_<y;_++)h(f.children[_],d,g)}function u(f,d){return Ar.setFromMatrixPosition(f.matrixWorld),Sr.setFromMatrixPosition(d.matrixWorld),Ar.distanceToSquared(Sr)}function p(f){const d=[];return f.traverseVisible(function(g){g.isCSS2DObject&&d.push(g)}),d}function m(f){const d=p(f).sort(function(_,y){if(_.renderOrder!==y.renderOrder)return y.renderOrder-_.renderOrder;const x=o.objects.get(_).distanceToCameraSquared,v=o.objects.get(y).distanceToCameraSquared;return x-v}),g=d.length;for(let _=0,y=d.length;_<y;_++)d[_].element.style.zIndex=g-_}}}const Za={CN:[35,105],IN:[22,78],US:[39,-98],ID:[-2,118],PK:[30,70],BR:[-10,-55],NG:[9,8],BD:[24,90],RU:[60,100],MX:[23,-102],JP:[36,138],ET:[9,38.5],PH:[12,122],EG:[27,30],VN:[16,108],DE:[51,10],TR:[39,35],IR:[32,53],TH:[15,101],GB:[54,-2],FR:[46,2],IT:[42.5,12.5],ZA:[-29,24],TZ:[-6,35],KE:[0,38],KR:[36,128],CO:[4,-72],ES:[40,-4],AR:[-34,-64],UG:[1,32],DZ:[28,3],UA:[49,32],IQ:[33,44],PL:[52,20],CA:[56,-106],MA:[32,-5],SA:[24,45],PE:[-10,-76],AU:[-25,134],MY:[4,109.5],GH:[8,-1],NP:[28,84],VE:[7,-66],MG:[-19,47],CM:[6,12],NL:[52.5,5.5],CL:[-34,-71],SE:[62,15],NO:[64,10],SG:[1.3,103.8],NZ:[-42,174],IE:[53,-8],IL:[31,35],AE:[24,54],CH:[47,8],AT:[47.5,14.5],PT:[39.5,-8],GR:[39,22],CZ:[49.8,15.5],BE:[50.8,4],HU:[47,20],FI:[64,26],DK:[56,10],IS:[65,-18],CD:[-3,22],SD:[16,30],AO:[-12.5,18.5],MZ:[-18,35],CI:[7.5,-5.5],NE:[17,10],BF:[12,-1.5],ML:[17,-4],SN:[14.5,-14.5],ZM:[-15,28],ZW:[-19,29.5],RW:[-2,30],AF:[33,65],MM:[21,96],KP:[40,127],MN:[46,105],LK:[7.8,80.8],KZ:[48,67],UZ:[41,64],CU:[22,-79.5],EC:[-1.5,-78.5],GT:[15.5,-90.3],BO:[-17,-65],HN:[15,-86.5],PY:[-23,-58],UY:[-33,-56],CR:[10,-84],PA:[9,-80]},Ka=new Set(["CN","IN","US","BR","RU","JP","DE","GB","FR","AU","CA","MX","ID","SA","ZA","EG","NG","AR","IT","ES","KR","TR","PL","NL","CH","SE","NO","PK","BD","VN"]),Xa=new Set(["CN","IN","US","BR","RU","AU","CA"]),Wa=new Set(["RU","CA","US","CN","BR","AU"]),qa=new Set(["IN","AR","KZ","DZ","CD","SA","MX","ID","SD","LY","IR","MN","PE","TD","NE","AO","ML","ZA","CO","ET","BO","MR","EG","TZ","NG","VE","PK","TR","CL","MM"]),Qa=new Set(["AF","UA","MG","MZ","FR","ES","TH","CM","PG","JP","DE","VN","MY","CI","PL","IT","PH","EC","BF","NZ","GB","GH","RO","LA","GY","OM","BY","KH","SN","UG","NO","SE","FI","MR","ZM","ZW","NP","MA","IQ","BD"]);class Ja{labelRenderer;labels=[];labelGroup;currentStyle="none";sphereRadius;currentMorph=0;globe=null;camera=null;constructor(e,t){this.sphereRadius=t,this.labelRenderer=new Ha;const i=e.clientWidth||800,n=e.clientHeight||600;this.labelRenderer.setSize(i,n),this.labelRenderer.domElement.style.position="absolute",this.labelRenderer.domElement.style.top="0",this.labelRenderer.domElement.style.left="0",this.labelRenderer.domElement.style.pointerEvents="none",e.appendChild(this.labelRenderer.domElement),this.labelGroup=new D.Group,this.injectStyles(),this.createLabels()}injectStyles(){const e=document.createElement("style");e.textContent=`
542
542
  .country-label {
543
543
  font-family: system-ui, -apple-system, sans-serif;
544
544
  font-weight: 400;
@@ -618,7 +618,7 @@
618
618
  font-size: 4px;
619
619
  color: rgba(255, 255, 255, 0.35);
620
620
  }
621
- `,document.head.appendChild(e)}getSizeCategory(e){return Wa.has(e)?"large":qa.has(e)?"medium":Qa.has(e)?"small":"tiny"}createLabels(){$i.forEach(e=>{const t=Za[e.code];if(!t)return;const[i,n]=t,r=this.getSizeCategory(e.code),s=document.createElement("div");s.className=`country-label hidden size-${r}`,s.textContent=e.name;const o=new Ya(s),l={element:s,object:o,country:e,lat:i,lon:n,sizeCategory:r};this.labelGroup.add(o),this.labels.push(l),this.updateLabelPosition(o,l,this.currentMorph)})}tempVector=new D.Vector3;cameraDirection=new D.Vector3;updateLabelPosition(e,t,i){const{lat:n,lon:r,element:s}=t,o=n*Math.PI/180,l=r*Math.PI/180,h=this.sphereRadius+.5,c=h*Math.cos(o)*Math.sin(l),u=h*Math.sin(o),p=h*Math.cos(o)*Math.cos(l),m=2*Math.PI*this.sphereRadius,f=Math.PI*this.sphereRadius,d=(r+180)/360,g=(n+90)/180,_=(d-.5)*m,y=(g-.5)*f,b=.5;if(this.globe&&i>.01)if(this.tempVector.set(c,u,p),this.tempVector.applyEuler(this.globe.rotation),e.position.set(this.tempVector.x*i+_*(1-i),this.tempVector.y*i+y*(1-i),this.tempVector.z*i+b*(1-i)),this.camera&&i>.5){this.cameraDirection.copy(this.camera.position).normalize();const C=this.tempVector.clone().normalize().dot(this.cameraDirection)>.15;s.style.opacity=C?"":"0"}else s.style.opacity="";else e.position.set(c*i+_*(1-i),u*i+y*(1-i),p*i+b*(1-i)),s.style.opacity=""}getGroup(){return this.labelGroup}setStyle(e){this.currentStyle=e,this.labels.forEach(t=>{const i=t.country.code;let n=!1;switch(e){case"none":n=!1;break;case"minimal":n=Xa.has(i);break;case"major":n=Ka.has(i);break;case"all":case"capitals":n=!0;break}t.element.classList.toggle("hidden",!n)}),this.labelRenderer.domElement.className=`label-style-${e}`}setMorph(e){this.currentMorph=e}setGlobe(e){this.globe=e}setCamera(e){this.camera=e}update(){this.currentStyle!=="none"&&this.labels.forEach(e=>{this.updateLabelPosition(e.object,e,this.currentMorph)})}render(e,t){this.currentStyle!=="none"&&this.labelRenderer.render(e,t)}resize(e,t){this.labelRenderer.setSize(e,t)}getStyle(){return this.currentStyle}getVisibleLabelsForCanvas(e,t,i){if(this.currentStyle==="none")return[];const n=[],r=new D.Vector3;return this.labels.forEach(s=>{const o=s.element.style.opacity,l=o===""?1:parseFloat(o)||0;if(l<.1||s.element.classList.contains("hidden"))return;s.object.getWorldPosition(r),r.project(e);const h=(r.x*.5+.5)*t,c=(-r.y*.5+.5)*i;h>=0&&h<=t&&c>=0&&c<=i&&r.z<1&&n.push({text:s.country.name,x:h,y:c,opacity:l})}),n}dispose(){this.labels.forEach(e=>{this.labelGroup.remove(e.object),e.element.remove()}),this.labels=[],this.labelRenderer.domElement.remove()}}const Zt={lifeExpectancy:{id:"lifeExpectancy",name:"Life Expectancy",unit:"years",description:"Average life expectancy at birth",colorScale:["#feedde","#fdbe85","#d94701"],domain:[55,85],format:a=>`${a.toFixed(1)} years`},humanDevIndex:{id:"humanDevIndex",name:"Human Development Index",unit:"",description:"UN composite index of life expectancy, education, and income",colorScale:["#fee5d9","#fcae91","#cb181d"],domain:[.4,1],format:a=>a.toFixed(3)},gdpPerCapita:{id:"gdpPerCapita",name:"GDP per Capita (PPP)",unit:"$",description:"Purchasing power parity adjusted GDP per person",colorScale:["#edf8e9","#74c476","#006d2c"],domain:[1e3,8e4],format:a=>`$${(a/1e3).toFixed(1)}k`},co2Emissions:{id:"co2Emissions",name:"CO₂ Emissions",unit:"t/capita",description:"Carbon dioxide emissions per capita",colorScale:["#f7fbff","#6baed6","#08306b"],domain:[0,20],format:a=>`${a.toFixed(1)}t`},renewableEnergy:{id:"renewableEnergy",name:"Renewable Energy",unit:"%",description:"Share of renewable energy in total energy consumption",colorScale:["#f7fcf5","#74c476","#00441b"],domain:[0,100],format:a=>`${a.toFixed(0)}%`},internetUsers:{id:"internetUsers",name:"Internet Penetration",unit:"%",description:"Percentage of population using the internet",colorScale:["#f2f0f7","#9e9ac8","#54278f"],domain:[0,100],format:a=>`${a.toFixed(0)}%`},urbanPopulation:{id:"urbanPopulation",name:"Urbanization",unit:"%",description:"Percentage of population living in urban areas",colorScale:["#fff5eb","#fd8d3c","#7f2704"],domain:[15,100],format:a=>`${a.toFixed(0)}%`},healthExpenditure:{id:"healthExpenditure",name:"Health Spending",unit:"% GDP",description:"Total health expenditure as percentage of GDP",colorScale:["#fff5f0","#fb6a4a","#99000d"],domain:[2,18],format:a=>`${a.toFixed(1)}%`},forestArea:{id:"forestArea",name:"Forest Coverage",unit:"%",description:"Forest area as percentage of total land area",colorScale:["#f7fcf5","#41ab5d","#00441b"],domain:[0,75],format:a=>`${a.toFixed(0)}%`},population:{id:"population",name:"Population",unit:"millions",description:"Total population",colorScale:["#fff7bc","#fec44f","#d95f0e"],domain:[1,1500],format:a=>`${a.toFixed(0)}M`},accessElectricity:{id:"accessElectricity",name:"Electricity Access",unit:"%",description:"Percentage of population with access to electricity",colorScale:["#ffeda0","#feb24c","#f03b20"],domain:[20,100],format:a=>`${a.toFixed(0)}%`},educationExpenditure:{id:"educationExpenditure",name:"Education Spending",unit:"% GDP",description:"Government expenditure on education as percentage of GDP",colorScale:["#edf8fb","#7bccc4","#0868ac"],domain:[1,10],format:a=>`${a.toFixed(1)}%`}};Zt.lifeExpectancy;const Ze=50,eo=`
621
+ `,document.head.appendChild(e)}getSizeCategory(e){return Wa.has(e)?"large":qa.has(e)?"medium":Qa.has(e)?"small":"tiny"}createLabels(){$i.forEach(e=>{const t=Za[e.code];if(!t)return;const[i,n]=t,r=this.getSizeCategory(e.code),s=document.createElement("div");s.className=`country-label hidden size-${r}`,s.textContent=e.name;const o=new Ya(s),l={element:s,object:o,country:e,lat:i,lon:n,sizeCategory:r};this.labelGroup.add(o),this.labels.push(l),this.updateLabelPosition(o,l,this.currentMorph)})}tempVector=new D.Vector3;cameraDirection=new D.Vector3;updateLabelPosition(e,t,i){const{lat:n,lon:r,element:s}=t,o=n*Math.PI/180,l=r*Math.PI/180,c=this.sphereRadius+.5,h=c*Math.cos(o)*Math.sin(l),u=c*Math.sin(o),p=c*Math.cos(o)*Math.cos(l),m=2*Math.PI*this.sphereRadius,f=Math.PI*this.sphereRadius,d=(r+180)/360,g=(n+90)/180,_=(d-.5)*m,y=(g-.5)*f,x=.5;if(this.globe&&i>.01)if(this.tempVector.set(h,u,p),this.tempVector.applyEuler(this.globe.rotation),e.position.set(this.tempVector.x*i+_*(1-i),this.tempVector.y*i+y*(1-i),this.tempVector.z*i+x*(1-i)),this.camera&&i>.5){this.cameraDirection.copy(this.camera.position).normalize();const C=this.tempVector.clone().normalize().dot(this.cameraDirection)>.15;s.style.opacity=C?"":"0"}else s.style.opacity="";else e.position.set(h*i+_*(1-i),u*i+y*(1-i),p*i+x*(1-i)),s.style.opacity=""}getGroup(){return this.labelGroup}setStyle(e){this.currentStyle=e,this.labels.forEach(t=>{const i=t.country.code;let n=!1;switch(e){case"none":n=!1;break;case"minimal":n=Xa.has(i);break;case"major":n=Ka.has(i);break;case"all":case"capitals":n=!0;break}t.element.classList.toggle("hidden",!n)}),this.labelRenderer.domElement.className=`label-style-${e}`}setMorph(e){this.currentMorph=e}setGlobe(e){this.globe=e}setCamera(e){this.camera=e}update(){this.currentStyle!=="none"&&this.labels.forEach(e=>{this.updateLabelPosition(e.object,e,this.currentMorph)})}render(e,t){this.currentStyle!=="none"&&this.labelRenderer.render(e,t)}resize(e,t){this.labelRenderer.setSize(e,t)}getStyle(){return this.currentStyle}getVisibleLabelsForCanvas(e,t,i){if(this.currentStyle==="none")return[];const n=[],r=new D.Vector3;return this.labels.forEach(s=>{const o=s.element.style.opacity,l=o===""?1:parseFloat(o)||0;if(l<.1||s.element.classList.contains("hidden"))return;s.object.getWorldPosition(r),r.project(e);const c=(r.x*.5+.5)*t,h=(-r.y*.5+.5)*i;c>=0&&c<=t&&h>=0&&h<=i&&r.z<1&&n.push({text:s.country.name,x:c,y:h,opacity:l})}),n}dispose(){this.labels.forEach(e=>{this.labelGroup.remove(e.object),e.element.remove()}),this.labels=[],this.labelRenderer.domElement.remove()}}const Zt={lifeExpectancy:{id:"lifeExpectancy",name:"Life Expectancy",unit:"years",description:"Average life expectancy at birth",colorScale:["#feedde","#fdbe85","#d94701"],domain:[55,85],format:a=>`${a.toFixed(1)} years`},humanDevIndex:{id:"humanDevIndex",name:"Human Development Index",unit:"",description:"UN composite index of life expectancy, education, and income",colorScale:["#fee5d9","#fcae91","#cb181d"],domain:[.4,1],format:a=>a.toFixed(3)},gdpPerCapita:{id:"gdpPerCapita",name:"GDP per Capita (PPP)",unit:"$",description:"Purchasing power parity adjusted GDP per person",colorScale:["#edf8e9","#74c476","#006d2c"],domain:[1e3,8e4],format:a=>`$${(a/1e3).toFixed(1)}k`},co2Emissions:{id:"co2Emissions",name:"CO₂ Emissions",unit:"t/capita",description:"Carbon dioxide emissions per capita",colorScale:["#f7fbff","#6baed6","#08306b"],domain:[0,20],format:a=>`${a.toFixed(1)}t`},renewableEnergy:{id:"renewableEnergy",name:"Renewable Energy",unit:"%",description:"Share of renewable energy in total energy consumption",colorScale:["#f7fcf5","#74c476","#00441b"],domain:[0,100],format:a=>`${a.toFixed(0)}%`},internetUsers:{id:"internetUsers",name:"Internet Penetration",unit:"%",description:"Percentage of population using the internet",colorScale:["#f2f0f7","#9e9ac8","#54278f"],domain:[0,100],format:a=>`${a.toFixed(0)}%`},urbanPopulation:{id:"urbanPopulation",name:"Urbanization",unit:"%",description:"Percentage of population living in urban areas",colorScale:["#fff5eb","#fd8d3c","#7f2704"],domain:[15,100],format:a=>`${a.toFixed(0)}%`},healthExpenditure:{id:"healthExpenditure",name:"Health Spending",unit:"% GDP",description:"Total health expenditure as percentage of GDP",colorScale:["#fff5f0","#fb6a4a","#99000d"],domain:[2,18],format:a=>`${a.toFixed(1)}%`},forestArea:{id:"forestArea",name:"Forest Coverage",unit:"%",description:"Forest area as percentage of total land area",colorScale:["#f7fcf5","#41ab5d","#00441b"],domain:[0,75],format:a=>`${a.toFixed(0)}%`},population:{id:"population",name:"Population",unit:"millions",description:"Total population",colorScale:["#fff7bc","#fec44f","#d95f0e"],domain:[1,1500],format:a=>`${a.toFixed(0)}M`},accessElectricity:{id:"accessElectricity",name:"Electricity Access",unit:"%",description:"Percentage of population with access to electricity",colorScale:["#ffeda0","#feb24c","#f03b20"],domain:[20,100],format:a=>`${a.toFixed(0)}%`},educationExpenditure:{id:"educationExpenditure",name:"Education Spending",unit:"% GDP",description:"Government expenditure on education as percentage of GDP",colorScale:["#edf8fb","#7bccc4","#0868ac"],domain:[1,10],format:a=>`${a.toFixed(1)}%`}};Zt.lifeExpectancy;const Ze=50,eo=`
622
622
  uniform float uMorph;
623
623
  uniform float uTime;
624
624
  uniform float uParchment;
@@ -661,6 +661,44 @@ float noise(vec2 p) {
661
661
  return mix(mix(a, b, f.x), mix(c, d, f.x), f.y);
662
662
  }
663
663
 
664
+ // 3D noise for seamless spherical sampling
665
+ float noise3D(vec3 p) {
666
+ vec3 i = floor(p);
667
+ vec3 f = fract(p);
668
+ f = f * f * (3.0 - 2.0 * f);
669
+
670
+ float n000 = hash3(i);
671
+ float n100 = hash3(i + vec3(1.0, 0.0, 0.0));
672
+ float n010 = hash3(i + vec3(0.0, 1.0, 0.0));
673
+ float n110 = hash3(i + vec3(1.0, 1.0, 0.0));
674
+ float n001 = hash3(i + vec3(0.0, 0.0, 1.0));
675
+ float n101 = hash3(i + vec3(1.0, 0.0, 1.0));
676
+ float n011 = hash3(i + vec3(0.0, 1.0, 1.0));
677
+ float n111 = hash3(i + vec3(1.0, 1.0, 1.0));
678
+
679
+ float nx00 = mix(n000, n100, f.x);
680
+ float nx10 = mix(n010, n110, f.x);
681
+ float nx01 = mix(n001, n101, f.x);
682
+ float nx11 = mix(n011, n111, f.x);
683
+
684
+ float nxy0 = mix(nx00, nx10, f.y);
685
+ float nxy1 = mix(nx01, nx11, f.y);
686
+
687
+ return mix(nxy0, nxy1, f.z);
688
+ }
689
+
690
+ // FBM using 3D noise for seamless spherical clouds
691
+ float fbm3D(vec3 p) {
692
+ float value = 0.0;
693
+ float amplitude = 0.5;
694
+ for (int i = 0; i < 4; i++) {
695
+ value += amplitude * noise3D(p);
696
+ p *= 2.0;
697
+ amplitude *= 0.5;
698
+ }
699
+ return value;
700
+ }
701
+
664
702
  // Fractal Brownian Motion for natural-looking tears
665
703
  float fbm(vec2 p) {
666
704
  float value = 0.0;
@@ -901,6 +939,49 @@ float fbm(vec2 p) {
901
939
  return value;
902
940
  }
903
941
 
942
+ // 3D hash for volumetric noise
943
+ float hash3(vec3 p) {
944
+ return fract(sin(dot(p, vec3(127.1, 311.7, 74.7))) * 43758.5453);
945
+ }
946
+
947
+ // 3D noise for seamless spherical sampling
948
+ float noise3D(vec3 p) {
949
+ vec3 i = floor(p);
950
+ vec3 f = fract(p);
951
+ f = f * f * (3.0 - 2.0 * f);
952
+
953
+ float n000 = hash3(i);
954
+ float n100 = hash3(i + vec3(1.0, 0.0, 0.0));
955
+ float n010 = hash3(i + vec3(0.0, 1.0, 0.0));
956
+ float n110 = hash3(i + vec3(1.0, 1.0, 0.0));
957
+ float n001 = hash3(i + vec3(0.0, 0.0, 1.0));
958
+ float n101 = hash3(i + vec3(1.0, 0.0, 1.0));
959
+ float n011 = hash3(i + vec3(0.0, 1.0, 1.0));
960
+ float n111 = hash3(i + vec3(1.0, 1.0, 1.0));
961
+
962
+ float nx00 = mix(n000, n100, f.x);
963
+ float nx10 = mix(n010, n110, f.x);
964
+ float nx01 = mix(n001, n101, f.x);
965
+ float nx11 = mix(n011, n111, f.x);
966
+
967
+ float nxy0 = mix(nx00, nx10, f.y);
968
+ float nxy1 = mix(nx01, nx11, f.y);
969
+
970
+ return mix(nxy0, nxy1, f.z);
971
+ }
972
+
973
+ // FBM using 3D noise for seamless spherical clouds
974
+ float fbm3D(vec3 p) {
975
+ float value = 0.0;
976
+ float amplitude = 0.5;
977
+ for (int i = 0; i < 4; i++) {
978
+ value += amplitude * noise3D(p);
979
+ p *= 2.0;
980
+ amplitude *= 0.5;
981
+ }
982
+ return value;
983
+ }
984
+
904
985
  void main() {
905
986
  if (vDiscard > 0.5) {
906
987
  discard;
@@ -943,17 +1024,29 @@ void main() {
943
1024
  color += vec3(1.0, 0.9, 0.7) * scatter * 0.15;
944
1025
  }
945
1026
 
946
- // Cloud layer
1027
+ // Cloud layer - use spherical 3D coordinates for seamless wrapping
947
1028
  if (uClouds > 0.01) {
948
- vec2 cloudUv = vUv + vec2(uTime * uCloudSpeed * 0.01, 0.0);
949
- cloudUv = fract(cloudUv);
950
-
951
- float cloud1 = fbm(cloudUv * 8.0 + uTime * uCloudSpeed * 0.1);
952
- float cloud2 = fbm(cloudUv * 16.0 - uTime * uCloudSpeed * 0.05);
953
- float cloud3 = fbm(cloudUv * 4.0 + uTime * uCloudSpeed * 0.02);
1029
+ // Convert UV to spherical 3D coordinates (naturally wraps without seams)
1030
+ float lon = vUv.x * 2.0 * 3.14159;
1031
+ float lat = (vUv.y - 0.5) * 3.14159;
1032
+
1033
+ // Add time-based rotation for cloud movement
1034
+ float cloudLon = lon + uTime * uCloudSpeed * 0.02;
1035
+
1036
+ // Create 3D point on sphere surface
1037
+ vec3 spherePoint = vec3(
1038
+ cos(lat) * cos(cloudLon),
1039
+ sin(lat),
1040
+ cos(lat) * sin(cloudLon)
1041
+ );
1042
+
1043
+ // Sample noise at different scales using 3D coordinates
1044
+ float cloud1 = fbm3D(spherePoint * 3.0 + uTime * uCloudSpeed * 0.01);
1045
+ float cloud2 = fbm3D(spherePoint * 6.0 - uTime * uCloudSpeed * 0.005);
1046
+ float cloud3 = fbm3D(spherePoint * 1.5 + uTime * uCloudSpeed * 0.003);
954
1047
 
955
1048
  float clouds = cloud1 * 0.5 + cloud2 * 0.3 + cloud3 * 0.2;
956
- clouds = smoothstep(0.35, 0.7, clouds);
1049
+ clouds = smoothstep(0.35, 0.65, clouds);
957
1050
 
958
1051
  vec3 cloudColor = vec3(1.0, 1.0, 1.0);
959
1052
  float cloudLight = 0.7 + 0.3 * dayFactor;
@@ -1062,5 +1155,5 @@ void main() {
1062
1155
 
1063
1156
  gl_FragColor = vec4(1.0, 1.0, 1.0, alpha * vOpacity * 0.9);
1064
1157
  }
1065
- `,Tr={satellite:"https://raw.githubusercontent.com/mrdoob/three.js/dev/examples/textures/planets/earth_atmos_2048.jpg",natural:"https://raw.githubusercontent.com/mrdoob/three.js/dev/examples/textures/planets/earth_day_4096.jpg",dark:"https://raw.githubusercontent.com/mrdoob/three.js/dev/examples/textures/planets/earth_lights_2048.png",light:"https://raw.githubusercontent.com/turban/webgl-earth/master/images/2_no_clouds_4k.jpg",night:"https://raw.githubusercontent.com/mrdoob/three.js/dev/examples/textures/planets/earth_lights_2048.png",topographic:"https://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74117/world.topo.200407.3x5400x2700.jpg"},Dr={texture:"satellite",labels:"all",statistic:"lifeExpectancy",autoRotate:!1,initialView:"globe",showControls:!1,showLegend:!0,effects:{atmosphereIntensity:0,atmosphere:!1,clouds:!1,starTwinkle:!0},extrudeHeight:!1};class ao{container;config;scene;camera;renderer;controls;globe=null;material=null;atmosphere=null;stars=null;gui=null;choropleth=null;legend=null;exporter=null;countryLabels=null;textureLoader=new D.TextureLoader;dataTexture=null;morph=0;currentStatistic=null;animationId=null;isDestroyed=!1;ready;resolveReady;constructor(e,t={}){if(typeof e=="string"){const i=document.querySelector(e);if(!i)throw new Error(`Container not found: ${e}`);this.container=i}else this.container=e;this.config={...Dr,...t,effects:{...Dr.effects,...t.effects}},this.ready=new Promise(i=>{this.resolveReady=i}),this.init()}async init(){const e=this.config.width||this.container.clientWidth||800,t=this.config.height||this.container.clientHeight||600;this.scene=new D.Scene,this.scene.background=new D.Color(2066),this.camera=new D.PerspectiveCamera(50,e/t,1,1e3),this.camera.position.set(0,0,this.config.initialView==="flat"?350:150),this.renderer=new D.WebGLRenderer({antialias:!0}),this.renderer.setSize(e,t),this.renderer.setPixelRatio(Math.min(window.devicePixelRatio,2)),this.container.appendChild(this.renderer.domElement),this.controls=new Ir(this.camera,this.renderer.domElement),this.controls.enableDamping=!0,this.controls.minDistance=80,this.controls.maxDistance=400,this.choropleth=new Ca,this.config.showLegend&&(this.legend=new Sa(this.container)),await this.createGlobe(),this.createStars(),this.config.effects.atmosphere&&this.createAtmosphere(),this.countryLabels=new Ja(this.container,Ze),this.scene.add(this.countryLabels.getGroup()),this.globe&&this.countryLabels.setGlobe(this.globe),this.countryLabels.setCamera(this.camera),this.countryLabels.setStyle(this.config.labels),this.exporter=new ja(this.renderer,this.scene,this.camera),this.config.showControls&&this.createGUI(),await this.choropleth.waitForLoad(),this.setStatistic(this.config.statistic),this.morph=this.config.initialView==="globe"?1:0,this.material&&(this.material.uniforms.uMorph.value=this.morph),this.countryLabels?.setMorph(this.morph),window.addEventListener("resize",this.handleResize),document.addEventListener("fullscreenchange",this.handleFullscreenChange),window.addEventListener("keydown",this.handleKeydown),this.animate(),this.resolveReady()}async createGlobe(){const e=await this.textureLoader.loadAsync(Tr[this.config.texture]);e.anisotropy=this.renderer.capabilities.getMaxAnisotropy(),e.minFilter=D.LinearMipmapLinearFilter,e.magFilter=D.LinearFilter;const t=document.createElement("canvas");t.width=2048,t.height=1024,this.dataTexture=new D.CanvasTexture(t);const i=new D.PlaneGeometry(Math.PI*2*Ze,Math.PI*Ze,256,128);this.material=new D.ShaderMaterial({vertexShader:eo,fragmentShader:to,uniforms:{uMorph:{value:0},uTime:{value:0},uParchment:{value:0},uExtremeParchment:{value:0},uTransitionEffect:{value:0},uTexture:{value:e},uDataTexture:{value:this.dataTexture},uCloudTexture:{value:null},uNightTexture:{value:null},uDataOpacity:{value:0},uDataOverlay:{value:0},uExtrudeHeight:{value:this.config.extrudeHeight?1:0},uSunDir:{value:new D.Vector3(1,.5,1).normalize()},uClouds:{value:this.config.effects.clouds?1:0},uCloudSpeed:{value:this.config.effects.cloudSpeed||1},uCloudOpacity:{value:this.config.effects.cloudOpacity||.6},uAtmosphereIntensity:{value:this.config.effects.atmosphereIntensity||0},uAurora:{value:this.config.effects.aurora?1:0},uAuroraIntensity:{value:1},uCityLights:{value:this.config.effects.cityLights?1:0},uCityLightsIntensity:{value:1},uOceanSpecular:{value:this.config.effects.oceanSpecular?1:0},uSpecularIntensity:{value:1},uSunGlow:{value:0},uGridLines:{value:this.config.effects.gridLines?1:0},uGridOpacity:{value:this.config.effects.gridOpacity||.5},uScanEffect:{value:0},uScanSpeed:{value:1},uHologram:{value:this.config.effects.hologramMode?1:0},uHologramColor:{value:new D.Color(65535)},uVintage:{value:this.config.effects.vintageMode?1:0},uThermal:{value:this.config.effects.thermalMode?1:0},uBlueprint:{value:this.config.effects.blueprintMode?1:0},uGlowPulse:{value:this.config.effects.glowPulse?1:0},uGlowColor:{value:new D.Color(4491519)}},side:D.DoubleSide}),this.globe=new D.Mesh(i,this.material),this.scene.add(this.globe)}createAtmosphere(){const e=new D.PlaneGeometry(Math.PI*2*Ze*1.15,Math.PI*Ze*1.15,128,64),t=new D.ShaderMaterial({vertexShader:io,fragmentShader:no,uniforms:{uMorph:{value:0}},side:D.BackSide,transparent:!0,blending:D.AdditiveBlending,depthWrite:!1});this.atmosphere=new D.Mesh(e,t),this.scene.add(this.atmosphere)}createStars(){const t=new D.BufferGeometry,i=new Float32Array(3e3*3),n=new Float32Array(3e3),r=new Float32Array(3e3);for(let o=0;o<3e3;o++){const l=300+Math.random()*300,h=Math.random()*Math.PI*2,c=Math.acos(2*Math.random()-1);i[o*3]=l*Math.sin(c)*Math.cos(h),i[o*3+1]=l*Math.sin(c)*Math.sin(h),i[o*3+2]=l*Math.cos(c),n[o]=.5+Math.random()*1.5,r[o]=Math.random()*Math.PI*2}t.setAttribute("position",new D.BufferAttribute(i,3)),t.setAttribute("aSize",new D.BufferAttribute(n,1)),t.setAttribute("aPhase",new D.BufferAttribute(r,1));const s=new D.ShaderMaterial({vertexShader:ro,fragmentShader:so,uniforms:{uTime:{value:0},uTwinkle:{value:this.config.effects.starTwinkle?1:0}},transparent:!0,blending:D.AdditiveBlending,depthWrite:!1});this.stars=new D.Points(t,s),this.scene.add(this.stars)}createGUI(){this.gui=new Ni({title:"Globe Controls",width:300});const e=this.gui.addFolder("View");e.add({toGlobe:()=>this.toGlobe()},"toGlobe").name("→ Globe"),e.add({toFlat:()=>this.toFlat()},"toFlat").name("→ Flat Map"),e.add({morph:this.morph},"morph",0,1).name("Morph").onChange(r=>this.setMorph(r)),e.open();const t=this.gui.addFolder("Statistics"),i=Object.keys(Zt);t.add({stat:this.config.statistic},"stat",i).name("Statistic").onChange(r=>this.setStatistic(r)),t.open();const n=["none","minimal","major","all"];this.gui.add({labels:this.config.labels},"labels",n).name("Labels").onChange(r=>this.setLabels(r)),this.gui.add(this.config,"autoRotate").name("Auto Rotate")}handleResize=()=>{if(this.isDestroyed)return;const e=this.config.width||this.container.clientWidth,t=this.config.height||this.container.clientHeight;this.camera.aspect=e/t,this.camera.updateProjectionMatrix(),this.renderer.setSize(e,t),this.countryLabels?.resize(e,t)};handleFullscreenChange=()=>{this.isDestroyed||setTimeout(()=>this.handleResize(),50)};handleKeydown=e=>{this.isDestroyed||((e.key==="g"||e.key==="G")&&(this.morph>.5?this.toFlat():this.toGlobe()),(e.key==="f"||e.key==="F")&&this.toggleFullscreen())};animate=()=>{if(this.isDestroyed)return;this.animationId=requestAnimationFrame(this.animate);const e=performance.now()*.001;this.material&&(this.material.uniforms.uTime.value=e),this.stars&&(this.stars.material.uniforms.uTime.value=e),this.controls.update(),this.config.autoRotate&&this.globe&&(this.globe.rotation.y+=.002*this.morph),this.countryLabels?.update(),this.renderer.render(this.scene,this.camera),this.countryLabels?.render(this.scene,this.camera)};toGlobe(){wt.to(this,{morph:1,duration:2.5,ease:"power2.inOut",onUpdate:()=>{this.material&&(this.material.uniforms.uMorph.value=this.morph),this.atmosphere&&(this.atmosphere.material.uniforms.uMorph.value=this.morph),this.countryLabels?.setMorph(this.morph),this.config.onViewChange?.("globe",this.morph)}}),wt.to(this.camera.position,{z:150,duration:2.5,ease:"power2.inOut"})}toFlat(){wt.to(this,{morph:0,duration:2.5,ease:"power2.inOut",onUpdate:()=>{this.material&&(this.material.uniforms.uMorph.value=this.morph),this.atmosphere&&(this.atmosphere.material.uniforms.uMorph.value=this.morph),this.countryLabels?.setMorph(this.morph),this.config.onViewChange?.("flat",this.morph)}}),wt.to(this.camera.position,{z:350,duration:2.5,ease:"power2.inOut"})}setMorph(e){this.morph=Math.max(0,Math.min(1,e)),this.material&&(this.material.uniforms.uMorph.value=this.morph),this.atmosphere&&(this.atmosphere.material.uniforms.uMorph.value=this.morph),this.countryLabels?.setMorph(this.morph)}getMorph(){return this.morph}setStatistic(e){if(typeof e=="string"){if(!Zt[e]){console.warn(`Unknown statistic: ${e}`);return}this.currentStatistic=e;const i=va.find(n=>n.id===e);if(i&&this.choropleth){const n=this.choropleth.renderTexture(i);if(this.material&&n){const r=new D.CanvasTexture(n);r.needsUpdate=!0,this.material.uniforms.uDataTexture.value=r,this.material.uniforms.uDataOverlay.value=1,this.material.uniforms.uDataOpacity.value=.7}}this.legend&&i&&this.legend.show(i)}else{const t=e;if(this.currentStatistic=t.definition.id,this.choropleth){const i=this.choropleth.renderCustomTexture(t.values,t.definition.colorScale,t.definition.domain);if(this.material&&i){const n=new D.CanvasTexture(i);n.needsUpdate=!0,this.material.uniforms.uDataTexture.value=n,this.material.uniforms.uDataOverlay.value=1,this.material.uniforms.uDataOpacity.value=.7}}this.legend&&this.legend.show(t.definition)}}setLabels(e){this.countryLabels?.setStyle(e)}async setTexture(e){const t=Tr[e];if(!(!t||!this.material))try{const i=await this.textureLoader.loadAsync(t);i.anisotropy=this.renderer.capabilities.getMaxAnisotropy(),i.minFilter=D.LinearMipmapLinearFilter,i.magFilter=D.LinearFilter,this.material.uniforms.uTexture.value=i}catch(i){console.error("Failed to load texture:",e,i)}}setAutoRotate(e){this.config.autoRotate=e}screenshot(e){this.exporter?.screenshot(e)}async recordGif(e){if(!this.exporter)return;const t=e?.duration||5,i=e?.fps||20,n=t*i;this.exporter.startGifCapture(e);for(let r=0;r<n;r++)this.exporter.captureGifFrame(),await new Promise(s=>setTimeout(s,1e3/i));await this.exporter.stopGifCapture(e)}async recordVideo(e){if(!this.exporter)return;const t=e?.duration||5;await this.exporter.startVideoRecording(e),await new Promise(i=>setTimeout(i,t*1e3)),this.exporter.stopVideoRecording()}setEffects(e){Object.assign(this.config.effects,e),this.material&&(e.atmosphere!==void 0&&(e.atmosphere&&!this.atmosphere?this.createAtmosphere():!e.atmosphere&&this.atmosphere&&(this.scene.remove(this.atmosphere),this.atmosphere.geometry.dispose(),this.atmosphere.material.dispose(),this.atmosphere=null)),e.clouds!==void 0&&(this.material.uniforms.uClouds.value=e.clouds?1:0),e.cloudSpeed!==void 0&&(this.material.uniforms.uCloudSpeed.value=e.cloudSpeed),e.cloudOpacity!==void 0&&(this.material.uniforms.uCloudOpacity.value=e.cloudOpacity),e.atmosphereIntensity!==void 0&&(this.material.uniforms.uAtmosphereIntensity.value=e.atmosphereIntensity),e.gridLines!==void 0&&(this.material.uniforms.uGridLines.value=e.gridLines?1:0),e.gridOpacity!==void 0&&(this.material.uniforms.uGridOpacity.value=e.gridOpacity),e.glowPulse!==void 0&&(this.material.uniforms.uGlowPulse.value=e.glowPulse?1:0),e.starTwinkle!==void 0&&this.stars&&(this.stars.material.uniforms.uTwinkle.value=e.starTwinkle?1:0))}resize(e,t){this.config.width=e,this.config.height=t,this.handleResize()}async toggleFullscreen(){document.fullscreenElement?(await document.exitFullscreen(),setTimeout(()=>this.handleResize(),100)):(await this.container.requestFullscreen(),setTimeout(()=>this.handleResize(),100))}isFullscreen(){return document.fullscreenElement===this.container}destroy(){this.isDestroyed=!0,this.animationId&&cancelAnimationFrame(this.animationId),window.removeEventListener("resize",this.handleResize),window.removeEventListener("keydown",this.handleKeydown),document.removeEventListener("fullscreenchange",this.handleFullscreenChange),this.gui?.destroy(),this.legend?.dispose(),this.countryLabels?.dispose(),this.globe?.geometry.dispose(),this.globe?.material?.dispose(),this.atmosphere?.geometry.dispose(),this.atmosphere?.material?.dispose(),this.stars?.geometry.dispose(),this.stars?.material?.dispose(),this.renderer.dispose(),this.container.removeChild(this.renderer.domElement)}}ae.BUILT_IN_STATISTICS=Zt,ae.GlobeViz=ao,ae.WORLD_STATISTICS=$i,ae.createFormatter=Vi,ae.formatValue=Pa,ae.normalizeCountryValues=fr,ae.toNumericCode=Bi,Object.defineProperty(ae,Symbol.toStringTag,{value:"Module"})}));
1158
+ `,Tr={satellite:"https://raw.githubusercontent.com/mrdoob/three.js/dev/examples/textures/planets/earth_atmos_2048.jpg",natural:"https://raw.githubusercontent.com/mrdoob/three.js/dev/examples/textures/planets/earth_day_4096.jpg",dark:"https://raw.githubusercontent.com/mrdoob/three.js/dev/examples/textures/planets/earth_lights_2048.png",light:"https://raw.githubusercontent.com/turban/webgl-earth/master/images/2_no_clouds_4k.jpg",night:"https://raw.githubusercontent.com/mrdoob/three.js/dev/examples/textures/planets/earth_lights_2048.png",topographic:"https://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74117/world.topo.200407.3x5400x2700.jpg"},Dr={texture:"satellite",labels:"all",statistic:"lifeExpectancy",autoRotate:!1,initialView:"globe",showControls:!1,showLegend:!0,effects:{atmosphereIntensity:0,atmosphere:!1,clouds:!1,starTwinkle:!0},extrudeHeight:!1};class ao{container;config;scene;camera;renderer;controls;globe=null;material=null;atmosphere=null;stars=null;gui=null;choropleth=null;legend=null;exporter=null;countryLabels=null;textureLoader=new D.TextureLoader;dataTexture=null;morph=0;currentStatistic=null;animationId=null;isDestroyed=!1;ready;resolveReady;constructor(e,t={}){if(typeof e=="string"){const i=document.querySelector(e);if(!i)throw new Error(`Container not found: ${e}`);this.container=i}else this.container=e;this.config={...Dr,...t,effects:{...Dr.effects,...t.effects}},this.ready=new Promise(i=>{this.resolveReady=i}),this.init()}async init(){const e=this.config.width||this.container.clientWidth||800,t=this.config.height||this.container.clientHeight||600;this.scene=new D.Scene,this.scene.background=new D.Color(2066),this.camera=new D.PerspectiveCamera(50,e/t,1,1e3),this.camera.position.set(0,0,this.config.initialView==="flat"?350:150),this.renderer=new D.WebGLRenderer({antialias:!0}),this.renderer.setSize(e,t),this.renderer.setPixelRatio(Math.min(window.devicePixelRatio,2)),this.container.appendChild(this.renderer.domElement),this.controls=new Ir(this.camera,this.renderer.domElement),this.controls.enableDamping=!0,this.controls.minDistance=80,this.controls.maxDistance=400,this.choropleth=new Ca,this.config.showLegend&&(this.legend=new Sa(this.container)),await this.createGlobe(),this.createStars(),this.config.effects.atmosphere&&this.createAtmosphere(),this.countryLabels=new Ja(this.container,Ze),this.scene.add(this.countryLabels.getGroup()),this.globe&&this.countryLabels.setGlobe(this.globe),this.countryLabels.setCamera(this.camera),this.countryLabels.setStyle(this.config.labels),this.exporter=new ja(this.renderer,this.scene,this.camera),this.config.showControls&&this.createGUI(),await this.choropleth.waitForLoad(),this.setStatistic(this.config.statistic),this.morph=this.config.initialView==="globe"?1:0,this.material&&(this.material.uniforms.uMorph.value=this.morph),this.countryLabels?.setMorph(this.morph),window.addEventListener("resize",this.handleResize),document.addEventListener("fullscreenchange",this.handleFullscreenChange),window.addEventListener("keydown",this.handleKeydown),this.animate(),this.resolveReady()}async createGlobe(){const e=await this.textureLoader.loadAsync(Tr[this.config.texture]);e.anisotropy=this.renderer.capabilities.getMaxAnisotropy(),e.minFilter=D.LinearMipmapLinearFilter,e.magFilter=D.LinearFilter;const t=document.createElement("canvas");t.width=2048,t.height=1024,this.dataTexture=new D.CanvasTexture(t);const i=new D.PlaneGeometry(Math.PI*2*Ze,Math.PI*Ze,256,128);this.material=new D.ShaderMaterial({vertexShader:eo,fragmentShader:to,uniforms:{uMorph:{value:0},uTime:{value:0},uParchment:{value:0},uExtremeParchment:{value:0},uTransitionEffect:{value:0},uTexture:{value:e},uDataTexture:{value:this.dataTexture},uCloudTexture:{value:null},uNightTexture:{value:null},uDataOpacity:{value:0},uDataOverlay:{value:0},uExtrudeHeight:{value:this.config.extrudeHeight?1:0},uSunDir:{value:new D.Vector3(1,.5,1).normalize()},uClouds:{value:this.config.effects.clouds?1:0},uCloudSpeed:{value:this.config.effects.cloudSpeed||1},uCloudOpacity:{value:this.config.effects.cloudOpacity||.6},uAtmosphereIntensity:{value:this.config.effects.atmosphereIntensity||0},uAurora:{value:this.config.effects.aurora?1:0},uAuroraIntensity:{value:1},uCityLights:{value:this.config.effects.cityLights?1:0},uCityLightsIntensity:{value:1},uOceanSpecular:{value:this.config.effects.oceanSpecular?1:0},uSpecularIntensity:{value:1},uSunGlow:{value:0},uGridLines:{value:this.config.effects.gridLines?1:0},uGridOpacity:{value:this.config.effects.gridOpacity||.5},uScanEffect:{value:0},uScanSpeed:{value:1},uHologram:{value:this.config.effects.hologramMode?1:0},uHologramColor:{value:new D.Color(65535)},uVintage:{value:this.config.effects.vintageMode?1:0},uThermal:{value:this.config.effects.thermalMode?1:0},uBlueprint:{value:this.config.effects.blueprintMode?1:0},uGlowPulse:{value:this.config.effects.glowPulse?1:0},uGlowColor:{value:new D.Color(4491519)}},side:D.DoubleSide}),this.globe=new D.Mesh(i,this.material),this.scene.add(this.globe)}createAtmosphere(){const e=new D.PlaneGeometry(Math.PI*2*Ze*1.15,Math.PI*Ze*1.15,128,64),t=new D.ShaderMaterial({vertexShader:io,fragmentShader:no,uniforms:{uMorph:{value:0}},side:D.BackSide,transparent:!0,blending:D.AdditiveBlending,depthWrite:!1});this.atmosphere=new D.Mesh(e,t),this.scene.add(this.atmosphere)}createStars(){const t=new D.BufferGeometry,i=new Float32Array(3e3*3),n=new Float32Array(3e3),r=new Float32Array(3e3);for(let o=0;o<3e3;o++){const l=300+Math.random()*300,c=Math.random()*Math.PI*2,h=Math.acos(2*Math.random()-1);i[o*3]=l*Math.sin(h)*Math.cos(c),i[o*3+1]=l*Math.sin(h)*Math.sin(c),i[o*3+2]=l*Math.cos(h),n[o]=.5+Math.random()*1.5,r[o]=Math.random()*Math.PI*2}t.setAttribute("position",new D.BufferAttribute(i,3)),t.setAttribute("aSize",new D.BufferAttribute(n,1)),t.setAttribute("aPhase",new D.BufferAttribute(r,1));const s=new D.ShaderMaterial({vertexShader:ro,fragmentShader:so,uniforms:{uTime:{value:0},uTwinkle:{value:this.config.effects.starTwinkle?1:0}},transparent:!0,blending:D.AdditiveBlending,depthWrite:!1});this.stars=new D.Points(t,s),this.scene.add(this.stars)}createGUI(){this.gui=new Ni({title:"Globe Controls",width:300});const e=this.gui.addFolder("View");e.add({toGlobe:()=>this.toGlobe()},"toGlobe").name("→ Globe"),e.add({toFlat:()=>this.toFlat()},"toFlat").name("→ Flat Map"),e.add({morph:this.morph},"morph",0,1).name("Morph").onChange(r=>this.setMorph(r)),e.open();const t=this.gui.addFolder("Statistics"),i=Object.keys(Zt);t.add({stat:this.config.statistic},"stat",i).name("Statistic").onChange(r=>this.setStatistic(r)),t.open();const n=["none","minimal","major","all"];this.gui.add({labels:this.config.labels},"labels",n).name("Labels").onChange(r=>this.setLabels(r)),this.gui.add(this.config,"autoRotate").name("Auto Rotate")}handleResize=()=>{if(this.isDestroyed)return;const e=this.config.width||this.container.clientWidth,t=this.config.height||this.container.clientHeight;this.camera.aspect=e/t,this.camera.updateProjectionMatrix(),this.renderer.setSize(e,t),this.countryLabels?.resize(e,t)};handleFullscreenChange=()=>{this.isDestroyed||setTimeout(()=>this.handleResize(),50)};handleKeydown=e=>{this.isDestroyed||((e.key==="g"||e.key==="G")&&(this.morph>.5?this.toFlat():this.toGlobe()),(e.key==="f"||e.key==="F")&&this.toggleFullscreen())};animate=()=>{if(this.isDestroyed)return;this.animationId=requestAnimationFrame(this.animate);const e=performance.now()*.001;this.material&&(this.material.uniforms.uTime.value=e),this.stars&&(this.stars.material.uniforms.uTime.value=e),this.controls.update(),this.config.autoRotate&&this.globe&&(this.globe.rotation.y+=.002*this.morph),this.countryLabels?.update(),this.renderer.render(this.scene,this.camera),this.countryLabels?.render(this.scene,this.camera)};toGlobe(){wt.to(this,{morph:1,duration:2.5,ease:"power2.inOut",onUpdate:()=>{this.material&&(this.material.uniforms.uMorph.value=this.morph),this.atmosphere&&(this.atmosphere.material.uniforms.uMorph.value=this.morph),this.countryLabels?.setMorph(this.morph),this.config.onViewChange?.("globe",this.morph)}}),wt.to(this.camera.position,{z:150,duration:2.5,ease:"power2.inOut"})}toFlat(){wt.to(this,{morph:0,duration:2.5,ease:"power2.inOut",onUpdate:()=>{this.material&&(this.material.uniforms.uMorph.value=this.morph),this.atmosphere&&(this.atmosphere.material.uniforms.uMorph.value=this.morph),this.countryLabels?.setMorph(this.morph),this.config.onViewChange?.("flat",this.morph)}}),wt.to(this.camera.position,{z:350,duration:2.5,ease:"power2.inOut"})}setMorph(e){this.morph=Math.max(0,Math.min(1,e)),this.material&&(this.material.uniforms.uMorph.value=this.morph),this.atmosphere&&(this.atmosphere.material.uniforms.uMorph.value=this.morph),this.countryLabels?.setMorph(this.morph)}getMorph(){return this.morph}setStatistic(e){if(typeof e=="string"){if(!Zt[e]){console.warn(`Unknown statistic: ${e}`);return}this.currentStatistic=e;const i=va.find(n=>n.id===e);if(i&&this.choropleth){const n=this.choropleth.renderTexture(i);if(this.material&&n){const r=new D.CanvasTexture(n);r.needsUpdate=!0,this.material.uniforms.uDataTexture.value=r,this.material.uniforms.uDataOverlay.value=1,this.material.uniforms.uDataOpacity.value=.7}}this.legend&&i&&this.legend.show(i)}else{const t=e;if(this.currentStatistic=t.definition.id,this.choropleth){const i=this.choropleth.renderCustomTexture(t.values,t.definition.colorScale,t.definition.domain);if(this.material&&i){const n=new D.CanvasTexture(i);n.needsUpdate=!0,this.material.uniforms.uDataTexture.value=n,this.material.uniforms.uDataOverlay.value=1,this.material.uniforms.uDataOpacity.value=.7}}this.legend&&this.legend.show(t.definition)}}setLabels(e){this.countryLabels?.setStyle(e)}async setTexture(e){const t=Tr[e];if(!(!t||!this.material))try{const i=await this.textureLoader.loadAsync(t);i.anisotropy=this.renderer.capabilities.getMaxAnisotropy(),i.minFilter=D.LinearMipmapLinearFilter,i.magFilter=D.LinearFilter,this.material.uniforms.uTexture.value=i}catch(i){console.error("Failed to load texture:",e,i)}}setAutoRotate(e){this.config.autoRotate=e}screenshot(e){this.exporter?.screenshot(e)}async recordGif(e){if(!this.exporter)return;const t=e?.duration||5,i=e?.fps||20,n=t*i;this.exporter.startGifCapture(e);for(let r=0;r<n;r++)this.exporter.captureGifFrame(),await new Promise(s=>setTimeout(s,1e3/i));await this.exporter.stopGifCapture(e)}async recordVideo(e){if(!this.exporter)return;const t=e?.duration||5;await this.exporter.startVideoRecording(e),await new Promise(i=>setTimeout(i,t*1e3)),this.exporter.stopVideoRecording()}setEffects(e){Object.assign(this.config.effects,e),this.material&&(e.atmosphere!==void 0&&(e.atmosphere&&!this.atmosphere?this.createAtmosphere():!e.atmosphere&&this.atmosphere&&(this.scene.remove(this.atmosphere),this.atmosphere.geometry.dispose(),this.atmosphere.material.dispose(),this.atmosphere=null)),e.clouds!==void 0&&(this.material.uniforms.uClouds.value=e.clouds?1:0),e.cloudSpeed!==void 0&&(this.material.uniforms.uCloudSpeed.value=e.cloudSpeed),e.cloudOpacity!==void 0&&(this.material.uniforms.uCloudOpacity.value=e.cloudOpacity),e.atmosphereIntensity!==void 0&&(this.material.uniforms.uAtmosphereIntensity.value=e.atmosphereIntensity),e.gridLines!==void 0&&(this.material.uniforms.uGridLines.value=e.gridLines?1:0),e.gridOpacity!==void 0&&(this.material.uniforms.uGridOpacity.value=e.gridOpacity),e.glowPulse!==void 0&&(this.material.uniforms.uGlowPulse.value=e.glowPulse?1:0),e.starTwinkle!==void 0&&this.stars&&(this.stars.material.uniforms.uTwinkle.value=e.starTwinkle?1:0))}resize(e,t){this.config.width=e,this.config.height=t,this.handleResize()}async toggleFullscreen(){document.fullscreenElement?(await document.exitFullscreen(),setTimeout(()=>this.handleResize(),100)):(await this.container.requestFullscreen(),setTimeout(()=>this.handleResize(),100))}isFullscreen(){return document.fullscreenElement===this.container}destroy(){this.isDestroyed=!0,this.animationId&&cancelAnimationFrame(this.animationId),window.removeEventListener("resize",this.handleResize),window.removeEventListener("keydown",this.handleKeydown),document.removeEventListener("fullscreenchange",this.handleFullscreenChange),this.gui?.destroy(),this.legend?.dispose(),this.countryLabels?.dispose(),this.globe?.geometry.dispose(),this.globe?.material?.dispose(),this.atmosphere?.geometry.dispose(),this.atmosphere?.material?.dispose(),this.stars?.geometry.dispose(),this.stars?.material?.dispose(),this.renderer.dispose(),this.container.removeChild(this.renderer.domElement)}}ae.BUILT_IN_STATISTICS=Zt,ae.GlobeViz=ao,ae.WORLD_STATISTICS=$i,ae.createFormatter=Vi,ae.formatValue=Pa,ae.normalizeCountryValues=fr,ae.toNumericCode=Bi,Object.defineProperty(ae,Symbol.toStringTag,{value:"Module"})}));
1066
1159
  //# sourceMappingURL=gralobe.umd.cjs.map