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
@@ -1,158 +1,161 @@
1
- var nt = (c) => {
2
- throw TypeError(c);
1
+ var __defProp = Object.defineProperty;
2
+ var __typeError = (msg) => {
3
+ throw TypeError(msg);
3
4
  };
4
- var st = (c, h, e) => h.has(c) || nt("Cannot " + e);
5
- var t = (c, h, e) => (st(c, h, "read from private field"), e ? e.call(c) : h.get(c)), r = (c, h, e) => h.has(c) ? nt("Cannot add the same private member more than once") : h instanceof WeakSet ? h.add(c) : h.set(c, e), o = (c, h, e, s) => (st(c, h, "write to private field"), s ? s.call(c, e) : h.set(c, e), e), p = (c, h, e) => (st(c, h, "access private method"), e);
6
- import { CSSProperty as E } from "../css-property/index.js";
7
- import { v as Q } from "../Viewport-Dt-d9DPi.js";
8
- import { ElementLinkedStore as pt } from "../element-linked-store/index.js";
9
- import { i as ot } from "../index-e9eDuagL.js";
10
- import { d as W } from "../events-CsVF98U6.js";
11
- import { d as dt } from "../function-C10DGppn.js";
12
- import { g as lt } from "../style-j2TwriJ_.js";
5
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
6
+ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
7
+ 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), __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
8
+ import { CSSProperty } from "../css-property/index.js";
9
+ import { v as viewport } from "../Viewport-BiDoiU8M.js";
10
+ import { ElementLinkedStore } from "../element-linked-store/index.js";
11
+ import { i as isBrowser } from "../index-DpKsHe97.js";
12
+ import { d as dispatchEvent } from "../events-Ds-TuvYW.js";
13
+ import { d as debounce } from "../function-UmbPrOHm.js";
14
+ import { g as getElementTransitionDurationMS } from "../style-DBoQWK0d.js";
13
15
  import "construct-style-sheets-polyfill";
14
- import { u as ft, p as gt } from "../url-CYgo5vrG.js";
15
- import { windowResizer as ct } from "../window-resizer/index.js";
16
- var f, w, tt, et;
17
- class mt {
16
+ import { u as updateSearchParameter, p as parseSearchParameters } from "../url-CWCY_qe_.js";
17
+ import { windowResizer } from "../window-resizer/index.js";
18
+ var _groups, _stack, _clickOutsideListener, _keydownListener;
19
+ const _PopoverGroups = class _PopoverGroups {
18
20
  constructor() {
19
- r(this, f, /* @__PURE__ */ new Map());
20
- r(this, w, []);
21
- r(this, tt, (h) => {
22
- var s;
23
- const e = [...t(this, w)].reverse().find((i) => i.clickOutside.current);
24
- if (e) {
25
- const i = h.composedPath();
26
- if (i.find(
27
- (N) => N instanceof HTMLElement && N.hasAttribute("data-popover-content")
21
+ __privateAdd(this, _groups, /* @__PURE__ */ new Map());
22
+ __privateAdd(this, _stack, []);
23
+ __privateAdd(this, _clickOutsideListener, /* @__PURE__ */ __name((e) => {
24
+ var _a;
25
+ const lastPopover = [...__privateGet(this, _stack)].reverse().find((el) => el.clickOutside.current);
26
+ if (lastPopover) {
27
+ const path = e.composedPath();
28
+ if (path.find(
29
+ (el) => el instanceof HTMLElement && el.hasAttribute("data-popover-content")
28
30
  ))
29
31
  return;
30
- const l = i[0], d = l instanceof Node && (e.contains(l) || ((s = e.shadowRoot) == null ? void 0 : s.contains(l))), L = l instanceof HTMLElement && l.hasAttribute("data-outside");
31
- (!d || L) && e.close();
32
+ const target = path[0], containsTarget = target instanceof Node && (lastPopover.contains(target) || ((_a = lastPopover.shadowRoot) == null ? void 0 : _a.contains(target))), outsideTarget = target instanceof HTMLElement && target.hasAttribute("data-outside");
33
+ (!containsTarget || outsideTarget) && lastPopover.close();
32
34
  }
33
- });
34
- r(this, et, (h) => {
35
- if (h.code === "Escape") {
36
- const e = [...t(this, w)].reverse().find((s) => s.escape.current);
37
- e && e.close();
35
+ }, "#clickOutsideListener"));
36
+ __privateAdd(this, _keydownListener, /* @__PURE__ */ __name((e) => {
37
+ if (e.code === "Escape") {
38
+ const lastPopover = [...__privateGet(this, _stack)].reverse().find((el) => el.escape.current);
39
+ lastPopover && lastPopover.close();
38
40
  }
39
- });
41
+ }, "#keydownListener"));
40
42
  document.documentElement.addEventListener(
41
43
  "click",
42
- t(this, tt)
43
- ), addEventListener("keydown", t(this, et));
44
+ __privateGet(this, _clickOutsideListener)
45
+ ), addEventListener("keydown", __privateGet(this, _keydownListener));
44
46
  }
45
47
  get groups() {
46
- return t(this, f);
48
+ return __privateGet(this, _groups);
47
49
  }
48
50
  get stack() {
49
- return t(this, w);
51
+ return __privateGet(this, _stack);
50
52
  }
51
- add(h, e) {
52
- if (e.closeRest.current)
53
- t(this, f).forEach((i) => {
54
- i.forEach((l) => {
55
- l.close();
53
+ add(groupName, element) {
54
+ if (element.closeRest.current)
55
+ __privateGet(this, _groups).forEach((g) => {
56
+ g.forEach((e) => {
57
+ e.close();
56
58
  });
57
59
  });
58
- else if (e.closeRestInGroup.current) {
59
- let i = t(this, f).get(h);
60
- i == null || i.forEach((l) => {
61
- l.close();
60
+ else if (element.closeRestInGroup.current) {
61
+ let group2 = __privateGet(this, _groups).get(groupName);
62
+ group2 == null || group2.forEach((e) => {
63
+ e.close();
62
64
  });
63
65
  }
64
- let s = t(this, f).get(h);
65
- s != null && s.length || (s = [], t(this, f).set(h, s)), t(this, w).push(e), s.push(e);
66
+ let group = __privateGet(this, _groups).get(groupName);
67
+ group != null && group.length || (group = [], __privateGet(this, _groups).set(groupName, group)), __privateGet(this, _stack).push(element), group.push(element);
66
68
  }
67
- remove(h, e) {
69
+ remove(groupName, element) {
68
70
  if (setTimeout(() => {
69
- o(this, w, t(this, w).filter((s) => s !== e));
70
- }), e.closeRest.current) {
71
- let s = [];
72
- t(this, f).forEach((i) => {
73
- i.forEach((l) => s.push(l));
74
- }), t(this, f).clear(), s.forEach((i) => i.close());
75
- } else if (e.closeRestInGroup.current) {
76
- const s = t(this, f).get(h);
77
- t(this, f).delete(h), s == null || s.forEach((i) => {
78
- i.close();
71
+ __privateSet(this, _stack, __privateGet(this, _stack).filter((e) => e !== element));
72
+ }), element.closeRest.current) {
73
+ let elements = [];
74
+ __privateGet(this, _groups).forEach((group) => {
75
+ group.forEach((element2) => elements.push(element2));
76
+ }), __privateGet(this, _groups).clear(), elements.forEach((element2) => element2.close());
77
+ } else if (element.closeRestInGroup.current) {
78
+ const group = __privateGet(this, _groups).get(groupName);
79
+ __privateGet(this, _groups).delete(groupName), group == null || group.forEach((element2) => {
80
+ element2.close();
79
81
  });
80
82
  } else {
81
- let s = t(this, f).get(h);
82
- s && (s = s.filter((i) => i !== e), t(this, f).set(h, s));
83
+ let group = __privateGet(this, _groups).get(groupName);
84
+ group && (group = group.filter((el) => el !== element), __privateGet(this, _groups).set(groupName, group));
83
85
  }
84
86
  }
85
- }
86
- f = new WeakMap(), w = new WeakMap(), tt = new WeakMap(), et = new WeakMap();
87
- var m, H, G, R, B, v, A, C, $, V, b, O, q, P, y, z, a, M, F, u, at, T, Z, D, S, I, X, U;
88
- const k = class k extends HTMLElement {
87
+ };
88
+ _groups = new WeakMap(), _stack = new WeakMap(), _clickOutsideListener = new WeakMap(), _keydownListener = new WeakMap(), __name(_PopoverGroups, "PopoverGroups");
89
+ let PopoverGroups = _PopoverGroups;
90
+ var _opened, _startClosingTimeoutId, _closeTimeoutId, _openFrameId, _openTransitionTimeoutId, _history, _restore, _dispatchResize, _closeRest, _closeRestInGroup, _group, _clickOutside, _escape, _checkViewportBounds, _historyAllowed, _lastTrigger, _status, _innerCloseElements, _resetScrollElements, _PopoverElement_instances, path_get, toggleGlobalClass_fn, deleteSearchParam_fn, _popStateListener, _resizeListener, _debouncedResize, _resize, _closeElementClickListener;
91
+ const _PopoverElement = class _PopoverElement extends HTMLElement {
89
92
  constructor() {
90
93
  super();
91
- r(this, u);
92
- r(this, m);
93
- r(this, H);
94
- r(this, G);
95
- r(this, R);
96
- r(this, B);
97
- r(this, v);
98
- r(this, A);
99
- r(this, C);
100
- r(this, $);
101
- r(this, V);
102
- r(this, b);
103
- r(this, O);
104
- r(this, q);
105
- r(this, P);
106
- r(this, y);
107
- r(this, z);
108
- r(this, a);
109
- r(this, M);
110
- r(this, F);
111
- r(this, D);
112
- r(this, S);
113
- r(this, I);
114
- r(this, X);
115
- r(this, U);
116
- this.urlValue = "", o(this, m, !1), o(this, v, new E(this, "--history", !1)), o(this, A, new E(this, "--restore", !1)), o(this, C, new E(this, "--dispatch-resize", !1)), o(this, $, new E(this, "--close-rest", !1)), o(this, V, new E(
94
+ __privateAdd(this, _PopoverElement_instances);
95
+ __privateAdd(this, _opened);
96
+ __privateAdd(this, _startClosingTimeoutId);
97
+ __privateAdd(this, _closeTimeoutId);
98
+ __privateAdd(this, _openFrameId);
99
+ __privateAdd(this, _openTransitionTimeoutId);
100
+ __privateAdd(this, _history);
101
+ __privateAdd(this, _restore);
102
+ __privateAdd(this, _dispatchResize);
103
+ __privateAdd(this, _closeRest);
104
+ __privateAdd(this, _closeRestInGroup);
105
+ __privateAdd(this, _group);
106
+ __privateAdd(this, _clickOutside);
107
+ __privateAdd(this, _escape);
108
+ __privateAdd(this, _checkViewportBounds);
109
+ __privateAdd(this, _historyAllowed);
110
+ __privateAdd(this, _lastTrigger);
111
+ __privateAdd(this, _status);
112
+ __privateAdd(this, _innerCloseElements);
113
+ __privateAdd(this, _resetScrollElements);
114
+ __privateAdd(this, _popStateListener);
115
+ __privateAdd(this, _resizeListener);
116
+ __privateAdd(this, _debouncedResize);
117
+ __privateAdd(this, _resize);
118
+ __privateAdd(this, _closeElementClickListener);
119
+ this.urlValue = "", __privateSet(this, _opened, !1), __privateSet(this, _history, new CSSProperty(this, "--history", !1)), __privateSet(this, _restore, new CSSProperty(this, "--restore", !1)), __privateSet(this, _dispatchResize, new CSSProperty(this, "--dispatch-resize", !1)), __privateSet(this, _closeRest, new CSSProperty(this, "--close-rest", !1)), __privateSet(this, _closeRestInGroup, new CSSProperty(
117
120
  this,
118
121
  "--close-rest-in-group",
119
122
  !1
120
- )), o(this, b, new E(this, "--group", "")), o(this, O, new E(this, "--click-outside", !1)), o(this, q, new E(this, "--escape", !1)), o(this, P, new E(this, "--check-viewport-bounds", !1)), o(this, y, !0), o(this, a, new pt(this, {
123
+ )), __privateSet(this, _group, new CSSProperty(this, "--group", "")), __privateSet(this, _clickOutside, new CSSProperty(this, "--click-outside", !1)), __privateSet(this, _escape, new CSSProperty(this, "--escape", !1)), __privateSet(this, _checkViewportBounds, new CSSProperty(this, "--check-viewport-bounds", !1)), __privateSet(this, _historyAllowed, !0), __privateSet(this, _status, new ElementLinkedStore(this, {
121
124
  triggered: !1,
122
125
  beforeopen: !1,
123
126
  opened: !1,
124
127
  closing: !1,
125
128
  transitionend: !1
126
- })), o(this, M, []), o(this, F, []), o(this, D, () => {
127
- o(this, y, !1), t(this, m) && t(this, v).current && !location.search.includes(this.id) ? this.close() : !t(this, m) && t(this, v).current && location.search.includes(this.id) && this.open({ trigger: this.idWithValue }), o(this, y, !0);
128
- }), o(this, S, () => {
129
- this.style.setProperty("--content-width", "initial"), this.style.setProperty("--content-height", "initial"), this.style.setProperty("--viewport-offset-x", "0px"), this.style.setProperty("--viewport-offset-y", "0px"), t(this, I).call(this);
130
- }), o(this, I, dt(() => {
131
- t(this, X).call(this);
132
- }, 10)), o(this, X, () => {
133
- if (this.style.setProperty("--content-width", this.scrollWidth + "px"), this.style.setProperty("--content-height", this.scrollHeight + "px"), t(this, P).current) {
134
- const e = this.getBoundingClientRect();
135
- let s = 0, i = 0;
136
- e.right > Q.width ? s = Q.width - e.right : e.left < 0 && (s = e.left * -1), e.bottom > Q.height ? i = Q.height - e.bottom : e.top < 0 && (i = e.top * -1), this.style.setProperty("--viewport-offset-x", s + "px"), this.style.setProperty("--viewport-offset-y", i + "px");
129
+ })), __privateSet(this, _innerCloseElements, []), __privateSet(this, _resetScrollElements, []), __privateSet(this, _popStateListener, () => {
130
+ __privateSet(this, _historyAllowed, !1), __privateGet(this, _opened) && __privateGet(this, _history).current && !location.search.includes(this.id) ? this.close() : !__privateGet(this, _opened) && __privateGet(this, _history).current && location.search.includes(this.id) && this.open({ trigger: this.idWithValue }), __privateSet(this, _historyAllowed, !0);
131
+ }), __privateSet(this, _resizeListener, () => {
132
+ this.style.setProperty("--content-width", "initial"), this.style.setProperty("--content-height", "initial"), this.style.setProperty("--viewport-offset-x", "0px"), this.style.setProperty("--viewport-offset-y", "0px"), __privateGet(this, _debouncedResize).call(this);
133
+ }), __privateSet(this, _debouncedResize, debounce(() => {
134
+ __privateGet(this, _resize).call(this);
135
+ }, 10)), __privateSet(this, _resize, () => {
136
+ if (this.style.setProperty("--content-width", this.scrollWidth + "px"), this.style.setProperty("--content-height", this.scrollHeight + "px"), __privateGet(this, _checkViewportBounds).current) {
137
+ const rect = this.getBoundingClientRect();
138
+ let viewportOffsetX = 0, viewportOffsetY = 0;
139
+ rect.right > viewport.width ? viewportOffsetX = viewport.width - rect.right : rect.left < 0 && (viewportOffsetX = rect.left * -1), rect.bottom > viewport.height ? viewportOffsetY = viewport.height - rect.bottom : rect.top < 0 && (viewportOffsetY = rect.top * -1), this.style.setProperty("--viewport-offset-x", viewportOffsetX + "px"), this.style.setProperty("--viewport-offset-y", viewportOffsetY + "px");
137
140
  }
138
- }), o(this, U, () => {
141
+ }), __privateSet(this, _closeElementClickListener, () => {
139
142
  this.close();
140
- }), t(this, b).subscribe((e) => {
141
- e.previous && (k.stack.remove(e.previous, this), e.current || (document.documentElement.classList.remove(
143
+ }), __privateGet(this, _group).subscribe((e) => {
144
+ e.previous && (_PopoverElement.stack.remove(e.previous, this), e.current || (document.documentElement.classList.remove(
142
145
  `${this.group.previous}-closing`
143
146
  ), document.documentElement.classList.remove(
144
147
  `${this.group.previous}-opened`
145
148
  )));
146
- }), t(this, a).subscribe((e) => {
149
+ }), __privateGet(this, _status).subscribe((e) => {
147
150
  if (this.group.current) {
148
151
  document.documentElement.classList.toggle(
149
152
  `${this.group.current}-closing`,
150
153
  e.current.closing
151
154
  );
152
- const s = k.stack.groups.get(this.group.current), i = s == null ? void 0 : s.find((l) => l.opened);
155
+ const group = _PopoverElement.stack.groups.get(this.group.current), element = group == null ? void 0 : group.find((e2) => e2.opened);
153
156
  document.documentElement.classList.toggle(
154
157
  `${this.group.current}-opened`,
155
- !!i
158
+ !!element
156
159
  );
157
160
  }
158
161
  });
@@ -164,242 +167,243 @@ const k = class k extends HTMLElement {
164
167
  return this.getAttribute("data-closing-global-class");
165
168
  }
166
169
  get history() {
167
- return t(this, v);
170
+ return __privateGet(this, _history);
168
171
  }
169
172
  get restore() {
170
- return t(this, A);
173
+ return __privateGet(this, _restore);
171
174
  }
172
175
  get dispatchResize() {
173
- return t(this, C);
176
+ return __privateGet(this, _dispatchResize);
174
177
  }
175
178
  get closeRest() {
176
- return t(this, $);
179
+ return __privateGet(this, _closeRest);
177
180
  }
178
181
  get closeRestInGroup() {
179
- return t(this, V);
182
+ return __privateGet(this, _closeRestInGroup);
180
183
  }
181
184
  get group() {
182
- return t(this, b);
185
+ return __privateGet(this, _group);
183
186
  }
184
187
  get clickOutside() {
185
- return t(this, O);
188
+ return __privateGet(this, _clickOutside);
186
189
  }
187
190
  get escape() {
188
- return t(this, q);
191
+ return __privateGet(this, _escape);
189
192
  }
190
193
  get opened() {
191
- return t(this, m);
194
+ return __privateGet(this, _opened);
192
195
  }
193
196
  get lastTrigger() {
194
- return t(this, z);
197
+ return __privateGet(this, _lastTrigger);
195
198
  }
196
199
  get idWithValue() {
197
200
  return `${this.id}${this.urlValue ? "=" + this.urlValue : ""}`;
198
201
  }
199
- updateUrlValue(e) {
200
- this.urlValue = (e == null ? void 0 : e.toString()) || "", t(this, m) && ft(this.id, e);
202
+ updateUrlValue(value) {
203
+ this.urlValue = (value == null ? void 0 : value.toString()) || "", __privateGet(this, _opened) && updateSearchParameter(this.id, value);
201
204
  }
202
- open(e) {
203
- if (t(this, m))
205
+ open(options) {
206
+ if (__privateGet(this, _opened))
204
207
  return;
205
- o(this, z, e == null ? void 0 : e.trigger), clearTimeout(t(this, H)), clearTimeout(t(this, G)), p(this, u, T).call(this, !1, this.closingClass), t(this, a).set("closing", !1), t(this, a).set("triggered", !0), W(this, "popoverTriggered", {
208
+ __privateSet(this, _lastTrigger, options == null ? void 0 : options.trigger), clearTimeout(__privateGet(this, _startClosingTimeoutId)), clearTimeout(__privateGet(this, _closeTimeoutId)), __privateMethod(this, _PopoverElement_instances, toggleGlobalClass_fn).call(this, !1, this.closingClass), __privateGet(this, _status).set("closing", !1), __privateGet(this, _status).set("triggered", !0), dispatchEvent(this, "popoverTriggered", {
206
209
  custom: !0,
207
210
  detail: {
208
- trigger: t(this, z)
211
+ trigger: __privateGet(this, _lastTrigger)
209
212
  }
210
- }), t(this, v).current && t(this, y) && history.pushState(history.state, "", t(this, u, at)), t(this, a).set("beforeopen", !0), o(this, m, !0);
211
- const s = () => {
212
- k.stack.add(t(this, b).current, this), t(this, F).forEach((i) => {
213
- i.scroll({
213
+ }), __privateGet(this, _history).current && __privateGet(this, _historyAllowed) && history.pushState(history.state, "", __privateGet(this, _PopoverElement_instances, path_get)), __privateGet(this, _status).set("beforeopen", !0), __privateSet(this, _opened, !0);
214
+ const opened = /* @__PURE__ */ __name(() => {
215
+ _PopoverElement.stack.add(__privateGet(this, _group).current, this), __privateGet(this, _resetScrollElements).forEach((el) => {
216
+ el.scroll({
214
217
  top: 0,
215
218
  left: 0,
216
219
  behavior: "instant"
217
220
  });
218
- }), p(this, u, T).call(this, !0, this.openClass), t(this, a).set("opened", !0), t(this, C).current ? W(window, "resize", { custom: !0 }) : t(this, S).call(this), W(this, "popoverOpened", {
221
+ }), __privateMethod(this, _PopoverElement_instances, toggleGlobalClass_fn).call(this, !0, this.openClass), __privateGet(this, _status).set("opened", !0), __privateGet(this, _dispatchResize).current ? dispatchEvent(window, "resize", { custom: !0 }) : __privateGet(this, _resizeListener).call(this), dispatchEvent(this, "popoverOpened", {
219
222
  custom: !0,
220
223
  detail: {
221
- trigger: t(this, z)
224
+ trigger: __privateGet(this, _lastTrigger)
222
225
  },
223
226
  bubbles: !0
224
- }), o(this, R, void 0), o(this, B, setTimeout(
227
+ }), __privateSet(this, _openFrameId, void 0), __privateSet(this, _openTransitionTimeoutId, setTimeout(
225
228
  () => {
226
- t(this, a).set("transitionend", !0), W(this, "popoverTransitionend");
229
+ __privateGet(this, _status).set("transitionend", !0), dispatchEvent(this, "popoverTransitionend");
227
230
  },
228
- lt(this) + 10
231
+ getElementTransitionDurationMS(this) + 10
229
232
  ));
230
- };
231
- e != null && e.skipTransition ? s() : o(this, R, requestAnimationFrame(s));
233
+ }, "opened");
234
+ options != null && options.skipTransition ? opened() : __privateSet(this, _openFrameId, requestAnimationFrame(opened));
232
235
  }
233
236
  close() {
234
- t(this, m) && (o(this, m, !1), cancelAnimationFrame(t(this, R)), clearTimeout(t(this, B)), k.stack.remove(t(this, b).current, this), p(this, u, Z).call(this), o(this, H, setTimeout(() => {
235
- t(this, a).set("transitionend", !1), t(this, a).set("opened", !1), t(this, a).set("closing", !0), p(this, u, T).call(this, !1, this.openClass), p(this, u, T).call(this, !0, this.closingClass), W(this, "popoverClosing", {
237
+ __privateGet(this, _opened) && (__privateSet(this, _opened, !1), cancelAnimationFrame(__privateGet(this, _openFrameId)), clearTimeout(__privateGet(this, _openTransitionTimeoutId)), _PopoverElement.stack.remove(__privateGet(this, _group).current, this), __privateMethod(this, _PopoverElement_instances, deleteSearchParam_fn).call(this), __privateSet(this, _startClosingTimeoutId, setTimeout(() => {
238
+ __privateGet(this, _status).set("transitionend", !1), __privateGet(this, _status).set("opened", !1), __privateGet(this, _status).set("closing", !0), __privateMethod(this, _PopoverElement_instances, toggleGlobalClass_fn).call(this, !1, this.openClass), __privateMethod(this, _PopoverElement_instances, toggleGlobalClass_fn).call(this, !0, this.closingClass), dispatchEvent(this, "popoverClosing", {
236
239
  custom: !0,
237
240
  bubbles: !0
238
- }), o(this, G, setTimeout(
241
+ }), __privateSet(this, _closeTimeoutId, setTimeout(
239
242
  () => {
240
- t(this, a).set("triggered", !1), t(this, a).set("beforeopen", !1), t(this, a).set("closing", !1), p(this, u, T).call(this, !1, this.closingClass), W(this, "popoverClosed", {
243
+ __privateGet(this, _status).set("triggered", !1), __privateGet(this, _status).set("beforeopen", !1), __privateGet(this, _status).set("closing", !1), __privateMethod(this, _PopoverElement_instances, toggleGlobalClass_fn).call(this, !1, this.closingClass), dispatchEvent(this, "popoverClosed", {
241
244
  custom: !0,
242
245
  bubbles: !0
243
246
  });
244
247
  },
245
- lt(this) + 10
248
+ getElementTransitionDurationMS(this) + 10
246
249
  ));
247
250
  }, 10)));
248
251
  }
249
252
  connectedCallback() {
250
- o(this, M, [
253
+ __privateSet(this, _innerCloseElements, [
251
254
  ...this.querySelectorAll(
252
255
  `[data-popover-close${this.id ? `="${this.id}"` : ""}]`
253
256
  )
254
- ]), t(this, M).forEach((e) => {
255
- e.addEventListener("click", t(this, U));
256
- }), o(this, F, [
257
+ ]), __privateGet(this, _innerCloseElements).forEach((el) => {
258
+ el.addEventListener("click", __privateGet(this, _closeElementClickListener));
259
+ }), __privateSet(this, _resetScrollElements, [
257
260
  ...this.querySelectorAll(
258
261
  `[data-popover-reset-scroll${this.id ? `="${this.id}"` : ""}]`
259
262
  )
260
- ]), t(this, v).observe(), t(this, A).observe(), t(this, C).observe(), t(this, $).observe(), t(this, V).observe(), t(this, b).observe(), t(this, O).observe(), t(this, q).observe(), t(this, P).observe(), this.setAttribute("role", "dialog"), addEventListener("popstate", t(this, D)), setTimeout(() => {
261
- t(this, A).current ? (o(this, y, !1), this.urlValue = gt(location.search)[this.id], location.search.includes(this.id) && this.open({ trigger: this.idWithValue }), o(this, y, !0)) : (p(this, u, Z).call(this), o(this, y, !0));
262
- }, 0), t(this, P).subscribe(() => {
263
- t(this, S).call(this);
264
- }), ct.subscribe(t(this, S));
263
+ ]), __privateGet(this, _history).observe(), __privateGet(this, _restore).observe(), __privateGet(this, _dispatchResize).observe(), __privateGet(this, _closeRest).observe(), __privateGet(this, _closeRestInGroup).observe(), __privateGet(this, _group).observe(), __privateGet(this, _clickOutside).observe(), __privateGet(this, _escape).observe(), __privateGet(this, _checkViewportBounds).observe(), this.setAttribute("role", "dialog"), addEventListener("popstate", __privateGet(this, _popStateListener)), setTimeout(() => {
264
+ __privateGet(this, _restore).current ? (__privateSet(this, _historyAllowed, !1), this.urlValue = parseSearchParameters(location.search)[this.id], location.search.includes(this.id) && this.open({ trigger: this.idWithValue }), __privateSet(this, _historyAllowed, !0)) : (__privateMethod(this, _PopoverElement_instances, deleteSearchParam_fn).call(this), __privateSet(this, _historyAllowed, !0));
265
+ }, 0), __privateGet(this, _checkViewportBounds).subscribe(() => {
266
+ __privateGet(this, _resizeListener).call(this);
267
+ }), windowResizer.subscribe(__privateGet(this, _resizeListener));
265
268
  }
266
269
  disconnectedCallback() {
267
- t(this, M).forEach((e) => {
268
- e.removeEventListener("click", t(this, U));
269
- }), k.stack.remove(t(this, b).current, this), ct.unsubscribe(t(this, S)), t(this, v).close(), t(this, A).close(), t(this, C).close(), t(this, $).close(), t(this, V).close(), t(this, b).close(), t(this, O).close(), t(this, q).close(), t(this, P).close(), this.removeAttribute("role"), p(this, u, T).call(this, !1, this.openClass), p(this, u, T).call(this, !1, this.closingClass), clearTimeout(t(this, H)), clearTimeout(t(this, G)), clearTimeout(t(this, R)), clearTimeout(t(this, B)), removeEventListener("popstate", t(this, D)), this.style.removeProperty("--content-width"), this.style.removeProperty("--content-height"), this.style.removeProperty("--viewport-offset-x"), this.style.removeProperty("--viewport-offset-y"), p(this, u, Z).call(this);
270
+ __privateGet(this, _innerCloseElements).forEach((el) => {
271
+ el.removeEventListener("click", __privateGet(this, _closeElementClickListener));
272
+ }), _PopoverElement.stack.remove(__privateGet(this, _group).current, this), windowResizer.unsubscribe(__privateGet(this, _resizeListener)), __privateGet(this, _history).close(), __privateGet(this, _restore).close(), __privateGet(this, _dispatchResize).close(), __privateGet(this, _closeRest).close(), __privateGet(this, _closeRestInGroup).close(), __privateGet(this, _group).close(), __privateGet(this, _clickOutside).close(), __privateGet(this, _escape).close(), __privateGet(this, _checkViewportBounds).close(), this.removeAttribute("role"), __privateMethod(this, _PopoverElement_instances, toggleGlobalClass_fn).call(this, !1, this.openClass), __privateMethod(this, _PopoverElement_instances, toggleGlobalClass_fn).call(this, !1, this.closingClass), clearTimeout(__privateGet(this, _startClosingTimeoutId)), clearTimeout(__privateGet(this, _closeTimeoutId)), clearTimeout(__privateGet(this, _openFrameId)), clearTimeout(__privateGet(this, _openTransitionTimeoutId)), removeEventListener("popstate", __privateGet(this, _popStateListener)), this.style.removeProperty("--content-width"), this.style.removeProperty("--content-height"), this.style.removeProperty("--viewport-offset-x"), this.style.removeProperty("--viewport-offset-y"), __privateMethod(this, _PopoverElement_instances, deleteSearchParam_fn).call(this);
270
273
  }
271
274
  };
272
- m = new WeakMap(), H = new WeakMap(), G = new WeakMap(), R = new WeakMap(), B = new WeakMap(), v = new WeakMap(), A = new WeakMap(), C = new WeakMap(), $ = new WeakMap(), V = new WeakMap(), b = new WeakMap(), O = new WeakMap(), q = new WeakMap(), P = new WeakMap(), y = new WeakMap(), z = new WeakMap(), a = new WeakMap(), M = new WeakMap(), F = new WeakMap(), u = new WeakSet(), at = function() {
275
+ _opened = new WeakMap(), _startClosingTimeoutId = new WeakMap(), _closeTimeoutId = new WeakMap(), _openFrameId = new WeakMap(), _openTransitionTimeoutId = new WeakMap(), _history = new WeakMap(), _restore = new WeakMap(), _dispatchResize = new WeakMap(), _closeRest = new WeakMap(), _closeRestInGroup = new WeakMap(), _group = new WeakMap(), _clickOutside = new WeakMap(), _escape = new WeakMap(), _checkViewportBounds = new WeakMap(), _historyAllowed = new WeakMap(), _lastTrigger = new WeakMap(), _status = new WeakMap(), _innerCloseElements = new WeakMap(), _resetScrollElements = new WeakMap(), _PopoverElement_instances = new WeakSet(), path_get = /* @__PURE__ */ __name(function() {
273
276
  return `${location.pathname}${location.search ? location.search + "&" : "?"}${this.idWithValue}`;
274
- }, T = function(e, s) {
275
- s && s.split(" ").map((i) => {
276
- document.documentElement.classList.toggle(i.trim(), e);
277
+ }, "#path"), toggleGlobalClass_fn = /* @__PURE__ */ __name(function(on, className) {
278
+ className && className.split(" ").map((v) => {
279
+ document.documentElement.classList.toggle(v.trim(), on);
277
280
  });
278
- }, Z = function() {
279
- if (t(this, v).current) {
280
- const e = new URL(location.href);
281
- e.searchParams.delete(this.id), history.replaceState(history.state, "", e.href);
281
+ }, "#toggleGlobalClass"), deleteSearchParam_fn = /* @__PURE__ */ __name(function() {
282
+ if (__privateGet(this, _history).current) {
283
+ const url = new URL(location.href);
284
+ url.searchParams.delete(this.id), history.replaceState(history.state, "", url.href);
282
285
  }
283
- }, D = new WeakMap(), S = new WeakMap(), I = new WeakMap(), X = new WeakMap(), U = new WeakMap(), k.stack = new mt();
284
- let _ = k;
285
- ot && !customElements.get("e-popover") && customElements.define("e-popover", _);
286
- var n, g, x, it, Y, j, J, K, rt;
287
- class vt extends HTMLElement {
286
+ }, "#deleteSearchParam"), _popStateListener = new WeakMap(), _resizeListener = new WeakMap(), _debouncedResize = new WeakMap(), _resize = new WeakMap(), _closeElementClickListener = new WeakMap(), __name(_PopoverElement, "PopoverElement"), _PopoverElement.stack = new PopoverGroups();
287
+ let PopoverElement = _PopoverElement;
288
+ isBrowser && !customElements.get("e-popover") && customElements.define("e-popover", PopoverElement);
289
+ var _popoverElement, _type, _PopoverButtonElement_instances, unlistenPopover_fn, _popoverTriggeredListener, _popoverOpenedListener, _popoverClosingListener, _popoverClosedListener, updateType_fn;
290
+ const _PopoverButtonElement = class _PopoverButtonElement extends HTMLElement {
288
291
  constructor() {
289
292
  super();
290
- r(this, x);
291
- r(this, n);
292
- r(this, g, new E(this, "--type", "open"));
293
- r(this, Y, (e) => {
294
- e.target === t(this, n) && t(this, g).current !== "close" && this.classList.add("triggered");
295
- });
296
- r(this, j, (e) => {
297
- e.target === t(this, n) && t(this, g).current !== "close" && (this.classList.add("opened"), this.setAttribute("aria-expanded", "true"));
298
- });
299
- r(this, J, (e) => {
300
- e.target === t(this, n) && t(this, g).current !== "close" && this.classList.remove("opened");
301
- });
302
- r(this, K, (e) => {
303
- e.target === t(this, n) && t(this, g).current !== "close" && (this.classList.remove("triggered"), this.setAttribute("aria-expanded", "false"));
304
- });
305
- ot && (this.addEventListener("click", () => {
306
- if (t(this, n)) {
307
- const e = t(this, g).current;
308
- e === "open" || e === "toggle" && !t(this, n).opened ? t(this, n).open({ trigger: this }) : (e === "close" || e === "toggle" && t(this, n).opened) && t(this, n).close();
293
+ __privateAdd(this, _PopoverButtonElement_instances);
294
+ __privateAdd(this, _popoverElement);
295
+ __privateAdd(this, _type, new CSSProperty(this, "--type", "open"));
296
+ __privateAdd(this, _popoverTriggeredListener, /* @__PURE__ */ __name((e) => {
297
+ e.target === __privateGet(this, _popoverElement) && __privateGet(this, _type).current !== "close" && this.classList.add("triggered");
298
+ }, "#popoverTriggeredListener"));
299
+ __privateAdd(this, _popoverOpenedListener, /* @__PURE__ */ __name((e) => {
300
+ e.target === __privateGet(this, _popoverElement) && __privateGet(this, _type).current !== "close" && (this.classList.add("opened"), this.setAttribute("aria-expanded", "true"));
301
+ }, "#popoverOpenedListener"));
302
+ __privateAdd(this, _popoverClosingListener, /* @__PURE__ */ __name((e) => {
303
+ e.target === __privateGet(this, _popoverElement) && __privateGet(this, _type).current !== "close" && this.classList.remove("opened");
304
+ }, "#popoverClosingListener"));
305
+ __privateAdd(this, _popoverClosedListener, /* @__PURE__ */ __name((e) => {
306
+ e.target === __privateGet(this, _popoverElement) && __privateGet(this, _type).current !== "close" && (this.classList.remove("triggered"), this.setAttribute("aria-expanded", "false"));
307
+ }, "#popoverClosedListener"));
308
+ isBrowser && (this.addEventListener("click", () => {
309
+ if (__privateGet(this, _popoverElement)) {
310
+ const type = __privateGet(this, _type).current;
311
+ type === "open" || type === "toggle" && !__privateGet(this, _popoverElement).opened ? __privateGet(this, _popoverElement).open({ trigger: this }) : (type === "close" || type === "toggle" && __privateGet(this, _popoverElement).opened) && __privateGet(this, _popoverElement).close();
309
312
  }
310
313
  }), this.addEventListener("keydown", (e) => {
311
314
  e.code === "Space" && !this.hasAttribute("keydown-disabled") && (e.preventDefault(), this.click());
312
315
  }));
313
316
  }
314
317
  get type() {
315
- return t(this, g);
318
+ return __privateGet(this, _type);
316
319
  }
317
320
  get popoverElement() {
318
- return t(this, n);
321
+ return __privateGet(this, _popoverElement);
319
322
  }
320
- changePopover(e) {
321
- var s;
322
- if (p(this, x, it).call(this), e) {
323
- let i = null;
324
- if (e === "parent") {
325
- const l = this.closest("[data-popover]");
326
- if (l)
327
- i = l;
323
+ changePopover(targetId) {
324
+ var _a;
325
+ if (__privateMethod(this, _PopoverButtonElement_instances, unlistenPopover_fn).call(this), targetId) {
326
+ let popoverElement = null;
327
+ if (targetId === "parent") {
328
+ const closestTarget = this.closest("[data-popover]");
329
+ if (closestTarget)
330
+ popoverElement = closestTarget;
328
331
  else {
329
- const d = this.getRootNode();
330
- d instanceof ShadowRoot ? i = d.host.closest("[data-popover]") : d instanceof HTMLElement && (i = d.closest("[data-popover]"));
332
+ const rootNode = this.getRootNode();
333
+ rootNode instanceof ShadowRoot ? popoverElement = rootNode.host.closest("[data-popover]") : rootNode instanceof HTMLElement && (popoverElement = rootNode.closest("[data-popover]"));
331
334
  }
332
- } else if (e === "sibling")
333
- i = (s = this.parentElement) == null ? void 0 : s.querySelector("[data-popover]");
334
- else if (e === "ancestor-child") {
335
- const l = (d) => {
336
- if (!d)
335
+ } else if (targetId === "sibling")
336
+ popoverElement = (_a = this.parentElement) == null ? void 0 : _a.querySelector("[data-popover]");
337
+ else if (targetId === "ancestor-child") {
338
+ const find = /* @__PURE__ */ __name((el) => {
339
+ if (!el)
337
340
  return null;
338
- let L = d.querySelector("[data-popover]");
339
- return !L && (d != null && d.parentElement) && (L = l(d.parentElement)), L;
340
- };
341
- i = l(this.parentElement) || null;
341
+ let founded = el.querySelector("[data-popover]");
342
+ return !founded && (el != null && el.parentElement) && (founded = find(el.parentElement)), founded;
343
+ }, "find");
344
+ popoverElement = find(this.parentElement) || null;
342
345
  } else {
343
- let l = e;
344
- if (isNaN(parseInt(l)) && (!e.startsWith(".") && !e.startsWith("[") && !e.startsWith("#") && (l = `#${e}`), i = document.querySelector(l) || this.getRootNode().querySelector(l)), !i) {
345
- const L = [...document.querySelectorAll("[data-popover-ids]")].find(
346
- (N) => {
347
- var ht;
348
- return (ht = N.getAttribute("data-popover-ids")) == null ? void 0 : ht.split(",").find((ut) => ut.trim() === e);
346
+ let selector = targetId;
347
+ if (isNaN(parseInt(selector)) && (!targetId.startsWith(".") && !targetId.startsWith("[") && !targetId.startsWith("#") && (selector = `#${targetId}`), popoverElement = document.querySelector(selector) || this.getRootNode().querySelector(selector)), !popoverElement) {
348
+ const founded = [...document.querySelectorAll("[data-popover-ids]")].find(
349
+ (el) => {
350
+ var _a2;
351
+ return (_a2 = el.getAttribute("data-popover-ids")) == null ? void 0 : _a2.split(",").find((v) => v.trim() === targetId);
349
352
  }
350
353
  );
351
- L && (i = L);
354
+ founded && (popoverElement = founded);
352
355
  }
353
356
  }
354
- i instanceof HTMLElement ? (o(this, n, i), t(this, n).addEventListener(
357
+ popoverElement instanceof HTMLElement ? (__privateSet(this, _popoverElement, popoverElement), __privateGet(this, _popoverElement).addEventListener(
355
358
  "popoverTriggered",
356
- t(this, Y)
357
- ), t(this, n).addEventListener(
359
+ __privateGet(this, _popoverTriggeredListener)
360
+ ), __privateGet(this, _popoverElement).addEventListener(
358
361
  "popoverOpened",
359
- t(this, j)
360
- ), t(this, n).addEventListener(
362
+ __privateGet(this, _popoverOpenedListener)
363
+ ), __privateGet(this, _popoverElement).addEventListener(
361
364
  "popoverClosing",
362
- t(this, J)
363
- ), t(this, n).addEventListener(
365
+ __privateGet(this, _popoverClosingListener)
366
+ ), __privateGet(this, _popoverElement).addEventListener(
364
367
  "popoverClosed",
365
- t(this, K)
366
- )) : console.warn(this, `target ${e} not found`);
368
+ __privateGet(this, _popoverClosedListener)
369
+ )) : console.warn(this, `target ${targetId} not found`);
367
370
  }
368
- p(this, x, rt).call(this, t(this, g).current);
371
+ __privateMethod(this, _PopoverButtonElement_instances, updateType_fn).call(this, __privateGet(this, _type).current);
369
372
  }
370
373
  connectedCallback() {
371
- t(this, g).subscribe((s) => {
372
- p(this, x, rt).call(this, s.current);
374
+ __privateGet(this, _type).subscribe((e) => {
375
+ __privateMethod(this, _PopoverButtonElement_instances, updateType_fn).call(this, e.current);
373
376
  }), this.hasAttribute("tabindex") || (this.tabIndex = 0), this.hasAttribute("role") || this.setAttribute("role", "button");
374
- const e = this.getAttribute("target");
375
- e && this.changePopover(e), this.isConnected && t(this, g).observe();
377
+ const targetId = this.getAttribute("target");
378
+ targetId && this.changePopover(targetId), this.isConnected && __privateGet(this, _type).observe();
376
379
  }
377
380
  disconnectedCallback() {
378
- t(this, g).unobserve(), this.removeAttribute("aria-haspopup"), this.removeAttribute("aria-expanded"), this.removeAttribute("aria-controls"), this.removeAttribute("role"), this.removeAttribute("tabindex"), p(this, x, it).call(this);
381
+ __privateGet(this, _type).unobserve(), this.removeAttribute("aria-haspopup"), this.removeAttribute("aria-expanded"), this.removeAttribute("aria-controls"), this.removeAttribute("role"), this.removeAttribute("tabindex"), __privateMethod(this, _PopoverButtonElement_instances, unlistenPopover_fn).call(this);
379
382
  }
380
- }
381
- n = new WeakMap(), g = new WeakMap(), x = new WeakSet(), it = function() {
382
- t(this, n) && (t(this, n).removeEventListener(
383
+ };
384
+ _popoverElement = new WeakMap(), _type = new WeakMap(), _PopoverButtonElement_instances = new WeakSet(), unlistenPopover_fn = /* @__PURE__ */ __name(function() {
385
+ __privateGet(this, _popoverElement) && (__privateGet(this, _popoverElement).removeEventListener(
383
386
  "popoverTriggered",
384
- t(this, Y)
385
- ), t(this, n).removeEventListener(
387
+ __privateGet(this, _popoverTriggeredListener)
388
+ ), __privateGet(this, _popoverElement).removeEventListener(
386
389
  "popoverOpened",
387
- t(this, j)
388
- ), t(this, n).removeEventListener(
390
+ __privateGet(this, _popoverOpenedListener)
391
+ ), __privateGet(this, _popoverElement).removeEventListener(
389
392
  "popoverClosing",
390
- t(this, J)
391
- ), t(this, n).removeEventListener(
393
+ __privateGet(this, _popoverClosingListener)
394
+ ), __privateGet(this, _popoverElement).removeEventListener(
392
395
  "popoverClosed",
393
- t(this, K)
396
+ __privateGet(this, _popoverClosedListener)
394
397
  ));
395
- }, Y = new WeakMap(), j = new WeakMap(), J = new WeakMap(), K = new WeakMap(), rt = function(e) {
396
- t(this, n) instanceof _ && (e !== "close" ? (this.setAttribute("aria-haspopup", "true"), this.setAttribute(
398
+ }, "#unlistenPopover"), _popoverTriggeredListener = new WeakMap(), _popoverOpenedListener = new WeakMap(), _popoverClosingListener = new WeakMap(), _popoverClosedListener = new WeakMap(), updateType_fn = /* @__PURE__ */ __name(function(value) {
399
+ __privateGet(this, _popoverElement) instanceof PopoverElement && (value !== "close" ? (this.setAttribute("aria-haspopup", "true"), this.setAttribute(
397
400
  "aria-expanded",
398
- t(this, n).opened ? "true" : "false"
399
- ), this.setAttribute("aria-controls", t(this, n).id || "")) : (this.removeAttribute("aria-haspopup"), this.removeAttribute("aria-expanded"), this.removeAttribute("aria-controls")));
400
- };
401
- ot && !customElements.get("e-popover-button") && customElements.define("e-popover-button", vt);
401
+ __privateGet(this, _popoverElement).opened ? "true" : "false"
402
+ ), this.setAttribute("aria-controls", __privateGet(this, _popoverElement).id || "")) : (this.removeAttribute("aria-haspopup"), this.removeAttribute("aria-expanded"), this.removeAttribute("aria-controls")));
403
+ }, "#updateType"), __name(_PopoverButtonElement, "PopoverButtonElement");
404
+ let PopoverButtonElement = _PopoverButtonElement;
405
+ isBrowser && !customElements.get("e-popover-button") && customElements.define("e-popover-button", PopoverButtonElement);
402
406
  export {
403
- vt as PopoverButtonElement,
404
- _ as PopoverElement
407
+ PopoverButtonElement,
408
+ PopoverElement
405
409
  };