@stihl-design-system/components 1.0.0-RC.32 → 1.0.0-RC.34

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 (251) hide show
  1. package/accordion.Dmqocj97.js +12 -0
  2. package/actionbutton.DLQJU6AV.js +12 -0
  3. package/actionlink.DEBrWfN3.js +12 -0
  4. package/{arialiveregions.Fgcshs5k.js → arialiveregions.BUVY9NpY.js} +2 -2
  5. package/assets/Accordion.CzBGud45.css +1 -0
  6. package/assets/Button.C8sNwIeW.css +1 -0
  7. package/assets/Checkbox.CyOw3rXI.css +1 -0
  8. package/assets/CustomReactSelect.E_jJFVew.css +1 -0
  9. package/assets/Dialog.DJkn65Es.css +1 -0
  10. package/assets/Drawer.x3BCQvWE.css +1 -0
  11. package/assets/InputFile.BnIvK65P.css +1 -0
  12. package/assets/InputNumber.BoiCIR1f.css +1 -0
  13. package/assets/InputPassword.Dk3_vNLV.css +1 -0
  14. package/assets/InputSearch.C1_4cVCi.css +1 -0
  15. package/assets/LinkButton.B86yacK5.css +1 -0
  16. package/assets/{MegaMenu.DX9gChtY.css → MegaMenu.D5EtjFeL.css} +1 -1
  17. package/assets/Notification.CvohYEvT.css +1 -0
  18. package/assets/Select.COxLltX7.css +1 -0
  19. package/assets/Slider.DPEmJ3HD.css +1 -0
  20. package/assets/Stepper.tXJl15yL.css +1 -0
  21. package/assets/{SystemFeedback.RcrPepSZ.css → SystemFeedback.PKzqnXUe.css} +1 -1
  22. package/assets/Textarea.y3MW7VW0.css +1 -0
  23. package/assets/Toast.CGyKXb4V.css +1 -0
  24. package/assets/buttonround.BN3vUDc_.css +1 -0
  25. package/assets/input.DTu4g_iA.css +1 -0
  26. package/assets/step.BeLporJO.css +1 -0
  27. package/assets/switch.B9B-n_3y.css +1 -0
  28. package/{asterisk.CR60hx8S.js → asterisk.B2ih8VwF.js} +1 -1
  29. package/{banner.o4Etkjjo.js → banner.CI5HnDqD.js} +3 -3
  30. package/breadcrumb.CtwAux3P.js +11 -0
  31. package/button.DHuKanZP.js +13 -0
  32. package/{buttonround.ChKWHzsv.js → buttonround.CMlmEDaN.js} +6 -6
  33. package/checkbox.DwccD0Mp.js +12 -0
  34. package/checkboxgroup.ZiUFfCJ1.js +9 -0
  35. package/chip.B0s_fS8L.js +12 -0
  36. package/chipgroup.Dpu66bo5.js +143 -0
  37. package/chunks/Accordion.CYIfNOWr.js +168 -0
  38. package/chunks/{ActionButton.DdDesD7K.js → ActionButton.DOYsEHPr.js} +37 -37
  39. package/chunks/{ActionLink.DqAsPYda.js → ActionLink.DbyciN3Y.js} +36 -36
  40. package/chunks/{AriaLiveRegions.utils.Cb327d_2.js → AriaLiveRegions.utils.CybNIBSa.js} +2 -2
  41. package/chunks/{Breadcrumb.9KinNuyQ.js → Breadcrumb.BgnpTo01.js} +35 -37
  42. package/chunks/{Button.Cf1CKq8N.js → Button.DCZgBNmA.js} +8 -8
  43. package/chunks/Checkbox.BcGXAuuP.js +88 -0
  44. package/chunks/{CheckboxGroup.Cj68J6Ee.js → CheckboxGroup.BuFd1luB.js} +5 -5
  45. package/chunks/{Chip.BrbYu6i_.js → Chip.D6pubCZV.js} +6 -6
  46. package/chunks/{CustomReactSelect.Cqq70QC0.js → CustomReactSelect.Dg3wC_VH.js} +450 -447
  47. package/chunks/Dialog.DpqSVrYR.js +102 -0
  48. package/chunks/Drawer.DISWybOa.js +107 -0
  49. package/chunks/{Fieldset.D7cLR5ze.js → Fieldset.DiMtr6Vw.js} +6 -6
  50. package/chunks/Header.7TQL_J9t.js +370 -0
  51. package/chunks/{Icon.NSsVrYeq.js → Icon.CDLyB7Pv.js} +77 -79
  52. package/chunks/{Input.utils.Cnnzvuk4.js → Input.utils.Dkw7gRrr.js} +17 -17
  53. package/chunks/InputFile.C8nt9Fu8.js +218 -0
  54. package/chunks/InputNumber.CbH1XJfl.js +267 -0
  55. package/chunks/{InputPassword.Da3hEKTc.js → InputPassword.DbdjuSiJ.js} +34 -34
  56. package/chunks/InputSearch.joxmugiv.js +173 -0
  57. package/chunks/{LinkButton.59oNDwPU.js → LinkButton.BZgIGgc8.js} +7 -7
  58. package/chunks/MegaMenu.CQbOeaib.js +189 -0
  59. package/chunks/NavigationTabList.G_l0GiUa.js +67 -0
  60. package/chunks/{NavigationTabs.DspPFHPh.js → NavigationTabs.BwM-6CRm.js} +13 -14
  61. package/chunks/Notification.CrojkJ0E.js +91 -0
  62. package/chunks/Popover.Bb0Pjmvg.js +215 -0
  63. package/chunks/{RadioGroup.DeTz3c19.js → RadioGroup.CexC4v2Z.js} +5 -5
  64. package/chunks/Select.BEIdNMML.js +164 -0
  65. package/chunks/{Slider.84lkgq3W.js → Slider.CR0zYHeZ.js} +83 -84
  66. package/chunks/Stepper.PTQdQBYf.js +152 -0
  67. package/chunks/{SystemFeedback.CyGbUCzT.js → SystemFeedback.CjlARKki.js} +9 -9
  68. package/chunks/Tabs.DyP4whX0.js +83 -0
  69. package/chunks/{Text.DGWeWF1y.js → Text.DpRtTpB4.js} +3 -3
  70. package/chunks/Textarea.Du2RII5u.js +168 -0
  71. package/chunks/Toast.ug_RjGgF.js +76 -0
  72. package/chunks/{arrow-clockwise.BefOjGPg.js → arrow-clockwise.C4iOgjOc.js} +1 -1
  73. package/chunks/{arrow-counterclockwise.C7Ov32BZ.js → arrow-counterclockwise.CgQAuBUe.js} +1 -1
  74. package/chunks/{circle-check-colored.Bye_GwLy.js → circle-check-colored.qP2s3vjI.js} +1 -1
  75. package/chunks/{diamond-exclamationmark-colored.WNKYwZ8q.js → diamond-exclamationmark-colored.CzYiaTZ0.js} +1 -1
  76. package/chunks/feather.l1E4nFBx.js +10 -0
  77. package/chunks/file-type-doc.B_RSSYbu.js +10 -0
  78. package/chunks/floating-ui.dom.BT8pKtCQ.js +1005 -0
  79. package/chunks/floating-ui.react.3FjeMiuN.js +1999 -0
  80. package/chunks/helpers.CexwVao7.js +38 -0
  81. package/chunks/{index.CgTHIF3K.js → index.D-sRdssb.js} +1 -1
  82. package/chunks/{index.CEyLAtio.js → index.DL9mof6u.js} +2 -2
  83. package/chunks/{is-animation-disabled.CUl4N3LI.js → is-animation-disabled.B-V_68K-.js} +5 -5
  84. package/chunks/{map.CXgG1iGz.js → map.DNl7PF61.js} +1 -1
  85. package/chunks/moon.5yILPYXs.js +10 -0
  86. package/chunks/muscle.DbNjWasV.js +10 -0
  87. package/chunks/petrol.BGWwCsTw.js +10 -0
  88. package/chunks/sun.CY6ttzTL.js +10 -0
  89. package/chunks/{triangle-exclamationmark-colored.CbVC3Gzi.js → triangle-exclamationmark-colored.e93zvQ6Q.js} +1 -1
  90. package/chunks/upload.BogDfonx.js +10 -0
  91. package/chunks/useBreakpoint.BzR_yaIv.js +42 -0
  92. package/chunks/variants.-R3_RCW8.js +10 -0
  93. package/chunks/weight.DUPu2UT0.js +10 -0
  94. package/combobox.jG5GRA7C.js +65 -0
  95. package/components/ChipGroup/ChipGroup.utils.d.ts +1 -3
  96. package/components/Combobox/Combobox.utils.d.ts +3 -4
  97. package/components/Combobox/CustomReactSelect/CustomReactSelect.d.ts +4 -2
  98. package/components/{InputStepper/InputStepper.d.ts → InputNumber/InputNumber.d.ts} +4 -4
  99. package/components/InputNumber/InputNumber.utils.d.ts +13 -0
  100. package/components/Scroller/Scroller.d.ts +6 -2
  101. package/components/Stepper/Step.d.ts +33 -0
  102. package/components/Stepper/Step.utils.d.ts +5 -0
  103. package/components/Stepper/Stepper.d.ts +56 -0
  104. package/components/Stepper/Stepper.test.d.ts +1 -0
  105. package/components/Stepper/Stepper.utils.d.ts +30 -0
  106. package/components/Stepper/Stepper.utils.test.d.ts +1 -0
  107. package/customreactselect.BFN8cYJi.js +14 -0
  108. package/dialog.CzM_Cxp0.js +9 -0
  109. package/drawer._A9MQ8Cj.js +9 -0
  110. package/fieldset.CId-NtI5.js +11 -0
  111. package/{filelist.BiKMKCyg.js → filelist.DgVuWpR3.js} +23 -24
  112. package/{flag.72PONA83.js → flag.CE32qHPa.js} +3 -3
  113. package/{floatingactionbutton.B2YChsNU.js → floatingactionbutton.Bsnncudt.js} +5 -5
  114. package/header.CelAkqtp.js +12 -0
  115. package/{heading.BXFBZhKv.js → heading.DHLpT4dc.js} +2 -2
  116. package/icon.vzkPwgjZ.js +9 -0
  117. package/index.d.ts +4 -2
  118. package/index.es.js +218 -206
  119. package/input.DuEbg7d6.js +206 -0
  120. package/inputfile.BjgJGefV.js +17 -0
  121. package/inputnumber.BcrxBVv0.js +16 -0
  122. package/inputnumber.d.ts +2 -0
  123. package/inputpassword.CddmBW-T.js +13 -0
  124. package/inputsearch.CFOASqrd.js +14 -0
  125. package/{link.DbnvsD3j.js → link.f8MMZo-w.js} +5 -5
  126. package/linkbutton.BYAvi-_V.js +12 -0
  127. package/{logo.C96KaG1P.js → logo.DprmD8HU.js} +3 -3
  128. package/{logo100years.BcB6_c-o.js → logo100years.B4d_DIiB.js} +1 -1
  129. package/megamenu.Cy9Cc-mC.js +12 -0
  130. package/navigationtablist.CkkLyHrM.js +10 -0
  131. package/navigationtabs.Dp7D2fnc.js +9 -0
  132. package/notification.B-norGiB.js +10 -0
  133. package/{numberindicator.Ddf3ESi7.js → numberindicator.BdnPMogE.js} +2 -2
  134. package/{optioncheckbox.DqfXuPdi.js → optioncheckbox.nBVwGv6c.js} +3 -3
  135. package/package.json +41 -50
  136. package/partials/index.js +56 -50
  137. package/partials/lib/partials.d.ts +1 -1
  138. package/popover.DFVDZY-m.js +12 -0
  139. package/{radio.7_N_alaS.js → radio.DHUfSPai.js} +2 -2
  140. package/radiogroup.DaThoMfq.js +11 -0
  141. package/scroller.Cu7H_VCT.js +98 -0
  142. package/select.CMdKf7tC.js +13 -0
  143. package/{skiptocontent.BSCde5hT.js → skiptocontent.CHVh0hbr.js} +4 -4
  144. package/slider.C5dK6KcG.js +11 -0
  145. package/{spinner.BUjhjAvw.js → spinner.C9qCeq0R.js} +18 -18
  146. package/step.DKf4CHGr.js +82 -0
  147. package/step.d.ts +6 -0
  148. package/stepper.CCP_igpJ.js +16 -0
  149. package/stepper.d.ts +2 -0
  150. package/{switch.D7BCfyyZ.js → switch.Bqdyzi2E.js} +5 -5
  151. package/systemfeedback.O7tj1juR.js +10 -0
  152. package/tablist.DZgo49nZ.js +209 -0
  153. package/{tabpane.CB-eudyw.js → tabpane.C4nsUlwc.js} +2 -2
  154. package/tabs.BkoT7feH.js +11 -0
  155. package/text.cLv2PhjQ.js +10 -0
  156. package/textarea.DMn20z4p.js +13 -0
  157. package/{title.Bz_k5Vda.js → title.DuLPB-VK.js} +2 -2
  158. package/toast.Dvs8woTH.js +11 -0
  159. package/toastmanager.pi_Fhd5t.js +89 -0
  160. package/tooltip.QJe_bfO-.js +178 -0
  161. package/topbar.Bxwvp9Lf.js +12 -0
  162. package/types/icon-types.d.ts +1 -1
  163. package/utils/index.d.ts +1 -0
  164. package/utils/mergeRefs.d.ts +5 -0
  165. package/utils/mergeRefs.test.d.ts +1 -0
  166. package/accordion.HfUSDwQJ.js +0 -12
  167. package/actionbutton.kgd0E_xF.js +0 -12
  168. package/actionlink.CwC42RWc.js +0 -12
  169. package/assets/Accordion.BJb4TOG0.css +0 -1
  170. package/assets/Button.Dw8H5nFS.css +0 -1
  171. package/assets/Checkbox.BKHQN_tu.css +0 -1
  172. package/assets/CustomReactSelect.DGIItWIh.css +0 -1
  173. package/assets/Dialog.CGAg7bnN.css +0 -1
  174. package/assets/Drawer.VOvWQoEr.css +0 -1
  175. package/assets/InputFile.CCQxsulT.css +0 -1
  176. package/assets/InputPassword.124xVOiO.css +0 -1
  177. package/assets/InputSearch.Bkg-1urJ.css +0 -1
  178. package/assets/InputStepper.DvFJk1Mi.css +0 -1
  179. package/assets/LinkButton.xMvg_ojf.css +0 -1
  180. package/assets/Notification.BOuaA5GT.css +0 -1
  181. package/assets/Select.C1gWF32A.css +0 -1
  182. package/assets/Slider.Bidyhb-B.css +0 -1
  183. package/assets/Textarea.Dq4rH9Tg.css +0 -1
  184. package/assets/Toast.CJ1zhDIT.css +0 -1
  185. package/assets/buttonround.Cw9hnUan.css +0 -1
  186. package/assets/input.CUjGh-UM.css +0 -1
  187. package/assets/switch.Bc9KIyw9.css +0 -1
  188. package/breadcrumb.BsQm0kUD.js +0 -11
  189. package/button.Dyy6ajX6.js +0 -13
  190. package/checkbox.BNnp4ztM.js +0 -12
  191. package/checkboxgroup.BTVnKenc.js +0 -9
  192. package/chip.C7NstOHt.js +0 -12
  193. package/chipgroup.Zo1-IOCn.js +0 -210
  194. package/chunks/Accordion.CnqryAUu.js +0 -170
  195. package/chunks/Checkbox.CiwriItT.js +0 -88
  196. package/chunks/Dialog.Bv7k55He.js +0 -135
  197. package/chunks/Drawer.BVTvx276.js +0 -140
  198. package/chunks/Header.um5MlziB.js +0 -377
  199. package/chunks/InputFile.bVWWdePn.js +0 -220
  200. package/chunks/InputSearch.GOYqFCcZ.js +0 -174
  201. package/chunks/InputStepper.BuhPtfl-.js +0 -268
  202. package/chunks/MegaMenu._o3nNDAa.js +0 -192
  203. package/chunks/NavigationTabList.DuT7gzhj.js +0 -57
  204. package/chunks/Notification.Pts2oh0R.js +0 -92
  205. package/chunks/Popover.BRR8YZ-P.js +0 -228
  206. package/chunks/Select.D2ehd4yN.js +0 -162
  207. package/chunks/Tabs.C8ADTzJ0.js +0 -83
  208. package/chunks/Textarea.Cw85sxHL.js +0 -163
  209. package/chunks/Toast.DG3WVvau.js +0 -76
  210. package/chunks/file-type-doc.DlovDOBh.js +0 -10
  211. package/chunks/floating-ui.dom.VgHc0h4l.js +0 -989
  212. package/chunks/floating-ui.react.DCyAzlZ4.js +0 -2011
  213. package/chunks/helpers.BbWkXTr3.js +0 -37
  214. package/chunks/petrol.Du6qAgp0.js +0 -10
  215. package/chunks/upload.ZImTAIgx.js +0 -10
  216. package/chunks/useBreakpoint.CMOR9ZOB.js +0 -44
  217. package/combobox.orZ3z8CB.js +0 -60
  218. package/components/InputStepper/InputStepper.utils.d.ts +0 -13
  219. package/customreactselect.Np-RpzvU.js +0 -14
  220. package/dialog.D4rcbW6A.js +0 -10
  221. package/drawer.BCCB3Rkj.js +0 -10
  222. package/fieldset.ZLs9IGpE.js +0 -11
  223. package/header.DUbn3BZt.js +0 -12
  224. package/icon.CHVAZr5T.js +0 -9
  225. package/input.DG20x6gh.js +0 -203
  226. package/inputfile.Dc56lQ4t.js +0 -17
  227. package/inputpassword.znFHRLsI.js +0 -13
  228. package/inputsearch.B1G6rfVk.js +0 -14
  229. package/inputstepper.d.ts +0 -2
  230. package/inputstepper.o6rdM_CW.js +0 -16
  231. package/linkbutton.DU8Ih8ZF.js +0 -12
  232. package/megamenu.CPH8EeFF.js +0 -12
  233. package/navigationtablist.C0iwsAad.js +0 -9
  234. package/navigationtabs.JjJtbuUe.js +0 -9
  235. package/notification.Ds_Q7ifk.js +0 -10
  236. package/popover.B72W0OvU.js +0 -12
  237. package/radiogroup.C_3IcNBq.js +0 -11
  238. package/scroller.CQxmQU6U.js +0 -123
  239. package/select.Ceyt-zvu.js +0 -13
  240. package/slider.Dq2dcziy.js +0 -11
  241. package/systemfeedback.CSdWOWuf.js +0 -10
  242. package/tablist.V7DBklhE.js +0 -256
  243. package/tabs.DQNLPAEN.js +0 -11
  244. package/text.ZOUuesnU.js +0 -10
  245. package/textarea.CixKeQBp.js +0 -13
  246. package/toast.D8QprMCa.js +0 -11
  247. package/toastmanager.BSVjYsg9.js +0 -116
  248. package/tooltip.CUCSRXd3.js +0 -191
  249. package/topbar.CVhJy-Br.js +0 -12
  250. /package/components/{InputStepper/InputStepper.test.d.ts → InputNumber/InputNumber.test.d.ts} +0 -0
  251. /package/components/{InputStepper/InputStepper.utils.test.d.ts → InputNumber/InputNumberutils.test.d.ts} +0 -0
@@ -1,2011 +0,0 @@
1
- "use client";
2
- import * as u from "react";
3
- import { useLayoutEffect as Pt } from "react";
4
- import { i as Gt, b as se, f as Zt, c as zt, o as Jt, s as Qt, d as st, e as J, g as en, h as We, j as tn, k as Be, l as nn, m as kt, n as At } from "./floating-ui.dom.VgHc0h4l.js";
5
- import { jsxs as Qe, jsx as ne, Fragment as rn } from "react/jsx-runtime";
6
- import * as et from "react-dom";
7
- /*!
8
- * tabbable 6.2.0
9
- * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
10
- */
11
- var on = ["input:not([inert])", "select:not([inert])", "textarea:not([inert])", "a[href]:not([inert])", "button:not([inert])", "[tabindex]:not(slot):not([inert])", "audio[controls]:not([inert])", "video[controls]:not([inert])", '[contenteditable]:not([contenteditable="false"]):not([inert])', "details>summary:first-of-type:not([inert])", "details:not([inert])"], ke = /* @__PURE__ */ on.join(","), Ot = typeof Element > "u", he = Ot ? function() {
12
- } : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector, Ae = !Ot && Element.prototype.getRootNode ? function(e) {
13
- var t;
14
- return e == null || (t = e.getRootNode) === null || t === void 0 ? void 0 : t.call(e);
15
- } : function(e) {
16
- return e == null ? void 0 : e.ownerDocument;
17
- }, Oe = function e(t, n) {
18
- var r;
19
- n === void 0 && (n = !0);
20
- var o = t == null || (r = t.getAttribute) === null || r === void 0 ? void 0 : r.call(t, "inert"), s = o === "" || o === "true", i = s || n && t && e(t.parentNode);
21
- return i;
22
- }, sn = function(t) {
23
- var n, r = t == null || (n = t.getAttribute) === null || n === void 0 ? void 0 : n.call(t, "contenteditable");
24
- return r === "" || r === "true";
25
- }, Ft = function(t, n, r) {
26
- if (Oe(t))
27
- return [];
28
- var o = Array.prototype.slice.apply(t.querySelectorAll(ke));
29
- return n && he.call(t, ke) && o.unshift(t), o = o.filter(r), o;
30
- }, Lt = function e(t, n, r) {
31
- for (var o = [], s = Array.from(t); s.length; ) {
32
- var i = s.shift();
33
- if (!Oe(i, !1))
34
- if (i.tagName === "SLOT") {
35
- var a = i.assignedElements(), c = a.length ? a : i.children, l = e(c, !0, r);
36
- r.flatten ? o.push.apply(o, l) : o.push({
37
- scopeParent: i,
38
- candidates: l
39
- });
40
- } else {
41
- var v = he.call(i, ke);
42
- v && r.filter(i) && (n || !t.includes(i)) && o.push(i);
43
- var y = i.shadowRoot || // check for an undisclosed shadow
44
- typeof r.getShadowRoot == "function" && r.getShadowRoot(i), w = !Oe(y, !1) && (!r.shadowRootFilter || r.shadowRootFilter(i));
45
- if (y && w) {
46
- var f = e(y === !0 ? i.children : y.children, !0, r);
47
- r.flatten ? o.push.apply(o, f) : o.push({
48
- scopeParent: i,
49
- candidates: f
50
- });
51
- } else
52
- s.unshift.apply(s, i.children);
53
- }
54
- }
55
- return o;
56
- }, Dt = function(t) {
57
- return !isNaN(parseInt(t.getAttribute("tabindex"), 10));
58
- }, Nt = function(t) {
59
- if (!t)
60
- throw new Error("No node provided");
61
- return t.tabIndex < 0 && (/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName) || sn(t)) && !Dt(t) ? 0 : t.tabIndex;
62
- }, un = function(t, n) {
63
- var r = Nt(t);
64
- return r < 0 && n && !Dt(t) ? 0 : r;
65
- }, an = function(t, n) {
66
- return t.tabIndex === n.tabIndex ? t.documentOrder - n.documentOrder : t.tabIndex - n.tabIndex;
67
- }, $t = function(t) {
68
- return t.tagName === "INPUT";
69
- }, cn = function(t) {
70
- return $t(t) && t.type === "hidden";
71
- }, ln = function(t) {
72
- var n = t.tagName === "DETAILS" && Array.prototype.slice.apply(t.children).some(function(r) {
73
- return r.tagName === "SUMMARY";
74
- });
75
- return n;
76
- }, fn = function(t, n) {
77
- for (var r = 0; r < t.length; r++)
78
- if (t[r].checked && t[r].form === n)
79
- return t[r];
80
- }, dn = function(t) {
81
- if (!t.name)
82
- return !0;
83
- var n = t.form || Ae(t), r = function(a) {
84
- return n.querySelectorAll('input[type="radio"][name="' + a + '"]');
85
- }, o;
86
- if (typeof window < "u" && typeof window.CSS < "u" && typeof window.CSS.escape == "function")
87
- o = r(window.CSS.escape(t.name));
88
- else
89
- try {
90
- o = r(t.name);
91
- } catch (i) {
92
- return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s", i.message), !1;
93
- }
94
- var s = fn(o, t.form);
95
- return !s || s === t;
96
- }, mn = function(t) {
97
- return $t(t) && t.type === "radio";
98
- }, vn = function(t) {
99
- return mn(t) && !dn(t);
100
- }, pn = function(t) {
101
- var n, r = t && Ae(t), o = (n = r) === null || n === void 0 ? void 0 : n.host, s = !1;
102
- if (r && r !== t) {
103
- var i, a, c;
104
- for (s = !!((i = o) !== null && i !== void 0 && (a = i.ownerDocument) !== null && a !== void 0 && a.contains(o) || t != null && (c = t.ownerDocument) !== null && c !== void 0 && c.contains(t)); !s && o; ) {
105
- var l, v, y;
106
- r = Ae(o), o = (l = r) === null || l === void 0 ? void 0 : l.host, s = !!((v = o) !== null && v !== void 0 && (y = v.ownerDocument) !== null && y !== void 0 && y.contains(o));
107
- }
108
- }
109
- return s;
110
- }, it = function(t) {
111
- var n = t.getBoundingClientRect(), r = n.width, o = n.height;
112
- return r === 0 && o === 0;
113
- }, gn = function(t, n) {
114
- var r = n.displayCheck, o = n.getShadowRoot;
115
- if (getComputedStyle(t).visibility === "hidden")
116
- return !0;
117
- var s = he.call(t, "details>summary:first-of-type"), i = s ? t.parentElement : t;
118
- if (he.call(i, "details:not([open]) *"))
119
- return !0;
120
- if (!r || r === "full" || r === "legacy-full") {
121
- if (typeof o == "function") {
122
- for (var a = t; t; ) {
123
- var c = t.parentElement, l = Ae(t);
124
- if (c && !c.shadowRoot && o(c) === !0)
125
- return it(t);
126
- t.assignedSlot ? t = t.assignedSlot : !c && l !== t.ownerDocument ? t = l.host : t = c;
127
- }
128
- t = a;
129
- }
130
- if (pn(t))
131
- return !t.getClientRects().length;
132
- if (r !== "legacy-full")
133
- return !0;
134
- } else if (r === "non-zero-area")
135
- return it(t);
136
- return !1;
137
- }, bn = function(t) {
138
- if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))
139
- for (var n = t.parentElement; n; ) {
140
- if (n.tagName === "FIELDSET" && n.disabled) {
141
- for (var r = 0; r < n.children.length; r++) {
142
- var o = n.children.item(r);
143
- if (o.tagName === "LEGEND")
144
- return he.call(n, "fieldset[disabled] *") ? !0 : !o.contains(t);
145
- }
146
- return !0;
147
- }
148
- n = n.parentElement;
149
- }
150
- return !1;
151
- }, Ge = function(t, n) {
152
- return !(n.disabled || // we must do an inert look up to filter out any elements inside an inert ancestor
153
- // because we're limited in the type of selectors we can use in JSDom (see related
154
- // note related to `candidateSelectors`)
155
- Oe(n) || cn(n) || gn(n, t) || // For a details element with a summary, the summary element gets the focus
156
- ln(n) || bn(n));
157
- }, Ze = function(t, n) {
158
- return !(vn(n) || Nt(n) < 0 || !Ge(t, n));
159
- }, hn = function(t) {
160
- var n = parseInt(t.getAttribute("tabindex"), 10);
161
- return !!(isNaN(n) || n >= 0);
162
- }, Rn = function e(t) {
163
- var n = [], r = [];
164
- return t.forEach(function(o, s) {
165
- var i = !!o.scopeParent, a = i ? o.scopeParent : o, c = un(a, i), l = i ? e(o.candidates) : a;
166
- c === 0 ? i ? n.push.apply(n, l) : n.push(a) : r.push({
167
- documentOrder: s,
168
- tabIndex: c,
169
- item: o,
170
- isScope: i,
171
- content: l
172
- });
173
- }), r.sort(an).reduce(function(o, s) {
174
- return s.isScope ? o.push.apply(o, s.content) : o.push(s.content), o;
175
- }, []).concat(n);
176
- }, De = function(t, n) {
177
- n = n || {};
178
- var r;
179
- return n.getShadowRoot ? r = Lt([t], n.includeContainer, {
180
- filter: Ze.bind(null, n),
181
- flatten: !1,
182
- getShadowRoot: n.getShadowRoot,
183
- shadowRootFilter: hn
184
- }) : r = Ft(t, n.includeContainer, Ze.bind(null, n)), Rn(r);
185
- }, yn = function(t, n) {
186
- n = n || {};
187
- var r;
188
- return n.getShadowRoot ? r = Lt([t], n.includeContainer, {
189
- filter: Ge.bind(null, n),
190
- flatten: !0,
191
- getShadowRoot: n.getShadowRoot
192
- }) : r = Ft(t, n.includeContainer, Ge.bind(null, n)), r;
193
- }, _t = function(t, n) {
194
- if (n = n || {}, !t)
195
- throw new Error("No node provided");
196
- return he.call(t, ke) === !1 ? !1 : Ze(n, t);
197
- };
198
- function tt() {
199
- const e = navigator.userAgentData;
200
- return e != null && e.platform ? e.platform : navigator.platform;
201
- }
202
- function Wt() {
203
- const e = navigator.userAgentData;
204
- return e && Array.isArray(e.brands) ? e.brands.map((t) => {
205
- let {
206
- brand: n,
207
- version: r
208
- } = t;
209
- return n + "/" + r;
210
- }).join(" ") : navigator.userAgent;
211
- }
212
- function Bt() {
213
- return /apple/i.test(navigator.vendor);
214
- }
215
- function ze() {
216
- const e = /android/i;
217
- return e.test(tt()) || e.test(Wt());
218
- }
219
- function En() {
220
- return tt().toLowerCase().startsWith("mac") && !navigator.maxTouchPoints;
221
- }
222
- function Vt() {
223
- return Wt().includes("jsdom/");
224
- }
225
- const ut = "data-floating-ui-focusable", wn = "input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";
226
- function fe(e) {
227
- let t = e.activeElement;
228
- for (; ((n = t) == null || (n = n.shadowRoot) == null ? void 0 : n.activeElement) != null; ) {
229
- var n;
230
- t = t.shadowRoot.activeElement;
231
- }
232
- return t;
233
- }
234
- function z(e, t) {
235
- if (!e || !t)
236
- return !1;
237
- const n = t.getRootNode == null ? void 0 : t.getRootNode();
238
- if (e.contains(t))
239
- return !0;
240
- if (n && Gt(n)) {
241
- let r = t;
242
- for (; r; ) {
243
- if (e === r)
244
- return !0;
245
- r = r.parentNode || r.host;
246
- }
247
- }
248
- return !1;
249
- }
250
- function ae(e) {
251
- return "composedPath" in e ? e.composedPath()[0] : e.target;
252
- }
253
- function Ve(e, t) {
254
- if (t == null)
255
- return !1;
256
- if ("composedPath" in e)
257
- return e.composedPath().includes(t);
258
- const n = e;
259
- return n.target != null && t.contains(n.target);
260
- }
261
- function xn(e) {
262
- return e.matches("html,body");
263
- }
264
- function Q(e) {
265
- return (e == null ? void 0 : e.ownerDocument) || document;
266
- }
267
- function nt(e) {
268
- return se(e) && e.matches(wn);
269
- }
270
- function at(e) {
271
- return e ? e.getAttribute("role") === "combobox" && nt(e) : !1;
272
- }
273
- function Tn(e) {
274
- if (!e || Vt()) return !0;
275
- try {
276
- return e.matches(":focus-visible");
277
- } catch {
278
- return !0;
279
- }
280
- }
281
- function Je(e) {
282
- return e ? e.hasAttribute(ut) ? e : e.querySelector("[" + ut + "]") || e : null;
283
- }
284
- function Re(e, t) {
285
- let n = e.filter((o) => {
286
- var s;
287
- return o.parentId === t && ((s = o.context) == null ? void 0 : s.open);
288
- }), r = n;
289
- for (; r.length; )
290
- r = e.filter((o) => {
291
- var s;
292
- return (s = r) == null ? void 0 : s.some((i) => {
293
- var a;
294
- return o.parentId === i.id && ((a = o.context) == null ? void 0 : a.open);
295
- });
296
- }), n = n.concat(r);
297
- return n;
298
- }
299
- function ct(e, t) {
300
- var n;
301
- let r = [], o = (n = e.find((s) => s.id === t)) == null ? void 0 : n.parentId;
302
- for (; o; ) {
303
- const s = e.find((i) => i.id === o);
304
- o = s == null ? void 0 : s.parentId, s && (r = r.concat(s));
305
- }
306
- return r;
307
- }
308
- function Ke(e) {
309
- e.preventDefault(), e.stopPropagation();
310
- }
311
- function Cn(e) {
312
- return "nativeEvent" in e;
313
- }
314
- function Sn(e) {
315
- return e.mozInputSource === 0 && e.isTrusted ? !0 : ze() && e.pointerType ? e.type === "click" && e.buttons === 1 : e.detail === 0 && !e.pointerType;
316
- }
317
- function In(e) {
318
- return Vt() ? !1 : !ze() && e.width === 0 && e.height === 0 || ze() && e.width === 1 && e.height === 1 && e.pressure === 0 && e.detail === 0 && e.pointerType === "mouse" || // iOS VoiceOver returns 0.333• for width/height.
319
- e.width < 1 && e.height < 1 && e.pressure === 0 && e.detail === 0 && e.pointerType === "touch";
320
- }
321
- function Ee(e, t) {
322
- const n = ["mouse", "pen"];
323
- return t || n.push("", void 0), n.includes(e);
324
- }
325
- var Mn = typeof document < "u", Pn = function() {
326
- }, G = Mn ? Pt : Pn;
327
- const kn = {
328
- ...u
329
- };
330
- function ve(e) {
331
- const t = u.useRef(e);
332
- return G(() => {
333
- t.current = e;
334
- }), t;
335
- }
336
- const An = kn.useInsertionEffect, On = An || ((e) => e());
337
- function ee(e) {
338
- const t = u.useRef(() => {
339
- if (process.env.NODE_ENV !== "production")
340
- throw new Error("Cannot call an event handler while rendering.");
341
- });
342
- return On(() => {
343
- t.current = e;
344
- }), u.useCallback(function() {
345
- for (var n = arguments.length, r = new Array(n), o = 0; o < n; o++)
346
- r[o] = arguments[o];
347
- return t.current == null ? void 0 : t.current(...r);
348
- }, []);
349
- }
350
- const xe = () => ({
351
- getShadowRoot: !0,
352
- displayCheck: (
353
- // JSDOM does not support the `tabbable` library. To solve this we can
354
- // check if `ResizeObserver` is a real function (not polyfilled), which
355
- // determines if the current environment is JSDOM-like.
356
- typeof ResizeObserver == "function" && ResizeObserver.toString().includes("[native code]") ? "full" : "none"
357
- )
358
- });
359
- function Kt(e, t) {
360
- const n = De(e, xe()), r = n.length;
361
- if (r === 0) return;
362
- const o = fe(Q(e)), s = n.indexOf(o), i = s === -1 ? t === 1 ? 0 : r - 1 : s + t;
363
- return n[i];
364
- }
365
- function qt(e) {
366
- return Kt(Q(e).body, 1) || e;
367
- }
368
- function jt(e) {
369
- return Kt(Q(e).body, -1) || e;
370
- }
371
- function ye(e, t) {
372
- const n = t || e.currentTarget, r = e.relatedTarget;
373
- return !r || !z(n, r);
374
- }
375
- function Fn(e) {
376
- De(e, xe()).forEach((n) => {
377
- n.dataset.tabindex = n.getAttribute("tabindex") || "", n.setAttribute("tabindex", "-1");
378
- });
379
- }
380
- function lt(e) {
381
- e.querySelectorAll("[data-tabindex]").forEach((n) => {
382
- const r = n.dataset.tabindex;
383
- delete n.dataset.tabindex, r ? n.setAttribute("tabindex", r) : n.removeAttribute("tabindex");
384
- });
385
- }
386
- var Ln = typeof document < "u", Dn = function() {
387
- }, Pe = Ln ? Pt : Dn;
388
- function Fe(e, t) {
389
- if (e === t)
390
- return !0;
391
- if (typeof e != typeof t)
392
- return !1;
393
- if (typeof e == "function" && e.toString() === t.toString())
394
- return !0;
395
- let n, r, o;
396
- if (e && t && typeof e == "object") {
397
- if (Array.isArray(e)) {
398
- if (n = e.length, n !== t.length) return !1;
399
- for (r = n; r-- !== 0; )
400
- if (!Fe(e[r], t[r]))
401
- return !1;
402
- return !0;
403
- }
404
- if (o = Object.keys(e), n = o.length, n !== Object.keys(t).length)
405
- return !1;
406
- for (r = n; r-- !== 0; )
407
- if (!{}.hasOwnProperty.call(t, o[r]))
408
- return !1;
409
- for (r = n; r-- !== 0; ) {
410
- const s = o[r];
411
- if (!(s === "_owner" && e.$$typeof) && !Fe(e[s], t[s]))
412
- return !1;
413
- }
414
- return !0;
415
- }
416
- return e !== e && t !== t;
417
- }
418
- function Ut(e) {
419
- return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
420
- }
421
- function ft(e, t) {
422
- const n = Ut(e);
423
- return Math.round(t * n) / n;
424
- }
425
- function qe(e) {
426
- const t = u.useRef(e);
427
- return Pe(() => {
428
- t.current = e;
429
- }), t;
430
- }
431
- function Nn(e) {
432
- e === void 0 && (e = {});
433
- const {
434
- placement: t = "bottom",
435
- strategy: n = "absolute",
436
- middleware: r = [],
437
- platform: o,
438
- elements: {
439
- reference: s,
440
- floating: i
441
- } = {},
442
- transform: a = !0,
443
- whileElementsMounted: c,
444
- open: l
445
- } = e, [v, y] = u.useState({
446
- x: 0,
447
- y: 0,
448
- strategy: n,
449
- placement: t,
450
- middlewareData: {},
451
- isPositioned: !1
452
- }), [w, f] = u.useState(r);
453
- Fe(w, r) || f(r);
454
- const [h, d] = u.useState(null), [x, C] = u.useState(null), g = u.useCallback((p) => {
455
- p !== _.current && (_.current = p, d(p));
456
- }, []), E = u.useCallback((p) => {
457
- p !== A.current && (A.current = p, C(p));
458
- }, []), S = s || h, D = i || x, _ = u.useRef(null), A = u.useRef(null), K = u.useRef(v), j = c != null, H = qe(c), N = qe(o), W = qe(l), B = u.useCallback(() => {
459
- if (!_.current || !A.current)
460
- return;
461
- const p = {
462
- placement: t,
463
- strategy: n,
464
- middleware: w
465
- };
466
- N.current && (p.platform = N.current), zt(_.current, A.current, p).then((R) => {
467
- const I = {
468
- ...R,
469
- // The floating element's position may be recomputed while it's closed
470
- // but still mounted (such as when transitioning out). To ensure
471
- // `isPositioned` will be `false` initially on the next open, avoid
472
- // setting it to `true` when `open === false` (must be specified).
473
- isPositioned: W.current !== !1
474
- };
475
- O.current && !Fe(K.current, I) && (K.current = I, et.flushSync(() => {
476
- y(I);
477
- }));
478
- });
479
- }, [w, t, n, N, W]);
480
- Pe(() => {
481
- l === !1 && K.current.isPositioned && (K.current.isPositioned = !1, y((p) => ({
482
- ...p,
483
- isPositioned: !1
484
- })));
485
- }, [l]);
486
- const O = u.useRef(!1);
487
- Pe(() => (O.current = !0, () => {
488
- O.current = !1;
489
- }), []), Pe(() => {
490
- if (S && (_.current = S), D && (A.current = D), S && D) {
491
- if (H.current)
492
- return H.current(S, D, B);
493
- B();
494
- }
495
- }, [S, D, B, H, j]);
496
- const m = u.useMemo(() => ({
497
- reference: _,
498
- floating: A,
499
- setReference: g,
500
- setFloating: E
501
- }), [g, E]), F = u.useMemo(() => ({
502
- reference: S,
503
- floating: D
504
- }), [S, D]), T = u.useMemo(() => {
505
- const p = {
506
- position: n,
507
- left: 0,
508
- top: 0
509
- };
510
- if (!F.floating)
511
- return p;
512
- const R = ft(F.floating, v.x), I = ft(F.floating, v.y);
513
- return a ? {
514
- ...p,
515
- transform: "translate(" + R + "px, " + I + "px)",
516
- ...Ut(F.floating) >= 1.5 && {
517
- willChange: "transform"
518
- }
519
- } : {
520
- position: n,
521
- left: R,
522
- top: I
523
- };
524
- }, [n, a, F.floating, v.x, v.y]);
525
- return u.useMemo(() => ({
526
- ...v,
527
- update: B,
528
- refs: m,
529
- elements: F,
530
- floatingStyles: T
531
- }), [v, B, m, F, T]);
532
- }
533
- const $n = (e) => {
534
- function t(n) {
535
- return {}.hasOwnProperty.call(n, "current");
536
- }
537
- return {
538
- name: "arrow",
539
- options: e,
540
- fn(n) {
541
- const {
542
- element: r,
543
- padding: o
544
- } = typeof e == "function" ? e(n) : e;
545
- return r && t(r) ? r.current != null ? st({
546
- element: r.current,
547
- padding: o
548
- }).fn(n) : {} : r ? st({
549
- element: r,
550
- padding: o
551
- }).fn(n) : {};
552
- }
553
- };
554
- }, mr = (e, t) => ({
555
- ...Jt(e),
556
- options: [e, t]
557
- }), vr = (e, t) => ({
558
- ...Qt(e),
559
- options: [e, t]
560
- }), pr = (e, t) => ({
561
- ...Zt(e),
562
- options: [e, t]
563
- }), gr = (e, t) => ({
564
- ...$n(e),
565
- options: [e, t]
566
- });
567
- function br(e) {
568
- const t = u.useRef(void 0), n = u.useCallback((r) => {
569
- const o = e.map((s) => {
570
- if (s != null) {
571
- if (typeof s == "function") {
572
- const i = s, a = i(r);
573
- return typeof a == "function" ? a : () => {
574
- i(null);
575
- };
576
- }
577
- return s.current = r, () => {
578
- s.current = null;
579
- };
580
- }
581
- });
582
- return () => {
583
- o.forEach((s) => s == null ? void 0 : s());
584
- };
585
- }, e);
586
- return u.useMemo(() => e.every((r) => r == null) ? null : (r) => {
587
- t.current && (t.current(), t.current = void 0), r != null && (t.current = n(r));
588
- }, e);
589
- }
590
- const _n = "data-floating-ui-focusable", dt = "active", mt = "selected", Wn = {
591
- ...u
592
- };
593
- let vt = !1, Bn = 0;
594
- const pt = () => (
595
- // Ensure the id is unique with multiple independent versions of Floating UI
596
- // on <React 18
597
- "floating-ui-" + Math.random().toString(36).slice(2, 6) + Bn++
598
- );
599
- function Vn() {
600
- const [e, t] = u.useState(() => vt ? pt() : void 0);
601
- return G(() => {
602
- e == null && t(pt());
603
- }, []), u.useEffect(() => {
604
- vt = !0;
605
- }, []), e;
606
- }
607
- const Kn = Wn.useId, Ne = Kn || Vn;
608
- let we;
609
- process.env.NODE_ENV !== "production" && (we = /* @__PURE__ */ new Set());
610
- function qn() {
611
- for (var e, t = arguments.length, n = new Array(t), r = 0; r < t; r++)
612
- n[r] = arguments[r];
613
- const o = "Floating UI: " + n.join(" ");
614
- if (!((e = we) != null && e.has(o))) {
615
- var s;
616
- (s = we) == null || s.add(o), console.warn(o);
617
- }
618
- }
619
- function jn() {
620
- for (var e, t = arguments.length, n = new Array(t), r = 0; r < t; r++)
621
- n[r] = arguments[r];
622
- const o = "Floating UI: " + n.join(" ");
623
- if (!((e = we) != null && e.has(o))) {
624
- var s;
625
- (s = we) == null || s.add(o), console.error(o);
626
- }
627
- }
628
- const hr = /* @__PURE__ */ u.forwardRef(function(t, n) {
629
- const {
630
- context: {
631
- placement: r,
632
- elements: {
633
- floating: o
634
- },
635
- middlewareData: {
636
- arrow: s,
637
- shift: i
638
- }
639
- },
640
- width: a = 14,
641
- height: c = 7,
642
- tipRadius: l = 0,
643
- strokeWidth: v = 0,
644
- staticOffset: y,
645
- stroke: w,
646
- d: f,
647
- style: {
648
- transform: h,
649
- ...d
650
- } = {},
651
- ...x
652
- } = t;
653
- process.env.NODE_ENV !== "production" && (n || qn("The `ref` prop is required for `FloatingArrow`."));
654
- const C = Ne(), [g, E] = u.useState(!1);
655
- if (G(() => {
656
- if (!o) return;
657
- kt(o).direction === "rtl" && E(!0);
658
- }, [o]), !o)
659
- return null;
660
- const [S, D] = r.split("-"), _ = S === "top" || S === "bottom";
661
- let A = y;
662
- (_ && i != null && i.x || !_ && i != null && i.y) && (A = null);
663
- const K = v * 2, j = K / 2, H = a / 2 * (l / -8 + 1), N = c / 2 * l / 4, W = !!f, B = A && D === "end" ? "bottom" : "top";
664
- let O = A && D === "end" ? "right" : "left";
665
- A && g && (O = D === "end" ? "left" : "right");
666
- const m = (s == null ? void 0 : s.x) != null ? A || s.x : "", F = (s == null ? void 0 : s.y) != null ? A || s.y : "", T = f || "M0,0" + (" H" + a) + (" L" + (a - H) + "," + (c - N)) + (" Q" + a / 2 + "," + c + " " + H + "," + (c - N)) + " Z", p = {
667
- top: W ? "rotate(180deg)" : "",
668
- left: W ? "rotate(90deg)" : "rotate(-90deg)",
669
- bottom: W ? "" : "rotate(180deg)",
670
- right: W ? "rotate(-90deg)" : "rotate(90deg)"
671
- }[S];
672
- return /* @__PURE__ */ Qe("svg", {
673
- ...x,
674
- "aria-hidden": !0,
675
- ref: n,
676
- width: W ? a : a + K,
677
- height: a,
678
- viewBox: "0 0 " + a + " " + (c > a ? c : a),
679
- style: {
680
- position: "absolute",
681
- pointerEvents: "none",
682
- [O]: m,
683
- [B]: F,
684
- [S]: _ || W ? "100%" : "calc(100% - " + K / 2 + "px)",
685
- transform: [p, h].filter((R) => !!R).join(" "),
686
- ...d
687
- },
688
- children: [K > 0 && /* @__PURE__ */ ne("path", {
689
- clipPath: "url(#" + C + ")",
690
- fill: "none",
691
- stroke: w,
692
- strokeWidth: K + (f ? 0 : 1),
693
- d: T
694
- }), /* @__PURE__ */ ne("path", {
695
- stroke: K && !f ? x.fill : "none",
696
- d: T
697
- }), /* @__PURE__ */ ne("clipPath", {
698
- id: C,
699
- children: /* @__PURE__ */ ne("rect", {
700
- x: -j,
701
- y: j * (W ? -1 : 1),
702
- width: a + K,
703
- height: a
704
- })
705
- })]
706
- });
707
- });
708
- function Un() {
709
- const e = /* @__PURE__ */ new Map();
710
- return {
711
- emit(t, n) {
712
- var r;
713
- (r = e.get(t)) == null || r.forEach((o) => o(n));
714
- },
715
- on(t, n) {
716
- e.has(t) || e.set(t, /* @__PURE__ */ new Set()), e.get(t).add(n);
717
- },
718
- off(t, n) {
719
- var r;
720
- (r = e.get(t)) == null || r.delete(n);
721
- }
722
- };
723
- }
724
- const Hn = /* @__PURE__ */ u.createContext(null), Yn = /* @__PURE__ */ u.createContext(null), rt = () => {
725
- var e;
726
- return ((e = u.useContext(Hn)) == null ? void 0 : e.id) || null;
727
- }, $e = () => u.useContext(Yn);
728
- function pe(e) {
729
- return "data-floating-ui-" + e;
730
- }
731
- function te(e) {
732
- e.current !== -1 && (clearTimeout(e.current), e.current = -1);
733
- }
734
- const gt = /* @__PURE__ */ pe("safe-polygon");
735
- function je(e, t, n) {
736
- if (n && !Ee(n))
737
- return 0;
738
- if (typeof e == "number")
739
- return e;
740
- if (typeof e == "function") {
741
- const r = e();
742
- return typeof r == "number" ? r : r == null ? void 0 : r[t];
743
- }
744
- return e == null ? void 0 : e[t];
745
- }
746
- function Ue(e) {
747
- return typeof e == "function" ? e() : e;
748
- }
749
- function Rr(e, t) {
750
- t === void 0 && (t = {});
751
- const {
752
- open: n,
753
- onOpenChange: r,
754
- dataRef: o,
755
- events: s,
756
- elements: i
757
- } = e, {
758
- enabled: a = !0,
759
- delay: c = 0,
760
- handleClose: l = null,
761
- mouseOnly: v = !1,
762
- restMs: y = 0,
763
- move: w = !0
764
- } = t, f = $e(), h = rt(), d = ve(l), x = ve(c), C = ve(n), g = ve(y), E = u.useRef(), S = u.useRef(-1), D = u.useRef(), _ = u.useRef(-1), A = u.useRef(!0), K = u.useRef(!1), j = u.useRef(() => {
765
- }), H = u.useRef(!1), N = ee(() => {
766
- var T;
767
- const p = (T = o.current.openEvent) == null ? void 0 : T.type;
768
- return (p == null ? void 0 : p.includes("mouse")) && p !== "mousedown";
769
- });
770
- u.useEffect(() => {
771
- if (!a) return;
772
- function T(p) {
773
- let {
774
- open: R
775
- } = p;
776
- R || (te(S), te(_), A.current = !0, H.current = !1);
777
- }
778
- return s.on("openchange", T), () => {
779
- s.off("openchange", T);
780
- };
781
- }, [a, s]), u.useEffect(() => {
782
- if (!a || !d.current || !n) return;
783
- function T(R) {
784
- N() && r(!1, R, "hover");
785
- }
786
- const p = Q(i.floating).documentElement;
787
- return p.addEventListener("mouseleave", T), () => {
788
- p.removeEventListener("mouseleave", T);
789
- };
790
- }, [i.floating, n, r, a, d, N]);
791
- const W = u.useCallback(function(T, p, R) {
792
- p === void 0 && (p = !0), R === void 0 && (R = "hover");
793
- const I = je(x.current, "close", E.current);
794
- I && !D.current ? (te(S), S.current = window.setTimeout(() => r(!1, T, R), I)) : p && (te(S), r(!1, T, R));
795
- }, [x, r]), B = ee(() => {
796
- j.current(), D.current = void 0;
797
- }), O = ee(() => {
798
- if (K.current) {
799
- const T = Q(i.floating).body;
800
- T.style.pointerEvents = "", T.removeAttribute(gt), K.current = !1;
801
- }
802
- }), m = ee(() => o.current.openEvent ? ["click", "mousedown"].includes(o.current.openEvent.type) : !1);
803
- u.useEffect(() => {
804
- if (!a) return;
805
- function T(b) {
806
- if (te(S), A.current = !1, v && !Ee(E.current) || Ue(g.current) > 0 && !je(x.current, "open"))
807
- return;
808
- const $ = je(x.current, "open", E.current);
809
- $ ? S.current = window.setTimeout(() => {
810
- C.current || r(!0, b, "hover");
811
- }, $) : n || r(!0, b, "hover");
812
- }
813
- function p(b) {
814
- if (m()) {
815
- O();
816
- return;
817
- }
818
- j.current();
819
- const $ = Q(i.floating);
820
- if (te(_), H.current = !1, d.current && o.current.floatingContext) {
821
- n || te(S), D.current = d.current({
822
- ...o.current.floatingContext,
823
- tree: f,
824
- x: b.clientX,
825
- y: b.clientY,
826
- onClose() {
827
- O(), B(), m() || W(b, !0, "safe-polygon");
828
- }
829
- });
830
- const ce = D.current;
831
- $.addEventListener("mousemove", ce), j.current = () => {
832
- $.removeEventListener("mousemove", ce);
833
- };
834
- return;
835
- }
836
- (E.current === "touch" ? !z(i.floating, b.relatedTarget) : !0) && W(b);
837
- }
838
- function R(b) {
839
- m() || o.current.floatingContext && (d.current == null || d.current({
840
- ...o.current.floatingContext,
841
- tree: f,
842
- x: b.clientX,
843
- y: b.clientY,
844
- onClose() {
845
- O(), B(), m() || W(b);
846
- }
847
- })(b));
848
- }
849
- function I() {
850
- te(S);
851
- }
852
- function V(b) {
853
- m() || W(b, !1);
854
- }
855
- if (J(i.domReference)) {
856
- const b = i.domReference, $ = i.floating;
857
- return n && b.addEventListener("mouseleave", R), w && b.addEventListener("mousemove", T, {
858
- once: !0
859
- }), b.addEventListener("mouseenter", T), b.addEventListener("mouseleave", p), $ && ($.addEventListener("mouseleave", R), $.addEventListener("mouseenter", I), $.addEventListener("mouseleave", V)), () => {
860
- n && b.removeEventListener("mouseleave", R), w && b.removeEventListener("mousemove", T), b.removeEventListener("mouseenter", T), b.removeEventListener("mouseleave", p), $ && ($.removeEventListener("mouseleave", R), $.removeEventListener("mouseenter", I), $.removeEventListener("mouseleave", V));
861
- };
862
- }
863
- }, [i, a, e, v, w, W, B, O, r, n, C, f, x, d, o, m, g]), G(() => {
864
- var T;
865
- if (a && n && (T = d.current) != null && (T = T.__options) != null && T.blockPointerEvents && N()) {
866
- K.current = !0;
867
- const R = i.floating;
868
- if (J(i.domReference) && R) {
869
- var p;
870
- const I = Q(i.floating).body;
871
- I.setAttribute(gt, "");
872
- const V = i.domReference, b = f == null || (p = f.nodesRef.current.find(($) => $.id === h)) == null || (p = p.context) == null ? void 0 : p.elements.floating;
873
- return b && (b.style.pointerEvents = ""), I.style.pointerEvents = "none", V.style.pointerEvents = "auto", R.style.pointerEvents = "auto", () => {
874
- I.style.pointerEvents = "", V.style.pointerEvents = "", R.style.pointerEvents = "";
875
- };
876
- }
877
- }
878
- }, [a, n, h, i, f, d, N]), G(() => {
879
- n || (E.current = void 0, H.current = !1, B(), O());
880
- }, [n, B, O]), u.useEffect(() => () => {
881
- B(), te(S), te(_), O();
882
- }, [a, i.domReference, B, O]);
883
- const F = u.useMemo(() => {
884
- function T(p) {
885
- E.current = p.pointerType;
886
- }
887
- return {
888
- onPointerDown: T,
889
- onPointerEnter: T,
890
- onMouseMove(p) {
891
- const {
892
- nativeEvent: R
893
- } = p;
894
- function I() {
895
- !A.current && !C.current && r(!0, R, "hover");
896
- }
897
- v && !Ee(E.current) || n || Ue(g.current) === 0 || H.current && p.movementX ** 2 + p.movementY ** 2 < 2 || (te(_), E.current === "touch" ? I() : (H.current = !0, _.current = window.setTimeout(I, Ue(g.current))));
898
- }
899
- };
900
- }, [v, r, n, C, g]);
901
- return u.useMemo(() => a ? {
902
- reference: F
903
- } : {}, [a, F]);
904
- }
905
- let bt = 0;
906
- function ge(e, t) {
907
- t === void 0 && (t = {});
908
- const {
909
- preventScroll: n = !1,
910
- cancelPrevious: r = !0,
911
- sync: o = !1
912
- } = t;
913
- r && cancelAnimationFrame(bt);
914
- const s = () => e == null ? void 0 : e.focus({
915
- preventScroll: n
916
- });
917
- o ? s() : bt = requestAnimationFrame(s);
918
- }
919
- function Xn(e) {
920
- return (e == null ? void 0 : e.ownerDocument) || document;
921
- }
922
- const be = {
923
- inert: /* @__PURE__ */ new WeakMap(),
924
- "aria-hidden": /* @__PURE__ */ new WeakMap(),
925
- none: /* @__PURE__ */ new WeakMap()
926
- };
927
- function ht(e) {
928
- return e === "inert" ? be.inert : e === "aria-hidden" ? be["aria-hidden"] : be.none;
929
- }
930
- let Se = /* @__PURE__ */ new WeakSet(), Ie = {}, He = 0;
931
- const Gn = () => typeof HTMLElement < "u" && "inert" in HTMLElement.prototype, Ht = (e) => e && (e.host || Ht(e.parentNode)), Zn = (e, t) => t.map((n) => {
932
- if (e.contains(n))
933
- return n;
934
- const r = Ht(n);
935
- return e.contains(r) ? r : null;
936
- }).filter((n) => n != null);
937
- function zn(e, t, n, r) {
938
- const o = "data-floating-ui-inert", s = r ? "inert" : n ? "aria-hidden" : null, i = Zn(t, e), a = /* @__PURE__ */ new Set(), c = new Set(i), l = [];
939
- Ie[o] || (Ie[o] = /* @__PURE__ */ new WeakMap());
940
- const v = Ie[o];
941
- i.forEach(y), w(t), a.clear();
942
- function y(f) {
943
- !f || a.has(f) || (a.add(f), f.parentNode && y(f.parentNode));
944
- }
945
- function w(f) {
946
- !f || c.has(f) || [].forEach.call(f.children, (h) => {
947
- if (At(h) !== "script")
948
- if (a.has(h))
949
- w(h);
950
- else {
951
- const d = s ? h.getAttribute(s) : null, x = d !== null && d !== "false", C = ht(s), g = (C.get(h) || 0) + 1, E = (v.get(h) || 0) + 1;
952
- C.set(h, g), v.set(h, E), l.push(h), g === 1 && x && Se.add(h), E === 1 && h.setAttribute(o, ""), !x && s && h.setAttribute(s, s === "inert" ? "" : "true");
953
- }
954
- });
955
- }
956
- return He++, () => {
957
- l.forEach((f) => {
958
- const h = ht(s), x = (h.get(f) || 0) - 1, C = (v.get(f) || 0) - 1;
959
- h.set(f, x), v.set(f, C), x || (!Se.has(f) && s && f.removeAttribute(s), Se.delete(f)), C || f.removeAttribute(o);
960
- }), He--, He || (be.inert = /* @__PURE__ */ new WeakMap(), be["aria-hidden"] = /* @__PURE__ */ new WeakMap(), be.none = /* @__PURE__ */ new WeakMap(), Se = /* @__PURE__ */ new WeakSet(), Ie = {});
961
- };
962
- }
963
- function Rt(e, t, n) {
964
- t === void 0 && (t = !1), n === void 0 && (n = !1);
965
- const r = Xn(e[0]).body;
966
- return zn(e.concat(Array.from(r.querySelectorAll("[aria-live]"))), r, t, n);
967
- }
968
- const _e = {
969
- border: 0,
970
- clip: "rect(0 0 0 0)",
971
- height: "1px",
972
- margin: "-1px",
973
- overflow: "hidden",
974
- padding: 0,
975
- position: "fixed",
976
- whiteSpace: "nowrap",
977
- width: "1px",
978
- top: 0,
979
- left: 0
980
- }, Le = /* @__PURE__ */ u.forwardRef(function(t, n) {
981
- const [r, o] = u.useState();
982
- G(() => {
983
- Bt() && o("button");
984
- }, []);
985
- const s = {
986
- ref: n,
987
- tabIndex: 0,
988
- // Role is only for VoiceOver
989
- role: r,
990
- "aria-hidden": r ? void 0 : !0,
991
- [pe("focus-guard")]: "",
992
- style: _e
993
- };
994
- return /* @__PURE__ */ ne("span", {
995
- ...t,
996
- ...s
997
- });
998
- }), Yt = /* @__PURE__ */ u.createContext(null), yt = /* @__PURE__ */ pe("portal");
999
- function Jn(e) {
1000
- e === void 0 && (e = {});
1001
- const {
1002
- id: t,
1003
- root: n
1004
- } = e, r = Ne(), o = Xt(), [s, i] = u.useState(null), a = u.useRef(null);
1005
- return G(() => () => {
1006
- s == null || s.remove(), queueMicrotask(() => {
1007
- a.current = null;
1008
- });
1009
- }, [s]), G(() => {
1010
- if (!r || a.current) return;
1011
- const c = t ? document.getElementById(t) : null;
1012
- if (!c) return;
1013
- const l = document.createElement("div");
1014
- l.id = r, l.setAttribute(yt, ""), c.appendChild(l), a.current = l, i(l);
1015
- }, [t, r]), G(() => {
1016
- if (n === null || !r || a.current) return;
1017
- let c = n || (o == null ? void 0 : o.portalNode);
1018
- c && !J(c) && (c = c.current), c = c || document.body;
1019
- let l = null;
1020
- t && (l = document.createElement("div"), l.id = t, c.appendChild(l));
1021
- const v = document.createElement("div");
1022
- v.id = r, v.setAttribute(yt, ""), c = l || c, c.appendChild(v), a.current = v, i(v);
1023
- }, [t, n, r, o]), s;
1024
- }
1025
- function yr(e) {
1026
- const {
1027
- children: t,
1028
- id: n,
1029
- root: r,
1030
- preserveTabOrder: o = !0
1031
- } = e, s = Jn({
1032
- id: n,
1033
- root: r
1034
- }), [i, a] = u.useState(null), c = u.useRef(null), l = u.useRef(null), v = u.useRef(null), y = u.useRef(null), w = i == null ? void 0 : i.modal, f = i == null ? void 0 : i.open, h = (
1035
- // The FocusManager and therefore floating element are currently open/
1036
- // rendered.
1037
- !!i && // Guards are only for non-modal focus management.
1038
- !i.modal && // Don't render if unmount is transitioning.
1039
- i.open && o && !!(r || s)
1040
- );
1041
- return u.useEffect(() => {
1042
- if (!s || !o || w)
1043
- return;
1044
- function d(x) {
1045
- s && ye(x) && (x.type === "focusin" ? lt : Fn)(s);
1046
- }
1047
- return s.addEventListener("focusin", d, !0), s.addEventListener("focusout", d, !0), () => {
1048
- s.removeEventListener("focusin", d, !0), s.removeEventListener("focusout", d, !0);
1049
- };
1050
- }, [s, o, w]), u.useEffect(() => {
1051
- s && (f || lt(s));
1052
- }, [f, s]), /* @__PURE__ */ Qe(Yt.Provider, {
1053
- value: u.useMemo(() => ({
1054
- preserveTabOrder: o,
1055
- beforeOutsideRef: c,
1056
- afterOutsideRef: l,
1057
- beforeInsideRef: v,
1058
- afterInsideRef: y,
1059
- portalNode: s,
1060
- setFocusManagerState: a
1061
- }), [o, s]),
1062
- children: [h && s && /* @__PURE__ */ ne(Le, {
1063
- "data-type": "outside",
1064
- ref: c,
1065
- onFocus: (d) => {
1066
- if (ye(d, s)) {
1067
- var x;
1068
- (x = v.current) == null || x.focus();
1069
- } else {
1070
- const C = i ? i.domReference : null, g = jt(C);
1071
- g == null || g.focus();
1072
- }
1073
- }
1074
- }), h && s && /* @__PURE__ */ ne("span", {
1075
- "aria-owns": s.id,
1076
- style: _e
1077
- }), s && /* @__PURE__ */ et.createPortal(t, s), h && s && /* @__PURE__ */ ne(Le, {
1078
- "data-type": "outside",
1079
- ref: l,
1080
- onFocus: (d) => {
1081
- if (ye(d, s)) {
1082
- var x;
1083
- (x = y.current) == null || x.focus();
1084
- } else {
1085
- const C = i ? i.domReference : null, g = qt(C);
1086
- g == null || g.focus(), i != null && i.closeOnFocusOut && (i == null || i.onOpenChange(!1, d.nativeEvent, "focus-out"));
1087
- }
1088
- }
1089
- })]
1090
- });
1091
- }
1092
- const Xt = () => u.useContext(Yt);
1093
- function Et(e) {
1094
- return u.useMemo(() => (t) => {
1095
- e.forEach((n) => {
1096
- n && (n.current = t);
1097
- });
1098
- }, e);
1099
- }
1100
- const Qn = 20;
1101
- let me = [];
1102
- function er(e) {
1103
- me = me.filter((t) => t.isConnected), e && At(e) !== "body" && (me.push(e), me.length > Qn && (me = me.slice(-20)));
1104
- }
1105
- function wt() {
1106
- return me.slice().reverse().find((e) => e.isConnected);
1107
- }
1108
- function tr(e) {
1109
- const t = xe();
1110
- return _t(e, t) ? e : De(e, t)[0] || e;
1111
- }
1112
- function xt(e, t) {
1113
- var n;
1114
- if (!t.current.includes("floating") && !((n = e.getAttribute("role")) != null && n.includes("dialog")))
1115
- return;
1116
- const r = xe(), s = yn(e, r).filter((a) => {
1117
- const c = a.getAttribute("data-tabindex") || "";
1118
- return _t(a, r) || a.hasAttribute("data-tabindex") && !c.startsWith("-");
1119
- }), i = e.getAttribute("tabindex");
1120
- t.current.includes("floating") || s.length === 0 ? i !== "0" && e.setAttribute("tabindex", "0") : (i !== "-1" || e.hasAttribute("data-tabindex") && e.getAttribute("data-tabindex") !== "-1") && (e.setAttribute("tabindex", "-1"), e.setAttribute("data-tabindex", "-1"));
1121
- }
1122
- const nr = /* @__PURE__ */ u.forwardRef(function(t, n) {
1123
- return /* @__PURE__ */ ne("button", {
1124
- ...t,
1125
- type: "button",
1126
- ref: n,
1127
- tabIndex: -1,
1128
- style: _e
1129
- });
1130
- });
1131
- function Er(e) {
1132
- const {
1133
- context: t,
1134
- children: n,
1135
- disabled: r = !1,
1136
- order: o = ["content"],
1137
- guards: s = !0,
1138
- initialFocus: i = 0,
1139
- returnFocus: a = !0,
1140
- restoreFocus: c = !1,
1141
- modal: l = !0,
1142
- visuallyHiddenDismiss: v = !1,
1143
- closeOnFocusOut: y = !0,
1144
- outsideElementsInert: w = !1,
1145
- getInsideElements: f = () => []
1146
- } = e, {
1147
- open: h,
1148
- onOpenChange: d,
1149
- events: x,
1150
- dataRef: C,
1151
- elements: {
1152
- domReference: g,
1153
- floating: E
1154
- }
1155
- } = t, S = ee(() => {
1156
- var M;
1157
- return (M = C.current.floatingContext) == null ? void 0 : M.nodeId;
1158
- }), D = ee(f), _ = typeof i == "number" && i < 0, A = at(g) && _, K = Gn(), j = K ? s : !0, H = !j || K && w, N = ve(o), W = ve(i), B = ve(a), O = $e(), m = Xt(), F = u.useRef(null), T = u.useRef(null), p = u.useRef(!1), R = u.useRef(!1), I = u.useRef(-1), V = m != null, b = Je(E), $ = ee(function(M) {
1159
- return M === void 0 && (M = b), M ? De(M, xe()) : [];
1160
- }), ie = ee((M) => {
1161
- const L = $(M);
1162
- return N.current.map((P) => g && P === "reference" ? g : b && P === "floating" ? b : L).filter(Boolean).flat();
1163
- });
1164
- u.useEffect(() => {
1165
- if (r || !l) return;
1166
- function M(P) {
1167
- if (P.key === "Tab") {
1168
- z(b, fe(Q(b))) && $().length === 0 && !A && Ke(P);
1169
- const k = ie(), Y = ae(P);
1170
- N.current[0] === "reference" && Y === g && (Ke(P), P.shiftKey ? ge(k[k.length - 1]) : ge(k[1])), N.current[1] === "floating" && Y === b && P.shiftKey && (Ke(P), ge(k[0]));
1171
- }
1172
- }
1173
- const L = Q(b);
1174
- return L.addEventListener("keydown", M), () => {
1175
- L.removeEventListener("keydown", M);
1176
- };
1177
- }, [r, g, b, l, N, A, $, ie]), u.useEffect(() => {
1178
- if (r || !E) return;
1179
- function M(L) {
1180
- const P = ae(L), Y = $().indexOf(P);
1181
- Y !== -1 && (I.current = Y);
1182
- }
1183
- return E.addEventListener("focusin", M), () => {
1184
- E.removeEventListener("focusin", M);
1185
- };
1186
- }, [r, E, $]), u.useEffect(() => {
1187
- if (r || !y) return;
1188
- function M() {
1189
- R.current = !0, setTimeout(() => {
1190
- R.current = !1;
1191
- });
1192
- }
1193
- function L(P) {
1194
- const k = P.relatedTarget, Y = P.currentTarget, X = ae(P);
1195
- queueMicrotask(() => {
1196
- const oe = S(), ue = !(z(g, k) || z(E, k) || z(k, E) || z(m == null ? void 0 : m.portalNode, k) || k != null && k.hasAttribute(pe("focus-guard")) || O && (Re(O.nodesRef.current, oe).find((q) => {
1197
- var U, le;
1198
- return z((U = q.context) == null ? void 0 : U.elements.floating, k) || z((le = q.context) == null ? void 0 : le.elements.domReference, k);
1199
- }) || ct(O.nodesRef.current, oe).find((q) => {
1200
- var U, le, ot;
1201
- return [(U = q.context) == null ? void 0 : U.elements.floating, Je((le = q.context) == null ? void 0 : le.elements.floating)].includes(k) || ((ot = q.context) == null ? void 0 : ot.elements.domReference) === k;
1202
- })));
1203
- if (Y === g && b && xt(b, N), c && Y !== g && !(X != null && X.isConnected) && fe(Q(b)) === Q(b).body) {
1204
- se(b) && b.focus();
1205
- const q = I.current, U = $(), le = U[q] || U[U.length - 1] || b;
1206
- se(le) && le.focus();
1207
- }
1208
- if (C.current.insideReactTree) {
1209
- C.current.insideReactTree = !1;
1210
- return;
1211
- }
1212
- (A || !l) && k && ue && !R.current && // Fix React 18 Strict Mode returnFocus due to double rendering.
1213
- k !== wt() && (p.current = !0, d(!1, P, "focus-out"));
1214
- });
1215
- }
1216
- if (E && se(g))
1217
- return g.addEventListener("focusout", L), g.addEventListener("pointerdown", M), E.addEventListener("focusout", L), () => {
1218
- g.removeEventListener("focusout", L), g.removeEventListener("pointerdown", M), E.removeEventListener("focusout", L);
1219
- };
1220
- }, [r, g, E, b, l, O, m, d, y, c, $, A, S, N, C]);
1221
- const ce = u.useRef(null), Z = u.useRef(null), re = Et([ce, m == null ? void 0 : m.beforeInsideRef]), de = Et([Z, m == null ? void 0 : m.afterInsideRef]);
1222
- u.useEffect(() => {
1223
- var M, L;
1224
- if (r || !E) return;
1225
- const P = Array.from((m == null || (M = m.portalNode) == null ? void 0 : M.querySelectorAll("[" + pe("portal") + "]")) || []), k = O ? ct(O.nodesRef.current, S()) : [], Y = O && !l ? k.map((q) => {
1226
- var U;
1227
- return (U = q.context) == null ? void 0 : U.elements.floating;
1228
- }) : [], X = (L = k.find((q) => {
1229
- var U;
1230
- return at(((U = q.context) == null ? void 0 : U.elements.domReference) || null);
1231
- })) == null || (L = L.context) == null ? void 0 : L.elements.domReference, oe = [E, X, ...P, ...Y, ...D(), F.current, T.current, ce.current, Z.current, m == null ? void 0 : m.beforeOutsideRef.current, m == null ? void 0 : m.afterOutsideRef.current, N.current.includes("reference") || A ? g : null].filter((q) => q != null), ue = l || A ? Rt(oe, !H, H) : Rt(oe);
1232
- return () => {
1233
- ue();
1234
- };
1235
- }, [r, g, E, l, N, m, A, j, H, O, S, D]), G(() => {
1236
- if (r || !se(b)) return;
1237
- const M = Q(b), L = fe(M);
1238
- queueMicrotask(() => {
1239
- const P = ie(b), k = W.current, Y = (typeof k == "number" ? P[k] : k.current) || b, X = z(b, L);
1240
- !_ && !X && h && ge(Y, {
1241
- preventScroll: Y === b
1242
- });
1243
- });
1244
- }, [r, h, b, _, ie, W]), G(() => {
1245
- if (r || !b) return;
1246
- const M = Q(b), L = fe(M);
1247
- er(L);
1248
- function P(X) {
1249
- let {
1250
- reason: oe,
1251
- event: ue,
1252
- nested: q
1253
- } = X;
1254
- if (["hover", "safe-polygon"].includes(oe) && ue.type === "mouseleave" && (p.current = !0), oe === "outside-press")
1255
- if (q)
1256
- p.current = !1;
1257
- else if (Sn(ue) || In(ue))
1258
- p.current = !1;
1259
- else {
1260
- let U = !1;
1261
- document.createElement("div").focus({
1262
- get preventScroll() {
1263
- return U = !0, !1;
1264
- }
1265
- }), U ? p.current = !1 : p.current = !0;
1266
- }
1267
- }
1268
- x.on("openchange", P);
1269
- const k = M.createElement("span");
1270
- k.setAttribute("tabindex", "-1"), k.setAttribute("aria-hidden", "true"), Object.assign(k.style, _e), V && g && g.insertAdjacentElement("afterend", k);
1271
- function Y() {
1272
- if (typeof B.current == "boolean") {
1273
- const X = g || wt();
1274
- return X && X.isConnected ? X : k;
1275
- }
1276
- return B.current.current || k;
1277
- }
1278
- return () => {
1279
- x.off("openchange", P);
1280
- const X = fe(M), oe = z(E, X) || O && Re(O.nodesRef.current, S()).some((q) => {
1281
- var U;
1282
- return z((U = q.context) == null ? void 0 : U.elements.floating, X);
1283
- }), ue = Y();
1284
- queueMicrotask(() => {
1285
- const q = tr(ue);
1286
- // eslint-disable-next-line react-hooks/exhaustive-deps
1287
- B.current && !p.current && se(q) && // If the focus moved somewhere else after mount, avoid returning focus
1288
- // since it likely entered a different element which should be
1289
- // respected: https://github.com/floating-ui/floating-ui/issues/2607
1290
- (!(q !== X && X !== M.body) || oe) && q.focus({
1291
- preventScroll: !0
1292
- }), k.remove();
1293
- });
1294
- };
1295
- }, [r, E, b, B, C, x, O, V, g, S]), u.useEffect(() => {
1296
- queueMicrotask(() => {
1297
- p.current = !1;
1298
- });
1299
- }, [r]), G(() => {
1300
- if (!r && m)
1301
- return m.setFocusManagerState({
1302
- modal: l,
1303
- closeOnFocusOut: y,
1304
- open: h,
1305
- onOpenChange: d,
1306
- domReference: g
1307
- }), () => {
1308
- m.setFocusManagerState(null);
1309
- };
1310
- }, [r, m, l, h, d, y, g]), G(() => {
1311
- r || b && xt(b, N);
1312
- }, [r, b, N]);
1313
- function Te(M) {
1314
- return r || !v || !l ? null : /* @__PURE__ */ ne(nr, {
1315
- ref: M === "start" ? F : T,
1316
- onClick: (L) => d(!1, L.nativeEvent),
1317
- children: typeof v == "string" ? v : "Dismiss"
1318
- });
1319
- }
1320
- const Ce = !r && j && (l ? !A : !0) && (V || l);
1321
- return /* @__PURE__ */ Qe(rn, {
1322
- children: [Ce && /* @__PURE__ */ ne(Le, {
1323
- "data-type": "inside",
1324
- ref: re,
1325
- onFocus: (M) => {
1326
- if (l) {
1327
- const P = ie();
1328
- ge(o[0] === "reference" ? P[0] : P[P.length - 1]);
1329
- } else if (m != null && m.preserveTabOrder && m.portalNode)
1330
- if (p.current = !1, ye(M, m.portalNode)) {
1331
- const P = qt(g);
1332
- P == null || P.focus();
1333
- } else {
1334
- var L;
1335
- (L = m.beforeOutsideRef.current) == null || L.focus();
1336
- }
1337
- }
1338
- }), !A && Te("start"), n, Te("end"), Ce && /* @__PURE__ */ ne(Le, {
1339
- "data-type": "inside",
1340
- ref: de,
1341
- onFocus: (M) => {
1342
- if (l)
1343
- ge(ie()[0]);
1344
- else if (m != null && m.preserveTabOrder && m.portalNode)
1345
- if (y && (p.current = !0), ye(M, m.portalNode)) {
1346
- const P = jt(g);
1347
- P == null || P.focus();
1348
- } else {
1349
- var L;
1350
- (L = m.afterOutsideRef.current) == null || L.focus();
1351
- }
1352
- }
1353
- })]
1354
- });
1355
- }
1356
- let Me = 0;
1357
- const Tt = "--floating-ui-scrollbar-width";
1358
- function rr() {
1359
- const e = tt(), t = /iP(hone|ad|od)|iOS/.test(e) || // iPads can claim to be MacIntel
1360
- e === "MacIntel" && navigator.maxTouchPoints > 1, n = document.body.style, o = Math.round(document.documentElement.getBoundingClientRect().left) + document.documentElement.scrollLeft ? "paddingLeft" : "paddingRight", s = window.innerWidth - document.documentElement.clientWidth, i = n.left ? parseFloat(n.left) : window.scrollX, a = n.top ? parseFloat(n.top) : window.scrollY;
1361
- if (n.overflow = "hidden", n.setProperty(Tt, s + "px"), s && (n[o] = s + "px"), t) {
1362
- var c, l;
1363
- const v = ((c = window.visualViewport) == null ? void 0 : c.offsetLeft) || 0, y = ((l = window.visualViewport) == null ? void 0 : l.offsetTop) || 0;
1364
- Object.assign(n, {
1365
- position: "fixed",
1366
- top: -(a - Math.floor(y)) + "px",
1367
- left: -(i - Math.floor(v)) + "px",
1368
- right: "0"
1369
- });
1370
- }
1371
- return () => {
1372
- Object.assign(n, {
1373
- overflow: "",
1374
- [o]: ""
1375
- }), n.removeProperty(Tt), t && (Object.assign(n, {
1376
- position: "",
1377
- top: "",
1378
- left: "",
1379
- right: ""
1380
- }), window.scrollTo(i, a));
1381
- };
1382
- }
1383
- let Ct = () => {
1384
- };
1385
- const wr = /* @__PURE__ */ u.forwardRef(function(t, n) {
1386
- const {
1387
- lockScroll: r = !1,
1388
- ...o
1389
- } = t;
1390
- return G(() => {
1391
- if (r)
1392
- return Me++, Me === 1 && (Ct = rr()), () => {
1393
- Me--, Me === 0 && Ct();
1394
- };
1395
- }, [r]), /* @__PURE__ */ ne("div", {
1396
- ref: n,
1397
- ...o,
1398
- style: {
1399
- position: "fixed",
1400
- overflow: "auto",
1401
- top: 0,
1402
- right: 0,
1403
- bottom: 0,
1404
- left: 0,
1405
- ...o.style
1406
- }
1407
- });
1408
- });
1409
- function St(e) {
1410
- return se(e.target) && e.target.tagName === "BUTTON";
1411
- }
1412
- function or(e) {
1413
- return se(e.target) && e.target.tagName === "A";
1414
- }
1415
- function It(e) {
1416
- return nt(e);
1417
- }
1418
- function xr(e, t) {
1419
- t === void 0 && (t = {});
1420
- const {
1421
- open: n,
1422
- onOpenChange: r,
1423
- dataRef: o,
1424
- elements: {
1425
- domReference: s
1426
- }
1427
- } = e, {
1428
- enabled: i = !0,
1429
- event: a = "click",
1430
- toggle: c = !0,
1431
- ignoreMouse: l = !1,
1432
- keyboardHandlers: v = !0,
1433
- stickIfOpen: y = !0
1434
- } = t, w = u.useRef(), f = u.useRef(!1), h = u.useMemo(() => ({
1435
- onPointerDown(d) {
1436
- w.current = d.pointerType;
1437
- },
1438
- onMouseDown(d) {
1439
- const x = w.current;
1440
- d.button === 0 && a !== "click" && (Ee(x, !0) && l || (n && c && (!(o.current.openEvent && y) || o.current.openEvent.type === "mousedown") ? r(!1, d.nativeEvent, "click") : (d.preventDefault(), r(!0, d.nativeEvent, "click"))));
1441
- },
1442
- onClick(d) {
1443
- const x = w.current;
1444
- if (a === "mousedown" && w.current) {
1445
- w.current = void 0;
1446
- return;
1447
- }
1448
- Ee(x, !0) && l || (n && c && (!(o.current.openEvent && y) || o.current.openEvent.type === "click") ? r(!1, d.nativeEvent, "click") : r(!0, d.nativeEvent, "click"));
1449
- },
1450
- onKeyDown(d) {
1451
- w.current = void 0, !(d.defaultPrevented || !v || St(d)) && (d.key === " " && !It(s) && (d.preventDefault(), f.current = !0), !or(d) && d.key === "Enter" && r(!(n && c), d.nativeEvent, "click"));
1452
- },
1453
- onKeyUp(d) {
1454
- d.defaultPrevented || !v || St(d) || It(s) || d.key === " " && f.current && (f.current = !1, r(!(n && c), d.nativeEvent, "click"));
1455
- }
1456
- }), [o, s, a, l, v, r, n, y, c]);
1457
- return u.useMemo(() => i ? {
1458
- reference: h
1459
- } : {}, [i, h]);
1460
- }
1461
- const sr = {
1462
- pointerdown: "onPointerDown",
1463
- mousedown: "onMouseDown",
1464
- click: "onClick"
1465
- }, ir = {
1466
- pointerdown: "onPointerDownCapture",
1467
- mousedown: "onMouseDownCapture",
1468
- click: "onClickCapture"
1469
- }, Mt = (e) => {
1470
- var t, n;
1471
- return {
1472
- escapeKey: typeof e == "boolean" ? e : (t = e == null ? void 0 : e.escapeKey) != null ? t : !1,
1473
- outsidePress: typeof e == "boolean" ? e : (n = e == null ? void 0 : e.outsidePress) != null ? n : !0
1474
- };
1475
- };
1476
- function Tr(e, t) {
1477
- t === void 0 && (t = {});
1478
- const {
1479
- open: n,
1480
- onOpenChange: r,
1481
- elements: o,
1482
- dataRef: s
1483
- } = e, {
1484
- enabled: i = !0,
1485
- escapeKey: a = !0,
1486
- outsidePress: c = !0,
1487
- outsidePressEvent: l = "pointerdown",
1488
- referencePress: v = !1,
1489
- referencePressEvent: y = "pointerdown",
1490
- ancestorScroll: w = !1,
1491
- bubbles: f,
1492
- capture: h
1493
- } = t, d = $e(), x = ee(typeof c == "function" ? c : () => !1), C = typeof c == "function" ? x : c, g = u.useRef(!1), {
1494
- escapeKey: E,
1495
- outsidePress: S
1496
- } = Mt(f), {
1497
- escapeKey: D,
1498
- outsidePress: _
1499
- } = Mt(h), A = u.useRef(!1), K = u.useRef(-1), j = ee((m) => {
1500
- var F;
1501
- if (!n || !i || !a || m.key !== "Escape" || A.current)
1502
- return;
1503
- const T = (F = s.current.floatingContext) == null ? void 0 : F.nodeId, p = d ? Re(d.nodesRef.current, T) : [];
1504
- if (!E && (m.stopPropagation(), p.length > 0)) {
1505
- let R = !0;
1506
- if (p.forEach((I) => {
1507
- var V;
1508
- if ((V = I.context) != null && V.open && !I.context.dataRef.current.__escapeKeyBubbles) {
1509
- R = !1;
1510
- return;
1511
- }
1512
- }), !R)
1513
- return;
1514
- }
1515
- r(!1, Cn(m) ? m.nativeEvent : m, "escape-key");
1516
- }), H = ee((m) => {
1517
- var F;
1518
- const T = () => {
1519
- var p;
1520
- j(m), (p = ae(m)) == null || p.removeEventListener("keydown", T);
1521
- };
1522
- (F = ae(m)) == null || F.addEventListener("keydown", T);
1523
- }), N = ee((m) => {
1524
- var F;
1525
- const T = s.current.insideReactTree;
1526
- s.current.insideReactTree = !1;
1527
- const p = g.current;
1528
- if (g.current = !1, l === "click" && p || T || typeof C == "function" && !C(m))
1529
- return;
1530
- const R = ae(m), I = "[" + pe("inert") + "]", V = Q(o.floating).querySelectorAll(I);
1531
- let b = J(R) ? R : null;
1532
- for (; b && !Be(b); ) {
1533
- const Z = nn(b);
1534
- if (Be(Z) || !J(Z))
1535
- break;
1536
- b = Z;
1537
- }
1538
- if (V.length && J(R) && !xn(R) && // Clicked on a direct ancestor (e.g. FloatingOverlay).
1539
- !z(R, o.floating) && // If the target root element contains none of the markers, then the
1540
- // element was injected after the floating element rendered.
1541
- Array.from(V).every((Z) => !z(b, Z)))
1542
- return;
1543
- if (se(R) && O) {
1544
- const Z = Be(R), re = kt(R), de = /auto|scroll/, Te = Z || de.test(re.overflowX), Ce = Z || de.test(re.overflowY), M = Te && R.clientWidth > 0 && R.scrollWidth > R.clientWidth, L = Ce && R.clientHeight > 0 && R.scrollHeight > R.clientHeight, P = re.direction === "rtl", k = L && (P ? m.offsetX <= R.offsetWidth - R.clientWidth : m.offsetX > R.clientWidth), Y = M && m.offsetY > R.clientHeight;
1545
- if (k || Y)
1546
- return;
1547
- }
1548
- const $ = (F = s.current.floatingContext) == null ? void 0 : F.nodeId, ie = d && Re(d.nodesRef.current, $).some((Z) => {
1549
- var re;
1550
- return Ve(m, (re = Z.context) == null ? void 0 : re.elements.floating);
1551
- });
1552
- if (Ve(m, o.floating) || Ve(m, o.domReference) || ie)
1553
- return;
1554
- const ce = d ? Re(d.nodesRef.current, $) : [];
1555
- if (ce.length > 0) {
1556
- let Z = !0;
1557
- if (ce.forEach((re) => {
1558
- var de;
1559
- if ((de = re.context) != null && de.open && !re.context.dataRef.current.__outsidePressBubbles) {
1560
- Z = !1;
1561
- return;
1562
- }
1563
- }), !Z)
1564
- return;
1565
- }
1566
- r(!1, m, "outside-press");
1567
- }), W = ee((m) => {
1568
- var F;
1569
- const T = () => {
1570
- var p;
1571
- N(m), (p = ae(m)) == null || p.removeEventListener(l, T);
1572
- };
1573
- (F = ae(m)) == null || F.addEventListener(l, T);
1574
- });
1575
- u.useEffect(() => {
1576
- if (!n || !i)
1577
- return;
1578
- s.current.__escapeKeyBubbles = E, s.current.__outsidePressBubbles = S;
1579
- let m = -1;
1580
- function F(V) {
1581
- r(!1, V, "ancestor-scroll");
1582
- }
1583
- function T() {
1584
- window.clearTimeout(m), A.current = !0;
1585
- }
1586
- function p() {
1587
- m = window.setTimeout(
1588
- () => {
1589
- A.current = !1;
1590
- },
1591
- // 0ms or 1ms don't work in Safari. 5ms appears to consistently work.
1592
- // Only apply to WebKit for the test to remain 0ms.
1593
- tn() ? 5 : 0
1594
- );
1595
- }
1596
- const R = Q(o.floating);
1597
- a && (R.addEventListener("keydown", D ? H : j, D), R.addEventListener("compositionstart", T), R.addEventListener("compositionend", p)), C && R.addEventListener(l, _ ? W : N, _);
1598
- let I = [];
1599
- return w && (J(o.domReference) && (I = We(o.domReference)), J(o.floating) && (I = I.concat(We(o.floating))), !J(o.reference) && o.reference && o.reference.contextElement && (I = I.concat(We(o.reference.contextElement)))), I = I.filter((V) => {
1600
- var b;
1601
- return V !== ((b = R.defaultView) == null ? void 0 : b.visualViewport);
1602
- }), I.forEach((V) => {
1603
- V.addEventListener("scroll", F, {
1604
- passive: !0
1605
- });
1606
- }), () => {
1607
- a && (R.removeEventListener("keydown", D ? H : j, D), R.removeEventListener("compositionstart", T), R.removeEventListener("compositionend", p)), C && R.removeEventListener(l, _ ? W : N, _), I.forEach((V) => {
1608
- V.removeEventListener("scroll", F);
1609
- }), window.clearTimeout(m);
1610
- };
1611
- }, [s, o, a, C, l, n, r, w, i, E, S, j, D, H, N, _, W]), u.useEffect(() => {
1612
- s.current.insideReactTree = !1;
1613
- }, [s, C, l]);
1614
- const B = u.useMemo(() => ({
1615
- onKeyDown: j,
1616
- ...v && {
1617
- [sr[y]]: (m) => {
1618
- r(!1, m.nativeEvent, "reference-press");
1619
- },
1620
- ...y !== "click" && {
1621
- onClick(m) {
1622
- r(!1, m.nativeEvent, "reference-press");
1623
- }
1624
- }
1625
- }
1626
- }), [j, r, v, y]), O = u.useMemo(() => ({
1627
- onKeyDown: j,
1628
- onMouseDown() {
1629
- g.current = !0;
1630
- },
1631
- onMouseUp() {
1632
- g.current = !0;
1633
- },
1634
- [ir[l]]: () => {
1635
- s.current.insideReactTree = !0;
1636
- },
1637
- onBlurCapture() {
1638
- d || (te(K), s.current.insideReactTree = !0, K.current = window.setTimeout(() => {
1639
- s.current.insideReactTree = !1;
1640
- }));
1641
- }
1642
- }), [j, l, s, d]);
1643
- return u.useMemo(() => i ? {
1644
- reference: B,
1645
- floating: O
1646
- } : {}, [i, B, O]);
1647
- }
1648
- function ur(e) {
1649
- const {
1650
- open: t = !1,
1651
- onOpenChange: n,
1652
- elements: r
1653
- } = e, o = Ne(), s = u.useRef({}), [i] = u.useState(() => Un()), a = rt() != null;
1654
- if (process.env.NODE_ENV !== "production") {
1655
- const f = r.reference;
1656
- f && !J(f) && jn("Cannot pass a virtual element to the `elements.reference` option,", "as it must be a real DOM element. Use `refs.setPositionReference()`", "instead.");
1657
- }
1658
- const [c, l] = u.useState(r.reference), v = ee((f, h, d) => {
1659
- s.current.openEvent = f ? h : void 0, i.emit("openchange", {
1660
- open: f,
1661
- event: h,
1662
- reason: d,
1663
- nested: a
1664
- }), n == null || n(f, h, d);
1665
- }), y = u.useMemo(() => ({
1666
- setPositionReference: l
1667
- }), []), w = u.useMemo(() => ({
1668
- reference: c || r.reference || null,
1669
- floating: r.floating || null,
1670
- domReference: r.reference
1671
- }), [c, r.reference, r.floating]);
1672
- return u.useMemo(() => ({
1673
- dataRef: s,
1674
- open: t,
1675
- onOpenChange: v,
1676
- elements: w,
1677
- events: i,
1678
- floatingId: o,
1679
- refs: y
1680
- }), [t, v, w, i, o, y]);
1681
- }
1682
- function Cr(e) {
1683
- e === void 0 && (e = {});
1684
- const {
1685
- nodeId: t
1686
- } = e, n = ur({
1687
- ...e,
1688
- elements: {
1689
- reference: null,
1690
- floating: null,
1691
- ...e.elements
1692
- }
1693
- }), r = e.rootContext || n, o = r.elements, [s, i] = u.useState(null), [a, c] = u.useState(null), v = (o == null ? void 0 : o.domReference) || s, y = u.useRef(null), w = $e();
1694
- G(() => {
1695
- v && (y.current = v);
1696
- }, [v]);
1697
- const f = Nn({
1698
- ...e,
1699
- elements: {
1700
- ...o,
1701
- ...a && {
1702
- reference: a
1703
- }
1704
- }
1705
- }), h = u.useCallback((E) => {
1706
- const S = J(E) ? {
1707
- getBoundingClientRect: () => E.getBoundingClientRect(),
1708
- getClientRects: () => E.getClientRects(),
1709
- contextElement: E
1710
- } : E;
1711
- c(S), f.refs.setReference(S);
1712
- }, [f.refs]), d = u.useCallback((E) => {
1713
- (J(E) || E === null) && (y.current = E, i(E)), (J(f.refs.reference.current) || f.refs.reference.current === null || // Don't allow setting virtual elements using the old technique back to
1714
- // `null` to support `positionReference` + an unstable `reference`
1715
- // callback ref.
1716
- E !== null && !J(E)) && f.refs.setReference(E);
1717
- }, [f.refs]), x = u.useMemo(() => ({
1718
- ...f.refs,
1719
- setReference: d,
1720
- setPositionReference: h,
1721
- domReference: y
1722
- }), [f.refs, d, h]), C = u.useMemo(() => ({
1723
- ...f.elements,
1724
- domReference: v
1725
- }), [f.elements, v]), g = u.useMemo(() => ({
1726
- ...f,
1727
- ...r,
1728
- refs: x,
1729
- elements: C,
1730
- nodeId: t
1731
- }), [f, x, C, t, r]);
1732
- return G(() => {
1733
- r.dataRef.current.floatingContext = g;
1734
- const E = w == null ? void 0 : w.nodesRef.current.find((S) => S.id === t);
1735
- E && (E.context = g);
1736
- }), u.useMemo(() => ({
1737
- ...f,
1738
- context: g,
1739
- refs: x,
1740
- elements: C
1741
- }), [f, x, C, g]);
1742
- }
1743
- function Ye() {
1744
- return En() && Bt();
1745
- }
1746
- function Sr(e, t) {
1747
- t === void 0 && (t = {});
1748
- const {
1749
- open: n,
1750
- onOpenChange: r,
1751
- events: o,
1752
- dataRef: s,
1753
- elements: i
1754
- } = e, {
1755
- enabled: a = !0,
1756
- visibleOnly: c = !0
1757
- } = t, l = u.useRef(!1), v = u.useRef(-1), y = u.useRef(!0);
1758
- u.useEffect(() => {
1759
- if (!a) return;
1760
- const f = en(i.domReference);
1761
- function h() {
1762
- !n && se(i.domReference) && i.domReference === fe(Q(i.domReference)) && (l.current = !0);
1763
- }
1764
- function d() {
1765
- y.current = !0;
1766
- }
1767
- function x() {
1768
- y.current = !1;
1769
- }
1770
- return f.addEventListener("blur", h), Ye() && (f.addEventListener("keydown", d, !0), f.addEventListener("pointerdown", x, !0)), () => {
1771
- f.removeEventListener("blur", h), Ye() && (f.removeEventListener("keydown", d, !0), f.removeEventListener("pointerdown", x, !0));
1772
- };
1773
- }, [i.domReference, n, a]), u.useEffect(() => {
1774
- if (!a) return;
1775
- function f(h) {
1776
- let {
1777
- reason: d
1778
- } = h;
1779
- (d === "reference-press" || d === "escape-key") && (l.current = !0);
1780
- }
1781
- return o.on("openchange", f), () => {
1782
- o.off("openchange", f);
1783
- };
1784
- }, [o, a]), u.useEffect(() => () => {
1785
- te(v);
1786
- }, []);
1787
- const w = u.useMemo(() => ({
1788
- onMouseLeave() {
1789
- l.current = !1;
1790
- },
1791
- onFocus(f) {
1792
- if (l.current) return;
1793
- const h = ae(f.nativeEvent);
1794
- if (c && J(h)) {
1795
- if (Ye() && !f.relatedTarget) {
1796
- if (!y.current && !nt(h))
1797
- return;
1798
- } else if (!Tn(h))
1799
- return;
1800
- }
1801
- r(!0, f.nativeEvent, "focus");
1802
- },
1803
- onBlur(f) {
1804
- l.current = !1;
1805
- const h = f.relatedTarget, d = f.nativeEvent, x = J(h) && h.hasAttribute(pe("focus-guard")) && h.getAttribute("data-type") === "outside";
1806
- v.current = window.setTimeout(() => {
1807
- var C;
1808
- const g = fe(i.domReference ? i.domReference.ownerDocument : document);
1809
- !h && g === i.domReference || z((C = s.current.floatingContext) == null ? void 0 : C.refs.floating.current, g) || z(i.domReference, g) || x || r(!1, d, "focus");
1810
- });
1811
- }
1812
- }), [s, i.domReference, r, c]);
1813
- return u.useMemo(() => a ? {
1814
- reference: w
1815
- } : {}, [a, w]);
1816
- }
1817
- function Xe(e, t, n) {
1818
- const r = /* @__PURE__ */ new Map(), o = n === "item";
1819
- let s = e;
1820
- if (o && e) {
1821
- const {
1822
- [dt]: i,
1823
- [mt]: a,
1824
- ...c
1825
- } = e;
1826
- s = c;
1827
- }
1828
- return {
1829
- ...n === "floating" && {
1830
- tabIndex: -1,
1831
- [_n]: ""
1832
- },
1833
- ...s,
1834
- ...t.map((i) => {
1835
- const a = i ? i[n] : null;
1836
- return typeof a == "function" ? e ? a(e) : null : a;
1837
- }).concat(e).reduce((i, a) => (a && Object.entries(a).forEach((c) => {
1838
- let [l, v] = c;
1839
- if (!(o && [dt, mt].includes(l)))
1840
- if (l.indexOf("on") === 0) {
1841
- if (r.has(l) || r.set(l, []), typeof v == "function") {
1842
- var y;
1843
- (y = r.get(l)) == null || y.push(v), i[l] = function() {
1844
- for (var w, f = arguments.length, h = new Array(f), d = 0; d < f; d++)
1845
- h[d] = arguments[d];
1846
- return (w = r.get(l)) == null ? void 0 : w.map((x) => x(...h)).find((x) => x !== void 0);
1847
- };
1848
- }
1849
- } else
1850
- i[l] = v;
1851
- }), i), {})
1852
- };
1853
- }
1854
- function Ir(e) {
1855
- e === void 0 && (e = []);
1856
- const t = e.map((a) => a == null ? void 0 : a.reference), n = e.map((a) => a == null ? void 0 : a.floating), r = e.map((a) => a == null ? void 0 : a.item), o = u.useCallback(
1857
- (a) => Xe(a, e, "reference"),
1858
- // eslint-disable-next-line react-hooks/exhaustive-deps
1859
- t
1860
- ), s = u.useCallback(
1861
- (a) => Xe(a, e, "floating"),
1862
- // eslint-disable-next-line react-hooks/exhaustive-deps
1863
- n
1864
- ), i = u.useCallback(
1865
- (a) => Xe(a, e, "item"),
1866
- // eslint-disable-next-line react-hooks/exhaustive-deps
1867
- r
1868
- );
1869
- return u.useMemo(() => ({
1870
- getReferenceProps: o,
1871
- getFloatingProps: s,
1872
- getItemProps: i
1873
- }), [o, s, i]);
1874
- }
1875
- const ar = /* @__PURE__ */ new Map([["select", "listbox"], ["combobox", "listbox"], ["label", !1]]);
1876
- function Mr(e, t) {
1877
- var n, r;
1878
- t === void 0 && (t = {});
1879
- const {
1880
- open: o,
1881
- elements: s,
1882
- floatingId: i
1883
- } = e, {
1884
- enabled: a = !0,
1885
- role: c = "dialog"
1886
- } = t, l = Ne(), v = ((n = s.domReference) == null ? void 0 : n.id) || l, y = u.useMemo(() => {
1887
- var g;
1888
- return ((g = Je(s.floating)) == null ? void 0 : g.id) || i;
1889
- }, [s.floating, i]), w = (r = ar.get(c)) != null ? r : c, h = rt() != null, d = u.useMemo(() => w === "tooltip" || c === "label" ? {
1890
- ["aria-" + (c === "label" ? "labelledby" : "describedby")]: o ? y : void 0
1891
- } : {
1892
- "aria-expanded": o ? "true" : "false",
1893
- "aria-haspopup": w === "alertdialog" ? "dialog" : w,
1894
- "aria-controls": o ? y : void 0,
1895
- ...w === "listbox" && {
1896
- role: "combobox"
1897
- },
1898
- ...w === "menu" && {
1899
- id: v
1900
- },
1901
- ...w === "menu" && h && {
1902
- role: "menuitem"
1903
- },
1904
- ...c === "select" && {
1905
- "aria-autocomplete": "none"
1906
- },
1907
- ...c === "combobox" && {
1908
- "aria-autocomplete": "list"
1909
- }
1910
- }, [w, y, h, o, v, c]), x = u.useMemo(() => {
1911
- const g = {
1912
- id: y,
1913
- ...w && {
1914
- role: w
1915
- }
1916
- };
1917
- return w === "tooltip" || c === "label" ? g : {
1918
- ...g,
1919
- ...w === "menu" && {
1920
- "aria-labelledby": v
1921
- }
1922
- };
1923
- }, [w, y, v, c]), C = u.useCallback((g) => {
1924
- let {
1925
- active: E,
1926
- selected: S
1927
- } = g;
1928
- const D = {
1929
- role: "option",
1930
- ...E && {
1931
- id: y + "-fui-option"
1932
- }
1933
- };
1934
- switch (c) {
1935
- case "select":
1936
- return {
1937
- ...D,
1938
- "aria-selected": E && S
1939
- };
1940
- case "combobox":
1941
- return {
1942
- ...D,
1943
- "aria-selected": S
1944
- };
1945
- }
1946
- return {};
1947
- }, [y, c]);
1948
- return u.useMemo(() => a ? {
1949
- reference: d,
1950
- floating: x,
1951
- item: C
1952
- } : {}, [a, d, x, C]);
1953
- }
1954
- function cr(e, t) {
1955
- const [n, r] = u.useState(e);
1956
- return e && !n && r(!0), u.useEffect(() => {
1957
- if (!e && n) {
1958
- const o = setTimeout(() => r(!1), t);
1959
- return () => clearTimeout(o);
1960
- }
1961
- }, [e, n, t]), n;
1962
- }
1963
- function Pr(e, t) {
1964
- t === void 0 && (t = {});
1965
- const {
1966
- open: n,
1967
- elements: {
1968
- floating: r
1969
- }
1970
- } = e, {
1971
- duration: o = 250
1972
- } = t, i = (typeof o == "number" ? o : o.close) || 0, [a, c] = u.useState("unmounted"), l = cr(n, i);
1973
- return !l && a === "close" && c("unmounted"), G(() => {
1974
- if (r) {
1975
- if (n) {
1976
- c("initial");
1977
- const v = requestAnimationFrame(() => {
1978
- et.flushSync(() => {
1979
- c("open");
1980
- });
1981
- });
1982
- return () => {
1983
- cancelAnimationFrame(v);
1984
- };
1985
- }
1986
- c("close");
1987
- }
1988
- }, [n, r]), {
1989
- isMounted: l,
1990
- status: a
1991
- };
1992
- }
1993
- export {
1994
- Er as F,
1995
- xr as a,
1996
- Tr as b,
1997
- Mr as c,
1998
- Ir as d,
1999
- br as e,
2000
- Pr as f,
2001
- yr as g,
2002
- wr as h,
2003
- pr as i,
2004
- gr as j,
2005
- hr as k,
2006
- Rr as l,
2007
- Sr as m,
2008
- mr as o,
2009
- vr as s,
2010
- Cr as u
2011
- };