aptechka 0.64.0 → 0.64.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 (118) hide show
  1. package/lib/Animation-BRqj4VfN.cjs +1 -0
  2. package/lib/{Animation-Cb-klopb.js → Animation-D29tc5VS.js} +5 -4
  3. package/lib/Damped-BD1OQ1fH.cjs +1 -0
  4. package/lib/{Damped-ByZFbNSt.js → Damped-YrqW5V4w.js} +5 -4
  5. package/lib/DragControls-D8BXtKVu.cjs +1 -0
  6. package/lib/DragControls-DGDUw6bM.js +226 -0
  7. package/lib/ScrollSegmentElement-B6gp1q_z.js +459 -0
  8. package/lib/ScrollSegmentElement-DtMMAirz.cjs +1 -0
  9. package/lib/SourceElement-D_YeNqsI.cjs +5 -0
  10. package/lib/SourceElement-jbviggZp.js +217 -0
  11. package/lib/{Store-swP_0ymB.js → Store-0BVty6AZ.js} +2 -1
  12. package/lib/Store-Cd1GlEmZ.cjs +1 -0
  13. package/lib/Tweened-B-AHx93m.cjs +1 -0
  14. package/lib/{Tweened-DzZwfKNm.js → Tweened-_pF0zXXN.js} +9 -8
  15. package/lib/Viewport-DA10iWAO.js +109 -0
  16. package/lib/Viewport-DB0qAZPJ.cjs +1 -0
  17. package/lib/accordion/index.cjs +1 -1
  18. package/lib/accordion/index.js +2 -1
  19. package/lib/animation/index.cjs +1 -1
  20. package/lib/animation/index.js +3 -3
  21. package/lib/attribute/index.cjs +1 -1
  22. package/lib/attribute/index.js +5 -4
  23. package/lib/billboard/index.cjs +1 -1
  24. package/lib/billboard/index.js +2 -1
  25. package/lib/canvas/index.cjs +1 -1
  26. package/lib/canvas/index.js +5 -5
  27. package/lib/controls/index.cjs +1 -1
  28. package/lib/controls/index.js +6 -223
  29. package/lib/css-property/index.cjs +1 -1
  30. package/lib/css-property/index.js +15 -14
  31. package/lib/custom-scrollbar/index.cjs +1 -1
  32. package/lib/custom-scrollbar/index.js +25 -24
  33. package/lib/dev/index.cjs +1 -1
  34. package/lib/dev/index.js +7 -6
  35. package/lib/device/index.cjs +1 -1
  36. package/lib/device/index.js +5 -106
  37. package/lib/element-linked-store/index.cjs +1 -1
  38. package/lib/element-linked-store/index.js +5 -4
  39. package/lib/element-resizer/index.cjs +1 -1
  40. package/lib/element-resizer/index.js +22 -21
  41. package/lib/en3/En3View.d.ts +2 -2
  42. package/lib/en3/en3.d.ts +3 -2
  43. package/lib/en3/index.cjs +3 -3
  44. package/lib/en3/index.js +93 -91
  45. package/lib/iframe/index.cjs +1 -1
  46. package/lib/iframe/index.js +4 -3
  47. package/lib/image/index.cjs +1 -1
  48. package/lib/image/index.js +5 -4
  49. package/lib/{index-euf5anj6.js → index-Bv9zgfdb.js} +3 -2
  50. package/lib/index-DekP7OZe.cjs +1 -0
  51. package/lib/intersector/index.cjs +1 -1
  52. package/lib/intersector/index.js +4 -3
  53. package/lib/ladder/index.cjs +1 -1
  54. package/lib/ladder/index.js +41 -40
  55. package/lib/{layout-DpZo-I0y.js → layout-BSMtwCga.js} +2 -2
  56. package/lib/layout-box/index.cjs +1 -1
  57. package/lib/layout-box/index.js +18 -17
  58. package/lib/loading/index.cjs +1 -1
  59. package/lib/loading/index.js +4 -3
  60. package/lib/masonry-layout/index.cjs +1 -1
  61. package/lib/masonry-layout/index.js +2 -2
  62. package/lib/media/index.cjs +1 -1
  63. package/lib/media/index.js +12 -11
  64. package/lib/morph/index.cjs +1 -1
  65. package/lib/morph/index.js +3 -2
  66. package/lib/need_redo_tweaker/index.cjs +3 -3
  67. package/lib/need_redo_tweaker/index.js +368 -340
  68. package/lib/pixel-perfect/index.cjs +1 -1
  69. package/lib/pixel-perfect/index.js +2 -2
  70. package/lib/pointer/index.cjs +1 -1
  71. package/lib/pointer/index.js +19 -18
  72. package/lib/popover/index.cjs +1 -1
  73. package/lib/popover/index.js +3 -2
  74. package/lib/radio/index.cjs +1 -1
  75. package/lib/radio/index.js +2 -1
  76. package/lib/router/index.cjs +1 -1
  77. package/lib/router/index.js +11 -10
  78. package/lib/scroll/index.cjs +1 -1
  79. package/lib/scroll/index.js +66 -65
  80. package/lib/{scroll-Benkuq-t.js → scroll-BWF48oHS.js} +11 -10
  81. package/lib/scroll-CFDCeArT.cjs +1 -0
  82. package/lib/scroll-segment/index.cjs +1 -1
  83. package/lib/scroll-segment/index.js +3 -456
  84. package/lib/sequence/index.cjs +1 -1
  85. package/lib/sequence/index.js +4 -3
  86. package/lib/size-element/index.cjs +1 -1
  87. package/lib/size-element/index.js +2 -1
  88. package/lib/slicer/index.cjs +3 -3
  89. package/lib/slicer/index.js +31 -30
  90. package/lib/source/SourceElement.d.ts +1 -1
  91. package/lib/source/index.cjs +1 -5
  92. package/lib/source/index.js +5 -214
  93. package/lib/store/index.cjs +1 -1
  94. package/lib/store/index.js +14 -13
  95. package/lib/stylesheet-DpnWNVyD.js +24 -0
  96. package/lib/stylesheet-HWF2a3nr.cjs +1 -0
  97. package/lib/ticker/index.cjs +1 -1
  98. package/lib/ticker/index.js +14 -13
  99. package/lib/utils/index.cjs +1 -1
  100. package/lib/utils/index.d.ts +1 -0
  101. package/lib/utils/index.js +5 -5
  102. package/lib/utils/jss.d.ts +0 -1
  103. package/lib/utils/stylesheet.d.ts +2 -0
  104. package/lib/video/index.cjs +1 -1
  105. package/lib/video/index.js +11 -10
  106. package/lib/window-resizer/index.cjs +1 -1
  107. package/lib/window-resizer/index.js +9 -8
  108. package/lib/youtube/index.cjs +1 -1
  109. package/lib/youtube/index.js +12 -11
  110. package/package.json +4 -4
  111. package/lib/Animation-dD_idtTU.cjs +0 -1
  112. package/lib/Damped-B8bmTxAr.cjs +0 -1
  113. package/lib/Store-GokLe_g-.cjs +0 -1
  114. package/lib/Tweened-BsL9FamJ.cjs +0 -1
  115. package/lib/index-Cqw2NKev.cjs +0 -1
  116. package/lib/jss-CRBgdvJ3.cjs +0 -1
  117. package/lib/jss-DtnXPEnq.js +0 -23
  118. package/lib/scroll-DAhSpkhR.cjs +0 -1
@@ -1,42 +1,43 @@
1
- var h = (n) => {
2
- throw TypeError(n);
1
+ var h = (r) => {
2
+ throw TypeError(r);
3
3
  };
4
- var y = (n, t, s) => t.has(n) || h("Cannot " + s);
5
- var r = (n, t, s) => (y(n, t, "read from private field"), s ? s.call(n) : t.get(n)), b = (n, t, s) => t.has(n) ? h("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(n) : t.set(n, s), u = (n, t, s, e) => (y(n, t, "write to private field"), e ? e.call(n, s) : t.set(n, s), s);
6
- import { i as p } from "../index-euf5anj6.js";
4
+ var y = (r, t, s) => t.has(r) || h("Cannot " + s);
5
+ var n = (r, t, s) => (y(r, t, "read from private field"), s ? s.call(r) : t.get(r)), b = (r, t, s) => t.has(r) ? h("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(r) : t.set(r, s), u = (r, t, s, e) => (y(r, t, "write to private field"), e ? e.call(r, s) : t.set(r, s), s);
6
+ import { i as p } from "../index-Bv9zgfdb.js";
7
7
  import { g as w } from "../dom-CVWzyXPH.js";
8
- var i, o, f;
8
+ import "construct-style-sheets-polyfill";
9
+ var i, c, f;
9
10
  class z {
10
11
  constructor() {
11
12
  b(this, i, []);
12
- b(this, o, null);
13
+ b(this, c, null);
13
14
  b(this, f, (t) => {
14
- r(this, i).map((e) => ({
15
+ n(this, i).map((e) => ({
15
16
  subscriber: e,
16
17
  entry: t.find((l) => l.target === e.element)
17
18
  })).forEach((e) => {
18
19
  e.entry && (e.subscriber.entry = e.entry, e.subscriber.callback(e.entry));
19
20
  });
20
21
  });
21
- p && window.ResizeObserver && u(this, o, new ResizeObserver(r(this, f)));
22
+ p && window.ResizeObserver && u(this, c, new ResizeObserver(n(this, f)));
22
23
  }
23
24
  subscribe(t, s) {
24
25
  const e = w(t);
25
26
  if (!e)
26
27
  return () => {
27
28
  };
28
- const l = r(this, i).find(
29
- (c) => c.element === e
29
+ const l = n(this, i).find(
30
+ (o) => o.element === e
30
31
  );
31
32
  if (!l)
32
- r(this, o).observe(e);
33
+ n(this, c).observe(e);
33
34
  else {
34
- const c = r(this, i).find(
35
+ const o = n(this, i).find(
35
36
  (m) => m.element === e && m.entry
36
37
  );
37
- c != null && c.element.isConnected && s(c.entry);
38
+ o != null && o.element.isConnected && s(o.entry);
38
39
  }
39
- return r(this, i).push({
40
+ return n(this, i).push({
40
41
  element: e,
41
42
  callback: s,
42
43
  entry: (l == null ? void 0 : l.entry) || null
@@ -45,17 +46,17 @@ class z {
45
46
  };
46
47
  }
47
48
  unsubscribe(t) {
48
- const s = r(this, i).find(
49
+ const s = n(this, i).find(
49
50
  (e) => e.callback === t
50
51
  );
51
- s && (u(this, i, r(this, i).filter(
52
+ s && (u(this, i, n(this, i).filter(
52
53
  (e) => e.callback !== s.callback
53
- )), r(this, i).find((e) => e.element === s.element) || r(this, o).unobserve(s.element));
54
+ )), n(this, i).find((e) => e.element === s.element) || n(this, c).unobserve(s.element));
54
55
  }
55
56
  }
56
- i = new WeakMap(), o = new WeakMap(), f = new WeakMap();
57
- const g = new z();
57
+ i = new WeakMap(), c = new WeakMap(), f = new WeakMap();
58
+ const E = new z();
58
59
  export {
59
60
  z as ElementResizer,
60
- g as elementResizer
61
+ E as elementResizer
61
62
  };
@@ -33,7 +33,7 @@ export declare class En3View {
33
33
  destroy(): void;
34
34
  attachToHTMLElement<T extends Object3D>(element: ElementOrSelector<HTMLElement>, object: T, options?: En3AttachOptions): En3AttachedObject3D<T>;
35
35
  detachFromHTMLElement(object: Object3D): void;
36
- add<T extends Object3D<any>>(object: T): T;
37
- add<T extends Object3D<any>>(object: T, element: ElementOrSelector<HTMLElement>, options?: En3AttachOptions): En3AttachedObject3D<T>;
36
+ add<T extends Object3D>(object: T): T;
37
+ add<T extends Object3D>(object: T, element: ElementOrSelector<HTMLElement>, options?: En3AttachOptions): En3AttachedObject3D<T>;
38
38
  remove(object: Object3D, detach?: boolean): void;
39
39
  }
package/lib/en3/en3.d.ts CHANGED
@@ -1,14 +1,15 @@
1
- import { ElementOrSelector } from '../utils';
2
1
  import { WebGLRenderer, WebGLRendererParameters } from 'three';
2
+ import { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer.js';
3
+ import { ElementOrSelector } from '../utils';
3
4
  import { En3View, En3ViewOptions } from './En3View';
4
5
  import { En3Raycaster } from './En3Raycaster';
5
- import { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer.js';
6
6
  export interface En3Options {
7
7
  webGLRendererParameters?: WebGLRendererParameters;
8
8
  maxPixelRatio?: number;
9
9
  containerElement?: ElementOrSelector<HTMLElement>;
10
10
  view?: En3ViewOptions;
11
11
  zIndex?: number;
12
+ position?: 'fixed' | 'absolute' | 'relative';
12
13
  composer?: typeof EffectComposer;
13
14
  }
14
15
  declare class En3 {
package/lib/en3/index.cjs CHANGED
@@ -1,8 +1,8 @@
1
- "use strict";var de=Object.defineProperty,ue=Object.defineProperties;var me=Object.getOwnPropertyDescriptors;var Z=Object.getOwnPropertySymbols;var fe=Object.prototype.hasOwnProperty,ge=Object.prototype.propertyIsEnumerable;var Q=s=>{throw TypeError(s)};var J=(s,e,i)=>e in s?de(s,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):s[e]=i,k=(s,e)=>{for(var i in e||(e={}))fe.call(e,i)&&J(s,i,e[i]);if(Z)for(var i of Z(e))ge.call(e,i)&&J(s,i,e[i]);return s},ee=(s,e)=>ue(s,me(e));var te=(s,e,i)=>e.has(s)||Q("Cannot "+i);var t=(s,e,i)=>(te(s,e,"read from private field"),i?i.call(s):e.get(s)),r=(s,e,i)=>e.has(s)?Q("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(s):e.set(s,i),n=(s,e,i,a)=>(te(s,e,"write to private field"),a?a.call(s,i):e.set(s,i),i);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ie=require("../order/index.cjs"),se=require("../window-resizer/index.cjs"),re=require("../ticker/index.cjs"),ae=require("../dom-JBOkFLTh.cjs");require("../index-Cqw2NKev.cjs");const u=require("three"),ne=require("../layout-box/index.cjs");function he(s){const e=i=>{i.dispose();for(const a of Object.keys(i)){const h=i[a];h&&typeof h=="object"&&"minFilter"in h&&h.dispose()}};s.traverse(i=>{if(i instanceof u.Mesh){if(i.geometry.dispose(),!Array.isArray(i.material)&&i.material.isMaterial)e(i.material);else if(Array.isArray(i.material))for(const a of i.material)e(a)}})}var P,o,C,v,w,O,D,R;class X{constructor(e,i){r(this,P);r(this,o);r(this,C);r(this,v);r(this,w);r(this,O);r(this,D);r(this,R);n(this,P,e),n(this,o,(i==null?void 0:i.cameraType)==="orthographic"?new u.OrthographicCamera:new u.PerspectiveCamera),n(this,C,new u.Scene),n(this,v,[]),n(this,w,(i==null?void 0:i.cameraDistance)||1e3),t(this,o).near=(i==null?void 0:i.cameraNear)||1,t(this,o).far=(i==null?void 0:i.cameraFar)||11e3,n(this,O,(i==null?void 0:i.cameraFov)||"auto"),t(this,o).position.z=t(this,w),t(this,o).name=`Cameras.${t(this,P)}`,n(this,D,ae.getElement(i==null?void 0:i.sizeElement)||document.documentElement),this.beforeRenderCallback=i==null?void 0:i.beforeRender,n(this,R,new ne.LayoutBox(t(this,D))),t(this,R).onResize(()=>{this.resize()})}get name(){return t(this,P)}get camera(){return t(this,o)}get scene(){return t(this,C)}get box(){return t(this,R)}get cameraDistance(){return t(this,w)}set cameraDistance(e){n(this,w,e),this.resize()}get sizeElement(){return t(this,D)}get isClipped(){return t(this,D)!==d.containerElement}resize(){const{width:e,height:i}=t(this,R);t(this,o).userData.controlled||(t(this,o).position.z=t(this,w)),t(this,o)instanceof u.PerspectiveCamera?(t(this,o).aspect=e/i,t(this,o).fov=t(this,O)==="auto"?2*Math.atan(i/2/t(this,w))*(180/Math.PI):t(this,o).userData.controlled?t(this,o).fov:t(this,O)):t(this,o)instanceof u.OrthographicCamera&&(t(this,o).left=e/-2,t(this,o).right=e/2,t(this,o).top=i/2,t(this,o).bottom=i/-2),t(this,o).updateProjectionMatrix()}destroy(){t(this,v).forEach(e=>{e.userData.box.destroy()}),t(this,C).clear(),he(t(this,C)),d.destroyView(this.name),t(this,R).destroy()}attachToHTMLElement(e,i,a){const h=new ne.LayoutBox(e,ee(k({},a),{containerElement:t(this,D),cartesian:!0,scrollStep:!this.isClipped}));return h.bindObject(i),i.userData.box=h,t(this,v).push(i),i}detachFromHTMLElement(e){n(this,v,t(this,v).filter(i=>i===e?(e.userData.box.destroy(),!1):!0))}add(...e){const i=e[0],a=e[1],h=e[2];return a&&this.attachToHTMLElement(a,i,h),this.scene.add(i),i}remove(e,i){this.scene.remove(e),i&&this.detachFromHTMLElement(e)}}P=new WeakMap,o=new WeakMap,C=new WeakMap,v=new WeakMap,w=new WeakMap,O=new WeakMap,D=new WeakMap,R=new WeakMap;var A,q,F,z,I;class xe{constructor(e){r(this,A);r(this,q);r(this,F);r(this,z);r(this,I);n(this,A,e.targetName||void 0),n(this,q,e.eventDispatcher||e.object3D),n(this,F,e.propagation||!1),n(this,z,e.object3D),n(this,I,t(this,A)?()=>t(this,z).getObjectByName(t(this,A))||t(this,z):()=>t(this,z))}get object3D(){return t(this,z)}get eventDispatcher(){return t(this,q)}get propagation(){return t(this,F)}get target(){return t(this,I).call(this)}dispatch(e,i){this.eventDispatcher.dispatchEvent(k({originalEvent:i,type:e},this.intersection))}}A=new WeakMap,q=new WeakMap,F=new WeakMap,z=new WeakMap,I=new WeakMap;var E,m,H,N,_,B,W;class ye{constructor(){r(this,E,[]);r(this,m,[]);r(this,H,new u.Vector2);r(this,N,new u.Raycaster);r(this,_,e=>{for(let i=0;i<t(this,m).length;i++)t(this,m)[i].dispatch("pointerDown",e)});r(this,B,e=>{for(let i=0;i<t(this,m).length;i++)t(this,m)[i].dispatch("pointerUp",e)});r(this,W,e=>{if(!t(this,E).length)return;t(this,H).x=e.clientX/d.width*2-1,t(this,H).y=-(e.clientY/d.height)*2+1,d.camera&&t(this,N).setFromCamera(t(this,H),d.camera);const i=[];for(const c of t(this,E)){const f=t(this,N).intersectObject(c.target);f.length&&(c.intersection=f[0],i.push(c))}let a=!1;const h=t(this,m).filter(c=>!i.find(f=>f.object3D.uuid===c.object3D.uuid)),y=i.sort((c,f)=>f.object3D.position.z-c.object3D.position.z).filter((c,f)=>a?(h.push(c),!1):(a=!c.propagation,!0)),p=y.filter(c=>!t(this,m).find(f=>f.object3D.uuid===c.object3D.uuid));for(let c=0;c<h.length;c++)h[c].dispatch("pointerLeave",e);for(let c=0;c<p.length;c++)p[c].dispatch("pointerEnter",e);n(this,m,y);for(let c=0;c<t(this,m).length;c++)t(this,m)[c].dispatch("pointerMove",e)});d.containerElement.addEventListener("pointerdown",t(this,_)),d.containerElement.addEventListener("pointerup",t(this,B)),d.containerElement.addEventListener("pointermove",t(this,W))}destroy(){d.containerElement.removeEventListener("pointerdown",t(this,_)),d.containerElement.removeEventListener("pointerup",t(this,B)),d.containerElement.removeEventListener("pointermove",t(this,W)),n(this,E,[]),n(this,m,[])}add(e,i){if(t(this,E).find(h=>h.object3D.uuid===e.uuid))return;const a=new xe(k({object3D:e},i));t(this,E).push(a)}remove(e){n(this,E,t(this,E).filter(i=>i.object3D.uuid!==e.uuid)),n(this,m,t(this,m).filter(i=>i.object3D.uuid!==e.uuid))}}E=new WeakMap,m=new WeakMap,H=new WeakMap,N=new WeakMap,_=new WeakMap,B=new WeakMap,W=new WeakMap;var U,b,l,j,g,M,T,L,Y,S,x,$,G;class Ee{constructor(){r(this,U,`https://unpkg.com/three@0.${u.REVISION}.x`);r(this,b,null);r(this,l,null);r(this,j,null);r(this,g,new Map);r(this,M,0);r(this,T,0);r(this,L,0);r(this,Y,2);r(this,S,!1);r(this,x,null);r(this,$,()=>{n(this,M,t(this,b).clientWidth),n(this,T,t(this,b).clientHeight),n(this,L,Math.min(t(this,Y),devicePixelRatio||1)),t(this,l).setPixelRatio(t(this,L)),t(this,l).setSize(t(this,M),t(this,T)),t(this,x)&&(t(this,x).setPixelRatio(t(this,L)),t(this,x).setSize(t(this,M),t(this,T)))});r(this,G,()=>{t(this,l).setRenderTarget(null),t(this,g).forEach(e=>{this.render(e)})})}get CDNVersion(){return t(this,U)}get containerElement(){return t(this,b)}get webglRenderer(){return t(this,l)}get raycaster(){return t(this,j)}get views(){return t(this,g)}get view(){return this.getView("default")}get camera(){return this.getView("default").camera}get scene(){return this.getView("default").scene}get width(){return t(this,M)}get height(){return t(this,T)}get pixelRatio(){return t(this,L)}get composer(){return t(this,x)}setup(e){if(t(this,S)){console.warn("[en3.setup]: You are trying to setup en3 again.");return}n(this,b,ae.getElement(e==null?void 0:e.containerElement)||document.body),n(this,Y,(e==null?void 0:e.maxPixelRatio)||2),n(this,l,new u.WebGLRenderer(e==null?void 0:e.webGLRendererParameters)),t(this,l).domElement.style.cssText=`
2
- position: fixed;
1
+ "use strict";var de=Object.defineProperty,ue=Object.defineProperties;var me=Object.getOwnPropertyDescriptors;var Z=Object.getOwnPropertySymbols;var fe=Object.prototype.hasOwnProperty,ge=Object.prototype.propertyIsEnumerable;var Q=r=>{throw TypeError(r)};var J=(r,e,i)=>e in r?de(r,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):r[e]=i,k=(r,e)=>{for(var i in e||(e={}))fe.call(e,i)&&J(r,i,e[i]);if(Z)for(var i of Z(e))ge.call(e,i)&&J(r,i,e[i]);return r},ee=(r,e)=>ue(r,me(e));var te=(r,e,i)=>e.has(r)||Q("Cannot "+i);var t=(r,e,i)=>(te(r,e,"read from private field"),i?i.call(r):e.get(r)),s=(r,e,i)=>e.has(r)?Q("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,i),a=(r,e,i,n)=>(te(r,e,"write to private field"),n?n.call(r,i):e.set(r,i),i);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("three"),ie=require("../order/index.cjs"),re=require("../window-resizer/index.cjs"),se=require("../ticker/index.cjs"),ne=require("../dom-JBOkFLTh.cjs");require("construct-style-sheets-polyfill");require("../index-DekP7OZe.cjs");const ae=require("../layout-box/index.cjs");function he(r){const e=i=>{i.dispose();for(const n of Object.keys(i)){const h=i[n];h&&typeof h=="object"&&"minFilter"in h&&h.dispose()}};r.traverse(i=>{if(i instanceof u.Mesh){if(i.geometry.dispose(),!Array.isArray(i.material)&&i.material.isMaterial)e(i.material);else if(Array.isArray(i.material))for(const n of i.material)e(n)}})}var P,o,C,v,w,O,D,R;class X{constructor(e,i){s(this,P);s(this,o);s(this,C);s(this,v);s(this,w);s(this,O);s(this,D);s(this,R);a(this,P,e),a(this,o,(i==null?void 0:i.cameraType)==="orthographic"?new u.OrthographicCamera:new u.PerspectiveCamera),a(this,C,new u.Scene),a(this,v,[]),a(this,w,(i==null?void 0:i.cameraDistance)||1e3),t(this,o).near=(i==null?void 0:i.cameraNear)||1,t(this,o).far=(i==null?void 0:i.cameraFar)||11e3,a(this,O,(i==null?void 0:i.cameraFov)||"auto"),t(this,o).position.z=t(this,w),t(this,o).name=`Cameras.${t(this,P)}`,a(this,D,ne.getElement(i==null?void 0:i.sizeElement)||document.documentElement),this.beforeRenderCallback=i==null?void 0:i.beforeRender,a(this,R,new ae.LayoutBox(t(this,D))),t(this,R).onResize(()=>{this.resize()})}get name(){return t(this,P)}get camera(){return t(this,o)}get scene(){return t(this,C)}get box(){return t(this,R)}get cameraDistance(){return t(this,w)}set cameraDistance(e){a(this,w,e),this.resize()}get sizeElement(){return t(this,D)}get isClipped(){return t(this,D)!==d.containerElement}resize(){const{width:e,height:i}=t(this,R);t(this,o).userData.controlled||(t(this,o).position.z=t(this,w)),t(this,o)instanceof u.PerspectiveCamera?(t(this,o).aspect=e/i,t(this,o).fov=t(this,O)==="auto"?2*Math.atan(i/2/t(this,w))*(180/Math.PI):t(this,o).userData.controlled?t(this,o).fov:t(this,O)):t(this,o)instanceof u.OrthographicCamera&&(t(this,o).left=e/-2,t(this,o).right=e/2,t(this,o).top=i/2,t(this,o).bottom=i/-2),t(this,o).updateProjectionMatrix()}destroy(){t(this,v).forEach(e=>{e.userData.box.destroy()}),t(this,C).clear(),he(t(this,C)),d.destroyView(this.name),t(this,R).destroy()}attachToHTMLElement(e,i,n){const h=new ae.LayoutBox(e,ee(k({},n),{containerElement:t(this,D),cartesian:!0,scrollStep:!this.isClipped}));return h.bindObject(i),i.userData.box=h,t(this,v).push(i),i}detachFromHTMLElement(e){a(this,v,t(this,v).filter(i=>i===e?(e.userData.box.destroy(),!1):!0))}add(...e){const i=e[0],n=e[1],h=e[2];return n&&this.attachToHTMLElement(n,i,h),this.scene.add(i),i}remove(e,i){this.scene.remove(e),i&&this.detachFromHTMLElement(e)}}P=new WeakMap,o=new WeakMap,C=new WeakMap,v=new WeakMap,w=new WeakMap,O=new WeakMap,D=new WeakMap,R=new WeakMap;var A,q,F,z,I;class xe{constructor(e){s(this,A);s(this,q);s(this,F);s(this,z);s(this,I);a(this,A,e.targetName||void 0),a(this,q,e.eventDispatcher||e.object3D),a(this,F,e.propagation||!1),a(this,z,e.object3D),a(this,I,t(this,A)?()=>t(this,z).getObjectByName(t(this,A))||t(this,z):()=>t(this,z))}get object3D(){return t(this,z)}get eventDispatcher(){return t(this,q)}get propagation(){return t(this,F)}get target(){return t(this,I).call(this)}dispatch(e,i){this.eventDispatcher.dispatchEvent(k({originalEvent:i,type:e},this.intersection))}}A=new WeakMap,q=new WeakMap,F=new WeakMap,z=new WeakMap,I=new WeakMap;var E,m,H,N,_,B,$;class ye{constructor(){s(this,E,[]);s(this,m,[]);s(this,H,new u.Vector2);s(this,N,new u.Raycaster);s(this,_,e=>{for(let i=0;i<t(this,m).length;i++)t(this,m)[i].dispatch("pointerDown",e)});s(this,B,e=>{for(let i=0;i<t(this,m).length;i++)t(this,m)[i].dispatch("pointerUp",e)});s(this,$,e=>{if(!t(this,E).length)return;t(this,H).x=e.clientX/d.width*2-1,t(this,H).y=-(e.clientY/d.height)*2+1,d.camera&&t(this,N).setFromCamera(t(this,H),d.camera);const i=[];for(const c of t(this,E)){const f=t(this,N).intersectObject(c.target);f.length&&(c.intersection=f[0],i.push(c))}let n=!1;const h=t(this,m).filter(c=>!i.find(f=>f.object3D.uuid===c.object3D.uuid)),y=i.sort((c,f)=>f.object3D.position.z-c.object3D.position.z).filter((c,f)=>n?(h.push(c),!1):(n=!c.propagation,!0)),p=y.filter(c=>!t(this,m).find(f=>f.object3D.uuid===c.object3D.uuid));for(let c=0;c<h.length;c++)h[c].dispatch("pointerLeave",e);for(let c=0;c<p.length;c++)p[c].dispatch("pointerEnter",e);a(this,m,y);for(let c=0;c<t(this,m).length;c++)t(this,m)[c].dispatch("pointerMove",e)});d.containerElement.addEventListener("pointerdown",t(this,_)),d.containerElement.addEventListener("pointerup",t(this,B)),d.containerElement.addEventListener("pointermove",t(this,$))}destroy(){d.containerElement.removeEventListener("pointerdown",t(this,_)),d.containerElement.removeEventListener("pointerup",t(this,B)),d.containerElement.removeEventListener("pointermove",t(this,$)),a(this,E,[]),a(this,m,[])}add(e,i){if(t(this,E).find(h=>h.object3D.uuid===e.uuid))return;const n=new xe(k({object3D:e},i));t(this,E).push(n)}remove(e){a(this,E,t(this,E).filter(i=>i.object3D.uuid!==e.uuid)),a(this,m,t(this,m).filter(i=>i.object3D.uuid!==e.uuid))}}E=new WeakMap,m=new WeakMap,H=new WeakMap,N=new WeakMap,_=new WeakMap,B=new WeakMap,$=new WeakMap;var U,b,l,j,g,M,T,L,W,S,x,Y,G;class Ee{constructor(){s(this,U,`https://unpkg.com/three@0.${u.REVISION}.x`);s(this,b,null);s(this,l,null);s(this,j,null);s(this,g,new Map);s(this,M,0);s(this,T,0);s(this,L,0);s(this,W,2);s(this,S,!1);s(this,x,null);s(this,Y,()=>{a(this,M,t(this,b).clientWidth),a(this,T,t(this,b).clientHeight),a(this,L,Math.min(t(this,W),devicePixelRatio||1)),t(this,l).setPixelRatio(t(this,L)),t(this,l).setSize(t(this,M),t(this,T)),t(this,x)&&(t(this,x).setPixelRatio(t(this,L)),t(this,x).setSize(t(this,M),t(this,T)))});s(this,G,()=>{t(this,l).setRenderTarget(null),t(this,g).forEach(e=>{this.render(e)})})}get CDNVersion(){return t(this,U)}get containerElement(){return t(this,b)}get webglRenderer(){return t(this,l)}get raycaster(){return t(this,j)}get views(){return t(this,g)}get view(){return this.getView("default")}get camera(){return this.getView("default").camera}get scene(){return this.getView("default").scene}get width(){return t(this,M)}get height(){return t(this,T)}get pixelRatio(){return t(this,L)}get composer(){return t(this,x)}setup(e){if(t(this,S)){console.warn("[en3.setup]: You are trying to setup en3 again.");return}a(this,b,ne.getElement(e==null?void 0:e.containerElement)||document.body),a(this,W,(e==null?void 0:e.maxPixelRatio)||2),a(this,l,new u.WebGLRenderer(e==null?void 0:e.webGLRendererParameters)),t(this,l).domElement.style.cssText=`
2
+ position: ${(e==null?void 0:e.position)||"fixed"};
3
3
  left: 0;
4
4
  top: 0;
5
5
  width: 100%;
6
6
  height: 100%;
7
7
  z-index: ${(e==null?void 0:e.zIndex)||0};
8
- `,(t(this,b).shadowRoot||t(this,b)).append(t(this,l).domElement),t(this,g).set("default",new X("default",k({sizeElement:t(this,b)},e==null?void 0:e.view))),n(this,j,new ye),e!=null&&e.composer&&(n(this,x,new e.composer(t(this,l))),this.render=()=>{t(this,x).render()}),n(this,S,!0),se.windowResizer.subscribe(t(this,$),ie.RESIZE_ORDER.CANVAS),re.ticker.subscribe(t(this,G),{order:ie.TICK_ORDER.CANVAS})}destroy(){if(!t(this,S)){console.warn("[en3.setup]: You are trying to destory en3 but it has not been initialized.");return}se.windowResizer.unsubscribe(t(this,$)),re.ticker.unsubscribe(t(this,G)),t(this,j).destroy(),t(this,g).forEach(e=>{e.destroy()}),t(this,l).dispose(),t(this,l).domElement.remove(),n(this,l,null),t(this,x).dispose(),n(this,x,null),n(this,S,!1)}createView(e,i){const a=t(this,g).size,h=new X(e,i);return t(this,g).set(e,h),a===1&&t(this,l).setScissorTest(!0),h}getView(e){return t(this,g).get(e)}destroyView(e){const i=t(this,g).get(e);i&&(t(this,g).delete(e),i.destroy(),t(this,g).size<=1&&t(this,l).setScissorTest(!1))}render(e){var i;if(t(this,g).size>1||this.view.isClipped){const a=e.box.left+e.box.CSSTranslation.x+e.box.scrollValue.x,h=d.height-e.box.height-e.box.top+e.box.CSSTranslation.y+e.box.scrollValue.y*-1;t(this,l).setScissor(a,h,e.box.width,e.box.height),t(this,l).setViewport(a,h,e.box.width,e.box.height)}(i=e.beforeRenderCallback)==null||i.call(e),t(this,l).render(e.scene,e.camera)}}U=new WeakMap,b=new WeakMap,l=new WeakMap,j=new WeakMap,g=new WeakMap,M=new WeakMap,T=new WeakMap,L=new WeakMap,Y=new WeakMap,S=new WeakMap,x=new WeakMap,$=new WeakMap,G=new WeakMap;const d=new Ee;function be(s,e,i){const a=e.x,h=e.y,V=i||s.image.width/s.image.height;let y=0,p=0,c=s.offset.x,f=s.offset.y,ce=s.rotation,oe=s.center.x,le=s.center.y;a/h>V?(y=1,p=h/a*V):(p=1,y=a/h/V),s.matrix.setUvTransform(c,f,y,p,ce,oe,le)}const K=new u.Vector3,we=new u.Vector3;function pe(s,e="default"){const i=d.getView(e),{width:a,height:h}=d,V=a/h;s instanceof u.Vector3?K.copy(s):K.set(...s);const y=i.camera.getWorldPosition(we).distanceTo(K);if(i.camera instanceof u.OrthographicCamera)return{width:a/i.camera.zoom,height:h/i.camera.zoom,factor:1,distance:y,aspect:V};{const p=i.camera.fov*Math.PI/180,c=2*Math.tan(p/2)*y,f=c*(a/h);return{width:f,height:c,factor:a/f,distance:y,aspect:V}}}function ve(s,e){s.traverse(i=>{i instanceof u.Mesh&&i.material&&(Array.isArray(i.material)?i.material:[i.material]).forEach(e)})}function De(s,e){s.traverse(i=>{i instanceof u.Mesh&&e(i)})}exports.En3View=X;exports.coverTexture=be;exports.dispose=he;exports.en3=d;exports.getCurrentViewport=pe;exports.traverseMaterials=ve;exports.traverseMeshes=De;
8
+ `,(t(this,b).shadowRoot||t(this,b)).append(t(this,l).domElement),t(this,g).set("default",new X("default",k({sizeElement:t(this,b)},e==null?void 0:e.view))),a(this,j,new ye),e!=null&&e.composer&&(a(this,x,new e.composer(t(this,l))),this.render=()=>{t(this,x).render()}),a(this,S,!0),re.windowResizer.subscribe(t(this,Y),ie.RESIZE_ORDER.CANVAS),se.ticker.subscribe(t(this,G),{order:ie.TICK_ORDER.CANVAS})}destroy(){var e;if(!t(this,S)){console.warn("[en3.setup]: You are trying to destory en3 but it has not been initialized.");return}re.windowResizer.unsubscribe(t(this,Y)),se.ticker.unsubscribe(t(this,G)),t(this,j).destroy(),t(this,g).forEach(i=>{i.destroy()}),t(this,l).dispose(),t(this,l).domElement.remove(),a(this,l,null),(e=t(this,x))==null||e.dispose(),a(this,x,null),a(this,S,!1)}createView(e,i){const n=t(this,g).size,h=new X(e,i);return t(this,g).set(e,h),n===1&&t(this,l).setScissorTest(!0),h}getView(e){return t(this,g).get(e)}destroyView(e){const i=t(this,g).get(e);i&&(t(this,g).delete(e),i.destroy(),t(this,g).size<=1&&t(this,l).setScissorTest(!1))}render(e){var i;if(t(this,g).size>1||this.view.isClipped){const n=e.box.left+e.box.CSSTranslation.x+e.box.scrollValue.x,h=d.height-e.box.height-e.box.top+e.box.CSSTranslation.y+e.box.scrollValue.y*-1;t(this,l).setScissor(n,h,e.box.width,e.box.height),t(this,l).setViewport(n,h,e.box.width,e.box.height)}(i=e.beforeRenderCallback)==null||i.call(e),t(this,l).render(e.scene,e.camera)}}U=new WeakMap,b=new WeakMap,l=new WeakMap,j=new WeakMap,g=new WeakMap,M=new WeakMap,T=new WeakMap,L=new WeakMap,W=new WeakMap,S=new WeakMap,x=new WeakMap,Y=new WeakMap,G=new WeakMap;const d=new Ee;function be(r,e,i){const n=e.x,h=e.y,V=i||r.image.width/r.image.height;let y=0,p=0,c=r.offset.x,f=r.offset.y,ce=r.rotation,oe=r.center.x,le=r.center.y;n/h>V?(y=1,p=h/n*V):(p=1,y=n/h/V),r.matrix.setUvTransform(c,f,y,p,ce,oe,le)}const K=new u.Vector3,we=new u.Vector3;function pe(r,e="default"){const i=d.getView(e),{width:n,height:h}=d,V=n/h;r instanceof u.Vector3?K.copy(r):K.set(...r);const y=i.camera.getWorldPosition(we).distanceTo(K);if(i.camera instanceof u.OrthographicCamera)return{width:n/i.camera.zoom,height:h/i.camera.zoom,factor:1,distance:y,aspect:V};{const p=i.camera.fov*Math.PI/180,c=2*Math.tan(p/2)*y,f=c*(n/h);return{width:f,height:c,factor:n/f,distance:y,aspect:V}}}function ve(r,e){r.traverse(i=>{i instanceof u.Mesh&&i.material&&(Array.isArray(i.material)?i.material:[i.material]).forEach(e)})}function De(r,e){r.traverse(i=>{i instanceof u.Mesh&&e(i)})}exports.En3View=X;exports.coverTexture=be;exports.dispose=he;exports.en3=d;exports.getCurrentViewport=pe;exports.traverseMaterials=ve;exports.traverseMeshes=De;
package/lib/en3/index.js CHANGED
@@ -1,33 +1,34 @@
1
- var ue = Object.defineProperty, me = Object.defineProperties;
1
+ var me = Object.defineProperty, ue = Object.defineProperties;
2
2
  var fe = Object.getOwnPropertyDescriptors;
3
3
  var J = Object.getOwnPropertySymbols;
4
4
  var ge = Object.prototype.hasOwnProperty, Ee = Object.prototype.propertyIsEnumerable;
5
5
  var ee = (s) => {
6
6
  throw TypeError(s);
7
7
  };
8
- var Q = (s, e, i) => e in s ? ue(s, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : s[e] = i, j = (s, e) => {
8
+ var Q = (s, e, i) => e in s ? me(s, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : s[e] = i, j = (s, e) => {
9
9
  for (var i in e || (e = {}))
10
10
  ge.call(e, i) && Q(s, i, e[i]);
11
11
  if (J)
12
12
  for (var i of J(e))
13
13
  Ee.call(e, i) && Q(s, i, e[i]);
14
14
  return s;
15
- }, te = (s, e) => me(s, fe(e));
15
+ }, te = (s, e) => ue(s, fe(e));
16
16
  var ie = (s, e, i) => e.has(s) || ee("Cannot " + i);
17
- var t = (s, e, i) => (ie(s, e, "read from private field"), i ? i.call(s) : e.get(s)), r = (s, e, i) => e.has(s) ? ee("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(s) : e.set(s, i), h = (s, e, i, n) => (ie(s, e, "write to private field"), n ? n.call(s, i) : e.set(s, i), i);
18
- import { RESIZE_ORDER as be, TICK_ORDER as ye } from "../order/index.js";
19
- import { windowResizer as se } from "../window-resizer/index.js";
20
- import { ticker as re } from "../ticker/index.js";
17
+ var t = (s, e, i) => (ie(s, e, "read from private field"), i ? i.call(s) : e.get(s)), r = (s, e, i) => e.has(s) ? ee("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(s) : e.set(s, i), h = (s, e, i, a) => (ie(s, e, "write to private field"), a ? a.call(s, i) : e.set(s, i), i);
18
+ import { Mesh as Z, OrthographicCamera as X, PerspectiveCamera as se, Scene as be, Vector2 as ye, Raycaster as xe, REVISION as we, WebGLRenderer as pe, Vector3 as q } from "three";
19
+ import { RESIZE_ORDER as De, TICK_ORDER as Re } from "../order/index.js";
20
+ import { windowResizer as re } from "../window-resizer/index.js";
21
+ import { ticker as he } from "../ticker/index.js";
21
22
  import { g as ce } from "../dom-CVWzyXPH.js";
22
- import "../index-euf5anj6.js";
23
- import { Mesh as Z, OrthographicCamera as X, PerspectiveCamera as he, Scene as xe, Vector2 as we, Raycaster as pe, REVISION as De, WebGLRenderer as Re, Vector3 as q } from "three";
24
- import { LayoutBox as ne } from "../layout-box/index.js";
23
+ import "construct-style-sheets-polyfill";
24
+ import "../index-Bv9zgfdb.js";
25
+ import { LayoutBox as ae } from "../layout-box/index.js";
25
26
  function ve(s) {
26
27
  const e = (i) => {
27
28
  i.dispose();
28
- for (const n of Object.keys(i)) {
29
- const a = i[n];
30
- a && typeof a == "object" && "minFilter" in a && a.dispose();
29
+ for (const a of Object.keys(i)) {
30
+ const n = i[a];
31
+ n && typeof n == "object" && "minFilter" in n && n.dispose();
31
32
  }
32
33
  };
33
34
  s.traverse((i) => {
@@ -35,12 +36,12 @@ function ve(s) {
35
36
  if (i.geometry.dispose(), !Array.isArray(i.material) && i.material.isMaterial)
36
37
  e(i.material);
37
38
  else if (Array.isArray(i.material))
38
- for (const n of i.material) e(n);
39
+ for (const a of i.material) e(a);
39
40
  }
40
41
  });
41
42
  }
42
43
  var S, o, V, p, x, P, D, R;
43
- class ae {
44
+ class ne {
44
45
  constructor(e, i) {
45
46
  r(this, S);
46
47
  r(this, o);
@@ -50,7 +51,7 @@ class ae {
50
51
  r(this, P);
51
52
  r(this, D);
52
53
  r(this, R);
53
- h(this, S, e), h(this, o, (i == null ? void 0 : i.cameraType) === "orthographic" ? new X() : new he()), h(this, V, new xe()), h(this, p, []), h(this, x, (i == null ? void 0 : i.cameraDistance) || 1e3), t(this, o).near = (i == null ? void 0 : i.cameraNear) || 1, t(this, o).far = (i == null ? void 0 : i.cameraFar) || 11e3, h(this, P, (i == null ? void 0 : i.cameraFov) || "auto"), t(this, o).position.z = t(this, x), t(this, o).name = `Cameras.${t(this, S)}`, h(this, D, ce(i == null ? void 0 : i.sizeElement) || document.documentElement), this.beforeRenderCallback = i == null ? void 0 : i.beforeRender, h(this, R, new ne(t(this, D))), t(this, R).onResize(() => {
54
+ h(this, S, e), h(this, o, (i == null ? void 0 : i.cameraType) === "orthographic" ? new X() : new se()), h(this, V, new be()), h(this, p, []), h(this, x, (i == null ? void 0 : i.cameraDistance) || 1e3), t(this, o).near = (i == null ? void 0 : i.cameraNear) || 1, t(this, o).far = (i == null ? void 0 : i.cameraFar) || 11e3, h(this, P, (i == null ? void 0 : i.cameraFov) || "auto"), t(this, o).position.z = t(this, x), t(this, o).name = `Cameras.${t(this, S)}`, h(this, D, ce(i == null ? void 0 : i.sizeElement) || document.documentElement), this.beforeRenderCallback = i == null ? void 0 : i.beforeRender, h(this, R, new ae(t(this, D))), t(this, R).onResize(() => {
54
55
  this.resize();
55
56
  });
56
57
  }
@@ -76,31 +77,31 @@ class ae {
76
77
  return t(this, D);
77
78
  }
78
79
  get isClipped() {
79
- return t(this, D) !== u.containerElement;
80
+ return t(this, D) !== m.containerElement;
80
81
  }
81
82
  resize() {
82
83
  const { width: e, height: i } = t(this, R);
83
- t(this, o).userData.controlled || (t(this, o).position.z = t(this, x)), t(this, o) instanceof he ? (t(this, o).aspect = e / i, t(this, o).fov = t(this, P) === "auto" ? 2 * Math.atan(i / 2 / t(this, x)) * (180 / Math.PI) : t(this, o).userData.controlled ? t(this, o).fov : t(this, P)) : t(this, o) instanceof X && (t(this, o).left = e / -2, t(this, o).right = e / 2, t(this, o).top = i / 2, t(this, o).bottom = i / -2), t(this, o).updateProjectionMatrix();
84
+ t(this, o).userData.controlled || (t(this, o).position.z = t(this, x)), t(this, o) instanceof se ? (t(this, o).aspect = e / i, t(this, o).fov = t(this, P) === "auto" ? 2 * Math.atan(i / 2 / t(this, x)) * (180 / Math.PI) : t(this, o).userData.controlled ? t(this, o).fov : t(this, P)) : t(this, o) instanceof X && (t(this, o).left = e / -2, t(this, o).right = e / 2, t(this, o).top = i / 2, t(this, o).bottom = i / -2), t(this, o).updateProjectionMatrix();
84
85
  }
85
86
  destroy() {
86
87
  t(this, p).forEach((e) => {
87
88
  e.userData.box.destroy();
88
- }), t(this, V).clear(), ve(t(this, V)), u.destroyView(this.name), t(this, R).destroy();
89
+ }), t(this, V).clear(), ve(t(this, V)), m.destroyView(this.name), t(this, R).destroy();
89
90
  }
90
- attachToHTMLElement(e, i, n) {
91
- const a = new ne(e, te(j({}, n), {
91
+ attachToHTMLElement(e, i, a) {
92
+ const n = new ae(e, te(j({}, a), {
92
93
  containerElement: t(this, D),
93
94
  cartesian: !0,
94
95
  scrollStep: !this.isClipped
95
96
  }));
96
- return a.bindObject(i), i.userData.box = a, t(this, p).push(i), i;
97
+ return n.bindObject(i), i.userData.box = n, t(this, p).push(i), i;
97
98
  }
98
99
  detachFromHTMLElement(e) {
99
100
  h(this, p, t(this, p).filter((i) => i === e ? (e.userData.box.destroy(), !1) : !0));
100
101
  }
101
102
  add(...e) {
102
- const i = e[0], n = e[1], a = e[2];
103
- return n && this.attachToHTMLElement(n, i, a), this.scene.add(i), i;
103
+ const i = e[0], a = e[1], n = e[2];
104
+ return a && this.attachToHTMLElement(a, i, n), this.scene.add(i), i;
104
105
  }
105
106
  remove(e, i) {
106
107
  this.scene.remove(e), i && this.detachFromHTMLElement(e);
@@ -137,73 +138,73 @@ class ze {
137
138
  }
138
139
  }
139
140
  A = new WeakMap(), k = new WeakMap(), F = new WeakMap(), v = new WeakMap(), I = new WeakMap();
140
- var b, d, H, N, W, Y, _;
141
+ var b, d, H, N, $, W, Y;
141
142
  class Ve {
142
143
  constructor() {
143
144
  r(this, b, []);
144
145
  r(this, d, []);
145
- r(this, H, new we());
146
- r(this, N, new pe());
147
- r(this, W, (e) => {
146
+ r(this, H, new ye());
147
+ r(this, N, new xe());
148
+ r(this, $, (e) => {
148
149
  for (let i = 0; i < t(this, d).length; i++)
149
150
  t(this, d)[i].dispatch("pointerDown", e);
150
151
  });
151
- r(this, Y, (e) => {
152
+ r(this, W, (e) => {
152
153
  for (let i = 0; i < t(this, d).length; i++)
153
154
  t(this, d)[i].dispatch("pointerUp", e);
154
155
  });
155
- r(this, _, (e) => {
156
+ r(this, Y, (e) => {
156
157
  if (!t(this, b).length)
157
158
  return;
158
- t(this, H).x = e.clientX / u.width * 2 - 1, t(this, H).y = -(e.clientY / u.height) * 2 + 1, u.camera && t(this, N).setFromCamera(t(this, H), u.camera);
159
+ t(this, H).x = e.clientX / m.width * 2 - 1, t(this, H).y = -(e.clientY / m.height) * 2 + 1, m.camera && t(this, N).setFromCamera(t(this, H), m.camera);
159
160
  const i = [];
160
161
  for (const c of t(this, b)) {
161
- const m = t(this, N).intersectObject(c.target);
162
- m.length && (c.intersection = m[0], i.push(c));
162
+ const u = t(this, N).intersectObject(c.target);
163
+ u.length && (c.intersection = u[0], i.push(c));
163
164
  }
164
- let n = !1;
165
- const a = t(this, d).filter(
166
- (c) => !i.find((m) => m.object3D.uuid === c.object3D.uuid)
165
+ let a = !1;
166
+ const n = t(this, d).filter(
167
+ (c) => !i.find((u) => u.object3D.uuid === c.object3D.uuid)
167
168
  ), E = i.sort(
168
- (c, m) => m.object3D.position.z - c.object3D.position.z
169
- ).filter((c, m) => n ? (a.push(c), !1) : (n = !c.propagation, !0)), w = E.filter(
170
- (c) => !t(this, d).find((m) => m.object3D.uuid === c.object3D.uuid)
169
+ (c, u) => u.object3D.position.z - c.object3D.position.z
170
+ ).filter((c, u) => a ? (n.push(c), !1) : (a = !c.propagation, !0)), w = E.filter(
171
+ (c) => !t(this, d).find((u) => u.object3D.uuid === c.object3D.uuid)
171
172
  );
172
- for (let c = 0; c < a.length; c++)
173
- a[c].dispatch("pointerLeave", e);
173
+ for (let c = 0; c < n.length; c++)
174
+ n[c].dispatch("pointerLeave", e);
174
175
  for (let c = 0; c < w.length; c++)
175
176
  w[c].dispatch("pointerEnter", e);
176
177
  h(this, d, E);
177
178
  for (let c = 0; c < t(this, d).length; c++)
178
179
  t(this, d)[c].dispatch("pointerMove", e);
179
180
  });
180
- u.containerElement.addEventListener(
181
+ m.containerElement.addEventListener(
181
182
  "pointerdown",
182
- t(this, W)
183
- ), u.containerElement.addEventListener("pointerup", t(this, Y)), u.containerElement.addEventListener(
183
+ t(this, $)
184
+ ), m.containerElement.addEventListener("pointerup", t(this, W)), m.containerElement.addEventListener(
184
185
  "pointermove",
185
- t(this, _)
186
+ t(this, Y)
186
187
  );
187
188
  }
188
189
  destroy() {
189
- u.containerElement.removeEventListener(
190
+ m.containerElement.removeEventListener(
190
191
  "pointerdown",
191
- t(this, W)
192
- ), u.containerElement.removeEventListener(
192
+ t(this, $)
193
+ ), m.containerElement.removeEventListener(
193
194
  "pointerup",
194
- t(this, Y)
195
- ), u.containerElement.removeEventListener(
195
+ t(this, W)
196
+ ), m.containerElement.removeEventListener(
196
197
  "pointermove",
197
- t(this, _)
198
+ t(this, Y)
198
199
  ), h(this, b, []), h(this, d, []);
199
200
  }
200
201
  add(e, i) {
201
- if (t(this, b).find((a) => a.object3D.uuid === e.uuid))
202
+ if (t(this, b).find((n) => n.object3D.uuid === e.uuid))
202
203
  return;
203
- const n = new ze(j({
204
+ const a = new ze(j({
204
205
  object3D: e
205
206
  }, i));
206
- t(this, b).push(n);
207
+ t(this, b).push(a);
207
208
  }
208
209
  remove(e) {
209
210
  h(this, b, t(this, b).filter(
@@ -211,11 +212,11 @@ class Ve {
211
212
  )), h(this, d, t(this, d).filter((i) => i.object3D.uuid !== e.uuid));
212
213
  }
213
214
  }
214
- b = new WeakMap(), d = new WeakMap(), H = new WeakMap(), N = new WeakMap(), W = new WeakMap(), Y = new WeakMap(), _ = new WeakMap();
215
- var U, y, l, O, f, L, T, C, $, M, g, B, G;
215
+ b = new WeakMap(), d = new WeakMap(), H = new WeakMap(), N = new WeakMap(), $ = new WeakMap(), W = new WeakMap(), Y = new WeakMap();
216
+ var U, y, l, O, f, L, T, C, _, M, g, B, G;
216
217
  class Le {
217
218
  constructor() {
218
- r(this, U, `https://unpkg.com/three@0.${De}.x`);
219
+ r(this, U, `https://unpkg.com/three@0.${we}.x`);
219
220
  r(this, y, null);
220
221
  r(this, l, null);
221
222
  r(this, O, null);
@@ -223,11 +224,11 @@ class Le {
223
224
  r(this, L, 0);
224
225
  r(this, T, 0);
225
226
  r(this, C, 0);
226
- r(this, $, 2);
227
+ r(this, _, 2);
227
228
  r(this, M, !1);
228
229
  r(this, g, null);
229
230
  r(this, B, () => {
230
- h(this, L, t(this, y).clientWidth), h(this, T, t(this, y).clientHeight), h(this, C, Math.min(t(this, $), devicePixelRatio || 1)), t(this, l).setPixelRatio(t(this, C)), t(this, l).setSize(t(this, L), t(this, T)), t(this, g) && (t(this, g).setPixelRatio(t(this, C)), t(this, g).setSize(t(this, L), t(this, T)));
231
+ h(this, L, t(this, y).clientWidth), h(this, T, t(this, y).clientHeight), h(this, C, Math.min(t(this, _), devicePixelRatio || 1)), t(this, l).setPixelRatio(t(this, C)), t(this, l).setSize(t(this, L), t(this, T)), t(this, g) && (t(this, g).setPixelRatio(t(this, C)), t(this, g).setSize(t(this, L), t(this, T)));
231
232
  });
232
233
  r(this, G, () => {
233
234
  t(this, l).setRenderTarget(null), t(this, f).forEach((e) => {
@@ -276,8 +277,8 @@ class Le {
276
277
  console.warn("[en3.setup]: You are trying to setup en3 again.");
277
278
  return;
278
279
  }
279
- h(this, y, ce(e == null ? void 0 : e.containerElement) || document.body), h(this, $, (e == null ? void 0 : e.maxPixelRatio) || 2), h(this, l, new Re(e == null ? void 0 : e.webGLRendererParameters)), t(this, l).domElement.style.cssText = `
280
- position: fixed;
280
+ h(this, y, ce(e == null ? void 0 : e.containerElement) || document.body), h(this, _, (e == null ? void 0 : e.maxPixelRatio) || 2), h(this, l, new pe(e == null ? void 0 : e.webGLRendererParameters)), t(this, l).domElement.style.cssText = `
281
+ position: ${(e == null ? void 0 : e.position) || "fixed"};
281
282
  left: 0;
282
283
  top: 0;
283
284
  width: 100%;
@@ -285,27 +286,28 @@ class Le {
285
286
  z-index: ${(e == null ? void 0 : e.zIndex) || 0};
286
287
  `, (t(this, y).shadowRoot || t(this, y)).append(t(this, l).domElement), t(this, f).set(
287
288
  "default",
288
- new ae("default", j({
289
+ new ne("default", j({
289
290
  sizeElement: t(this, y)
290
291
  }, e == null ? void 0 : e.view))
291
292
  ), h(this, O, new Ve()), e != null && e.composer && (h(this, g, new e.composer(t(this, l))), this.render = () => {
292
293
  t(this, g).render();
293
- }), h(this, M, !0), se.subscribe(t(this, B), be.CANVAS), re.subscribe(t(this, G), { order: ye.CANVAS });
294
+ }), h(this, M, !0), re.subscribe(t(this, B), De.CANVAS), he.subscribe(t(this, G), { order: Re.CANVAS });
294
295
  }
295
296
  destroy() {
297
+ var e;
296
298
  if (!t(this, M)) {
297
299
  console.warn(
298
300
  "[en3.setup]: You are trying to destory en3 but it has not been initialized."
299
301
  );
300
302
  return;
301
303
  }
302
- se.unsubscribe(t(this, B)), re.unsubscribe(t(this, G)), t(this, O).destroy(), t(this, f).forEach((e) => {
303
- e.destroy();
304
- }), t(this, l).dispose(), t(this, l).domElement.remove(), h(this, l, null), t(this, g).dispose(), h(this, g, null), h(this, M, !1);
304
+ re.unsubscribe(t(this, B)), he.unsubscribe(t(this, G)), t(this, O).destroy(), t(this, f).forEach((i) => {
305
+ i.destroy();
306
+ }), t(this, l).dispose(), t(this, l).domElement.remove(), h(this, l, null), (e = t(this, g)) == null || e.dispose(), h(this, g, null), h(this, M, !1);
305
307
  }
306
308
  createView(e, i) {
307
- const n = t(this, f).size, a = new ae(e, i);
308
- return t(this, f).set(e, a), n === 1 && t(this, l).setScissorTest(!0), a;
309
+ const a = t(this, f).size, n = new ne(e, i);
310
+ return t(this, f).set(e, n), a === 1 && t(this, l).setScissorTest(!0), n;
309
311
  }
310
312
  getView(e) {
311
313
  return t(this, f).get(e);
@@ -317,10 +319,10 @@ class Le {
317
319
  render(e) {
318
320
  var i;
319
321
  if (t(this, f).size > 1 || this.view.isClipped) {
320
- const n = e.box.left + e.box.CSSTranslation.x + e.box.scrollValue.x, a = u.height - e.box.height - e.box.top + e.box.CSSTranslation.y + e.box.scrollValue.y * -1;
321
- t(this, l).setScissor(n, a, e.box.width, e.box.height), t(this, l).setViewport(
322
- n,
322
+ const a = e.box.left + e.box.CSSTranslation.x + e.box.scrollValue.x, n = m.height - e.box.height - e.box.top + e.box.CSSTranslation.y + e.box.scrollValue.y * -1;
323
+ t(this, l).setScissor(a, n, e.box.width, e.box.height), t(this, l).setViewport(
323
324
  a,
325
+ n,
324
326
  e.box.width,
325
327
  e.box.height
326
328
  );
@@ -328,47 +330,47 @@ class Le {
328
330
  (i = e.beforeRenderCallback) == null || i.call(e), t(this, l).render(e.scene, e.camera);
329
331
  }
330
332
  }
331
- U = new WeakMap(), y = new WeakMap(), l = new WeakMap(), O = new WeakMap(), f = new WeakMap(), L = new WeakMap(), T = new WeakMap(), C = new WeakMap(), $ = new WeakMap(), M = new WeakMap(), g = new WeakMap(), B = new WeakMap(), G = new WeakMap();
332
- const u = new Le();
333
- function ke(s, e, i) {
334
- const n = e.x, a = e.y, z = i || s.image.width / s.image.height;
335
- let E = 0, w = 0, c = s.offset.x, m = s.offset.y, oe = s.rotation, le = s.center.x, de = s.center.y;
336
- n / a > z ? (E = 1, w = a / n * z) : (w = 1, E = n / a / z), s.matrix.setUvTransform(c, m, E, w, oe, le, de);
333
+ U = new WeakMap(), y = new WeakMap(), l = new WeakMap(), O = new WeakMap(), f = new WeakMap(), L = new WeakMap(), T = new WeakMap(), C = new WeakMap(), _ = new WeakMap(), M = new WeakMap(), g = new WeakMap(), B = new WeakMap(), G = new WeakMap();
334
+ const m = new Le();
335
+ function Fe(s, e, i) {
336
+ const a = e.x, n = e.y, z = i || s.image.width / s.image.height;
337
+ let E = 0, w = 0, c = s.offset.x, u = s.offset.y, oe = s.rotation, le = s.center.x, de = s.center.y;
338
+ a / n > z ? (E = 1, w = n / a * z) : (w = 1, E = a / n / z), s.matrix.setUvTransform(c, u, E, w, oe, le, de);
337
339
  }
338
340
  const K = new q(), Te = new q();
339
- function Fe(s, e = "default") {
340
- const i = u.getView(e), { width: n, height: a } = u, z = n / a;
341
+ function Ie(s, e = "default") {
342
+ const i = m.getView(e), { width: a, height: n } = m, z = a / n;
341
343
  s instanceof q ? K.copy(s) : K.set(...s);
342
344
  const E = i.camera.getWorldPosition(Te).distanceTo(K);
343
345
  if (i.camera instanceof X)
344
346
  return {
345
- width: n / i.camera.zoom,
346
- height: a / i.camera.zoom,
347
+ width: a / i.camera.zoom,
348
+ height: n / i.camera.zoom,
347
349
  factor: 1,
348
350
  distance: E,
349
351
  aspect: z
350
352
  };
351
353
  {
352
- const w = i.camera.fov * Math.PI / 180, c = 2 * Math.tan(w / 2) * E, m = c * (n / a);
353
- return { width: m, height: c, factor: n / m, distance: E, aspect: z };
354
+ const w = i.camera.fov * Math.PI / 180, c = 2 * Math.tan(w / 2) * E, u = c * (a / n);
355
+ return { width: u, height: c, factor: a / u, distance: E, aspect: z };
354
356
  }
355
357
  }
356
- function Ie(s, e) {
358
+ function Ne(s, e) {
357
359
  s.traverse((i) => {
358
360
  i instanceof Z && i.material && (Array.isArray(i.material) ? i.material : [i.material]).forEach(e);
359
361
  });
360
362
  }
361
- function Ne(s, e) {
363
+ function $e(s, e) {
362
364
  s.traverse((i) => {
363
365
  i instanceof Z && e(i);
364
366
  });
365
367
  }
366
368
  export {
367
- ae as En3View,
368
- ke as coverTexture,
369
+ ne as En3View,
370
+ Fe as coverTexture,
369
371
  ve as dispose,
370
- u as en3,
371
- Fe as getCurrentViewport,
372
- Ie as traverseMaterials,
373
- Ne as traverseMeshes
372
+ m as en3,
373
+ Ie as getCurrentViewport,
374
+ Ne as traverseMaterials,
375
+ $e as traverseMeshes
374
376
  };
@@ -1 +1 @@
1
- "use strict";var u=r=>{throw TypeError(r)};var a=(r,t,e)=>t.has(r)||u("Cannot "+e);var s=(r,t,e)=>(a(r,t,"read from private field"),e?e.call(r):t.get(r)),o=(r,t,e)=>t.has(r)?u("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(r):t.set(r,e),c=(r,t,e,i)=>(a(r,t,"write to private field"),i?i.call(r,e):t.set(r,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("../source/index.cjs");require("../window-resizer/index.cjs");require("../Store-GokLe_g-.cjs");const f=require("../index-Cqw2NKev.cjs");var n,l,m;class E extends h.SourceElement{constructor(){super({sourceSetOptions:{mediaBuckets:!1}});o(this,n,null);o(this,l,()=>{var e,i;(i=(e=this.consumerElement).onload)==null||i.call(e,new Event("load"))});o(this,m,()=>{var e,i;(i=(e=this.consumerElement).onload)==null||i.call(e,new Event("error"))})}createConsumer(){return document.createElement("div")}consumeSource(e){s(this,n)&&(s(this,n).onload=null,s(this,n).onerror=null),this.consumerElement.innerHTML=(e==null?void 0:e.replace(/\\u003C/g,"<").replace(/\\u003E/g,">").replace(/\\"/g,'"'))||"",c(this,n,this.consumerElement.querySelector("iframe")),s(this,n)&&(s(this,n).onload=s(this,l),s(this,n).onerror=s(this,m))}}n=new WeakMap,l=new WeakMap,m=new WeakMap;f.isBrowser&&!customElements.get("e-iframe")&&customElements.define("e-iframe",E);exports.IFrameElement=E;
1
+ "use strict";var u=r=>{throw TypeError(r)};var a=(r,t,e)=>t.has(r)||u("Cannot "+e);var s=(r,t,e)=>(a(r,t,"read from private field"),e?e.call(r):t.get(r)),o=(r,t,e)=>t.has(r)?u("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(r):t.set(r,e),c=(r,t,e,i)=>(a(r,t,"write to private field"),i?i.call(r,e):t.set(r,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("../SourceElement-D_YeNqsI.cjs");require("../window-resizer/index.cjs");require("../Store-Cd1GlEmZ.cjs");const f=require("../index-DekP7OZe.cjs");require("construct-style-sheets-polyfill");var n,l,m;class E extends h.SourceElement{constructor(){super({sourceSetOptions:{mediaBuckets:!1}});o(this,n,null);o(this,l,()=>{var e,i;(i=(e=this.consumerElement).onload)==null||i.call(e,new Event("load"))});o(this,m,()=>{var e,i;(i=(e=this.consumerElement).onload)==null||i.call(e,new Event("error"))})}createConsumer(){return document.createElement("div")}consumeSource(e){s(this,n)&&(s(this,n).onload=null,s(this,n).onerror=null),this.consumerElement.innerHTML=(e==null?void 0:e.replace(/\\u003C/g,"<").replace(/\\u003E/g,">").replace(/\\"/g,'"'))||"",c(this,n,this.consumerElement.querySelector("iframe")),s(this,n)&&(s(this,n).onload=s(this,l),s(this,n).onerror=s(this,m))}}n=new WeakMap,l=new WeakMap,m=new WeakMap;f.isBrowser&&!customElements.get("e-iframe")&&customElements.define("e-iframe",E);exports.IFrameElement=E;
@@ -3,10 +3,11 @@ var a = (r) => {
3
3
  };
4
4
  var u = (r, t, e) => t.has(r) || a("Cannot " + e);
5
5
  var s = (r, t, e) => (u(r, t, "read from private field"), e ? e.call(r) : t.get(r)), i = (r, t, e) => t.has(r) ? a("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(r) : t.set(r, e), c = (r, t, e, o) => (u(r, t, "write to private field"), o ? o.call(r, e) : t.set(r, e), e);
6
- import { SourceElement as E } from "../source/index.js";
6
+ import { a as E } from "../SourceElement-jbviggZp.js";
7
7
  import "../window-resizer/index.js";
8
- import "../Store-swP_0ymB.js";
9
- import { i as f } from "../index-euf5anj6.js";
8
+ import "../Store-0BVty6AZ.js";
9
+ import { i as f } from "../index-Bv9zgfdb.js";
10
+ import "construct-style-sheets-polyfill";
10
11
  var n, m, l;
11
12
  class h extends E {
12
13
  constructor() {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../device/index.cjs"),i=require("../source/index.cjs");require("../window-resizer/index.cjs");require("../Store-GokLe_g-.cjs");const n=require("../index-Cqw2NKev.cjs");class t extends i.SourceElement{createConsumer(){return document.createElement("img")}consumeSource(e){if(e&&this.hasAttribute("webp")&&r.device.isWebp){const s=e.split(".").slice(0,-1).join(".")+".webp";this.consumerElement.src=s}else this.consumerElement.src=e||""}}n.isBrowser&&!customElements.get("e-image")&&customElements.define("e-image",t);exports.ImageElement=t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../Viewport-DB0qAZPJ.cjs"),i=require("../SourceElement-D_YeNqsI.cjs");require("../window-resizer/index.cjs");require("../Store-Cd1GlEmZ.cjs");const n=require("../index-DekP7OZe.cjs");require("construct-style-sheets-polyfill");class t extends i.SourceElement{createConsumer(){return document.createElement("img")}consumeSource(e){if(e&&this.hasAttribute("webp")&&s.device.isWebp){const r=e.split(".").slice(0,-1).join(".")+".webp";this.consumerElement.src=r}else this.consumerElement.src=e||""}}n.isBrowser&&!customElements.get("e-image")&&customElements.define("e-image",t);exports.ImageElement=t;
@@ -1,8 +1,9 @@
1
- import { device as m } from "../device/index.js";
2
- import { SourceElement as s } from "../source/index.js";
1
+ import { d as m } from "../Viewport-DA10iWAO.js";
2
+ import { a as s } from "../SourceElement-jbviggZp.js";
3
3
  import "../window-resizer/index.js";
4
- import "../Store-swP_0ymB.js";
5
- import { i } from "../index-euf5anj6.js";
4
+ import "../Store-0BVty6AZ.js";
5
+ import { i } from "../index-Bv9zgfdb.js";
6
+ import "construct-style-sheets-polyfill";
6
7
  class r extends s {
7
8
  createConsumer() {
8
9
  return document.createElement("img");
@@ -4,6 +4,7 @@ var m = (s) => {
4
4
  var y = (s, t, n) => t.has(s) || m("Cannot " + n);
5
5
  var i = (s, t, n) => (y(s, t, "read from private field"), n ? n.call(s) : t.get(s)), u = (s, t, n) => t.has(s) ? m("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(s) : t.set(s, n), h = (s, t, n, e) => (y(s, t, "write to private field"), e ? e.call(s, n) : t.set(s, n), n);
6
6
  import { g as d } from "./dom-CVWzyXPH.js";
7
+ import "construct-style-sheets-polyfill";
7
8
  const w = typeof window != "undefined" && typeof window.document != "undefined";
8
9
  var r, f, b;
9
10
  class p {
@@ -56,9 +57,9 @@ class p {
56
57
  }
57
58
  }
58
59
  r = new WeakMap(), f = new WeakMap(), b = new WeakMap();
59
- const I = new p();
60
+ const a = new p();
60
61
  export {
61
62
  p as I,
62
- I as a,
63
+ a,
63
64
  w as i
64
65
  };
@@ -0,0 +1 @@
1
+ "use strict";var d=s=>{throw TypeError(s)};var w=(s,t,n)=>t.has(s)||d("Cannot "+n);var r=(s,t,n)=>(w(s,t,"read from private field"),n?n.call(s):t.get(s)),f=(s,t,n)=>t.has(s)?d("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,n),h=(s,t,n,e)=>(w(s,t,"write to private field"),e?e.call(s,n):t.set(s,n),n);const p=require("./dom-JBOkFLTh.cjs");require("construct-style-sheets-polyfill");const y=typeof window!="undefined"&&typeof window.document!="undefined";var i,u,b;class m{constructor(){f(this,i,[]);f(this,u,null);f(this,b,t=>{r(this,i).map(e=>({subscriber:e,entry:t.find(o=>o.target===e.element)})).forEach(e=>{e.entry&&(e.subscriber.entry=e.entry,e.subscriber.callback(e.entry))})});y&&window.IntersectionObserver&&h(this,u,new IntersectionObserver(r(this,b)))}subscribe(t,n){const e=p.getElement(t);if(!e)return()=>{};const o=r(this,i).find(c=>c.element===e);if(!o)r(this,u).observe(e);else{const c=r(this,i).find(l=>l.element===e&&l.entry);c!=null&&c.entry.isIntersecting&&n(c.entry)}return r(this,i).push({element:e,callback:n,entry:(o==null?void 0:o.entry)||null}),()=>{this.unsubscribe(n)}}unsubscribe(t){const n=r(this,i).find(e=>e.callback===t);n&&(h(this,i,r(this,i).filter(e=>e.callback!==t)),r(this,i).find(e=>e.element===n.element)||r(this,u).unobserve(n.element))}}i=new WeakMap,u=new WeakMap,b=new WeakMap;const v=new m;exports.Intersector=m;exports.intersector=v;exports.isBrowser=y;