aptechka 0.83.1 → 0.84.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 (285) hide show
  1. package/lib/Animation-BAiM6_n1.js +111 -0
  2. package/lib/Animation-DMWabSR0.cjs +1 -0
  3. package/lib/Composed-B0fvCtZz.cjs +1 -0
  4. package/lib/Composed-CgA9lLWA.js +75 -0
  5. package/lib/Damped-BLo-OAVb.cjs +1 -0
  6. package/lib/Damped-Dcz5UdMH.js +57 -0
  7. package/lib/DerivedArray-DFhxap_z.js +63 -0
  8. package/lib/DerivedArray-DYtWMW0n.cjs +1 -0
  9. package/lib/DragControls-BPHsDeH6.cjs +1 -0
  10. package/lib/DragControls-D2a1Cifp.js +234 -0
  11. package/lib/LocalLinks-BWFJYhGX.cjs +1 -0
  12. package/lib/LocalLinks-Dwgf3No6.js +65 -0
  13. package/lib/PageAnnouncerElement-DPMlVJZG.cjs +1 -0
  14. package/lib/PageAnnouncerElement-DV9pm_od.js +28 -0
  15. package/lib/PageScroll-BAatKJx6.cjs +1 -0
  16. package/lib/PageScroll-m3TsHnzR.js +65 -0
  17. package/lib/SourceElement-941MrYpq.js +265 -0
  18. package/lib/SourceElement-DBLZ7b5k.cjs +5 -0
  19. package/lib/Store-BCW70G3Z.cjs +1 -0
  20. package/lib/Store-uLDYY9ed.js +158 -0
  21. package/lib/Tweened-BvtjLCa3.js +48 -0
  22. package/lib/Tweened-DdXm1dbF.cjs +1 -0
  23. package/lib/Viewport-BiDoiU8M.js +113 -0
  24. package/lib/Viewport-CXGKUyDy.cjs +1 -0
  25. package/lib/accordion/index.cjs +1 -1
  26. package/lib/accordion/index.js +97 -93
  27. package/lib/animation/index.cjs +1 -1
  28. package/lib/animation/index.js +6 -6
  29. package/lib/api-fetcher/index.cjs +1 -1
  30. package/lib/api-fetcher/index.js +67 -66
  31. package/lib/attribute/index.cjs +1 -1
  32. package/lib/attribute/index.js +37 -34
  33. package/lib/attributes-BADnRZpK.cjs +1 -0
  34. package/lib/attributes-FObgMNCf.js +36 -0
  35. package/lib/billboard/index.cjs +1 -1
  36. package/lib/billboard/index.js +240 -232
  37. package/lib/cache/index.cjs +1 -1
  38. package/lib/cache/index.js +26 -23
  39. package/lib/canvas/index.cjs +1 -1
  40. package/lib/canvas/index.js +62 -59
  41. package/lib/canvas-BP1ceie3.cjs +1 -0
  42. package/lib/canvas-DsglKco1.js +40 -0
  43. package/lib/connector/index.cjs +1 -1
  44. package/lib/connector/index.js +44 -41
  45. package/lib/controls/index.cjs +1 -1
  46. package/lib/controls/index.js +6 -6
  47. package/lib/coordinates--JG1U6kQ.js +29 -0
  48. package/lib/coordinates-DQ9XV9M1.cjs +1 -0
  49. package/lib/css-property/index.cjs +1 -1
  50. package/lib/css-property/index.d.ts +1 -1
  51. package/lib/css-property/index.js +40 -37
  52. package/lib/css-unit-parser/index.cjs +2 -2
  53. package/lib/css-unit-parser/index.js +22 -19
  54. package/lib/css-value-parser/index.cjs +1 -1
  55. package/lib/css-value-parser/index.js +13 -11
  56. package/lib/custom-elements-BfZCJde6.cjs +1 -0
  57. package/lib/custom-elements-HEMuF7yH.js +27 -0
  58. package/lib/dev/index.cjs +2 -1
  59. package/lib/dev/index.d.ts +1 -0
  60. package/lib/dev/index.js +25 -10
  61. package/lib/device/index.cjs +1 -1
  62. package/lib/device/index.js +5 -5
  63. package/lib/dom-B40i6NXw.cjs +1 -0
  64. package/lib/dom-D8D-_9ty.js +108 -0
  65. package/lib/easings-BSGJFMAo.js +40 -0
  66. package/lib/easings-BWq0pPLq.cjs +1 -0
  67. package/lib/element-CqD0jqBJ.cjs +1 -0
  68. package/lib/element-DKw5H-Tu.js +10 -0
  69. package/lib/element-linked-store/index.cjs +1 -1
  70. package/lib/element-linked-store/index.js +53 -52
  71. package/lib/element-resizer/index.cjs +1 -1
  72. package/lib/element-resizer/index.js +47 -44
  73. package/lib/en3/index.cjs +4 -4
  74. package/lib/en3/index.js +192 -185
  75. package/lib/events-Ds-TuvYW.js +9 -0
  76. package/lib/events-UlGk63iC.cjs +1 -0
  77. package/lib/file-DwQs6bB6.js +28 -0
  78. package/lib/file-RHfA3OS-.cjs +1 -0
  79. package/lib/function-H4b_gTg6.cjs +1 -0
  80. package/lib/function-UmbPrOHm.js +19 -0
  81. package/lib/gestures-DmKKNnh4.js +14 -0
  82. package/lib/gestures-DtYbQr49.cjs +1 -0
  83. package/lib/history/index.cjs +1 -1
  84. package/lib/history/index.js +24 -21
  85. package/lib/iframe/index.cjs +1 -1
  86. package/lib/iframe/index.js +27 -24
  87. package/lib/image/index.cjs +1 -1
  88. package/lib/image/index.js +17 -13
  89. package/lib/index-BpO2RJ__.cjs +1 -0
  90. package/lib/index-DpKsHe97.js +68 -0
  91. package/lib/intersector/index.cjs +1 -1
  92. package/lib/intersector/index.js +3 -3
  93. package/lib/jsx/ComponentElement.d.ts +4 -0
  94. package/lib/jsx/h.d.ts +7 -16
  95. package/lib/jsx/hooks/component/useStylesheet.d.ts +1 -1
  96. package/lib/jsx/hooks/cssProperty.d.ts +6 -0
  97. package/lib/jsx/hooks/resize.d.ts +4 -0
  98. package/lib/jsx/hooks/store.d.ts +1 -2
  99. package/lib/jsx/hooks/ticker.d.ts +5 -0
  100. package/lib/jsx/index.cjs +1 -1
  101. package/lib/jsx/index.d.ts +4 -4
  102. package/lib/jsx/index.js +171 -349
  103. package/lib/jsx/plugins/vite/index.cjs +49 -0
  104. package/lib/jsx/plugins/vite/index.d.ts +38 -0
  105. package/lib/jsx/plugins/vite/index.js +104 -0
  106. package/lib/jsx/render.d.ts +2 -0
  107. package/lib/jsx/type.d.ts +228 -190
  108. package/lib/ladder/index.cjs +1 -1
  109. package/lib/ladder/index.js +86 -84
  110. package/lib/layout-C26zkY7D.js +35 -0
  111. package/lib/layout-CnGLl7oe.cjs +1 -0
  112. package/lib/layout-box/index.cjs +1 -1
  113. package/lib/layout-box/index.js +221 -217
  114. package/lib/loading/index.cjs +1 -1
  115. package/lib/loading/index.js +48 -45
  116. package/lib/local-links/index.cjs +1 -1
  117. package/lib/local-links/index.js +2 -2
  118. package/lib/masonry-layout/index.cjs +1 -1
  119. package/lib/masonry-layout/index.js +48 -45
  120. package/lib/math-C-knY2TL.cjs +1 -0
  121. package/lib/math-r8V23YFe.js +57 -0
  122. package/lib/media/index.cjs +1 -1
  123. package/lib/media/index.js +28 -25
  124. package/lib/metadata-BNdkmeeD.js +15 -0
  125. package/lib/metadata-BrHUfpV9.cjs +1 -0
  126. package/lib/morph/index.cjs +1 -1
  127. package/lib/morph/index.js +561 -556
  128. package/lib/morph-BtgB1YQP.js +256 -0
  129. package/lib/morph-Buhxq-X0.cjs +1 -0
  130. package/lib/need_redo_tweaker/index.cjs +4 -4
  131. package/lib/need_redo_tweaker/index.js +862 -834
  132. package/lib/notifier/index.cjs +1 -1
  133. package/lib/notifier/index.js +29 -26
  134. package/lib/number-Bu4sGvW7.cjs +1 -0
  135. package/lib/number-DiVt2xnh.js +47 -0
  136. package/lib/object-CiIdEmJx.js +98 -0
  137. package/lib/object-DTY_W6xG.cjs +1 -0
  138. package/lib/order/index.cjs +1 -1
  139. package/lib/order/index.js +3 -3
  140. package/lib/page-announcer/index.cjs +1 -1
  141. package/lib/page-announcer/index.js +2 -2
  142. package/lib/page-scroll/index.cjs +1 -1
  143. package/lib/page-scroll/index.js +2 -2
  144. package/lib/pixel-perfect/index.cjs +4 -4
  145. package/lib/pixel-perfect/index.js +43 -40
  146. package/lib/pointer/index.cjs +1 -1
  147. package/lib/pointer/index.js +125 -122
  148. package/lib/polyfills-CG1XJNia.js +28 -0
  149. package/lib/polyfills-DZCuDBkA.cjs +1 -0
  150. package/lib/popover/index.cjs +1 -1
  151. package/lib/popover/index.js +249 -245
  152. package/lib/radio/index.cjs +1 -1
  153. package/lib/radio/index.js +58 -55
  154. package/lib/render-DLcWVnuH.js +355 -0
  155. package/lib/render-DdomypCo.cjs +1 -0
  156. package/lib/router/index.cjs +1 -1
  157. package/lib/router/index.js +196 -194
  158. package/lib/scroll/index.cjs +1 -1
  159. package/lib/scroll/index.js +890 -877
  160. package/lib/scroll-BvIWh1xB.js +41 -0
  161. package/lib/scroll-CT0lpyRZ.cjs +1 -0
  162. package/lib/scroll-entries/index.cjs +1 -1
  163. package/lib/scroll-entries/index.js +37 -34
  164. package/lib/scroll-kit/index.cjs +1 -1
  165. package/lib/scroll-kit/index.js +214 -209
  166. package/lib/sequence/index.cjs +1 -1
  167. package/lib/sequence/index.js +102 -98
  168. package/lib/size-element/index.cjs +1 -1
  169. package/lib/size-element/index.js +29 -26
  170. package/lib/slicer/index.cjs +1 -1
  171. package/lib/slicer/index.js +118 -113
  172. package/lib/source/index.cjs +1 -1
  173. package/lib/source/index.js +5 -5
  174. package/lib/spa/index.cjs +1 -1
  175. package/lib/spa/index.js +94 -94
  176. package/lib/store/index.cjs +1 -1
  177. package/lib/store/index.d.ts +2 -2
  178. package/lib/store/index.js +10 -8
  179. package/lib/string-B3lm2b7v.js +84 -0
  180. package/lib/string-CbRNzmd9.cjs +1 -0
  181. package/lib/style-DBoQWK0d.js +14 -0
  182. package/lib/style-IDJ6db6n.cjs +1 -0
  183. package/lib/stylesheet-CHvuef16.js +28 -0
  184. package/lib/stylesheet-CQdBaIAA.cjs +1 -0
  185. package/lib/ticker/index.cjs +1 -1
  186. package/lib/ticker/index.js +96 -92
  187. package/lib/url-CPCO10Sy.cjs +1 -0
  188. package/lib/url-CWCY_qe_.js +124 -0
  189. package/lib/utils/attributes.d.ts +2 -0
  190. package/lib/utils/dom.d.ts +1 -0
  191. package/lib/utils/index.cjs +1 -1
  192. package/lib/utils/index.js +245 -226
  193. package/lib/utils/polyfills.d.ts +1 -1
  194. package/lib/video/index.cjs +1 -1
  195. package/lib/video/index.js +36 -33
  196. package/lib/window-resizer/index.cjs +1 -1
  197. package/lib/window-resizer/index.js +27 -24
  198. package/lib/youtube/index.cjs +1 -1
  199. package/lib/youtube/index.js +56 -54
  200. package/package.json +11 -24
  201. package/lib/Animation-BzTjZIE-.js +0 -108
  202. package/lib/Animation-C39Ah-LM.cjs +0 -1
  203. package/lib/Composed-C-TV9te3.cjs +0 -1
  204. package/lib/Composed-DyAWjEXE.js +0 -121
  205. package/lib/Damped-CRusiRIV.js +0 -56
  206. package/lib/Damped-Prr0iKu1.cjs +0 -1
  207. package/lib/DragControls-8rNZwQrs.cjs +0 -1
  208. package/lib/DragControls-DBNdMBA4.js +0 -228
  209. package/lib/LocalLinks-BxhSFv_Q.cjs +0 -1
  210. package/lib/LocalLinks-DFZFpbjs.js +0 -62
  211. package/lib/PageAnnouncerElement-0LxZjtVH.js +0 -24
  212. package/lib/PageAnnouncerElement-AQ0Ja6HM.cjs +0 -1
  213. package/lib/PageScroll-0LxFblry.js +0 -62
  214. package/lib/PageScroll-BXJUQwG7.cjs +0 -1
  215. package/lib/SourceElement-BHqPFbna.cjs +0 -5
  216. package/lib/SourceElement-DjbHjynf.js +0 -260
  217. package/lib/Store-Blf4msDz.cjs +0 -1
  218. package/lib/Store-ZThXYBQd.js +0 -152
  219. package/lib/Tweened-Bw1Cn1PJ.js +0 -47
  220. package/lib/Tweened-DWtk9E-O.cjs +0 -1
  221. package/lib/Viewport-BxCr0GlB.cjs +0 -1
  222. package/lib/Viewport-Dt-d9DPi.js +0 -109
  223. package/lib/attributes-69we3byR.js +0 -10
  224. package/lib/attributes-Bf2svn4j.cjs +0 -1
  225. package/lib/canvas-CU5Xjahf.cjs +0 -1
  226. package/lib/canvas-DeZ0SLUJ.js +0 -34
  227. package/lib/coordinates-CgdGoSYs.js +0 -24
  228. package/lib/coordinates-D8Np3cPD.cjs +0 -1
  229. package/lib/custom-elements-DBnCK7Zx.js +0 -24
  230. package/lib/custom-elements-Dh4TWRDJ.cjs +0 -1
  231. package/lib/dom-BETkVSSZ.js +0 -82
  232. package/lib/dom-CBLlqORw.cjs +0 -1
  233. package/lib/easings-BEmRlrDd.js +0 -38
  234. package/lib/easings-GegIwET5.cjs +0 -1
  235. package/lib/element-CGVl1jA-.js +0 -7
  236. package/lib/element-yhcBhsho.cjs +0 -1
  237. package/lib/events-CsVF98U6.js +0 -6
  238. package/lib/events-KVanG9sR.cjs +0 -1
  239. package/lib/file-DSpfWdd9.cjs +0 -1
  240. package/lib/file-GHShUlue.js +0 -24
  241. package/lib/function-C10DGppn.js +0 -17
  242. package/lib/function-MthRj-GJ.cjs +0 -1
  243. package/lib/gestures-C7gbKx11.cjs +0 -1
  244. package/lib/gestures-CcXV6fCp.js +0 -11
  245. package/lib/index-OE2INULi.cjs +0 -1
  246. package/lib/index-e9eDuagL.js +0 -65
  247. package/lib/jsx/hydrate.d.ts +0 -1
  248. package/lib/jsx/integrations/astro/client.cjs +0 -1
  249. package/lib/jsx/integrations/astro/client.d.ts +0 -2
  250. package/lib/jsx/integrations/astro/client.js +0 -50
  251. package/lib/jsx/integrations/astro/index.cjs +0 -1
  252. package/lib/jsx/integrations/astro/index.d.ts +0 -2
  253. package/lib/jsx/integrations/astro/index.js +0 -54
  254. package/lib/jsx/integrations/astro/server.cjs +0 -1
  255. package/lib/jsx/integrations/astro/server.d.ts +0 -3
  256. package/lib/jsx/integrations/astro/server.js +0 -35
  257. package/lib/jsx/plugins/vite.d.ts +0 -21
  258. package/lib/layout-BSMtwCga.js +0 -29
  259. package/lib/layout-Ctc2p3uz.cjs +0 -1
  260. package/lib/math-BOBiC4TN.js +0 -45
  261. package/lib/math-GDWEqu7y.cjs +0 -1
  262. package/lib/metadata-BcYZ5w3T.cjs +0 -1
  263. package/lib/metadata-jfowcCyz.js +0 -12
  264. package/lib/morph-B6sGhLCi.cjs +0 -1
  265. package/lib/morph-BQErz7qP.js +0 -242
  266. package/lib/number-ChAm68cm.cjs +0 -1
  267. package/lib/number-CumqY64S.js +0 -40
  268. package/lib/object-CcMK4y_r.js +0 -87
  269. package/lib/object-baN9pgbU.cjs +0 -1
  270. package/lib/polyfills-DJrTJQky.js +0 -24
  271. package/lib/polyfills-Df4r-ETT.cjs +0 -1
  272. package/lib/render-DQs7rIoN.cjs +0 -1
  273. package/lib/render-D_0FCWEu.js +0 -18
  274. package/lib/scroll-BA2WnUrb.cjs +0 -1
  275. package/lib/scroll-DY5senkF.js +0 -37
  276. package/lib/string-BlMQbe8b.js +0 -70
  277. package/lib/string-DUXXtU8v.cjs +0 -1
  278. package/lib/style-At6aDoqG.cjs +0 -1
  279. package/lib/style-j2TwriJ_.js +0 -10
  280. package/lib/stylesheet-5_o7PFzM.cjs +0 -1
  281. package/lib/stylesheet-DdBzowZY.js +0 -24
  282. package/lib/url-CHgcNwJ1.cjs +0 -1
  283. package/lib/url-CYgo5vrG.js +0 -113
  284. package/lib/vite-C-i3hVDL.js +0 -75
  285. package/lib/vite-DzanPumM.cjs +0 -44
package/lib/en3/index.js CHANGED
@@ -1,169 +1,171 @@
1
- var ee = Object.defineProperty, te = Object.defineProperties;
2
- var se = Object.getOwnPropertyDescriptors;
3
- var _ = Object.getOwnPropertySymbols;
4
- var ie = Object.prototype.hasOwnProperty, re = Object.prototype.propertyIsEnumerable;
5
- var B = (r) => {
6
- throw TypeError(r);
1
+ var __defProp = Object.defineProperty, __defProps = Object.defineProperties;
2
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
3
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty, __propIsEnum = Object.prototype.propertyIsEnumerable;
5
+ var __typeError = (msg) => {
6
+ throw TypeError(msg);
7
7
  };
8
- var G = (r, e, s) => e in r ? ee(r, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : r[e] = s, F = (r, e) => {
9
- for (var s in e || (e = {}))
10
- ie.call(e, s) && G(r, s, e[s]);
11
- if (_)
12
- for (var s of _(e))
13
- re.call(e, s) && G(r, s, e[s]);
14
- return r;
15
- }, K = (r, e) => te(r, se(e));
16
- var U = (r, e, s) => e.has(r) || B("Cannot " + s);
17
- var t = (r, e, s) => (U(r, e, "read from private field"), s ? s.call(r) : e.get(r)), c = (r, e, s) => e.has(r) ? B("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, s), n = (r, e, s, i) => (U(r, e, "write to private field"), i ? i.call(r, s) : e.set(r, s), s);
18
- import { RESIZE_ORDER as he, TICK_ORDER as ae } from "../order/index.js";
19
- import { ticker as Z } from "../ticker/index.js";
20
- import { g as Y } from "../dom-BETkVSSZ.js";
8
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value, __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ __hasOwnProp.call(b, prop) && __defNormalProp(a, prop, b[prop]);
11
+ if (__getOwnPropSymbols)
12
+ for (var prop of __getOwnPropSymbols(b))
13
+ __propIsEnum.call(b, prop) && __defNormalProp(a, prop, b[prop]);
14
+ return a;
15
+ }, __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)), __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
16
+ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
17
+ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)), __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value), __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
18
+ import { RESIZE_ORDER, TICK_ORDER } from "../order/index.js";
19
+ import { ticker } from "../ticker/index.js";
20
+ import { g as getElement } from "../dom-D8D-_9ty.js";
21
21
  import "construct-style-sheets-polyfill";
22
- import "../index-e9eDuagL.js";
23
- import { windowResizer as q } from "../window-resizer/index.js";
24
- import { Mesh as $, OrthographicCamera as N, PerspectiveCamera as J, Scene as ne, REVISION as ce, WebGLRenderer as le, Vector3 as W } from "three";
25
- import { LayoutBox as Q } from "../layout-box/index.js";
26
- import { d as me } from "../function-C10DGppn.js";
27
- function fe(r) {
28
- const e = (s) => {
29
- s.dispose();
30
- for (const i of Object.keys(s)) {
31
- const a = s[i];
32
- a && typeof a == "object" && "minFilter" in a && a.dispose();
22
+ import "../index-DpKsHe97.js";
23
+ import { windowResizer } from "../window-resizer/index.js";
24
+ import { Mesh, OrthographicCamera, PerspectiveCamera, Scene, REVISION, WebGLRenderer, Vector3 } from "three";
25
+ import { LayoutBox } from "../layout-box/index.js";
26
+ import { d as debounce } from "../function-UmbPrOHm.js";
27
+ function dispose(object3d) {
28
+ const cleanMaterial = /* @__PURE__ */ __name((material) => {
29
+ material.dispose();
30
+ for (const key of Object.keys(material)) {
31
+ const value = material[key];
32
+ value && typeof value == "object" && "minFilter" in value && value.dispose();
33
33
  }
34
- };
35
- r.traverse((s) => {
36
- if (s instanceof $) {
37
- if (s.geometry.dispose(), !Array.isArray(s.material) && s.material.isMaterial)
38
- e(s.material);
39
- else if (Array.isArray(s.material))
40
- for (const i of s.material) e(i);
34
+ }, "cleanMaterial");
35
+ object3d.traverse((object) => {
36
+ if (object instanceof Mesh) {
37
+ if (object.geometry.dispose(), !Array.isArray(object.material) && object.material.isMaterial)
38
+ cleanMaterial(object.material);
39
+ else if (Array.isArray(object.material))
40
+ for (const material of object.material) cleanMaterial(material);
41
41
  }
42
42
  });
43
43
  }
44
- var S, D, h, w, o, u, g, x, b, R;
45
- class X {
46
- constructor(e, s, i) {
47
- c(this, S);
48
- c(this, D);
49
- c(this, h);
50
- c(this, w);
51
- c(this, o);
52
- c(this, u);
53
- c(this, g);
54
- c(this, x);
55
- c(this, b);
56
- c(this, R, me(() => {
44
+ __name(dispose, "dispose");
45
+ var _en3, _name, _camera, _scene, _attachedObjects, _cameraDistance, _cameraFov, _sizeElement, _box, _debouncedResize;
46
+ const _En3View = class _En3View {
47
+ constructor(en3, name, options) {
48
+ __privateAdd(this, _en3);
49
+ __privateAdd(this, _name);
50
+ __privateAdd(this, _camera);
51
+ __privateAdd(this, _scene);
52
+ __privateAdd(this, _attachedObjects);
53
+ __privateAdd(this, _cameraDistance);
54
+ __privateAdd(this, _cameraFov);
55
+ __privateAdd(this, _sizeElement);
56
+ __privateAdd(this, _box);
57
+ __privateAdd(this, _debouncedResize, debounce(() => {
57
58
  this.resize();
58
59
  }, 0));
59
- n(this, S, e), n(this, D, s), n(this, h, (i == null ? void 0 : i.cameraType) === "orthographic" ? new N() : new J()), n(this, w, new ne()), n(this, o, []), n(this, u, (i == null ? void 0 : i.cameraDistance) || 1e3), t(this, h).near = (i == null ? void 0 : i.cameraNear) || 1, t(this, h).far = (i == null ? void 0 : i.cameraFar) || 11e3, n(this, g, (i == null ? void 0 : i.cameraFov) || "auto"), t(this, h).position.z = t(this, u), t(this, h).name = `Cameras.${t(this, D)}`, n(this, x, Y(i == null ? void 0 : i.sizeElement) || document.documentElement), this.beforeRenderCallback = i == null ? void 0 : i.beforeRender, n(this, b, new Q(t(this, x))), t(this, b).onResize(() => {
60
+ __privateSet(this, _en3, en3), __privateSet(this, _name, name), __privateSet(this, _camera, (options == null ? void 0 : options.cameraType) === "orthographic" ? new OrthographicCamera() : new PerspectiveCamera()), __privateSet(this, _scene, new Scene()), __privateSet(this, _attachedObjects, []), __privateSet(this, _cameraDistance, (options == null ? void 0 : options.cameraDistance) || 1e3), __privateGet(this, _camera).near = (options == null ? void 0 : options.cameraNear) || 1, __privateGet(this, _camera).far = (options == null ? void 0 : options.cameraFar) || 11e3, __privateSet(this, _cameraFov, (options == null ? void 0 : options.cameraFov) || "auto"), __privateGet(this, _camera).position.z = __privateGet(this, _cameraDistance), __privateGet(this, _camera).name = `Cameras.${__privateGet(this, _name)}`, __privateSet(this, _sizeElement, getElement(options == null ? void 0 : options.sizeElement) || document.documentElement), this.beforeRenderCallback = options == null ? void 0 : options.beforeRender, __privateSet(this, _box, new LayoutBox(__privateGet(this, _sizeElement))), __privateGet(this, _box).onResize(() => {
60
61
  this.resize();
61
62
  });
62
63
  }
63
64
  get name() {
64
- return t(this, D);
65
+ return __privateGet(this, _name);
65
66
  }
66
67
  get camera() {
67
- return t(this, h);
68
+ return __privateGet(this, _camera);
68
69
  }
69
70
  get scene() {
70
- return t(this, w);
71
+ return __privateGet(this, _scene);
71
72
  }
72
73
  get box() {
73
- return t(this, b);
74
+ return __privateGet(this, _box);
74
75
  }
75
76
  get cameraDistance() {
76
- return t(this, u);
77
+ return __privateGet(this, _cameraDistance);
77
78
  }
78
- set cameraDistance(e) {
79
- n(this, u, e), t(this, R).call(this);
79
+ set cameraDistance(value) {
80
+ __privateSet(this, _cameraDistance, value), __privateGet(this, _debouncedResize).call(this);
80
81
  }
81
- set fov(e) {
82
- n(this, g, e), t(this, R).call(this);
82
+ set fov(value) {
83
+ __privateSet(this, _cameraFov, value), __privateGet(this, _debouncedResize).call(this);
83
84
  }
84
85
  get fov() {
85
- return t(this, g);
86
+ return __privateGet(this, _cameraFov);
86
87
  }
87
- set near(e) {
88
- t(this, h).near = e, t(this, R).call(this);
88
+ set near(value) {
89
+ __privateGet(this, _camera).near = value, __privateGet(this, _debouncedResize).call(this);
89
90
  }
90
91
  get near() {
91
- return t(this, h).near;
92
+ return __privateGet(this, _camera).near;
92
93
  }
93
- set far(e) {
94
- t(this, h).far = e, t(this, R).call(this);
94
+ set far(value) {
95
+ __privateGet(this, _camera).far = value, __privateGet(this, _debouncedResize).call(this);
95
96
  }
96
97
  get far() {
97
- return t(this, h).far;
98
+ return __privateGet(this, _camera).far;
98
99
  }
99
100
  get sizeElement() {
100
- return t(this, x);
101
+ return __privateGet(this, _sizeElement);
101
102
  }
102
103
  get isClipped() {
103
- return t(this, x) !== t(this, S).containerElement;
104
+ return __privateGet(this, _sizeElement) !== __privateGet(this, _en3).containerElement;
104
105
  }
105
106
  resize() {
106
- const { width: e, height: s } = t(this, b);
107
- t(this, h).userData.controlled || (t(this, h).position.z = t(this, u)), t(this, h) instanceof J ? (t(this, h).aspect = e / s, t(this, h).fov = t(this, g) === "auto" ? 2 * Math.atan(s / 2 / t(this, u)) * (180 / Math.PI) : t(this, h).userData.controlled ? t(this, h).fov : t(this, g)) : t(this, h) instanceof N && (t(this, h).left = e / -2, t(this, h).right = e / 2, t(this, h).top = s / 2, t(this, h).bottom = s / -2), t(this, h).updateProjectionMatrix();
107
+ const { width, height } = __privateGet(this, _box);
108
+ __privateGet(this, _camera).userData.controlled || (__privateGet(this, _camera).position.z = __privateGet(this, _cameraDistance)), __privateGet(this, _camera) instanceof PerspectiveCamera ? (__privateGet(this, _camera).aspect = width / height, __privateGet(this, _camera).fov = __privateGet(this, _cameraFov) === "auto" ? 2 * Math.atan(height / 2 / __privateGet(this, _cameraDistance)) * (180 / Math.PI) : __privateGet(this, _camera).userData.controlled ? __privateGet(this, _camera).fov : __privateGet(this, _cameraFov)) : __privateGet(this, _camera) instanceof OrthographicCamera && (__privateGet(this, _camera).left = width / -2, __privateGet(this, _camera).right = width / 2, __privateGet(this, _camera).top = height / 2, __privateGet(this, _camera).bottom = height / -2), __privateGet(this, _camera).updateProjectionMatrix();
108
109
  }
109
110
  destroy() {
110
- t(this, o).forEach((e) => {
111
- e.userData.box.destroy();
112
- }), t(this, w).clear(), fe(t(this, w)), t(this, S).destroyView(this.name), t(this, b).destroy();
111
+ __privateGet(this, _attachedObjects).forEach((object) => {
112
+ object.userData.box.destroy();
113
+ }), __privateGet(this, _scene).clear(), dispose(__privateGet(this, _scene)), __privateGet(this, _en3).destroyView(this.name), __privateGet(this, _box).destroy();
113
114
  }
114
- attachToHTMLElement(e, s, i) {
115
- const a = new Q(e, K(F({}, i), {
116
- containerElement: t(this, x),
115
+ attachToHTMLElement(element, object, options) {
116
+ const box = new LayoutBox(element, __spreadProps(__spreadValues({}, options), {
117
+ containerElement: __privateGet(this, _sizeElement),
117
118
  cartesian: !0,
118
119
  scrollStep: !this.isClipped
119
120
  }));
120
- return a.bindObject(s), s.userData.box = a, t(this, o).push(s), s;
121
+ return box.bindObject(object), object.userData.box = box, __privateGet(this, _attachedObjects).push(object), object;
121
122
  }
122
- detachFromHTMLElement(e) {
123
- n(this, o, t(this, o).filter((s) => s === e ? (e.userData.box.destroy(), !1) : !0));
123
+ detachFromHTMLElement(object) {
124
+ __privateSet(this, _attachedObjects, __privateGet(this, _attachedObjects).filter((o) => o === object ? (object.userData.box.destroy(), !1) : !0));
124
125
  }
125
- add(...e) {
126
- const s = e[0], i = e[1], a = e[2];
127
- return i && this.attachToHTMLElement(i, s, a), this.scene.add(s), s;
126
+ add(...args) {
127
+ const object = args[0], element = args[1], options = args[2];
128
+ return element && this.attachToHTMLElement(element, object, options), this.scene.add(object), object;
128
129
  }
129
- remove(e, s) {
130
- this.scene.remove(e), s && this.detachFromHTMLElement(e);
130
+ remove(object, detach) {
131
+ this.scene.remove(object), detach && this.detachFromHTMLElement(object);
131
132
  }
132
- }
133
- S = new WeakMap(), D = new WeakMap(), h = new WeakMap(), w = new WeakMap(), o = new WeakMap(), u = new WeakMap(), g = new WeakMap(), x = new WeakMap(), b = new WeakMap(), R = new WeakMap();
134
- var I, f, l, m, z, V, C, v, T, d, P, A;
135
- class Ve {
133
+ };
134
+ _en3 = new WeakMap(), _name = new WeakMap(), _camera = new WeakMap(), _scene = new WeakMap(), _attachedObjects = new WeakMap(), _cameraDistance = new WeakMap(), _cameraFov = new WeakMap(), _sizeElement = new WeakMap(), _box = new WeakMap(), _debouncedResize = new WeakMap(), __name(_En3View, "En3View");
135
+ let En3View = _En3View;
136
+ var _CDNVersion, _containerElement, _webglRenderer, _views, _width, _height, _pixelRatio, _maxPixelRatio, _isCreated, _composer, _resizeListener, _tickListener;
137
+ const _En3 = class _En3 {
136
138
  constructor() {
137
- c(this, I, `https://unpkg.com/three@0.${ce}.x`);
138
- c(this, f, null);
139
- c(this, l, null);
140
- c(this, m, /* @__PURE__ */ new Map());
141
- c(this, z, 0);
142
- c(this, V, 0);
143
- c(this, C, 0);
144
- c(this, v, 2);
145
- c(this, T, !1);
146
- c(this, d, null);
147
- c(this, P, (e) => {
148
- e instanceof CustomEvent || (n(this, z, t(this, f).clientWidth), n(this, V, t(this, f).clientHeight), n(this, C, Math.min(t(this, v), devicePixelRatio || 1)), t(this, l).setPixelRatio(t(this, C)), t(this, l).setSize(t(this, z), t(this, V)), t(this, d) && (t(this, d).setPixelRatio(t(this, C)), t(this, d).setSize(t(this, z), t(this, V))));
149
- });
150
- c(this, A, () => {
151
- t(this, l).setRenderTarget(null), t(this, m).forEach((e) => {
152
- this.render(e);
139
+ __privateAdd(this, _CDNVersion, `https://unpkg.com/three@0.${REVISION}.x`);
140
+ __privateAdd(this, _containerElement, null);
141
+ __privateAdd(this, _webglRenderer, null);
142
+ __privateAdd(this, _views, /* @__PURE__ */ new Map());
143
+ __privateAdd(this, _width, 0);
144
+ __privateAdd(this, _height, 0);
145
+ __privateAdd(this, _pixelRatio, 0);
146
+ __privateAdd(this, _maxPixelRatio, 2);
147
+ __privateAdd(this, _isCreated, !1);
148
+ __privateAdd(this, _composer, null);
149
+ __privateAdd(this, _resizeListener, /* @__PURE__ */ __name((e) => {
150
+ e instanceof CustomEvent || (__privateSet(this, _width, __privateGet(this, _containerElement).clientWidth), __privateSet(this, _height, __privateGet(this, _containerElement).clientHeight), __privateSet(this, _pixelRatio, Math.min(__privateGet(this, _maxPixelRatio), devicePixelRatio || 1)), __privateGet(this, _webglRenderer).setPixelRatio(__privateGet(this, _pixelRatio)), __privateGet(this, _webglRenderer).setSize(__privateGet(this, _width), __privateGet(this, _height)), __privateGet(this, _composer) && (__privateGet(this, _composer).setPixelRatio(__privateGet(this, _pixelRatio)), __privateGet(this, _composer).setSize(__privateGet(this, _width), __privateGet(this, _height))));
151
+ }, "#resizeListener"));
152
+ __privateAdd(this, _tickListener, /* @__PURE__ */ __name(() => {
153
+ __privateGet(this, _webglRenderer).setRenderTarget(null), __privateGet(this, _views).forEach((view) => {
154
+ this.render(view);
153
155
  });
154
- });
156
+ }, "#tickListener"));
155
157
  }
156
158
  get CDNVersion() {
157
- return t(this, I);
159
+ return __privateGet(this, _CDNVersion);
158
160
  }
159
161
  get containerElement() {
160
- return t(this, f);
162
+ return __privateGet(this, _containerElement);
161
163
  }
162
164
  get webglRenderer() {
163
- return t(this, l);
165
+ return __privateGet(this, _webglRenderer);
164
166
  }
165
167
  get views() {
166
- return t(this, m);
168
+ return __privateGet(this, _views);
167
169
  }
168
170
  get view() {
169
171
  return this.getView("default");
@@ -175,110 +177,115 @@ class Ve {
175
177
  return this.getView("default").scene;
176
178
  }
177
179
  get width() {
178
- return t(this, z);
180
+ return __privateGet(this, _width);
179
181
  }
180
182
  get height() {
181
- return t(this, V);
183
+ return __privateGet(this, _height);
182
184
  }
183
185
  get pixelRatio() {
184
- return t(this, C);
186
+ return __privateGet(this, _pixelRatio);
185
187
  }
186
188
  get composer() {
187
- return t(this, d);
189
+ return __privateGet(this, _composer);
188
190
  }
189
- setup(e) {
190
- if (t(this, T))
191
+ setup(options) {
192
+ if (__privateGet(this, _isCreated))
191
193
  return;
192
- n(this, f, Y(e == null ? void 0 : e.containerElement) || document.body), n(this, v, (e == null ? void 0 : e.maxPixelRatio) || 2), n(this, l, new le(e == null ? void 0 : e.webGLRendererParameters)), t(this, l).domElement.style.cssText = `
193
- position: ${(e == null ? void 0 : e.position) || "fixed"};
194
+ __privateSet(this, _containerElement, getElement(options == null ? void 0 : options.containerElement) || document.body), __privateSet(this, _maxPixelRatio, (options == null ? void 0 : options.maxPixelRatio) || 2), __privateSet(this, _webglRenderer, new WebGLRenderer(options == null ? void 0 : options.webGLRendererParameters)), __privateGet(this, _webglRenderer).domElement.style.cssText = `
195
+ position: ${(options == null ? void 0 : options.position) || "fixed"};
194
196
  left: 0;
195
197
  top: 0;
196
198
  width: 100%;
197
199
  height: 100%;
198
- z-index: ${(e == null ? void 0 : e.zIndex) || 0};
199
- `, (t(this, f).shadowRoot || t(this, f)).append(t(this, l).domElement), t(this, m).set(
200
+ z-index: ${(options == null ? void 0 : options.zIndex) || 0};
201
+ `, (__privateGet(this, _containerElement).shadowRoot || __privateGet(this, _containerElement)).append(__privateGet(this, _webglRenderer).domElement), __privateGet(this, _views).set(
200
202
  "default",
201
- new X(this, "default", F({
202
- sizeElement: t(this, f)
203
- }, e == null ? void 0 : e.view))
204
- ), e != null && e.composer && (n(this, d, new e.composer(t(this, l))), this.render = () => {
205
- t(this, d).render();
206
- }), n(this, T, !0), q.subscribe(t(this, P), he.CANVAS), Z.subscribe(t(this, A), {
207
- order: ae.CANVAS,
208
- culling: t(this, f)
203
+ new En3View(this, "default", __spreadValues({
204
+ sizeElement: __privateGet(this, _containerElement)
205
+ }, options == null ? void 0 : options.view))
206
+ ), options != null && options.composer && (__privateSet(this, _composer, new options.composer(__privateGet(this, _webglRenderer))), this.render = () => {
207
+ __privateGet(this, _composer).render();
208
+ }), __privateSet(this, _isCreated, !0), windowResizer.subscribe(__privateGet(this, _resizeListener), RESIZE_ORDER.CANVAS), ticker.subscribe(__privateGet(this, _tickListener), {
209
+ order: TICK_ORDER.CANVAS,
210
+ culling: __privateGet(this, _containerElement)
209
211
  });
210
212
  }
211
213
  destroy() {
212
- var e;
213
- t(this, T) && (q.unsubscribe(t(this, P)), Z.unsubscribe(t(this, A)), t(this, m).forEach((s) => {
214
- s.destroy();
215
- }), t(this, m).clear(), t(this, l).dispose(), t(this, l).domElement.remove(), n(this, l, null), (e = t(this, d)) == null || e.dispose(), n(this, d, null), n(this, T, !1));
216
- }
217
- createView(e, s) {
218
- const i = t(this, m).size, a = new X(this, e, s);
219
- return t(this, m).set(e, a), i === 1 && t(this, l).setScissorTest(!0), a;
220
- }
221
- getView(e) {
222
- return t(this, m).get(e);
223
- }
224
- destroyView(e) {
225
- const s = t(this, m).get(e);
226
- s && (t(this, m).delete(e), s.destroy(), t(this, m).size <= 1 && t(this, l).setScissorTest(!1));
227
- }
228
- render(e) {
229
- var s;
230
- if (t(this, m).size > 1 || this.view.isClipped) {
231
- const i = e.box.left + e.box.CSSTranslation.x + e.box.scrollValue.x, a = this.height - e.box.height - e.box.top + e.box.CSSTranslation.y + e.box.scrollValue.y * -1;
232
- t(this, l).setScissor(i, a, e.box.width, e.box.height), t(this, l).setViewport(
233
- i,
234
- a,
235
- e.box.width,
236
- e.box.height
214
+ var _a;
215
+ __privateGet(this, _isCreated) && (windowResizer.unsubscribe(__privateGet(this, _resizeListener)), ticker.unsubscribe(__privateGet(this, _tickListener)), __privateGet(this, _views).forEach((view) => {
216
+ view.destroy();
217
+ }), __privateGet(this, _views).clear(), __privateGet(this, _webglRenderer).dispose(), __privateGet(this, _webglRenderer).domElement.remove(), __privateSet(this, _webglRenderer, null), (_a = __privateGet(this, _composer)) == null || _a.dispose(), __privateSet(this, _composer, null), __privateSet(this, _isCreated, !1));
218
+ }
219
+ createView(viewName, viewOptions) {
220
+ const size = __privateGet(this, _views).size, view = new En3View(this, viewName, viewOptions);
221
+ return __privateGet(this, _views).set(viewName, view), size === 1 && __privateGet(this, _webglRenderer).setScissorTest(!0), view;
222
+ }
223
+ getView(viewName) {
224
+ return __privateGet(this, _views).get(viewName);
225
+ }
226
+ destroyView(viewName) {
227
+ const view = __privateGet(this, _views).get(viewName);
228
+ view && (__privateGet(this, _views).delete(viewName), view.destroy(), __privateGet(this, _views).size <= 1 && __privateGet(this, _webglRenderer).setScissorTest(!1));
229
+ }
230
+ render(view) {
231
+ var _a;
232
+ if (__privateGet(this, _views).size > 1 || this.view.isClipped) {
233
+ const left = view.box.left + view.box.CSSTranslation.x + view.box.scrollValue.x, top = this.height - view.box.height - view.box.top + view.box.CSSTranslation.y + view.box.scrollValue.y * -1;
234
+ __privateGet(this, _webglRenderer).setScissor(left, top, view.box.width, view.box.height), __privateGet(this, _webglRenderer).setViewport(
235
+ left,
236
+ top,
237
+ view.box.width,
238
+ view.box.height
237
239
  );
238
240
  }
239
- (s = e.beforeRenderCallback) == null || s.call(e), t(this, l).render(e.scene, e.camera);
241
+ (_a = view.beforeRenderCallback) == null || _a.call(view), __privateGet(this, _webglRenderer).render(view.scene, view.camera);
240
242
  }
243
+ };
244
+ _CDNVersion = new WeakMap(), _containerElement = new WeakMap(), _webglRenderer = new WeakMap(), _views = new WeakMap(), _width = new WeakMap(), _height = new WeakMap(), _pixelRatio = new WeakMap(), _maxPixelRatio = new WeakMap(), _isCreated = new WeakMap(), _composer = new WeakMap(), _resizeListener = new WeakMap(), _tickListener = new WeakMap(), __name(_En3, "En3");
245
+ let En3 = _En3;
246
+ function coverTexture(texture, planeSize, aspect) {
247
+ const width = planeSize.x, height = planeSize.y, _aspect = aspect || texture.image.width / texture.image.height;
248
+ let sx = 0, sy = 0, tx = texture.offset.x, ty = texture.offset.y, r = texture.rotation, cx = texture.center.x, cy = texture.center.y;
249
+ width / height > _aspect ? (sx = 1, sy = height / width * _aspect) : (sy = 1, sx = width / height / _aspect), texture.matrix.setUvTransform(tx, ty, sx, sy, r, cx, cy);
241
250
  }
242
- I = new WeakMap(), f = new WeakMap(), l = new WeakMap(), m = new WeakMap(), z = new WeakMap(), V = new WeakMap(), C = new WeakMap(), v = new WeakMap(), T = new WeakMap(), d = new WeakMap(), P = new WeakMap(), A = new WeakMap();
243
- function Ce(r, e, s) {
244
- const i = e.x, a = e.y, y = s || r.image.width / r.image.height;
245
- let M = 0, E = 0, O = r.offset.x, L = r.offset.y, k = r.rotation, j = r.center.x, p = r.center.y;
246
- i / a > y ? (M = 1, E = a / i * y) : (E = 1, M = i / a / y), r.matrix.setUvTransform(O, L, M, E, k, j, p);
247
- }
248
- const H = new W(), de = new W();
249
- function Te(r, e, s = "default") {
250
- const i = r.getView(s), { width: a, height: y } = r, M = a / y;
251
- e instanceof W ? H.copy(e) : H.set(...e);
252
- const E = i.camera.getWorldPosition(de).distanceTo(H);
253
- if (i.camera instanceof N)
251
+ __name(coverTexture, "coverTexture");
252
+ const tempTarget = new Vector3(), position = new Vector3();
253
+ function getCurrentViewport(en3, target, viewName = "default") {
254
+ const view = en3.getView(viewName), { width, height } = en3, aspect = width / height;
255
+ target instanceof Vector3 ? tempTarget.copy(target) : tempTarget.set(...target);
256
+ const distance = view.camera.getWorldPosition(position).distanceTo(tempTarget);
257
+ if (view.camera instanceof OrthographicCamera)
254
258
  return {
255
- width: a / i.camera.zoom,
256
- height: y / i.camera.zoom,
259
+ width: width / view.camera.zoom,
260
+ height: height / view.camera.zoom,
257
261
  factor: 1,
258
- distance: E,
259
- aspect: M
262
+ distance,
263
+ aspect
260
264
  };
261
265
  {
262
- const O = i.camera.fov * Math.PI / 180, L = 2 * Math.tan(O / 2) * E, k = L * (a / y);
263
- return { width: k, height: L, factor: a / k, distance: E, aspect: M };
266
+ const fov = view.camera.fov * Math.PI / 180, h = 2 * Math.tan(fov / 2) * distance, w = h * (width / height);
267
+ return { width: w, height: h, factor: width / w, distance, aspect };
264
268
  }
265
269
  }
266
- function Me(r, e) {
267
- r.traverse((s) => {
268
- s instanceof $ && s.material && (Array.isArray(s.material) ? s.material : [s.material]).forEach(e);
270
+ __name(getCurrentViewport, "getCurrentViewport");
271
+ function traverseMaterials(object, callback) {
272
+ object.traverse((node) => {
273
+ node instanceof Mesh && node.material && (Array.isArray(node.material) ? node.material : [node.material]).forEach(callback);
269
274
  });
270
275
  }
271
- function Se(r, e) {
272
- r.traverse((s) => {
273
- s instanceof $ && e(s);
276
+ __name(traverseMaterials, "traverseMaterials");
277
+ function traverseMeshes(object, callback) {
278
+ object.traverse((node) => {
279
+ node instanceof Mesh && callback(node);
274
280
  });
275
281
  }
282
+ __name(traverseMeshes, "traverseMeshes");
276
283
  export {
277
- Ve as En3,
278
- X as En3View,
279
- Ce as coverTexture,
280
- fe as dispose,
281
- Te as getCurrentViewport,
282
- Me as traverseMaterials,
283
- Se as traverseMeshes
284
+ En3,
285
+ En3View,
286
+ coverTexture,
287
+ dispose,
288
+ getCurrentViewport,
289
+ traverseMaterials,
290
+ traverseMeshes
284
291
  };
@@ -0,0 +1,9 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
3
+ function dispatchEvent(from, name, init) {
4
+ init != null && init.custom || init != null && init.detail ? from.dispatchEvent(new CustomEvent(name, init)) : from.dispatchEvent(new Event(name, init));
5
+ }
6
+ __name(dispatchEvent, "dispatchEvent");
7
+ export {
8
+ dispatchEvent as d
9
+ };
@@ -0,0 +1 @@
1
+ "use strict";var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});function dispatchEvent(from,name,init){init!=null&&init.custom||init!=null&&init.detail?from.dispatchEvent(new CustomEvent(name,init)):from.dispatchEvent(new Event(name,init))}__name(dispatchEvent,"dispatchEvent");exports.dispatchEvent=dispatchEvent;
@@ -0,0 +1,28 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
3
+ function createJSONAndSave(filename, dataObjToWrite) {
4
+ const blob = new Blob([JSON.stringify(dataObjToWrite)], {
5
+ type: "application/json"
6
+ }), link = document.createElement("a");
7
+ link.download = filename + ".json", link.href = window.URL.createObjectURL(blob), link.dataset.downloadurl = [
8
+ "application/json",
9
+ link.download,
10
+ link.href
11
+ ].join(":");
12
+ const evt = new MouseEvent("click", {
13
+ view: window,
14
+ bubbles: !0,
15
+ cancelable: !0
16
+ });
17
+ link.dispatchEvent(evt), link.remove();
18
+ }
19
+ __name(createJSONAndSave, "createJSONAndSave");
20
+ function downloadURI(uri, name) {
21
+ const link = document.createElement("a");
22
+ name && link.setAttribute("download", name), link.href = uri, document.body.appendChild(link), link.click(), link.remove();
23
+ }
24
+ __name(downloadURI, "downloadURI");
25
+ export {
26
+ createJSONAndSave as c,
27
+ downloadURI as d
28
+ };
@@ -0,0 +1 @@
1
+ "use strict";var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});function createJSONAndSave(filename,dataObjToWrite){const blob=new Blob([JSON.stringify(dataObjToWrite)],{type:"application/json"}),link=document.createElement("a");link.download=filename+".json",link.href=window.URL.createObjectURL(blob),link.dataset.downloadurl=["application/json",link.download,link.href].join(":");const evt=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0});link.dispatchEvent(evt),link.remove()}__name(createJSONAndSave,"createJSONAndSave");function downloadURI(uri,name){const link=document.createElement("a");name&&link.setAttribute("download",name),link.href=uri,document.body.appendChild(link),link.click(),link.remove()}__name(downloadURI,"downloadURI");exports.createJSONAndSave=createJSONAndSave;exports.downloadURI=downloadURI;
@@ -0,0 +1 @@
1
+ "use strict";var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});const debounce=__name((callback,delay=100)=>{let timeout;return(...args)=>{clearTimeout(timeout),timeout=setTimeout(()=>callback(...args),delay)}},"debounce"),throttle=__name((callback,delay=0)=>{let wait=!1;return(...args)=>{wait||(wait=!0,setTimeout(()=>{callback(...args),wait=!1},delay))}},"throttle");exports.debounce=debounce;exports.throttle=throttle;
@@ -0,0 +1,19 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
3
+ const debounce = /* @__PURE__ */ __name((callback, delay = 100) => {
4
+ let timeout;
5
+ return (...args) => {
6
+ clearTimeout(timeout), timeout = setTimeout(() => callback(...args), delay);
7
+ };
8
+ }, "debounce"), throttle = /* @__PURE__ */ __name((callback, delay = 0) => {
9
+ let wait = !1;
10
+ return (...args) => {
11
+ wait || (wait = !0, setTimeout(() => {
12
+ callback(...args), wait = !1;
13
+ }, delay));
14
+ };
15
+ }, "throttle");
16
+ export {
17
+ debounce as d,
18
+ throttle as t
19
+ };
@@ -0,0 +1,14 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
3
+ function setupDrag(onMove, onDrop) {
4
+ const pointerMove = /* @__PURE__ */ __name((moveEvent) => {
5
+ onMove == null || onMove(moveEvent);
6
+ }, "pointerMove"), drop = /* @__PURE__ */ __name((e) => {
7
+ removeEventListener("pointermove", pointerMove), removeEventListener("pointerup", drop), removeEventListener("touchend", drop), onDrop == null || onDrop(e);
8
+ }, "drop");
9
+ addEventListener("pointermove", pointerMove), addEventListener("pointerup", drop), addEventListener("touchend", drop);
10
+ }
11
+ __name(setupDrag, "setupDrag");
12
+ export {
13
+ setupDrag as s
14
+ };
@@ -0,0 +1 @@
1
+ "use strict";var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});function setupDrag(onMove,onDrop){const pointerMove=__name(moveEvent=>{onMove==null||onMove(moveEvent)},"pointerMove"),drop=__name(e=>{removeEventListener("pointermove",pointerMove),removeEventListener("pointerup",drop),removeEventListener("touchend",drop),onDrop==null||onDrop(e)},"drop");addEventListener("pointermove",pointerMove),addEventListener("pointerup",drop),addEventListener("touchend",drop)}__name(setupDrag,"setupDrag");exports.setupDrag=setupDrag;
@@ -1 +1 @@
1
- "use strict";var d=e=>{throw TypeError(e)};var p=(e,t,o)=>t.has(e)||d("Cannot "+o);var i=(e,t,o)=>(p(e,t,"read from private field"),o?o.call(e):t.get(e)),a=(e,t,o)=>t.has(e)?d("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,o),h=(e,t,o,c)=>(p(e,t,"write to private field"),c?c.call(e,o):t.set(e,o),o);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var s,n,r;class w{constructor(t){a(this,s,!1);a(this,n);a(this,r,()=>{if(!window.location.hash)try{h(this,s,!0),i(this,n).onPop(new URL(window.location.toString())),h(this,s,!1)}catch(t){window.location.reload()}});window.addEventListener("popstate",i(this,r)),h(this,n,t)}get isBack(){return i(this,s)}push(t){history.pushState({},"",`${t}`)}destroy(){window.removeEventListener("popstate",i(this,r))}}s=new WeakMap,n=new WeakMap,r=new WeakMap;exports.History=w;
1
+ "use strict";var __defProp=Object.defineProperty;var __typeError=msg=>{throw TypeError(msg)};var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __accessCheck=(obj,member,msg)=>member.has(obj)||__typeError("Cannot "+msg);var __privateGet=(obj,member,getter)=>(__accessCheck(obj,member,"read from private field"),getter?getter.call(obj):member.get(obj)),__privateAdd=(obj,member,value)=>member.has(obj)?__typeError("Cannot add the same private member more than once"):member instanceof WeakSet?member.add(obj):member.set(obj,value),__privateSet=(obj,member,value,setter)=>(__accessCheck(obj,member,"write to private field"),setter?setter.call(obj,value):member.set(obj,value),value);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var _isBack,_options,_popstateListener;const _History=class _History{constructor(options){__privateAdd(this,_isBack,!1);__privateAdd(this,_options);__privateAdd(this,_popstateListener,__name(()=>{if(!window.location.hash)try{__privateSet(this,_isBack,!0),__privateGet(this,_options).onPop(new URL(window.location.toString())),__privateSet(this,_isBack,!1)}catch(e){window.location.reload()}},"#popstateListener"));window.addEventListener("popstate",__privateGet(this,_popstateListener)),__privateSet(this,_options,options)}get isBack(){return __privateGet(this,_isBack)}push(url){history.pushState({},"",`${url}`)}destroy(){window.removeEventListener("popstate",__privateGet(this,_popstateListener))}};_isBack=new WeakMap,_options=new WeakMap,_popstateListener=new WeakMap,__name(_History,"History");let History=_History;exports.History=History;