(globalThis.webpackChunk=globalThis.webpackChunk||[]).push([[6141],{776141(__unused_webpack_module,__webpack_exports__,__webpack_require__){(function(){if(!this.ST)return()=>{};with(this.ST)with(this.RH)with(this.G)return function(){"use strict";__webpack_require__.d(__webpack_exports__,{A:()=>e.A});var e=__webpack_require__(939195)}}).call(__webpack_require__._LM_("$root$",{__webpack_require__,__webpack_exports__}))()},939195(__unused_webpack_module,__webpack_exports__,__webpack_require__){(function(){if(!this.ST)return()=>{};with(this.ST)with(this.RH)with(this.G)return function(){"use strict";__webpack_require__.d(__webpack_exports__,{A:()=>s});var e=__webpack_require__(787332);var t=__webpack_require__.n(e);var n=__webpack_require__(860012);var o=__webpack_require__(844113);var l=__webpack_require__.n(o);var r=__webpack_require__(456895);__webpack_require__.n(r);var i=__webpack_require__(158332);function u({animationEventEmitter:e,width:t="200",height:o="200",followMouse:u=!0,lookAtTarget:s={},lookAtDirection:h=null}){let c=(0,n.useRef)(null);let d=(0,n.useRef)(null);let f=(0,n.useRef)(e);f.current=e;let a=(0,n.useRef)(u);let w=(0,n.useRef)({followMouse:u,width:t,height:o});let[b,p]=(0,n.useState)(null);return(0,n.useEffect)(()=>{let e=c.current;if(!e)return undefined;let{followMouse:t,width:n,height:o}=w.current;let u=l()({followMouse:t,pxNotRatio:!0,width:n,height:o,meshJson:(0,i.zk)(),verticalFieldOfView:Math.PI/37.5,near:100,far:340});p(u),e.appendChild(u.container),d.current=(({top:e,left:t,height:n,width:o})=>{let l=t+o/2;let r=e+n/2;return{up:{x:l,y:e-n},down:{x:l,y:e+n*2},left:{x:t-o,y:r},right:{x:t+o*2,y:r},middle:{x:l,y:r}}})(e.getBoundingClientRect());let s=(0,r.debounce)(u.setFollowMouse.bind(u,!0),1e3);let h=u.setFollowMouse.bind(u,!1);let a=f.current;let b=u.setFollowMouse.bind(u);return a.on("point",e=>{h(),u.lookAtAndRender(e),s()}),a.on("setFollowMouse",b),()=>{a.removeAllListeners(),u.container.remove(),u.stopAnimation(),p(null)}},[]),(0,n.useEffect)(()=>{let e=d.current;if(!b||!e)return;h?b.lookAtAndRender(e[h]):s?.x&&s?.y&&b.lookAtAndRender(s)},[h,s,b]),(0,n.useEffect)(()=>{if(!b||a.current===u)return;a.current=u;let e=(0,r.debounce)(b.setFollowMouse.bind(b,!0),1e3);b.setFollowMouse(!1),u&&e()},[u,b]),n.createElement("div",{ref:c,style:{zIndex:0}})}u.propTypes={animationEventEmitter:t().object.isRequired,width:t().string,height:t().string,followMouse:t().bool,lookAtTarget:t().object,lookAtDirection:t().oneOf(["up","down","left","right","middle"])};let s=u}}).call(__webpack_require__._LM_("$root$",{__webpack_require__,__webpack_exports__}))()}}]);