aptechka 0.13.0 → 0.14.0

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.
Files changed (108) hide show
  1. package/lib/{Animation-seVC6-fS.cjs → Animation-De9aUv3b.cjs} +1 -1
  2. package/lib/{Animation-DF5jPON_.js → Animation-NAGXiFv5.js} +1 -1
  3. package/lib/{Composed-ChlKoJEp.cjs → Composed-C_4slJQ6.cjs} +1 -1
  4. package/lib/{Composed-CoX1ImVk.js → Composed-CfWa-69I.js} +1 -1
  5. package/lib/{Damped-C7WAqKPh.cjs → Damped-DYJ6Z0xo.cjs} +1 -1
  6. package/lib/{Damped-BDO-F13V.js → Damped-DbJKrUIf.js} +1 -1
  7. package/lib/Derived-BIBU-y7Z.cjs +1 -0
  8. package/lib/Derived-Vo_RsJfi.js +23 -0
  9. package/lib/{SourceManager-B8-EMNnd.js → SourceManager-B6wZpXUZ.js} +1 -1
  10. package/lib/{SourceManager-TzU9Rw08.cjs → SourceManager-CfHcGLUa.cjs} +1 -1
  11. package/lib/Store-C46i0nvr.js +137 -0
  12. package/lib/Store-npaZHvX4.cjs +1 -0
  13. package/lib/{Tweened-DSXD0I0k.cjs → Tweened-BkkD9s4n.cjs} +1 -1
  14. package/lib/{Tweened-CHhmfvzo.js → Tweened-DOSHLCZa.js} +1 -1
  15. package/lib/{Viewport-DTlImj28.js → Viewport-B55BvLsV.js} +1 -1
  16. package/lib/{Viewport-BmLTk_6k.cjs → Viewport-Cv4TRGiv.cjs} +1 -1
  17. package/lib/animation/index.cjs +1 -1
  18. package/lib/animation/index.js +3 -3
  19. package/lib/attribute/index.cjs +1 -1
  20. package/lib/attribute/index.js +13 -13
  21. package/lib/canvas/index.cjs +7 -1
  22. package/lib/canvas/index.js +54 -58
  23. package/lib/class-linked-status/index.cjs +1 -1
  24. package/lib/class-linked-status/index.js +1 -1
  25. package/lib/controls/index.cjs +1 -1
  26. package/lib/controls/index.js +3 -3
  27. package/lib/{createStylesheet-DO5t5q-m.js → createStylesheet-C68ja-RS.js} +3 -3
  28. package/lib/{createStylesheet-CaDI99iu.cjs → createStylesheet-Csfmh-MH.cjs} +1 -1
  29. package/lib/css-property/index.cjs +1 -1
  30. package/lib/css-property/index.js +4 -4
  31. package/lib/dev/index.cjs +1 -1
  32. package/lib/dev/index.js +1 -1
  33. package/lib/device/index.cjs +1 -1
  34. package/lib/device/index.js +1 -1
  35. package/lib/{dom-P5QbAASX.js → dom-0S_WDL4g.js} +2 -2
  36. package/lib/element-constructor/index.cjs +1 -1
  37. package/lib/element-constructor/index.js +133 -122
  38. package/lib/element-resizer/index.js +8 -8
  39. package/lib/en3/helpers/index.cjs +1 -1
  40. package/lib/en3/helpers/index.js +4 -4
  41. package/lib/en3/index.js +1 -1
  42. package/lib/en3/loaders/index.js +1 -1
  43. package/lib/en3/misc/index.cjs +1 -1
  44. package/lib/en3/misc/index.js +2 -2
  45. package/lib/en3/utils/index.js +2 -2
  46. package/lib/{en3-x-Ki30MY.js → en3-sK9Z-fp2.js} +1 -1
  47. package/lib/file-BEr-o55N.js +31 -0
  48. package/lib/file-C9BbxzVU.cjs +1 -0
  49. package/lib/image/index.cjs +1 -1
  50. package/lib/image/index.js +1 -1
  51. package/lib/intersector/index.js +7 -7
  52. package/lib/ladder/index.cjs +1 -1
  53. package/lib/ladder/index.js +1 -1
  54. package/lib/layout-box/index.js +14 -14
  55. package/lib/media/index.cjs +1 -1
  56. package/lib/media/index.js +1 -1
  57. package/lib/need_redo_tweaker/index.cjs +18 -0
  58. package/lib/need_redo_tweaker/index.js +1343 -0
  59. package/lib/pointer/index.cjs +1 -1
  60. package/lib/pointer/index.js +3 -3
  61. package/lib/popover/index.cjs +1 -1
  62. package/lib/popover/index.js +60 -62
  63. package/lib/scroll/index.cjs +1 -1
  64. package/lib/scroll/index.js +105 -106
  65. package/lib/scroll-entries/index.js +15 -15
  66. package/lib/sequence/index.cjs +1 -1
  67. package/lib/sequence/index.js +1 -1
  68. package/lib/slicer/index.cjs +5 -5
  69. package/lib/slicer/index.js +55 -86
  70. package/lib/source/index.cjs +1 -1
  71. package/lib/source/index.js +2 -2
  72. package/lib/store/index.cjs +1 -1
  73. package/lib/store/index.js +38 -112
  74. package/lib/{tags-v-OSVkiQ.cjs → tags-6_ETuR75.cjs} +1 -1
  75. package/lib/{tags-4AoxVUe3.js → tags-zft1DGBz.js} +93 -93
  76. package/lib/ticker/index.js +1 -1
  77. package/lib/{traverseMaterials-mGC2_FkG.js → traverseMaterials-BlZbRhgW.js} +1 -1
  78. package/lib/utils/index.cjs +1 -1
  79. package/lib/utils/index.js +56 -57
  80. package/lib/video/index.cjs +1 -1
  81. package/lib/video/index.js +1 -1
  82. package/package.json +7 -55
  83. package/lib/Derived-B-2UXnVE.cjs +0 -1
  84. package/lib/Derived-CDGpSMKu.js +0 -56
  85. package/lib/Store-BnA-dJsE.cjs +0 -1
  86. package/lib/Store-DGtldlBH.js +0 -147
  87. package/lib/accordion/index.cjs +0 -1
  88. package/lib/accordion/index.js +0 -167
  89. package/lib/checkbox/index.cjs +0 -1
  90. package/lib/checkbox/index.js +0 -112
  91. package/lib/createTheme-CHnsCgAr.js +0 -15
  92. package/lib/createTheme-Cfaw9UmV.cjs +0 -1
  93. package/lib/events-BGwqaxVW.cjs +0 -1
  94. package/lib/events-CJTUMSLU.js +0 -20
  95. package/lib/file-EevnUtRj.cjs +0 -1
  96. package/lib/file-lxi_oXJf.js +0 -13
  97. package/lib/index-BhbT9PrL.js +0 -261
  98. package/lib/index-BpsQqM-8.cjs +0 -9
  99. package/lib/modal/index.cjs +0 -1
  100. package/lib/modal/index.js +0 -133
  101. package/lib/select/index.cjs +0 -1
  102. package/lib/select/index.js +0 -7
  103. package/lib/svg-path-data/index.cjs +0 -3
  104. package/lib/svg-path-data/index.js +0 -490
  105. package/lib/theme/index.cjs +0 -1
  106. package/lib/theme/index.js +0 -25
  107. package/lib/tweaker/index.cjs +0 -10
  108. package/lib/tweaker/index.js +0 -992
@@ -1 +1 @@
1
- "use strict";var On=Object.defineProperty;var qt=Object.getOwnPropertySymbols;var Dn=Object.prototype.hasOwnProperty,Cn=Object.prototype.propertyIsEnumerable;var Bt=m=>{throw TypeError(m)};var Ut=(m,n,a)=>n in m?On(m,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):m[n]=a,se=(m,n)=>{for(var a in n||(n={}))Dn.call(n,a)&&Ut(m,a,n[a]);if(qt)for(var a of qt(n))Cn.call(n,a)&&Ut(m,a,n[a]);return m};var St=(m,n,a)=>n.has(m)||Bt("Cannot "+a);var s=(m,n,a)=>(St(m,n,"read from private field"),a?a.call(m):n.get(m)),f=(m,n,a)=>n.has(m)?Bt("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(m):n.set(m,a),x=(m,n,a,e)=>(St(m,n,"write to private field"),e?e.call(m,a):n.set(m,a),a),E=(m,n,a)=>(St(m,n,"access private method"),a);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("../../en3-C1fLmsjs.cjs"),X=require("../../Store-BnA-dJsE.cjs"),t=require("three"),jn=require("../../object-CCiXnER2.cjs"),Wt=require("../../ticker/index.cjs"),kn=require("../../Composed-ChlKoJEp.cjs"),Rn=require("../../traverseMaterials-CD_3_56D.cjs");function Hn(m){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(m){for(const a in m)if(a!=="default"){const e=Object.getOwnPropertyDescriptor(m,a);Object.defineProperty(n,a,e.get?e:{enumerable:!0,get:()=>m[a]})}}return n.default=m,Object.freeze(n)}const de=Hn(t),Yn=["AddEquation","SubtractEquation","ReverseSubtractEquation","MinEquation","MaxEquation"],cn=["ZeroFactor","OneFactor","SrcColorFactor","OneMinusSrcColorFactor","SrcAlphaFactor","OneMinusSrcAlphaFactor","DstAlphaFactor","OneMinusDstAlphaFactor","DstColorFactor","OneMinusDstColorFactor","SrcAlphaSaturateFactor","ConstantColorFactor","OneMinusConstantColorFactor","ConstantAlphaFactor","OneMinusConstantAlphaFactor"],zn=[...cn,"SrcAlphaSaturateFactor"],Nn=["NoBlending","NormalBlending","AdditiveBlending","SubtractiveBlending","MultiplyBlending","CustomBlending"],Xn=["NeverDepth","AlwaysDepth","EqualDepth","LessDepth","LessEqualDepth ","GreaterEqualDepth ","GreaterDepth","NotEqualDepth"],Zn=["NeverStencilFunc","LessStencilFunc","EqualStencilFunc","LessEqualStencilFunc ","GreaterStencilFunc","NotEqualStencilFunc ","GreaterEqualStencilFunc","AlwaysStencilFunc"],Pt=["ZeroStencilOp","KeepStencilOp","ReplaceStencilOp","IncrementStencilOp","DecrementStencilOp","IncrementWrapStencilOp","DecrementWrapStencilOp","InvertStencilOp"],Gn=["FrontSide","BackSide","DoubleSide"],Fn=["TangentSpaceNormalMap","ObjectSpaceNormalMap"],Vn=["round","bevel","miter"],Qn=["NoToneMapping","LinearToneMapping","ReinhardToneMapping","CineonToneMapping","ACESFilmicToneMapping","AgXToneMapping","NeutralToneMapping","CustomToneMapping"],qn={intensity:{type:"number",min:0,max:20,step:1e-4},renderOrder:{type:"number",step:1},alphaTest:{type:"number",min:0,max:1,step:.001},blendAlpha:{type:"number",min:0,max:1,step:.001},blendDst:{type:"select",variants:zn},blendDstAlpha:{type:"number",min:0,max:1,step:.001},blendEquation:{type:"select",variants:Yn},blendEquationAlpha:{type:"number",min:0,max:1,step:.001},blending:{type:"select",variants:Nn},blendSrc:{type:"select",variants:cn},blendSrcAlpha:{type:"number",min:0,max:1,step:.001},depthFunc:{type:"select",variants:Xn},stencilFunc:{type:"select",variants:Zn},stencilRef:{type:"number",min:0,step:1},stencilFail:{type:"select",variants:Pt},stencilZFail:{type:"select",variants:Pt},stencilZPass:{type:"select",variants:Pt},opacity:{type:"number",min:0,max:1,step:1e-4},side:{type:"select",variants:Gn},roughness:{type:"number",min:0,max:1,step:1e-4},metalness:{type:"number",min:0,max:1,step:1e-4},lightMapIntensity:{type:"number",min:0,max:20,step:1e-4},aoMapIntensity:{type:"number",min:0,max:20,step:1e-4},bumpScale:{type:"number",min:0,step:1e-4},normalMapType:{type:"select",variants:Fn},wireframeLinejoin:{type:"select",variants:Vn},envMapIntensity:{type:"number",min:0,max:20,step:1e-4},emissiveIntensity:{type:"number",min:0,max:20,step:1e-4},fov:{type:"number",min:0,max:180,step:1},zoom:{type:"number",min:0,step:1e-4},near:{type:"number",min:0,step:1e-4},far:{type:"number",min:0,step:1},filmGauge:{type:"number",min:0,step:1e-4},filmOffset:{type:"number",min:0,step:1e-4},distance:{type:"number",min:0,step:.1},decay:{type:"number",min:0,step:1e-5,ease:.001},focus:{type:"number",min:0,max:1,step:1e-5},bias:{type:"number",min:0,max:.01,step:1e-6,ease:.01},blurSamples:{type:"number",min:0,step:1},normalBias:{type:"number",min:0,step:.001,ease:.01},radius:{type:"number",min:0,step:.001,ease:.01},penumbra:{type:"number",min:0,max:1,step:1e-6},power:{type:"number",min:0,step:.001,ease:.01},angle:{type:"number",min:0,step:1e-6,ease:.001},toneMapping:{type:"select",variants:Qn},toneMappingExposure:{type:"number",min:0,step:.001,ease:.1},mapSize:{type:"number",min:0,step:1},damp:{type:"number",min:0,max:1,step:1e-6},strength:{type:"number",min:0,step:.01},threshold:{type:"number",min:0,max:1,step:1e-4}},Un=new Set(["stencilFuncMask","needsUpdate","version","wireframeLinewidth","position","scale","rotation","coordinateSystem","aspect","autoUpdate","up"]);var Le,ne,M,ln,hn,pn,mn,un,_t,It,ye,be;class he{constructor(n,a){f(this,M);f(this,Le);f(this,ne,[]);x(this,Le,n);const e=se(se({},qn),a==null?void 0:a.optionsCatalog),r=new Set([...Un,...(a==null?void 0:a.skipKeys)||[]]),c=(a==null?void 0:a.folderName)||s(this,Le).name,i=a==null?void 0:a.afterChange;E(this,M,ln).call(this,{subject:s(this,Le),skipKeys:r,optionsCatalog:e,folderKey:c,afterChange:i})}destroy(){s(this,ne).forEach(n=>{n.close()})}}Le=new WeakMap,ne=new WeakMap,M=new WeakSet,ln=function(n){const{subject:a,folderKey:e,optionsCatalog:r,afterChange:c,skipKeys:i}=n;for(const l in a){if(l.startsWith("_")||i.has(l))continue;const u=a[l],p=E(this,M,ye).call(this,u),d=`${e}.${l}`,w=r[l];typeof p=="number"?(w==null?void 0:w.type)==="select"?E(this,M,_t).call(this,{name:d,value:u,subject:a,key:l,managerOptions:w,afterChange:c}):E(this,M,hn).call(this,{name:d,value:u,subject:a,key:l,managerOptions:w,afterChange:c}):p instanceof de.Vector2||p instanceof de.Vector3?E(this,M,pn).call(this,{name:d,value:u,subject:a,key:l,managerOptions:w,afterChange:c}):typeof p=="boolean"&&!l.startsWith("is")&&!l.startsWith("matrix")?E(this,M,mn).call(this,{name:d,value:u,subject:a,key:l,managerOptions:w,afterChange:c}):p instanceof de.Color?E(this,M,un).call(this,{name:d,value:u,subject:a,key:l,managerOptions:w,afterChange:c}):w&&(w==null?void 0:w.type)==="select"&&E(this,M,_t).call(this,{name:d,value:u,subject:a,key:l,managerOptions:w,afterChange:c})}},hn=function({name:n,value:a,subject:e,key:r,managerOptions:c,afterChange:i}){const l=new X.Store(E(this,M,ye).call(this,a),{passport:{name:n,manager:se({type:"number"},c)}});l.subscribe(u=>{E(this,M,be).call(this,e,r,(p,d)=>p[d]=u.current),i==null||i()}),s(this,ne).push(l)},pn=function({name:n,value:a,subject:e,key:r,managerOptions:c,afterChange:i}){const l=p=>{const d=[p.x,p.y];return p instanceof de.Vector3&&d.push(p.z),d},u=new X.Store(l(E(this,M,ye).call(this,a)),{passport:{name:n,manager:se({type:"number"},c)}});u.subscribe(p=>{E(this,M,be).call(this,e,r,(d,w)=>d[w].set(...p.current)),i==null||i()}),s(this,ne).push(u)},mn=function({name:n,value:a,subject:e,key:r,managerOptions:c,afterChange:i}){const l=new X.Store(E(this,M,ye).call(this,a),{passport:{name:n,manager:se({type:"boolean"},c)}});l.subscribe(u=>{E(this,M,be).call(this,e,r,(p,d)=>p[d]=u.current),i==null||i()}),s(this,ne).push(l)},un=function({name:n,value:a,subject:e,key:r,managerOptions:c,afterChange:i}){const l=new X.Store(`#${E(this,M,ye).call(this,a).getHexString()}`,{passport:{name:n,manager:se({type:"color"},c)}});l.subscribe(u=>{E(this,M,be).call(this,e,r,(p,d)=>p[d]=new de.Color(u.current)),i==null||i()}),s(this,ne).push(l)},_t=function({name:n,value:a,subject:e,key:r,managerOptions:c,afterChange:i}){const l=c==null?void 0:c.variants;if(l){let u=null;for(const d of l)a===de[d]&&(u=d);const p=new X.Store(u||E(this,M,ye).call(this,a),{passport:{name:n,manager:se({},c)}});p.subscribe(d=>{typeof d.current=="string"&&(d.current[0]===d.current[0].toUpperCase()?E(this,M,be).call(this,e,r,(w,L)=>w[L]=de[d.current]):E(this,M,be).call(this,e,r,(w,L)=>w[L]=d.current)),i==null||i()}),s(this,ne).push(p)}},It=function(n){return jn.isObject(n)&&"value"in n},ye=function(n){return E(this,M,It).call(this,n)?n.value:n},be=function(n,a,e){E(this,M,It).call(this,n[a])?e(n[a],"value"):e(n,a)};var g,re,ge,Me,Ee,qe,U,Oe,bt,Ue;class Ot{constructor(n,a){f(this,Oe);f(this,g);f(this,re,[]);f(this,ge);f(this,Me);f(this,Ee);f(this,qe,!0);f(this,U,[]);f(this,Ue,()=>{s(this,U).forEach(n=>{"update"in n&&n.update()})});var l,u;x(this,g,n);let e=!1;n.name.startsWith("T.")&&(n.name=n.name.slice(2)),n.name.includes("P.")&&(e=!0,n.name=n.name.replace("P.",""));const r=n.name;s(this,g).userData.controlled=!0;const c=(a==null?void 0:a.step)||1e-4,i=((l=n.userData)==null?void 0:l.box)||n;if(s(this,g)instanceof t.Light){let p;s(this,g)instanceof t.PointLight?p=new t.PointLightHelper(s(this,g),100):s(this,g)instanceof t.DirectionalLight?(s(this,g).scale.setScalar(100),p=new t.DirectionalLightHelper(s(this,g),1)):s(this,g)instanceof t.SpotLight?p=new t.SpotLightHelper(s(this,g)):s(this,g)instanceof t.HemisphereLight&&(p=new t.HemisphereLightHelper(s(this,g),100)),s(this,U).push(p);const d=(u=s(this,g).shadow)==null?void 0:u.camera;if(d instanceof t.Camera){const w=new t.CameraHelper(d);s(this,U).push(w)}}if(s(this,U).forEach(p=>{y.en3.view.add(p)}),x(this,ge,new X.Store([i.position.x,i.position.y,i.position.z],{passport:{name:`${r}.Transformation.Position`,manager:{type:"number",step:c}}})),x(this,Me,new X.Store([i.rotation.x,i.rotation.y,i.rotation.z],{passport:{name:`${r}.Transformation.Rotation`,manager:{type:"number",step:c,ease:.01}}})),x(this,Ee,new X.Store([i.scale.x,i.scale.y,i.scale.z],{passport:{name:`${r}.Transformation.Scale`,manager:{type:"number",step:c}}})),this.save(),x(this,qe,!1),s(this,ge).subscribe(p=>{E(this,Oe,bt).call(this,"position",p.current)}),s(this,Me).subscribe(p=>{E(this,Oe,bt).call(this,"rotation",p.current)}),s(this,Ee).subscribe(p=>{E(this,Oe,bt).call(this,"scale",p.current)}),e){if(s(this,re).push(new he(s(this,g),{folderName:`${s(this,g).name}.Parameters`,afterChange:s(this,g)instanceof t.Camera?()=>{y.en3.view.resize()}:void 0})),s(this,g)instanceof t.Mesh){const p=s(this,g).material;p instanceof t.Material&&s(this,re).push(new he(p,{folderName:`${s(this,g).name}.Parameters.Material`,afterChange:()=>{p.needsUpdate=!0}}))}else if(s(this,g)instanceof t.Light){const p=s(this,g).shadow;p&&s(this,re).push(new he(p,{folderName:`${s(this,g).name}.Parameters.Shadow`,afterChange:()=>{p.needsUpdate=!0}})),p.camera&&s(this,re).push(new he(p,{folderName:`${s(this,g).name}.Parameters.Shadow.Camera`,afterChange:()=>{p.camera.updateProjectionMatrix()}}))}}s(this,U).length&&Wt.ticker.subscribe(s(this,Ue))}get object3d(){return s(this,g)}get helpers(){return s(this,U)}get raycasterTarget(){return s(this,U)[0]||s(this,g)}destroy(){s(this,re).forEach(n=>n.destroy()),s(this,ge).close(),s(this,Me).close(),s(this,Ee).close(),s(this,g).userData.controlled=!1,s(this,U).forEach(n=>{n&&"dispose"in n&&(n.dispose(),y.en3.view.remove(n))}),Wt.ticker.unsubscribe(s(this,Ue))}save(){const n=(a,e)=>{(!s(this,qe)||a.initial===a.current)&&(a.current=[e.x,e.y,e.z])};n(s(this,ge),s(this,g).position),n(s(this,Me),s(this,g).rotation),n(s(this,Ee),s(this,g).scale)}}g=new WeakMap,re=new WeakMap,ge=new WeakMap,Me=new WeakMap,Ee=new WeakMap,qe=new WeakMap,U=new WeakMap,Oe=new WeakSet,bt=function(n,a){const e=s(this,g).userData.box;if(e){const r=c=>({x:a[0]-c.x,y:a[1]-c.y,z:a[2]-c.z});n==="position"?e.setPositionStep("_manager","+",r(e.getIncludedPositionSteps("_manager"))):n==="rotation"?e.setRotationStep("_manager","+",r(e.getIncludedRotationSteps("_manager"))):n==="scale"&&e.setScaleStep("_manager","+",r(e.getIncludedScaleSteps("_manager")))}else s(this,g)[n].set(...a)},Ue=new WeakMap;const Kt={type:"change"},xt={type:"start"},$t={type:"end"},ut=new t.Ray,Jt=new t.Plane,Bn=Math.cos(70*t.MathUtils.DEG2RAD);class Wn extends t.EventDispatcher{constructor(n,a){super(),this.object=n,this.domElement=a,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new t.Vector3,this.cursor=new t.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:t.MOUSE.ROTATE,MIDDLE:t.MOUSE.DOLLY,RIGHT:t.MOUSE.PAN},this.touches={ONE:t.TOUCH.ROTATE,TWO:t.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 l.phi},this.getAzimuthalAngle=function(){return l.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(o){o.addEventListener("keydown",Et),this._domElementKeyEvents=o},this.stopListenToKeyEvents=function(){this._domElementKeyEvents.removeEventListener("keydown",Et),this._domElementKeyEvents=null},this.saveState=function(){e.target0.copy(e.target),e.position0.copy(e.object.position),e.zoom0=e.object.zoom},this.reset=function(){e.target.copy(e.target0),e.object.position.copy(e.position0),e.object.zoom=e.zoom0,e.object.updateProjectionMatrix(),e.dispatchEvent(Kt),e.update(),c=r.NONE},this.update=function(){const o=new t.Vector3,h=new t.Quaternion().setFromUnitVectors(n.up,new t.Vector3(0,1,0)),b=h.clone().invert(),P=new t.Vector3,N=new t.Quaternion,ie=new t.Vector3,F=2*Math.PI;return function(Ln=null){const Vt=e.object.position;o.copy(Vt).sub(e.target),o.applyQuaternion(h),l.setFromVector3(o),e.autoRotate&&c===r.NONE&&me(gt(Ln)),e.enableDamping?(l.theta+=u.theta*e.dampingFactor,l.phi+=u.phi*e.dampingFactor):(l.theta+=u.theta,l.phi+=u.phi);let J=e.minAzimuthAngle,ee=e.maxAzimuthAngle;isFinite(J)&&isFinite(ee)&&(J<-Math.PI?J+=F:J>Math.PI&&(J-=F),ee<-Math.PI?ee+=F:ee>Math.PI&&(ee-=F),J<=ee?l.theta=Math.max(J,Math.min(ee,l.theta)):l.theta=l.theta>(J+ee)/2?Math.max(J,l.theta):Math.min(ee,l.theta)),l.phi=Math.max(e.minPolarAngle,Math.min(e.maxPolarAngle,l.phi)),l.makeSafe(),e.enableDamping===!0?e.target.addScaledVector(d,e.dampingFactor):e.target.add(d),e.target.sub(e.cursor),e.target.clampLength(e.minTargetRadius,e.maxTargetRadius),e.target.add(e.cursor);let Xe=!1;if(e.zoomToCursor&&ve||e.object.isOrthographicCamera)l.radius=oe(l.radius);else{const te=l.radius;l.radius=oe(l.radius*p),Xe=te!=l.radius}if(o.setFromSpherical(l),o.applyQuaternion(b),Vt.copy(e.target).add(o),e.object.lookAt(e.target),e.enableDamping===!0?(u.theta*=1-e.dampingFactor,u.phi*=1-e.dampingFactor,d.multiplyScalar(1-e.dampingFactor)):(u.set(0,0,0),d.set(0,0,0)),e.zoomToCursor&&ve){let te=null;if(e.object.isPerspectiveCamera){const Ze=o.length();te=oe(Ze*p);const mt=Ze-te;e.object.position.addScaledVector(K,mt),e.object.updateMatrixWorld(),Xe=!!mt}else if(e.object.isOrthographicCamera){const Ze=new t.Vector3(k.x,k.y,0);Ze.unproject(e.object);const mt=e.object.zoom;e.object.zoom=Math.max(e.minZoom,Math.min(e.maxZoom,e.object.zoom/p)),e.object.updateProjectionMatrix(),Xe=mt!==e.object.zoom;const Qt=new t.Vector3(k.x,k.y,0);Qt.unproject(e.object),e.object.position.sub(Qt).add(Ze),e.object.updateMatrixWorld(),te=o.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),e.zoomToCursor=!1;te!==null&&(this.screenSpacePanning?e.target.set(0,0,-1).transformDirection(e.object.matrix).multiplyScalar(te).add(e.object.position):(ut.origin.copy(e.object.position),ut.direction.set(0,0,-1).transformDirection(e.object.matrix),Math.abs(e.object.up.dot(ut.direction))<Bn?n.lookAt(e.target):(Jt.setFromNormalAndCoplanarPoint(e.object.up,e.target),ut.intersectPlane(Jt,e.target))))}else if(e.object.isOrthographicCamera){const te=e.object.zoom;e.object.zoom=Math.max(e.minZoom,Math.min(e.maxZoom,e.object.zoom/p)),te!==e.object.zoom&&(e.object.updateProjectionMatrix(),Xe=!0)}return p=1,ve=!1,Xe||P.distanceToSquared(e.object.position)>i||8*(1-N.dot(e.object.quaternion))>i||ie.distanceToSquared(e.target)>i?(e.dispatchEvent(Kt),P.copy(e.object.position),N.copy(e.object.quaternion),ie.copy(e.target),!0):!1}}(),this.dispose=function(){e.domElement.removeEventListener("contextmenu",Gt),e.domElement.removeEventListener("pointerdown",Yt),e.domElement.removeEventListener("pointercancel",Ne),e.domElement.removeEventListener("wheel",zt),e.domElement.removeEventListener("pointermove",Mt),e.domElement.removeEventListener("pointerup",Ne),e.domElement.getRootNode().removeEventListener("keydown",Nt,{capture:!0}),e._domElementKeyEvents!==null&&(e._domElementKeyEvents.removeEventListener("keydown",Et),e._domElementKeyEvents=null)};const e=this,r={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let c=r.NONE;const i=1e-6,l=new t.Spherical,u=new t.Spherical;let p=1;const d=new t.Vector3,w=new t.Vector2,L=new t.Vector2,W=new t.Vector2,Z=new t.Vector2,O=new t.Vector2,j=new t.Vector2,D=new t.Vector2,T=new t.Vector2,_=new t.Vector2,K=new t.Vector3,k=new t.Vector2;let ve=!1;const I=[],pe={};let ze=!1;function gt(o){return o!==null?2*Math.PI/60*e.autoRotateSpeed*o:2*Math.PI/60/60*e.autoRotateSpeed}function Te(o){const h=Math.abs(o*.01);return Math.pow(.95,e.zoomSpeed*h)}function me(o){u.theta-=o}function _e(o){u.phi-=o}const G=function(){const o=new t.Vector3;return function(b,P){o.setFromMatrixColumn(P,0),o.multiplyScalar(-b),d.add(o)}}(),Y=function(){const o=new t.Vector3;return function(b,P){e.screenSpacePanning===!0?o.setFromMatrixColumn(P,1):(o.setFromMatrixColumn(P,0),o.crossVectors(e.object.up,o)),o.multiplyScalar(b),d.add(o)}}(),q=function(){const o=new t.Vector3;return function(b,P){const N=e.domElement;if(e.object.isPerspectiveCamera){const ie=e.object.position;o.copy(ie).sub(e.target);let F=o.length();F*=Math.tan(e.object.fov/2*Math.PI/180),G(2*b*F/N.clientHeight,e.object.matrix),Y(2*P*F/N.clientHeight,e.object.matrix)}else e.object.isOrthographicCamera?(G(b*(e.object.right-e.object.left)/e.object.zoom/N.clientWidth,e.object.matrix),Y(P*(e.object.top-e.object.bottom)/e.object.zoom/N.clientHeight,e.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),e.enablePan=!1)}}();function z(o){e.object.isPerspectiveCamera||e.object.isOrthographicCamera?p/=o:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),e.enableZoom=!1)}function $(o){e.object.isPerspectiveCamera||e.object.isOrthographicCamera?p*=o:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),e.enableZoom=!1)}function A(o,h){if(!e.zoomToCursor)return;ve=!0;const b=e.domElement.getBoundingClientRect(),P=o-b.left,N=h-b.top,ie=b.width,F=b.height;k.x=P/ie*2-1,k.y=-(N/F)*2+1,K.set(k.x,k.y,1).unproject(e.object).sub(e.object.position).normalize()}function oe(o){return Math.max(e.minDistance,Math.min(e.maxDistance,o))}function ue(o){w.set(o.clientX,o.clientY)}function Ie(o){A(o.clientX,o.clientX),D.set(o.clientX,o.clientY)}function ht(o){Z.set(o.clientX,o.clientY)}function pt(o){L.set(o.clientX,o.clientY),W.subVectors(L,w).multiplyScalar(e.rotateSpeed);const h=e.domElement;me(2*Math.PI*W.x/h.clientHeight),_e(2*Math.PI*W.y/h.clientHeight),w.copy(L),e.update()}function fn(o){T.set(o.clientX,o.clientY),_.subVectors(T,D),_.y>0?z(Te(_.y)):_.y<0&&$(Te(_.y)),D.copy(T),e.update()}function yn(o){O.set(o.clientX,o.clientY),j.subVectors(O,Z).multiplyScalar(e.panSpeed),q(j.x,j.y),Z.copy(O),e.update()}function bn(o){A(o.clientX,o.clientY),o.deltaY<0?$(Te(o.deltaY)):o.deltaY>0&&z(Te(o.deltaY)),e.update()}function wn(o){let h=!1;switch(o.code){case e.keys.UP:o.ctrlKey||o.metaKey||o.shiftKey?_e(2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):q(0,e.keyPanSpeed),h=!0;break;case e.keys.BOTTOM:o.ctrlKey||o.metaKey||o.shiftKey?_e(-2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):q(0,-e.keyPanSpeed),h=!0;break;case e.keys.LEFT:o.ctrlKey||o.metaKey||o.shiftKey?me(2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):q(e.keyPanSpeed,0),h=!0;break;case e.keys.RIGHT:o.ctrlKey||o.metaKey||o.shiftKey?me(-2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):q(-e.keyPanSpeed,0),h=!0;break}h&&(o.preventDefault(),e.update())}function Dt(o){if(I.length===1)w.set(o.pageX,o.pageY);else{const h=Ae(o),b=.5*(o.pageX+h.x),P=.5*(o.pageY+h.y);w.set(b,P)}}function Ct(o){if(I.length===1)Z.set(o.pageX,o.pageY);else{const h=Ae(o),b=.5*(o.pageX+h.x),P=.5*(o.pageY+h.y);Z.set(b,P)}}function jt(o){const h=Ae(o),b=o.pageX-h.x,P=o.pageY-h.y,N=Math.sqrt(b*b+P*P);D.set(0,N)}function gn(o){e.enableZoom&&jt(o),e.enablePan&&Ct(o)}function Mn(o){e.enableZoom&&jt(o),e.enableRotate&&Dt(o)}function kt(o){if(I.length==1)L.set(o.pageX,o.pageY);else{const b=Ae(o),P=.5*(o.pageX+b.x),N=.5*(o.pageY+b.y);L.set(P,N)}W.subVectors(L,w).multiplyScalar(e.rotateSpeed);const h=e.domElement;me(2*Math.PI*W.x/h.clientHeight),_e(2*Math.PI*W.y/h.clientHeight),w.copy(L)}function Rt(o){if(I.length===1)O.set(o.pageX,o.pageY);else{const h=Ae(o),b=.5*(o.pageX+h.x),P=.5*(o.pageY+h.y);O.set(b,P)}j.subVectors(O,Z).multiplyScalar(e.panSpeed),q(j.x,j.y),Z.copy(O)}function Ht(o){const h=Ae(o),b=o.pageX-h.x,P=o.pageY-h.y,N=Math.sqrt(b*b+P*P);T.set(0,N),_.set(0,Math.pow(T.y/D.y,e.zoomSpeed)),z(_.y),D.copy(T);const ie=(o.pageX+h.x)*.5,F=(o.pageY+h.y)*.5;A(ie,F)}function En(o){e.enableZoom&&Ht(o),e.enablePan&&Rt(o)}function Sn(o){e.enableZoom&&Ht(o),e.enableRotate&&kt(o)}function Yt(o){e.enabled!==!1&&(I.length===0&&(e.domElement.setPointerCapture(o.pointerId),e.domElement.addEventListener("pointermove",Mt),e.domElement.addEventListener("pointerup",Ne)),!An(o)&&(_n(o),o.pointerType==="touch"?Zt(o):Pn(o)))}function Mt(o){e.enabled!==!1&&(o.pointerType==="touch"?Tn(o):xn(o))}function Ne(o){switch(In(o),I.length){case 0:e.domElement.releasePointerCapture(o.pointerId),e.domElement.removeEventListener("pointermove",Mt),e.domElement.removeEventListener("pointerup",Ne),e.dispatchEvent($t),c=r.NONE;break;case 1:const h=I[0],b=pe[h];Zt({pointerId:h,pageX:b.x,pageY:b.y});break}}function Pn(o){let h;switch(o.button){case 0:h=e.mouseButtons.LEFT;break;case 1:h=e.mouseButtons.MIDDLE;break;case 2:h=e.mouseButtons.RIGHT;break;default:h=-1}switch(h){case t.MOUSE.DOLLY:if(e.enableZoom===!1)return;Ie(o),c=r.DOLLY;break;case t.MOUSE.ROTATE:if(o.ctrlKey||o.metaKey||o.shiftKey){if(e.enablePan===!1)return;ht(o),c=r.PAN}else{if(e.enableRotate===!1)return;ue(o),c=r.ROTATE}break;case t.MOUSE.PAN:if(o.ctrlKey||o.metaKey||o.shiftKey){if(e.enableRotate===!1)return;ue(o),c=r.ROTATE}else{if(e.enablePan===!1)return;ht(o),c=r.PAN}break;default:c=r.NONE}c!==r.NONE&&e.dispatchEvent(xt)}function xn(o){switch(c){case r.ROTATE:if(e.enableRotate===!1)return;pt(o);break;case r.DOLLY:if(e.enableZoom===!1)return;fn(o);break;case r.PAN:if(e.enablePan===!1)return;yn(o);break}}function zt(o){e.enabled===!1||e.enableZoom===!1||c!==r.NONE||(o.preventDefault(),e.dispatchEvent(xt),bn(vn(o)),e.dispatchEvent($t))}function vn(o){const h=o.deltaMode,b={clientX:o.clientX,clientY:o.clientY,deltaY:o.deltaY};switch(h){case 1:b.deltaY*=16;break;case 2:b.deltaY*=100;break}return o.ctrlKey&&!ze&&(b.deltaY*=10),b}function Nt(o){o.key==="Control"&&(ze=!0,e.domElement.getRootNode().addEventListener("keyup",Xt,{passive:!0,capture:!0}))}function Xt(o){o.key==="Control"&&(ze=!1,e.domElement.getRootNode().removeEventListener("keyup",Xt,{passive:!0,capture:!0}))}function Et(o){e.enabled===!1||e.enablePan===!1||wn(o)}function Zt(o){switch(Ft(o),I.length){case 1:switch(e.touches.ONE){case t.TOUCH.ROTATE:if(e.enableRotate===!1)return;Dt(o),c=r.TOUCH_ROTATE;break;case t.TOUCH.PAN:if(e.enablePan===!1)return;Ct(o),c=r.TOUCH_PAN;break;default:c=r.NONE}break;case 2:switch(e.touches.TWO){case t.TOUCH.DOLLY_PAN:if(e.enableZoom===!1&&e.enablePan===!1)return;gn(o),c=r.TOUCH_DOLLY_PAN;break;case t.TOUCH.DOLLY_ROTATE:if(e.enableZoom===!1&&e.enableRotate===!1)return;Mn(o),c=r.TOUCH_DOLLY_ROTATE;break;default:c=r.NONE}break;default:c=r.NONE}c!==r.NONE&&e.dispatchEvent(xt)}function Tn(o){switch(Ft(o),c){case r.TOUCH_ROTATE:if(e.enableRotate===!1)return;kt(o),e.update();break;case r.TOUCH_PAN:if(e.enablePan===!1)return;Rt(o),e.update();break;case r.TOUCH_DOLLY_PAN:if(e.enableZoom===!1&&e.enablePan===!1)return;En(o),e.update();break;case r.TOUCH_DOLLY_ROTATE:if(e.enableZoom===!1&&e.enableRotate===!1)return;Sn(o),e.update();break;default:c=r.NONE}}function Gt(o){e.enabled!==!1&&o.preventDefault()}function _n(o){I.push(o.pointerId)}function In(o){delete pe[o.pointerId];for(let h=0;h<I.length;h++)if(I[h]==o.pointerId){I.splice(h,1);return}}function An(o){for(let h=0;h<I.length;h++)if(I[h]==o.pointerId)return!0;return!1}function Ft(o){let h=pe[o.pointerId];h===void 0&&(h=new t.Vector2,pe[o.pointerId]=h),h.set(o.pageX,o.pageY)}function Ae(o){const h=o.pointerId===I[0]?I[1]:I[0];return pe[h]}e.domElement.addEventListener("contextmenu",Gt),e.domElement.addEventListener("pointerdown",Yt),e.domElement.addEventListener("pointercancel",Ne),e.domElement.addEventListener("wheel",zt,{passive:!1}),e.domElement.getRootNode().addEventListener("keydown",Nt,{passive:!0,capture:!0}),this.update()}}const fe=new t.Raycaster,H=new t.Vector3,ae=new t.Vector3,v=new t.Quaternion,en={X:new t.Vector3(1,0,0),Y:new t.Vector3(0,1,0),Z:new t.Vector3(0,0,1)},vt={type:"change"},tn={type:"mouseDown",mode:null},nn={type:"mouseUp",mode:null},on={type:"objectChange"};class Kn extends t.Object3D{constructor(n,a){super(),a===void 0&&(console.warn('THREE.TransformControls: The second parameter "domElement" is now mandatory.'),a=document),this.isTransformControls=!0,this.visible=!1,this.domElement=a,this.domElement.style.touchAction="none";const e=new oo;this._gizmo=e,this.add(e);const r=new io;this._plane=r,this.add(r);const c=this;function i(T,_){let K=_;Object.defineProperty(c,T,{get:function(){return K!==void 0?K:_},set:function(k){K!==k&&(K=k,r[T]=k,e[T]=k,c.dispatchEvent({type:T+"-changed",value:k}),c.dispatchEvent(vt))}}),c[T]=_,r[T]=_,e[T]=_}i("camera",n),i("object",void 0),i("enabled",!0),i("axis",null),i("mode","translate"),i("translationSnap",null),i("rotationSnap",null),i("scaleSnap",null),i("space","world"),i("size",1),i("dragging",!1),i("showX",!0),i("showY",!0),i("showZ",!0);const l=new t.Vector3,u=new t.Vector3,p=new t.Quaternion,d=new t.Quaternion,w=new t.Vector3,L=new t.Quaternion,W=new t.Vector3,Z=new t.Vector3,O=new t.Vector3,j=0,D=new t.Vector3;i("worldPosition",l),i("worldPositionStart",u),i("worldQuaternion",p),i("worldQuaternionStart",d),i("cameraPosition",w),i("cameraQuaternion",L),i("pointStart",W),i("pointEnd",Z),i("rotationAxis",O),i("rotationAngle",j),i("eye",D),this._offset=new t.Vector3,this._startNorm=new t.Vector3,this._endNorm=new t.Vector3,this._cameraScale=new t.Vector3,this._parentPosition=new t.Vector3,this._parentQuaternion=new t.Quaternion,this._parentQuaternionInv=new t.Quaternion,this._parentScale=new t.Vector3,this._worldScaleStart=new t.Vector3,this._worldQuaternionInv=new t.Quaternion,this._worldScale=new t.Vector3,this._positionStart=new t.Vector3,this._quaternionStart=new t.Quaternion,this._scaleStart=new t.Vector3,this._getPointer=$n.bind(this),this._onPointerDown=eo.bind(this),this._onPointerHover=Jn.bind(this),this._onPointerMove=to.bind(this),this._onPointerUp=no.bind(this),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointermove",this._onPointerHover),this.domElement.addEventListener("pointerup",this._onPointerUp)}updateMatrixWorld(n){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(n)}pointerHover(n){if(this.object===void 0||this.dragging===!0)return;n!==null&&fe.setFromCamera(n,this.camera);const a=Tt(this._gizmo.picker[this.mode],fe);a?this.axis=a.object.name:this.axis=null}pointerDown(n){if(!(this.object===void 0||this.dragging===!0||n!=null&&n.button!==0)&&this.axis!==null){n!==null&&fe.setFromCamera(n,this.camera);const a=Tt(this._plane,fe,!0);a&&(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(a.point).sub(this.worldPositionStart)),this.dragging=!0,tn.mode=this.mode,this.dispatchEvent(tn)}}pointerMove(n){const a=this.axis,e=this.mode,r=this.object;let c=this.space;if(e==="scale"?c="local":(a==="E"||a==="XYZE"||a==="XYZ")&&(c="world"),r===void 0||a===null||this.dragging===!1||n!==null&&n.button!==-1)return;n!==null&&fe.setFromCamera(n,this.camera);const i=Tt(this._plane,fe,!0);if(i){if(this.pointEnd.copy(i.point).sub(this.worldPositionStart),e==="translate")this._offset.copy(this.pointEnd).sub(this.pointStart),c==="local"&&a!=="XYZ"&&this._offset.applyQuaternion(this._worldQuaternionInv),a.indexOf("X")===-1&&(this._offset.x=0),a.indexOf("Y")===-1&&(this._offset.y=0),a.indexOf("Z")===-1&&(this._offset.z=0),c==="local"&&a!=="XYZ"?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),r.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(c==="local"&&(r.position.applyQuaternion(v.copy(this._quaternionStart).invert()),a.search("X")!==-1&&(r.position.x=Math.round(r.position.x/this.translationSnap)*this.translationSnap),a.search("Y")!==-1&&(r.position.y=Math.round(r.position.y/this.translationSnap)*this.translationSnap),a.search("Z")!==-1&&(r.position.z=Math.round(r.position.z/this.translationSnap)*this.translationSnap),r.position.applyQuaternion(this._quaternionStart)),c==="world"&&(r.parent&&r.position.add(H.setFromMatrixPosition(r.parent.matrixWorld)),a.search("X")!==-1&&(r.position.x=Math.round(r.position.x/this.translationSnap)*this.translationSnap),a.search("Y")!==-1&&(r.position.y=Math.round(r.position.y/this.translationSnap)*this.translationSnap),a.search("Z")!==-1&&(r.position.z=Math.round(r.position.z/this.translationSnap)*this.translationSnap),r.parent&&r.position.sub(H.setFromMatrixPosition(r.parent.matrixWorld))));else if(e==="scale"){if(a.search("XYZ")!==-1){let l=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(l*=-1),ae.set(l,l,l)}else H.copy(this.pointStart),ae.copy(this.pointEnd),H.applyQuaternion(this._worldQuaternionInv),ae.applyQuaternion(this._worldQuaternionInv),ae.divide(H),a.search("X")===-1&&(ae.x=1),a.search("Y")===-1&&(ae.y=1),a.search("Z")===-1&&(ae.z=1);r.scale.copy(this._scaleStart).multiply(ae),this.scaleSnap&&(a.search("X")!==-1&&(r.scale.x=Math.round(r.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),a.search("Y")!==-1&&(r.scale.y=Math.round(r.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),a.search("Z")!==-1&&(r.scale.z=Math.round(r.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(e==="rotate"){this._offset.copy(this.pointEnd).sub(this.pointStart);const l=20/this.worldPosition.distanceTo(H.setFromMatrixPosition(this.camera.matrixWorld));let u=!1;a==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(H.copy(this.rotationAxis).cross(this.eye))*l):(a==="X"||a==="Y"||a==="Z")&&(this.rotationAxis.copy(en[a]),H.copy(en[a]),c==="local"&&H.applyQuaternion(this.worldQuaternion),H.cross(this.eye),H.length()===0?u=!0:this.rotationAngle=this._offset.dot(H.normalize())*l),(a==="E"||u)&&(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),c==="local"&&a!=="E"&&a!=="XYZE"?(r.quaternion.copy(this._quaternionStart),r.quaternion.multiply(v.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),r.quaternion.copy(v.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),r.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(vt),this.dispatchEvent(on)}}pointerUp(n){n!==null&&n.button!==0||(this.dragging&&this.axis!==null&&(nn.mode=this.mode,this.dispatchEvent(nn)),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(n){n.geometry&&n.geometry.dispose(),n.material&&n.material.dispose()})}attach(n){return this.object=n,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(vt),this.dispatchEvent(on),this.pointStart.copy(this.pointEnd))}getRaycaster(){return fe}getMode(){return this.mode}setMode(n){this.mode=n}setTranslationSnap(n){this.translationSnap=n}setRotationSnap(n){this.rotationSnap=n}setScaleSnap(n){this.scaleSnap=n}setSize(n){this.size=n}setSpace(n){this.space=n}}function $n(m){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:m.button};{const n=this.domElement.getBoundingClientRect();return{x:(m.clientX-n.left)/n.width*2-1,y:-(m.clientY-n.top)/n.height*2+1,button:m.button}}}function Jn(m){if(this.enabled)switch(m.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(m));break}}function eo(m){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(m.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(m)),this.pointerDown(this._getPointer(m)))}function to(m){this.enabled&&this.pointerMove(this._getPointer(m))}function no(m){this.enabled&&(this.domElement.releasePointerCapture(m.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(m)))}function Tt(m,n,a){const e=n.intersectObject(m,!0);for(let r=0;r<e.length;r++)if(e[r].object.visible||a)return e[r];return!1}const dt=new t.Euler,S=new t.Vector3(0,1,0),sn=new t.Vector3(0,0,0),an=new t.Matrix4,ft=new t.Quaternion,wt=new t.Quaternion,B=new t.Vector3,rn=new t.Matrix4,Ve=new t.Vector3(1,0,0),we=new t.Vector3(0,1,0),Qe=new t.Vector3(0,0,1),yt=new t.Vector3,Ge=new t.Vector3,Fe=new t.Vector3;class oo extends t.Object3D{constructor(){super(),this.isTransformControlsGizmo=!0,this.type="TransformControlsGizmo";const n=new t.MeshBasicMaterial({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),a=new t.LineBasicMaterial({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),e=n.clone();e.opacity=.15;const r=a.clone();r.opacity=.5;const c=n.clone();c.color.setHex(16711680);const i=n.clone();i.color.setHex(65280);const l=n.clone();l.color.setHex(255);const u=n.clone();u.color.setHex(16711680),u.opacity=.5;const p=n.clone();p.color.setHex(65280),p.opacity=.5;const d=n.clone();d.color.setHex(255),d.opacity=.5;const w=n.clone();w.opacity=.25;const L=n.clone();L.color.setHex(16776960),L.opacity=.25,n.clone().color.setHex(16776960);const Z=n.clone();Z.color.setHex(7895160);const O=new t.CylinderGeometry(0,.04,.1,12);O.translate(0,.05,0);const j=new t.BoxGeometry(.08,.08,.08);j.translate(0,.04,0);const D=new t.BufferGeometry;D.setAttribute("position",new t.Float32BufferAttribute([0,0,0,1,0,0],3));const T=new t.CylinderGeometry(.0075,.0075,.5,3);T.translate(0,.25,0);function _(Y,q){const z=new t.TorusGeometry(Y,.0075,3,64,q*Math.PI*2);return z.rotateY(Math.PI/2),z.rotateX(Math.PI/2),z}function K(){const Y=new t.BufferGeometry;return Y.setAttribute("position",new t.Float32BufferAttribute([0,0,0,1,1,1],3)),Y}const k={X:[[new t.Mesh(O,c),[.5,0,0],[0,0,-Math.PI/2]],[new t.Mesh(O,c),[-.5,0,0],[0,0,Math.PI/2]],[new t.Mesh(T,c),[0,0,0],[0,0,-Math.PI/2]]],Y:[[new t.Mesh(O,i),[0,.5,0]],[new t.Mesh(O,i),[0,-.5,0],[Math.PI,0,0]],[new t.Mesh(T,i)]],Z:[[new t.Mesh(O,l),[0,0,.5],[Math.PI/2,0,0]],[new t.Mesh(O,l),[0,0,-.5],[-Math.PI/2,0,0]],[new t.Mesh(T,l),null,[Math.PI/2,0,0]]],XYZ:[[new t.Mesh(new t.OctahedronGeometry(.1,0),w.clone()),[0,0,0]]],XY:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),d.clone()),[.15,.15,0]]],YZ:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),u.clone()),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),p.clone()),[.15,0,.15],[-Math.PI/2,0,0]]]},ve={X:[[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),e),[.3,0,0],[0,0,-Math.PI/2]],[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),e),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),e),[0,.3,0]],[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),e),[0,-.3,0],[0,0,Math.PI]]],Z:[[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),e),[0,0,.3],[Math.PI/2,0,0]],[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),e),[0,0,-.3],[-Math.PI/2,0,0]]],XYZ:[[new t.Mesh(new t.OctahedronGeometry(.2,0),e)]],XY:[[new t.Mesh(new t.BoxGeometry(.2,.2,.01),e),[.15,.15,0]]],YZ:[[new t.Mesh(new t.BoxGeometry(.2,.2,.01),e),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new t.Mesh(new t.BoxGeometry(.2,.2,.01),e),[.15,0,.15],[-Math.PI/2,0,0]]]},I={START:[[new t.Mesh(new t.OctahedronGeometry(.01,2),r),null,null,null,"helper"]],END:[[new t.Mesh(new t.OctahedronGeometry(.01,2),r),null,null,null,"helper"]],DELTA:[[new t.Line(K(),r),null,null,null,"helper"]],X:[[new t.Line(D,r.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new t.Line(D,r.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new t.Line(D,r.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},pe={XYZE:[[new t.Mesh(_(.5,1),Z),null,[0,Math.PI/2,0]]],X:[[new t.Mesh(_(.5,.5),c)]],Y:[[new t.Mesh(_(.5,.5),i),null,[0,0,-Math.PI/2]]],Z:[[new t.Mesh(_(.5,.5),l),null,[0,Math.PI/2,0]]],E:[[new t.Mesh(_(.75,1),L),null,[0,Math.PI/2,0]]]},ze={AXIS:[[new t.Line(D,r.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]]},gt={XYZE:[[new t.Mesh(new t.SphereGeometry(.25,10,8),e)]],X:[[new t.Mesh(new t.TorusGeometry(.5,.1,4,24),e),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new t.Mesh(new t.TorusGeometry(.5,.1,4,24),e),[0,0,0],[Math.PI/2,0,0]]],Z:[[new t.Mesh(new t.TorusGeometry(.5,.1,4,24),e),[0,0,0],[0,0,-Math.PI/2]]],E:[[new t.Mesh(new t.TorusGeometry(.75,.1,2,24),e)]]},Te={X:[[new t.Mesh(j,c),[.5,0,0],[0,0,-Math.PI/2]],[new t.Mesh(T,c),[0,0,0],[0,0,-Math.PI/2]],[new t.Mesh(j,c),[-.5,0,0],[0,0,Math.PI/2]]],Y:[[new t.Mesh(j,i),[0,.5,0]],[new t.Mesh(T,i)],[new t.Mesh(j,i),[0,-.5,0],[0,0,Math.PI]]],Z:[[new t.Mesh(j,l),[0,0,.5],[Math.PI/2,0,0]],[new t.Mesh(T,l),[0,0,0],[Math.PI/2,0,0]],[new t.Mesh(j,l),[0,0,-.5],[-Math.PI/2,0,0]]],XY:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),d),[.15,.15,0]]],YZ:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),u),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),p),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new t.Mesh(new t.BoxGeometry(.1,.1,.1),w.clone())]]},me={X:[[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),e),[.3,0,0],[0,0,-Math.PI/2]],[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),e),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),e),[0,.3,0]],[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),e),[0,-.3,0],[0,0,Math.PI]]],Z:[[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),e),[0,0,.3],[Math.PI/2,0,0]],[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),e),[0,0,-.3],[-Math.PI/2,0,0]]],XY:[[new t.Mesh(new t.BoxGeometry(.2,.2,.01),e),[.15,.15,0]]],YZ:[[new t.Mesh(new t.BoxGeometry(.2,.2,.01),e),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new t.Mesh(new t.BoxGeometry(.2,.2,.01),e),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new t.Mesh(new t.BoxGeometry(.2,.2,.2),e),[0,0,0]]]},_e={X:[[new t.Line(D,r.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new t.Line(D,r.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new t.Line(D,r.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]};function G(Y){const q=new t.Object3D;for(const z in Y)for(let $=Y[z].length;$--;){const A=Y[z][$][0].clone(),oe=Y[z][$][1],ue=Y[z][$][2],Ie=Y[z][$][3],ht=Y[z][$][4];A.name=z,A.tag=ht,oe&&A.position.set(oe[0],oe[1],oe[2]),ue&&A.rotation.set(ue[0],ue[1],ue[2]),Ie&&A.scale.set(Ie[0],Ie[1],Ie[2]),A.updateMatrix();const pt=A.geometry.clone();pt.applyMatrix4(A.matrix),A.geometry=pt,A.renderOrder=1/0,A.position.set(0,0,0),A.rotation.set(0,0,0),A.scale.set(1,1,1),q.add(A)}return q}this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=G(k)),this.add(this.gizmo.rotate=G(pe)),this.add(this.gizmo.scale=G(Te)),this.add(this.picker.translate=G(ve)),this.add(this.picker.rotate=G(gt)),this.add(this.picker.scale=G(me)),this.add(this.helper.translate=G(I)),this.add(this.helper.rotate=G(ze)),this.add(this.helper.scale=G(_e)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}updateMatrixWorld(n){const e=(this.mode==="scale"?"local":this.space)==="local"?this.worldQuaternion:wt;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 r=[];r=r.concat(this.picker[this.mode].children),r=r.concat(this.gizmo[this.mode].children),r=r.concat(this.helper[this.mode].children);for(let c=0;c<r.length;c++){const i=r[c];i.visible=!0,i.rotation.set(0,0,0),i.position.copy(this.worldPosition);let l;if(this.camera.isOrthographicCamera?l=(this.camera.top-this.camera.bottom)/this.camera.zoom:l=this.worldPosition.distanceTo(this.cameraPosition)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),i.scale.set(1,1,1).multiplyScalar(l*this.size/4),i.tag==="helper"){i.visible=!1,i.name==="AXIS"?(i.visible=!!this.axis,this.axis==="X"&&(v.setFromEuler(dt.set(0,0,0)),i.quaternion.copy(e).multiply(v),Math.abs(S.copy(Ve).applyQuaternion(e).dot(this.eye))>.9&&(i.visible=!1)),this.axis==="Y"&&(v.setFromEuler(dt.set(0,0,Math.PI/2)),i.quaternion.copy(e).multiply(v),Math.abs(S.copy(we).applyQuaternion(e).dot(this.eye))>.9&&(i.visible=!1)),this.axis==="Z"&&(v.setFromEuler(dt.set(0,Math.PI/2,0)),i.quaternion.copy(e).multiply(v),Math.abs(S.copy(Qe).applyQuaternion(e).dot(this.eye))>.9&&(i.visible=!1)),this.axis==="XYZE"&&(v.setFromEuler(dt.set(0,Math.PI/2,0)),S.copy(this.rotationAxis),i.quaternion.setFromRotationMatrix(an.lookAt(sn,S,we)),i.quaternion.multiply(v),i.visible=this.dragging),this.axis==="E"&&(i.visible=!1)):i.name==="START"?(i.position.copy(this.worldPositionStart),i.visible=this.dragging):i.name==="END"?(i.position.copy(this.worldPosition),i.visible=this.dragging):i.name==="DELTA"?(i.position.copy(this.worldPositionStart),i.quaternion.copy(this.worldQuaternionStart),H.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),H.applyQuaternion(this.worldQuaternionStart.clone().invert()),i.scale.copy(H),i.visible=this.dragging):(i.quaternion.copy(e),this.dragging?i.position.copy(this.worldPositionStart):i.position.copy(this.worldPosition),this.axis&&(i.visible=this.axis.search(i.name)!==-1));continue}i.quaternion.copy(e),this.mode==="translate"||this.mode==="scale"?(i.name==="X"&&Math.abs(S.copy(Ve).applyQuaternion(e).dot(this.eye))>.99&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),i.name==="Y"&&Math.abs(S.copy(we).applyQuaternion(e).dot(this.eye))>.99&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),i.name==="Z"&&Math.abs(S.copy(Qe).applyQuaternion(e).dot(this.eye))>.99&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),i.name==="XY"&&Math.abs(S.copy(Qe).applyQuaternion(e).dot(this.eye))<.2&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),i.name==="YZ"&&Math.abs(S.copy(Ve).applyQuaternion(e).dot(this.eye))<.2&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),i.name==="XZ"&&Math.abs(S.copy(we).applyQuaternion(e).dot(this.eye))<.2&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1)):this.mode==="rotate"&&(ft.copy(e),S.copy(this.eye).applyQuaternion(v.copy(e).invert()),i.name.search("E")!==-1&&i.quaternion.setFromRotationMatrix(an.lookAt(this.eye,sn,we)),i.name==="X"&&(v.setFromAxisAngle(Ve,Math.atan2(-S.y,S.z)),v.multiplyQuaternions(ft,v),i.quaternion.copy(v)),i.name==="Y"&&(v.setFromAxisAngle(we,Math.atan2(S.x,S.z)),v.multiplyQuaternions(ft,v),i.quaternion.copy(v)),i.name==="Z"&&(v.setFromAxisAngle(Qe,Math.atan2(S.y,S.x)),v.multiplyQuaternions(ft,v),i.quaternion.copy(v))),i.visible=i.visible&&(i.name.indexOf("X")===-1||this.showX),i.visible=i.visible&&(i.name.indexOf("Y")===-1||this.showY),i.visible=i.visible&&(i.name.indexOf("Z")===-1||this.showZ),i.visible=i.visible&&(i.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),i.material._color=i.material._color||i.material.color.clone(),i.material._opacity=i.material._opacity||i.material.opacity,i.material.color.copy(i.material._color),i.material.opacity=i.material._opacity,this.enabled&&this.axis&&(i.name===this.axis||this.axis.split("").some(function(u){return i.name===u}))&&(i.material.color.setHex(16776960),i.material.opacity=1)}super.updateMatrixWorld(n)}}class io extends t.Mesh{constructor(){super(new t.PlaneGeometry(1e5,1e5,2,2),new t.MeshBasicMaterial({visible:!1,wireframe:!0,side:t.DoubleSide,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(n){let a=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(a="local"),yt.copy(Ve).applyQuaternion(a==="local"?this.worldQuaternion:wt),Ge.copy(we).applyQuaternion(a==="local"?this.worldQuaternion:wt),Fe.copy(Qe).applyQuaternion(a==="local"?this.worldQuaternion:wt),S.copy(Ge),this.mode){case"translate":case"scale":switch(this.axis){case"X":S.copy(this.eye).cross(yt),B.copy(yt).cross(S);break;case"Y":S.copy(this.eye).cross(Ge),B.copy(Ge).cross(S);break;case"Z":S.copy(this.eye).cross(Fe),B.copy(Fe).cross(S);break;case"XY":B.copy(Fe);break;case"YZ":B.copy(yt);break;case"XZ":S.copy(Fe),B.copy(Ge);break;case"XYZ":case"E":B.set(0,0,0);break}break;case"rotate":default:B.set(0,0,0)}B.length()===0?this.quaternion.copy(this.cameraQuaternion):(rn.lookAt(H.set(0,0,0),B,S),this.quaternion.setFromRotationMatrix(rn)),super.updateMatrixWorld(n)}}var V,Se;class so{constructor(){f(this,V);f(this,Se);x(this,V,new Wn(y.en3.camera,y.en3.webglRenderer.domElement)),x(this,Se,new X.Store([0,0,0],{passport:{name:"Controls.OrbitControls.Target",manager:{type:"number",invisible:!0}}}));let n=!0;s(this,Se).subscribe(a=>{s(this,V).target.set(...a.current),n&&s(this,V).update()}),s(this,V).addEventListener("change",()=>{n=!1,s(this,Se).current=[s(this,V).target.x,s(this,V).target.y,s(this,V).target.z],n=!0})}get controls(){return s(this,V)}destroy(){s(this,V).dispose(),s(this,Se).close()}}V=new WeakMap,Se=new WeakMap;var R,Be,We,Ke,$e,Je,et,tt,nt;class ao{constructor(){f(this,R,null);f(this,Be,new X.Store(y.en3.camera.far,{passport:{name:"Helpers.Grid.Size",manager:{type:"number",step:1}}}));f(this,We,new X.Store(100,{passport:{name:"Helpers.Grid.Divisions",manager:{type:"number"}}}));f(this,Ke,new X.Store("#0000ff",{passport:{name:"Helpers.Grid.Color 1",manager:{type:"color"}}}));f(this,$e,new X.Store("#808080",{passport:{name:"Helpers.Grid.Color 2",manager:{type:"color"}}}));f(this,Je,new X.Store(!1,{passport:{name:"Helpers.Grid.Vertical",manager:{type:"boolean"}}}));f(this,et,new X.Store(!0,{passport:{name:"Helpers.Grid.Visible",manager:{type:"boolean"}}}));f(this,tt);f(this,nt,n=>{n.key==="g"&&(s(this,R).visible=!s(this,R).visible)});x(this,tt,new kn.Composed([s(this,Be),s(this,We),s(this,Ke),s(this,$e),s(this,Je),s(this,et)],()=>{s(this,R)&&(y.en3.view.remove(s(this,R)),s(this,R).dispose()),x(this,R,new t.GridHelper(s(this,Be).current,s(this,We).current,s(this,Ke).current,s(this,$e).current)),s(this,R).rotation.x=s(this,Je).current?Math.PI/2:0,s(this,R).visible=s(this,et).current,y.en3.view.add(s(this,R))})),addEventListener("keydown",s(this,nt))}get helper(){return s(this,R)}destroy(){s(this,tt).close(),s(this,R)&&(y.en3.view.remove(s(this,R)),s(this,R).dispose()),removeEventListener("keydown",s(this,nt))}}R=new WeakMap,Be=new WeakMap,We=new WeakMap,Ke=new WeakMap,$e=new WeakMap,Je=new WeakMap,et=new WeakMap,tt=new WeakMap,nt=new WeakMap;var C,Q,ce,le,ot,De,it,st,At;class ro{constructor(){f(this,st);f(this,C);f(this,Q,[]);f(this,ce,null);f(this,le,n=>{if(n.child.name.startsWith("T.")&&!s(this,Q).find(a=>a.object3d===n.child)){const a=new Ot(n.child);s(this,Q).push(a),y.en3.raycaster.add(a.raycasterTarget,{eventDispatcher:a.raycasterTarget}),a.raycasterTarget.addEventListener("pointerDown",s(this,De)),a.object3d.addEventListener("childadded",s(this,le))}});f(this,ot,n=>{const a=E(this,st,At).call(this,n.child);a&&(y.en3.raycaster.remove(a.raycasterTarget),a.destroy(),a.raycasterTarget.removeEventListener("pointerDown",s(this,De)),a.object3d.removeEventListener("childadded",s(this,le)),x(this,Q,s(this,Q).filter(e=>e!==a)))});f(this,De,n=>{const a=E(this,st,At).call(this,n.target);a&&(x(this,ce,s(this,Q).find(e=>e.object3d===(a==null?void 0:a.object3d))||null),s(this,ce)&&s(this,C).attach(s(this,ce).object3d))});f(this,it,n=>{n.key==="t"?s(this,C).setMode("translate"):n.key==="r"?s(this,C).setMode("rotate"):n.key==="s"?s(this,C).setMode("scale"):n.key==="Escape"?s(this,C).detach():n.key==="+"||n.key==="="?s(this,C).setSize(s(this,C).size+.1):n.key==="-"||n.key==="_"?s(this,C).setSize(s(this,C).size-.1):n.key==="h"&&s(this,Q).forEach(a=>{a.helpers.forEach(e=>{e.visible=!e.visible})})});x(this,C,new Kn(y.en3.camera,y.en3.webglRenderer.domElement)),s(this,C).addEventListener("objectChange",n=>{s(this,ce)&&s(this,ce).save()}),y.en3.view.add(s(this,C)),y.en3.scene.addEventListener("childadded",s(this,le)),y.en3.scene.addEventListener("childremoved",s(this,ot)),window.addEventListener("keydown",s(this,it))}get controls(){return s(this,C)}destroy(){y.en3.scene.removeEventListener("childadded",s(this,le)),y.en3.scene.removeEventListener("childremoved",s(this,ot)),window.removeEventListener("keydown",s(this,it)),s(this,C).dispose(),s(this,Q).forEach(n=>{n.raycasterTarget.removeEventListener("pointerDown",s(this,De)),n.object3d.removeEventListener("childadded",s(this,le)),n.destroy()}),x(this,Q,[])}}C=new WeakMap,Q=new WeakMap,ce=new WeakMap,le=new WeakMap,ot=new WeakMap,De=new WeakMap,it=new WeakMap,st=new WeakSet,At=function(n){return s(this,Q).find(e=>e.object3d===n||e.raycasterTarget===n)};var Ce,je,ke,Re,xe,Lt,dn;class co{constructor(){f(this,xe);f(this,Ce);f(this,je);f(this,ke);f(this,Re,[]);x(this,Ce,y.en3.composer.addPass=y.en3.composer.addPass.bind(y.en3.composer)),y.en3.composer.addPass=(...n)=>{E(this,xe,Lt).call(this,n[0]),s(this,Ce).call(this,...n)},x(this,je,y.en3.composer.removePass=y.en3.composer.removePass.bind(y.en3.composer)),y.en3.composer.removePass=(...n)=>{E(this,xe,dn).call(this,n[0]),s(this,je).call(this,...n)},x(this,ke,y.en3.composer.insertPass=y.en3.composer.insertPass.bind(y.en3.composer)),y.en3.composer.insertPass=(...n)=>{E(this,xe,Lt).call(this,n[0]),s(this,ke).call(this,...n)}}destroy(){y.en3.composer.addPass=s(this,Ce),y.en3.composer.removePass=s(this,je),y.en3.composer.insertPass=s(this,ke),s(this,Re).forEach(n=>{n.destroy()})}}Ce=new WeakMap,je=new WeakMap,ke=new WeakMap,Re=new WeakMap,xe=new WeakSet,Lt=function(n){s(this,Re).push(new he(n,{folderName:`EffectComposer.${n.constructor.name}`,skipKeys:["renderToScreen","needsSwap","nMips","oldClearAlpha","clearColor","resolution"]})),"uniforms"in n&&s(this,Re).push(new he(n.uniforms,{folderName:`EffectComposer.${n.constructor.name}.Uniforms`,optionsCatalog:{maxblur:{type:"number",min:0,max:1,step:1e-5,ease:.1},aperture:{type:"number",min:0,max:.01,step:1e-6},focus:{type:"number",min:0,step:.01}},skipKeys:["time","resolution"]}))},dn=function(n){};var at,rt,ct,lt,He,Pe,Ye;class lo{constructor(){f(this,at);f(this,rt);f(this,ct,null);f(this,lt);f(this,He);f(this,Pe);f(this,Ye);x(this,at,new he(y.en3.webglRenderer,{folderName:"Renderer"})),x(this,rt,new he(y.en3.webglRenderer.shadowMap,{folderName:"Renderer.shadowMap",optionsCatalog:{type:{type:"select",variants:["BasicShadowMap","PCFShadowMap","PCFSoftShadowMap","VSMShadowMap"]}},afterChange:()=>{y.en3.webglRenderer.shadowMap.needsUpdate=!0,Rn.traverseMaterials(y.en3.scene,n=>{n.needsUpdate=!0})}})),y.en3.composer&&x(this,ct,new co),x(this,lt,new ao),x(this,He,new Ot(y.en3.camera)),x(this,Pe,new so),s(this,Pe).controls.addEventListener("change",()=>{s(this,He).save()}),x(this,Ye,new ro),s(this,Ye).controls.addEventListener("dragging-changed",n=>{s(this,Pe).controls.enabled=!n.value})}destroy(){var n;s(this,at).destroy(),s(this,rt).destroy(),(n=s(this,ct))==null||n.destroy(),s(this,lt).destroy(),s(this,He).destroy(),s(this,Pe).destroy(),s(this,Ye).destroy()}}at=new WeakMap,rt=new WeakMap,ct=new WeakMap,lt=new WeakMap,He=new WeakMap,Pe=new WeakMap,Ye=new WeakMap;exports.En3Helpers=lo;exports.En3Object3dManager=Ot;
1
+ "use strict";var On=Object.defineProperty;var qt=Object.getOwnPropertySymbols;var Dn=Object.prototype.hasOwnProperty,Cn=Object.prototype.propertyIsEnumerable;var Bt=m=>{throw TypeError(m)};var Ut=(m,n,a)=>n in m?On(m,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):m[n]=a,se=(m,n)=>{for(var a in n||(n={}))Dn.call(n,a)&&Ut(m,a,n[a]);if(qt)for(var a of qt(n))Cn.call(n,a)&&Ut(m,a,n[a]);return m};var St=(m,n,a)=>n.has(m)||Bt("Cannot "+a);var s=(m,n,a)=>(St(m,n,"read from private field"),a?a.call(m):n.get(m)),f=(m,n,a)=>n.has(m)?Bt("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(m):n.set(m,a),x=(m,n,a,e)=>(St(m,n,"write to private field"),e?e.call(m,a):n.set(m,a),a),E=(m,n,a)=>(St(m,n,"access private method"),a);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("../../en3-C1fLmsjs.cjs"),X=require("../../Store-npaZHvX4.cjs"),t=require("three"),jn=require("../../object-CCiXnER2.cjs"),Wt=require("../../ticker/index.cjs"),kn=require("../../Composed-C_4slJQ6.cjs"),Rn=require("../../traverseMaterials-CD_3_56D.cjs");function Hn(m){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(m){for(const a in m)if(a!=="default"){const e=Object.getOwnPropertyDescriptor(m,a);Object.defineProperty(n,a,e.get?e:{enumerable:!0,get:()=>m[a]})}}return n.default=m,Object.freeze(n)}const de=Hn(t),Yn=["AddEquation","SubtractEquation","ReverseSubtractEquation","MinEquation","MaxEquation"],cn=["ZeroFactor","OneFactor","SrcColorFactor","OneMinusSrcColorFactor","SrcAlphaFactor","OneMinusSrcAlphaFactor","DstAlphaFactor","OneMinusDstAlphaFactor","DstColorFactor","OneMinusDstColorFactor","SrcAlphaSaturateFactor","ConstantColorFactor","OneMinusConstantColorFactor","ConstantAlphaFactor","OneMinusConstantAlphaFactor"],zn=[...cn,"SrcAlphaSaturateFactor"],Nn=["NoBlending","NormalBlending","AdditiveBlending","SubtractiveBlending","MultiplyBlending","CustomBlending"],Xn=["NeverDepth","AlwaysDepth","EqualDepth","LessDepth","LessEqualDepth ","GreaterEqualDepth ","GreaterDepth","NotEqualDepth"],Zn=["NeverStencilFunc","LessStencilFunc","EqualStencilFunc","LessEqualStencilFunc ","GreaterStencilFunc","NotEqualStencilFunc ","GreaterEqualStencilFunc","AlwaysStencilFunc"],Pt=["ZeroStencilOp","KeepStencilOp","ReplaceStencilOp","IncrementStencilOp","DecrementStencilOp","IncrementWrapStencilOp","DecrementWrapStencilOp","InvertStencilOp"],Gn=["FrontSide","BackSide","DoubleSide"],Fn=["TangentSpaceNormalMap","ObjectSpaceNormalMap"],Vn=["round","bevel","miter"],Qn=["NoToneMapping","LinearToneMapping","ReinhardToneMapping","CineonToneMapping","ACESFilmicToneMapping","AgXToneMapping","NeutralToneMapping","CustomToneMapping"],qn={intensity:{type:"number",min:0,max:20,step:1e-4},renderOrder:{type:"number",step:1},alphaTest:{type:"number",min:0,max:1,step:.001},blendAlpha:{type:"number",min:0,max:1,step:.001},blendDst:{type:"select",variants:zn},blendDstAlpha:{type:"number",min:0,max:1,step:.001},blendEquation:{type:"select",variants:Yn},blendEquationAlpha:{type:"number",min:0,max:1,step:.001},blending:{type:"select",variants:Nn},blendSrc:{type:"select",variants:cn},blendSrcAlpha:{type:"number",min:0,max:1,step:.001},depthFunc:{type:"select",variants:Xn},stencilFunc:{type:"select",variants:Zn},stencilRef:{type:"number",min:0,step:1},stencilFail:{type:"select",variants:Pt},stencilZFail:{type:"select",variants:Pt},stencilZPass:{type:"select",variants:Pt},opacity:{type:"number",min:0,max:1,step:1e-4},side:{type:"select",variants:Gn},roughness:{type:"number",min:0,max:1,step:1e-4},metalness:{type:"number",min:0,max:1,step:1e-4},lightMapIntensity:{type:"number",min:0,max:20,step:1e-4},aoMapIntensity:{type:"number",min:0,max:20,step:1e-4},bumpScale:{type:"number",min:0,step:1e-4},normalMapType:{type:"select",variants:Fn},wireframeLinejoin:{type:"select",variants:Vn},envMapIntensity:{type:"number",min:0,max:20,step:1e-4},emissiveIntensity:{type:"number",min:0,max:20,step:1e-4},fov:{type:"number",min:0,max:180,step:1},zoom:{type:"number",min:0,step:1e-4},near:{type:"number",min:0,step:1e-4},far:{type:"number",min:0,step:1},filmGauge:{type:"number",min:0,step:1e-4},filmOffset:{type:"number",min:0,step:1e-4},distance:{type:"number",min:0,step:.1},decay:{type:"number",min:0,step:1e-5,ease:.001},focus:{type:"number",min:0,max:1,step:1e-5},bias:{type:"number",min:0,max:.01,step:1e-6,ease:.01},blurSamples:{type:"number",min:0,step:1},normalBias:{type:"number",min:0,step:.001,ease:.01},radius:{type:"number",min:0,step:.001,ease:.01},penumbra:{type:"number",min:0,max:1,step:1e-6},power:{type:"number",min:0,step:.001,ease:.01},angle:{type:"number",min:0,step:1e-6,ease:.001},toneMapping:{type:"select",variants:Qn},toneMappingExposure:{type:"number",min:0,step:.001,ease:.1},mapSize:{type:"number",min:0,step:1},damp:{type:"number",min:0,max:1,step:1e-6},strength:{type:"number",min:0,step:.01},threshold:{type:"number",min:0,max:1,step:1e-4}},Un=new Set(["stencilFuncMask","needsUpdate","version","wireframeLinewidth","position","scale","rotation","coordinateSystem","aspect","autoUpdate","up"]);var Le,ne,M,ln,hn,pn,mn,un,_t,It,ye,be;class he{constructor(n,a){f(this,M);f(this,Le);f(this,ne,[]);x(this,Le,n);const e=se(se({},qn),a==null?void 0:a.optionsCatalog),r=new Set([...Un,...(a==null?void 0:a.skipKeys)||[]]),c=(a==null?void 0:a.folderName)||s(this,Le).name,i=a==null?void 0:a.afterChange;E(this,M,ln).call(this,{subject:s(this,Le),skipKeys:r,optionsCatalog:e,folderKey:c,afterChange:i})}destroy(){s(this,ne).forEach(n=>{n.close()})}}Le=new WeakMap,ne=new WeakMap,M=new WeakSet,ln=function(n){const{subject:a,folderKey:e,optionsCatalog:r,afterChange:c,skipKeys:i}=n;for(const l in a){if(l.startsWith("_")||i.has(l))continue;const u=a[l],p=E(this,M,ye).call(this,u),d=`${e}.${l}`,w=r[l];typeof p=="number"?(w==null?void 0:w.type)==="select"?E(this,M,_t).call(this,{name:d,value:u,subject:a,key:l,managerOptions:w,afterChange:c}):E(this,M,hn).call(this,{name:d,value:u,subject:a,key:l,managerOptions:w,afterChange:c}):p instanceof de.Vector2||p instanceof de.Vector3?E(this,M,pn).call(this,{name:d,value:u,subject:a,key:l,managerOptions:w,afterChange:c}):typeof p=="boolean"&&!l.startsWith("is")&&!l.startsWith("matrix")?E(this,M,mn).call(this,{name:d,value:u,subject:a,key:l,managerOptions:w,afterChange:c}):p instanceof de.Color?E(this,M,un).call(this,{name:d,value:u,subject:a,key:l,managerOptions:w,afterChange:c}):w&&(w==null?void 0:w.type)==="select"&&E(this,M,_t).call(this,{name:d,value:u,subject:a,key:l,managerOptions:w,afterChange:c})}},hn=function({name:n,value:a,subject:e,key:r,managerOptions:c,afterChange:i}){const l=new X.Store(E(this,M,ye).call(this,a),{passport:{name:n,manager:se({type:"number"},c)}});l.subscribe(u=>{E(this,M,be).call(this,e,r,(p,d)=>p[d]=u.current),i==null||i()}),s(this,ne).push(l)},pn=function({name:n,value:a,subject:e,key:r,managerOptions:c,afterChange:i}){const l=p=>{const d=[p.x,p.y];return p instanceof de.Vector3&&d.push(p.z),d},u=new X.Store(l(E(this,M,ye).call(this,a)),{passport:{name:n,manager:se({type:"number"},c)}});u.subscribe(p=>{E(this,M,be).call(this,e,r,(d,w)=>d[w].set(...p.current)),i==null||i()}),s(this,ne).push(u)},mn=function({name:n,value:a,subject:e,key:r,managerOptions:c,afterChange:i}){const l=new X.Store(E(this,M,ye).call(this,a),{passport:{name:n,manager:se({type:"boolean"},c)}});l.subscribe(u=>{E(this,M,be).call(this,e,r,(p,d)=>p[d]=u.current),i==null||i()}),s(this,ne).push(l)},un=function({name:n,value:a,subject:e,key:r,managerOptions:c,afterChange:i}){const l=new X.Store(`#${E(this,M,ye).call(this,a).getHexString()}`,{passport:{name:n,manager:se({type:"color"},c)}});l.subscribe(u=>{E(this,M,be).call(this,e,r,(p,d)=>p[d]=new de.Color(u.current)),i==null||i()}),s(this,ne).push(l)},_t=function({name:n,value:a,subject:e,key:r,managerOptions:c,afterChange:i}){const l=c==null?void 0:c.variants;if(l){let u=null;for(const d of l)a===de[d]&&(u=d);const p=new X.Store(u||E(this,M,ye).call(this,a),{passport:{name:n,manager:se({},c)}});p.subscribe(d=>{typeof d.current=="string"&&(d.current[0]===d.current[0].toUpperCase()?E(this,M,be).call(this,e,r,(w,L)=>w[L]=de[d.current]):E(this,M,be).call(this,e,r,(w,L)=>w[L]=d.current)),i==null||i()}),s(this,ne).push(p)}},It=function(n){return jn.isObject(n)&&"value"in n},ye=function(n){return E(this,M,It).call(this,n)?n.value:n},be=function(n,a,e){E(this,M,It).call(this,n[a])?e(n[a],"value"):e(n,a)};var g,re,ge,Me,Ee,qe,U,Oe,bt,Ue;class Ot{constructor(n,a){f(this,Oe);f(this,g);f(this,re,[]);f(this,ge);f(this,Me);f(this,Ee);f(this,qe,!0);f(this,U,[]);f(this,Ue,()=>{s(this,U).forEach(n=>{"update"in n&&n.update()})});var l,u;x(this,g,n);let e=!1;n.name.startsWith("T.")&&(n.name=n.name.slice(2)),n.name.includes("P.")&&(e=!0,n.name=n.name.replace("P.",""));const r=n.name;s(this,g).userData.controlled=!0;const c=(a==null?void 0:a.step)||1e-4,i=((l=n.userData)==null?void 0:l.box)||n;if(s(this,g)instanceof t.Light){let p;s(this,g)instanceof t.PointLight?p=new t.PointLightHelper(s(this,g),100):s(this,g)instanceof t.DirectionalLight?(s(this,g).scale.setScalar(100),p=new t.DirectionalLightHelper(s(this,g),1)):s(this,g)instanceof t.SpotLight?p=new t.SpotLightHelper(s(this,g)):s(this,g)instanceof t.HemisphereLight&&(p=new t.HemisphereLightHelper(s(this,g),100)),s(this,U).push(p);const d=(u=s(this,g).shadow)==null?void 0:u.camera;if(d instanceof t.Camera){const w=new t.CameraHelper(d);s(this,U).push(w)}}if(s(this,U).forEach(p=>{y.en3.view.add(p)}),x(this,ge,new X.Store([i.position.x,i.position.y,i.position.z],{passport:{name:`${r}.Transformation.Position`,manager:{type:"number",step:c}}})),x(this,Me,new X.Store([i.rotation.x,i.rotation.y,i.rotation.z],{passport:{name:`${r}.Transformation.Rotation`,manager:{type:"number",step:c,ease:.01}}})),x(this,Ee,new X.Store([i.scale.x,i.scale.y,i.scale.z],{passport:{name:`${r}.Transformation.Scale`,manager:{type:"number",step:c}}})),this.save(),x(this,qe,!1),s(this,ge).subscribe(p=>{E(this,Oe,bt).call(this,"position",p.current)}),s(this,Me).subscribe(p=>{E(this,Oe,bt).call(this,"rotation",p.current)}),s(this,Ee).subscribe(p=>{E(this,Oe,bt).call(this,"scale",p.current)}),e){if(s(this,re).push(new he(s(this,g),{folderName:`${s(this,g).name}.Parameters`,afterChange:s(this,g)instanceof t.Camera?()=>{y.en3.view.resize()}:void 0})),s(this,g)instanceof t.Mesh){const p=s(this,g).material;p instanceof t.Material&&s(this,re).push(new he(p,{folderName:`${s(this,g).name}.Parameters.Material`,afterChange:()=>{p.needsUpdate=!0}}))}else if(s(this,g)instanceof t.Light){const p=s(this,g).shadow;p&&s(this,re).push(new he(p,{folderName:`${s(this,g).name}.Parameters.Shadow`,afterChange:()=>{p.needsUpdate=!0}})),p.camera&&s(this,re).push(new he(p,{folderName:`${s(this,g).name}.Parameters.Shadow.Camera`,afterChange:()=>{p.camera.updateProjectionMatrix()}}))}}s(this,U).length&&Wt.ticker.subscribe(s(this,Ue))}get object3d(){return s(this,g)}get helpers(){return s(this,U)}get raycasterTarget(){return s(this,U)[0]||s(this,g)}destroy(){s(this,re).forEach(n=>n.destroy()),s(this,ge).close(),s(this,Me).close(),s(this,Ee).close(),s(this,g).userData.controlled=!1,s(this,U).forEach(n=>{n&&"dispose"in n&&(n.dispose(),y.en3.view.remove(n))}),Wt.ticker.unsubscribe(s(this,Ue))}save(){const n=(a,e)=>{(!s(this,qe)||a.initial===a.current)&&(a.current=[e.x,e.y,e.z])};n(s(this,ge),s(this,g).position),n(s(this,Me),s(this,g).rotation),n(s(this,Ee),s(this,g).scale)}}g=new WeakMap,re=new WeakMap,ge=new WeakMap,Me=new WeakMap,Ee=new WeakMap,qe=new WeakMap,U=new WeakMap,Oe=new WeakSet,bt=function(n,a){const e=s(this,g).userData.box;if(e){const r=c=>({x:a[0]-c.x,y:a[1]-c.y,z:a[2]-c.z});n==="position"?e.setPositionStep("_manager","+",r(e.getIncludedPositionSteps("_manager"))):n==="rotation"?e.setRotationStep("_manager","+",r(e.getIncludedRotationSteps("_manager"))):n==="scale"&&e.setScaleStep("_manager","+",r(e.getIncludedScaleSteps("_manager")))}else s(this,g)[n].set(...a)},Ue=new WeakMap;const Kt={type:"change"},xt={type:"start"},$t={type:"end"},ut=new t.Ray,Jt=new t.Plane,Bn=Math.cos(70*t.MathUtils.DEG2RAD);class Wn extends t.EventDispatcher{constructor(n,a){super(),this.object=n,this.domElement=a,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new t.Vector3,this.cursor=new t.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:t.MOUSE.ROTATE,MIDDLE:t.MOUSE.DOLLY,RIGHT:t.MOUSE.PAN},this.touches={ONE:t.TOUCH.ROTATE,TWO:t.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 l.phi},this.getAzimuthalAngle=function(){return l.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(o){o.addEventListener("keydown",Et),this._domElementKeyEvents=o},this.stopListenToKeyEvents=function(){this._domElementKeyEvents.removeEventListener("keydown",Et),this._domElementKeyEvents=null},this.saveState=function(){e.target0.copy(e.target),e.position0.copy(e.object.position),e.zoom0=e.object.zoom},this.reset=function(){e.target.copy(e.target0),e.object.position.copy(e.position0),e.object.zoom=e.zoom0,e.object.updateProjectionMatrix(),e.dispatchEvent(Kt),e.update(),c=r.NONE},this.update=function(){const o=new t.Vector3,h=new t.Quaternion().setFromUnitVectors(n.up,new t.Vector3(0,1,0)),b=h.clone().invert(),P=new t.Vector3,N=new t.Quaternion,ie=new t.Vector3,F=2*Math.PI;return function(Ln=null){const Vt=e.object.position;o.copy(Vt).sub(e.target),o.applyQuaternion(h),l.setFromVector3(o),e.autoRotate&&c===r.NONE&&me(gt(Ln)),e.enableDamping?(l.theta+=u.theta*e.dampingFactor,l.phi+=u.phi*e.dampingFactor):(l.theta+=u.theta,l.phi+=u.phi);let J=e.minAzimuthAngle,ee=e.maxAzimuthAngle;isFinite(J)&&isFinite(ee)&&(J<-Math.PI?J+=F:J>Math.PI&&(J-=F),ee<-Math.PI?ee+=F:ee>Math.PI&&(ee-=F),J<=ee?l.theta=Math.max(J,Math.min(ee,l.theta)):l.theta=l.theta>(J+ee)/2?Math.max(J,l.theta):Math.min(ee,l.theta)),l.phi=Math.max(e.minPolarAngle,Math.min(e.maxPolarAngle,l.phi)),l.makeSafe(),e.enableDamping===!0?e.target.addScaledVector(d,e.dampingFactor):e.target.add(d),e.target.sub(e.cursor),e.target.clampLength(e.minTargetRadius,e.maxTargetRadius),e.target.add(e.cursor);let Xe=!1;if(e.zoomToCursor&&ve||e.object.isOrthographicCamera)l.radius=oe(l.radius);else{const te=l.radius;l.radius=oe(l.radius*p),Xe=te!=l.radius}if(o.setFromSpherical(l),o.applyQuaternion(b),Vt.copy(e.target).add(o),e.object.lookAt(e.target),e.enableDamping===!0?(u.theta*=1-e.dampingFactor,u.phi*=1-e.dampingFactor,d.multiplyScalar(1-e.dampingFactor)):(u.set(0,0,0),d.set(0,0,0)),e.zoomToCursor&&ve){let te=null;if(e.object.isPerspectiveCamera){const Ze=o.length();te=oe(Ze*p);const mt=Ze-te;e.object.position.addScaledVector(K,mt),e.object.updateMatrixWorld(),Xe=!!mt}else if(e.object.isOrthographicCamera){const Ze=new t.Vector3(k.x,k.y,0);Ze.unproject(e.object);const mt=e.object.zoom;e.object.zoom=Math.max(e.minZoom,Math.min(e.maxZoom,e.object.zoom/p)),e.object.updateProjectionMatrix(),Xe=mt!==e.object.zoom;const Qt=new t.Vector3(k.x,k.y,0);Qt.unproject(e.object),e.object.position.sub(Qt).add(Ze),e.object.updateMatrixWorld(),te=o.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),e.zoomToCursor=!1;te!==null&&(this.screenSpacePanning?e.target.set(0,0,-1).transformDirection(e.object.matrix).multiplyScalar(te).add(e.object.position):(ut.origin.copy(e.object.position),ut.direction.set(0,0,-1).transformDirection(e.object.matrix),Math.abs(e.object.up.dot(ut.direction))<Bn?n.lookAt(e.target):(Jt.setFromNormalAndCoplanarPoint(e.object.up,e.target),ut.intersectPlane(Jt,e.target))))}else if(e.object.isOrthographicCamera){const te=e.object.zoom;e.object.zoom=Math.max(e.minZoom,Math.min(e.maxZoom,e.object.zoom/p)),te!==e.object.zoom&&(e.object.updateProjectionMatrix(),Xe=!0)}return p=1,ve=!1,Xe||P.distanceToSquared(e.object.position)>i||8*(1-N.dot(e.object.quaternion))>i||ie.distanceToSquared(e.target)>i?(e.dispatchEvent(Kt),P.copy(e.object.position),N.copy(e.object.quaternion),ie.copy(e.target),!0):!1}}(),this.dispose=function(){e.domElement.removeEventListener("contextmenu",Gt),e.domElement.removeEventListener("pointerdown",Yt),e.domElement.removeEventListener("pointercancel",Ne),e.domElement.removeEventListener("wheel",zt),e.domElement.removeEventListener("pointermove",Mt),e.domElement.removeEventListener("pointerup",Ne),e.domElement.getRootNode().removeEventListener("keydown",Nt,{capture:!0}),e._domElementKeyEvents!==null&&(e._domElementKeyEvents.removeEventListener("keydown",Et),e._domElementKeyEvents=null)};const e=this,r={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let c=r.NONE;const i=1e-6,l=new t.Spherical,u=new t.Spherical;let p=1;const d=new t.Vector3,w=new t.Vector2,L=new t.Vector2,W=new t.Vector2,Z=new t.Vector2,O=new t.Vector2,j=new t.Vector2,D=new t.Vector2,T=new t.Vector2,_=new t.Vector2,K=new t.Vector3,k=new t.Vector2;let ve=!1;const I=[],pe={};let ze=!1;function gt(o){return o!==null?2*Math.PI/60*e.autoRotateSpeed*o:2*Math.PI/60/60*e.autoRotateSpeed}function Te(o){const h=Math.abs(o*.01);return Math.pow(.95,e.zoomSpeed*h)}function me(o){u.theta-=o}function _e(o){u.phi-=o}const G=function(){const o=new t.Vector3;return function(b,P){o.setFromMatrixColumn(P,0),o.multiplyScalar(-b),d.add(o)}}(),Y=function(){const o=new t.Vector3;return function(b,P){e.screenSpacePanning===!0?o.setFromMatrixColumn(P,1):(o.setFromMatrixColumn(P,0),o.crossVectors(e.object.up,o)),o.multiplyScalar(b),d.add(o)}}(),q=function(){const o=new t.Vector3;return function(b,P){const N=e.domElement;if(e.object.isPerspectiveCamera){const ie=e.object.position;o.copy(ie).sub(e.target);let F=o.length();F*=Math.tan(e.object.fov/2*Math.PI/180),G(2*b*F/N.clientHeight,e.object.matrix),Y(2*P*F/N.clientHeight,e.object.matrix)}else e.object.isOrthographicCamera?(G(b*(e.object.right-e.object.left)/e.object.zoom/N.clientWidth,e.object.matrix),Y(P*(e.object.top-e.object.bottom)/e.object.zoom/N.clientHeight,e.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),e.enablePan=!1)}}();function z(o){e.object.isPerspectiveCamera||e.object.isOrthographicCamera?p/=o:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),e.enableZoom=!1)}function $(o){e.object.isPerspectiveCamera||e.object.isOrthographicCamera?p*=o:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),e.enableZoom=!1)}function A(o,h){if(!e.zoomToCursor)return;ve=!0;const b=e.domElement.getBoundingClientRect(),P=o-b.left,N=h-b.top,ie=b.width,F=b.height;k.x=P/ie*2-1,k.y=-(N/F)*2+1,K.set(k.x,k.y,1).unproject(e.object).sub(e.object.position).normalize()}function oe(o){return Math.max(e.minDistance,Math.min(e.maxDistance,o))}function ue(o){w.set(o.clientX,o.clientY)}function Ie(o){A(o.clientX,o.clientX),D.set(o.clientX,o.clientY)}function ht(o){Z.set(o.clientX,o.clientY)}function pt(o){L.set(o.clientX,o.clientY),W.subVectors(L,w).multiplyScalar(e.rotateSpeed);const h=e.domElement;me(2*Math.PI*W.x/h.clientHeight),_e(2*Math.PI*W.y/h.clientHeight),w.copy(L),e.update()}function fn(o){T.set(o.clientX,o.clientY),_.subVectors(T,D),_.y>0?z(Te(_.y)):_.y<0&&$(Te(_.y)),D.copy(T),e.update()}function yn(o){O.set(o.clientX,o.clientY),j.subVectors(O,Z).multiplyScalar(e.panSpeed),q(j.x,j.y),Z.copy(O),e.update()}function bn(o){A(o.clientX,o.clientY),o.deltaY<0?$(Te(o.deltaY)):o.deltaY>0&&z(Te(o.deltaY)),e.update()}function wn(o){let h=!1;switch(o.code){case e.keys.UP:o.ctrlKey||o.metaKey||o.shiftKey?_e(2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):q(0,e.keyPanSpeed),h=!0;break;case e.keys.BOTTOM:o.ctrlKey||o.metaKey||o.shiftKey?_e(-2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):q(0,-e.keyPanSpeed),h=!0;break;case e.keys.LEFT:o.ctrlKey||o.metaKey||o.shiftKey?me(2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):q(e.keyPanSpeed,0),h=!0;break;case e.keys.RIGHT:o.ctrlKey||o.metaKey||o.shiftKey?me(-2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):q(-e.keyPanSpeed,0),h=!0;break}h&&(o.preventDefault(),e.update())}function Dt(o){if(I.length===1)w.set(o.pageX,o.pageY);else{const h=Ae(o),b=.5*(o.pageX+h.x),P=.5*(o.pageY+h.y);w.set(b,P)}}function Ct(o){if(I.length===1)Z.set(o.pageX,o.pageY);else{const h=Ae(o),b=.5*(o.pageX+h.x),P=.5*(o.pageY+h.y);Z.set(b,P)}}function jt(o){const h=Ae(o),b=o.pageX-h.x,P=o.pageY-h.y,N=Math.sqrt(b*b+P*P);D.set(0,N)}function gn(o){e.enableZoom&&jt(o),e.enablePan&&Ct(o)}function Mn(o){e.enableZoom&&jt(o),e.enableRotate&&Dt(o)}function kt(o){if(I.length==1)L.set(o.pageX,o.pageY);else{const b=Ae(o),P=.5*(o.pageX+b.x),N=.5*(o.pageY+b.y);L.set(P,N)}W.subVectors(L,w).multiplyScalar(e.rotateSpeed);const h=e.domElement;me(2*Math.PI*W.x/h.clientHeight),_e(2*Math.PI*W.y/h.clientHeight),w.copy(L)}function Rt(o){if(I.length===1)O.set(o.pageX,o.pageY);else{const h=Ae(o),b=.5*(o.pageX+h.x),P=.5*(o.pageY+h.y);O.set(b,P)}j.subVectors(O,Z).multiplyScalar(e.panSpeed),q(j.x,j.y),Z.copy(O)}function Ht(o){const h=Ae(o),b=o.pageX-h.x,P=o.pageY-h.y,N=Math.sqrt(b*b+P*P);T.set(0,N),_.set(0,Math.pow(T.y/D.y,e.zoomSpeed)),z(_.y),D.copy(T);const ie=(o.pageX+h.x)*.5,F=(o.pageY+h.y)*.5;A(ie,F)}function En(o){e.enableZoom&&Ht(o),e.enablePan&&Rt(o)}function Sn(o){e.enableZoom&&Ht(o),e.enableRotate&&kt(o)}function Yt(o){e.enabled!==!1&&(I.length===0&&(e.domElement.setPointerCapture(o.pointerId),e.domElement.addEventListener("pointermove",Mt),e.domElement.addEventListener("pointerup",Ne)),!An(o)&&(_n(o),o.pointerType==="touch"?Zt(o):Pn(o)))}function Mt(o){e.enabled!==!1&&(o.pointerType==="touch"?Tn(o):xn(o))}function Ne(o){switch(In(o),I.length){case 0:e.domElement.releasePointerCapture(o.pointerId),e.domElement.removeEventListener("pointermove",Mt),e.domElement.removeEventListener("pointerup",Ne),e.dispatchEvent($t),c=r.NONE;break;case 1:const h=I[0],b=pe[h];Zt({pointerId:h,pageX:b.x,pageY:b.y});break}}function Pn(o){let h;switch(o.button){case 0:h=e.mouseButtons.LEFT;break;case 1:h=e.mouseButtons.MIDDLE;break;case 2:h=e.mouseButtons.RIGHT;break;default:h=-1}switch(h){case t.MOUSE.DOLLY:if(e.enableZoom===!1)return;Ie(o),c=r.DOLLY;break;case t.MOUSE.ROTATE:if(o.ctrlKey||o.metaKey||o.shiftKey){if(e.enablePan===!1)return;ht(o),c=r.PAN}else{if(e.enableRotate===!1)return;ue(o),c=r.ROTATE}break;case t.MOUSE.PAN:if(o.ctrlKey||o.metaKey||o.shiftKey){if(e.enableRotate===!1)return;ue(o),c=r.ROTATE}else{if(e.enablePan===!1)return;ht(o),c=r.PAN}break;default:c=r.NONE}c!==r.NONE&&e.dispatchEvent(xt)}function xn(o){switch(c){case r.ROTATE:if(e.enableRotate===!1)return;pt(o);break;case r.DOLLY:if(e.enableZoom===!1)return;fn(o);break;case r.PAN:if(e.enablePan===!1)return;yn(o);break}}function zt(o){e.enabled===!1||e.enableZoom===!1||c!==r.NONE||(o.preventDefault(),e.dispatchEvent(xt),bn(vn(o)),e.dispatchEvent($t))}function vn(o){const h=o.deltaMode,b={clientX:o.clientX,clientY:o.clientY,deltaY:o.deltaY};switch(h){case 1:b.deltaY*=16;break;case 2:b.deltaY*=100;break}return o.ctrlKey&&!ze&&(b.deltaY*=10),b}function Nt(o){o.key==="Control"&&(ze=!0,e.domElement.getRootNode().addEventListener("keyup",Xt,{passive:!0,capture:!0}))}function Xt(o){o.key==="Control"&&(ze=!1,e.domElement.getRootNode().removeEventListener("keyup",Xt,{passive:!0,capture:!0}))}function Et(o){e.enabled===!1||e.enablePan===!1||wn(o)}function Zt(o){switch(Ft(o),I.length){case 1:switch(e.touches.ONE){case t.TOUCH.ROTATE:if(e.enableRotate===!1)return;Dt(o),c=r.TOUCH_ROTATE;break;case t.TOUCH.PAN:if(e.enablePan===!1)return;Ct(o),c=r.TOUCH_PAN;break;default:c=r.NONE}break;case 2:switch(e.touches.TWO){case t.TOUCH.DOLLY_PAN:if(e.enableZoom===!1&&e.enablePan===!1)return;gn(o),c=r.TOUCH_DOLLY_PAN;break;case t.TOUCH.DOLLY_ROTATE:if(e.enableZoom===!1&&e.enableRotate===!1)return;Mn(o),c=r.TOUCH_DOLLY_ROTATE;break;default:c=r.NONE}break;default:c=r.NONE}c!==r.NONE&&e.dispatchEvent(xt)}function Tn(o){switch(Ft(o),c){case r.TOUCH_ROTATE:if(e.enableRotate===!1)return;kt(o),e.update();break;case r.TOUCH_PAN:if(e.enablePan===!1)return;Rt(o),e.update();break;case r.TOUCH_DOLLY_PAN:if(e.enableZoom===!1&&e.enablePan===!1)return;En(o),e.update();break;case r.TOUCH_DOLLY_ROTATE:if(e.enableZoom===!1&&e.enableRotate===!1)return;Sn(o),e.update();break;default:c=r.NONE}}function Gt(o){e.enabled!==!1&&o.preventDefault()}function _n(o){I.push(o.pointerId)}function In(o){delete pe[o.pointerId];for(let h=0;h<I.length;h++)if(I[h]==o.pointerId){I.splice(h,1);return}}function An(o){for(let h=0;h<I.length;h++)if(I[h]==o.pointerId)return!0;return!1}function Ft(o){let h=pe[o.pointerId];h===void 0&&(h=new t.Vector2,pe[o.pointerId]=h),h.set(o.pageX,o.pageY)}function Ae(o){const h=o.pointerId===I[0]?I[1]:I[0];return pe[h]}e.domElement.addEventListener("contextmenu",Gt),e.domElement.addEventListener("pointerdown",Yt),e.domElement.addEventListener("pointercancel",Ne),e.domElement.addEventListener("wheel",zt,{passive:!1}),e.domElement.getRootNode().addEventListener("keydown",Nt,{passive:!0,capture:!0}),this.update()}}const fe=new t.Raycaster,H=new t.Vector3,ae=new t.Vector3,v=new t.Quaternion,en={X:new t.Vector3(1,0,0),Y:new t.Vector3(0,1,0),Z:new t.Vector3(0,0,1)},vt={type:"change"},tn={type:"mouseDown",mode:null},nn={type:"mouseUp",mode:null},on={type:"objectChange"};class Kn extends t.Object3D{constructor(n,a){super(),a===void 0&&(console.warn('THREE.TransformControls: The second parameter "domElement" is now mandatory.'),a=document),this.isTransformControls=!0,this.visible=!1,this.domElement=a,this.domElement.style.touchAction="none";const e=new oo;this._gizmo=e,this.add(e);const r=new io;this._plane=r,this.add(r);const c=this;function i(T,_){let K=_;Object.defineProperty(c,T,{get:function(){return K!==void 0?K:_},set:function(k){K!==k&&(K=k,r[T]=k,e[T]=k,c.dispatchEvent({type:T+"-changed",value:k}),c.dispatchEvent(vt))}}),c[T]=_,r[T]=_,e[T]=_}i("camera",n),i("object",void 0),i("enabled",!0),i("axis",null),i("mode","translate"),i("translationSnap",null),i("rotationSnap",null),i("scaleSnap",null),i("space","world"),i("size",1),i("dragging",!1),i("showX",!0),i("showY",!0),i("showZ",!0);const l=new t.Vector3,u=new t.Vector3,p=new t.Quaternion,d=new t.Quaternion,w=new t.Vector3,L=new t.Quaternion,W=new t.Vector3,Z=new t.Vector3,O=new t.Vector3,j=0,D=new t.Vector3;i("worldPosition",l),i("worldPositionStart",u),i("worldQuaternion",p),i("worldQuaternionStart",d),i("cameraPosition",w),i("cameraQuaternion",L),i("pointStart",W),i("pointEnd",Z),i("rotationAxis",O),i("rotationAngle",j),i("eye",D),this._offset=new t.Vector3,this._startNorm=new t.Vector3,this._endNorm=new t.Vector3,this._cameraScale=new t.Vector3,this._parentPosition=new t.Vector3,this._parentQuaternion=new t.Quaternion,this._parentQuaternionInv=new t.Quaternion,this._parentScale=new t.Vector3,this._worldScaleStart=new t.Vector3,this._worldQuaternionInv=new t.Quaternion,this._worldScale=new t.Vector3,this._positionStart=new t.Vector3,this._quaternionStart=new t.Quaternion,this._scaleStart=new t.Vector3,this._getPointer=$n.bind(this),this._onPointerDown=eo.bind(this),this._onPointerHover=Jn.bind(this),this._onPointerMove=to.bind(this),this._onPointerUp=no.bind(this),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointermove",this._onPointerHover),this.domElement.addEventListener("pointerup",this._onPointerUp)}updateMatrixWorld(n){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(n)}pointerHover(n){if(this.object===void 0||this.dragging===!0)return;n!==null&&fe.setFromCamera(n,this.camera);const a=Tt(this._gizmo.picker[this.mode],fe);a?this.axis=a.object.name:this.axis=null}pointerDown(n){if(!(this.object===void 0||this.dragging===!0||n!=null&&n.button!==0)&&this.axis!==null){n!==null&&fe.setFromCamera(n,this.camera);const a=Tt(this._plane,fe,!0);a&&(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(a.point).sub(this.worldPositionStart)),this.dragging=!0,tn.mode=this.mode,this.dispatchEvent(tn)}}pointerMove(n){const a=this.axis,e=this.mode,r=this.object;let c=this.space;if(e==="scale"?c="local":(a==="E"||a==="XYZE"||a==="XYZ")&&(c="world"),r===void 0||a===null||this.dragging===!1||n!==null&&n.button!==-1)return;n!==null&&fe.setFromCamera(n,this.camera);const i=Tt(this._plane,fe,!0);if(i){if(this.pointEnd.copy(i.point).sub(this.worldPositionStart),e==="translate")this._offset.copy(this.pointEnd).sub(this.pointStart),c==="local"&&a!=="XYZ"&&this._offset.applyQuaternion(this._worldQuaternionInv),a.indexOf("X")===-1&&(this._offset.x=0),a.indexOf("Y")===-1&&(this._offset.y=0),a.indexOf("Z")===-1&&(this._offset.z=0),c==="local"&&a!=="XYZ"?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),r.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(c==="local"&&(r.position.applyQuaternion(v.copy(this._quaternionStart).invert()),a.search("X")!==-1&&(r.position.x=Math.round(r.position.x/this.translationSnap)*this.translationSnap),a.search("Y")!==-1&&(r.position.y=Math.round(r.position.y/this.translationSnap)*this.translationSnap),a.search("Z")!==-1&&(r.position.z=Math.round(r.position.z/this.translationSnap)*this.translationSnap),r.position.applyQuaternion(this._quaternionStart)),c==="world"&&(r.parent&&r.position.add(H.setFromMatrixPosition(r.parent.matrixWorld)),a.search("X")!==-1&&(r.position.x=Math.round(r.position.x/this.translationSnap)*this.translationSnap),a.search("Y")!==-1&&(r.position.y=Math.round(r.position.y/this.translationSnap)*this.translationSnap),a.search("Z")!==-1&&(r.position.z=Math.round(r.position.z/this.translationSnap)*this.translationSnap),r.parent&&r.position.sub(H.setFromMatrixPosition(r.parent.matrixWorld))));else if(e==="scale"){if(a.search("XYZ")!==-1){let l=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(l*=-1),ae.set(l,l,l)}else H.copy(this.pointStart),ae.copy(this.pointEnd),H.applyQuaternion(this._worldQuaternionInv),ae.applyQuaternion(this._worldQuaternionInv),ae.divide(H),a.search("X")===-1&&(ae.x=1),a.search("Y")===-1&&(ae.y=1),a.search("Z")===-1&&(ae.z=1);r.scale.copy(this._scaleStart).multiply(ae),this.scaleSnap&&(a.search("X")!==-1&&(r.scale.x=Math.round(r.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),a.search("Y")!==-1&&(r.scale.y=Math.round(r.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),a.search("Z")!==-1&&(r.scale.z=Math.round(r.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(e==="rotate"){this._offset.copy(this.pointEnd).sub(this.pointStart);const l=20/this.worldPosition.distanceTo(H.setFromMatrixPosition(this.camera.matrixWorld));let u=!1;a==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(H.copy(this.rotationAxis).cross(this.eye))*l):(a==="X"||a==="Y"||a==="Z")&&(this.rotationAxis.copy(en[a]),H.copy(en[a]),c==="local"&&H.applyQuaternion(this.worldQuaternion),H.cross(this.eye),H.length()===0?u=!0:this.rotationAngle=this._offset.dot(H.normalize())*l),(a==="E"||u)&&(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),c==="local"&&a!=="E"&&a!=="XYZE"?(r.quaternion.copy(this._quaternionStart),r.quaternion.multiply(v.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),r.quaternion.copy(v.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),r.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(vt),this.dispatchEvent(on)}}pointerUp(n){n!==null&&n.button!==0||(this.dragging&&this.axis!==null&&(nn.mode=this.mode,this.dispatchEvent(nn)),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(n){n.geometry&&n.geometry.dispose(),n.material&&n.material.dispose()})}attach(n){return this.object=n,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(vt),this.dispatchEvent(on),this.pointStart.copy(this.pointEnd))}getRaycaster(){return fe}getMode(){return this.mode}setMode(n){this.mode=n}setTranslationSnap(n){this.translationSnap=n}setRotationSnap(n){this.rotationSnap=n}setScaleSnap(n){this.scaleSnap=n}setSize(n){this.size=n}setSpace(n){this.space=n}}function $n(m){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:m.button};{const n=this.domElement.getBoundingClientRect();return{x:(m.clientX-n.left)/n.width*2-1,y:-(m.clientY-n.top)/n.height*2+1,button:m.button}}}function Jn(m){if(this.enabled)switch(m.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(m));break}}function eo(m){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(m.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(m)),this.pointerDown(this._getPointer(m)))}function to(m){this.enabled&&this.pointerMove(this._getPointer(m))}function no(m){this.enabled&&(this.domElement.releasePointerCapture(m.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(m)))}function Tt(m,n,a){const e=n.intersectObject(m,!0);for(let r=0;r<e.length;r++)if(e[r].object.visible||a)return e[r];return!1}const dt=new t.Euler,S=new t.Vector3(0,1,0),sn=new t.Vector3(0,0,0),an=new t.Matrix4,ft=new t.Quaternion,wt=new t.Quaternion,B=new t.Vector3,rn=new t.Matrix4,Ve=new t.Vector3(1,0,0),we=new t.Vector3(0,1,0),Qe=new t.Vector3(0,0,1),yt=new t.Vector3,Ge=new t.Vector3,Fe=new t.Vector3;class oo extends t.Object3D{constructor(){super(),this.isTransformControlsGizmo=!0,this.type="TransformControlsGizmo";const n=new t.MeshBasicMaterial({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),a=new t.LineBasicMaterial({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),e=n.clone();e.opacity=.15;const r=a.clone();r.opacity=.5;const c=n.clone();c.color.setHex(16711680);const i=n.clone();i.color.setHex(65280);const l=n.clone();l.color.setHex(255);const u=n.clone();u.color.setHex(16711680),u.opacity=.5;const p=n.clone();p.color.setHex(65280),p.opacity=.5;const d=n.clone();d.color.setHex(255),d.opacity=.5;const w=n.clone();w.opacity=.25;const L=n.clone();L.color.setHex(16776960),L.opacity=.25,n.clone().color.setHex(16776960);const Z=n.clone();Z.color.setHex(7895160);const O=new t.CylinderGeometry(0,.04,.1,12);O.translate(0,.05,0);const j=new t.BoxGeometry(.08,.08,.08);j.translate(0,.04,0);const D=new t.BufferGeometry;D.setAttribute("position",new t.Float32BufferAttribute([0,0,0,1,0,0],3));const T=new t.CylinderGeometry(.0075,.0075,.5,3);T.translate(0,.25,0);function _(Y,q){const z=new t.TorusGeometry(Y,.0075,3,64,q*Math.PI*2);return z.rotateY(Math.PI/2),z.rotateX(Math.PI/2),z}function K(){const Y=new t.BufferGeometry;return Y.setAttribute("position",new t.Float32BufferAttribute([0,0,0,1,1,1],3)),Y}const k={X:[[new t.Mesh(O,c),[.5,0,0],[0,0,-Math.PI/2]],[new t.Mesh(O,c),[-.5,0,0],[0,0,Math.PI/2]],[new t.Mesh(T,c),[0,0,0],[0,0,-Math.PI/2]]],Y:[[new t.Mesh(O,i),[0,.5,0]],[new t.Mesh(O,i),[0,-.5,0],[Math.PI,0,0]],[new t.Mesh(T,i)]],Z:[[new t.Mesh(O,l),[0,0,.5],[Math.PI/2,0,0]],[new t.Mesh(O,l),[0,0,-.5],[-Math.PI/2,0,0]],[new t.Mesh(T,l),null,[Math.PI/2,0,0]]],XYZ:[[new t.Mesh(new t.OctahedronGeometry(.1,0),w.clone()),[0,0,0]]],XY:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),d.clone()),[.15,.15,0]]],YZ:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),u.clone()),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),p.clone()),[.15,0,.15],[-Math.PI/2,0,0]]]},ve={X:[[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),e),[.3,0,0],[0,0,-Math.PI/2]],[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),e),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),e),[0,.3,0]],[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),e),[0,-.3,0],[0,0,Math.PI]]],Z:[[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),e),[0,0,.3],[Math.PI/2,0,0]],[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),e),[0,0,-.3],[-Math.PI/2,0,0]]],XYZ:[[new t.Mesh(new t.OctahedronGeometry(.2,0),e)]],XY:[[new t.Mesh(new t.BoxGeometry(.2,.2,.01),e),[.15,.15,0]]],YZ:[[new t.Mesh(new t.BoxGeometry(.2,.2,.01),e),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new t.Mesh(new t.BoxGeometry(.2,.2,.01),e),[.15,0,.15],[-Math.PI/2,0,0]]]},I={START:[[new t.Mesh(new t.OctahedronGeometry(.01,2),r),null,null,null,"helper"]],END:[[new t.Mesh(new t.OctahedronGeometry(.01,2),r),null,null,null,"helper"]],DELTA:[[new t.Line(K(),r),null,null,null,"helper"]],X:[[new t.Line(D,r.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new t.Line(D,r.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new t.Line(D,r.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},pe={XYZE:[[new t.Mesh(_(.5,1),Z),null,[0,Math.PI/2,0]]],X:[[new t.Mesh(_(.5,.5),c)]],Y:[[new t.Mesh(_(.5,.5),i),null,[0,0,-Math.PI/2]]],Z:[[new t.Mesh(_(.5,.5),l),null,[0,Math.PI/2,0]]],E:[[new t.Mesh(_(.75,1),L),null,[0,Math.PI/2,0]]]},ze={AXIS:[[new t.Line(D,r.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]]},gt={XYZE:[[new t.Mesh(new t.SphereGeometry(.25,10,8),e)]],X:[[new t.Mesh(new t.TorusGeometry(.5,.1,4,24),e),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new t.Mesh(new t.TorusGeometry(.5,.1,4,24),e),[0,0,0],[Math.PI/2,0,0]]],Z:[[new t.Mesh(new t.TorusGeometry(.5,.1,4,24),e),[0,0,0],[0,0,-Math.PI/2]]],E:[[new t.Mesh(new t.TorusGeometry(.75,.1,2,24),e)]]},Te={X:[[new t.Mesh(j,c),[.5,0,0],[0,0,-Math.PI/2]],[new t.Mesh(T,c),[0,0,0],[0,0,-Math.PI/2]],[new t.Mesh(j,c),[-.5,0,0],[0,0,Math.PI/2]]],Y:[[new t.Mesh(j,i),[0,.5,0]],[new t.Mesh(T,i)],[new t.Mesh(j,i),[0,-.5,0],[0,0,Math.PI]]],Z:[[new t.Mesh(j,l),[0,0,.5],[Math.PI/2,0,0]],[new t.Mesh(T,l),[0,0,0],[Math.PI/2,0,0]],[new t.Mesh(j,l),[0,0,-.5],[-Math.PI/2,0,0]]],XY:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),d),[.15,.15,0]]],YZ:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),u),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),p),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new t.Mesh(new t.BoxGeometry(.1,.1,.1),w.clone())]]},me={X:[[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),e),[.3,0,0],[0,0,-Math.PI/2]],[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),e),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),e),[0,.3,0]],[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),e),[0,-.3,0],[0,0,Math.PI]]],Z:[[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),e),[0,0,.3],[Math.PI/2,0,0]],[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),e),[0,0,-.3],[-Math.PI/2,0,0]]],XY:[[new t.Mesh(new t.BoxGeometry(.2,.2,.01),e),[.15,.15,0]]],YZ:[[new t.Mesh(new t.BoxGeometry(.2,.2,.01),e),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new t.Mesh(new t.BoxGeometry(.2,.2,.01),e),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new t.Mesh(new t.BoxGeometry(.2,.2,.2),e),[0,0,0]]]},_e={X:[[new t.Line(D,r.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new t.Line(D,r.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new t.Line(D,r.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]};function G(Y){const q=new t.Object3D;for(const z in Y)for(let $=Y[z].length;$--;){const A=Y[z][$][0].clone(),oe=Y[z][$][1],ue=Y[z][$][2],Ie=Y[z][$][3],ht=Y[z][$][4];A.name=z,A.tag=ht,oe&&A.position.set(oe[0],oe[1],oe[2]),ue&&A.rotation.set(ue[0],ue[1],ue[2]),Ie&&A.scale.set(Ie[0],Ie[1],Ie[2]),A.updateMatrix();const pt=A.geometry.clone();pt.applyMatrix4(A.matrix),A.geometry=pt,A.renderOrder=1/0,A.position.set(0,0,0),A.rotation.set(0,0,0),A.scale.set(1,1,1),q.add(A)}return q}this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=G(k)),this.add(this.gizmo.rotate=G(pe)),this.add(this.gizmo.scale=G(Te)),this.add(this.picker.translate=G(ve)),this.add(this.picker.rotate=G(gt)),this.add(this.picker.scale=G(me)),this.add(this.helper.translate=G(I)),this.add(this.helper.rotate=G(ze)),this.add(this.helper.scale=G(_e)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}updateMatrixWorld(n){const e=(this.mode==="scale"?"local":this.space)==="local"?this.worldQuaternion:wt;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 r=[];r=r.concat(this.picker[this.mode].children),r=r.concat(this.gizmo[this.mode].children),r=r.concat(this.helper[this.mode].children);for(let c=0;c<r.length;c++){const i=r[c];i.visible=!0,i.rotation.set(0,0,0),i.position.copy(this.worldPosition);let l;if(this.camera.isOrthographicCamera?l=(this.camera.top-this.camera.bottom)/this.camera.zoom:l=this.worldPosition.distanceTo(this.cameraPosition)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),i.scale.set(1,1,1).multiplyScalar(l*this.size/4),i.tag==="helper"){i.visible=!1,i.name==="AXIS"?(i.visible=!!this.axis,this.axis==="X"&&(v.setFromEuler(dt.set(0,0,0)),i.quaternion.copy(e).multiply(v),Math.abs(S.copy(Ve).applyQuaternion(e).dot(this.eye))>.9&&(i.visible=!1)),this.axis==="Y"&&(v.setFromEuler(dt.set(0,0,Math.PI/2)),i.quaternion.copy(e).multiply(v),Math.abs(S.copy(we).applyQuaternion(e).dot(this.eye))>.9&&(i.visible=!1)),this.axis==="Z"&&(v.setFromEuler(dt.set(0,Math.PI/2,0)),i.quaternion.copy(e).multiply(v),Math.abs(S.copy(Qe).applyQuaternion(e).dot(this.eye))>.9&&(i.visible=!1)),this.axis==="XYZE"&&(v.setFromEuler(dt.set(0,Math.PI/2,0)),S.copy(this.rotationAxis),i.quaternion.setFromRotationMatrix(an.lookAt(sn,S,we)),i.quaternion.multiply(v),i.visible=this.dragging),this.axis==="E"&&(i.visible=!1)):i.name==="START"?(i.position.copy(this.worldPositionStart),i.visible=this.dragging):i.name==="END"?(i.position.copy(this.worldPosition),i.visible=this.dragging):i.name==="DELTA"?(i.position.copy(this.worldPositionStart),i.quaternion.copy(this.worldQuaternionStart),H.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),H.applyQuaternion(this.worldQuaternionStart.clone().invert()),i.scale.copy(H),i.visible=this.dragging):(i.quaternion.copy(e),this.dragging?i.position.copy(this.worldPositionStart):i.position.copy(this.worldPosition),this.axis&&(i.visible=this.axis.search(i.name)!==-1));continue}i.quaternion.copy(e),this.mode==="translate"||this.mode==="scale"?(i.name==="X"&&Math.abs(S.copy(Ve).applyQuaternion(e).dot(this.eye))>.99&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),i.name==="Y"&&Math.abs(S.copy(we).applyQuaternion(e).dot(this.eye))>.99&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),i.name==="Z"&&Math.abs(S.copy(Qe).applyQuaternion(e).dot(this.eye))>.99&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),i.name==="XY"&&Math.abs(S.copy(Qe).applyQuaternion(e).dot(this.eye))<.2&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),i.name==="YZ"&&Math.abs(S.copy(Ve).applyQuaternion(e).dot(this.eye))<.2&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),i.name==="XZ"&&Math.abs(S.copy(we).applyQuaternion(e).dot(this.eye))<.2&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1)):this.mode==="rotate"&&(ft.copy(e),S.copy(this.eye).applyQuaternion(v.copy(e).invert()),i.name.search("E")!==-1&&i.quaternion.setFromRotationMatrix(an.lookAt(this.eye,sn,we)),i.name==="X"&&(v.setFromAxisAngle(Ve,Math.atan2(-S.y,S.z)),v.multiplyQuaternions(ft,v),i.quaternion.copy(v)),i.name==="Y"&&(v.setFromAxisAngle(we,Math.atan2(S.x,S.z)),v.multiplyQuaternions(ft,v),i.quaternion.copy(v)),i.name==="Z"&&(v.setFromAxisAngle(Qe,Math.atan2(S.y,S.x)),v.multiplyQuaternions(ft,v),i.quaternion.copy(v))),i.visible=i.visible&&(i.name.indexOf("X")===-1||this.showX),i.visible=i.visible&&(i.name.indexOf("Y")===-1||this.showY),i.visible=i.visible&&(i.name.indexOf("Z")===-1||this.showZ),i.visible=i.visible&&(i.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),i.material._color=i.material._color||i.material.color.clone(),i.material._opacity=i.material._opacity||i.material.opacity,i.material.color.copy(i.material._color),i.material.opacity=i.material._opacity,this.enabled&&this.axis&&(i.name===this.axis||this.axis.split("").some(function(u){return i.name===u}))&&(i.material.color.setHex(16776960),i.material.opacity=1)}super.updateMatrixWorld(n)}}class io extends t.Mesh{constructor(){super(new t.PlaneGeometry(1e5,1e5,2,2),new t.MeshBasicMaterial({visible:!1,wireframe:!0,side:t.DoubleSide,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(n){let a=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(a="local"),yt.copy(Ve).applyQuaternion(a==="local"?this.worldQuaternion:wt),Ge.copy(we).applyQuaternion(a==="local"?this.worldQuaternion:wt),Fe.copy(Qe).applyQuaternion(a==="local"?this.worldQuaternion:wt),S.copy(Ge),this.mode){case"translate":case"scale":switch(this.axis){case"X":S.copy(this.eye).cross(yt),B.copy(yt).cross(S);break;case"Y":S.copy(this.eye).cross(Ge),B.copy(Ge).cross(S);break;case"Z":S.copy(this.eye).cross(Fe),B.copy(Fe).cross(S);break;case"XY":B.copy(Fe);break;case"YZ":B.copy(yt);break;case"XZ":S.copy(Fe),B.copy(Ge);break;case"XYZ":case"E":B.set(0,0,0);break}break;case"rotate":default:B.set(0,0,0)}B.length()===0?this.quaternion.copy(this.cameraQuaternion):(rn.lookAt(H.set(0,0,0),B,S),this.quaternion.setFromRotationMatrix(rn)),super.updateMatrixWorld(n)}}var V,Se;class so{constructor(){f(this,V);f(this,Se);x(this,V,new Wn(y.en3.camera,y.en3.webglRenderer.domElement)),x(this,Se,new X.Store([0,0,0],{passport:{name:"Controls.OrbitControls.Target",manager:{type:"number",invisible:!0}}}));let n=!0;s(this,Se).subscribe(a=>{s(this,V).target.set(...a.current),n&&s(this,V).update()}),s(this,V).addEventListener("change",()=>{n=!1,s(this,Se).current=[s(this,V).target.x,s(this,V).target.y,s(this,V).target.z],n=!0})}get controls(){return s(this,V)}destroy(){s(this,V).dispose(),s(this,Se).close()}}V=new WeakMap,Se=new WeakMap;var R,Be,We,Ke,$e,Je,et,tt,nt;class ao{constructor(){f(this,R,null);f(this,Be,new X.Store(y.en3.camera.far,{passport:{name:"Helpers.Grid.Size",manager:{type:"number",step:1}}}));f(this,We,new X.Store(100,{passport:{name:"Helpers.Grid.Divisions",manager:{type:"number"}}}));f(this,Ke,new X.Store("#0000ff",{passport:{name:"Helpers.Grid.Color 1",manager:{type:"color"}}}));f(this,$e,new X.Store("#808080",{passport:{name:"Helpers.Grid.Color 2",manager:{type:"color"}}}));f(this,Je,new X.Store(!1,{passport:{name:"Helpers.Grid.Vertical",manager:{type:"boolean"}}}));f(this,et,new X.Store(!0,{passport:{name:"Helpers.Grid.Visible",manager:{type:"boolean"}}}));f(this,tt);f(this,nt,n=>{n.key==="g"&&(s(this,R).visible=!s(this,R).visible)});x(this,tt,new kn.Composed([s(this,Be),s(this,We),s(this,Ke),s(this,$e),s(this,Je),s(this,et)],()=>{s(this,R)&&(y.en3.view.remove(s(this,R)),s(this,R).dispose()),x(this,R,new t.GridHelper(s(this,Be).current,s(this,We).current,s(this,Ke).current,s(this,$e).current)),s(this,R).rotation.x=s(this,Je).current?Math.PI/2:0,s(this,R).visible=s(this,et).current,y.en3.view.add(s(this,R))})),addEventListener("keydown",s(this,nt))}get helper(){return s(this,R)}destroy(){s(this,tt).close(),s(this,R)&&(y.en3.view.remove(s(this,R)),s(this,R).dispose()),removeEventListener("keydown",s(this,nt))}}R=new WeakMap,Be=new WeakMap,We=new WeakMap,Ke=new WeakMap,$e=new WeakMap,Je=new WeakMap,et=new WeakMap,tt=new WeakMap,nt=new WeakMap;var C,Q,ce,le,ot,De,it,st,At;class ro{constructor(){f(this,st);f(this,C);f(this,Q,[]);f(this,ce,null);f(this,le,n=>{if(n.child.name.startsWith("T.")&&!s(this,Q).find(a=>a.object3d===n.child)){const a=new Ot(n.child);s(this,Q).push(a),y.en3.raycaster.add(a.raycasterTarget,{eventDispatcher:a.raycasterTarget}),a.raycasterTarget.addEventListener("pointerDown",s(this,De)),a.object3d.addEventListener("childadded",s(this,le))}});f(this,ot,n=>{const a=E(this,st,At).call(this,n.child);a&&(y.en3.raycaster.remove(a.raycasterTarget),a.destroy(),a.raycasterTarget.removeEventListener("pointerDown",s(this,De)),a.object3d.removeEventListener("childadded",s(this,le)),x(this,Q,s(this,Q).filter(e=>e!==a)))});f(this,De,n=>{const a=E(this,st,At).call(this,n.target);a&&(x(this,ce,s(this,Q).find(e=>e.object3d===(a==null?void 0:a.object3d))||null),s(this,ce)&&s(this,C).attach(s(this,ce).object3d))});f(this,it,n=>{n.key==="t"?s(this,C).setMode("translate"):n.key==="r"?s(this,C).setMode("rotate"):n.key==="s"?s(this,C).setMode("scale"):n.key==="Escape"?s(this,C).detach():n.key==="+"||n.key==="="?s(this,C).setSize(s(this,C).size+.1):n.key==="-"||n.key==="_"?s(this,C).setSize(s(this,C).size-.1):n.key==="h"&&s(this,Q).forEach(a=>{a.helpers.forEach(e=>{e.visible=!e.visible})})});x(this,C,new Kn(y.en3.camera,y.en3.webglRenderer.domElement)),s(this,C).addEventListener("objectChange",n=>{s(this,ce)&&s(this,ce).save()}),y.en3.view.add(s(this,C)),y.en3.scene.addEventListener("childadded",s(this,le)),y.en3.scene.addEventListener("childremoved",s(this,ot)),window.addEventListener("keydown",s(this,it))}get controls(){return s(this,C)}destroy(){y.en3.scene.removeEventListener("childadded",s(this,le)),y.en3.scene.removeEventListener("childremoved",s(this,ot)),window.removeEventListener("keydown",s(this,it)),s(this,C).dispose(),s(this,Q).forEach(n=>{n.raycasterTarget.removeEventListener("pointerDown",s(this,De)),n.object3d.removeEventListener("childadded",s(this,le)),n.destroy()}),x(this,Q,[])}}C=new WeakMap,Q=new WeakMap,ce=new WeakMap,le=new WeakMap,ot=new WeakMap,De=new WeakMap,it=new WeakMap,st=new WeakSet,At=function(n){return s(this,Q).find(e=>e.object3d===n||e.raycasterTarget===n)};var Ce,je,ke,Re,xe,Lt,dn;class co{constructor(){f(this,xe);f(this,Ce);f(this,je);f(this,ke);f(this,Re,[]);x(this,Ce,y.en3.composer.addPass=y.en3.composer.addPass.bind(y.en3.composer)),y.en3.composer.addPass=(...n)=>{E(this,xe,Lt).call(this,n[0]),s(this,Ce).call(this,...n)},x(this,je,y.en3.composer.removePass=y.en3.composer.removePass.bind(y.en3.composer)),y.en3.composer.removePass=(...n)=>{E(this,xe,dn).call(this,n[0]),s(this,je).call(this,...n)},x(this,ke,y.en3.composer.insertPass=y.en3.composer.insertPass.bind(y.en3.composer)),y.en3.composer.insertPass=(...n)=>{E(this,xe,Lt).call(this,n[0]),s(this,ke).call(this,...n)}}destroy(){y.en3.composer.addPass=s(this,Ce),y.en3.composer.removePass=s(this,je),y.en3.composer.insertPass=s(this,ke),s(this,Re).forEach(n=>{n.destroy()})}}Ce=new WeakMap,je=new WeakMap,ke=new WeakMap,Re=new WeakMap,xe=new WeakSet,Lt=function(n){s(this,Re).push(new he(n,{folderName:`EffectComposer.${n.constructor.name}`,skipKeys:["renderToScreen","needsSwap","nMips","oldClearAlpha","clearColor","resolution"]})),"uniforms"in n&&s(this,Re).push(new he(n.uniforms,{folderName:`EffectComposer.${n.constructor.name}.Uniforms`,optionsCatalog:{maxblur:{type:"number",min:0,max:1,step:1e-5,ease:.1},aperture:{type:"number",min:0,max:.01,step:1e-6},focus:{type:"number",min:0,step:.01}},skipKeys:["time","resolution"]}))},dn=function(n){};var at,rt,ct,lt,He,Pe,Ye;class lo{constructor(){f(this,at);f(this,rt);f(this,ct,null);f(this,lt);f(this,He);f(this,Pe);f(this,Ye);x(this,at,new he(y.en3.webglRenderer,{folderName:"Renderer"})),x(this,rt,new he(y.en3.webglRenderer.shadowMap,{folderName:"Renderer.shadowMap",optionsCatalog:{type:{type:"select",variants:["BasicShadowMap","PCFShadowMap","PCFSoftShadowMap","VSMShadowMap"]}},afterChange:()=>{y.en3.webglRenderer.shadowMap.needsUpdate=!0,Rn.traverseMaterials(y.en3.scene,n=>{n.needsUpdate=!0})}})),y.en3.composer&&x(this,ct,new co),x(this,lt,new ao),x(this,He,new Ot(y.en3.camera)),x(this,Pe,new so),s(this,Pe).controls.addEventListener("change",()=>{s(this,He).save()}),x(this,Ye,new ro),s(this,Ye).controls.addEventListener("dragging-changed",n=>{s(this,Pe).controls.enabled=!n.value})}destroy(){var n;s(this,at).destroy(),s(this,rt).destroy(),(n=s(this,ct))==null||n.destroy(),s(this,lt).destroy(),s(this,He).destroy(),s(this,Pe).destroy(),s(this,Ye).destroy()}}at=new WeakMap,rt=new WeakMap,ct=new WeakMap,lt=new WeakMap,He=new WeakMap,Pe=new WeakMap,Ye=new WeakMap;exports.En3Helpers=lo;exports.En3Object3dManager=Ot;
@@ -14,14 +14,14 @@ var on = (m, t, o) => t in m ? Kn(m, t, { enumerable: !0, configurable: !0, writ
14
14
  };
15
15
  var Ot = (m, t, o) => t.has(m) || an("Cannot " + o);
16
16
  var s = (m, t, o) => (Ot(m, t, "read from private field"), o ? o.call(m) : t.get(m)), f = (m, t, o) => t.has(m) ? an("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(m) : t.set(m, o), v = (m, t, o, e) => (Ot(m, t, "write to private field"), e ? e.call(m, o) : t.set(m, o), o), M = (m, t, o) => (Ot(m, t, "access private method"), o);
17
- import { e as b } from "../../en3-x-Ki30MY.js";
18
- import { S as F } from "../../Store-DGtldlBH.js";
17
+ import { e as b } from "../../en3-sK9Z-fp2.js";
18
+ import { S as F } from "../../Store-C46i0nvr.js";
19
19
  import * as Ee from "three";
20
20
  import { Light as rn, PointLight as $n, PointLightHelper as Jn, DirectionalLight as ei, DirectionalLightHelper as ti, SpotLight as ni, SpotLightHelper as ii, HemisphereLight as si, HemisphereLightHelper as oi, Camera as ln, CameraHelper as ai, Mesh as p, Material as ri, Ray as li, Plane as ci, MathUtils as hi, EventDispatcher as pi, Vector3 as y, MOUSE as Re, TOUCH as Ye, Quaternion as B, Spherical as cn, Vector2 as $, Raycaster as mi, Object3D as Yt, Euler as di, Matrix4 as Sn, MeshBasicMaterial as xn, LineBasicMaterial as ui, CylinderGeometry as Q, BoxGeometry as Z, BufferGeometry as hn, Float32BufferAttribute as pn, OctahedronGeometry as Mt, Line as pe, SphereGeometry as fi, TorusGeometry as Ve, PlaneGeometry as yi, DoubleSide as bi, GridHelper as wi } from "three";
21
21
  import { a as gi } from "../../object-D6MVWB4l.js";
22
22
  import { ticker as mn } from "../../ticker/index.js";
23
- import { C as Ei } from "../../Composed-CoX1ImVk.js";
24
- import { t as Pi } from "../../traverseMaterials-mGC2_FkG.js";
23
+ import { C as Ei } from "../../Composed-CfWa-69I.js";
24
+ import { t as Pi } from "../../traverseMaterials-BlZbRhgW.js";
25
25
  const Mi = [
26
26
  "AddEquation",
27
27
  "SubtractEquation",
package/lib/en3/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { E as n, e as s, a as o } from "../en3-x-Ki30MY.js";
1
+ import { E as n, e as s, a as o } from "../en3-sK9Z-fp2.js";
2
2
  export {
3
3
  n as En3View,
4
4
  s as en3,
@@ -20,7 +20,7 @@ var le = (d, t, e) => new Promise((r, n) => {
20
20
  a((e = e.apply(d, t)).next());
21
21
  });
22
22
  import { TrianglesDrawMode as Fe, TriangleFanDrawMode as re, TriangleStripDrawMode as Le, Loader as Pe, LoaderUtils as X, FileLoader as _e, Color as G, LinearSRGBColorSpace as I, SpotLight as ke, PointLight as He, DirectionalLight as Ge, MeshBasicMaterial as V, SRGBColorSpace as z, MeshPhysicalMaterial as y, Vector2 as Se, Matrix4 as Y, Vector3 as B, Quaternion as Me, InstancedMesh as Be, InstancedBufferAttribute as Ue, Object3D as ye, TextureLoader as we, ImageBitmapLoader as ve, BufferAttribute as J, InterleavedBuffer as je, InterleavedBufferAttribute as Ke, LinearFilter as be, LinearMipmapLinearFilter as Ne, RepeatWrapping as ie, PointsMaterial as Ve, Material as $, LineBasicMaterial as Xe, MeshStandardMaterial as Ie, DoubleSide as ze, PropertyBinding as qe, BufferGeometry as We, SkinnedMesh as Ye, Mesh as Qe, LineSegments as Ze, Line as Je, LineLoop as $e, Points as et, Group as ee, PerspectiveCamera as tt, MathUtils as nt, OrthographicCamera as st, Skeleton as rt, AnimationClip as it, Bone as ot, InterpolateLinear as Oe, ColorManagement as de, NearestFilter as at, NearestMipmapNearestFilter as ct, LinearMipmapNearestFilter as ut, NearestMipmapLinearFilter as lt, ClampToEdgeWrapping as dt, MirroredRepeatWrapping as ft, InterpolateDiscrete as ht, FrontSide as pt, Texture as fe, VectorKeyframeTrack as he, NumberKeyframeTrack as pe, QuaternionKeyframeTrack as me, Box3 as mt, Sphere as At, Interpolant as gt } from "three";
23
- import { e as N, a as b, d as Ae } from "../../en3-x-Ki30MY.js";
23
+ import { e as N, a as b, d as Ae } from "../../en3-sK9Z-fp2.js";
24
24
  function ge(d, t) {
25
25
  if (t === Fe)
26
26
  return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."), d;
@@ -1,4 +1,4 @@
1
- "use strict";var b=o=>{throw TypeError(o)};var D=(o,e,t)=>e.has(o)||b("Cannot "+t);var i=(o,e,t)=>(D(o,e,"read from private field"),t?t.call(o):e.get(o)),s=(o,e,t)=>e.has(o)?b("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,t),c=(o,e,t,r)=>(D(o,e,"write to private field"),r?r.call(o,t):e.set(o,t),t),L=(o,e,t)=>(D(o,e,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=require("../../loading/index.cjs"),z=require("../../SourceManager-TzU9Rw08.cjs"),y=require("../../Store-BnA-dJsE.cjs");var u,l,v,k;class T{constructor(e){s(this,v);s(this,u);s(this,l);c(this,u,e.material),c(this,l,e.uniforms||{}),i(this,u).userData.uniforms=i(this,l);let t;const r=()=>{t==null||t()};i(this,u).addEventListener("dispose",r),i(this,u).onBeforeCompile=n=>{var d;t==null||t();for(const R in i(this,l))n.uniforms[R]=i(this,l)[R];e.vertextDeclarations&&(n.vertexShader=`
1
+ "use strict";var b=o=>{throw TypeError(o)};var D=(o,e,t)=>e.has(o)||b("Cannot "+t);var i=(o,e,t)=>(D(o,e,"read from private field"),t?t.call(o):e.get(o)),s=(o,e,t)=>e.has(o)?b("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,t),c=(o,e,t,r)=>(D(o,e,"write to private field"),r?r.call(o,t):e.set(o,t),t),L=(o,e,t)=>(D(o,e,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=require("../../loading/index.cjs"),z=require("../../SourceManager-CfHcGLUa.cjs"),y=require("../../Store-npaZHvX4.cjs");var u,l,v,k;class T{constructor(e){s(this,v);s(this,u);s(this,l);c(this,u,e.material),c(this,l,e.uniforms||{}),i(this,u).userData.uniforms=i(this,l);let t;const r=()=>{t==null||t()};i(this,u).addEventListener("dispose",r),i(this,u).onBeforeCompile=n=>{var d;t==null||t();for(const R in i(this,l))n.uniforms[R]=i(this,l)[R];e.vertextDeclarations&&(n.vertexShader=`
2
2
  ${e.vertextDeclarations}
3
3
  ${n.vertexShader}
4
4
  `),e.fragmentDeclarations&&(n.fragmentShader=`
@@ -4,8 +4,8 @@ var R = (o) => {
4
4
  var m = (o, i, t) => i.has(o) || R("Cannot " + t);
5
5
  var e = (o, i, t) => (m(o, i, "read from private field"), t ? t.call(o) : i.get(o)), r = (o, i, t) => i.has(o) ? R("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(o) : i.set(o, t), c = (o, i, t, s) => (m(o, i, "write to private field"), s ? s.call(o, t) : i.set(o, t), t), L = (o, i, t) => (m(o, i, "access private method"), t);
6
6
  import { loading as $ } from "../../loading/index.js";
7
- import { S as A } from "../../SourceManager-B8-EMNnd.js";
8
- import { S as z } from "../../Store-DGtldlBH.js";
7
+ import { S as A } from "../../SourceManager-B6wZpXUZ.js";
8
+ import { S as z } from "../../Store-C46i0nvr.js";
9
9
  var h, u, S, k;
10
10
  class w {
11
11
  constructor(i) {
@@ -1,5 +1,5 @@
1
- import { d as w } from "../../en3-x-Ki30MY.js";
2
- import { g as T, t as C } from "../../traverseMaterials-mGC2_FkG.js";
1
+ import { d as w } from "../../en3-sK9Z-fp2.js";
2
+ import { g as T, t as C } from "../../traverseMaterials-BlZbRhgW.js";
3
3
  import { Mesh as g } from "three";
4
4
  function y(t, e, s) {
5
5
  const o = e.x, r = e.y, i = s || t.image.width / t.image.height;
@@ -18,7 +18,7 @@ var e = (h, t, i) => (J(h, t, "read from private field"), i ? i.call(h) : t.get(
18
18
  import { RESIZE_ORDER as ue, TICK_ORDER as me } from "./order/index.js";
19
19
  import { windowResizer as Q } from "./window-resizer/index.js";
20
20
  import { ticker as ee } from "./ticker/index.js";
21
- import { a as ae } from "./dom-P5QbAASX.js";
21
+ import { g as ae } from "./dom-0S_WDL4g.js";
22
22
  import { Mesh as fe, OrthographicCamera as te, PerspectiveCamera as ie, Scene as ge, Vector2 as Ee, Raycaster as be, REVISION as xe, WebGLRenderer as ye } from "three";
23
23
  import { LayoutBox as se } from "./layout-box/index.js";
24
24
  function we(h) {
@@ -0,0 +1,31 @@
1
+ function c(n) {
2
+ n.dispatchEvent(
3
+ new CustomEvent("sizeChange", {
4
+ bubbles: !0,
5
+ composed: !0
6
+ })
7
+ );
8
+ }
9
+ function s(n) {
10
+ n.dispatchEvent(
11
+ new CustomEvent("beforeSizeChange", {
12
+ bubbles: !0,
13
+ composed: !0
14
+ })
15
+ );
16
+ }
17
+ function i(n, t) {
18
+ const o = new Blob([JSON.stringify(t)], { type: "application/json" }), e = document.createElement("a");
19
+ e.download = n + ".json", e.href = window.URL.createObjectURL(o), e.dataset.downloadurl = ["application/json", e.download, e.href].join(":");
20
+ const a = new MouseEvent("click", {
21
+ view: window,
22
+ bubbles: !0,
23
+ cancelable: !0
24
+ });
25
+ e.dispatchEvent(a), e.remove();
26
+ }
27
+ export {
28
+ s as a,
29
+ i as c,
30
+ c as d
31
+ };
@@ -0,0 +1 @@
1
+ "use strict";function i(n){n.dispatchEvent(new CustomEvent("sizeChange",{bubbles:!0,composed:!0}))}function c(n){n.dispatchEvent(new CustomEvent("beforeSizeChange",{bubbles:!0,composed:!0}))}function s(n,t){const o=new Blob([JSON.stringify(t)],{type:"application/json"}),e=document.createElement("a");e.download=n+".json",e.href=window.URL.createObjectURL(o),e.dataset.downloadurl=["application/json",e.download,e.href].join(":");const a=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0});e.dispatchEvent(a),e.remove()}exports.createJSONAndSave=s;exports.dispatchBeforeSizeChangeEvent=c;exports.dispatchSizeChangeEvent=i;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../window-resizer/index.cjs");require("../Store-BnA-dJsE.cjs");const r=require("../source/index.cjs");class e extends r.SourceElement{createConsumer(){return document.createElement("img")}consumeSource(t){this.consumerElement.src=t||""}}customElements.get("e-image")||customElements.define("e-image",e);exports.ImageElement=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../window-resizer/index.cjs");require("../Store-npaZHvX4.cjs");const r=require("../source/index.cjs");class e extends r.SourceElement{createConsumer(){return document.createElement("img")}consumeSource(t){this.consumerElement.src=t||""}}customElements.get("e-image")||customElements.define("e-image",e);exports.ImageElement=e;
@@ -1,5 +1,5 @@
1
1
  import "../window-resizer/index.js";
2
- import "../Store-DGtldlBH.js";
2
+ import "../Store-C46i0nvr.js";
3
3
  import { SourceElement as m } from "../source/index.js";
4
4
  class t extends m {
5
5
  createConsumer() {
@@ -3,10 +3,10 @@ var m = (n) => {
3
3
  };
4
4
  var y = (n, t, s) => t.has(n) || m("Cannot " + s);
5
5
  var r = (n, t, s) => (y(n, t, "read from private field"), s ? s.call(n) : t.get(n)), f = (n, t, s) => t.has(n) ? m("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(n) : t.set(n, s), l = (n, t, s, e) => (y(n, t, "write to private field"), e ? e.call(n, s) : t.set(n, s), s);
6
- import { i as p } from "../browser-0zX67oeU.js";
7
- import { a as w } from "../dom-P5QbAASX.js";
6
+ import { i as g } from "../browser-0zX67oeU.js";
7
+ import { g as p } from "../dom-0S_WDL4g.js";
8
8
  var i, b, u;
9
- class g {
9
+ class w {
10
10
  constructor() {
11
11
  f(this, i, []);
12
12
  f(this, b, null);
@@ -18,12 +18,12 @@ class g {
18
18
  e.entry && (e.subscriber.entry = e.entry, e.subscriber.callback(e.entry));
19
19
  });
20
20
  });
21
- p && window.IntersectionObserver && l(this, b, new IntersectionObserver(
21
+ g && window.IntersectionObserver && l(this, b, new IntersectionObserver(
22
22
  r(this, u)
23
23
  ));
24
24
  }
25
25
  subscribe(t, s) {
26
- const e = w(t);
26
+ const e = p(t);
27
27
  if (!e)
28
28
  return () => {
29
29
  };
@@ -56,8 +56,8 @@ class g {
56
56
  }
57
57
  }
58
58
  i = new WeakMap(), b = new WeakMap(), u = new WeakMap();
59
- const E = new g();
59
+ const E = new w();
60
60
  export {
61
- g as Intersector,
61
+ w as Intersector,
62
62
  E as intersector
63
63
  };
@@ -1 +1 @@
1
- "use strict";var M=Object.defineProperty;var S=Object.getOwnPropertySymbols;var V=Object.prototype.hasOwnProperty,m=Object.prototype.propertyIsEnumerable;var v=t=>{throw TypeError(t)};var k=(t,s,e)=>s in t?M(t,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[s]=e,w=(t,s)=>{for(var e in s||(s={}))V.call(s,e)&&k(t,e,s[e]);if(S)for(var e of S(s))m.call(s,e)&&k(t,e,s[e]);return t};var g=(t,s,e)=>s.has(t)||v("Cannot "+e);var o=(t,s,e)=>(g(t,s,"read from private field"),e?e.call(t):s.get(t)),p=(t,s,e)=>s.has(t)?v("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(t):s.set(t,e),f=(t,s,e,i)=>(g(t,s,"write to private field"),i?i.call(t,e):s.set(t,e),e),b=(t,s,e)=>(g(t,s,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("../Store-BnA-dJsE.cjs");var d,u,a,h,y;class x extends q.Store{constructor(e){super(e,{equalityCheck:()=>!1});p(this,h);p(this,d);p(this,u);p(this,a);f(this,d,w({},e)),f(this,u,new Map),f(this,a,new Set)}get base(){return o(this,d)}get steps(){return o(this,u)}close(){super.close(),o(this,a).clear(),o(this,u).clear()}bind(e){o(this,a).add(e)}unbind(e){o(this,a).delete(e)}deleteStep(e){this.steps.delete(e)}getStepValue(e){var i;return(i=this.steps.get(e))==null?void 0:i[1]}getExcludedStepsValue(...e){const i=new Map;return e.map(c=>{const n=this.steps.get(c);n&&i.set(c,n)}),b(this,h,y).call(this,i)}getIncludedStepsValue(...e){const i=new Map(this.steps);return e.map(c=>{this.steps.has(c)&&i.delete(c)}),b(this,h,y).call(this,i)}setStep(e,i,c){const n={};for(const r in this.current)n[r]=c[r]||0;this.steps.set(e,[i,n]),this.calculate()}calculate(){this.current=b(this,h,y).call(this,o(this,u))}}d=new WeakMap,u=new WeakMap,a=new WeakMap,h=new WeakSet,y=function(e){const i={};for(const c in this.base)i[c]=this.base[c];for(const c of e){const n=c[1];if(n[0]==="+")for(const r in this.base){const l=n[1][r];i[r]+=l}else if(n[0]==="*")for(const r in this.base){const l=n[1][r];i[r]*=l}else if(n[0]==="/")for(const r in this.base){const l=n[1][r];i[r]/=l}else if(n[0]==="-")for(const r in this.base){const l=n[1][r];i[r]-=l}}for(const c of o(this,a))for(const n in i)c[n]=i[n];return i};exports.Ladder=x;
1
+ "use strict";var M=Object.defineProperty;var S=Object.getOwnPropertySymbols;var V=Object.prototype.hasOwnProperty,m=Object.prototype.propertyIsEnumerable;var v=t=>{throw TypeError(t)};var k=(t,s,e)=>s in t?M(t,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[s]=e,w=(t,s)=>{for(var e in s||(s={}))V.call(s,e)&&k(t,e,s[e]);if(S)for(var e of S(s))m.call(s,e)&&k(t,e,s[e]);return t};var g=(t,s,e)=>s.has(t)||v("Cannot "+e);var o=(t,s,e)=>(g(t,s,"read from private field"),e?e.call(t):s.get(t)),p=(t,s,e)=>s.has(t)?v("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(t):s.set(t,e),f=(t,s,e,i)=>(g(t,s,"write to private field"),i?i.call(t,e):s.set(t,e),e),b=(t,s,e)=>(g(t,s,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("../Store-npaZHvX4.cjs");var d,u,a,h,y;class x extends q.Store{constructor(e){super(e,{equalityCheck:()=>!1});p(this,h);p(this,d);p(this,u);p(this,a);f(this,d,w({},e)),f(this,u,new Map),f(this,a,new Set)}get base(){return o(this,d)}get steps(){return o(this,u)}close(){super.close(),o(this,a).clear(),o(this,u).clear()}bind(e){o(this,a).add(e)}unbind(e){o(this,a).delete(e)}deleteStep(e){this.steps.delete(e)}getStepValue(e){var i;return(i=this.steps.get(e))==null?void 0:i[1]}getExcludedStepsValue(...e){const i=new Map;return e.map(c=>{const n=this.steps.get(c);n&&i.set(c,n)}),b(this,h,y).call(this,i)}getIncludedStepsValue(...e){const i=new Map(this.steps);return e.map(c=>{this.steps.has(c)&&i.delete(c)}),b(this,h,y).call(this,i)}setStep(e,i,c){const n={};for(const r in this.current)n[r]=c[r]||0;this.steps.set(e,[i,n]),this.calculate()}calculate(){this.current=b(this,h,y).call(this,o(this,u))}}d=new WeakMap,u=new WeakMap,a=new WeakMap,h=new WeakSet,y=function(e){const i={};for(const c in this.base)i[c]=this.base[c];for(const c of e){const n=c[1];if(n[0]==="+")for(const r in this.base){const l=n[1][r];i[r]+=l}else if(n[0]==="*")for(const r in this.base){const l=n[1][r];i[r]*=l}else if(n[0]==="/")for(const r in this.base){const l=n[1][r];i[r]/=l}else if(n[0]==="-")for(const r in this.base){const l=n[1][r];i[r]-=l}}for(const c of o(this,a))for(const n in i)c[n]=i[n];return i};exports.Ladder=x;
@@ -14,7 +14,7 @@ var S = (t, s, e) => s in t ? V(t, s, { enumerable: !0, configurable: !0, writab
14
14
  };
15
15
  var g = (t, s, e) => s.has(t) || v("Cannot " + e);
16
16
  var r = (t, s, e) => (g(t, s, "read from private field"), e ? e.call(t) : s.get(t)), p = (t, s, e) => s.has(t) ? v("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(t) : s.set(t, e), d = (t, s, e, i) => (g(t, s, "write to private field"), i ? i.call(t, e) : s.set(t, e), e), b = (t, s, e) => (g(t, s, "access private method"), e);
17
- import { S as M } from "../Store-DGtldlBH.js";
17
+ import { S as M } from "../Store-C46i0nvr.js";
18
18
  var f, h, a, u, y;
19
19
  class E extends M {
20
20
  constructor(e) {
@@ -9,7 +9,7 @@ import { RESIZE_ORDER as St, TICK_ORDER as dt } from "../order/index.js";
9
9
  import { scrollEntries as $ } from "../scroll-entries/index.js";
10
10
  import { ticker as j } from "../ticker/index.js";
11
11
  import { i as tt } from "../browser-0zX67oeU.js";
12
- import { a as et } from "../dom-P5QbAASX.js";
12
+ import { g as et } from "../dom-0S_WDL4g.js";
13
13
  import { g as F, a as G } from "../layout-HoBT_Da2.js";
14
14
  import { elementResizer as st } from "../element-resizer/index.js";
15
15
  import { windowResizer as it } from "../window-resizer/index.js";
@@ -37,7 +37,7 @@ function pt(i) {
37
37
  translationZ: O
38
38
  };
39
39
  }
40
- var a, z, b, _, W, X, v, w, q, B, x, M, Y, S, d, C, H, I, D, p, m, g, c, n, o, E, R, T, f, J, ht, rt, nt, P, U, Z;
40
+ var a, z, b, _, W, X, v, w, q, B, x, M, Y, S, d, C, H, I, D, p, g, m, c, n, o, E, R, T, f, J, ht, rt, nt, P, U, Z;
41
41
  class Ct {
42
42
  constructor(e, s) {
43
43
  h(this, f);
@@ -61,8 +61,8 @@ class Ct {
61
61
  h(this, I, 0);
62
62
  h(this, D, 0);
63
63
  h(this, p, { x: 0, y: 0, z: 0 });
64
- h(this, m, { x: 0, y: 0, z: 0 });
65
- h(this, g, { x: 1, y: 1, z: 1 });
64
+ h(this, g, { x: 0, y: 0, z: 0 });
65
+ h(this, m, { x: 1, y: 1, z: 1 });
66
66
  h(this, c, new N({ x: 0, y: 0, z: 0 }));
67
67
  h(this, n, new N({ x: 0, y: 0, z: 0 }));
68
68
  h(this, o, new N({ x: 0, y: 0, z: 0 }));
@@ -139,10 +139,10 @@ class Ct {
139
139
  return t(this, p);
140
140
  }
141
141
  get CSSRotation() {
142
- return t(this, m);
142
+ return t(this, g);
143
143
  }
144
144
  get CSSScale() {
145
- return t(this, g);
145
+ return t(this, m);
146
146
  }
147
147
  get front() {
148
148
  return t(this, C);
@@ -243,7 +243,7 @@ class Ct {
243
243
  return t(this, T).unsubscribe(...e);
244
244
  }
245
245
  }
246
- a = new WeakMap(), z = new WeakMap(), b = new WeakMap(), _ = new WeakMap(), W = new WeakMap(), X = new WeakMap(), v = new WeakMap(), w = new WeakMap(), q = new WeakMap(), B = new WeakMap(), x = new WeakMap(), M = new WeakMap(), Y = new WeakMap(), S = new WeakMap(), d = new WeakMap(), C = new WeakMap(), H = new WeakMap(), I = new WeakMap(), D = new WeakMap(), p = new WeakMap(), m = new WeakMap(), g = new WeakMap(), c = new WeakMap(), n = new WeakMap(), o = new WeakMap(), E = new WeakMap(), R = new WeakMap(), T = new WeakMap(), f = new WeakSet(), J = function() {
246
+ a = new WeakMap(), z = new WeakMap(), b = new WeakMap(), _ = new WeakMap(), W = new WeakMap(), X = new WeakMap(), v = new WeakMap(), w = new WeakMap(), q = new WeakMap(), B = new WeakMap(), x = new WeakMap(), M = new WeakMap(), Y = new WeakMap(), S = new WeakMap(), d = new WeakMap(), C = new WeakMap(), H = new WeakMap(), I = new WeakMap(), D = new WeakMap(), p = new WeakMap(), g = new WeakMap(), m = new WeakMap(), c = new WeakMap(), n = new WeakMap(), o = new WeakMap(), E = new WeakMap(), R = new WeakMap(), T = new WeakMap(), f = new WeakSet(), J = function() {
247
247
  t(this, o).calculate(), t(this, n).calculate(), t(this, c).calculate();
248
248
  }, ht = function() {
249
249
  t(this, o).setStep("_size", "+", {
@@ -257,17 +257,17 @@ a = new WeakMap(), z = new WeakMap(), b = new WeakMap(), _ = new WeakMap(), W =
257
257
  y: s,
258
258
  z: l
259
259
  }), t(this, q) ? (t(this, o).setStep("_scale", "*", {
260
- x: t(this, g).x,
261
- y: t(this, g).y,
262
- z: t(this, g).z
260
+ x: t(this, m).x,
261
+ y: t(this, m).y,
262
+ z: t(this, m).z
263
263
  }), t(this, n).setStep("_translation", "+", {
264
264
  x: t(this, p).x,
265
265
  y: t(this, p).y,
266
266
  z: t(this, p).z
267
267
  }), t(this, c).setStep("_rotation", "+", {
268
- x: t(this, m).x,
269
- y: t(this, m).y,
270
- z: t(this, m).z
268
+ x: t(this, g).x,
269
+ y: t(this, g).y,
270
+ z: t(this, g).z
271
271
  })) : (t(this, o).setStep("_scale", "*", {
272
272
  x: 1,
273
273
  y: 1,
@@ -299,7 +299,7 @@ a = new WeakMap(), z = new WeakMap(), b = new WeakMap(), _ = new WeakMap(), W =
299
299
  r(this, H, t(this, d)), r(this, I, t(this, S));
300
300
  r(this, D, t(this, C) * -1);
301
301
  const k = new WebKitCSSMatrix(e.transform), u = pt(k);
302
- t(this, p).x = u.translationX, t(this, p).y = u.translationY, t(this, p).z = u.translationZ, t(this, g).x = u.scaleX, t(this, g).y = u.scaleY, t(this, g).z = u.scaleZ, t(this, m).x = u.rotationX, t(this, m).y = u.rotationY, t(this, m).z = u.rotationZ, L(this, f, ht).call(this), L(this, f, J).call(this), t(this, T).notify();
302
+ t(this, p).x = u.translationX, t(this, p).y = u.translationY, t(this, p).z = u.translationZ, t(this, m).x = u.scaleX, t(this, m).y = u.scaleY, t(this, m).z = u.scaleZ, t(this, g).x = u.rotationX, t(this, g).y = u.rotationY, t(this, g).z = u.rotationZ, L(this, f, ht).call(this), L(this, f, J).call(this), t(this, T).notify();
303
303
  }, nt = function() {
304
304
  t(this, E).x = 0, t(this, E).y = 0, t(this, E).z = 0;
305
305
  for (let e = 0; e < t(this, b).length; e++) {
@@ -1 +1 @@
1
- "use strict";var d=e=>{throw TypeError(e)};var a=(e,r,s)=>r.has(e)||d("Cannot "+s);var o=(e,r,s)=>(a(e,r,"read from private field"),s?s.call(e):r.get(e)),c=(e,r,s)=>r.has(e)?d("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(e):r.set(e,s),u=(e,r,s,n)=>(a(e,r,"write to private field"),n?n.call(e,s):r.set(e,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("../order/index.cjs"),h=require("../window-resizer/index.cjs"),b=require("../Store-BnA-dJsE.cjs");var i,t;class w extends b.Store{constructor(s){super(!1);c(this,i);c(this,t);u(this,i,s),u(this,t,h.windowResizer.subscribe(()=>{matchMedia(o(this,i)).matches?this.current=!0:this.current=!1},l.RESIZE_ORDER.MEDIA))}close(){super.close(),o(this,t).call(this)}}i=new WeakMap,t=new WeakMap;exports.Media=w;
1
+ "use strict";var d=e=>{throw TypeError(e)};var a=(e,r,s)=>r.has(e)||d("Cannot "+s);var o=(e,r,s)=>(a(e,r,"read from private field"),s?s.call(e):r.get(e)),c=(e,r,s)=>r.has(e)?d("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(e):r.set(e,s),u=(e,r,s,n)=>(a(e,r,"write to private field"),n?n.call(e,s):r.set(e,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("../order/index.cjs"),h=require("../window-resizer/index.cjs"),b=require("../Store-npaZHvX4.cjs");var i,t;class w extends b.Store{constructor(s){super(!1);c(this,i);c(this,t);u(this,i,s),u(this,t,h.windowResizer.subscribe(()=>{matchMedia(o(this,i)).matches?this.current=!0:this.current=!1},l.RESIZE_ORDER.MEDIA))}close(){super.close(),o(this,t).call(this)}}i=new WeakMap,t=new WeakMap;exports.Media=w;
@@ -5,7 +5,7 @@ var h = (e, s, r) => s.has(e) || a("Cannot " + r);
5
5
  var o = (e, s, r) => (h(e, s, "read from private field"), r ? r.call(e) : s.get(e)), c = (e, s, r) => s.has(e) ? a("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(e) : s.set(e, r), u = (e, s, r, m) => (h(e, s, "write to private field"), m ? m.call(e, r) : s.set(e, r), r);
6
6
  import { RESIZE_ORDER as n } from "../order/index.js";
7
7
  import { windowResizer as f } from "../window-resizer/index.js";
8
- import { S as l } from "../Store-DGtldlBH.js";
8
+ import { S as l } from "../Store-C46i0nvr.js";
9
9
  var t, i;
10
10
  class w extends l {
11
11
  constructor(r) {