@konstructio/ui 0.0.12-alpha.0 → 0.0.12-alpha.2

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 (277) hide show
  1. package/dist/{Combination-Cmu9JRkv.js → Combination-b348x__d.js} +89 -89
  2. package/dist/Modal-DZUwNzSW.js +914 -0
  3. package/dist/{chevron-up-CvquEaNg.js → chevron-up-DgLBQCKD.js} +1 -1
  4. package/dist/components/Alert/Alert.js +58 -0
  5. package/dist/components/Alert/Alert.variants.js +77 -0
  6. package/dist/components/AlertDialog/AlertDialog.js +20 -23
  7. package/dist/components/AlertDialog/components/AlertDialogTrigger.js +3 -6
  8. package/dist/components/AlertDialog/components/index.js +1 -1
  9. package/dist/components/Autocomplete/Autocomplete.js +15 -17
  10. package/dist/components/Autocomplete/components/List/List.js +7 -7
  11. package/dist/components/Breadcrumb/Breadcrumb.js +68 -69
  12. package/dist/components/Breadcrumb/Breadcrumb.variants.js +16 -17
  13. package/dist/components/Breadcrumb/components/Item/Item.js +61 -0
  14. package/dist/components/Breadcrumb/components/Item/Item.variants.js +90 -0
  15. package/dist/components/Breadcrumb/components/index.js +4 -0
  16. package/dist/components/Breadcrumb/hooks/useBreadcrumb.js +2 -3
  17. package/dist/components/Button/Button.js +15 -17
  18. package/dist/components/Card/Card.js +11 -13
  19. package/dist/components/Checkbox/Checkbox.js +16 -18
  20. package/dist/components/Divider/Divider.js +10 -0
  21. package/dist/components/Divider/Divider.variants.js +14 -0
  22. package/dist/components/Dropdown/Dropdown.js +4 -6
  23. package/dist/components/Dropdown/components/List/List.js +9 -10
  24. package/dist/components/Dropdown/components/ListItem/ListItem.js +20 -21
  25. package/dist/components/Dropdown/components/Wrapper.js +31 -34
  26. package/dist/components/Dropdown/contexts/dropdown.provider.js +4 -4
  27. package/dist/components/Dropdown/hooks/useDropdown.js +12 -14
  28. package/dist/components/Dropdown/hooks/useNavigationList.js +8 -10
  29. package/dist/components/Input/Input.js +12 -14
  30. package/dist/components/Loading/Loading.js +28 -0
  31. package/dist/components/Loading/Loading.variants.js +20 -0
  32. package/dist/components/Modal/Modal.js +3 -3
  33. package/dist/components/Modal/components/Body/Body.js +1 -1
  34. package/dist/components/Modal/components/Footer/Footer.js +1 -1
  35. package/dist/components/Modal/components/Header/Header.js +1 -1
  36. package/dist/components/Modal/components/Wrapper/Wrapper.js +7 -9
  37. package/dist/components/Modal/components/index.js +1 -1
  38. package/dist/components/Modal/contexts/Modal.provider.js +4 -4
  39. package/dist/components/NumberInput/NumberInput.js +9 -11
  40. package/dist/components/ProgressBar/ProgressBar.js +12 -15
  41. package/dist/components/Radio/Radio.js +55 -37
  42. package/dist/components/Radio/Radio.variants.js +69 -16
  43. package/dist/components/RadioCard/RadioCard.js +41 -0
  44. package/dist/components/RadioCard/RadioCard.variants.js +19 -0
  45. package/dist/components/RadioCardGroup/RadioCardGroup.js +47 -0
  46. package/dist/components/RadioCardGroup/RadioCardGroup.variants.js +21 -0
  47. package/dist/components/RadioGroup/RadioGroup.js +37 -27
  48. package/dist/components/RadioGroup/RadioGroup.variants.js +21 -0
  49. package/dist/components/Range/Range.js +20 -22
  50. package/dist/components/Sidebar/Sidebar.js +20 -22
  51. package/dist/components/Sidebar/components/Footer/Footer.js +9 -12
  52. package/dist/components/Sidebar/components/Logo/Logo.js +9 -12
  53. package/dist/components/Sidebar/components/Navigation/Navigation.js +12 -15
  54. package/dist/components/Sidebar/components/NavigationGroup/NavigationGroup.js +12 -15
  55. package/dist/components/Sidebar/components/NavigationOption/NavigationOption.js +17 -20
  56. package/dist/components/Sidebar/components/NavigationSeparator/NavigationSeparator.js +8 -11
  57. package/dist/components/Sidebar/components/NavigationTitle/NavigationTitle.js +10 -13
  58. package/dist/components/Sidebar/components/Wrapper/Wrapper.js +29 -27
  59. package/dist/components/Slider/Slider.js +11 -13
  60. package/dist/components/Switch/Switch.js +28 -30
  61. package/dist/components/TagSelect/TagSelect.js +18 -20
  62. package/dist/components/TextArea/TextArea.js +17 -19
  63. package/dist/components/Toast/Toast.js +56 -58
  64. package/dist/components/Tooltip/Tooltip.js +10 -12
  65. package/dist/components/Typography/Typography.js +30 -0
  66. package/dist/components/Typography/Typography.variants.js +36 -0
  67. package/dist/components/index.js +64 -50
  68. package/dist/contexts/theme.provider.js +84 -14
  69. package/dist/{AlertDialogTrigger-D4Tm_9M0.js → index-3jTPaVvh.js} +25 -27
  70. package/dist/{index-BxeV34ij.js → index-4ecjw_Aj.js} +1 -1
  71. package/dist/{index-BedjZUuB.js → index-B33at13_.js} +3 -3
  72. package/dist/{index-BaNV0qac.js → index-BTeAm7mx.js} +7113 -7144
  73. package/dist/index-B_6_jmOO.js +68 -0
  74. package/dist/{index-BBjak_0p.js → index-BbsJ0VIJ.js} +2 -2
  75. package/dist/{index-D68N8v8R.js → index-C5psggHV.js} +17 -17
  76. package/dist/{index-z-AJyzdv.js → index-C6WtlN_F.js} +11 -11
  77. package/dist/{index-8vgf-x5i.js → index-Cva-e5M4.js} +2 -2
  78. package/dist/{index-D4Q2rMby.js → index-Dj1pom3_.js} +2 -2
  79. package/dist/{index-BtibbG81.js → index-Z1voPZOH.js} +1 -1
  80. package/dist/index.d.ts +561 -4
  81. package/dist/index.js +74 -60
  82. package/dist/package.json +27 -28
  83. package/dist/plugins/konstruct.js +34 -31
  84. package/dist/plugins/utils/animation.styles.js +162 -0
  85. package/dist/plugins/utils/index.js +7 -0
  86. package/dist/styles.css +1 -1
  87. package/dist/styles.js +1 -1
  88. package/dist/useBreadcrumb-BsIeMoR1.js +1279 -0
  89. package/dist/{x-CRBgmX1Q.js → x-DU-Zw-L_.js} +1 -1
  90. package/package.json +27 -28
  91. package/dist/Modal-L73dmnHv.js +0 -914
  92. package/dist/components/AlertDialog/AlertDialog.d.ts +0 -3
  93. package/dist/components/AlertDialog/AlertDialog.types.d.ts +0 -18
  94. package/dist/components/AlertDialog/AlertDialog.types.js +0 -1
  95. package/dist/components/AlertDialog/AlertDialog.variants.d.ts +0 -3
  96. package/dist/components/AlertDialog/components/AlertDialogTrigger.d.ts +0 -3
  97. package/dist/components/AlertDialog/components/AlertDialogTrigger.types.d.ts +0 -6
  98. package/dist/components/AlertDialog/components/AlertDialogTrigger.types.js +0 -1
  99. package/dist/components/AlertDialog/components/index.d.ts +0 -1
  100. package/dist/components/AlertDialog/hooks/index.d.ts +0 -1
  101. package/dist/components/AlertDialog/hooks/useAlertDialog.d.ts +0 -7
  102. package/dist/components/Autocomplete/Autocomplete.d.ts +0 -3
  103. package/dist/components/Autocomplete/Autocomplete.types.d.ts +0 -18
  104. package/dist/components/Autocomplete/Autocomplete.types.js +0 -1
  105. package/dist/components/Autocomplete/Autocomplete.variants.d.ts +0 -8
  106. package/dist/components/Autocomplete/components/List/List.d.ts +0 -3
  107. package/dist/components/Autocomplete/components/List/List.types.d.ts +0 -13
  108. package/dist/components/Autocomplete/components/List/List.types.js +0 -1
  109. package/dist/components/Autocomplete/components/List/List.variants.d.ts +0 -16
  110. package/dist/components/Autocomplete/components/index.d.ts +0 -1
  111. package/dist/components/Autocomplete/hooks/index.d.ts +0 -2
  112. package/dist/components/Autocomplete/hooks/useAutocomplete.d.ts +0 -17
  113. package/dist/components/Autocomplete/hooks/useNavigationList.d.ts +0 -10
  114. package/dist/components/Breadcrumb/Breadcrumb.d.ts +0 -3
  115. package/dist/components/Breadcrumb/Breadcrumb.types.d.ts +0 -11
  116. package/dist/components/Breadcrumb/Breadcrumb.types.js +0 -1
  117. package/dist/components/Breadcrumb/Breadcrumb.variants.d.ts +0 -12
  118. package/dist/components/Breadcrumb/hooks/useBreadcrumb.d.ts +0 -3
  119. package/dist/components/Button/Button.d.ts +0 -4
  120. package/dist/components/Button/Button.types.d.ts +0 -7
  121. package/dist/components/Button/Button.types.js +0 -1
  122. package/dist/components/Button/Button.variants.d.ts +0 -7
  123. package/dist/components/Card/Card.d.ts +0 -4
  124. package/dist/components/Card/Card.types.d.ts +0 -8
  125. package/dist/components/Card/Card.types.js +0 -1
  126. package/dist/components/Card/Card.variants.d.ts +0 -10
  127. package/dist/components/Checkbox/Checkbox.d.ts +0 -3
  128. package/dist/components/Checkbox/Checkbox.types.d.ts +0 -14
  129. package/dist/components/Checkbox/Checkbox.types.js +0 -1
  130. package/dist/components/Checkbox/Checkbox.variants.d.ts +0 -9
  131. package/dist/components/Dropdown/Dropdown.d.ts +0 -3
  132. package/dist/components/Dropdown/Dropdown.types.d.ts +0 -16
  133. package/dist/components/Dropdown/Dropdown.types.js +0 -1
  134. package/dist/components/Dropdown/Dropdown.variants.d.ts +0 -3
  135. package/dist/components/Dropdown/components/EmptyList.d.ts +0 -2
  136. package/dist/components/Dropdown/components/List/List.d.ts +0 -3
  137. package/dist/components/Dropdown/components/List/List.types.d.ts +0 -6
  138. package/dist/components/Dropdown/components/List/List.types.js +0 -1
  139. package/dist/components/Dropdown/components/List/List.variants.d.ts +0 -3
  140. package/dist/components/Dropdown/components/ListItem/ListItem.d.ts +0 -3
  141. package/dist/components/Dropdown/components/ListItem/ListItem.types.d.ts +0 -4
  142. package/dist/components/Dropdown/components/ListItem/ListItem.types.js +0 -1
  143. package/dist/components/Dropdown/components/ListItem/ListItem.variants.d.ts +0 -3
  144. package/dist/components/Dropdown/components/Wrapper.d.ts +0 -3
  145. package/dist/components/Dropdown/components/index.d.ts +0 -3
  146. package/dist/components/Dropdown/contexts/dropdown.context.d.ts +0 -8
  147. package/dist/components/Dropdown/contexts/dropdown.hook.d.ts +0 -2
  148. package/dist/components/Dropdown/contexts/dropdown.provider.d.ts +0 -5
  149. package/dist/components/Dropdown/contexts/index.d.ts +0 -2
  150. package/dist/components/Dropdown/hooks/useDropdown.d.ts +0 -11
  151. package/dist/components/Dropdown/hooks/useNavigationList.d.ts +0 -8
  152. package/dist/components/Input/Input.d.ts +0 -3
  153. package/dist/components/Input/Input.types.d.ts +0 -9
  154. package/dist/components/Input/Input.types.js +0 -1
  155. package/dist/components/Input/Input.variants.d.ts +0 -4
  156. package/dist/components/Modal/Modal.d.ts +0 -8
  157. package/dist/components/Modal/Modal.types.d.ts +0 -12
  158. package/dist/components/Modal/Modal.types.js +0 -1
  159. package/dist/components/Modal/components/Body/Body.d.ts +0 -3
  160. package/dist/components/Modal/components/Body/Body.types.d.ts +0 -5
  161. package/dist/components/Modal/components/Body/Body.types.js +0 -1
  162. package/dist/components/Modal/components/Footer/Footer.d.ts +0 -3
  163. package/dist/components/Modal/components/Footer/Footer.types.d.ts +0 -5
  164. package/dist/components/Modal/components/Footer/Footer.types.js +0 -1
  165. package/dist/components/Modal/components/Header/Header.d.ts +0 -3
  166. package/dist/components/Modal/components/Header/Header.types.d.ts +0 -5
  167. package/dist/components/Modal/components/Header/Header.types.js +0 -1
  168. package/dist/components/Modal/components/Wrapper/Wrapper.d.ts +0 -3
  169. package/dist/components/Modal/components/Wrapper/Wrapper.types.d.ts +0 -7
  170. package/dist/components/Modal/components/Wrapper/Wrapper.types.js +0 -1
  171. package/dist/components/Modal/components/Wrapper/Wrapper.variants.d.ts +0 -6
  172. package/dist/components/Modal/components/index.d.ts +0 -4
  173. package/dist/components/Modal/contexts/Modal.context.d.ts +0 -2
  174. package/dist/components/Modal/contexts/Modal.provider.d.ts +0 -4
  175. package/dist/components/Modal/contexts/Modal.types.d.ts +0 -9
  176. package/dist/components/Modal/contexts/Modal.types.js +0 -1
  177. package/dist/components/Modal/contexts/index.d.ts +0 -1
  178. package/dist/components/Modal/hooks/index.d.ts +0 -1
  179. package/dist/components/Modal/hooks/useModal.d.ts +0 -9
  180. package/dist/components/NumberInput/NumberInput.d.ts +0 -3
  181. package/dist/components/NumberInput/NumberInput.types.d.ts +0 -11
  182. package/dist/components/NumberInput/NumberInput.types.js +0 -1
  183. package/dist/components/NumberInput/NumberInput.variants.d.ts +0 -11
  184. package/dist/components/ProgressBar/ProgressBar.d.ts +0 -3
  185. package/dist/components/ProgressBar/ProgressBar.types.d.ts +0 -8
  186. package/dist/components/ProgressBar/ProgressBar.types.js +0 -1
  187. package/dist/components/ProgressBar/ProgressBar.variants.d.ts +0 -7
  188. package/dist/components/Radio/Radio.d.ts +0 -3
  189. package/dist/components/Radio/Radio.types.d.ts +0 -12
  190. package/dist/components/Radio/Radio.types.js +0 -1
  191. package/dist/components/Radio/Radio.variants.d.ts +0 -3
  192. package/dist/components/RadioGroup/RadioGroup.d.ts +0 -3
  193. package/dist/components/RadioGroup/RadioGroup.types.d.ts +0 -12
  194. package/dist/components/RadioGroup/RadioGroup.types.js +0 -1
  195. package/dist/components/Range/Range.d.ts +0 -3
  196. package/dist/components/Range/Range.types.d.ts +0 -13
  197. package/dist/components/Range/Range.types.js +0 -1
  198. package/dist/components/Range/Range.variants.d.ts +0 -14
  199. package/dist/components/Sidebar/Sidebar.d.ts +0 -5
  200. package/dist/components/Sidebar/Sidebar.types.d.ts +0 -18
  201. package/dist/components/Sidebar/Sidebar.types.js +0 -1
  202. package/dist/components/Sidebar/Sidebar.variants.d.ts +0 -6
  203. package/dist/components/Sidebar/components/Footer/Footer.d.ts +0 -3
  204. package/dist/components/Sidebar/components/Footer/Footer.types.d.ts +0 -6
  205. package/dist/components/Sidebar/components/Footer/Footer.types.js +0 -1
  206. package/dist/components/Sidebar/components/Footer/Footer.variants.d.ts +0 -3
  207. package/dist/components/Sidebar/components/Logo/Logo.d.ts +0 -3
  208. package/dist/components/Sidebar/components/Logo/Logo.types.d.ts +0 -6
  209. package/dist/components/Sidebar/components/Logo/Logo.types.js +0 -1
  210. package/dist/components/Sidebar/components/Logo/Logo.variants.d.ts +0 -3
  211. package/dist/components/Sidebar/components/Navigation/Navigation.d.ts +0 -4
  212. package/dist/components/Sidebar/components/Navigation/Navigation.types.d.ts +0 -16
  213. package/dist/components/Sidebar/components/Navigation/Navigation.types.js +0 -1
  214. package/dist/components/Sidebar/components/Navigation/Navigation.variants.d.ts +0 -3
  215. package/dist/components/Sidebar/components/NavigationGroup/NavigationGroup.d.ts +0 -3
  216. package/dist/components/Sidebar/components/NavigationGroup/NavigationGroup.types.d.ts +0 -8
  217. package/dist/components/Sidebar/components/NavigationGroup/NavigationGroup.types.js +0 -1
  218. package/dist/components/Sidebar/components/NavigationGroup/NavigationGroup.variants.d.ts +0 -3
  219. package/dist/components/Sidebar/components/NavigationOption/NavigationOption.d.ts +0 -3
  220. package/dist/components/Sidebar/components/NavigationOption/NavigationOption.types.d.ts +0 -17
  221. package/dist/components/Sidebar/components/NavigationOption/NavigationOption.types.js +0 -1
  222. package/dist/components/Sidebar/components/NavigationOption/NavigationOption.variants.d.ts +0 -4
  223. package/dist/components/Sidebar/components/NavigationSeparator/NavigationSeparator.d.ts +0 -3
  224. package/dist/components/Sidebar/components/NavigationSeparator/NavigationSeparator.types.d.ts +0 -5
  225. package/dist/components/Sidebar/components/NavigationSeparator/NavigationSeparator.types.js +0 -1
  226. package/dist/components/Sidebar/components/NavigationSeparator/NavigationSeparator.variants.d.ts +0 -3
  227. package/dist/components/Sidebar/components/NavigationTitle/NavigationTitle.d.ts +0 -3
  228. package/dist/components/Sidebar/components/NavigationTitle/NavigationTitle.types.d.ts +0 -8
  229. package/dist/components/Sidebar/components/NavigationTitle/NavigationTitle.types.js +0 -1
  230. package/dist/components/Sidebar/components/NavigationTitle/NavigationTitle.variants.d.ts +0 -3
  231. package/dist/components/Sidebar/components/Wrapper/Wrapper.d.ts +0 -3
  232. package/dist/components/Sidebar/components/index.d.ts +0 -15
  233. package/dist/components/Slider/Slider.d.ts +0 -3
  234. package/dist/components/Slider/Slider.types.d.ts +0 -13
  235. package/dist/components/Slider/Slider.types.js +0 -1
  236. package/dist/components/Slider/Slider.variants.d.ts +0 -11
  237. package/dist/components/Switch/Switch.d.ts +0 -3
  238. package/dist/components/Switch/Switch.types.d.ts +0 -10
  239. package/dist/components/Switch/Switch.types.js +0 -1
  240. package/dist/components/Switch/Switch.variants.d.ts +0 -6
  241. package/dist/components/Tag/Tag.d.ts +0 -3
  242. package/dist/components/Tag/Tag.types.d.ts +0 -4
  243. package/dist/components/Tag/Tag.types.js +0 -1
  244. package/dist/components/Tag/Tag.variants.d.ts +0 -3
  245. package/dist/components/TagSelect/TagSelect.d.ts +0 -3
  246. package/dist/components/TagSelect/TagSelect.types.d.ts +0 -9
  247. package/dist/components/TagSelect/TagSelect.types.js +0 -1
  248. package/dist/components/TagSelect/TagSelect.variants.d.ts +0 -9
  249. package/dist/components/TagSelect/hooks/useTagSelect.d.ts +0 -9
  250. package/dist/components/TextArea/TextArea.d.ts +0 -3
  251. package/dist/components/TextArea/TextArea.types.d.ts +0 -10
  252. package/dist/components/TextArea/TextArea.types.js +0 -1
  253. package/dist/components/TextArea/TextArea.variants.d.ts +0 -3
  254. package/dist/components/Toast/Toast.d.ts +0 -3
  255. package/dist/components/Toast/Toast.types.d.ts +0 -12
  256. package/dist/components/Toast/Toast.types.js +0 -1
  257. package/dist/components/Toast/Toast.variants.d.ts +0 -9
  258. package/dist/components/Tooltip/Tooltip.d.ts +0 -3
  259. package/dist/components/Tooltip/Tooltip.types.d.ts +0 -8
  260. package/dist/components/Tooltip/Tooltip.types.js +0 -1
  261. package/dist/components/Tooltip/Tooltip.variants.d.ts +0 -8
  262. package/dist/components/Tooltip/hooks/useTooltip.d.ts +0 -4
  263. package/dist/components/index.d.ts +0 -21
  264. package/dist/contexts/index.d.ts +0 -3
  265. package/dist/contexts/theme.context.d.ts +0 -6
  266. package/dist/contexts/theme.hook.d.ts +0 -7
  267. package/dist/contexts/theme.provider.d.ts +0 -6
  268. package/dist/hooks/index.d.ts +0 -1
  269. package/dist/hooks/useToggle.d.ts +0 -1
  270. package/dist/index-DoOsnuB6.js +0 -72
  271. package/dist/js.cookie-OLEfuq_g.js +0 -74
  272. package/dist/plugins/index.d.ts +0 -1
  273. package/dist/plugins/konstruct.d.ts +0 -4
  274. package/dist/plugins/utils/colors.d.ts +0 -328
  275. package/dist/styles.d.ts +0 -0
  276. package/dist/useBreadcrumb-DxYsZvj_.js +0 -1398
  277. package/dist/utils/index.d.ts +0 -4
@@ -0,0 +1,914 @@
1
+ import { Body as Cr } from "./components/Modal/components/Body/Body.js";
2
+ import { Footer as Mr } from "./components/Modal/components/Footer/Footer.js";
3
+ import { Header as _r } from "./components/Modal/components/Header/Header.js";
4
+ import { jsx as _, jsxs as ee } from "react/jsx-runtime";
5
+ import { r as kr } from "./index-BTeAm7mx.js";
6
+ import { R as Lr } from "./index-Z1voPZOH.js";
7
+ import S, { createContext as Rr, forwardRef as Ue, useState as re, useRef as ne, useCallback as W, useEffect as Wr, useMemo as Br, Fragment as Ur, PureComponent as Gr, Children as K, isValidElement as X } from "react";
8
+ import { p as l } from "./index-C5psggHV.js";
9
+ import { c as le, a as Hr, u as jr, R as Vr } from "./Combination-b348x__d.js";
10
+ import { cn as Ce } from "./utils/index.js";
11
+ import { useModal as Ge } from "./components/Modal/hooks/useModal.js";
12
+ import { buttonCloseVariants as qr, modalVariants as $r } from "./components/Modal/components/Wrapper/Wrapper.variants.js";
13
+ import { X as Kr } from "./x-DU-Zw-L_.js";
14
+ import { useTheme as Xr } from "./contexts/theme.hook.js";
15
+ function Yr(e, r) {
16
+ if (e == null) return {};
17
+ var n = {};
18
+ for (var t in e) if ({}.hasOwnProperty.call(e, t)) {
19
+ if (r.includes(t)) continue;
20
+ n[t] = e[t];
21
+ }
22
+ return n;
23
+ }
24
+ function U() {
25
+ return U = Object.assign ? Object.assign.bind() : function(e) {
26
+ for (var r = 1; r < arguments.length; r++) {
27
+ var n = arguments[r];
28
+ for (var t in n) ({}).hasOwnProperty.call(n, t) && (e[t] = n[t]);
29
+ }
30
+ return e;
31
+ }, U.apply(null, arguments);
32
+ }
33
+ var ie = "data-focus-lock", He = "data-focus-lock-disabled", zr = "data-no-focus-lock", Jr = "data-autofocus-inside", Qr = "data-no-autofocus", te = {
34
+ width: "1px",
35
+ height: "0px",
36
+ padding: 0,
37
+ overflow: "hidden",
38
+ position: "fixed",
39
+ top: "1px",
40
+ left: "1px"
41
+ }, je = le({}, function(e) {
42
+ var r = e.target, n = e.currentTarget;
43
+ return {
44
+ target: r,
45
+ currentTarget: n
46
+ };
47
+ }), Ve = le(), Zr = le(), en = Hr({
48
+ async: !0,
49
+ ssr: typeof document < "u"
50
+ }), rn = /* @__PURE__ */ Rr(void 0), nn = [], ve = /* @__PURE__ */ Ue(function(r, n) {
51
+ var t, o = re(), u = o[0], i = o[1], c = ne(), v = ne(!1), f = ne(null), b = re({}), s = b[1], a = r.children, p = r.disabled, d = p === void 0 ? !1 : p, m = r.noFocusGuards, F = m === void 0 ? !1 : m, x = r.persistentFocus, y = x === void 0 ? !1 : x, h = r.crossFrame, O = h === void 0 ? !0 : h, w = r.autoFocus, D = w === void 0 ? !0 : w, q = r.allowTextSelection, z = r.group, mr = r.className, pr = r.whiteList, br = r.hasPositiveIndices, Ie = r.shards, J = Ie === void 0 ? nn : Ie, Se = r.as, Ne = Se === void 0 ? "div" : Se, Te = r.lockProps, yr = Te === void 0 ? {} : Te, hr = r.sideCar, Pe = r.returnFocus, $ = Pe === void 0 ? !1 : Pe, Fr = r.focusOptions, Q = r.onActivation, Z = r.onDeactivation, gr = re({}), xr = gr[0], Or = W(function(I) {
52
+ var C = I.captureFocusRestore;
53
+ if (!f.current) {
54
+ var M, T = (M = document) == null ? void 0 : M.activeElement;
55
+ f.current = T, T !== document.body && (f.current = C(T));
56
+ }
57
+ c.current && Q && Q(c.current), v.current = !0, s();
58
+ }, [Q]), Er = W(function() {
59
+ v.current = !1, Z && Z(c.current), s();
60
+ }, [Z]), wr = W(function(I) {
61
+ var C = f.current;
62
+ if (C) {
63
+ var M = (typeof C == "function" ? C() : C) || document.body, T = typeof $ == "function" ? $(M) : $;
64
+ if (T) {
65
+ var De = typeof T == "object" ? T : void 0;
66
+ f.current = null, I ? Promise.resolve().then(function() {
67
+ return M.focus(De);
68
+ }) : M.focus(De);
69
+ }
70
+ }
71
+ }, [$]), Ir = W(function(I) {
72
+ v.current && je.useMedium(I);
73
+ }, []), Sr = Ve.useMedium, Nr = W(function(I) {
74
+ c.current !== I && (c.current = I, i(I));
75
+ }, []);
76
+ process.env.NODE_ENV !== "production" && (typeof q < "u" && console.warn("React-Focus-Lock: allowTextSelection is deprecated and enabled by default"), Wr(function() {
77
+ !c.current && typeof Ne != "string" && console.error("FocusLock: could not obtain ref to internal node");
78
+ }, []));
79
+ var Tr = U((t = {}, t[He] = d && "disabled", t[ie] = z, t), yr), Ae = F !== !0, Pr = Ae && F !== "tail", Ar = jr([n, Nr]), Dr = Br(function() {
80
+ return {
81
+ observed: c,
82
+ shards: J,
83
+ enabled: !d,
84
+ active: v.current
85
+ };
86
+ }, [d, v.current, J, u]);
87
+ return /* @__PURE__ */ S.createElement(Ur, null, Ae && [
88
+ /* @__PURE__ */ S.createElement("div", {
89
+ key: "guard-first",
90
+ "data-focus-guard": !0,
91
+ tabIndex: d ? -1 : 0,
92
+ style: te
93
+ }),
94
+ br ? /* @__PURE__ */ S.createElement("div", {
95
+ key: "guard-nearest",
96
+ "data-focus-guard": !0,
97
+ tabIndex: d ? -1 : 1,
98
+ style: te
99
+ }) : null
100
+ ], !d && /* @__PURE__ */ S.createElement(hr, {
101
+ id: xr,
102
+ sideCar: en,
103
+ observed: u,
104
+ disabled: d,
105
+ persistentFocus: y,
106
+ crossFrame: O,
107
+ autoFocus: D,
108
+ whiteList: pr,
109
+ shards: J,
110
+ onActivation: Or,
111
+ onDeactivation: Er,
112
+ returnFocus: wr,
113
+ focusOptions: Fr,
114
+ noFocusGuards: F
115
+ }), /* @__PURE__ */ S.createElement(Ne, U({
116
+ ref: Ar
117
+ }, Tr, {
118
+ className: mr,
119
+ onBlur: Sr,
120
+ onFocus: Ir
121
+ }), /* @__PURE__ */ S.createElement(rn.Provider, {
122
+ value: Dr
123
+ }, a)), Pr && /* @__PURE__ */ S.createElement("div", {
124
+ "data-focus-guard": !0,
125
+ tabIndex: d ? -1 : 0,
126
+ style: te
127
+ }));
128
+ });
129
+ ve.propTypes = process.env.NODE_ENV !== "production" ? {
130
+ children: l.node,
131
+ disabled: l.bool,
132
+ returnFocus: l.oneOfType([l.bool, l.object, l.func]),
133
+ focusOptions: l.object,
134
+ noFocusGuards: l.bool,
135
+ hasPositiveIndices: l.bool,
136
+ allowTextSelection: l.bool,
137
+ autoFocus: l.bool,
138
+ persistentFocus: l.bool,
139
+ crossFrame: l.bool,
140
+ group: l.string,
141
+ className: l.string,
142
+ whiteList: l.func,
143
+ shards: l.arrayOf(l.any),
144
+ as: l.oneOfType([l.string, l.func, l.object]),
145
+ lockProps: l.object,
146
+ onActivation: l.func,
147
+ onDeactivation: l.func,
148
+ sideCar: l.any.isRequired
149
+ } : {};
150
+ function ce(e, r) {
151
+ return ce = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, t) {
152
+ return n.__proto__ = t, n;
153
+ }, ce(e, r);
154
+ }
155
+ function tn(e, r) {
156
+ e.prototype = Object.create(r.prototype), e.prototype.constructor = e, ce(e, r);
157
+ }
158
+ function G(e) {
159
+ "@babel/helpers - typeof";
160
+ return G = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(r) {
161
+ return typeof r;
162
+ } : function(r) {
163
+ return r && typeof Symbol == "function" && r.constructor === Symbol && r !== Symbol.prototype ? "symbol" : typeof r;
164
+ }, G(e);
165
+ }
166
+ function on(e, r) {
167
+ if (G(e) != "object" || !e) return e;
168
+ var n = e[Symbol.toPrimitive];
169
+ if (n !== void 0) {
170
+ var t = n.call(e, r);
171
+ if (G(t) != "object") return t;
172
+ throw new TypeError("@@toPrimitive must return a primitive value.");
173
+ }
174
+ return (r === "string" ? String : Number)(e);
175
+ }
176
+ function un(e) {
177
+ var r = on(e, "string");
178
+ return G(r) == "symbol" ? r : r + "";
179
+ }
180
+ function an(e, r, n) {
181
+ return (r = un(r)) in e ? Object.defineProperty(e, r, {
182
+ value: n,
183
+ enumerable: !0,
184
+ configurable: !0,
185
+ writable: !0
186
+ }) : e[r] = n, e;
187
+ }
188
+ function cn(e, r) {
189
+ if (process.env.NODE_ENV !== "production") {
190
+ if (typeof e != "function")
191
+ throw new Error("Expected reducePropsToState to be a function.");
192
+ if (typeof r != "function")
193
+ throw new Error("Expected handleStateChangeOnClient to be a function.");
194
+ }
195
+ function n(t) {
196
+ return t.displayName || t.name || "Component";
197
+ }
198
+ return function(o) {
199
+ if (process.env.NODE_ENV !== "production" && typeof o != "function")
200
+ throw new Error("Expected WrappedComponent to be a React component.");
201
+ var u = [], i;
202
+ function c() {
203
+ i = e(u.map(function(f) {
204
+ return f.props;
205
+ })), r(i);
206
+ }
207
+ var v = /* @__PURE__ */ function(f) {
208
+ tn(b, f);
209
+ function b() {
210
+ return f.apply(this, arguments) || this;
211
+ }
212
+ b.peek = function() {
213
+ return i;
214
+ };
215
+ var s = b.prototype;
216
+ return s.componentDidMount = function() {
217
+ u.push(this), c();
218
+ }, s.componentDidUpdate = function() {
219
+ c();
220
+ }, s.componentWillUnmount = function() {
221
+ var p = u.indexOf(this);
222
+ u.splice(p, 1), c();
223
+ }, s.render = function() {
224
+ return /* @__PURE__ */ S.createElement(o, this.props);
225
+ }, b;
226
+ }(Gr);
227
+ return an(v, "displayName", "SideEffect(" + n(o) + ")"), v;
228
+ };
229
+ }
230
+ var E = function(e) {
231
+ for (var r = Array(e.length), n = 0; n < e.length; ++n)
232
+ r[n] = e[n];
233
+ return r;
234
+ }, A = function(e) {
235
+ return Array.isArray(e) ? e : [e];
236
+ }, qe = function(e) {
237
+ return Array.isArray(e) ? e[0] : e;
238
+ }, fn = function(e) {
239
+ if (e.nodeType !== Node.ELEMENT_NODE)
240
+ return !1;
241
+ var r = window.getComputedStyle(e, null);
242
+ return !r || !r.getPropertyValue ? !1 : r.getPropertyValue("display") === "none" || r.getPropertyValue("visibility") === "hidden";
243
+ }, $e = function(e) {
244
+ return e.parentNode && e.parentNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? (
245
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
246
+ e.parentNode.host
247
+ ) : e.parentNode;
248
+ }, Ke = function(e) {
249
+ return e === document || e && e.nodeType === Node.DOCUMENT_NODE;
250
+ }, sn = function(e) {
251
+ return e.hasAttribute("inert");
252
+ }, dn = function(e, r) {
253
+ return !e || Ke(e) || !fn(e) && !sn(e) && r($e(e));
254
+ }, Xe = function(e, r) {
255
+ var n = e.get(r);
256
+ if (n !== void 0)
257
+ return n;
258
+ var t = dn(r, Xe.bind(void 0, e));
259
+ return e.set(r, t), t;
260
+ }, ln = function(e, r) {
261
+ return e && !Ke(e) ? pn(e) ? r($e(e)) : !1 : !0;
262
+ }, Ye = function(e, r) {
263
+ var n = e.get(r);
264
+ if (n !== void 0)
265
+ return n;
266
+ var t = ln(r, Ye.bind(void 0, e));
267
+ return e.set(r, t), t;
268
+ }, ze = function(e) {
269
+ return e.dataset;
270
+ }, vn = function(e) {
271
+ return e.tagName === "BUTTON";
272
+ }, Je = function(e) {
273
+ return e.tagName === "INPUT";
274
+ }, Qe = function(e) {
275
+ return Je(e) && e.type === "radio";
276
+ }, mn = function(e) {
277
+ return !((Je(e) || vn(e)) && (e.type === "hidden" || e.disabled));
278
+ }, pn = function(e) {
279
+ var r = e.getAttribute(Qr);
280
+ return ![!0, "true", ""].includes(r);
281
+ }, me = function(e) {
282
+ var r;
283
+ return !!(e && (!((r = ze(e)) === null || r === void 0) && r.focusGuard));
284
+ }, fe = function(e) {
285
+ return !me(e);
286
+ }, bn = function(e) {
287
+ return !!e;
288
+ }, yn = function(e, r) {
289
+ var n = Math.max(0, e.tabIndex), t = Math.max(0, r.tabIndex), o = n - t, u = e.index - r.index;
290
+ if (o) {
291
+ if (!n)
292
+ return 1;
293
+ if (!t)
294
+ return -1;
295
+ }
296
+ return o || u;
297
+ }, hn = function(e) {
298
+ return e.tabIndex < 0 && !e.hasAttribute("tabindex") ? 0 : e.tabIndex;
299
+ }, pe = function(e, r, n) {
300
+ return E(e).map(function(t, o) {
301
+ var u = hn(t);
302
+ return {
303
+ node: t,
304
+ index: o,
305
+ tabIndex: n && u === -1 ? (t.dataset || {}).focusGuard ? 0 : -1 : u
306
+ };
307
+ }).filter(function(t) {
308
+ return !r || t.tabIndex >= 0;
309
+ }).sort(yn);
310
+ }, Fn = [
311
+ "button:enabled",
312
+ "select:enabled",
313
+ "textarea:enabled",
314
+ "input:enabled",
315
+ // elements with explicit roles will also use explicit tabindex
316
+ // '[role="button"]',
317
+ "a[href]",
318
+ "area[href]",
319
+ "summary",
320
+ "iframe",
321
+ "object",
322
+ "embed",
323
+ "audio[controls]",
324
+ "video[controls]",
325
+ "[tabindex]",
326
+ "[contenteditable]",
327
+ "[autofocus]"
328
+ ], be = Fn.join(","), gn = "".concat(be, ", [data-focus-guard]"), Ze = function(e, r) {
329
+ return E((e.shadowRoot || e).children).reduce(function(n, t) {
330
+ return n.concat(t.matches(r ? gn : be) ? [t] : [], Ze(t));
331
+ }, []);
332
+ }, xn = function(e, r) {
333
+ var n;
334
+ return e instanceof HTMLIFrameElement && (!((n = e.contentDocument) === null || n === void 0) && n.body) ? R([e.contentDocument.body], r) : [e];
335
+ }, R = function(e, r) {
336
+ return e.reduce(function(n, t) {
337
+ var o, u = Ze(t, r), i = (o = []).concat.apply(o, u.map(function(c) {
338
+ return xn(c, r);
339
+ }));
340
+ return n.concat(
341
+ // add all tabbables inside and within shadow DOMs in DOM order
342
+ i,
343
+ // add if node is tabbable itself
344
+ t.parentNode ? E(t.parentNode.querySelectorAll(be)).filter(function(c) {
345
+ return c === t;
346
+ }) : []
347
+ );
348
+ }, []);
349
+ }, On = function(e) {
350
+ var r = e.querySelectorAll("[".concat(Jr, "]"));
351
+ return E(r).map(function(n) {
352
+ return R([n]);
353
+ }).reduce(function(n, t) {
354
+ return n.concat(t);
355
+ }, []);
356
+ }, ye = function(e, r) {
357
+ return E(e).filter(function(n) {
358
+ return Xe(r, n);
359
+ }).filter(function(n) {
360
+ return mn(n);
361
+ });
362
+ }, Me = function(e, r) {
363
+ return r === void 0 && (r = /* @__PURE__ */ new Map()), E(e).filter(function(n) {
364
+ return Ye(r, n);
365
+ });
366
+ }, he = function(e, r, n) {
367
+ return pe(ye(R(e, n), r), !0, n);
368
+ }, H = function(e, r) {
369
+ return pe(ye(R(e), r), !1);
370
+ }, En = function(e, r) {
371
+ return ye(On(e), r);
372
+ }, P = function(e, r) {
373
+ return e.shadowRoot ? P(e.shadowRoot, r) : Object.getPrototypeOf(e).contains !== void 0 && Object.getPrototypeOf(e).contains.call(e, r) ? !0 : E(e.children).some(function(n) {
374
+ var t;
375
+ if (n instanceof HTMLIFrameElement) {
376
+ var o = (t = n.contentDocument) === null || t === void 0 ? void 0 : t.body;
377
+ return o ? P(o, r) : !1;
378
+ }
379
+ return P(n, r);
380
+ });
381
+ }, wn = function(e) {
382
+ for (var r = /* @__PURE__ */ new Set(), n = e.length, t = 0; t < n; t += 1)
383
+ for (var o = t + 1; o < n; o += 1) {
384
+ var u = e[t].compareDocumentPosition(e[o]);
385
+ (u & Node.DOCUMENT_POSITION_CONTAINED_BY) > 0 && r.add(o), (u & Node.DOCUMENT_POSITION_CONTAINS) > 0 && r.add(t);
386
+ }
387
+ return e.filter(function(i, c) {
388
+ return !r.has(c);
389
+ });
390
+ }, er = function(e) {
391
+ return e.parentNode ? er(e.parentNode) : e;
392
+ }, Fe = function(e) {
393
+ var r = A(e);
394
+ return r.filter(Boolean).reduce(function(n, t) {
395
+ var o = t.getAttribute(ie);
396
+ return n.push.apply(n, o ? wn(E(er(t).querySelectorAll("[".concat(ie, '="').concat(o, '"]:not([').concat(He, '="disabled"])')))) : [t]), n;
397
+ }, []);
398
+ }, In = function(e) {
399
+ try {
400
+ return e();
401
+ } catch {
402
+ return;
403
+ }
404
+ }, j = function(e) {
405
+ if (e === void 0 && (e = document), !(!e || !e.activeElement)) {
406
+ var r = e.activeElement;
407
+ return r.shadowRoot ? j(r.shadowRoot) : r instanceof HTMLIFrameElement && In(function() {
408
+ return r.contentWindow.document;
409
+ }) ? j(r.contentWindow.document) : r;
410
+ }
411
+ }, Sn = function(e, r) {
412
+ return e === r;
413
+ }, Nn = function(e, r) {
414
+ return !!E(e.querySelectorAll("iframe")).some(function(n) {
415
+ return Sn(n, r);
416
+ });
417
+ }, rr = function(e, r) {
418
+ return r === void 0 && (r = j(qe(e).ownerDocument)), !r || r.dataset && r.dataset.focusGuard ? !1 : Fe(e).some(function(n) {
419
+ return P(n, r) || Nn(n, r);
420
+ });
421
+ }, Tn = function(e) {
422
+ e === void 0 && (e = document);
423
+ var r = j(e);
424
+ return r ? E(e.querySelectorAll("[".concat(zr, "]"))).some(function(n) {
425
+ return P(n, r);
426
+ }) : !1;
427
+ }, Pn = function(e, r) {
428
+ return r.filter(Qe).filter(function(n) {
429
+ return n.name === e.name;
430
+ }).filter(function(n) {
431
+ return n.checked;
432
+ })[0] || e;
433
+ }, ge = function(e, r) {
434
+ return Qe(e) && e.name ? Pn(e, r) : e;
435
+ }, An = function(e) {
436
+ var r = /* @__PURE__ */ new Set();
437
+ return e.forEach(function(n) {
438
+ return r.add(ge(n, e));
439
+ }), e.filter(function(n) {
440
+ return r.has(n);
441
+ });
442
+ }, _e = function(e) {
443
+ return e[0] && e.length > 1 ? ge(e[0], e) : e[0];
444
+ }, ke = function(e, r) {
445
+ return e.indexOf(ge(r, e));
446
+ }, se = "NEW_FOCUS", Dn = function(e, r, n, t, o) {
447
+ var u = e.length, i = e[0], c = e[u - 1], v = me(t);
448
+ if (!(t && e.indexOf(t) >= 0)) {
449
+ var f = t !== void 0 ? n.indexOf(t) : -1, b = o ? n.indexOf(o) : f, s = o ? e.indexOf(o) : -1;
450
+ if (f === -1)
451
+ return s !== -1 ? s : se;
452
+ if (s === -1)
453
+ return se;
454
+ var a = f - b, p = n.indexOf(i), d = n.indexOf(c), m = An(n), F = t !== void 0 ? m.indexOf(t) : -1, x = o ? m.indexOf(o) : F, y = m.filter(function(z) {
455
+ return z.tabIndex >= 0;
456
+ }), h = t !== void 0 ? y.indexOf(t) : -1, O = o ? y.indexOf(o) : h, w = h >= 0 && O >= 0 ? (
457
+ // old/new are tabbables, measure distance in tabbable space
458
+ O - h
459
+ ) : (
460
+ // or else measure in focusable space
461
+ x - F
462
+ );
463
+ if (!a && s >= 0 || r.length === 0)
464
+ return s;
465
+ var D = ke(e, r[0]), q = ke(e, r[r.length - 1]);
466
+ if (f <= p && v && Math.abs(a) > 1)
467
+ return q;
468
+ if (f >= d && v && Math.abs(a) > 1)
469
+ return D;
470
+ if (a && Math.abs(w) > 1)
471
+ return s;
472
+ if (f <= p)
473
+ return q;
474
+ if (f > d)
475
+ return D;
476
+ if (a)
477
+ return Math.abs(a) > 1 ? s : (u + s + a) % u;
478
+ }
479
+ }, Cn = function(e) {
480
+ return function(r) {
481
+ var n, t = (n = ze(r)) === null || n === void 0 ? void 0 : n.autofocus;
482
+ return (
483
+ // @ts-expect-error
484
+ r.autofocus || //
485
+ t !== void 0 && t !== "false" || //
486
+ e.indexOf(r) >= 0
487
+ );
488
+ };
489
+ }, Le = function(e, r, n) {
490
+ var t = e.map(function(u) {
491
+ var i = u.node;
492
+ return i;
493
+ }), o = Me(t.filter(Cn(n)));
494
+ return o && o.length ? _e(o) : _e(Me(r));
495
+ }, de = function(e, r) {
496
+ return r === void 0 && (r = []), r.push(e), e.parentNode && de(e.parentNode.host || e.parentNode, r), r;
497
+ }, oe = function(e, r) {
498
+ for (var n = de(e), t = de(r), o = 0; o < n.length; o += 1) {
499
+ var u = n[o];
500
+ if (t.indexOf(u) >= 0)
501
+ return u;
502
+ }
503
+ return !1;
504
+ }, nr = function(e, r, n) {
505
+ var t = A(e), o = A(r), u = t[0], i = !1;
506
+ return o.filter(Boolean).forEach(function(c) {
507
+ i = oe(i || c, c) || i, n.filter(Boolean).forEach(function(v) {
508
+ var f = oe(u, v);
509
+ f && (!i || P(f, i) ? i = f : i = oe(f, i));
510
+ });
511
+ }), i;
512
+ }, Re = function(e, r) {
513
+ return e.reduce(function(n, t) {
514
+ return n.concat(En(t, r));
515
+ }, []);
516
+ }, Mn = function(e, r) {
517
+ var n = /* @__PURE__ */ new Map();
518
+ return r.forEach(function(t) {
519
+ return n.set(t.node, t);
520
+ }), e.map(function(t) {
521
+ return n.get(t);
522
+ }).filter(bn);
523
+ }, _n = function(e, r) {
524
+ var n = j(A(e).length > 0 ? document : qe(e).ownerDocument), t = Fe(e).filter(fe), o = nr(n || e, e, t), u = /* @__PURE__ */ new Map(), i = H(t, u), c = i.filter(function(d) {
525
+ var m = d.node;
526
+ return fe(m);
527
+ });
528
+ if (c[0]) {
529
+ var v = H([o], u).map(function(d) {
530
+ var m = d.node;
531
+ return m;
532
+ }), f = Mn(v, c), b = f.map(function(d) {
533
+ var m = d.node;
534
+ return m;
535
+ }), s = f.filter(function(d) {
536
+ var m = d.tabIndex;
537
+ return m >= 0;
538
+ }).map(function(d) {
539
+ var m = d.node;
540
+ return m;
541
+ }), a = Dn(b, s, v, n, r);
542
+ if (a === se) {
543
+ var p = (
544
+ // first try only tabbable, and the fallback to all focusable, as long as at least one element should be picked for focus
545
+ Le(i, s, Re(t, u)) || Le(i, b, Re(t, u))
546
+ );
547
+ if (p)
548
+ return { node: p };
549
+ console.warn("focus-lock: cannot find any node to move focus into");
550
+ return;
551
+ }
552
+ return a === void 0 ? a : f[a];
553
+ }
554
+ }, kn = function(e) {
555
+ var r = Fe(e).filter(fe), n = nr(e, e, r), t = pe(R([n], !0), !0, !0), o = R(r, !1);
556
+ return t.map(function(u) {
557
+ var i = u.node, c = u.index;
558
+ return {
559
+ node: i,
560
+ index: c,
561
+ lockItem: o.indexOf(i) >= 0,
562
+ guard: me(i)
563
+ };
564
+ });
565
+ }, xe = function(e, r) {
566
+ e && ("focus" in e && e.focus(r), "contentWindow" in e && e.contentWindow && e.contentWindow.focus());
567
+ }, ue = 0, ae = !1, tr = function(e, r, n) {
568
+ n === void 0 && (n = {});
569
+ var t = _n(e, r);
570
+ if (!ae && t) {
571
+ if (ue > 2) {
572
+ console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"), ae = !0, setTimeout(function() {
573
+ ae = !1;
574
+ }, 1);
575
+ return;
576
+ }
577
+ ue++, xe(t.node, n.focusOptions), ue--;
578
+ }
579
+ };
580
+ function B(e) {
581
+ if (!e)
582
+ return null;
583
+ if (typeof WeakRef > "u")
584
+ return function() {
585
+ return e || null;
586
+ };
587
+ var r = e ? new WeakRef(e) : null;
588
+ return function() {
589
+ return (r == null ? void 0 : r.deref()) || null;
590
+ };
591
+ }
592
+ var Ln = function(e) {
593
+ if (!e)
594
+ return null;
595
+ for (var r = [], n = e; n && n !== document.body; )
596
+ r.push({
597
+ current: B(n),
598
+ parent: B(n.parentElement),
599
+ left: B(n.previousElementSibling),
600
+ right: B(n.nextElementSibling)
601
+ }), n = n.parentElement;
602
+ return {
603
+ element: B(e),
604
+ stack: r,
605
+ ownerDocument: e.ownerDocument
606
+ };
607
+ }, Rn = function(e) {
608
+ var r, n, t, o, u;
609
+ if (e)
610
+ for (var i = e.stack, c = e.ownerDocument, v = /* @__PURE__ */ new Map(), f = 0, b = i; f < b.length; f++) {
611
+ var s = b[f], a = (r = s.parent) === null || r === void 0 ? void 0 : r.call(s);
612
+ if (a && c.contains(a)) {
613
+ for (var p = (n = s.left) === null || n === void 0 ? void 0 : n.call(s), d = s.current(), m = a.contains(d) ? d : void 0, F = (t = s.right) === null || t === void 0 ? void 0 : t.call(s), x = he([a], v), y = (
614
+ // that is element itself
615
+ (u = (o = m ?? // or something in it's place
616
+ (p == null ? void 0 : p.nextElementSibling)) !== null && o !== void 0 ? o : (
617
+ // or somebody to the right, still close enough
618
+ F
619
+ )) !== null && u !== void 0 ? u : (
620
+ // or somebody to the left, something?
621
+ p
622
+ )
623
+ ); y; ) {
624
+ for (var h = 0, O = x; h < O.length; h++) {
625
+ var w = O[h];
626
+ if (y != null && y.contains(w.node))
627
+ return w.node;
628
+ }
629
+ y = y.nextElementSibling;
630
+ }
631
+ if (x.length)
632
+ return x[0].node;
633
+ }
634
+ }
635
+ }, or = function(e) {
636
+ var r = Ln(e);
637
+ return function() {
638
+ return Rn(r);
639
+ };
640
+ }, Wn = function(e, r, n) {
641
+ if (!e || !r)
642
+ return console.error("no element or scope given"), {};
643
+ var t = A(r);
644
+ if (t.every(function(i) {
645
+ return !P(i, e);
646
+ }))
647
+ return console.error("Active element is not contained in the scope"), {};
648
+ var o = n ? he(t, /* @__PURE__ */ new Map()) : H(t, /* @__PURE__ */ new Map()), u = o.findIndex(function(i) {
649
+ var c = i.node;
650
+ return c === e;
651
+ });
652
+ if (u !== -1)
653
+ return {
654
+ prev: o[u - 1],
655
+ next: o[u + 1],
656
+ first: o[0],
657
+ last: o[o.length - 1]
658
+ };
659
+ }, Bn = function(e, r) {
660
+ var n = r ? he(A(e), /* @__PURE__ */ new Map()) : H(A(e), /* @__PURE__ */ new Map());
661
+ return {
662
+ first: n[0],
663
+ last: n[n.length - 1]
664
+ };
665
+ }, Un = function(e) {
666
+ return Object.assign({
667
+ scope: document.body,
668
+ cycle: !0,
669
+ onlyTabbable: !0
670
+ }, e);
671
+ }, ur = function(e, r, n) {
672
+ r === void 0 && (r = {});
673
+ var t = Un(r), o = Wn(e, t.scope, t.onlyTabbable);
674
+ if (o) {
675
+ var u = n(o, t.cycle);
676
+ u && xe(u.node, t.focusOptions);
677
+ }
678
+ }, Gn = function(e, r) {
679
+ r === void 0 && (r = {}), ur(e, r, function(n, t) {
680
+ var o = n.next, u = n.first;
681
+ return o || t && u;
682
+ });
683
+ }, Hn = function(e, r) {
684
+ r === void 0 && (r = {}), ur(e, r, function(n, t) {
685
+ var o = n.prev, u = n.last;
686
+ return o || t && u;
687
+ });
688
+ }, ar = function(e, r, n) {
689
+ var t, o = Bn(e, (t = r.onlyTabbable) !== null && t !== void 0 ? t : !0), u = o[n];
690
+ u && xe(u.node, r.focusOptions);
691
+ }, jn = function(e, r) {
692
+ r === void 0 && (r = {}), ar(e, r, "first");
693
+ }, Vn = function(e, r) {
694
+ r === void 0 && (r = {}), ar(e, r, "last");
695
+ };
696
+ function Oe(e) {
697
+ setTimeout(e, 1);
698
+ }
699
+ var qn = function(r) {
700
+ return r && "current" in r ? r.current : r;
701
+ }, ir = function() {
702
+ return document && document.activeElement === document.body;
703
+ }, $n = function() {
704
+ return ir() || Tn();
705
+ }, k = null, g = null, We = function() {
706
+ return null;
707
+ }, L = null, V = !1, Ee = !1, Kn = function() {
708
+ return !0;
709
+ }, Xn = function(r) {
710
+ return (k.whiteList || Kn)(r);
711
+ }, Yn = function(r, n) {
712
+ L = {
713
+ observerNode: r,
714
+ portaledElement: n
715
+ };
716
+ }, zn = function(r) {
717
+ return L && L.portaledElement === r;
718
+ };
719
+ function Be(e, r, n, t) {
720
+ var o = null, u = e;
721
+ do {
722
+ var i = t[u];
723
+ if (i.guard)
724
+ i.node.dataset.focusAutoGuard && (o = i);
725
+ else if (i.lockItem) {
726
+ if (u !== e)
727
+ return;
728
+ o = null;
729
+ } else
730
+ break;
731
+ } while ((u += n) !== r);
732
+ o && (o.node.tabIndex = 0);
733
+ }
734
+ var Jn = function(r) {
735
+ return r ? !!V : V === "meanwhile";
736
+ }, Qn = function e(r, n, t) {
737
+ return n && (n.host === r && (!n.activeElement || t.contains(n.activeElement)) || n.parentNode && e(r, n.parentNode, t));
738
+ }, Zn = function(r, n) {
739
+ return n.some(function(t) {
740
+ return Qn(r, t, t);
741
+ });
742
+ }, cr = function(r) {
743
+ return H(r, /* @__PURE__ */ new Map());
744
+ }, et = function(r) {
745
+ return !cr([r.parentNode]).some(function(n) {
746
+ return n.node === r;
747
+ });
748
+ }, Y = function() {
749
+ var r = !1;
750
+ if (k) {
751
+ var n = k, t = n.observed, o = n.persistentFocus, u = n.autoFocus, i = n.shards, c = n.crossFrame, v = n.focusOptions, f = n.noFocusGuards, b = t || L && L.portaledElement;
752
+ if (ir() && g && g !== document.body && (!document.body.contains(g) || et(g))) {
753
+ var s = We();
754
+ s && s.focus();
755
+ }
756
+ var a = document && document.activeElement;
757
+ if (b) {
758
+ var p = [b].concat(i.map(qn).filter(Boolean)), d = function() {
759
+ if (!Jn(c) || !f || !g || Ee)
760
+ return !1;
761
+ var h = cr(p), O = h.findIndex(function(w) {
762
+ var D = w.node;
763
+ return D === g;
764
+ });
765
+ return O === 0 || O === h.length - 1;
766
+ };
767
+ if ((!a || Xn(a)) && (o || d() || !$n() || !g && u) && (b && !(rr(p) || a && Zn(a, p) || zn(a)) && (document && !g && a && !u ? (a.blur && a.blur(), document.body.focus()) : (r = tr(p, g, {
768
+ focusOptions: v
769
+ }), L = {})), g = document && document.activeElement, g !== document.body && (We = or(g)), V = !1), document && a !== document.activeElement && document.querySelector("[data-focus-auto-guard]")) {
770
+ var m = document && document.activeElement, F = kn(p), x = F.map(function(y) {
771
+ var h = y.node;
772
+ return h;
773
+ }).indexOf(m);
774
+ x > -1 && (F.filter(function(y) {
775
+ var h = y.guard, O = y.node;
776
+ return h && O.dataset.focusAutoGuard;
777
+ }).forEach(function(y) {
778
+ var h = y.node;
779
+ return h.removeAttribute("tabIndex");
780
+ }), Be(x, F.length, 1, F), Be(x, -1, -1, F));
781
+ }
782
+ }
783
+ }
784
+ return r;
785
+ }, fr = function(r) {
786
+ Y() && r && (r.stopPropagation(), r.preventDefault());
787
+ }, we = function() {
788
+ return Oe(Y);
789
+ }, rt = function(r) {
790
+ var n = r.target, t = r.currentTarget;
791
+ t.contains(n) || Yn(t, n);
792
+ }, nt = function() {
793
+ return null;
794
+ }, sr = function() {
795
+ Ee = !0;
796
+ }, dr = function() {
797
+ Ee = !1, V = "just", Oe(function() {
798
+ V = "meanwhile";
799
+ });
800
+ }, tt = function() {
801
+ document.addEventListener("focusin", fr), document.addEventListener("focusout", we), window.addEventListener("focus", sr), window.addEventListener("blur", dr);
802
+ }, ot = function() {
803
+ document.removeEventListener("focusin", fr), document.removeEventListener("focusout", we), window.removeEventListener("focus", sr), window.removeEventListener("blur", dr);
804
+ };
805
+ function ut(e) {
806
+ return e.filter(function(r) {
807
+ var n = r.disabled;
808
+ return !n;
809
+ });
810
+ }
811
+ var lr = {
812
+ moveFocusInside: tr,
813
+ focusInside: rr,
814
+ focusNextElement: Gn,
815
+ focusPrevElement: Hn,
816
+ focusFirstElement: jn,
817
+ focusLastElement: Vn,
818
+ captureFocusRestore: or
819
+ };
820
+ function at(e) {
821
+ var r = e.slice(-1)[0];
822
+ r && !k && tt();
823
+ var n = k, t = n && r && r.id === n.id;
824
+ k = r, n && !t && (n.onDeactivation(), e.filter(function(o) {
825
+ var u = o.id;
826
+ return u === n.id;
827
+ }).length || n.returnFocus(!r)), r ? (g = null, (!t || n.observed !== r.observed) && r.onActivation(lr), Y(), Oe(Y)) : (ot(), g = null);
828
+ }
829
+ je.assignSyncMedium(rt);
830
+ Ve.assignMedium(we);
831
+ Zr.assignMedium(function(e) {
832
+ return e(lr);
833
+ });
834
+ const it = cn(ut, at)(nt);
835
+ var vr = /* @__PURE__ */ Ue(function(r, n) {
836
+ return /* @__PURE__ */ S.createElement(ve, U({
837
+ sideCar: it,
838
+ ref: n
839
+ }, r));
840
+ }), ct = ve.propTypes || {}, ft = Yr(ct, ["sideCar"]);
841
+ vr.propTypes = process.env.NODE_ENV !== "production" ? ft : {};
842
+ const st = ({
843
+ children: e,
844
+ theme: r,
845
+ className: n,
846
+ buttonCloseClassName: t
847
+ }) => {
848
+ const { content: o, onClose: u, closeBtnRef: i } = Ge(), { theme: c } = Xr(), v = K.toArray(e).find(
849
+ (a) => X(a) && a.type === N.Header
850
+ ), f = K.toArray(e).find(
851
+ (a) => X(a) && a.type === N.Body
852
+ ), b = K.toArray(e).find(
853
+ (a) => X(a) && a.type === N.Footer
854
+ ), s = K.toArray(e).filter(
855
+ (a) => !X(a) || ![N.Header, N.Body, N.Footer].includes(
856
+ a.type
857
+ )
858
+ );
859
+ return /* @__PURE__ */ _(vr, { returnFocus: !0, children: /* @__PURE__ */ _(Vr, { children: /* @__PURE__ */ ee("div", { className: "fixed inset-0 grid place-content-center", children: [
860
+ /* @__PURE__ */ _(
861
+ "div",
862
+ {
863
+ className: "absolute inset-0 bg-black opacity-75",
864
+ onClick: u,
865
+ role: "presentation"
866
+ }
867
+ ),
868
+ /* @__PURE__ */ ee(
869
+ "div",
870
+ {
871
+ className: Ce(
872
+ $r({
873
+ className: n,
874
+ theme: r ?? c
875
+ })
876
+ ),
877
+ role: "dialog",
878
+ "aria-modal": "true",
879
+ children: [
880
+ v,
881
+ /* @__PURE__ */ ee(
882
+ "button",
883
+ {
884
+ ref: i,
885
+ className: Ce(
886
+ qr({
887
+ className: t,
888
+ theme: r ?? c
889
+ })
890
+ ),
891
+ onClick: u,
892
+ children: [
893
+ /* @__PURE__ */ _(Kr, {}),
894
+ /* @__PURE__ */ _(Lr, { children: "Dismiss modal" })
895
+ ]
896
+ }
897
+ ),
898
+ f ?? s ?? o,
899
+ b
900
+ ]
901
+ }
902
+ )
903
+ ] }) }) });
904
+ }, N = ({ ...e }) => {
905
+ const { isOpen: r } = Ge();
906
+ return r ? kr.createPortal(/* @__PURE__ */ _(st, { ...e }), document.body) : null;
907
+ };
908
+ N.Header = _r;
909
+ N.Body = Cr;
910
+ N.Footer = Mr;
911
+ export {
912
+ N as M,
913
+ st as W
914
+ };