aptechka 0.25.1 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (188) hide show
  1. package/lib/Animation-B9m8bw96.cjs +1 -0
  2. package/lib/Animation-DN95L7Xo.js +105 -0
  3. package/lib/Damped-CTsV8tl_.cjs +1 -0
  4. package/lib/Damped-Chu29wn-.js +53 -0
  5. package/lib/Tweened-BUuSLSF7.js +44 -0
  6. package/lib/Tweened-BttGiyB0.cjs +1 -0
  7. package/lib/animation/index.cjs +1 -1
  8. package/lib/animation/index.js +6 -53
  9. package/lib/canvas-CU5Xjahf.cjs +1 -0
  10. package/lib/canvas-DeZ0SLUJ.js +34 -0
  11. package/lib/connector/index.cjs +1 -1
  12. package/lib/connector/index.js +1 -1
  13. package/lib/controls/index.cjs +1 -1
  14. package/lib/controls/index.js +3 -3
  15. package/lib/coordinates-CgdGoSYs.js +24 -0
  16. package/lib/coordinates-D8Np3cPD.cjs +1 -0
  17. package/lib/css-property/index.cjs +1 -1
  18. package/lib/css-property/index.js +1 -1
  19. package/lib/dev/index.cjs +1 -1
  20. package/lib/dev/index.js +1 -1
  21. package/lib/device/index.cjs +1 -1
  22. package/lib/device/index.js +1 -1
  23. package/lib/element-resizer/react/index.cjs +1 -0
  24. package/lib/element-resizer/react/index.js +8 -0
  25. package/lib/element-resizer/vanilla/index.cjs +1 -0
  26. package/lib/element-resizer/{index.js → vanilla/index.js} +2 -2
  27. package/lib/en3/index.cjs +8 -0
  28. package/lib/en3/index.js +374 -0
  29. package/lib/events-CsVF98U6.js +6 -0
  30. package/lib/events-KVanG9sR.cjs +1 -0
  31. package/lib/intersector/react/index.cjs +1 -0
  32. package/lib/intersector/react/index.js +12 -0
  33. package/lib/intersector/vanilla/index.cjs +1 -0
  34. package/lib/intersector/{index.js → vanilla/index.js} +2 -2
  35. package/lib/jss-CjccJC-K.js +21 -0
  36. package/lib/jss-GJLvaNfT.cjs +1 -0
  37. package/lib/layout-box/index.cjs +1 -1
  38. package/lib/layout-box/index.js +3 -3
  39. package/lib/loading/index.cjs +1 -1
  40. package/lib/loading/index.js +42 -85
  41. package/lib/math-BOBiC4TN.js +45 -0
  42. package/lib/math-GDWEqu7y.cjs +1 -0
  43. package/lib/media/index.cjs +1 -1
  44. package/lib/media/index.js +1 -1
  45. package/lib/media-elements/index.cjs +5 -0
  46. package/lib/media-elements/index.js +389 -0
  47. package/lib/morph/index.cjs +1 -0
  48. package/lib/morph/index.js +227 -0
  49. package/lib/need_redo_tweaker/index.cjs +4 -4
  50. package/lib/need_redo_tweaker/index.js +100 -82
  51. package/lib/object-CCiXnER2.cjs +1 -0
  52. package/lib/object-D6MVWB4l.js +85 -0
  53. package/lib/pointer/index.cjs +1 -0
  54. package/lib/pointer/index.js +151 -0
  55. package/lib/polyfills-CM4SCDTt.cjs +1 -0
  56. package/lib/polyfills-X6KXuHg-.js +33 -0
  57. package/lib/router/index.cjs +1 -0
  58. package/lib/router/index.js +266 -0
  59. package/lib/scroll/react/index.cjs +30 -0
  60. package/lib/scroll/react/index.js +761 -0
  61. package/lib/scroll/vanilla/index.cjs +1 -0
  62. package/lib/scroll/vanilla/index.js +1120 -0
  63. package/lib/slicer/index.cjs +11 -0
  64. package/lib/slicer/index.js +108 -0
  65. package/lib/source/index.cjs +1 -1
  66. package/lib/source/index.js +1 -1
  67. package/lib/style-BqzUd8Fy.cjs +1 -0
  68. package/lib/style-M-RBTQxT.js +21 -0
  69. package/lib/ticker/react/index.cjs +1 -0
  70. package/lib/ticker/react/index.js +19 -0
  71. package/lib/ticker/vanilla/index.cjs +1 -0
  72. package/lib/ticker/{index.js → vanilla/index.js} +2 -2
  73. package/lib/url-BDc0awLa.js +22 -0
  74. package/lib/url-C3Vj8msL.cjs +1 -0
  75. package/lib/utils/index.cjs +1 -1
  76. package/lib/utils/index.js +146 -220
  77. package/lib/window-resizer/react/index.cjs +1 -0
  78. package/lib/window-resizer/react/index.js +8 -0
  79. package/lib/window-resizer/vanilla/index.cjs +1 -0
  80. package/lib/window-resizer/vanilla/index.js +32 -0
  81. package/package.json +132 -20
  82. package/lib/Tweened-CDYmG9hk.js +0 -138
  83. package/lib/Tweened-DlyMbHu_.cjs +0 -1
  84. package/lib/animation/Animation.d.ts +0 -34
  85. package/lib/animation/Damped.d.ts +0 -18
  86. package/lib/animation/Tweened.d.ts +0 -14
  87. package/lib/animation/index.d.ts +0 -3
  88. package/lib/attribute/index.d.ts +0 -14
  89. package/lib/class-linked-status/index.d.ts +0 -11
  90. package/lib/connector/index.d.ts +0 -15
  91. package/lib/controls/AutoplayControls.d.ts +0 -16
  92. package/lib/controls/Controls.d.ts +0 -8
  93. package/lib/controls/DragControls.d.ts +0 -15
  94. package/lib/controls/KeyboardControls.d.ts +0 -13
  95. package/lib/controls/WheelControls.d.ts +0 -18
  96. package/lib/controls/index.d.ts +0 -5
  97. package/lib/css-property/index.d.ts +0 -16
  98. package/lib/css-unit-parser/index.d.ts +0 -6
  99. package/lib/css-value-parser/index.d.ts +0 -6
  100. package/lib/dev/index.d.ts +0 -1
  101. package/lib/device/Device.d.ts +0 -16
  102. package/lib/device/Viewport.d.ts +0 -28
  103. package/lib/device/index.d.ts +0 -2
  104. package/lib/element-resizer/index.cjs +0 -1
  105. package/lib/element-resizer/index.d.ts +0 -9
  106. package/lib/intersector/index.cjs +0 -1
  107. package/lib/intersector/index.d.ts +0 -9
  108. package/lib/ladder/index.d.ts +0 -23
  109. package/lib/layout-box/index.d.ts +0 -95
  110. package/lib/loading/index.d.ts +0 -38
  111. package/lib/media/index.d.ts +0 -11
  112. package/lib/need_redo_tweaker/CheckboxElement.d.ts +0 -14
  113. package/lib/need_redo_tweaker/TweakerBooleanManagerElement.d.ts +0 -10
  114. package/lib/need_redo_tweaker/TweakerColorManagerElement.d.ts +0 -10
  115. package/lib/need_redo_tweaker/TweakerElement.d.ts +0 -17
  116. package/lib/need_redo_tweaker/TweakerFieldElement.d.ts +0 -19
  117. package/lib/need_redo_tweaker/TweakerFolderElement.d.ts +0 -23
  118. package/lib/need_redo_tweaker/TweakerLinkManagerElement.d.ts +0 -10
  119. package/lib/need_redo_tweaker/TweakerNumberManagerElement.d.ts +0 -13
  120. package/lib/need_redo_tweaker/TweakerSelectManagerElement.d.ts +0 -10
  121. package/lib/need_redo_tweaker/TweakerStoreManagerElement.d.ts +0 -9
  122. package/lib/need_redo_tweaker/TweakerStringManagerElement.d.ts +0 -10
  123. package/lib/need_redo_tweaker/element-constructor/ElementConstructor.d.ts +0 -74
  124. package/lib/need_redo_tweaker/element-constructor/createStylesheet.d.ts +0 -2
  125. package/lib/need_redo_tweaker/element-constructor/createTheme.d.ts +0 -12
  126. package/lib/need_redo_tweaker/element-constructor/index.d.ts +0 -4
  127. package/lib/need_redo_tweaker/element-constructor/knownSvgTags.d.ts +0 -1
  128. package/lib/need_redo_tweaker/element-constructor/tags.d.ts +0 -118
  129. package/lib/need_redo_tweaker/index.d.ts +0 -1
  130. package/lib/need_redo_tweaker/select/SelectElement.d.ts +0 -24
  131. package/lib/need_redo_tweaker/select/SelectHeadElement.d.ts +0 -12
  132. package/lib/need_redo_tweaker/select/SelectOptionElement.d.ts +0 -13
  133. package/lib/need_redo_tweaker/select/SelectUserElement.d.ts +0 -6
  134. package/lib/need_redo_tweaker/select/index.d.ts +0 -4
  135. package/lib/need_redo_tweaker/theme/index.d.ts +0 -35
  136. package/lib/need_redo_tweaker/tweakerManagerConstructors.d.ts +0 -14
  137. package/lib/need_redo_tweaker/tweakerStorage.d.ts +0 -23
  138. package/lib/notifier/index.d.ts +0 -8
  139. package/lib/order/index.d.ts +0 -22
  140. package/lib/polyfills-AItxku8u.js +0 -76
  141. package/lib/polyfills-Caa6z-Ay.cjs +0 -1
  142. package/lib/scroll-entries/index.d.ts +0 -20
  143. package/lib/source/SourceClass.d.ts +0 -11
  144. package/lib/source/SourceManager.d.ts +0 -13
  145. package/lib/source/SourceSet.d.ts +0 -8
  146. package/lib/source/index.d.ts +0 -3
  147. package/lib/store/Composed.d.ts +0 -7
  148. package/lib/store/Derived.d.ts +0 -7
  149. package/lib/store/DerivedArray.d.ts +0 -7
  150. package/lib/store/Resource.d.ts +0 -11
  151. package/lib/store/Store.d.ts +0 -35
  152. package/lib/store/StoreRegistry.d.ts +0 -22
  153. package/lib/store/index.d.ts +0 -6
  154. package/lib/style-3MQV6Cnl.js +0 -122
  155. package/lib/style-BoXabX_p.cjs +0 -1
  156. package/lib/ticker/index.cjs +0 -1
  157. package/lib/ticker/index.d.ts +0 -21
  158. package/lib/utils/array.d.ts +0 -2
  159. package/lib/utils/attributes.d.ts +0 -2
  160. package/lib/utils/browser.d.ts +0 -1
  161. package/lib/utils/bytes.d.ts +0 -1
  162. package/lib/utils/canvas.d.ts +0 -7
  163. package/lib/utils/collisions.d.ts +0 -3
  164. package/lib/utils/coordinates.d.ts +0 -13
  165. package/lib/utils/cssom.d.ts +0 -5
  166. package/lib/utils/decoding.d.ts +0 -2
  167. package/lib/utils/dom.d.ts +0 -5
  168. package/lib/utils/easings.d.ts +0 -17
  169. package/lib/utils/events.d.ts +0 -8
  170. package/lib/utils/file.d.ts +0 -1
  171. package/lib/utils/function.d.ts +0 -2
  172. package/lib/utils/gestures.d.ts +0 -1
  173. package/lib/utils/index.d.ts +0 -27
  174. package/lib/utils/jss.d.ts +0 -12
  175. package/lib/utils/layout.d.ts +0 -3
  176. package/lib/utils/math.d.ts +0 -11
  177. package/lib/utils/number.d.ts +0 -3
  178. package/lib/utils/object.d.ts +0 -9
  179. package/lib/utils/polyfills.d.ts +0 -1
  180. package/lib/utils/promises.d.ts +0 -1
  181. package/lib/utils/string.d.ts +0 -8
  182. package/lib/utils/style.d.ts +0 -2
  183. package/lib/utils/ts-shape.d.ts +0 -20
  184. package/lib/utils/ts-utility.d.ts +0 -26
  185. package/lib/utils/url.d.ts +0 -9
  186. package/lib/window-resizer/index.cjs +0 -1
  187. package/lib/window-resizer/index.d.ts +0 -9
  188. package/lib/window-resizer/index.js +0 -42
@@ -0,0 +1,374 @@
1
+ var me = Object.defineProperty, fe = Object.defineProperties;
2
+ var ge = Object.getOwnPropertyDescriptors;
3
+ var Q = Object.getOwnPropertySymbols;
4
+ var Ee = Object.prototype.hasOwnProperty, be = Object.prototype.propertyIsEnumerable;
5
+ var te = (s) => {
6
+ throw TypeError(s);
7
+ };
8
+ var ee = (s, e, i) => e in s ? me(s, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : s[e] = i, j = (s, e) => {
9
+ for (var i in e || (e = {}))
10
+ Ee.call(e, i) && ee(s, i, e[i]);
11
+ if (Q)
12
+ for (var i of Q(e))
13
+ be.call(e, i) && ee(s, i, e[i]);
14
+ return s;
15
+ }, ie = (s, e) => fe(s, ge(e));
16
+ var se = (s, e, i) => e.has(s) || te("Cannot " + i);
17
+ var t = (s, e, i) => (se(s, e, "read from private field"), i ? i.call(s) : e.get(s)), r = (s, e, i) => e.has(s) ? te("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(s) : e.set(s, i), a = (s, e, i, h) => (se(s, e, "write to private field"), h ? h.call(s, i) : e.set(s, i), i);
18
+ import { RESIZE_ORDER as ye, TICK_ORDER as xe } from "../order/index.js";
19
+ import { windowResizer as re } from "../window-resizer/vanilla/index.js";
20
+ import { ticker as ae } from "../ticker/vanilla/index.js";
21
+ import { g as oe } from "../dom-0S_WDL4g.js";
22
+ import { Mesh as q, OrthographicCamera as X, PerspectiveCamera as he, Scene as we, Vector2 as pe, Raycaster as De, REVISION as Re, WebGLRenderer as ve, Vector3 as J } from "three";
23
+ import { LayoutBox as ne } from "../layout-box/index.js";
24
+ function ze(s) {
25
+ const e = (i) => {
26
+ i.dispose();
27
+ for (const h of Object.keys(i)) {
28
+ const n = i[h];
29
+ n && typeof n == "object" && "minFilter" in n && n.dispose();
30
+ }
31
+ };
32
+ s.traverse((i) => {
33
+ if (i instanceof q) {
34
+ if (i.geometry.dispose(), !Array.isArray(i.material) && i.material.isMaterial)
35
+ e(i.material);
36
+ else if (Array.isArray(i.material))
37
+ for (const h of i.material) e(h);
38
+ }
39
+ });
40
+ }
41
+ var S, o, V, p, x, P, D, R;
42
+ class ce {
43
+ constructor(e, i) {
44
+ r(this, S);
45
+ r(this, o);
46
+ r(this, V);
47
+ r(this, p);
48
+ r(this, x);
49
+ r(this, P);
50
+ r(this, D);
51
+ r(this, R);
52
+ a(this, S, e), a(this, o, (i == null ? void 0 : i.cameraType) === "orthographic" ? new X() : new he()), a(this, V, new we()), a(this, p, []), a(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, a(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)}`, a(this, D, oe(i == null ? void 0 : i.sizeElement) || document.documentElement), this.beforeRenderCallback = i == null ? void 0 : i.beforeRender, a(this, R, new ne(t(this, D))), t(this, R).onResize(() => {
53
+ this.resize();
54
+ });
55
+ }
56
+ get name() {
57
+ return t(this, S);
58
+ }
59
+ get camera() {
60
+ return t(this, o);
61
+ }
62
+ get scene() {
63
+ return t(this, V);
64
+ }
65
+ get box() {
66
+ return t(this, R);
67
+ }
68
+ get cameraDistance() {
69
+ return t(this, x);
70
+ }
71
+ set cameraDistance(e) {
72
+ a(this, x, e), this.resize();
73
+ }
74
+ get sizeElement() {
75
+ return t(this, D);
76
+ }
77
+ get isClipped() {
78
+ return t(this, D) !== u.containerElement;
79
+ }
80
+ resize() {
81
+ const { width: e, height: i } = t(this, R);
82
+ 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();
83
+ }
84
+ destroy() {
85
+ t(this, p).forEach((e) => {
86
+ e.userData.box.destroy();
87
+ }), t(this, V).clear(), ze(t(this, V)), u.destroyView(this.name), t(this, R).destroy();
88
+ }
89
+ attachToHTMLElement(e, i, h) {
90
+ const n = new ne(e, ie(j({}, h), {
91
+ containerElement: t(this, D),
92
+ cartesian: !0,
93
+ scrollStep: !this.isClipped
94
+ }));
95
+ return n.bindObject(i), i.userData.box = n, t(this, p).push(i), i;
96
+ }
97
+ detachFromHTMLElement(e) {
98
+ a(this, p, t(this, p).filter((i) => i === e ? (e.userData.box.destroy(), !1) : !0));
99
+ }
100
+ add(...e) {
101
+ const i = e[0], h = e[1], n = e[2];
102
+ return h && this.attachToHTMLElement(h, i, n), this.scene.add(i), i;
103
+ }
104
+ remove(e, i) {
105
+ this.scene.remove(e), i && this.detachFromHTMLElement(e);
106
+ }
107
+ }
108
+ S = new WeakMap(), o = new WeakMap(), V = new WeakMap(), p = new WeakMap(), x = new WeakMap(), P = new WeakMap(), D = new WeakMap(), R = new WeakMap();
109
+ var A, k, F, v, I;
110
+ class Ve {
111
+ constructor(e) {
112
+ r(this, A);
113
+ r(this, k);
114
+ r(this, F);
115
+ r(this, v);
116
+ r(this, I);
117
+ a(this, A, e.targetName || void 0), a(this, k, e.eventDispatcher || e.object3D), a(this, F, e.propagation || !1), a(this, v, e.object3D), a(this, I, t(this, A) ? () => t(this, v).getObjectByName(t(this, A)) || t(this, v) : () => t(this, v));
118
+ }
119
+ get object3D() {
120
+ return t(this, v);
121
+ }
122
+ get eventDispatcher() {
123
+ return t(this, k);
124
+ }
125
+ get propagation() {
126
+ return t(this, F);
127
+ }
128
+ get target() {
129
+ return t(this, I).call(this);
130
+ }
131
+ dispatch(e, i) {
132
+ this.eventDispatcher.dispatchEvent(j({
133
+ originalEvent: i,
134
+ type: e
135
+ }, this.intersection));
136
+ }
137
+ }
138
+ A = new WeakMap(), k = new WeakMap(), F = new WeakMap(), v = new WeakMap(), I = new WeakMap();
139
+ var b, d, H, N, W, Y, _;
140
+ class Le {
141
+ constructor() {
142
+ r(this, b, []);
143
+ r(this, d, []);
144
+ r(this, H, new pe());
145
+ r(this, N, new De());
146
+ r(this, W, (e) => {
147
+ for (let i = 0; i < t(this, d).length; i++)
148
+ t(this, d)[i].dispatch("pointerDown", e);
149
+ });
150
+ r(this, Y, (e) => {
151
+ for (let i = 0; i < t(this, d).length; i++)
152
+ t(this, d)[i].dispatch("pointerUp", e);
153
+ });
154
+ r(this, _, (e) => {
155
+ if (!t(this, b).length)
156
+ return;
157
+ 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);
158
+ const i = [];
159
+ for (const c of t(this, b)) {
160
+ const m = t(this, N).intersectObject(c.target);
161
+ m.length && (c.intersection = m[0], i.push(c));
162
+ }
163
+ let h = !1;
164
+ const n = t(this, d).filter(
165
+ (c) => !i.find((m) => m.object3D.uuid === c.object3D.uuid)
166
+ ), E = i.sort(
167
+ (c, m) => m.object3D.position.z - c.object3D.position.z
168
+ ).filter((c, m) => h ? (n.push(c), !1) : (h = !c.propagation, !0)), w = E.filter(
169
+ (c) => !t(this, d).find((m) => m.object3D.uuid === c.object3D.uuid)
170
+ );
171
+ for (let c = 0; c < n.length; c++)
172
+ n[c].dispatch("pointerLeave", e);
173
+ for (let c = 0; c < w.length; c++)
174
+ w[c].dispatch("pointerEnter", e);
175
+ a(this, d, E);
176
+ for (let c = 0; c < t(this, d).length; c++)
177
+ t(this, d)[c].dispatch("pointerMove", e);
178
+ });
179
+ u.containerElement.addEventListener(
180
+ "pointerdown",
181
+ t(this, W)
182
+ ), u.containerElement.addEventListener("pointerup", t(this, Y)), u.containerElement.addEventListener(
183
+ "pointermove",
184
+ t(this, _)
185
+ );
186
+ }
187
+ destroy() {
188
+ u.containerElement.removeEventListener(
189
+ "pointerdown",
190
+ t(this, W)
191
+ ), u.containerElement.removeEventListener(
192
+ "pointerup",
193
+ t(this, Y)
194
+ ), u.containerElement.removeEventListener(
195
+ "pointermove",
196
+ t(this, _)
197
+ ), a(this, b, []), a(this, d, []);
198
+ }
199
+ add(e, i) {
200
+ if (t(this, b).find((n) => n.object3D.uuid === e.uuid))
201
+ return;
202
+ const h = new Ve(j({
203
+ object3D: e
204
+ }, i));
205
+ t(this, b).push(h);
206
+ }
207
+ remove(e) {
208
+ a(this, b, t(this, b).filter(
209
+ (i) => i.object3D.uuid !== e.uuid
210
+ )), a(this, d, t(this, d).filter((i) => i.object3D.uuid !== e.uuid));
211
+ }
212
+ }
213
+ b = new WeakMap(), d = new WeakMap(), H = new WeakMap(), N = new WeakMap(), W = new WeakMap(), Y = new WeakMap(), _ = new WeakMap();
214
+ var U, y, l, O, f, L, T, C, $, M, Z, g, B, G;
215
+ class Te {
216
+ constructor() {
217
+ r(this, U, `https://unpkg.com/three@0.${Re}.x`);
218
+ r(this, y, null);
219
+ r(this, l, null);
220
+ r(this, O, null);
221
+ r(this, f, /* @__PURE__ */ new Map());
222
+ r(this, L, 0);
223
+ r(this, T, 0);
224
+ r(this, C, 0);
225
+ r(this, $, 2);
226
+ r(this, M, !1);
227
+ r(this, Z, !1);
228
+ r(this, g, null);
229
+ r(this, B, () => {
230
+ a(this, L, t(this, y).clientWidth), a(this, T, t(this, y).clientHeight), a(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
+ r(this, G, () => {
233
+ t(this, l).setRenderTarget(null), t(this, f).forEach((e) => {
234
+ this.render(e);
235
+ });
236
+ });
237
+ }
238
+ get CDNVersion() {
239
+ return t(this, U);
240
+ }
241
+ get containerElement() {
242
+ return t(this, y);
243
+ }
244
+ get webglRenderer() {
245
+ return t(this, l);
246
+ }
247
+ get raycaster() {
248
+ return t(this, O);
249
+ }
250
+ get views() {
251
+ return t(this, f);
252
+ }
253
+ get view() {
254
+ return this.getView("default");
255
+ }
256
+ get camera() {
257
+ return this.getView("default").camera;
258
+ }
259
+ get scene() {
260
+ return this.getView("default").scene;
261
+ }
262
+ get width() {
263
+ return t(this, L);
264
+ }
265
+ get height() {
266
+ return t(this, T);
267
+ }
268
+ get pixelRatio() {
269
+ return t(this, C);
270
+ }
271
+ get composer() {
272
+ return t(this, g);
273
+ }
274
+ setup(e) {
275
+ if (t(this, M)) {
276
+ console.warn("[en3.setup]: You are trying to setup en3 again.");
277
+ return;
278
+ }
279
+ a(this, y, oe(e == null ? void 0 : e.containerElement) || document.body), a(this, $, (e == null ? void 0 : e.maxPixelRatio) || 2), a(this, l, new ve(e == null ? void 0 : e.webGLRendererParameters)), t(this, l).domElement.style.cssText = `
280
+ position: fixed;
281
+ left: 0;
282
+ top: 0;
283
+ width: 100%;
284
+ height: 100%;
285
+ z-index: ${(e == null ? void 0 : e.zIndex) || 0};
286
+ `, (t(this, y).shadowRoot || t(this, y)).append(t(this, l).domElement), t(this, f).set(
287
+ "default",
288
+ new ce("default", j({
289
+ sizeElement: t(this, y)
290
+ }, e == null ? void 0 : e.view))
291
+ ), a(this, O, new Le()), e != null && e.composer && (a(this, g, new e.composer(t(this, l))), this.render = () => {
292
+ t(this, g).render();
293
+ }), a(this, M, !0), re.subscribe(t(this, B), ye.CANVAS), ae.subscribe(t(this, G), { order: xe.CANVAS });
294
+ }
295
+ destroy() {
296
+ if (!t(this, M)) {
297
+ console.warn(
298
+ "[en3.setup]: You are trying to destory en3 but it has not been initialized."
299
+ );
300
+ return;
301
+ }
302
+ re.unsubscribe(t(this, B)), ae.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(), a(this, l, null), t(this, g).dispose(), a(this, g, null), a(this, M, !1);
305
+ }
306
+ createView(e, i) {
307
+ const h = t(this, f).size, n = new ce(e, i);
308
+ return t(this, f).set(e, n), h === 1 && t(this, l).setScissorTest(!0), n;
309
+ }
310
+ getView(e) {
311
+ return t(this, f).get(e);
312
+ }
313
+ destroyView(e) {
314
+ const i = t(this, f).get(e);
315
+ i && (t(this, f).delete(e), i.destroy(), t(this, f).size <= 1 && t(this, l).setScissorTest(!1));
316
+ }
317
+ render(e) {
318
+ var i;
319
+ if (t(this, f).size > 1 || this.view.isClipped) {
320
+ const h = e.box.left + e.box.CSSTranslation.x + e.box.scrollValue.x, n = u.height - e.box.height - e.box.top + e.box.CSSTranslation.y + e.box.scrollValue.y * -1;
321
+ t(this, l).setScissor(h, n, e.box.width, e.box.height), t(this, l).setViewport(
322
+ h,
323
+ n,
324
+ e.box.width,
325
+ e.box.height
326
+ );
327
+ }
328
+ (i = e.beforeRenderCallback) == null || i.call(e), t(this, l).render(e.scene, e.camera);
329
+ }
330
+ }
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(), Z = new WeakMap(), g = new WeakMap(), B = new WeakMap(), G = new WeakMap();
332
+ const u = new Te();
333
+ function ke(s, e, i) {
334
+ const h = e.x, n = e.y, z = i || s.image.width / s.image.height;
335
+ let E = 0, w = 0, c = s.offset.x, m = s.offset.y, le = s.rotation, de = s.center.x, ue = s.center.y;
336
+ h / n > z ? (E = 1, w = n / h * z) : (w = 1, E = h / n / z), s.matrix.setUvTransform(c, m, E, w, le, de, ue);
337
+ }
338
+ const K = new J(), Ce = new J();
339
+ function Fe(s, e = "default") {
340
+ const i = u.getView(e), { width: h, height: n } = u, z = h / n;
341
+ s instanceof J ? K.copy(s) : K.set(...s);
342
+ const E = i.camera.getWorldPosition(Ce).distanceTo(K);
343
+ if (i.camera instanceof X)
344
+ return {
345
+ width: h / i.camera.zoom,
346
+ height: n / i.camera.zoom,
347
+ factor: 1,
348
+ distance: E,
349
+ aspect: z
350
+ };
351
+ {
352
+ const w = i.camera.fov * Math.PI / 180, c = 2 * Math.tan(w / 2) * E, m = c * (h / n);
353
+ return { width: m, height: c, factor: h / m, distance: E, aspect: z };
354
+ }
355
+ }
356
+ function Ie(s, e) {
357
+ s.traverse((i) => {
358
+ i instanceof q && i.material && (Array.isArray(i.material) ? i.material : [i.material]).forEach(e);
359
+ });
360
+ }
361
+ function Ne(s, e) {
362
+ s.traverse((i) => {
363
+ i instanceof q && e(i);
364
+ });
365
+ }
366
+ export {
367
+ ce as En3View,
368
+ ke as coverTexture,
369
+ ze as dispose,
370
+ u as en3,
371
+ Fe as getCurrentViewport,
372
+ Ie as traverseMaterials,
373
+ Ne as traverseMeshes
374
+ };
@@ -0,0 +1,6 @@
1
+ function d(s, c, e) {
2
+ e != null && e.custom || e != null && e.detail ? s.dispatchEvent(new CustomEvent(c, e)) : s.dispatchEvent(new Event(c, e));
3
+ }
4
+ export {
5
+ d
6
+ };
@@ -0,0 +1 @@
1
+ "use strict";function v(s,c,e){e!=null&&e.custom||e!=null&&e.detail?s.dispatchEvent(new CustomEvent(c,e)):s.dispatchEvent(new Event(c,e))}exports.dispatchEvent=v;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react"),e=require("../vanilla/index.cjs");function o(r,t){s.useEffect(()=>{let i;if(r instanceof Element||typeof r=="string"||typeof r=="object"&&(i=r==null?void 0:r.current),i)return e.intersector.subscribe(i,t)},[r,t])}exports.useIntersection=o;
@@ -0,0 +1,12 @@
1
+ import { useEffect as i } from "react";
2
+ import { intersector as t } from "../vanilla/index.js";
3
+ function u(r, f) {
4
+ i(() => {
5
+ let o;
6
+ if (r instanceof Element || typeof r == "string" || typeof r == "object" && (o = r == null ? void 0 : r.current), o)
7
+ return t.subscribe(o, f);
8
+ }, [r, f]);
9
+ }
10
+ export {
11
+ u as useIntersection
12
+ };
@@ -0,0 +1 @@
1
+ "use strict";var y=n=>{throw TypeError(n)};var m=(n,t,s)=>t.has(n)||y("Cannot "+s);var r=(n,t,s)=>(m(n,t,"read from private field"),s?s.call(n):t.get(n)),b=(n,t,s)=>t.has(n)?y("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,s),f=(n,t,s,e)=>(m(n,t,"write to private field"),e?e.call(n,s):t.set(n,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("../../browser-CpzFX2xg.cjs"),d=require("../../dom-JBOkFLTh.cjs");var i,u,l;class g{constructor(){b(this,i,[]);b(this,u,null);b(this,l,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))})});w.isBrowser&&window.IntersectionObserver&&f(this,u,new IntersectionObserver(r(this,l)))}subscribe(t,s){const e=d.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(h=>h.element===e&&h.entry);c!=null&&c.entry.isIntersecting&&s(c.entry)}return r(this,i).push({element:e,callback:s,entry:(o==null?void 0:o.entry)||null}),console.log(r(this,i)),()=>{this.unsubscribe(s)}}unsubscribe(t){const s=r(this,i).find(e=>e.callback===t);s&&(f(this,i,r(this,i).filter(e=>e.callback===t)),r(this,i).find(e=>e.element===s.element)||r(this,u).unobserve(s.element))}}i=new WeakMap,u=new WeakMap,l=new WeakMap;const v=new g;exports.Intersector=g;exports.intersector=v;
@@ -3,8 +3,8 @@ var m = (n) => {
3
3
  };
4
4
  var y = (n, t, s) => t.has(n) || m("Cannot " + s);
5
5
  var r = (n, t, s) => (y(n, t, "read from private field"), s ? s.call(n) : t.get(n)), f = (n, t, s) => t.has(n) ? m("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(n) : t.set(n, s), l = (n, t, s, e) => (y(n, t, "write to private field"), e ? e.call(n, s) : t.set(n, s), s);
6
- import { i as g } from "../browser-0zX67oeU.js";
7
- import { g as p } from "../dom-0S_WDL4g.js";
6
+ import { i as g } from "../../browser-0zX67oeU.js";
7
+ import { g as p } from "../../dom-0S_WDL4g.js";
8
8
  var i, b, u;
9
9
  class w {
10
10
  constructor() {
@@ -0,0 +1,21 @@
1
+ import { i as s } from "./browser-0zX67oeU.js";
2
+ import { c } from "./string-f0Dnk0L1.js";
3
+ function o(t) {
4
+ let e = "";
5
+ for (const r in t) {
6
+ const n = t[r];
7
+ typeof n == "object" ? (e += `${r} {`, e += o(n), e += "}") : e += `${c(r)}: ${n};`;
8
+ }
9
+ return e;
10
+ }
11
+ function a(t) {
12
+ if (s) {
13
+ const e = new CSSStyleSheet();
14
+ return e.replaceSync(o(t)), e;
15
+ }
16
+ return null;
17
+ }
18
+ export {
19
+ a as c,
20
+ o as s
21
+ };
@@ -0,0 +1 @@
1
+ "use strict";const o=require("./browser-CpzFX2xg.cjs"),c=require("./string-DhgS_iFl.cjs");function s(t){let e="";for(const r in t){const n=t[r];typeof n=="object"?(e+=`${r} {`,e+=s(n),e+="}"):e+=`${c.camelToKebab(r)}: ${n};`}return e}function l(t){if(o.isBrowser){const e=new CSSStyleSheet;return e.replaceSync(s(t)),e}return null}exports.createStylesheet=l;exports.styleToString=s;
@@ -1 +1 @@
1
- "use strict";var J=i=>{throw TypeError(i)};var N=(i,e,s)=>e.has(i)||J("Cannot "+s);var t=(i,e,s)=>(N(i,e,"read from private field"),s?s.call(i):e.get(i)),h=(i,e,s)=>e.has(i)?J("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,s),r=(i,e,s,l)=>(N(i,e,"write to private field"),l?l.call(i,s):e.set(i,s),s),L=(i,e,s)=>(N(i,e,"access private method"),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const St=require("../css-unit-parser/index.cjs"),$=require("../ladder/index.cjs"),Q=require("../order/index.cjs"),F=require("../scroll-entries/index.cjs"),j=require("../ticker/index.cjs"),tt=require("../browser-CpzFX2xg.cjs"),et=require("../dom-JBOkFLTh.cjs"),V=require("../layout-8ryRAMGJ.cjs"),st=require("../element-resizer/index.cjs"),it=require("../window-resizer/index.cjs"),dt=require("../notifier/index.cjs");function ht(i){const e=Math.sqrt(i.m11*i.m11+i.m12*i.m12+i.m13*i.m13),s=Math.sqrt(i.m21*i.m21+i.m22*i.m22+i.m23*i.m23),l=Math.sqrt(i.m31*i.m31+i.m32*i.m32+i.m33*i.m33),y=Math.atan2(i.m32,i.m33),B=Math.atan2(-i.m31,Math.sqrt(i.m32*i.m32+i.m33*i.m33)),K=Math.atan2(i.m21,i.m11),a=i.m41,q=i.m42*-1,O=i.m43;return{scaleX:e,scaleY:s,scaleZ:l,rotationX:y,rotationY:B,rotationZ:K,translationX:a,translationY:q,translationZ:O}}var u,b,m,R,A,T,v,w,W,k,x,_,X,S,d,C,Y,H,U,g,p,z,o,n,c,E,M,I,f,G,rt,nt,lt,P,D,Z;class ft{constructor(e,s){h(this,f);h(this,u,null);h(this,b,null);h(this,m,[]);h(this,R,"auto");h(this,A,"top");h(this,T,!1);h(this,v,!0);h(this,w,!0);h(this,W,!0);h(this,k,!0);h(this,x,0);h(this,_,0);h(this,X,0);h(this,S,0);h(this,d,0);h(this,C,0);h(this,Y,0);h(this,H,0);h(this,U,0);h(this,g,{x:0,y:0,z:0});h(this,p,{x:0,y:0,z:0});h(this,z,{x:1,y:1,z:1});h(this,o,new $.Ladder({x:0,y:0,z:0}));h(this,n,new $.Ladder({x:0,y:0,z:0}));h(this,c,new $.Ladder({x:0,y:0,z:0}));h(this,E,{x:0,y:0,z:0});h(this,M,new Map);h(this,I,new dt.Notifier);h(this,P,()=>{tt.isBrowser&&L(this,f,nt).call(this)});h(this,D,()=>{L(this,f,lt).call(this),L(this,f,G).call(this)});h(this,Z,()=>{const e=F.scrollEntries.getAll(this.element);t(this,M).forEach((s,l)=>{e.includes(l)||(this.deleteScrollStep(s),t(this,M).delete(l))}),e.forEach(s=>{if(!t(this,M).has(s)){const l=()=>s;t(this,M).set(s,l),this.setScrollStep(l)}})});tt.isBrowser&&(r(this,u,et.getElement(e)||document.body),r(this,b,et.getElement(s==null?void 0:s.containerElement)||document.body),r(this,R,(s==null?void 0:s.scrollAxis)||"auto"),r(this,A,(s==null?void 0:s.frontSide)||"top"),r(this,T,(s==null?void 0:s.cartesian)||!1),r(this,v,(s==null?void 0:s.sizeStep)!==void 0?s.sizeStep:!0),r(this,w,(s==null?void 0:s.positionStep)!==void 0?s.positionStep:!0),r(this,W,(s==null?void 0:s.transformStep)!==void 0?s.transformStep:!0),r(this,k,(s==null?void 0:s.scrollStep)!==void 0?s.scrollStep:!0),t(this,c).setStep("_size","+",{x:1,y:1,z:1}),t(this,n).setStep("_position","+",{x:0,y:0,z:0}),t(this,c).setStep("_scale","*",{x:1,y:1,z:1}),t(this,n).setStep("_translation","+",{x:0,y:0,z:0}),t(this,o).setStep("_rotation","+",{x:0,y:0,z:0}),t(this,k)&&(F.scrollEntries.notifier.subscribe(t(this,Z)),t(this,Z).call(this)),st.elementResizer.subscribe(this.element,t(this,P)),it.windowResizer.subscribe(t(this,P),Q.RESIZE_ORDER.LAYOUT_BOX),j.ticker.subscribe(t(this,D),{order:Q.TICK_ORDER.LAYOUT_BOX,culling:s!=null&&s.culling?this.element:void 0}))}get element(){return t(this,u)}get containerElement(){return t(this,b)}get position(){return t(this,n).current}get rotation(){return t(this,o).current}get scale(){return t(this,c).current}get scrollValue(){return t(this,E)}get left(){return t(this,d)}get top(){return t(this,S)}get CSSTranslation(){return t(this,g)}get CSSRotation(){return t(this,p)}get CSSScale(){return t(this,z)}get front(){return t(this,C)}get width(){return t(this,x)}get height(){return t(this,_)}get depth(){return t(this,X)}destroy(){j.ticker.unsubscribe(t(this,D)),st.elementResizer.unsubscribe(t(this,P)),it.windowResizer.unsubscribe(t(this,P)),F.scrollEntries.notifier.unsubscribe(t(this,Z)),t(this,M).clear(),t(this,n).close(),t(this,o).close(),t(this,c).close()}bindObject(e){e.position&&t(this,n).bind(e.position),e.rotation&&t(this,o).bind(e.rotation),e.scale&&t(this,c).bind(e.scale)}unbindObject(e){e.position&&t(this,n).unbind(e.position),e.rotation&&t(this,o).unbind(e.rotation),e.scale&&t(this,c).unbind(e.scale)}setScrollStep(e){return t(this,m).includes(e)||t(this,m).push(e),()=>this.deleteScrollStep(e)}deleteScrollStep(e){r(this,m,t(this,m).filter(s=>s!==e))}setPositionStep(...e){t(this,n).setStep(...e)}getPositionStep(...e){return t(this,n).getStepValue(...e)}setRotationStep(...e){t(this,o).setStep(...e)}getRotationStep(...e){return t(this,o).getStepValue(...e)}getExcludedRotationSteps(...e){return t(this,o).getExcludedStepsValue(...e)}getIncludedRotationSteps(...e){return t(this,o).getIncludedStepsValue(...e)}setScaleStep(...e){t(this,c).setStep(...e)}getScaleStep(...e){return t(this,c).getStepValue(...e)}getExcludedScaleSteps(...e){return t(this,c).getExcludedStepsValue(...e)}getIncludedScaleSteps(...e){return t(this,c).getIncludedStepsValue(...e)}deletePositionStep(...e){t(this,n).deleteStep(...e)}getExcludedPositionSteps(...e){return t(this,n).getExcludedStepsValue(...e)}getIncludedPositionSteps(...e){return t(this,n).getIncludedStepsValue(...e)}deleteRotationStep(...e){t(this,o).deleteStep(...e)}deleteScaleStep(...e){t(this,c).deleteStep(...e)}onPosition(...e){return t(this,n).subscribe(...e)}offPosition(...e){t(this,n).unsubscribe(...e)}onScale(...e){return t(this,c).subscribe(...e)}offScale(...e){t(this,c).unsubscribe(...e)}onRotation(...e){return t(this,o).subscribe(...e)}offRotation(...e){t(this,o).unsubscribe(...e)}onResize(...e){return t(this,I).subscribe(...e)}offResize(...e){return t(this,I).unsubscribe(...e)}}u=new WeakMap,b=new WeakMap,m=new WeakMap,R=new WeakMap,A=new WeakMap,T=new WeakMap,v=new WeakMap,w=new WeakMap,W=new WeakMap,k=new WeakMap,x=new WeakMap,_=new WeakMap,X=new WeakMap,S=new WeakMap,d=new WeakMap,C=new WeakMap,Y=new WeakMap,H=new WeakMap,U=new WeakMap,g=new WeakMap,p=new WeakMap,z=new WeakMap,o=new WeakMap,n=new WeakMap,c=new WeakMap,E=new WeakMap,M=new WeakMap,I=new WeakMap,f=new WeakSet,G=function(){t(this,c).calculate(),t(this,n).calculate(),t(this,o).calculate()},rt=function(){t(this,c).setStep("_size","+",{x:t(this,v)?t(this,x):1,y:t(this,v)?t(this,_):1,z:t(this,v)?t(this,X):1});const e=t(this,w)?t(this,Y):0,s=t(this,w)?t(this,H):0,l=t(this,w)?t(this,U):0;t(this,n).setStep("_position","+",{x:e,y:s,z:l}),t(this,W)?(t(this,c).setStep("_scale","*",{x:t(this,z).x,y:t(this,z).y,z:t(this,z).z}),t(this,n).setStep("_translation","+",{x:t(this,g).x,y:t(this,g).y,z:t(this,g).z}),t(this,o).setStep("_rotation","+",{x:t(this,p).x,y:t(this,p).y,z:t(this,p).z})):(t(this,c).setStep("_scale","*",{x:1,y:1,z:1}),t(this,n).setStep("_translation","+",{x:0,y:0,z:0}),t(this,o).setStep("_rotation","+",{x:0,y:0,z:0}))},nt=function(){const e=getComputedStyle(t(this,u));r(this,x,Math.max(t(this,u).clientWidth,1)),r(this,_,Math.max(t(this,u).clientHeight,1)),r(this,X,Math.max(St.cssUnitParser.parse(e.getPropertyValue("--depth")||"0px"),1));const s=V.getCumulativeOffsetLeft(t(this,b)),l=V.getCumulativeOffsetTop(t(this,b)),y=t(this,b).clientWidth,B=t(this,b).clientHeight;if(r(this,d,V.getCumulativeOffsetLeft(t(this,u))-s),r(this,S,V.getCumulativeOffsetTop(t(this,u))-l),t(this,R)==="z"){const q=t(this,d)/y,O=t(this,S)/B;r(this,d,(q-Math.floor(q))*y),r(this,S,(O-Math.floor(O))*B),t(this,A)==="left"?r(this,C,V.getCumulativeOffsetLeft(t(this,u))-s-t(this,d)):r(this,C,V.getCumulativeOffsetTop(t(this,u))-l-t(this,S))}if(r(this,d,t(this,d)+t(this,u).clientLeft),r(this,S,t(this,S)+t(this,u).clientTop),t(this,T)){const q=Math.round(y/2),O=Math.round(B/2),ct=t(this,x)?Math.round(t(this,x)/2):0,ot=t(this,_)?Math.round(t(this,_)/2):0,ut=t(this,d)-q+ct,at=(t(this,S)-O+ot)*-1;r(this,Y,ut),r(this,H,at)}else r(this,Y,t(this,d)),r(this,H,t(this,S));r(this,U,t(this,C)*-1);const K=new WebKitCSSMatrix(e.transform),a=ht(K);t(this,g).x=a.translationX,t(this,g).y=a.translationY,t(this,g).z=a.translationZ,t(this,z).x=a.scaleX,t(this,z).y=a.scaleY,t(this,z).z=a.scaleZ,t(this,p).x=a.rotationX,t(this,p).y=a.rotationY,t(this,p).z=a.rotationZ,L(this,f,rt).call(this),L(this,f,G).call(this),t(this,I).notify()},lt=function(){t(this,E).x=0,t(this,E).y=0,t(this,E).z=0;for(let e=0;e<t(this,m).length;e++){const s=t(this,m)[e]();let l=s.axis;t(this,R)!=="auto"&&(l=t(this,R));const y=s.value*(l==="x"?-1:t(this,T)?1:-1);t(this,E)[l]+=y,t(this,n).setStep(`_scroll_${e}`,"+",{[l]:y})}},P=new WeakMap,D=new WeakMap,Z=new WeakMap;exports.LayoutBox=ft;exports.decomposeCSSMatrix=ht;
1
+ "use strict";var J=i=>{throw TypeError(i)};var N=(i,e,s)=>e.has(i)||J("Cannot "+s);var t=(i,e,s)=>(N(i,e,"read from private field"),s?s.call(i):e.get(i)),h=(i,e,s)=>e.has(i)?J("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,s),r=(i,e,s,l)=>(N(i,e,"write to private field"),l?l.call(i,s):e.set(i,s),s),L=(i,e,s)=>(N(i,e,"access private method"),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const St=require("../css-unit-parser/index.cjs"),$=require("../ladder/index.cjs"),Q=require("../order/index.cjs"),F=require("../scroll-entries/index.cjs"),j=require("../ticker/vanilla/index.cjs"),tt=require("../browser-CpzFX2xg.cjs"),et=require("../dom-JBOkFLTh.cjs"),V=require("../layout-8ryRAMGJ.cjs"),st=require("../element-resizer/vanilla/index.cjs"),it=require("../window-resizer/vanilla/index.cjs"),dt=require("../notifier/index.cjs");function ht(i){const e=Math.sqrt(i.m11*i.m11+i.m12*i.m12+i.m13*i.m13),s=Math.sqrt(i.m21*i.m21+i.m22*i.m22+i.m23*i.m23),l=Math.sqrt(i.m31*i.m31+i.m32*i.m32+i.m33*i.m33),y=Math.atan2(i.m32,i.m33),B=Math.atan2(-i.m31,Math.sqrt(i.m32*i.m32+i.m33*i.m33)),K=Math.atan2(i.m21,i.m11),a=i.m41,q=i.m42*-1,O=i.m43;return{scaleX:e,scaleY:s,scaleZ:l,rotationX:y,rotationY:B,rotationZ:K,translationX:a,translationY:q,translationZ:O}}var u,b,m,M,A,T,R,w,W,k,x,_,X,S,d,C,Y,H,U,g,p,z,o,n,c,E,v,I,f,G,rt,nt,lt,P,D,Z;class ft{constructor(e,s){h(this,f);h(this,u,null);h(this,b,null);h(this,m,[]);h(this,M,"auto");h(this,A,"top");h(this,T,!1);h(this,R,!0);h(this,w,!0);h(this,W,!0);h(this,k,!0);h(this,x,0);h(this,_,0);h(this,X,0);h(this,S,0);h(this,d,0);h(this,C,0);h(this,Y,0);h(this,H,0);h(this,U,0);h(this,g,{x:0,y:0,z:0});h(this,p,{x:0,y:0,z:0});h(this,z,{x:1,y:1,z:1});h(this,o,new $.Ladder({x:0,y:0,z:0}));h(this,n,new $.Ladder({x:0,y:0,z:0}));h(this,c,new $.Ladder({x:0,y:0,z:0}));h(this,E,{x:0,y:0,z:0});h(this,v,new Map);h(this,I,new dt.Notifier);h(this,P,()=>{tt.isBrowser&&L(this,f,nt).call(this)});h(this,D,()=>{L(this,f,lt).call(this),L(this,f,G).call(this)});h(this,Z,()=>{const e=F.scrollEntries.getAll(this.element);t(this,v).forEach((s,l)=>{e.includes(l)||(this.deleteScrollStep(s),t(this,v).delete(l))}),e.forEach(s=>{if(!t(this,v).has(s)){const l=()=>s;t(this,v).set(s,l),this.setScrollStep(l)}})});tt.isBrowser&&(r(this,u,et.getElement(e)||document.body),r(this,b,et.getElement(s==null?void 0:s.containerElement)||document.body),r(this,M,(s==null?void 0:s.scrollAxis)||"auto"),r(this,A,(s==null?void 0:s.frontSide)||"top"),r(this,T,(s==null?void 0:s.cartesian)||!1),r(this,R,(s==null?void 0:s.sizeStep)!==void 0?s.sizeStep:!0),r(this,w,(s==null?void 0:s.positionStep)!==void 0?s.positionStep:!0),r(this,W,(s==null?void 0:s.transformStep)!==void 0?s.transformStep:!0),r(this,k,(s==null?void 0:s.scrollStep)!==void 0?s.scrollStep:!0),t(this,c).setStep("_size","+",{x:1,y:1,z:1}),t(this,n).setStep("_position","+",{x:0,y:0,z:0}),t(this,c).setStep("_scale","*",{x:1,y:1,z:1}),t(this,n).setStep("_translation","+",{x:0,y:0,z:0}),t(this,o).setStep("_rotation","+",{x:0,y:0,z:0}),t(this,k)&&(F.scrollEntries.notifier.subscribe(t(this,Z)),t(this,Z).call(this)),st.elementResizer.subscribe(this.element,t(this,P)),it.windowResizer.subscribe(t(this,P),Q.RESIZE_ORDER.LAYOUT_BOX),j.ticker.subscribe(t(this,D),{order:Q.TICK_ORDER.LAYOUT_BOX,culling:s!=null&&s.culling?this.element:void 0}))}get element(){return t(this,u)}get containerElement(){return t(this,b)}get position(){return t(this,n).current}get rotation(){return t(this,o).current}get scale(){return t(this,c).current}get scrollValue(){return t(this,E)}get left(){return t(this,d)}get top(){return t(this,S)}get CSSTranslation(){return t(this,g)}get CSSRotation(){return t(this,p)}get CSSScale(){return t(this,z)}get front(){return t(this,C)}get width(){return t(this,x)}get height(){return t(this,_)}get depth(){return t(this,X)}destroy(){j.ticker.unsubscribe(t(this,D)),st.elementResizer.unsubscribe(t(this,P)),it.windowResizer.unsubscribe(t(this,P)),F.scrollEntries.notifier.unsubscribe(t(this,Z)),t(this,v).clear(),t(this,n).close(),t(this,o).close(),t(this,c).close()}bindObject(e){e.position&&t(this,n).bind(e.position),e.rotation&&t(this,o).bind(e.rotation),e.scale&&t(this,c).bind(e.scale)}unbindObject(e){e.position&&t(this,n).unbind(e.position),e.rotation&&t(this,o).unbind(e.rotation),e.scale&&t(this,c).unbind(e.scale)}setScrollStep(e){return t(this,m).includes(e)||t(this,m).push(e),()=>this.deleteScrollStep(e)}deleteScrollStep(e){r(this,m,t(this,m).filter(s=>s!==e))}setPositionStep(...e){t(this,n).setStep(...e)}getPositionStep(...e){return t(this,n).getStepValue(...e)}setRotationStep(...e){t(this,o).setStep(...e)}getRotationStep(...e){return t(this,o).getStepValue(...e)}getExcludedRotationSteps(...e){return t(this,o).getExcludedStepsValue(...e)}getIncludedRotationSteps(...e){return t(this,o).getIncludedStepsValue(...e)}setScaleStep(...e){t(this,c).setStep(...e)}getScaleStep(...e){return t(this,c).getStepValue(...e)}getExcludedScaleSteps(...e){return t(this,c).getExcludedStepsValue(...e)}getIncludedScaleSteps(...e){return t(this,c).getIncludedStepsValue(...e)}deletePositionStep(...e){t(this,n).deleteStep(...e)}getExcludedPositionSteps(...e){return t(this,n).getExcludedStepsValue(...e)}getIncludedPositionSteps(...e){return t(this,n).getIncludedStepsValue(...e)}deleteRotationStep(...e){t(this,o).deleteStep(...e)}deleteScaleStep(...e){t(this,c).deleteStep(...e)}onPosition(...e){return t(this,n).subscribe(...e)}offPosition(...e){t(this,n).unsubscribe(...e)}onScale(...e){return t(this,c).subscribe(...e)}offScale(...e){t(this,c).unsubscribe(...e)}onRotation(...e){return t(this,o).subscribe(...e)}offRotation(...e){t(this,o).unsubscribe(...e)}onResize(...e){return t(this,I).subscribe(...e)}offResize(...e){return t(this,I).unsubscribe(...e)}}u=new WeakMap,b=new WeakMap,m=new WeakMap,M=new WeakMap,A=new WeakMap,T=new WeakMap,R=new WeakMap,w=new WeakMap,W=new WeakMap,k=new WeakMap,x=new WeakMap,_=new WeakMap,X=new WeakMap,S=new WeakMap,d=new WeakMap,C=new WeakMap,Y=new WeakMap,H=new WeakMap,U=new WeakMap,g=new WeakMap,p=new WeakMap,z=new WeakMap,o=new WeakMap,n=new WeakMap,c=new WeakMap,E=new WeakMap,v=new WeakMap,I=new WeakMap,f=new WeakSet,G=function(){t(this,c).calculate(),t(this,n).calculate(),t(this,o).calculate()},rt=function(){t(this,c).setStep("_size","+",{x:t(this,R)?t(this,x):1,y:t(this,R)?t(this,_):1,z:t(this,R)?t(this,X):1});const e=t(this,w)?t(this,Y):0,s=t(this,w)?t(this,H):0,l=t(this,w)?t(this,U):0;t(this,n).setStep("_position","+",{x:e,y:s,z:l}),t(this,W)?(t(this,c).setStep("_scale","*",{x:t(this,z).x,y:t(this,z).y,z:t(this,z).z}),t(this,n).setStep("_translation","+",{x:t(this,g).x,y:t(this,g).y,z:t(this,g).z}),t(this,o).setStep("_rotation","+",{x:t(this,p).x,y:t(this,p).y,z:t(this,p).z})):(t(this,c).setStep("_scale","*",{x:1,y:1,z:1}),t(this,n).setStep("_translation","+",{x:0,y:0,z:0}),t(this,o).setStep("_rotation","+",{x:0,y:0,z:0}))},nt=function(){const e=getComputedStyle(t(this,u));r(this,x,Math.max(t(this,u).clientWidth,1)),r(this,_,Math.max(t(this,u).clientHeight,1)),r(this,X,Math.max(St.cssUnitParser.parse(e.getPropertyValue("--depth")||"0px"),1));const s=V.getCumulativeOffsetLeft(t(this,b)),l=V.getCumulativeOffsetTop(t(this,b)),y=t(this,b).clientWidth,B=t(this,b).clientHeight;if(r(this,d,V.getCumulativeOffsetLeft(t(this,u))-s),r(this,S,V.getCumulativeOffsetTop(t(this,u))-l),t(this,M)==="z"){const q=t(this,d)/y,O=t(this,S)/B;r(this,d,(q-Math.floor(q))*y),r(this,S,(O-Math.floor(O))*B),t(this,A)==="left"?r(this,C,V.getCumulativeOffsetLeft(t(this,u))-s-t(this,d)):r(this,C,V.getCumulativeOffsetTop(t(this,u))-l-t(this,S))}if(r(this,d,t(this,d)+t(this,u).clientLeft),r(this,S,t(this,S)+t(this,u).clientTop),t(this,T)){const q=Math.round(y/2),O=Math.round(B/2),ct=t(this,x)?Math.round(t(this,x)/2):0,ot=t(this,_)?Math.round(t(this,_)/2):0,ut=t(this,d)-q+ct,at=(t(this,S)-O+ot)*-1;r(this,Y,ut),r(this,H,at)}else r(this,Y,t(this,d)),r(this,H,t(this,S));r(this,U,t(this,C)*-1);const K=new WebKitCSSMatrix(e.transform),a=ht(K);t(this,g).x=a.translationX,t(this,g).y=a.translationY,t(this,g).z=a.translationZ,t(this,z).x=a.scaleX,t(this,z).y=a.scaleY,t(this,z).z=a.scaleZ,t(this,p).x=a.rotationX,t(this,p).y=a.rotationY,t(this,p).z=a.rotationZ,L(this,f,rt).call(this),L(this,f,G).call(this),t(this,I).notify()},lt=function(){t(this,E).x=0,t(this,E).y=0,t(this,E).z=0;for(let e=0;e<t(this,m).length;e++){const s=t(this,m)[e]();let l=s.axis;t(this,M)!=="auto"&&(l=t(this,M));const y=s.value*(l==="x"?-1:t(this,T)?1:-1);t(this,E)[l]+=y,t(this,n).setStep(`_scroll_${e}`,"+",{[l]:y})}},P=new WeakMap,D=new WeakMap,Z=new WeakMap;exports.LayoutBox=ft;exports.decomposeCSSMatrix=ht;
@@ -7,12 +7,12 @@ import { cssUnitParser as ut } from "../css-unit-parser/index.js";
7
7
  import { Ladder as N } from "../ladder/index.js";
8
8
  import { RESIZE_ORDER as St, TICK_ORDER as dt } from "../order/index.js";
9
9
  import { scrollEntries as $ } from "../scroll-entries/index.js";
10
- import { ticker as j } from "../ticker/index.js";
10
+ import { ticker as j } from "../ticker/vanilla/index.js";
11
11
  import { i as tt } from "../browser-0zX67oeU.js";
12
12
  import { g as et } from "../dom-0S_WDL4g.js";
13
13
  import { g as F, a as G } from "../layout-HoBT_Da2.js";
14
- import { elementResizer as st } from "../element-resizer/index.js";
15
- import { windowResizer as it } from "../window-resizer/index.js";
14
+ import { elementResizer as st } from "../element-resizer/vanilla/index.js";
15
+ import { windowResizer as it } from "../window-resizer/vanilla/index.js";
16
16
  import { Notifier as ft } from "../notifier/index.js";
17
17
  function pt(i) {
18
18
  const e = Math.sqrt(
@@ -1 +1 @@
1
- "use strict";var b=Object.defineProperty,C=Object.defineProperties;var L=Object.getOwnPropertyDescriptors;var E=Object.getOwnPropertySymbols;var N=Object.prototype.hasOwnProperty,_=Object.prototype.propertyIsEnumerable;var w=s=>{throw TypeError(s)};var S=(s,t,e)=>t in s?b(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,f=(s,t)=>{for(var e in t||(t={}))N.call(t,e)&&S(s,e,t[e]);if(E)for(var e of E(t))_.call(t,e)&&S(s,e,t[e]);return s},c=(s,t)=>C(s,L(t));var p=(s,t,e)=>t.has(s)||w("Cannot "+e);var r=(s,t,e)=>(p(s,t,"read from private field"),e?e.call(s):t.get(s)),l=(s,t,e)=>t.has(s)?w("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,e),v=(s,t,e,o)=>(p(s,t,"write to private field"),o?o.call(s,e):t.set(s,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("../notifier/index.cjs"),q=require("../function-MthRj-GJ.cjs");var i,h,a,d,n,u,g;class M{constructor(){l(this,i,new Map);l(this,h,new y.Notifier);l(this,a,new y.Notifier);l(this,d,new y.Notifier);l(this,n,!1);l(this,u,t=>{const{loaded:e,total:o}=this.getStats();r(this,h).notify({progress:e/o,loaded:e,total:o,namespace:t}),r(this,g).call(this)});l(this,g,q.debounce(()=>{const{loaded:t,total:e}=this.getStats();if(t===e){v(this,n,!0);const{total:o}=this.getStats();r(this,a).notify({total:o})}},150))}get progressEvent(){return r(this,h)}get completeEvent(){return r(this,a)}get errorEvent(){return r(this,d)}get _counter(){return r(this,i)}get isComplete(){return r(this,n)}reset(){v(this,n,!1),r(this,i).clear()}setTotal(t,e=1){r(this,n)||r(this,i).set(t,{loaded:0,total:e})}setLoaded(t,e=1){if(!r(this,n)&&r(this,i).has(t)){const o=r(this,i).get(t);o.loaded!==e&&(r(this,i).set(t,c(f({},o),{loaded:e})),r(this,u).call(this,t))}}setError(t,e){if(!r(this,n)&&r(this,i).has(t)){const o=r(this,i).get(t);r(this,i).set(t,c(f({},o),{total:o.total-1})),r(this,d).notify({namespace:t,url:e})}}getStats(){return Array.from(r(this,i)).reduce((t,e)=>({loaded:t.loaded+e[1].loaded,total:t.total+e[1].total}),{loaded:0,total:0})}}i=new WeakMap,h=new WeakMap,a=new WeakMap,d=new WeakMap,n=new WeakMap,u=new WeakMap,g=new WeakMap;const T=new M;exports.loading=T;
1
+ "use strict";var g=e=>{throw TypeError(e)};var p=(e,t,s)=>t.has(e)||g("Cannot "+s);var i=(e,t,s)=>(p(e,t,"read from private field"),s?s.call(e):t.get(e)),n=(e,t,s)=>t.has(e)?g("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),c=(e,t,s,d)=>(p(e,t,"write to private field"),d?d.call(e,s):t.set(e,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("../events-KVanG9sR.cjs"),u=require("../function-MthRj-GJ.cjs");var o,a,r,l,h;class v{constructor(){n(this,o,new Map);n(this,a,!1);n(this,r,u.debounce(()=>{i(this,a)||(c(this,a,!0),f.dispatchEvent(window,"loadingStart",{detail:{}}),i(this,l).call(this))},0));n(this,l,()=>{if(!i(this,a))return;const t=i(this,o).size,s=Array.from(i(this,o)).filter(w=>w[1]).length,d=s/t;f.dispatchEvent(window,"loadingProgress",{detail:{total:t,loaded:s,progress:d}}),d===1&&i(this,h).call(this)});n(this,h,u.debounce(()=>{c(this,a,!1),f.dispatchEvent(window,"loadingComplete",{detail:{total:i(this,o).size}}),i(this,o).clear()},0))}add(t){i(this,o).set(t,!1),i(this,r).call(this)}complete(t){i(this,o).set(t,!0),i(this,l).call(this)}error(t){i(this,o).has(t)&&(console.error(`Failed to load ${t}`),i(this,o).delete(t)),i(this,l).call(this)}}o=new WeakMap,a=new WeakMap,r=new WeakMap,l=new WeakMap,h=new WeakMap;const b=new v;exports.loading=b;
@@ -1,95 +1,52 @@
1
- var S = Object.defineProperty, C = Object.defineProperties;
2
- var L = Object.getOwnPropertyDescriptors;
3
- var v = Object.getOwnPropertySymbols;
4
- var b = Object.prototype.hasOwnProperty, x = Object.prototype.propertyIsEnumerable;
5
- var y = (s) => {
6
- throw TypeError(s);
1
+ var p = (i) => {
2
+ throw TypeError(i);
7
3
  };
8
- var w = (s, t, e) => t in s ? S(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e, u = (s, t) => {
9
- for (var e in t || (t = {}))
10
- b.call(t, e) && w(s, e, t[e]);
11
- if (v)
12
- for (var e of v(t))
13
- x.call(t, e) && w(s, e, t[e]);
14
- return s;
15
- }, c = (s, t) => C(s, L(t));
16
- var m = (s, t, e) => t.has(s) || y("Cannot " + e);
17
- var r = (s, t, e) => (m(s, t, "read from private field"), e ? e.call(s) : t.get(s)), h = (s, t, e) => t.has(s) ? y("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(s) : t.set(s, e), E = (s, t, e, o) => (m(s, t, "write to private field"), o ? o.call(s, e) : t.set(s, e), e);
18
- import { Notifier as p } from "../notifier/index.js";
19
- import { d as A } from "../function-C10DGppn.js";
20
- var i, l, a, d, n, g, f;
21
- class M {
4
+ var g = (i, t, e) => t.has(i) || p("Cannot " + e);
5
+ var s = (i, t, e) => (g(i, t, "read from private field"), e ? e.call(i) : t.get(i)), l = (i, t, e) => t.has(i) ? p("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(i) : t.set(i, e), c = (i, t, e, r) => (g(i, t, "write to private field"), r ? r.call(i, e) : t.set(i, e), e);
6
+ import { d as f } from "../events-CsVF98U6.js";
7
+ import { d as w } from "../function-C10DGppn.js";
8
+ var o, a, h, d, n;
9
+ class u {
22
10
  constructor() {
23
- h(this, i, /* @__PURE__ */ new Map());
24
- h(this, l, new p());
25
- h(this, a, new p());
26
- h(this, d, new p());
27
- h(this, n, !1);
28
- h(this, g, (t) => {
29
- const { loaded: e, total: o } = this.getStats();
30
- r(this, l).notify({
31
- progress: e / o,
32
- loaded: e,
33
- total: o,
34
- namespace: t
35
- }), r(this, f).call(this);
11
+ l(this, o, /* @__PURE__ */ new Map());
12
+ l(this, a, !1);
13
+ l(this, h, w(() => {
14
+ s(this, a) || (c(this, a, !0), f(window, "loadingStart", {
15
+ detail: {}
16
+ }), s(this, d).call(this));
17
+ }, 0));
18
+ l(this, d, () => {
19
+ if (!s(this, a))
20
+ return;
21
+ const t = s(this, o).size, e = Array.from(s(this, o)).filter((m) => m[1]).length, r = e / t;
22
+ f(window, "loadingProgress", {
23
+ detail: {
24
+ total: t,
25
+ loaded: e,
26
+ progress: r
27
+ }
28
+ }), r === 1 && s(this, n).call(this);
36
29
  });
37
- h(this, f, A(() => {
38
- const { loaded: t, total: e } = this.getStats();
39
- if (t === e) {
40
- E(this, n, !0);
41
- const { total: o } = this.getStats();
42
- r(this, a).notify({
43
- total: o
44
- });
45
- }
46
- }, 150));
30
+ l(this, n, w(() => {
31
+ c(this, a, !1), f(window, "loadingComplete", {
32
+ detail: {
33
+ total: s(this, o).size
34
+ }
35
+ }), s(this, o).clear();
36
+ }, 0));
47
37
  }
48
- get progressEvent() {
49
- return r(this, l);
38
+ add(t) {
39
+ s(this, o).set(t, !1), s(this, h).call(this);
50
40
  }
51
- get completeEvent() {
52
- return r(this, a);
41
+ complete(t) {
42
+ s(this, o).set(t, !0), s(this, d).call(this);
53
43
  }
54
- get errorEvent() {
55
- return r(this, d);
56
- }
57
- get _counter() {
58
- return r(this, i);
59
- }
60
- get isComplete() {
61
- return r(this, n);
62
- }
63
- reset() {
64
- E(this, n, !1), r(this, i).clear();
65
- }
66
- setTotal(t, e = 1) {
67
- r(this, n) || r(this, i).set(t, { loaded: 0, total: e });
68
- }
69
- setLoaded(t, e = 1) {
70
- if (!r(this, n) && r(this, i).has(t)) {
71
- const o = r(this, i).get(t);
72
- o.loaded !== e && (r(this, i).set(t, c(u({}, o), { loaded: e })), r(this, g).call(this, t));
73
- }
74
- }
75
- setError(t, e) {
76
- if (!r(this, n) && r(this, i).has(t)) {
77
- const o = r(this, i).get(t);
78
- r(this, i).set(t, c(u({}, o), { total: o.total - 1 })), r(this, d).notify({
79
- namespace: t,
80
- url: e
81
- });
82
- }
83
- }
84
- getStats() {
85
- return Array.from(r(this, i)).reduce(
86
- (t, e) => ({ loaded: t.loaded + e[1].loaded, total: t.total + e[1].total }),
87
- { loaded: 0, total: 0 }
88
- );
44
+ error(t) {
45
+ s(this, o).has(t) && (console.error(`Failed to load ${t}`), s(this, o).delete(t)), s(this, d).call(this);
89
46
  }
90
47
  }
91
- i = new WeakMap(), l = new WeakMap(), a = new WeakMap(), d = new WeakMap(), n = new WeakMap(), g = new WeakMap(), f = new WeakMap();
92
- const j = new M();
48
+ o = new WeakMap(), a = new WeakMap(), h = new WeakMap(), d = new WeakMap(), n = new WeakMap();
49
+ const k = new u();
93
50
  export {
94
- j as loading
51
+ k as loading
95
52
  };