@shopware-ag/dive 1.19.1-beta.2 → 1.19.1-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +295 -362
- package/build/chunks/PerspectiveCamera-ACx6umAu.mjs +38 -0
- package/build/chunks/PerspectiveCamera-ACx6umAu.mjs.map +1 -0
- package/build/chunks/PerspectiveCamera-BXPNOM71.cjs +2 -0
- package/build/chunks/PerspectiveCamera-BXPNOM71.cjs.map +1 -0
- package/build/chunks/fflate.module-DHdJvhNh.cjs +7 -0
- package/build/chunks/fflate.module-DHdJvhNh.cjs.map +1 -0
- package/build/chunks/fflate.module-DkZg07PZ.mjs +603 -0
- package/build/chunks/fflate.module-DkZg07PZ.mjs.map +1 -0
- package/build/chunks/file-type-error-D6aWGgyc.mjs +15 -0
- package/build/chunks/file-type-error-D6aWGgyc.mjs.map +1 -0
- package/build/chunks/file-type-error-DtvBgs64.cjs +2 -0
- package/build/chunks/file-type-error-DtvBgs64.cjs.map +1 -0
- package/build/chunks/index-C7Wx_9uY.mjs +34 -0
- package/build/chunks/index-C7Wx_9uY.mjs.map +1 -0
- package/build/chunks/index-MNP0K5dt.cjs +2 -0
- package/build/chunks/index-MNP0K5dt.cjs.map +1 -0
- package/build/chunks/network-error-C2ZDC8qS.cjs +2 -0
- package/build/chunks/network-error-C2ZDC8qS.cjs.map +1 -0
- package/build/chunks/network-error-DgecatEk.mjs +27 -0
- package/build/chunks/network-error-DgecatEk.mjs.map +1 -0
- package/build/index.cjs +57 -0
- package/build/index.cjs.map +1 -0
- package/build/index.d.ts +6 -0
- package/build/index.mjs +6884 -0
- package/build/index.mjs.map +1 -0
- package/build/src/animation/AnimationSystem.d.ts +1 -1
- package/build/src/axiscamera/AxisCamera.d.ts +2 -2
- package/build/src/com/Communication.d.ts +5 -8
- package/build/src/com/actions/scene/exportscene.d.ts +1 -1
- package/build/src/com/actions/scene/launchar.d.ts +1 -1
- package/build/src/controls/OrbitControls.d.ts +2 -2
- package/build/src/dive.d.ts +12 -29
- package/build/src/engine/Engine.d.ts +32 -0
- package/build/src/{camera → engine/camera}/PerspectiveCamera.d.ts +1 -1
- package/build/src/{scene → engine/scene}/Scene.d.ts +4 -4
- package/build/src/{scene → engine/scene}/root/Root.d.ts +2 -3
- package/build/src/error/ar-compatibility/ar-compatibility-error.d.ts +12 -0
- package/build/src/error/file-type/file-type-error.d.ts +4 -0
- package/build/src/error/index.d.ts +4 -0
- package/build/src/error/network/network-error.d.ts +5 -0
- package/build/src/error/parse/parse-error.d.ts +4 -0
- package/build/src/helper/findSceneRecursive/findSceneRecursive.d.ts +1 -1
- package/build/src/helper/getFileTypeFromUri/getFileTypeFromUri.d.ts +6 -0
- package/build/src/helper/index.d.ts +7 -0
- package/build/src/helper/isFileTypeSupported/isFileTypeSupported.d.ts +7 -0
- package/build/src/index.d.ts +2 -0
- package/build/src/math/index.d.ts +1 -1
- package/build/src/modules/_system/Module.d.ts +13 -0
- package/build/src/modules/_system/ModuleRegistry.d.ts +29 -0
- package/build/src/modules/ar/ARSystem.cjs +2 -0
- package/build/src/modules/ar/ARSystem.cjs.map +1 -0
- package/build/src/{ar/AR.d.ts → modules/ar/ARSystem.d.ts} +26 -0
- package/build/src/modules/ar/ARSystem.mjs +164 -0
- package/build/src/modules/ar/ARSystem.mjs.map +1 -0
- package/build/src/{ar → modules/ar}/arquicklook/ARQuickLook.d.ts +2 -1
- package/build/src/{ar → modules/ar}/sceneviewer/SceneViewer.d.ts +1 -1
- package/build/src/{ar → modules/ar}/webxr/WebXR.d.ts +3 -3
- package/build/src/{ar → modules/ar}/webxr/controller/WebXRController.d.ts +2 -2
- package/build/src/{ar → modules/ar}/webxr/origin/WebXROrigin.d.ts +1 -1
- package/build/src/{ar → modules/ar}/webxr/raycaster/WebXRRaycaster.d.ts +3 -3
- package/build/src/{ar → modules/ar}/webxr/raycaster/ar/WebXRRaycasterAR.d.ts +1 -1
- package/build/src/{ar → modules/ar}/webxr/raycaster/three/WebXRRaycasterTHREE.d.ts +2 -2
- package/build/src/{ar → modules/ar}/webxr/touchscreencontrols/WebXRTouchscreenControls.d.ts +1 -1
- package/build/src/modules/asset/converter/AssetConverter.cjs +2 -0
- package/build/src/modules/asset/converter/AssetConverter.cjs.map +1 -0
- package/build/src/modules/asset/converter/AssetConverter.d.ts +29 -0
- package/build/src/modules/asset/converter/AssetConverter.mjs +22 -0
- package/build/src/modules/asset/converter/AssetConverter.mjs.map +1 -0
- package/build/src/modules/asset/exporter/AssetExporter.cjs +165 -0
- package/build/src/modules/asset/exporter/AssetExporter.cjs.map +1 -0
- package/build/src/{exporter/Exporter.d.ts → modules/asset/exporter/AssetExporter.d.ts} +7 -2
- package/build/src/modules/asset/exporter/AssetExporter.mjs +1622 -0
- package/build/src/modules/asset/exporter/AssetExporter.mjs.map +1 -0
- package/build/src/modules/asset/loader/AssetLoader.cjs +3 -0
- package/build/src/modules/asset/loader/AssetLoader.cjs.map +1 -0
- package/build/src/modules/asset/loader/AssetLoader.d.ts +33 -0
- package/build/src/modules/asset/loader/AssetLoader.mjs +1924 -0
- package/build/src/modules/asset/loader/AssetLoader.mjs.map +1 -0
- package/build/src/modules/index.d.ts +10 -0
- package/build/src/modules/mediacreator/MediaCreator.cjs +2 -0
- package/build/src/modules/mediacreator/MediaCreator.cjs.map +1 -0
- package/build/src/modules/mediacreator/MediaCreator.d.ts +40 -0
- package/build/src/modules/mediacreator/MediaCreator.mjs +28 -0
- package/build/src/modules/mediacreator/MediaCreator.mjs.map +1 -0
- package/build/src/modules/systeminfo/SystemInfo.cjs +2 -0
- package/build/src/modules/systeminfo/SystemInfo.cjs.map +1 -0
- package/build/src/{info/Info.d.ts → modules/systeminfo/SystemInfo.d.ts} +40 -7
- package/build/src/modules/systeminfo/SystemInfo.mjs +115 -0
- package/build/src/modules/systeminfo/SystemInfo.mjs.map +1 -0
- package/build/src/toolbox/BaseTool.d.ts +1 -1
- package/build/src/toolbox/Toolbox.d.ts +1 -1
- package/build/src/toolbox/select/SelectTool.d.ts +1 -1
- package/build/src/toolbox/transform/TransformTool.d.ts +1 -1
- package/build/src/types/file/FileTypes.d.ts +1 -2
- package/build/src/types/index.d.ts +1 -0
- package/package.json +17 -21
- package/build/dive.cjs +0 -4025
- package/build/dive.cjs.map +0 -1
- package/build/dive.d.ts +0 -6
- package/build/dive.js +0 -4025
- package/build/dive.js.map +0 -1
- package/build/dive.mjs +0 -28200
- package/build/dive.mjs.map +0 -1
- package/build/src/converter/Converter.d.ts +0 -12
- package/build/src/io/IO.d.ts +0 -10
- package/build/src/io/gltf/GLTFIO.d.ts +0 -12
- package/build/src/loader/Loader.d.ts +0 -7
- package/build/src/mediacreator/MediaCreator.d.ts +0 -17
- package/build/src/module/Module.d.ts +0 -8
- package/build/src/types/error/index.d.ts +0 -12
- /package/build/src/{renderer → engine/renderer}/Renderer.d.ts +0 -0
- /package/build/src/{scene → engine/scene}/xrroot/XRRoot.d.ts +0 -0
- /package/build/src/{scene → engine/scene}/xrroot/xrlightroot/XRLightRoot.d.ts +0 -0
- /package/build/src/{ar → modules/ar}/webxr/crosshair/WebXRCrosshair.d.ts +0 -0
- /package/build/src/{ar → modules/ar}/webxr/overlay/Overlay.d.ts +0 -0
package/build/index.cjs
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";var g0=Object.defineProperty;var _0=(S,a,n)=>a in S?g0(S,a,{enumerable:!0,configurable:!0,writable:!0,value:n}):S[a]=n;var y=(S,a,n)=>_0(S,typeof a!="symbol"?a+"":a,n);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("three"),Nn=require("@tweenjs/tween.js"),pe=require("./chunks/PerspectiveCamera-BXPNOM71.cjs"),zs=require("three-spritetext"),Zs=require("./chunks/network-error-C2ZDC8qS.cjs"),zl=require("./chunks/file-type-error-DtvBgs64.cjs"),Qs=require("./chunks/index-MNP0K5dt.cjs"),Pl={type:"change"},Fs={type:"start"},Rl={type:"end"},_r=new u.Ray,Tl=new u.Plane,m0=Math.cos(70*u.MathUtils.DEG2RAD);class b0 extends u.EventDispatcher{constructor(a,n){super(),this.object=a,this.domElement=n,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new u.Vector3,this.cursor=new u.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:u.MOUSE.ROTATE,MIDDLE:u.MOUSE.DOLLY,RIGHT:u.MOUSE.PAN},this.touches={ONE:u.TOUCH.ROTATE,TWO:u.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return P.phi},this.getAzimuthalAngle=function(){return P.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(p){p.addEventListener("keydown",bt),this._domElementKeyEvents=p},this.stopListenToKeyEvents=function(){this._domElementKeyEvents.removeEventListener("keydown",bt),this._domElementKeyEvents=null},this.saveState=function(){r.target0.copy(r.target),r.position0.copy(r.object.position),r.zoom0=r.object.zoom},this.reset=function(){r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.zoom=r.zoom0,r.object.updateProjectionMatrix(),r.dispatchEvent(Pl),r.update(),w=f.NONE},this.update=function(){const p=new u.Vector3,R=new u.Quaternion().setFromUnitVectors(a.up,new u.Vector3(0,1,0)),F=R.clone().invert(),Q=new u.Vector3,ye=new u.Quaternion,wt=new u.Vector3,Fe=2*Math.PI;return function(Rr=null){const Kn=r.object.position;p.copy(Kn).sub(r.target),p.applyQuaternion(R),P.setFromVector3(p),r.autoRotate&&w===f.NONE&&Pt(Yn(Rr)),r.enableDamping?(P.theta+=D.theta*r.dampingFactor,P.phi+=D.phi*r.dampingFactor):(P.theta+=D.theta,P.phi+=D.phi);let ft=r.minAzimuthAngle,dt=r.maxAzimuthAngle;isFinite(ft)&&isFinite(dt)&&(ft<-Math.PI?ft+=Fe:ft>Math.PI&&(ft-=Fe),dt<-Math.PI?dt+=Fe:dt>Math.PI&&(dt-=Fe),ft<=dt?P.theta=Math.max(ft,Math.min(dt,P.theta)):P.theta=P.theta>(ft+dt)/2?Math.max(ft,P.theta):Math.min(dt,P.theta)),P.phi=Math.max(r.minPolarAngle,Math.min(r.maxPolarAngle,P.phi)),P.makeSafe(),r.enableDamping===!0?r.target.addScaledVector(le,r.dampingFactor):r.target.add(le),r.target.sub(r.cursor),r.target.clampLength(r.minTargetRadius,r.maxTargetRadius),r.target.add(r.cursor);let an=!1;if(r.zoomToCursor&&nt||r.object.isOrthographicCamera)P.radius=Ze(P.radius);else{const Qe=P.radius;P.radius=Ze(P.radius*H),an=Qe!=P.radius}if(p.setFromSpherical(P),p.applyQuaternion(F),Kn.copy(r.target).add(p),r.object.lookAt(r.target),r.enableDamping===!0?(D.theta*=1-r.dampingFactor,D.phi*=1-r.dampingFactor,le.multiplyScalar(1-r.dampingFactor)):(D.set(0,0,0),le.set(0,0,0)),r.zoomToCursor&&nt){let Qe=null;if(r.object.isPerspectiveCamera){const ln=p.length();Qe=Ze(ln*H);const Yt=ln-Qe;r.object.position.addScaledVector(Ie,Yt),r.object.updateMatrixWorld(),an=!!Yt}else if(r.object.isOrthographicCamera){const ln=new u.Vector3(ee.x,ee.y,0);ln.unproject(r.object);const Yt=r.object.zoom;r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/H)),r.object.updateProjectionMatrix(),an=Yt!==r.object.zoom;const Pi=new u.Vector3(ee.x,ee.y,0);Pi.unproject(r.object),r.object.position.sub(Pi).add(ln),r.object.updateMatrixWorld(),Qe=p.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),r.zoomToCursor=!1;Qe!==null&&(this.screenSpacePanning?r.target.set(0,0,-1).transformDirection(r.object.matrix).multiplyScalar(Qe).add(r.object.position):(_r.origin.copy(r.object.position),_r.direction.set(0,0,-1).transformDirection(r.object.matrix),Math.abs(r.object.up.dot(_r.direction))<m0?a.lookAt(r.target):(Tl.setFromNormalAndCoplanarPoint(r.object.up,r.target),_r.intersectPlane(Tl,r.target))))}else if(r.object.isOrthographicCamera){const Qe=r.object.zoom;r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/H)),Qe!==r.object.zoom&&(r.object.updateProjectionMatrix(),an=!0)}return H=1,nt=!1,an||Q.distanceToSquared(r.object.position)>g||8*(1-ye.dot(r.object.quaternion))>g||wt.distanceToSquared(r.target)>g?(r.dispatchEvent(Pl),Q.copy(r.object.position),ye.copy(r.object.quaternion),wt.copy(r.target),!0):!1}}(),this.dispose=function(){r.domElement.removeEventListener("contextmenu",Pn),r.domElement.removeEventListener("pointerdown",xi),r.domElement.removeEventListener("pointercancel",Se),r.domElement.removeEventListener("wheel",Si),r.domElement.removeEventListener("pointermove",Rt),r.domElement.removeEventListener("pointerup",Se),r.domElement.getRootNode().removeEventListener("keydown",Mi,{capture:!0}),r._domElementKeyEvents!==null&&(r._domElementKeyEvents.removeEventListener("keydown",bt),r._domElementKeyEvents=null)};const r=this,f={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let w=f.NONE;const g=1e-6,P=new u.Spherical,D=new u.Spherical;let H=1;const le=new u.Vector3,ce=new u.Vector2,Pe=new u.Vector2,Re=new u.Vector2,me=new u.Vector2,ue=new u.Vector2,q=new u.Vector2,re=new u.Vector2,ne=new u.Vector2,j=new u.Vector2,Ie=new u.Vector3,ee=new u.Vector2;let nt=!1;const Z=[],Xe={};let At=!1;function Yn(p){return p!==null?2*Math.PI/60*r.autoRotateSpeed*p:2*Math.PI/60/60*r.autoRotateSpeed}function kt(p){const R=Math.abs(p*.01);return Math.pow(.95,r.zoomSpeed*R)}function Pt(p){D.theta-=p}function zt(p){D.phi-=p}const Ge=function(){const p=new u.Vector3;return function(F,Q){p.setFromMatrixColumn(Q,0),p.multiplyScalar(-F),le.add(p)}}(),xe=function(){const p=new u.Vector3;return function(F,Q){r.screenSpacePanning===!0?p.setFromMatrixColumn(Q,1):(p.setFromMatrixColumn(Q,0),p.crossVectors(r.object.up,p)),p.multiplyScalar(F),le.add(p)}}(),je=function(){const p=new u.Vector3;return function(F,Q){const ye=r.domElement;if(r.object.isPerspectiveCamera){const wt=r.object.position;p.copy(wt).sub(r.target);let Fe=p.length();Fe*=Math.tan(r.object.fov/2*Math.PI/180),Ge(2*F*Fe/ye.clientHeight,r.object.matrix),xe(2*Q*Fe/ye.clientHeight,r.object.matrix)}else r.object.isOrthographicCamera?(Ge(F*(r.object.right-r.object.left)/r.object.zoom/ye.clientWidth,r.object.matrix),xe(Q*(r.object.top-r.object.bottom)/r.object.zoom/ye.clientHeight,r.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),r.enablePan=!1)}}();function ge(p){r.object.isPerspectiveCamera||r.object.isOrthographicCamera?H/=p:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function Te(p){r.object.isPerspectiveCamera||r.object.isOrthographicCamera?H*=p:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function _e(p,R){if(!r.zoomToCursor)return;nt=!0;const F=r.domElement.getBoundingClientRect(),Q=p-F.left,ye=R-F.top,wt=F.width,Fe=F.height;ee.x=Q/wt*2-1,ee.y=-(ye/Fe)*2+1,Ie.set(ee.x,ee.y,1).unproject(r.object).sub(r.object.position).normalize()}function Ze(p){return Math.max(r.minDistance,Math.min(r.maxDistance,p))}function we(p){ce.set(p.clientX,p.clientY)}function Ft(p){_e(p.clientX,p.clientX),re.set(p.clientX,p.clientY)}function yn(p){me.set(p.clientX,p.clientY)}function En(p){Pe.set(p.clientX,p.clientY),Re.subVectors(Pe,ce).multiplyScalar(r.rotateSpeed);const R=r.domElement;Pt(2*Math.PI*Re.x/R.clientHeight),zt(2*Math.PI*Re.y/R.clientHeight),ce.copy(Pe),r.update()}function Wt(p){ne.set(p.clientX,p.clientY),j.subVectors(ne,re),j.y>0?ge(kt(j.y)):j.y<0&&Te(kt(j.y)),re.copy(ne),r.update()}function xn(p){ue.set(p.clientX,p.clientY),q.subVectors(ue,me).multiplyScalar(r.panSpeed),je(q.x,q.y),me.copy(ue),r.update()}function Pr(p){_e(p.clientX,p.clientY),p.deltaY<0?Te(kt(p.deltaY)):p.deltaY>0&&ge(kt(p.deltaY)),r.update()}function nn(p){let R=!1;switch(p.code){case r.keys.UP:p.ctrlKey||p.metaKey||p.shiftKey?zt(2*Math.PI*r.rotateSpeed/r.domElement.clientHeight):je(0,r.keyPanSpeed),R=!0;break;case r.keys.BOTTOM:p.ctrlKey||p.metaKey||p.shiftKey?zt(-2*Math.PI*r.rotateSpeed/r.domElement.clientHeight):je(0,-r.keyPanSpeed),R=!0;break;case r.keys.LEFT:p.ctrlKey||p.metaKey||p.shiftKey?Pt(2*Math.PI*r.rotateSpeed/r.domElement.clientHeight):je(r.keyPanSpeed,0),R=!0;break;case r.keys.RIGHT:p.ctrlKey||p.metaKey||p.shiftKey?Pt(-2*Math.PI*r.rotateSpeed/r.domElement.clientHeight):je(-r.keyPanSpeed,0),R=!0;break}R&&(p.preventDefault(),r.update())}function Vt(p){if(Z.length===1)ce.set(p.pageX,p.pageY);else{const R=vt(p),F=.5*(p.pageX+R.x),Q=.5*(p.pageY+R.y);ce.set(F,Q)}}function vi(p){if(Z.length===1)me.set(p.pageX,p.pageY);else{const R=vt(p),F=.5*(p.pageX+R.x),Q=.5*(p.pageY+R.y);me.set(F,Q)}}function rn(p){const R=vt(p),F=p.pageX-R.x,Q=p.pageY-R.y,ye=Math.sqrt(F*F+Q*Q);re.set(0,ye)}function Sn(p){r.enableZoom&&rn(p),r.enablePan&&vi(p)}function wi(p){r.enableZoom&&rn(p),r.enableRotate&&Vt(p)}function ze(p){if(Z.length==1)Pe.set(p.pageX,p.pageY);else{const F=vt(p),Q=.5*(p.pageX+F.x),ye=.5*(p.pageY+F.y);Pe.set(Q,ye)}Re.subVectors(Pe,ce).multiplyScalar(r.rotateSpeed);const R=r.domElement;Pt(2*Math.PI*Re.x/R.clientHeight),zt(2*Math.PI*Re.y/R.clientHeight),ce.copy(Pe)}function Nt(p){if(Z.length===1)ue.set(p.pageX,p.pageY);else{const R=vt(p),F=.5*(p.pageX+R.x),Q=.5*(p.pageY+R.y);ue.set(F,Q)}q.subVectors(ue,me).multiplyScalar(r.panSpeed),je(q.x,q.y),me.copy(ue)}function yi(p){const R=vt(p),F=p.pageX-R.x,Q=p.pageY-R.y,ye=Math.sqrt(F*F+Q*Q);ne.set(0,ye),j.set(0,Math.pow(ne.y/re.y,r.zoomSpeed)),ge(j.y),re.copy(ne);const wt=(p.pageX+R.x)*.5,Fe=(p.pageY+R.y)*.5;_e(wt,Fe)}function ht(p){r.enableZoom&&yi(p),r.enablePan&&Nt(p)}function Ei(p){r.enableZoom&&yi(p),r.enableRotate&&ze(p)}function xi(p){r.enabled!==!1&&(Z.length===0&&(r.domElement.setPointerCapture(p.pointerId),r.domElement.addEventListener("pointermove",Rt),r.domElement.addEventListener("pointerup",Se)),!Qn(p)&&(jn(p),p.pointerType==="touch"?An(p):sn(p)))}function Rt(p){r.enabled!==!1&&(p.pointerType==="touch"?Xn(p):Mn(p))}function Se(p){switch(Zn(p),Z.length){case 0:r.domElement.releasePointerCapture(p.pointerId),r.domElement.removeEventListener("pointermove",Rt),r.domElement.removeEventListener("pointerup",Se),r.dispatchEvent(Rl),w=f.NONE;break;case 1:const R=Z[0],F=Xe[R];An({pointerId:R,pageX:F.x,pageY:F.y});break}}function sn(p){let R;switch(p.button){case 0:R=r.mouseButtons.LEFT;break;case 1:R=r.mouseButtons.MIDDLE;break;case 2:R=r.mouseButtons.RIGHT;break;default:R=-1}switch(R){case u.MOUSE.DOLLY:if(r.enableZoom===!1)return;Ft(p),w=f.DOLLY;break;case u.MOUSE.ROTATE:if(p.ctrlKey||p.metaKey||p.shiftKey){if(r.enablePan===!1)return;yn(p),w=f.PAN}else{if(r.enableRotate===!1)return;we(p),w=f.ROTATE}break;case u.MOUSE.PAN:if(p.ctrlKey||p.metaKey||p.shiftKey){if(r.enableRotate===!1)return;we(p),w=f.ROTATE}else{if(r.enablePan===!1)return;yn(p),w=f.PAN}break;default:w=f.NONE}w!==f.NONE&&r.dispatchEvent(Fs)}function Mn(p){switch(w){case f.ROTATE:if(r.enableRotate===!1)return;En(p);break;case f.DOLLY:if(r.enableZoom===!1)return;Wt(p);break;case f.PAN:if(r.enablePan===!1)return;xn(p);break}}function Si(p){r.enabled===!1||r.enableZoom===!1||w!==f.NONE||(p.preventDefault(),r.dispatchEvent(Fs),Pr(on(p)),r.dispatchEvent(Rl))}function on(p){const R=p.deltaMode,F={clientX:p.clientX,clientY:p.clientY,deltaY:p.deltaY};switch(R){case 1:F.deltaY*=16;break;case 2:F.deltaY*=100;break}return p.ctrlKey&&!At&&(F.deltaY*=10),F}function Mi(p){p.key==="Control"&&(At=!0,r.domElement.getRootNode().addEventListener("keyup",Ht,{passive:!0,capture:!0}))}function Ht(p){p.key==="Control"&&(At=!1,r.domElement.getRootNode().removeEventListener("keyup",Ht,{passive:!0,capture:!0}))}function bt(p){r.enabled===!1||r.enablePan===!1||nn(p)}function An(p){switch(Rn(p),Z.length){case 1:switch(r.touches.ONE){case u.TOUCH.ROTATE:if(r.enableRotate===!1)return;Vt(p),w=f.TOUCH_ROTATE;break;case u.TOUCH.PAN:if(r.enablePan===!1)return;vi(p),w=f.TOUCH_PAN;break;default:w=f.NONE}break;case 2:switch(r.touches.TWO){case u.TOUCH.DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;Sn(p),w=f.TOUCH_DOLLY_PAN;break;case u.TOUCH.DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;wi(p),w=f.TOUCH_DOLLY_ROTATE;break;default:w=f.NONE}break;default:w=f.NONE}w!==f.NONE&&r.dispatchEvent(Fs)}function Xn(p){switch(Rn(p),w){case f.TOUCH_ROTATE:if(r.enableRotate===!1)return;ze(p),r.update();break;case f.TOUCH_PAN:if(r.enablePan===!1)return;Nt(p),r.update();break;case f.TOUCH_DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;ht(p),r.update();break;case f.TOUCH_DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;Ei(p),r.update();break;default:w=f.NONE}}function Pn(p){r.enabled!==!1&&p.preventDefault()}function jn(p){Z.push(p.pointerId)}function Zn(p){delete Xe[p.pointerId];for(let R=0;R<Z.length;R++)if(Z[R]==p.pointerId){Z.splice(R,1);return}}function Qn(p){for(let R=0;R<Z.length;R++)if(Z[R]==p.pointerId)return!0;return!1}function Rn(p){let R=Xe[p.pointerId];R===void 0&&(R=new u.Vector2,Xe[p.pointerId]=R),R.set(p.pageX,p.pageY)}function vt(p){const R=p.pointerId===Z[0]?Z[1]:Z[0];return Xe[R]}r.domElement.addEventListener("contextmenu",Pn),r.domElement.addEventListener("pointerdown",xi),r.domElement.addEventListener("pointercancel",Se),r.domElement.addEventListener("wheel",Si,{passive:!1}),r.domElement.getRootNode().addEventListener("keydown",Mi,{passive:!0,capture:!0}),this.update()}}const yr={enableDamping:!0,dampingFactor:.04},bi=class bi extends b0{constructor(n,r,f,w=yr){super(n,r.domElement);y(this,"_animationSystem");y(this,"last",null);y(this,"animating",!1);y(this,"locked",!1);y(this,"stopMoveTo",()=>{});y(this,"stopRevertLast",()=>{});y(this,"object");y(this,"domElement");y(this,"_removePreRenderCallback",()=>{});y(this,"preRenderCallback",()=>{this.locked||this.update()});this._animationSystem=f,this.domElement=r.domElement,this.object=n;const g=r.AddPreRenderCallback(()=>{this.preRenderCallback()});this._removePreRenderCallback=()=>{r.RemovePreRenderCallback(g)},this.enableDamping=w.enableDamping||yr.enableDamping,this.dampingFactor=w.dampingFactor||yr.dampingFactor,this.object.position.set(0,2,2),this.target.copy({x:0,y:.5,z:0}),this.update()}Dispose(){this._removePreRenderCallback(),this.dispose()}ComputeEncompassingView(n){const r=n.getCenter(new u.Vector3),f=n.getSize(new u.Vector3),w=Math.max(f.x,f.y,f.z)*1.25;return{position:this.object.position.clone().normalize().multiplyScalar(w),target:r}}ZoomIn(n){const r=n||bi.DEFAULT_ZOOM_FACTOR,{minDistance:f,maxDistance:w}=this;this.minDistance=this.maxDistance=u.MathUtils.clamp(this.getDistance()-r,f+r,w-r),this.update(),this.minDistance=f,this.maxDistance=w}ZoomOut(n){const r=n||bi.DEFAULT_ZOOM_FACTOR,{minDistance:f,maxDistance:w}=this;this.minDistance=this.maxDistance=u.MathUtils.clamp(this.getDistance()+r,f+r,w-r),this.update(),this.minDistance=f,this.maxDistance=w}MoveTo(n,r,f,w){if(this.animating)return;const g=n||this.object.position.clone(),P=r||this.target.clone();this.stopRevertLast(),this.locked||(this.last={pos:this.object.position.clone(),target:this.target.clone()}),this.animating=f>0,this.locked=w,this.enabled=!1;const D=this._animationSystem.Animate(this.object.position).to(g,f).easing(Nn.Easing.Quadratic.Out).start(),H=this._animationSystem.Animate(this.target).to(P,f).easing(Nn.Easing.Quadratic.Out).onUpdate(()=>{this.object.lookAt(this.target)}).onComplete(()=>{this.animating=!1,this.enabled=!w}).start();this.stopMoveTo=()=>{D.stop(),H.stop()}}RevertLast(n){if(this.animating||!this.locked)return;this.stopMoveTo(),this.animating=n>0,this.enabled=!1;const{pos:r,target:f}=this.last,w=this._animationSystem.Animate(this.object.position).to(r,n).easing(Nn.Easing.Quadratic.Out).start(),g=this._animationSystem.Animate(this.target).to(f,n).easing(Nn.Easing.Quadratic.Out).onUpdate(()=>{this.object.lookAt(this.target)}).onComplete(()=>{this.animating=!1,this.locked=!1,this.enabled=!0}).start();this.stopRevertLast=()=>{w.stop(),g.stop()}}};y(bi,"DEFAULT_ZOOM_FACTOR",1);let Ns=bi;function Er(S,a){return S?a in S:!1}function Sr(S,a){if(S)return Er(S,a)?S:Sr(S.parent,a)}class v0{constructor(a,n){y(this,"POINTER_DRAG_THRESHOLD",.001);y(this,"name");y(this,"_canvas");y(this,"_scene");y(this,"_controller");y(this,"_pointer");y(this,"_pointerPrimaryDown");y(this,"_pointerMiddleDown");y(this,"_pointerSecondaryDown");y(this,"_lastPointerDown");y(this,"_lastPointerUp");y(this,"_raycaster");y(this,"_intersects");y(this,"_hovered");y(this,"_dragging");y(this,"_dragStart");y(this,"_dragCurrent");y(this,"_dragEnd");y(this,"_dragDelta");y(this,"_draggable");y(this,"_dragRaycastOnObjects");this.name="BaseTool",this._canvas=n.domElement,this._scene=a,this._controller=n,this._pointer=new u.Vector2,this._pointerPrimaryDown=!1,this._pointerMiddleDown=!1,this._pointerSecondaryDown=!1,this._lastPointerDown=new u.Vector2,this._lastPointerUp=new u.Vector2,this._raycaster=new u.Raycaster,this._raycaster.layers.mask=pe.PRODUCT_LAYER_MASK|pe.UI_LAYER_MASK,this._intersects=[],this._hovered=null,this._dragging=!1,this._dragStart=new u.Vector3,this._dragCurrent=new u.Vector3,this._dragEnd=new u.Vector3,this._dragDelta=new u.Vector3,this._draggable=null,this._dragRaycastOnObjects=null}get _pointerAnyDown(){return this._pointerPrimaryDown||this._pointerMiddleDown||this._pointerSecondaryDown}Activate(){}Deactivate(){}onPointerDown(a){var n;switch(a.button){case 0:{this._pointerPrimaryDown=!0;break}case 1:{this._pointerMiddleDown=!0;break}case 2:{this._pointerSecondaryDown=!0;break}default:console.warn("DIVEBaseTool.onPointerDown: Unknown button: "+a.button)}this._lastPointerDown.copy(this._pointer),this._draggable=Sr((n=this._intersects[0])==null?void 0:n.object,"isDraggable")||null}onDragStart(a){this._draggable&&(this._dragRaycastOnObjects!==null&&(this._intersects=this._raycaster.intersectObjects(this._dragRaycastOnObjects,!0)),this._intersects.length!==0&&(this._dragStart.copy(this._intersects[0].point.clone()),this._dragCurrent.copy(this._intersects[0].point.clone()),this._dragEnd.copy(this._dragStart.clone()),this._dragDelta.set(0,0,0),this._draggable&&this._draggable.onDragStart&&(this._draggable.onDragStart({dragStart:this._dragStart,dragCurrent:this._dragCurrent,dragEnd:this._dragEnd,dragDelta:this._dragDelta}),this._dragging=!0,this._controller.enabled=!1)))}onPointerMove(a){var r;this._pointer.x=a.offsetX/this._canvas.clientWidth*2-1,this._pointer.y=-(a.offsetY/this._canvas.clientHeight)*2+1,this._raycaster.setFromCamera(this._pointer,this._controller.object),this._intersects=this.raycast(this._scene.children);const n=Sr((r=this._intersects[0])==null?void 0:r.object,"isHoverable");if(this._intersects[0]&&n){if(!this._hovered){n.onPointerEnter&&n.onPointerEnter(this._intersects[0]),this._hovered=n;return}if(this._hovered.uuid!==n.uuid){this._hovered.onPointerLeave&&this._hovered.onPointerLeave(),n.onPointerEnter&&n.onPointerEnter(this._intersects[0]),this._hovered=n;return}n.onPointerOver&&n.onPointerOver(this._intersects[0]),this._hovered=n}else this._hovered&&this._hovered.onPointerLeave&&this._hovered.onPointerLeave(),this._hovered=null;this._pointerAnyDown&&(this._dragging||this.onDragStart(a),this.onDrag(a))}onDrag(a){this._dragRaycastOnObjects!==null&&(this._intersects=this._raycaster.intersectObjects(this._dragRaycastOnObjects,!0));const n=this._intersects[0];n&&(this._dragCurrent.copy(n.point.clone()),this._dragEnd.copy(n.point.clone()),this._dragDelta.subVectors(this._dragCurrent.clone(),this._dragStart.clone()),this._draggable&&this._draggable.onDrag&&this._draggable.onDrag({dragStart:this._dragStart,dragCurrent:this._dragCurrent,dragEnd:this._dragEnd,dragDelta:this._dragDelta}))}onPointerUp(a){switch(this.pointerWasDragged()||this._dragging?this._draggable&&this.onDragEnd(a):this.onClick(a),a.button){case 0:this._pointerPrimaryDown=!1;break;case 1:this._pointerMiddleDown=!1;break;case 2:this._pointerSecondaryDown=!1;break}this._lastPointerUp.copy(this._pointer)}onClick(a){}onDragEnd(a){const n=this._intersects[0];n&&(this._dragEnd.copy(n.point.clone()),this._dragCurrent.copy(n.point.clone()),this._dragDelta.subVectors(this._dragCurrent.clone(),this._dragStart.clone())),this._draggable&&this._draggable.onDragEnd&&this._draggable.onDragEnd({dragStart:this._dragStart,dragCurrent:this._dragCurrent,dragEnd:this._dragEnd,dragDelta:this._dragDelta}),this._draggable=null,this._dragging=!1,this._dragStart.set(0,0,0),this._dragCurrent.set(0,0,0),this._dragEnd.set(0,0,0),this._dragDelta.set(0,0,0),this._controller.enabled=!0}onWheel(a){}raycast(a){return a!==void 0?this._raycaster.intersectObjects(a,!0).filter(n=>n.object.visible):this._raycaster.intersectObjects(this._scene.children,!0).filter(n=>n.object.visible)}pointerWasDragged(){return this._lastPointerDown.distanceTo(this._pointer)>this.POINTER_DRAG_THRESHOLD}}const bn=new u.Raycaster,Ce=new u.Vector3,tn=new u.Vector3,oe=new u.Quaternion,Ll={X:new u.Vector3(1,0,0),Y:new u.Vector3(0,1,0),Z:new u.Vector3(0,0,1)},Ws={type:"change"},Ol={type:"mouseDown"},Dl={type:"mouseUp",mode:null},Cl={type:"objectChange"};class w0 extends u.Object3D{constructor(a,n){super(),n===void 0&&(console.warn('THREE.TransformControls: The second parameter "domElement" is now mandatory.'),n=document),this.isTransformControls=!0,this.visible=!1,this.domElement=n,this.domElement.style.touchAction="none";const r=new A0;this._gizmo=r,this.add(r);const f=new P0;this._plane=f,this.add(f);const w=this;function g(ne,j){let Ie=j;Object.defineProperty(w,ne,{get:function(){return Ie!==void 0?Ie:j},set:function(ee){Ie!==ee&&(Ie=ee,f[ne]=ee,r[ne]=ee,w.dispatchEvent({type:ne+"-changed",value:ee}),w.dispatchEvent(Ws))}}),w[ne]=j,f[ne]=j,r[ne]=j}g("camera",a),g("object",void 0),g("enabled",!0),g("axis",null),g("mode","translate"),g("translationSnap",null),g("rotationSnap",null),g("scaleSnap",null),g("space","world"),g("size",1),g("dragging",!1),g("showX",!0),g("showY",!0),g("showZ",!0);const P=new u.Vector3,D=new u.Vector3,H=new u.Quaternion,le=new u.Quaternion,ce=new u.Vector3,Pe=new u.Quaternion,Re=new u.Vector3,me=new u.Vector3,ue=new u.Vector3,q=0,re=new u.Vector3;g("worldPosition",P),g("worldPositionStart",D),g("worldQuaternion",H),g("worldQuaternionStart",le),g("cameraPosition",ce),g("cameraQuaternion",Pe),g("pointStart",Re),g("pointEnd",me),g("rotationAxis",ue),g("rotationAngle",q),g("eye",re),this._offset=new u.Vector3,this._startNorm=new u.Vector3,this._endNorm=new u.Vector3,this._cameraScale=new u.Vector3,this._parentPosition=new u.Vector3,this._parentQuaternion=new u.Quaternion,this._parentQuaternionInv=new u.Quaternion,this._parentScale=new u.Vector3,this._worldScaleStart=new u.Vector3,this._worldQuaternionInv=new u.Quaternion,this._worldScale=new u.Vector3,this._positionStart=new u.Vector3,this._quaternionStart=new u.Quaternion,this._scaleStart=new u.Vector3,this._getPointer=y0.bind(this),this._onPointerDown=x0.bind(this),this._onPointerHover=E0.bind(this),this._onPointerMove=S0.bind(this),this._onPointerUp=M0.bind(this),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointermove",this._onPointerHover),this.domElement.addEventListener("pointerup",this._onPointerUp)}updateMatrixWorld(a){this.object!==void 0&&(this.object.updateMatrixWorld(),this.object.parent===null?console.error("TransformControls: The attached 3D object must be a part of the scene graph."):this.object.parent.matrixWorld.decompose(this._parentPosition,this._parentQuaternion,this._parentScale),this.object.matrixWorld.decompose(this.worldPosition,this.worldQuaternion,this._worldScale),this._parentQuaternionInv.copy(this._parentQuaternion).invert(),this._worldQuaternionInv.copy(this.worldQuaternion).invert()),this.camera.updateMatrixWorld(),this.camera.matrixWorld.decompose(this.cameraPosition,this.cameraQuaternion,this._cameraScale),this.camera.isOrthographicCamera?this.camera.getWorldDirection(this.eye).negate():this.eye.copy(this.cameraPosition).sub(this.worldPosition).normalize(),super.updateMatrixWorld(a)}pointerHover(a){if(this.object===void 0||this.dragging===!0)return;a!==null&&bn.setFromCamera(a,this.camera);const n=Vs(this._gizmo.picker[this.mode],bn);n?this.axis=n.object.name:this.axis=null}pointerDown(a){if(!(this.object===void 0||this.dragging===!0||a!=null&&a.button!==0)&&this.axis!==null){a!==null&&bn.setFromCamera(a,this.camera);const n=Vs(this._plane,bn,!0);n&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(n.point).sub(this.worldPositionStart)),this.dragging=!0,Ol.mode=this.mode,this.dispatchEvent(Ol)}}pointerMove(a){const n=this.axis,r=this.mode,f=this.object;let w=this.space;if(r==="scale"?w="local":(n==="E"||n==="XYZE"||n==="XYZ")&&(w="world"),f===void 0||n===null||this.dragging===!1||a!==null&&a.button!==-1)return;a!==null&&bn.setFromCamera(a,this.camera);const g=Vs(this._plane,bn,!0);if(g){if(this.pointEnd.copy(g.point).sub(this.worldPositionStart),r==="translate")this._offset.copy(this.pointEnd).sub(this.pointStart),w==="local"&&n!=="XYZ"&&this._offset.applyQuaternion(this._worldQuaternionInv),n.indexOf("X")===-1&&(this._offset.x=0),n.indexOf("Y")===-1&&(this._offset.y=0),n.indexOf("Z")===-1&&(this._offset.z=0),w==="local"&&n!=="XYZ"?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),f.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(w==="local"&&(f.position.applyQuaternion(oe.copy(this._quaternionStart).invert()),n.search("X")!==-1&&(f.position.x=Math.round(f.position.x/this.translationSnap)*this.translationSnap),n.search("Y")!==-1&&(f.position.y=Math.round(f.position.y/this.translationSnap)*this.translationSnap),n.search("Z")!==-1&&(f.position.z=Math.round(f.position.z/this.translationSnap)*this.translationSnap),f.position.applyQuaternion(this._quaternionStart)),w==="world"&&(f.parent&&f.position.add(Ce.setFromMatrixPosition(f.parent.matrixWorld)),n.search("X")!==-1&&(f.position.x=Math.round(f.position.x/this.translationSnap)*this.translationSnap),n.search("Y")!==-1&&(f.position.y=Math.round(f.position.y/this.translationSnap)*this.translationSnap),n.search("Z")!==-1&&(f.position.z=Math.round(f.position.z/this.translationSnap)*this.translationSnap),f.parent&&f.position.sub(Ce.setFromMatrixPosition(f.parent.matrixWorld))));else if(r==="scale"){if(n.search("XYZ")!==-1){let P=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(P*=-1),tn.set(P,P,P)}else Ce.copy(this.pointStart),tn.copy(this.pointEnd),Ce.applyQuaternion(this._worldQuaternionInv),tn.applyQuaternion(this._worldQuaternionInv),tn.divide(Ce),n.search("X")===-1&&(tn.x=1),n.search("Y")===-1&&(tn.y=1),n.search("Z")===-1&&(tn.z=1);f.scale.copy(this._scaleStart).multiply(tn),this.scaleSnap&&(n.search("X")!==-1&&(f.scale.x=Math.round(f.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),n.search("Y")!==-1&&(f.scale.y=Math.round(f.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),n.search("Z")!==-1&&(f.scale.z=Math.round(f.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(r==="rotate"){this._offset.copy(this.pointEnd).sub(this.pointStart);const P=20/this.worldPosition.distanceTo(Ce.setFromMatrixPosition(this.camera.matrixWorld));let D=!1;n==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(Ce.copy(this.rotationAxis).cross(this.eye))*P):(n==="X"||n==="Y"||n==="Z")&&(this.rotationAxis.copy(Ll[n]),Ce.copy(Ll[n]),w==="local"&&Ce.applyQuaternion(this.worldQuaternion),Ce.cross(this.eye),Ce.length()===0?D=!0:this.rotationAngle=this._offset.dot(Ce.normalize())*P),(n==="E"||D)&&(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),w==="local"&&n!=="E"&&n!=="XYZE"?(f.quaternion.copy(this._quaternionStart),f.quaternion.multiply(oe.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),f.quaternion.copy(oe.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),f.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(Ws),this.dispatchEvent(Cl)}}pointerUp(a){a!==null&&a.button!==0||(this.dragging&&this.axis!==null&&(Dl.mode=this.mode,this.dispatchEvent(Dl)),this.dragging=!1,this.axis=null)}dispose(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerHover),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.traverse(function(a){a.geometry&&a.geometry.dispose(),a.material&&a.material.dispose()})}attach(a){return this.object=a,this.visible=!0,this}detach(){return this.object=void 0,this.visible=!1,this.axis=null,this}reset(){this.enabled&&this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent(Ws),this.dispatchEvent(Cl),this.pointStart.copy(this.pointEnd))}getRaycaster(){return bn}getMode(){return this.mode}setMode(a){this.mode=a}setTranslationSnap(a){this.translationSnap=a}setRotationSnap(a){this.rotationSnap=a}setScaleSnap(a){this.scaleSnap=a}setSize(a){this.size=a}setSpace(a){this.space=a}}function y0(S){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:S.button};{const a=this.domElement.getBoundingClientRect();return{x:(S.clientX-a.left)/a.width*2-1,y:-(S.clientY-a.top)/a.height*2+1,button:S.button}}}function E0(S){if(this.enabled)switch(S.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(S));break}}function x0(S){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(S.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(S)),this.pointerDown(this._getPointer(S)))}function S0(S){this.enabled&&this.pointerMove(this._getPointer(S))}function M0(S){this.enabled&&(this.domElement.releasePointerCapture(S.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(S)))}function Vs(S,a,n){const r=a.intersectObject(S,!0);for(let f=0;f<r.length;f++)if(r[f].object.visible||n)return r[f];return!1}const mr=new u.Euler,J=new u.Vector3(0,1,0),Il=new u.Vector3(0,0,0),Gl=new u.Matrix4,br=new u.Quaternion,xr=new u.Quaternion,St=new u.Vector3,Bl=new u.Matrix4,pi=new u.Vector3(1,0,0),vn=new u.Vector3(0,1,0),gi=new u.Vector3(0,0,1),vr=new u.Vector3,fi=new u.Vector3,di=new u.Vector3;class A0 extends u.Object3D{constructor(){super(),this.isTransformControlsGizmo=!0,this.type="TransformControlsGizmo";const a=new u.MeshBasicMaterial({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),n=new u.LineBasicMaterial({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),r=a.clone();r.opacity=.15;const f=n.clone();f.opacity=.5;const w=a.clone();w.color.setHex(16711680);const g=a.clone();g.color.setHex(65280);const P=a.clone();P.color.setHex(255);const D=a.clone();D.color.setHex(16711680),D.opacity=.5;const H=a.clone();H.color.setHex(65280),H.opacity=.5;const le=a.clone();le.color.setHex(255),le.opacity=.5;const ce=a.clone();ce.opacity=.25;const Pe=a.clone();Pe.color.setHex(16776960),Pe.opacity=.25,a.clone().color.setHex(16776960);const me=a.clone();me.color.setHex(7895160);const ue=new u.CylinderGeometry(0,.04,.1,12);ue.translate(0,.05,0);const q=new u.BoxGeometry(.08,.08,.08);q.translate(0,.04,0);const re=new u.BufferGeometry;re.setAttribute("position",new u.Float32BufferAttribute([0,0,0,1,0,0],3));const ne=new u.CylinderGeometry(.0075,.0075,.5,3);ne.translate(0,.25,0);function j(xe,je){const ge=new u.TorusGeometry(xe,.0075,3,64,je*Math.PI*2);return ge.rotateY(Math.PI/2),ge.rotateX(Math.PI/2),ge}function Ie(){const xe=new u.BufferGeometry;return xe.setAttribute("position",new u.Float32BufferAttribute([0,0,0,1,1,1],3)),xe}const ee={X:[[new u.Mesh(ue,w),[.5,0,0],[0,0,-Math.PI/2]],[new u.Mesh(ue,w),[-.5,0,0],[0,0,Math.PI/2]],[new u.Mesh(ne,w),[0,0,0],[0,0,-Math.PI/2]]],Y:[[new u.Mesh(ue,g),[0,.5,0]],[new u.Mesh(ue,g),[0,-.5,0],[Math.PI,0,0]],[new u.Mesh(ne,g)]],Z:[[new u.Mesh(ue,P),[0,0,.5],[Math.PI/2,0,0]],[new u.Mesh(ue,P),[0,0,-.5],[-Math.PI/2,0,0]],[new u.Mesh(ne,P),null,[Math.PI/2,0,0]]],XYZ:[[new u.Mesh(new u.OctahedronGeometry(.1,0),ce.clone()),[0,0,0]]],XY:[[new u.Mesh(new u.BoxGeometry(.15,.15,.01),le.clone()),[.15,.15,0]]],YZ:[[new u.Mesh(new u.BoxGeometry(.15,.15,.01),D.clone()),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new u.Mesh(new u.BoxGeometry(.15,.15,.01),H.clone()),[.15,0,.15],[-Math.PI/2,0,0]]]},nt={X:[[new u.Mesh(new u.CylinderGeometry(.2,0,.6,4),r),[.3,0,0],[0,0,-Math.PI/2]],[new u.Mesh(new u.CylinderGeometry(.2,0,.6,4),r),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new u.Mesh(new u.CylinderGeometry(.2,0,.6,4),r),[0,.3,0]],[new u.Mesh(new u.CylinderGeometry(.2,0,.6,4),r),[0,-.3,0],[0,0,Math.PI]]],Z:[[new u.Mesh(new u.CylinderGeometry(.2,0,.6,4),r),[0,0,.3],[Math.PI/2,0,0]],[new u.Mesh(new u.CylinderGeometry(.2,0,.6,4),r),[0,0,-.3],[-Math.PI/2,0,0]]],XYZ:[[new u.Mesh(new u.OctahedronGeometry(.2,0),r)]],XY:[[new u.Mesh(new u.BoxGeometry(.2,.2,.01),r),[.15,.15,0]]],YZ:[[new u.Mesh(new u.BoxGeometry(.2,.2,.01),r),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new u.Mesh(new u.BoxGeometry(.2,.2,.01),r),[.15,0,.15],[-Math.PI/2,0,0]]]},Z={START:[[new u.Mesh(new u.OctahedronGeometry(.01,2),f),null,null,null,"helper"]],END:[[new u.Mesh(new u.OctahedronGeometry(.01,2),f),null,null,null,"helper"]],DELTA:[[new u.Line(Ie(),f),null,null,null,"helper"]],X:[[new u.Line(re,f.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new u.Line(re,f.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new u.Line(re,f.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},Xe={XYZE:[[new u.Mesh(j(.5,1),me),null,[0,Math.PI/2,0]]],X:[[new u.Mesh(j(.5,.5),w)]],Y:[[new u.Mesh(j(.5,.5),g),null,[0,0,-Math.PI/2]]],Z:[[new u.Mesh(j(.5,.5),P),null,[0,Math.PI/2,0]]],E:[[new u.Mesh(j(.75,1),Pe),null,[0,Math.PI/2,0]]]},At={AXIS:[[new u.Line(re,f.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]]},Yn={XYZE:[[new u.Mesh(new u.SphereGeometry(.25,10,8),r)]],X:[[new u.Mesh(new u.TorusGeometry(.5,.1,4,24),r),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new u.Mesh(new u.TorusGeometry(.5,.1,4,24),r),[0,0,0],[Math.PI/2,0,0]]],Z:[[new u.Mesh(new u.TorusGeometry(.5,.1,4,24),r),[0,0,0],[0,0,-Math.PI/2]]],E:[[new u.Mesh(new u.TorusGeometry(.75,.1,2,24),r)]]},kt={X:[[new u.Mesh(q,w),[.5,0,0],[0,0,-Math.PI/2]],[new u.Mesh(ne,w),[0,0,0],[0,0,-Math.PI/2]],[new u.Mesh(q,w),[-.5,0,0],[0,0,Math.PI/2]]],Y:[[new u.Mesh(q,g),[0,.5,0]],[new u.Mesh(ne,g)],[new u.Mesh(q,g),[0,-.5,0],[0,0,Math.PI]]],Z:[[new u.Mesh(q,P),[0,0,.5],[Math.PI/2,0,0]],[new u.Mesh(ne,P),[0,0,0],[Math.PI/2,0,0]],[new u.Mesh(q,P),[0,0,-.5],[-Math.PI/2,0,0]]],XY:[[new u.Mesh(new u.BoxGeometry(.15,.15,.01),le),[.15,.15,0]]],YZ:[[new u.Mesh(new u.BoxGeometry(.15,.15,.01),D),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new u.Mesh(new u.BoxGeometry(.15,.15,.01),H),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new u.Mesh(new u.BoxGeometry(.1,.1,.1),ce.clone())]]},Pt={X:[[new u.Mesh(new u.CylinderGeometry(.2,0,.6,4),r),[.3,0,0],[0,0,-Math.PI/2]],[new u.Mesh(new u.CylinderGeometry(.2,0,.6,4),r),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new u.Mesh(new u.CylinderGeometry(.2,0,.6,4),r),[0,.3,0]],[new u.Mesh(new u.CylinderGeometry(.2,0,.6,4),r),[0,-.3,0],[0,0,Math.PI]]],Z:[[new u.Mesh(new u.CylinderGeometry(.2,0,.6,4),r),[0,0,.3],[Math.PI/2,0,0]],[new u.Mesh(new u.CylinderGeometry(.2,0,.6,4),r),[0,0,-.3],[-Math.PI/2,0,0]]],XY:[[new u.Mesh(new u.BoxGeometry(.2,.2,.01),r),[.15,.15,0]]],YZ:[[new u.Mesh(new u.BoxGeometry(.2,.2,.01),r),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new u.Mesh(new u.BoxGeometry(.2,.2,.01),r),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new u.Mesh(new u.BoxGeometry(.2,.2,.2),r),[0,0,0]]]},zt={X:[[new u.Line(re,f.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new u.Line(re,f.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new u.Line(re,f.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]};function Ge(xe){const je=new u.Object3D;for(const ge in xe)for(let Te=xe[ge].length;Te--;){const _e=xe[ge][Te][0].clone(),Ze=xe[ge][Te][1],we=xe[ge][Te][2],Ft=xe[ge][Te][3],yn=xe[ge][Te][4];_e.name=ge,_e.tag=yn,Ze&&_e.position.set(Ze[0],Ze[1],Ze[2]),we&&_e.rotation.set(we[0],we[1],we[2]),Ft&&_e.scale.set(Ft[0],Ft[1],Ft[2]),_e.updateMatrix();const En=_e.geometry.clone();En.applyMatrix4(_e.matrix),_e.geometry=En,_e.renderOrder=1/0,_e.position.set(0,0,0),_e.rotation.set(0,0,0),_e.scale.set(1,1,1),je.add(_e)}return je}this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=Ge(ee)),this.add(this.gizmo.rotate=Ge(Xe)),this.add(this.gizmo.scale=Ge(kt)),this.add(this.picker.translate=Ge(nt)),this.add(this.picker.rotate=Ge(Yn)),this.add(this.picker.scale=Ge(Pt)),this.add(this.helper.translate=Ge(Z)),this.add(this.helper.rotate=Ge(At)),this.add(this.helper.scale=Ge(zt)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}updateMatrixWorld(a){const r=(this.mode==="scale"?"local":this.space)==="local"?this.worldQuaternion:xr;this.gizmo.translate.visible=this.mode==="translate",this.gizmo.rotate.visible=this.mode==="rotate",this.gizmo.scale.visible=this.mode==="scale",this.helper.translate.visible=this.mode==="translate",this.helper.rotate.visible=this.mode==="rotate",this.helper.scale.visible=this.mode==="scale";let f=[];f=f.concat(this.picker[this.mode].children),f=f.concat(this.gizmo[this.mode].children),f=f.concat(this.helper[this.mode].children);for(let w=0;w<f.length;w++){const g=f[w];g.visible=!0,g.rotation.set(0,0,0),g.position.copy(this.worldPosition);let P;if(this.camera.isOrthographicCamera?P=(this.camera.top-this.camera.bottom)/this.camera.zoom:P=this.worldPosition.distanceTo(this.cameraPosition)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),g.scale.set(1,1,1).multiplyScalar(P*this.size/4),g.tag==="helper"){g.visible=!1,g.name==="AXIS"?(g.visible=!!this.axis,this.axis==="X"&&(oe.setFromEuler(mr.set(0,0,0)),g.quaternion.copy(r).multiply(oe),Math.abs(J.copy(pi).applyQuaternion(r).dot(this.eye))>.9&&(g.visible=!1)),this.axis==="Y"&&(oe.setFromEuler(mr.set(0,0,Math.PI/2)),g.quaternion.copy(r).multiply(oe),Math.abs(J.copy(vn).applyQuaternion(r).dot(this.eye))>.9&&(g.visible=!1)),this.axis==="Z"&&(oe.setFromEuler(mr.set(0,Math.PI/2,0)),g.quaternion.copy(r).multiply(oe),Math.abs(J.copy(gi).applyQuaternion(r).dot(this.eye))>.9&&(g.visible=!1)),this.axis==="XYZE"&&(oe.setFromEuler(mr.set(0,Math.PI/2,0)),J.copy(this.rotationAxis),g.quaternion.setFromRotationMatrix(Gl.lookAt(Il,J,vn)),g.quaternion.multiply(oe),g.visible=this.dragging),this.axis==="E"&&(g.visible=!1)):g.name==="START"?(g.position.copy(this.worldPositionStart),g.visible=this.dragging):g.name==="END"?(g.position.copy(this.worldPosition),g.visible=this.dragging):g.name==="DELTA"?(g.position.copy(this.worldPositionStart),g.quaternion.copy(this.worldQuaternionStart),Ce.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),Ce.applyQuaternion(this.worldQuaternionStart.clone().invert()),g.scale.copy(Ce),g.visible=this.dragging):(g.quaternion.copy(r),this.dragging?g.position.copy(this.worldPositionStart):g.position.copy(this.worldPosition),this.axis&&(g.visible=this.axis.search(g.name)!==-1));continue}g.quaternion.copy(r),this.mode==="translate"||this.mode==="scale"?(g.name==="X"&&Math.abs(J.copy(pi).applyQuaternion(r).dot(this.eye))>.99&&(g.scale.set(1e-10,1e-10,1e-10),g.visible=!1),g.name==="Y"&&Math.abs(J.copy(vn).applyQuaternion(r).dot(this.eye))>.99&&(g.scale.set(1e-10,1e-10,1e-10),g.visible=!1),g.name==="Z"&&Math.abs(J.copy(gi).applyQuaternion(r).dot(this.eye))>.99&&(g.scale.set(1e-10,1e-10,1e-10),g.visible=!1),g.name==="XY"&&Math.abs(J.copy(gi).applyQuaternion(r).dot(this.eye))<.2&&(g.scale.set(1e-10,1e-10,1e-10),g.visible=!1),g.name==="YZ"&&Math.abs(J.copy(pi).applyQuaternion(r).dot(this.eye))<.2&&(g.scale.set(1e-10,1e-10,1e-10),g.visible=!1),g.name==="XZ"&&Math.abs(J.copy(vn).applyQuaternion(r).dot(this.eye))<.2&&(g.scale.set(1e-10,1e-10,1e-10),g.visible=!1)):this.mode==="rotate"&&(br.copy(r),J.copy(this.eye).applyQuaternion(oe.copy(r).invert()),g.name.search("E")!==-1&&g.quaternion.setFromRotationMatrix(Gl.lookAt(this.eye,Il,vn)),g.name==="X"&&(oe.setFromAxisAngle(pi,Math.atan2(-J.y,J.z)),oe.multiplyQuaternions(br,oe),g.quaternion.copy(oe)),g.name==="Y"&&(oe.setFromAxisAngle(vn,Math.atan2(J.x,J.z)),oe.multiplyQuaternions(br,oe),g.quaternion.copy(oe)),g.name==="Z"&&(oe.setFromAxisAngle(gi,Math.atan2(J.y,J.x)),oe.multiplyQuaternions(br,oe),g.quaternion.copy(oe))),g.visible=g.visible&&(g.name.indexOf("X")===-1||this.showX),g.visible=g.visible&&(g.name.indexOf("Y")===-1||this.showY),g.visible=g.visible&&(g.name.indexOf("Z")===-1||this.showZ),g.visible=g.visible&&(g.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),g.material._color=g.material._color||g.material.color.clone(),g.material._opacity=g.material._opacity||g.material.opacity,g.material.color.copy(g.material._color),g.material.opacity=g.material._opacity,this.enabled&&this.axis&&(g.name===this.axis||this.axis.split("").some(function(D){return g.name===D}))&&(g.material.color.setHex(16776960),g.material.opacity=1)}super.updateMatrixWorld(a)}}class P0 extends u.Mesh{constructor(){super(new u.PlaneGeometry(1e5,1e5,2,2),new u.MeshBasicMaterial({visible:!1,wireframe:!0,side:u.DoubleSide,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(a){let n=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(n="local"),vr.copy(pi).applyQuaternion(n==="local"?this.worldQuaternion:xr),fi.copy(vn).applyQuaternion(n==="local"?this.worldQuaternion:xr),di.copy(gi).applyQuaternion(n==="local"?this.worldQuaternion:xr),J.copy(fi),this.mode){case"translate":case"scale":switch(this.axis){case"X":J.copy(this.eye).cross(vr),St.copy(vr).cross(J);break;case"Y":J.copy(this.eye).cross(fi),St.copy(fi).cross(J);break;case"Z":J.copy(this.eye).cross(di),St.copy(di).cross(J);break;case"XY":St.copy(di);break;case"YZ":St.copy(vr);break;case"XZ":J.copy(di),St.copy(fi);break;case"XYZ":case"E":St.set(0,0,0);break}break;case"rotate":default:St.set(0,0,0)}St.length()===0?this.quaternion.copy(this.cameraQuaternion):(Bl.lookAt(Ce.set(0,0,0),St,J),this.quaternion.setFromRotationMatrix(Bl)),super.updateMatrixWorld(a)}}const Fl="#c20017",Wl="#00ab26",Vl="#0081d4",Hs=Fl,Ys=Wl,Xs=Vl;class R0 extends v0{constructor(n,r){super(n,r);y(this,"isTransformTool",!0);y(this,"_scaleLinked");y(this,"_gizmo");this.name="DIVETransformTool",this._scaleLinked=!1,this._gizmo=this.initGizmo(),this._scene.add(this._gizmo)}Activate(){}SetGizmoMode(n){this._gizmo.mode=n}SetGizmoVisibility(n){const r=this._scene.children.includes(this._gizmo);n&&!r?(this._scene.add(this._gizmo),"isTransformControls"in this._gizmo&&this._gizmo.getRaycaster().layers.enableAll()):!n&&r&&(this._scene.remove(this._gizmo),"isTransformControls"in this._gizmo&&this._gizmo.getRaycaster().layers.disableAll())}SetGizmoScaleLinked(n){this._scaleLinked=n}initGizmo(){const n=new w0(this._controller.object,this._controller.domElement);return n.mode="translate",n.traverse(r=>{if(!("isMesh"in r))return;const f=r.material;r.name==="X"&&f.color.set(Hs),r.name==="Y"&&f.color.set(Ys),r.name==="Z"&&f.color.set(Xs),r.name==="XY"&&f.color.set(Xs),r.name==="YZ"&&f.color.set(Hs),r.name==="XZ"&&f.color.set(Ys)}),n.addEventListener("mouseDown",()=>{this._controller.enabled=!1,Er(n.object,"isMovable")&&n.object.onMoveStart&&n.object.onMoveStart()}),n.addEventListener("objectChange",()=>{if(Er(n.object,"isMovable")&&n.object.onMove&&(n.object.onMove(),this._scaleLinked)){const r=n.object.scale,f=(r.x+r.y+r.z)/3;n.object.scale.set(f,f,f)}}),n.addEventListener("mouseUp",()=>{this._controller.enabled=!0,Er(n.object,"isMovable")&&n.object.onMoveEnd&&n.object.onMoveEnd()}),n}}const Ul=S=>S.isSelectTool!==void 0;class T0 extends R0{constructor(n,r){super(n,r);y(this,"isSelectTool",!0);this.name="SelectTool"}Activate(){}Select(n){this.AttachGizmo(n),n.onSelect&&n.onSelect()}Deselect(n){this.DetachGizmo(),n.onDeselect&&n.onDeselect()}AttachGizmo(n){if("isMovable"in n){const r=n;this._gizmo.attach(r),this.SetGizmoVisibility(r.visible)}}DetachGizmo(){this._gizmo.detach()}onClick(n){super.onClick(n);const r=this._raycaster.intersectObjects(this._scene.Root.children,!0).filter(w=>w.object.visible)[0],f=Sr(r==null?void 0:r.object,"isSelectable");if(!r||!f){this._gizmo.object&&this.Deselect(this._gizmo.object);return}if(this._gizmo.object){if(this._gizmo.object.uuid===f.uuid)return;this.Deselect(this._gizmo.object)}this.Select(f)}}class Nl{constructor(a,n){y(this,"_scene");y(this,"_controller");y(this,"_activeTool");y(this,"_selectTool");this._scene=a,this._controller=n,this._selectTool=null,this._activeTool=null}get selectTool(){return this._selectTool||(this._selectTool=new T0(this._scene,this._controller)),this._selectTool}Dispose(){this.removeEventListeners()}GetActiveTool(){return this._activeTool}UseTool(a){var n;switch((n=this._activeTool)==null||n.Deactivate(),a){case"select":{this.addEventListeners(),this.selectTool.Activate(),this._activeTool=this.selectTool;break}case"none":{this.removeEventListeners(),this._activeTool=null;break}default:console.warn(`DIVEToolBox.UseTool: Unknown tool: ${a}`)}}SetGizmoMode(a){this.selectTool.SetGizmoMode(a)}SetGizmoVisibility(a){this.selectTool.SetGizmoVisibility(a)}SetGizmoScaleLinked(a){this.selectTool.SetGizmoScaleLinked(a)}onPointerMove(a){var n;(n=this._activeTool)==null||n.onPointerMove(a)}onPointerDown(a){var n;(n=this._activeTool)==null||n.onPointerDown(a)}onPointerUp(a){var n;(n=this._activeTool)==null||n.onPointerUp(a)}onWheel(a){var n;(n=this._activeTool)==null||n.onWheel(a)}addEventListeners(){this._controller.domElement.addEventListener("pointermove",a=>this.onPointerMove(a)),this._controller.domElement.addEventListener("pointerdown",a=>this.onPointerDown(a)),this._controller.domElement.addEventListener("pointerup",a=>this.onPointerUp(a)),this._controller.domElement.addEventListener("wheel",a=>this.onWheel(a))}removeEventListeners(){this._controller.domElement.removeEventListener("pointermove",a=>this.onPointerMove(a)),this._controller.domElement.removeEventListener("pointerdown",a=>this.onPointerDown(a)),this._controller.domElement.removeEventListener("pointerup",a=>this.onPointerUp(a)),this._controller.domElement.removeEventListener("wheel",a=>this.onWheel(a))}}y(Nl,"DefaultTool","select");const De=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];function L0(){const S=Math.random()*4294967295|0,a=Math.random()*4294967295|0,n=Math.random()*4294967295|0,r=Math.random()*4294967295|0;return(De[S&255]+De[S>>8&255]+De[S>>16&255]+De[S>>24&255]+"-"+De[a&255]+De[a>>8&255]+"-"+De[a>>16&15|64]+De[a>>24&255]+"-"+De[n&63|128]+De[n>>8&255]+"-"+De[n>>16&255]+De[n>>24&255]+De[r&255]+De[r>>8&255]+De[r>>16&255]+De[r>>24&255]).toLowerCase()}var wr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},_i={exports:{}};/**
|
|
2
|
+
* @license
|
|
3
|
+
* Lodash <https://lodash.com/>
|
|
4
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
5
|
+
* Released under MIT license <https://lodash.com/license>
|
|
6
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
7
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
8
|
+
*/var O0=_i.exports,kl;function D0(){return kl||(kl=1,function(S,a){(function(){var n,r="4.17.21",f=200,w="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",g="Expected a function",P="Invalid `variable` option passed into `_.template`",D="__lodash_hash_undefined__",H=500,le="__lodash_placeholder__",ce=1,Pe=2,Re=4,me=1,ue=2,q=1,re=2,ne=4,j=8,Ie=16,ee=32,nt=64,Z=128,Xe=256,At=512,Yn=30,kt="...",Pt=800,zt=16,Ge=1,xe=2,je=3,ge=1/0,Te=9007199254740991,_e=17976931348623157e292,Ze=NaN,we=4294967295,Ft=we-1,yn=we>>>1,En=[["ary",Z],["bind",q],["bindKey",re],["curry",j],["curryRight",Ie],["flip",At],["partial",ee],["partialRight",nt],["rearg",Xe]],Wt="[object Arguments]",xn="[object Array]",Pr="[object AsyncFunction]",nn="[object Boolean]",Vt="[object Date]",vi="[object DOMException]",rn="[object Error]",Sn="[object Function]",wi="[object GeneratorFunction]",ze="[object Map]",Nt="[object Number]",yi="[object Null]",ht="[object Object]",Ei="[object Promise]",xi="[object Proxy]",Rt="[object RegExp]",Se="[object Set]",sn="[object String]",Mn="[object Symbol]",Si="[object Undefined]",on="[object WeakMap]",Mi="[object WeakSet]",Ht="[object ArrayBuffer]",bt="[object DataView]",An="[object Float32Array]",Xn="[object Float64Array]",Pn="[object Int8Array]",jn="[object Int16Array]",Zn="[object Int32Array]",Qn="[object Uint8Array]",Rn="[object Uint8ClampedArray]",vt="[object Uint16Array]",Ai="[object Uint32Array]",p=/\b__p \+= '';/g,R=/\b(__p \+=) '' \+/g,F=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Q=/&(?:amp|lt|gt|quot|#39);/g,ye=/[&<>"']/g,wt=RegExp(Q.source),Fe=RegExp(ye.source),Js=/<%-([\s\S]+?)%>/g,Rr=/<%([\s\S]+?)%>/g,Kn=/<%=([\s\S]+?)%>/g,ft=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,dt=/^\w*$/,an=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Qe=/[\\^$.*+?()[\]{}|]/g,ln=RegExp(Qe.source),Yt=/^\s+/,Pi=/\s/,jl=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Zl=/\{\n\/\* \[wrapped with (.+)\] \*/,Ql=/,? & /,Kl=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ql=/[()=,{}\[\]\/\s]/,$l=/\\(\\)?/g,Jl=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,eo=/\w*$/,ec=/^[-+]0x[0-9a-f]+$/i,tc=/^0b[01]+$/i,nc=/^\[object .+?Constructor\]$/,ic=/^0o[0-7]+$/i,rc=/^(?:0|[1-9]\d*)$/,sc=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ri=/($^)/,oc=/['\n\r\u2028\u2029\\]/g,Ti="\\ud800-\\udfff",ac="\\u0300-\\u036f",lc="\\ufe20-\\ufe2f",cc="\\u20d0-\\u20ff",to=ac+lc+cc,no="\\u2700-\\u27bf",io="a-z\\xdf-\\xf6\\xf8-\\xff",uc="\\xac\\xb1\\xd7\\xf7",hc="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",fc="\\u2000-\\u206f",dc=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ro="A-Z\\xc0-\\xd6\\xd8-\\xde",so="\\ufe0e\\ufe0f",oo=uc+hc+fc+dc,Tr="['’]",pc="["+Ti+"]",ao="["+oo+"]",Li="["+to+"]",lo="\\d+",gc="["+no+"]",co="["+io+"]",uo="[^"+Ti+oo+lo+no+io+ro+"]",Lr="\\ud83c[\\udffb-\\udfff]",_c="(?:"+Li+"|"+Lr+")",ho="[^"+Ti+"]",Or="(?:\\ud83c[\\udde6-\\uddff]){2}",Dr="[\\ud800-\\udbff][\\udc00-\\udfff]",Tn="["+ro+"]",fo="\\u200d",po="(?:"+co+"|"+uo+")",mc="(?:"+Tn+"|"+uo+")",go="(?:"+Tr+"(?:d|ll|m|re|s|t|ve))?",_o="(?:"+Tr+"(?:D|LL|M|RE|S|T|VE))?",mo=_c+"?",bo="["+so+"]?",bc="(?:"+fo+"(?:"+[ho,Or,Dr].join("|")+")"+bo+mo+")*",vc="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",wc="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",vo=bo+mo+bc,yc="(?:"+[gc,Or,Dr].join("|")+")"+vo,Ec="(?:"+[ho+Li+"?",Li,Or,Dr,pc].join("|")+")",xc=RegExp(Tr,"g"),Sc=RegExp(Li,"g"),Cr=RegExp(Lr+"(?="+Lr+")|"+Ec+vo,"g"),Mc=RegExp([Tn+"?"+co+"+"+go+"(?="+[ao,Tn,"$"].join("|")+")",mc+"+"+_o+"(?="+[ao,Tn+po,"$"].join("|")+")",Tn+"?"+po+"+"+go,Tn+"+"+_o,wc,vc,lo,yc].join("|"),"g"),Ac=RegExp("["+fo+Ti+to+so+"]"),Pc=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Rc=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Tc=-1,ie={};ie[An]=ie[Xn]=ie[Pn]=ie[jn]=ie[Zn]=ie[Qn]=ie[Rn]=ie[vt]=ie[Ai]=!0,ie[Wt]=ie[xn]=ie[Ht]=ie[nn]=ie[bt]=ie[Vt]=ie[rn]=ie[Sn]=ie[ze]=ie[Nt]=ie[ht]=ie[Rt]=ie[Se]=ie[sn]=ie[on]=!1;var te={};te[Wt]=te[xn]=te[Ht]=te[bt]=te[nn]=te[Vt]=te[An]=te[Xn]=te[Pn]=te[jn]=te[Zn]=te[ze]=te[Nt]=te[ht]=te[Rt]=te[Se]=te[sn]=te[Mn]=te[Qn]=te[Rn]=te[vt]=te[Ai]=!0,te[rn]=te[Sn]=te[on]=!1;var Lc={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Oc={"&":"&","<":"<",">":">",'"':""","'":"'"},Dc={"&":"&","<":"<",">":">",""":'"',"'":"'"},Cc={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ic=parseFloat,Gc=parseInt,wo=typeof wr=="object"&&wr&&wr.Object===Object&&wr,Bc=typeof self=="object"&&self&&self.Object===Object&&self,Me=wo||Bc||Function("return this")(),Ir=a&&!a.nodeType&&a,cn=Ir&&!0&&S&&!S.nodeType&&S,yo=cn&&cn.exports===Ir,Gr=yo&&wo.process,it=function(){try{var _=cn&&cn.require&&cn.require("util").types;return _||Gr&&Gr.binding&&Gr.binding("util")}catch{}}(),Eo=it&&it.isArrayBuffer,xo=it&&it.isDate,So=it&&it.isMap,Mo=it&&it.isRegExp,Ao=it&&it.isSet,Po=it&&it.isTypedArray;function Ke(_,v,b){switch(b.length){case 0:return _.call(v);case 1:return _.call(v,b[0]);case 2:return _.call(v,b[0],b[1]);case 3:return _.call(v,b[0],b[1],b[2])}return _.apply(v,b)}function Uc(_,v,b,T){for(var G=-1,Y=_==null?0:_.length;++G<Y;){var be=_[G];v(T,be,b(be),_)}return T}function rt(_,v){for(var b=-1,T=_==null?0:_.length;++b<T&&v(_[b],b,_)!==!1;);return _}function kc(_,v){for(var b=_==null?0:_.length;b--&&v(_[b],b,_)!==!1;);return _}function Ro(_,v){for(var b=-1,T=_==null?0:_.length;++b<T;)if(!v(_[b],b,_))return!1;return!0}function Xt(_,v){for(var b=-1,T=_==null?0:_.length,G=0,Y=[];++b<T;){var be=_[b];v(be,b,_)&&(Y[G++]=be)}return Y}function Oi(_,v){var b=_==null?0:_.length;return!!b&&Ln(_,v,0)>-1}function Br(_,v,b){for(var T=-1,G=_==null?0:_.length;++T<G;)if(b(v,_[T]))return!0;return!1}function se(_,v){for(var b=-1,T=_==null?0:_.length,G=Array(T);++b<T;)G[b]=v(_[b],b,_);return G}function jt(_,v){for(var b=-1,T=v.length,G=_.length;++b<T;)_[G+b]=v[b];return _}function Ur(_,v,b,T){var G=-1,Y=_==null?0:_.length;for(T&&Y&&(b=_[++G]);++G<Y;)b=v(b,_[G],G,_);return b}function zc(_,v,b,T){var G=_==null?0:_.length;for(T&&G&&(b=_[--G]);G--;)b=v(b,_[G],G,_);return b}function kr(_,v){for(var b=-1,T=_==null?0:_.length;++b<T;)if(v(_[b],b,_))return!0;return!1}var Fc=zr("length");function Wc(_){return _.split("")}function Vc(_){return _.match(Kl)||[]}function To(_,v,b){var T;return b(_,function(G,Y,be){if(v(G,Y,be))return T=Y,!1}),T}function Di(_,v,b,T){for(var G=_.length,Y=b+(T?1:-1);T?Y--:++Y<G;)if(v(_[Y],Y,_))return Y;return-1}function Ln(_,v,b){return v===v?eu(_,v,b):Di(_,Lo,b)}function Nc(_,v,b,T){for(var G=b-1,Y=_.length;++G<Y;)if(T(_[G],v))return G;return-1}function Lo(_){return _!==_}function Oo(_,v){var b=_==null?0:_.length;return b?Wr(_,v)/b:Ze}function zr(_){return function(v){return v==null?n:v[_]}}function Fr(_){return function(v){return _==null?n:_[v]}}function Do(_,v,b,T,G){return G(_,function(Y,be,$){b=T?(T=!1,Y):v(b,Y,be,$)}),b}function Hc(_,v){var b=_.length;for(_.sort(v);b--;)_[b]=_[b].value;return _}function Wr(_,v){for(var b,T=-1,G=_.length;++T<G;){var Y=v(_[T]);Y!==n&&(b=b===n?Y:b+Y)}return b}function Vr(_,v){for(var b=-1,T=Array(_);++b<_;)T[b]=v(b);return T}function Yc(_,v){return se(v,function(b){return[b,_[b]]})}function Co(_){return _&&_.slice(0,Uo(_)+1).replace(Yt,"")}function qe(_){return function(v){return _(v)}}function Nr(_,v){return se(v,function(b){return _[b]})}function qn(_,v){return _.has(v)}function Io(_,v){for(var b=-1,T=_.length;++b<T&&Ln(v,_[b],0)>-1;);return b}function Go(_,v){for(var b=_.length;b--&&Ln(v,_[b],0)>-1;);return b}function Xc(_,v){for(var b=_.length,T=0;b--;)_[b]===v&&++T;return T}var jc=Fr(Lc),Zc=Fr(Oc);function Qc(_){return"\\"+Cc[_]}function Kc(_,v){return _==null?n:_[v]}function On(_){return Ac.test(_)}function qc(_){return Pc.test(_)}function $c(_){for(var v,b=[];!(v=_.next()).done;)b.push(v.value);return b}function Hr(_){var v=-1,b=Array(_.size);return _.forEach(function(T,G){b[++v]=[G,T]}),b}function Bo(_,v){return function(b){return _(v(b))}}function Zt(_,v){for(var b=-1,T=_.length,G=0,Y=[];++b<T;){var be=_[b];(be===v||be===le)&&(_[b]=le,Y[G++]=b)}return Y}function Ci(_){var v=-1,b=Array(_.size);return _.forEach(function(T){b[++v]=T}),b}function Jc(_){var v=-1,b=Array(_.size);return _.forEach(function(T){b[++v]=[T,T]}),b}function eu(_,v,b){for(var T=b-1,G=_.length;++T<G;)if(_[T]===v)return T;return-1}function tu(_,v,b){for(var T=b+1;T--;)if(_[T]===v)return T;return T}function Dn(_){return On(_)?iu(_):Fc(_)}function pt(_){return On(_)?ru(_):Wc(_)}function Uo(_){for(var v=_.length;v--&&Pi.test(_.charAt(v)););return v}var nu=Fr(Dc);function iu(_){for(var v=Cr.lastIndex=0;Cr.test(_);)++v;return v}function ru(_){return _.match(Cr)||[]}function su(_){return _.match(Mc)||[]}var ou=function _(v){v=v==null?Me:Cn.defaults(Me.Object(),v,Cn.pick(Me,Rc));var b=v.Array,T=v.Date,G=v.Error,Y=v.Function,be=v.Math,$=v.Object,Yr=v.RegExp,au=v.String,st=v.TypeError,Ii=b.prototype,lu=Y.prototype,In=$.prototype,Gi=v["__core-js_shared__"],Bi=lu.toString,K=In.hasOwnProperty,cu=0,ko=function(){var e=/[^.]+$/.exec(Gi&&Gi.keys&&Gi.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Ui=In.toString,uu=Bi.call($),hu=Me._,fu=Yr("^"+Bi.call(K).replace(Qe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ki=yo?v.Buffer:n,Qt=v.Symbol,zi=v.Uint8Array,zo=ki?ki.allocUnsafe:n,Fi=Bo($.getPrototypeOf,$),Fo=$.create,Wo=In.propertyIsEnumerable,Wi=Ii.splice,Vo=Qt?Qt.isConcatSpreadable:n,$n=Qt?Qt.iterator:n,un=Qt?Qt.toStringTag:n,Vi=function(){try{var e=gn($,"defineProperty");return e({},"",{}),e}catch{}}(),du=v.clearTimeout!==Me.clearTimeout&&v.clearTimeout,pu=T&&T.now!==Me.Date.now&&T.now,gu=v.setTimeout!==Me.setTimeout&&v.setTimeout,Ni=be.ceil,Hi=be.floor,Xr=$.getOwnPropertySymbols,_u=ki?ki.isBuffer:n,No=v.isFinite,mu=Ii.join,bu=Bo($.keys,$),ve=be.max,Le=be.min,vu=T.now,wu=v.parseInt,Ho=be.random,yu=Ii.reverse,jr=gn(v,"DataView"),Jn=gn(v,"Map"),Zr=gn(v,"Promise"),Gn=gn(v,"Set"),ei=gn(v,"WeakMap"),ti=gn($,"create"),Yi=ei&&new ei,Bn={},Eu=_n(jr),xu=_n(Jn),Su=_n(Zr),Mu=_n(Gn),Au=_n(ei),Xi=Qt?Qt.prototype:n,ni=Xi?Xi.valueOf:n,Yo=Xi?Xi.toString:n;function l(e){if(he(e)&&!B(e)&&!(e instanceof V)){if(e instanceof ot)return e;if(K.call(e,"__wrapped__"))return Xa(e)}return new ot(e)}var Un=function(){function e(){}return function(t){if(!ae(t))return{};if(Fo)return Fo(t);e.prototype=t;var i=new e;return e.prototype=n,i}}();function ji(){}function ot(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=n}l.templateSettings={escape:Js,evaluate:Rr,interpolate:Kn,variable:"",imports:{_:l}},l.prototype=ji.prototype,l.prototype.constructor=l,ot.prototype=Un(ji.prototype),ot.prototype.constructor=ot;function V(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=we,this.__views__=[]}function Pu(){var e=new V(this.__wrapped__);return e.__actions__=We(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=We(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=We(this.__views__),e}function Ru(){if(this.__filtered__){var e=new V(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e}function Tu(){var e=this.__wrapped__.value(),t=this.__dir__,i=B(e),s=t<0,o=i?e.length:0,c=Wh(0,o,this.__views__),h=c.start,d=c.end,m=d-h,E=s?d:h-1,x=this.__iteratees__,M=x.length,A=0,L=Le(m,this.__takeCount__);if(!i||!s&&o==m&&L==m)return ga(e,this.__actions__);var C=[];e:for(;m--&&A<L;){E+=t;for(var k=-1,I=e[E];++k<M;){var W=x[k],N=W.iteratee,et=W.type,ke=N(I);if(et==xe)I=ke;else if(!ke){if(et==Ge)continue e;break e}}C[A++]=I}return C}V.prototype=Un(ji.prototype),V.prototype.constructor=V;function hn(e){var t=-1,i=e==null?0:e.length;for(this.clear();++t<i;){var s=e[t];this.set(s[0],s[1])}}function Lu(){this.__data__=ti?ti(null):{},this.size=0}function Ou(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}function Du(e){var t=this.__data__;if(ti){var i=t[e];return i===D?n:i}return K.call(t,e)?t[e]:n}function Cu(e){var t=this.__data__;return ti?t[e]!==n:K.call(t,e)}function Iu(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=ti&&t===n?D:t,this}hn.prototype.clear=Lu,hn.prototype.delete=Ou,hn.prototype.get=Du,hn.prototype.has=Cu,hn.prototype.set=Iu;function Tt(e){var t=-1,i=e==null?0:e.length;for(this.clear();++t<i;){var s=e[t];this.set(s[0],s[1])}}function Gu(){this.__data__=[],this.size=0}function Bu(e){var t=this.__data__,i=Zi(t,e);if(i<0)return!1;var s=t.length-1;return i==s?t.pop():Wi.call(t,i,1),--this.size,!0}function Uu(e){var t=this.__data__,i=Zi(t,e);return i<0?n:t[i][1]}function ku(e){return Zi(this.__data__,e)>-1}function zu(e,t){var i=this.__data__,s=Zi(i,e);return s<0?(++this.size,i.push([e,t])):i[s][1]=t,this}Tt.prototype.clear=Gu,Tt.prototype.delete=Bu,Tt.prototype.get=Uu,Tt.prototype.has=ku,Tt.prototype.set=zu;function Lt(e){var t=-1,i=e==null?0:e.length;for(this.clear();++t<i;){var s=e[t];this.set(s[0],s[1])}}function Fu(){this.size=0,this.__data__={hash:new hn,map:new(Jn||Tt),string:new hn}}function Wu(e){var t=or(this,e).delete(e);return this.size-=t?1:0,t}function Vu(e){return or(this,e).get(e)}function Nu(e){return or(this,e).has(e)}function Hu(e,t){var i=or(this,e),s=i.size;return i.set(e,t),this.size+=i.size==s?0:1,this}Lt.prototype.clear=Fu,Lt.prototype.delete=Wu,Lt.prototype.get=Vu,Lt.prototype.has=Nu,Lt.prototype.set=Hu;function fn(e){var t=-1,i=e==null?0:e.length;for(this.__data__=new Lt;++t<i;)this.add(e[t])}function Yu(e){return this.__data__.set(e,D),this}function Xu(e){return this.__data__.has(e)}fn.prototype.add=fn.prototype.push=Yu,fn.prototype.has=Xu;function gt(e){var t=this.__data__=new Tt(e);this.size=t.size}function ju(){this.__data__=new Tt,this.size=0}function Zu(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i}function Qu(e){return this.__data__.get(e)}function Ku(e){return this.__data__.has(e)}function qu(e,t){var i=this.__data__;if(i instanceof Tt){var s=i.__data__;if(!Jn||s.length<f-1)return s.push([e,t]),this.size=++i.size,this;i=this.__data__=new Lt(s)}return i.set(e,t),this.size=i.size,this}gt.prototype.clear=ju,gt.prototype.delete=Zu,gt.prototype.get=Qu,gt.prototype.has=Ku,gt.prototype.set=qu;function Xo(e,t){var i=B(e),s=!i&&mn(e),o=!i&&!s&&en(e),c=!i&&!s&&!o&&Wn(e),h=i||s||o||c,d=h?Vr(e.length,au):[],m=d.length;for(var E in e)(t||K.call(e,E))&&!(h&&(E=="length"||o&&(E=="offset"||E=="parent")||c&&(E=="buffer"||E=="byteLength"||E=="byteOffset")||It(E,m)))&&d.push(E);return d}function jo(e){var t=e.length;return t?e[ss(0,t-1)]:n}function $u(e,t){return ar(We(e),dn(t,0,e.length))}function Ju(e){return ar(We(e))}function Qr(e,t,i){(i!==n&&!_t(e[t],i)||i===n&&!(t in e))&&Ot(e,t,i)}function ii(e,t,i){var s=e[t];(!(K.call(e,t)&&_t(s,i))||i===n&&!(t in e))&&Ot(e,t,i)}function Zi(e,t){for(var i=e.length;i--;)if(_t(e[i][0],t))return i;return-1}function eh(e,t,i,s){return Kt(e,function(o,c,h){t(s,o,i(o),h)}),s}function Zo(e,t){return e&&Et(t,Ee(t),e)}function th(e,t){return e&&Et(t,Ne(t),e)}function Ot(e,t,i){t=="__proto__"&&Vi?Vi(e,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[t]=i}function Kr(e,t){for(var i=-1,s=t.length,o=b(s),c=e==null;++i<s;)o[i]=c?n:Ls(e,t[i]);return o}function dn(e,t,i){return e===e&&(i!==n&&(e=e<=i?e:i),t!==n&&(e=e>=t?e:t)),e}function at(e,t,i,s,o,c){var h,d=t&ce,m=t&Pe,E=tℜif(i&&(h=o?i(e,s,o,c):i(e)),h!==n)return h;if(!ae(e))return e;var x=B(e);if(x){if(h=Nh(e),!d)return We(e,h)}else{var M=Oe(e),A=M==Sn||M==wi;if(en(e))return ba(e,d);if(M==ht||M==Wt||A&&!o){if(h=m||A?{}:Ua(e),!d)return m?Dh(e,th(h,e)):Oh(e,Zo(h,e))}else{if(!te[M])return o?e:{};h=Hh(e,M,d)}}c||(c=new gt);var L=c.get(e);if(L)return L;c.set(e,h),fl(e)?e.forEach(function(I){h.add(at(I,t,i,I,e,c))}):ul(e)&&e.forEach(function(I,W){h.set(W,at(I,t,i,W,e,c))});var C=E?m?_s:gs:m?Ne:Ee,k=x?n:C(e);return rt(k||e,function(I,W){k&&(W=I,I=e[W]),ii(h,W,at(I,t,i,W,e,c))}),h}function nh(e){var t=Ee(e);return function(i){return Qo(i,e,t)}}function Qo(e,t,i){var s=i.length;if(e==null)return!s;for(e=$(e);s--;){var o=i[s],c=t[o],h=e[o];if(h===n&&!(o in e)||!c(h))return!1}return!0}function Ko(e,t,i){if(typeof e!="function")throw new st(g);return ui(function(){e.apply(n,i)},t)}function ri(e,t,i,s){var o=-1,c=Oi,h=!0,d=e.length,m=[],E=t.length;if(!d)return m;i&&(t=se(t,qe(i))),s?(c=Br,h=!1):t.length>=f&&(c=qn,h=!1,t=new fn(t));e:for(;++o<d;){var x=e[o],M=i==null?x:i(x);if(x=s||x!==0?x:0,h&&M===M){for(var A=E;A--;)if(t[A]===M)continue e;m.push(x)}else c(t,M,s)||m.push(x)}return m}var Kt=xa(yt),qo=xa($r,!0);function ih(e,t){var i=!0;return Kt(e,function(s,o,c){return i=!!t(s,o,c),i}),i}function Qi(e,t,i){for(var s=-1,o=e.length;++s<o;){var c=e[s],h=t(c);if(h!=null&&(d===n?h===h&&!Je(h):i(h,d)))var d=h,m=c}return m}function rh(e,t,i,s){var o=e.length;for(i=U(i),i<0&&(i=-i>o?0:o+i),s=s===n||s>o?o:U(s),s<0&&(s+=o),s=i>s?0:pl(s);i<s;)e[i++]=t;return e}function $o(e,t){var i=[];return Kt(e,function(s,o,c){t(s,o,c)&&i.push(s)}),i}function Ae(e,t,i,s,o){var c=-1,h=e.length;for(i||(i=Xh),o||(o=[]);++c<h;){var d=e[c];t>0&&i(d)?t>1?Ae(d,t-1,i,s,o):jt(o,d):s||(o[o.length]=d)}return o}var qr=Sa(),Jo=Sa(!0);function yt(e,t){return e&&qr(e,t,Ee)}function $r(e,t){return e&&Jo(e,t,Ee)}function Ki(e,t){return Xt(t,function(i){return Gt(e[i])})}function pn(e,t){t=$t(t,e);for(var i=0,s=t.length;e!=null&&i<s;)e=e[xt(t[i++])];return i&&i==s?e:n}function ea(e,t,i){var s=t(e);return B(e)?s:jt(s,i(e))}function Be(e){return e==null?e===n?Si:yi:un&&un in $(e)?Fh(e):Jh(e)}function Jr(e,t){return e>t}function sh(e,t){return e!=null&&K.call(e,t)}function oh(e,t){return e!=null&&t in $(e)}function ah(e,t,i){return e>=Le(t,i)&&e<ve(t,i)}function es(e,t,i){for(var s=i?Br:Oi,o=e[0].length,c=e.length,h=c,d=b(c),m=1/0,E=[];h--;){var x=e[h];h&&t&&(x=se(x,qe(t))),m=Le(x.length,m),d[h]=!i&&(t||o>=120&&x.length>=120)?new fn(h&&x):n}x=e[0];var M=-1,A=d[0];e:for(;++M<o&&E.length<m;){var L=x[M],C=t?t(L):L;if(L=i||L!==0?L:0,!(A?qn(A,C):s(E,C,i))){for(h=c;--h;){var k=d[h];if(!(k?qn(k,C):s(e[h],C,i)))continue e}A&&A.push(C),E.push(L)}}return E}function lh(e,t,i,s){return yt(e,function(o,c,h){t(s,i(o),c,h)}),s}function si(e,t,i){t=$t(t,e),e=Wa(e,t);var s=e==null?e:e[xt(ct(t))];return s==null?n:Ke(s,e,i)}function ta(e){return he(e)&&Be(e)==Wt}function ch(e){return he(e)&&Be(e)==Ht}function uh(e){return he(e)&&Be(e)==Vt}function oi(e,t,i,s,o){return e===t?!0:e==null||t==null||!he(e)&&!he(t)?e!==e&&t!==t:hh(e,t,i,s,oi,o)}function hh(e,t,i,s,o,c){var h=B(e),d=B(t),m=h?xn:Oe(e),E=d?xn:Oe(t);m=m==Wt?ht:m,E=E==Wt?ht:E;var x=m==ht,M=E==ht,A=m==E;if(A&&en(e)){if(!en(t))return!1;h=!0,x=!1}if(A&&!x)return c||(c=new gt),h||Wn(e)?Ia(e,t,i,s,o,c):kh(e,t,m,i,s,o,c);if(!(i&me)){var L=x&&K.call(e,"__wrapped__"),C=M&&K.call(t,"__wrapped__");if(L||C){var k=L?e.value():e,I=C?t.value():t;return c||(c=new gt),o(k,I,i,s,c)}}return A?(c||(c=new gt),zh(e,t,i,s,o,c)):!1}function fh(e){return he(e)&&Oe(e)==ze}function ts(e,t,i,s){var o=i.length,c=o,h=!s;if(e==null)return!c;for(e=$(e);o--;){var d=i[o];if(h&&d[2]?d[1]!==e[d[0]]:!(d[0]in e))return!1}for(;++o<c;){d=i[o];var m=d[0],E=e[m],x=d[1];if(h&&d[2]){if(E===n&&!(m in e))return!1}else{var M=new gt;if(s)var A=s(E,x,m,e,t,M);if(!(A===n?oi(x,E,me|ue,s,M):A))return!1}}return!0}function na(e){if(!ae(e)||Zh(e))return!1;var t=Gt(e)?fu:nc;return t.test(_n(e))}function dh(e){return he(e)&&Be(e)==Rt}function ph(e){return he(e)&&Oe(e)==Se}function gh(e){return he(e)&&dr(e.length)&&!!ie[Be(e)]}function ia(e){return typeof e=="function"?e:e==null?He:typeof e=="object"?B(e)?oa(e[0],e[1]):sa(e):Ml(e)}function ns(e){if(!ci(e))return bu(e);var t=[];for(var i in $(e))K.call(e,i)&&i!="constructor"&&t.push(i);return t}function _h(e){if(!ae(e))return $h(e);var t=ci(e),i=[];for(var s in e)s=="constructor"&&(t||!K.call(e,s))||i.push(s);return i}function is(e,t){return e<t}function ra(e,t){var i=-1,s=Ve(e)?b(e.length):[];return Kt(e,function(o,c,h){s[++i]=t(o,c,h)}),s}function sa(e){var t=bs(e);return t.length==1&&t[0][2]?za(t[0][0],t[0][1]):function(i){return i===e||ts(i,e,t)}}function oa(e,t){return ws(e)&&ka(t)?za(xt(e),t):function(i){var s=Ls(i,e);return s===n&&s===t?Os(i,e):oi(t,s,me|ue)}}function qi(e,t,i,s,o){e!==t&&qr(t,function(c,h){if(o||(o=new gt),ae(c))mh(e,t,h,i,qi,s,o);else{var d=s?s(Es(e,h),c,h+"",e,t,o):n;d===n&&(d=c),Qr(e,h,d)}},Ne)}function mh(e,t,i,s,o,c,h){var d=Es(e,i),m=Es(t,i),E=h.get(m);if(E){Qr(e,i,E);return}var x=c?c(d,m,i+"",e,t,h):n,M=x===n;if(M){var A=B(m),L=!A&&en(m),C=!A&&!L&&Wn(m);x=m,A||L||C?B(d)?x=d:fe(d)?x=We(d):L?(M=!1,x=ba(m,!0)):C?(M=!1,x=va(m,!0)):x=[]:hi(m)||mn(m)?(x=d,mn(d)?x=gl(d):(!ae(d)||Gt(d))&&(x=Ua(m))):M=!1}M&&(h.set(m,x),o(x,m,s,c,h),h.delete(m)),Qr(e,i,x)}function aa(e,t){var i=e.length;if(i)return t+=t<0?i:0,It(t,i)?e[t]:n}function la(e,t,i){t.length?t=se(t,function(c){return B(c)?function(h){return pn(h,c.length===1?c[0]:c)}:c}):t=[He];var s=-1;t=se(t,qe(O()));var o=ra(e,function(c,h,d){var m=se(t,function(E){return E(c)});return{criteria:m,index:++s,value:c}});return Hc(o,function(c,h){return Lh(c,h,i)})}function bh(e,t){return ca(e,t,function(i,s){return Os(e,s)})}function ca(e,t,i){for(var s=-1,o=t.length,c={};++s<o;){var h=t[s],d=pn(e,h);i(d,h)&&ai(c,$t(h,e),d)}return c}function vh(e){return function(t){return pn(t,e)}}function rs(e,t,i,s){var o=s?Nc:Ln,c=-1,h=t.length,d=e;for(e===t&&(t=We(t)),i&&(d=se(e,qe(i)));++c<h;)for(var m=0,E=t[c],x=i?i(E):E;(m=o(d,x,m,s))>-1;)d!==e&&Wi.call(d,m,1),Wi.call(e,m,1);return e}function ua(e,t){for(var i=e?t.length:0,s=i-1;i--;){var o=t[i];if(i==s||o!==c){var c=o;It(o)?Wi.call(e,o,1):ls(e,o)}}return e}function ss(e,t){return e+Hi(Ho()*(t-e+1))}function wh(e,t,i,s){for(var o=-1,c=ve(Ni((t-e)/(i||1)),0),h=b(c);c--;)h[s?c:++o]=e,e+=i;return h}function os(e,t){var i="";if(!e||t<1||t>Te)return i;do t%2&&(i+=e),t=Hi(t/2),t&&(e+=e);while(t);return i}function z(e,t){return xs(Fa(e,t,He),e+"")}function yh(e){return jo(Vn(e))}function Eh(e,t){var i=Vn(e);return ar(i,dn(t,0,i.length))}function ai(e,t,i,s){if(!ae(e))return e;t=$t(t,e);for(var o=-1,c=t.length,h=c-1,d=e;d!=null&&++o<c;){var m=xt(t[o]),E=i;if(m==="__proto__"||m==="constructor"||m==="prototype")return e;if(o!=h){var x=d[m];E=s?s(x,m,d):n,E===n&&(E=ae(x)?x:It(t[o+1])?[]:{})}ii(d,m,E),d=d[m]}return e}var ha=Yi?function(e,t){return Yi.set(e,t),e}:He,xh=Vi?function(e,t){return Vi(e,"toString",{configurable:!0,enumerable:!1,value:Cs(t),writable:!0})}:He;function Sh(e){return ar(Vn(e))}function lt(e,t,i){var s=-1,o=e.length;t<0&&(t=-t>o?0:o+t),i=i>o?o:i,i<0&&(i+=o),o=t>i?0:i-t>>>0,t>>>=0;for(var c=b(o);++s<o;)c[s]=e[s+t];return c}function Mh(e,t){var i;return Kt(e,function(s,o,c){return i=t(s,o,c),!i}),!!i}function $i(e,t,i){var s=0,o=e==null?s:e.length;if(typeof t=="number"&&t===t&&o<=yn){for(;s<o;){var c=s+o>>>1,h=e[c];h!==null&&!Je(h)&&(i?h<=t:h<t)?s=c+1:o=c}return o}return as(e,t,He,i)}function as(e,t,i,s){var o=0,c=e==null?0:e.length;if(c===0)return 0;t=i(t);for(var h=t!==t,d=t===null,m=Je(t),E=t===n;o<c;){var x=Hi((o+c)/2),M=i(e[x]),A=M!==n,L=M===null,C=M===M,k=Je(M);if(h)var I=s||C;else E?I=C&&(s||A):d?I=C&&A&&(s||!L):m?I=C&&A&&!L&&(s||!k):L||k?I=!1:I=s?M<=t:M<t;I?o=x+1:c=x}return Le(c,Ft)}function fa(e,t){for(var i=-1,s=e.length,o=0,c=[];++i<s;){var h=e[i],d=t?t(h):h;if(!i||!_t(d,m)){var m=d;c[o++]=h===0?0:h}}return c}function da(e){return typeof e=="number"?e:Je(e)?Ze:+e}function $e(e){if(typeof e=="string")return e;if(B(e))return se(e,$e)+"";if(Je(e))return Yo?Yo.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function qt(e,t,i){var s=-1,o=Oi,c=e.length,h=!0,d=[],m=d;if(i)h=!1,o=Br;else if(c>=f){var E=t?null:Bh(e);if(E)return Ci(E);h=!1,o=qn,m=new fn}else m=t?[]:d;e:for(;++s<c;){var x=e[s],M=t?t(x):x;if(x=i||x!==0?x:0,h&&M===M){for(var A=m.length;A--;)if(m[A]===M)continue e;t&&m.push(M),d.push(x)}else o(m,M,i)||(m!==d&&m.push(M),d.push(x))}return d}function ls(e,t){return t=$t(t,e),e=Wa(e,t),e==null||delete e[xt(ct(t))]}function pa(e,t,i,s){return ai(e,t,i(pn(e,t)),s)}function Ji(e,t,i,s){for(var o=e.length,c=s?o:-1;(s?c--:++c<o)&&t(e[c],c,e););return i?lt(e,s?0:c,s?c+1:o):lt(e,s?c+1:0,s?o:c)}function ga(e,t){var i=e;return i instanceof V&&(i=i.value()),Ur(t,function(s,o){return o.func.apply(o.thisArg,jt([s],o.args))},i)}function cs(e,t,i){var s=e.length;if(s<2)return s?qt(e[0]):[];for(var o=-1,c=b(s);++o<s;)for(var h=e[o],d=-1;++d<s;)d!=o&&(c[o]=ri(c[o]||h,e[d],t,i));return qt(Ae(c,1),t,i)}function _a(e,t,i){for(var s=-1,o=e.length,c=t.length,h={};++s<o;){var d=s<c?t[s]:n;i(h,e[s],d)}return h}function us(e){return fe(e)?e:[]}function hs(e){return typeof e=="function"?e:He}function $t(e,t){return B(e)?e:ws(e,t)?[e]:Ya(X(e))}var Ah=z;function Jt(e,t,i){var s=e.length;return i=i===n?s:i,!t&&i>=s?e:lt(e,t,i)}var ma=du||function(e){return Me.clearTimeout(e)};function ba(e,t){if(t)return e.slice();var i=e.length,s=zo?zo(i):new e.constructor(i);return e.copy(s),s}function fs(e){var t=new e.constructor(e.byteLength);return new zi(t).set(new zi(e)),t}function Ph(e,t){var i=t?fs(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.byteLength)}function Rh(e){var t=new e.constructor(e.source,eo.exec(e));return t.lastIndex=e.lastIndex,t}function Th(e){return ni?$(ni.call(e)):{}}function va(e,t){var i=t?fs(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.length)}function wa(e,t){if(e!==t){var i=e!==n,s=e===null,o=e===e,c=Je(e),h=t!==n,d=t===null,m=t===t,E=Je(t);if(!d&&!E&&!c&&e>t||c&&h&&m&&!d&&!E||s&&h&&m||!i&&m||!o)return 1;if(!s&&!c&&!E&&e<t||E&&i&&o&&!s&&!c||d&&i&&o||!h&&o||!m)return-1}return 0}function Lh(e,t,i){for(var s=-1,o=e.criteria,c=t.criteria,h=o.length,d=i.length;++s<h;){var m=wa(o[s],c[s]);if(m){if(s>=d)return m;var E=i[s];return m*(E=="desc"?-1:1)}}return e.index-t.index}function ya(e,t,i,s){for(var o=-1,c=e.length,h=i.length,d=-1,m=t.length,E=ve(c-h,0),x=b(m+E),M=!s;++d<m;)x[d]=t[d];for(;++o<h;)(M||o<c)&&(x[i[o]]=e[o]);for(;E--;)x[d++]=e[o++];return x}function Ea(e,t,i,s){for(var o=-1,c=e.length,h=-1,d=i.length,m=-1,E=t.length,x=ve(c-d,0),M=b(x+E),A=!s;++o<x;)M[o]=e[o];for(var L=o;++m<E;)M[L+m]=t[m];for(;++h<d;)(A||o<c)&&(M[L+i[h]]=e[o++]);return M}function We(e,t){var i=-1,s=e.length;for(t||(t=b(s));++i<s;)t[i]=e[i];return t}function Et(e,t,i,s){var o=!i;i||(i={});for(var c=-1,h=t.length;++c<h;){var d=t[c],m=s?s(i[d],e[d],d,i,e):n;m===n&&(m=e[d]),o?Ot(i,d,m):ii(i,d,m)}return i}function Oh(e,t){return Et(e,vs(e),t)}function Dh(e,t){return Et(e,Ga(e),t)}function er(e,t){return function(i,s){var o=B(i)?Uc:eh,c=t?t():{};return o(i,e,O(s,2),c)}}function kn(e){return z(function(t,i){var s=-1,o=i.length,c=o>1?i[o-1]:n,h=o>2?i[2]:n;for(c=e.length>3&&typeof c=="function"?(o--,c):n,h&&Ue(i[0],i[1],h)&&(c=o<3?n:c,o=1),t=$(t);++s<o;){var d=i[s];d&&e(t,d,s,c)}return t})}function xa(e,t){return function(i,s){if(i==null)return i;if(!Ve(i))return e(i,s);for(var o=i.length,c=t?o:-1,h=$(i);(t?c--:++c<o)&&s(h[c],c,h)!==!1;);return i}}function Sa(e){return function(t,i,s){for(var o=-1,c=$(t),h=s(t),d=h.length;d--;){var m=h[e?d:++o];if(i(c[m],m,c)===!1)break}return t}}function Ch(e,t,i){var s=t&q,o=li(e);function c(){var h=this&&this!==Me&&this instanceof c?o:e;return h.apply(s?i:this,arguments)}return c}function Ma(e){return function(t){t=X(t);var i=On(t)?pt(t):n,s=i?i[0]:t.charAt(0),o=i?Jt(i,1).join(""):t.slice(1);return s[e]()+o}}function zn(e){return function(t){return Ur(xl(El(t).replace(xc,"")),e,"")}}function li(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var i=Un(e.prototype),s=e.apply(i,t);return ae(s)?s:i}}function Ih(e,t,i){var s=li(e);function o(){for(var c=arguments.length,h=b(c),d=c,m=Fn(o);d--;)h[d]=arguments[d];var E=c<3&&h[0]!==m&&h[c-1]!==m?[]:Zt(h,m);if(c-=E.length,c<i)return La(e,t,tr,o.placeholder,n,h,E,n,n,i-c);var x=this&&this!==Me&&this instanceof o?s:e;return Ke(x,this,h)}return o}function Aa(e){return function(t,i,s){var o=$(t);if(!Ve(t)){var c=O(i,3);t=Ee(t),i=function(d){return c(o[d],d,o)}}var h=e(t,i,s);return h>-1?o[c?t[h]:h]:n}}function Pa(e){return Ct(function(t){var i=t.length,s=i,o=ot.prototype.thru;for(e&&t.reverse();s--;){var c=t[s];if(typeof c!="function")throw new st(g);if(o&&!h&&sr(c)=="wrapper")var h=new ot([],!0)}for(s=h?s:i;++s<i;){c=t[s];var d=sr(c),m=d=="wrapper"?ms(c):n;m&&ys(m[0])&&m[1]==(Z|j|ee|Xe)&&!m[4].length&&m[9]==1?h=h[sr(m[0])].apply(h,m[3]):h=c.length==1&&ys(c)?h[d]():h.thru(c)}return function(){var E=arguments,x=E[0];if(h&&E.length==1&&B(x))return h.plant(x).value();for(var M=0,A=i?t[M].apply(this,E):x;++M<i;)A=t[M].call(this,A);return A}})}function tr(e,t,i,s,o,c,h,d,m,E){var x=t&Z,M=t&q,A=t&re,L=t&(j|Ie),C=t&At,k=A?n:li(e);function I(){for(var W=arguments.length,N=b(W),et=W;et--;)N[et]=arguments[et];if(L)var ke=Fn(I),tt=Xc(N,ke);if(s&&(N=ya(N,s,o,L)),c&&(N=Ea(N,c,h,L)),W-=tt,L&&W<E){var de=Zt(N,ke);return La(e,t,tr,I.placeholder,i,N,de,d,m,E-W)}var mt=M?i:this,Ut=A?mt[e]:e;return W=N.length,d?N=ef(N,d):C&&W>1&&N.reverse(),x&&m<W&&(N.length=m),this&&this!==Me&&this instanceof I&&(Ut=k||li(Ut)),Ut.apply(mt,N)}return I}function Ra(e,t){return function(i,s){return lh(i,e,t(s),{})}}function nr(e,t){return function(i,s){var o;if(i===n&&s===n)return t;if(i!==n&&(o=i),s!==n){if(o===n)return s;typeof i=="string"||typeof s=="string"?(i=$e(i),s=$e(s)):(i=da(i),s=da(s)),o=e(i,s)}return o}}function ds(e){return Ct(function(t){return t=se(t,qe(O())),z(function(i){var s=this;return e(t,function(o){return Ke(o,s,i)})})})}function ir(e,t){t=t===n?" ":$e(t);var i=t.length;if(i<2)return i?os(t,e):t;var s=os(t,Ni(e/Dn(t)));return On(t)?Jt(pt(s),0,e).join(""):s.slice(0,e)}function Gh(e,t,i,s){var o=t&q,c=li(e);function h(){for(var d=-1,m=arguments.length,E=-1,x=s.length,M=b(x+m),A=this&&this!==Me&&this instanceof h?c:e;++E<x;)M[E]=s[E];for(;m--;)M[E++]=arguments[++d];return Ke(A,o?i:this,M)}return h}function Ta(e){return function(t,i,s){return s&&typeof s!="number"&&Ue(t,i,s)&&(i=s=n),t=Bt(t),i===n?(i=t,t=0):i=Bt(i),s=s===n?t<i?1:-1:Bt(s),wh(t,i,s,e)}}function rr(e){return function(t,i){return typeof t=="string"&&typeof i=="string"||(t=ut(t),i=ut(i)),e(t,i)}}function La(e,t,i,s,o,c,h,d,m,E){var x=t&j,M=x?h:n,A=x?n:h,L=x?c:n,C=x?n:c;t|=x?ee:nt,t&=~(x?nt:ee),t&ne||(t&=-4);var k=[e,t,o,L,M,C,A,d,m,E],I=i.apply(n,k);return ys(e)&&Va(I,k),I.placeholder=s,Na(I,e,t)}function ps(e){var t=be[e];return function(i,s){if(i=ut(i),s=s==null?0:Le(U(s),292),s&&No(i)){var o=(X(i)+"e").split("e"),c=t(o[0]+"e"+(+o[1]+s));return o=(X(c)+"e").split("e"),+(o[0]+"e"+(+o[1]-s))}return t(i)}}var Bh=Gn&&1/Ci(new Gn([,-0]))[1]==ge?function(e){return new Gn(e)}:Bs;function Oa(e){return function(t){var i=Oe(t);return i==ze?Hr(t):i==Se?Jc(t):Yc(t,e(t))}}function Dt(e,t,i,s,o,c,h,d){var m=t&re;if(!m&&typeof e!="function")throw new st(g);var E=s?s.length:0;if(E||(t&=-97,s=o=n),h=h===n?h:ve(U(h),0),d=d===n?d:U(d),E-=o?o.length:0,t&nt){var x=s,M=o;s=o=n}var A=m?n:ms(e),L=[e,t,i,s,o,x,M,c,h,d];if(A&&qh(L,A),e=L[0],t=L[1],i=L[2],s=L[3],o=L[4],d=L[9]=L[9]===n?m?0:e.length:ve(L[9]-E,0),!d&&t&(j|Ie)&&(t&=-25),!t||t==q)var C=Ch(e,t,i);else t==j||t==Ie?C=Ih(e,t,d):(t==ee||t==(q|ee))&&!o.length?C=Gh(e,t,i,s):C=tr.apply(n,L);var k=A?ha:Va;return Na(k(C,L),e,t)}function Da(e,t,i,s){return e===n||_t(e,In[i])&&!K.call(s,i)?t:e}function Ca(e,t,i,s,o,c){return ae(e)&&ae(t)&&(c.set(t,e),qi(e,t,n,Ca,c),c.delete(t)),e}function Uh(e){return hi(e)?n:e}function Ia(e,t,i,s,o,c){var h=i&me,d=e.length,m=t.length;if(d!=m&&!(h&&m>d))return!1;var E=c.get(e),x=c.get(t);if(E&&x)return E==t&&x==e;var M=-1,A=!0,L=i&ue?new fn:n;for(c.set(e,t),c.set(t,e);++M<d;){var C=e[M],k=t[M];if(s)var I=h?s(k,C,M,t,e,c):s(C,k,M,e,t,c);if(I!==n){if(I)continue;A=!1;break}if(L){if(!kr(t,function(W,N){if(!qn(L,N)&&(C===W||o(C,W,i,s,c)))return L.push(N)})){A=!1;break}}else if(!(C===k||o(C,k,i,s,c))){A=!1;break}}return c.delete(e),c.delete(t),A}function kh(e,t,i,s,o,c,h){switch(i){case bt:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Ht:return!(e.byteLength!=t.byteLength||!c(new zi(e),new zi(t)));case nn:case Vt:case Nt:return _t(+e,+t);case rn:return e.name==t.name&&e.message==t.message;case Rt:case sn:return e==t+"";case ze:var d=Hr;case Se:var m=s&me;if(d||(d=Ci),e.size!=t.size&&!m)return!1;var E=h.get(e);if(E)return E==t;s|=ue,h.set(e,t);var x=Ia(d(e),d(t),s,o,c,h);return h.delete(e),x;case Mn:if(ni)return ni.call(e)==ni.call(t)}return!1}function zh(e,t,i,s,o,c){var h=i&me,d=gs(e),m=d.length,E=gs(t),x=E.length;if(m!=x&&!h)return!1;for(var M=m;M--;){var A=d[M];if(!(h?A in t:K.call(t,A)))return!1}var L=c.get(e),C=c.get(t);if(L&&C)return L==t&&C==e;var k=!0;c.set(e,t),c.set(t,e);for(var I=h;++M<m;){A=d[M];var W=e[A],N=t[A];if(s)var et=h?s(N,W,A,t,e,c):s(W,N,A,e,t,c);if(!(et===n?W===N||o(W,N,i,s,c):et)){k=!1;break}I||(I=A=="constructor")}if(k&&!I){var ke=e.constructor,tt=t.constructor;ke!=tt&&"constructor"in e&&"constructor"in t&&!(typeof ke=="function"&&ke instanceof ke&&typeof tt=="function"&&tt instanceof tt)&&(k=!1)}return c.delete(e),c.delete(t),k}function Ct(e){return xs(Fa(e,n,Qa),e+"")}function gs(e){return ea(e,Ee,vs)}function _s(e){return ea(e,Ne,Ga)}var ms=Yi?function(e){return Yi.get(e)}:Bs;function sr(e){for(var t=e.name+"",i=Bn[t],s=K.call(Bn,t)?i.length:0;s--;){var o=i[s],c=o.func;if(c==null||c==e)return o.name}return t}function Fn(e){var t=K.call(l,"placeholder")?l:e;return t.placeholder}function O(){var e=l.iteratee||Is;return e=e===Is?ia:e,arguments.length?e(arguments[0],arguments[1]):e}function or(e,t){var i=e.__data__;return jh(t)?i[typeof t=="string"?"string":"hash"]:i.map}function bs(e){for(var t=Ee(e),i=t.length;i--;){var s=t[i],o=e[s];t[i]=[s,o,ka(o)]}return t}function gn(e,t){var i=Kc(e,t);return na(i)?i:n}function Fh(e){var t=K.call(e,un),i=e[un];try{e[un]=n;var s=!0}catch{}var o=Ui.call(e);return s&&(t?e[un]=i:delete e[un]),o}var vs=Xr?function(e){return e==null?[]:(e=$(e),Xt(Xr(e),function(t){return Wo.call(e,t)}))}:Us,Ga=Xr?function(e){for(var t=[];e;)jt(t,vs(e)),e=Fi(e);return t}:Us,Oe=Be;(jr&&Oe(new jr(new ArrayBuffer(1)))!=bt||Jn&&Oe(new Jn)!=ze||Zr&&Oe(Zr.resolve())!=Ei||Gn&&Oe(new Gn)!=Se||ei&&Oe(new ei)!=on)&&(Oe=function(e){var t=Be(e),i=t==ht?e.constructor:n,s=i?_n(i):"";if(s)switch(s){case Eu:return bt;case xu:return ze;case Su:return Ei;case Mu:return Se;case Au:return on}return t});function Wh(e,t,i){for(var s=-1,o=i.length;++s<o;){var c=i[s],h=c.size;switch(c.type){case"drop":e+=h;break;case"dropRight":t-=h;break;case"take":t=Le(t,e+h);break;case"takeRight":e=ve(e,t-h);break}}return{start:e,end:t}}function Vh(e){var t=e.match(Zl);return t?t[1].split(Ql):[]}function Ba(e,t,i){t=$t(t,e);for(var s=-1,o=t.length,c=!1;++s<o;){var h=xt(t[s]);if(!(c=e!=null&&i(e,h)))break;e=e[h]}return c||++s!=o?c:(o=e==null?0:e.length,!!o&&dr(o)&&It(h,o)&&(B(e)||mn(e)))}function Nh(e){var t=e.length,i=new e.constructor(t);return t&&typeof e[0]=="string"&&K.call(e,"index")&&(i.index=e.index,i.input=e.input),i}function Ua(e){return typeof e.constructor=="function"&&!ci(e)?Un(Fi(e)):{}}function Hh(e,t,i){var s=e.constructor;switch(t){case Ht:return fs(e);case nn:case Vt:return new s(+e);case bt:return Ph(e,i);case An:case Xn:case Pn:case jn:case Zn:case Qn:case Rn:case vt:case Ai:return va(e,i);case ze:return new s;case Nt:case sn:return new s(e);case Rt:return Rh(e);case Se:return new s;case Mn:return Th(e)}}function Yh(e,t){var i=t.length;if(!i)return e;var s=i-1;return t[s]=(i>1?"& ":"")+t[s],t=t.join(i>2?", ":" "),e.replace(jl,`{
|
|
9
|
+
/* [wrapped with `+t+`] */
|
|
10
|
+
`)}function Xh(e){return B(e)||mn(e)||!!(Vo&&e&&e[Vo])}function It(e,t){var i=typeof e;return t=t??Te,!!t&&(i=="number"||i!="symbol"&&rc.test(e))&&e>-1&&e%1==0&&e<t}function Ue(e,t,i){if(!ae(i))return!1;var s=typeof t;return(s=="number"?Ve(i)&&It(t,i.length):s=="string"&&t in i)?_t(i[t],e):!1}function ws(e,t){if(B(e))return!1;var i=typeof e;return i=="number"||i=="symbol"||i=="boolean"||e==null||Je(e)?!0:dt.test(e)||!ft.test(e)||t!=null&&e in $(t)}function jh(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function ys(e){var t=sr(e),i=l[t];if(typeof i!="function"||!(t in V.prototype))return!1;if(e===i)return!0;var s=ms(i);return!!s&&e===s[0]}function Zh(e){return!!ko&&ko in e}var Qh=Gi?Gt:ks;function ci(e){var t=e&&e.constructor,i=typeof t=="function"&&t.prototype||In;return e===i}function ka(e){return e===e&&!ae(e)}function za(e,t){return function(i){return i==null?!1:i[e]===t&&(t!==n||e in $(i))}}function Kh(e){var t=hr(e,function(s){return i.size===H&&i.clear(),s}),i=t.cache;return t}function qh(e,t){var i=e[1],s=t[1],o=i|s,c=o<(q|re|Z),h=s==Z&&i==j||s==Z&&i==Xe&&e[7].length<=t[8]||s==(Z|Xe)&&t[7].length<=t[8]&&i==j;if(!(c||h))return e;s&q&&(e[2]=t[2],o|=i&q?0:ne);var d=t[3];if(d){var m=e[3];e[3]=m?ya(m,d,t[4]):d,e[4]=m?Zt(e[3],le):t[4]}return d=t[5],d&&(m=e[5],e[5]=m?Ea(m,d,t[6]):d,e[6]=m?Zt(e[5],le):t[6]),d=t[7],d&&(e[7]=d),s&Z&&(e[8]=e[8]==null?t[8]:Le(e[8],t[8])),e[9]==null&&(e[9]=t[9]),e[0]=t[0],e[1]=o,e}function $h(e){var t=[];if(e!=null)for(var i in $(e))t.push(i);return t}function Jh(e){return Ui.call(e)}function Fa(e,t,i){return t=ve(t===n?e.length-1:t,0),function(){for(var s=arguments,o=-1,c=ve(s.length-t,0),h=b(c);++o<c;)h[o]=s[t+o];o=-1;for(var d=b(t+1);++o<t;)d[o]=s[o];return d[t]=i(h),Ke(e,this,d)}}function Wa(e,t){return t.length<2?e:pn(e,lt(t,0,-1))}function ef(e,t){for(var i=e.length,s=Le(t.length,i),o=We(e);s--;){var c=t[s];e[s]=It(c,i)?o[c]:n}return e}function Es(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var Va=Ha(ha),ui=gu||function(e,t){return Me.setTimeout(e,t)},xs=Ha(xh);function Na(e,t,i){var s=t+"";return xs(e,Yh(s,tf(Vh(s),i)))}function Ha(e){var t=0,i=0;return function(){var s=vu(),o=zt-(s-i);if(i=s,o>0){if(++t>=Pt)return arguments[0]}else t=0;return e.apply(n,arguments)}}function ar(e,t){var i=-1,s=e.length,o=s-1;for(t=t===n?s:t;++i<t;){var c=ss(i,o),h=e[c];e[c]=e[i],e[i]=h}return e.length=t,e}var Ya=Kh(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(an,function(i,s,o,c){t.push(o?c.replace($l,"$1"):s||i)}),t});function xt(e){if(typeof e=="string"||Je(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function _n(e){if(e!=null){try{return Bi.call(e)}catch{}try{return e+""}catch{}}return""}function tf(e,t){return rt(En,function(i){var s="_."+i[0];t&i[1]&&!Oi(e,s)&&e.push(s)}),e.sort()}function Xa(e){if(e instanceof V)return e.clone();var t=new ot(e.__wrapped__,e.__chain__);return t.__actions__=We(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}function nf(e,t,i){(i?Ue(e,t,i):t===n)?t=1:t=ve(U(t),0);var s=e==null?0:e.length;if(!s||t<1)return[];for(var o=0,c=0,h=b(Ni(s/t));o<s;)h[c++]=lt(e,o,o+=t);return h}function rf(e){for(var t=-1,i=e==null?0:e.length,s=0,o=[];++t<i;){var c=e[t];c&&(o[s++]=c)}return o}function sf(){var e=arguments.length;if(!e)return[];for(var t=b(e-1),i=arguments[0],s=e;s--;)t[s-1]=arguments[s];return jt(B(i)?We(i):[i],Ae(t,1))}var of=z(function(e,t){return fe(e)?ri(e,Ae(t,1,fe,!0)):[]}),af=z(function(e,t){var i=ct(t);return fe(i)&&(i=n),fe(e)?ri(e,Ae(t,1,fe,!0),O(i,2)):[]}),lf=z(function(e,t){var i=ct(t);return fe(i)&&(i=n),fe(e)?ri(e,Ae(t,1,fe,!0),n,i):[]});function cf(e,t,i){var s=e==null?0:e.length;return s?(t=i||t===n?1:U(t),lt(e,t<0?0:t,s)):[]}function uf(e,t,i){var s=e==null?0:e.length;return s?(t=i||t===n?1:U(t),t=s-t,lt(e,0,t<0?0:t)):[]}function hf(e,t){return e&&e.length?Ji(e,O(t,3),!0,!0):[]}function ff(e,t){return e&&e.length?Ji(e,O(t,3),!0):[]}function df(e,t,i,s){var o=e==null?0:e.length;return o?(i&&typeof i!="number"&&Ue(e,t,i)&&(i=0,s=o),rh(e,t,i,s)):[]}function ja(e,t,i){var s=e==null?0:e.length;if(!s)return-1;var o=i==null?0:U(i);return o<0&&(o=ve(s+o,0)),Di(e,O(t,3),o)}function Za(e,t,i){var s=e==null?0:e.length;if(!s)return-1;var o=s-1;return i!==n&&(o=U(i),o=i<0?ve(s+o,0):Le(o,s-1)),Di(e,O(t,3),o,!0)}function Qa(e){var t=e==null?0:e.length;return t?Ae(e,1):[]}function pf(e){var t=e==null?0:e.length;return t?Ae(e,ge):[]}function gf(e,t){var i=e==null?0:e.length;return i?(t=t===n?1:U(t),Ae(e,t)):[]}function _f(e){for(var t=-1,i=e==null?0:e.length,s={};++t<i;){var o=e[t];s[o[0]]=o[1]}return s}function Ka(e){return e&&e.length?e[0]:n}function mf(e,t,i){var s=e==null?0:e.length;if(!s)return-1;var o=i==null?0:U(i);return o<0&&(o=ve(s+o,0)),Ln(e,t,o)}function bf(e){var t=e==null?0:e.length;return t?lt(e,0,-1):[]}var vf=z(function(e){var t=se(e,us);return t.length&&t[0]===e[0]?es(t):[]}),wf=z(function(e){var t=ct(e),i=se(e,us);return t===ct(i)?t=n:i.pop(),i.length&&i[0]===e[0]?es(i,O(t,2)):[]}),yf=z(function(e){var t=ct(e),i=se(e,us);return t=typeof t=="function"?t:n,t&&i.pop(),i.length&&i[0]===e[0]?es(i,n,t):[]});function Ef(e,t){return e==null?"":mu.call(e,t)}function ct(e){var t=e==null?0:e.length;return t?e[t-1]:n}function xf(e,t,i){var s=e==null?0:e.length;if(!s)return-1;var o=s;return i!==n&&(o=U(i),o=o<0?ve(s+o,0):Le(o,s-1)),t===t?tu(e,t,o):Di(e,Lo,o,!0)}function Sf(e,t){return e&&e.length?aa(e,U(t)):n}var Mf=z(qa);function qa(e,t){return e&&e.length&&t&&t.length?rs(e,t):e}function Af(e,t,i){return e&&e.length&&t&&t.length?rs(e,t,O(i,2)):e}function Pf(e,t,i){return e&&e.length&&t&&t.length?rs(e,t,n,i):e}var Rf=Ct(function(e,t){var i=e==null?0:e.length,s=Kr(e,t);return ua(e,se(t,function(o){return It(o,i)?+o:o}).sort(wa)),s});function Tf(e,t){var i=[];if(!(e&&e.length))return i;var s=-1,o=[],c=e.length;for(t=O(t,3);++s<c;){var h=e[s];t(h,s,e)&&(i.push(h),o.push(s))}return ua(e,o),i}function Ss(e){return e==null?e:yu.call(e)}function Lf(e,t,i){var s=e==null?0:e.length;return s?(i&&typeof i!="number"&&Ue(e,t,i)?(t=0,i=s):(t=t==null?0:U(t),i=i===n?s:U(i)),lt(e,t,i)):[]}function Of(e,t){return $i(e,t)}function Df(e,t,i){return as(e,t,O(i,2))}function Cf(e,t){var i=e==null?0:e.length;if(i){var s=$i(e,t);if(s<i&&_t(e[s],t))return s}return-1}function If(e,t){return $i(e,t,!0)}function Gf(e,t,i){return as(e,t,O(i,2),!0)}function Bf(e,t){var i=e==null?0:e.length;if(i){var s=$i(e,t,!0)-1;if(_t(e[s],t))return s}return-1}function Uf(e){return e&&e.length?fa(e):[]}function kf(e,t){return e&&e.length?fa(e,O(t,2)):[]}function zf(e){var t=e==null?0:e.length;return t?lt(e,1,t):[]}function Ff(e,t,i){return e&&e.length?(t=i||t===n?1:U(t),lt(e,0,t<0?0:t)):[]}function Wf(e,t,i){var s=e==null?0:e.length;return s?(t=i||t===n?1:U(t),t=s-t,lt(e,t<0?0:t,s)):[]}function Vf(e,t){return e&&e.length?Ji(e,O(t,3),!1,!0):[]}function Nf(e,t){return e&&e.length?Ji(e,O(t,3)):[]}var Hf=z(function(e){return qt(Ae(e,1,fe,!0))}),Yf=z(function(e){var t=ct(e);return fe(t)&&(t=n),qt(Ae(e,1,fe,!0),O(t,2))}),Xf=z(function(e){var t=ct(e);return t=typeof t=="function"?t:n,qt(Ae(e,1,fe,!0),n,t)});function jf(e){return e&&e.length?qt(e):[]}function Zf(e,t){return e&&e.length?qt(e,O(t,2)):[]}function Qf(e,t){return t=typeof t=="function"?t:n,e&&e.length?qt(e,n,t):[]}function Ms(e){if(!(e&&e.length))return[];var t=0;return e=Xt(e,function(i){if(fe(i))return t=ve(i.length,t),!0}),Vr(t,function(i){return se(e,zr(i))})}function $a(e,t){if(!(e&&e.length))return[];var i=Ms(e);return t==null?i:se(i,function(s){return Ke(t,n,s)})}var Kf=z(function(e,t){return fe(e)?ri(e,t):[]}),qf=z(function(e){return cs(Xt(e,fe))}),$f=z(function(e){var t=ct(e);return fe(t)&&(t=n),cs(Xt(e,fe),O(t,2))}),Jf=z(function(e){var t=ct(e);return t=typeof t=="function"?t:n,cs(Xt(e,fe),n,t)}),ed=z(Ms);function td(e,t){return _a(e||[],t||[],ii)}function nd(e,t){return _a(e||[],t||[],ai)}var id=z(function(e){var t=e.length,i=t>1?e[t-1]:n;return i=typeof i=="function"?(e.pop(),i):n,$a(e,i)});function Ja(e){var t=l(e);return t.__chain__=!0,t}function rd(e,t){return t(e),e}function lr(e,t){return t(e)}var sd=Ct(function(e){var t=e.length,i=t?e[0]:0,s=this.__wrapped__,o=function(c){return Kr(c,e)};return t>1||this.__actions__.length||!(s instanceof V)||!It(i)?this.thru(o):(s=s.slice(i,+i+(t?1:0)),s.__actions__.push({func:lr,args:[o],thisArg:n}),new ot(s,this.__chain__).thru(function(c){return t&&!c.length&&c.push(n),c}))});function od(){return Ja(this)}function ad(){return new ot(this.value(),this.__chain__)}function ld(){this.__values__===n&&(this.__values__=dl(this.value()));var e=this.__index__>=this.__values__.length,t=e?n:this.__values__[this.__index__++];return{done:e,value:t}}function cd(){return this}function ud(e){for(var t,i=this;i instanceof ji;){var s=Xa(i);s.__index__=0,s.__values__=n,t?o.__wrapped__=s:t=s;var o=s;i=i.__wrapped__}return o.__wrapped__=e,t}function hd(){var e=this.__wrapped__;if(e instanceof V){var t=e;return this.__actions__.length&&(t=new V(this)),t=t.reverse(),t.__actions__.push({func:lr,args:[Ss],thisArg:n}),new ot(t,this.__chain__)}return this.thru(Ss)}function fd(){return ga(this.__wrapped__,this.__actions__)}var dd=er(function(e,t,i){K.call(e,i)?++e[i]:Ot(e,i,1)});function pd(e,t,i){var s=B(e)?Ro:ih;return i&&Ue(e,t,i)&&(t=n),s(e,O(t,3))}function gd(e,t){var i=B(e)?Xt:$o;return i(e,O(t,3))}var _d=Aa(ja),md=Aa(Za);function bd(e,t){return Ae(cr(e,t),1)}function vd(e,t){return Ae(cr(e,t),ge)}function wd(e,t,i){return i=i===n?1:U(i),Ae(cr(e,t),i)}function el(e,t){var i=B(e)?rt:Kt;return i(e,O(t,3))}function tl(e,t){var i=B(e)?kc:qo;return i(e,O(t,3))}var yd=er(function(e,t,i){K.call(e,i)?e[i].push(t):Ot(e,i,[t])});function Ed(e,t,i,s){e=Ve(e)?e:Vn(e),i=i&&!s?U(i):0;var o=e.length;return i<0&&(i=ve(o+i,0)),pr(e)?i<=o&&e.indexOf(t,i)>-1:!!o&&Ln(e,t,i)>-1}var xd=z(function(e,t,i){var s=-1,o=typeof t=="function",c=Ve(e)?b(e.length):[];return Kt(e,function(h){c[++s]=o?Ke(t,h,i):si(h,t,i)}),c}),Sd=er(function(e,t,i){Ot(e,i,t)});function cr(e,t){var i=B(e)?se:ra;return i(e,O(t,3))}function Md(e,t,i,s){return e==null?[]:(B(t)||(t=t==null?[]:[t]),i=s?n:i,B(i)||(i=i==null?[]:[i]),la(e,t,i))}var Ad=er(function(e,t,i){e[i?0:1].push(t)},function(){return[[],[]]});function Pd(e,t,i){var s=B(e)?Ur:Do,o=arguments.length<3;return s(e,O(t,4),i,o,Kt)}function Rd(e,t,i){var s=B(e)?zc:Do,o=arguments.length<3;return s(e,O(t,4),i,o,qo)}function Td(e,t){var i=B(e)?Xt:$o;return i(e,fr(O(t,3)))}function Ld(e){var t=B(e)?jo:yh;return t(e)}function Od(e,t,i){(i?Ue(e,t,i):t===n)?t=1:t=U(t);var s=B(e)?$u:Eh;return s(e,t)}function Dd(e){var t=B(e)?Ju:Sh;return t(e)}function Cd(e){if(e==null)return 0;if(Ve(e))return pr(e)?Dn(e):e.length;var t=Oe(e);return t==ze||t==Se?e.size:ns(e).length}function Id(e,t,i){var s=B(e)?kr:Mh;return i&&Ue(e,t,i)&&(t=n),s(e,O(t,3))}var Gd=z(function(e,t){if(e==null)return[];var i=t.length;return i>1&&Ue(e,t[0],t[1])?t=[]:i>2&&Ue(t[0],t[1],t[2])&&(t=[t[0]]),la(e,Ae(t,1),[])}),ur=pu||function(){return Me.Date.now()};function Bd(e,t){if(typeof t!="function")throw new st(g);return e=U(e),function(){if(--e<1)return t.apply(this,arguments)}}function nl(e,t,i){return t=i?n:t,t=e&&t==null?e.length:t,Dt(e,Z,n,n,n,n,t)}function il(e,t){var i;if(typeof t!="function")throw new st(g);return e=U(e),function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=n),i}}var As=z(function(e,t,i){var s=q;if(i.length){var o=Zt(i,Fn(As));s|=ee}return Dt(e,s,t,i,o)}),rl=z(function(e,t,i){var s=q|re;if(i.length){var o=Zt(i,Fn(rl));s|=ee}return Dt(t,s,e,i,o)});function sl(e,t,i){t=i?n:t;var s=Dt(e,j,n,n,n,n,n,t);return s.placeholder=sl.placeholder,s}function ol(e,t,i){t=i?n:t;var s=Dt(e,Ie,n,n,n,n,n,t);return s.placeholder=ol.placeholder,s}function al(e,t,i){var s,o,c,h,d,m,E=0,x=!1,M=!1,A=!0;if(typeof e!="function")throw new st(g);t=ut(t)||0,ae(i)&&(x=!!i.leading,M="maxWait"in i,c=M?ve(ut(i.maxWait)||0,t):c,A="trailing"in i?!!i.trailing:A);function L(de){var mt=s,Ut=o;return s=o=n,E=de,h=e.apply(Ut,mt),h}function C(de){return E=de,d=ui(W,t),x?L(de):h}function k(de){var mt=de-m,Ut=de-E,Al=t-mt;return M?Le(Al,c-Ut):Al}function I(de){var mt=de-m,Ut=de-E;return m===n||mt>=t||mt<0||M&&Ut>=c}function W(){var de=ur();if(I(de))return N(de);d=ui(W,k(de))}function N(de){return d=n,A&&s?L(de):(s=o=n,h)}function et(){d!==n&&ma(d),E=0,s=m=o=d=n}function ke(){return d===n?h:N(ur())}function tt(){var de=ur(),mt=I(de);if(s=arguments,o=this,m=de,mt){if(d===n)return C(m);if(M)return ma(d),d=ui(W,t),L(m)}return d===n&&(d=ui(W,t)),h}return tt.cancel=et,tt.flush=ke,tt}var Ud=z(function(e,t){return Ko(e,1,t)}),kd=z(function(e,t,i){return Ko(e,ut(t)||0,i)});function zd(e){return Dt(e,At)}function hr(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new st(g);var i=function(){var s=arguments,o=t?t.apply(this,s):s[0],c=i.cache;if(c.has(o))return c.get(o);var h=e.apply(this,s);return i.cache=c.set(o,h)||c,h};return i.cache=new(hr.Cache||Lt),i}hr.Cache=Lt;function fr(e){if(typeof e!="function")throw new st(g);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}function Fd(e){return il(2,e)}var Wd=Ah(function(e,t){t=t.length==1&&B(t[0])?se(t[0],qe(O())):se(Ae(t,1),qe(O()));var i=t.length;return z(function(s){for(var o=-1,c=Le(s.length,i);++o<c;)s[o]=t[o].call(this,s[o]);return Ke(e,this,s)})}),Ps=z(function(e,t){var i=Zt(t,Fn(Ps));return Dt(e,ee,n,t,i)}),ll=z(function(e,t){var i=Zt(t,Fn(ll));return Dt(e,nt,n,t,i)}),Vd=Ct(function(e,t){return Dt(e,Xe,n,n,n,t)});function Nd(e,t){if(typeof e!="function")throw new st(g);return t=t===n?t:U(t),z(e,t)}function Hd(e,t){if(typeof e!="function")throw new st(g);return t=t==null?0:ve(U(t),0),z(function(i){var s=i[t],o=Jt(i,0,t);return s&&jt(o,s),Ke(e,this,o)})}function Yd(e,t,i){var s=!0,o=!0;if(typeof e!="function")throw new st(g);return ae(i)&&(s="leading"in i?!!i.leading:s,o="trailing"in i?!!i.trailing:o),al(e,t,{leading:s,maxWait:t,trailing:o})}function Xd(e){return nl(e,1)}function jd(e,t){return Ps(hs(t),e)}function Zd(){if(!arguments.length)return[];var e=arguments[0];return B(e)?e:[e]}function Qd(e){return at(e,Re)}function Kd(e,t){return t=typeof t=="function"?t:n,at(e,Re,t)}function qd(e){return at(e,ce|Re)}function $d(e,t){return t=typeof t=="function"?t:n,at(e,ce|Re,t)}function Jd(e,t){return t==null||Qo(e,t,Ee(t))}function _t(e,t){return e===t||e!==e&&t!==t}var ep=rr(Jr),tp=rr(function(e,t){return e>=t}),mn=ta(function(){return arguments}())?ta:function(e){return he(e)&&K.call(e,"callee")&&!Wo.call(e,"callee")},B=b.isArray,np=Eo?qe(Eo):ch;function Ve(e){return e!=null&&dr(e.length)&&!Gt(e)}function fe(e){return he(e)&&Ve(e)}function ip(e){return e===!0||e===!1||he(e)&&Be(e)==nn}var en=_u||ks,rp=xo?qe(xo):uh;function sp(e){return he(e)&&e.nodeType===1&&!hi(e)}function op(e){if(e==null)return!0;if(Ve(e)&&(B(e)||typeof e=="string"||typeof e.splice=="function"||en(e)||Wn(e)||mn(e)))return!e.length;var t=Oe(e);if(t==ze||t==Se)return!e.size;if(ci(e))return!ns(e).length;for(var i in e)if(K.call(e,i))return!1;return!0}function ap(e,t){return oi(e,t)}function lp(e,t,i){i=typeof i=="function"?i:n;var s=i?i(e,t):n;return s===n?oi(e,t,n,i):!!s}function Rs(e){if(!he(e))return!1;var t=Be(e);return t==rn||t==vi||typeof e.message=="string"&&typeof e.name=="string"&&!hi(e)}function cp(e){return typeof e=="number"&&No(e)}function Gt(e){if(!ae(e))return!1;var t=Be(e);return t==Sn||t==wi||t==Pr||t==xi}function cl(e){return typeof e=="number"&&e==U(e)}function dr(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Te}function ae(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function he(e){return e!=null&&typeof e=="object"}var ul=So?qe(So):fh;function up(e,t){return e===t||ts(e,t,bs(t))}function hp(e,t,i){return i=typeof i=="function"?i:n,ts(e,t,bs(t),i)}function fp(e){return hl(e)&&e!=+e}function dp(e){if(Qh(e))throw new G(w);return na(e)}function pp(e){return e===null}function gp(e){return e==null}function hl(e){return typeof e=="number"||he(e)&&Be(e)==Nt}function hi(e){if(!he(e)||Be(e)!=ht)return!1;var t=Fi(e);if(t===null)return!0;var i=K.call(t,"constructor")&&t.constructor;return typeof i=="function"&&i instanceof i&&Bi.call(i)==uu}var Ts=Mo?qe(Mo):dh;function _p(e){return cl(e)&&e>=-9007199254740991&&e<=Te}var fl=Ao?qe(Ao):ph;function pr(e){return typeof e=="string"||!B(e)&&he(e)&&Be(e)==sn}function Je(e){return typeof e=="symbol"||he(e)&&Be(e)==Mn}var Wn=Po?qe(Po):gh;function mp(e){return e===n}function bp(e){return he(e)&&Oe(e)==on}function vp(e){return he(e)&&Be(e)==Mi}var wp=rr(is),yp=rr(function(e,t){return e<=t});function dl(e){if(!e)return[];if(Ve(e))return pr(e)?pt(e):We(e);if($n&&e[$n])return $c(e[$n]());var t=Oe(e),i=t==ze?Hr:t==Se?Ci:Vn;return i(e)}function Bt(e){if(!e)return e===0?e:0;if(e=ut(e),e===ge||e===-1/0){var t=e<0?-1:1;return t*_e}return e===e?e:0}function U(e){var t=Bt(e),i=t%1;return t===t?i?t-i:t:0}function pl(e){return e?dn(U(e),0,we):0}function ut(e){if(typeof e=="number")return e;if(Je(e))return Ze;if(ae(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=ae(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Co(e);var i=tc.test(e);return i||ic.test(e)?Gc(e.slice(2),i?2:8):ec.test(e)?Ze:+e}function gl(e){return Et(e,Ne(e))}function Ep(e){return e?dn(U(e),-9007199254740991,Te):e===0?e:0}function X(e){return e==null?"":$e(e)}var xp=kn(function(e,t){if(ci(t)||Ve(t)){Et(t,Ee(t),e);return}for(var i in t)K.call(t,i)&&ii(e,i,t[i])}),_l=kn(function(e,t){Et(t,Ne(t),e)}),gr=kn(function(e,t,i,s){Et(t,Ne(t),e,s)}),Sp=kn(function(e,t,i,s){Et(t,Ee(t),e,s)}),Mp=Ct(Kr);function Ap(e,t){var i=Un(e);return t==null?i:Zo(i,t)}var Pp=z(function(e,t){e=$(e);var i=-1,s=t.length,o=s>2?t[2]:n;for(o&&Ue(t[0],t[1],o)&&(s=1);++i<s;)for(var c=t[i],h=Ne(c),d=-1,m=h.length;++d<m;){var E=h[d],x=e[E];(x===n||_t(x,In[E])&&!K.call(e,E))&&(e[E]=c[E])}return e}),Rp=z(function(e){return e.push(n,Ca),Ke(ml,n,e)});function Tp(e,t){return To(e,O(t,3),yt)}function Lp(e,t){return To(e,O(t,3),$r)}function Op(e,t){return e==null?e:qr(e,O(t,3),Ne)}function Dp(e,t){return e==null?e:Jo(e,O(t,3),Ne)}function Cp(e,t){return e&&yt(e,O(t,3))}function Ip(e,t){return e&&$r(e,O(t,3))}function Gp(e){return e==null?[]:Ki(e,Ee(e))}function Bp(e){return e==null?[]:Ki(e,Ne(e))}function Ls(e,t,i){var s=e==null?n:pn(e,t);return s===n?i:s}function Up(e,t){return e!=null&&Ba(e,t,sh)}function Os(e,t){return e!=null&&Ba(e,t,oh)}var kp=Ra(function(e,t,i){t!=null&&typeof t.toString!="function"&&(t=Ui.call(t)),e[t]=i},Cs(He)),zp=Ra(function(e,t,i){t!=null&&typeof t.toString!="function"&&(t=Ui.call(t)),K.call(e,t)?e[t].push(i):e[t]=[i]},O),Fp=z(si);function Ee(e){return Ve(e)?Xo(e):ns(e)}function Ne(e){return Ve(e)?Xo(e,!0):_h(e)}function Wp(e,t){var i={};return t=O(t,3),yt(e,function(s,o,c){Ot(i,t(s,o,c),s)}),i}function Vp(e,t){var i={};return t=O(t,3),yt(e,function(s,o,c){Ot(i,o,t(s,o,c))}),i}var Np=kn(function(e,t,i){qi(e,t,i)}),ml=kn(function(e,t,i,s){qi(e,t,i,s)}),Hp=Ct(function(e,t){var i={};if(e==null)return i;var s=!1;t=se(t,function(c){return c=$t(c,e),s||(s=c.length>1),c}),Et(e,_s(e),i),s&&(i=at(i,ce|Pe|Re,Uh));for(var o=t.length;o--;)ls(i,t[o]);return i});function Yp(e,t){return bl(e,fr(O(t)))}var Xp=Ct(function(e,t){return e==null?{}:bh(e,t)});function bl(e,t){if(e==null)return{};var i=se(_s(e),function(s){return[s]});return t=O(t),ca(e,i,function(s,o){return t(s,o[0])})}function jp(e,t,i){t=$t(t,e);var s=-1,o=t.length;for(o||(o=1,e=n);++s<o;){var c=e==null?n:e[xt(t[s])];c===n&&(s=o,c=i),e=Gt(c)?c.call(e):c}return e}function Zp(e,t,i){return e==null?e:ai(e,t,i)}function Qp(e,t,i,s){return s=typeof s=="function"?s:n,e==null?e:ai(e,t,i,s)}var vl=Oa(Ee),wl=Oa(Ne);function Kp(e,t,i){var s=B(e),o=s||en(e)||Wn(e);if(t=O(t,4),i==null){var c=e&&e.constructor;o?i=s?new c:[]:ae(e)?i=Gt(c)?Un(Fi(e)):{}:i={}}return(o?rt:yt)(e,function(h,d,m){return t(i,h,d,m)}),i}function qp(e,t){return e==null?!0:ls(e,t)}function $p(e,t,i){return e==null?e:pa(e,t,hs(i))}function Jp(e,t,i,s){return s=typeof s=="function"?s:n,e==null?e:pa(e,t,hs(i),s)}function Vn(e){return e==null?[]:Nr(e,Ee(e))}function eg(e){return e==null?[]:Nr(e,Ne(e))}function tg(e,t,i){return i===n&&(i=t,t=n),i!==n&&(i=ut(i),i=i===i?i:0),t!==n&&(t=ut(t),t=t===t?t:0),dn(ut(e),t,i)}function ng(e,t,i){return t=Bt(t),i===n?(i=t,t=0):i=Bt(i),e=ut(e),ah(e,t,i)}function ig(e,t,i){if(i&&typeof i!="boolean"&&Ue(e,t,i)&&(t=i=n),i===n&&(typeof t=="boolean"?(i=t,t=n):typeof e=="boolean"&&(i=e,e=n)),e===n&&t===n?(e=0,t=1):(e=Bt(e),t===n?(t=e,e=0):t=Bt(t)),e>t){var s=e;e=t,t=s}if(i||e%1||t%1){var o=Ho();return Le(e+o*(t-e+Ic("1e-"+((o+"").length-1))),t)}return ss(e,t)}var rg=zn(function(e,t,i){return t=t.toLowerCase(),e+(i?yl(t):t)});function yl(e){return Ds(X(e).toLowerCase())}function El(e){return e=X(e),e&&e.replace(sc,jc).replace(Sc,"")}function sg(e,t,i){e=X(e),t=$e(t);var s=e.length;i=i===n?s:dn(U(i),0,s);var o=i;return i-=t.length,i>=0&&e.slice(i,o)==t}function og(e){return e=X(e),e&&Fe.test(e)?e.replace(ye,Zc):e}function ag(e){return e=X(e),e&&ln.test(e)?e.replace(Qe,"\\$&"):e}var lg=zn(function(e,t,i){return e+(i?"-":"")+t.toLowerCase()}),cg=zn(function(e,t,i){return e+(i?" ":"")+t.toLowerCase()}),ug=Ma("toLowerCase");function hg(e,t,i){e=X(e),t=U(t);var s=t?Dn(e):0;if(!t||s>=t)return e;var o=(t-s)/2;return ir(Hi(o),i)+e+ir(Ni(o),i)}function fg(e,t,i){e=X(e),t=U(t);var s=t?Dn(e):0;return t&&s<t?e+ir(t-s,i):e}function dg(e,t,i){e=X(e),t=U(t);var s=t?Dn(e):0;return t&&s<t?ir(t-s,i)+e:e}function pg(e,t,i){return i||t==null?t=0:t&&(t=+t),wu(X(e).replace(Yt,""),t||0)}function gg(e,t,i){return(i?Ue(e,t,i):t===n)?t=1:t=U(t),os(X(e),t)}function _g(){var e=arguments,t=X(e[0]);return e.length<3?t:t.replace(e[1],e[2])}var mg=zn(function(e,t,i){return e+(i?"_":"")+t.toLowerCase()});function bg(e,t,i){return i&&typeof i!="number"&&Ue(e,t,i)&&(t=i=n),i=i===n?we:i>>>0,i?(e=X(e),e&&(typeof t=="string"||t!=null&&!Ts(t))&&(t=$e(t),!t&&On(e))?Jt(pt(e),0,i):e.split(t,i)):[]}var vg=zn(function(e,t,i){return e+(i?" ":"")+Ds(t)});function wg(e,t,i){return e=X(e),i=i==null?0:dn(U(i),0,e.length),t=$e(t),e.slice(i,i+t.length)==t}function yg(e,t,i){var s=l.templateSettings;i&&Ue(e,t,i)&&(t=n),e=X(e),t=gr({},t,s,Da);var o=gr({},t.imports,s.imports,Da),c=Ee(o),h=Nr(o,c),d,m,E=0,x=t.interpolate||Ri,M="__p += '",A=Yr((t.escape||Ri).source+"|"+x.source+"|"+(x===Kn?Jl:Ri).source+"|"+(t.evaluate||Ri).source+"|$","g"),L="//# sourceURL="+(K.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Tc+"]")+`
|
|
11
|
+
`;e.replace(A,function(I,W,N,et,ke,tt){return N||(N=et),M+=e.slice(E,tt).replace(oc,Qc),W&&(d=!0,M+=`' +
|
|
12
|
+
__e(`+W+`) +
|
|
13
|
+
'`),ke&&(m=!0,M+=`';
|
|
14
|
+
`+ke+`;
|
|
15
|
+
__p += '`),N&&(M+=`' +
|
|
16
|
+
((__t = (`+N+`)) == null ? '' : __t) +
|
|
17
|
+
'`),E=tt+I.length,I}),M+=`';
|
|
18
|
+
`;var C=K.call(t,"variable")&&t.variable;if(!C)M=`with (obj) {
|
|
19
|
+
`+M+`
|
|
20
|
+
}
|
|
21
|
+
`;else if(ql.test(C))throw new G(P);M=(m?M.replace(p,""):M).replace(R,"$1").replace(F,"$1;"),M="function("+(C||"obj")+`) {
|
|
22
|
+
`+(C?"":`obj || (obj = {});
|
|
23
|
+
`)+"var __t, __p = ''"+(d?", __e = _.escape":"")+(m?`, __j = Array.prototype.join;
|
|
24
|
+
function print() { __p += __j.call(arguments, '') }
|
|
25
|
+
`:`;
|
|
26
|
+
`)+M+`return __p
|
|
27
|
+
}`;var k=Sl(function(){return Y(c,L+"return "+M).apply(n,h)});if(k.source=M,Rs(k))throw k;return k}function Eg(e){return X(e).toLowerCase()}function xg(e){return X(e).toUpperCase()}function Sg(e,t,i){if(e=X(e),e&&(i||t===n))return Co(e);if(!e||!(t=$e(t)))return e;var s=pt(e),o=pt(t),c=Io(s,o),h=Go(s,o)+1;return Jt(s,c,h).join("")}function Mg(e,t,i){if(e=X(e),e&&(i||t===n))return e.slice(0,Uo(e)+1);if(!e||!(t=$e(t)))return e;var s=pt(e),o=Go(s,pt(t))+1;return Jt(s,0,o).join("")}function Ag(e,t,i){if(e=X(e),e&&(i||t===n))return e.replace(Yt,"");if(!e||!(t=$e(t)))return e;var s=pt(e),o=Io(s,pt(t));return Jt(s,o).join("")}function Pg(e,t){var i=Yn,s=kt;if(ae(t)){var o="separator"in t?t.separator:o;i="length"in t?U(t.length):i,s="omission"in t?$e(t.omission):s}e=X(e);var c=e.length;if(On(e)){var h=pt(e);c=h.length}if(i>=c)return e;var d=i-Dn(s);if(d<1)return s;var m=h?Jt(h,0,d).join(""):e.slice(0,d);if(o===n)return m+s;if(h&&(d+=m.length-d),Ts(o)){if(e.slice(d).search(o)){var E,x=m;for(o.global||(o=Yr(o.source,X(eo.exec(o))+"g")),o.lastIndex=0;E=o.exec(x);)var M=E.index;m=m.slice(0,M===n?d:M)}}else if(e.indexOf($e(o),d)!=d){var A=m.lastIndexOf(o);A>-1&&(m=m.slice(0,A))}return m+s}function Rg(e){return e=X(e),e&&wt.test(e)?e.replace(Q,nu):e}var Tg=zn(function(e,t,i){return e+(i?" ":"")+t.toUpperCase()}),Ds=Ma("toUpperCase");function xl(e,t,i){return e=X(e),t=i?n:t,t===n?qc(e)?su(e):Vc(e):e.match(t)||[]}var Sl=z(function(e,t){try{return Ke(e,n,t)}catch(i){return Rs(i)?i:new G(i)}}),Lg=Ct(function(e,t){return rt(t,function(i){i=xt(i),Ot(e,i,As(e[i],e))}),e});function Og(e){var t=e==null?0:e.length,i=O();return e=t?se(e,function(s){if(typeof s[1]!="function")throw new st(g);return[i(s[0]),s[1]]}):[],z(function(s){for(var o=-1;++o<t;){var c=e[o];if(Ke(c[0],this,s))return Ke(c[1],this,s)}})}function Dg(e){return nh(at(e,ce))}function Cs(e){return function(){return e}}function Cg(e,t){return e==null||e!==e?t:e}var Ig=Pa(),Gg=Pa(!0);function He(e){return e}function Is(e){return ia(typeof e=="function"?e:at(e,ce))}function Bg(e){return sa(at(e,ce))}function Ug(e,t){return oa(e,at(t,ce))}var kg=z(function(e,t){return function(i){return si(i,e,t)}}),zg=z(function(e,t){return function(i){return si(e,i,t)}});function Gs(e,t,i){var s=Ee(t),o=Ki(t,s);i==null&&!(ae(t)&&(o.length||!s.length))&&(i=t,t=e,e=this,o=Ki(t,Ee(t)));var c=!(ae(i)&&"chain"in i)||!!i.chain,h=Gt(e);return rt(o,function(d){var m=t[d];e[d]=m,h&&(e.prototype[d]=function(){var E=this.__chain__;if(c||E){var x=e(this.__wrapped__),M=x.__actions__=We(this.__actions__);return M.push({func:m,args:arguments,thisArg:e}),x.__chain__=E,x}return m.apply(e,jt([this.value()],arguments))})}),e}function Fg(){return Me._===this&&(Me._=hu),this}function Bs(){}function Wg(e){return e=U(e),z(function(t){return aa(t,e)})}var Vg=ds(se),Ng=ds(Ro),Hg=ds(kr);function Ml(e){return ws(e)?zr(xt(e)):vh(e)}function Yg(e){return function(t){return e==null?n:pn(e,t)}}var Xg=Ta(),jg=Ta(!0);function Us(){return[]}function ks(){return!1}function Zg(){return{}}function Qg(){return""}function Kg(){return!0}function qg(e,t){if(e=U(e),e<1||e>Te)return[];var i=we,s=Le(e,we);t=O(t),e-=we;for(var o=Vr(s,t);++i<e;)t(i);return o}function $g(e){return B(e)?se(e,xt):Je(e)?[e]:We(Ya(X(e)))}function Jg(e){var t=++cu;return X(e)+t}var e0=nr(function(e,t){return e+t},0),t0=ps("ceil"),n0=nr(function(e,t){return e/t},1),i0=ps("floor");function r0(e){return e&&e.length?Qi(e,He,Jr):n}function s0(e,t){return e&&e.length?Qi(e,O(t,2),Jr):n}function o0(e){return Oo(e,He)}function a0(e,t){return Oo(e,O(t,2))}function l0(e){return e&&e.length?Qi(e,He,is):n}function c0(e,t){return e&&e.length?Qi(e,O(t,2),is):n}var u0=nr(function(e,t){return e*t},1),h0=ps("round"),f0=nr(function(e,t){return e-t},0);function d0(e){return e&&e.length?Wr(e,He):0}function p0(e,t){return e&&e.length?Wr(e,O(t,2)):0}return l.after=Bd,l.ary=nl,l.assign=xp,l.assignIn=_l,l.assignInWith=gr,l.assignWith=Sp,l.at=Mp,l.before=il,l.bind=As,l.bindAll=Lg,l.bindKey=rl,l.castArray=Zd,l.chain=Ja,l.chunk=nf,l.compact=rf,l.concat=sf,l.cond=Og,l.conforms=Dg,l.constant=Cs,l.countBy=dd,l.create=Ap,l.curry=sl,l.curryRight=ol,l.debounce=al,l.defaults=Pp,l.defaultsDeep=Rp,l.defer=Ud,l.delay=kd,l.difference=of,l.differenceBy=af,l.differenceWith=lf,l.drop=cf,l.dropRight=uf,l.dropRightWhile=hf,l.dropWhile=ff,l.fill=df,l.filter=gd,l.flatMap=bd,l.flatMapDeep=vd,l.flatMapDepth=wd,l.flatten=Qa,l.flattenDeep=pf,l.flattenDepth=gf,l.flip=zd,l.flow=Ig,l.flowRight=Gg,l.fromPairs=_f,l.functions=Gp,l.functionsIn=Bp,l.groupBy=yd,l.initial=bf,l.intersection=vf,l.intersectionBy=wf,l.intersectionWith=yf,l.invert=kp,l.invertBy=zp,l.invokeMap=xd,l.iteratee=Is,l.keyBy=Sd,l.keys=Ee,l.keysIn=Ne,l.map=cr,l.mapKeys=Wp,l.mapValues=Vp,l.matches=Bg,l.matchesProperty=Ug,l.memoize=hr,l.merge=Np,l.mergeWith=ml,l.method=kg,l.methodOf=zg,l.mixin=Gs,l.negate=fr,l.nthArg=Wg,l.omit=Hp,l.omitBy=Yp,l.once=Fd,l.orderBy=Md,l.over=Vg,l.overArgs=Wd,l.overEvery=Ng,l.overSome=Hg,l.partial=Ps,l.partialRight=ll,l.partition=Ad,l.pick=Xp,l.pickBy=bl,l.property=Ml,l.propertyOf=Yg,l.pull=Mf,l.pullAll=qa,l.pullAllBy=Af,l.pullAllWith=Pf,l.pullAt=Rf,l.range=Xg,l.rangeRight=jg,l.rearg=Vd,l.reject=Td,l.remove=Tf,l.rest=Nd,l.reverse=Ss,l.sampleSize=Od,l.set=Zp,l.setWith=Qp,l.shuffle=Dd,l.slice=Lf,l.sortBy=Gd,l.sortedUniq=Uf,l.sortedUniqBy=kf,l.split=bg,l.spread=Hd,l.tail=zf,l.take=Ff,l.takeRight=Wf,l.takeRightWhile=Vf,l.takeWhile=Nf,l.tap=rd,l.throttle=Yd,l.thru=lr,l.toArray=dl,l.toPairs=vl,l.toPairsIn=wl,l.toPath=$g,l.toPlainObject=gl,l.transform=Kp,l.unary=Xd,l.union=Hf,l.unionBy=Yf,l.unionWith=Xf,l.uniq=jf,l.uniqBy=Zf,l.uniqWith=Qf,l.unset=qp,l.unzip=Ms,l.unzipWith=$a,l.update=$p,l.updateWith=Jp,l.values=Vn,l.valuesIn=eg,l.without=Kf,l.words=xl,l.wrap=jd,l.xor=qf,l.xorBy=$f,l.xorWith=Jf,l.zip=ed,l.zipObject=td,l.zipObjectDeep=nd,l.zipWith=id,l.entries=vl,l.entriesIn=wl,l.extend=_l,l.extendWith=gr,Gs(l,l),l.add=e0,l.attempt=Sl,l.camelCase=rg,l.capitalize=yl,l.ceil=t0,l.clamp=tg,l.clone=Qd,l.cloneDeep=qd,l.cloneDeepWith=$d,l.cloneWith=Kd,l.conformsTo=Jd,l.deburr=El,l.defaultTo=Cg,l.divide=n0,l.endsWith=sg,l.eq=_t,l.escape=og,l.escapeRegExp=ag,l.every=pd,l.find=_d,l.findIndex=ja,l.findKey=Tp,l.findLast=md,l.findLastIndex=Za,l.findLastKey=Lp,l.floor=i0,l.forEach=el,l.forEachRight=tl,l.forIn=Op,l.forInRight=Dp,l.forOwn=Cp,l.forOwnRight=Ip,l.get=Ls,l.gt=ep,l.gte=tp,l.has=Up,l.hasIn=Os,l.head=Ka,l.identity=He,l.includes=Ed,l.indexOf=mf,l.inRange=ng,l.invoke=Fp,l.isArguments=mn,l.isArray=B,l.isArrayBuffer=np,l.isArrayLike=Ve,l.isArrayLikeObject=fe,l.isBoolean=ip,l.isBuffer=en,l.isDate=rp,l.isElement=sp,l.isEmpty=op,l.isEqual=ap,l.isEqualWith=lp,l.isError=Rs,l.isFinite=cp,l.isFunction=Gt,l.isInteger=cl,l.isLength=dr,l.isMap=ul,l.isMatch=up,l.isMatchWith=hp,l.isNaN=fp,l.isNative=dp,l.isNil=gp,l.isNull=pp,l.isNumber=hl,l.isObject=ae,l.isObjectLike=he,l.isPlainObject=hi,l.isRegExp=Ts,l.isSafeInteger=_p,l.isSet=fl,l.isString=pr,l.isSymbol=Je,l.isTypedArray=Wn,l.isUndefined=mp,l.isWeakMap=bp,l.isWeakSet=vp,l.join=Ef,l.kebabCase=lg,l.last=ct,l.lastIndexOf=xf,l.lowerCase=cg,l.lowerFirst=ug,l.lt=wp,l.lte=yp,l.max=r0,l.maxBy=s0,l.mean=o0,l.meanBy=a0,l.min=l0,l.minBy=c0,l.stubArray=Us,l.stubFalse=ks,l.stubObject=Zg,l.stubString=Qg,l.stubTrue=Kg,l.multiply=u0,l.nth=Sf,l.noConflict=Fg,l.noop=Bs,l.now=ur,l.pad=hg,l.padEnd=fg,l.padStart=dg,l.parseInt=pg,l.random=ig,l.reduce=Pd,l.reduceRight=Rd,l.repeat=gg,l.replace=_g,l.result=jp,l.round=h0,l.runInContext=_,l.sample=Ld,l.size=Cd,l.snakeCase=mg,l.some=Id,l.sortedIndex=Of,l.sortedIndexBy=Df,l.sortedIndexOf=Cf,l.sortedLastIndex=If,l.sortedLastIndexBy=Gf,l.sortedLastIndexOf=Bf,l.startCase=vg,l.startsWith=wg,l.subtract=f0,l.sum=d0,l.sumBy=p0,l.template=yg,l.times=qg,l.toFinite=Bt,l.toInteger=U,l.toLength=pl,l.toLower=Eg,l.toNumber=ut,l.toSafeInteger=Ep,l.toString=X,l.toUpper=xg,l.trim=Sg,l.trimEnd=Mg,l.trimStart=Ag,l.truncate=Pg,l.unescape=Rg,l.uniqueId=Jg,l.upperCase=Tg,l.upperFirst=Ds,l.each=el,l.eachRight=tl,l.first=Ka,Gs(l,function(){var e={};return yt(l,function(t,i){K.call(l.prototype,i)||(e[i]=t)}),e}(),{chain:!1}),l.VERSION=r,rt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){l[e].placeholder=l}),rt(["drop","take"],function(e,t){V.prototype[e]=function(i){i=i===n?1:ve(U(i),0);var s=this.__filtered__&&!t?new V(this):this.clone();return s.__filtered__?s.__takeCount__=Le(i,s.__takeCount__):s.__views__.push({size:Le(i,we),type:e+(s.__dir__<0?"Right":"")}),s},V.prototype[e+"Right"]=function(i){return this.reverse()[e](i).reverse()}}),rt(["filter","map","takeWhile"],function(e,t){var i=t+1,s=i==Ge||i==je;V.prototype[e]=function(o){var c=this.clone();return c.__iteratees__.push({iteratee:O(o,3),type:i}),c.__filtered__=c.__filtered__||s,c}}),rt(["head","last"],function(e,t){var i="take"+(t?"Right":"");V.prototype[e]=function(){return this[i](1).value()[0]}}),rt(["initial","tail"],function(e,t){var i="drop"+(t?"":"Right");V.prototype[e]=function(){return this.__filtered__?new V(this):this[i](1)}}),V.prototype.compact=function(){return this.filter(He)},V.prototype.find=function(e){return this.filter(e).head()},V.prototype.findLast=function(e){return this.reverse().find(e)},V.prototype.invokeMap=z(function(e,t){return typeof e=="function"?new V(this):this.map(function(i){return si(i,e,t)})}),V.prototype.reject=function(e){return this.filter(fr(O(e)))},V.prototype.slice=function(e,t){e=U(e);var i=this;return i.__filtered__&&(e>0||t<0)?new V(i):(e<0?i=i.takeRight(-e):e&&(i=i.drop(e)),t!==n&&(t=U(t),i=t<0?i.dropRight(-t):i.take(t-e)),i)},V.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},V.prototype.toArray=function(){return this.take(we)},yt(V.prototype,function(e,t){var i=/^(?:filter|find|map|reject)|While$/.test(t),s=/^(?:head|last)$/.test(t),o=l[s?"take"+(t=="last"?"Right":""):t],c=s||/^find/.test(t);o&&(l.prototype[t]=function(){var h=this.__wrapped__,d=s?[1]:arguments,m=h instanceof V,E=d[0],x=m||B(h),M=function(W){var N=o.apply(l,jt([W],d));return s&&A?N[0]:N};x&&i&&typeof E=="function"&&E.length!=1&&(m=x=!1);var A=this.__chain__,L=!!this.__actions__.length,C=c&&!A,k=m&&!L;if(!c&&x){h=k?h:new V(this);var I=e.apply(h,d);return I.__actions__.push({func:lr,args:[M],thisArg:n}),new ot(I,A)}return C&&k?e.apply(this,d):(I=this.thru(M),C?s?I.value()[0]:I.value():I)})}),rt(["pop","push","shift","sort","splice","unshift"],function(e){var t=Ii[e],i=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",s=/^(?:pop|shift)$/.test(e);l.prototype[e]=function(){var o=arguments;if(s&&!this.__chain__){var c=this.value();return t.apply(B(c)?c:[],o)}return this[i](function(h){return t.apply(B(h)?h:[],o)})}}),yt(V.prototype,function(e,t){var i=l[t];if(i){var s=i.name+"";K.call(Bn,s)||(Bn[s]=[]),Bn[s].push({name:t,func:i})}}),Bn[tr(n,re).name]=[{name:"wrapper",func:n}],V.prototype.clone=Pu,V.prototype.reverse=Ru,V.prototype.value=Tu,l.prototype.at=sd,l.prototype.chain=od,l.prototype.commit=ad,l.prototype.next=ld,l.prototype.plant=ud,l.prototype.reverse=hd,l.prototype.toJSON=l.prototype.valueOf=l.prototype.value=fd,l.prototype.first=l.prototype.head,$n&&(l.prototype[$n]=cd),l},Cn=ou();cn?((cn.exports=Cn)._=Cn,Ir._=Cn):Me._=Cn}).call(O0)}(_i,_i.exports)),_i.exports}var C0=D0(),I0={AssetLoader:"./src/modules/asset/loader/AssetLoader.mjs",AssetConverter:"./src/modules/asset/converter/AssetConverter.mjs",AssetExporter:"./src/modules/asset/exporter/AssetExporter.mjs",ARSystem:"./src/modules/ar/ARSystem.mjs",MediaCreator:"./src/modules/mediacreator/MediaCreator.mjs",SystemInfo:"./src/modules/systeminfo/SystemInfo.mjs"};class G0{constructor(a){y(this,"_promise",null);y(this,"_instance",null);y(this,"_importFn");this._name=a,this._importFn=async()=>{const n=I0[this._name];if(!n)throw new Error(`Build path for module ${this._name} not found in __MODULE_BUILD_PATHS__. Build configuration issue?`);try{const r=await import(n);if(!r[this._name])throw new Error(`Module class ${this._name} not found in dynamically imported module: ${n}`);return r[this._name]}catch(r){throw new Error(`Failed to dynamically import module ${this._name} from path ${n}: ${r instanceof Error?r.message:String(r)}`)}}}async getInstance(){if(this._instance!==null)return this._instance;this._promise||(this._promise=this._importFn());try{const a=await this._promise;return this._instance=new a,this._instance}catch(a){throw new Error(`Failed to instantiate module ${this._name}: ${a instanceof Error?a.message:String(a)}`)}}}const Mr=class Mr{constructor(){y(this,"_modules",new Map)}static get instance(){return this._instance}register(a){this._modules.has(a)&&console.warn(`Module '${a}' is already registered. Overwriting.`),this._modules.set(a,new G0(a))}async get(a){const n=this._modules.get(a);if(!n)throw new Error(`Module '${a}' not registered`);return n.getInstance()}};y(Mr,"_instance",new Mr);let js=Mr;const mi=js.instance,B0={AssetLoader:"./asset/loader/AssetLoader.ts",AssetConverter:"./asset/converter/AssetConverter.ts",AssetExporter:"./asset/exporter/AssetExporter.ts",ARSystem:"./ar/ARSystem.ts",MediaCreator:"./mediacreator/MediaCreator.ts",SystemInfo:"./systeminfo/SystemInfo.ts"};Object.keys(B0).forEach(S=>{mi.register(S)});const Hn=class Hn{constructor(a,n,r,f){y(this,"_id");y(this,"renderer");y(this,"scene");y(this,"controller");y(this,"toolbox");y(this,"registered",new Map);y(this,"listeners",new Map);this._id=L0(),this.renderer=a,this.scene=n,this.controller=r,this.toolbox=f,Hn.__instances.push(this)}static get(a){const n=this.__instances.find(r=>r.id===a);return n||this.__instances.find(r=>Array.from(r.registered.values()).find(f=>f.id===a))}get id(){return this._id}DestroyInstance(){const a=Hn.__instances.findIndex(n=>n.id===this.id);return a===-1?!1:(Hn.__instances.splice(a,1),!0)}PerformAction(a,n){let r=!1;switch(a){case"START_RENDER":{this.renderer.StartRenderer(this.scene,this.controller.object),r=!0;break}case"GET_ALL_SCENE_DATA":{r=this.getAllSceneData(n);break}case"GET_ALL_OBJECTS":{r=this.getAllObjects(n);break}case"GET_OBJECTS":{r=this.getObjects(n);break}case"ADD_OBJECT":{r=this.addObject(n);break}case"UPDATE_OBJECT":{r=this.updateObject(n);break}case"DELETE_OBJECT":{r=this.deleteObject(n);break}case"SELECT_OBJECT":{r=this.selectObject(n);break}case"DESELECT_OBJECT":{r=this.deselectObject(n);break}case"SET_BACKGROUND":{r=this.setBackground(n);break}case"DROP_IT":{r=this.dropIt(n);break}case"PLACE_ON_FLOOR":{r=this.placeOnFloor(n);break}case"SET_CAMERA_TRANSFORM":{r=this.setCameraTransform(n);break}case"GET_CAMERA_TRANSFORM":{r=this.getCameraTransform(n);break}case"MOVE_CAMERA":{r=this.moveCamera(n);break}case"RESET_CAMERA":{r=this.resetCamera(n);break}case"COMPUTE_ENCOMPASSING_VIEW":{r=this.computeEncompassingView(n);break}case"SET_CAMERA_LAYER":{r=this.setCameraLayer(n);break}case"ZOOM_CAMERA":{r=this.zoomCamera(n);break}case"SET_GIZMO_MODE":{r=this.setGizmoMode(n);break}case"SET_GIZMO_VISIBILITY":{r=this.setGizmoVisibility(n);break}case"SET_GIZMO_SCALE_LINKED":{r=this.setGizmoScaleLinked(n);break}case"USE_TOOL":{r=this.useTool(n);break}case"MODEL_LOADED":{r=this.modelLoaded(n);break}case"UPDATE_SCENE":{r=this.updateScene(n);break}case"GENERATE_MEDIA":{r=this.generateMedia(n);break}case"SET_PARENT":{r=this.setParent(n);break}case"EXPORT_SCENE":{r=this.exportScene(n);break}case"LAUNCH_AR":{const{uri:f,options:w}=n;r=new Promise((g,P)=>{mi.get("ARSystem").then(D=>{g(D.launch(f,w))}).catch(P)});break}default:console.warn(`DIVECommunication.PerformAction: has been executed with unknown Action type ${a}`)}return this.dispatch(a,n),r}Subscribe(a,n){return this.listeners.get(a)||this.listeners.set(a,[]),this.listeners.get(a).push(n),()=>{const r=this.listeners.get(a);if(!r)return!1;const f=r.findIndex(w=>w===n);return f===-1?!1:(r.splice(f,1),!0)}}dispatch(a,n){const r=this.listeners.get(a);r&&r.forEach(f=>f(n))}getAllSceneData(a){const n={name:this.scene.name,mediaItem:null,backgroundColor:"#"+this.scene.background.getHexString(),floorEnabled:this.scene.Floor.visible,floorColor:"#"+this.scene.Floor.material.color.getHexString(),userCamera:{position:this.controller.object.position.clone(),target:this.controller.target.clone()},spotmarks:[],lights:Array.from(this.registered.values()).filter(r=>r.entityType==="light"),objects:Array.from(this.registered.values()).filter(r=>r.entityType==="model"),cameras:Array.from(this.registered.values()).filter(r=>r.entityType==="pov"),primitives:Array.from(this.registered.values()).filter(r=>r.entityType==="primitive"),groups:Array.from(this.registered.values()).filter(r=>r.entityType==="group")};return Object.assign(a,n),n}getAllObjects(a){return Object.assign(a,this.registered),this.registered}getObjects(a){if(a.ids.length===0)return[];const n=[];return this.registered.forEach(r=>{a.ids.includes(r.id)&&n.push(r)}),n}addObject(a){return this.registered.get(a.id)?!1:(a.parentId===void 0&&(a.parentId=null),this.registered.set(a.id,a),this.scene.AddSceneObject(a),!0)}updateObject(a){const n=this.registered.get(a.id);if(!n)return!1;this.registered.set(a.id,C0.merge(n,a));const r=this.registered.get(a.id);return this.scene.UpdateSceneObject({...a,id:r.id,entityType:r.entityType}),Object.assign(a,r),!0}deleteObject(a){const n=this.registered.get(a.id);return n?(n.parentId&&this.setParent({object:{id:n.id},parent:null}),n.entityType==="group"&&this.registered.forEach(r=>{r.parentId===n.id&&this.updateObject({id:r.id,parentId:null})}),Object.assign(a,n),this.registered.delete(a.id),Array.from(this.registered.values()).forEach(r=>{r.parentId&&r.parentId===a.id&&(r.parentId=null)}),this.scene.DeleteSceneObject(n),!0):!1}selectObject(a){const n=this.registered.get(a.id);if(!n)return!1;const r=this.scene.GetSceneObject(n);if(!r||!("isSelectable"in r))return!1;const f=this.toolbox.GetActiveTool();return f&&Ul(f)&&f.AttachGizmo(r),Object.assign(a,n),!0}deselectObject(a){const n=this.registered.get(a.id);if(!n)return!1;const r=this.scene.GetSceneObject(n);if(!r||!("isSelectable"in r))return!1;const f=this.toolbox.GetActiveTool();return f&&Ul(f)&&f.DetachGizmo(),Object.assign(a,n),!0}setBackground(a){return this.scene.SetBackground(a.color),!0}dropIt(a){const n=this.registered.get(a.id);return n?(this.scene.GetSceneObject(n).DropIt(),!0):!1}placeOnFloor(a){const n=this.registered.get(a.id);return n?(this.scene.PlaceOnFloor(n),!0):!1}setCameraTransform(a){return this.controller.object.position.copy(a.position),this.controller.target.copy(a.target),this.controller.update(),!0}getCameraTransform(a){const n={position:this.controller.object.position.clone(),target:this.controller.target.clone()};return Object.assign(a,n),n}moveCamera(a){let n={x:0,y:0,z:0},r={x:0,y:0,z:0};return"id"in a?(n=this.registered.get(a.id).position,r=this.registered.get(a.id).target):(n=a.position,r=a.target),this.controller.MoveTo(n,r,a.duration,a.locked),!0}setCameraLayer(a){return this.controller.object.SetCameraLayer(a.layer),!0}resetCamera(a){return this.controller.RevertLast(a.duration),!0}computeEncompassingView(a){const n=this.scene.ComputeSceneBB(),r=this.controller.ComputeEncompassingView(n);return Object.assign(a,r),r}zoomCamera(a){return a.direction==="IN"&&this.controller.ZoomIn(a.by),a.direction==="OUT"&&this.controller.ZoomOut(a.by),!0}setGizmoMode(a){return this.toolbox.SetGizmoMode(a.mode),!0}setGizmoVisibility(a){return this.toolbox.SetGizmoVisibility(a),a}setGizmoScaleLinked(a){return this.toolbox.SetGizmoScaleLinked(a),a}useTool(a){return this.toolbox.UseTool(a.tool),!0}modelLoaded(a){return this.registered.get(a.id).loaded=!0,!0}updateScene(a){return a.name!==void 0&&(this.scene.name=a.name),a.backgroundColor!==void 0&&this.scene.SetBackground(a.backgroundColor),a.gridEnabled!==void 0&&this.scene.Grid.SetVisibility(a.gridEnabled),a.floorEnabled!==void 0&&this.scene.Floor.SetVisibility(a.floorEnabled),a.floorColor!==void 0&&this.scene.Floor.SetColor(a.floorColor),a.name=this.scene.name,a.backgroundColor="#"+this.scene.background.getHexString(),a.gridEnabled=this.scene.Grid.visible,a.floorEnabled=this.scene.Floor.visible,a.floorColor="#"+this.scene.Floor.material.color.getHexString(),!0}generateMedia(a){let n={x:0,y:0,z:0},r={x:0,y:0,z:0};return"id"in a?(n=this.registered.get(a.id).position,r=this.registered.get(a.id).target):(n=a.position,r=a.target),mi.get("MediaCreator").then(f=>f.GenerateMedia(n,r,a.width,a.height))}setParent(a){const n=this.registered.get(a.object.id);if(!n)return!1;const r=this.scene.GetSceneObject(n);if(!r)return!1;if(a.parent===null)return this.scene.Root.attach(r),this.updateObject({id:n.id,parentId:null}),!0;if(a.object.id===a.parent.id)return!1;const f=this.registered.get(a.parent.id);if(!f)return this.scene.Root.attach(r),this.updateObject({id:n.id,parentId:null}),!0;const w=this.scene.GetSceneObject(f);return w?(w.attach(r),this.updateObject({id:n.id,parentId:f.id}),!0):(this.scene.Root.attach(r),this.updateObject({id:n.id,parentId:null}),!0)}exportScene(a){return mi.get("AssetExporter").then(n=>n.export(this.scene.Root,a.type,{}))}};y(Hn,"__instances",[]);let Ye=Hn;class U0{constructor(a){y(this,"_renderer");y(this,"_rendererCallbackId");this._renderer=a,this._rendererCallbackId=this._renderer.AddPreRenderCallback(()=>{this.Update()})}Dispose(){this._renderer.RemovePreRenderCallback(this._rendererCallbackId)}Update(){Nn.update()}Animate(a){return new Nn.Tween(a)}}class k0 extends u.OrthographicCamera{constructor(n,r,f){super(-1,1,1,-1,.1,100);y(this,"axesHelper");y(this,"_renderer");y(this,"_scene");y(this,"_renderCallbackId");this.layers.mask=pe.COORDINATE_LAYER_MASK,this.axesHelper=new u.AxesHelper(.5),this.axesHelper.layers.mask=pe.COORDINATE_LAYER_MASK,this.axesHelper.material.depthTest=!1,this.axesHelper.position.set(0,0,-1),this.axesHelper.setColors(new u.Color(Hs),new u.Color(Ys),new u.Color(Xs));const w=new zs("X",.2,Fl),g=new zs("Y",.2,Wl),P=new zs("Z",.2,Vl);w.layers.mask=pe.COORDINATE_LAYER_MASK,g.layers.mask=pe.COORDINATE_LAYER_MASK,P.layers.mask=pe.COORDINATE_LAYER_MASK,w.position.set(.7,0,0),g.position.set(0,.7,0),P.position.set(0,0,.7),this.axesHelper.add(w),this.axesHelper.add(g),this.axesHelper.add(P),this.add(this.axesHelper),this._renderer=n,this._scene=r,this._scene.add(this);const D=new u.Vector4;this._renderCallbackId=n.AddPostRenderCallback(()=>{const H=r.background;r.background=null,n.getViewport(D),n.setViewport(0,0,150,150),n.autoClear=!1,this.SetFromCameraMatrix(f.object.matrix),n.render(r,this),n.setViewport(D),n.autoClear=!0,r.background=H})}Dispose(){this._renderer.RemovePostRenderCallback(this._renderCallbackId),this._scene.remove(this)}SetFromCameraMatrix(n){this.axesHelper.rotation.setFromRotationMatrix(new u.Matrix4().extractRotation(n).invert())}}const z0="1.19.1-beta.4",F0={version:z0},wn={antialias:!0,alpha:!0,stencil:!1,shadowMapEnabled:!0,shadowMapType:u.PCFSoftShadowMap,toneMapping:u.NoToneMapping,canvas:void 0};class W0 extends u.WebGLRenderer{constructor(n=wn){super({antialias:n.antialias||wn.antialias,alpha:n.alpha||wn.alpha,preserveDrawingBuffer:!0,canvas:n.canvas});y(this,"paused",!1);y(this,"running",!1);y(this,"force",!1);y(this,"preRenderCallbacks",new Map);y(this,"postRenderCallbacks",new Map);this.setPixelRatio(window.devicePixelRatio),this.shadowMap.enabled=n.shadowMapEnabled||wn.shadowMapEnabled,this.shadowMap.type=n.shadowMapType||wn.shadowMapType,this.toneMapping=n.toneMapping||wn.toneMapping,this.debug.checkShaderErrors=!1}Dispose(){this.StopRenderer(),this.dispose()}StartRenderer(n,r){this.setAnimationLoop((f,w)=>{this.internal_render(n,r,f,w)}),this.running=!0}PauseRenderer(){this.paused=!0}ResumeRenderer(){this.paused=!1}StopRenderer(){this.setAnimationLoop(null),this.running=!1}OnResize(n,r){this.setSize(n,r)}AddPreRenderCallback(n){const r=u.MathUtils.generateUUID();return this.preRenderCallbacks.set(r,n),r}RemovePreRenderCallback(n){return this.preRenderCallbacks.has(n)?(this.preRenderCallbacks.delete(n),!0):!1}AddPostRenderCallback(n){const r=u.MathUtils.generateUUID();return this.postRenderCallbacks.set(r,n),r}RemovePostRenderCallback(n){return this.postRenderCallbacks.has(n)?(this.postRenderCallbacks.delete(n),!0):!1}ForceRendering(){this.force=!0}internal_render(n,r,f,w){(this.paused||!this.running)&&!this.force||(this.preRenderCallbacks.forEach(g=>{g(f,w)}),this.render(n,r),this.postRenderCallbacks.forEach(g=>{g(f,w)}),this.force=!1)}}class V0 extends u.Object3D{constructor(){super();y(this,"isDIVELight",!0);y(this,"isDIVEAmbientLight",!0);y(this,"_light");this.name="DIVEAmbientLight",this._light=new u.AmbientLight(16777215,1),this._light.layers.mask=pe.PRODUCT_LAYER_MASK,this.add(this._light)}SetColor(n){this._light.color=n}SetIntensity(n){this._light.intensity=n}SetEnabled(n){this._light.visible=n}}class N0 extends u.Object3D{constructor(){super();y(this,"isDIVELight",!0);y(this,"isDIVEPointLight",!0);y(this,"isMovable",!0);y(this,"isSelectable",!0);y(this,"gizmo",null);y(this,"light");y(this,"mesh");this.name="DIVEPointLight",this.light=new u.PointLight(16777215,1),this.light.layers.mask=pe.PRODUCT_LAYER_MASK,this.light.castShadow=!0,this.light.shadow.mapSize.width=512,this.light.shadow.mapSize.height=512,this.add(this.light);const n=.1,r=new u.SphereGeometry(n,n*320,n*320),f=new u.MeshBasicMaterial({color:this.light.color,transparent:!0,opacity:.8,side:u.FrontSide});this.mesh=new u.Mesh(r,f),this.mesh.layers.mask=pe.UI_LAYER_MASK,this.add(this.mesh)}SetColor(n){this.light.color=n,this.mesh.material.color=n}SetIntensity(n){this.light.intensity=n,this.mesh.material.opacity=n>.8?.8:n*.8}SetEnabled(n){this.light.visible=n}onMove(){var n;(n=Ye.get(this.userData.id))==null||n.PerformAction("UPDATE_OBJECT",{id:this.userData.id,position:this.position})}onSelect(){var n;(n=Ye.get(this.userData.id))==null||n.PerformAction("SELECT_OBJECT",{id:this.userData.id})}onDeselect(){var n;(n=Ye.get(this.userData.id))==null||n.PerformAction("DESELECT_OBJECT",{id:this.userData.id})}}class H0 extends u.Object3D{constructor(){super();y(this,"isDIVELight",!0);y(this,"isDIVESceneLight",!0);y(this,"_hemiLight");y(this,"_dirLight");this.name="DIVESceneLight",this._hemiLight=new u.HemisphereLight(16777215,16777215,2),this._hemiLight.layers.mask=pe.PRODUCT_LAYER_MASK,this._hemiLight.position.set(0,50,0),this.add(this._hemiLight),this._dirLight=new u.DirectionalLight(16777215,3),this._dirLight.layers.mask=pe.PRODUCT_LAYER_MASK,this._dirLight.position.set(1,1.75,1),this._dirLight.position.multiplyScalar(30),this._dirLight.castShadow=!0,this._dirLight.shadow.mapSize.width=2048,this._dirLight.shadow.mapSize.height=2048;const n=5;this._dirLight.shadow.camera.left=-5,this._dirLight.shadow.camera.right=n,this._dirLight.shadow.camera.top=n,this._dirLight.shadow.camera.bottom=-5,this._dirLight.shadow.camera.far=3500,this.add(this._dirLight)}SetColor(n){this._hemiLight.color=n,this._dirLight.color=n}SetIntensity(n){this._hemiLight.intensity=n*2,this._dirLight.intensity=n*3}SetEnabled(n){this._hemiLight.visible=n,this._dirLight.visible=n}}const Ks=S=>S.parent?Ks(S.parent):S;class Y0{constructor(){y(this,"isMovable",!0)}}class X0{constructor(){y(this,"isSelectable",!0)}}function j0(S,a){return a.forEach(n=>{Object.getOwnPropertyNames(n.prototype).forEach(r=>{Object.defineProperty(S.prototype,r,Object.getOwnPropertyDescriptor(n.prototype,r))})}),S}class qs extends j0(u.Object3D,[X0,Y0]){constructor(){super();y(this,"isDIVENode",!0);y(this,"gizmo",null);y(this,"_positionWorldBuffer");y(this,"_boundingBox");this.layers.mask=pe.PRODUCT_LAYER_MASK,this._positionWorldBuffer=new u.Vector3,this._boundingBox=new u.Box3}SetPosition(n){if(!this.parent){this.position.set(n.x,n.y,n.z);return}const r=new u.Vector3(n.x,n.y,n.z);this.position.copy(this.parent.worldToLocal(r)),"isDIVEGroup"in this.parent&&this.parent.UpdateLineTo(this)}SetRotation(n){this.rotation.set(n.x,n.y,n.z)}SetScale(n){this.scale.set(n.x,n.y,n.z)}SetVisibility(n){this.visible=n}SetToWorldOrigin(){var n;this.position.set(0,0,0),(n=Ye.get(this.userData.id))==null||n.PerformAction("UPDATE_OBJECT",{id:this.userData.id,position:this.getWorldPosition(this._positionWorldBuffer),rotation:this.rotation,scale:this.scale})}onMove(){var n;(n=Ye.get(this.userData.id))==null||n.PerformAction("UPDATE_OBJECT",{id:this.userData.id,position:this.getWorldPosition(this._positionWorldBuffer),rotation:this.rotation,scale:this.scale})}onSelect(){var n;(n=Ye.get(this.userData.id))==null||n.PerformAction("SELECT_OBJECT",{id:this.userData.id})}onDeselect(){var n;(n=Ye.get(this.userData.id))==null||n.PerformAction("DESELECT_OBJECT",{id:this.userData.id})}}class Z0 extends qs{constructor(){super(...arguments);y(this,"isDIVEModel",!0);y(this,"_mesh",null);y(this,"_material",null)}SetModel(n){this.clear(),this._boundingBox.makeEmpty(),n.traverse(r=>{r.castShadow=!0,r.receiveShadow=!0,r.layers.mask=this.layers.mask,this._boundingBox.expandByObject(r),!this._mesh&&"isMesh"in r&&(this._mesh=r,this._material?this._mesh.material=this._material:this._material=r.material)}),this.add(n)}SetMaterial(n){this._material||(this._material=new u.MeshStandardMaterial),n.vertexColors!==void 0&&(this._material.vertexColors=n.vertexColors),n.color!==void 0&&this._material.color.set(n.color),n.map!==void 0&&(this._material.map=n.map),n.normalMap!==void 0&&(this._material.normalMap=n.normalMap),n.roughness!==void 0&&(this._material.roughness=n.roughness),n.roughnessMap!==void 0&&(this._material.roughnessMap=n.roughnessMap,this._material.roughnessMap&&(this._material.roughness=1)),n.metalness!==void 0&&(this._material.metalness=n.metalness),n.metalnessMap!==void 0&&(this._material.metalnessMap=n.metalnessMap,this._material.metalnessMap&&(this._material.metalness=1)),this._mesh&&(this._mesh.material=this._material)}PlaceOnFloor(){var w,g,P,D,H;const n=this.getWorldPosition(this._positionWorldBuffer),r=n.clone();(g=(w=this._mesh)==null?void 0:w.geometry)==null||g.computeBoundingBox();const f=(D=(P=this._mesh)==null?void 0:P.geometry)==null?void 0:D.boundingBox;!f||!this._mesh||(n.y=n.y-this._mesh.localToWorld(f.min.clone()).y,n.y!==r.y&&((H=Ye.get(this.userData.id))==null||H.PerformAction("UPDATE_OBJECT",{id:this.userData.id,position:n,rotation:this.rotation,scale:this.scale})))}DropIt(){if(!this.parent){console.warn("DIVEModel: DropIt() called on a model that is not in the scene.",this);return}const n=this._boundingBox.min.y*this.scale.y,r=this.localToWorld(this._boundingBox.getCenter(new u.Vector3).multiply(this.scale));r.y=n+this.position.y;const f=new u.Raycaster(r,new u.Vector3(0,-1,0));f.layers.mask=pe.PRODUCT_LAYER_MASK;const w=f.intersectObjects(Ks(this).Root.children,!0);if(w.length>0){const g=w[0].object;g.geometry.computeBoundingBox();const P=g.geometry.boundingBox,D=g.localToWorld(P.max.clone()),H=this.position.clone(),le=this.position.clone().setY(D.y).sub(new u.Vector3(0,n,0));if(this.position.copy(le),this.position.y===H.y)return;this.onMove()}}}class Q0 extends qs{constructor(){super();y(this,"isDIVEPrimitive",!0);y(this,"_mesh");this._mesh=new u.Mesh,this._mesh.layers.mask=pe.PRODUCT_LAYER_MASK,this._mesh.castShadow=!0,this._mesh.receiveShadow=!0,this._mesh.material=new u.MeshStandardMaterial,this.add(this._mesh)}SetGeometry(n){const r=this.assembleGeometry(n);r&&(this._mesh.geometry=r,this._boundingBox.setFromObject(this._mesh))}SetMaterial(n){const r=this._mesh.material;n.vertexColors!==void 0&&(r.vertexColors=n.vertexColors),n.color!==void 0&&(r.color=new u.Color(n.color)),n.map!==void 0&&(r.map=n.map),n.normalMap!==void 0&&(r.normalMap=n.normalMap),n.roughness!==void 0&&(r.roughness=n.roughness),n.roughnessMap!==void 0&&(r.roughnessMap=n.roughnessMap,r.roughnessMap&&(r.roughness=1)),n.metalness!==void 0&&(r.metalness=n.metalness),n.metalnessMap!==void 0&&(r.metalnessMap=n.metalnessMap,r.metalnessMap&&(r.metalness=0)),this._mesh&&(this._mesh.material=r)}PlaceOnFloor(){var w,g,P,D,H;const n=this.getWorldPosition(this._positionWorldBuffer),r=n.clone();(g=(w=this._mesh)==null?void 0:w.geometry)==null||g.computeBoundingBox();const f=(D=(P=this._mesh)==null?void 0:P.geometry)==null?void 0:D.boundingBox;!f||!this._mesh||(n.y=n.y-this._mesh.localToWorld(f.min.clone()).y,n.y!==r.y&&((H=Ye.get(this.userData.id))==null||H.PerformAction("UPDATE_OBJECT",{id:this.userData.id,position:n,rotation:this.rotation,scale:this.scale})))}DropIt(){if(!this.parent){console.warn("DIVEPrimitive: DropIt() called on a model that is not in the scene.",this);return}const n=this._boundingBox.min.y*this.scale.y,r=this.localToWorld(this._boundingBox.getCenter(new u.Vector3).multiply(this.scale));r.y=n+this.position.y;const f=new u.Raycaster(r,new u.Vector3(0,-1,0));f.layers.mask=pe.PRODUCT_LAYER_MASK;const w=f.intersectObjects(Ks(this).Root.children,!0);if(w.length>0){const g=w[0].object;g.geometry.computeBoundingBox();const P=g.geometry.boundingBox,D=g.localToWorld(P.max.clone()),H=this.position.clone(),le=this.position.clone().setY(D.y).sub(new u.Vector3(0,n,0));if(this.position.copy(le),this.position.y===H.y)return;this.onMove()}}assembleGeometry(n){switch(this._mesh.material.flatShading=!1,n.name.toLowerCase()){case"cylinder":return this.createCylinderGeometry(n);case"sphere":return this.createSphereGeometry(n);case"pyramid":return this._mesh.material.flatShading=!0,this.createPyramidGeometry(n);case"cube":case"box":return this.createBoxGeometry(n);case"cone":return this.createConeGeometry(n);case"wall":return this.createWallGeometry(n);case"plane":return this.createPlaneGeometry(n);default:return console.warn("DIVEPrimitive.assembleGeometry: Invalid geometry type:",n.name.toLowerCase()),null}}createCylinderGeometry(n){const r=new u.CylinderGeometry(n.width/2,n.width/2,n.height,64);return r.translate(0,n.height/2,0),r}createSphereGeometry(n){return new u.SphereGeometry(n.width/2,256,256)}createPyramidGeometry(n){const r=new Float32Array([-n.width/2,0,-n.depth/2,n.width/2,0,-n.depth/2,n.width/2,0,n.depth/2,-n.width/2,0,n.depth/2,0,n.height,0]),f=new Uint16Array([0,1,2,0,2,3,0,4,1,1,4,2,2,4,3,3,4,0]),w=new u.BufferGeometry;return w.setAttribute("position",new u.BufferAttribute(r,3)),w.setIndex(new u.BufferAttribute(f,1)),w.computeVertexNormals(),w.computeBoundingBox(),w.computeBoundingSphere(),w}createBoxGeometry(n){const r=new u.BoxGeometry(n.width,n.height,n.depth);return r.translate(0,n.height/2,0),r}createConeGeometry(n){const r=new u.ConeGeometry(n.width/2,n.height,256);return r.translate(0,n.height/2,0),r}createWallGeometry(n){const r=new u.BoxGeometry(n.width,n.height,n.depth||.05,16);return r.translate(0,n.height/2,0),r}createPlaneGeometry(n){const r=new u.BoxGeometry(n.width,n.height,n.depth);return r.translate(0,n.height/2,0),r}}class K0 extends qs{constructor(){super();y(this,"isDIVEGroup",!0);y(this,"_members");y(this,"_lines");this.name="DIVEGroup",this._members=[],this._lines=[]}get members(){return this._members}SetPosition(n){super.SetPosition(n),this._members.forEach(r=>{"isDIVENode"in r&&r.onMove()})}SetLinesVisibility(n,r){if(!r){this._lines.forEach(w=>{w.visible=n});return}const f=this._members.indexOf(r);f!==-1&&(this._lines[f].visible=n)}attach(n){if(this._members.includes(n))return this;const r=this.createLine();return this.add(r),this._lines.push(r),super.attach(n),this._members.push(n),this.updateLineTo(r,n),this.SetLinesVisibility(!0,n),this}remove(n){const r=this._members.indexOf(n);if(r===-1)return this;const f=this._lines[r];return super.remove(f),this._lines.splice(r,1),super.remove(n),this._members.splice(r,1),this}UpdateLineTo(n){const r=this._members.indexOf(n);r!==-1&&this.updateLineTo(this._lines[r],n)}createLine(){const n=new u.BufferGeometry,r=new u.LineDashedMaterial({color:6710886,dashSize:.05,gapSize:.025}),f=new u.Line(n,r);return f.visible=!1,f}updateLineTo(n,r){n.geometry.setFromPoints([new u.Vector3(0,0,0),r.position.clone()]),n.computeLineDistances()}}class $s extends u.Object3D{constructor(){super();y(this,"isDIVERoot",!0);this.name="Root"}ComputeSceneBB(){const n=new u.Box3;return this.traverse(r=>{"isObject3D"in r&&n.expandByObject(r)}),n}GetSceneObject(n){let r;return this.traverse(f=>{r||f.userData.id===n.id&&(r=f)}),r}AddSceneObject(n){switch(n.entityType){case"pov":break;case"light":{this.updateLight(n);break}case"model":{this.updateModel(n);break}case"primitive":{this.updatePrimitive(n);break}case"group":{this.updateGroup(n);break}default:console.warn(`DIVERoot.AddSceneObject: Unknown entity type: ${n.entityType}`)}}UpdateSceneObject(n){switch(n.entityType){case"pov":break;case"light":{this.updateLight(n);break}case"model":{this.updateModel(n);break}case"primitive":{this.updatePrimitive(n);break}case"group":{this.updateGroup(n);break}default:console.warn(`DIVERoot.UpdateSceneObject: Unknown entity type: ${n.entityType}`)}}DeleteSceneObject(n){switch(n.entityType){case"pov":break;case"light":{this.deleteLight(n);break}case"model":{this.deleteModel(n);break}case"primitive":{this.deletePrimitive(n);break}case"group":{this.deleteGroup(n);break}default:console.warn(`DIVERoot.DeleteSceneObject: Unknown entity type: ${n.entityType}`)}}PlaceOnFloor(n){switch(n.entityType){case"pov":case"light":break;case"model":case"primitive":{this.placeOnFloor(n);break}default:console.warn(`DIVERoot.PlaceOnFloor: Unknown entity type: ${n.entityType}`)}}updateLight(n){let r=this.GetSceneObject(n);if(!r){switch(n.type){case"scene":{r=new H0;break}case"ambient":{r=new V0;break}case"point":{r=new N0;break}default:{console.warn(`DIVERoot.updateLight: Unknown light type: ${n.type}`);return}}r.userData.id=n.id,this.add(r)}n.name!==void 0&&n.name!==null&&(r.name=n.name),n.position!==void 0&&n.position!==null&&r.position.set(n.position.x,n.position.y,n.position.z),n.intensity!==void 0&&n.intensity!==null&&r.SetIntensity(n.intensity),n.enabled!==void 0&&n.enabled!==null&&r.SetEnabled(n.enabled),n.color!==void 0&&n.color!==null&&r.SetColor(new u.Color(n.color)),n.visible!==void 0&&n.visible!==null&&(r.visible=n.visible),n.parentId!==void 0&&this.setParent({...n,parentId:n.parentId})}updateModel(n){let r=this.GetSceneObject(n);r||(r=new Z0,r.userData.id=n.id,r.userData.uri=n.uri,this.add(r)),n.uri!==void 0&&mi.get("AssetLoader").then(f=>{f.load(n.uri).then(w=>{var g;r.SetModel(w),(g=Ye.get(n.id))==null||g.PerformAction("MODEL_LOADED",{id:n.id})})}),n.name!==void 0&&(r.name=n.name),n.position!==void 0&&r.SetPosition(n.position),n.rotation!==void 0&&r.SetRotation(n.rotation),n.scale!==void 0&&r.SetScale(n.scale),n.visible!==void 0&&r.SetVisibility(n.visible),n.material!==void 0&&r.SetMaterial(n.material),n.parentId!==void 0&&this.setParent({...n,parentId:n.parentId})}updatePrimitive(n){let r=this.GetSceneObject(n);r||(r=new Q0,r.userData.id=n.id,this.add(r)),n.name!==void 0&&(r.name=n.name),n.geometry!==void 0&&r.SetGeometry(n.geometry),n.position!==void 0&&r.SetPosition(n.position),n.rotation!==void 0&&r.SetRotation(n.rotation),n.scale!==void 0&&r.SetScale(n.scale),n.visible!==void 0&&r.SetVisibility(n.visible),n.material!==void 0&&r.SetMaterial(n.material),n.parentId!==void 0&&this.setParent({...n,parentId:n.parentId})}updateGroup(n){let r=this.GetSceneObject(n);r||(r=new K0,r.userData.id=n.id,this.add(r)),n.name!==void 0&&(r.name=n.name),n.position!==void 0&&r.SetPosition(n.position),n.rotation!==void 0&&r.SetRotation(n.rotation),n.scale!==void 0&&r.SetScale(n.scale),n.visible!==void 0&&r.SetVisibility(n.visible),n.bbVisible!==void 0&&r.SetLinesVisibility(n.bbVisible),n.parentId!==void 0&&this.setParent({...n,parentId:n.parentId})}deleteLight(n){const r=this.GetSceneObject(n);if(!r){console.warn(`DIVERoot.deleteLight: Light with id ${n.id} not found`);return}this.detachTransformControls(r),r.parent.remove(r)}deleteModel(n){const r=this.GetSceneObject(n);if(!r){console.warn(`DIVERoot.deleteModel: Model with id ${n.id} not found`);return}this.detachTransformControls(r),r.parent.remove(r)}deletePrimitive(n){const r=this.GetSceneObject(n);if(!r){console.warn(`DIVERoot.deletePrimitive: Primitive with id ${n.id} not found`);return}this.detachTransformControls(r),r.parent.remove(r)}deleteGroup(n){const r=this.GetSceneObject(n);if(!r){console.warn(`DIVERoot.deleteGroup: Group with id ${n.id} not found`);return}this.detachTransformControls(r);for(let f=r.members.length-1;f>=0;f--)this.attach(r.members[f]);r.parent.remove(r)}placeOnFloor(n){const r=this.GetSceneObject(n);r&&r.PlaceOnFloor()}setParent(n){const r=this.GetSceneObject(n);if(r)if(n.parentId!==null){const f=this.GetSceneObject({id:n.parentId});if(!f)return;f.attach(r)}else this.attach(r)}detachTransformControls(n){this.findScene(n).children.find(r=>{"isTransformControls"in r&&r.detach()})}findScene(n){return n.parent!==null?this.findScene(n.parent):n}}const q0="#888888",$0="#dddddd";class J0 extends u.Object3D{constructor(){super(),this.name="Grid";const a=new u.GridHelper(100,100,q0,$0);a.material.depthTest=!1,a.layers.mask=pe.HELPER_LAYER_MASK,this.add(a)}SetVisibility(a){this.visible=a}}class e_ extends u.Mesh{constructor(){super(new u.PlaneGeometry(1e4,1e4),new u.MeshStandardMaterial({color:new u.Color(150/255,150/255,150/255)}));y(this,"isFloor",!0);this.name="Floor",this.layers.mask=pe.PRODUCT_LAYER_MASK,this.receiveShadow=!0,this.rotateX(-Math.PI/2)}SetVisibility(n){this.visible=n}SetColor(n){this.material.color=new u.Color(n)}}class t_{constructor(a,n,r,f,w){this.xrLight=a,this.renderer=n,this.lightProbe=r,this.xrWebGLBinding=null,this.estimationStartCallback=w,this.frameCallback=this.onXRFrame.bind(this);const g=n.xr.getSession();if(f&&"XRWebGLBinding"in window){const P=new u.WebGLCubeRenderTarget(16);a.environment=P.texture;const D=n.getContext();switch(g.preferredReflectionFormat){case"srgba8":D.getExtension("EXT_sRGB");break;case"rgba16f":D.getExtension("OES_texture_half_float");break}this.xrWebGLBinding=new XRWebGLBinding(g,D),this.lightProbe.addEventListener("reflectionchange",()=>{this.updateReflection()})}g.requestAnimationFrame(this.frameCallback)}updateReflection(){const a=this.renderer.properties.get(this.xrLight.environment);if(a){const n=this.xrWebGLBinding.getReflectionCubeMap(this.lightProbe);n&&(a.__webglTexture=n,this.xrLight.environment.needsPMREMUpdate=!0)}}onXRFrame(a,n){if(!this.xrLight)return;n.session.requestAnimationFrame(this.frameCallback);const f=n.getLightEstimate(this.lightProbe);if(f){this.xrLight.lightProbe.sh.fromArray(f.sphericalHarmonicsCoefficients),this.xrLight.lightProbe.intensity=1;const w=Math.max(1,Math.max(f.primaryLightIntensity.x,Math.max(f.primaryLightIntensity.y,f.primaryLightIntensity.z)));this.xrLight.directionalLight.color.setRGB(f.primaryLightIntensity.x/w,f.primaryLightIntensity.y/w,f.primaryLightIntensity.z/w),this.xrLight.directionalLight.intensity=w,this.xrLight.directionalLight.position.copy(f.primaryLightDirection),this.estimationStartCallback&&(this.estimationStartCallback(),this.estimationStartCallback=null)}}dispose(){this.xrLight=null,this.renderer=null,this.lightProbe=null,this.xrWebGLBinding=null}}class n_ extends u.Group{constructor(a,n=!0){super(),this.lightProbe=new u.LightProbe,this.lightProbe.intensity=0,this.add(this.lightProbe),this.directionalLight=new u.DirectionalLight,this.directionalLight.intensity=0,this.add(this.directionalLight),this.environment=null;let r=null,f=!1;a.xr.addEventListener("sessionstart",()=>{const w=a.xr.getSession();"requestLightProbe"in w&&w.requestLightProbe({reflectionFormat:w.preferredReflectionFormat}).then(g=>{r=new t_(this,a,g,n,()=>{f=!0,this.dispatchEvent({type:"estimationstart"})})})}),a.xr.addEventListener("sessionend",()=>{r&&(r.dispose(),r=null),f&&this.dispatchEvent({type:"estimationend"})}),this.dispose=()=>{r&&(r.dispose(),r=null),this.remove(this.lightProbe),this.lightProbe=null,this.remove(this.directionalLight),this.directionalLight=null,this.environment=null}}}class i_ extends u.Object3D{constructor(n){super();y(this,"_scene");y(this,"_xrLight");y(this,"_lightRoot");this.name="XRLightRoot",this._scene=n,this._xrLight=null,this._lightRoot=new $s,this._lightRoot.UpdateSceneObject({id:"XRSceneLight",entityType:"light",name:"XRSceneLight",type:"scene",color:16777215,intensity:1,enabled:!0,visible:!0}),this.add(this._lightRoot)}InitLightEstimation(n){this._xrLight||(this._xrLight=new n_(n,!0),this._xrLight.layers.mask=pe.PRODUCT_LAYER_MASK,this.add(this._xrLight)),this._xrLight.addEventListener("estimationstart",()=>{this.onEstimationStart()}),this._xrLight.addEventListener("estimationend",()=>{this.onEstimationEnd()})}DisposeLightEstimation(){this._xrLight&&(this._xrLight.removeEventListener("estimationstart",()=>{this.onEstimationStart()}),this._xrLight.removeEventListener("estimationend",()=>{this.onEstimationEnd()}))}onEstimationStart(){this._lightRoot.visible=!1,this._xrLight&&this._xrLight.environment&&(this._scene.environment=this._xrLight.environment)}onEstimationEnd(){this._lightRoot.visible=!0,this._scene.environment=null,this._xrLight}}class r_ extends u.Object3D{constructor(n){super();y(this,"_xrLightRoot");y(this,"_xrModelRoot");y(this,"_xrHandNode");y(this,"_xrShadowPlane");this.name="XRRoot",this._xrModelRoot=new $s,this._xrModelRoot.name="XRModelRoot",this.add(this._xrModelRoot),this._xrShadowPlane=new u.Mesh(new u.PlaneGeometry(100,100),new u.ShadowMaterial({opacity:1,transparent:!0})),this._xrModelRoot.add(this._xrShadowPlane),this._xrLightRoot=new i_(n),this._xrLightRoot.name="XRLightRoot",this.add(this._xrLightRoot),this._xrHandNode=new u.Object3D,this._xrHandNode.name="XRHandNode",this.add(this._xrHandNode)}get XRModelRoot(){return this._xrModelRoot}get XRLightRoot(){return this._xrLightRoot}get XRHandNode(){return this._xrHandNode}InitLightEstimation(n){this._xrLightRoot.InitLightEstimation(n)}DisposeLightEstimation(){this._xrLightRoot.DisposeLightEstimation()}}class s_ extends u.Scene{constructor(){super();y(this,"_root");y(this,"_floor");y(this,"_grid");y(this,"_xrRoot");this.background=new u.Color(16777215),this._root=new $s,this.add(this._root),this._floor=new e_,this.add(this._floor),this._grid=new J0,this.add(this._grid),this._xrRoot=new r_(this),this._xrRoot.visible=!1,this.add(this._xrRoot)}get Root(){return this._root}get XRRoot(){return this._xrRoot}get Floor(){return this._floor}get Grid(){return this._grid}InitXR(n){this._root.visible=!1,this._xrRoot.visible=!0,this._xrRoot.InitLightEstimation(n)}DisposeXR(){this._root.visible=!0,this._xrRoot.visible=!1,this._xrRoot.DisposeLightEstimation()}SetBackground(n){this.background=new u.Color(n)}ComputeSceneBB(){return this.Root.ComputeSceneBB()}GetSceneObject(n){return this.Root.GetSceneObject(n)}AddSceneObject(n){this.Root.AddSceneObject(n)}UpdateSceneObject(n){this.Root.UpdateSceneObject(n)}DeleteSceneObject(n){this.Root.DeleteSceneObject(n)}PlaceOnFloor(n){this.Root.PlaceOnFloor(n)}}const Hl={autoResize:!0,autoStart:!0,displayAxes:!1,renderer:wn,perspectiveCamera:pe.DIVEPerspectiveCameraDefaultSettings};class o_{constructor(a){y(this,"_renderer");y(this,"_scene");y(this,"_perspectiveCamera");y(this,"_settings");y(this,"_resizeObserverId","");y(this,"_width",0);y(this,"_height",0);this._settings={...Hl,...a??{}},this._renderer=new W0(this._settings.renderer),this._scene=new s_,this._perspectiveCamera=new pe.DIVEPerspectiveCamera(this._settings.perspectiveCamera),this._settings.autoResize&&this._addResizeObserver(),this._settings.autoStart&&this.renderer.StartRenderer(this.scene,this.perspectiveCamera)}get renderer(){return this._renderer}get scene(){return this._scene}get perspectiveCamera(){return this._perspectiveCamera}dispose(){this._removeResizeObserver(),this._renderer.dispose()}onResize(a,n){this.renderer.OnResize(a,n),this.perspectiveCamera.OnResize(a,n)}_addResizeObserver(){this._resizeObserverId=this.renderer.AddPreRenderCallback(()=>{const a=this.renderer.domElement.parentElement;if(!a)return;const{clientWidth:n,clientHeight:r}=a;n===this._width&&r===this._height||(this.onResize(n,r),this._width=n,this._height=r)})}_removeResizeObserver(){this.renderer.RemovePreRenderCallback(this._resizeObserverId)}}function Mt(S,a){const n=(S+"e").split("e");return+(n[0]+"e"+(+n[1]+(a||0)))}function a_(S,a=0){const n=Mt(S,+a);return Mt(Math.ceil(n),-a)}function l_(S,a=0){const n=Mt(S,+a);return Mt(Math.floor(n),-a)}function Yl(S,a=0){if(S<0)return-Yl(-S,a);const n=Mt(S,+a);return Mt(Math.round(n),-a)}function c_(S,a,n){return Math.atan2(S.clone().cross(a).dot(n),a.clone().dot(S))}function u_(S,a=0){const n=Mt(S,+a);return Mt(Math.round(n),-a).toFixed(a)}function h_(S,a=0){const n=Mt(S,+a);return Mt(Math.trunc(n),-a)}function f_(S){return(u.MathUtils.radToDeg(S)+360)%360}function d_(S){return u.MathUtils.degToRad(S)}const p_={ceilExp:a_,floorExp:l_,roundExp:Yl,toFixedExp:u_,truncateExp:h_,signedAngleTo:c_,radToDeg:f_,degToRad:d_},Xl={...Hl,orbitControls:yr};class Ar{constructor(a){y(this,"_settings");y(this,"_engine");y(this,"orbitControls");y(this,"toolbox");y(this,"_communication");y(this,"animationSystem");y(this,"axisCamera");this._settings={...Xl,...a??{}},this._engine=new o_(a),this.animationSystem=new U0(this._engine.renderer),this.orbitControls=new Ns(this._engine.perspectiveCamera,this._engine.renderer,this.animationSystem,this._settings.orbitControls),this.toolbox=new Nl(this._engine.scene,this.orbitControls),this._communication=new Ye(this._engine.renderer,this._engine.scene,this.orbitControls,this.toolbox),this._settings.displayAxes?this.axisCamera=new k0(this._engine.renderer,this._engine.scene,this.orbitControls):this.axisCamera=null,window.DIVE={PrintScene:()=>this._engine.scene},console.log(`DIVE ${F0.version} initialized successfully!`),console.log(`
|
|
28
|
+
@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@
|
|
29
|
+
@@@@+-:::::::---------------------==------------------------------=#@@@@
|
|
30
|
+
@@%=::::.......::---------------------------------------------------------+@@
|
|
31
|
+
@@+:::...........::-----------------------------------------------------------#@@
|
|
32
|
+
@@=:::.........::::::-------------------------------------------------------------%@
|
|
33
|
+
@%:::.......:::::::-----------------------------------------------------------------#@
|
|
34
|
+
@*:::.....:::::-----------------------------------------------------------------------*@
|
|
35
|
+
@%::::::.::::---------------------------------------------------------------------------@@
|
|
36
|
+
@@-:::::::::-----------------------------------------------------------------------------=@
|
|
37
|
+
@%::::::::--------------------------------------------------------------------------------%@
|
|
38
|
+
@+::::::::--------------------------------=@@@@@%-----------------------------------------%@
|
|
39
|
+
@=:::::::--------------------------------*@@ @@+---------------------------------------#@
|
|
40
|
+
@+:::::::-------------------------------*@ @*--------------------------------------%@
|
|
41
|
+
@#::::::::-----------------------------=@@ @@=-------------------------------------%@
|
|
42
|
+
@@-::::::::----------------------------@@ @@------------------------------------=@
|
|
43
|
+
@%:::::::::--------------------------*@ @*-----------------------------------@@
|
|
44
|
+
@*:::::::::-------------------------@@ @@----------------------------------%@
|
|
45
|
+
@#::::::::::----------------------%@ @%--------------------------------%@
|
|
46
|
+
@#:::::::::::-------------------=@@ @@=------------------------------%@
|
|
47
|
+
@@-::::::::::::----------------%@ @%----------------------------=@@
|
|
48
|
+
@@#::::::::::::::------------*@ @*--------------------------#@@
|
|
49
|
+
@@+::::::::::::::::--------@@ @@------------------------+@@
|
|
50
|
+
@@*:::::::::::::::::----@@ @@---------------------+@@
|
|
51
|
+
@@@-:::::::::::::::--#@ @#-----------------=%@@
|
|
52
|
+
@@%-::::::::::::-%@ @%-------------=%@@
|
|
53
|
+
@@@@+:::::::#@@ @@*-------*@@@@
|
|
54
|
+
@@@@@@@ @@@@@@
|
|
55
|
+
|
|
56
|
+
`)}static async QuickView(a,n){return new Promise(r=>{const f=new Ar(n);f._communication.PerformAction("UPDATE_SCENE",{backgroundColor:16777215,gridEnabled:!1,floorColor:16777215}),f._communication.PerformAction("SET_CAMERA_TRANSFORM",{position:{x:0,y:2,z:2},target:{x:0,y:.5,z:0}});const w=u.MathUtils.generateUUID();f._communication.PerformAction("ADD_OBJECT",{entityType:"light",type:"scene",name:"light",id:w,enabled:!0,visible:!0,intensity:1,color:16777215});const g=u.MathUtils.generateUUID();f._communication.Subscribe("MODEL_LOADED",P=>{if(P.id!==g)return;const D=f._communication.PerformAction("COMPUTE_ENCOMPASSING_VIEW",{});f._communication.PerformAction("SET_CAMERA_TRANSFORM",{position:D.position,target:D.target}),window.DIVE.instances||(window.DIVE.instances=[]),window.DIVE.instances.push(f),r(f)}),f._communication.PerformAction("ADD_OBJECT",{entityType:"model",name:"object",id:g,position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0},scale:{x:1,y:1,z:1},uri:a,visible:!0,loaded:!1})})}get engine(){return this._engine}get communication(){return this._communication}get canvas(){return this._engine.renderer.domElement}Dispose(){var a;this.orbitControls.Dispose(),(a=this.axisCamera)==null||a.Dispose(),this.animationSystem.Dispose(),this.toolbox.Dispose(),this._communication.DestroyInstance()}}exports.FILE_TYPES=Zs.FILE_TYPES;exports.NetworkError=Zs.NetworkError;exports.SUPPORTED_FILE_TYPES=Zs.SUPPORTED_FILE_TYPES;exports.FileTypeError=zl.FileTypeError;exports.ParseError=zl.ParseError;exports.ARCompatibilityError=Qs.ARCompatibilityError;exports.ESystem=Qs.ESystem;exports.EWebXRUnsupportedReason=Qs.EWebXRUnsupportedReason;exports.DIVE=Ar;exports.DIVECommunication=Ye;exports.DIVEDefaultSettings=Xl;exports.DiveMath=p_;exports.default=Ar;
|
|
57
|
+
//# sourceMappingURL=index.cjs.map
|