@pnx-mixtape/mxds 0.1.0-rc.4 → 0.1.0-rc.6

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 (236) hide show
  1. package/.claude/skills/create-mxds-component/SKILL.md +77 -0
  2. package/DESIGN.md +595 -0
  3. package/README.md +2 -3
  4. package/dist/build/accordion.entry.js +2 -1
  5. package/dist/build/autocomplete.entry.js +1 -1
  6. package/dist/build/back-to-top.css +1 -0
  7. package/dist/build/back-to-top.entry.js +1 -0
  8. package/dist/build/base.css +1 -1
  9. package/dist/build/button.css +1 -1
  10. package/dist/build/card.css +1 -1
  11. package/dist/build/chunks/Accordion-Bqe8vTNR.js +44 -0
  12. package/dist/build/chunks/AccordionGroup-BYtoAFxg.js +47 -0
  13. package/dist/build/chunks/AccordionMobile-D517oXYZ.js +26 -0
  14. package/dist/build/chunks/Autocomplete-kRo8RNbC.js +135 -0
  15. package/dist/build/chunks/BackToTop-4M-Wl7z3.js +64 -0
  16. package/dist/build/chunks/ClosableAlert-CZ114JsL.js +55 -0
  17. package/dist/build/chunks/CookieConsent-wd8gQ2Oe.js +18 -0
  18. package/dist/build/chunks/Dialog-DoYcGqhW.js +48 -0
  19. package/dist/build/chunks/DropMenu-CSTZq0Zt.js +68 -0
  20. package/dist/build/chunks/FeedbackForm-BsL7fv8s.js +64 -0
  21. package/dist/build/chunks/Gallery-DqJPujX5.js +165 -0
  22. package/dist/build/chunks/GlobalToggle-7H3F1Wvc.js +82 -0
  23. package/dist/build/chunks/InPageNavigation-D7m3IN89.js +86 -0
  24. package/dist/build/chunks/Navigation-CRModT40.js +142 -0
  25. package/dist/build/chunks/Popover-CiTAftNU.js +30 -0
  26. package/dist/build/chunks/Sticky-C1H8MNqK.js +51 -0
  27. package/dist/build/chunks/Tabs-BJD3kABL.js +160 -0
  28. package/dist/build/chunks/Translate-yAgySwet.js +46 -0
  29. package/dist/build/chunks/cookie-compliance-CG6x-TcV.js +119 -0
  30. package/dist/build/chunks/enums-BrHxPZZ_.js +36 -0
  31. package/dist/build/chunks/polyfills-D-qh1a_2.js +33 -0
  32. package/dist/build/chunks/utilities-B9mNRs7V.js +255 -0
  33. package/dist/build/content-block.css +1 -1
  34. package/dist/build/cookie-consent.entry.js +1 -1
  35. package/dist/build/dialog.entry.js +1 -1
  36. package/dist/build/drop-menu.entry.js +1 -1
  37. package/dist/build/elements.js +147 -1
  38. package/dist/build/feedback-form.css +1 -0
  39. package/dist/build/feedback-form.entry.js +1 -0
  40. package/dist/build/filters.entry.js +145 -1
  41. package/dist/build/form.css +1 -1
  42. package/dist/build/gallery.entry.js +1 -1
  43. package/dist/build/global-alert.entry.js +1 -1
  44. package/dist/build/header.css +1 -1
  45. package/dist/build/header.entry.js +1 -1
  46. package/dist/build/icon.css +1 -1
  47. package/dist/build/in-page-navigation.entry.js +1 -1
  48. package/dist/build/navigation.css +1 -1
  49. package/dist/build/navigation.entry.js +1 -1
  50. package/dist/build/pagination.css +1 -1
  51. package/dist/build/popover.entry.js +1 -1
  52. package/dist/build/react.js +2291 -1
  53. package/dist/build/side-navigation.css +1 -1
  54. package/dist/build/sidebar.css +1 -1
  55. package/dist/build/sticky.entry.js +1 -1
  56. package/dist/build/tabs.entry.js +1 -1
  57. package/dist/build/translate.css +1 -0
  58. package/dist/build/translate.entry.js +1 -0
  59. package/dist/build/utility-list.entry.js +53 -1
  60. package/dist/types/Component/BackToTop/BackToTop.d.ts +20 -0
  61. package/dist/types/Component/BackToTop/BackToTop.d.ts.map +1 -0
  62. package/dist/types/Component/BackToTop/Elements/BackToTop.d.ts +27 -0
  63. package/dist/types/Component/BackToTop/Elements/BackToTop.d.ts.map +1 -0
  64. package/dist/types/Component/BackToTop/back-to-top.entry.d.ts +2 -0
  65. package/dist/types/Component/BackToTop/back-to-top.entry.d.ts.map +1 -0
  66. package/dist/types/Component/DropMenu/DropMenu.d.ts +2 -1
  67. package/dist/types/Component/DropMenu/DropMenu.d.ts.map +1 -1
  68. package/dist/types/Component/Navigation/Elements/Navigation.d.ts +2 -3
  69. package/dist/types/Component/Navigation/Elements/Navigation.d.ts.map +1 -1
  70. package/dist/types/Component/SideNavigation/Components/SideNavigationTree.d.ts +3 -3
  71. package/dist/types/Component/SideNavigation/Components/SideNavigationTree.d.ts.map +1 -1
  72. package/dist/types/Component/SideNavigation/SideNavigation.d.ts +3 -1
  73. package/dist/types/Component/SideNavigation/SideNavigation.d.ts.map +1 -1
  74. package/dist/types/Component/Tabs/Components/TabDropMenu.d.ts.map +1 -1
  75. package/dist/types/Component/Tabs/Elements/Tabs.d.ts.map +1 -1
  76. package/dist/types/Component/Translate/Elements/Translate.d.ts +23 -0
  77. package/dist/types/Component/Translate/Elements/Translate.d.ts.map +1 -0
  78. package/dist/types/Component/Translate/Translate.d.ts +37 -0
  79. package/dist/types/Component/Translate/Translate.d.ts.map +1 -0
  80. package/dist/types/Component/Translate/languages.d.ts +11 -0
  81. package/dist/types/Component/Translate/languages.d.ts.map +1 -0
  82. package/dist/types/Component/Translate/translate.entry.d.ts +2 -0
  83. package/dist/types/Component/Translate/translate.entry.d.ts.map +1 -0
  84. package/dist/types/Form/FeedbackForm/Elements/FeedbackForm.d.ts +37 -0
  85. package/dist/types/Form/FeedbackForm/Elements/FeedbackForm.d.ts.map +1 -0
  86. package/dist/types/Form/FeedbackForm/FeedbackForm.d.ts +36 -0
  87. package/dist/types/Form/FeedbackForm/FeedbackForm.d.ts.map +1 -0
  88. package/dist/types/Form/FeedbackForm/feedback-form.entry.d.ts +2 -0
  89. package/dist/types/Form/FeedbackForm/feedback-form.entry.d.ts.map +1 -0
  90. package/dist/types/Utility/Elements/google-translate-widget.d.ts +91 -0
  91. package/dist/types/Utility/Elements/google-translate-widget.d.ts.map +1 -0
  92. package/dist/types/Utility/utilities.d.ts +2 -0
  93. package/dist/types/Utility/utilities.d.ts.map +1 -1
  94. package/dist/types/elements.d.ts +3 -0
  95. package/dist/types/elements.d.ts.map +1 -1
  96. package/dist/types/enums.d.ts +3 -1
  97. package/dist/types/enums.d.ts.map +1 -1
  98. package/dist/types/react.d.ts +3 -0
  99. package/dist/types/react.d.ts.map +1 -1
  100. package/dist/types/tokens.d.ts +1 -0
  101. package/dist/types/tokens.d.ts.map +1 -1
  102. package/docs/API.md +1215 -0
  103. package/docs/CSSGuidelines.md +893 -0
  104. package/docs/CodeQuality.md +940 -0
  105. package/docs/ComponentArchitecture.md +714 -0
  106. package/docs/Contributing.md +626 -0
  107. package/docs/MemoryManagement.md +598 -0
  108. package/docs/Migrations.md +6 -0
  109. package/docs/README.md +100 -0
  110. package/docs/Security.md +444 -0
  111. package/docs/Testing.md +739 -0
  112. package/docs/Troubleshooting.md +674 -0
  113. package/package.json +9 -6
  114. package/src/Atom/Button/Button.tsx +1 -1
  115. package/src/Atom/Button/__snapshots__/Button.stories.tsx.snap +2 -2
  116. package/src/Atom/Button/_buttons.css +1 -0
  117. package/src/Atom/Icon/README.md +1 -1
  118. package/src/Atom/Icon/_icon.css +1 -0
  119. package/src/Atom/Icon/images/thumb.svg +1 -0
  120. package/src/Atom/Link/_links.css +1 -0
  121. package/src/Atom/Media/__snapshots__/Media.stories.ts.snap +4 -9
  122. package/src/Atom/Media/media.twig +4 -5
  123. package/src/Component/BackToTop/BackToTop.stories.ts +127 -0
  124. package/src/Component/BackToTop/BackToTop.stories.tsx +53 -0
  125. package/src/Component/BackToTop/BackToTop.tsx +120 -0
  126. package/src/Component/BackToTop/Elements/BackToTop.ts +119 -0
  127. package/src/Component/BackToTop/README.md +164 -0
  128. package/src/Component/BackToTop/__snapshots__/BackToTop.stories.ts.snap +24 -0
  129. package/src/Component/BackToTop/__snapshots__/BackToTop.stories.tsx.snap +3 -0
  130. package/src/Component/BackToTop/back-to-top.css +70 -0
  131. package/src/Component/BackToTop/back-to-top.entry.js +1 -0
  132. package/src/Component/BackToTop/back-to-top.twig +26 -0
  133. package/src/Component/Card/Components/CardContent.tsx +1 -1
  134. package/src/Component/Card/Components/CardMedia.tsx +1 -1
  135. package/src/Component/Card/__snapshots__/Card.stories.tsx.snap +3 -3
  136. package/src/Component/Card/card.css +1 -1
  137. package/src/Component/Carousel/Carousel.stories.ts +66 -36
  138. package/src/Component/Carousel/__snapshots__/Carousel.stories.tsx.snap +5 -5
  139. package/src/Component/ContentBlock/Components/ContentBlockMedia.tsx +1 -1
  140. package/src/Component/ContentBlock/content-block.css +1 -1
  141. package/src/Component/DropMenu/DropMenu.stories.ts +21 -2
  142. package/src/Component/DropMenu/DropMenu.tsx +14 -4
  143. package/src/Component/DropMenu/__snapshots__/DropMenu.stories.ts.snap +3 -3
  144. package/src/Component/DropMenu/__snapshots__/DropMenu.stories.tsx.snap +2 -2
  145. package/src/Component/DropMenu/drop-menu.twig +7 -1
  146. package/src/Component/HeroBanner/__snapshots__/HeroBanner.stories.tsx.snap +1 -1
  147. package/src/Component/InPageNavigation/__snapshots__/InPageNavigation.stories.ts.snap +48 -13
  148. package/src/Component/InPageNavigation/in-page-navigation.twig +4 -6
  149. package/src/Component/ListItem/Components/ListItemMedia.tsx +1 -1
  150. package/src/Component/Navigation/Elements/Navigation.ts +25 -29
  151. package/src/Component/Navigation/README.md +11 -10
  152. package/src/Component/Navigation/__snapshots__/Navigation.stories.ts.snap +8 -8
  153. package/src/Component/Navigation/_navigation-dropdown.css +9 -11
  154. package/src/Component/Navigation/_navigation-mega.css +5 -11
  155. package/src/Component/Navigation/_navigation.css +5 -3
  156. package/src/Component/Navigation/menu.twig +1 -1
  157. package/src/Component/Navigation/navigation.twig +0 -1
  158. package/src/Component/Pagination/Pagination.stories.ts +57 -27
  159. package/src/Component/Pagination/pagination.css +16 -7
  160. package/src/Component/Popover/__snapshots__/Popover.stories.tsx.snap +3 -3
  161. package/src/Component/SideNavigation/Components/SideNavigationTree.tsx +68 -24
  162. package/src/Component/SideNavigation/README.md +78 -32
  163. package/src/Component/SideNavigation/SideNavigation.stories.ts +41 -2
  164. package/src/Component/SideNavigation/SideNavigation.stories.tsx +31 -0
  165. package/src/Component/SideNavigation/SideNavigation.tsx +13 -3
  166. package/src/Component/SideNavigation/__snapshots__/SideNavigation.stories.ts.snap +87 -3
  167. package/src/Component/SideNavigation/__snapshots__/SideNavigation.stories.tsx.snap +2 -0
  168. package/src/Component/SideNavigation/side-navigation.css +3 -3
  169. package/src/Component/SideNavigation/side-navigation.twig +10 -3
  170. package/src/Component/Tabs/Components/TabDropMenu.tsx +7 -1
  171. package/src/Component/Tabs/Elements/Tabs.ts +13 -3
  172. package/src/Component/Tabs/Tabs.stories.ts +33 -12
  173. package/src/Component/Tabs/Tabs.stories.tsx +28 -14
  174. package/src/Component/Tabs/__snapshots__/Tabs.stories.ts.snap +3 -3
  175. package/src/Component/Tabs/__snapshots__/Tabs.stories.tsx.snap +2 -2
  176. package/src/Component/Translate/Elements/Translate.ts +76 -0
  177. package/src/Component/Translate/README.md +285 -0
  178. package/src/Component/Translate/Translate.stories.ts +87 -0
  179. package/src/Component/Translate/Translate.stories.tsx +77 -0
  180. package/src/Component/Translate/Translate.tsx +213 -0
  181. package/src/Component/Translate/__snapshots__/Translate.stories.ts.snap +18 -0
  182. package/src/Component/Translate/__snapshots__/Translate.stories.tsx.snap +3 -0
  183. package/src/Component/Translate/languages.ts +39 -0
  184. package/src/Component/Translate/translate.css +62 -0
  185. package/src/Component/Translate/translate.entry.js +1 -0
  186. package/src/Component/Translate/translate.twig +44 -0
  187. package/src/Form/Autocomplete/Autocomplete.stories.tsx +2 -1
  188. package/src/Form/FeedbackForm/Elements/FeedbackForm.ts +122 -0
  189. package/src/Form/FeedbackForm/FeedbackForm.stories.ts +99 -0
  190. package/src/Form/FeedbackForm/FeedbackForm.stories.tsx +73 -0
  191. package/src/Form/FeedbackForm/FeedbackForm.tsx +196 -0
  192. package/src/Form/FeedbackForm/README.md +233 -0
  193. package/src/Form/FeedbackForm/__snapshots__/FeedbackForm.stories.ts.snap +125 -0
  194. package/src/Form/FeedbackForm/__snapshots__/FeedbackForm.stories.tsx.snap +5 -0
  195. package/src/Form/FeedbackForm/feedback-form.css +74 -0
  196. package/src/Form/FeedbackForm/feedback-form.entry.js +1 -0
  197. package/src/Form/FeedbackForm/feedback-form.twig +80 -0
  198. package/src/Form/form.css +17 -19
  199. package/src/Introduction.mdx +1 -1
  200. package/src/Layout/Footer/__snapshots__/Footer.stories.ts.snap +3 -3
  201. package/src/Layout/Header/Components/GlobalToggle.tsx +1 -1
  202. package/src/Layout/Header/Header.stories.ts +53 -48
  203. package/src/Layout/Header/Header.stories.tsx +35 -22
  204. package/src/Layout/Header/Header.tsx +2 -2
  205. package/src/Layout/Header/__snapshots__/Header.stories.ts.snap +18 -14
  206. package/src/Layout/Header/__snapshots__/Header.stories.tsx.snap +2 -2
  207. package/src/Layout/Header/_toggles.css +7 -7
  208. package/src/Layout/Page/__snapshots__/Page.stories.tsx.snap +1 -1
  209. package/src/Layout/Sidebar/sidebar.css +10 -3
  210. package/src/Utility/Elements/google-translate-widget.ts +293 -0
  211. package/src/Utility/global.d.ts +4 -0
  212. package/src/Utility/utilities.ts +2 -0
  213. package/src/_custom-media.css +2 -0
  214. package/src/elements.ts +3 -0
  215. package/src/enums.ts +2 -0
  216. package/src/react.ts +3 -0
  217. package/src/tokens.js +1 -0
  218. package/dist/build/chunks/Accordion-GN0sME4W.js +0 -1
  219. package/dist/build/chunks/AccordionGroup-Bzqp5__q.js +0 -1
  220. package/dist/build/chunks/AccordionMobile-DG5jSe8Q.js +0 -1
  221. package/dist/build/chunks/Autocomplete-B4RtkAyh.js +0 -1
  222. package/dist/build/chunks/ClosableAlert-DEhj8Nxm.js +0 -1
  223. package/dist/build/chunks/CookieConsent-BkCMRVST.js +0 -1
  224. package/dist/build/chunks/Dialog-Haahn-Yn.js +0 -1
  225. package/dist/build/chunks/DropMenu-1baQc8Yc.js +0 -1
  226. package/dist/build/chunks/Gallery-D8NGXy2Q.js +0 -1
  227. package/dist/build/chunks/GlobalToggle-B52fdBQu.js +0 -1
  228. package/dist/build/chunks/InPageNavigation-Dyn2TR-N.js +0 -1
  229. package/dist/build/chunks/Navigation-hOrfLq7h.js +0 -1
  230. package/dist/build/chunks/Popover-Cxg-s5Jn.js +0 -1
  231. package/dist/build/chunks/Sticky-BGCuuEJK.js +0 -1
  232. package/dist/build/chunks/Tabs-DYy1YTdU.js +0 -15
  233. package/dist/build/chunks/cookie-compliance-Bbm-0vpj.js +0 -1
  234. package/dist/build/chunks/enums-DLV_1NAf.js +0 -1
  235. package/dist/build/chunks/polyfills-C7pRt54M.js +0 -1
  236. package/dist/build/chunks/utilities-_Bq3TxAQ.js +0 -1
@@ -0,0 +1,255 @@
1
+ import { n as e } from "./cookie-compliance-CG6x-TcV.js";
2
+ //#region src/Utility/Elements/disclosure-widget.ts
3
+ var t = class {
4
+ options;
5
+ context;
6
+ trigger;
7
+ element;
8
+ id;
9
+ isOpen;
10
+ attached;
11
+ constructor(e, t, n, r = document) {
12
+ if (!e) throw Error("toggle is required.");
13
+ if (!t) throw Error("element is required.");
14
+ let i = {
15
+ attribute: "inert",
16
+ shouldPreventDefault: !0,
17
+ setInitialAttribute: !0,
18
+ clickEvent: "click"
19
+ };
20
+ this.options = {
21
+ ...i,
22
+ ...n
23
+ }, this.context = r || document, this.trigger = e, this.element = t, this.id = this.element.id || this.generatedId();
24
+ }
25
+ init = () => {
26
+ if (Object.prototype.hasOwnProperty.call(this.trigger, "disclosureWidget")) return;
27
+ let { attribute: e, setInitialAttribute: t } = this.options;
28
+ this.trigger.disclosureWidget = this, t && this.element.setAttribute(e, ""), this.attach();
29
+ };
30
+ handleToggle = () => {
31
+ let { attribute: e, setInitialAttribute: t } = this.options;
32
+ this.element.toggleAttribute(e);
33
+ let n = this.element.hasAttribute(e);
34
+ this.isOpen = t ? !n : n, this.trigger.setAttribute("aria-expanded", String(this.isOpen));
35
+ let r = new CustomEvent("disclosure-toggle", {
36
+ bubbles: !0,
37
+ cancelable: !0,
38
+ detail: {
39
+ isOpen: this.isOpen,
40
+ id: this.id,
41
+ options: this.options,
42
+ target: this.element
43
+ }
44
+ });
45
+ this.trigger.dispatchEvent(r);
46
+ };
47
+ handleMouse = (e) => {
48
+ let { currentTarget: t, type: n, relatedTarget: r } = e;
49
+ if (n === "mouseover" || n === "mouseout") {
50
+ let e = this.trigger.parentNode;
51
+ if (e !== t || e.contains(r)) return;
52
+ } else if (this.trigger !== t) return;
53
+ let { shouldPreventDefault: i } = this.options;
54
+ this.handleToggle(), i && (e.preventDefault(), e.stopPropagation());
55
+ };
56
+ handleKeyboard = (e) => {
57
+ let { key: t, target: n } = e;
58
+ if (this.trigger !== n) return;
59
+ let { isOpen: r } = this, { shouldPreventDefault: i } = this.options;
60
+ switch (t) {
61
+ case "ArrowDown":
62
+ case "Enter":
63
+ r || this.handleToggle(), i && (e.preventDefault(), e.stopPropagation());
64
+ break;
65
+ case "ArrowUp":
66
+ case "Escape": r && this.handleToggle(), i && (e.preventDefault(), e.stopPropagation());
67
+ }
68
+ };
69
+ attach = () => {
70
+ if (this.attached) return;
71
+ let { clickEvent: e } = this.options;
72
+ if (e === "mouseover") {
73
+ let e = this.trigger.parentNode;
74
+ e.addEventListener("mouseover", this.handleMouse), e.addEventListener("mouseout", this.handleMouse);
75
+ } else this.trigger.addEventListener("click", this.handleMouse);
76
+ this.trigger.addEventListener("keydown", this.handleKeyboard), this.trigger.setAttribute("aria-expanded", "false"), this.trigger.hasAttribute("aria-controls") || this.trigger.setAttribute("aria-controls", this.id), this.attached = !0;
77
+ };
78
+ detach = () => {
79
+ if (!this.attached) return;
80
+ this.isOpen && this.handleToggle();
81
+ let { clickEvent: e } = this.options;
82
+ if (e === "mouseover") {
83
+ let e = this.trigger.parentNode;
84
+ e.removeEventListener("mouseover", this.handleMouse), e.removeEventListener("mouseout", this.handleMouse);
85
+ } else this.trigger.removeEventListener("click", this.handleMouse);
86
+ this.trigger.removeEventListener("keydown", this.handleKeyboard), this.trigger.removeAttribute("aria-expanded"), this.attached = !1;
87
+ };
88
+ generatedId = () => {
89
+ let e = this.trigger?.textContent?.trim();
90
+ return e ? o(e) : "";
91
+ };
92
+ }, n = "https://translate.google.com/translate_a/element.js?cb=translateInit", r = "googtrans", i = "mx-translate-google-element", a = class {
93
+ root;
94
+ config;
95
+ controller;
96
+ pendingCode;
97
+ noticeEl;
98
+ blockedNoticeEl;
99
+ constructor(e, t) {
100
+ this.root = e, this.config = {
101
+ defaultLanguage: t.defaultLanguage,
102
+ blockedPaths: t.blockedPaths ?? [],
103
+ scriptUrl: t.scriptUrl ?? n,
104
+ storageKey: t.storageKey ?? r,
105
+ updateTriggerLabel: t.updateTriggerLabel ?? !0,
106
+ notice: t.notice,
107
+ onOpen: t.onOpen,
108
+ onClose: t.onClose,
109
+ onLanguageChange: t.onLanguageChange
110
+ };
111
+ }
112
+ init() {
113
+ this.controller = new AbortController(), window.addEventListener("pageshow", this.handlePageshow, { signal: this.controller.signal });
114
+ let e = this.getStoredLanguage();
115
+ e && e !== this.config.defaultLanguage && (this.updateActiveItem(e), this.config.updateTriggerLabel && this.updateTriggerLabel(e), this.updateNotice(e), this.isPathBlocked() || (this.pendingCode = e, this.loadScript().then(() => this.driveSelect(e)).catch(() => {})));
116
+ }
117
+ destroy() {
118
+ this.controller?.abort(), this.noticeEl?.remove(), this.blockedNoticeEl?.remove();
119
+ }
120
+ setLanguage(e) {
121
+ this.updateActiveItem(e), this.config.updateTriggerLabel && this.updateTriggerLabel(e), this.updateNotice(e), !this.isPathBlocked() && (this.persist(e), this.pendingCode = e, this.loadScript().then(() => this.driveSelect(e)).catch(() => {}), this.config.onLanguageChange?.(e));
122
+ }
123
+ getCurrentLanguage() {
124
+ return this.getStoredLanguage() ?? this.config.defaultLanguage;
125
+ }
126
+ isPathBlocked(e = window.location.pathname) {
127
+ return this.config.blockedPaths.some((t) => e.startsWith(t));
128
+ }
129
+ getStoredLanguage() {
130
+ try {
131
+ return window.localStorage.getItem(this.config.storageKey)?.split("/")[2] || null;
132
+ } catch {
133
+ return null;
134
+ }
135
+ }
136
+ persist(e) {
137
+ try {
138
+ window.localStorage.setItem(this.config.storageKey, `/${this.config.defaultLanguage}/${e}`);
139
+ } catch {}
140
+ }
141
+ getLanguageItem(e) {
142
+ return this.root.querySelector(`[data-language="${e}"]`);
143
+ }
144
+ updateActiveItem(e) {
145
+ this.root.querySelectorAll("[data-language]").forEach((t) => {
146
+ t.dataset.language === e ? t.setAttribute("aria-current", "true") : t.removeAttribute("aria-current");
147
+ });
148
+ }
149
+ updateTriggerLabel(e) {
150
+ let t = this.root.querySelector("[popovertarget]");
151
+ if (!t) return;
152
+ let n = t.dataset.label || "Language", r = this.getLanguageItem(e)?.textContent?.trim() ?? e;
153
+ t.setAttribute("aria-label", `${n}: ${r}, ${e.toUpperCase()}`);
154
+ let i = t.querySelector(".mx-translate__code");
155
+ i && (i.textContent = e.toUpperCase());
156
+ }
157
+ createNotice() {
158
+ if (!this.config.notice || this.noticeEl) return;
159
+ let { anchorSelector: e, position: t, content: n, blockedContent: r } = this.config.notice, i = e ? document.querySelector(e) : document.body;
160
+ if (!i) return;
161
+ let a = t ?? (e ? "afterend" : "afterbegin");
162
+ this.noticeEl = l(`<div class="mx-global-alert mx-global-alert--light mx-page mx-translate__notice" role="status" aria-live="polite" aria-atomic="true" data-translate-notice hidden><div class="mx-global-alert__inner"><div class="mx-global-alert__content">${n}</div></div></div>`), this.noticeEl && i.insertAdjacentElement(a, this.noticeEl), r && (this.blockedNoticeEl = l(`<div class="mx-global-alert mx-global-alert--critical mx-page mx-translate__notice" role="alert" aria-live="assertive" aria-atomic="true" data-translate-notice-blocked hidden><div class="mx-global-alert__inner"><div class="mx-global-alert__content">${r}</div></div></div>`), this.blockedNoticeEl && i.insertAdjacentElement(a, this.blockedNoticeEl));
163
+ }
164
+ updateNotice(e) {
165
+ if (!this.config.notice) return;
166
+ this.createNotice();
167
+ let t = e !== this.config.defaultLanguage, n = this.isPathBlocked();
168
+ this.noticeEl?.toggleAttribute("hidden", !(t && !n)), this.blockedNoticeEl?.toggleAttribute("hidden", !(t && n));
169
+ }
170
+ loadScript() {
171
+ return window.mxTranslateScriptPromise || (window.mxTranslateScriptPromise = new Promise((e, t) => {
172
+ window.translateInit = () => {
173
+ new window.google.translate.TranslateElement({
174
+ pageLanguage: this.config.defaultLanguage,
175
+ autoDisplay: !1
176
+ }, this.getMountPoint()), e();
177
+ };
178
+ let n = document.createElement("script");
179
+ n.src = this.config.scriptUrl, n.addEventListener("error", () => t(/* @__PURE__ */ Error("Failed to load Google Translate"))), document.body.appendChild(n);
180
+ })), window.mxTranslateScriptPromise;
181
+ }
182
+ getMountPoint() {
183
+ let e = document.getElementById(i);
184
+ return e || (e = document.createElement("div"), e.id = i, e.style.display = "none", document.body.appendChild(e)), i;
185
+ }
186
+ waitForComboBoxOption(e, t = 20) {
187
+ return new Promise((n) => {
188
+ let r = (t) => {
189
+ let i = document.querySelector(".goog-te-combo");
190
+ i?.querySelector(`option[value="${e}"]`) ? n(i) : t <= 0 ? n(null) : setTimeout(() => r(t - 1), 100);
191
+ };
192
+ r(t);
193
+ });
194
+ }
195
+ async driveSelect(e) {
196
+ let t = await this.waitForComboBoxOption(e);
197
+ this.pendingCode === e && t && (t.value = e, t.dispatchEvent(new Event("change")));
198
+ }
199
+ handlePageshow = (e) => {
200
+ if (!e.persisted) return;
201
+ window.mxTranslateScriptPromise = void 0;
202
+ let t = this.getStoredLanguage();
203
+ t && t !== this.config.defaultLanguage && !this.isPathBlocked() && (this.pendingCode = t, this.loadScript().then(() => this.driveSelect(t)).catch(() => {}));
204
+ };
205
+ }, o = (t, n = 20) => {
206
+ if (!e.notEmpty(t)) return "";
207
+ let r = t.toLowerCase().trim().replace(/\s+/g, "-").replace(/[^-a-z0-9]/g, "").replace(/[\n\r]+|[\s]{2,}/g, "");
208
+ return [...[
209
+ ,
210
+ ,
211
+ ,
212
+ ,
213
+ ,
214
+ ,
215
+ ].keys()].forEach(() => {
216
+ r.charAt(0).match(/[a-z]/g) || (r = r.substring(1));
217
+ }), e.integer(n, 1) && (r = r.substring(0, n)), r;
218
+ }, s = (t) => e.notEmpty(t) ? t.trim().replace(/(?:^\w|[A-Z]|\b\w|\s+)/g, (e, t) => +e == 0 ? "" : t === 0 ? e.toLowerCase() : e.toUpperCase()).replace(/[^\w\s]/gi, "") : "", c = (e, t) => {
219
+ if (typeof e != "string" || !e || !Array.isArray(t)) return !1;
220
+ try {
221
+ let { hostname: n } = new URL(e);
222
+ return window.location.hostname === n || t.includes(n);
223
+ } catch {
224
+ return !1;
225
+ }
226
+ }, l = (e) => {
227
+ try {
228
+ return new DOMParser().parseFromString(e, "text/html").body.firstElementChild;
229
+ } catch {
230
+ return null;
231
+ }
232
+ }, u = (e, t = !1, n = !1) => {
233
+ let r = new ResizeObserver((i) => {
234
+ i.forEach(({ contentBoxSize: i, borderBoxSize: a }) => {
235
+ let [{ inlineSize: o, blockSize: s }] = n ? i : a;
236
+ e.style.setProperty("--inline-size", `${o.toFixed(1)}px`), e.style.setProperty("--block-size", `${s.toFixed(1)}px`), t && r.unobserve(e);
237
+ });
238
+ });
239
+ r.observe(e);
240
+ }, d = (e, t, n, r = []) => {
241
+ let { target: i, clientY: a, clientX: o } = e, s = i instanceof HTMLOptionElement || i instanceof HTMLSelectElement;
242
+ if ((r?.filter((e) => e === i || e.contains(i))).length || s) return;
243
+ let c = new IntersectionObserver(([{ boundingClientRect: e }]) => {
244
+ let { top: t, height: r, width: i, left: s } = e;
245
+ t <= a && a <= t + r && s <= o && o <= s + i || n(), c.disconnect();
246
+ });
247
+ c.observe(t);
248
+ }, f = (e, t) => {
249
+ let { key: n } = e;
250
+ n === "Escape" && t();
251
+ }, p = (e, t) => {
252
+ Object.hasOwn(window, "Drupal") && Object.hasOwn(Drupal, "behaviors") ? Drupal.behaviors[t] = { attach: e } : window.addEventListener("DOMContentLoaded", e.bind(document, document));
253
+ };
254
+ //#endregion
255
+ export { c as a, s as c, d as i, a as l, u as n, p as o, f as r, o as s, l as t, t as u };
@@ -1 +1 @@
1
- @layer popover-polyfill,design-system.defaults,design-system.atoms,design-system.layout,design-system.utilities;@layer design-system.components{.mx-content-block{gap:var(--content-block-gap,var(--gap));display:grid;& .mx-link-list{inline-size:100%}}.mx-content-block__media{inline-size:100%;margin:auto;display:grid;position:relative;& img{aspect-ratio:var(--ratio);border-radius:var(--border-radius);object-fit:cover;display:block}& .mx-skeleton--bg{aspect-ratio:var(--ratio)}}}
1
+ @layer popover-polyfill,design-system.defaults,design-system.atoms,design-system.layout,design-system.utilities;@layer design-system.components{.mx-content-block{gap:var(--content-block-gap,var(--gap));display:grid;& .mx-link-list{inline-size:100%}}.mx-content-block__media{inline-size:100%;margin:auto;display:grid;position:relative;& img{aspect-ratio:var(--ratio);border-radius:var(--border-radius);object-fit:cover;display:block}& .skeleton--bg{aspect-ratio:var(--ratio)}}}
@@ -1 +1 @@
1
- import"./chunks/CookieConsent-BkCMRVST.js";
1
+ import "./chunks/CookieConsent-wd8gQ2Oe.js";
@@ -1 +1 @@
1
- import"./chunks/Dialog-Haahn-Yn.js";
1
+ import "./chunks/Dialog-DoYcGqhW.js";
@@ -1 +1 @@
1
- import"./chunks/DropMenu-1baQc8Yc.js";
1
+ import "./chunks/DropMenu-CSTZq0Zt.js";
@@ -1 +1,147 @@
1
- import{n as e,t}from"./chunks/cookie-compliance-Bbm-0vpj.js";import{a as n,c as r,i,l as a,n as o,o as s,r as c,s as l,t as u}from"./chunks/utilities-_Bq3TxAQ.js";import{n as d,t as f}from"./chunks/Navigation-hOrfLq7h.js";import{t as p}from"./chunks/GlobalToggle-B52fdBQu.js";import{t as m}from"./chunks/Autocomplete-B4RtkAyh.js";import{t as h}from"./chunks/DropMenu-1baQc8Yc.js";import{t as g}from"./chunks/Tabs-DYy1YTdU.js";import{t as _}from"./chunks/Sticky-BGCuuEJK.js";import{t as v}from"./chunks/InPageNavigation-Dyn2TR-N.js";import{t as y}from"./chunks/ClosableAlert-DEhj8Nxm.js";import{n as b,t as x}from"./chunks/Gallery-D8NGXy2Q.js";import{t as S}from"./chunks/Dialog-Haahn-Yn.js";import{t as C}from"./chunks/Accordion-GN0sME4W.js";import{t as w}from"./chunks/AccordionMobile-DG5jSe8Q.js";import{t as T}from"./chunks/CookieConsent-BkCMRVST.js";import{t as E}from"./chunks/AccordionGroup-Bzqp5__q.js";var D=class e{el;callback;controller;observer;fallbackBtn;errorMsg;constructor(e,t){this.el=e,this.callback=t,this.fallbackBtn=this.el.querySelector(`[data-load-fallback]`),this.errorMsg=this.el.querySelector(`[data-load-error]`),this.controller=new AbortController}init=()=>{this.observer=new IntersectionObserver(e=>{e.forEach(({isIntersecting:e})=>{e&&this.load().catch(e=>this.handleError(e))})}),this.observer.observe(this.el);let{signal:e}=this.controller;this.fallbackBtn?.addEventListener(`click`,this.handleClick,{signal:e})};load=async()=>{try{await this.callback()}catch(e){this.handleError(e)}finally{this.destroy()}};destroy=()=>{this.observer.disconnect(),this.controller.abort()};handleClick=()=>{this.load().catch(e=>this.handleError(e))};handleError=e=>{this.errorMsg?.removeAttribute(`hidden`)};static create=(t,n)=>{Object.hasOwn(window,`once`)&&window.once(`intersection-loader`,t)?.forEach(t=>{new e(t,n).init()})}},O=class e{el;callback;controller;breakpoint;options;fallbackBtn;errorMsg;constructor(e,t,n={mediaQuery:`(max-width: 720px)`}){if(!e)throw Error(`Element is null or empty.`);this.el=e,this.callback=t,this.breakpoint=window.matchMedia(n.mediaQuery),this.options={...n},this.fallbackBtn=this.el.querySelector(`[data-load-fallback]`),this.errorMsg=this.el.querySelector(`[data-load-error]`),this.controller=new AbortController}init=()=>{this.responsiveCheck(this.breakpoint);let{signal:e}=this.controller;this.breakpoint.addEventListener(`change`,this.responsiveCheck,{signal:e}),this.fallbackBtn?.addEventListener(`click`,this.handleClick,{signal:e})};responsiveCheck=({matches:e})=>{e&&this.load().catch(e=>this.handleError(e))};load=async()=>{try{await this.callback()}catch(e){this.handleError(e)}finally{this.destroy()}};destroy=()=>{this.controller.abort()};handleClick=()=>{this.load().catch(e=>this.handleError(e))};handleError=e=>{this.errorMsg?.removeAttribute(`hidden`)};static create=(t,n,r={})=>{Object.hasOwn(window,`once`)&&window.once(`breakpoint-loader`,t)?.forEach(t=>{new e(t,n,r).init()})}},k=class extends HTMLElement{internals_;controller;widget;static observedAttributes=[`open`];constructor(){super(),this.internals_=this.attachInternals(),this.controller=new AbortController}connectedCallback(){if(!this.trigger||!this.content)return;this.content?.setAttribute(`inert`,``),this.content?.setAttribute(`role`,`region`),this.widget=new a(this.trigger,this,{attribute:`open`,setInitialAttribute:!1}),this.widget.init();let{signal:e}=this.controller;this.handleHash(),document.addEventListener(`hashchange`,this.handleHash,{signal:e})}disconnectedCallback(){this.content?.removeAttribute(`inert`),this.widget.detach(),this.controller.abort()}attributeChangedCallback(e,t,n){let r=n===null;this.content?.toggleAttribute(`inert`,r)}handleHash=()=>{let{hash:e}=window.location;e&&e===`#${this.id}`&&!this.hasAttribute(`open`)&&this.widget.handleToggle()};get trigger(){let e=this.querySelector(`:scope > button`);if(!e)throw Error(`${this.localName} must contain a <button> element.`);return e}get content(){let e=this.trigger?.nextElementSibling;if(!e)throw Error(`${this.localName} must contain a <div> element after the <button>.`);return e}};customElements.get(`mx-accordiondiv`)||customElements.define(`mx-accordiondiv`,k);export{C as Accordion,k as AccordionDiv,E as AccordionGroup,w as AccordionMobile,m as Autocomplete,O as BreakpointLoader,b as Carousel,y as ClosableAlert,t as CookieCompliance,T as CookieConsent,S as Dialog,a as DisclosureWidget,h as DropMenu,x as Gallery,p as GlobalToggle,v as InPageNavigation,D as IntersectionLoader,d as Keyboard,f as Navigation,_ as Sticky,g as Tabs,u as createElement,o as getElementBox,c as handleEscape,i as handleOutsideClick,n as isInternalLink,s as loadOnReady,l as makeAnchor,r as makeCamelCase,e as validators};
1
+ import { n as e, t } from "./chunks/cookie-compliance-CG6x-TcV.js";
2
+ import { a as n, c as r, i, l as a, n as o, o as s, r as c, s as l, t as u, u as d } from "./chunks/utilities-B9mNRs7V.js";
3
+ import { n as f, t as p } from "./chunks/Navigation-CRModT40.js";
4
+ import { t as m } from "./chunks/GlobalToggle-7H3F1Wvc.js";
5
+ import { t as h } from "./chunks/FeedbackForm-BsL7fv8s.js";
6
+ import { t as g } from "./chunks/Autocomplete-kRo8RNbC.js";
7
+ import { t as _ } from "./chunks/DropMenu-CSTZq0Zt.js";
8
+ import { t as v } from "./chunks/Translate-yAgySwet.js";
9
+ import { t as y } from "./chunks/Tabs-BJD3kABL.js";
10
+ import { t as b } from "./chunks/Sticky-C1H8MNqK.js";
11
+ import { t as x } from "./chunks/InPageNavigation-D7m3IN89.js";
12
+ import { t as S } from "./chunks/ClosableAlert-CZ114JsL.js";
13
+ import { n as C, t as w } from "./chunks/Gallery-DqJPujX5.js";
14
+ import { t as T } from "./chunks/Dialog-DoYcGqhW.js";
15
+ import { t as E } from "./chunks/Accordion-Bqe8vTNR.js";
16
+ import { t as D } from "./chunks/AccordionMobile-D517oXYZ.js";
17
+ import { t as O } from "./chunks/CookieConsent-wd8gQ2Oe.js";
18
+ import { t as k } from "./chunks/BackToTop-4M-Wl7z3.js";
19
+ import { t as A } from "./chunks/AccordionGroup-BYtoAFxg.js";
20
+ //#region src/Utility/Elements/io-loader.ts
21
+ var j = class e {
22
+ el;
23
+ callback;
24
+ controller;
25
+ observer;
26
+ fallbackBtn;
27
+ errorMsg;
28
+ constructor(e, t) {
29
+ this.el = e, this.callback = t, this.fallbackBtn = this.el.querySelector("[data-load-fallback]"), this.errorMsg = this.el.querySelector("[data-load-error]"), this.controller = new AbortController();
30
+ }
31
+ init = () => {
32
+ this.observer = new IntersectionObserver((e) => {
33
+ e.forEach(({ isIntersecting: e }) => {
34
+ e && this.load().catch((e) => this.handleError(e));
35
+ });
36
+ }), this.observer.observe(this.el);
37
+ let { signal: e } = this.controller;
38
+ this.fallbackBtn?.addEventListener("click", this.handleClick, { signal: e });
39
+ };
40
+ load = async () => {
41
+ try {
42
+ await this.callback();
43
+ } catch (e) {
44
+ this.handleError(e);
45
+ } finally {
46
+ this.destroy();
47
+ }
48
+ };
49
+ destroy = () => {
50
+ this.observer.disconnect(), this.controller.abort();
51
+ };
52
+ handleClick = () => {
53
+ this.load().catch((e) => this.handleError(e));
54
+ };
55
+ handleError = (e) => {
56
+ this.errorMsg?.removeAttribute("hidden");
57
+ };
58
+ static create = (t, n) => {
59
+ Object.hasOwn(window, "once") && window.once("intersection-loader", t)?.forEach((t) => {
60
+ new e(t, n).init();
61
+ });
62
+ };
63
+ }, M = class e {
64
+ el;
65
+ callback;
66
+ controller;
67
+ breakpoint;
68
+ options;
69
+ fallbackBtn;
70
+ errorMsg;
71
+ constructor(e, t, n = { mediaQuery: "(max-width: 720px)" }) {
72
+ if (!e) throw Error("Element is null or empty.");
73
+ this.el = e, this.callback = t, this.breakpoint = window.matchMedia(n.mediaQuery), this.options = { ...n }, this.fallbackBtn = this.el.querySelector("[data-load-fallback]"), this.errorMsg = this.el.querySelector("[data-load-error]"), this.controller = new AbortController();
74
+ }
75
+ init = () => {
76
+ this.responsiveCheck(this.breakpoint);
77
+ let { signal: e } = this.controller;
78
+ this.breakpoint.addEventListener("change", this.responsiveCheck, { signal: e }), this.fallbackBtn?.addEventListener("click", this.handleClick, { signal: e });
79
+ };
80
+ responsiveCheck = ({ matches: e }) => {
81
+ e && this.load().catch((e) => this.handleError(e));
82
+ };
83
+ load = async () => {
84
+ try {
85
+ await this.callback();
86
+ } catch (e) {
87
+ this.handleError(e);
88
+ } finally {
89
+ this.destroy();
90
+ }
91
+ };
92
+ destroy = () => {
93
+ this.controller.abort();
94
+ };
95
+ handleClick = () => {
96
+ this.load().catch((e) => this.handleError(e));
97
+ };
98
+ handleError = (e) => {
99
+ this.errorMsg?.removeAttribute("hidden");
100
+ };
101
+ static create = (t, n, r = {}) => {
102
+ Object.hasOwn(window, "once") && window.once("breakpoint-loader", t)?.forEach((t) => {
103
+ new e(t, n, r).init();
104
+ });
105
+ };
106
+ }, N = class extends HTMLElement {
107
+ internals_;
108
+ controller;
109
+ widget;
110
+ static observedAttributes = ["open"];
111
+ constructor() {
112
+ super(), this.internals_ = this.attachInternals(), this.controller = new AbortController();
113
+ }
114
+ connectedCallback() {
115
+ if (!this.trigger || !this.content) return;
116
+ this.content?.setAttribute("inert", ""), this.content?.setAttribute("role", "region"), this.widget = new d(this.trigger, this, {
117
+ attribute: "open",
118
+ setInitialAttribute: !1
119
+ }), this.widget.init();
120
+ let { signal: e } = this.controller;
121
+ this.handleHash(), document.addEventListener("hashchange", this.handleHash, { signal: e });
122
+ }
123
+ disconnectedCallback() {
124
+ this.content?.removeAttribute("inert"), this.widget.detach(), this.controller.abort();
125
+ }
126
+ attributeChangedCallback(e, t, n) {
127
+ let r = n === null;
128
+ this.content?.toggleAttribute("inert", r);
129
+ }
130
+ handleHash = () => {
131
+ let { hash: e } = window.location;
132
+ e && e === `#${this.id}` && !this.hasAttribute("open") && this.widget.handleToggle();
133
+ };
134
+ get trigger() {
135
+ let e = this.querySelector(":scope > button");
136
+ if (!e) throw Error(`${this.localName} must contain a <button> element.`);
137
+ return e;
138
+ }
139
+ get content() {
140
+ let e = this.trigger?.nextElementSibling;
141
+ if (!e) throw Error(`${this.localName} must contain a <div> element after the <button>.`);
142
+ return e;
143
+ }
144
+ };
145
+ customElements.get("mx-accordiondiv") || customElements.define("mx-accordiondiv", N);
146
+ //#endregion
147
+ export { E as Accordion, N as AccordionDiv, A as AccordionGroup, D as AccordionMobile, g as Autocomplete, k as BackToTop, M as BreakpointLoader, C as Carousel, S as ClosableAlert, t as CookieCompliance, O as CookieConsent, T as Dialog, d as DisclosureWidget, _ as DropMenu, h as FeedbackForm, w as Gallery, m as GlobalToggle, a as GoogleTranslateWidget, x as InPageNavigation, j as IntersectionLoader, f as Keyboard, p as Navigation, b as Sticky, y as Tabs, v as Translate, u as createElement, o as getElementBox, c as handleEscape, i as handleOutsideClick, n as isInternalLink, s as loadOnReady, l as makeAnchor, r as makeCamelCase, e as validators };
@@ -0,0 +1 @@
1
+ @layer popover-polyfill;@layer design-system.defaults{mx-feedback-form{display:block}}@layer design-system.atoms,design-system.layout,design-system.utilities;@layer design-system.components{.mx-feedback-form{display:block;& form{gap:var(--flow-gap,var(--gap));display:grid}& .mx-error-message{margin-block-end:unset}& .mx-form-actions{margin-block-start:var(--flow-gap,var(--gap))}}.mx-feedback-form__rating{gap:var(--spacing-s);flex-wrap:wrap;display:flex}.mx-feedback-form__option .mx-icon{--icon-size:var(--feedback-form-icon-size,var(--spacing-m))}.mx-feedback-form__option label{cursor:pointer}.mx-feedback-form__option:has(input:checked) label{--button-bg:var(--button-dark-bg,var(--link-colour,var(--colour-link)));--button-fg:var(--button-dark-fg,var(--colour-foreground-reverse))}.mx-feedback-form__option:has(input:focus-visible) label{outline:var(--outline-size,2px) var(--outline-style,solid) var(--outline-color,currentcolor);outline-offset:var(--outline-offset,2px)}.mx-feedback-form.is-enhanced .mx-feedback-form__reveal{display:none}.mx-feedback-form.is-enhanced:has(.mx-feedback-form__rating input:checked) .mx-feedback-form__reveal{display:block}}
@@ -0,0 +1 @@
1
+ import "./chunks/FeedbackForm-BsL7fv8s.js";
@@ -1 +1,145 @@
1
- import{n as e}from"./chunks/cookie-compliance-Bbm-0vpj.js";import"./chunks/utilities-_Bq3TxAQ.js";import"./chunks/Accordion-GN0sME4W.js";import"./chunks/AccordionMobile-DG5jSe8Q.js";import"./chunks/enums-DLV_1NAf.js";import{createFocusTrap as t}from"focus-trap";var n=class extends HTMLElement{internals_;controller;entries;timeout;mq;focusTrap;rafId;focusTrapTimeout;scrollLockClass=`body--scroll-lock`;isRight;isInstant;instantDebounce;static observedAttributes=[`count`];constructor(){super(),this.internals_=this.attachInternals(),this.controller=new AbortController,this.mq=this.getAttribute(`mq`)||`(max-width: 720px)`,this.isRight=this.classList.contains(`mx-filters--right`),this.isInstant=this.classList.contains(`mx-filters--auto`)}connectedCallback(){if(!this.items)return;let{signal:e}=this.controller;this.closeBtn?.addEventListener(`click`,this.handleClose,{signal:e}),this.showBtn?.previousElementSibling.setAttribute(`hidden`,`until-found`),this.showBtn?.addEventListener(`click`,this.handleShow,{signal:e}),this.resetBtn?.setAttribute(`disabled`,``),this.submitBtn?.setAttribute(`disabled`,``),this.handleCounters(),this.addEventListener(`change`,this.handleCounters,{signal:e}),this.form?.addEventListener(`submit`,this.handleCounters,{signal:e}),this.form?.addEventListener(`reset`,this.handleReset,{signal:e}),this.isInstant&&(this.addEventListener(`change`,this.handleInstantSubmit,{signal:e}),this.addEventListener(`input`,this.handleInstantSubmit,{signal:e})),this.isRight&&(this.handleBreakpoint(this.breakpoint),this.breakpoint.addEventListener(`change`,this.handleBreakpoint,{signal:e}),this.focusTrap=t(this.form,{escapeDeactivates:!1,setReturnFocus:this.details,allowOutsideClick:!0,onActivate:()=>document.body.classList.add(this.scrollLockClass),onDeactivate:()=>document.body.classList.remove(this.scrollLockClass),checkCanFocusTrap:([e])=>new Promise(t=>{this.focusTrapTimeout=setTimeout(()=>{this.rafId&&=(cancelAnimationFrame(this.rafId),null),t()},2e3);let n=()=>{getComputedStyle(e).display===`none`?this.rafId=requestAnimationFrame(n):(this.focusTrapTimeout&&=(clearTimeout(this.focusTrapTimeout),null),this.rafId=null,t())};this.rafId=requestAnimationFrame(n)})}))}disconnectedCallback(){this.controller.abort(),this.timeout&&=(clearTimeout(this.timeout),null),this.instantDebounce&&=(clearTimeout(this.instantDebounce),null),this.rafId&&=(cancelAnimationFrame(this.rafId),null),this.focusTrapTimeout&&=(clearTimeout(this.focusTrapTimeout),null),this.focusTrap?.deactivate(),document.body.classList.remove(this.scrollLockClass)}attributeChangedCallback(t,n,r){if(t===`count`&&n!==r){let t=e.integer(r,1);if(this.resetBtn?.toggleAttribute(`disabled`,!t),this.submitBtn?.toggleAttribute(`disabled`,!t),!this.allCounter)return;this.allCounter.textContent=t?r:``}}handleClose=e=>{this.details&&(this.details.open=!1,e.preventDefault())};handleShow=e=>{e.preventDefault();let t=this.showBtn.previousElementSibling;t.removeAttribute(`hidden`);let n=t.previousElementSibling.querySelector(`input`);n&&(n.focus({preventScroll:!0}),this.timeout=setTimeout(()=>{this.showBtn.setAttribute(`hidden`,``)},100))};handleReset=()=>{this.entries.forEach((e,t)=>{this.entries.set(t,{...e,count:null}),e.counter&&(e.counter.textContent=``)}),this.setAttribute(`count`,`0`),this.instantDebounce&&=(clearTimeout(this.instantDebounce),null),this.isInstant&&(this.instantDebounce=setTimeout(()=>this.form?.requestSubmit(),0))};handleInstantSubmit=e=>{let t=e.target,n=t instanceof HTMLSelectElement||t instanceof HTMLInputElement&&[`checkbox`,`radio`].includes(t.type);n===(e.type===`change`)&&(this.instantDebounce&&=(clearTimeout(this.instantDebounce),null),n?this.form?.requestSubmit():this.instantDebounce=setTimeout(()=>this.form?.requestSubmit(),400))};handleCounters=()=>{let e=new FormData(this.form,this.submitBtn);this.entries.forEach((t,n)=>{let{length:r}=e.getAll(n).filter(Boolean),i=r>0?r:null;this.entries.set(n,{...t,count:i}),t.counter&&(t.counter.textContent=i?.toString()||``)});let t=[...this.entries].filter(([,e])=>e.count).length;this.setAttribute(`count`,t.toString())};handleBreakpoint=({matches:e})=>{if(!this.details)return;let{signal:t}=this.controller;e?this.details.addEventListener(`toggle`,this.handleToggle,{signal:t}):(this.details.removeEventListener(`toggle`,this.handleToggle),document.body.classList.remove(this.scrollLockClass),this.focusTrap?.deactivate())};handleToggle=async()=>{if(this.details.open)try{await this.focusTrap?.activate()}catch{}else this.focusTrap?.deactivate()};get items(){let e=this.querySelectorAll(`.mx-filter-item`);if(!e)throw Error(`${this.localName} must contain a .mx-filter-item element.`);return this.entries=/* @__PURE__ */ new Map,e.forEach(e=>{let t=e.querySelector(`input, select`)?.getAttribute(`name`);this.entries.set(t,{item:e,counter:e.querySelector(`[data-counter]`)})}),e}get details(){return this.querySelector(`mx-accordionmobile > details`)}get closeBtn(){return this.details?.querySelector(`button[data-close]`)}get form(){return this.querySelector(`form`)}get resetBtn(){return this.querySelector(`button[type='reset']`)}get submitBtn(){return this.querySelector(`button[type='submit']`)}get showBtn(){return this.querySelector(`button[data-show]`)}get allCounter(){return this.querySelector(`[data-counters]`)}get breakpoint(){return window.matchMedia(this.mq)}get pending(){return this.form?.getAttribute(`aria-busy`)===`true`}set pending(e){this.form?.setAttribute(`aria-busy`,String(e))}};customElements.get(`mx-filters`)||customElements.define(`mx-filters`,n);
1
+ import { n as e } from "./chunks/cookie-compliance-CG6x-TcV.js";
2
+ import "./chunks/utilities-B9mNRs7V.js";
3
+ import "./chunks/Accordion-Bqe8vTNR.js";
4
+ import "./chunks/AccordionMobile-D517oXYZ.js";
5
+ import "./chunks/enums-BrHxPZZ_.js";
6
+ import { createFocusTrap as t } from "focus-trap";
7
+ //#region src/Component/Filters/Elements/Filters.ts
8
+ var n = class extends HTMLElement {
9
+ internals_;
10
+ controller;
11
+ entries;
12
+ timeout;
13
+ mq;
14
+ focusTrap;
15
+ rafId;
16
+ focusTrapTimeout;
17
+ scrollLockClass = "body--scroll-lock";
18
+ isRight;
19
+ isInstant;
20
+ instantDebounce;
21
+ static observedAttributes = ["count"];
22
+ constructor() {
23
+ super(), this.internals_ = this.attachInternals(), this.controller = new AbortController(), this.mq = this.getAttribute("mq") || "(max-width: 720px)", this.isRight = this.classList.contains("mx-filters--right"), this.isInstant = this.classList.contains("mx-filters--auto");
24
+ }
25
+ connectedCallback() {
26
+ if (!this.items) return;
27
+ let { signal: e } = this.controller;
28
+ this.closeBtn?.addEventListener("click", this.handleClose, { signal: e }), this.showBtn?.previousElementSibling.setAttribute("hidden", "until-found"), this.showBtn?.addEventListener("click", this.handleShow, { signal: e }), this.resetBtn?.setAttribute("disabled", ""), this.submitBtn?.setAttribute("disabled", ""), this.handleCounters(), this.addEventListener("change", this.handleCounters, { signal: e }), this.form?.addEventListener("submit", this.handleCounters, { signal: e }), this.form?.addEventListener("reset", this.handleReset, { signal: e }), this.isInstant && (this.addEventListener("change", this.handleInstantSubmit, { signal: e }), this.addEventListener("input", this.handleInstantSubmit, { signal: e })), this.isRight && (this.handleBreakpoint(this.breakpoint), this.breakpoint.addEventListener("change", this.handleBreakpoint, { signal: e }), this.focusTrap = t(this.form, {
29
+ escapeDeactivates: !1,
30
+ setReturnFocus: this.details,
31
+ allowOutsideClick: !0,
32
+ onActivate: () => document.body.classList.add(this.scrollLockClass),
33
+ onDeactivate: () => document.body.classList.remove(this.scrollLockClass),
34
+ checkCanFocusTrap: ([e]) => new Promise((t) => {
35
+ this.focusTrapTimeout = setTimeout(() => {
36
+ this.rafId &&= (cancelAnimationFrame(this.rafId), null), t();
37
+ }, 2e3);
38
+ let n = () => {
39
+ getComputedStyle(e).display === "none" ? this.rafId = requestAnimationFrame(n) : (this.focusTrapTimeout &&= (clearTimeout(this.focusTrapTimeout), null), this.rafId = null, t());
40
+ };
41
+ this.rafId = requestAnimationFrame(n);
42
+ })
43
+ }));
44
+ }
45
+ disconnectedCallback() {
46
+ this.controller.abort(), this.timeout &&= (clearTimeout(this.timeout), null), this.instantDebounce &&= (clearTimeout(this.instantDebounce), null), this.rafId &&= (cancelAnimationFrame(this.rafId), null), this.focusTrapTimeout &&= (clearTimeout(this.focusTrapTimeout), null), this.focusTrap?.deactivate(), document.body.classList.remove(this.scrollLockClass);
47
+ }
48
+ attributeChangedCallback(t, n, r) {
49
+ if (t === "count" && n !== r) {
50
+ let t = e.integer(r, 1);
51
+ if (this.resetBtn?.toggleAttribute("disabled", !t), this.submitBtn?.toggleAttribute("disabled", !t), !this.allCounter) return;
52
+ this.allCounter.textContent = t ? r : "";
53
+ }
54
+ }
55
+ handleClose = (e) => {
56
+ this.details && (this.details.open = !1, e.preventDefault());
57
+ };
58
+ handleShow = (e) => {
59
+ e.preventDefault();
60
+ let t = this.showBtn.previousElementSibling;
61
+ t.removeAttribute("hidden");
62
+ let n = t.previousElementSibling.querySelector("input");
63
+ n && (n.focus({ preventScroll: !0 }), this.timeout = setTimeout(() => {
64
+ this.showBtn.setAttribute("hidden", "");
65
+ }, 100));
66
+ };
67
+ handleReset = () => {
68
+ this.entries.forEach((e, t) => {
69
+ this.entries.set(t, {
70
+ ...e,
71
+ count: null
72
+ }), e.counter && (e.counter.textContent = "");
73
+ }), this.setAttribute("count", "0"), this.instantDebounce &&= (clearTimeout(this.instantDebounce), null), this.isInstant && (this.instantDebounce = setTimeout(() => this.form?.requestSubmit(), 0));
74
+ };
75
+ handleInstantSubmit = (e) => {
76
+ let t = e.target, n = t instanceof HTMLSelectElement || t instanceof HTMLInputElement && ["checkbox", "radio"].includes(t.type);
77
+ n === (e.type === "change") && (this.instantDebounce &&= (clearTimeout(this.instantDebounce), null), n ? this.form?.requestSubmit() : this.instantDebounce = setTimeout(() => this.form?.requestSubmit(), 400));
78
+ };
79
+ handleCounters = () => {
80
+ let e = new FormData(this.form, this.submitBtn);
81
+ this.entries.forEach((t, n) => {
82
+ let { length: r } = e.getAll(n).filter(Boolean), i = r > 0 ? r : null;
83
+ this.entries.set(n, {
84
+ ...t,
85
+ count: i
86
+ }), t.counter && (t.counter.textContent = i?.toString() || "");
87
+ });
88
+ let t = [...this.entries].filter(([, e]) => e.count).length;
89
+ this.setAttribute("count", t.toString());
90
+ };
91
+ handleBreakpoint = ({ matches: e }) => {
92
+ if (!this.details) return;
93
+ let { signal: t } = this.controller;
94
+ e ? this.details.addEventListener("toggle", this.handleToggle, { signal: t }) : (this.details.removeEventListener("toggle", this.handleToggle), document.body.classList.remove(this.scrollLockClass), this.focusTrap?.deactivate());
95
+ };
96
+ handleToggle = async () => {
97
+ if (this.details.open) try {
98
+ await this.focusTrap?.activate();
99
+ } catch {}
100
+ else this.focusTrap?.deactivate();
101
+ };
102
+ get items() {
103
+ let e = this.querySelectorAll(".mx-filter-item");
104
+ if (!e) throw Error(`${this.localName} must contain a .mx-filter-item element.`);
105
+ return this.entries = /* @__PURE__ */ new Map(), e.forEach((e) => {
106
+ let t = e.querySelector("input, select")?.getAttribute("name");
107
+ this.entries.set(t, {
108
+ item: e,
109
+ counter: e.querySelector("[data-counter]")
110
+ });
111
+ }), e;
112
+ }
113
+ get details() {
114
+ return this.querySelector("mx-accordionmobile > details");
115
+ }
116
+ get closeBtn() {
117
+ return this.details?.querySelector("button[data-close]");
118
+ }
119
+ get form() {
120
+ return this.querySelector("form");
121
+ }
122
+ get resetBtn() {
123
+ return this.querySelector("button[type='reset']");
124
+ }
125
+ get submitBtn() {
126
+ return this.querySelector("button[type='submit']");
127
+ }
128
+ get showBtn() {
129
+ return this.querySelector("button[data-show]");
130
+ }
131
+ get allCounter() {
132
+ return this.querySelector("[data-counters]");
133
+ }
134
+ get breakpoint() {
135
+ return window.matchMedia(this.mq);
136
+ }
137
+ get pending() {
138
+ return this.form?.getAttribute("aria-busy") === "true";
139
+ }
140
+ set pending(e) {
141
+ this.form?.setAttribute("aria-busy", String(e));
142
+ }
143
+ };
144
+ customElements.get("mx-filters") || customElements.define("mx-filters", n);
145
+ //#endregion