aptechka 0.7.2 → 0.7.3

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 (35) hide show
  1. package/lib/accordion/AccordionElement.d.ts +0 -3
  2. package/lib/accordion/index.cjs +1 -1
  3. package/lib/accordion/index.js +60 -71
  4. package/lib/en3/core/En3Raycaster.d.ts +1 -0
  5. package/lib/en3/helpers/{En3Controls.d.ts → En3Helpers.d.ts} +1 -1
  6. package/lib/en3/helpers/En3Object3dManager.d.ts +2 -0
  7. package/lib/en3/helpers/En3ParametersManager.d.ts +5 -0
  8. package/lib/en3/helpers/index.cjs +1 -1
  9. package/lib/en3/helpers/index.d.ts +1 -1
  10. package/lib/en3/helpers/index.js +1203 -669
  11. package/lib/en3/index.cjs +1 -1
  12. package/lib/en3/index.js +1 -1
  13. package/lib/en3/loaders/index.cjs +1 -1
  14. package/lib/en3/loaders/index.js +1 -1
  15. package/lib/en3/utils/index.cjs +1 -1
  16. package/lib/en3/utils/index.js +15 -38
  17. package/lib/en3-BQMd-J6t.cjs +8 -0
  18. package/lib/{en3-hbkN1OPu.js → en3-CsNHRA0v.js} +22 -22
  19. package/lib/events-BGwqaxVW.cjs +1 -0
  20. package/lib/{events-_C2CztxR.js → events-C_coq1Mk.js} +9 -0
  21. package/lib/{index-BAH_fO2N.js → index-CoOTQk9H.js} +40 -40
  22. package/lib/{index-D1LQUR-R.cjs → index-DVUk3T-y.cjs} +2 -2
  23. package/lib/select/index.cjs +1 -1
  24. package/lib/select/index.js +1 -1
  25. package/lib/traverseMaterials-B87RMkV0.js +29 -0
  26. package/lib/traverseMaterials-Crv7f9BJ.cjs +1 -0
  27. package/lib/tweaker/index.cjs +3 -3
  28. package/lib/tweaker/index.js +314 -296
  29. package/lib/tweaker/tweakerStorage.d.ts +2 -0
  30. package/lib/utils/events.d.ts +2 -0
  31. package/lib/utils/index.cjs +1 -1
  32. package/lib/utils/index.js +65 -64
  33. package/package.json +1 -1
  34. package/lib/en3-C4mzaF6q.cjs +0 -8
  35. package/lib/events-Crwi8fz6.cjs +0 -1
@@ -28,7 +28,4 @@ declare global {
28
28
  interface HTMLElementEventMap {
29
29
  accordionItemToggle: CustomEvent<AccordionItemToggleEventDetail>;
30
30
  }
31
- interface HTMLElementEventMap {
32
- beforeAccordionItemToggle: CustomEvent<AccordionItemToggleEventDetail>;
33
- }
34
31
  }
@@ -1 +1 @@
1
- "use strict";var R=(s,e,i)=>{if(!e.has(s))throw TypeError("Cannot "+i)};var t=(s,e,i)=>(R(s,e,"read from private field"),i?i.call(s):e.get(s)),h=(s,e,i)=>{if(e.has(s))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(s):e.set(s,i)},d=(s,e,i,n)=>(R(s,e,"write to private field"),n?n.call(s,i):e.set(s,i),i);var o=(s,e,i)=>(R(s,e,"access private method"),i);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const K=require("../custom-element/index.cjs"),F=require("../attribute/index.cjs"),V=require("../browser-CpzFX2xg.cjs"),X=require("../dom-JBOkFLTh.cjs"),Y=require("../events-Crwi8fz6.cjs"),Z=require("../style-At6aDoqG.cjs");var j=Object.defineProperty,ee=Object.getOwnPropertyDescriptor,te=(s,e,i,n)=>{for(var b=n>1?void 0:n?ee(e,i):e,H=s.length-1,P;H>=0;H--)(P=s[H])&&(b=(n?P(e,i,b):P(b))||b);return n&&b&&j(e,i,b),b},Q=(s,e,i)=>{if(!e.has(s))throw TypeError("Cannot "+i)},c=(s,e,i)=>(Q(s,e,"read from private field"),i?i.call(s):e.get(s)),L=(s,e,i)=>{if(e.has(s))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(s):e.set(s,i)},D=(s,e,i,n)=>(Q(s,e,"write to private field"),e.set(s,i),i),N,B,m,y,I,G,a,r,v,l,A,O,T,u,_,W,U,w,S,x,C,q,z,f,g,E,p,M,$,k;class J{constructor(e,i){h(this,W);h(this,w);h(this,f);h(this,E);h(this,M);h(this,a,null);h(this,r,null);h(this,v,null);h(this,l,null);h(this,A,null);h(this,O,!1);h(this,T,void 0);h(this,u,!1);h(this,_,[]);h(this,x,()=>{t(this,u)?this.close():this.open()});h(this,C,()=>{t(this,u)&&(o(this,f,g).call(this,0,!0),o(this,f,g).call(this,t(this,w,S)))});h(this,q,()=>{o(this,E,p).call(this,"size-change")});h(this,z,e=>{t(this,u)&&(o(this,f,g).call(this,0,!0),o(this,f,g).call(this,t(this,w,S)),t(this,_).forEach(i=>{i.element.scroll({left:t(this,a).axisAttribute.current==="x"?i.scroll:0,top:t(this,a).axisAttribute.current==="y"?i.scroll:0})}))});h(this,k,()=>{const e=X.getAllParentElements(t(this,r));d(this,_,e.map(i=>({element:i,scroll:t(this,a).axisAttribute.current==="y"?i.scrollTop:i.scrollLeft})))});i.firstElementChild instanceof HTMLElement&&i.lastElementChild instanceof HTMLElement?(d(this,a,e),d(this,r,i),d(this,v,i.firstElementChild),d(this,l,i.lastElementChild),t(this,v).style.cursor="default",t(this,l).style.overflow="hidden",t(this,a).axisAttribute.current==="y"?t(this,l).style.height="0px":t(this,l).style.width="0px",d(this,A,new ResizeObserver(t(this,q))),addEventListener("resize",t(this,C)),t(this,v).addEventListener("click",t(this,x)),t(this,r).addEventListener("sizeChange",t(this,z)),t(this,r).addEventListener("beforeAccordionItemToggle",t(this,k)),t(this,r).hasAttribute("data-opened")&&this.open({skipTransition:!0})):e.removeItem(t(this,r))}get element(){return t(this,r)}destroy(){t(this,v)&&(t(this,r).classList.remove("opened","triggered"),t(this,v).style.cursor="",o(this,f,g).call(this,void 0),t(this,A).disconnect(),removeEventListener("resize",t(this,C)),t(this,v).removeEventListener("click",t(this,x)),t(this,r).removeEventListener("sizeChange",t(this,z)),t(this,r).removeEventListener("beforeAccordionItemToggle",t(this,k)),clearTimeout(t(this,T)))}open(e){o(this,E,p).call(this,"before-toggle"),e!=null&&e.skipTransition&&o(this,M,$).call(this),t(this,a).multipleAttribute.current||t(this,a).closeAll({exclude:t(this,r)}),t(this,O)||t(this,A).observe(t(this,l)),d(this,u,!0),clearTimeout(t(this,T)),t(this,r).classList.add("triggered"),o(this,f,g).call(this,t(this,w,S)),setTimeout(()=>{t(this,r).classList.add("opened")},0),o(this,E,p).call(this,"toggle")}close(e){o(this,E,p).call(this,"before-toggle"),e!=null&&e.skipTransition&&o(this,M,$).call(this),d(this,u,!1),t(this,r).classList.remove("opened"),o(this,f,g).call(this,0),d(this,T,setTimeout(()=>{t(this,r).classList.remove("triggered")},Z.getElementTransitionDurationMS(t(this,l)))),o(this,E,p).call(this,"toggle")}}a=new WeakMap,r=new WeakMap,v=new WeakMap,l=new WeakMap,A=new WeakMap,O=new WeakMap,T=new WeakMap,u=new WeakMap,_=new WeakMap,W=new WeakSet,U=function(){return t(this,r).parentElement||t(this,r).getRootNode()},w=new WeakSet,S=function(){return t(this,a).axisAttribute.current==="x"?t(this,l).scrollWidth:t(this,l).scrollHeight},x=new WeakMap,C=new WeakMap,q=new WeakMap,z=new WeakMap,f=new WeakSet,g=function(e,i=!1){i&&(t(this,l).style.transition="all 0s",setTimeout(()=>{t(this,l).style.transition=""}));const n=t(this,a).axisAttribute.current==="x"?"width":"height";e!=null?t(this,l).style[n]=`${e}px`:t(this,l).style[n]=""},E=new WeakSet,p=function(e){e==="before-toggle"?t(this,r).dispatchEvent(new CustomEvent("beforeAccordionItemToggle",{bubbles:!0,composed:!0,detail:{opened:t(this,u)}})):e==="toggle"?t(this,r).dispatchEvent(new CustomEvent("accordionItemToggle",{bubbles:!0,composed:!0,detail:{opened:t(this,u)}})):e==="size-change"&&Y.dispatchSizeChangeEvent(t(this,W,U))},M=new WeakSet,$=function(){t(this,l).style.transition="all 0s",setTimeout(()=>{t(this,l).style.transition=""},50)},k=new WeakMap;exports.AccordionElement=class extends K.CustomElement{constructor(){super(),L(this,I),L(this,N,new F.Attribute(this,"axis","y")),L(this,B,new F.Attribute(this,"multiple",!1)),L(this,m,[]),L(this,y,null),V.isBrowser&&D(this,y,new MutationObserver(e=>{e.forEach(i=>{i.removedNodes.forEach(n=>{n instanceof HTMLElement&&this.removeItem(n)}),i.addedNodes.forEach(n=>{n instanceof HTMLElement&&this.createItem(n)})})}))}get axisAttribute(){return c(this,N)}get multipleAttribute(){return c(this,B)}createItem(e){c(this,m).find(i=>i.element===e)||c(this,m).push(new J(this,e))}removeItem(e){D(this,m,c(this,m).filter(i=>{if(i.element!==e)return!0;i.destroy()}))}closeAll(e){c(this,m).forEach(i=>{(e==null?void 0:e.exclude)!==i.element&&i.close(e)})}openAll(e){c(this,m).forEach(i=>{(e==null?void 0:e.exclude)!==i.element&&i.open(e)})}connectedCallback(){c(this,y).observe(c(this,I,G),{childList:!0}),D(this,m,[...c(this,I,G).children].map(e=>{if(e instanceof HTMLElement)return new J(this,e)}).filter(e=>!!e))}disconnectedCallback(){c(this,y).disconnect()}};N=new WeakMap;B=new WeakMap;m=new WeakMap;y=new WeakMap;I=new WeakSet;G=function(){return this.shadowRoot?this.shadowRoot:this};exports.AccordionElement=te([K.define("e-accordion")],exports.AccordionElement);
1
+ "use strict";var R=(s,e,i)=>{if(!e.has(s))throw TypeError("Cannot "+i)};var t=(s,e,i)=>(R(s,e,"read from private field"),i?i.call(s):e.get(s)),h=(s,e,i)=>{if(e.has(s))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(s):e.set(s,i)},d=(s,e,i,n)=>(R(s,e,"write to private field"),n?n.call(s,i):e.set(s,i),i);var o=(s,e,i)=>(R(s,e,"access private method"),i);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Q=require("../custom-element/index.cjs"),F=require("../attribute/index.cjs"),X=require("../browser-CpzFX2xg.cjs"),Y=require("../dom-JBOkFLTh.cjs"),J=require("../events-BGwqaxVW.cjs"),Z=require("../style-At6aDoqG.cjs");var j=Object.defineProperty,ee=Object.getOwnPropertyDescriptor,te=(s,e,i,n)=>{for(var p=n>1?void 0:n?ee(e,i):e,H=s.length-1,P;H>=0;H--)(P=s[H])&&(p=(n?P(e,i,p):P(p))||p);return n&&p&&j(e,i,p),p},U=(s,e,i)=>{if(!e.has(s))throw TypeError("Cannot "+i)},c=(s,e,i)=>(U(s,e,"read from private field"),i?i.call(s):e.get(s)),A=(s,e,i)=>{if(e.has(s))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(s):e.set(s,i)},D=(s,e,i,n)=>(U(s,e,"write to private field"),e.set(s,i),i),N,B,f,T,k,G,a,r,m,l,L,I,w,v,_,W,V,y,O,x,C,q,z,u,g,E,b,S,$,M;class K{constructor(e,i){h(this,W);h(this,y);h(this,u);h(this,E);h(this,S);h(this,a,null);h(this,r,null);h(this,m,null);h(this,l,null);h(this,L,null);h(this,I,!1);h(this,w,void 0);h(this,v,!1);h(this,_,[]);h(this,x,()=>{t(this,v)?this.close():this.open()});h(this,C,()=>{t(this,v)&&(o(this,u,g).call(this,0,!0),o(this,u,g).call(this,t(this,y,O)))});h(this,q,()=>{o(this,E,b).call(this,"size-change")});h(this,z,e=>{t(this,v)&&(o(this,u,g).call(this,0,!0),o(this,u,g).call(this,t(this,y,O)),t(this,_).forEach(i=>{i.element.scroll({left:t(this,a).axisAttribute.current==="x"?i.scroll:0,top:t(this,a).axisAttribute.current==="y"?i.scroll:0})}))});h(this,M,()=>{const e=Y.getAllParentElements(t(this,r));d(this,_,e.map(i=>({element:i,scroll:t(this,a).axisAttribute.current==="y"?i.scrollTop:i.scrollLeft})))});i.firstElementChild instanceof HTMLElement&&i.lastElementChild instanceof HTMLElement?(d(this,a,e),d(this,r,i),d(this,m,i.firstElementChild),d(this,l,i.lastElementChild),t(this,m).style.cursor="default",t(this,l).style.overflow="hidden",t(this,a).axisAttribute.current==="y"?t(this,l).style.height="0px":t(this,l).style.width="0px",d(this,L,new ResizeObserver(t(this,q))),addEventListener("resize",t(this,C)),t(this,m).addEventListener("click",t(this,x)),t(this,r).addEventListener("beforeSizeChange",t(this,M)),t(this,r).addEventListener("sizeChange",t(this,z)),t(this,r).hasAttribute("data-opened")&&this.open({skipTransition:!0})):e.removeItem(t(this,r))}get element(){return t(this,r)}destroy(){t(this,m)&&(t(this,r).classList.remove("opened","triggered"),t(this,m).style.cursor="",o(this,u,g).call(this,void 0),t(this,L).disconnect(),removeEventListener("resize",t(this,C)),t(this,m).removeEventListener("click",t(this,x)),t(this,r).removeEventListener("beforeSizeChange",t(this,M)),t(this,r).removeEventListener("sizeChange",t(this,z)),clearTimeout(t(this,w)))}open(e){o(this,E,b).call(this,"before-toggle"),e!=null&&e.skipTransition&&o(this,S,$).call(this),t(this,a).multipleAttribute.current||t(this,a).closeAll({exclude:t(this,r)}),t(this,I)||t(this,L).observe(t(this,l)),d(this,v,!0),clearTimeout(t(this,w)),t(this,r).classList.add("triggered"),o(this,u,g).call(this,t(this,y,O)),setTimeout(()=>{t(this,r).classList.add("opened")},0),o(this,E,b).call(this,"toggle")}close(e){o(this,E,b).call(this,"before-toggle"),e!=null&&e.skipTransition&&o(this,S,$).call(this),d(this,v,!1),t(this,r).classList.remove("opened"),o(this,u,g).call(this,0),d(this,w,setTimeout(()=>{t(this,r).classList.remove("triggered")},Z.getElementTransitionDurationMS(t(this,l)))),o(this,E,b).call(this,"toggle")}}a=new WeakMap,r=new WeakMap,m=new WeakMap,l=new WeakMap,L=new WeakMap,I=new WeakMap,w=new WeakMap,v=new WeakMap,_=new WeakMap,W=new WeakSet,V=function(){return t(this,r).parentElement||t(this,r).getRootNode()},y=new WeakSet,O=function(){return t(this,a).axisAttribute.current==="x"?t(this,l).scrollWidth:t(this,l).scrollHeight},x=new WeakMap,C=new WeakMap,q=new WeakMap,z=new WeakMap,u=new WeakSet,g=function(e,i=!1){i&&(t(this,l).style.transition="all 0s",setTimeout(()=>{t(this,l).style.transition=""}));const n=t(this,a).axisAttribute.current==="x"?"width":"height";e!=null?t(this,l).style[n]=`${e}px`:t(this,l).style[n]=""},E=new WeakSet,b=function(e){e==="before-toggle"?J.dispatchBeforeSizeChangeEvent(t(this,r)):e==="toggle"?t(this,r).dispatchEvent(new CustomEvent("accordionItemToggle",{bubbles:!0,composed:!0,detail:{opened:t(this,v)}})):e==="size-change"&&J.dispatchSizeChangeEvent(t(this,W,V))},S=new WeakSet,$=function(){t(this,l).style.transition="all 0s",setTimeout(()=>{t(this,l).style.transition=""},50)},M=new WeakMap;exports.AccordionElement=class extends Q.CustomElement{constructor(){super(),A(this,k),A(this,N,new F.Attribute(this,"axis","y")),A(this,B,new F.Attribute(this,"multiple",!1)),A(this,f,[]),A(this,T,null),X.isBrowser&&D(this,T,new MutationObserver(e=>{e.forEach(i=>{i.removedNodes.forEach(n=>{n instanceof HTMLElement&&this.removeItem(n)}),i.addedNodes.forEach(n=>{n instanceof HTMLElement&&this.createItem(n)})})}))}get axisAttribute(){return c(this,N)}get multipleAttribute(){return c(this,B)}createItem(e){c(this,f).find(i=>i.element===e)||c(this,f).push(new K(this,e))}removeItem(e){D(this,f,c(this,f).filter(i=>{if(i.element!==e)return!0;i.destroy()}))}closeAll(e){c(this,f).forEach(i=>{(e==null?void 0:e.exclude)!==i.element&&i.close(e)})}openAll(e){c(this,f).forEach(i=>{(e==null?void 0:e.exclude)!==i.element&&i.open(e)})}connectedCallback(){c(this,T).observe(c(this,k,G),{childList:!0}),D(this,f,[...c(this,k,G).children].map(e=>{if(e instanceof HTMLElement)return new K(this,e)}).filter(e=>!!e))}disconnectedCallback(){c(this,T).disconnect()}};N=new WeakMap;B=new WeakMap;f=new WeakMap;T=new WeakMap;k=new WeakSet;G=function(){return this.shadowRoot?this.shadowRoot:this};exports.AccordionElement=te([Q.define("e-accordion")],exports.AccordionElement);
@@ -6,136 +6,125 @@ var e = (i, t, s) => (D(i, t, "read from private field"), s ? s.call(i) : t.get(
6
6
  if (t.has(i))
7
7
  throw TypeError("Cannot add the same private member more than once");
8
8
  t instanceof WeakSet ? t.add(i) : t.set(i, s);
9
- }, d = (i, t, s, a) => (D(i, t, "write to private field"), a ? a.call(i, s) : t.set(i, s), s);
9
+ }, d = (i, t, s, o) => (D(i, t, "write to private field"), o ? o.call(i, s) : t.set(i, s), s);
10
10
  var n = (i, t, s) => (D(i, t, "access private method"), s);
11
11
  import { CustomElement as V, define as X } from "../custom-element/index.js";
12
12
  import { Attribute as F } from "../attribute/index.js";
13
13
  import { i as Y } from "../browser-0zX67oeU.js";
14
14
  import { a as Z } from "../dom-0S_WDL4g.js";
15
- import { d as j } from "../events-_C2CztxR.js";
16
- import { a as ee } from "../style-CklEF62D.js";
17
- var te = Object.defineProperty, ie = Object.getOwnPropertyDescriptor, se = (i, t, s, a) => {
18
- for (var E = a > 1 ? void 0 : a ? ie(t, s) : t, R = i.length - 1, P; R >= 0; R--)
19
- (P = i[R]) && (E = (a ? P(t, s, E) : P(E)) || E);
20
- return a && E && te(t, s, E), E;
15
+ import { a as j, d as ee } from "../events-C_coq1Mk.js";
16
+ import { a as te } from "../style-CklEF62D.js";
17
+ var ie = Object.defineProperty, se = Object.getOwnPropertyDescriptor, re = (i, t, s, o) => {
18
+ for (var E = o > 1 ? void 0 : o ? se(t, s) : t, R = i.length - 1, P; R >= 0; R--)
19
+ (P = i[R]) && (E = (o ? P(t, s, E) : P(E)) || E);
20
+ return o && E && ie(t, s, E), E;
21
21
  }, Q = (i, t, s) => {
22
22
  if (!t.has(i))
23
23
  throw TypeError("Cannot " + s);
24
- }, c = (i, t, s) => (Q(i, t, "read from private field"), s ? s.call(i) : t.get(i)), A = (i, t, s) => {
24
+ }, c = (i, t, s) => (Q(i, t, "read from private field"), s ? s.call(i) : t.get(i)), y = (i, t, s) => {
25
25
  if (t.has(i))
26
26
  throw TypeError("Cannot add the same private member more than once");
27
27
  t instanceof WeakSet ? t.add(i) : t.set(i, s);
28
- }, N = (i, t, s, a) => (Q(i, t, "write to private field"), t.set(i, s), s), B, G, m, y, M, $, o, r, v, l, L, O, T, u, x, W, U, w, S, _, C, H, z, f, g, p, b, k, q, I;
28
+ }, N = (i, t, s, o) => (Q(i, t, "write to private field"), t.set(i, s), s), B, G, u, x, M, $, a, r, m, l, L, O, w, v, A, W, U, T, I, C, _, H, z, f, g, p, b, S, q, k;
29
29
  class J {
30
30
  constructor(t, s) {
31
31
  h(this, W);
32
- h(this, w);
32
+ h(this, T);
33
33
  h(this, f);
34
34
  h(this, p);
35
- h(this, k);
36
- h(this, o, null);
35
+ h(this, S);
36
+ h(this, a, null);
37
37
  h(this, r, null);
38
- h(this, v, null);
38
+ h(this, m, null);
39
39
  h(this, l, null);
40
40
  h(this, L, null);
41
41
  h(this, O, !1);
42
- h(this, T, void 0);
43
- h(this, u, !1);
44
- h(this, x, []);
45
- h(this, _, () => {
46
- e(this, u) ? this.close() : this.open();
47
- });
42
+ h(this, w, void 0);
43
+ h(this, v, !1);
44
+ h(this, A, []);
48
45
  h(this, C, () => {
49
- e(this, u) && (n(this, f, g).call(this, 0, !0), n(this, f, g).call(this, e(this, w, S)));
46
+ e(this, v) ? this.close() : this.open();
47
+ });
48
+ h(this, _, () => {
49
+ e(this, v) && (n(this, f, g).call(this, 0, !0), n(this, f, g).call(this, e(this, T, I)));
50
50
  });
51
51
  h(this, H, () => {
52
52
  n(this, p, b).call(this, "size-change");
53
53
  });
54
54
  h(this, z, (t) => {
55
- e(this, u) && (n(this, f, g).call(this, 0, !0), n(this, f, g).call(this, e(this, w, S)), e(this, x).forEach((s) => {
55
+ e(this, v) && (n(this, f, g).call(this, 0, !0), n(this, f, g).call(this, e(this, T, I)), e(this, A).forEach((s) => {
56
56
  s.element.scroll({
57
- left: e(this, o).axisAttribute.current === "x" ? s.scroll : 0,
58
- top: e(this, o).axisAttribute.current === "y" ? s.scroll : 0
57
+ left: e(this, a).axisAttribute.current === "x" ? s.scroll : 0,
58
+ top: e(this, a).axisAttribute.current === "y" ? s.scroll : 0
59
59
  });
60
60
  }));
61
61
  });
62
- h(this, I, () => {
62
+ h(this, k, () => {
63
63
  const t = Z(e(this, r));
64
- d(this, x, t.map((s) => ({
64
+ d(this, A, t.map((s) => ({
65
65
  element: s,
66
- scroll: e(this, o).axisAttribute.current === "y" ? s.scrollTop : s.scrollLeft
66
+ scroll: e(this, a).axisAttribute.current === "y" ? s.scrollTop : s.scrollLeft
67
67
  })));
68
68
  });
69
- s.firstElementChild instanceof HTMLElement && s.lastElementChild instanceof HTMLElement ? (d(this, o, t), d(this, r, s), d(this, v, s.firstElementChild), d(this, l, s.lastElementChild), e(this, v).style.cursor = "default", e(this, l).style.overflow = "hidden", e(this, o).axisAttribute.current === "y" ? e(this, l).style.height = "0px" : e(this, l).style.width = "0px", d(this, L, new ResizeObserver(e(this, H))), addEventListener("resize", e(this, C)), e(this, v).addEventListener("click", e(this, _)), e(this, r).addEventListener(
69
+ s.firstElementChild instanceof HTMLElement && s.lastElementChild instanceof HTMLElement ? (d(this, a, t), d(this, r, s), d(this, m, s.firstElementChild), d(this, l, s.lastElementChild), e(this, m).style.cursor = "default", e(this, l).style.overflow = "hidden", e(this, a).axisAttribute.current === "y" ? e(this, l).style.height = "0px" : e(this, l).style.width = "0px", d(this, L, new ResizeObserver(e(this, H))), addEventListener("resize", e(this, _)), e(this, m).addEventListener("click", e(this, C)), e(this, r).addEventListener(
70
+ "beforeSizeChange",
71
+ e(this, k)
72
+ ), e(this, r).addEventListener(
70
73
  "sizeChange",
71
74
  e(this, z)
72
- ), e(this, r).addEventListener(
73
- "beforeAccordionItemToggle",
74
- e(this, I)
75
75
  ), e(this, r).hasAttribute("data-opened") && this.open({ skipTransition: !0 })) : t.removeItem(e(this, r));
76
76
  }
77
77
  get element() {
78
78
  return e(this, r);
79
79
  }
80
80
  destroy() {
81
- e(this, v) && (e(this, r).classList.remove("opened", "triggered"), e(this, v).style.cursor = "", n(this, f, g).call(this, void 0), e(this, L).disconnect(), removeEventListener("resize", e(this, C)), e(this, v).removeEventListener("click", e(this, _)), e(this, r).removeEventListener(
81
+ e(this, m) && (e(this, r).classList.remove("opened", "triggered"), e(this, m).style.cursor = "", n(this, f, g).call(this, void 0), e(this, L).disconnect(), removeEventListener("resize", e(this, _)), e(this, m).removeEventListener("click", e(this, C)), e(this, r).removeEventListener(
82
+ "beforeSizeChange",
83
+ e(this, k)
84
+ ), e(this, r).removeEventListener(
82
85
  "sizeChange",
83
86
  e(this, z)
84
- ), e(this, r).removeEventListener(
85
- "beforeAccordionItemToggle",
86
- e(this, I)
87
- ), clearTimeout(e(this, T)));
87
+ ), clearTimeout(e(this, w)));
88
88
  }
89
89
  open(t) {
90
- n(this, p, b).call(this, "before-toggle"), t != null && t.skipTransition && n(this, k, q).call(this), e(this, o).multipleAttribute.current || e(this, o).closeAll({ exclude: e(this, r) }), e(this, O) || e(this, L).observe(e(this, l)), d(this, u, !0), clearTimeout(e(this, T)), e(this, r).classList.add("triggered"), n(this, f, g).call(this, e(this, w, S)), setTimeout(() => {
90
+ n(this, p, b).call(this, "before-toggle"), t != null && t.skipTransition && n(this, S, q).call(this), e(this, a).multipleAttribute.current || e(this, a).closeAll({ exclude: e(this, r) }), e(this, O) || e(this, L).observe(e(this, l)), d(this, v, !0), clearTimeout(e(this, w)), e(this, r).classList.add("triggered"), n(this, f, g).call(this, e(this, T, I)), setTimeout(() => {
91
91
  e(this, r).classList.add("opened");
92
92
  }, 0), n(this, p, b).call(this, "toggle");
93
93
  }
94
94
  close(t) {
95
- n(this, p, b).call(this, "before-toggle"), t != null && t.skipTransition && n(this, k, q).call(this), d(this, u, !1), e(this, r).classList.remove("opened"), n(this, f, g).call(this, 0), d(this, T, setTimeout(() => {
95
+ n(this, p, b).call(this, "before-toggle"), t != null && t.skipTransition && n(this, S, q).call(this), d(this, v, !1), e(this, r).classList.remove("opened"), n(this, f, g).call(this, 0), d(this, w, setTimeout(() => {
96
96
  e(this, r).classList.remove("triggered");
97
- }, ee(e(this, l)))), n(this, p, b).call(this, "toggle");
97
+ }, te(e(this, l)))), n(this, p, b).call(this, "toggle");
98
98
  }
99
99
  }
100
- o = new WeakMap(), r = new WeakMap(), v = new WeakMap(), l = new WeakMap(), L = new WeakMap(), O = new WeakMap(), T = new WeakMap(), u = new WeakMap(), x = new WeakMap(), W = new WeakSet(), U = function() {
100
+ a = new WeakMap(), r = new WeakMap(), m = new WeakMap(), l = new WeakMap(), L = new WeakMap(), O = new WeakMap(), w = new WeakMap(), v = new WeakMap(), A = new WeakMap(), W = new WeakSet(), U = function() {
101
101
  return e(this, r).parentElement || e(this, r).getRootNode();
102
- }, w = new WeakSet(), S = function() {
103
- return e(this, o).axisAttribute.current === "x" ? e(this, l).scrollWidth : e(this, l).scrollHeight;
104
- }, _ = new WeakMap(), C = new WeakMap(), H = new WeakMap(), z = new WeakMap(), f = new WeakSet(), g = function(t, s = !1) {
102
+ }, T = new WeakSet(), I = function() {
103
+ return e(this, a).axisAttribute.current === "x" ? e(this, l).scrollWidth : e(this, l).scrollHeight;
104
+ }, C = new WeakMap(), _ = new WeakMap(), H = new WeakMap(), z = new WeakMap(), f = new WeakSet(), g = function(t, s = !1) {
105
105
  s && (e(this, l).style.transition = "all 0s", setTimeout(() => {
106
106
  e(this, l).style.transition = "";
107
107
  }));
108
- const a = e(this, o).axisAttribute.current === "x" ? "width" : "height";
109
- t != null ? e(this, l).style[a] = `${t}px` : e(this, l).style[a] = "";
108
+ const o = e(this, a).axisAttribute.current === "x" ? "width" : "height";
109
+ t != null ? e(this, l).style[o] = `${t}px` : e(this, l).style[o] = "";
110
110
  }, p = new WeakSet(), b = function(t) {
111
- t === "before-toggle" ? e(this, r).dispatchEvent(
112
- new CustomEvent(
113
- "beforeAccordionItemToggle",
114
- {
115
- bubbles: !0,
116
- composed: !0,
117
- detail: {
118
- opened: e(this, u)
119
- }
120
- }
121
- )
122
- ) : t === "toggle" ? e(this, r).dispatchEvent(
111
+ t === "before-toggle" ? j(e(this, r)) : t === "toggle" ? e(this, r).dispatchEvent(
123
112
  new CustomEvent("accordionItemToggle", {
124
113
  bubbles: !0,
125
114
  composed: !0,
126
115
  detail: {
127
- opened: e(this, u)
116
+ opened: e(this, v)
128
117
  }
129
118
  })
130
- ) : t === "size-change" && j(e(this, W, U));
131
- }, k = new WeakSet(), q = function() {
119
+ ) : t === "size-change" && ee(e(this, W, U));
120
+ }, S = new WeakSet(), q = function() {
132
121
  e(this, l).style.transition = "all 0s", setTimeout(() => {
133
122
  e(this, l).style.transition = "";
134
123
  }, 50);
135
- }, I = new WeakMap();
124
+ }, k = new WeakMap();
136
125
  let K = class extends V {
137
126
  constructor() {
138
- super(), A(this, M), A(this, B, new F(this, "axis", "y")), A(this, G, new F(this, "multiple", !1)), A(this, m, []), A(this, y, null), Y && N(this, y, new MutationObserver((i) => {
127
+ super(), y(this, M), y(this, B, new F(this, "axis", "y")), y(this, G, new F(this, "multiple", !1)), y(this, u, []), y(this, x, null), Y && N(this, x, new MutationObserver((i) => {
139
128
  i.forEach((t) => {
140
129
  t.removedNodes.forEach((s) => {
141
130
  s instanceof HTMLElement && this.removeItem(s);
@@ -152,46 +141,46 @@ let K = class extends V {
152
141
  return c(this, G);
153
142
  }
154
143
  createItem(i) {
155
- c(this, m).find((t) => t.element === i) || c(this, m).push(new J(this, i));
144
+ c(this, u).find((t) => t.element === i) || c(this, u).push(new J(this, i));
156
145
  }
157
146
  removeItem(i) {
158
- N(this, m, c(this, m).filter((t) => {
147
+ N(this, u, c(this, u).filter((t) => {
159
148
  if (t.element !== i)
160
149
  return !0;
161
150
  t.destroy();
162
151
  }));
163
152
  }
164
153
  closeAll(i) {
165
- c(this, m).forEach((t) => {
154
+ c(this, u).forEach((t) => {
166
155
  (i == null ? void 0 : i.exclude) !== t.element && t.close(i);
167
156
  });
168
157
  }
169
158
  openAll(i) {
170
- c(this, m).forEach((t) => {
159
+ c(this, u).forEach((t) => {
171
160
  (i == null ? void 0 : i.exclude) !== t.element && t.open(i);
172
161
  });
173
162
  }
174
163
  connectedCallback() {
175
- c(this, y).observe(c(this, M, $), {
164
+ c(this, x).observe(c(this, M, $), {
176
165
  childList: !0
177
- }), N(this, m, [...c(this, M, $).children].map((i) => {
166
+ }), N(this, u, [...c(this, M, $).children].map((i) => {
178
167
  if (i instanceof HTMLElement)
179
168
  return new J(this, i);
180
169
  }).filter((i) => !!i));
181
170
  }
182
171
  disconnectedCallback() {
183
- c(this, y).disconnect();
172
+ c(this, x).disconnect();
184
173
  }
185
174
  };
186
175
  B = /* @__PURE__ */ new WeakMap();
187
176
  G = /* @__PURE__ */ new WeakMap();
188
- m = /* @__PURE__ */ new WeakMap();
189
- y = /* @__PURE__ */ new WeakMap();
177
+ u = /* @__PURE__ */ new WeakMap();
178
+ x = /* @__PURE__ */ new WeakMap();
190
179
  M = /* @__PURE__ */ new WeakSet();
191
180
  $ = function() {
192
181
  return this.shadowRoot ? this.shadowRoot : this;
193
182
  };
194
- K = se([
183
+ K = re([
195
184
  X("e-accordion")
196
185
  ], K);
197
186
  export {
@@ -4,6 +4,7 @@ export type En3RaycasterEventType = 'pointerDown' | 'pointerUp' | 'pointerMove'
4
4
  export type En3RaycasterEvent = {
5
5
  type: En3RaycasterEventType;
6
6
  originalEvent: PointerEvent;
7
+ target: Object3D;
7
8
  } & Intersection<Object3D>;
8
9
  export interface En3RaycasterOptions {
9
10
  targetName?: string;
@@ -1,4 +1,4 @@
1
- export declare class En3Controls {
1
+ export declare class En3Helpers {
2
2
  #private;
3
3
  constructor();
4
4
  destroy(): void;
@@ -7,6 +7,8 @@ export declare class En3Object3dManager {
7
7
  #private;
8
8
  constructor(object3d: Object3D, options?: En3Object3dManagerOptions);
9
9
  get object3d(): Object3D<import('three').Object3DEventMap>;
10
+ get helpers(): Object3D<import('three').Object3DEventMap>[];
11
+ get raycasterTarget(): Object3D<import('three').Object3DEventMap>;
10
12
  destroy(): void;
11
13
  save(): void;
12
14
  }
@@ -0,0 +1,5 @@
1
+ export declare class En3ParametersManager {
2
+ #private;
3
+ constructor(subject: any);
4
+ destroy(): void;
5
+ }
@@ -1 +1 @@
1
- "use strict";var tt=(p,i,r)=>{if(!i.has(p))throw TypeError("Cannot "+r)};var a=(p,i,r)=>(tt(p,i,"read from private field"),r?r.call(p):i.get(p)),u=(p,i,r)=>{if(i.has(p))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(p):i.set(p,r)},P=(p,i,r,e)=>(tt(p,i,"write to private field"),e?e.call(p,r):i.set(p,r),r);var Ne=(p,i,r)=>(tt(p,i,"access private method"),r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("../../en3-C4mzaF6q.cjs"),$=require("../../Store-6s0YXK4o.cjs"),t=require("three"),qt=require("../../Composed-Dx2hs-va.cjs");var Z,le,ce,he,Le,ge,Be;class st{constructor(i,r){u(this,ge);u(this,Z,void 0);u(this,le,void 0);u(this,ce,void 0);u(this,he,void 0);u(this,Le,!0);var n;P(this,Z,i),a(this,Z).userData.controlled=!0;const e=(r==null?void 0:r.step)||1e-4,s=i.name||"Unnamed",c=((n=i.userData)==null?void 0:n.box)||i;P(this,le,new $.Store([c.position.x,c.position.y,c.position.z],{passport:{name:`${s}.Position`,manager:{type:"number",step:e}}})),P(this,ce,new $.Store([c.rotation.x,c.rotation.y,c.rotation.z],{passport:{name:`${s}.Rotation`,manager:{type:"number",step:e,ease:.01}}})),P(this,he,new $.Store([c.scale.x,c.scale.y,c.scale.z],{passport:{name:`${s}.Scale`,manager:{type:"number",step:e}}})),this.save(),P(this,Le,!1),a(this,le).subscribe(h=>{Ne(this,ge,Be).call(this,"position",h.current)}),a(this,ce).subscribe(h=>{Ne(this,ge,Be).call(this,"rotation",h.current)}),a(this,he).subscribe(h=>{Ne(this,ge,Be).call(this,"scale",h.current)})}get object3d(){return a(this,Z)}destroy(){a(this,le).close(),a(this,ce).close(),a(this,he).close(),a(this,Z).userData.controlled=!1}save(){const i=(r,e)=>{(!a(this,Le)||r.initial===r.current)&&(r.current=[e.x,e.y,e.z])};i(a(this,le),a(this,Z).position),i(a(this,ce),a(this,Z).rotation),i(a(this,he),a(this,Z).scale)}}Z=new WeakMap,le=new WeakMap,ce=new WeakMap,he=new WeakMap,Le=new WeakMap,ge=new WeakSet,Be=function(i,r){const e=a(this,Z).userData.box;if(e){const s=c=>({x:r[0]-c.x,y:r[1]-c.y,z:r[2]-c.z});i==="position"?e.setPositionStep("_manager","+",s(e.getIncludedPositionSteps("_manager"))):i==="rotation"?e.setRotationStep("_manager","+",s(e.getIncludedRotationSteps("_manager"))):i==="scale"&&e.setScaleStep("_manager","+",s(e.getIncludedScaleSteps("_manager")))}else a(this,Z)[i].set(...r)};const Et={type:"change"},ot={type:"start"},Pt={type:"end"},Ue=new t.Ray,St=new t.Plane,Ft=Math.cos(70*t.MathUtils.DEG2RAD);class Wt extends t.EventDispatcher{constructor(i,r){super(),this.object=i,this.domElement=r,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 h.phi},this.getAzimuthalAngle=function(){return h.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(Et),e.update(),c=s.NONE},this.update=function(){const o=new t.Vector3,l=new t.Quaternion().setFromUnitVectors(i.up,new t.Vector3(0,1,0)),d=l.clone().invert(),f=new t.Vector3,D=new t.Quaternion,ee=new t.Vector3,X=2*Math.PI;return function(Ut=null){const gt=e.object.position;o.copy(gt).sub(e.target),o.applyQuaternion(l),h.setFromVector3(o),e.autoRotate&&c===s.NONE&&ie($e(Ut)),e.enableDamping?(h.theta+=w.theta*e.dampingFactor,h.phi+=w.phi*e.dampingFactor):(h.theta+=w.theta,h.phi+=w.phi);let W=e.minAzimuthAngle,B=e.maxAzimuthAngle;isFinite(W)&&isFinite(B)&&(W<-Math.PI?W+=X:W>Math.PI&&(W-=X),B<-Math.PI?B+=X:B>Math.PI&&(B-=X),W<=B?h.theta=Math.max(W,Math.min(B,h.theta)):h.theta=h.theta>(W+B)/2?Math.max(W,h.theta):Math.min(B,h.theta)),h.phi=Math.max(e.minPolarAngle,Math.min(e.maxPolarAngle,h.phi)),h.makeSafe(),e.enableDamping===!0?e.target.addScaledVector(Y,e.dampingFactor):e.target.add(Y),e.target.sub(e.cursor),e.target.clampLength(e.minTargetRadius,e.maxTargetRadius),e.target.add(e.cursor);let _e=!1;if(e.zoomToCursor&&me||e.object.isOrthographicCamera)h.radius=J(h.radius);else{const K=h.radius;h.radius=J(h.radius*A),_e=K!=h.radius}if(o.setFromSpherical(h),o.applyQuaternion(d),gt.copy(e.target).add(o),e.object.lookAt(e.target),e.enableDamping===!0?(w.theta*=1-e.dampingFactor,w.phi*=1-e.dampingFactor,Y.multiplyScalar(1-e.dampingFactor)):(w.set(0,0,0),Y.set(0,0,0)),e.zoomToCursor&&me){let K=null;if(e.object.isPerspectiveCamera){const Te=o.length();K=J(Te*A);const Ve=Te-K;e.object.position.addScaledVector(q,Ve),e.object.updateMatrixWorld(),_e=!!Ve}else if(e.object.isOrthographicCamera){const Te=new t.Vector3(v.x,v.y,0);Te.unproject(e.object);const Ve=e.object.zoom;e.object.zoom=Math.max(e.minZoom,Math.min(e.maxZoom,e.object.zoom/A)),e.object.updateProjectionMatrix(),_e=Ve!==e.object.zoom;const Mt=new t.Vector3(v.x,v.y,0);Mt.unproject(e.object),e.object.position.sub(Mt).add(Te),e.object.updateMatrixWorld(),K=o.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),e.zoomToCursor=!1;K!==null&&(this.screenSpacePanning?e.target.set(0,0,-1).transformDirection(e.object.matrix).multiplyScalar(K).add(e.object.position):(Ue.origin.copy(e.object.position),Ue.direction.set(0,0,-1).transformDirection(e.object.matrix),Math.abs(e.object.up.dot(Ue.direction))<Ft?i.lookAt(e.target):(St.setFromNormalAndCoplanarPoint(e.object.up,e.target),Ue.intersectPlane(St,e.target))))}else if(e.object.isOrthographicCamera){const K=e.object.zoom;e.object.zoom=Math.max(e.minZoom,Math.min(e.maxZoom,e.object.zoom/A)),K!==e.object.zoom&&(e.object.updateProjectionMatrix(),_e=!0)}return A=1,me=!1,_e||f.distanceToSquared(e.object.position)>n||8*(1-D.dot(e.object.quaternion))>n||ee.distanceToSquared(e.target)>n?(e.dispatchEvent(Et),f.copy(e.object.position),D.copy(e.object.quaternion),ee.copy(e.target),!0):!1}}(),this.dispose=function(){e.domElement.removeEventListener("contextmenu",wt),e.domElement.removeEventListener("pointerdown",dt),e.domElement.removeEventListener("pointercancel",xe),e.domElement.removeEventListener("wheel",ut),e.domElement.removeEventListener("pointermove",Je),e.domElement.removeEventListener("pointerup",xe),e.domElement.getRootNode().removeEventListener("keydown",mt,{capture:!0}),e._domElementKeyEvents!==null&&(e._domElementKeyEvents.removeEventListener("keydown",et),e._domElementKeyEvents=null)};const e=this,s={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let c=s.NONE;const n=1e-6,h=new t.Spherical,w=new t.Spherical;let A=1;const Y=new t.Vector3,k=new t.Vector2,R=new t.Vector2,U=new t.Vector2,z=new t.Vector2,S=new t.Vector2,T=new t.Vector2,x=new t.Vector2,b=new t.Vector2,g=new t.Vector2,q=new t.Vector3,v=new t.Vector2;let me=!1;const M=[],ne={};let Se=!1;function $e(o){return o!==null?2*Math.PI/60*e.autoRotateSpeed*o:2*Math.PI/60/60*e.autoRotateSpeed}function fe(o){const l=Math.abs(o*.01);return Math.pow(.95,e.zoomSpeed*l)}function ie(o){w.theta-=o}function ye(o){w.phi-=o}const H=function(){const o=new t.Vector3;return function(d,f){o.setFromMatrixColumn(f,0),o.multiplyScalar(-d),Y.add(o)}}(),L=function(){const o=new t.Vector3;return function(d,f){e.screenSpacePanning===!0?o.setFromMatrixColumn(f,1):(o.setFromMatrixColumn(f,0),o.crossVectors(e.object.up,o)),o.multiplyScalar(d),Y.add(o)}}(),G=function(){const o=new t.Vector3;return function(d,f){const D=e.domElement;if(e.object.isPerspectiveCamera){const ee=e.object.position;o.copy(ee).sub(e.target);let X=o.length();X*=Math.tan(e.object.fov/2*Math.PI/180),H(2*d*X/D.clientHeight,e.object.matrix),L(2*f*X/D.clientHeight,e.object.matrix)}else e.object.isOrthographicCamera?(H(d*(e.object.right-e.object.left)/e.object.zoom/D.clientWidth,e.object.matrix),L(f*(e.object.top-e.object.bottom)/e.object.zoom/D.clientHeight,e.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),e.enablePan=!1)}}();function j(o){e.object.isPerspectiveCamera||e.object.isOrthographicCamera?A/=o:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),e.enableZoom=!1)}function F(o){e.object.isPerspectiveCamera||e.object.isOrthographicCamera?A*=o:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),e.enableZoom=!1)}function E(o,l){if(!e.zoomToCursor)return;me=!0;const d=e.domElement.getBoundingClientRect(),f=o-d.left,D=l-d.top,ee=d.width,X=d.height;v.x=f/ee*2-1,v.y=-(D/X)*2+1,q.set(v.x,v.y,1).unproject(e.object).sub(e.object.position).normalize()}function J(o){return Math.max(e.minDistance,Math.min(e.maxDistance,o))}function se(o){k.set(o.clientX,o.clientY)}function we(o){E(o.clientX,o.clientX),x.set(o.clientX,o.clientY)}function Qe(o){z.set(o.clientX,o.clientY)}function Ge(o){R.set(o.clientX,o.clientY),U.subVectors(R,k).multiplyScalar(e.rotateSpeed);const l=e.domElement;ie(2*Math.PI*U.x/l.clientHeight),ye(2*Math.PI*U.y/l.clientHeight),k.copy(R),e.update()}function Lt(o){b.set(o.clientX,o.clientY),g.subVectors(b,x),g.y>0?j(fe(g.y)):g.y<0&&F(fe(g.y)),x.copy(b),e.update()}function jt(o){S.set(o.clientX,o.clientY),T.subVectors(S,z).multiplyScalar(e.panSpeed),G(T.x,T.y),z.copy(S),e.update()}function Dt(o){E(o.clientX,o.clientY),o.deltaY<0?F(fe(o.deltaY)):o.deltaY>0&&j(fe(o.deltaY)),e.update()}function Ct(o){let l=!1;switch(o.code){case e.keys.UP:o.ctrlKey||o.metaKey||o.shiftKey?ye(2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):G(0,e.keyPanSpeed),l=!0;break;case e.keys.BOTTOM:o.ctrlKey||o.metaKey||o.shiftKey?ye(-2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):G(0,-e.keyPanSpeed),l=!0;break;case e.keys.LEFT:o.ctrlKey||o.metaKey||o.shiftKey?ie(2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):G(e.keyPanSpeed,0),l=!0;break;case e.keys.RIGHT:o.ctrlKey||o.metaKey||o.shiftKey?ie(-2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):G(-e.keyPanSpeed,0),l=!0;break}l&&(o.preventDefault(),e.update())}function at(o){if(M.length===1)k.set(o.pageX,o.pageY);else{const l=be(o),d=.5*(o.pageX+l.x),f=.5*(o.pageY+l.y);k.set(d,f)}}function rt(o){if(M.length===1)z.set(o.pageX,o.pageY);else{const l=be(o),d=.5*(o.pageX+l.x),f=.5*(o.pageY+l.y);z.set(d,f)}}function lt(o){const l=be(o),d=o.pageX-l.x,f=o.pageY-l.y,D=Math.sqrt(d*d+f*f);x.set(0,D)}function Yt(o){e.enableZoom&&lt(o),e.enablePan&&rt(o)}function kt(o){e.enableZoom&&lt(o),e.enableRotate&&at(o)}function ct(o){if(M.length==1)R.set(o.pageX,o.pageY);else{const d=be(o),f=.5*(o.pageX+d.x),D=.5*(o.pageY+d.y);R.set(f,D)}U.subVectors(R,k).multiplyScalar(e.rotateSpeed);const l=e.domElement;ie(2*Math.PI*U.x/l.clientHeight),ye(2*Math.PI*U.y/l.clientHeight),k.copy(R)}function ht(o){if(M.length===1)S.set(o.pageX,o.pageY);else{const l=be(o),d=.5*(o.pageX+l.x),f=.5*(o.pageY+l.y);S.set(d,f)}T.subVectors(S,z).multiplyScalar(e.panSpeed),G(T.x,T.y),z.copy(S)}function pt(o){const l=be(o),d=o.pageX-l.x,f=o.pageY-l.y,D=Math.sqrt(d*d+f*f);b.set(0,D),g.set(0,Math.pow(b.y/x.y,e.zoomSpeed)),j(g.y),x.copy(b);const ee=(o.pageX+l.x)*.5,X=(o.pageY+l.y)*.5;E(ee,X)}function Rt(o){e.enableZoom&&pt(o),e.enablePan&&ht(o)}function zt(o){e.enableZoom&&pt(o),e.enableRotate&&ct(o)}function dt(o){e.enabled!==!1&&(M.length===0&&(e.domElement.setPointerCapture(o.pointerId),e.domElement.addEventListener("pointermove",Je),e.domElement.addEventListener("pointerup",xe)),!Nt(o)&&(Gt(o),o.pointerType==="touch"?yt(o):Ht(o)))}function Je(o){e.enabled!==!1&&(o.pointerType==="touch"?Qt(o):Xt(o))}function xe(o){switch(Vt(o),M.length){case 0:e.domElement.releasePointerCapture(o.pointerId),e.domElement.removeEventListener("pointermove",Je),e.domElement.removeEventListener("pointerup",xe),e.dispatchEvent(Pt),c=s.NONE;break;case 1:const l=M[0],d=ne[l];yt({pointerId:l,pageX:d.x,pageY:d.y});break}}function Ht(o){let l;switch(o.button){case 0:l=e.mouseButtons.LEFT;break;case 1:l=e.mouseButtons.MIDDLE;break;case 2:l=e.mouseButtons.RIGHT;break;default:l=-1}switch(l){case t.MOUSE.DOLLY:if(e.enableZoom===!1)return;we(o),c=s.DOLLY;break;case t.MOUSE.ROTATE:if(o.ctrlKey||o.metaKey||o.shiftKey){if(e.enablePan===!1)return;Qe(o),c=s.PAN}else{if(e.enableRotate===!1)return;se(o),c=s.ROTATE}break;case t.MOUSE.PAN:if(o.ctrlKey||o.metaKey||o.shiftKey){if(e.enableRotate===!1)return;se(o),c=s.ROTATE}else{if(e.enablePan===!1)return;Qe(o),c=s.PAN}break;default:c=s.NONE}c!==s.NONE&&e.dispatchEvent(ot)}function Xt(o){switch(c){case s.ROTATE:if(e.enableRotate===!1)return;Ge(o);break;case s.DOLLY:if(e.enableZoom===!1)return;Lt(o);break;case s.PAN:if(e.enablePan===!1)return;jt(o);break}}function ut(o){e.enabled===!1||e.enableZoom===!1||c!==s.NONE||(o.preventDefault(),e.dispatchEvent(ot),Dt(Zt(o)),e.dispatchEvent(Pt))}function Zt(o){const l=o.deltaMode,d={clientX:o.clientX,clientY:o.clientY,deltaY:o.deltaY};switch(l){case 1:d.deltaY*=16;break;case 2:d.deltaY*=100;break}return o.ctrlKey&&!Se&&(d.deltaY*=10),d}function mt(o){o.key==="Control"&&(Se=!0,e.domElement.getRootNode().addEventListener("keyup",ft,{passive:!0,capture:!0}))}function ft(o){o.key==="Control"&&(Se=!1,e.domElement.getRootNode().removeEventListener("keyup",ft,{passive:!0,capture:!0}))}function et(o){e.enabled===!1||e.enablePan===!1||Ct(o)}function yt(o){switch(bt(o),M.length){case 1:switch(e.touches.ONE){case t.TOUCH.ROTATE:if(e.enableRotate===!1)return;at(o),c=s.TOUCH_ROTATE;break;case t.TOUCH.PAN:if(e.enablePan===!1)return;rt(o),c=s.TOUCH_PAN;break;default:c=s.NONE}break;case 2:switch(e.touches.TWO){case t.TOUCH.DOLLY_PAN:if(e.enableZoom===!1&&e.enablePan===!1)return;Yt(o),c=s.TOUCH_DOLLY_PAN;break;case t.TOUCH.DOLLY_ROTATE:if(e.enableZoom===!1&&e.enableRotate===!1)return;kt(o),c=s.TOUCH_DOLLY_ROTATE;break;default:c=s.NONE}break;default:c=s.NONE}c!==s.NONE&&e.dispatchEvent(ot)}function Qt(o){switch(bt(o),c){case s.TOUCH_ROTATE:if(e.enableRotate===!1)return;ct(o),e.update();break;case s.TOUCH_PAN:if(e.enablePan===!1)return;ht(o),e.update();break;case s.TOUCH_DOLLY_PAN:if(e.enableZoom===!1&&e.enablePan===!1)return;Rt(o),e.update();break;case s.TOUCH_DOLLY_ROTATE:if(e.enableZoom===!1&&e.enableRotate===!1)return;zt(o),e.update();break;default:c=s.NONE}}function wt(o){e.enabled!==!1&&o.preventDefault()}function Gt(o){M.push(o.pointerId)}function Vt(o){delete ne[o.pointerId];for(let l=0;l<M.length;l++)if(M[l]==o.pointerId){M.splice(l,1);return}}function Nt(o){for(let l=0;l<M.length;l++)if(M[l]==o.pointerId)return!0;return!1}function bt(o){let l=ne[o.pointerId];l===void 0&&(l=new t.Vector2,ne[o.pointerId]=l),l.set(o.pageX,o.pageY)}function be(o){const l=o.pointerId===M[0]?M[1]:M[0];return ne[l]}e.domElement.addEventListener("contextmenu",wt),e.domElement.addEventListener("pointerdown",dt),e.domElement.addEventListener("pointercancel",xe),e.domElement.addEventListener("wheel",ut,{passive:!1}),e.domElement.getRootNode().addEventListener("keydown",mt,{passive:!0,capture:!0}),this.update()}}const ae=new t.Raycaster,I=new t.Vector3,te=new t.Vector3,y=new t.Quaternion,xt={X:new t.Vector3(1,0,0),Y:new t.Vector3(0,1,0),Z:new t.Vector3(0,0,1)},nt={type:"change"},_t={type:"mouseDown",mode:null},Tt={type:"mouseUp",mode:null},vt={type:"objectChange"};class Bt extends t.Object3D{constructor(i,r){super(),r===void 0&&(console.warn('THREE.TransformControls: The second parameter "domElement" is now mandatory.'),r=document),this.isTransformControls=!0,this.visible=!1,this.domElement=r,this.domElement.style.touchAction="none";const e=new oo;this._gizmo=e,this.add(e);const s=new no;this._plane=s,this.add(s);const c=this;function n(b,g){let q=g;Object.defineProperty(c,b,{get:function(){return q!==void 0?q:g},set:function(v){q!==v&&(q=v,s[b]=v,e[b]=v,c.dispatchEvent({type:b+"-changed",value:v}),c.dispatchEvent(nt))}}),c[b]=g,s[b]=g,e[b]=g}n("camera",i),n("object",void 0),n("enabled",!0),n("axis",null),n("mode","translate"),n("translationSnap",null),n("rotationSnap",null),n("scaleSnap",null),n("space","world"),n("size",1),n("dragging",!1),n("showX",!0),n("showY",!0),n("showZ",!0);const h=new t.Vector3,w=new t.Vector3,A=new t.Quaternion,Y=new t.Quaternion,k=new t.Vector3,R=new t.Quaternion,U=new t.Vector3,z=new t.Vector3,S=new t.Vector3,T=0,x=new t.Vector3;n("worldPosition",h),n("worldPositionStart",w),n("worldQuaternion",A),n("worldQuaternionStart",Y),n("cameraPosition",k),n("cameraQuaternion",R),n("pointStart",U),n("pointEnd",z),n("rotationAxis",S),n("rotationAngle",T),n("eye",x),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=Kt.bind(this),this._onPointerDown=Jt.bind(this),this._onPointerHover=$t.bind(this),this._onPointerMove=eo.bind(this),this._onPointerUp=to.bind(this),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointermove",this._onPointerHover),this.domElement.addEventListener("pointerup",this._onPointerUp)}updateMatrixWorld(i){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(i)}pointerHover(i){if(this.object===void 0||this.dragging===!0)return;i!==null&&ae.setFromCamera(i,this.camera);const r=it(this._gizmo.picker[this.mode],ae);r?this.axis=r.object.name:this.axis=null}pointerDown(i){if(!(this.object===void 0||this.dragging===!0||i!=null&&i.button!==0)&&this.axis!==null){i!==null&&ae.setFromCamera(i,this.camera);const r=it(this._plane,ae,!0);r&&(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(r.point).sub(this.worldPositionStart)),this.dragging=!0,_t.mode=this.mode,this.dispatchEvent(_t)}}pointerMove(i){const r=this.axis,e=this.mode,s=this.object;let c=this.space;if(e==="scale"?c="local":(r==="E"||r==="XYZE"||r==="XYZ")&&(c="world"),s===void 0||r===null||this.dragging===!1||i!==null&&i.button!==-1)return;i!==null&&ae.setFromCamera(i,this.camera);const n=it(this._plane,ae,!0);if(n){if(this.pointEnd.copy(n.point).sub(this.worldPositionStart),e==="translate")this._offset.copy(this.pointEnd).sub(this.pointStart),c==="local"&&r!=="XYZ"&&this._offset.applyQuaternion(this._worldQuaternionInv),r.indexOf("X")===-1&&(this._offset.x=0),r.indexOf("Y")===-1&&(this._offset.y=0),r.indexOf("Z")===-1&&(this._offset.z=0),c==="local"&&r!=="XYZ"?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),s.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(c==="local"&&(s.position.applyQuaternion(y.copy(this._quaternionStart).invert()),r.search("X")!==-1&&(s.position.x=Math.round(s.position.x/this.translationSnap)*this.translationSnap),r.search("Y")!==-1&&(s.position.y=Math.round(s.position.y/this.translationSnap)*this.translationSnap),r.search("Z")!==-1&&(s.position.z=Math.round(s.position.z/this.translationSnap)*this.translationSnap),s.position.applyQuaternion(this._quaternionStart)),c==="world"&&(s.parent&&s.position.add(I.setFromMatrixPosition(s.parent.matrixWorld)),r.search("X")!==-1&&(s.position.x=Math.round(s.position.x/this.translationSnap)*this.translationSnap),r.search("Y")!==-1&&(s.position.y=Math.round(s.position.y/this.translationSnap)*this.translationSnap),r.search("Z")!==-1&&(s.position.z=Math.round(s.position.z/this.translationSnap)*this.translationSnap),s.parent&&s.position.sub(I.setFromMatrixPosition(s.parent.matrixWorld))));else if(e==="scale"){if(r.search("XYZ")!==-1){let h=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(h*=-1),te.set(h,h,h)}else I.copy(this.pointStart),te.copy(this.pointEnd),I.applyQuaternion(this._worldQuaternionInv),te.applyQuaternion(this._worldQuaternionInv),te.divide(I),r.search("X")===-1&&(te.x=1),r.search("Y")===-1&&(te.y=1),r.search("Z")===-1&&(te.z=1);s.scale.copy(this._scaleStart).multiply(te),this.scaleSnap&&(r.search("X")!==-1&&(s.scale.x=Math.round(s.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),r.search("Y")!==-1&&(s.scale.y=Math.round(s.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),r.search("Z")!==-1&&(s.scale.z=Math.round(s.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(e==="rotate"){this._offset.copy(this.pointEnd).sub(this.pointStart);const h=20/this.worldPosition.distanceTo(I.setFromMatrixPosition(this.camera.matrixWorld));let w=!1;r==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(I.copy(this.rotationAxis).cross(this.eye))*h):(r==="X"||r==="Y"||r==="Z")&&(this.rotationAxis.copy(xt[r]),I.copy(xt[r]),c==="local"&&I.applyQuaternion(this.worldQuaternion),I.cross(this.eye),I.length()===0?w=!0:this.rotationAngle=this._offset.dot(I.normalize())*h),(r==="E"||w)&&(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"&&r!=="E"&&r!=="XYZE"?(s.quaternion.copy(this._quaternionStart),s.quaternion.multiply(y.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),s.quaternion.copy(y.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),s.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(nt),this.dispatchEvent(vt)}}pointerUp(i){i!==null&&i.button!==0||(this.dragging&&this.axis!==null&&(Tt.mode=this.mode,this.dispatchEvent(Tt)),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(i){i.geometry&&i.geometry.dispose(),i.material&&i.material.dispose()})}attach(i){return this.object=i,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(nt),this.dispatchEvent(vt),this.pointStart.copy(this.pointEnd))}getRaycaster(){return ae}getMode(){return this.mode}setMode(i){this.mode=i}setTranslationSnap(i){this.translationSnap=i}setRotationSnap(i){this.rotationSnap=i}setScaleSnap(i){this.scaleSnap=i}setSize(i){this.size=i}setSpace(i){this.space=i}}function Kt(p){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:p.button};{const i=this.domElement.getBoundingClientRect();return{x:(p.clientX-i.left)/i.width*2-1,y:-(p.clientY-i.top)/i.height*2+1,button:p.button}}}function $t(p){if(this.enabled)switch(p.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(p));break}}function Jt(p){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(p.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(p)),this.pointerDown(this._getPointer(p)))}function eo(p){this.enabled&&this.pointerMove(this._getPointer(p))}function to(p){this.enabled&&(this.domElement.releasePointerCapture(p.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(p)))}function it(p,i,r){const e=i.intersectObject(p,!0);for(let s=0;s<e.length;s++)if(e[s].object.visible||r)return e[s];return!1}const qe=new t.Euler,m=new t.Vector3(0,1,0),It=new t.Vector3(0,0,0),Ot=new t.Matrix4,Fe=new t.Quaternion,Ke=new t.Quaternion,N=new t.Vector3,At=new t.Matrix4,Oe=new t.Vector3(1,0,0),re=new t.Vector3(0,1,0),Ae=new t.Vector3(0,0,1),We=new t.Vector3,ve=new t.Vector3,Ie=new t.Vector3;class oo extends t.Object3D{constructor(){super(),this.isTransformControlsGizmo=!0,this.type="TransformControlsGizmo";const i=new t.MeshBasicMaterial({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),r=new t.LineBasicMaterial({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),e=i.clone();e.opacity=.15;const s=r.clone();s.opacity=.5;const c=i.clone();c.color.setHex(16711680);const n=i.clone();n.color.setHex(65280);const h=i.clone();h.color.setHex(255);const w=i.clone();w.color.setHex(16711680),w.opacity=.5;const A=i.clone();A.color.setHex(65280),A.opacity=.5;const Y=i.clone();Y.color.setHex(255),Y.opacity=.5;const k=i.clone();k.opacity=.25;const R=i.clone();R.color.setHex(16776960),R.opacity=.25,i.clone().color.setHex(16776960);const z=i.clone();z.color.setHex(7895160);const S=new t.CylinderGeometry(0,.04,.1,12);S.translate(0,.05,0);const T=new t.BoxGeometry(.08,.08,.08);T.translate(0,.04,0);const x=new t.BufferGeometry;x.setAttribute("position",new t.Float32BufferAttribute([0,0,0,1,0,0],3));const b=new t.CylinderGeometry(.0075,.0075,.5,3);b.translate(0,.25,0);function g(L,G){const j=new t.TorusGeometry(L,.0075,3,64,G*Math.PI*2);return j.rotateY(Math.PI/2),j.rotateX(Math.PI/2),j}function q(){const L=new t.BufferGeometry;return L.setAttribute("position",new t.Float32BufferAttribute([0,0,0,1,1,1],3)),L}const v={X:[[new t.Mesh(S,c),[.5,0,0],[0,0,-Math.PI/2]],[new t.Mesh(S,c),[-.5,0,0],[0,0,Math.PI/2]],[new t.Mesh(b,c),[0,0,0],[0,0,-Math.PI/2]]],Y:[[new t.Mesh(S,n),[0,.5,0]],[new t.Mesh(S,n),[0,-.5,0],[Math.PI,0,0]],[new t.Mesh(b,n)]],Z:[[new t.Mesh(S,h),[0,0,.5],[Math.PI/2,0,0]],[new t.Mesh(S,h),[0,0,-.5],[-Math.PI/2,0,0]],[new t.Mesh(b,h),null,[Math.PI/2,0,0]]],XYZ:[[new t.Mesh(new t.OctahedronGeometry(.1,0),k.clone()),[0,0,0]]],XY:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),Y.clone()),[.15,.15,0]]],YZ:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),w.clone()),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),A.clone()),[.15,0,.15],[-Math.PI/2,0,0]]]},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]]],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]]]},M={START:[[new t.Mesh(new t.OctahedronGeometry(.01,2),s),null,null,null,"helper"]],END:[[new t.Mesh(new t.OctahedronGeometry(.01,2),s),null,null,null,"helper"]],DELTA:[[new t.Line(q(),s),null,null,null,"helper"]],X:[[new t.Line(x,s.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new t.Line(x,s.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new t.Line(x,s.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},ne={XYZE:[[new t.Mesh(g(.5,1),z),null,[0,Math.PI/2,0]]],X:[[new t.Mesh(g(.5,.5),c)]],Y:[[new t.Mesh(g(.5,.5),n),null,[0,0,-Math.PI/2]]],Z:[[new t.Mesh(g(.5,.5),h),null,[0,Math.PI/2,0]]],E:[[new t.Mesh(g(.75,1),R),null,[0,Math.PI/2,0]]]},Se={AXIS:[[new t.Line(x,s.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]]},$e={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)]]},fe={X:[[new t.Mesh(T,c),[.5,0,0],[0,0,-Math.PI/2]],[new t.Mesh(b,c),[0,0,0],[0,0,-Math.PI/2]],[new t.Mesh(T,c),[-.5,0,0],[0,0,Math.PI/2]]],Y:[[new t.Mesh(T,n),[0,.5,0]],[new t.Mesh(b,n)],[new t.Mesh(T,n),[0,-.5,0],[0,0,Math.PI]]],Z:[[new t.Mesh(T,h),[0,0,.5],[Math.PI/2,0,0]],[new t.Mesh(b,h),[0,0,0],[Math.PI/2,0,0]],[new t.Mesh(T,h),[0,0,-.5],[-Math.PI/2,0,0]]],XY:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),Y),[.15,.15,0]]],YZ:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),w),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),A),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new t.Mesh(new t.BoxGeometry(.1,.1,.1),k.clone())]]},ie={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]]]},ye={X:[[new t.Line(x,s.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new t.Line(x,s.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new t.Line(x,s.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]};function H(L){const G=new t.Object3D;for(const j in L)for(let F=L[j].length;F--;){const E=L[j][F][0].clone(),J=L[j][F][1],se=L[j][F][2],we=L[j][F][3],Qe=L[j][F][4];E.name=j,E.tag=Qe,J&&E.position.set(J[0],J[1],J[2]),se&&E.rotation.set(se[0],se[1],se[2]),we&&E.scale.set(we[0],we[1],we[2]),E.updateMatrix();const Ge=E.geometry.clone();Ge.applyMatrix4(E.matrix),E.geometry=Ge,E.renderOrder=1/0,E.position.set(0,0,0),E.rotation.set(0,0,0),E.scale.set(1,1,1),G.add(E)}return G}this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=H(v)),this.add(this.gizmo.rotate=H(ne)),this.add(this.gizmo.scale=H(fe)),this.add(this.picker.translate=H(me)),this.add(this.picker.rotate=H($e)),this.add(this.picker.scale=H(ie)),this.add(this.helper.translate=H(M)),this.add(this.helper.rotate=H(Se)),this.add(this.helper.scale=H(ye)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}updateMatrixWorld(i){const e=(this.mode==="scale"?"local":this.space)==="local"?this.worldQuaternion:Ke;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 s=[];s=s.concat(this.picker[this.mode].children),s=s.concat(this.gizmo[this.mode].children),s=s.concat(this.helper[this.mode].children);for(let c=0;c<s.length;c++){const n=s[c];n.visible=!0,n.rotation.set(0,0,0),n.position.copy(this.worldPosition);let h;if(this.camera.isOrthographicCamera?h=(this.camera.top-this.camera.bottom)/this.camera.zoom:h=this.worldPosition.distanceTo(this.cameraPosition)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),n.scale.set(1,1,1).multiplyScalar(h*this.size/4),n.tag==="helper"){n.visible=!1,n.name==="AXIS"?(n.visible=!!this.axis,this.axis==="X"&&(y.setFromEuler(qe.set(0,0,0)),n.quaternion.copy(e).multiply(y),Math.abs(m.copy(Oe).applyQuaternion(e).dot(this.eye))>.9&&(n.visible=!1)),this.axis==="Y"&&(y.setFromEuler(qe.set(0,0,Math.PI/2)),n.quaternion.copy(e).multiply(y),Math.abs(m.copy(re).applyQuaternion(e).dot(this.eye))>.9&&(n.visible=!1)),this.axis==="Z"&&(y.setFromEuler(qe.set(0,Math.PI/2,0)),n.quaternion.copy(e).multiply(y),Math.abs(m.copy(Ae).applyQuaternion(e).dot(this.eye))>.9&&(n.visible=!1)),this.axis==="XYZE"&&(y.setFromEuler(qe.set(0,Math.PI/2,0)),m.copy(this.rotationAxis),n.quaternion.setFromRotationMatrix(Ot.lookAt(It,m,re)),n.quaternion.multiply(y),n.visible=this.dragging),this.axis==="E"&&(n.visible=!1)):n.name==="START"?(n.position.copy(this.worldPositionStart),n.visible=this.dragging):n.name==="END"?(n.position.copy(this.worldPosition),n.visible=this.dragging):n.name==="DELTA"?(n.position.copy(this.worldPositionStart),n.quaternion.copy(this.worldQuaternionStart),I.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),I.applyQuaternion(this.worldQuaternionStart.clone().invert()),n.scale.copy(I),n.visible=this.dragging):(n.quaternion.copy(e),this.dragging?n.position.copy(this.worldPositionStart):n.position.copy(this.worldPosition),this.axis&&(n.visible=this.axis.search(n.name)!==-1));continue}n.quaternion.copy(e),this.mode==="translate"||this.mode==="scale"?(n.name==="X"&&Math.abs(m.copy(Oe).applyQuaternion(e).dot(this.eye))>.99&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="Y"&&Math.abs(m.copy(re).applyQuaternion(e).dot(this.eye))>.99&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="Z"&&Math.abs(m.copy(Ae).applyQuaternion(e).dot(this.eye))>.99&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="XY"&&Math.abs(m.copy(Ae).applyQuaternion(e).dot(this.eye))<.2&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="YZ"&&Math.abs(m.copy(Oe).applyQuaternion(e).dot(this.eye))<.2&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="XZ"&&Math.abs(m.copy(re).applyQuaternion(e).dot(this.eye))<.2&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1)):this.mode==="rotate"&&(Fe.copy(e),m.copy(this.eye).applyQuaternion(y.copy(e).invert()),n.name.search("E")!==-1&&n.quaternion.setFromRotationMatrix(Ot.lookAt(this.eye,It,re)),n.name==="X"&&(y.setFromAxisAngle(Oe,Math.atan2(-m.y,m.z)),y.multiplyQuaternions(Fe,y),n.quaternion.copy(y)),n.name==="Y"&&(y.setFromAxisAngle(re,Math.atan2(m.x,m.z)),y.multiplyQuaternions(Fe,y),n.quaternion.copy(y)),n.name==="Z"&&(y.setFromAxisAngle(Ae,Math.atan2(m.y,m.x)),y.multiplyQuaternions(Fe,y),n.quaternion.copy(y))),n.visible=n.visible&&(n.name.indexOf("X")===-1||this.showX),n.visible=n.visible&&(n.name.indexOf("Y")===-1||this.showY),n.visible=n.visible&&(n.name.indexOf("Z")===-1||this.showZ),n.visible=n.visible&&(n.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),n.material._color=n.material._color||n.material.color.clone(),n.material._opacity=n.material._opacity||n.material.opacity,n.material.color.copy(n.material._color),n.material.opacity=n.material._opacity,this.enabled&&this.axis&&(n.name===this.axis||this.axis.split("").some(function(w){return n.name===w}))&&(n.material.color.setHex(16776960),n.material.opacity=1)}super.updateMatrixWorld(i)}}class no 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(i){let r=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(r="local"),We.copy(Oe).applyQuaternion(r==="local"?this.worldQuaternion:Ke),ve.copy(re).applyQuaternion(r==="local"?this.worldQuaternion:Ke),Ie.copy(Ae).applyQuaternion(r==="local"?this.worldQuaternion:Ke),m.copy(ve),this.mode){case"translate":case"scale":switch(this.axis){case"X":m.copy(this.eye).cross(We),N.copy(We).cross(m);break;case"Y":m.copy(this.eye).cross(ve),N.copy(ve).cross(m);break;case"Z":m.copy(this.eye).cross(Ie),N.copy(Ie).cross(m);break;case"XY":N.copy(Ie);break;case"YZ":N.copy(We);break;case"XZ":m.copy(Ie),N.copy(ve);break;case"XYZ":case"E":N.set(0,0,0);break}break;case"rotate":default:N.set(0,0,0)}N.length()===0?this.quaternion.copy(this.cameraQuaternion):(At.lookAt(I.set(0,0,0),N,m),this.quaternion.setFromRotationMatrix(At)),super.updateMatrixWorld(i)}}var Q,pe;class io{constructor(){u(this,Q,void 0);u(this,pe,void 0);P(this,Q,new Wt(O.en3.camera,O.en3.webglRenderer.domElement)),P(this,pe,new $.Store([0,0,0],{passport:{name:"Controls.OrbitControls.Target",manager:{type:"number",step:1e-4,ease:10}}}));let i=!0;a(this,pe).subscribe(r=>{a(this,Q).target.set(...r.current),i&&a(this,Q).update()}),a(this,Q).addEventListener("change",()=>{i=!1,a(this,pe).current=[a(this,Q).target.x,a(this,Q).target.y,a(this,Q).target.z],i=!0})}get controls(){return a(this,Q)}destroy(){a(this,Q).dispose(),a(this,pe).close()}}Q=new WeakMap,pe=new WeakMap;var C,je,De,Ce,Ye,ke,Re,ze;class so{constructor(){u(this,C,null);u(this,je,new $.Store(O.en3.camera.far,{passport:{name:"Helpers.Grid.Size",manager:{type:"number",step:1}}}));u(this,De,new $.Store(100,{passport:{name:"Helpers.Grid.Divisions",manager:{type:"number"}}}));u(this,Ce,new $.Store("#0000ff",{passport:{name:"Helpers.Grid.Color 1",manager:{type:"color"}}}));u(this,Ye,new $.Store("#808080",{passport:{name:"Helpers.Grid.Color 2",manager:{type:"color"}}}));u(this,ke,new $.Store(!1,{passport:{name:"Helpers.Grid.Vertical",manager:{type:"boolean"}}}));u(this,Re,void 0);u(this,ze,i=>{i.key==="g"&&(a(this,C).visible=!a(this,C).visible)});P(this,Re,new qt.Composed([a(this,je),a(this,De),a(this,Ce),a(this,Ye),a(this,ke)],()=>{a(this,C)&&(O.en3.view.remove(a(this,C)),a(this,C).dispose()),P(this,C,new t.GridHelper(a(this,je).current,a(this,De).current,a(this,Ce).current,a(this,Ye).current)),a(this,C).rotation.x=a(this,ke).current?Math.PI/2:0,O.en3.view.add(a(this,C))})),addEventListener("keydown",a(this,ze))}get helper(){return a(this,C)}destroy(){a(this,Re).close(),a(this,C)&&(O.en3.view.remove(a(this,C)),a(this,C).dispose()),removeEventListener("keydown",a(this,ze))}}C=new WeakMap,je=new WeakMap,De=new WeakMap,Ce=new WeakMap,Ye=new WeakMap,ke=new WeakMap,Re=new WeakMap,ze=new WeakMap;var _,V,oe,de,He,Me,Xe;class ao{constructor(){u(this,_,void 0);u(this,V,[]);u(this,oe,null);u(this,de,i=>{i.child.name&&!a(this,V).find(r=>r.object3d===i.child)&&(a(this,V).push(new st(i.child)),O.en3.raycaster.add(i.child),i.child.addEventListener("pointerDown",a(this,Me)),i.child.addEventListener("childadded",a(this,de)))});u(this,He,i=>{const r=a(this,V).find(e=>e.object3d===i.child);r&&(r.destroy(),O.en3.raycaster.remove(i.child),r.object3d.removeEventListener("pointerDown",a(this,Me)),i.child.removeEventListener("childadded",a(this,de)),P(this,V,a(this,V).filter(e=>e!==r)))});u(this,Me,i=>{P(this,oe,a(this,V).find(r=>r.object3d===i.object)||null),a(this,oe)&&a(this,_).attach(a(this,oe).object3d)});u(this,Xe,i=>{i.key==="t"?a(this,_).setMode("translate"):i.key==="r"?a(this,_).setMode("rotate"):i.key==="s"?a(this,_).setMode("scale"):i.key==="Escape"?a(this,_).detach():i.key==="+"||i.key==="="?a(this,_).setSize(a(this,_).size+.1):(i.key==="-"||i.key==="_")&&a(this,_).setSize(a(this,_).size-.1)});P(this,_,new Bt(O.en3.camera,O.en3.webglRenderer.domElement)),a(this,_).addEventListener("objectChange",i=>{a(this,oe)&&a(this,oe).save()}),O.en3.view.add(a(this,_)),O.en3.scene.addEventListener("childadded",a(this,de)),O.en3.scene.addEventListener("childremoved",a(this,He)),window.addEventListener("keydown",a(this,Xe))}get controls(){return a(this,_)}destroy(){O.en3.scene.removeEventListener("childadded",a(this,de)),O.en3.scene.removeEventListener("childremoved",a(this,He)),window.removeEventListener("keydown",a(this,Xe)),a(this,_).dispose(),a(this,V).forEach(i=>{i.destroy(),i.object3d.removeEventListener("pointerDown",a(this,Me))}),P(this,V,[])}}_=new WeakMap,V=new WeakMap,oe=new WeakMap,de=new WeakMap,He=new WeakMap,Me=new WeakMap,Xe=new WeakMap;var Ze,Ee,ue,Pe;class ro{constructor(){u(this,Ze,void 0);u(this,Ee,void 0);u(this,ue,void 0);u(this,Pe,void 0);P(this,Ze,new so),P(this,Ee,new st(O.en3.camera)),P(this,ue,new io),a(this,ue).controls.addEventListener("change",()=>{a(this,Ee).save()}),P(this,Pe,new ao),a(this,Pe).controls.addEventListener("dragging-changed",i=>{a(this,ue).controls.enabled=!i.value})}destroy(){a(this,Ze).destroy(),a(this,Ee).destroy(),a(this,ue).destroy(),a(this,Pe).destroy()}}Ze=new WeakMap,Ee=new WeakMap,ue=new WeakMap,Pe=new WeakMap;exports.En3Controls=ro;exports.En3Object3dManager=st;
1
+ "use strict";var xn=Object.defineProperty;var Gt=Object.getOwnPropertySymbols;var vn=Object.prototype.hasOwnProperty,Tn=Object.prototype.propertyIsEnumerable;var Ft=(p,o,s)=>o in p?xn(p,o,{enumerable:!0,configurable:!0,writable:!0,value:s}):p[o]=s,st=(p,o)=>{for(var s in o||(o={}))vn.call(o,s)&&Ft(p,s,o[s]);if(Gt)for(var s of Gt(o))Tn.call(o,s)&&Ft(p,s,o[s]);return p};var gt=(p,o,s)=>{if(!o.has(p))throw TypeError("Cannot "+s)};var a=(p,o,s)=>(gt(p,o,"read from private field"),s?s.call(p):o.get(p)),u=(p,o,s)=>{if(o.has(p))throw TypeError("Cannot add the same private member more than once");o instanceof WeakSet?o.add(p):o.set(p,s)},S=(p,o,s,e)=>(gt(p,o,"write to private field"),e?e.call(p,s):o.set(p,s),s);var _=(p,o,s)=>(gt(p,o,"access private method"),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("../../en3-BQMd-J6t.cjs"),X=require("../../Store-6s0YXK4o.cjs"),t=require("three"),_n=require("../../traverseMaterials-Crv7f9BJ.cjs"),Nt=require("../../ticker/index.cjs"),On=require("../../Composed-Dx2hs-va.cjs");function In(p){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(p){for(const s in p)if(s!=="default"){const e=Object.getOwnPropertyDescriptor(p,s);Object.defineProperty(o,s,e.get?e:{enumerable:!0,get:()=>p[s]})}}return o.default=p,Object.freeze(o)}const G=In(t),Ln=["AddEquation","SubtractEquation","ReverseSubtractEquation","MinEquation","MaxEquation"],tn=["ZeroFactor","OneFactor","SrcColorFactor","OneMinusSrcColorFactor","SrcAlphaFactor","OneMinusSrcAlphaFactor","DstAlphaFactor","OneMinusDstAlphaFactor","DstColorFactor","OneMinusDstColorFactor","SrcAlphaSaturateFactor","ConstantColorFactor","OneMinusConstantColorFactor","ConstantAlphaFactor","OneMinusConstantAlphaFactor"],An=[...tn,"SrcAlphaSaturateFactor"],Dn=["NoBlending","NormalBlending","AdditiveBlending","SubtractiveBlending","MultiplyBlending","CustomBlending"],jn=["NeverDepth","AlwaysDepth","EqualDepth","LessDepth","LessEqualDepth ","GreaterEqualDepth ","GreaterDepth","NotEqualDepth"],kn=["NeverStencilFunc","LessStencilFunc","EqualStencilFunc","LessEqualStencilFunc ","GreaterStencilFunc","NotEqualStencilFunc ","GreaterEqualStencilFunc","AlwaysStencilFunc"],Mt=["ZeroStencilOp","KeepStencilOp","ReplaceStencilOp","IncrementStencilOp","DecrementStencilOp","IncrementWrapStencilOp","DecrementWrapStencilOp","InvertStencilOp"],Hn=["FrontSide","BackSide","DoubleSide"],Rn=["TangentSpaceNormalMap","ObjectSpaceNormalMap"],Yn=["round","bevel","miter"],Cn=["NoToneMapping","LinearToneMapping","ReinhardToneMapping","CineonToneMapping","ACESFilmicToneMapping","AgXToneMapping","NeutralToneMapping","CustomToneMapping"],zn=["BasicShadowMap","PCFShadowMap","PCFSoftShadowMap","VSMShadowMap"],ke={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:An},blendDstAlpha:{type:"number",min:0,max:1,step:.001},blendEquation:{type:"select",variants:Ln},blendEquationAlpha:{type:"number",min:0,max:1,step:.001},blending:{type:"select",variants:Dn},blendSrc:{type:"select",variants:tn},blendSrcAlpha:{type:"number",min:0,max:1,step:.001},depthFunc:{type:"select",variants:jn},stencilFunc:{type:"select",variants:kn},stencilRef:{type:"number",min:0,step:1},stencilFail:{type:"select",variants:Mt},stencilZFail:{type:"select",variants:Mt},stencilZPass:{type:"select",variants:Mt},opacity:{type:"number",min:0,max:1,step:1e-4},side:{type:"select",variants:Hn},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:Rn},wireframeLinejoin:{type:"select",variants:Yn},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:Cn},toneMappingExposure:{type:"number",min:0,step:.001,ease:.1},mapSize:{type:"number",min:0,step:1}},Xn={type:{type:"select",variants:zn}},Zn=new Set(["stencilFuncMask","needsUpdate","version","wireframeLinewidth","position","scale","rotation","coordinateSystem","aspect","autoUpdate","up"]);var L,oe,ie,de,mt,on,ut,sn,dt,an,ft,rn,ze,xt;class nn{constructor(o){u(this,ie);u(this,mt);u(this,ut);u(this,dt);u(this,ft);u(this,ze);u(this,L,void 0);u(this,oe,[]);if(S(this,L,o),a(this,L)instanceof G.Object3D){if(_(this,ie,de).call(this,a(this,L),`${a(this,L).name}.Parameters`,ke,a(this,L)instanceof G.Camera?()=>{P.en3.view.resize()}:void 0),a(this,L)instanceof G.Mesh){const s=a(this,L).material;s instanceof G.Material&&_(this,ie,de).call(this,s,`${a(this,L).name}.Parameters.Material`,ke,()=>{s.needsUpdate=!0})}else if(a(this,L)instanceof G.Light){const s=a(this,L).shadow;if(s){_(this,ie,de).call(this,s,`${a(this,L).name}.Parameters.Shadow`,ke,()=>{s.needsUpdate=!0});const e=s.camera;e&&_(this,ie,de).call(this,e,`${a(this,L).name}.Parameters.Shadow.Camera`,ke,()=>{s.camera.updateProjectionMatrix()})}}}else if(a(this,L)instanceof G.WebGLRenderer){const s=a(this,L);_(this,ie,de).call(this,s,"Renderer",ke),_(this,ie,de).call(this,s.shadowMap,"Renderer.shadowMap",Xn,()=>{s.shadowMap.needsUpdate=!0,_n.traverseMaterials(P.en3.scene,e=>{e.needsUpdate=!0})})}}destroy(){a(this,oe).forEach(o=>{o.close()})}}L=new WeakMap,oe=new WeakMap,ie=new WeakSet,de=function(o,s,e,r){for(const c in o){if(c.startsWith("_")||Zn.has(c))continue;const i=o[c],l=`${s}.${c}`,m=e[c];typeof i=="number"?(m==null?void 0:m.type)==="select"?_(this,ze,xt).call(this,l,i,o,c,m,r):_(this,mt,on).call(this,l,i,o,c,m,r):i instanceof G.Vector2||i instanceof G.Vector3?_(this,ut,sn).call(this,l,i,o,c,m,r):typeof i=="boolean"&&!c.startsWith("is")&&!c.startsWith("matrix")?_(this,dt,an).call(this,l,i,o,c,r):i instanceof G.Color?_(this,ft,rn).call(this,l,i,o,c,r):m&&(m==null?void 0:m.type)==="select"&&_(this,ze,xt).call(this,l,i,o,c,m,r)}},mt=new WeakSet,on=function(o,s,e,r,c,i){const l=new X.Store(s,{passport:{name:o,manager:st({type:"number"},c)}});l.subscribe(m=>{e[r]=m.current,i==null||i()}),a(this,oe).push(l)},ut=new WeakSet,sn=function(o,s,e,r,c,i){const l=d=>{const y=[d.x,d.y];return d instanceof G.Vector3&&y.push(d.z),y},m=new X.Store(l(s),{passport:{name:o,manager:st({type:"number"},c)}});m.subscribe(d=>{e[r].set(...d.current),i==null||i()}),a(this,oe).push(m)},dt=new WeakSet,an=function(o,s,e,r,c){const i=new X.Store(s,{passport:{name:o,manager:{type:"boolean"}}});i.subscribe(l=>{e[r]=l.current,c==null||c()}),a(this,oe).push(i)},ft=new WeakSet,rn=function(o,s,e,r,c){const i=new X.Store(`#${s.getHexString()}`,{passport:{name:o,manager:{type:"color"}}});i.subscribe(l=>{e[r]=new G.Color(l.current),c==null||c()}),a(this,oe).push(i)},ze=new WeakSet,xt=function(o,s,e,r,c,i){const l=c.variants;let m=null;for(const y of l)s===G[y]&&(m=y);const d=new X.Store(m||s,{passport:{name:o,manager:st({},c)}});d.subscribe(y=>{typeof y.current=="string"&&(y.current[0]===y.current[0].toUpperCase()?e[r]=G[y.current]:e[r]=y.current),i==null||i()}),a(this,oe).push(d)};var g,Xe,ye,be,we,Ze,B,Te,ht,Ge;class Tt{constructor(o,s){u(this,Te);u(this,g,void 0);u(this,Xe,null);u(this,ye,void 0);u(this,be,void 0);u(this,we,void 0);u(this,Ze,!0);u(this,B,[]);u(this,Ge,()=>{a(this,B).forEach(o=>{"update"in o&&o.update()})});var l,m;S(this,g,o);let e=!1;o.name.startsWith("T.")&&(o.name=o.name.slice(2)),o.name.includes("P.")&&(e=!0,o.name=o.name.replace("P.",""));const r=o.name;a(this,g).userData.controlled=!0;const c=(s==null?void 0:s.step)||1e-4,i=((l=o.userData)==null?void 0:l.box)||o;if(a(this,g)instanceof t.Light){let d;a(this,g)instanceof t.PointLight?d=new t.PointLightHelper(a(this,g),100):a(this,g)instanceof t.DirectionalLight?(a(this,g).scale.setScalar(100),d=new t.DirectionalLightHelper(a(this,g),1)):a(this,g)instanceof t.SpotLight?d=new t.SpotLightHelper(a(this,g)):a(this,g)instanceof t.HemisphereLight&&(d=new t.HemisphereLightHelper(a(this,g),100)),a(this,B).push(d);const y=(m=a(this,g).shadow)==null?void 0:m.camera;if(y instanceof t.Camera){const R=new t.CameraHelper(y);a(this,B).push(R)}}a(this,B).forEach(d=>{P.en3.view.add(d)}),S(this,ye,new X.Store([i.position.x,i.position.y,i.position.z],{passport:{name:`${r}.Transformation.Position`,manager:{type:"number",step:c}}})),S(this,be,new X.Store([i.rotation.x,i.rotation.y,i.rotation.z],{passport:{name:`${r}.Transformation.Rotation`,manager:{type:"number",step:c,ease:.01}}})),S(this,we,new X.Store([i.scale.x,i.scale.y,i.scale.z],{passport:{name:`${r}.Transformation.Scale`,manager:{type:"number",step:c}}})),this.save(),S(this,Ze,!1),a(this,ye).subscribe(d=>{_(this,Te,ht).call(this,"position",d.current)}),a(this,be).subscribe(d=>{_(this,Te,ht).call(this,"rotation",d.current)}),a(this,we).subscribe(d=>{_(this,Te,ht).call(this,"scale",d.current)}),e&&S(this,Xe,new nn(a(this,g))),a(this,B).length&&Nt.ticker.subscribe(a(this,Ge))}get object3d(){return a(this,g)}get helpers(){return a(this,B)}get raycasterTarget(){return a(this,B)[0]||a(this,g)}destroy(){var o;(o=a(this,Xe))==null||o.destroy(),a(this,ye).close(),a(this,be).close(),a(this,we).close(),a(this,g).userData.controlled=!1,a(this,B).forEach(s=>{s&&"dispose"in s&&(s.dispose(),P.en3.view.remove(s))}),Nt.ticker.unsubscribe(a(this,Ge))}save(){const o=(s,e)=>{(!a(this,Ze)||s.initial===s.current)&&(s.current=[e.x,e.y,e.z])};o(a(this,ye),a(this,g).position),o(a(this,be),a(this,g).rotation),o(a(this,we),a(this,g).scale)}}g=new WeakMap,Xe=new WeakMap,ye=new WeakMap,be=new WeakMap,we=new WeakMap,Ze=new WeakMap,B=new WeakMap,Te=new WeakSet,ht=function(o,s){const e=a(this,g).userData.box;if(e){const r=c=>({x:s[0]-c.x,y:s[1]-c.y,z:s[2]-c.z});o==="position"?e.setPositionStep("_manager","+",r(e.getIncludedPositionSteps("_manager"))):o==="rotation"?e.setRotationStep("_manager","+",r(e.getIncludedRotationSteps("_manager"))):o==="scale"&&e.setScaleStep("_manager","+",r(e.getIncludedScaleSteps("_manager")))}else a(this,g)[o].set(...s)},Ge=new WeakMap;const Qt={type:"change"},Et={type:"start"},Vt={type:"end"},at=new t.Ray,qt=new t.Plane,Gn=Math.cos(70*t.MathUtils.DEG2RAD);class Fn extends t.EventDispatcher{constructor(o,s){super(),this.object=o,this.domElement=s,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(n){n.addEventListener("keydown",wt),this._domElementKeyEvents=n},this.stopListenToKeyEvents=function(){this._domElementKeyEvents.removeEventListener("keydown",wt),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(Qt),e.update(),c=r.NONE},this.update=function(){const n=new t.Vector3,h=new t.Quaternion().setFromUnitVectors(o.up,new t.Vector3(0,1,0)),f=h.clone().invert(),w=new t.Vector3,z=new t.Quaternion,ae=new t.Vector3,Q=2*Math.PI;return function(Pn=null){const Xt=e.object.position;n.copy(Xt).sub(e.target),n.applyQuaternion(h),l.setFromVector3(n),e.autoRotate&&c===r.NONE&&pe(yt(Pn)),e.enableDamping?(l.theta+=m.theta*e.dampingFactor,l.phi+=m.phi*e.dampingFactor):(l.theta+=m.theta,l.phi+=m.phi);let ee=e.minAzimuthAngle,te=e.maxAzimuthAngle;isFinite(ee)&&isFinite(te)&&(ee<-Math.PI?ee+=Q:ee>Math.PI&&(ee-=Q),te<-Math.PI?te+=Q:te>Math.PI&&(te-=Q),ee<=te?l.theta=Math.max(ee,Math.min(te,l.theta)):l.theta=l.theta>(ee+te)/2?Math.max(ee,l.theta):Math.min(te,l.theta)),l.phi=Math.max(e.minPolarAngle,Math.min(e.maxPolarAngle,l.phi)),l.makeSafe(),e.enableDamping===!0?e.target.addScaledVector(y,e.dampingFactor):e.target.add(y),e.target.sub(e.cursor),e.target.clampLength(e.minTargetRadius,e.maxTargetRadius),e.target.add(e.cursor);let De=!1;if(e.zoomToCursor&&Ee||e.object.isOrthographicCamera)l.radius=se(l.radius);else{const ne=l.radius;l.radius=se(l.radius*d),De=ne!=l.radius}if(n.setFromSpherical(l),n.applyQuaternion(f),Xt.copy(e.target).add(n),e.object.lookAt(e.target),e.enableDamping===!0?(m.theta*=1-e.dampingFactor,m.phi*=1-e.dampingFactor,y.multiplyScalar(1-e.dampingFactor)):(m.set(0,0,0),y.set(0,0,0)),e.zoomToCursor&&Ee){let ne=null;if(e.object.isPerspectiveCamera){const je=n.length();ne=se(je*d);const it=je-ne;e.object.position.addScaledVector($,it),e.object.updateMatrixWorld(),De=!!it}else if(e.object.isOrthographicCamera){const je=new t.Vector3(j.x,j.y,0);je.unproject(e.object);const it=e.object.zoom;e.object.zoom=Math.max(e.minZoom,Math.min(e.maxZoom,e.object.zoom/d)),e.object.updateProjectionMatrix(),De=it!==e.object.zoom;const Zt=new t.Vector3(j.x,j.y,0);Zt.unproject(e.object),e.object.position.sub(Zt).add(je),e.object.updateMatrixWorld(),ne=n.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),e.zoomToCursor=!1;ne!==null&&(this.screenSpacePanning?e.target.set(0,0,-1).transformDirection(e.object.matrix).multiplyScalar(ne).add(e.object.position):(at.origin.copy(e.object.position),at.direction.set(0,0,-1).transformDirection(e.object.matrix),Math.abs(e.object.up.dot(at.direction))<Gn?o.lookAt(e.target):(qt.setFromNormalAndCoplanarPoint(e.object.up,e.target),at.intersectPlane(qt,e.target))))}else if(e.object.isOrthographicCamera){const ne=e.object.zoom;e.object.zoom=Math.max(e.minZoom,Math.min(e.maxZoom,e.object.zoom/d)),ne!==e.object.zoom&&(e.object.updateProjectionMatrix(),De=!0)}return d=1,Ee=!1,De||w.distanceToSquared(e.object.position)>i||8*(1-z.dot(e.object.quaternion))>i||ae.distanceToSquared(e.target)>i?(e.dispatchEvent(Qt),w.copy(e.object.position),z.copy(e.object.quaternion),ae.copy(e.target),!0):!1}}(),this.dispose=function(){e.domElement.removeEventListener("contextmenu",Ct),e.domElement.removeEventListener("pointerdown",jt),e.domElement.removeEventListener("pointercancel",Ae),e.domElement.removeEventListener("wheel",kt),e.domElement.removeEventListener("pointermove",bt),e.domElement.removeEventListener("pointerup",Ae),e.domElement.getRootNode().removeEventListener("keydown",Ht,{capture:!0}),e._domElementKeyEvents!==null&&(e._domElementKeyEvents.removeEventListener("keydown",wt),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,m=new t.Spherical;let d=1;const y=new t.Vector3,R=new t.Vector2,Z=new t.Vector2,K=new t.Vector2,F=new t.Vector2,O=new t.Vector2,D=new t.Vector2,I=new t.Vector2,E=new t.Vector2,x=new t.Vector2,$=new t.Vector3,j=new t.Vector2;let Ee=!1;const v=[],he={};let Le=!1;function yt(n){return n!==null?2*Math.PI/60*e.autoRotateSpeed*n:2*Math.PI/60/60*e.autoRotateSpeed}function Se(n){const h=Math.abs(n*.01);return Math.pow(.95,e.zoomSpeed*h)}function pe(n){m.theta-=n}function Pe(n){m.phi-=n}const N=function(){const n=new t.Vector3;return function(f,w){n.setFromMatrixColumn(w,0),n.multiplyScalar(-f),y.add(n)}}(),Y=function(){const n=new t.Vector3;return function(f,w){e.screenSpacePanning===!0?n.setFromMatrixColumn(w,1):(n.setFromMatrixColumn(w,0),n.crossVectors(e.object.up,n)),n.multiplyScalar(f),y.add(n)}}(),U=function(){const n=new t.Vector3;return function(f,w){const z=e.domElement;if(e.object.isPerspectiveCamera){const ae=e.object.position;n.copy(ae).sub(e.target);let Q=n.length();Q*=Math.tan(e.object.fov/2*Math.PI/180),N(2*f*Q/z.clientHeight,e.object.matrix),Y(2*w*Q/z.clientHeight,e.object.matrix)}else e.object.isOrthographicCamera?(N(f*(e.object.right-e.object.left)/e.object.zoom/z.clientWidth,e.object.matrix),Y(w*(e.object.top-e.object.bottom)/e.object.zoom/z.clientHeight,e.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),e.enablePan=!1)}}();function C(n){e.object.isPerspectiveCamera||e.object.isOrthographicCamera?d/=n:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),e.enableZoom=!1)}function J(n){e.object.isPerspectiveCamera||e.object.isOrthographicCamera?d*=n:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),e.enableZoom=!1)}function T(n,h){if(!e.zoomToCursor)return;Ee=!0;const f=e.domElement.getBoundingClientRect(),w=n-f.left,z=h-f.top,ae=f.width,Q=f.height;j.x=w/ae*2-1,j.y=-(z/Q)*2+1,$.set(j.x,j.y,1).unproject(e.object).sub(e.object.position).normalize()}function se(n){return Math.max(e.minDistance,Math.min(e.maxDistance,n))}function me(n){R.set(n.clientX,n.clientY)}function xe(n){T(n.clientX,n.clientX),I.set(n.clientX,n.clientY)}function nt(n){F.set(n.clientX,n.clientY)}function ot(n){Z.set(n.clientX,n.clientY),K.subVectors(Z,R).multiplyScalar(e.rotateSpeed);const h=e.domElement;pe(2*Math.PI*K.x/h.clientHeight),Pe(2*Math.PI*K.y/h.clientHeight),R.copy(Z),e.update()}function cn(n){E.set(n.clientX,n.clientY),x.subVectors(E,I),x.y>0?C(Se(x.y)):x.y<0&&J(Se(x.y)),I.copy(E),e.update()}function ln(n){O.set(n.clientX,n.clientY),D.subVectors(O,F).multiplyScalar(e.panSpeed),U(D.x,D.y),F.copy(O),e.update()}function hn(n){T(n.clientX,n.clientY),n.deltaY<0?J(Se(n.deltaY)):n.deltaY>0&&C(Se(n.deltaY)),e.update()}function pn(n){let h=!1;switch(n.code){case e.keys.UP:n.ctrlKey||n.metaKey||n.shiftKey?Pe(2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):U(0,e.keyPanSpeed),h=!0;break;case e.keys.BOTTOM:n.ctrlKey||n.metaKey||n.shiftKey?Pe(-2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):U(0,-e.keyPanSpeed),h=!0;break;case e.keys.LEFT:n.ctrlKey||n.metaKey||n.shiftKey?pe(2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):U(e.keyPanSpeed,0),h=!0;break;case e.keys.RIGHT:n.ctrlKey||n.metaKey||n.shiftKey?pe(-2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):U(-e.keyPanSpeed,0),h=!0;break}h&&(n.preventDefault(),e.update())}function _t(n){if(v.length===1)R.set(n.pageX,n.pageY);else{const h=ve(n),f=.5*(n.pageX+h.x),w=.5*(n.pageY+h.y);R.set(f,w)}}function Ot(n){if(v.length===1)F.set(n.pageX,n.pageY);else{const h=ve(n),f=.5*(n.pageX+h.x),w=.5*(n.pageY+h.y);F.set(f,w)}}function It(n){const h=ve(n),f=n.pageX-h.x,w=n.pageY-h.y,z=Math.sqrt(f*f+w*w);I.set(0,z)}function mn(n){e.enableZoom&&It(n),e.enablePan&&Ot(n)}function un(n){e.enableZoom&&It(n),e.enableRotate&&_t(n)}function Lt(n){if(v.length==1)Z.set(n.pageX,n.pageY);else{const f=ve(n),w=.5*(n.pageX+f.x),z=.5*(n.pageY+f.y);Z.set(w,z)}K.subVectors(Z,R).multiplyScalar(e.rotateSpeed);const h=e.domElement;pe(2*Math.PI*K.x/h.clientHeight),Pe(2*Math.PI*K.y/h.clientHeight),R.copy(Z)}function At(n){if(v.length===1)O.set(n.pageX,n.pageY);else{const h=ve(n),f=.5*(n.pageX+h.x),w=.5*(n.pageY+h.y);O.set(f,w)}D.subVectors(O,F).multiplyScalar(e.panSpeed),U(D.x,D.y),F.copy(O)}function Dt(n){const h=ve(n),f=n.pageX-h.x,w=n.pageY-h.y,z=Math.sqrt(f*f+w*w);E.set(0,z),x.set(0,Math.pow(E.y/I.y,e.zoomSpeed)),C(x.y),I.copy(E);const ae=(n.pageX+h.x)*.5,Q=(n.pageY+h.y)*.5;T(ae,Q)}function dn(n){e.enableZoom&&Dt(n),e.enablePan&&At(n)}function fn(n){e.enableZoom&&Dt(n),e.enableRotate&&Lt(n)}function jt(n){e.enabled!==!1&&(v.length===0&&(e.domElement.setPointerCapture(n.pointerId),e.domElement.addEventListener("pointermove",bt),e.domElement.addEventListener("pointerup",Ae)),!Sn(n)&&(Mn(n),n.pointerType==="touch"?Yt(n):yn(n)))}function bt(n){e.enabled!==!1&&(n.pointerType==="touch"?gn(n):bn(n))}function Ae(n){switch(En(n),v.length){case 0:e.domElement.releasePointerCapture(n.pointerId),e.domElement.removeEventListener("pointermove",bt),e.domElement.removeEventListener("pointerup",Ae),e.dispatchEvent(Vt),c=r.NONE;break;case 1:const h=v[0],f=he[h];Yt({pointerId:h,pageX:f.x,pageY:f.y});break}}function yn(n){let h;switch(n.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;xe(n),c=r.DOLLY;break;case t.MOUSE.ROTATE:if(n.ctrlKey||n.metaKey||n.shiftKey){if(e.enablePan===!1)return;nt(n),c=r.PAN}else{if(e.enableRotate===!1)return;me(n),c=r.ROTATE}break;case t.MOUSE.PAN:if(n.ctrlKey||n.metaKey||n.shiftKey){if(e.enableRotate===!1)return;me(n),c=r.ROTATE}else{if(e.enablePan===!1)return;nt(n),c=r.PAN}break;default:c=r.NONE}c!==r.NONE&&e.dispatchEvent(Et)}function bn(n){switch(c){case r.ROTATE:if(e.enableRotate===!1)return;ot(n);break;case r.DOLLY:if(e.enableZoom===!1)return;cn(n);break;case r.PAN:if(e.enablePan===!1)return;ln(n);break}}function kt(n){e.enabled===!1||e.enableZoom===!1||c!==r.NONE||(n.preventDefault(),e.dispatchEvent(Et),hn(wn(n)),e.dispatchEvent(Vt))}function wn(n){const h=n.deltaMode,f={clientX:n.clientX,clientY:n.clientY,deltaY:n.deltaY};switch(h){case 1:f.deltaY*=16;break;case 2:f.deltaY*=100;break}return n.ctrlKey&&!Le&&(f.deltaY*=10),f}function Ht(n){n.key==="Control"&&(Le=!0,e.domElement.getRootNode().addEventListener("keyup",Rt,{passive:!0,capture:!0}))}function Rt(n){n.key==="Control"&&(Le=!1,e.domElement.getRootNode().removeEventListener("keyup",Rt,{passive:!0,capture:!0}))}function wt(n){e.enabled===!1||e.enablePan===!1||pn(n)}function Yt(n){switch(zt(n),v.length){case 1:switch(e.touches.ONE){case t.TOUCH.ROTATE:if(e.enableRotate===!1)return;_t(n),c=r.TOUCH_ROTATE;break;case t.TOUCH.PAN:if(e.enablePan===!1)return;Ot(n),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;mn(n),c=r.TOUCH_DOLLY_PAN;break;case t.TOUCH.DOLLY_ROTATE:if(e.enableZoom===!1&&e.enableRotate===!1)return;un(n),c=r.TOUCH_DOLLY_ROTATE;break;default:c=r.NONE}break;default:c=r.NONE}c!==r.NONE&&e.dispatchEvent(Et)}function gn(n){switch(zt(n),c){case r.TOUCH_ROTATE:if(e.enableRotate===!1)return;Lt(n),e.update();break;case r.TOUCH_PAN:if(e.enablePan===!1)return;At(n),e.update();break;case r.TOUCH_DOLLY_PAN:if(e.enableZoom===!1&&e.enablePan===!1)return;dn(n),e.update();break;case r.TOUCH_DOLLY_ROTATE:if(e.enableZoom===!1&&e.enableRotate===!1)return;fn(n),e.update();break;default:c=r.NONE}}function Ct(n){e.enabled!==!1&&n.preventDefault()}function Mn(n){v.push(n.pointerId)}function En(n){delete he[n.pointerId];for(let h=0;h<v.length;h++)if(v[h]==n.pointerId){v.splice(h,1);return}}function Sn(n){for(let h=0;h<v.length;h++)if(v[h]==n.pointerId)return!0;return!1}function zt(n){let h=he[n.pointerId];h===void 0&&(h=new t.Vector2,he[n.pointerId]=h),h.set(n.pageX,n.pageY)}function ve(n){const h=n.pointerId===v[0]?v[1]:v[0];return he[h]}e.domElement.addEventListener("contextmenu",Ct),e.domElement.addEventListener("pointerdown",jt),e.domElement.addEventListener("pointercancel",Ae),e.domElement.addEventListener("wheel",kt,{passive:!1}),e.domElement.getRootNode().addEventListener("keydown",Ht,{passive:!0,capture:!0}),this.update()}}const ue=new t.Raycaster,H=new t.Vector3,re=new t.Vector3,M=new t.Quaternion,Ut={X:new t.Vector3(1,0,0),Y:new t.Vector3(0,1,0),Z:new t.Vector3(0,0,1)},St={type:"change"},Bt={type:"mouseDown",mode:null},Wt={type:"mouseUp",mode:null},Kt={type:"objectChange"};class Nn extends t.Object3D{constructor(o,s){super(),s===void 0&&(console.warn('THREE.TransformControls: The second parameter "domElement" is now mandatory.'),s=document),this.isTransformControls=!0,this.visible=!1,this.domElement=s,this.domElement.style.touchAction="none";const e=new Wn;this._gizmo=e,this.add(e);const r=new Kn;this._plane=r,this.add(r);const c=this;function i(E,x){let $=x;Object.defineProperty(c,E,{get:function(){return $!==void 0?$:x},set:function(j){$!==j&&($=j,r[E]=j,e[E]=j,c.dispatchEvent({type:E+"-changed",value:j}),c.dispatchEvent(St))}}),c[E]=x,r[E]=x,e[E]=x}i("camera",o),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,m=new t.Vector3,d=new t.Quaternion,y=new t.Quaternion,R=new t.Vector3,Z=new t.Quaternion,K=new t.Vector3,F=new t.Vector3,O=new t.Vector3,D=0,I=new t.Vector3;i("worldPosition",l),i("worldPositionStart",m),i("worldQuaternion",d),i("worldQuaternionStart",y),i("cameraPosition",R),i("cameraQuaternion",Z),i("pointStart",K),i("pointEnd",F),i("rotationAxis",O),i("rotationAngle",D),i("eye",I),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=Qn.bind(this),this._onPointerDown=qn.bind(this),this._onPointerHover=Vn.bind(this),this._onPointerMove=Un.bind(this),this._onPointerUp=Bn.bind(this),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointermove",this._onPointerHover),this.domElement.addEventListener("pointerup",this._onPointerUp)}updateMatrixWorld(o){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(o)}pointerHover(o){if(this.object===void 0||this.dragging===!0)return;o!==null&&ue.setFromCamera(o,this.camera);const s=Pt(this._gizmo.picker[this.mode],ue);s?this.axis=s.object.name:this.axis=null}pointerDown(o){if(!(this.object===void 0||this.dragging===!0||o!=null&&o.button!==0)&&this.axis!==null){o!==null&&ue.setFromCamera(o,this.camera);const s=Pt(this._plane,ue,!0);s&&(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(s.point).sub(this.worldPositionStart)),this.dragging=!0,Bt.mode=this.mode,this.dispatchEvent(Bt)}}pointerMove(o){const s=this.axis,e=this.mode,r=this.object;let c=this.space;if(e==="scale"?c="local":(s==="E"||s==="XYZE"||s==="XYZ")&&(c="world"),r===void 0||s===null||this.dragging===!1||o!==null&&o.button!==-1)return;o!==null&&ue.setFromCamera(o,this.camera);const i=Pt(this._plane,ue,!0);if(i){if(this.pointEnd.copy(i.point).sub(this.worldPositionStart),e==="translate")this._offset.copy(this.pointEnd).sub(this.pointStart),c==="local"&&s!=="XYZ"&&this._offset.applyQuaternion(this._worldQuaternionInv),s.indexOf("X")===-1&&(this._offset.x=0),s.indexOf("Y")===-1&&(this._offset.y=0),s.indexOf("Z")===-1&&(this._offset.z=0),c==="local"&&s!=="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(M.copy(this._quaternionStart).invert()),s.search("X")!==-1&&(r.position.x=Math.round(r.position.x/this.translationSnap)*this.translationSnap),s.search("Y")!==-1&&(r.position.y=Math.round(r.position.y/this.translationSnap)*this.translationSnap),s.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)),s.search("X")!==-1&&(r.position.x=Math.round(r.position.x/this.translationSnap)*this.translationSnap),s.search("Y")!==-1&&(r.position.y=Math.round(r.position.y/this.translationSnap)*this.translationSnap),s.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(s.search("XYZ")!==-1){let l=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(l*=-1),re.set(l,l,l)}else H.copy(this.pointStart),re.copy(this.pointEnd),H.applyQuaternion(this._worldQuaternionInv),re.applyQuaternion(this._worldQuaternionInv),re.divide(H),s.search("X")===-1&&(re.x=1),s.search("Y")===-1&&(re.y=1),s.search("Z")===-1&&(re.z=1);r.scale.copy(this._scaleStart).multiply(re),this.scaleSnap&&(s.search("X")!==-1&&(r.scale.x=Math.round(r.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),s.search("Y")!==-1&&(r.scale.y=Math.round(r.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),s.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 m=!1;s==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(H.copy(this.rotationAxis).cross(this.eye))*l):(s==="X"||s==="Y"||s==="Z")&&(this.rotationAxis.copy(Ut[s]),H.copy(Ut[s]),c==="local"&&H.applyQuaternion(this.worldQuaternion),H.cross(this.eye),H.length()===0?m=!0:this.rotationAngle=this._offset.dot(H.normalize())*l),(s==="E"||m)&&(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"&&s!=="E"&&s!=="XYZE"?(r.quaternion.copy(this._quaternionStart),r.quaternion.multiply(M.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),r.quaternion.copy(M.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),r.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(St),this.dispatchEvent(Kt)}}pointerUp(o){o!==null&&o.button!==0||(this.dragging&&this.axis!==null&&(Wt.mode=this.mode,this.dispatchEvent(Wt)),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(o){o.geometry&&o.geometry.dispose(),o.material&&o.material.dispose()})}attach(o){return this.object=o,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(St),this.dispatchEvent(Kt),this.pointStart.copy(this.pointEnd))}getRaycaster(){return ue}getMode(){return this.mode}setMode(o){this.mode=o}setTranslationSnap(o){this.translationSnap=o}setRotationSnap(o){this.rotationSnap=o}setScaleSnap(o){this.scaleSnap=o}setSize(o){this.size=o}setSpace(o){this.space=o}}function Qn(p){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:p.button};{const o=this.domElement.getBoundingClientRect();return{x:(p.clientX-o.left)/o.width*2-1,y:-(p.clientY-o.top)/o.height*2+1,button:p.button}}}function Vn(p){if(this.enabled)switch(p.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(p));break}}function qn(p){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(p.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(p)),this.pointerDown(this._getPointer(p)))}function Un(p){this.enabled&&this.pointerMove(this._getPointer(p))}function Bn(p){this.enabled&&(this.domElement.releasePointerCapture(p.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(p)))}function Pt(p,o,s){const e=o.intersectObject(p,!0);for(let r=0;r<e.length;r++)if(e[r].object.visible||s)return e[r];return!1}const rt=new t.Euler,b=new t.Vector3(0,1,0),$t=new t.Vector3(0,0,0),Jt=new t.Matrix4,ct=new t.Quaternion,pt=new t.Quaternion,W=new t.Vector3,en=new t.Matrix4,Ye=new t.Vector3(1,0,0),fe=new t.Vector3(0,1,0),Ce=new t.Vector3(0,0,1),lt=new t.Vector3,He=new t.Vector3,Re=new t.Vector3;class Wn extends t.Object3D{constructor(){super(),this.isTransformControlsGizmo=!0,this.type="TransformControlsGizmo";const o=new t.MeshBasicMaterial({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),s=new t.LineBasicMaterial({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),e=o.clone();e.opacity=.15;const r=s.clone();r.opacity=.5;const c=o.clone();c.color.setHex(16711680);const i=o.clone();i.color.setHex(65280);const l=o.clone();l.color.setHex(255);const m=o.clone();m.color.setHex(16711680),m.opacity=.5;const d=o.clone();d.color.setHex(65280),d.opacity=.5;const y=o.clone();y.color.setHex(255),y.opacity=.5;const R=o.clone();R.opacity=.25;const Z=o.clone();Z.color.setHex(16776960),Z.opacity=.25,o.clone().color.setHex(16776960);const F=o.clone();F.color.setHex(7895160);const O=new t.CylinderGeometry(0,.04,.1,12);O.translate(0,.05,0);const D=new t.BoxGeometry(.08,.08,.08);D.translate(0,.04,0);const I=new t.BufferGeometry;I.setAttribute("position",new t.Float32BufferAttribute([0,0,0,1,0,0],3));const E=new t.CylinderGeometry(.0075,.0075,.5,3);E.translate(0,.25,0);function x(Y,U){const C=new t.TorusGeometry(Y,.0075,3,64,U*Math.PI*2);return C.rotateY(Math.PI/2),C.rotateX(Math.PI/2),C}function $(){const Y=new t.BufferGeometry;return Y.setAttribute("position",new t.Float32BufferAttribute([0,0,0,1,1,1],3)),Y}const j={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(E,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(E,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(E,l),null,[Math.PI/2,0,0]]],XYZ:[[new t.Mesh(new t.OctahedronGeometry(.1,0),R.clone()),[0,0,0]]],XY:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),y.clone()),[.15,.15,0]]],YZ:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),m.clone()),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),d.clone()),[.15,0,.15],[-Math.PI/2,0,0]]]},Ee={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]]]},v={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($(),r),null,null,null,"helper"]],X:[[new t.Line(I,r.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new t.Line(I,r.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new t.Line(I,r.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},he={XYZE:[[new t.Mesh(x(.5,1),F),null,[0,Math.PI/2,0]]],X:[[new t.Mesh(x(.5,.5),c)]],Y:[[new t.Mesh(x(.5,.5),i),null,[0,0,-Math.PI/2]]],Z:[[new t.Mesh(x(.5,.5),l),null,[0,Math.PI/2,0]]],E:[[new t.Mesh(x(.75,1),Z),null,[0,Math.PI/2,0]]]},Le={AXIS:[[new t.Line(I,r.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]]},yt={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)]]},Se={X:[[new t.Mesh(D,c),[.5,0,0],[0,0,-Math.PI/2]],[new t.Mesh(E,c),[0,0,0],[0,0,-Math.PI/2]],[new t.Mesh(D,c),[-.5,0,0],[0,0,Math.PI/2]]],Y:[[new t.Mesh(D,i),[0,.5,0]],[new t.Mesh(E,i)],[new t.Mesh(D,i),[0,-.5,0],[0,0,Math.PI]]],Z:[[new t.Mesh(D,l),[0,0,.5],[Math.PI/2,0,0]],[new t.Mesh(E,l),[0,0,0],[Math.PI/2,0,0]],[new t.Mesh(D,l),[0,0,-.5],[-Math.PI/2,0,0]]],XY:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),y),[.15,.15,0]]],YZ:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),m),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),d),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new t.Mesh(new t.BoxGeometry(.1,.1,.1),R.clone())]]},pe={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]]]},Pe={X:[[new t.Line(I,r.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new t.Line(I,r.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new t.Line(I,r.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]};function N(Y){const U=new t.Object3D;for(const C in Y)for(let J=Y[C].length;J--;){const T=Y[C][J][0].clone(),se=Y[C][J][1],me=Y[C][J][2],xe=Y[C][J][3],nt=Y[C][J][4];T.name=C,T.tag=nt,se&&T.position.set(se[0],se[1],se[2]),me&&T.rotation.set(me[0],me[1],me[2]),xe&&T.scale.set(xe[0],xe[1],xe[2]),T.updateMatrix();const ot=T.geometry.clone();ot.applyMatrix4(T.matrix),T.geometry=ot,T.renderOrder=1/0,T.position.set(0,0,0),T.rotation.set(0,0,0),T.scale.set(1,1,1),U.add(T)}return U}this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=N(j)),this.add(this.gizmo.rotate=N(he)),this.add(this.gizmo.scale=N(Se)),this.add(this.picker.translate=N(Ee)),this.add(this.picker.rotate=N(yt)),this.add(this.picker.scale=N(pe)),this.add(this.helper.translate=N(v)),this.add(this.helper.rotate=N(Le)),this.add(this.helper.scale=N(Pe)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}updateMatrixWorld(o){const e=(this.mode==="scale"?"local":this.space)==="local"?this.worldQuaternion:pt;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"&&(M.setFromEuler(rt.set(0,0,0)),i.quaternion.copy(e).multiply(M),Math.abs(b.copy(Ye).applyQuaternion(e).dot(this.eye))>.9&&(i.visible=!1)),this.axis==="Y"&&(M.setFromEuler(rt.set(0,0,Math.PI/2)),i.quaternion.copy(e).multiply(M),Math.abs(b.copy(fe).applyQuaternion(e).dot(this.eye))>.9&&(i.visible=!1)),this.axis==="Z"&&(M.setFromEuler(rt.set(0,Math.PI/2,0)),i.quaternion.copy(e).multiply(M),Math.abs(b.copy(Ce).applyQuaternion(e).dot(this.eye))>.9&&(i.visible=!1)),this.axis==="XYZE"&&(M.setFromEuler(rt.set(0,Math.PI/2,0)),b.copy(this.rotationAxis),i.quaternion.setFromRotationMatrix(Jt.lookAt($t,b,fe)),i.quaternion.multiply(M),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(b.copy(Ye).applyQuaternion(e).dot(this.eye))>.99&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),i.name==="Y"&&Math.abs(b.copy(fe).applyQuaternion(e).dot(this.eye))>.99&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),i.name==="Z"&&Math.abs(b.copy(Ce).applyQuaternion(e).dot(this.eye))>.99&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),i.name==="XY"&&Math.abs(b.copy(Ce).applyQuaternion(e).dot(this.eye))<.2&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),i.name==="YZ"&&Math.abs(b.copy(Ye).applyQuaternion(e).dot(this.eye))<.2&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),i.name==="XZ"&&Math.abs(b.copy(fe).applyQuaternion(e).dot(this.eye))<.2&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1)):this.mode==="rotate"&&(ct.copy(e),b.copy(this.eye).applyQuaternion(M.copy(e).invert()),i.name.search("E")!==-1&&i.quaternion.setFromRotationMatrix(Jt.lookAt(this.eye,$t,fe)),i.name==="X"&&(M.setFromAxisAngle(Ye,Math.atan2(-b.y,b.z)),M.multiplyQuaternions(ct,M),i.quaternion.copy(M)),i.name==="Y"&&(M.setFromAxisAngle(fe,Math.atan2(b.x,b.z)),M.multiplyQuaternions(ct,M),i.quaternion.copy(M)),i.name==="Z"&&(M.setFromAxisAngle(Ce,Math.atan2(b.y,b.x)),M.multiplyQuaternions(ct,M),i.quaternion.copy(M))),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(m){return i.name===m}))&&(i.material.color.setHex(16776960),i.material.opacity=1)}super.updateMatrixWorld(o)}}class Kn 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(o){let s=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(s="local"),lt.copy(Ye).applyQuaternion(s==="local"?this.worldQuaternion:pt),He.copy(fe).applyQuaternion(s==="local"?this.worldQuaternion:pt),Re.copy(Ce).applyQuaternion(s==="local"?this.worldQuaternion:pt),b.copy(He),this.mode){case"translate":case"scale":switch(this.axis){case"X":b.copy(this.eye).cross(lt),W.copy(lt).cross(b);break;case"Y":b.copy(this.eye).cross(He),W.copy(He).cross(b);break;case"Z":b.copy(this.eye).cross(Re),W.copy(Re).cross(b);break;case"XY":W.copy(Re);break;case"YZ":W.copy(lt);break;case"XZ":b.copy(Re),W.copy(He);break;case"XYZ":case"E":W.set(0,0,0);break}break;case"rotate":default:W.set(0,0,0)}W.length()===0?this.quaternion.copy(this.cameraQuaternion):(en.lookAt(H.set(0,0,0),W,b),this.quaternion.setFromRotationMatrix(en)),super.updateMatrixWorld(o)}}var V,ge;class $n{constructor(){u(this,V,void 0);u(this,ge,void 0);S(this,V,new Fn(P.en3.camera,P.en3.webglRenderer.domElement)),S(this,ge,new X.Store([0,0,0],{passport:{name:"Controls.OrbitControls.Target",manager:{type:"number",step:1e-4,ease:10}}}));let o=!0;a(this,ge).subscribe(s=>{a(this,V).target.set(...s.current),o&&a(this,V).update()}),a(this,V).addEventListener("change",()=>{o=!1,a(this,ge).current=[a(this,V).target.x,a(this,V).target.y,a(this,V).target.z],o=!0})}get controls(){return a(this,V)}destroy(){a(this,V).dispose(),a(this,ge).close()}}V=new WeakMap,ge=new WeakMap;var k,Fe,Ne,Qe,Ve,qe,Ue,Be,We;class Jn{constructor(){u(this,k,null);u(this,Fe,new X.Store(P.en3.camera.far,{passport:{name:"Helpers.Grid.Size",manager:{type:"number",step:1}}}));u(this,Ne,new X.Store(100,{passport:{name:"Helpers.Grid.Divisions",manager:{type:"number"}}}));u(this,Qe,new X.Store("#0000ff",{passport:{name:"Helpers.Grid.Color 1",manager:{type:"color"}}}));u(this,Ve,new X.Store("#808080",{passport:{name:"Helpers.Grid.Color 2",manager:{type:"color"}}}));u(this,qe,new X.Store(!1,{passport:{name:"Helpers.Grid.Vertical",manager:{type:"boolean"}}}));u(this,Ue,new X.Store(!0,{passport:{name:"Helpers.Grid.Visible",manager:{type:"boolean"}}}));u(this,Be,void 0);u(this,We,o=>{o.key==="g"&&(a(this,k).visible=!a(this,k).visible)});S(this,Be,new On.Composed([a(this,Fe),a(this,Ne),a(this,Qe),a(this,Ve),a(this,qe),a(this,Ue)],()=>{a(this,k)&&(P.en3.view.remove(a(this,k)),a(this,k).dispose()),S(this,k,new t.GridHelper(a(this,Fe).current,a(this,Ne).current,a(this,Qe).current,a(this,Ve).current)),a(this,k).rotation.x=a(this,qe).current?Math.PI/2:0,a(this,k).visible=a(this,Ue).current,P.en3.view.add(a(this,k))})),addEventListener("keydown",a(this,We))}get helper(){return a(this,k)}destroy(){a(this,Be).close(),a(this,k)&&(P.en3.view.remove(a(this,k)),a(this,k).dispose()),removeEventListener("keydown",a(this,We))}}k=new WeakMap,Fe=new WeakMap,Ne=new WeakMap,Qe=new WeakMap,Ve=new WeakMap,qe=new WeakMap,Ue=new WeakMap,Be=new WeakMap,We=new WeakMap;var A,q,ce,le,Ke,_e,$e,Je,vt;class eo{constructor(){u(this,Je);u(this,A,void 0);u(this,q,[]);u(this,ce,null);u(this,le,o=>{if(o.child.name.startsWith("T.")&&!a(this,q).find(s=>s.object3d===o.child)){const s=new Tt(o.child);a(this,q).push(s),P.en3.raycaster.add(s.raycasterTarget,{eventDispatcher:s.raycasterTarget}),s.raycasterTarget.addEventListener("pointerDown",a(this,_e)),s.object3d.addEventListener("childadded",a(this,le))}});u(this,Ke,o=>{const s=_(this,Je,vt).call(this,o.child);s&&(P.en3.raycaster.remove(s.raycasterTarget),s.destroy(),s.raycasterTarget.removeEventListener("pointerDown",a(this,_e)),s.object3d.removeEventListener("childadded",a(this,le)),S(this,q,a(this,q).filter(e=>e!==s)))});u(this,_e,o=>{const s=_(this,Je,vt).call(this,o.target);s&&(S(this,ce,a(this,q).find(e=>e.object3d===(s==null?void 0:s.object3d))||null),a(this,ce)&&a(this,A).attach(a(this,ce).object3d))});u(this,$e,o=>{o.key==="t"?a(this,A).setMode("translate"):o.key==="r"?a(this,A).setMode("rotate"):o.key==="s"?a(this,A).setMode("scale"):o.key==="Escape"?a(this,A).detach():o.key==="+"||o.key==="="?a(this,A).setSize(a(this,A).size+.1):o.key==="-"||o.key==="_"?a(this,A).setSize(a(this,A).size-.1):o.key==="h"&&a(this,q).forEach(s=>{s.helpers.forEach(e=>{e.visible=!e.visible})})});S(this,A,new Nn(P.en3.camera,P.en3.webglRenderer.domElement)),a(this,A).addEventListener("objectChange",o=>{a(this,ce)&&a(this,ce).save()}),P.en3.view.add(a(this,A)),P.en3.scene.addEventListener("childadded",a(this,le)),P.en3.scene.addEventListener("childremoved",a(this,Ke)),window.addEventListener("keydown",a(this,$e))}get controls(){return a(this,A)}destroy(){P.en3.scene.removeEventListener("childadded",a(this,le)),P.en3.scene.removeEventListener("childremoved",a(this,Ke)),window.removeEventListener("keydown",a(this,$e)),a(this,A).dispose(),a(this,q).forEach(o=>{o.raycasterTarget.removeEventListener("pointerDown",a(this,_e)),o.object3d.removeEventListener("childadded",a(this,le)),o.destroy()}),S(this,q,[])}}A=new WeakMap,q=new WeakMap,ce=new WeakMap,le=new WeakMap,Ke=new WeakMap,_e=new WeakMap,$e=new WeakMap,Je=new WeakSet,vt=function(o){return a(this,q).find(e=>e.object3d===o||e.raycasterTarget===o)};var et,tt,Oe,Me,Ie;class to{constructor(){u(this,et,void 0);u(this,tt,void 0);u(this,Oe,void 0);u(this,Me,void 0);u(this,Ie,void 0);S(this,et,new nn(P.en3.webglRenderer)),S(this,tt,new Jn),S(this,Oe,new Tt(P.en3.camera)),S(this,Me,new $n),a(this,Me).controls.addEventListener("change",()=>{a(this,Oe).save()}),S(this,Ie,new eo),a(this,Ie).controls.addEventListener("dragging-changed",o=>{a(this,Me).controls.enabled=!o.value})}destroy(){a(this,et).destroy(),a(this,tt).destroy(),a(this,Oe).destroy(),a(this,Me).destroy(),a(this,Ie).destroy()}}et=new WeakMap,tt=new WeakMap,Oe=new WeakMap,Me=new WeakMap,Ie=new WeakMap;exports.En3Helpers=to;exports.En3Object3dManager=Tt;
@@ -1,2 +1,2 @@
1
- export { En3Controls } from './En3Controls';
1
+ export { En3Helpers } from './En3Helpers';
2
2
  export { En3Object3dManager, type En3Object3dManagerOptions, } from './En3Object3dManager';