diff --git a/dist/index.css b/dist/index.css index e282125..fc31073 100644 --- a/dist/index.css +++ b/dist/index.css @@ -152,7 +152,7 @@ input[type="range"].powerSlider { aspect-ratio: 0.4; border-radius: 10px; border-width: 4px; - font-size: x-large; + font-size: large; min-width: 80px; user-select: none; } diff --git a/dist/vendor.js b/dist/vendor.js index e030355..8cec7bf 100644 --- a/dist/vendor.js +++ b/dist/vendor.js @@ -1,4 +1,4 @@ -(()=>{var e={"./node_modules/interactjs/dist/interact.min.js":e=>{e.exports=function(){var e,n,i={};Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0,i.default=function(e){return!(!e||!e.Window)&&e instanceof e.Window};var r={};Object.defineProperty(r,"__esModule",{value:!0}),r.getWindow=function(e){return(0,i.default)(e)?e:(e.ownerDocument||e).defaultView||s.window},r.init=o,r.window=r.realWindow=void 0;var a=void 0;r.realWindow=a;var s=void 0;function o(e){r.realWindow=a=e;var n=e.document.createTextNode("");n.ownerDocument!==e.document&&"function"==typeof e.wrap&&e.wrap(n)===n&&(e=e.wrap(e)),r.window=s=e}r.window=s,"undefined"!=typeof window&&window&&o(window);var l={};function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(l,"__esModule",{value:!0}),l.default=void 0;var c=function(e){return!!e&&"object"===u(e)},h=function(e){return"function"==typeof e};l.default={window:function(e){return e===r.window||(0,i.default)(e)},docFrag:function(e){return c(e)&&11===e.nodeType},object:c,func:h,number:function(e){return"number"==typeof e},bool:function(e){return"boolean"==typeof e},string:function(e){return"string"==typeof e},element:function(e){if(!e||"object"!==u(e))return!1;var n=r.getWindow(e)||r.window;return/object|function/.test("undefined"==typeof Element?"undefined":u(Element))?e instanceof Element||e instanceof n.Element:1===e.nodeType&&"string"==typeof e.nodeName},plainObject:function(e){return c(e)&&!!e.constructor&&/function Object\b/.test(e.constructor.toString())},array:function(e){return c(e)&&void 0!==e.length&&h(e.splice)}};var d={};function p(e){var n=e.interaction;if("drag"===n.prepared.name){var i=n.prepared.axis;"x"===i?(n.coords.cur.page.y=n.coords.start.page.y,n.coords.cur.client.y=n.coords.start.client.y,n.coords.velocity.client.y=0,n.coords.velocity.page.y=0):"y"===i&&(n.coords.cur.page.x=n.coords.start.page.x,n.coords.cur.client.x=n.coords.start.client.x,n.coords.velocity.client.x=0,n.coords.velocity.page.x=0)}}function f(e){var n=e.iEvent,i=e.interaction;if("drag"===i.prepared.name){var r=i.prepared.axis;if("x"===r||"y"===r){var a="x"===r?"y":"x";n.page[a]=i.coords.start.page[a],n.client[a]=i.coords.start.client[a],n.delta[a]=0}}}Object.defineProperty(d,"__esModule",{value:!0}),d.default=void 0;var m={id:"actions/drag",install:function(e){var n=e.actions,i=e.Interactable,r=e.defaults;i.prototype.draggable=m.draggable,n.map.drag=m,n.methodDict.drag="draggable",r.actions.drag=m.defaults},listeners:{"interactions:before-action-move":p,"interactions:action-resume":p,"interactions:action-move":f,"auto-start:check":function(e){var n=e.interaction,i=e.interactable,r=e.buttons,a=i.options.drag;if(a&&a.enabled&&(!n.pointerIsDown||!/mouse|pointer/.test(n.pointerType)||0!=(r&i.options.drag.mouseButtons)))return e.action={name:"drag",axis:"start"===a.lockAxis?a.startAxis:a.lockAxis},!1}},draggable:function(e){return l.default.object(e)?(this.options.drag.enabled=!1!==e.enabled,this.setPerAction("drag",e),this.setOnEvents("drag",e),/^(xy|x|y|start)$/.test(e.lockAxis)&&(this.options.drag.lockAxis=e.lockAxis),/^(xy|x|y)$/.test(e.startAxis)&&(this.options.drag.startAxis=e.startAxis),this):l.default.bool(e)?(this.options.drag.enabled=e,this):this.options.drag},beforeMove:p,move:f,defaults:{startAxis:"xy",lockAxis:"xy"},getCursor:function(){return"move"}};d.default=m;var g={};Object.defineProperty(g,"__esModule",{value:!0}),g.default=void 0;var v={init:function(e){v.document=e.document,v.DocumentFragment=e.DocumentFragment||_,v.SVGElement=e.SVGElement||_,v.SVGSVGElement=e.SVGSVGElement||_,v.SVGElementInstance=e.SVGElementInstance||_,v.Element=e.Element||_,v.HTMLElement=e.HTMLElement||v.Element,v.Event=e.Event,v.Touch=e.Touch||_,v.PointerEvent=e.PointerEvent||e.MSPointerEvent},document:null,DocumentFragment:null,SVGElement:null,SVGSVGElement:null,SVGElementInstance:null,Element:null,HTMLElement:null,Event:null,Touch:null,PointerEvent:null};function _(){}g.default=v;var y={};Object.defineProperty(y,"__esModule",{value:!0}),y.default=void 0;var x={init:function(e){var n=g.default.Element,i=e.navigator||{};x.supportsTouch="ontouchstart"in e||l.default.func(e.DocumentTouch)&&g.default.document instanceof e.DocumentTouch,x.supportsPointerEvent=!1!==i.pointerEnabled&&!!g.default.PointerEvent,x.isIOS=/iP(hone|od|ad)/.test(i.platform),x.isIOS7=/iP(hone|od|ad)/.test(i.platform)&&/OS 7[^\d]/.test(i.appVersion),x.isIe9=/MSIE 9/.test(i.userAgent),x.isOperaMobile="Opera"===i.appName&&x.supportsTouch&&/Presto/.test(i.userAgent),x.prefixedMatchesSelector="matches"in n.prototype?"matches":"webkitMatchesSelector"in n.prototype?"webkitMatchesSelector":"mozMatchesSelector"in n.prototype?"mozMatchesSelector":"oMatchesSelector"in n.prototype?"oMatchesSelector":"msMatchesSelector",x.pEventTypes=x.supportsPointerEvent?g.default.PointerEvent===e.MSPointerEvent?{up:"MSPointerUp",down:"MSPointerDown",over:"mouseover",out:"mouseout",move:"MSPointerMove",cancel:"MSPointerCancel"}:{up:"pointerup",down:"pointerdown",over:"pointerover",out:"pointerout",move:"pointermove",cancel:"pointercancel"}:null,x.wheelEvent=g.default.document&&"onmousewheel"in g.default.document?"mousewheel":"wheel"},supportsTouch:null,supportsPointerEvent:null,isIOS7:null,isIOS:null,isIe9:null,isOperaMobile:null,prefixedMatchesSelector:null,pEventTypes:null,wheelEvent:null};y.default=x;var b={};function M(e){var n=e.parentNode;if(l.default.docFrag(n))for(;(n=n.host)&&l.default.docFrag(n););return n}function S(e,n){return r.window!==r.realWindow&&(n=n.replace(/\/deep\//g," ")),e[y.default.prefixedMatchesSelector](n)}Object.defineProperty(b,"__esModule",{value:!0}),b.closest=function(e,n){for(;l.default.element(e);){if(S(e,n))return e;e=M(e)}return null},b.getActualElement=function(e){return e.correspondingUseElement||e},b.getElementClientRect=A,b.getElementRect=function(e){var n=A(e);if(!y.default.isIOS7&&n){var i=w(r.getWindow(e));n.left+=i.x,n.right+=i.x,n.top+=i.y,n.bottom+=i.y}return n},b.getPath=function(e){for(var n=[];e;)n.push(e),e=M(e);return n},b.getScrollXY=w,b.indexOfDeepestElement=function(e){for(var n,i=[],a=0;a=(parseInt(r.getWindow(o).getComputedStyle(o).zIndex,10)||0)&&(n=a)}else n=a}}else n=a}}return n},b.matchesSelector=S,b.matchesUpTo=function(e,n,i){for(;l.default.element(e);){if(S(e,n))return!0;if((e=M(e))===i)return S(e,n)}return!1},b.nodeContains=function(e,n){if(e.contains)return e.contains(n);for(;n;){if(n===e)return!0;n=n.parentNode}return!1},b.parentNode=M,b.trySelector=function(e){return!!l.default.string(e)&&(g.default.document.querySelector(e),!0)};var E=function(e){return e.parentNode||e.host};function T(e,n){for(var i,r=[],a=e;(i=E(a))&&a!==n&&i!==a.ownerDocument;)r.unshift(a),a=i;return r}function w(e){return{x:(e=e||r.window).scrollX||e.document.documentElement.scrollLeft,y:e.scrollY||e.document.documentElement.scrollTop}}function A(e){var n=e instanceof g.default.SVGElement?e.getBoundingClientRect():e.getClientRects()[0];return n&&{left:n.left,right:n.right,top:n.top,bottom:n.bottom,width:n.width||n.right-n.left,height:n.height||n.bottom-n.top}}var R={};Object.defineProperty(R,"__esModule",{value:!0}),R.default=function(e,n){for(var i in n)e[i]=n[i];return e};var P={};function C(e,n){(null==n||n>e.length)&&(n=e.length);for(var i=0,r=Array(n);i1?W(n):n[0];H(r,e.page),V(r,e.client),e.timeStamp=i},z.setZeroCoords=function(e){e.page.x=0,e.page.y=0,e.client.x=0,e.client.y=0},z.touchAngle=function(e,n){var i=n+"X",r=n+"Y",a=G(e),s=a[1][i]-a[0][i];return 180*Math.atan2(a[1][r]-a[0][r],s)/Math.PI},z.touchBBox=function(e){if(!e.length)return null;var n=G(e),i=Math.min(n[0].pageX,n[1].pageX),r=Math.min(n[0].pageY,n[1].pageY),a=Math.max(n[0].pageX,n[1].pageX),s=Math.max(n[0].pageY,n[1].pageY);return{x:i,y:r,left:i,top:r,right:a,bottom:s,width:a-i,height:s-r}},z.touchDistance=function(e,n){var i=n+"X",r=n+"Y",a=G(e),s=a[0][i]-a[1][i],o=a[0][r]-a[1][r];return(0,U.default)(s,o)};var j={};function X(e,n,i){return n in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i,e}Object.defineProperty(j,"__esModule",{value:!0}),j.BaseEvent=void 0;var q=function(){function e(n){(function(e,n){if(!(e instanceof n))throw TypeError("Cannot call a class as a function")})(this,e),X(this,"immediatePropagationStopped",!1),X(this,"propagationStopped",!1),this._interaction=n}return function(e,n){for(var i=0;io.left&&d.xo.top&&d.y=o.left&&g<=o.right&&v>=o.top&&v<=o.bottom}return m&&l.default.number(c)&&(u=Math.max(0,Math.min(o.right,m.right)-Math.max(o.left,m.left))*Math.max(0,Math.min(o.bottom,m.bottom)-Math.max(o.top,m.top))/(m.width*m.height)>=c),e.options.drop.checker&&(u=e.options.drop.checker(n,i,u,e,s,r,a)),u}(this,e,n,i,r,a,s)},i.dynamicDrop=function(n){return l.default.bool(n)?(e.dynamicDrop=n,i):e.dynamicDrop},(0,R.default)(n.phaselessTypes,{dragenter:!0,dragleave:!0,dropactivate:!0,dropdeactivate:!0,dropmove:!0,drop:!0}),n.methodDict.drop="dropzone",e.dynamicDrop=!1,a.actions.drop=eh.defaults},listeners:{"interactions:before-action-start":function(e){var n=e.interaction;"drag"===n.prepared.name&&(n.dropState={cur:{dropzone:null,element:null},prev:{dropzone:null,element:null},rejected:null,events:null,activeDrops:[]})},"interactions:after-action-start":function(e,n){var i=e.interaction,r=(e.event,e.iEvent);if("drag"===i.prepared.name){var a=i.dropState;a.activeDrops=[],a.events={},a.activeDrops=es(n,i.element),a.events=el(i,0,r),a.events.activate&&(ea(a.activeDrops,a.events.activate),n.fire("actions/drop:start",{interaction:i,dragEvent:r}))}},"interactions:action-move":ec,"interactions:after-action-move":function(e,n){var i=e.interaction,r=e.iEvent;if("drag"===i.prepared.name){var a=i.dropState;eu(i,a.events),n.fire("actions/drop:move",{interaction:i,dragEvent:r}),a.events={}}},"interactions:action-end":function(e,n){if("drag"===e.interaction.prepared.name){var i=e.interaction,r=e.iEvent;ec(e,n),eu(i,i.dropState.events),n.fire("actions/drop:end",{interaction:i,dragEvent:r})}},"interactions:stop":function(e){var n=e.interaction;if("drag"===n.prepared.name){var i=n.dropState;i&&(i.activeDrops=null,i.events=null,i.cur.dropzone=null,i.cur.element=null,i.prev.dropzone=null,i.prev.element=null,i.rejected=!1)}}},getActiveDrops:es,getDrop:eo,getDropEvents:el,fireDropEvents:eu,defaults:{enabled:!1,accept:null,overlap:"pointer"}};er.default=eh;var ed={};function ep(e){var n=e.interaction,i=e.iEvent,r=e.phase;if("gesture"===n.prepared.name){var a=n.pointers.map(function(e){return e.pointer}),s=n.interactable.options.deltaSource;if(i.touches=[a[0],a[1]],"start"===r)i.distance=z.touchDistance(a,s),i.box=z.touchBBox(a),i.scale=1,i.ds=0,i.angle=z.touchAngle(a,s),i.da=0,n.gesture.startDistance=i.distance,n.gesture.startAngle=i.angle;else if("end"===r){var o=n.prevEvent;i.distance=o.distance,i.box=o.box,i.scale=o.scale,i.ds=0,i.angle=o.angle,i.da=0}else i.distance=z.touchDistance(a,s),i.box=z.touchBBox(a),i.scale=i.distance/n.gesture.startDistance,i.angle=z.touchAngle(a,s),i.ds=i.scale-n.gesture.scale,i.da=i.angle-n.gesture.angle;n.gesture.distance=i.distance,n.gesture.angle=i.angle,l.default.number(i.scale)&&i.scale!==1/0&&!isNaN(i.scale)&&(n.gesture.scale=i.scale)}}Object.defineProperty(ed,"__esModule",{value:!0}),ed.default=void 0;var ef={id:"actions/gesture",before:["actions/drag","actions/resize"],install:function(e){var n=e.actions,i=e.Interactable,r=e.defaults;i.prototype.gesturable=function(e){return l.default.object(e)?(this.options.gesture.enabled=!1!==e.enabled,this.setPerAction("gesture",e),this.setOnEvents("gesture",e),this):l.default.bool(e)?(this.options.gesture.enabled=e,this):this.options.gesture},n.map.gesture=ef,n.methodDict.gesture="gesturable",r.actions.gesture=ef.defaults},listeners:{"interactions:action-start":ep,"interactions:action-move":ep,"interactions:action-end":ep,"interactions:new":function(e){e.interaction.gesture={angle:0,distance:0,scale:1,startAngle:0,startDistance:0}},"auto-start:check":function(e){if(!(e.interaction.pointers.length<2)){var n=e.interactable.options.gesture;if(n&&n.enabled)return e.action={name:"gesture"},!1}}},defaults:{},getCursor:function(){return""}};ed.default=ef;var em={};function eg(e){var n=e.iEvent,i=e.interaction;"resize"===i.prepared.name&&i.resizeAxes&&(i.interactable.options.resize.square?("y"===i.resizeAxes?n.delta.x=n.delta.y:n.delta.y=n.delta.x,n.axes="xy"):(n.axes=i.resizeAxes,"x"===i.resizeAxes?n.delta.y=0:"y"===i.resizeAxes&&(n.delta.x=0)))}Object.defineProperty(em,"__esModule",{value:!0}),em.default=void 0;var ev={id:"actions/resize",before:["actions/drag"],install:function(e){var n=e.actions,i=e.browser,r=e.Interactable,a=e.defaults;ev.cursors=i.isIe9?{x:"e-resize",y:"s-resize",xy:"se-resize",top:"n-resize",left:"w-resize",bottom:"s-resize",right:"e-resize",topleft:"se-resize",bottomright:"se-resize",topright:"ne-resize",bottomleft:"ne-resize"}:{x:"ew-resize",y:"ns-resize",xy:"nwse-resize",top:"ns-resize",left:"ew-resize",bottom:"ns-resize",right:"ew-resize",topleft:"nwse-resize",bottomright:"nwse-resize",topright:"nesw-resize",bottomleft:"nesw-resize"},ev.defaultMargin=i.supportsTouch||i.supportsPointerEvent?20:10,r.prototype.resizable=function(n){return l.default.object(n)?(this.options.resize.enabled=!1!==n.enabled,this.setPerAction("resize",n),this.setOnEvents("resize",n),l.default.string(n.axis)&&/^x$|^y$|^xy$/.test(n.axis)?this.options.resize.axis=n.axis:null===n.axis&&(this.options.resize.axis=e.defaults.actions.resize.axis),l.default.bool(n.preserveAspectRatio)?this.options.resize.preserveAspectRatio=n.preserveAspectRatio:l.default.bool(n.square)&&(this.options.resize.square=n.square),this):l.default.bool(n)?(this.options.resize.enabled=n,this):this.options.resize},n.map.resize=ev,n.methodDict.resize="resizable",a.actions.resize=ev.defaults},listeners:{"interactions:new":function(e){e.interaction.resizeAxes="xy"},"interactions:action-start":function(e){(function(e){var n=e.iEvent,i=e.interaction;if("resize"===i.prepared.name&&i.prepared.edges){var r=i.rect;i._rects={start:(0,R.default)({},r),corrected:(0,R.default)({},r),previous:(0,R.default)({},r),delta:{left:0,right:0,width:0,top:0,bottom:0,height:0}},n.edges=i.prepared.edges,n.rect=i._rects.corrected,n.deltaRect=i._rects.delta}})(e),eg(e)},"interactions:action-move":function(e){(function(e){var n=e.iEvent,i=e.interaction;if("resize"===i.prepared.name&&i.prepared.edges){var r=i.interactable.options.resize.invert,a=i.rect,s=i._rects,o=s.start,l=s.corrected,u=s.delta,c=s.previous;if((0,R.default)(c,l),"reposition"===r||"negate"===r){if((0,R.default)(l,a),"reposition"===r){if(l.top>l.bottom){var h=l.top;l.top=l.bottom,l.bottom=h}if(l.left>l.right){var d=l.left;l.left=l.right,l.right=d}}}else l.top=Math.min(a.top,o.bottom),l.bottom=Math.max(a.bottom,o.top),l.left=Math.min(a.left,o.right),l.right=Math.max(a.right,o.left);for(var p in l.width=l.right-l.left,l.height=l.bottom-l.top,l)u[p]=l[p]-c[p];n.edges=i.prepared.edges,n.rect=l,n.deltaRect=u}})(e),eg(e)},"interactions:action-end":function(e){var n=e.iEvent,i=e.interaction;"resize"===i.prepared.name&&i.prepared.edges&&(n.edges=i.prepared.edges,n.rect=i._rects.corrected,n.deltaRect=i._rects.delta)},"auto-start:check":function(e){var n=e.interaction,i=e.interactable,r=e.element,a=e.rect,s=e.buttons;if(a){var o=(0,R.default)({},n.coords.cur.page),u=i.options.resize;if(u&&u.enabled&&(!n.pointerIsDown||!/mouse|pointer/.test(n.pointerType)||0!=(s&u.mouseButtons))){if(l.default.object(u.edges)){var c={left:!1,right:!1,top:!1,bottom:!1};for(var h in c)c[h]=function(e,n,i,r,a,s,o){if(!n)return!1;if(!0===n){var u=l.default.number(s.width)?s.width:s.right-s.left,c=l.default.number(s.height)?s.height:s.bottom-s.top;if(o=Math.min(o,Math.abs(("left"===e||"right"===e?u:c)/2)),u<0&&("left"===e?e="right":"right"===e&&(e="left")),c<0&&("top"===e?e="bottom":"bottom"===e&&(e="top")),"left"===e){var h=u>=0?s.left:s.right;return i.x=0?s.top:s.bottom;return i.y(u>=0?s.right:s.left)-o;if("bottom"===e)return i.y>(c>=0?s.bottom:s.top)-o}return!!l.default.element(r)&&(l.default.element(n)?n===r:b.matchesUpTo(r,n,a))}(h,u.edges[h],o,n._latestPointer.eventTarget,r,a,u.margin||ev.defaultMargin);c.left=c.left&&!c.right,c.top=c.top&&!c.bottom,(c.left||c.right||c.top||c.bottom)&&(e.action={name:"resize",edges:c})}else{var d="y"!==u.axis&&o.x>a.right-ev.defaultMargin,p="x"!==u.axis&&o.y>a.bottom-ev.defaultMargin;(d||p)&&(e.action={name:"resize",axes:(d?"x":"")+(p?"y":"")})}return!e.action&&void 0}}}},defaults:{square:!1,preserveAspectRatio:!1,axis:"xy",margin:NaN,edges:null,invert:"none"},cursors:null,getCursor:function(e){var n=e.edges,i=e.axis,r=e.name,a=ev.cursors,s=null;if(i)s=a[r+i];else if(n){for(var o="",l=["top","bottom","left","right"],u=0;u=1){var h={x:eE.x*c,y:eE.y*c};if(h.x||h.y){var d=ew(s);l.default.window(s)?s.scrollBy(h.x,h.y):s&&(s.scrollLeft+=h.x,s.scrollTop+=h.y);var p=ew(s),f={x:p.x-d.x,y:p.y-d.y};(f.x||f.y)&&n.fire({type:"autoscroll",target:i,interactable:n,delta:f,interaction:e,container:s})}eE.prevTime=o}eE.isScrolling&&(ey.default.cancel(eE.i),eE.i=ey.default.request(eE.scroll))},check:function(e,n){var i;return null==(i=e.options[n].autoScroll)?void 0:i.enabled},onInteractionMove:function(e){var n=e.interaction,i=e.pointer;if(n.interacting()&&eE.check(n.interactable,n.prepared.name)){if(n.simulation)eE.x=eE.y=0;else{var r,a,s,o,u=n.interactable,c=n.element,h=n.prepared.name,d=u.options[h].autoScroll,p=eT(d.container,u,c);if(l.default.window(p))o=i.clientXp.innerWidth-eE.margin,s=i.clientY>p.innerHeight-eE.margin;else{var f=b.getElementClientRect(p);o=i.clientXf.right-eE.margin,s=i.clientY>f.bottom-eE.margin}eE.x=a?1:o?-1:0,eE.y=s?1:r?-1:0,eE.isScrolling||(eE.margin=d.margin,eE.speed=d.speed,eE.start(n))}}}};function eT(e,n,i){return(l.default.string(e)?(0,P.getStringOptionResult)(e,n,i):e)||(0,r.getWindow)(i)}function ew(e){return l.default.window(e)&&(e=window.document.body),{x:e.scrollLeft,y:e.scrollTop}}var eA={id:"auto-scroll",install:function(e){var n=e.defaults,i=e.actions;e.autoScroll=eE,eE.now=function(){return e.now()},i.phaselessTypes.autoscroll=!0,n.perAction.autoScroll=eE.defaults},listeners:{"interactions:new":function(e){e.interaction.autoScroll=null},"interactions:destroy":function(e){e.interaction.autoScroll=null,eE.stop(),eE.interaction&&(eE.interaction=null)},"interactions:stop":eE.stop,"interactions:action-move":function(e){return eE.onInteractionMove(e)}}};eS.default=eA;var eR={};Object.defineProperty(eR,"__esModule",{value:!0}),eR.copyAction=function(e,n){return e.name=n.name,e.axis=n.axis,e.edges=n.edges,e},eR.sign=void 0,eR.warnOnce=function(e,n){var i=!1;return function(){return i||(r.window.console.warn(n),i=!0),e.apply(this,arguments)}},eR.sign=function(e){return e>=0?1:-1};var eP={};function eC(e){return l.default.bool(e)?(this.options.styleCursor=e,this):null===e?(delete this.options.styleCursor,this):this.options.styleCursor}function eL(e){return l.default.func(e)?(this.options.actionChecker=e,this):null===e?(delete this.options.actionChecker,this):this.options.actionChecker}Object.defineProperty(eP,"__esModule",{value:!0}),eP.default=void 0,eP.default={id:"auto-start/interactableMethods",install:function(e){var n=e.Interactable;n.prototype.getAction=function(n,i,r,a){var s,o,l=(s=this.getRect(a),o={action:null,interactable:this,interaction:r,element:a,rect:s,buttons:i.buttons||({0:1,1:4,3:8,4:16})[i.button]},e.fire("auto-start:check",o),o.action);return this.options.actionChecker?this.options.actionChecker(n,i,l,this,a,r):l},n.prototype.ignoreFrom=(0,eR.warnOnce)(function(e){return this._backCompatOption("ignoreFrom",e)},"Interactable.ignoreFrom() has been deprecated. Use Interactble.draggable({ignoreFrom: newValue})."),n.prototype.allowFrom=(0,eR.warnOnce)(function(e){return this._backCompatOption("allowFrom",e)},"Interactable.allowFrom() has been deprecated. Use Interactble.draggable({allowFrom: newValue})."),n.prototype.actionChecker=eL,n.prototype.styleCursor=eC}};var eO={};function eI(e,n,i,r,a){return n.testIgnoreAllow(n.options[e.name],i,r)&&n.options[e.name].enabled&&eN(n,i,e,a)?e:null}function eD(e,n,i,r,a){var s=[],o=[],u=r;function c(e){s.push(e),o.push(u)}for(;l.default.element(u);){s=[],o=[],a.interactables.forEachMatch(u,c);var h=function(e,n,i,r,a,s,o){for(var l=0,u=r.length;l=l||p.interactable===e&&((c+=f===i.name?1:0)>=s||p.element===n&&(h++,f===i.name&&h>=o))))return!1}return l>0}function eF(e,n){return l.default.number(e)?(n.autoStart.maxInteractions=e,this):n.autoStart.maxInteractions}function ez(e,n,i){var r=i.autoStart.cursorElement;r&&r!==e&&(r.style.cursor=""),e.ownerDocument.documentElement.style.cursor=n,e.style.cursor=n,i.autoStart.cursorElement=n?e:null}function eB(e,n){var i=e.interactable,r=e.element,a=e.prepared;if("mouse"===e.pointerType&&i&&i.options.styleCursor){var s="";if(a.name){var o=i.options[a.name].cursorChecker;s=l.default.func(o)?o(a,i,r,e._interacting):n.actions.map[a.name].getCursor(a)}ez(e.element,s||"",n)}else n.autoStart.cursorElement&&ez(n.autoStart.cursorElement,"",n)}Object.defineProperty(eO,"__esModule",{value:!0}),eO.default=void 0,eO.default={id:"auto-start/base",before:["actions"],install:function(e){var n=e.interactStatic,i=e.defaults;e.usePlugin(eP.default),i.base.actionChecker=null,i.base.styleCursor=!0,(0,R.default)(i.perAction,{manualStart:!1,max:1/0,maxPerElement:1,allowFrom:null,ignoreFrom:null,mouseButtons:1}),n.maxInteractions=function(n){return eF(n,e)},e.autoStart={maxInteractions:1/0,withinInteractionLimit:eN,cursorElement:null}},listeners:{"interactions:down":function(e,n){var i=e.interaction,r=e.pointer,a=e.event,s=e.eventTarget;i.interacting()||eU(i,eD(i,r,a,s,n),n)},"interactions:move":function(e,n){var i,r,a,s;i=e.interaction,r=e.pointer,a=e.event,s=e.eventTarget,"mouse"!==i.pointerType||i.pointerIsDown||i.interacting()||eU(i,eD(i,r,a,s,n),n),function(e,n){var i=e.interaction;if(i.pointerIsDown&&!i.interacting()&&i.pointerWasMoved&&i.prepared.name){n.fire("autoStart:before-start",e);var r=i.interactable,a=i.prepared.name;a&&r&&(r.options[a].manualStart||!eN(r,i.element,i.prepared,n)?i.stop():(i.start(i.prepared,r,i.element),eB(i,n)))}}(e,n)},"interactions:stop":function(e,n){var i=e.interaction,r=i.interactable;r&&r.options.styleCursor&&ez(i.element,"",n)}},maxInteractions:eF,withinInteractionLimit:eN,validateAction:eI};var ek={};Object.defineProperty(ek,"__esModule",{value:!0}),ek.default=void 0,ek.default={id:"auto-start/dragAxis",listeners:{"autoStart:before-start":function(e,n){var i=e.interaction,r=e.eventTarget,a=e.dx,s=e.dy;if("drag"===i.prepared.name){var o=Math.abs(a),u=Math.abs(s),c=i.interactable.options.drag,h=c.startAxis,d=o>u?"x":o0&&(n.autoStartHoldTimer=setTimeout(function(){n.start(n.prepared,n.interactable,n.element)},i))},"interactions:move":function(e){var n=e.interaction,i=e.duplicate;n.autoStartHoldTimer&&n.pointerWasMoved&&!i&&(clearTimeout(n.autoStartHoldTimer),n.autoStartHoldTimer=null)},"autoStart:before-start":function(e){var n=e.interaction;eV(n)>0&&(n.prepared.name=null)}},getHoldDuration:eV};var eG={};Object.defineProperty(eG,"__esModule",{value:!0}),eG.default=void 0,eG.default={id:"auto-start",install:function(e){e.usePlugin(eO.default),e.usePlugin(eH.default),e.usePlugin(ek.default)}};var eW={};function ej(e){return/^(always|never|auto)$/.test(e)?(this.options.preventDefault=e,this):l.default.bool(e)?(this.options.preventDefault=e?"always":"never",this):this.options.preventDefault}function eX(e){var n=e.interaction,i=e.event;n.interactable&&n.interactable.checkAndPreventDefault(i)}function eq(e){var n=e.Interactable;n.prototype.preventDefault=ej,n.prototype.checkAndPreventDefault=function(n){return function(e,n,i){var a=e.options.preventDefault;if("never"!==a){if("always"!==a){if(n.events.supportsPassive&&/^touch(start|move)$/.test(i.type)){var s=(0,r.getWindow)(i.target).document,o=n.getDocOptions(s);if(!o||!o.events||!1!==o.events.passive)return}/^(mouse|pointer|touch)*(down|start)/i.test(i.type)||l.default.element(i.target)&&(0,b.matchesSelector)(i.target,"input,select,textarea,[contenteditable=true],[contenteditable=true] *")||i.preventDefault()}else i.preventDefault()}}(this,e,n)},e.interactions.docEvents.push({type:"dragstart",listener:function(n){for(var i=0;ie.length)&&(n=e.length);for(var i=0,r=Array(n);i150)return null;var n=180*Math.atan2(e.prevEvent.velocityY,e.prevEvent.velocityX)/Math.PI;n<0&&(n+=360);var i=112.5<=n&&n<247.5,r=202.5<=n&&n<337.5;return{up:r,down:!r&&22.5<=n&&n<157.5,left:i,right:!i&&(292.5<=n||n<67.5),angle:n,speed:e.prevEvent.speed,velocity:{x:e.prevEvent.velocityX,y:e.prevEvent.velocityY}}}},{key:"preventDefault",value:function(){}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}}],function(e,n){for(var i=0;ithis.pointerMoveTolerance);var o=this.getPointerIndex(e),l={pointer:e,pointerIndex:o,pointerInfo:this.pointers[o],event:n,type:"move",eventTarget:i,dx:r,dy:a,duplicate:s,interaction:this};s||z.setCoordVelocity(this.coords.velocity,this.coords.delta),this._scopeFire("interactions:move",l),s||this.simulation||(this.interacting()&&(l.type=null,this.move(l)),this.pointerWasMoved&&z.copyCoords(this.coords.prev,this.coords.cur))}},{key:"move",value:function(e){e&&e.event||z.setZeroCoords(this.coords.delta),(e=(0,R.default)({pointer:this._latestPointer.pointer,event:this._latestPointer.event,eventTarget:this._latestPointer.eventTarget,interaction:this},e||{})).phase="move",this._doPhase(e)}},{key:"pointerUp",value:function(e,n,i,r){var a=this.getPointerIndex(e);-1===a&&(a=this.updatePointer(e,n,i,!1));var s=/cancel$/i.test(n.type)?"cancel":"up";this._scopeFire("interactions:".concat(s),{pointer:e,pointerIndex:a,pointerInfo:this.pointers[a],event:n,eventTarget:i,type:s,curEventTarget:r,interaction:this}),this.simulation||this.end(n),this.removePointer(e,n)}},{key:"documentBlur",value:function(e){this.end(e),this._scopeFire("interactions:blur",{event:e,type:"blur",interaction:this})}},{key:"end",value:function(e){var n;this._ending=!0,e=e||this._latestPointer.event,this.interacting()&&(n=this._doPhase({event:e,interaction:this,phase:"end"})),this._ending=!1,!0===n&&this.stop()}},{key:"currentAction",value:function(){return this._interacting?this.prepared.name:null}},{key:"interacting",value:function(){return this._interacting}},{key:"stop",value:function(){this._scopeFire("interactions:stop",{interaction:this}),this.interactable=this.element=null,this._interacting=!1,this._stopped=!0,this.prepared.name=this.prevEvent=null}},{key:"getPointerIndex",value:function(e){var n=z.getPointerId(e);return"mouse"===this.pointerType||"pen"===this.pointerType?this.pointers.length-1:Y.findIndex(this.pointers,function(e){return e.id===n})}},{key:"getPointerInfo",value:function(e){return this.pointers[this.getPointerIndex(e)]}},{key:"updatePointer",value:function(e,n,i,r){var a=z.getPointerId(e),s=this.getPointerIndex(e),o=this.pointers[s];return r=!1!==r&&(r||/(down|start)$/i.test(n.type)),o?o.pointer=e:(o=new ts.PointerInfo(a,e,n,null,null),s=this.pointers.length,this.pointers.push(o)),z.setCoords(this.coords.cur,this.pointers.map(function(e){return e.pointer}),this._now()),z.setCoordDeltas(this.coords.delta,this.coords.prev,this.coords.cur),r&&(this.pointerIsDown=!0,o.downTime=this.coords.cur.timeStamp,o.downTarget=i,z.pointerExtend(this.downPointer,e),this.interacting()||(z.copyCoords(this.coords.start,this.coords.cur),z.copyCoords(this.coords.prev,this.coords.cur),this.downEvent=n,this.pointerWasMoved=!1)),this._updateLatestPointer(e,n,i),this._scopeFire("interactions:update-pointer",{pointer:e,event:n,eventTarget:i,down:r,pointerInfo:o,pointerIndex:s,interaction:this}),s}},{key:"removePointer",value:function(e,n){var i=this.getPointerIndex(e);if(-1!==i){var r=this.pointers[i];this._scopeFire("interactions:remove-pointer",{pointer:e,event:n,eventTarget:null,pointerIndex:i,pointerInfo:r,interaction:this}),this.pointers.splice(i,1),this.pointerIsDown=!1}}},{key:"_updateLatestPointer",value:function(e,n,i){this._latestPointer.pointer=e,this._latestPointer.event=n,this._latestPointer.eventTarget=i}},{key:"destroy",value:function(){this._latestPointer.pointer=null,this._latestPointer.event=null,this._latestPointer.eventTarget=null}},{key:"_createPreparedEvent",value:function(e,n,i,r){return new e9.InteractEvent(this,e,this.prepared.name,n,this.element,i,r)}},{key:"_fireEvent",value:function(e){var n;null==(n=this.interactable)||n.fire(e),(!this.prevEvent||e.timeStamp>=this.prevEvent.timeStamp)&&(this.prevEvent=e)}},{key:"_doPhase",value:function(e){var n=e.event,i=e.phase,r=e.preEnd,a=e.type,s=this.rect;if(s&&"move"===i&&(P.addEdges(this.edges,s,this.coords.delta[this.interactable.options.deltaSource]),s.width=s.right-s.left,s.height=s.bottom-s.top),!1===this._scopeFire("interactions:before-action-".concat(i),e))return!1;var o=e.iEvent=this._createPreparedEvent(n,i,r,a);return this._scopeFire("interactions:action-".concat(i),e),"start"===i&&(this.prevEvent=o),this._fireEvent(o),this._scopeFire("interactions:after-action-".concat(i),e),!0}},{key:"_now",value:function(){return Date.now()}}],function(e,n){for(var i=0;ii.minSpeed&&a>i.endSpeed)this.startInertia();else{if(s.result=s.setAll(this.modifierArg),!s.result.changed)return!1;this.startSmoothEnd()}return n.modification.result.rect=null,n.offsetBy(this.targetOffset),n._doPhase({interaction:n,event:e,phase:"inertiastart"}),n.offsetBy({x:-this.targetOffset.x,y:-this.targetOffset.y}),n.modification.result.rect=null,this.active=!0,n.simulation=this,!0}},{key:"startInertia",value:function(){var e=this,n=this.interaction.coords.velocity.client,i=tP(this.interaction),r=i.resistance,a=-Math.log(i.endSpeed/this.v0)/r;this.targetOffset={x:(n.x-a)/r,y:(n.y-a)/r},this.te=a,this.lambda_v0=r/this.v0,this.one_ve_v0=1-i.endSpeed/this.v0;var s=this.modification,o=this.modifierArg;o.pageCoords={x:this.startCoords.x+this.targetOffset.x,y:this.startCoords.y+this.targetOffset.y},s.result=s.setAll(o),s.result.changed&&(this.isModified=!0,this.modifiedOffset={x:this.targetOffset.x+s.result.delta.x,y:this.targetOffset.y+s.result.delta.y}),this.onNextFrame(function(){return e.inertiaTick()})}},{key:"startSmoothEnd",value:function(){var e=this;this.smoothEnd=!0,this.isModified=!0,this.targetOffset={x:this.modification.result.delta.x,y:this.modification.result.delta.y},this.onNextFrame(function(){return e.smoothEndTick()})}},{key:"onNextFrame",value:function(e){var n=this;this.timeout=ey.default.request(function(){n.active&&e()})}},{key:"inertiaTick",value:function(){var e,n,i,r,a=this,s=this.interaction,o=tP(s).resistance,l=(s._now()-this.t0)/1e3;if(l=0;i--){var r=n[i],a=r.selector,s=r.context,o=r.listeners;a===this.target&&s===this._context&&n.splice(i,1);for(var u=o.length-1;u>=0;u--)this._scopeEvents.removeDelegate(this.target,this._context,e,o[u][0],o[u][1])}else this._scopeEvents.remove(this.target,"all")}}],function(e,n){for(var i=0;ie.length)&&(n=e.length);for(var i=0,r=Array(n);i=0;o--){var f=d[o];if(f.selector===e&&f.context===n){for(var m=f.listeners,g=m.length-1;g>=0;g--){var v=tX(m[g],2),_=v[0],y=v[1],x=y.capture,b=y.passive;if(_===a&&x===l.capture&&b===l.passive){m.splice(g,1),m.length||(d.splice(o,1),u(n,i,c),u(n,i,h,!0)),p=!0;break}}if(p)break}}},delegateListener:c,delegateUseCapture:h,delegatedEvents:r,documents:a,targets:i,supportsOptions:!1,supportsPassive:!1};function o(e,n,r,a){var o=tJ(a),l=Y.find(i,function(n){return n.eventTarget===e});l||(l={eventTarget:e,events:{}},i.push(l)),l.events[n]||(l.events[n]=[]),e.addEventListener&&!Y.contains(l.events[n],r)&&(e.addEventListener(n,r,s.supportsOptions?o:o.capture),l.events[n].push(r))}function u(e,n,r,a){var o=tJ(a),l=Y.findIndex(i,function(n){return n.eventTarget===e}),c=i[l];if(c&&c.events){if("all"!==n){var h=!1,d=c.events[n];if(d){if("all"===r){for(var p=d.length-1;p>=0;p--)u(e,n,d[p],o);return}for(var f=0;f=2)continue;if(!a.interacting()&&n===a.pointerType)return a}return null}};function t$(e,n){return e.pointers.some(function(e){return e.id===n})}tZ.default=tK;var tQ={};function t0(e){return(t0="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function t1(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var r,a,s=[],o=!0,l=!1;try{for(i=i.call(e);!(o=(r=i.next()).done)&&(s.push(r.value),!n||s.length!==n);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==i.return||i.return()}finally{if(l)throw a}}return s}}(e,n)||function(e,n){if(e){if("string"==typeof e)return t2(e,n);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?t2(e,n):void 0}}(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function t2(e,n){(null==n||n>e.length)&&(n=e.length);for(var i=0,r=Array(n);i=0;r--){var a=n.interactions.list[r];a.interactable===i&&(a.stop(),n.fire("interactions:destroy",{interaction:a}),a.destroy(),n.interactions.list.length>2&&n.interactions.list.splice(r,1))}}},onDocSignal:t8,doOnInteractions:t6,methodNames:t5};var t9={};function ne(e){return(ne="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function nt(){return(nt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,n,i){var r=function(e,n){for(;!Object.prototype.hasOwnProperty.call(e,n)&&null!==(e=ni(e)););return e}(e,n);if(r){var a=Object.getOwnPropertyDescriptor(r,n);return a.get?a.get.call(arguments.length<3?e:i):a.value}}).apply(this,arguments)}function nn(e,n){return(nn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,n){return e.__proto__=n,e})(e,n)}function ni(e){return(ni=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function nr(e,n){if(!(e instanceof n))throw TypeError("Cannot call a class as a function")}function na(e,n){for(var i=0;ie.length)&&(n=e.length);for(var i=0,r=Array(n);iMath.abs(c.y),u.coords,u.rect),(0,R.default)(r,u.coords)),u.eventProps},defaults:{ratio:"preserve",equalDelta:!1,modifiers:[],enabled:!1}};function nw(e,n,i){var r=e.startCoords,a=e.edgeSign;n?i.y=r.y+(i.x-r.x)*a.y:i.x=r.x+(i.y-r.y)*a.x}function nA(e,n,i,r){var a=e.startRect,s=e.startCoords,o=e.ratio,l=e.edgeSign;if(n){var u=r.width/o;i.y=s.y+(u-a.height)*l.y}else{var c=r.height*o;i.x=s.x+(c-a.width)*l.x}}nM.aspectRatio=nT;var nR=(0,e6.makeModifier)(nT,"aspectRatio");nM.default=nR;var nP={};Object.defineProperty(nP,"__esModule",{value:!0}),nP.default=void 0;var nC=function(){};nC._defaults={},nP.default=nC;var nL={};Object.defineProperty(nL,"__esModule",{value:!0}),Object.defineProperty(nL,"default",{enumerable:!0,get:function(){return nP.default}});var nO={};function nI(e,n,i){return l.default.func(e)?P.resolveRectLike(e,n.interactable,n.element,[i.x,i.y,n]):P.resolveRectLike(e,n.interactable,n.element)}Object.defineProperty(nO,"__esModule",{value:!0}),nO.default=void 0,nO.getRestrictionRect=nI,nO.restrict=void 0;var nD={start:function(e){var n=e.rect,i=e.startOffset,r=e.state,a=e.interaction,s=e.pageCoords,o=r.options,l=o.elementRect,u=(0,R.default)({left:0,top:0,right:0,bottom:0},o.offset||{});if(n&&l){var c=nI(o.restriction,a,s);if(c){var h=c.right-c.left-n.width,d=c.bottom-c.top-n.height;h<0&&(u.left+=h,u.right+=h),d<0&&(u.top+=d,u.bottom+=d)}u.left+=i.left-n.width*l.left,u.top+=i.top-n.height*l.top,u.right+=i.right-n.width*(1-l.right),u.bottom+=i.bottom-n.height*(1-l.bottom)}r.offset=u},set:function(e){var n=e.coords,i=e.interaction,r=e.state,a=r.options,s=r.offset,o=nI(a.restriction,i,n);if(o){var l=P.xywhToTlbr(o);n.x=Math.max(Math.min(l.right-s.right,n.x),l.left+s.left),n.y=Math.max(Math.min(l.bottom-s.bottom,n.y),l.top+s.top)}},defaults:{restriction:null,elementRect:null,offset:null,endOnly:!1,enabled:!1}};nO.restrict=nD;var nU=(0,e6.makeModifier)(nD,"restrict");nO.default=nU;var nN={};Object.defineProperty(nN,"__esModule",{value:!0}),nN.restrictEdges=nN.default=void 0;var nF={top:1/0,left:1/0,bottom:-1/0,right:-1/0},nz={top:-1/0,left:-1/0,bottom:1/0,right:1/0};function nB(e,n){for(var i=["top","left","bottom","right"],r=0;re.length)&&(n=e.length);for(var i=0,r=Array(n);i{"use strict";i.d(n,{Z:()=>r});let r={crush:(e,n=50)=>{let i=[];for(let e=127;--e;)(e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||"-_.!~*'()".includes(String.fromCharCode(e)))&&i.push(String.fromCharCode(e));for(let e=32;e<255;++e){let n=String.fromCharCode(e);"\\"==n||i.includes(n)||i.unshift(n)}let r=((e,i)=>{let r=i.length,a="",s=e=>encodeURI(encodeURIComponent(e)).replace(/%../g,"i").length,o=e=>{let n=e.charCodeAt(0),i=e.charCodeAt(e.length-1);return n>=56320&&n<=57343||i>=55296&&i<=56319},l={};for(let i=2;i=0;++a)s=e.indexOf(r,s+i);a>1&&(l[r]=a)}for(;;){let n;for(;r--&&e.includes(i[r]););if(r<0)break;let o=i[r],u=0,c=s(o);for(let e in l){let i=l[e],r=(i-1)*s(e)-(i+1)*c;a.length||(r-=s("\x01")),r<=0?delete l[e]:r>u&&(n=e,u=r)}if(!n)break;e=e.split(n).join(o)+o+n,a=o+a;let h={};for(let i in l){let r=i.split(n).join(o),a=0;for(let n=e.indexOf(r);n>=0;++a)n=e.indexOf(r,n+r.length);a>1&&(h[r]=a)}l=h}return{a:e,b:a}})(e=a(e=e.replace(RegExp("\x01","g"),"")),i),s=r.a;return r.b.length&&(s+="\x01"+r.b),s+="_"},uncrush:e=>{let n=(e=e.substring(0,e.length-1)).split("\x01"),i=n[0];if(n.length>1)for(let e of n[1]){let n=i.split(e);i=n.join(n.pop())}return a(i,0)}},a=(e,n=1)=>{let i=[['"',"'"],["':","!"],[",'","~"],["}",")","\\","\\"],["{","(","\\","\\"]],r=(e,n)=>{let i=RegExp(`${(n[2]?n[2]:"")+n[0]}|${(n[3]?n[3]:"")+n[1]}`,"g");return e.replace(i,e=>e===n[0]?n[1]:n[0])};if(n)for(let n=0;n{"use strict";let r,a,s,o;i.d(n,{BbS:()=>s9,CP7:()=>rD,D1R:()=>y,DvJ:()=>ni,EB7:()=>av,EJi:()=>sh,F5T:()=>tO,FM8:()=>Z,GUF:()=>R,Hmr:()=>s0,Hw6:()=>ed,Ilk:()=>tP,KI_:()=>A,Kj0:()=>nt,M8C:()=>J,Mig:()=>sK,N$j:()=>rJ,NMF:()=>M,OdW:()=>rQ,OoA:()=>p,Ox3:()=>sZ,PMe:()=>sG,Pa4:()=>eb,QRU:()=>sQ,SJI:()=>s8,SPe:()=>r8,Syv:()=>b,TUv:()=>rY,TlE:()=>tN,Tme:()=>td,TyD:()=>f,UY4:()=>ac,UlW:()=>E,Wid:()=>sc,Wl3:()=>l,WwZ:()=>S,YLQ:()=>m,ZAu:()=>rA,Zp0:()=>s$,ZzF:()=>eE,Zzh:()=>of,_12:()=>nS,_C8:()=>sg,_fP:()=>ex,aCh:()=>w,aH4:()=>g,aLr:()=>eV,aNw:()=>sL,blk:()=>au,cJO:()=>st,cPb:()=>nc,cek:()=>sY,dUE:()=>sS,dpR:()=>sN,ehD:()=>u,ejS:()=>al,epp:()=>eo,fHI:()=>aB,hH6:()=>sD,iKG:()=>nD,iLg:()=>sT,iMs:()=>ou,iUV:()=>oo,iWj:()=>nx,jyz:()=>nl,kB5:()=>rz,lb7:()=>r0,m7l:()=>sR,mTL:()=>s1,nls:()=>r9,qyh:()=>_,rpg:()=>h,tGC:()=>og,u9r:()=>tq,uWy:()=>d,vBJ:()=>tI,vpT:()=>rN,wem:()=>v,wk1:()=>x,woe:()=>am,x12:()=>aa,xEZ:()=>em,xWb:()=>ol,xoR:()=>sd,xsS:()=>rU,yC1:()=>sA,yGw:()=>eK,z$h:()=>T,zf8:()=>az});let l=0,u=2,c="attached",h=1e3,d=1001,p=1002,f=1003,m=1004,g=1005,v=1006,_=1007,y=1008,x=1023,b=2300,M=2301,S=0,E=1,T=2,w="",A="srgb",R="srgb-linear",P="display-p3",C="display-p3-linear",L="linear",O="srgb",I="rec709",D="300 es";class U{addEventListener(e,n){void 0===this._listeners&&(this._listeners={});let i=this._listeners;void 0===i[e]&&(i[e]=[]),-1===i[e].indexOf(n)&&i[e].push(n)}hasEventListener(e,n){if(void 0===this._listeners)return!1;let i=this._listeners;return void 0!==i[e]&&-1!==i[e].indexOf(n)}removeEventListener(e,n){if(void 0===this._listeners)return;let i=this._listeners[e];if(void 0!==i){let e=i.indexOf(n);-1!==e&&i.splice(e,1)}}dispatchEvent(e){if(void 0===this._listeners)return;let n=this._listeners[e.type];if(void 0!==n){e.target=this;let i=n.slice(0);for(let n=0,r=i.length;n>8&255]+N[e>>16&255]+N[e>>24&255]+"-"+N[255&n]+N[n>>8&255]+"-"+N[n>>16&15|64]+N[n>>24&255]+"-"+N[63&i|128]+N[i>>8&255]+"-"+N[i>>16&255]+N[i>>24&255]+N[255&r]+N[r>>8&255]+N[r>>16&255]+N[r>>24&255]).toLowerCase()}function H(e,n,i){return Math.max(n,Math.min(i,e))}function V(e,n){return(e%n+n)%n}function G(e,n,i){return(1-i)*e+i*n}function W(e){return(e&e-1)==0&&0!==e}function j(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))}function X(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}function q(e,n){switch(n.constructor){case Float32Array:return e;case Uint32Array:return e/4294967295;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/2147483647,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw Error("Invalid component type.")}}function Y(e,n){switch(n.constructor){case Float32Array:return e;case Uint32Array:return Math.round(4294967295*e);case Uint16Array:return Math.round(65535*e);case Uint8Array:return Math.round(255*e);case Int32Array:return Math.round(2147483647*e);case Int16Array:return Math.round(32767*e);case Int8Array:return Math.round(127*e);default:throw Error("Invalid component type.")}}let J={DEG2RAD:z,RAD2DEG:B,generateUUID:k,clamp:H,euclideanModulo:V,mapLinear:function(e,n,i,r,a){return r+(e-n)*(a-r)/(i-n)},inverseLerp:function(e,n,i){return e!==n?(i-e)/(n-e):0},lerp:G,damp:function(e,n,i,r){return G(e,n,1-Math.exp(-i*r))},pingpong:function(e,n=1){return n-Math.abs(V(e,2*n)-n)},smoothstep:function(e,n,i){return e<=n?0:e>=i?1:(e=(e-n)/(i-n))*e*(3-2*e)},smootherstep:function(e,n,i){return e<=n?0:e>=i?1:(e=(e-n)/(i-n))*e*e*(e*(6*e-15)+10)},randInt:function(e,n){return e+Math.floor(Math.random()*(n-e+1))},randFloat:function(e,n){return e+Math.random()*(n-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){void 0!==e&&(F=e);let n=F+=1831565813;return n=Math.imul(n^n>>>15,1|n),(((n^=n+Math.imul(n^n>>>7,61|n))^n>>>14)>>>0)/4294967296},degToRad:function(e){return e*z},radToDeg:function(e){return e*B},isPowerOfTwo:W,ceilPowerOfTwo:j,floorPowerOfTwo:X,setQuaternionFromProperEuler:function(e,n,i,r,a){let s=Math.cos,o=Math.sin,l=s(i/2),u=o(i/2),c=s((n+r)/2),h=o((n+r)/2),d=s((n-r)/2),p=o((n-r)/2),f=s((r-n)/2),m=o((r-n)/2);switch(a){case"XYX":e.set(l*h,u*d,u*p,l*c);break;case"YZY":e.set(u*p,l*h,u*d,l*c);break;case"ZXZ":e.set(u*d,u*p,l*h,l*c);break;case"XZX":e.set(l*h,u*m,u*f,l*c);break;case"YXY":e.set(u*f,l*h,u*m,l*c);break;case"ZYZ":e.set(u*m,u*f,l*h,l*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+a)}},normalize:Y,denormalize:q};class Z{constructor(e=0,n=0){Z.prototype.isVector2=!0,this.x=e,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,n){return this.x=e,this.y=n,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;default:throw Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let n=this.x,i=this.y,r=e.elements;return this.x=r[0]*n+r[3]*i+r[6],this.y=r[1]*n+r[4]*i+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this}clampLength(e,n){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(n,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){let n=Math.sqrt(this.lengthSq()*e.lengthSq());return 0===n?Math.PI/2:Math.acos(H(this.dot(e)/n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let n=this.x-e.x,i=this.y-e.y;return n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this}rotateAround(e,n){let i=Math.cos(n),r=Math.sin(n),a=this.x-e.x,s=this.y-e.y;return this.x=a*i-s*r+e.x,this.y=a*r+s*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class K{constructor(e,n,i,r,a,s,o,l,u){K.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==e&&this.set(e,n,i,r,a,s,o,l,u)}set(e,n,i,r,a,s,o,l,u){let c=this.elements;return c[0]=e,c[1]=r,c[2]=o,c[3]=n,c[4]=a,c[5]=l,c[6]=i,c[7]=s,c[8]=u,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let n=this.elements,i=e.elements;return n[0]=i[0],n[1]=i[1],n[2]=i[2],n[3]=i[3],n[4]=i[4],n[5]=i[5],n[6]=i[6],n[7]=i[7],n[8]=i[8],this}extractBasis(e,n,i){return e.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let n=e.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){let i=e.elements,r=n.elements,a=this.elements,s=i[0],o=i[3],l=i[6],u=i[1],c=i[4],h=i[7],d=i[2],p=i[5],f=i[8],m=r[0],g=r[3],v=r[6],_=r[1],y=r[4],x=r[7],b=r[2],M=r[5],S=r[8];return a[0]=s*m+o*_+l*b,a[3]=s*g+o*y+l*M,a[6]=s*v+o*x+l*S,a[1]=u*m+c*_+h*b,a[4]=u*g+c*y+h*M,a[7]=u*v+c*x+h*S,a[2]=d*m+p*_+f*b,a[5]=d*g+p*y+f*M,a[8]=d*v+p*x+f*S,this}multiplyScalar(e){let n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=e,n[4]*=e,n[7]*=e,n[2]*=e,n[5]*=e,n[8]*=e,this}determinant(){let e=this.elements,n=e[0],i=e[1],r=e[2],a=e[3],s=e[4],o=e[5],l=e[6],u=e[7],c=e[8];return n*s*c-n*o*u-i*a*c+i*o*l+r*a*u-r*s*l}invert(){let e=this.elements,n=e[0],i=e[1],r=e[2],a=e[3],s=e[4],o=e[5],l=e[6],u=e[7],c=e[8],h=c*s-o*u,d=o*l-c*a,p=u*a-s*l,f=n*h+i*d+r*p;if(0===f)return this.set(0,0,0,0,0,0,0,0,0);let m=1/f;return e[0]=h*m,e[1]=(r*u-c*i)*m,e[2]=(o*i-r*s)*m,e[3]=d*m,e[4]=(c*n-r*l)*m,e[5]=(r*a-o*n)*m,e[6]=p*m,e[7]=(i*l-u*n)*m,e[8]=(s*n-i*a)*m,this}transpose(){let e;let n=this.elements;return e=n[1],n[1]=n[3],n[3]=e,e=n[2],n[2]=n[6],n[6]=e,e=n[5],n[5]=n[7],n[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let n=this.elements;return e[0]=n[0],e[1]=n[3],e[2]=n[6],e[3]=n[1],e[4]=n[4],e[5]=n[7],e[6]=n[2],e[7]=n[5],e[8]=n[8],this}setUvTransform(e,n,i,r,a,s,o){let l=Math.cos(a),u=Math.sin(a);return this.set(i*l,i*u,-i*(l*s+u*o)+s+e,-r*u,r*l,-r*(-u*s+l*o)+o+n,0,0,1),this}scale(e,n){return this.premultiply($.makeScale(e,n)),this}rotate(e){return this.premultiply($.makeRotation(-e)),this}translate(e,n){return this.premultiply($.makeTranslation(e,n)),this}makeTranslation(e,n){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,n,0,0,1),this}makeRotation(e){let n=Math.cos(e),i=Math.sin(e);return this.set(n,-i,0,i,n,0,0,0,1),this}makeScale(e,n){return this.set(e,0,0,0,n,0,0,0,1),this}equals(e){let n=this.elements,i=e.elements;for(let e=0;e<9;e++)if(n[e]!==i[e])return!1;return!0}fromArray(e,n=0){for(let i=0;i<9;i++)this.elements[i]=e[i+n];return this}toArray(e=[],n=0){let i=this.elements;return e[n]=i[0],e[n+1]=i[1],e[n+2]=i[2],e[n+3]=i[3],e[n+4]=i[4],e[n+5]=i[5],e[n+6]=i[6],e[n+7]=i[7],e[n+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}let $=new K;function Q(e){for(let n=e.length-1;n>=0;--n)if(e[n]>=65535)return!0;return!1}function ee(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array;let et={};function en(e){e in et||(et[e]=!0,console.warn(e))}let ei=new K().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),er=new K().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),ea={[R]:{transfer:L,primaries:I,toReference:e=>e,fromReference:e=>e},[A]:{transfer:O,primaries:I,toReference:e=>e.convertSRGBToLinear(),fromReference:e=>e.convertLinearToSRGB()},[C]:{transfer:L,primaries:"p3",toReference:e=>e.applyMatrix3(er),fromReference:e=>e.applyMatrix3(ei)},[P]:{transfer:O,primaries:"p3",toReference:e=>e.convertSRGBToLinear().applyMatrix3(er),fromReference:e=>e.applyMatrix3(ei).convertLinearToSRGB()}},es=new Set([R,C]),eo={enabled:!0,_workingColorSpace:R,get legacyMode(){return console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),!this.enabled},set legacyMode(legacyMode){console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),this.enabled=!legacyMode},get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(colorSpace){if(!es.has(colorSpace))throw Error(`Unsupported working color space, "${colorSpace}".`);this._workingColorSpace=colorSpace},convert:function(e,n,i){if(!1===this.enabled||n===i||!n||!i)return e;let r=ea[n].toReference;return(0,ea[i].fromReference)(r(e))},fromWorkingColorSpace:function(e,n){return this.convert(e,this._workingColorSpace,n)},toWorkingColorSpace:function(e,n){return this.convert(e,n,this._workingColorSpace)},getPrimaries:function(e){return ea[e].primaries},getTransfer:function(e){return e===w?L:ea[e].transfer}};function el(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function eu(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}class ec{static getDataURL(e){let n;if(/^data:/i.test(e.src)||"undefined"==typeof HTMLCanvasElement)return e.src;if(e instanceof HTMLCanvasElement)n=e;else{void 0===r&&(r=ee("canvas")),r.width=e.width,r.height=e.height;let i=r.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),n=r}return n.width>2048||n.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),n.toDataURL("image/jpeg",.6)):n.toDataURL("image/png")}static sRGBToLinear(e){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){let n=ee("canvas");n.width=e.width,n.height=e.height;let i=n.getContext("2d");i.drawImage(e,0,0,e.width,e.height);let r=i.getImageData(0,0,e.width,e.height),a=r.data;for(let e=0;e0&&(i.userData=this.userData),n||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(300!==this.mapping)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case h:e.x=e.x-Math.floor(e.x);break;case d:e.x=e.x<0?0:1;break;case p:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case h:e.y=e.y-Math.floor(e.y);break;case d:e.y=e.y<0?0:1;break;case p:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){!0===e&&(this.version++,this.source.needsUpdate=!0)}get encoding(){return en("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===A?3001:3e3}set encoding(e){en("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=3001===e?A:w}}em.DEFAULT_IMAGE=null,em.DEFAULT_MAPPING=300,em.DEFAULT_ANISOTROPY=1;class eg{constructor(e=0,n=0,i=0,r=1){eg.prototype.isVector4=!0,this.x=e,this.y=n,this.z=i,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,n,i,r){return this.x=e,this.y=n,this.z=i,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;break;default:throw Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this.w=e.w+n.w,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this.w+=e.w*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this.w=e.w-n.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let n=this.x,i=this.y,r=this.z,a=this.w,s=e.elements;return this.x=s[0]*n+s[4]*i+s[8]*r+s[12]*a,this.y=s[1]*n+s[5]*i+s[9]*r+s[13]*a,this.z=s[2]*n+s[6]*i+s[10]*r+s[14]*a,this.w=s[3]*n+s[7]*i+s[11]*r+s[15]*a,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let n=Math.sqrt(1-e.w*e.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/n,this.y=e.y/n,this.z=e.z/n),this}setAxisAngleFromRotationMatrix(e){let n,i,r;let a=e.elements,s=a[0],o=a[4],l=a[8],u=a[1],c=a[5],h=a[9],d=a[2],p=a[6],f=a[10];if(.01>Math.abs(o-u)&&.01>Math.abs(l-d)&&.01>Math.abs(h-p)){if(.1>Math.abs(o+u)&&.1>Math.abs(l+d)&&.1>Math.abs(h+p)&&.1>Math.abs(s+c+f-3))return this.set(1,0,0,0),this;let e=(s+1)/2,a=(c+1)/2,m=(f+1)/2,g=(o+u)/4,v=(l+d)/4,_=(h+p)/4;return e>a&&e>m?e<.01?(n=0,i=.707106781,r=.707106781):(i=g/(n=Math.sqrt(e)),r=v/n):a>m?a<.01?(n=.707106781,i=0,r=.707106781):(n=g/(i=Math.sqrt(a)),r=_/i):m<.01?(n=.707106781,i=.707106781,r=0):(n=v/(r=Math.sqrt(m)),i=_/r),this.set(n,i,r,Math.PI),this}let m=Math.sqrt((p-h)*(p-h)+(l-d)*(l-d)+(u-o)*(u-o));return .001>Math.abs(m)&&(m=1),this.x=(p-h)/m,this.y=(l-d)/m,this.z=(u-o)/m,this.w=Math.acos((s+c+f-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this.z=Math.max(e.z,Math.min(n.z,this.z)),this.w=Math.max(e.w,Math.min(n.w,this.w)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this.z=Math.max(e,Math.min(n,this.z)),this.w=Math.max(e,Math.min(n,this.w)),this}clampLength(e,n){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(n,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this.w+=(e.w-this.w)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this.z=e.z+(n.z-e.z)*i,this.w=e.w+(n.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this.w=e[n+3],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e[n+3]=this.w,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this.w=e.getW(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class ev extends U{constructor(e=1,n=1,i={}){super(),this.isRenderTarget=!0,this.width=e,this.height=n,this.depth=1,this.scissor=new eg(0,0,e,n),this.scissorTest=!1,this.viewport=new eg(0,0,e,n),void 0!==i.encoding&&(en("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),i.colorSpace=3001===i.encoding?A:w),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:v,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0},i),this.texture=new em({width:e,height:n,depth:1},i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=i.generateMipmaps,this.texture.internalFormat=i.internalFormat,this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.depthTexture=i.depthTexture,this.samples=i.samples}setSize(e,n,i=1){(this.width!==e||this.height!==n||this.depth!==i)&&(this.width=e,this.height=n,this.depth=i,this.texture.image.width=e,this.texture.image.height=n,this.texture.image.depth=i,this.dispose()),this.viewport.set(0,0,e,n),this.scissor.set(0,0,e,n)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;let n=Object.assign({},e.texture.image);return this.texture.source=new ed(n),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,null!==e.depthTexture&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class e_ extends ev{constructor(e=1,n=1,i={}){super(e,n,i),this.isWebGLRenderTarget=!0}}class ey extends em{constructor(e=null,n=1,i=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:n,height:i,depth:r},this.magFilter=f,this.minFilter=f,this.wrapR=d,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class ex{constructor(e=0,n=0,i=0,r=1){this.isQuaternion=!0,this._x=e,this._y=n,this._z=i,this._w=r}static slerpFlat(e,n,i,r,a,s,o){let l=i[r+0],u=i[r+1],c=i[r+2],h=i[r+3],d=a[s+0],p=a[s+1],f=a[s+2],m=a[s+3];if(0===o){e[n+0]=l,e[n+1]=u,e[n+2]=c,e[n+3]=h;return}if(1===o){e[n+0]=d,e[n+1]=p,e[n+2]=f,e[n+3]=m;return}if(h!==m||l!==d||u!==p||c!==f){let e=1-o,n=l*d+u*p+c*f+h*m,i=n>=0?1:-1,r=1-n*n;if(r>Number.EPSILON){let a=Math.sqrt(r),s=Math.atan2(a,n*i);e=Math.sin(e*s)/a,o=Math.sin(o*s)/a}let a=o*i;if(l=l*e+d*a,u=u*e+p*a,c=c*e+f*a,h=h*e+m*a,e===1-o){let e=1/Math.sqrt(l*l+u*u+c*c+h*h);l*=e,u*=e,c*=e,h*=e}}e[n]=l,e[n+1]=u,e[n+2]=c,e[n+3]=h}static multiplyQuaternionsFlat(e,n,i,r,a,s){let o=i[r],l=i[r+1],u=i[r+2],c=i[r+3],h=a[s],d=a[s+1],p=a[s+2],f=a[s+3];return e[n]=o*f+c*h+l*p-u*d,e[n+1]=l*f+c*d+u*h-o*p,e[n+2]=u*f+c*p+o*d-l*h,e[n+3]=c*f-o*h-l*d-u*p,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,n,i,r){return this._x=e,this._y=n,this._z=i,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,n){let i=e._x,r=e._y,a=e._z,s=e._order,o=Math.cos,l=Math.sin,u=o(i/2),c=o(r/2),h=o(a/2),d=l(i/2),p=l(r/2),f=l(a/2);switch(s){case"XYZ":this._x=d*c*h+u*p*f,this._y=u*p*h-d*c*f,this._z=u*c*f+d*p*h,this._w=u*c*h-d*p*f;break;case"YXZ":this._x=d*c*h+u*p*f,this._y=u*p*h-d*c*f,this._z=u*c*f-d*p*h,this._w=u*c*h+d*p*f;break;case"ZXY":this._x=d*c*h-u*p*f,this._y=u*p*h+d*c*f,this._z=u*c*f+d*p*h,this._w=u*c*h-d*p*f;break;case"ZYX":this._x=d*c*h-u*p*f,this._y=u*p*h+d*c*f,this._z=u*c*f-d*p*h,this._w=u*c*h+d*p*f;break;case"YZX":this._x=d*c*h+u*p*f,this._y=u*p*h+d*c*f,this._z=u*c*f-d*p*h,this._w=u*c*h-d*p*f;break;case"XZY":this._x=d*c*h-u*p*f,this._y=u*p*h-d*c*f,this._z=u*c*f+d*p*h,this._w=u*c*h+d*p*f;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return!1!==n&&this._onChangeCallback(),this}setFromAxisAngle(e,n){let i=n/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){let n=e.elements,i=n[0],r=n[4],a=n[8],s=n[1],o=n[5],l=n[9],u=n[2],c=n[6],h=n[10],d=i+o+h;if(d>0){let e=.5/Math.sqrt(d+1);this._w=.25/e,this._x=(c-l)*e,this._y=(a-u)*e,this._z=(s-r)*e}else if(i>o&&i>h){let e=2*Math.sqrt(1+i-o-h);this._w=(c-l)/e,this._x=.25*e,this._y=(r+s)/e,this._z=(a+u)/e}else if(o>h){let e=2*Math.sqrt(1+o-i-h);this._w=(a-u)/e,this._x=(r+s)/e,this._y=.25*e,this._z=(l+c)/e}else{let e=2*Math.sqrt(1+h-i-o);this._w=(s-r)/e,this._x=(a+u)/e,this._y=(l+c)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,n){let i=e.dot(n)+1;return iMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0):(this._x=0,this._y=-e.z,this._z=e.y)):(this._x=e.y*n.z-e.z*n.y,this._y=e.z*n.x-e.x*n.z,this._z=e.x*n.y-e.y*n.x),this._w=i,this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(H(this.dot(e),-1,1)))}rotateTowards(e,n){let i=this.angleTo(e);return 0===i||this.slerp(e,Math.min(1,n/i)),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,n){let i=e._x,r=e._y,a=e._z,s=e._w,o=n._x,l=n._y,u=n._z,c=n._w;return this._x=i*c+s*o+r*u-a*l,this._y=r*c+s*l+a*o-i*u,this._z=a*c+s*u+i*l-r*o,this._w=s*c-i*o-r*l-a*u,this._onChangeCallback(),this}slerp(e,n){if(0===n)return this;if(1===n)return this.copy(e);let i=this._x,r=this._y,a=this._z,s=this._w,o=s*e._w+i*e._x+r*e._y+a*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=s,this._x=i,this._y=r,this._z=a,this;let l=1-o*o;if(l<=Number.EPSILON){let e=1-n;return this._w=e*s+n*this._w,this._x=e*i+n*this._x,this._y=e*r+n*this._y,this._z=e*a+n*this._z,this.normalize(),this._onChangeCallback(),this}let u=Math.sqrt(l),c=Math.atan2(u,o),h=Math.sin((1-n)*c)/u,d=Math.sin(n*c)/u;return this._w=s*h+this._w*d,this._x=i*h+this._x*d,this._y=r*h+this._y*d,this._z=a*h+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,n,i){return this.copy(e).slerp(n,i)}random(){let e=Math.random(),n=Math.sqrt(1-e),i=Math.sqrt(e),r=2*Math.PI*Math.random(),a=2*Math.PI*Math.random();return this.set(n*Math.cos(r),i*Math.sin(a),i*Math.cos(a),n*Math.sin(r))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,n=0){return this._x=e[n],this._y=e[n+1],this._z=e[n+2],this._w=e[n+3],this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._w,e}fromBufferAttribute(e,n){return this._x=e.getX(n),this._y=e.getY(n),this._z=e.getZ(n),this._w=e.getW(n),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class eb{constructor(e=0,n=0,i=0){eb.prototype.isVector3=!0,this.x=e,this.y=n,this.z=i}set(e,n,i){return void 0===i&&(i=this.z),this.x=e,this.y=n,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;default:throw Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,n){return this.x=e.x*n.x,this.y=e.y*n.y,this.z=e.z*n.z,this}applyEuler(e){return this.applyQuaternion(eS.setFromEuler(e))}applyAxisAngle(e,n){return this.applyQuaternion(eS.setFromAxisAngle(e,n))}applyMatrix3(e){let n=this.x,i=this.y,r=this.z,a=e.elements;return this.x=a[0]*n+a[3]*i+a[6]*r,this.y=a[1]*n+a[4]*i+a[7]*r,this.z=a[2]*n+a[5]*i+a[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let n=this.x,i=this.y,r=this.z,a=e.elements,s=1/(a[3]*n+a[7]*i+a[11]*r+a[15]);return this.x=(a[0]*n+a[4]*i+a[8]*r+a[12])*s,this.y=(a[1]*n+a[5]*i+a[9]*r+a[13])*s,this.z=(a[2]*n+a[6]*i+a[10]*r+a[14])*s,this}applyQuaternion(e){let n=this.x,i=this.y,r=this.z,a=e.x,s=e.y,o=e.z,l=e.w,u=2*(s*r-o*i),c=2*(o*n-a*r),h=2*(a*i-s*n);return this.x=n+l*u+s*h-o*c,this.y=i+l*c+o*u-a*h,this.z=r+l*h+a*c-s*u,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let n=this.x,i=this.y,r=this.z,a=e.elements;return this.x=a[0]*n+a[4]*i+a[8]*r,this.y=a[1]*n+a[5]*i+a[9]*r,this.z=a[2]*n+a[6]*i+a[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this.z=Math.max(e.z,Math.min(n.z,this.z)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this.z=Math.max(e,Math.min(n,this.z)),this}clampLength(e,n){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(n,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this.z=e.z+(n.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,n){let i=e.x,r=e.y,a=e.z,s=n.x,o=n.y,l=n.z;return this.x=r*l-a*o,this.y=a*s-i*l,this.z=i*o-r*s,this}projectOnVector(e){let n=e.lengthSq();if(0===n)return this.set(0,0,0);let i=e.dot(this)/n;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return eM.copy(this).projectOnVector(e),this.sub(eM)}reflect(e){return this.sub(eM.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let n=Math.sqrt(this.lengthSq()*e.lengthSq());return 0===n?Math.PI/2:Math.acos(H(this.dot(e)/n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let n=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return n*n+i*i+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,n,i){let r=Math.sin(n)*e;return this.x=r*Math.sin(i),this.y=Math.cos(n)*e,this.z=r*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,n,i){return this.x=e*Math.sin(n),this.y=i,this.z=e*Math.cos(n),this}setFromMatrixPosition(e){let n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(e){let n=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=n,this.y=i,this.z=r,this}setFromMatrixColumn(e,n){return this.fromArray(e.elements,4*n)}setFromMatrix3Column(e,n){return this.fromArray(e.elements,3*n)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let e=(Math.random()-.5)*2,n=Math.random()*Math.PI*2,i=Math.sqrt(1-e**2);return this.x=i*Math.cos(n),this.y=i*Math.sin(n),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}let eM=new eb,eS=new ex;class eE{constructor(e=new eb(Infinity,Infinity,Infinity),n=new eb(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=n}set(e,n){return this.min.copy(e),this.max.copy(n),this}setFromArray(e){this.makeEmpty();for(let n=0,i=e.length;nthis.max.x)&&!(e.ythis.max.y)&&!(e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,n){return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x)&&!(e.max.ythis.max.y)&&!(e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,ew),ew.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let n,i;return e.normal.x>0?(n=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(n=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(n+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(n+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(n+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(n+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),n<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(eD),eU.subVectors(this.max,eD),eR.subVectors(e.a,eD),eP.subVectors(e.b,eD),eC.subVectors(e.c,eD),eL.subVectors(eP,eR),eO.subVectors(eC,eP),eI.subVectors(eR,eC);let n=[0,-eL.z,eL.y,0,-eO.z,eO.y,0,-eI.z,eI.y,eL.z,0,-eL.x,eO.z,0,-eO.x,eI.z,0,-eI.x,-eL.y,eL.x,0,-eO.y,eO.x,0,-eI.y,eI.x,0];return!!(ez(n,eR,eP,eC,eU)&&ez(n=[1,0,0,0,1,0,0,0,1],eR,eP,eC,eU))&&(eN.crossVectors(eL,eO),ez(n=[eN.x,eN.y,eN.z],eR,eP,eC,eU))}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,ew).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=.5*this.getSize(ew).length()),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()||(eT[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),eT[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),eT[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),eT[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),eT[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),eT[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),eT[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),eT[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(eT)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}let eT=[new eb,new eb,new eb,new eb,new eb,new eb,new eb,new eb],ew=new eb,eA=new eE,eR=new eb,eP=new eb,eC=new eb,eL=new eb,eO=new eb,eI=new eb,eD=new eb,eU=new eb,eN=new eb,eF=new eb;function ez(e,n,i,r,a){for(let s=0,o=e.length-3;s<=o;s+=3){eF.fromArray(e,s);let o=a.x*Math.abs(eF.x)+a.y*Math.abs(eF.y)+a.z*Math.abs(eF.z),l=n.dot(eF),u=i.dot(eF),c=r.dot(eF);if(Math.max(-Math.max(l,u,c),Math.min(l,u,c))>o)return!1}return!0}let eB=new eE,ek=new eb,eH=new eb;class eV{constructor(e=new eb,n=-1){this.center=e,this.radius=n}set(e,n){return this.center.copy(e),this.radius=n,this}setFromPoints(e,n){let i=this.center;void 0!==n?i.copy(n):eB.setFromPoints(e).getCenter(i);let r=0;for(let n=0,a=e.length;nthis.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n}getBoundingBox(e){return this.isEmpty()?e.makeEmpty():(e.set(this.center,this.center),e.expandByScalar(this.radius)),e}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;ek.subVectors(e,this.center);let n=ek.lengthSq();if(n>this.radius*this.radius){let e=Math.sqrt(n),i=(e-this.radius)*.5;this.center.addScaledVector(ek,i/e),this.radius+=i}return this}union(e){return e.isEmpty()||(this.isEmpty()?this.copy(e):!0===this.center.equals(e.center)?this.radius=Math.max(this.radius,e.radius):(eH.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(ek.copy(e.center).add(eH)),this.expandByPoint(ek.copy(e.center).sub(eH)))),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}let eG=new eb,eW=new eb,ej=new eb,eX=new eb,eq=new eb,eY=new eb,eJ=new eb;class eZ{constructor(e=new eb,n=new eb(0,0,-1)){this.origin=e,this.direction=n}set(e,n){return this.origin.copy(e),this.direction.copy(n),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,n){return n.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,eG)),this}closestPointToPoint(e,n){n.subVectors(e,this.origin);let i=n.dot(this.direction);return i<0?n.copy(this.origin):n.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let n=eG.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(eG.copy(this.origin).addScaledVector(this.direction,n),eG.distanceToSquared(e))}distanceSqToSegment(e,n,i,r){let a,s,o,l;eW.copy(e).add(n).multiplyScalar(.5),ej.copy(n).sub(e).normalize(),eX.copy(this.origin).sub(eW);let u=.5*e.distanceTo(n),c=-this.direction.dot(ej),h=eX.dot(this.direction),d=-eX.dot(ej),p=eX.lengthSq(),f=Math.abs(1-c*c);if(f>0){if(a=c*d-h,s=c*h-d,l=u*f,a>=0){if(s>=-l){if(s<=l){let e=1/f;a*=e,s*=e,o=a*(a+c*s+2*h)+s*(c*a+s+2*d)+p}else o=-(a=Math.max(0,-(c*(s=u)+h)))*a+s*(s+2*d)+p}else o=-(a=Math.max(0,-(c*(s=-u)+h)))*a+s*(s+2*d)+p}else s<=-l?(s=(a=Math.max(0,-(-c*u+h)))>0?-u:Math.min(Math.max(-u,-d),u),o=-a*a+s*(s+2*d)+p):s<=l?(a=0,o=(s=Math.min(Math.max(-u,-d),u))*(s+2*d)+p):(s=(a=Math.max(0,-(c*u+h)))>0?u:Math.min(Math.max(-u,-d),u),o=-a*a+s*(s+2*d)+p)}else s=c>0?-u:u,o=-(a=Math.max(0,-(c*s+h)))*a+s*(s+2*d)+p;return i&&i.copy(this.origin).addScaledVector(this.direction,a),r&&r.copy(eW).addScaledVector(ej,s),o}intersectSphere(e,n){eG.subVectors(e.center,this.origin);let i=eG.dot(this.direction),r=eG.dot(eG)-i*i,a=e.radius*e.radius;if(r>a)return null;let s=Math.sqrt(a-r),o=i-s,l=i+s;return l<0?null:o<0?this.at(l,n):this.at(o,n)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let n=e.normal.dot(this.direction);if(0===n)return 0===e.distanceToPoint(this.origin)?0:null;let i=-(this.origin.dot(e.normal)+e.constant)/n;return i>=0?i:null}intersectPlane(e,n){let i=this.distanceToPlane(e);return null===i?null:this.at(i,n)}intersectsPlane(e){let n=e.distanceToPoint(this.origin);return!!(0===n||e.normal.dot(this.direction)*n<0)}intersectBox(e,n){let i,r,a,s,o,l;let u=1/this.direction.x,c=1/this.direction.y,h=1/this.direction.z,d=this.origin;return(u>=0?(i=(e.min.x-d.x)*u,r=(e.max.x-d.x)*u):(i=(e.max.x-d.x)*u,r=(e.min.x-d.x)*u),c>=0?(a=(e.min.y-d.y)*c,s=(e.max.y-d.y)*c):(a=(e.max.y-d.y)*c,s=(e.min.y-d.y)*c),i>s||a>r)?null:((a>i||isNaN(i))&&(i=a),(s=0?(o=(e.min.z-d.z)*h,l=(e.max.z-d.z)*h):(o=(e.max.z-d.z)*h,l=(e.min.z-d.z)*h),i>l||o>r)?null:((o>i||i!=i)&&(i=o),(l=0?i:r,n)}intersectsBox(e){return null!==this.intersectBox(e,eG)}intersectTriangle(e,n,i,r,a){let s;eq.subVectors(n,e),eY.subVectors(i,e),eJ.crossVectors(eq,eY);let o=this.direction.dot(eJ);if(o>0){if(r)return null;s=1}else{if(!(o<0))return null;s=-1,o=-o}eX.subVectors(this.origin,e);let l=s*this.direction.dot(eY.crossVectors(eX,eY));if(l<0)return null;let u=s*this.direction.dot(eq.cross(eX));if(u<0||l+u>o)return null;let c=-s*eX.dot(eJ);return c<0?null:this.at(c/o,a)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class eK{constructor(e,n,i,r,a,s,o,l,u,c,h,d,p,f,m,g){eK.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==e&&this.set(e,n,i,r,a,s,o,l,u,c,h,d,p,f,m,g)}set(e,n,i,r,a,s,o,l,u,c,h,d,p,f,m,g){let v=this.elements;return v[0]=e,v[4]=n,v[8]=i,v[12]=r,v[1]=a,v[5]=s,v[9]=o,v[13]=l,v[2]=u,v[6]=c,v[10]=h,v[14]=d,v[3]=p,v[7]=f,v[11]=m,v[15]=g,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new eK().fromArray(this.elements)}copy(e){let n=this.elements,i=e.elements;return n[0]=i[0],n[1]=i[1],n[2]=i[2],n[3]=i[3],n[4]=i[4],n[5]=i[5],n[6]=i[6],n[7]=i[7],n[8]=i[8],n[9]=i[9],n[10]=i[10],n[11]=i[11],n[12]=i[12],n[13]=i[13],n[14]=i[14],n[15]=i[15],this}copyPosition(e){let n=this.elements,i=e.elements;return n[12]=i[12],n[13]=i[13],n[14]=i[14],this}setFromMatrix3(e){let n=e.elements;return this.set(n[0],n[3],n[6],0,n[1],n[4],n[7],0,n[2],n[5],n[8],0,0,0,0,1),this}extractBasis(e,n,i){return e.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,n,i){return this.set(e.x,n.x,i.x,0,e.y,n.y,i.y,0,e.z,n.z,i.z,0,0,0,0,1),this}extractRotation(e){let n=this.elements,i=e.elements,r=1/e$.setFromMatrixColumn(e,0).length(),a=1/e$.setFromMatrixColumn(e,1).length(),s=1/e$.setFromMatrixColumn(e,2).length();return n[0]=i[0]*r,n[1]=i[1]*r,n[2]=i[2]*r,n[3]=0,n[4]=i[4]*a,n[5]=i[5]*a,n[6]=i[6]*a,n[7]=0,n[8]=i[8]*s,n[9]=i[9]*s,n[10]=i[10]*s,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromEuler(e){let n=this.elements,i=e.x,r=e.y,a=e.z,s=Math.cos(i),o=Math.sin(i),l=Math.cos(r),u=Math.sin(r),c=Math.cos(a),h=Math.sin(a);if("XYZ"===e.order){let e=s*c,i=s*h,r=o*c,a=o*h;n[0]=l*c,n[4]=-l*h,n[8]=u,n[1]=i+r*u,n[5]=e-a*u,n[9]=-o*l,n[2]=a-e*u,n[6]=r+i*u,n[10]=s*l}else if("YXZ"===e.order){let e=l*c,i=l*h,r=u*c,a=u*h;n[0]=e+a*o,n[4]=r*o-i,n[8]=s*u,n[1]=s*h,n[5]=s*c,n[9]=-o,n[2]=i*o-r,n[6]=a+e*o,n[10]=s*l}else if("ZXY"===e.order){let e=l*c,i=l*h,r=u*c,a=u*h;n[0]=e-a*o,n[4]=-s*h,n[8]=r+i*o,n[1]=i+r*o,n[5]=s*c,n[9]=a-e*o,n[2]=-s*u,n[6]=o,n[10]=s*l}else if("ZYX"===e.order){let e=s*c,i=s*h,r=o*c,a=o*h;n[0]=l*c,n[4]=r*u-i,n[8]=e*u+a,n[1]=l*h,n[5]=a*u+e,n[9]=i*u-r,n[2]=-u,n[6]=o*l,n[10]=s*l}else if("YZX"===e.order){let e=s*l,i=s*u,r=o*l,a=o*u;n[0]=l*c,n[4]=a-e*h,n[8]=r*h+i,n[1]=h,n[5]=s*c,n[9]=-o*c,n[2]=-u*c,n[6]=i*h+r,n[10]=e-a*h}else if("XZY"===e.order){let e=s*l,i=s*u,r=o*l,a=o*u;n[0]=l*c,n[4]=-h,n[8]=u*c,n[1]=e*h+a,n[5]=s*c,n[9]=i*h-r,n[2]=r*h-i,n[6]=o*c,n[10]=a*h+e}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromQuaternion(e){return this.compose(e0,e,e1)}lookAt(e,n,i){let r=this.elements;return e4.subVectors(e,n),0===e4.lengthSq()&&(e4.z=1),e4.normalize(),e2.crossVectors(i,e4),0===e2.lengthSq()&&(1===Math.abs(i.z)?e4.x+=1e-4:e4.z+=1e-4,e4.normalize(),e2.crossVectors(i,e4)),e2.normalize(),e3.crossVectors(e4,e2),r[0]=e2.x,r[4]=e3.x,r[8]=e4.x,r[1]=e2.y,r[5]=e3.y,r[9]=e4.y,r[2]=e2.z,r[6]=e3.z,r[10]=e4.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){let i=e.elements,r=n.elements,a=this.elements,s=i[0],o=i[4],l=i[8],u=i[12],c=i[1],h=i[5],d=i[9],p=i[13],f=i[2],m=i[6],g=i[10],v=i[14],_=i[3],y=i[7],x=i[11],b=i[15],M=r[0],S=r[4],E=r[8],T=r[12],w=r[1],A=r[5],R=r[9],P=r[13],C=r[2],L=r[6],O=r[10],I=r[14],D=r[3],U=r[7],N=r[11],F=r[15];return a[0]=s*M+o*w+l*C+u*D,a[4]=s*S+o*A+l*L+u*U,a[8]=s*E+o*R+l*O+u*N,a[12]=s*T+o*P+l*I+u*F,a[1]=c*M+h*w+d*C+p*D,a[5]=c*S+h*A+d*L+p*U,a[9]=c*E+h*R+d*O+p*N,a[13]=c*T+h*P+d*I+p*F,a[2]=f*M+m*w+g*C+v*D,a[6]=f*S+m*A+g*L+v*U,a[10]=f*E+m*R+g*O+v*N,a[14]=f*T+m*P+g*I+v*F,a[3]=_*M+y*w+x*C+b*D,a[7]=_*S+y*A+x*L+b*U,a[11]=_*E+y*R+x*O+b*N,a[15]=_*T+y*P+x*I+b*F,this}multiplyScalar(e){let n=this.elements;return n[0]*=e,n[4]*=e,n[8]*=e,n[12]*=e,n[1]*=e,n[5]*=e,n[9]*=e,n[13]*=e,n[2]*=e,n[6]*=e,n[10]*=e,n[14]*=e,n[3]*=e,n[7]*=e,n[11]*=e,n[15]*=e,this}determinant(){let e=this.elements,n=e[0],i=e[4],r=e[8],a=e[12],s=e[1],o=e[5],l=e[9],u=e[13],c=e[2],h=e[6],d=e[10],p=e[14],f=e[3];return f*(+a*l*h-r*u*h-a*o*d+i*u*d+r*o*p-i*l*p)+e[7]*(+n*l*p-n*u*d+a*s*d-r*s*p+r*u*c-a*l*c)+e[11]*(+n*u*h-n*o*p-a*s*h+i*s*p+a*o*c-i*u*c)+e[15]*(-r*o*c-n*l*h+n*o*d+r*s*h-i*s*d+i*l*c)}transpose(){let e;let n=this.elements;return e=n[1],n[1]=n[4],n[4]=e,e=n[2],n[2]=n[8],n[8]=e,e=n[6],n[6]=n[9],n[9]=e,e=n[3],n[3]=n[12],n[12]=e,e=n[7],n[7]=n[13],n[13]=e,e=n[11],n[11]=n[14],n[14]=e,this}setPosition(e,n,i){let r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=n,r[14]=i),this}invert(){let e=this.elements,n=e[0],i=e[1],r=e[2],a=e[3],s=e[4],o=e[5],l=e[6],u=e[7],c=e[8],h=e[9],d=e[10],p=e[11],f=e[12],m=e[13],g=e[14],v=e[15],_=h*g*u-m*d*u+m*l*p-o*g*p-h*l*v+o*d*v,y=f*d*u-c*g*u-f*l*p+s*g*p+c*l*v-s*d*v,x=c*m*u-f*h*u+f*o*p-s*m*p-c*o*v+s*h*v,b=f*h*l-c*m*l-f*o*d+s*m*d+c*o*g-s*h*g,M=n*_+i*y+r*x+a*b;if(0===M)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let S=1/M;return e[0]=_*S,e[1]=(m*d*a-h*g*a-m*r*p+i*g*p+h*r*v-i*d*v)*S,e[2]=(o*g*a-m*l*a+m*r*u-i*g*u-o*r*v+i*l*v)*S,e[3]=(h*l*a-o*d*a-h*r*u+i*d*u+o*r*p-i*l*p)*S,e[4]=y*S,e[5]=(c*g*a-f*d*a+f*r*p-n*g*p-c*r*v+n*d*v)*S,e[6]=(f*l*a-s*g*a-f*r*u+n*g*u+s*r*v-n*l*v)*S,e[7]=(s*d*a-c*l*a+c*r*u-n*d*u-s*r*p+n*l*p)*S,e[8]=x*S,e[9]=(f*h*a-c*m*a-f*i*p+n*m*p+c*i*v-n*h*v)*S,e[10]=(s*m*a-f*o*a+f*i*u-n*m*u-s*i*v+n*o*v)*S,e[11]=(c*o*a-s*h*a-c*i*u+n*h*u+s*i*p-n*o*p)*S,e[12]=b*S,e[13]=(c*m*r-f*h*r+f*i*d-n*m*d-c*i*g+n*h*g)*S,e[14]=(f*o*r-s*m*r-f*i*l+n*m*l+s*i*g-n*o*g)*S,e[15]=(s*h*r-c*o*r+c*i*l-n*h*l-s*i*d+n*o*d)*S,this}scale(e){let n=this.elements,i=e.x,r=e.y,a=e.z;return n[0]*=i,n[4]*=r,n[8]*=a,n[1]*=i,n[5]*=r,n[9]*=a,n[2]*=i,n[6]*=r,n[10]*=a,n[3]*=i,n[7]*=r,n[11]*=a,this}getMaxScaleOnAxis(){let e=this.elements;return Math.sqrt(Math.max(e[0]*e[0]+e[1]*e[1]+e[2]*e[2],e[4]*e[4]+e[5]*e[5]+e[6]*e[6],e[8]*e[8]+e[9]*e[9]+e[10]*e[10]))}makeTranslation(e,n,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,n,0,0,1,i,0,0,0,1),this}makeRotationX(e){let n=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,n,-i,0,0,i,n,0,0,0,0,1),this}makeRotationY(e){let n=Math.cos(e),i=Math.sin(e);return this.set(n,0,i,0,0,1,0,0,-i,0,n,0,0,0,0,1),this}makeRotationZ(e){let n=Math.cos(e),i=Math.sin(e);return this.set(n,-i,0,0,i,n,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,n){let i=Math.cos(n),r=Math.sin(n),a=1-i,s=e.x,o=e.y,l=e.z,u=a*s,c=a*o;return this.set(u*s+i,u*o-r*l,u*l+r*o,0,u*o+r*l,c*o+i,c*l-r*s,0,u*l-r*o,c*l+r*s,a*l*l+i,0,0,0,0,1),this}makeScale(e,n,i){return this.set(e,0,0,0,0,n,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,n,i,r,a,s){return this.set(1,i,a,0,e,1,s,0,n,r,1,0,0,0,0,1),this}compose(e,n,i){let r=this.elements,a=n._x,s=n._y,o=n._z,l=n._w,u=a+a,c=s+s,h=o+o,d=a*u,p=a*c,f=a*h,m=s*c,g=s*h,v=o*h,_=l*u,y=l*c,x=l*h,b=i.x,M=i.y,S=i.z;return r[0]=(1-(m+v))*b,r[1]=(p+x)*b,r[2]=(f-y)*b,r[3]=0,r[4]=(p-x)*M,r[5]=(1-(d+v))*M,r[6]=(g+_)*M,r[7]=0,r[8]=(f+y)*S,r[9]=(g-_)*S,r[10]=(1-(d+m))*S,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,n,i){let r=this.elements,a=e$.set(r[0],r[1],r[2]).length(),s=e$.set(r[4],r[5],r[6]).length(),o=e$.set(r[8],r[9],r[10]).length();0>this.determinant()&&(a=-a),e.x=r[12],e.y=r[13],e.z=r[14],eQ.copy(this);let l=1/a,u=1/s,c=1/o;return eQ.elements[0]*=l,eQ.elements[1]*=l,eQ.elements[2]*=l,eQ.elements[4]*=u,eQ.elements[5]*=u,eQ.elements[6]*=u,eQ.elements[8]*=c,eQ.elements[9]*=c,eQ.elements[10]*=c,n.setFromRotationMatrix(eQ),i.x=a,i.y=s,i.z=o,this}makePerspective(e,n,i,r,a,s,o=2e3){let l,u;let c=this.elements;if(2e3===o)l=-(s+a)/(s-a),u=-2*s*a/(s-a);else if(2001===o)l=-s/(s-a),u=-s*a/(s-a);else throw Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return c[0]=2*a/(n-e),c[4]=0,c[8]=(n+e)/(n-e),c[12]=0,c[1]=0,c[5]=2*a/(i-r),c[9]=(i+r)/(i-r),c[13]=0,c[2]=0,c[6]=0,c[10]=l,c[14]=u,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,n,i,r,a,s,o=2e3){let l,u;let c=this.elements,h=1/(n-e),d=1/(i-r),p=1/(s-a);if(2e3===o)l=(s+a)*p,u=-2*p;else if(2001===o)l=a*p,u=-1*p;else throw Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return c[0]=2*h,c[4]=0,c[8]=0,c[12]=-((n+e)*h),c[1]=0,c[5]=2*d,c[9]=0,c[13]=-((i+r)*d),c[2]=0,c[6]=0,c[10]=u,c[14]=-l,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){let n=this.elements,i=e.elements;for(let e=0;e<16;e++)if(n[e]!==i[e])return!1;return!0}fromArray(e,n=0){for(let i=0;i<16;i++)this.elements[i]=e[i+n];return this}toArray(e=[],n=0){let i=this.elements;return e[n]=i[0],e[n+1]=i[1],e[n+2]=i[2],e[n+3]=i[3],e[n+4]=i[4],e[n+5]=i[5],e[n+6]=i[6],e[n+7]=i[7],e[n+8]=i[8],e[n+9]=i[9],e[n+10]=i[10],e[n+11]=i[11],e[n+12]=i[12],e[n+13]=i[13],e[n+14]=i[14],e[n+15]=i[15],e}}let e$=new eb,eQ=new eK,e0=new eb(0,0,0),e1=new eb(1,1,1),e2=new eb,e3=new eb,e4=new eb,e5=new eK,e6=new ex;class e7{constructor(e=0,n=0,i=0,r=e7.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=n,this._z=i,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,n,i,r=this._order){return this._x=e,this._y=n,this._z=i,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,n=this._order,i=!0){let r=e.elements,a=r[0],s=r[4],o=r[8],l=r[1],u=r[5],c=r[9],h=r[2],d=r[6],p=r[10];switch(n){case"XYZ":this._y=Math.asin(H(o,-1,1)),.9999999>Math.abs(o)?(this._x=Math.atan2(-c,p),this._z=Math.atan2(-s,a)):(this._x=Math.atan2(d,u),this._z=0);break;case"YXZ":this._x=Math.asin(-H(c,-1,1)),.9999999>Math.abs(c)?(this._y=Math.atan2(o,p),this._z=Math.atan2(l,u)):(this._y=Math.atan2(-h,a),this._z=0);break;case"ZXY":this._x=Math.asin(H(d,-1,1)),.9999999>Math.abs(d)?(this._y=Math.atan2(-h,p),this._z=Math.atan2(-s,u)):(this._y=0,this._z=Math.atan2(l,a));break;case"ZYX":this._y=Math.asin(-H(h,-1,1)),.9999999>Math.abs(h)?(this._x=Math.atan2(d,p),this._z=Math.atan2(l,a)):(this._x=0,this._z=Math.atan2(-s,u));break;case"YZX":this._z=Math.asin(H(l,-1,1)),.9999999>Math.abs(l)?(this._x=Math.atan2(-c,u),this._y=Math.atan2(-h,a)):(this._x=0,this._y=Math.atan2(o,p));break;case"XZY":this._z=Math.asin(-H(s,-1,1)),.9999999>Math.abs(s)?(this._x=Math.atan2(d,u),this._y=Math.atan2(o,a)):(this._x=Math.atan2(-c,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,!0===i&&this._onChangeCallback(),this}setFromQuaternion(e,n,i){return e5.makeRotationFromQuaternion(e),this.setFromRotationMatrix(e5,n,i)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return e6.setFromEuler(this),this.setFromQuaternion(e6,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}e7.DEFAULT_ORDER="XYZ";class e8{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let e=0;e1){for(let e=0;e0&&(i=i.concat(a))}return i}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(tr,e,ta),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(tr,ts,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let n=this.matrixWorld.elements;return e.set(n[8],n[9],n[10]).normalize()}raycast(){}traverse(e){e(this);let n=this.children;for(let i=0,r=n.length;i0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(r.instanceColor=this.instanceColor.toJSON())),this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=a(e.geometries,this.geometry);let n=this.geometry.parameters;if(void 0!==n&&void 0!==n.shapes){let i=n.shapes;if(Array.isArray(i))for(let n=0,r=i.length;n0){r.children=[];for(let n=0;n0){r.animations=[];for(let n=0;n0&&(i.geometries=n),r.length>0&&(i.materials=r),a.length>0&&(i.textures=a),o.length>0&&(i.images=o),l.length>0&&(i.shapes=l),u.length>0&&(i.skeletons=u),c.length>0&&(i.animations=c),h.length>0&&(i.nodes=h)}return i.object=r,i;function s(e){let n=[];for(let i in e){let r=e[i];delete r.metadata,n.push(r)}return n}}clone(e){return new this.constructor().copy(this,e)}copy(e,n=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),!0===n)for(let n=0;n0?r.multiplyScalar(1/Math.sqrt(a)):r.set(0,0,0)}static getBarycoord(e,n,i,r,a){tp.subVectors(r,n),tf.subVectors(i,n),tm.subVectors(e,n);let s=tp.dot(tp),o=tp.dot(tf),l=tp.dot(tm),u=tf.dot(tf),c=tf.dot(tm),h=s*u-o*o;if(0===h)return a.set(-2,-1,-1);let d=1/h,p=(u*l-o*c)*d,f=(s*c-o*l)*d;return a.set(1-p-f,f,p)}static containsPoint(e,n,i,r){return this.getBarycoord(e,n,i,r,tg),tg.x>=0&&tg.y>=0&&tg.x+tg.y<=1}static getUV(e,n,i,r,a,s,o,l){return!1===tS&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),tS=!0),this.getInterpolation(e,n,i,r,a,s,o,l)}static getInterpolation(e,n,i,r,a,s,o,l){return this.getBarycoord(e,n,i,r,tg),l.setScalar(0),l.addScaledVector(a,tg.x),l.addScaledVector(s,tg.y),l.addScaledVector(o,tg.z),l}static isFrontFacing(e,n,i,r){return tp.subVectors(i,n),tf.subVectors(e,n),0>tp.cross(tf).dot(r)}set(e,n,i){return this.a.copy(e),this.b.copy(n),this.c.copy(i),this}setFromPointsAndIndices(e,n,i,r){return this.a.copy(e[n]),this.b.copy(e[i]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,n,i,r){return this.a.fromBufferAttribute(e,n),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return tp.subVectors(this.c,this.b),tf.subVectors(this.a,this.b),.5*tp.cross(tf).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return tE.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return tE.getBarycoord(e,this.a,this.b,this.c,n)}getUV(e,n,i,r,a){return!1===tS&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),tS=!0),tE.getInterpolation(e,this.a,this.b,this.c,n,i,r,a)}getInterpolation(e,n,i,r,a){return tE.getInterpolation(e,this.a,this.b,this.c,n,i,r,a)}containsPoint(e){return tE.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return tE.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,n){let i,r;let a=this.a,s=this.b,o=this.c;tv.subVectors(s,a),t_.subVectors(o,a),tx.subVectors(e,a);let l=tv.dot(tx),u=t_.dot(tx);if(l<=0&&u<=0)return n.copy(a);tb.subVectors(e,s);let c=tv.dot(tb),h=t_.dot(tb);if(c>=0&&h<=c)return n.copy(s);let d=l*h-c*u;if(d<=0&&l>=0&&c<=0)return i=l/(l-c),n.copy(a).addScaledVector(tv,i);tM.subVectors(e,o);let p=tv.dot(tM),f=t_.dot(tM);if(f>=0&&p<=f)return n.copy(o);let m=p*u-l*f;if(m<=0&&u>=0&&f<=0)return r=u/(u-f),n.copy(a).addScaledVector(t_,r);let g=c*f-p*h;if(g<=0&&h-c>=0&&p-f>=0)return ty.subVectors(o,s),r=(h-c)/(h-c+(p-f)),n.copy(s).addScaledVector(ty,r);let v=1/(g+m+d);return i=m*v,r=d*v,n.copy(a).addScaledVector(tv,i).addScaledVector(t_,r)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let tT={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},tw={h:0,s:0,l:0},tA={h:0,s:0,l:0};function tR(e,n,i){return(i<0&&(i+=1),i>1&&(i-=1),i<1/6)?e+(n-e)*6*i:i<.5?n:i<2/3?e+(n-e)*6*(2/3-i):e}class tP{constructor(e,n,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,n,i)}set(e,n,i){return void 0===n&&void 0===i?e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e):this.setRGB(e,n,i),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,n=A){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,eo.toWorkingColorSpace(this,n),this}setRGB(e,n,i,r=eo.workingColorSpace){return this.r=e,this.g=n,this.b=i,eo.toWorkingColorSpace(this,r),this}setHSL(e,n,i,r=eo.workingColorSpace){if(e=V(e,1),n=H(n,0,1),i=H(i,0,1),0===n)this.r=this.g=this.b=i;else{let r=i<=.5?i*(1+n):i+n-i*n,a=2*i-r;this.r=tR(a,r,e+1/3),this.g=tR(a,r,e),this.b=tR(a,r,e-1/3)}return eo.toWorkingColorSpace(this,r),this}setStyle(e,n=A){let i;function r(n){void 0!==n&&1>parseFloat(n)&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let a;let s=i[1],o=i[2];switch(s){case"rgb":case"rgba":if(a=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return r(a[4]),this.setRGB(Math.min(255,parseInt(a[1],10))/255,Math.min(255,parseInt(a[2],10))/255,Math.min(255,parseInt(a[3],10))/255,n);if(a=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return r(a[4]),this.setRGB(Math.min(100,parseInt(a[1],10))/100,Math.min(100,parseInt(a[2],10))/100,Math.min(100,parseInt(a[3],10))/100,n);break;case"hsl":case"hsla":if(a=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return r(a[4]),this.setHSL(parseFloat(a[1])/360,parseFloat(a[2])/100,parseFloat(a[3])/100,n);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){let r=i[1],a=r.length;if(3===a)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,n);if(6===a)return this.setHex(parseInt(r,16),n);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,n);return this}setColorName(e,n=A){let i=tT[e.toLowerCase()];return void 0!==i?this.setHex(i,n):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=el(e.r),this.g=el(e.g),this.b=el(e.b),this}copyLinearToSRGB(e){return this.r=eu(e.r),this.g=eu(e.g),this.b=eu(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=A){return eo.fromWorkingColorSpace(tC.copy(this),e),65536*Math.round(H(255*tC.r,0,255))+256*Math.round(H(255*tC.g,0,255))+Math.round(H(255*tC.b,0,255))}getHexString(e=A){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=eo.workingColorSpace){let i,r;eo.fromWorkingColorSpace(tC.copy(this),n);let a=tC.r,s=tC.g,o=tC.b,l=Math.max(a,s,o),u=Math.min(a,s,o),c=(u+l)/2;if(u===l)i=0,r=0;else{let e=l-u;switch(r=c<=.5?e/(l+u):e/(2-l-u),l){case a:i=(s-o)/e+(s0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(void 0!==e)for(let n in e){let i=e[n];if(void 0===i){console.warn(`THREE.Material: parameter '${n}' has value of undefined.`);continue}let r=this[n];if(void 0===r){console.warn(`THREE.Material: '${n}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[n]=i}}toJSON(e){let n=void 0===e||"string"==typeof e;n&&(e={textures:{},images:{}});let i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};function r(e){let n=[];for(let i in e){let r=e[i];delete r.metadata,n.push(r)}return n}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),void 0!==this.roughness&&(i.roughness=this.roughness),void 0!==this.metalness&&(i.metalness=this.metalness),void 0!==this.sheen&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(i.shininess=this.shininess),void 0!==this.clearcoat&&(i.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.iridescence&&(i.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(i.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),void 0!==this.anisotropy&&(i.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(i.combine=this.combine)),void 0!==this.envMapIntensity&&(i.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(i.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(i.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(i.size=this.size),null!==this.shadowSide&&(i.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(i.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(i.blending=this.blending),this.side!==l&&(i.side=this.side),!0===this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),!0===this.transparent&&(i.transparent=!0),204!==this.blendSrc&&(i.blendSrc=this.blendSrc),205!==this.blendDst&&(i.blendDst=this.blendDst),100!==this.blendEquation&&(i.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(i.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(i.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(i.blendAlpha=this.blendAlpha),3!==this.depthFunc&&(i.depthFunc=this.depthFunc),!1===this.depthTest&&(i.depthTest=this.depthTest),!1===this.depthWrite&&(i.depthWrite=this.depthWrite),!1===this.colorWrite&&(i.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(i.stencilWriteMask=this.stencilWriteMask),519!==this.stencilFunc&&(i.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(i.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(i.stencilFuncMask=this.stencilFuncMask),7680!==this.stencilFail&&(i.stencilFail=this.stencilFail),7680!==this.stencilZFail&&(i.stencilZFail=this.stencilZFail),7680!==this.stencilZPass&&(i.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(i.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(i.rotation=this.rotation),!0===this.polygonOffset&&(i.polygonOffset=!0),0!==this.polygonOffsetFactor&&(i.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(i.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(i.linewidth=this.linewidth),void 0!==this.dashSize&&(i.dashSize=this.dashSize),void 0!==this.gapSize&&(i.gapSize=this.gapSize),void 0!==this.scale&&(i.scale=this.scale),!0===this.dithering&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),!0===this.alphaHash&&(i.alphaHash=!0),!0===this.alphaToCoverage&&(i.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(i.premultipliedAlpha=!0),!0===this.forceSinglePass&&(i.forceSinglePass=!0),!0===this.wireframe&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(i.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(i.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(i.flatShading=!0),!1===this.visible&&(i.visible=!1),!1===this.toneMapped&&(i.toneMapped=!1),!1===this.fog&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData),n){let n=r(e.textures),a=r(e.images);n.length>0&&(i.textures=n),a.length>0&&(i.images=a)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let n=e.clippingPlanes,i=null;if(null!==n){let e=n.length;i=Array(e);for(let r=0;r!==e;++r)i[r]=n[r].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){!0===e&&this.version++}}class tI extends tO{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new tP(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}let tD=new eb,tU=new Z;class tN{constructor(e,n,i=!1){if(Array.isArray(e))throw TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=n,this.count=void 0!==e?e.length/n:0,this.normalized=i,this.usage=35044,this.updateRange={offset:0,count:-1},this.gpuType=1015,this.version=0}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,n,i){e*=this.itemSize,i*=n.itemSize;for(let r=0,a=this.itemSize;r0&&(e.userData=this.userData),void 0!==this.parameters){let n=this.parameters;for(let i in n)void 0!==n[i]&&(e[i]=n[i]);return e}e.data={attributes:{}};let n=this.index;null!==n&&(e.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});let i=this.attributes;for(let n in i){let r=i[n];e.data.attributes[n]=r.toJSON(e.data)}let r={},a=!1;for(let n in this.morphAttributes){let i=this.morphAttributes[n],s=[];for(let n=0,r=i.length;n0&&(r[n]=s,a=!0)}a&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);let s=this.groups;s.length>0&&(e.data.groups=JSON.parse(JSON.stringify(s)));let o=this.boundingSphere;return null!==o&&(e.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let n={};this.name=e.name;let i=e.index;null!==i&&this.setIndex(i.clone(n));let r=e.attributes;for(let e in r){let i=r[e];this.setAttribute(e,i.clone(n))}let a=e.morphAttributes;for(let e in a){let i=[],r=a[e];for(let e=0,a=r.length;e0){let i=e[n[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,n=i.length;e(e.far-e.near)**2)||(tY.copy(a).invert(),tJ.copy(e.ray).applyMatrix4(tY),null!==i.boundingBox&&!1===tJ.intersectsBox(i.boundingBox)))return;this._computeIntersections(e,n,tJ)}}_computeIntersections(e,n,i){let r;let a=this.geometry,s=this.material,o=a.index,l=a.attributes.position,u=a.attributes.uv,c=a.attributes.uv1,h=a.attributes.normal,d=a.groups,p=a.drawRange;if(null!==o){if(Array.isArray(s))for(let a=0,l=d.length;ai.far?null:{distance:c,point:ne.clone(),object:e}}(e,n,i,r,t$,tQ,t0,t9);if(d){a&&(t3.fromBufferAttribute(a,u),t4.fromBufferAttribute(a,c),t5.fromBufferAttribute(a,h),d.uv=tE.getInterpolation(t9,t$,tQ,t0,t3,t4,t5,new Z)),s&&(t3.fromBufferAttribute(s,u),t4.fromBufferAttribute(s,c),t5.fromBufferAttribute(s,h),d.uv1=tE.getInterpolation(t9,t$,tQ,t0,t3,t4,t5,new Z),d.uv2=d.uv1),o&&(t6.fromBufferAttribute(o,u),t7.fromBufferAttribute(o,c),t8.fromBufferAttribute(o,h),d.normal=tE.getInterpolation(t9,t$,tQ,t0,t6,t7,t8,new eb),d.normal.dot(r.direction)>0&&d.normal.multiplyScalar(-1));let e={a:u,b:c,c:h,normal:new eb,materialIndex:0};tE.getNormal(t$,tQ,t0,e.normal),d.face=e}return d}class ni extends tq{constructor(e=1,n=1,i=1,r=1,a=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:n,depth:i,widthSegments:r,heightSegments:a,depthSegments:s};let o=this;r=Math.floor(r),a=Math.floor(a);let l=[],u=[],c=[],h=[],d=0,p=0;function f(e,n,i,r,a,s,f,m,g,v,_){let y=s/g,x=f/v,b=s/2,M=f/2,S=m/2,E=g+1,T=v+1,w=0,A=0,R=new eb;for(let s=0;s0?1:-1,c.push(R.x,R.y,R.z),h.push(l/g),h.push(1-s/v),w+=1}}for(let e=0;e0&&(n.defines=this.defines),n.vertexShader=this.vertexShader,n.fragmentShader=this.fragmentShader,n.lights=this.lights,n.clipping=this.clipping;let i={};for(let e in this.extensions)!0===this.extensions[e]&&(i[e]=!0);return Object.keys(i).length>0&&(n.extensions=i),n}}class nu extends td{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new eK,this.projectionMatrix=new eK,this.projectionMatrixInverse=new eK,this.coordinateSystem=2e3}copy(e,n){return super.copy(e,n),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,n){super.updateWorldMatrix(e,n),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}class nc extends nu{constructor(e=50,n=1,i=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=r,this.focus=10,this.aspect=n,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){let n=.5*this.getFilmHeight()/e;this.fov=2*B*Math.atan(n),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(.5*z*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*B*Math.atan(Math.tan(.5*z*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,n,i,r,a,s){this.aspect=e/n,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=i,this.view.offsetY=r,this.view.width=a,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,n=e*Math.tan(.5*z*this.fov)/this.zoom,i=2*n,r=this.aspect*i,a=-.5*r,s=this.view;if(null!==this.view&&this.view.enabled){let e=s.fullWidth,o=s.fullHeight;a+=s.offsetX*r/e,n-=s.offsetY*i/o,r*=s.width/e,i*=s.height/o}let o=this.filmOffset;0!==o&&(a+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(a,a+r,n,n-i,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let n=super.toJSON(e);return n.object.fov=this.fov,n.object.zoom=this.zoom,n.object.near=this.near,n.object.far=this.far,n.object.focus=this.focus,n.object.aspect=this.aspect,null!==this.view&&(n.object.view=Object.assign({},this.view)),n.object.filmGauge=this.filmGauge,n.object.filmOffset=this.filmOffset,n}}class nh extends td{constructor(e,n,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;let r=new nc(-90,1,e,n);r.layers=this.layers,this.add(r);let a=new nc(-90,1,e,n);a.layers=this.layers,this.add(a);let s=new nc(-90,1,e,n);s.layers=this.layers,this.add(s);let o=new nc(-90,1,e,n);o.layers=this.layers,this.add(o);let l=new nc(-90,1,e,n);l.layers=this.layers,this.add(l);let u=new nc(-90,1,e,n);u.layers=this.layers,this.add(u)}updateCoordinateSystem(){let e=this.coordinateSystem,n=this.children.concat(),[i,r,a,s,o,l]=n;for(let e of n)this.remove(e);if(2e3===e)i.up.set(0,1,0),i.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),a.up.set(0,0,-1),a.lookAt(0,1,0),s.up.set(0,0,1),s.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(2001===e)i.up.set(0,-1,0),i.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),a.up.set(0,0,1),a.lookAt(0,1,0),s.up.set(0,0,-1),s.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(let e of n)this.add(e),e.updateMatrixWorld()}update(e,n){null===this.parent&&this.updateMatrixWorld();let{renderTarget:i,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());let[a,s,o,l,u,c]=this.children,h=e.getRenderTarget(),d=e.getActiveCubeFace(),p=e.getActiveMipmapLevel(),f=e.xr.enabled;e.xr.enabled=!1;let m=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,r),e.render(n,a),e.setRenderTarget(i,1,r),e.render(n,s),e.setRenderTarget(i,2,r),e.render(n,o),e.setRenderTarget(i,3,r),e.render(n,l),e.setRenderTarget(i,4,r),e.render(n,u),i.texture.generateMipmaps=m,e.setRenderTarget(i,5,r),e.render(n,c),e.setRenderTarget(h,d,p),e.xr.enabled=f,i.texture.needsPMREMUpdate=!0}}class nd extends em{constructor(e,n,i,r,a,s,o,l,u,c){super(e=void 0!==e?e:[],n=void 0!==n?n:301,i,r,a,s,o,l,u,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class np extends e_{constructor(e=1,n={}){super(e,e,n),this.isWebGLCubeRenderTarget=!0;let i={width:e,height:e,depth:1};void 0!==n.encoding&&(en("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),n.colorSpace=3001===n.encoding?A:w),this.texture=new nd([i,i,i,i,i,i],n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:v}fromEquirectangularTexture(e,n){this.texture.type=n.type,this.texture.colorSpace=n.colorSpace,this.texture.generateMipmaps=n.generateMipmaps,this.texture.minFilter=n.minFilter,this.texture.magFilter=n.magFilter;let i={uniforms:{tEquirect:{value:null}},vertexShader:` +(()=>{var e={"./node_modules/interactjs/dist/interact.min.js":e=>{e.exports=function(){var e,n={};Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0,n.default=function(e){return!(!e||!e.Window)&&e instanceof e.Window};var i={};Object.defineProperty(i,"__esModule",{value:!0}),i.getWindow=function(e){return(0,n.default)(e)?e:(e.ownerDocument||e).defaultView||a.window},i.init=s,i.window=i.realWindow=void 0;var r=void 0;i.realWindow=r;var a=void 0;function s(e){i.realWindow=r=e;var n=e.document.createTextNode("");n.ownerDocument!==e.document&&"function"==typeof e.wrap&&e.wrap(n)===n&&(e=e.wrap(e)),i.window=a=e}i.window=a,"undefined"!=typeof window&&window&&s(window);var o={};function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0;var u=function(e){return!!e&&"object"===l(e)},c=function(e){return"function"==typeof e};o.default={window:function(e){return e===i.window||(0,n.default)(e)},docFrag:function(e){return u(e)&&11===e.nodeType},object:u,func:c,number:function(e){return"number"==typeof e},bool:function(e){return"boolean"==typeof e},string:function(e){return"string"==typeof e},element:function(e){if(!e||"object"!==l(e))return!1;var n=i.getWindow(e)||i.window;return/object|function/.test("undefined"==typeof Element?"undefined":l(Element))?e instanceof Element||e instanceof n.Element:1===e.nodeType&&"string"==typeof e.nodeName},plainObject:function(e){return u(e)&&!!e.constructor&&/function Object\b/.test(e.constructor.toString())},array:function(e){return u(e)&&void 0!==e.length&&c(e.splice)}};var h={};function d(e){var n=e.interaction;if("drag"===n.prepared.name){var i=n.prepared.axis;"x"===i?(n.coords.cur.page.y=n.coords.start.page.y,n.coords.cur.client.y=n.coords.start.client.y,n.coords.velocity.client.y=0,n.coords.velocity.page.y=0):"y"===i&&(n.coords.cur.page.x=n.coords.start.page.x,n.coords.cur.client.x=n.coords.start.client.x,n.coords.velocity.client.x=0,n.coords.velocity.page.x=0)}}function p(e){var n=e.iEvent,i=e.interaction;if("drag"===i.prepared.name){var r=i.prepared.axis;if("x"===r||"y"===r){var a="x"===r?"y":"x";n.page[a]=i.coords.start.page[a],n.client[a]=i.coords.start.client[a],n.delta[a]=0}}}Object.defineProperty(h,"__esModule",{value:!0}),h.default=void 0;var f={id:"actions/drag",install:function(e){var n=e.actions,i=e.Interactable,r=e.defaults;i.prototype.draggable=f.draggable,n.map.drag=f,n.methodDict.drag="draggable",r.actions.drag=f.defaults},listeners:{"interactions:before-action-move":d,"interactions:action-resume":d,"interactions:action-move":p,"auto-start:check":function(e){var n=e.interaction,i=e.interactable,r=e.buttons,a=i.options.drag;if(a&&a.enabled&&(!n.pointerIsDown||!/mouse|pointer/.test(n.pointerType)||0!=(r&i.options.drag.mouseButtons)))return e.action={name:"drag",axis:"start"===a.lockAxis?a.startAxis:a.lockAxis},!1}},draggable:function(e){return o.default.object(e)?(this.options.drag.enabled=!1!==e.enabled,this.setPerAction("drag",e),this.setOnEvents("drag",e),/^(xy|x|y|start)$/.test(e.lockAxis)&&(this.options.drag.lockAxis=e.lockAxis),/^(xy|x|y)$/.test(e.startAxis)&&(this.options.drag.startAxis=e.startAxis),this):o.default.bool(e)?(this.options.drag.enabled=e,this):this.options.drag},beforeMove:d,move:p,defaults:{startAxis:"xy",lockAxis:"xy"},getCursor:function(){return"move"},filterEventType:function(e){return 0===e.search("drag")}};h.default=f;var m={};Object.defineProperty(m,"__esModule",{value:!0}),m.default=void 0;var g={init:function(e){g.document=e.document,g.DocumentFragment=e.DocumentFragment||v,g.SVGElement=e.SVGElement||v,g.SVGSVGElement=e.SVGSVGElement||v,g.SVGElementInstance=e.SVGElementInstance||v,g.Element=e.Element||v,g.HTMLElement=e.HTMLElement||g.Element,g.Event=e.Event,g.Touch=e.Touch||v,g.PointerEvent=e.PointerEvent||e.MSPointerEvent},document:null,DocumentFragment:null,SVGElement:null,SVGSVGElement:null,SVGElementInstance:null,Element:null,HTMLElement:null,Event:null,Touch:null,PointerEvent:null};function v(){}m.default=g;var _={};Object.defineProperty(_,"__esModule",{value:!0}),_.default=void 0;var y={init:function(e){var n=m.default.Element,i=e.navigator||{};y.supportsTouch="ontouchstart"in e||o.default.func(e.DocumentTouch)&&m.default.document instanceof e.DocumentTouch,y.supportsPointerEvent=!1!==i.pointerEnabled&&!!m.default.PointerEvent,y.isIOS=/iP(hone|od|ad)/.test(i.platform),y.isIOS7=/iP(hone|od|ad)/.test(i.platform)&&/OS 7[^\d]/.test(i.appVersion),y.isIe9=/MSIE 9/.test(i.userAgent),y.isOperaMobile="Opera"===i.appName&&y.supportsTouch&&/Presto/.test(i.userAgent),y.prefixedMatchesSelector="matches"in n.prototype?"matches":"webkitMatchesSelector"in n.prototype?"webkitMatchesSelector":"mozMatchesSelector"in n.prototype?"mozMatchesSelector":"oMatchesSelector"in n.prototype?"oMatchesSelector":"msMatchesSelector",y.pEventTypes=y.supportsPointerEvent?m.default.PointerEvent===e.MSPointerEvent?{up:"MSPointerUp",down:"MSPointerDown",over:"mouseover",out:"mouseout",move:"MSPointerMove",cancel:"MSPointerCancel"}:{up:"pointerup",down:"pointerdown",over:"pointerover",out:"pointerout",move:"pointermove",cancel:"pointercancel"}:null,y.wheelEvent=m.default.document&&"onmousewheel"in m.default.document?"mousewheel":"wheel"},supportsTouch:null,supportsPointerEvent:null,isIOS7:null,isIOS:null,isIe9:null,isOperaMobile:null,prefixedMatchesSelector:null,pEventTypes:null,wheelEvent:null};_.default=y;var x={};function b(e){var n=e.parentNode;if(o.default.docFrag(n))for(;(n=n.host)&&o.default.docFrag(n););return n}function M(e,n){return i.window!==i.realWindow&&(n=n.replace(/\/deep\//g," ")),e[_.default.prefixedMatchesSelector](n)}Object.defineProperty(x,"__esModule",{value:!0}),x.closest=function(e,n){for(;o.default.element(e);){if(M(e,n))return e;e=b(e)}return null},x.getActualElement=function(e){return e.correspondingUseElement||e},x.getElementClientRect=w,x.getElementRect=function(e){var n=w(e);if(!_.default.isIOS7&&n){var r=T(i.getWindow(e));n.left+=r.x,n.right+=r.x,n.top+=r.y,n.bottom+=r.y}return n},x.getPath=function(e){for(var n=[];e;)n.push(e),e=b(e);return n},x.getScrollXY=T,x.indexOfDeepestElement=function(e){for(var n,r=[],a=0;a=(parseInt(i.getWindow(o).getComputedStyle(o).zIndex,10)||0)&&(n=a)}else n=a}}else n=a}}return n},x.matchesSelector=M,x.matchesUpTo=function(e,n,i){for(;o.default.element(e);){if(M(e,n))return!0;if((e=b(e))===i)return M(e,n)}return!1},x.nodeContains=function(e,n){if(e.contains)return e.contains(n);for(;n;){if(n===e)return!0;n=n.parentNode}return!1},x.parentNode=b,x.trySelector=function(e){return!!o.default.string(e)&&(m.default.document.querySelector(e),!0)};var S=function(e){return e.parentNode||e.host};function E(e,n){for(var i,r=[],a=e;(i=S(a))&&a!==n&&i!==a.ownerDocument;)r.unshift(a),a=i;return r}function T(e){return{x:(e=e||i.window).scrollX||e.document.documentElement.scrollLeft,y:e.scrollY||e.document.documentElement.scrollTop}}function w(e){var n=e instanceof m.default.SVGElement?e.getBoundingClientRect():e.getClientRects()[0];return n&&{left:n.left,right:n.right,top:n.top,bottom:n.bottom,width:n.width||n.right-n.left,height:n.height||n.bottom-n.top}}var A={};Object.defineProperty(A,"__esModule",{value:!0}),A.default=function(e,n){for(var i in n)e[i]=n[i];return e};var R={};function P(e,n){(null==n||n>e.length)&&(n=e.length);for(var i=0,r=Array(n);i2&&void 0!==arguments[2]?arguments[2]:function(e){return!0},a=arguments.length>3?arguments[3]:void 0;if(a=a||{},o.default.string(n)&&-1!==n.search(" ")&&(n=I(n)),o.default.array(n))return n.forEach(function(n){return e(n,i,r,a)}),a;if(o.default.object(n)&&(i=n,n=""),o.default.func(i)&&r(n))a[n]=a[n]||[],a[n].push(i);else if(o.default.array(i))for(var s=0;s1?G(n):n[0];k(r,e.page),H(r,e.client),e.timeStamp=i},F.setZeroCoords=function(e){e.page.x=0,e.page.y=0,e.client.x=0,e.client.y=0},F.touchAngle=function(e,n){var i=n+"X",r=n+"Y",a=V(e),s=a[1][i]-a[0][i];return 180*Math.atan2(a[1][r]-a[0][r],s)/Math.PI},F.touchBBox=function(e){if(!e.length)return null;var n=V(e),i=Math.min(n[0].pageX,n[1].pageX),r=Math.min(n[0].pageY,n[1].pageY),a=Math.max(n[0].pageX,n[1].pageX),s=Math.max(n[0].pageY,n[1].pageY);return{x:i,y:r,left:i,top:r,right:a,bottom:s,width:a-i,height:s-r}},F.touchDistance=function(e,n){var i=n+"X",r=n+"Y",a=V(e),s=a[0][i]-a[1][i],o=a[0][r]-a[1][r];return(0,D.default)(s,o)};var W={};function j(e,n,i){return n in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i,e}Object.defineProperty(W,"__esModule",{value:!0}),W.BaseEvent=void 0;var X=function(){function e(n){(function(e,n){if(!(e instanceof n))throw TypeError("Cannot call a class as a function")})(this,e),j(this,"immediatePropagationStopped",!1),j(this,"propagationStopped",!1),this._interaction=n}return function(e,n){for(var i=0;il.left&&d.xl.top&&d.y=l.left&&g<=l.right&&v>=l.top&&v<=l.bottom}return m&&o.default.number(c)&&(u=Math.max(0,Math.min(l.right,m.right)-Math.max(l.left,m.left))*Math.max(0,Math.min(l.bottom,m.bottom)-Math.max(l.top,m.top))/(m.width*m.height)>=c),e.options.drop.checker&&(u=e.options.drop.checker(n,i,u,e,s,r,a)),u}(this,e,n,i,r,a,s)},i.dynamicDrop=function(n){return o.default.bool(n)?(e.dynamicDrop=n,i):e.dynamicDrop},(0,A.default)(n.phaselessTypes,{dragenter:!0,dragleave:!0,dropactivate:!0,dropdeactivate:!0,dropmove:!0,drop:!0}),n.methodDict.drop="dropzone",e.dynamicDrop=!1,a.actions.drop=ec.defaults},listeners:{"interactions:before-action-start":function(e){var n=e.interaction;"drag"===n.prepared.name&&(n.dropState={cur:{dropzone:null,element:null},prev:{dropzone:null,element:null},rejected:null,events:null,activeDrops:[]})},"interactions:after-action-start":function(e,n){var i=e.interaction,r=(e.event,e.iEvent);if("drag"===i.prepared.name){var a=i.dropState;a.activeDrops=[],a.events={},a.activeDrops=ea(n,i.element),a.events=eo(i,0,r),a.events.activate&&(er(a.activeDrops,a.events.activate),n.fire("actions/drop:start",{interaction:i,dragEvent:r}))}},"interactions:action-move":eu,"interactions:after-action-move":function(e,n){var i=e.interaction,r=e.iEvent;if("drag"===i.prepared.name){var a=i.dropState;el(i,a.events),n.fire("actions/drop:move",{interaction:i,dragEvent:r}),a.events={}}},"interactions:action-end":function(e,n){if("drag"===e.interaction.prepared.name){var i=e.interaction,r=e.iEvent;eu(e,n),el(i,i.dropState.events),n.fire("actions/drop:end",{interaction:i,dragEvent:r})}},"interactions:stop":function(e){var n=e.interaction;if("drag"===n.prepared.name){var i=n.dropState;i&&(i.activeDrops=null,i.events=null,i.cur.dropzone=null,i.cur.element=null,i.prev.dropzone=null,i.prev.element=null,i.rejected=!1)}}},getActiveDrops:ea,getDrop:es,getDropEvents:eo,fireDropEvents:el,filterEventType:function(e){return 0===e.search("drag")||0===e.search("drop")},defaults:{enabled:!1,accept:null,overlap:"pointer"}};ei.default=ec;var eh={};function ed(e){var n=e.interaction,i=e.iEvent,r=e.phase;if("gesture"===n.prepared.name){var a=n.pointers.map(function(e){return e.pointer}),s=n.interactable.options.deltaSource;if(i.touches=[a[0],a[1]],"start"===r)i.distance=F.touchDistance(a,s),i.box=F.touchBBox(a),i.scale=1,i.ds=0,i.angle=F.touchAngle(a,s),i.da=0,n.gesture.startDistance=i.distance,n.gesture.startAngle=i.angle;else if("end"===r||n.pointers.length<2){var l=n.prevEvent;i.distance=l.distance,i.box=l.box,i.scale=l.scale,i.ds=0,i.angle=l.angle,i.da=0}else i.distance=F.touchDistance(a,s),i.box=F.touchBBox(a),i.scale=i.distance/n.gesture.startDistance,i.angle=F.touchAngle(a,s),i.ds=i.scale-n.gesture.scale,i.da=i.angle-n.gesture.angle;n.gesture.distance=i.distance,n.gesture.angle=i.angle,o.default.number(i.scale)&&i.scale!==1/0&&!isNaN(i.scale)&&(n.gesture.scale=i.scale)}}Object.defineProperty(eh,"__esModule",{value:!0}),eh.default=void 0;var ep={id:"actions/gesture",before:["actions/drag","actions/resize"],install:function(e){var n=e.actions,i=e.Interactable,r=e.defaults;i.prototype.gesturable=function(e){return o.default.object(e)?(this.options.gesture.enabled=!1!==e.enabled,this.setPerAction("gesture",e),this.setOnEvents("gesture",e),this):o.default.bool(e)?(this.options.gesture.enabled=e,this):this.options.gesture},n.map.gesture=ep,n.methodDict.gesture="gesturable",r.actions.gesture=ep.defaults},listeners:{"interactions:action-start":ed,"interactions:action-move":ed,"interactions:action-end":ed,"interactions:new":function(e){e.interaction.gesture={angle:0,distance:0,scale:1,startAngle:0,startDistance:0}},"auto-start:check":function(e){if(!(e.interaction.pointers.length<2)){var n=e.interactable.options.gesture;if(n&&n.enabled)return e.action={name:"gesture"},!1}}},defaults:{},getCursor:function(){return""},filterEventType:function(e){return 0===e.search("gesture")}};eh.default=ep;var ef={};function em(e){var n=e.iEvent,i=e.interaction;"resize"===i.prepared.name&&i.resizeAxes&&(i.interactable.options.resize.square?("y"===i.resizeAxes?n.delta.x=n.delta.y:n.delta.y=n.delta.x,n.axes="xy"):(n.axes=i.resizeAxes,"x"===i.resizeAxes?n.delta.y=0:"y"===i.resizeAxes&&(n.delta.x=0)))}Object.defineProperty(ef,"__esModule",{value:!0}),ef.default=void 0;var eg={id:"actions/resize",before:["actions/drag"],install:function(e){var n=e.actions,i=e.browser,r=e.Interactable,a=e.defaults;eg.cursors=i.isIe9?{x:"e-resize",y:"s-resize",xy:"se-resize",top:"n-resize",left:"w-resize",bottom:"s-resize",right:"e-resize",topleft:"se-resize",bottomright:"se-resize",topright:"ne-resize",bottomleft:"ne-resize"}:{x:"ew-resize",y:"ns-resize",xy:"nwse-resize",top:"ns-resize",left:"ew-resize",bottom:"ns-resize",right:"ew-resize",topleft:"nwse-resize",bottomright:"nwse-resize",topright:"nesw-resize",bottomleft:"nesw-resize"},eg.defaultMargin=i.supportsTouch||i.supportsPointerEvent?20:10,r.prototype.resizable=function(n){return o.default.object(n)?(this.options.resize.enabled=!1!==n.enabled,this.setPerAction("resize",n),this.setOnEvents("resize",n),o.default.string(n.axis)&&/^x$|^y$|^xy$/.test(n.axis)?this.options.resize.axis=n.axis:null===n.axis&&(this.options.resize.axis=e.defaults.actions.resize.axis),o.default.bool(n.preserveAspectRatio)?this.options.resize.preserveAspectRatio=n.preserveAspectRatio:o.default.bool(n.square)&&(this.options.resize.square=n.square),this):o.default.bool(n)?(this.options.resize.enabled=n,this):this.options.resize},n.map.resize=eg,n.methodDict.resize="resizable",a.actions.resize=eg.defaults},listeners:{"interactions:new":function(e){e.interaction.resizeAxes="xy"},"interactions:action-start":function(e){(function(e){var n=e.iEvent,i=e.interaction;if("resize"===i.prepared.name&&i.prepared.edges){var r=i.rect;i._rects={start:(0,A.default)({},r),corrected:(0,A.default)({},r),previous:(0,A.default)({},r),delta:{left:0,right:0,width:0,top:0,bottom:0,height:0}},n.edges=i.prepared.edges,n.rect=i._rects.corrected,n.deltaRect=i._rects.delta}})(e),em(e)},"interactions:action-move":function(e){(function(e){var n=e.iEvent,i=e.interaction;if("resize"===i.prepared.name&&i.prepared.edges){var r=i.interactable.options.resize.invert,a=i.rect,s=i._rects,o=s.start,l=s.corrected,u=s.delta,c=s.previous;if((0,A.default)(c,l),"reposition"===r||"negate"===r){if((0,A.default)(l,a),"reposition"===r){if(l.top>l.bottom){var h=l.top;l.top=l.bottom,l.bottom=h}if(l.left>l.right){var d=l.left;l.left=l.right,l.right=d}}}else l.top=Math.min(a.top,o.bottom),l.bottom=Math.max(a.bottom,o.top),l.left=Math.min(a.left,o.right),l.right=Math.max(a.right,o.left);for(var p in l.width=l.right-l.left,l.height=l.bottom-l.top,l)u[p]=l[p]-c[p];n.edges=i.prepared.edges,n.rect=l,n.deltaRect=u}})(e),em(e)},"interactions:action-end":function(e){var n=e.iEvent,i=e.interaction;"resize"===i.prepared.name&&i.prepared.edges&&(n.edges=i.prepared.edges,n.rect=i._rects.corrected,n.deltaRect=i._rects.delta)},"auto-start:check":function(e){var n=e.interaction,i=e.interactable,r=e.element,a=e.rect,s=e.buttons;if(a){var l=(0,A.default)({},n.coords.cur.page),u=i.options.resize;if(u&&u.enabled&&(!n.pointerIsDown||!/mouse|pointer/.test(n.pointerType)||0!=(s&u.mouseButtons))){if(o.default.object(u.edges)){var c={left:!1,right:!1,top:!1,bottom:!1};for(var h in c)c[h]=function(e,n,i,r,a,s,l){if(!n)return!1;if(!0===n){var u=o.default.number(s.width)?s.width:s.right-s.left,c=o.default.number(s.height)?s.height:s.bottom-s.top;if(l=Math.min(l,Math.abs(("left"===e||"right"===e?u:c)/2)),u<0&&("left"===e?e="right":"right"===e&&(e="left")),c<0&&("top"===e?e="bottom":"bottom"===e&&(e="top")),"left"===e){var h=u>=0?s.left:s.right;return i.x=0?s.top:s.bottom;return i.y(u>=0?s.right:s.left)-l;if("bottom"===e)return i.y>(c>=0?s.bottom:s.top)-l}return!!o.default.element(r)&&(o.default.element(n)?n===r:x.matchesUpTo(r,n,a))}(h,u.edges[h],l,n._latestPointer.eventTarget,r,a,u.margin||eg.defaultMargin);c.left=c.left&&!c.right,c.top=c.top&&!c.bottom,(c.left||c.right||c.top||c.bottom)&&(e.action={name:"resize",edges:c})}else{var d="y"!==u.axis&&l.x>a.right-eg.defaultMargin,p="x"!==u.axis&&l.y>a.bottom-eg.defaultMargin;(d||p)&&(e.action={name:"resize",axes:(d?"x":"")+(p?"y":"")})}return!e.action&&void 0}}}},defaults:{square:!1,preserveAspectRatio:!1,axis:"xy",margin:NaN,edges:null,invert:"none"},cursors:null,getCursor:function(e){var n=e.edges,i=e.axis,r=e.name,a=eg.cursors,s=null;if(i)s=a[r+i];else if(n){for(var o="",l=["top","bottom","left","right"],u=0;u=1){var h={x:eS.x*c,y:eS.y*c};if(h.x||h.y){var d=eT(s);o.default.window(s)?s.scrollBy(h.x,h.y):s&&(s.scrollLeft+=h.x,s.scrollTop+=h.y);var p=eT(s),f={x:p.x-d.x,y:p.y-d.y};(f.x||f.y)&&n.fire({type:"autoscroll",target:i,interactable:n,delta:f,interaction:e,container:s})}eS.prevTime=l}eS.isScrolling&&(e_.default.cancel(eS.i),eS.i=e_.default.request(eS.scroll))},check:function(e,n){var i;return null==(i=e.options[n].autoScroll)?void 0:i.enabled},onInteractionMove:function(e){var n=e.interaction,i=e.pointer;if(n.interacting()&&eS.check(n.interactable,n.prepared.name)){if(n.simulation)eS.x=eS.y=0;else{var r,a,s,l,u=n.interactable,c=n.element,h=n.prepared.name,d=u.options[h].autoScroll,p=eE(d.container,u,c);if(o.default.window(p))l=i.clientXp.innerWidth-eS.margin,s=i.clientY>p.innerHeight-eS.margin;else{var f=x.getElementClientRect(p);l=i.clientXf.right-eS.margin,s=i.clientY>f.bottom-eS.margin}eS.x=a?1:l?-1:0,eS.y=s?1:r?-1:0,eS.isScrolling||(eS.margin=d.margin,eS.speed=d.speed,eS.start(n))}}}};function eE(e,n,r){return(o.default.string(e)?(0,R.getStringOptionResult)(e,n,r):e)||(0,i.getWindow)(r)}function eT(e){return o.default.window(e)&&(e=window.document.body),{x:e.scrollLeft,y:e.scrollTop}}var ew={id:"auto-scroll",install:function(e){var n=e.defaults,i=e.actions;e.autoScroll=eS,eS.now=function(){return e.now()},i.phaselessTypes.autoscroll=!0,n.perAction.autoScroll=eS.defaults},listeners:{"interactions:new":function(e){e.interaction.autoScroll=null},"interactions:destroy":function(e){e.interaction.autoScroll=null,eS.stop(),eS.interaction&&(eS.interaction=null)},"interactions:stop":eS.stop,"interactions:action-move":function(e){return eS.onInteractionMove(e)}}};eM.default=ew;var eA={};Object.defineProperty(eA,"__esModule",{value:!0}),eA.copyAction=function(e,n){return e.name=n.name,e.axis=n.axis,e.edges=n.edges,e},eA.sign=void 0,eA.warnOnce=function(e,n){var r=!1;return function(){return r||(i.window.console.warn(n),r=!0),e.apply(this,arguments)}},eA.sign=function(e){return e>=0?1:-1};var eR={};function eP(e){return o.default.bool(e)?(this.options.styleCursor=e,this):null===e?(delete this.options.styleCursor,this):this.options.styleCursor}function eC(e){return o.default.func(e)?(this.options.actionChecker=e,this):null===e?(delete this.options.actionChecker,this):this.options.actionChecker}Object.defineProperty(eR,"__esModule",{value:!0}),eR.default=void 0,eR.default={id:"auto-start/interactableMethods",install:function(e){var n=e.Interactable;n.prototype.getAction=function(n,i,r,a){var s,o,l=(s=this.getRect(a),o={action:null,interactable:this,interaction:r,element:a,rect:s,buttons:i.buttons||({0:1,1:4,3:8,4:16})[i.button]},e.fire("auto-start:check",o),o.action);return this.options.actionChecker?this.options.actionChecker(n,i,l,this,a,r):l},n.prototype.ignoreFrom=(0,eA.warnOnce)(function(e){return this._backCompatOption("ignoreFrom",e)},"Interactable.ignoreFrom() has been deprecated. Use Interactble.draggable({ignoreFrom: newValue})."),n.prototype.allowFrom=(0,eA.warnOnce)(function(e){return this._backCompatOption("allowFrom",e)},"Interactable.allowFrom() has been deprecated. Use Interactble.draggable({allowFrom: newValue})."),n.prototype.actionChecker=eC,n.prototype.styleCursor=eP}};var eL={};function eO(e,n,i,r,a){return n.testIgnoreAllow(n.options[e.name],i,r)&&n.options[e.name].enabled&&eU(n,i,e,a)?e:null}function eI(e,n,i,r,a){var s=[],l=[],u=r;function c(e){s.push(e),l.push(u)}for(;o.default.element(u);){s=[],l=[],a.interactables.forEachMatch(u,c);var h=function(e,n,i,r,a,s,o){for(var l=0,u=r.length;l=l||p.interactable===e&&((c+=f===i.name?1:0)>=s||p.element===n&&(h++,f===i.name&&h>=o))))return!1}return l>0}function eN(e,n){return o.default.number(e)?(n.autoStart.maxInteractions=e,this):n.autoStart.maxInteractions}function eF(e,n,i){var r=i.autoStart.cursorElement;r&&r!==e&&(r.style.cursor=""),e.ownerDocument.documentElement.style.cursor=n,e.style.cursor=n,i.autoStart.cursorElement=n?e:null}function ez(e,n){var i=e.interactable,r=e.element,a=e.prepared;if("mouse"===e.pointerType&&i&&i.options.styleCursor){var s="";if(a.name){var l=i.options[a.name].cursorChecker;s=o.default.func(l)?l(a,i,r,e._interacting):n.actions.map[a.name].getCursor(a)}eF(e.element,s||"",n)}else n.autoStart.cursorElement&&eF(n.autoStart.cursorElement,"",n)}Object.defineProperty(eL,"__esModule",{value:!0}),eL.default=void 0,eL.default={id:"auto-start/base",before:["actions"],install:function(e){var n=e.interactStatic,i=e.defaults;e.usePlugin(eR.default),i.base.actionChecker=null,i.base.styleCursor=!0,(0,A.default)(i.perAction,{manualStart:!1,max:1/0,maxPerElement:1,allowFrom:null,ignoreFrom:null,mouseButtons:1}),n.maxInteractions=function(n){return eN(n,e)},e.autoStart={maxInteractions:1/0,withinInteractionLimit:eU,cursorElement:null}},listeners:{"interactions:down":function(e,n){var i=e.interaction,r=e.pointer,a=e.event,s=e.eventTarget;i.interacting()||eD(i,eI(i,r,a,s,n),n)},"interactions:move":function(e,n){var i,r,a,s;i=e.interaction,r=e.pointer,a=e.event,s=e.eventTarget,"mouse"!==i.pointerType||i.pointerIsDown||i.interacting()||eD(i,eI(i,r,a,s,n),n),function(e,n){var i=e.interaction;if(i.pointerIsDown&&!i.interacting()&&i.pointerWasMoved&&i.prepared.name){n.fire("autoStart:before-start",e);var r=i.interactable,a=i.prepared.name;a&&r&&(r.options[a].manualStart||!eU(r,i.element,i.prepared,n)?i.stop():(i.start(i.prepared,r,i.element),ez(i,n)))}}(e,n)},"interactions:stop":function(e,n){var i=e.interaction,r=i.interactable;r&&r.options.styleCursor&&eF(i.element,"",n)}},maxInteractions:eN,withinInteractionLimit:eU,validateAction:eO};var eB={};Object.defineProperty(eB,"__esModule",{value:!0}),eB.default=void 0,eB.default={id:"auto-start/dragAxis",listeners:{"autoStart:before-start":function(e,n){var i=e.interaction,r=e.eventTarget,a=e.dx,s=e.dy;if("drag"===i.prepared.name){var l=Math.abs(a),u=Math.abs(s),c=i.interactable.options.drag,h=c.startAxis,d=l>u?"x":l0&&(n.autoStartHoldTimer=setTimeout(function(){n.start(n.prepared,n.interactable,n.element)},i))},"interactions:move":function(e){var n=e.interaction,i=e.duplicate;n.autoStartHoldTimer&&n.pointerWasMoved&&!i&&(clearTimeout(n.autoStartHoldTimer),n.autoStartHoldTimer=null)},"autoStart:before-start":function(e){var n=e.interaction;eH(n)>0&&(n.prepared.name=null)}},getHoldDuration:eH};var eV={};Object.defineProperty(eV,"__esModule",{value:!0}),eV.default=void 0,eV.default={id:"auto-start",install:function(e){e.usePlugin(eL.default),e.usePlugin(ek.default),e.usePlugin(eB.default)}};var eG={};function eW(e){return/^(always|never|auto)$/.test(e)?(this.options.preventDefault=e,this):o.default.bool(e)?(this.options.preventDefault=e?"always":"never",this):this.options.preventDefault}function ej(e){var n=e.interaction,i=e.event;n.interactable&&n.interactable.checkAndPreventDefault(i)}function eX(e){var n=e.Interactable;n.prototype.preventDefault=eW,n.prototype.checkAndPreventDefault=function(n){return function(e,n,r){var a=e.options.preventDefault;if("never"!==a){if("always"!==a){if(n.events.supportsPassive&&/^touch(start|move)$/.test(r.type)){var s=(0,i.getWindow)(r.target).document,l=n.getDocOptions(s);if(!l||!l.events||!1!==l.events.passive)return}/^(mouse|pointer|touch)*(down|start)/i.test(r.type)||o.default.element(r.target)&&(0,x.matchesSelector)(r.target,"input,select,textarea,[contenteditable=true],[contenteditable=true] *")||r.preventDefault()}else r.preventDefault()}}(this,e,n)},e.interactions.docEvents.push({type:"dragstart",listener:function(n){for(var i=0;ie.length)&&(n=e.length);for(var i=0,r=Array(n);i150)return null;var n=180*Math.atan2(e.prevEvent.velocityY,e.prevEvent.velocityX)/Math.PI;n<0&&(n+=360);var i=112.5<=n&&n<247.5,r=202.5<=n&&n<337.5;return{up:r,down:!r&&22.5<=n&&n<157.5,left:i,right:!i&&(292.5<=n||n<67.5),angle:n,speed:e.prevEvent.speed,velocity:{x:e.prevEvent.velocityX,y:e.prevEvent.velocityY}}}},{key:"preventDefault",value:function(){}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}}],function(e,n){for(var i=0;ithis.pointerMoveTolerance);var o=this.getPointerIndex(e),l={pointer:e,pointerIndex:o,pointerInfo:this.pointers[o],event:n,type:"move",eventTarget:i,dx:r,dy:a,duplicate:s,interaction:this};s||F.setCoordVelocity(this.coords.velocity,this.coords.delta),this._scopeFire("interactions:move",l),s||this.simulation||(this.interacting()&&(l.type=null,this.move(l)),this.pointerWasMoved&&F.copyCoords(this.coords.prev,this.coords.cur))}},{key:"move",value:function(e){e&&e.event||F.setZeroCoords(this.coords.delta),(e=(0,A.default)({pointer:this._latestPointer.pointer,event:this._latestPointer.event,eventTarget:this._latestPointer.eventTarget,interaction:this},e||{})).phase="move",this._doPhase(e)}},{key:"pointerUp",value:function(e,n,i,r){var a=this.getPointerIndex(e);-1===a&&(a=this.updatePointer(e,n,i,!1));var s=/cancel$/i.test(n.type)?"cancel":"up";this._scopeFire("interactions:".concat(s),{pointer:e,pointerIndex:a,pointerInfo:this.pointers[a],event:n,eventTarget:i,type:s,curEventTarget:r,interaction:this}),this.simulation||this.end(n),this.removePointer(e,n)}},{key:"documentBlur",value:function(e){this.end(e),this._scopeFire("interactions:blur",{event:e,type:"blur",interaction:this})}},{key:"end",value:function(e){var n;this._ending=!0,e=e||this._latestPointer.event,this.interacting()&&(n=this._doPhase({event:e,interaction:this,phase:"end"})),this._ending=!1,!0===n&&this.stop()}},{key:"currentAction",value:function(){return this._interacting?this.prepared.name:null}},{key:"interacting",value:function(){return this._interacting}},{key:"stop",value:function(){this._scopeFire("interactions:stop",{interaction:this}),this.interactable=this.element=null,this._interacting=!1,this._stopped=!0,this.prepared.name=this.prevEvent=null}},{key:"getPointerIndex",value:function(e){var n=F.getPointerId(e);return"mouse"===this.pointerType||"pen"===this.pointerType?this.pointers.length-1:q.findIndex(this.pointers,function(e){return e.id===n})}},{key:"getPointerInfo",value:function(e){return this.pointers[this.getPointerIndex(e)]}},{key:"updatePointer",value:function(e,n,i,r){var a=F.getPointerId(e),s=this.getPointerIndex(e),o=this.pointers[s];return r=!1!==r&&(r||/(down|start)$/i.test(n.type)),o?o.pointer=e:(o=new ts.PointerInfo(a,e,n,null,null),s=this.pointers.length,this.pointers.push(o)),F.setCoords(this.coords.cur,this.pointers.map(function(e){return e.pointer}),this._now()),F.setCoordDeltas(this.coords.delta,this.coords.prev,this.coords.cur),r&&(this.pointerIsDown=!0,o.downTime=this.coords.cur.timeStamp,o.downTarget=i,F.pointerExtend(this.downPointer,e),this.interacting()||(F.copyCoords(this.coords.start,this.coords.cur),F.copyCoords(this.coords.prev,this.coords.cur),this.downEvent=n,this.pointerWasMoved=!1)),this._updateLatestPointer(e,n,i),this._scopeFire("interactions:update-pointer",{pointer:e,event:n,eventTarget:i,down:r,pointerInfo:o,pointerIndex:s,interaction:this}),s}},{key:"removePointer",value:function(e,n){var i=this.getPointerIndex(e);if(-1!==i){var r=this.pointers[i];this._scopeFire("interactions:remove-pointer",{pointer:e,event:n,eventTarget:null,pointerIndex:i,pointerInfo:r,interaction:this}),this.pointers.splice(i,1),this.pointerIsDown=!1}}},{key:"_updateLatestPointer",value:function(e,n,i){this._latestPointer.pointer=e,this._latestPointer.event=n,this._latestPointer.eventTarget=i}},{key:"destroy",value:function(){this._latestPointer.pointer=null,this._latestPointer.event=null,this._latestPointer.eventTarget=null}},{key:"_createPreparedEvent",value:function(e,n,i,r){return new e9.InteractEvent(this,e,this.prepared.name,n,this.element,i,r)}},{key:"_fireEvent",value:function(e){var n;null==(n=this.interactable)||n.fire(e),(!this.prevEvent||e.timeStamp>=this.prevEvent.timeStamp)&&(this.prevEvent=e)}},{key:"_doPhase",value:function(e){var n=e.event,i=e.phase,r=e.preEnd,a=e.type,s=this.rect;if(s&&"move"===i&&(R.addEdges(this.edges,s,this.coords.delta[this.interactable.options.deltaSource]),s.width=s.right-s.left,s.height=s.bottom-s.top),!1===this._scopeFire("interactions:before-action-".concat(i),e))return!1;var o=e.iEvent=this._createPreparedEvent(n,i,r,a);return this._scopeFire("interactions:action-".concat(i),e),"start"===i&&(this.prevEvent=o),this._fireEvent(o),this._scopeFire("interactions:after-action-".concat(i),e),!0}},{key:"_now",value:function(){return Date.now()}}],function(e,n){for(var i=0;ii.minSpeed&&a>i.endSpeed)this.startInertia();else{if(s.result=s.setAll(this.modifierArg),!s.result.changed)return!1;this.startSmoothEnd()}return n.modification.result.rect=null,n.offsetBy(this.targetOffset),n._doPhase({interaction:n,event:e,phase:"inertiastart"}),n.offsetBy({x:-this.targetOffset.x,y:-this.targetOffset.y}),n.modification.result.rect=null,this.active=!0,n.simulation=this,!0}},{key:"startInertia",value:function(){var e=this,n=this.interaction.coords.velocity.client,i=tP(this.interaction),r=i.resistance,a=-Math.log(i.endSpeed/this.v0)/r;this.targetOffset={x:(n.x-a)/r,y:(n.y-a)/r},this.te=a,this.lambda_v0=r/this.v0,this.one_ve_v0=1-i.endSpeed/this.v0;var s=this.modification,o=this.modifierArg;o.pageCoords={x:this.startCoords.x+this.targetOffset.x,y:this.startCoords.y+this.targetOffset.y},s.result=s.setAll(o),s.result.changed&&(this.isModified=!0,this.modifiedOffset={x:this.targetOffset.x+s.result.delta.x,y:this.targetOffset.y+s.result.delta.y}),this.onNextFrame(function(){return e.inertiaTick()})}},{key:"startSmoothEnd",value:function(){var e=this;this.smoothEnd=!0,this.isModified=!0,this.targetOffset={x:this.modification.result.delta.x,y:this.modification.result.delta.y},this.onNextFrame(function(){return e.smoothEndTick()})}},{key:"onNextFrame",value:function(e){var n=this;this.timeout=e_.default.request(function(){n.active&&e()})}},{key:"inertiaTick",value:function(){var e,n,i,r,a=this,s=this.interaction,o=tP(s).resistance,l=(s._now()-this.t0)/1e3;if(l=0;i--){var r=n[i],a=r.selector,s=r.context,l=r.listeners;a===this.target&&s===this._context&&n.splice(i,1);for(var u=l.length-1;u>=0;u--)this._scopeEvents.removeDelegate(this.target,this._context,e,l[u][0],l[u][1])}else this._scopeEvents.remove(this.target,"all")}}],function(e,n){for(var i=0;ie.length)&&(n=e.length);for(var i=0,r=Array(n);i=0;o--){var f=d[o];if(f.selector===e&&f.context===n){for(var m=f.listeners,g=m.length-1;g>=0;g--){var v=m[g];if(v.func===a&&tK(v.options,l)){m.splice(g,1),m.length||(d.splice(o,1),u(n,i,c),u(n,i,h,!0)),p=!0;break}}if(p)break}}},delegateListener:c,delegateUseCapture:h,delegatedEvents:r,documents:a,targets:i,supportsOptions:!1,supportsPassive:!1};function l(e,n,r,a){if(e.addEventListener){var o=tZ(a),l=q.find(i,function(n){return n.eventTarget===e});l||(l={eventTarget:e,events:{}},i.push(l)),l.events[n]||(l.events[n]=[]),q.find(l.events[n],function(e){return e.func===r&&tK(e.options,o)})||(e.addEventListener(n,r,s.supportsOptions?o:o.capture),l.events[n].push({func:r,options:o}))}}function u(e,n,r,a){if(e.addEventListener&&e.removeEventListener){var o=q.findIndex(i,function(n){return n.eventTarget===e}),l=i[o];if(l&&l.events){if("all"!==n){var c=!1,h=l.events[n];if(h){if("all"===r){for(var d=h.length-1;d>=0;d--){var p=h[d];u(e,n,p.func,p.options)}return}for(var f=tZ(a),m=0;m=2)continue;if(!a.interacting()&&n===a.pointerType)return a}return null}};function t0(e,n){return e.pointers.some(function(e){return e.id===n})}t$.default=tQ;var t1={};function t2(e){return(t2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function t3(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var r,a,s=[],o=!0,l=!1;try{for(i=i.call(e);!(o=(r=i.next()).done)&&(s.push(r.value),!n||s.length!==n);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==i.return||i.return()}finally{if(l)throw a}}return s}}(e,n)||function(e,n){if(e){if("string"==typeof e)return t4(e,n);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?t4(e,n):void 0}}(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function t4(e,n){(null==n||n>e.length)&&(n=e.length);for(var i=0,r=Array(n);i=0;r--){var a=n.interactions.list[r];a.interactable===i&&(a.stop(),n.fire("interactions:destroy",{interaction:a}),a.destroy(),n.interactions.list.length>2&&n.interactions.list.splice(r,1))}}},onDocSignal:ne,doOnInteractions:t8,methodNames:t7};var nt={};function nn(e){return(nn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ni(){return(ni="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,n,i){var r=function(e,n){for(;!Object.prototype.hasOwnProperty.call(e,n)&&null!==(e=na(e)););return e}(e,n);if(r){var a=Object.getOwnPropertyDescriptor(r,n);return a.get?a.get.call(arguments.length<3?e:i):a.value}}).apply(this,arguments)}function nr(e,n){return(nr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,n){return e.__proto__=n,e})(e,n)}function na(e){return(na=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ns(e,n){if(!(e instanceof n))throw TypeError("Cannot call a class as a function")}function no(e,n){for(var i=0;ie.length)&&(n=e.length);for(var i=0,r=Array(n);iMath.abs(c.y),u.coords,u.rect),(0,A.default)(r,u.coords)),u.eventProps},defaults:{ratio:"preserve",equalDelta:!1,modifiers:[],enabled:!1}};function nR(e,n,i){var r=e.startCoords,a=e.edgeSign;n?i.y=r.y+(i.x-r.x)*a.y:i.x=r.x+(i.y-r.y)*a.x}function nP(e,n,i,r){var a=e.startRect,s=e.startCoords,o=e.ratio,l=e.edgeSign;if(n){var u=r.width/o;i.y=s.y+(u-a.height)*l.y}else{var c=r.height*o;i.x=s.x+(c-a.width)*l.x}}nE.aspectRatio=nA;var nC=(0,e6.makeModifier)(nA,"aspectRatio");nE.default=nC;var nL={};Object.defineProperty(nL,"__esModule",{value:!0}),nL.default=void 0;var nO=function(){};nO._defaults={},nL.default=nO;var nI={};Object.defineProperty(nI,"__esModule",{value:!0}),Object.defineProperty(nI,"default",{enumerable:!0,get:function(){return nL.default}});var nD={};function nU(e,n,i){return o.default.func(e)?R.resolveRectLike(e,n.interactable,n.element,[i.x,i.y,n]):R.resolveRectLike(e,n.interactable,n.element)}Object.defineProperty(nD,"__esModule",{value:!0}),nD.default=void 0,nD.getRestrictionRect=nU,nD.restrict=void 0;var nN={start:function(e){var n=e.rect,i=e.startOffset,r=e.state,a=e.interaction,s=e.pageCoords,o=r.options,l=o.elementRect,u=(0,A.default)({left:0,top:0,right:0,bottom:0},o.offset||{});if(n&&l){var c=nU(o.restriction,a,s);if(c){var h=c.right-c.left-n.width,d=c.bottom-c.top-n.height;h<0&&(u.left+=h,u.right+=h),d<0&&(u.top+=d,u.bottom+=d)}u.left+=i.left-n.width*l.left,u.top+=i.top-n.height*l.top,u.right+=i.right-n.width*(1-l.right),u.bottom+=i.bottom-n.height*(1-l.bottom)}r.offset=u},set:function(e){var n=e.coords,i=e.interaction,r=e.state,a=r.options,s=r.offset,o=nU(a.restriction,i,n);if(o){var l=R.xywhToTlbr(o);n.x=Math.max(Math.min(l.right-s.right,n.x),l.left+s.left),n.y=Math.max(Math.min(l.bottom-s.bottom,n.y),l.top+s.top)}},defaults:{restriction:null,elementRect:null,offset:null,endOnly:!1,enabled:!1}};nD.restrict=nN;var nF=(0,e6.makeModifier)(nN,"restrict");nD.default=nF;var nz={};Object.defineProperty(nz,"__esModule",{value:!0}),nz.restrictEdges=nz.default=void 0;var nB={top:1/0,left:1/0,bottom:-1/0,right:-1/0},nk={top:-1/0,left:-1/0,bottom:1/0,right:1/0};function nH(e,n){for(var i=["top","left","bottom","right"],r=0;re.length)&&(n=e.length);for(var i=0,r=Array(n);i{"use strict";i.d(n,{Z:()=>r});let r={crush:(e,n=50)=>{let i=[];for(let e=127;--e;)(e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||"-_.!~*'()".includes(String.fromCharCode(e)))&&i.push(String.fromCharCode(e));for(let e=32;e<255;++e){let n=String.fromCharCode(e);"\\"==n||i.includes(n)||i.unshift(n)}let r=((e,i)=>{let r=i.length,a="",s=e=>encodeURI(encodeURIComponent(e)).replace(/%../g,"i").length,o=e=>{let n=e.charCodeAt(0),i=e.charCodeAt(e.length-1);return n>=56320&&n<=57343||i>=55296&&i<=56319},l={};for(let i=2;i=0;++a)s=e.indexOf(r,s+i);a>1&&(l[r]=a)}for(;;){let n;for(;r--&&e.includes(i[r]););if(r<0)break;let o=i[r],u=0,c=s(o);for(let e in l){let i=l[e],r=(i-1)*s(e)-(i+1)*c;a.length||(r-=s("\x01")),r<=0?delete l[e]:r>u&&(n=e,u=r)}if(!n)break;e=e.split(n).join(o)+o+n,a=o+a;let h={};for(let i in l){let r=i.split(n).join(o),a=0;for(let n=e.indexOf(r);n>=0;++a)n=e.indexOf(r,n+r.length);a>1&&(h[r]=a)}l=h}return{a:e,b:a}})(e=a(e=e.replace(RegExp("\x01","g"),"")),i),s=r.a;return r.b.length&&(s+="\x01"+r.b),s+="_"},uncrush:e=>{let n=(e=e.substring(0,e.length-1)).split("\x01"),i=n[0];if(n.length>1)for(let e of n[1]){let n=i.split(e);i=n.join(n.pop())}return a(i,0)}},a=(e,n=1)=>{let i=[['"',"'"],["':","!"],[",'","~"],["}",")","\\","\\"],["{","(","\\","\\"]],r=(e,n)=>{let i=RegExp(`${(n[2]?n[2]:"")+n[0]}|${(n[3]?n[3]:"")+n[1]}`,"g");return e.replace(i,e=>e===n[0]?n[1]:n[0])};if(n)for(let n=0;n{"use strict";let r,a,s,o;i.d(n,{BbS:()=>s9,CP7:()=>rD,D1R:()=>y,DvJ:()=>ni,EB7:()=>av,EJi:()=>sh,F5T:()=>tO,FM8:()=>Z,GUF:()=>R,Hmr:()=>s0,Hw6:()=>ed,Ilk:()=>tP,KI_:()=>A,Kj0:()=>nt,M8C:()=>J,Mig:()=>sK,N$j:()=>rJ,NMF:()=>M,OdW:()=>rQ,OoA:()=>p,Ox3:()=>sZ,PMe:()=>sG,Pa4:()=>eb,QRU:()=>sQ,SJI:()=>s8,SPe:()=>r8,Syv:()=>b,TUv:()=>rY,TlE:()=>tN,Tme:()=>td,TyD:()=>f,UY4:()=>ac,UlW:()=>E,Wid:()=>sc,Wl3:()=>l,WwZ:()=>S,YLQ:()=>m,ZAu:()=>rA,Zp0:()=>s$,ZzF:()=>eE,Zzh:()=>of,_12:()=>nS,_C8:()=>sg,_fP:()=>ex,aCh:()=>w,aH4:()=>g,aLr:()=>eV,aNw:()=>sL,blk:()=>au,cJO:()=>st,cPb:()=>nc,cek:()=>sY,dUE:()=>sS,dpR:()=>sN,ehD:()=>u,ejS:()=>al,epp:()=>eo,fHI:()=>aB,hH6:()=>sD,iKG:()=>nD,iLg:()=>sT,iMs:()=>ou,iUV:()=>oo,iWj:()=>nx,jyz:()=>nl,kB5:()=>rz,lb7:()=>r0,m7l:()=>sR,mTL:()=>s1,nls:()=>r9,qyh:()=>_,rpg:()=>h,tGC:()=>og,u9r:()=>tq,uWy:()=>d,vBJ:()=>tI,vpT:()=>rN,wem:()=>v,wk1:()=>x,woe:()=>am,x12:()=>aa,xEZ:()=>em,xWb:()=>ol,xoR:()=>sd,xsS:()=>rU,yC1:()=>sA,yGw:()=>eK,z$h:()=>T,zf8:()=>az});let l=0,u=2,c="attached",h=1e3,d=1001,p=1002,f=1003,m=1004,g=1005,v=1006,_=1007,y=1008,x=1023,b=2300,M=2301,S=0,E=1,T=2,w="",A="srgb",R="srgb-linear",P="display-p3",C="display-p3-linear",L="linear",O="srgb",I="rec709",D="300 es";class U{addEventListener(e,n){void 0===this._listeners&&(this._listeners={});let i=this._listeners;void 0===i[e]&&(i[e]=[]),-1===i[e].indexOf(n)&&i[e].push(n)}hasEventListener(e,n){if(void 0===this._listeners)return!1;let i=this._listeners;return void 0!==i[e]&&-1!==i[e].indexOf(n)}removeEventListener(e,n){if(void 0===this._listeners)return;let i=this._listeners[e];if(void 0!==i){let e=i.indexOf(n);-1!==e&&i.splice(e,1)}}dispatchEvent(e){if(void 0===this._listeners)return;let n=this._listeners[e.type];if(void 0!==n){e.target=this;let i=n.slice(0);for(let n=0,r=i.length;n>8&255]+N[e>>16&255]+N[e>>24&255]+"-"+N[255&n]+N[n>>8&255]+"-"+N[n>>16&15|64]+N[n>>24&255]+"-"+N[63&i|128]+N[i>>8&255]+"-"+N[i>>16&255]+N[i>>24&255]+N[255&r]+N[r>>8&255]+N[r>>16&255]+N[r>>24&255]).toLowerCase()}function H(e,n,i){return Math.max(n,Math.min(i,e))}function V(e,n){return(e%n+n)%n}function G(e,n,i){return(1-i)*e+i*n}function W(e){return(e&e-1)==0&&0!==e}function j(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))}function X(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}function q(e,n){switch(n.constructor){case Float32Array:return e;case Uint32Array:return e/4294967295;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/2147483647,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw Error("Invalid component type.")}}function Y(e,n){switch(n.constructor){case Float32Array:return e;case Uint32Array:return Math.round(4294967295*e);case Uint16Array:return Math.round(65535*e);case Uint8Array:return Math.round(255*e);case Int32Array:return Math.round(2147483647*e);case Int16Array:return Math.round(32767*e);case Int8Array:return Math.round(127*e);default:throw Error("Invalid component type.")}}let J={DEG2RAD:z,RAD2DEG:B,generateUUID:k,clamp:H,euclideanModulo:V,mapLinear:function(e,n,i,r,a){return r+(e-n)*(a-r)/(i-n)},inverseLerp:function(e,n,i){return e!==n?(i-e)/(n-e):0},lerp:G,damp:function(e,n,i,r){return G(e,n,1-Math.exp(-i*r))},pingpong:function(e,n=1){return n-Math.abs(V(e,2*n)-n)},smoothstep:function(e,n,i){return e<=n?0:e>=i?1:(e=(e-n)/(i-n))*e*(3-2*e)},smootherstep:function(e,n,i){return e<=n?0:e>=i?1:(e=(e-n)/(i-n))*e*e*(e*(6*e-15)+10)},randInt:function(e,n){return e+Math.floor(Math.random()*(n-e+1))},randFloat:function(e,n){return e+Math.random()*(n-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){void 0!==e&&(F=e);let n=F+=1831565813;return n=Math.imul(n^n>>>15,1|n),(((n^=n+Math.imul(n^n>>>7,61|n))^n>>>14)>>>0)/4294967296},degToRad:function(e){return e*z},radToDeg:function(e){return e*B},isPowerOfTwo:W,ceilPowerOfTwo:j,floorPowerOfTwo:X,setQuaternionFromProperEuler:function(e,n,i,r,a){let s=Math.cos,o=Math.sin,l=s(i/2),u=o(i/2),c=s((n+r)/2),h=o((n+r)/2),d=s((n-r)/2),p=o((n-r)/2),f=s((r-n)/2),m=o((r-n)/2);switch(a){case"XYX":e.set(l*h,u*d,u*p,l*c);break;case"YZY":e.set(u*p,l*h,u*d,l*c);break;case"ZXZ":e.set(u*d,u*p,l*h,l*c);break;case"XZX":e.set(l*h,u*m,u*f,l*c);break;case"YXY":e.set(u*f,l*h,u*m,l*c);break;case"ZYZ":e.set(u*m,u*f,l*h,l*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+a)}},normalize:Y,denormalize:q};class Z{constructor(e=0,n=0){Z.prototype.isVector2=!0,this.x=e,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,n){return this.x=e,this.y=n,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;default:throw Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let n=this.x,i=this.y,r=e.elements;return this.x=r[0]*n+r[3]*i+r[6],this.y=r[1]*n+r[4]*i+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this}clampLength(e,n){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(n,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){let n=Math.sqrt(this.lengthSq()*e.lengthSq());return 0===n?Math.PI/2:Math.acos(H(this.dot(e)/n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let n=this.x-e.x,i=this.y-e.y;return n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this}rotateAround(e,n){let i=Math.cos(n),r=Math.sin(n),a=this.x-e.x,s=this.y-e.y;return this.x=a*i-s*r+e.x,this.y=a*r+s*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class K{constructor(e,n,i,r,a,s,o,l,u){K.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==e&&this.set(e,n,i,r,a,s,o,l,u)}set(e,n,i,r,a,s,o,l,u){let c=this.elements;return c[0]=e,c[1]=r,c[2]=o,c[3]=n,c[4]=a,c[5]=l,c[6]=i,c[7]=s,c[8]=u,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let n=this.elements,i=e.elements;return n[0]=i[0],n[1]=i[1],n[2]=i[2],n[3]=i[3],n[4]=i[4],n[5]=i[5],n[6]=i[6],n[7]=i[7],n[8]=i[8],this}extractBasis(e,n,i){return e.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let n=e.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){let i=e.elements,r=n.elements,a=this.elements,s=i[0],o=i[3],l=i[6],u=i[1],c=i[4],h=i[7],d=i[2],p=i[5],f=i[8],m=r[0],g=r[3],v=r[6],_=r[1],y=r[4],x=r[7],b=r[2],M=r[5],S=r[8];return a[0]=s*m+o*_+l*b,a[3]=s*g+o*y+l*M,a[6]=s*v+o*x+l*S,a[1]=u*m+c*_+h*b,a[4]=u*g+c*y+h*M,a[7]=u*v+c*x+h*S,a[2]=d*m+p*_+f*b,a[5]=d*g+p*y+f*M,a[8]=d*v+p*x+f*S,this}multiplyScalar(e){let n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=e,n[4]*=e,n[7]*=e,n[2]*=e,n[5]*=e,n[8]*=e,this}determinant(){let e=this.elements,n=e[0],i=e[1],r=e[2],a=e[3],s=e[4],o=e[5],l=e[6],u=e[7],c=e[8];return n*s*c-n*o*u-i*a*c+i*o*l+r*a*u-r*s*l}invert(){let e=this.elements,n=e[0],i=e[1],r=e[2],a=e[3],s=e[4],o=e[5],l=e[6],u=e[7],c=e[8],h=c*s-o*u,d=o*l-c*a,p=u*a-s*l,f=n*h+i*d+r*p;if(0===f)return this.set(0,0,0,0,0,0,0,0,0);let m=1/f;return e[0]=h*m,e[1]=(r*u-c*i)*m,e[2]=(o*i-r*s)*m,e[3]=d*m,e[4]=(c*n-r*l)*m,e[5]=(r*a-o*n)*m,e[6]=p*m,e[7]=(i*l-u*n)*m,e[8]=(s*n-i*a)*m,this}transpose(){let e;let n=this.elements;return e=n[1],n[1]=n[3],n[3]=e,e=n[2],n[2]=n[6],n[6]=e,e=n[5],n[5]=n[7],n[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let n=this.elements;return e[0]=n[0],e[1]=n[3],e[2]=n[6],e[3]=n[1],e[4]=n[4],e[5]=n[7],e[6]=n[2],e[7]=n[5],e[8]=n[8],this}setUvTransform(e,n,i,r,a,s,o){let l=Math.cos(a),u=Math.sin(a);return this.set(i*l,i*u,-i*(l*s+u*o)+s+e,-r*u,r*l,-r*(-u*s+l*o)+o+n,0,0,1),this}scale(e,n){return this.premultiply($.makeScale(e,n)),this}rotate(e){return this.premultiply($.makeRotation(-e)),this}translate(e,n){return this.premultiply($.makeTranslation(e,n)),this}makeTranslation(e,n){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,n,0,0,1),this}makeRotation(e){let n=Math.cos(e),i=Math.sin(e);return this.set(n,-i,0,i,n,0,0,0,1),this}makeScale(e,n){return this.set(e,0,0,0,n,0,0,0,1),this}equals(e){let n=this.elements,i=e.elements;for(let e=0;e<9;e++)if(n[e]!==i[e])return!1;return!0}fromArray(e,n=0){for(let i=0;i<9;i++)this.elements[i]=e[i+n];return this}toArray(e=[],n=0){let i=this.elements;return e[n]=i[0],e[n+1]=i[1],e[n+2]=i[2],e[n+3]=i[3],e[n+4]=i[4],e[n+5]=i[5],e[n+6]=i[6],e[n+7]=i[7],e[n+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}let $=new K;function Q(e){for(let n=e.length-1;n>=0;--n)if(e[n]>=65535)return!0;return!1}function ee(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array;let et={};function en(e){e in et||(et[e]=!0,console.warn(e))}let ei=new K().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),er=new K().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),ea={[R]:{transfer:L,primaries:I,toReference:e=>e,fromReference:e=>e},[A]:{transfer:O,primaries:I,toReference:e=>e.convertSRGBToLinear(),fromReference:e=>e.convertLinearToSRGB()},[C]:{transfer:L,primaries:"p3",toReference:e=>e.applyMatrix3(er),fromReference:e=>e.applyMatrix3(ei)},[P]:{transfer:O,primaries:"p3",toReference:e=>e.convertSRGBToLinear().applyMatrix3(er),fromReference:e=>e.applyMatrix3(ei).convertLinearToSRGB()}},es=new Set([R,C]),eo={enabled:!0,_workingColorSpace:R,get legacyMode(){return console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),!this.enabled},set legacyMode(legacyMode){console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),this.enabled=!legacyMode},get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(colorSpace){if(!es.has(colorSpace))throw Error(`Unsupported working color space, "${colorSpace}".`);this._workingColorSpace=colorSpace},convert:function(e,n,i){if(!1===this.enabled||n===i||!n||!i)return e;let r=ea[n].toReference;return(0,ea[i].fromReference)(r(e))},fromWorkingColorSpace:function(e,n){return this.convert(e,this._workingColorSpace,n)},toWorkingColorSpace:function(e,n){return this.convert(e,n,this._workingColorSpace)},getPrimaries:function(e){return ea[e].primaries},getTransfer:function(e){return e===w?L:ea[e].transfer}};function el(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function eu(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}class ec{static getDataURL(e){let n;if(/^data:/i.test(e.src)||"undefined"==typeof HTMLCanvasElement)return e.src;if(e instanceof HTMLCanvasElement)n=e;else{void 0===r&&(r=ee("canvas")),r.width=e.width,r.height=e.height;let i=r.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),n=r}return n.width>2048||n.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),n.toDataURL("image/jpeg",.6)):n.toDataURL("image/png")}static sRGBToLinear(e){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){let n=ee("canvas");n.width=e.width,n.height=e.height;let i=n.getContext("2d");i.drawImage(e,0,0,e.width,e.height);let r=i.getImageData(0,0,e.width,e.height),a=r.data;for(let e=0;e0&&(i.userData=this.userData),n||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(300!==this.mapping)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case h:e.x=e.x-Math.floor(e.x);break;case d:e.x=e.x<0?0:1;break;case p:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case h:e.y=e.y-Math.floor(e.y);break;case d:e.y=e.y<0?0:1;break;case p:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){!0===e&&(this.version++,this.source.needsUpdate=!0)}get encoding(){return en("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===A?3001:3e3}set encoding(e){en("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=3001===e?A:w}}em.DEFAULT_IMAGE=null,em.DEFAULT_MAPPING=300,em.DEFAULT_ANISOTROPY=1;class eg{constructor(e=0,n=0,i=0,r=1){eg.prototype.isVector4=!0,this.x=e,this.y=n,this.z=i,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,n,i,r){return this.x=e,this.y=n,this.z=i,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;break;default:throw Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this.w=e.w+n.w,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this.w+=e.w*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this.w=e.w-n.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let n=this.x,i=this.y,r=this.z,a=this.w,s=e.elements;return this.x=s[0]*n+s[4]*i+s[8]*r+s[12]*a,this.y=s[1]*n+s[5]*i+s[9]*r+s[13]*a,this.z=s[2]*n+s[6]*i+s[10]*r+s[14]*a,this.w=s[3]*n+s[7]*i+s[11]*r+s[15]*a,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let n=Math.sqrt(1-e.w*e.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/n,this.y=e.y/n,this.z=e.z/n),this}setAxisAngleFromRotationMatrix(e){let n,i,r;let a=e.elements,s=a[0],o=a[4],l=a[8],u=a[1],c=a[5],h=a[9],d=a[2],p=a[6],f=a[10];if(.01>Math.abs(o-u)&&.01>Math.abs(l-d)&&.01>Math.abs(h-p)){if(.1>Math.abs(o+u)&&.1>Math.abs(l+d)&&.1>Math.abs(h+p)&&.1>Math.abs(s+c+f-3))return this.set(1,0,0,0),this;let e=(s+1)/2,a=(c+1)/2,m=(f+1)/2,g=(o+u)/4,v=(l+d)/4,_=(h+p)/4;return e>a&&e>m?e<.01?(n=0,i=.707106781,r=.707106781):(i=g/(n=Math.sqrt(e)),r=v/n):a>m?a<.01?(n=.707106781,i=0,r=.707106781):(n=g/(i=Math.sqrt(a)),r=_/i):m<.01?(n=.707106781,i=.707106781,r=0):(n=v/(r=Math.sqrt(m)),i=_/r),this.set(n,i,r,Math.PI),this}let m=Math.sqrt((p-h)*(p-h)+(l-d)*(l-d)+(u-o)*(u-o));return .001>Math.abs(m)&&(m=1),this.x=(p-h)/m,this.y=(l-d)/m,this.z=(u-o)/m,this.w=Math.acos((s+c+f-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this.z=Math.max(e.z,Math.min(n.z,this.z)),this.w=Math.max(e.w,Math.min(n.w,this.w)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this.z=Math.max(e,Math.min(n,this.z)),this.w=Math.max(e,Math.min(n,this.w)),this}clampLength(e,n){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(n,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this.w+=(e.w-this.w)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this.z=e.z+(n.z-e.z)*i,this.w=e.w+(n.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this.w=e[n+3],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e[n+3]=this.w,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this.w=e.getW(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class ev extends U{constructor(e=1,n=1,i={}){super(),this.isRenderTarget=!0,this.width=e,this.height=n,this.depth=1,this.scissor=new eg(0,0,e,n),this.scissorTest=!1,this.viewport=new eg(0,0,e,n),void 0!==i.encoding&&(en("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),i.colorSpace=3001===i.encoding?A:w),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:v,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0},i),this.texture=new em({width:e,height:n,depth:1},i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=i.generateMipmaps,this.texture.internalFormat=i.internalFormat,this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.depthTexture=i.depthTexture,this.samples=i.samples}setSize(e,n,i=1){(this.width!==e||this.height!==n||this.depth!==i)&&(this.width=e,this.height=n,this.depth=i,this.texture.image.width=e,this.texture.image.height=n,this.texture.image.depth=i,this.dispose()),this.viewport.set(0,0,e,n),this.scissor.set(0,0,e,n)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;let n=Object.assign({},e.texture.image);return this.texture.source=new ed(n),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,null!==e.depthTexture&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class e_ extends ev{constructor(e=1,n=1,i={}){super(e,n,i),this.isWebGLRenderTarget=!0}}class ey extends em{constructor(e=null,n=1,i=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:n,height:i,depth:r},this.magFilter=f,this.minFilter=f,this.wrapR=d,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class ex{constructor(e=0,n=0,i=0,r=1){this.isQuaternion=!0,this._x=e,this._y=n,this._z=i,this._w=r}static slerpFlat(e,n,i,r,a,s,o){let l=i[r+0],u=i[r+1],c=i[r+2],h=i[r+3],d=a[s+0],p=a[s+1],f=a[s+2],m=a[s+3];if(0===o){e[n+0]=l,e[n+1]=u,e[n+2]=c,e[n+3]=h;return}if(1===o){e[n+0]=d,e[n+1]=p,e[n+2]=f,e[n+3]=m;return}if(h!==m||l!==d||u!==p||c!==f){let e=1-o,n=l*d+u*p+c*f+h*m,i=n>=0?1:-1,r=1-n*n;if(r>Number.EPSILON){let a=Math.sqrt(r),s=Math.atan2(a,n*i);e=Math.sin(e*s)/a,o=Math.sin(o*s)/a}let a=o*i;if(l=l*e+d*a,u=u*e+p*a,c=c*e+f*a,h=h*e+m*a,e===1-o){let e=1/Math.sqrt(l*l+u*u+c*c+h*h);l*=e,u*=e,c*=e,h*=e}}e[n]=l,e[n+1]=u,e[n+2]=c,e[n+3]=h}static multiplyQuaternionsFlat(e,n,i,r,a,s){let o=i[r],l=i[r+1],u=i[r+2],c=i[r+3],h=a[s],d=a[s+1],p=a[s+2],f=a[s+3];return e[n]=o*f+c*h+l*p-u*d,e[n+1]=l*f+c*d+u*h-o*p,e[n+2]=u*f+c*p+o*d-l*h,e[n+3]=c*f-o*h-l*d-u*p,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,n,i,r){return this._x=e,this._y=n,this._z=i,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,n){let i=e._x,r=e._y,a=e._z,s=e._order,o=Math.cos,l=Math.sin,u=o(i/2),c=o(r/2),h=o(a/2),d=l(i/2),p=l(r/2),f=l(a/2);switch(s){case"XYZ":this._x=d*c*h+u*p*f,this._y=u*p*h-d*c*f,this._z=u*c*f+d*p*h,this._w=u*c*h-d*p*f;break;case"YXZ":this._x=d*c*h+u*p*f,this._y=u*p*h-d*c*f,this._z=u*c*f-d*p*h,this._w=u*c*h+d*p*f;break;case"ZXY":this._x=d*c*h-u*p*f,this._y=u*p*h+d*c*f,this._z=u*c*f+d*p*h,this._w=u*c*h-d*p*f;break;case"ZYX":this._x=d*c*h-u*p*f,this._y=u*p*h+d*c*f,this._z=u*c*f-d*p*h,this._w=u*c*h+d*p*f;break;case"YZX":this._x=d*c*h+u*p*f,this._y=u*p*h+d*c*f,this._z=u*c*f-d*p*h,this._w=u*c*h-d*p*f;break;case"XZY":this._x=d*c*h-u*p*f,this._y=u*p*h-d*c*f,this._z=u*c*f+d*p*h,this._w=u*c*h+d*p*f;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return!1!==n&&this._onChangeCallback(),this}setFromAxisAngle(e,n){let i=n/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){let n=e.elements,i=n[0],r=n[4],a=n[8],s=n[1],o=n[5],l=n[9],u=n[2],c=n[6],h=n[10],d=i+o+h;if(d>0){let e=.5/Math.sqrt(d+1);this._w=.25/e,this._x=(c-l)*e,this._y=(a-u)*e,this._z=(s-r)*e}else if(i>o&&i>h){let e=2*Math.sqrt(1+i-o-h);this._w=(c-l)/e,this._x=.25*e,this._y=(r+s)/e,this._z=(a+u)/e}else if(o>h){let e=2*Math.sqrt(1+o-i-h);this._w=(a-u)/e,this._x=(r+s)/e,this._y=.25*e,this._z=(l+c)/e}else{let e=2*Math.sqrt(1+h-i-o);this._w=(s-r)/e,this._x=(a+u)/e,this._y=(l+c)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,n){let i=e.dot(n)+1;return iMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0):(this._x=0,this._y=-e.z,this._z=e.y)):(this._x=e.y*n.z-e.z*n.y,this._y=e.z*n.x-e.x*n.z,this._z=e.x*n.y-e.y*n.x),this._w=i,this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(H(this.dot(e),-1,1)))}rotateTowards(e,n){let i=this.angleTo(e);return 0===i||this.slerp(e,Math.min(1,n/i)),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,n){let i=e._x,r=e._y,a=e._z,s=e._w,o=n._x,l=n._y,u=n._z,c=n._w;return this._x=i*c+s*o+r*u-a*l,this._y=r*c+s*l+a*o-i*u,this._z=a*c+s*u+i*l-r*o,this._w=s*c-i*o-r*l-a*u,this._onChangeCallback(),this}slerp(e,n){if(0===n)return this;if(1===n)return this.copy(e);let i=this._x,r=this._y,a=this._z,s=this._w,o=s*e._w+i*e._x+r*e._y+a*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=s,this._x=i,this._y=r,this._z=a,this;let l=1-o*o;if(l<=Number.EPSILON){let e=1-n;return this._w=e*s+n*this._w,this._x=e*i+n*this._x,this._y=e*r+n*this._y,this._z=e*a+n*this._z,this.normalize(),this._onChangeCallback(),this}let u=Math.sqrt(l),c=Math.atan2(u,o),h=Math.sin((1-n)*c)/u,d=Math.sin(n*c)/u;return this._w=s*h+this._w*d,this._x=i*h+this._x*d,this._y=r*h+this._y*d,this._z=a*h+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,n,i){return this.copy(e).slerp(n,i)}random(){let e=Math.random(),n=Math.sqrt(1-e),i=Math.sqrt(e),r=2*Math.PI*Math.random(),a=2*Math.PI*Math.random();return this.set(n*Math.cos(r),i*Math.sin(a),i*Math.cos(a),n*Math.sin(r))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,n=0){return this._x=e[n],this._y=e[n+1],this._z=e[n+2],this._w=e[n+3],this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._w,e}fromBufferAttribute(e,n){return this._x=e.getX(n),this._y=e.getY(n),this._z=e.getZ(n),this._w=e.getW(n),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class eb{constructor(e=0,n=0,i=0){eb.prototype.isVector3=!0,this.x=e,this.y=n,this.z=i}set(e,n,i){return void 0===i&&(i=this.z),this.x=e,this.y=n,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;default:throw Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,n){return this.x=e.x*n.x,this.y=e.y*n.y,this.z=e.z*n.z,this}applyEuler(e){return this.applyQuaternion(eS.setFromEuler(e))}applyAxisAngle(e,n){return this.applyQuaternion(eS.setFromAxisAngle(e,n))}applyMatrix3(e){let n=this.x,i=this.y,r=this.z,a=e.elements;return this.x=a[0]*n+a[3]*i+a[6]*r,this.y=a[1]*n+a[4]*i+a[7]*r,this.z=a[2]*n+a[5]*i+a[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let n=this.x,i=this.y,r=this.z,a=e.elements,s=1/(a[3]*n+a[7]*i+a[11]*r+a[15]);return this.x=(a[0]*n+a[4]*i+a[8]*r+a[12])*s,this.y=(a[1]*n+a[5]*i+a[9]*r+a[13])*s,this.z=(a[2]*n+a[6]*i+a[10]*r+a[14])*s,this}applyQuaternion(e){let n=this.x,i=this.y,r=this.z,a=e.x,s=e.y,o=e.z,l=e.w,u=2*(s*r-o*i),c=2*(o*n-a*r),h=2*(a*i-s*n);return this.x=n+l*u+s*h-o*c,this.y=i+l*c+o*u-a*h,this.z=r+l*h+a*c-s*u,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let n=this.x,i=this.y,r=this.z,a=e.elements;return this.x=a[0]*n+a[4]*i+a[8]*r,this.y=a[1]*n+a[5]*i+a[9]*r,this.z=a[2]*n+a[6]*i+a[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this.z=Math.max(e.z,Math.min(n.z,this.z)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this.z=Math.max(e,Math.min(n,this.z)),this}clampLength(e,n){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(n,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this.z=e.z+(n.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,n){let i=e.x,r=e.y,a=e.z,s=n.x,o=n.y,l=n.z;return this.x=r*l-a*o,this.y=a*s-i*l,this.z=i*o-r*s,this}projectOnVector(e){let n=e.lengthSq();if(0===n)return this.set(0,0,0);let i=e.dot(this)/n;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return eM.copy(this).projectOnVector(e),this.sub(eM)}reflect(e){return this.sub(eM.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let n=Math.sqrt(this.lengthSq()*e.lengthSq());return 0===n?Math.PI/2:Math.acos(H(this.dot(e)/n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let n=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return n*n+i*i+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,n,i){let r=Math.sin(n)*e;return this.x=r*Math.sin(i),this.y=Math.cos(n)*e,this.z=r*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,n,i){return this.x=e*Math.sin(n),this.y=i,this.z=e*Math.cos(n),this}setFromMatrixPosition(e){let n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(e){let n=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=n,this.y=i,this.z=r,this}setFromMatrixColumn(e,n){return this.fromArray(e.elements,4*n)}setFromMatrix3Column(e,n){return this.fromArray(e.elements,3*n)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let e=(Math.random()-.5)*2,n=Math.random()*Math.PI*2,i=Math.sqrt(1-e**2);return this.x=i*Math.cos(n),this.y=i*Math.sin(n),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}let eM=new eb,eS=new ex;class eE{constructor(e=new eb(Infinity,Infinity,Infinity),n=new eb(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=n}set(e,n){return this.min.copy(e),this.max.copy(n),this}setFromArray(e){this.makeEmpty();for(let n=0,i=e.length;nthis.max.x)&&!(e.ythis.max.y)&&!(e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,n){return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x)&&!(e.max.ythis.max.y)&&!(e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,ew),ew.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let n,i;return e.normal.x>0?(n=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(n=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(n+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(n+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(n+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(n+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),n<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(eD),eU.subVectors(this.max,eD),eR.subVectors(e.a,eD),eP.subVectors(e.b,eD),eC.subVectors(e.c,eD),eL.subVectors(eP,eR),eO.subVectors(eC,eP),eI.subVectors(eR,eC);let n=[0,-eL.z,eL.y,0,-eO.z,eO.y,0,-eI.z,eI.y,eL.z,0,-eL.x,eO.z,0,-eO.x,eI.z,0,-eI.x,-eL.y,eL.x,0,-eO.y,eO.x,0,-eI.y,eI.x,0];return!!(ez(n,eR,eP,eC,eU)&&ez(n=[1,0,0,0,1,0,0,0,1],eR,eP,eC,eU))&&(eN.crossVectors(eL,eO),ez(n=[eN.x,eN.y,eN.z],eR,eP,eC,eU))}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,ew).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=.5*this.getSize(ew).length()),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()||(eT[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),eT[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),eT[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),eT[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),eT[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),eT[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),eT[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),eT[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(eT)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}let eT=[new eb,new eb,new eb,new eb,new eb,new eb,new eb,new eb],ew=new eb,eA=new eE,eR=new eb,eP=new eb,eC=new eb,eL=new eb,eO=new eb,eI=new eb,eD=new eb,eU=new eb,eN=new eb,eF=new eb;function ez(e,n,i,r,a){for(let s=0,o=e.length-3;s<=o;s+=3){eF.fromArray(e,s);let o=a.x*Math.abs(eF.x)+a.y*Math.abs(eF.y)+a.z*Math.abs(eF.z),l=n.dot(eF),u=i.dot(eF),c=r.dot(eF);if(Math.max(-Math.max(l,u,c),Math.min(l,u,c))>o)return!1}return!0}let eB=new eE,ek=new eb,eH=new eb;class eV{constructor(e=new eb,n=-1){this.center=e,this.radius=n}set(e,n){return this.center.copy(e),this.radius=n,this}setFromPoints(e,n){let i=this.center;void 0!==n?i.copy(n):eB.setFromPoints(e).getCenter(i);let r=0;for(let n=0,a=e.length;nthis.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n}getBoundingBox(e){return this.isEmpty()?e.makeEmpty():(e.set(this.center,this.center),e.expandByScalar(this.radius)),e}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;ek.subVectors(e,this.center);let n=ek.lengthSq();if(n>this.radius*this.radius){let e=Math.sqrt(n),i=(e-this.radius)*.5;this.center.addScaledVector(ek,i/e),this.radius+=i}return this}union(e){return e.isEmpty()||(this.isEmpty()?this.copy(e):!0===this.center.equals(e.center)?this.radius=Math.max(this.radius,e.radius):(eH.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(ek.copy(e.center).add(eH)),this.expandByPoint(ek.copy(e.center).sub(eH)))),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}let eG=new eb,eW=new eb,ej=new eb,eX=new eb,eq=new eb,eY=new eb,eJ=new eb;class eZ{constructor(e=new eb,n=new eb(0,0,-1)){this.origin=e,this.direction=n}set(e,n){return this.origin.copy(e),this.direction.copy(n),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,n){return n.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,eG)),this}closestPointToPoint(e,n){n.subVectors(e,this.origin);let i=n.dot(this.direction);return i<0?n.copy(this.origin):n.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let n=eG.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(eG.copy(this.origin).addScaledVector(this.direction,n),eG.distanceToSquared(e))}distanceSqToSegment(e,n,i,r){let a,s,o,l;eW.copy(e).add(n).multiplyScalar(.5),ej.copy(n).sub(e).normalize(),eX.copy(this.origin).sub(eW);let u=.5*e.distanceTo(n),c=-this.direction.dot(ej),h=eX.dot(this.direction),d=-eX.dot(ej),p=eX.lengthSq(),f=Math.abs(1-c*c);if(f>0){if(a=c*d-h,s=c*h-d,l=u*f,a>=0){if(s>=-l){if(s<=l){let e=1/f;a*=e,s*=e,o=a*(a+c*s+2*h)+s*(c*a+s+2*d)+p}else o=-(a=Math.max(0,-(c*(s=u)+h)))*a+s*(s+2*d)+p}else o=-(a=Math.max(0,-(c*(s=-u)+h)))*a+s*(s+2*d)+p}else s<=-l?(s=(a=Math.max(0,-(-c*u+h)))>0?-u:Math.min(Math.max(-u,-d),u),o=-a*a+s*(s+2*d)+p):s<=l?(a=0,o=(s=Math.min(Math.max(-u,-d),u))*(s+2*d)+p):(s=(a=Math.max(0,-(c*u+h)))>0?u:Math.min(Math.max(-u,-d),u),o=-a*a+s*(s+2*d)+p)}else s=c>0?-u:u,o=-(a=Math.max(0,-(c*s+h)))*a+s*(s+2*d)+p;return i&&i.copy(this.origin).addScaledVector(this.direction,a),r&&r.copy(eW).addScaledVector(ej,s),o}intersectSphere(e,n){eG.subVectors(e.center,this.origin);let i=eG.dot(this.direction),r=eG.dot(eG)-i*i,a=e.radius*e.radius;if(r>a)return null;let s=Math.sqrt(a-r),o=i-s,l=i+s;return l<0?null:o<0?this.at(l,n):this.at(o,n)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let n=e.normal.dot(this.direction);if(0===n)return 0===e.distanceToPoint(this.origin)?0:null;let i=-(this.origin.dot(e.normal)+e.constant)/n;return i>=0?i:null}intersectPlane(e,n){let i=this.distanceToPlane(e);return null===i?null:this.at(i,n)}intersectsPlane(e){let n=e.distanceToPoint(this.origin);return!!(0===n||e.normal.dot(this.direction)*n<0)}intersectBox(e,n){let i,r,a,s,o,l;let u=1/this.direction.x,c=1/this.direction.y,h=1/this.direction.z,d=this.origin;return(u>=0?(i=(e.min.x-d.x)*u,r=(e.max.x-d.x)*u):(i=(e.max.x-d.x)*u,r=(e.min.x-d.x)*u),c>=0?(a=(e.min.y-d.y)*c,s=(e.max.y-d.y)*c):(a=(e.max.y-d.y)*c,s=(e.min.y-d.y)*c),i>s||a>r)?null:((a>i||isNaN(i))&&(i=a),(s=0?(o=(e.min.z-d.z)*h,l=(e.max.z-d.z)*h):(o=(e.max.z-d.z)*h,l=(e.min.z-d.z)*h),i>l||o>r)?null:((o>i||i!=i)&&(i=o),(l=0?i:r,n)}intersectsBox(e){return null!==this.intersectBox(e,eG)}intersectTriangle(e,n,i,r,a){let s;eq.subVectors(n,e),eY.subVectors(i,e),eJ.crossVectors(eq,eY);let o=this.direction.dot(eJ);if(o>0){if(r)return null;s=1}else{if(!(o<0))return null;s=-1,o=-o}eX.subVectors(this.origin,e);let l=s*this.direction.dot(eY.crossVectors(eX,eY));if(l<0)return null;let u=s*this.direction.dot(eq.cross(eX));if(u<0||l+u>o)return null;let c=-s*eX.dot(eJ);return c<0?null:this.at(c/o,a)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class eK{constructor(e,n,i,r,a,s,o,l,u,c,h,d,p,f,m,g){eK.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==e&&this.set(e,n,i,r,a,s,o,l,u,c,h,d,p,f,m,g)}set(e,n,i,r,a,s,o,l,u,c,h,d,p,f,m,g){let v=this.elements;return v[0]=e,v[4]=n,v[8]=i,v[12]=r,v[1]=a,v[5]=s,v[9]=o,v[13]=l,v[2]=u,v[6]=c,v[10]=h,v[14]=d,v[3]=p,v[7]=f,v[11]=m,v[15]=g,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new eK().fromArray(this.elements)}copy(e){let n=this.elements,i=e.elements;return n[0]=i[0],n[1]=i[1],n[2]=i[2],n[3]=i[3],n[4]=i[4],n[5]=i[5],n[6]=i[6],n[7]=i[7],n[8]=i[8],n[9]=i[9],n[10]=i[10],n[11]=i[11],n[12]=i[12],n[13]=i[13],n[14]=i[14],n[15]=i[15],this}copyPosition(e){let n=this.elements,i=e.elements;return n[12]=i[12],n[13]=i[13],n[14]=i[14],this}setFromMatrix3(e){let n=e.elements;return this.set(n[0],n[3],n[6],0,n[1],n[4],n[7],0,n[2],n[5],n[8],0,0,0,0,1),this}extractBasis(e,n,i){return e.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,n,i){return this.set(e.x,n.x,i.x,0,e.y,n.y,i.y,0,e.z,n.z,i.z,0,0,0,0,1),this}extractRotation(e){let n=this.elements,i=e.elements,r=1/e$.setFromMatrixColumn(e,0).length(),a=1/e$.setFromMatrixColumn(e,1).length(),s=1/e$.setFromMatrixColumn(e,2).length();return n[0]=i[0]*r,n[1]=i[1]*r,n[2]=i[2]*r,n[3]=0,n[4]=i[4]*a,n[5]=i[5]*a,n[6]=i[6]*a,n[7]=0,n[8]=i[8]*s,n[9]=i[9]*s,n[10]=i[10]*s,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromEuler(e){let n=this.elements,i=e.x,r=e.y,a=e.z,s=Math.cos(i),o=Math.sin(i),l=Math.cos(r),u=Math.sin(r),c=Math.cos(a),h=Math.sin(a);if("XYZ"===e.order){let e=s*c,i=s*h,r=o*c,a=o*h;n[0]=l*c,n[4]=-l*h,n[8]=u,n[1]=i+r*u,n[5]=e-a*u,n[9]=-o*l,n[2]=a-e*u,n[6]=r+i*u,n[10]=s*l}else if("YXZ"===e.order){let e=l*c,i=l*h,r=u*c,a=u*h;n[0]=e+a*o,n[4]=r*o-i,n[8]=s*u,n[1]=s*h,n[5]=s*c,n[9]=-o,n[2]=i*o-r,n[6]=a+e*o,n[10]=s*l}else if("ZXY"===e.order){let e=l*c,i=l*h,r=u*c,a=u*h;n[0]=e-a*o,n[4]=-s*h,n[8]=r+i*o,n[1]=i+r*o,n[5]=s*c,n[9]=a-e*o,n[2]=-s*u,n[6]=o,n[10]=s*l}else if("ZYX"===e.order){let e=s*c,i=s*h,r=o*c,a=o*h;n[0]=l*c,n[4]=r*u-i,n[8]=e*u+a,n[1]=l*h,n[5]=a*u+e,n[9]=i*u-r,n[2]=-u,n[6]=o*l,n[10]=s*l}else if("YZX"===e.order){let e=s*l,i=s*u,r=o*l,a=o*u;n[0]=l*c,n[4]=a-e*h,n[8]=r*h+i,n[1]=h,n[5]=s*c,n[9]=-o*c,n[2]=-u*c,n[6]=i*h+r,n[10]=e-a*h}else if("XZY"===e.order){let e=s*l,i=s*u,r=o*l,a=o*u;n[0]=l*c,n[4]=-h,n[8]=u*c,n[1]=e*h+a,n[5]=s*c,n[9]=i*h-r,n[2]=r*h-i,n[6]=o*c,n[10]=a*h+e}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromQuaternion(e){return this.compose(e0,e,e1)}lookAt(e,n,i){let r=this.elements;return e4.subVectors(e,n),0===e4.lengthSq()&&(e4.z=1),e4.normalize(),e2.crossVectors(i,e4),0===e2.lengthSq()&&(1===Math.abs(i.z)?e4.x+=1e-4:e4.z+=1e-4,e4.normalize(),e2.crossVectors(i,e4)),e2.normalize(),e3.crossVectors(e4,e2),r[0]=e2.x,r[4]=e3.x,r[8]=e4.x,r[1]=e2.y,r[5]=e3.y,r[9]=e4.y,r[2]=e2.z,r[6]=e3.z,r[10]=e4.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){let i=e.elements,r=n.elements,a=this.elements,s=i[0],o=i[4],l=i[8],u=i[12],c=i[1],h=i[5],d=i[9],p=i[13],f=i[2],m=i[6],g=i[10],v=i[14],_=i[3],y=i[7],x=i[11],b=i[15],M=r[0],S=r[4],E=r[8],T=r[12],w=r[1],A=r[5],R=r[9],P=r[13],C=r[2],L=r[6],O=r[10],I=r[14],D=r[3],U=r[7],N=r[11],F=r[15];return a[0]=s*M+o*w+l*C+u*D,a[4]=s*S+o*A+l*L+u*U,a[8]=s*E+o*R+l*O+u*N,a[12]=s*T+o*P+l*I+u*F,a[1]=c*M+h*w+d*C+p*D,a[5]=c*S+h*A+d*L+p*U,a[9]=c*E+h*R+d*O+p*N,a[13]=c*T+h*P+d*I+p*F,a[2]=f*M+m*w+g*C+v*D,a[6]=f*S+m*A+g*L+v*U,a[10]=f*E+m*R+g*O+v*N,a[14]=f*T+m*P+g*I+v*F,a[3]=_*M+y*w+x*C+b*D,a[7]=_*S+y*A+x*L+b*U,a[11]=_*E+y*R+x*O+b*N,a[15]=_*T+y*P+x*I+b*F,this}multiplyScalar(e){let n=this.elements;return n[0]*=e,n[4]*=e,n[8]*=e,n[12]*=e,n[1]*=e,n[5]*=e,n[9]*=e,n[13]*=e,n[2]*=e,n[6]*=e,n[10]*=e,n[14]*=e,n[3]*=e,n[7]*=e,n[11]*=e,n[15]*=e,this}determinant(){let e=this.elements,n=e[0],i=e[4],r=e[8],a=e[12],s=e[1],o=e[5],l=e[9],u=e[13],c=e[2],h=e[6],d=e[10],p=e[14],f=e[3];return f*(+a*l*h-r*u*h-a*o*d+i*u*d+r*o*p-i*l*p)+e[7]*(+n*l*p-n*u*d+a*s*d-r*s*p+r*u*c-a*l*c)+e[11]*(+n*u*h-n*o*p-a*s*h+i*s*p+a*o*c-i*u*c)+e[15]*(-r*o*c-n*l*h+n*o*d+r*s*h-i*s*d+i*l*c)}transpose(){let e;let n=this.elements;return e=n[1],n[1]=n[4],n[4]=e,e=n[2],n[2]=n[8],n[8]=e,e=n[6],n[6]=n[9],n[9]=e,e=n[3],n[3]=n[12],n[12]=e,e=n[7],n[7]=n[13],n[13]=e,e=n[11],n[11]=n[14],n[14]=e,this}setPosition(e,n,i){let r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=n,r[14]=i),this}invert(){let e=this.elements,n=e[0],i=e[1],r=e[2],a=e[3],s=e[4],o=e[5],l=e[6],u=e[7],c=e[8],h=e[9],d=e[10],p=e[11],f=e[12],m=e[13],g=e[14],v=e[15],_=h*g*u-m*d*u+m*l*p-o*g*p-h*l*v+o*d*v,y=f*d*u-c*g*u-f*l*p+s*g*p+c*l*v-s*d*v,x=c*m*u-f*h*u+f*o*p-s*m*p-c*o*v+s*h*v,b=f*h*l-c*m*l-f*o*d+s*m*d+c*o*g-s*h*g,M=n*_+i*y+r*x+a*b;if(0===M)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let S=1/M;return e[0]=_*S,e[1]=(m*d*a-h*g*a-m*r*p+i*g*p+h*r*v-i*d*v)*S,e[2]=(o*g*a-m*l*a+m*r*u-i*g*u-o*r*v+i*l*v)*S,e[3]=(h*l*a-o*d*a-h*r*u+i*d*u+o*r*p-i*l*p)*S,e[4]=y*S,e[5]=(c*g*a-f*d*a+f*r*p-n*g*p-c*r*v+n*d*v)*S,e[6]=(f*l*a-s*g*a-f*r*u+n*g*u+s*r*v-n*l*v)*S,e[7]=(s*d*a-c*l*a+c*r*u-n*d*u-s*r*p+n*l*p)*S,e[8]=x*S,e[9]=(f*h*a-c*m*a-f*i*p+n*m*p+c*i*v-n*h*v)*S,e[10]=(s*m*a-f*o*a+f*i*u-n*m*u-s*i*v+n*o*v)*S,e[11]=(c*o*a-s*h*a-c*i*u+n*h*u+s*i*p-n*o*p)*S,e[12]=b*S,e[13]=(c*m*r-f*h*r+f*i*d-n*m*d-c*i*g+n*h*g)*S,e[14]=(f*o*r-s*m*r-f*i*l+n*m*l+s*i*g-n*o*g)*S,e[15]=(s*h*r-c*o*r+c*i*l-n*h*l-s*i*d+n*o*d)*S,this}scale(e){let n=this.elements,i=e.x,r=e.y,a=e.z;return n[0]*=i,n[4]*=r,n[8]*=a,n[1]*=i,n[5]*=r,n[9]*=a,n[2]*=i,n[6]*=r,n[10]*=a,n[3]*=i,n[7]*=r,n[11]*=a,this}getMaxScaleOnAxis(){let e=this.elements;return Math.sqrt(Math.max(e[0]*e[0]+e[1]*e[1]+e[2]*e[2],e[4]*e[4]+e[5]*e[5]+e[6]*e[6],e[8]*e[8]+e[9]*e[9]+e[10]*e[10]))}makeTranslation(e,n,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,n,0,0,1,i,0,0,0,1),this}makeRotationX(e){let n=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,n,-i,0,0,i,n,0,0,0,0,1),this}makeRotationY(e){let n=Math.cos(e),i=Math.sin(e);return this.set(n,0,i,0,0,1,0,0,-i,0,n,0,0,0,0,1),this}makeRotationZ(e){let n=Math.cos(e),i=Math.sin(e);return this.set(n,-i,0,0,i,n,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,n){let i=Math.cos(n),r=Math.sin(n),a=1-i,s=e.x,o=e.y,l=e.z,u=a*s,c=a*o;return this.set(u*s+i,u*o-r*l,u*l+r*o,0,u*o+r*l,c*o+i,c*l-r*s,0,u*l-r*o,c*l+r*s,a*l*l+i,0,0,0,0,1),this}makeScale(e,n,i){return this.set(e,0,0,0,0,n,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,n,i,r,a,s){return this.set(1,i,a,0,e,1,s,0,n,r,1,0,0,0,0,1),this}compose(e,n,i){let r=this.elements,a=n._x,s=n._y,o=n._z,l=n._w,u=a+a,c=s+s,h=o+o,d=a*u,p=a*c,f=a*h,m=s*c,g=s*h,v=o*h,_=l*u,y=l*c,x=l*h,b=i.x,M=i.y,S=i.z;return r[0]=(1-(m+v))*b,r[1]=(p+x)*b,r[2]=(f-y)*b,r[3]=0,r[4]=(p-x)*M,r[5]=(1-(d+v))*M,r[6]=(g+_)*M,r[7]=0,r[8]=(f+y)*S,r[9]=(g-_)*S,r[10]=(1-(d+m))*S,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,n,i){let r=this.elements,a=e$.set(r[0],r[1],r[2]).length(),s=e$.set(r[4],r[5],r[6]).length(),o=e$.set(r[8],r[9],r[10]).length();0>this.determinant()&&(a=-a),e.x=r[12],e.y=r[13],e.z=r[14],eQ.copy(this);let l=1/a,u=1/s,c=1/o;return eQ.elements[0]*=l,eQ.elements[1]*=l,eQ.elements[2]*=l,eQ.elements[4]*=u,eQ.elements[5]*=u,eQ.elements[6]*=u,eQ.elements[8]*=c,eQ.elements[9]*=c,eQ.elements[10]*=c,n.setFromRotationMatrix(eQ),i.x=a,i.y=s,i.z=o,this}makePerspective(e,n,i,r,a,s,o=2e3){let l,u;let c=this.elements;if(2e3===o)l=-(s+a)/(s-a),u=-2*s*a/(s-a);else if(2001===o)l=-s/(s-a),u=-s*a/(s-a);else throw Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return c[0]=2*a/(n-e),c[4]=0,c[8]=(n+e)/(n-e),c[12]=0,c[1]=0,c[5]=2*a/(i-r),c[9]=(i+r)/(i-r),c[13]=0,c[2]=0,c[6]=0,c[10]=l,c[14]=u,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,n,i,r,a,s,o=2e3){let l,u;let c=this.elements,h=1/(n-e),d=1/(i-r),p=1/(s-a);if(2e3===o)l=(s+a)*p,u=-2*p;else if(2001===o)l=a*p,u=-1*p;else throw Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return c[0]=2*h,c[4]=0,c[8]=0,c[12]=-((n+e)*h),c[1]=0,c[5]=2*d,c[9]=0,c[13]=-((i+r)*d),c[2]=0,c[6]=0,c[10]=u,c[14]=-l,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){let n=this.elements,i=e.elements;for(let e=0;e<16;e++)if(n[e]!==i[e])return!1;return!0}fromArray(e,n=0){for(let i=0;i<16;i++)this.elements[i]=e[i+n];return this}toArray(e=[],n=0){let i=this.elements;return e[n]=i[0],e[n+1]=i[1],e[n+2]=i[2],e[n+3]=i[3],e[n+4]=i[4],e[n+5]=i[5],e[n+6]=i[6],e[n+7]=i[7],e[n+8]=i[8],e[n+9]=i[9],e[n+10]=i[10],e[n+11]=i[11],e[n+12]=i[12],e[n+13]=i[13],e[n+14]=i[14],e[n+15]=i[15],e}}let e$=new eb,eQ=new eK,e0=new eb(0,0,0),e1=new eb(1,1,1),e2=new eb,e3=new eb,e4=new eb,e5=new eK,e6=new ex;class e7{constructor(e=0,n=0,i=0,r=e7.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=n,this._z=i,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,n,i,r=this._order){return this._x=e,this._y=n,this._z=i,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,n=this._order,i=!0){let r=e.elements,a=r[0],s=r[4],o=r[8],l=r[1],u=r[5],c=r[9],h=r[2],d=r[6],p=r[10];switch(n){case"XYZ":this._y=Math.asin(H(o,-1,1)),.9999999>Math.abs(o)?(this._x=Math.atan2(-c,p),this._z=Math.atan2(-s,a)):(this._x=Math.atan2(d,u),this._z=0);break;case"YXZ":this._x=Math.asin(-H(c,-1,1)),.9999999>Math.abs(c)?(this._y=Math.atan2(o,p),this._z=Math.atan2(l,u)):(this._y=Math.atan2(-h,a),this._z=0);break;case"ZXY":this._x=Math.asin(H(d,-1,1)),.9999999>Math.abs(d)?(this._y=Math.atan2(-h,p),this._z=Math.atan2(-s,u)):(this._y=0,this._z=Math.atan2(l,a));break;case"ZYX":this._y=Math.asin(-H(h,-1,1)),.9999999>Math.abs(h)?(this._x=Math.atan2(d,p),this._z=Math.atan2(l,a)):(this._x=0,this._z=Math.atan2(-s,u));break;case"YZX":this._z=Math.asin(H(l,-1,1)),.9999999>Math.abs(l)?(this._x=Math.atan2(-c,u),this._y=Math.atan2(-h,a)):(this._x=0,this._y=Math.atan2(o,p));break;case"XZY":this._z=Math.asin(-H(s,-1,1)),.9999999>Math.abs(s)?(this._x=Math.atan2(d,u),this._y=Math.atan2(o,a)):(this._x=Math.atan2(-c,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,!0===i&&this._onChangeCallback(),this}setFromQuaternion(e,n,i){return e5.makeRotationFromQuaternion(e),this.setFromRotationMatrix(e5,n,i)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return e6.setFromEuler(this),this.setFromQuaternion(e6,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}e7.DEFAULT_ORDER="XYZ";class e8{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let e=0;e1){for(let e=0;e0&&(i=i.concat(a))}return i}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(tr,e,ta),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(tr,ts,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let n=this.matrixWorld.elements;return e.set(n[8],n[9],n[10]).normalize()}raycast(){}traverse(e){e(this);let n=this.children;for(let i=0,r=n.length;i0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(r.instanceColor=this.instanceColor.toJSON())),this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=a(e.geometries,this.geometry);let n=this.geometry.parameters;if(void 0!==n&&void 0!==n.shapes){let i=n.shapes;if(Array.isArray(i))for(let n=0,r=i.length;n0){r.children=[];for(let n=0;n0){r.animations=[];for(let n=0;n0&&(i.geometries=n),r.length>0&&(i.materials=r),a.length>0&&(i.textures=a),o.length>0&&(i.images=o),l.length>0&&(i.shapes=l),u.length>0&&(i.skeletons=u),c.length>0&&(i.animations=c),h.length>0&&(i.nodes=h)}return i.object=r,i;function s(e){let n=[];for(let i in e){let r=e[i];delete r.metadata,n.push(r)}return n}}clone(e){return new this.constructor().copy(this,e)}copy(e,n=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),!0===n)for(let n=0;n0?r.multiplyScalar(1/Math.sqrt(a)):r.set(0,0,0)}static getBarycoord(e,n,i,r,a){tp.subVectors(r,n),tf.subVectors(i,n),tm.subVectors(e,n);let s=tp.dot(tp),o=tp.dot(tf),l=tp.dot(tm),u=tf.dot(tf),c=tf.dot(tm),h=s*u-o*o;if(0===h)return a.set(-2,-1,-1);let d=1/h,p=(u*l-o*c)*d,f=(s*c-o*l)*d;return a.set(1-p-f,f,p)}static containsPoint(e,n,i,r){return this.getBarycoord(e,n,i,r,tg),tg.x>=0&&tg.y>=0&&tg.x+tg.y<=1}static getUV(e,n,i,r,a,s,o,l){return!1===tS&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),tS=!0),this.getInterpolation(e,n,i,r,a,s,o,l)}static getInterpolation(e,n,i,r,a,s,o,l){return this.getBarycoord(e,n,i,r,tg),l.setScalar(0),l.addScaledVector(a,tg.x),l.addScaledVector(s,tg.y),l.addScaledVector(o,tg.z),l}static isFrontFacing(e,n,i,r){return tp.subVectors(i,n),tf.subVectors(e,n),0>tp.cross(tf).dot(r)}set(e,n,i){return this.a.copy(e),this.b.copy(n),this.c.copy(i),this}setFromPointsAndIndices(e,n,i,r){return this.a.copy(e[n]),this.b.copy(e[i]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,n,i,r){return this.a.fromBufferAttribute(e,n),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return tp.subVectors(this.c,this.b),tf.subVectors(this.a,this.b),.5*tp.cross(tf).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return tE.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return tE.getBarycoord(e,this.a,this.b,this.c,n)}getUV(e,n,i,r,a){return!1===tS&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),tS=!0),tE.getInterpolation(e,this.a,this.b,this.c,n,i,r,a)}getInterpolation(e,n,i,r,a){return tE.getInterpolation(e,this.a,this.b,this.c,n,i,r,a)}containsPoint(e){return tE.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return tE.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,n){let i,r;let a=this.a,s=this.b,o=this.c;tv.subVectors(s,a),t_.subVectors(o,a),tx.subVectors(e,a);let l=tv.dot(tx),u=t_.dot(tx);if(l<=0&&u<=0)return n.copy(a);tb.subVectors(e,s);let c=tv.dot(tb),h=t_.dot(tb);if(c>=0&&h<=c)return n.copy(s);let d=l*h-c*u;if(d<=0&&l>=0&&c<=0)return i=l/(l-c),n.copy(a).addScaledVector(tv,i);tM.subVectors(e,o);let p=tv.dot(tM),f=t_.dot(tM);if(f>=0&&p<=f)return n.copy(o);let m=p*u-l*f;if(m<=0&&u>=0&&f<=0)return r=u/(u-f),n.copy(a).addScaledVector(t_,r);let g=c*f-p*h;if(g<=0&&h-c>=0&&p-f>=0)return ty.subVectors(o,s),r=(h-c)/(h-c+(p-f)),n.copy(s).addScaledVector(ty,r);let v=1/(g+m+d);return i=m*v,r=d*v,n.copy(a).addScaledVector(tv,i).addScaledVector(t_,r)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let tT={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},tw={h:0,s:0,l:0},tA={h:0,s:0,l:0};function tR(e,n,i){return(i<0&&(i+=1),i>1&&(i-=1),i<1/6)?e+(n-e)*6*i:i<.5?n:i<2/3?e+(n-e)*6*(2/3-i):e}class tP{constructor(e,n,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,n,i)}set(e,n,i){return void 0===n&&void 0===i?e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e):this.setRGB(e,n,i),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,n=A){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,eo.toWorkingColorSpace(this,n),this}setRGB(e,n,i,r=eo.workingColorSpace){return this.r=e,this.g=n,this.b=i,eo.toWorkingColorSpace(this,r),this}setHSL(e,n,i,r=eo.workingColorSpace){if(e=V(e,1),n=H(n,0,1),i=H(i,0,1),0===n)this.r=this.g=this.b=i;else{let r=i<=.5?i*(1+n):i+n-i*n,a=2*i-r;this.r=tR(a,r,e+1/3),this.g=tR(a,r,e),this.b=tR(a,r,e-1/3)}return eo.toWorkingColorSpace(this,r),this}setStyle(e,n=A){let i;function r(n){void 0!==n&&1>parseFloat(n)&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let a;let s=i[1],o=i[2];switch(s){case"rgb":case"rgba":if(a=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return r(a[4]),this.setRGB(Math.min(255,parseInt(a[1],10))/255,Math.min(255,parseInt(a[2],10))/255,Math.min(255,parseInt(a[3],10))/255,n);if(a=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return r(a[4]),this.setRGB(Math.min(100,parseInt(a[1],10))/100,Math.min(100,parseInt(a[2],10))/100,Math.min(100,parseInt(a[3],10))/100,n);break;case"hsl":case"hsla":if(a=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return r(a[4]),this.setHSL(parseFloat(a[1])/360,parseFloat(a[2])/100,parseFloat(a[3])/100,n);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){let r=i[1],a=r.length;if(3===a)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,n);if(6===a)return this.setHex(parseInt(r,16),n);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,n);return this}setColorName(e,n=A){let i=tT[e.toLowerCase()];return void 0!==i?this.setHex(i,n):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=el(e.r),this.g=el(e.g),this.b=el(e.b),this}copyLinearToSRGB(e){return this.r=eu(e.r),this.g=eu(e.g),this.b=eu(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=A){return eo.fromWorkingColorSpace(tC.copy(this),e),65536*Math.round(H(255*tC.r,0,255))+256*Math.round(H(255*tC.g,0,255))+Math.round(H(255*tC.b,0,255))}getHexString(e=A){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=eo.workingColorSpace){let i,r;eo.fromWorkingColorSpace(tC.copy(this),n);let a=tC.r,s=tC.g,o=tC.b,l=Math.max(a,s,o),u=Math.min(a,s,o),c=(u+l)/2;if(u===l)i=0,r=0;else{let e=l-u;switch(r=c<=.5?e/(l+u):e/(2-l-u),l){case a:i=(s-o)/e+(s0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(void 0!==e)for(let n in e){let i=e[n];if(void 0===i){console.warn(`THREE.Material: parameter '${n}' has value of undefined.`);continue}let r=this[n];if(void 0===r){console.warn(`THREE.Material: '${n}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[n]=i}}toJSON(e){let n=void 0===e||"string"==typeof e;n&&(e={textures:{},images:{}});let i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};function r(e){let n=[];for(let i in e){let r=e[i];delete r.metadata,n.push(r)}return n}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),void 0!==this.roughness&&(i.roughness=this.roughness),void 0!==this.metalness&&(i.metalness=this.metalness),void 0!==this.sheen&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(i.shininess=this.shininess),void 0!==this.clearcoat&&(i.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.iridescence&&(i.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(i.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),void 0!==this.anisotropy&&(i.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(i.combine=this.combine)),void 0!==this.envMapIntensity&&(i.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(i.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(i.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(i.size=this.size),null!==this.shadowSide&&(i.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(i.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(i.blending=this.blending),this.side!==l&&(i.side=this.side),!0===this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),!0===this.transparent&&(i.transparent=!0),204!==this.blendSrc&&(i.blendSrc=this.blendSrc),205!==this.blendDst&&(i.blendDst=this.blendDst),100!==this.blendEquation&&(i.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(i.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(i.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(i.blendAlpha=this.blendAlpha),3!==this.depthFunc&&(i.depthFunc=this.depthFunc),!1===this.depthTest&&(i.depthTest=this.depthTest),!1===this.depthWrite&&(i.depthWrite=this.depthWrite),!1===this.colorWrite&&(i.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(i.stencilWriteMask=this.stencilWriteMask),519!==this.stencilFunc&&(i.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(i.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(i.stencilFuncMask=this.stencilFuncMask),7680!==this.stencilFail&&(i.stencilFail=this.stencilFail),7680!==this.stencilZFail&&(i.stencilZFail=this.stencilZFail),7680!==this.stencilZPass&&(i.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(i.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(i.rotation=this.rotation),!0===this.polygonOffset&&(i.polygonOffset=!0),0!==this.polygonOffsetFactor&&(i.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(i.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(i.linewidth=this.linewidth),void 0!==this.dashSize&&(i.dashSize=this.dashSize),void 0!==this.gapSize&&(i.gapSize=this.gapSize),void 0!==this.scale&&(i.scale=this.scale),!0===this.dithering&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),!0===this.alphaHash&&(i.alphaHash=!0),!0===this.alphaToCoverage&&(i.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(i.premultipliedAlpha=!0),!0===this.forceSinglePass&&(i.forceSinglePass=!0),!0===this.wireframe&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(i.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(i.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(i.flatShading=!0),!1===this.visible&&(i.visible=!1),!1===this.toneMapped&&(i.toneMapped=!1),!1===this.fog&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData),n){let n=r(e.textures),a=r(e.images);n.length>0&&(i.textures=n),a.length>0&&(i.images=a)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let n=e.clippingPlanes,i=null;if(null!==n){let e=n.length;i=Array(e);for(let r=0;r!==e;++r)i[r]=n[r].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){!0===e&&this.version++}}class tI extends tO{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new tP(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}let tD=new eb,tU=new Z;class tN{constructor(e,n,i=!1){if(Array.isArray(e))throw TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=n,this.count=void 0!==e?e.length/n:0,this.normalized=i,this.usage=35044,this.updateRange={offset:0,count:-1},this.gpuType=1015,this.version=0}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,n,i){e*=this.itemSize,i*=n.itemSize;for(let r=0,a=this.itemSize;r0&&(e.userData=this.userData),void 0!==this.parameters){let n=this.parameters;for(let i in n)void 0!==n[i]&&(e[i]=n[i]);return e}e.data={attributes:{}};let n=this.index;null!==n&&(e.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});let i=this.attributes;for(let n in i){let r=i[n];e.data.attributes[n]=r.toJSON(e.data)}let r={},a=!1;for(let n in this.morphAttributes){let i=this.morphAttributes[n],s=[];for(let n=0,r=i.length;n0&&(r[n]=s,a=!0)}a&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);let s=this.groups;s.length>0&&(e.data.groups=JSON.parse(JSON.stringify(s)));let o=this.boundingSphere;return null!==o&&(e.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let n={};this.name=e.name;let i=e.index;null!==i&&this.setIndex(i.clone(n));let r=e.attributes;for(let e in r){let i=r[e];this.setAttribute(e,i.clone(n))}let a=e.morphAttributes;for(let e in a){let i=[],r=a[e];for(let e=0,a=r.length;e0){let i=e[n[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,n=i.length;e(e.far-e.near)**2)||(tY.copy(a).invert(),tJ.copy(e.ray).applyMatrix4(tY),null!==i.boundingBox&&!1===tJ.intersectsBox(i.boundingBox)))return;this._computeIntersections(e,n,tJ)}}_computeIntersections(e,n,i){let r;let a=this.geometry,s=this.material,o=a.index,l=a.attributes.position,u=a.attributes.uv,c=a.attributes.uv1,h=a.attributes.normal,d=a.groups,p=a.drawRange;if(null!==o){if(Array.isArray(s))for(let a=0,l=d.length;ai.far?null:{distance:c,point:ne.clone(),object:e}}(e,n,i,r,t$,tQ,t0,t9);if(d){a&&(t3.fromBufferAttribute(a,u),t4.fromBufferAttribute(a,c),t5.fromBufferAttribute(a,h),d.uv=tE.getInterpolation(t9,t$,tQ,t0,t3,t4,t5,new Z)),s&&(t3.fromBufferAttribute(s,u),t4.fromBufferAttribute(s,c),t5.fromBufferAttribute(s,h),d.uv1=tE.getInterpolation(t9,t$,tQ,t0,t3,t4,t5,new Z),d.uv2=d.uv1),o&&(t6.fromBufferAttribute(o,u),t7.fromBufferAttribute(o,c),t8.fromBufferAttribute(o,h),d.normal=tE.getInterpolation(t9,t$,tQ,t0,t6,t7,t8,new eb),d.normal.dot(r.direction)>0&&d.normal.multiplyScalar(-1));let e={a:u,b:c,c:h,normal:new eb,materialIndex:0};tE.getNormal(t$,tQ,t0,e.normal),d.face=e}return d}class ni extends tq{constructor(e=1,n=1,i=1,r=1,a=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:n,depth:i,widthSegments:r,heightSegments:a,depthSegments:s};let o=this;r=Math.floor(r),a=Math.floor(a);let l=[],u=[],c=[],h=[],d=0,p=0;function f(e,n,i,r,a,s,f,m,g,v,_){let y=s/g,x=f/v,b=s/2,M=f/2,S=m/2,E=g+1,T=v+1,w=0,A=0,R=new eb;for(let s=0;s0?1:-1,c.push(R.x,R.y,R.z),h.push(l/g),h.push(1-s/v),w+=1}}for(let e=0;e0&&(n.defines=this.defines),n.vertexShader=this.vertexShader,n.fragmentShader=this.fragmentShader,n.lights=this.lights,n.clipping=this.clipping;let i={};for(let e in this.extensions)!0===this.extensions[e]&&(i[e]=!0);return Object.keys(i).length>0&&(n.extensions=i),n}}class nu extends td{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new eK,this.projectionMatrix=new eK,this.projectionMatrixInverse=new eK,this.coordinateSystem=2e3}copy(e,n){return super.copy(e,n),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,n){super.updateWorldMatrix(e,n),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}class nc extends nu{constructor(e=50,n=1,i=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=r,this.focus=10,this.aspect=n,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){let n=.5*this.getFilmHeight()/e;this.fov=2*B*Math.atan(n),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(.5*z*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*B*Math.atan(Math.tan(.5*z*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,n,i,r,a,s){this.aspect=e/n,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=i,this.view.offsetY=r,this.view.width=a,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,n=e*Math.tan(.5*z*this.fov)/this.zoom,i=2*n,r=this.aspect*i,a=-.5*r,s=this.view;if(null!==this.view&&this.view.enabled){let e=s.fullWidth,o=s.fullHeight;a+=s.offsetX*r/e,n-=s.offsetY*i/o,r*=s.width/e,i*=s.height/o}let o=this.filmOffset;0!==o&&(a+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(a,a+r,n,n-i,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let n=super.toJSON(e);return n.object.fov=this.fov,n.object.zoom=this.zoom,n.object.near=this.near,n.object.far=this.far,n.object.focus=this.focus,n.object.aspect=this.aspect,null!==this.view&&(n.object.view=Object.assign({},this.view)),n.object.filmGauge=this.filmGauge,n.object.filmOffset=this.filmOffset,n}}class nh extends td{constructor(e,n,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;let r=new nc(-90,1,e,n);r.layers=this.layers,this.add(r);let a=new nc(-90,1,e,n);a.layers=this.layers,this.add(a);let s=new nc(-90,1,e,n);s.layers=this.layers,this.add(s);let o=new nc(-90,1,e,n);o.layers=this.layers,this.add(o);let l=new nc(-90,1,e,n);l.layers=this.layers,this.add(l);let u=new nc(-90,1,e,n);u.layers=this.layers,this.add(u)}updateCoordinateSystem(){let e=this.coordinateSystem,n=this.children.concat(),[i,r,a,s,o,l]=n;for(let e of n)this.remove(e);if(2e3===e)i.up.set(0,1,0),i.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),a.up.set(0,0,-1),a.lookAt(0,1,0),s.up.set(0,0,1),s.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(2001===e)i.up.set(0,-1,0),i.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),a.up.set(0,0,1),a.lookAt(0,1,0),s.up.set(0,0,-1),s.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(let e of n)this.add(e),e.updateMatrixWorld()}update(e,n){null===this.parent&&this.updateMatrixWorld();let{renderTarget:i,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());let[a,s,o,l,u,c]=this.children,h=e.getRenderTarget(),d=e.getActiveCubeFace(),p=e.getActiveMipmapLevel(),f=e.xr.enabled;e.xr.enabled=!1;let m=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,r),e.render(n,a),e.setRenderTarget(i,1,r),e.render(n,s),e.setRenderTarget(i,2,r),e.render(n,o),e.setRenderTarget(i,3,r),e.render(n,l),e.setRenderTarget(i,4,r),e.render(n,u),i.texture.generateMipmaps=m,e.setRenderTarget(i,5,r),e.render(n,c),e.setRenderTarget(h,d,p),e.xr.enabled=f,i.texture.needsPMREMUpdate=!0}}class nd extends em{constructor(e,n,i,r,a,s,o,l,u,c){super(e=void 0!==e?e:[],n=void 0!==n?n:301,i,r,a,s,o,l,u,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class np extends e_{constructor(e=1,n={}){super(e,e,n),this.isWebGLCubeRenderTarget=!0;let i={width:e,height:e,depth:1};void 0!==n.encoding&&(en("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),n.colorSpace=3001===n.encoding?A:w),this.texture=new nd([i,i,i,i,i,i],n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:v}fromEquirectangularTexture(e,n){this.texture.type=n.type,this.texture.colorSpace=n.colorSpace,this.texture.generateMipmaps=n.generateMipmaps,this.texture.minFilter=n.minFilter,this.texture.magFilter=n.magFilter;let i={uniforms:{tEquirect:{value:null}},vertexShader:` varying vec3 vWorldDirection; diff --git a/package.json b/package.json index fefecc4..b03d724 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ } }, "dependencies": { - "interactjs": "^1.10.21", + "interactjs": "^1.10.23", "jsoncrush": "^1.1.8", "three": "^0.158.0" }, @@ -48,7 +48,7 @@ "@testing-library/dom": "^9.3.3", "@types/chai": "^4.3.11", "@types/jest": "^29.5.10", - "@types/node": "^20.9.4", + "@types/node": "^20.10.0", "@types/three": "^0.158.3", "chai": "^4.3.10", "ini": "^4.1.1", diff --git a/yarn.lock b/yarn.lock index 97e15b4..a078f9e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -316,10 +316,10 @@ resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz#1d572bfbbe14b7704e0ba0f39b74815b84870d70" integrity sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw== -"@interactjs/types@1.10.21": - version "1.10.21" - resolved "https://registry.yarnpkg.com/@interactjs/types/-/types-1.10.21.tgz#22da1bd76679a5340b866893e8c6b191a9bcee0c" - integrity sha512-U5N3eg9m3rLO9PrQkAaLKsSlCTRxpuMyhPBdMpicPH09icW/kIjLWQcDa3tP/I57zG0yxG6zBFREAcrjyIB3Bw== +"@interactjs/types@1.10.23": + version "1.10.23" + resolved "https://registry.yarnpkg.com/@interactjs/types/-/types-1.10.23.tgz#ed62f85cc9a821527552398b808bb3e77c83d674" + integrity sha512-8/s1gFVNW60SqFLiFQDsvJuuzICthzyOu52bu8MhLFsxFnhVfng1xzjxi2+UokQULsp0WgBsctIS9bF7se9nJQ== "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" @@ -930,10 +930,10 @@ dependencies: "@types/node" "*" -"@types/node@*", "@types/node@^20.9.4": - version "20.9.4" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.9.4.tgz#cc8f970e869c26834bdb7ed480b30ede622d74c7" - integrity sha512-wmyg8HUhcn6ACjsn8oKYjkN/zUzQeNtMy44weTJSM6p4MMzEOuKbA3OjJ267uPCOW7Xex9dyrNTful8XTQYoDA== +"@types/node@*", "@types/node@^20.10.0": + version "20.10.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.10.0.tgz#16ddf9c0a72b832ec4fcce35b8249cf149214617" + integrity sha512-D0WfRmU9TQ8I9PFx9Yc+EBHw+vSpIub4IDvQivcp26PtPrdMGAq5SDcpXEo/epqa/DXotVpekHiLNTg3iaKXBQ== dependencies: undici-types "~5.26.4" @@ -1572,9 +1572,9 @@ camelcase@^6.0.0, camelcase@^6.2.0: integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== caniuse-lite@^1.0.30001541: - version "1.0.30001564" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001564.tgz#eaa8bbc58c0cbccdcb7b41186df39dd2ba591889" - integrity sha512-DqAOf+rhof+6GVx1y+xzbFPeOumfQnhYzVnZD6LAXijR77yPtm9mfOcqOnT3mpnJiZVT+kwLAFnRlZcIz+c6bg== + version "1.0.30001565" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001565.tgz#a528b253c8a2d95d2b415e11d8b9942acc100c4f" + integrity sha512-xrE//a3O7TP0vaJ8ikzkD2c2NgcVUvsEe2IvFTntV4Yd1Z9FVzh+gW+enX96L0psrbaFMcVcH2l90xNuGDWc8w== chai@^4.3.10: version "4.3.10" @@ -2023,9 +2023,9 @@ ee-first@1.1.1: integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow== electron-to-chromium@^1.4.535: - version "1.4.590" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.590.tgz#85a428fbabb77265a4804040837ed4f2538e3300" - integrity sha512-hohItzsQcG7/FBsviCYMtQwUSWvVF7NVqPOnJCErWsAshsP/CR2LAXdmq276RbESNdhxiAq5/vRo1g2pxGXVww== + version "1.4.594" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.594.tgz#f69f207fba80735a44a988df42f3f439115d0515" + integrity sha512-xT1HVAu5xFn7bDfkjGQi9dNpMqGchUkebwf1GL7cZN32NSwwlHRPMSDJ1KN6HkS0bWUtndbSQZqvpQftKG2uFQ== emittery@^0.13.1: version "0.13.1" @@ -2676,12 +2676,12 @@ ini@^4.1.1: resolved "https://registry.yarnpkg.com/ini/-/ini-4.1.1.tgz#d95b3d843b1e906e56d6747d5447904ff50ce7a1" integrity sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g== -interactjs@^1.10.21: - version "1.10.21" - resolved "https://registry.yarnpkg.com/interactjs/-/interactjs-1.10.21.tgz#a7579bf6006ea8888fdc490f4cc33a96aa90aef0" - integrity sha512-85GdTHci8W7gFzSPfV26x69LA3Gnl64NbVYDTfw0Jo4rVvH4WAGBNjM5xV2UJwMvusmJLo2XkJDK5k7IsU87bA== +interactjs@^1.10.23: + version "1.10.23" + resolved "https://registry.yarnpkg.com/interactjs/-/interactjs-1.10.23.tgz#13b20e08ec66b9e5d43761ea39fd67f34459bc17" + integrity sha512-ZnxfYh4QBnWnnCXVOVHEU4r2w01EQMTsLCd71n0mpsItFhV7S/jXycvzgsNvf5I99trBRRwP8RJXU8oy4hRFEw== dependencies: - "@interactjs/types" "1.10.21" + "@interactjs/types" "1.10.23" internal-slot@^1.0.4: version "1.0.6"