lizaui 12.0.19 → 12.0.21

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 (186) hide show
  1. package/dist/button-group/index.cjs.js +1 -1
  2. package/dist/button-group/index.es.js +2 -2
  3. package/dist/button-v2/index.cjs.js +3 -3
  4. package/dist/button-v2/index.es.js +3 -3
  5. package/dist/chunks/{Button-daStTTzk.js → Button-Bumy9bze.js} +7 -56
  6. package/dist/chunks/Button-Bumy9bze.js.map +1 -0
  7. package/dist/chunks/{Button-DK8vIKEw.js → Button-CFYOfByw.js} +9 -58
  8. package/dist/chunks/Button-CFYOfByw.js.map +1 -0
  9. package/dist/chunks/{FocusScope-D-jCzxHq.js → FocusScope-4TdD5fCA.js} +3 -3
  10. package/dist/chunks/{FocusScope-D-jCzxHq.js.map → FocusScope-4TdD5fCA.js.map} +1 -1
  11. package/dist/chunks/{FocusScope-BJBTKF3R.js → FocusScope-jSNMAXzg.js} +3 -3
  12. package/dist/chunks/{FocusScope-BJBTKF3R.js.map → FocusScope-jSNMAXzg.js.map} +1 -1
  13. package/dist/chunks/Hidden-BY45Dc0j.js +54 -0
  14. package/dist/chunks/Hidden-BY45Dc0j.js.map +1 -0
  15. package/dist/chunks/Hidden-C55DpjMP.js +55 -0
  16. package/dist/chunks/Hidden-C55DpjMP.js.map +1 -0
  17. package/dist/chunks/{I18nProvider-8HiWALvM.js → I18nProvider-BUfkOEhQ.js} +2 -2
  18. package/dist/chunks/{I18nProvider-8HiWALvM.js.map → I18nProvider-BUfkOEhQ.js.map} +1 -1
  19. package/dist/chunks/{I18nProvider-DSyuLrKX.js → I18nProvider-Coj9x7B8.js} +2 -2
  20. package/dist/chunks/{I18nProvider-DSyuLrKX.js.map → I18nProvider-Coj9x7B8.js.map} +1 -1
  21. package/dist/chunks/{ProgressBar-CYj13G9N.js → ProgressBar-542C1mif.js} +5 -5
  22. package/dist/chunks/{ProgressBar-CYj13G9N.js.map → ProgressBar-542C1mif.js.map} +1 -1
  23. package/dist/chunks/{ProgressBar-BiWM84v5.js → ProgressBar-BiKRsJ8m.js} +5 -5
  24. package/dist/chunks/{ProgressBar-BiWM84v5.js.map → ProgressBar-BiKRsJ8m.js.map} +1 -1
  25. package/dist/chunks/SharedElementTransition-BSCoaphV.js +106 -0
  26. package/dist/chunks/{SharedElementTransition-D87oSBzB.js.map → SharedElementTransition-BSCoaphV.js.map} +1 -1
  27. package/dist/chunks/SharedElementTransition-CJVe1D_I.js +107 -0
  28. package/dist/chunks/{SharedElementTransition-BxczX23g.js.map → SharedElementTransition-CJVe1D_I.js.map} +1 -1
  29. package/dist/chunks/VisuallyHidden-CTe1-RoI.js +49 -0
  30. package/dist/chunks/VisuallyHidden-CTe1-RoI.js.map +1 -0
  31. package/dist/chunks/VisuallyHidden-DPJuOMsW.js +50 -0
  32. package/dist/chunks/VisuallyHidden-DPJuOMsW.js.map +1 -0
  33. package/dist/chunks/{button-group-CXxfE0Nh.js → button-group-CJ72SS4c.js} +2 -2
  34. package/dist/chunks/{button-group-CXxfE0Nh.js.map → button-group-CJ72SS4c.js.map} +1 -1
  35. package/dist/chunks/{button-group-CAIXp_CY.js → button-group-DJ5IdBp6.js} +2 -2
  36. package/dist/chunks/{button-group-CAIXp_CY.js.map → button-group-DJ5IdBp6.js.map} +1 -1
  37. package/dist/chunks/{compose-zqddfADC.js → compose-Cfw0sImv.js} +2 -2
  38. package/dist/chunks/{compose-zqddfADC.js.map → compose-Cfw0sImv.js.map} +1 -1
  39. package/dist/chunks/{compose-DVjlikkg.js → compose-DOOi0Yan.js} +2 -2
  40. package/dist/chunks/{compose-DVjlikkg.js.map → compose-DOOi0Yan.js.map} +1 -1
  41. package/dist/chunks/{focusSafely-CoIRf3xM.js → focusSafely-CKxVSn6H.js} +40 -2
  42. package/dist/chunks/{focusSafely-CoIRf3xM.js.map → focusSafely-CKxVSn6H.js.map} +1 -1
  43. package/dist/chunks/{focusSafely-kwqdsDlJ.js → focusSafely-DfEgLKh6.js} +46 -8
  44. package/dist/chunks/{focusSafely-kwqdsDlJ.js.map → focusSafely-DfEgLKh6.js.map} +1 -1
  45. package/dist/chunks/mergeRefs-Y9oG13yB.js +24 -0
  46. package/dist/chunks/mergeRefs-Y9oG13yB.js.map +1 -0
  47. package/dist/chunks/mergeRefs-t6d4XvXq.js +25 -0
  48. package/dist/chunks/mergeRefs-t6d4XvXq.js.map +1 -0
  49. package/dist/chunks/{number-ClNYm70x.js → number-CYgYWykt.js} +2 -2
  50. package/dist/chunks/{number-ClNYm70x.js.map → number-CYgYWykt.js.map} +1 -1
  51. package/dist/chunks/{number-apyCzMO6.js → number-DDpsLN2d.js} +2 -2
  52. package/dist/chunks/{number-apyCzMO6.js.map → number-DDpsLN2d.js.map} +1 -1
  53. package/dist/chunks/{radio-group-dNkQoY2h.js → radio-group-BwXvYzSm.js} +15 -13
  54. package/dist/chunks/{radio-group-dNkQoY2h.js.map → radio-group-BwXvYzSm.js.map} +1 -1
  55. package/dist/chunks/{radio-group-V6X0yA63.js → radio-group-hO2beGF6.js} +17 -15
  56. package/dist/chunks/{radio-group-V6X0yA63.js.map → radio-group-hO2beGF6.js.map} +1 -1
  57. package/dist/chunks/useControlledState-DE_m1RML.js +39 -0
  58. package/dist/chunks/useControlledState-DE_m1RML.js.map +1 -0
  59. package/dist/chunks/useControlledState-DZA25XHU.js +40 -0
  60. package/dist/chunks/useControlledState-DZA25XHU.js.map +1 -0
  61. package/dist/chunks/{useFormReset-Cf2fzi86.js → useFormReset-BYRGk5vb.js} +2 -2
  62. package/dist/chunks/{useFormReset-Cf2fzi86.js.map → useFormReset-BYRGk5vb.js.map} +1 -1
  63. package/dist/chunks/{useFormReset-Bwwr8ivc.js → useFormReset-Bgv2ktIE.js} +2 -2
  64. package/dist/chunks/{useFormReset-Bwwr8ivc.js.map → useFormReset-Bgv2ktIE.js.map} +1 -1
  65. package/dist/chunks/useHasTabbableChild-CSJ0P5QT.js +2577 -0
  66. package/dist/chunks/useHasTabbableChild-CSJ0P5QT.js.map +1 -0
  67. package/dist/chunks/useHasTabbableChild-kl2T5gEX.js +2576 -0
  68. package/dist/chunks/useHasTabbableChild-kl2T5gEX.js.map +1 -0
  69. package/dist/chunks/{useHover-B3gEex-2.js → useHover-BHCSbkLb.js} +3 -3
  70. package/dist/chunks/{useHover-B3gEex-2.js.map → useHover-BHCSbkLb.js.map} +1 -1
  71. package/dist/chunks/{useHover-Dn1CIUT8.js → useHover-D9f9xyxz.js} +3 -3
  72. package/dist/chunks/{useHover-Dn1CIUT8.js.map → useHover-D9f9xyxz.js.map} +1 -1
  73. package/dist/chunks/{useLabel-ClsFWJD0.js → useLabel-CzhH-Tov.js} +4 -23
  74. package/dist/chunks/useLabel-CzhH-Tov.js.map +1 -0
  75. package/dist/chunks/{useLabel-todYehRc.js → useLabel-YLbDMN-c.js} +4 -23
  76. package/dist/chunks/useLabel-YLbDMN-c.js.map +1 -0
  77. package/dist/chunks/useLabels-BiXnWBSL.js +23 -0
  78. package/dist/chunks/useLabels-BiXnWBSL.js.map +1 -0
  79. package/dist/chunks/useLabels-Bl0mJafM.js +24 -0
  80. package/dist/chunks/useLabels-Bl0mJafM.js.map +1 -0
  81. package/dist/chunks/{useMove-BifTPO2Z.js → useMove-DeuS9PRx.js} +3 -3
  82. package/dist/chunks/{useMove-BifTPO2Z.js.map → useMove-DeuS9PRx.js.map} +1 -1
  83. package/dist/chunks/{useMove-C6JNYkjM.js → useMove-Xpbmb6OD.js} +3 -3
  84. package/dist/chunks/{useMove-C6JNYkjM.js.map → useMove-Xpbmb6OD.js.map} +1 -1
  85. package/dist/chunks/{usePress-D_rPVnKY.js → usePress-Arf10jW0.js} +4 -4
  86. package/dist/chunks/{usePress-D_rPVnKY.js.map → usePress-Arf10jW0.js.map} +1 -1
  87. package/dist/chunks/{usePress-BtBLddLY.js → usePress-B1yQk_p8.js} +4 -4
  88. package/dist/chunks/{usePress-BtBLddLY.js.map → usePress-B1yQk_p8.js.map} +1 -1
  89. package/dist/chunks/{useProgressBar-B1VDzYE6.js → useProgressBar-BsO-Q5JP.js} +4 -4
  90. package/dist/chunks/{useProgressBar-B1VDzYE6.js.map → useProgressBar-BsO-Q5JP.js.map} +1 -1
  91. package/dist/chunks/{useProgressBar--b8hyT4v.js → useProgressBar-d2k0k8r0.js} +4 -4
  92. package/dist/chunks/{useProgressBar--b8hyT4v.js.map → useProgressBar-d2k0k8r0.js.map} +1 -1
  93. package/dist/chunks/{useSlot-DnUNwd8f.js → useSlot-CFaaZeQE.js} +4 -4
  94. package/dist/chunks/{useSlot-DnUNwd8f.js.map → useSlot-CFaaZeQE.js.map} +1 -1
  95. package/dist/chunks/{useSlot-Dwd3MQYT.js → useSlot-TNtJf1z8.js} +4 -4
  96. package/dist/chunks/{useSlot-Dwd3MQYT.js.map → useSlot-TNtJf1z8.js.map} +1 -1
  97. package/dist/chunks/{utils-Ki_DdjNi.js → utils-BCEhcDlv.js} +12 -33
  98. package/dist/chunks/utils-BCEhcDlv.js.map +1 -0
  99. package/dist/chunks/{utils-GD-7Nve2.js → utils-DvHk9ofL.js} +5 -26
  100. package/dist/chunks/utils-DvHk9ofL.js.map +1 -0
  101. package/dist/components/icons/icons.d.ts +20 -0
  102. package/dist/components/icons/icons.d.ts.map +1 -0
  103. package/dist/components/scroll-shadow/index.d.ts +22 -0
  104. package/dist/components/scroll-shadow/index.d.ts.map +1 -0
  105. package/dist/components/scroll-shadow/scroll-shadow.d.ts +33 -0
  106. package/dist/components/scroll-shadow/scroll-shadow.d.ts.map +1 -0
  107. package/dist/components/scroll-shadow/scroll-shadow.styles.d.ts +70 -0
  108. package/dist/components/scroll-shadow/scroll-shadow.styles.d.ts.map +1 -0
  109. package/dist/components/scroll-shadow/use-safe-layout-effect.d.ts +3 -0
  110. package/dist/components/scroll-shadow/use-safe-layout-effect.d.ts.map +1 -0
  111. package/dist/components/scroll-shadow/use-scroll-shadow.d.ts +12 -0
  112. package/dist/components/scroll-shadow/use-scroll-shadow.d.ts.map +1 -0
  113. package/dist/components/tabs/index.d.ts +26 -0
  114. package/dist/components/tabs/index.d.ts.map +1 -0
  115. package/dist/components/tabs/tabs.d.ts +40 -0
  116. package/dist/components/tabs/tabs.d.ts.map +1 -0
  117. package/dist/components/tabs/tabs.styles.d.ts +87 -0
  118. package/dist/components/tabs/tabs.styles.d.ts.map +1 -0
  119. package/dist/data-table/index.cjs.js +297 -2813
  120. package/dist/data-table/index.cjs.js.map +1 -1
  121. package/dist/data-table/index.es.js +208 -2724
  122. package/dist/data-table/index.es.js.map +1 -1
  123. package/dist/index.cjs.js +3 -3
  124. package/dist/index.es.js +3 -3
  125. package/dist/lib/utils/assertion.d.ts +10 -0
  126. package/dist/lib/utils/assertion.d.ts.map +1 -0
  127. package/dist/lib/utils/class-name.d.ts +8 -0
  128. package/dist/lib/utils/class-name.d.ts.map +1 -0
  129. package/dist/lib/utils/cn.d.ts +23 -0
  130. package/dist/lib/utils/cn.d.ts.map +1 -0
  131. package/dist/lib/utils/collection-prop-injection.d.ts +32 -0
  132. package/dist/lib/utils/collection-prop-injection.d.ts.map +1 -0
  133. package/dist/lib/utils/compose.d.ts +8 -0
  134. package/dist/lib/utils/compose.d.ts.map +1 -0
  135. package/dist/lib/utils/dom.d.ts +22 -0
  136. package/dist/lib/utils/dom.d.ts.map +1 -0
  137. package/dist/lib/utils/field-slots-gate.d.ts +10 -0
  138. package/dist/lib/utils/field-slots-gate.d.ts.map +1 -0
  139. package/dist/lib/utils/logger.d.ts +24 -0
  140. package/dist/lib/utils/logger.d.ts.map +1 -0
  141. package/dist/lib/utils/normalize.d.ts +6 -0
  142. package/dist/lib/utils/normalize.d.ts.map +1 -0
  143. package/dist/lib/utils/use-has-text-slot.d.ts +14 -0
  144. package/dist/lib/utils/use-has-text-slot.d.ts.map +1 -0
  145. package/dist/lizaui.css +632 -0
  146. package/dist/meter/index.cjs.js +4 -4
  147. package/dist/meter/index.es.js +4 -4
  148. package/dist/progress-bar/index.cjs.js +2 -2
  149. package/dist/progress-bar/index.es.js +2 -2
  150. package/dist/radio/index.cjs.js +2 -2
  151. package/dist/radio/index.es.js +2 -2
  152. package/dist/radio-group/index.cjs.js +1 -1
  153. package/dist/radio-group/index.es.js +2 -2
  154. package/dist/scroll-shadow/index.cjs.js +394 -0
  155. package/dist/scroll-shadow/index.cjs.js.map +1 -0
  156. package/dist/scroll-shadow/index.es.js +394 -0
  157. package/dist/scroll-shadow/index.es.js.map +1 -0
  158. package/dist/scroll-shadow.d.ts +2 -0
  159. package/dist/slider/index.cjs.js +11 -10
  160. package/dist/slider/index.cjs.js.map +1 -1
  161. package/dist/slider/index.es.js +10 -9
  162. package/dist/slider/index.es.js.map +1 -1
  163. package/dist/tabs/index.cjs.js +1400 -0
  164. package/dist/tabs/index.cjs.js.map +1 -0
  165. package/dist/tabs/index.es.js +1400 -0
  166. package/dist/tabs/index.es.js.map +1 -0
  167. package/dist/tabs.d.ts +2 -0
  168. package/dist/toggle-switch/index.cjs.js +11 -9
  169. package/dist/toggle-switch/index.cjs.js.map +1 -1
  170. package/dist/toggle-switch/index.es.js +9 -7
  171. package/dist/toggle-switch/index.es.js.map +1 -1
  172. package/dist/toolbar/index.cjs.js +4 -4
  173. package/dist/toolbar/index.es.js +4 -4
  174. package/package.json +12 -1
  175. package/dist/chunks/Button-DK8vIKEw.js.map +0 -1
  176. package/dist/chunks/Button-daStTTzk.js.map +0 -1
  177. package/dist/chunks/SharedElementTransition-BxczX23g.js +0 -12
  178. package/dist/chunks/SharedElementTransition-D87oSBzB.js +0 -13
  179. package/dist/chunks/VisuallyHidden-BbvdASBh.js +0 -85
  180. package/dist/chunks/VisuallyHidden-BbvdASBh.js.map +0 -1
  181. package/dist/chunks/VisuallyHidden-C-WtISJo.js +0 -86
  182. package/dist/chunks/VisuallyHidden-C-WtISJo.js.map +0 -1
  183. package/dist/chunks/useLabel-ClsFWJD0.js.map +0 -1
  184. package/dist/chunks/useLabel-todYehRc.js.map +0 -1
  185. package/dist/chunks/utils-GD-7Nve2.js.map +0 -1
  186. package/dist/chunks/utils-Ki_DdjNi.js.map +0 -1
@@ -1,228 +1,25 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { c } from "react/compiler-runtime";
3
3
  import { t as tableVariants } from "../chunks/data-table-CtvkKzD_.js";
4
- import React__default, { useEffect, useMemo, createContext, cloneElement, forwardRef, useContext, useCallback, useState, useRef, isValidElement, version } from "react";
5
- import { h as $c7eafbbe1ea5834e$export$535bd6ca7f90a273, f as $c4867b2f328c2698$export$e5c5a5f917a5871c, g as $390e54f620492c70$export$f680877a34711e37, d as $bbaa08b3cd72f041$export$9d1611c77c2fe928, i as $a4e76a5424781910$export$e08e3b67e392101e, j as $03e8ab2d84d7657a$export$4338b53315abf666, b as $7230ffa83bc0c2cf$export$4d86445c2cf5e3, m as $7230ffa83bc0c2cf$export$2881499e37b75b9a, c as $7230ffa83bc0c2cf$export$df3a06d6289f983e, p as $7230ffa83bc0c2cf$export$c62b8e45d58ddad9, $ as $7230ffa83bc0c2cf$export$29f1550f4b0d4415, k as $4064df0d6f9620e1$export$c9058316764c140e, e as $7230ffa83bc0c2cf$export$c245e6201fed2f75 } from "../chunks/utils-Ki_DdjNi.js";
6
- import { a as $d7f64c32b702fe2c$export$8dc98ba7eadeaa56, b as $a46cf152bb926da5$export$a9b970dcc4ae71a9, c as $7705c033048f6da7$export$24d547caef80ccd1 } from "../chunks/Button-DK8vIKEw.js";
7
- import { $ as $792f28e438b9ad5f$export$758399f318e6385a } from "../chunks/SharedElementTransition-D87oSBzB.js";
8
- import { $ as $6f0c29017aeec335$export$d68d59712b04d9d1, a as $6f0c29017aeec335$export$408d25a4e12db025, b as $6f0c29017aeec335$export$8258a0665a675899, c as $6f0c29017aeec335$export$b1918e978f1ee46f } from "../chunks/BaseCollection-CdxYWaH6.js";
9
- import { a as $fe16bffc7a557bf0$export$7f54fc3180508a52, j as $d1116acdf220c2da$export$f9762fab77588ecb, i as $8296dad1a4c5e0dc$export$8f71654801c2f7cd, $ as $48a7d519b337145d$export$4eaf04e54aa8eed6, e as $d1116acdf220c2da$export$4c014de7c8940b4c, f as $0c4a58759813079a$export$4e328f61c538687f, g as $e969f22b6713ca4a$export$ae780daf29e6d456 } from "../chunks/useHover-B3gEex-2.js";
10
- import ReactDOM__default, { createPortal, flushSync } from "react-dom";
4
+ import React__default, { useMemo, createContext, useRef, useEffect, useCallback, forwardRef, useContext, useState } from "react";
5
+ import { g as $c4867b2f328c2698$export$e5c5a5f917a5871c, h as $390e54f620492c70$export$f680877a34711e37, d as $bbaa08b3cd72f041$export$9d1611c77c2fe928, j as $a4e76a5424781910$export$e08e3b67e392101e, f as $03e8ab2d84d7657a$export$4338b53315abf666, b as $7230ffa83bc0c2cf$export$4d86445c2cf5e3, l as $7230ffa83bc0c2cf$export$2881499e37b75b9a, c as $7230ffa83bc0c2cf$export$df3a06d6289f983e, o as $7230ffa83bc0c2cf$export$c62b8e45d58ddad9, $ as $7230ffa83bc0c2cf$export$29f1550f4b0d4415, e as $7230ffa83bc0c2cf$export$c245e6201fed2f75 } from "../chunks/utils-BCEhcDlv.js";
6
+ import { a as $a46cf152bb926da5$export$a9b970dcc4ae71a9, b as $7705c033048f6da7$export$24d547caef80ccd1 } from "../chunks/Button-CFYOfByw.js";
7
+ import { o as $901761b40e390936$export$2bb74740c4e19def, p as $22bbea12c2567021$export$c3d8340acf92597f, q as $121970af65029459$export$f8aeda7b10753fa1, r as $cd5ea4b915021f1d$export$fbdeaa6a76694f71, s as $cd5ea4b915021f1d$export$7475b2c64539e4cf, $ as $60f19cefd567a3e4$export$253fe78d46329472, t as $cd5ea4b915021f1d$export$1005530eda016c13, b as $4a07ac835f260f78$export$6c8a5aaad13c9852, a as $d03379b88399b8c5$export$6cd28814d92fa9c9, u as $cd5ea4b915021f1d$export$5f3398f8733f90e2, e as $d667c2af82d35a98$export$d6daf82dcd84e87c, d as $bf14c9739fda2eb3$export$eac1895992b9f3d6, c as $f6ba6936bfd098a0$export$ecf600387e221c37, v as $51a3e22a5186a962$export$c826860796309d1b, g as $42ceafc619f9c3ba$export$18af5c7a9e9b3664, k as $263ab7fc0f95ccdb$export$4feb769f8ddf26c5, l as $263ab7fc0f95ccdb$export$a164736487e3f0ae, j as $b24d1bc31a0f941d$export$a9d04c5684123369, w as $42ceafc619f9c3ba$export$e953bb1cd0f19726, h as $91fe5e721c7f36c1$export$c9549807523555e0, i as $42ceafc619f9c3ba$export$fb8073518f34e6ec, x as $a80bd3e9349588e7$export$727c8fc270210f13, f as $42ceafc619f9c3ba$export$bf788dd355e3a401 } from "../chunks/useHasTabbableChild-CSJ0P5QT.js";
8
+ import { $ as $792f28e438b9ad5f$export$758399f318e6385a } from "../chunks/SharedElementTransition-CJVe1D_I.js";
9
+ import { b as $6f0c29017aeec335$export$8258a0665a675899, $ as $6f0c29017aeec335$export$d68d59712b04d9d1, a as $6f0c29017aeec335$export$408d25a4e12db025, c as $6f0c29017aeec335$export$b1918e978f1ee46f } from "../chunks/BaseCollection-CdxYWaH6.js";
11
10
  import { $ as $8e9d2fae0ecb9001$export$457c3d6518dd4c6f } from "../chunks/filterDOMProps-DqJGvnmf.js";
12
- import { a as $535772f9d2c1f38d$export$2d6ec8fc375ceafa, b as $535772f9d2c1f38d$export$20e40289641fbbb6 } from "../chunks/FocusScope-BJBTKF3R.js";
13
- import { f as $d447af545b77c9f1$export$b204af158042fbac, g as $23f2114a1b82827e$export$cd4e5573fbe2b576, t as $2add3ce32c6007eb$export$9ac100e40613ea10, A as $d447af545b77c9f1$export$f531f92e2a15358f, w as $2add3ce32c6007eb$export$78551043582a6a98, h as $2add3ce32c6007eb$export$a11b0059900ceec8, a as $23f2114a1b82827e$export$e58f029f0fbfdb29, e as $3b8b240c1bf84ab9$export$4c063cf1350e6fed, v as $2add3ce32c6007eb$export$fedb369cb70207f1, B as $2add3ce32c6007eb$export$e1865c3bedcd822b, c as $23f2114a1b82827e$export$4282f70798064fe0, C as $caaf0dd3060ed57c$export$9a302a45f65d0572, j as $f192c2f16961cbe0$export$80f3e147d781571c, D as $23f2114a1b82827e$export$b4f377a2b6254582, d as $3b8b240c1bf84ab9$export$bebd5a1431fec25d, q as $1969ac565cfec8d0$export$de79e2c695e052f3, k as $8f5a2122b0992be3$export$630ff653c5ada6a9, $ as $d447af545b77c9f1$export$f21a1ffae260145a, s as $caaf0dd3060ed57c$export$95185d699e05d4d7, E as $8f5a2122b0992be3$export$98e20ec92f614cfe, y as $8f5a2122b0992be3$export$b9b3dfddab17db27, F as $caaf0dd3060ed57c$export$bdc77b0c0a3a85d6 } from "../chunks/focusSafely-kwqdsDlJ.js";
14
- import { $ as $3e6197669829fe11$export$40bfa8c7b0832715, b as $ea3928288112382f$export$a966af930f325cab } from "../chunks/VisuallyHidden-C-WtISJo.js";
15
- import { $ as $2eb8e6d23f3d0cb0$export$43bb16f9c6d9e3f7 } from "../chunks/I18nProvider-DSyuLrKX.js";
16
- import { a as $7096878c21af5e66$export$a929f3f93e2cc67e, $ as $d27d541f9569d26d$export$45712eceda6fad21 } from "../chunks/usePress-D_rPVnKY.js";
17
- import { b as $e8ac3c3f5d4bae7f$export$d6875122194c7b44 } from "../chunks/useLabel-todYehRc.js";
18
- import { $ as $1dfdc54e7eb53ba0$export$36da96379f79f245 } from "../chunks/useMove-C6JNYkjM.js";
11
+ import { a as $535772f9d2c1f38d$export$2d6ec8fc375ceafa, b as $535772f9d2c1f38d$export$20e40289641fbbb6 } from "../chunks/FocusScope-jSNMAXzg.js";
12
+ import { a as $fe16bffc7a557bf0$export$7f54fc3180508a52, e as $d1116acdf220c2da$export$4c014de7c8940b4c, i as $8296dad1a4c5e0dc$export$8f71654801c2f7cd, f as $0c4a58759813079a$export$4e328f61c538687f, g as $e969f22b6713ca4a$export$ae780daf29e6d456 } from "../chunks/useHover-BHCSbkLb.js";
13
+ import { $ as $4064df0d6f9620e1$export$c9058316764c140e } from "../chunks/mergeRefs-t6d4XvXq.js";
14
+ import ReactDOM__default from "react-dom";
15
+ import { $ as $3e6197669829fe11$export$40bfa8c7b0832715 } from "../chunks/useControlledState-DZA25XHU.js";
16
+ import { $ as $2eb8e6d23f3d0cb0$export$43bb16f9c6d9e3f7 } from "../chunks/I18nProvider-Coj9x7B8.js";
17
+ import { G as $8f5a2122b0992be3$export$98e20ec92f614cfe, c as $23f2114a1b82827e$export$4282f70798064fe0, a as $23f2114a1b82827e$export$e58f029f0fbfdb29, g as $23f2114a1b82827e$export$cd4e5573fbe2b576, f as $d447af545b77c9f1$export$b204af158042fbac, F as $23f2114a1b82827e$export$b4f377a2b6254582, j as $f192c2f16961cbe0$export$80f3e147d781571c, y as $8f5a2122b0992be3$export$b9b3dfddab17db27, h as $2add3ce32c6007eb$export$a11b0059900ceec8, H as $caaf0dd3060ed57c$export$bdc77b0c0a3a85d6 } from "../chunks/focusSafely-DfEgLKh6.js";
18
+ import { $ as $d27d541f9569d26d$export$45712eceda6fad21 } from "../chunks/usePress-Arf10jW0.js";
19
+ import { $ as $e8ac3c3f5d4bae7f$export$d6875122194c7b44 } from "../chunks/useLabels-Bl0mJafM.js";
20
+ import { $ as $1dfdc54e7eb53ba0$export$36da96379f79f245 } from "../chunks/useMove-Xpbmb6OD.js";
21
+ import { a as $ea3928288112382f$export$a966af930f325cab } from "../chunks/VisuallyHidden-DPJuOMsW.js";
19
22
  import { cx } from "tailwind-variants";
20
- const $8b2399d051d06d4c$export$447a38995de2c711 = "react-aria-clear-focus";
21
- const $8b2399d051d06d4c$export$831c820ad60f9d12 = "react-aria-focus";
22
- function $b72f3f7b3b5f42c6$export$76e4e37e5339496d(to) {
23
- let from = $b72f3f7b3b5f42c6$export$759df0d867455a91($d447af545b77c9f1$export$b204af158042fbac(to));
24
- if (from !== to) {
25
- if (from) $b72f3f7b3b5f42c6$export$6c5dc7e81d2cc29a(from, to);
26
- if (to) $b72f3f7b3b5f42c6$export$2b35b76d2e30e129(to, from);
27
- }
28
- }
29
- function $b72f3f7b3b5f42c6$export$6c5dc7e81d2cc29a(from, to) {
30
- from.dispatchEvent(new FocusEvent("blur", {
31
- relatedTarget: to
32
- }));
33
- from.dispatchEvent(new FocusEvent("focusout", {
34
- bubbles: true,
35
- relatedTarget: to
36
- }));
37
- }
38
- function $b72f3f7b3b5f42c6$export$2b35b76d2e30e129(to, from) {
39
- to.dispatchEvent(new FocusEvent("focus", {
40
- relatedTarget: from
41
- }));
42
- to.dispatchEvent(new FocusEvent("focusin", {
43
- bubbles: true,
44
- relatedTarget: from
45
- }));
46
- }
47
- function $b72f3f7b3b5f42c6$export$759df0d867455a91(document2) {
48
- let activeElement = $23f2114a1b82827e$export$cd4e5573fbe2b576(document2);
49
- let activeDescendant = activeElement?.getAttribute("aria-activedescendant");
50
- if (activeDescendant) return document2.getElementById(activeDescendant) || activeElement;
51
- return activeElement;
52
- }
53
- const $bb39c0fc1c19b34c$var$KEYBOARD_HEIGHT = 100;
54
- const $bb39c0fc1c19b34c$var$KEYBOARD_TIMEOUT = 600;
55
- const $bb39c0fc1c19b34c$var$state = {
56
- isOpen: false,
57
- screenWidth: 0,
58
- screenHeight: 0,
59
- screenAngle: 0,
60
- screenTimeout: 0,
61
- startTimeStamp: 0,
62
- endTimeStamp: 0,
63
- resizeTimeStamp: 0,
64
- resizeTimeout: 0
65
- };
66
- const $bb39c0fc1c19b34c$var$nonTextInputTypes = /* @__PURE__ */ new Set([
67
- "checkbox",
68
- "radio",
69
- "range",
70
- "color",
71
- "file",
72
- "image",
73
- "button",
74
- "submit",
75
- "reset"
76
- ]);
77
- if (process.env.NODE_ENV === "test" && typeof window !== "undefined" && !Reflect.has(window, "visualViewport")) {
78
- const visualViewport = Object.assign(new EventTarget(), {
79
- offsetTop: 0,
80
- offsetLeft: 0,
81
- pageTop: 0,
82
- pageLeft: 0,
83
- scale: 1
84
- });
85
- Reflect.defineProperty(visualViewport, "width", {
86
- get: () => window.innerWidth,
87
- configurable: true
88
- });
89
- Reflect.defineProperty(visualViewport, "height", {
90
- get: () => window.innerHeight,
91
- configurable: true
92
- });
93
- Reflect.defineProperty(window, "visualViewport", {
94
- value: visualViewport,
95
- configurable: true,
96
- writable: true
97
- });
98
- }
99
- if (process.env.NODE_ENV === "test" && typeof window !== "undefined" && !Reflect.has(window.screen, "orientation")) {
100
- const orientation = Object.assign(new EventTarget(), {
101
- type: "landscape-primary"
102
- });
103
- Reflect.defineProperty(window.screen, "orientation", {
104
- value: orientation,
105
- configurable: true,
106
- writable: true
107
- });
108
- Reflect.defineProperty(window.screen.orientation, "angle", {
109
- get: () => window.orientation ?? 0,
110
- configurable: true
111
- });
112
- }
113
- function $bb39c0fc1c19b34c$var$getTouchScreen() {
114
- let screenWidth = Number(window.visualViewport?.width ?? window.innerWidth);
115
- let screenHeight = Number(window.visualViewport?.height ?? window.innerHeight);
116
- let visualScale = Number(window.visualViewport?.scale ?? 1);
117
- return {
118
- width: screenWidth * visualScale,
119
- height: screenHeight * visualScale,
120
- angle: window.screen.orientation.angle
121
- };
122
- }
123
- function $bb39c0fc1c19b34c$var$onResizeStart(e) {
124
- if ($bb39c0fc1c19b34c$var$state.resizeTimeStamp <= e.timeStamp + 50) {
125
- $bb39c0fc1c19b34c$var$state.resizeTimeStamp = e.timeStamp + 150;
126
- window.clearTimeout($bb39c0fc1c19b34c$var$state.resizeTimeout);
127
- $bb39c0fc1c19b34c$var$state.resizeTimeout = window.setTimeout($bb39c0fc1c19b34c$var$onResizeEnd, 150);
128
- }
129
- }
130
- function $bb39c0fc1c19b34c$var$onResizeEnd() {
131
- let viewportMeta = $7096878c21af5e66$export$a929f3f93e2cc67e("viewport");
132
- if ($2add3ce32c6007eb$export$a11b0059900ceec8() && viewportMeta?.includes("overlays-content")) return;
133
- let time = performance.now();
134
- let screen = $bb39c0fc1c19b34c$var$getTouchScreen();
135
- let elapsed = time - $bb39c0fc1c19b34c$var$state.startTimeStamp;
136
- let delta = $bb39c0fc1c19b34c$var$state.screenHeight - screen.height;
137
- let rotation = $bb39c0fc1c19b34c$var$state.screenAngle - screen.angle;
138
- if (Math.abs(rotation) % 180 && $bb39c0fc1c19b34c$var$state.screenWidth - screen.height < $bb39c0fc1c19b34c$var$KEYBOARD_HEIGHT) {
139
- $bb39c0fc1c19b34c$var$state.screenWidth = screen.width;
140
- $bb39c0fc1c19b34c$var$state.screenHeight = screen.height;
141
- $bb39c0fc1c19b34c$var$state.screenAngle = screen.angle;
142
- delta = 0;
143
- }
144
- if (elapsed > $bb39c0fc1c19b34c$var$KEYBOARD_TIMEOUT) {
145
- window.clearTimeout($bb39c0fc1c19b34c$var$state.screenTimeout);
146
- $bb39c0fc1c19b34c$var$state.screenTimeout = window.setTimeout(() => {
147
- let activeElement = document.hasFocus() ? $23f2114a1b82827e$export$cd4e5573fbe2b576() : null;
148
- let willKeyboardOpen = $bb39c0fc1c19b34c$export$c57958e35f31ed73(activeElement);
149
- let screen2 = $bb39c0fc1c19b34c$var$getTouchScreen();
150
- if (Math.abs($bb39c0fc1c19b34c$var$state.screenAngle - screen2.angle) % 180) return;
151
- if ($bb39c0fc1c19b34c$var$state.isOpen && willKeyboardOpen) return;
152
- $bb39c0fc1c19b34c$var$state.screenWidth = screen2.width;
153
- $bb39c0fc1c19b34c$var$state.screenHeight = screen2.height;
154
- $bb39c0fc1c19b34c$var$state.screenAngle = screen2.angle;
155
- $bb39c0fc1c19b34c$var$state.isOpen = false;
156
- }, $bb39c0fc1c19b34c$var$KEYBOARD_TIMEOUT);
157
- }
158
- if (elapsed <= $bb39c0fc1c19b34c$var$KEYBOARD_TIMEOUT && delta >= $bb39c0fc1c19b34c$var$KEYBOARD_HEIGHT) $bb39c0fc1c19b34c$var$state.endTimeStamp = time;
159
- $bb39c0fc1c19b34c$var$state.isOpen = delta >= $bb39c0fc1c19b34c$var$KEYBOARD_HEIGHT;
160
- }
161
- function $bb39c0fc1c19b34c$var$onOrientationChange() {
162
- let screen = $bb39c0fc1c19b34c$var$getTouchScreen();
163
- let rotation = $bb39c0fc1c19b34c$var$state.screenAngle - screen.angle;
164
- if (Math.abs(rotation) % 180 && !$bb39c0fc1c19b34c$var$state.isOpen) {
165
- let width = $bb39c0fc1c19b34c$var$state.screenWidth;
166
- let height = $bb39c0fc1c19b34c$var$state.screenHeight;
167
- $bb39c0fc1c19b34c$var$state.screenWidth = height;
168
- $bb39c0fc1c19b34c$var$state.screenHeight = width;
169
- }
170
- if (!$bb39c0fc1c19b34c$var$state.isOpen) $bb39c0fc1c19b34c$var$state.screenAngle = screen.angle;
171
- }
172
- function $bb39c0fc1c19b34c$var$onFocus(e) {
173
- let target = $23f2114a1b82827e$export$e58f029f0fbfdb29(e);
174
- let willKeyboardOpen = $bb39c0fc1c19b34c$export$c57958e35f31ed73(target);
175
- let time = performance.now();
176
- let screen = $bb39c0fc1c19b34c$var$getTouchScreen();
177
- let delta = $bb39c0fc1c19b34c$var$state.screenHeight - screen.height;
178
- if (delta < $bb39c0fc1c19b34c$var$KEYBOARD_HEIGHT && willKeyboardOpen) {
179
- $bb39c0fc1c19b34c$var$state.screenWidth = screen.width;
180
- $bb39c0fc1c19b34c$var$state.screenHeight = screen.height;
181
- $bb39c0fc1c19b34c$var$state.screenAngle = screen.angle;
182
- $bb39c0fc1c19b34c$var$state.startTimeStamp = time;
183
- }
184
- if (willKeyboardOpen) window.clearTimeout($bb39c0fc1c19b34c$var$state.screenTimeout);
185
- if (delta >= $bb39c0fc1c19b34c$var$KEYBOARD_HEIGHT && willKeyboardOpen) $bb39c0fc1c19b34c$var$state.endTimeStamp = time;
186
- }
187
- function $bb39c0fc1c19b34c$var$setupGlobalEvents() {
188
- let screen = $bb39c0fc1c19b34c$var$getTouchScreen();
189
- $d447af545b77c9f1$export$f531f92e2a15358f(window.visualViewport, "resize", $2add3ce32c6007eb$export$78551043582a6a98() ? $bb39c0fc1c19b34c$var$onResizeEnd : $bb39c0fc1c19b34c$var$onResizeStart);
190
- $d447af545b77c9f1$export$f531f92e2a15358f(window.screen.orientation, "change", $bb39c0fc1c19b34c$var$onOrientationChange);
191
- $d447af545b77c9f1$export$f531f92e2a15358f(window, "focus", $bb39c0fc1c19b34c$var$onFocus, {
192
- capture: true,
193
- passive: true
194
- });
195
- $bb39c0fc1c19b34c$var$state.screenWidth = screen.width;
196
- $bb39c0fc1c19b34c$var$state.screenHeight = screen.height;
197
- $bb39c0fc1c19b34c$var$state.screenAngle = screen.angle;
198
- }
199
- if (typeof document !== "undefined") {
200
- if (document.readyState !== "loading") $bb39c0fc1c19b34c$var$setupGlobalEvents();
201
- else $d447af545b77c9f1$export$f531f92e2a15358f(document, "DOMContentLoaded", $bb39c0fc1c19b34c$var$setupGlobalEvents);
202
- }
203
- function $bb39c0fc1c19b34c$export$c57958e35f31ed73(target) {
204
- if (!(target instanceof Element) || !$3b8b240c1bf84ab9$export$4c063cf1350e6fed(target)) return false;
205
- let isTextArea = target instanceof HTMLTextAreaElement;
206
- let isEditable = target instanceof HTMLElement && target.isContentEditable;
207
- let isTextInput = target instanceof HTMLInputElement && !$bb39c0fc1c19b34c$var$nonTextInputTypes.has(target.type);
208
- return isTextArea || isEditable || isTextInput;
209
- }
210
- function $bb39c0fc1c19b34c$export$16792effe837dba3(event) {
211
- return $2add3ce32c6007eb$export$9ac100e40613ea10() ? event.metaKey : event.ctrlKey;
212
- }
213
- function $600b3cf69ae46262$export$90fc3a17d93f704c(ref, event, listener, options) {
214
- let handleEvent = $fe16bffc7a557bf0$export$7f54fc3180508a52(listener);
215
- let isDisabled = listener == null;
216
- useEffect(() => {
217
- if (isDisabled || ref.current == null) return;
218
- return $d447af545b77c9f1$export$f531f92e2a15358f(ref.current, event, handleEvent, options);
219
- }, [
220
- ref,
221
- event,
222
- options,
223
- isDisabled
224
- ]);
225
- }
226
23
  const $a747a10fe70a57da$var$localeSymbol = /* @__PURE__ */ Symbol.for("react-aria.i18n.locale");
227
24
  const $a747a10fe70a57da$var$stringsSymbol = /* @__PURE__ */ Symbol.for("react-aria.i18n.strings");
228
25
  let $a747a10fe70a57da$var$cachedGlobalStrings = void 0;
@@ -346,733 +143,6 @@ function $cf2482eff2eeeec2$export$f12b703ca79dfbb1(strings, packageName) {
346
143
  }
347
144
  const $4b38b5b75ecc6208$export$b0d3ecf7112093a7 = /* @__PURE__ */ createContext(null);
348
145
  const $4b38b5b75ecc6208$export$698f465ec27e93df = /* @__PURE__ */ createContext(null);
349
- class $96ead35620b8fd36$export$410b0c854570d131 {
350
- constructor(ownerDocument) {
351
- this._firstChild = null;
352
- this._lastChild = null;
353
- this._previousSibling = null;
354
- this._nextSibling = null;
355
- this._parentNode = null;
356
- this._minInvalidChildIndex = null;
357
- this.ownerDocument = ownerDocument;
358
- }
359
- *[Symbol.iterator]() {
360
- let node = this.firstChild;
361
- while (node) {
362
- yield node;
363
- node = node.nextSibling;
364
- }
365
- }
366
- get firstChild() {
367
- return this._firstChild;
368
- }
369
- set firstChild(firstChild) {
370
- this._firstChild = firstChild;
371
- this.ownerDocument.markDirty(this);
372
- }
373
- get lastChild() {
374
- return this._lastChild;
375
- }
376
- set lastChild(lastChild) {
377
- this._lastChild = lastChild;
378
- this.ownerDocument.markDirty(this);
379
- }
380
- get previousSibling() {
381
- return this._previousSibling;
382
- }
383
- set previousSibling(previousSibling) {
384
- this._previousSibling = previousSibling;
385
- this.ownerDocument.markDirty(this);
386
- }
387
- get nextSibling() {
388
- return this._nextSibling;
389
- }
390
- set nextSibling(nextSibling) {
391
- this._nextSibling = nextSibling;
392
- this.ownerDocument.markDirty(this);
393
- }
394
- get parentNode() {
395
- return this._parentNode;
396
- }
397
- set parentNode(parentNode) {
398
- this._parentNode = parentNode;
399
- this.ownerDocument.markDirty(this);
400
- }
401
- get isConnected() {
402
- return this.parentNode?.isConnected || false;
403
- }
404
- invalidateChildIndices(child) {
405
- if (this._minInvalidChildIndex == null || !this._minInvalidChildIndex.isConnected || child.index < this._minInvalidChildIndex.index) {
406
- this._minInvalidChildIndex = child;
407
- this.ownerDocument.markDirty(this);
408
- }
409
- }
410
- updateChildIndices() {
411
- let node = this._minInvalidChildIndex;
412
- while (node) {
413
- node.index = node.previousSibling ? node.previousSibling.index + 1 : 0;
414
- node = node.nextSibling;
415
- }
416
- this._minInvalidChildIndex = null;
417
- }
418
- appendChild(child) {
419
- if (child.parentNode) child.parentNode.removeChild(child);
420
- if (this.firstChild == null) this.firstChild = child;
421
- if (this.lastChild) {
422
- this.lastChild.nextSibling = child;
423
- child.index = this.lastChild.index + 1;
424
- child.previousSibling = this.lastChild;
425
- } else {
426
- child.previousSibling = null;
427
- child.index = 0;
428
- }
429
- child.parentNode = this;
430
- child.nextSibling = null;
431
- this.lastChild = child;
432
- this.ownerDocument.markDirty(this);
433
- if (this.isConnected) this.ownerDocument.queueUpdate();
434
- }
435
- insertBefore(newNode, referenceNode) {
436
- if (referenceNode == null) return this.appendChild(newNode);
437
- if (newNode.parentNode) newNode.parentNode.removeChild(newNode);
438
- newNode.nextSibling = referenceNode;
439
- newNode.previousSibling = referenceNode.previousSibling;
440
- newNode.index = referenceNode.index - 1;
441
- if (this.firstChild === referenceNode) this.firstChild = newNode;
442
- else if (referenceNode.previousSibling) referenceNode.previousSibling.nextSibling = newNode;
443
- referenceNode.previousSibling = newNode;
444
- newNode.parentNode = referenceNode.parentNode;
445
- this.invalidateChildIndices(newNode);
446
- if (this.isConnected) this.ownerDocument.queueUpdate();
447
- }
448
- removeChild(child) {
449
- if (child.parentNode !== this) return;
450
- if (this._minInvalidChildIndex === child) this._minInvalidChildIndex = null;
451
- if (child.nextSibling) {
452
- this.invalidateChildIndices(child.nextSibling);
453
- child.nextSibling.previousSibling = child.previousSibling;
454
- }
455
- if (child.previousSibling) child.previousSibling.nextSibling = child.nextSibling;
456
- if (this.firstChild === child) this.firstChild = child.nextSibling;
457
- if (this.lastChild === child) this.lastChild = child.previousSibling;
458
- child.parentNode = null;
459
- child.nextSibling = null;
460
- child.previousSibling = null;
461
- child.index = 0;
462
- this.ownerDocument.markDirty(child);
463
- if (this.isConnected) this.ownerDocument.queueUpdate();
464
- }
465
- addEventListener() {
466
- }
467
- removeEventListener() {
468
- }
469
- get previousVisibleSibling() {
470
- let node = this.previousSibling;
471
- while (node && node.isHidden) node = node.previousSibling;
472
- return node;
473
- }
474
- get nextVisibleSibling() {
475
- let node = this.nextSibling;
476
- while (node && node.isHidden) node = node.nextSibling;
477
- return node;
478
- }
479
- get firstVisibleChild() {
480
- let node = this.firstChild;
481
- while (node && node.isHidden) node = node.nextSibling;
482
- return node;
483
- }
484
- get lastVisibleChild() {
485
- let node = this.lastChild;
486
- while (node && node.isHidden) node = node.previousSibling;
487
- return node;
488
- }
489
- }
490
- class $96ead35620b8fd36$export$dc064fe9e59310fd extends $96ead35620b8fd36$export$410b0c854570d131 {
491
- constructor(type, ownerDocument) {
492
- super(ownerDocument), this.nodeType = 8, this.isMutated = true, this._index = 0, this.isHidden = false;
493
- this.node = null;
494
- }
495
- get index() {
496
- return this._index;
497
- }
498
- set index(index) {
499
- this._index = index;
500
- this.ownerDocument.markDirty(this);
501
- }
502
- get level() {
503
- if (this.parentNode instanceof $96ead35620b8fd36$export$dc064fe9e59310fd) return this.parentNode.level + (this.parentNode.node?.type === "item" ? 1 : 0);
504
- return 0;
505
- }
506
- /**
507
- * Lazily gets a mutable instance of a Node. If the node has already
508
- * been cloned during this update cycle, it just returns the existing one.
509
- */
510
- getMutableNode() {
511
- if (this.node == null) return null;
512
- if (!this.isMutated) {
513
- this.node = this.node.clone();
514
- this.isMutated = true;
515
- }
516
- this.ownerDocument.markDirty(this);
517
- return this.node;
518
- }
519
- updateNode() {
520
- let nextSibling = this.nextVisibleSibling;
521
- let node = this.getMutableNode();
522
- if (node == null) return;
523
- node.index = this.index;
524
- node.level = this.level;
525
- node.parentKey = this.parentNode instanceof $96ead35620b8fd36$export$dc064fe9e59310fd ? this.parentNode.node?.key ?? null : null;
526
- node.prevKey = this.previousVisibleSibling?.node?.key ?? null;
527
- node.nextKey = nextSibling?.node?.key ?? null;
528
- node.hasChildNodes = !!this.firstChild;
529
- node.firstChildKey = this.firstVisibleChild?.node?.key ?? null;
530
- node.lastChildKey = this.lastVisibleChild?.node?.key ?? null;
531
- if ((node.colSpan != null || node.colIndex != null) && nextSibling) {
532
- let nextColIndex = (node.colIndex ?? node.index) + (node.colSpan ?? 1);
533
- if (nextSibling.node != null && nextColIndex !== nextSibling.node.colIndex) {
534
- let siblingNode = nextSibling.getMutableNode();
535
- siblingNode.colIndex = nextColIndex;
536
- }
537
- }
538
- }
539
- setProps(obj, ref, CollectionNodeClass, rendered, render) {
540
- let node;
541
- let { value: value1, textValue, id, ...props } = obj;
542
- if (this.node == null) {
543
- node = new CollectionNodeClass(id ?? `react-aria-${++this.ownerDocument.nodeId}`);
544
- this.node = node;
545
- } else node = this.getMutableNode();
546
- props.ref = ref;
547
- node.props = props;
548
- node.rendered = rendered;
549
- node.render = render;
550
- node.value = value1;
551
- if (obj["aria-label"]) node["aria-label"] = obj["aria-label"];
552
- node.textValue = textValue || (typeof props.children === "string" ? props.children : "") || obj["aria-label"] || "";
553
- if (id != null && id !== node.key) throw new Error("Cannot change the id of an item");
554
- if (props.colSpan != null) node.colSpan = props.colSpan;
555
- if (this.isConnected) this.ownerDocument.queueUpdate();
556
- }
557
- get style() {
558
- let element = this;
559
- return {
560
- get display() {
561
- return element.isHidden ? "none" : "";
562
- },
563
- set display(value) {
564
- let isHidden = value === "none";
565
- if (element.isHidden !== isHidden) {
566
- if (element.parentNode?.firstVisibleChild === element || element.parentNode?.lastVisibleChild === element) element.ownerDocument.markDirty(element.parentNode);
567
- let prev = element.previousVisibleSibling;
568
- let next = element.nextVisibleSibling;
569
- if (prev) element.ownerDocument.markDirty(prev);
570
- if (next) element.ownerDocument.markDirty(next);
571
- element.isHidden = isHidden;
572
- element.ownerDocument.markDirty(element);
573
- }
574
- }
575
- };
576
- }
577
- hasAttribute() {
578
- }
579
- setAttribute() {
580
- }
581
- setAttributeNS() {
582
- }
583
- removeAttribute() {
584
- }
585
- }
586
- class $96ead35620b8fd36$export$b34a105447964f9f extends $96ead35620b8fd36$export$410b0c854570d131 {
587
- constructor(collection) {
588
- super(null), this.nodeType = 11, this.ownerDocument = this, this.dirtyNodes = /* @__PURE__ */ new Set(), this.isSSR = false, this.nodeId = 0, this.nodesByProps = /* @__PURE__ */ new WeakMap(), this.keyOwners = /* @__PURE__ */ new Map(), this.nextCollection = null, this.subscriptions = /* @__PURE__ */ new Set(), this.queuedRender = false, this.inSubscription = false;
589
- this.collection = collection;
590
- this.nextCollection = collection;
591
- }
592
- get isConnected() {
593
- return true;
594
- }
595
- createElement(type) {
596
- return new $96ead35620b8fd36$export$dc064fe9e59310fd(type, this);
597
- }
598
- getMutableCollection() {
599
- if (!this.nextCollection) this.nextCollection = this.collection.clone();
600
- return this.nextCollection;
601
- }
602
- markDirty(node) {
603
- this.dirtyNodes.add(node);
604
- }
605
- addNode(element) {
606
- if (element.isHidden || element.node == null) return;
607
- if (process.env.NODE_ENV !== "production") {
608
- let key = element.node.key;
609
- let owner = this.keyOwners.get(key);
610
- if (owner && owner !== element) throw new Error(`Duplicate key "${String(key)}" found in collection. Every item in a collection must have a unique key.`);
611
- this.keyOwners.set(key, element);
612
- }
613
- let collection = this.getMutableCollection();
614
- if (!collection.getItem(element.node.key)) for (let child of element) this.addNode(child);
615
- collection.addNode(element.node);
616
- }
617
- removeNode(node) {
618
- for (let child of node) this.removeNode(child);
619
- if (node.node) {
620
- let collection = this.getMutableCollection();
621
- collection.removeNode(node.node.key);
622
- if (process.env.NODE_ENV !== "production" && this.keyOwners.get(node.node.key) === node) this.keyOwners.delete(node.node.key);
623
- }
624
- }
625
- /** Finalizes the collection update, updating all nodes and freezing the collection. */
626
- getCollection() {
627
- if (this.inSubscription) return this.collection;
628
- this.queuedRender = false;
629
- this.updateCollection();
630
- return this.collection;
631
- }
632
- updateCollection() {
633
- for (let element of this.dirtyNodes) if (element instanceof $96ead35620b8fd36$export$dc064fe9e59310fd && (!element.isConnected || element.isHidden)) this.removeNode(element);
634
- else element.updateChildIndices();
635
- for (let element of this.dirtyNodes) if (element instanceof $96ead35620b8fd36$export$dc064fe9e59310fd) {
636
- if (element.isConnected && !element.isHidden) {
637
- element.updateNode();
638
- this.addNode(element);
639
- }
640
- if (element.node) this.dirtyNodes.delete(element);
641
- element.isMutated = false;
642
- } else this.dirtyNodes.delete(element);
643
- if (this.nextCollection) {
644
- this.nextCollection.commit(this.firstVisibleChild?.node?.key ?? null, this.lastVisibleChild?.node?.key ?? null, this.isSSR);
645
- if (!this.isSSR) {
646
- this.collection = this.nextCollection;
647
- this.nextCollection = null;
648
- }
649
- }
650
- }
651
- queueUpdate() {
652
- if (this.dirtyNodes.size === 0 || this.queuedRender) return;
653
- this.queuedRender = true;
654
- this.inSubscription = true;
655
- if (!this.isSSR) this.collection = this.collection.clone();
656
- for (let fn of this.subscriptions) fn();
657
- this.inSubscription = false;
658
- }
659
- subscribe(fn) {
660
- this.subscriptions.add(fn);
661
- if (this.queuedRender) fn();
662
- return () => this.subscriptions.delete(fn);
663
- }
664
- resetAfterSSR() {
665
- if (this.isSSR) {
666
- this.isSSR = false;
667
- this.firstChild = null;
668
- this.lastChild = null;
669
- this.nodeId = 0;
670
- this.keyOwners.clear();
671
- }
672
- }
673
- }
674
- function $a80bd3e9349588e7$export$727c8fc270210f13(props) {
675
- let { children, items, idScope, addIdAndValue, dependencies = [] } = props;
676
- let childrenString = useMemo(() => process.env.NODE_ENV !== "production" && typeof children === "function" ? children.toString() : void 0, [
677
- children
678
- ]);
679
- let cache = useMemo(() => /* @__PURE__ */ new WeakMap(), [
680
- ...dependencies,
681
- childrenString
682
- ]);
683
- return useMemo(() => {
684
- if (items && typeof children === "function") {
685
- let res = [];
686
- for (let item of items) {
687
- let cacheKey = $a80bd3e9349588e7$var$isWeakKey(item) ? item : null;
688
- let rendered = cacheKey ? cache.get(cacheKey) : null;
689
- if (!rendered) {
690
- rendered = children(item);
691
- let id = rendered.props.id ?? item?.key ?? item?.id;
692
- if (idScope != null && rendered.props.id == null && id != null) id = idScope + ":" + id;
693
- let key = id ?? res.length;
694
- rendered = cloneElement(rendered, addIdAndValue ? {
695
- key,
696
- id,
697
- value: item
698
- } : {
699
- key
700
- });
701
- if (cacheKey) cache.set(cacheKey, rendered);
702
- }
703
- res.push(rendered);
704
- }
705
- return res;
706
- } else if (typeof children !== "function") return children;
707
- }, [
708
- children,
709
- items,
710
- cache,
711
- idScope,
712
- addIdAndValue
713
- ]);
714
- }
715
- function $a80bd3e9349588e7$var$isWeakKey(value) {
716
- switch (typeof value) {
717
- case "object":
718
- return value != null;
719
- case "function":
720
- case "symbol":
721
- return true;
722
- default:
723
- return false;
724
- }
725
- }
726
- var shim = { exports: {} };
727
- var useSyncExternalStoreShim_production = {};
728
- var hasRequiredUseSyncExternalStoreShim_production;
729
- function requireUseSyncExternalStoreShim_production() {
730
- if (hasRequiredUseSyncExternalStoreShim_production) return useSyncExternalStoreShim_production;
731
- hasRequiredUseSyncExternalStoreShim_production = 1;
732
- var React = React__default;
733
- function is(x, y) {
734
- return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
735
- }
736
- var objectIs = "function" === typeof Object.is ? Object.is : is, useState2 = React.useState, useEffect2 = React.useEffect, useLayoutEffect = React.useLayoutEffect, useDebugValue = React.useDebugValue;
737
- function useSyncExternalStore$2(subscribe, getSnapshot) {
738
- var value = getSnapshot(), _useState = useState2({ inst: { value, getSnapshot } }), inst = _useState[0].inst, forceUpdate = _useState[1];
739
- useLayoutEffect(
740
- function() {
741
- inst.value = value;
742
- inst.getSnapshot = getSnapshot;
743
- checkIfSnapshotChanged(inst) && forceUpdate({ inst });
744
- },
745
- [subscribe, value, getSnapshot]
746
- );
747
- useEffect2(
748
- function() {
749
- checkIfSnapshotChanged(inst) && forceUpdate({ inst });
750
- return subscribe(function() {
751
- checkIfSnapshotChanged(inst) && forceUpdate({ inst });
752
- });
753
- },
754
- [subscribe]
755
- );
756
- useDebugValue(value);
757
- return value;
758
- }
759
- function checkIfSnapshotChanged(inst) {
760
- var latestGetSnapshot = inst.getSnapshot;
761
- inst = inst.value;
762
- try {
763
- var nextValue = latestGetSnapshot();
764
- return !objectIs(inst, nextValue);
765
- } catch (error) {
766
- return true;
767
- }
768
- }
769
- function useSyncExternalStore$1(subscribe, getSnapshot) {
770
- return getSnapshot();
771
- }
772
- var shim2 = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
773
- useSyncExternalStoreShim_production.useSyncExternalStore = void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim2;
774
- return useSyncExternalStoreShim_production;
775
- }
776
- var useSyncExternalStoreShim_development = {};
777
- var hasRequiredUseSyncExternalStoreShim_development;
778
- function requireUseSyncExternalStoreShim_development() {
779
- if (hasRequiredUseSyncExternalStoreShim_development) return useSyncExternalStoreShim_development;
780
- hasRequiredUseSyncExternalStoreShim_development = 1;
781
- "production" !== process.env.NODE_ENV && (function() {
782
- function is(x, y) {
783
- return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
784
- }
785
- function useSyncExternalStore$2(subscribe, getSnapshot) {
786
- didWarnOld18Alpha || void 0 === React.startTransition || (didWarnOld18Alpha = true, void 0);
787
- var value = getSnapshot();
788
- if (!didWarnUncachedGetSnapshot) {
789
- var cachedValue = getSnapshot();
790
- objectIs(value, cachedValue) || (void 0, didWarnUncachedGetSnapshot = true);
791
- }
792
- cachedValue = useState2({
793
- inst: { value, getSnapshot }
794
- });
795
- var inst = cachedValue[0].inst, forceUpdate = cachedValue[1];
796
- useLayoutEffect(
797
- function() {
798
- inst.value = value;
799
- inst.getSnapshot = getSnapshot;
800
- checkIfSnapshotChanged(inst) && forceUpdate({ inst });
801
- },
802
- [subscribe, value, getSnapshot]
803
- );
804
- useEffect2(
805
- function() {
806
- checkIfSnapshotChanged(inst) && forceUpdate({ inst });
807
- return subscribe(function() {
808
- checkIfSnapshotChanged(inst) && forceUpdate({ inst });
809
- });
810
- },
811
- [subscribe]
812
- );
813
- useDebugValue(value);
814
- return value;
815
- }
816
- function checkIfSnapshotChanged(inst) {
817
- var latestGetSnapshot = inst.getSnapshot;
818
- inst = inst.value;
819
- try {
820
- var nextValue = latestGetSnapshot();
821
- return !objectIs(inst, nextValue);
822
- } catch (error) {
823
- return true;
824
- }
825
- }
826
- function useSyncExternalStore$1(subscribe, getSnapshot) {
827
- return getSnapshot();
828
- }
829
- "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
830
- var React = React__default, objectIs = "function" === typeof Object.is ? Object.is : is, useState2 = React.useState, useEffect2 = React.useEffect, useLayoutEffect = React.useLayoutEffect, useDebugValue = React.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim2 = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
831
- useSyncExternalStoreShim_development.useSyncExternalStore = void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim2;
832
- "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
833
- })();
834
- return useSyncExternalStoreShim_development;
835
- }
836
- var hasRequiredShim;
837
- function requireShim() {
838
- if (hasRequiredShim) return shim.exports;
839
- hasRequiredShim = 1;
840
- if (process.env.NODE_ENV === "production") {
841
- shim.exports = requireUseSyncExternalStoreShim_production();
842
- } else {
843
- shim.exports = requireUseSyncExternalStoreShim_development();
844
- }
845
- return shim.exports;
846
- }
847
- var shimExports = requireShim();
848
- const $42ceafc619f9c3ba$var$ShallowRenderContext = /* @__PURE__ */ createContext(false);
849
- const $42ceafc619f9c3ba$var$CollectionDocumentContext = /* @__PURE__ */ createContext(null);
850
- function $42ceafc619f9c3ba$export$bf788dd355e3a401(props) {
851
- let doc = useContext($42ceafc619f9c3ba$var$CollectionDocumentContext);
852
- if (doc)
853
- return props.content;
854
- let { collection, document: document2 } = $42ceafc619f9c3ba$var$useCollectionDocument(props.createCollection);
855
- return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement($d7f64c32b702fe2c$export$8dc98ba7eadeaa56, null, /* @__PURE__ */ React__default.createElement($42ceafc619f9c3ba$var$CollectionDocumentContext.Provider, {
856
- value: document2
857
- }, props.content)), /* @__PURE__ */ React__default.createElement($42ceafc619f9c3ba$var$CollectionInner, {
858
- render: props.children,
859
- collection
860
- }));
861
- }
862
- function $42ceafc619f9c3ba$var$CollectionInner({ collection, render }) {
863
- return render(collection);
864
- }
865
- function $42ceafc619f9c3ba$var$useSyncExternalStoreFallback(subscribe, getSnapshot, getServerSnapshot) {
866
- let isSSR = $c7eafbbe1ea5834e$export$535bd6ca7f90a273();
867
- let isSSRRef = useRef(isSSR);
868
- isSSRRef.current = isSSR;
869
- let getSnapshotWrapper = useCallback(() => {
870
- return isSSRRef.current ? getServerSnapshot() : getSnapshot();
871
- }, [
872
- getSnapshot,
873
- getServerSnapshot
874
- ]);
875
- return shimExports.useSyncExternalStore(subscribe, getSnapshotWrapper);
876
- }
877
- const $42ceafc619f9c3ba$var$useSyncExternalStore = typeof React__default["useSyncExternalStore"] === "function" ? React__default["useSyncExternalStore"] : $42ceafc619f9c3ba$var$useSyncExternalStoreFallback;
878
- function $42ceafc619f9c3ba$var$useCollectionDocument(createCollection) {
879
- let [document2] = useState(() => new $96ead35620b8fd36$export$b34a105447964f9f(createCollection?.() || new $6f0c29017aeec335$export$408d25a4e12db025()));
880
- let subscribe = useCallback((fn) => document2.subscribe(fn), [
881
- document2
882
- ]);
883
- let getSnapshot = useCallback(() => {
884
- let collection2 = document2.getCollection();
885
- if (document2.isSSR)
886
- document2.resetAfterSSR();
887
- return collection2;
888
- }, [
889
- document2
890
- ]);
891
- let getServerSnapshot = useCallback(() => {
892
- document2.isSSR = true;
893
- return document2.getCollection();
894
- }, [
895
- document2
896
- ]);
897
- let collection = $42ceafc619f9c3ba$var$useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
898
- return {
899
- collection,
900
- document: document2
901
- };
902
- }
903
- const $42ceafc619f9c3ba$var$SSRContext = /* @__PURE__ */ createContext(null);
904
- function $42ceafc619f9c3ba$var$createCollectionNodeClass(type) {
905
- var _a;
906
- let NodeClass = (_a = class extends $6f0c29017aeec335$export$d68d59712b04d9d1 {
907
- }, _a.type = type, _a);
908
- return NodeClass;
909
- }
910
- function $42ceafc619f9c3ba$var$useSSRCollectionNode(CollectionNodeClass, props, ref, rendered, children, render) {
911
- if (typeof CollectionNodeClass === "string")
912
- CollectionNodeClass = $42ceafc619f9c3ba$var$createCollectionNodeClass(CollectionNodeClass);
913
- let itemRef = useCallback((element) => {
914
- element?.setProps(props, ref, CollectionNodeClass, rendered, render);
915
- }, [
916
- props,
917
- ref,
918
- rendered,
919
- render,
920
- CollectionNodeClass
921
- ]);
922
- let parentNode = useContext($42ceafc619f9c3ba$var$SSRContext);
923
- if (parentNode) {
924
- let element = parentNode.ownerDocument.nodesByProps.get(props);
925
- if (!element) {
926
- element = parentNode.ownerDocument.createElement(CollectionNodeClass.type);
927
- element.setProps(props, ref, CollectionNodeClass, rendered, render);
928
- parentNode.appendChild(element);
929
- parentNode.ownerDocument.updateCollection();
930
- parentNode.ownerDocument.nodesByProps.set(props, element);
931
- }
932
- return children ? /* @__PURE__ */ React__default.createElement($42ceafc619f9c3ba$var$SSRContext.Provider, {
933
- value: element
934
- }, children) : null;
935
- }
936
- return /* @__PURE__ */ React__default.createElement(CollectionNodeClass.type, {
937
- ref: itemRef
938
- }, children);
939
- }
940
- function $42ceafc619f9c3ba$export$18af5c7a9e9b3664(CollectionNodeClass, render) {
941
- let Component = ({ node }) => render(node.props, node.props.ref, node);
942
- let Result = forwardRef((props, ref) => {
943
- let focusableProps = useContext($d1116acdf220c2da$export$f9762fab77588ecb);
944
- let isShallow = useContext($42ceafc619f9c3ba$var$ShallowRenderContext);
945
- if (!isShallow) {
946
- if (render.length >= 3) throw new Error(render.name + " cannot be rendered outside a collection.");
947
- return render(props, ref);
948
- }
949
- return $42ceafc619f9c3ba$var$useSSRCollectionNode(CollectionNodeClass, props, ref, "children" in props ? props.children : null, null, (node) => (
950
- // Forward FocusableContext to real DOM tree so tooltips work.
951
- /* @__PURE__ */ React__default.createElement($d1116acdf220c2da$export$f9762fab77588ecb.Provider, {
952
- value: focusableProps
953
- }, /* @__PURE__ */ React__default.createElement(Component, {
954
- node
955
- }))
956
- ));
957
- });
958
- Result.displayName = render.name;
959
- return Result;
960
- }
961
- function $42ceafc619f9c3ba$export$e953bb1cd0f19726(CollectionNodeClass, render, useChildren = $42ceafc619f9c3ba$var$useCollectionChildren) {
962
- let Component = ({ node }) => render(node.props, node.props.ref, node);
963
- let Result = forwardRef((props, ref) => {
964
- let children = useChildren(props);
965
- return $42ceafc619f9c3ba$var$useSSRCollectionNode(CollectionNodeClass, props, ref, null, children, (node) => /* @__PURE__ */ React__default.createElement(Component, {
966
- node
967
- })) ?? /* @__PURE__ */ React__default.createElement(React__default.Fragment, null);
968
- });
969
- Result.displayName = render.name;
970
- return Result;
971
- }
972
- function $42ceafc619f9c3ba$var$useCollectionChildren(options) {
973
- return $a80bd3e9349588e7$export$727c8fc270210f13({
974
- ...options,
975
- addIdAndValue: true
976
- });
977
- }
978
- const $42ceafc619f9c3ba$var$CollectionContext = /* @__PURE__ */ createContext(null);
979
- function $42ceafc619f9c3ba$export$fb8073518f34e6ec(props) {
980
- let ctx = useContext($42ceafc619f9c3ba$var$CollectionContext);
981
- let dependencies = (ctx?.dependencies || []).concat(props.dependencies);
982
- let idScope = props.idScope ?? ctx?.idScope;
983
- let children = $42ceafc619f9c3ba$var$useCollectionChildren({
984
- ...props,
985
- idScope,
986
- dependencies
987
- });
988
- let doc = useContext($42ceafc619f9c3ba$var$CollectionDocumentContext);
989
- if (doc) children = /* @__PURE__ */ React__default.createElement($42ceafc619f9c3ba$var$CollectionRoot, null, children);
990
- ctx = useMemo(
991
- () => ({
992
- dependencies: (
993
- // oxlint-disable-next-line react-hooks/exhaustive-deps
994
- dependencies
995
- ),
996
- idScope
997
- }),
998
- // eslint-disable-next-line react-hooks/exhaustive-deps
999
- // oxlint-disable-next-line react/react-compiler, react-hooks/exhaustive-deps
1000
- [
1001
- idScope,
1002
- ...dependencies
1003
- ]
1004
- );
1005
- return /* @__PURE__ */ React__default.createElement($42ceafc619f9c3ba$var$CollectionContext.Provider, {
1006
- value: ctx
1007
- }, children);
1008
- }
1009
- function $42ceafc619f9c3ba$var$CollectionRoot({ children }) {
1010
- let doc = useContext($42ceafc619f9c3ba$var$CollectionDocumentContext);
1011
- let wrappedChildren = useMemo(() => /* @__PURE__ */ React__default.createElement($42ceafc619f9c3ba$var$CollectionDocumentContext.Provider, {
1012
- value: null
1013
- }, /* @__PURE__ */ React__default.createElement($42ceafc619f9c3ba$var$ShallowRenderContext.Provider, {
1014
- value: true
1015
- }, children)), [
1016
- children
1017
- ]);
1018
- return $c7eafbbe1ea5834e$export$535bd6ca7f90a273() ? /* @__PURE__ */ React__default.createElement($42ceafc619f9c3ba$var$SSRContext.Provider, {
1019
- value: doc
1020
- }, wrappedChildren) : /* @__PURE__ */ createPortal(wrappedChildren, doc);
1021
- }
1022
- const $263ab7fc0f95ccdb$export$a164736487e3f0ae = {
1023
- CollectionRoot({ collection, renderDropIndicator }) {
1024
- return $263ab7fc0f95ccdb$var$useCollectionRender(collection, null, renderDropIndicator);
1025
- },
1026
- CollectionBranch({ collection, parent, renderDropIndicator }) {
1027
- return $263ab7fc0f95ccdb$var$useCollectionRender(collection, parent, renderDropIndicator);
1028
- }
1029
- };
1030
- function $263ab7fc0f95ccdb$var$useCollectionRender(collection, parent, renderDropIndicator) {
1031
- return $a80bd3e9349588e7$export$727c8fc270210f13({
1032
- items: parent ? collection.getChildren(parent.key) : collection,
1033
- dependencies: [
1034
- renderDropIndicator
1035
- ],
1036
- children(node) {
1037
- if (node.type === "content") return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null);
1038
- let rendered = node.render(node);
1039
- if (!renderDropIndicator || node.type !== "item") return rendered;
1040
- return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, renderDropIndicator({
1041
- type: "item",
1042
- key: node.key,
1043
- dropPosition: "before"
1044
- }), rendered, $263ab7fc0f95ccdb$export$2dbbd341daed716d(collection, node, renderDropIndicator));
1045
- }
1046
- });
1047
- }
1048
- function $263ab7fc0f95ccdb$export$2dbbd341daed716d(collection, node, renderDropIndicator) {
1049
- let key = node.key;
1050
- let keyAfter = collection.getKeyAfter(key);
1051
- let nextItemInFlattenedCollection = keyAfter != null ? collection.getItem(keyAfter) : null;
1052
- while (nextItemInFlattenedCollection != null && nextItemInFlattenedCollection.type !== "item") {
1053
- keyAfter = collection.getKeyAfter(nextItemInFlattenedCollection.key);
1054
- nextItemInFlattenedCollection = keyAfter != null ? collection.getItem(keyAfter) : null;
1055
- }
1056
- let nextItemInSameLevel = node.nextKey != null ? collection.getItem(node.nextKey) : null;
1057
- while (nextItemInSameLevel != null && nextItemInSameLevel.type !== "item") nextItemInSameLevel = nextItemInSameLevel.nextKey != null ? collection.getItem(nextItemInSameLevel.nextKey) : null;
1058
- let afterIndicators = [];
1059
- if (nextItemInSameLevel == null) {
1060
- let current = node;
1061
- while (current?.type === "item" && (!nextItemInFlattenedCollection || current.parentKey !== nextItemInFlattenedCollection.parentKey && nextItemInFlattenedCollection.level < current.level)) {
1062
- let indicator = renderDropIndicator({
1063
- type: "item",
1064
- key: current.key,
1065
- dropPosition: "after"
1066
- });
1067
- if (/* @__PURE__ */ isValidElement(indicator)) afterIndicators.push(/* @__PURE__ */ cloneElement(indicator, {
1068
- key: `${current.key}-after`
1069
- }));
1070
- current = current.parentKey != null ? collection.getItem(current.parentKey) : null;
1071
- }
1072
- }
1073
- return afterIndicators;
1074
- }
1075
- const $263ab7fc0f95ccdb$export$4feb769f8ddf26c5 = /* @__PURE__ */ createContext($263ab7fc0f95ccdb$export$a164736487e3f0ae);
1076
146
  function $3c71b1595a147f24$export$496315a1608d9602(cb, dependencies) {
1077
147
  const isInitialMount = useRef(true);
1078
148
  const lastDeps = useRef(null);
@@ -1090,174 +160,12 @@ function $3c71b1595a147f24$export$496315a1608d9602(cb, dependencies) {
1090
160
  lastDeps.current = dependencies;
1091
161
  }, dependencies);
1092
162
  }
1093
- function $901761b40e390936$export$2bb74740c4e19def(node, checkForOverflow) {
1094
- if (!node) return false;
1095
- let style = window.getComputedStyle(node);
1096
- let root = document.scrollingElement || document.documentElement;
1097
- let isScrollable = /(auto|scroll)/.test(style.overflow + style.overflowX + style.overflowY);
1098
- if (node === root && style.overflow !== "hidden") isScrollable = true;
1099
- if (isScrollable && checkForOverflow) isScrollable = node.scrollHeight !== node.clientHeight || node.scrollWidth !== node.clientWidth;
1100
- return isScrollable;
1101
- }
1102
163
  function $3578607fe3d4b096$export$cfa2225e87938781(node, checkForOverflow) {
1103
164
  let scrollableNode = node;
1104
165
  if ($901761b40e390936$export$2bb74740c4e19def(scrollableNode, checkForOverflow)) scrollableNode = scrollableNode.parentElement;
1105
166
  while (scrollableNode && !$901761b40e390936$export$2bb74740c4e19def(scrollableNode, checkForOverflow)) scrollableNode = scrollableNode.parentElement;
1106
167
  return scrollableNode || document.scrollingElement || document.documentElement;
1107
168
  }
1108
- function $76d97191f0f90600$export$94ed1c92c7beeb22(node, checkForOverflow) {
1109
- let parentElements = [];
1110
- let root = document.scrollingElement || document.documentElement;
1111
- while (node) {
1112
- if ($901761b40e390936$export$2bb74740c4e19def(node, checkForOverflow)) parentElements.push(node);
1113
- if (node === root) break;
1114
- node = node.parentElement;
1115
- }
1116
- return parentElements;
1117
- }
1118
- function $51a3e22a5186a962$export$53a0910f038337bd(scrollView, element, opts = {}) {
1119
- if (scrollView === element) return;
1120
- let target = element.getBoundingClientRect();
1121
- $51a3e22a5186a962$export$f064fd83a2c6e9ca(scrollView, element, target, opts);
1122
- }
1123
- function $51a3e22a5186a962$export$f064fd83a2c6e9ca(scrollView, element, target, opts = {}) {
1124
- let { block = "nearest", inline = "nearest" } = opts;
1125
- let y = scrollView.scrollTop;
1126
- let x = scrollView.scrollLeft;
1127
- let view = scrollView.getBoundingClientRect();
1128
- let itemStyle = window.getComputedStyle(element);
1129
- let viewStyle = window.getComputedStyle(scrollView);
1130
- let root = document.scrollingElement || document.documentElement;
1131
- let isRoot = scrollView === root;
1132
- let viewTop = scrollView === root ? 0 : view.top;
1133
- let viewBottom = scrollView === root ? scrollView.clientHeight : view.bottom;
1134
- let viewLeft = scrollView === root ? 0 : view.left;
1135
- let viewRight = scrollView === root ? scrollView.clientWidth : view.right;
1136
- let scrollMarginTop = parseFloat(itemStyle.scrollMarginTop) || 0;
1137
- let scrollMarginBottom = parseFloat(itemStyle.scrollMarginBottom) || 0;
1138
- let scrollMarginLeft = parseFloat(itemStyle.scrollMarginLeft) || 0;
1139
- let scrollMarginRight = parseFloat(itemStyle.scrollMarginRight) || 0;
1140
- let scrollPaddingTop = parseFloat(viewStyle.scrollPaddingTop) || 0;
1141
- let scrollPaddingBottom = parseFloat(viewStyle.scrollPaddingBottom) || 0;
1142
- let scrollPaddingLeft = parseFloat(viewStyle.scrollPaddingLeft) || 0;
1143
- let scrollPaddingRight = parseFloat(viewStyle.scrollPaddingRight) || 0;
1144
- let borderTopWidth = parseFloat(viewStyle.borderTopWidth) || 0;
1145
- let borderBottomWidth = parseFloat(viewStyle.borderBottomWidth) || 0;
1146
- let borderLeftWidth = parseFloat(viewStyle.borderLeftWidth) || 0;
1147
- let borderRightWidth = parseFloat(viewStyle.borderRightWidth) || 0;
1148
- let scrollAreaTop = target.top - scrollMarginTop;
1149
- let scrollAreaBottom = target.bottom + scrollMarginBottom;
1150
- let scrollAreaLeft = target.left - scrollMarginLeft;
1151
- let scrollAreaRight = target.right + scrollMarginRight;
1152
- let scrollBarOffsetX = scrollView === root ? 0 : borderLeftWidth + borderRightWidth;
1153
- let scrollBarOffsetY = scrollView === root ? 0 : borderTopWidth + borderBottomWidth;
1154
- let scrollBarWidth = scrollView === root ? 0 : scrollView.offsetWidth - scrollView.clientWidth - scrollBarOffsetX;
1155
- let scrollBarHeight = scrollView === root ? 0 : scrollView.offsetHeight - scrollView.clientHeight - scrollBarOffsetY;
1156
- let scrollPortTop = viewTop + (isRoot ? 0 : borderTopWidth) + scrollPaddingTop;
1157
- let scrollPortBottom = viewBottom - (isRoot ? 0 : borderBottomWidth) - scrollPaddingBottom - scrollBarHeight;
1158
- let scrollPortLeft = viewLeft + (isRoot ? 0 : borderLeftWidth) + scrollPaddingLeft;
1159
- let scrollPortRight = viewRight - (isRoot ? 0 : borderRightWidth) - scrollPaddingRight;
1160
- if ($2add3ce32c6007eb$export$fedb369cb70207f1() && $2add3ce32c6007eb$export$78551043582a6a98() || viewStyle.direction === "ltr") scrollPortRight -= scrollBarWidth;
1161
- else if (viewStyle.direction === "rtl") scrollPortLeft += scrollBarWidth;
1162
- let shouldScrollBlock = scrollAreaTop < scrollPortTop || scrollAreaBottom > scrollPortBottom;
1163
- let shouldScrollInline = scrollAreaLeft < scrollPortLeft || scrollAreaRight > scrollPortRight;
1164
- if (shouldScrollBlock && block === "start") y += scrollAreaTop - scrollPortTop;
1165
- else if (shouldScrollBlock && block === "center") y += (scrollAreaTop + scrollAreaBottom) / 2 - (scrollPortTop + scrollPortBottom) / 2;
1166
- else if (shouldScrollBlock && block === "end") y += scrollAreaBottom - scrollPortBottom;
1167
- else if (shouldScrollBlock && block === "nearest") {
1168
- let start = scrollAreaTop - scrollPortTop;
1169
- let end = scrollAreaBottom - scrollPortBottom;
1170
- y += Math.abs(start) <= Math.abs(end) ? start : end;
1171
- }
1172
- if (shouldScrollInline && inline === "start") x += scrollAreaLeft - scrollPortLeft;
1173
- else if (shouldScrollInline && inline === "center") x += (scrollAreaLeft + scrollAreaRight) / 2 - (scrollPortLeft + scrollPortRight) / 2;
1174
- else if (shouldScrollInline && inline === "end") x += scrollAreaRight - scrollPortRight;
1175
- else if (shouldScrollInline && inline === "nearest") {
1176
- let start = scrollAreaLeft - scrollPortLeft;
1177
- let end = scrollAreaRight - scrollPortRight;
1178
- x += Math.abs(start) <= Math.abs(end) ? start : end;
1179
- }
1180
- if (process.env.NODE_ENV === "test") {
1181
- scrollView.scrollLeft = x;
1182
- scrollView.scrollTop = y;
1183
- return;
1184
- }
1185
- scrollView.scrollTo({
1186
- left: x,
1187
- top: y
1188
- });
1189
- }
1190
- function $51a3e22a5186a962$export$c826860796309d1b(targetElement, opts = {}) {
1191
- let { containingElement } = opts;
1192
- if (targetElement && targetElement.isConnected) {
1193
- let root = document.scrollingElement || document.documentElement;
1194
- let isScrollPrevented = window.getComputedStyle(root).overflow === "hidden";
1195
- if (!isScrollPrevented) {
1196
- let { left: originalLeft, top: originalTop } = targetElement.getBoundingClientRect();
1197
- targetElement?.scrollIntoView?.({
1198
- block: "nearest"
1199
- });
1200
- let { left: newLeft, top: newTop } = targetElement.getBoundingClientRect();
1201
- if (Math.abs(originalLeft - newLeft) > 1 || Math.abs(originalTop - newTop) > 1) {
1202
- containingElement?.scrollIntoView?.({
1203
- block: "center",
1204
- inline: "center"
1205
- });
1206
- targetElement.scrollIntoView?.({
1207
- block: "nearest"
1208
- });
1209
- }
1210
- } else {
1211
- let { left: originalLeft, top: originalTop } = targetElement.getBoundingClientRect();
1212
- let scrollParents = $76d97191f0f90600$export$94ed1c92c7beeb22(targetElement, true);
1213
- for (let scrollParent of scrollParents) $51a3e22a5186a962$export$53a0910f038337bd(scrollParent, targetElement);
1214
- let { left: newLeft, top: newTop } = targetElement.getBoundingClientRect();
1215
- if (Math.abs(originalLeft - newLeft) > 1 || Math.abs(originalTop - newTop) > 1) {
1216
- scrollParents = containingElement ? $76d97191f0f90600$export$94ed1c92c7beeb22(containingElement, true) : [];
1217
- for (let scrollParent of scrollParents) $51a3e22a5186a962$export$53a0910f038337bd(scrollParent, containingElement, {
1218
- block: "center",
1219
- inline: "center"
1220
- });
1221
- for (let scrollParent of $76d97191f0f90600$export$94ed1c92c7beeb22(targetElement, true)) $51a3e22a5186a962$export$53a0910f038337bd(scrollParent, targetElement);
1222
- }
1223
- }
1224
- }
1225
- }
1226
- let $121970af65029459$var$descriptionId = 0;
1227
- const $121970af65029459$var$descriptionNodes = /* @__PURE__ */ new Map();
1228
- function $121970af65029459$export$f8aeda7b10753fa1(description) {
1229
- let [id, setId] = useState();
1230
- $c4867b2f328c2698$export$e5c5a5f917a5871c(() => {
1231
- if (!description) return;
1232
- let desc = $121970af65029459$var$descriptionNodes.get(description);
1233
- if (!desc) {
1234
- let id2 = `react-aria-description-${$121970af65029459$var$descriptionId++}`;
1235
- setId(id2);
1236
- let node = document.createElement("div");
1237
- node.id = id2;
1238
- node.style.display = "none";
1239
- node.textContent = description;
1240
- document.body.appendChild(node);
1241
- desc = {
1242
- refCount: 0,
1243
- element: node
1244
- };
1245
- $121970af65029459$var$descriptionNodes.set(description, desc);
1246
- } else setId(desc.element.id);
1247
- desc.refCount++;
1248
- return () => {
1249
- if (desc && --desc.refCount === 0) {
1250
- desc.element.remove();
1251
- $121970af65029459$var$descriptionNodes.delete(description);
1252
- }
1253
- };
1254
- }, [
1255
- description
1256
- ]);
1257
- return {
1258
- "aria-describedby": description ? id : void 0
1259
- };
1260
- }
1261
169
  const $ed8ccb2e23e76301$export$b085522c77523c51 = /* @__PURE__ */ createContext(null);
1262
170
  const $ed8ccb2e23e76301$export$c32003b803b6c22e = /* @__PURE__ */ createContext(null);
1263
171
  var $8700ca6f74b7a3bb$exports = {};
@@ -1595,484 +503,22 @@ function $f9554a667e4f0374$export$d1e8e3fbb7461f6(selectionManager, dragAndDropH
1595
503
  dropTargetKey
1596
504
  ]);
1597
505
  }
1598
- const $91fe5e721c7f36c1$export$c9549807523555e0 = /* @__PURE__ */ createContext({
1599
- isSelected: false
1600
- });
1601
- function $22bbea12c2567021$export$d3e3bd3e26688c04(e) {
1602
- return $2add3ce32c6007eb$export$e1865c3bedcd822b() ? e.altKey : e.ctrlKey;
1603
- }
1604
- function $22bbea12c2567021$export$c3d8340acf92597f(collectionRef, key) {
1605
- let selector = `[data-key="${CSS.escape(String(key))}"]`;
1606
- let collection = collectionRef.current?.dataset.collection;
1607
- if (collection) selector = `[data-collection="${CSS.escape(collection)}"]${selector}`;
1608
- return collectionRef.current?.querySelector(selector);
1609
- }
1610
- const $22bbea12c2567021$var$collectionMap = /* @__PURE__ */ new WeakMap();
1611
- function $22bbea12c2567021$export$881eb0d9f3605d9d(collection) {
1612
- let id = $390e54f620492c70$export$f680877a34711e37();
1613
- $22bbea12c2567021$var$collectionMap.set(collection, id);
1614
- return id;
1615
- }
1616
- function $22bbea12c2567021$export$6aeb1680a0ae8741(collection) {
1617
- return $22bbea12c2567021$var$collectionMap.get(collection);
1618
- }
1619
- const $f5a4a9a3486154da$var$TYPEAHEAD_DEBOUNCE_WAIT_MS = 1e3;
1620
- function $f5a4a9a3486154da$export$e32c88dfddc6e1d8(options) {
1621
- let { keyboardDelegate, selectionManager, onTypeSelect } = options;
1622
- let state = useRef({
1623
- search: "",
1624
- timeout: void 0
1625
- });
1626
- let onKeyDownCapture = (e) => {
1627
- if (state.current.search.length > 0 && e.key === " ") {
1628
- e.preventDefault();
1629
- if (!("continuePropagation" in e) || "continuePropagation" in e && !e.isPropagationStopped()) e.stopPropagation();
1630
- state.current.search += " ";
1631
- if (keyboardDelegate.getKeyForSearch != null) {
1632
- let key = keyboardDelegate.getKeyForSearch(state.current.search, selectionManager.focusedKey);
1633
- if (key == null) key = keyboardDelegate.getKeyForSearch(state.current.search);
1634
- if (key != null) {
1635
- selectionManager.setFocusedKey(key);
1636
- if (onTypeSelect) onTypeSelect(key);
1637
- }
1638
- }
1639
- clearTimeout(state.current.timeout);
1640
- state.current.timeout = setTimeout(() => {
1641
- state.current.search = "";
1642
- }, $f5a4a9a3486154da$var$TYPEAHEAD_DEBOUNCE_WAIT_MS);
1643
- }
1644
- };
1645
- let onKeyDown = (e) => {
1646
- let character = $f5a4a9a3486154da$var$getStringForKey(e.key);
1647
- if (!character || e.ctrlKey || e.metaKey || e.altKey || !$23f2114a1b82827e$export$4282f70798064fe0(e.currentTarget, $23f2114a1b82827e$export$e58f029f0fbfdb29(e)) || state.current.search.length === 0 && character === " ") return;
1648
- state.current.search += character;
1649
- if (keyboardDelegate.getKeyForSearch != null) {
1650
- let key = keyboardDelegate.getKeyForSearch(state.current.search, selectionManager.focusedKey);
1651
- if (key == null) key = keyboardDelegate.getKeyForSearch(state.current.search);
1652
- if (key != null) {
1653
- selectionManager.setFocusedKey(key);
1654
- if (onTypeSelect) onTypeSelect(key);
1655
- e.preventDefault();
1656
- if (!("continuePropagation" in e)) e.stopPropagation();
1657
- } else {
1658
- state.current.search = "";
1659
- clearTimeout(state.current.timeout);
1660
- state.current.timeout = void 0;
1661
- return;
1662
- }
1663
- }
1664
- clearTimeout(state.current.timeout);
1665
- state.current.timeout = setTimeout(() => {
1666
- state.current.search = "";
1667
- }, $f5a4a9a3486154da$var$TYPEAHEAD_DEBOUNCE_WAIT_MS);
1668
- };
1669
- useEffect(() => {
1670
- let timeout = state.current.timeout;
1671
- return () => {
1672
- clearTimeout(timeout);
1673
- };
1674
- }, [
1675
- state
1676
- ]);
1677
- return {
1678
- typeSelectProps: {
1679
- // Using a capturing listener to catch the keydown event before
1680
- // other hooks in order to handle the Spacebar event.
1681
- onKeyDownCapture: keyboardDelegate.getKeyForSearch ? onKeyDownCapture : void 0,
1682
- onKeyDown: keyboardDelegate.getKeyForSearch ? onKeyDown : void 0
1683
- }
1684
- };
1685
- }
1686
- function $f5a4a9a3486154da$var$getStringForKey(key) {
1687
- if (key.length === 1 || !/^[A-Z]/i.test(key)) return key;
1688
- return "";
1689
- }
1690
- function $a475cdc2445827b5$export$72ef708ab07251f1(effect, dependencies) {
1691
- const isInitialMount = useRef(true);
1692
- const lastDeps = useRef(null);
1693
- $c4867b2f328c2698$export$e5c5a5f917a5871c(() => {
1694
- isInitialMount.current = true;
1695
- return () => {
1696
- isInitialMount.current = false;
1697
- };
1698
- }, []);
1699
- $c4867b2f328c2698$export$e5c5a5f917a5871c(() => {
1700
- if (isInitialMount.current) isInitialMount.current = false;
1701
- else if (!lastDeps.current || dependencies.some((dep, i) => !Object.is(dep, lastDeps[i]))) effect();
1702
- lastDeps.current = dependencies;
1703
- }, dependencies);
1704
- }
1705
- function $d667c2af82d35a98$export$d6daf82dcd84e87c(options) {
1706
- let { selectionManager: manager, keyboardDelegate: delegate, ref, autoFocus = false, shouldFocusWrap = false, disallowEmptySelection = false, disallowSelectAll = false, escapeKeyBehavior = "clearSelection", selectOnFocus = manager.selectionBehavior === "replace", disallowTypeAhead = false, shouldUseVirtualFocus, allowsTabNavigation = false, scrollRef = ref, linkBehavior = "action", UNSTABLE_focusOnEntry } = options;
1707
- let { direction } = $2eb8e6d23f3d0cb0$export$43bb16f9c6d9e3f7();
1708
- let router = $caaf0dd3060ed57c$export$9a302a45f65d0572();
1709
- const navigateToKey = (e, key, childFocus) => {
1710
- if (key != null) {
1711
- if (manager.isLink(key) && linkBehavior === "selection" && selectOnFocus && !$22bbea12c2567021$export$d3e3bd3e26688c04(e)) {
1712
- flushSync(() => {
1713
- manager.setFocusedKey(key, childFocus);
1714
- });
1715
- let item = $22bbea12c2567021$export$c3d8340acf92597f(ref, key);
1716
- let itemProps = manager.getItemProps(key);
1717
- if (item) {
1718
- router.open(item, e, itemProps.href, itemProps.routerOptions);
1719
- return;
1720
- }
1721
- return false;
1722
- }
1723
- manager.setFocusedKey(key, childFocus);
1724
- if (manager.isLink(key) && linkBehavior === "override") return false;
1725
- if (e.shiftKey && manager.selectionMode === "multiple") {
1726
- manager.extendSelection(key);
1727
- return;
1728
- } else if (selectOnFocus && !$22bbea12c2567021$export$d3e3bd3e26688c04(e)) {
1729
- manager.replaceSelection(key);
1730
- return;
1731
- }
1732
- }
1733
- return false;
1734
- };
1735
- let arrowDown = (e) => {
1736
- if (delegate.getKeyBelow) {
1737
- let nextKey = manager.focusedKey != null ? delegate.getKeyBelow?.(manager.focusedKey) : delegate.getFirstKey?.();
1738
- if (nextKey == null && shouldFocusWrap) nextKey = delegate.getFirstKey?.(manager.focusedKey);
1739
- if (nextKey != null) {
1740
- navigateToKey(e, nextKey);
1741
- return;
1742
- }
1743
- }
1744
- return false;
1745
- };
1746
- let arrowUp = (e) => {
1747
- if (delegate.getKeyAbove) {
1748
- let nextKey = manager.focusedKey != null ? delegate.getKeyAbove?.(manager.focusedKey) : delegate.getLastKey?.();
1749
- if (nextKey == null && shouldFocusWrap) nextKey = delegate.getLastKey?.(manager.focusedKey);
1750
- if (nextKey != null) {
1751
- navigateToKey(e, nextKey);
1752
- return;
1753
- }
1754
- }
1755
- return false;
1756
- };
1757
- let home = (e) => {
1758
- if (delegate.getFirstKey) {
1759
- if (manager.focusedKey === null && e.shiftKey) return false;
1760
- let firstKey2 = delegate.getFirstKey(manager.focusedKey, $bb39c0fc1c19b34c$export$16792effe837dba3(e));
1761
- manager.setFocusedKey(firstKey2);
1762
- if (firstKey2 != null) {
1763
- if ($bb39c0fc1c19b34c$export$16792effe837dba3(e) && e.shiftKey && manager.selectionMode === "multiple") {
1764
- manager.extendSelection(firstKey2);
1765
- return;
1766
- } else if (selectOnFocus) {
1767
- manager.replaceSelection(firstKey2);
1768
- return;
1769
- }
1770
- }
1771
- }
1772
- return false;
1773
- };
1774
- let arrowLeft = (e) => {
1775
- if (delegate.getKeyLeftOf) {
1776
- let nextKey = manager.focusedKey != null ? delegate.getKeyLeftOf?.(manager.focusedKey) : delegate.getFirstKey?.();
1777
- if (nextKey == null && shouldFocusWrap) nextKey = direction === "rtl" ? delegate.getFirstKey?.(manager.focusedKey) : delegate.getLastKey?.(manager.focusedKey);
1778
- if (nextKey != null) {
1779
- navigateToKey(e, nextKey, direction === "rtl" ? "first" : "last");
1780
- return;
1781
- }
1782
- }
1783
- return false;
1784
- };
1785
- let arrowRight = (e) => {
1786
- if (delegate.getKeyRightOf) {
1787
- let nextKey = manager.focusedKey != null ? delegate.getKeyRightOf?.(manager.focusedKey) : delegate.getFirstKey?.();
1788
- if (nextKey == null && shouldFocusWrap) nextKey = direction === "rtl" ? delegate.getLastKey?.(manager.focusedKey) : delegate.getFirstKey?.(manager.focusedKey);
1789
- if (nextKey != null) {
1790
- navigateToKey(e, nextKey, direction === "rtl" ? "last" : "first");
1791
- return;
1792
- }
1793
- }
1794
- return false;
1795
- };
1796
- let end = (e) => {
1797
- if (delegate.getLastKey) {
1798
- if (manager.focusedKey === null && e.shiftKey) return false;
1799
- let lastKey = delegate.getLastKey(manager.focusedKey, $bb39c0fc1c19b34c$export$16792effe837dba3(e));
1800
- manager.setFocusedKey(lastKey);
1801
- if (lastKey != null) {
1802
- if ($bb39c0fc1c19b34c$export$16792effe837dba3(e) && e.shiftKey && manager.selectionMode === "multiple") {
1803
- manager.extendSelection(lastKey);
1804
- return;
1805
- } else if (selectOnFocus) {
1806
- manager.replaceSelection(lastKey);
1807
- return;
1808
- }
1809
- }
1810
- }
1811
- return false;
1812
- };
1813
- let pageDown = (e) => {
1814
- if (delegate.getKeyPageBelow && manager.focusedKey != null) {
1815
- let nextKey = delegate.getKeyPageBelow(manager.focusedKey);
1816
- if (nextKey != null) return navigateToKey(e, nextKey);
1817
- }
1818
- return false;
1819
- };
1820
- let pageUp = (e) => {
1821
- if (delegate.getKeyPageAbove && manager.focusedKey != null) {
1822
- let nextKey = delegate.getKeyPageAbove(manager.focusedKey);
1823
- if (nextKey != null) return navigateToKey(e, nextKey);
1824
- }
1825
- return false;
1826
- };
1827
- let aHandler = () => {
1828
- if (manager.selectionMode === "multiple" && disallowSelectAll !== true) {
1829
- manager.selectAll();
1830
- return;
1831
- }
1832
- return false;
1833
- };
1834
- let escape = () => {
1835
- if (escapeKeyBehavior === "clearSelection" && !disallowEmptySelection && manager.selectedKeys.size !== 0) {
1836
- manager.clearSelection();
1837
- return;
1838
- }
1839
- return false;
1840
- };
1841
- let tab = () => {
1842
- if (!allowsTabNavigation && ref.current) {
1843
- let walker = $535772f9d2c1f38d$export$2d6ec8fc375ceafa(ref.current, {
1844
- tabbable: true
1845
- });
1846
- let next = void 0;
1847
- let last;
1848
- do {
1849
- last = walker.lastChild();
1850
- if (last) next = last;
1851
- } while (last);
1852
- let activeElement = $23f2114a1b82827e$export$cd4e5573fbe2b576();
1853
- if (next && (!$23f2114a1b82827e$export$b4f377a2b6254582(next) || activeElement && !$3b8b240c1bf84ab9$export$bebd5a1431fec25d(activeElement))) $1969ac565cfec8d0$export$de79e2c695e052f3(next);
1854
- }
1855
- return {
1856
- shouldContinuePropagation: true,
1857
- shouldPreventDefault: false
1858
- };
1859
- };
1860
- let shiftTab = () => {
1861
- if (!allowsTabNavigation && ref.current) ref.current.focus();
1862
- return {
1863
- shouldContinuePropagation: true,
1864
- shouldPreventDefault: false
1865
- };
1866
- };
1867
- let withShiftSel = (key, callback) => {
1868
- return {
1869
- [$2add3ce32c6007eb$export$9ac100e40613ea10() ? key + "+Shift+Alt" : key + "+Shift+Control"]: callback,
1870
- [key + "+Shift"]: callback,
1871
- [$2add3ce32c6007eb$export$9ac100e40613ea10() ? key + "+Alt" : key + "+Control"]: callback,
1872
- [key]: callback
1873
- };
1874
- };
1875
- let { keyboardProps: repeatKeyboardProps } = $8296dad1a4c5e0dc$export$8f71654801c2f7cd({
1876
- shortcuts: {
1877
- ...withShiftSel("ArrowDown", arrowDown),
1878
- ...withShiftSel("ArrowUp", arrowUp),
1879
- ...withShiftSel("ArrowLeft", arrowLeft),
1880
- ...withShiftSel("ArrowRight", arrowRight),
1881
- ...withShiftSel("PageDown", pageDown),
1882
- ...withShiftSel("PageUp", pageUp)
1883
- },
1884
- allowRepeats: true
1885
- });
1886
- let { keyboardProps } = $8296dad1a4c5e0dc$export$8f71654801c2f7cd({
1887
- shortcuts: {
1888
- ...withShiftSel("Home", home),
1889
- ...withShiftSel("End", end),
1890
- "Mod+A": aHandler,
1891
- Escape: escape,
1892
- Tab: tab,
1893
- "Tab+Shift": shiftTab
1894
- }
1895
- });
1896
- let scrollPos = useRef({
1897
- top: 0,
1898
- left: 0
1899
- });
1900
- $600b3cf69ae46262$export$90fc3a17d93f704c(scrollRef, "scroll", () => {
1901
- scrollPos.current = {
1902
- top: scrollRef.current?.scrollTop ?? 0,
1903
- left: scrollRef.current?.scrollLeft ?? 0
1904
- };
1905
- });
1906
- let onFocus = (e) => {
1907
- if (manager.isFocused) {
1908
- if (!$23f2114a1b82827e$export$4282f70798064fe0(e.currentTarget, $23f2114a1b82827e$export$e58f029f0fbfdb29(e))) manager.setFocused(false);
1909
- return;
1910
- }
1911
- if (!$23f2114a1b82827e$export$4282f70798064fe0(e.currentTarget, $23f2114a1b82827e$export$e58f029f0fbfdb29(e))) return;
1912
- let modality = $8f5a2122b0992be3$export$630ff653c5ada6a9();
1913
- manager.setFocused(true);
1914
- let navigateToKey2 = (key) => {
1915
- if (key != null) {
1916
- manager.setFocusedKey(key);
1917
- if (selectOnFocus && !manager.isSelected(key)) manager.replaceSelection(key);
1918
- }
1919
- };
1920
- if (UNSTABLE_focusOnEntry && (modality === "keyboard" || modality === "virtual"))
1921
- navigateToKey2(UNSTABLE_focusOnEntry === "first" ? delegate.getFirstKey?.() : delegate.getLastKey?.());
1922
- else if (manager.focusedKey == null) {
1923
- let relatedTarget = e.relatedTarget;
1924
- if (relatedTarget && e.currentTarget.compareDocumentPosition(relatedTarget) & Node.DOCUMENT_POSITION_FOLLOWING) navigateToKey2(manager.lastSelectedKey ?? delegate.getLastKey?.());
1925
- else navigateToKey2(manager.firstSelectedKey ?? delegate.getFirstKey?.());
1926
- } else if (scrollRef.current) {
1927
- scrollRef.current.scrollTop = scrollPos.current.top;
1928
- scrollRef.current.scrollLeft = scrollPos.current.left;
1929
- }
1930
- if (manager.focusedKey != null && scrollRef.current) {
1931
- let element = $22bbea12c2567021$export$c3d8340acf92597f(ref, manager.focusedKey);
1932
- if (element instanceof HTMLElement) {
1933
- if (!$23f2114a1b82827e$export$b4f377a2b6254582(element) && !shouldUseVirtualFocus) $1969ac565cfec8d0$export$de79e2c695e052f3(element);
1934
- if (modality === "keyboard" || UNSTABLE_focusOnEntry && modality === "virtual") $51a3e22a5186a962$export$c826860796309d1b(element, {
1935
- containingElement: ref.current
1936
- });
1937
- }
1938
- }
1939
- };
1940
- let onBlur = (e) => {
1941
- if (!$23f2114a1b82827e$export$4282f70798064fe0(e.currentTarget, e.relatedTarget)) manager.setFocused(false);
1942
- };
1943
- let shouldVirtualFocusFirst = useRef(false);
1944
- $600b3cf69ae46262$export$90fc3a17d93f704c(ref, $8b2399d051d06d4c$export$831c820ad60f9d12, !shouldUseVirtualFocus ? void 0 : (e) => {
1945
- let { detail } = e;
1946
- e.stopPropagation();
1947
- manager.setFocused(true);
1948
- if (detail?.focusStrategy === "first") shouldVirtualFocusFirst.current = true;
1949
- });
1950
- let firstKey = delegate.getFirstKey?.() ?? null;
1951
- $a475cdc2445827b5$export$72ef708ab07251f1(() => {
1952
- if (shouldVirtualFocusFirst.current) {
1953
- if (firstKey == null) {
1954
- let previousActiveElement = $23f2114a1b82827e$export$cd4e5573fbe2b576();
1955
- $b72f3f7b3b5f42c6$export$76e4e37e5339496d(ref.current);
1956
- $b72f3f7b3b5f42c6$export$2b35b76d2e30e129(previousActiveElement, null);
1957
- if (manager.collection.size > 0) shouldVirtualFocusFirst.current = false;
1958
- } else {
1959
- manager.setFocusedKey(firstKey);
1960
- shouldVirtualFocusFirst.current = false;
1961
- }
1962
- }
1963
- }, [
1964
- firstKey,
1965
- manager.collection.size
1966
- ]);
1967
- $a475cdc2445827b5$export$72ef708ab07251f1(() => {
1968
- if (manager.collection.size > 0) shouldVirtualFocusFirst.current = false;
1969
- }, [
1970
- manager.focusedKey
1971
- ]);
1972
- $600b3cf69ae46262$export$90fc3a17d93f704c(ref, $8b2399d051d06d4c$export$447a38995de2c711, !shouldUseVirtualFocus ? void 0 : (e) => {
1973
- e.stopPropagation();
1974
- manager.setFocused(false);
1975
- if (e.detail?.clearFocusKey) manager.setFocusedKey(null);
1976
- });
1977
- const autoFocusRef = useRef(autoFocus);
1978
- const didAutoFocusRef = useRef(false);
1979
- useEffect(() => {
1980
- if (autoFocusRef.current) {
1981
- let focusedKey = null;
1982
- if (autoFocus === "first") focusedKey = delegate.getFirstKey?.() ?? null;
1983
- if (autoFocus === "last") focusedKey = delegate.getLastKey?.() ?? null;
1984
- let selectedKeys = manager.selectedKeys;
1985
- if (selectedKeys.size) {
1986
- for (let key of selectedKeys) if (manager.canSelectItem(key)) {
1987
- focusedKey = key;
1988
- break;
1989
- }
1990
- }
1991
- manager.setFocused(true);
1992
- manager.setFocusedKey(focusedKey);
1993
- if (focusedKey != null && selectOnFocus && !selectedKeys.size && manager.canSelectItem(focusedKey)) manager.replaceSelection(focusedKey);
1994
- if (focusedKey == null && !shouldUseVirtualFocus && ref.current) $f192c2f16961cbe0$export$80f3e147d781571c(ref.current);
1995
- if (manager.collection.size > 0) {
1996
- autoFocusRef.current = false;
1997
- didAutoFocusRef.current = true;
1998
- }
1999
- }
2000
- });
2001
- let lastFocusedKey = useRef(manager.focusedKey);
2002
- let raf = useRef(null);
2003
- useEffect(() => {
2004
- if (manager.isFocused && manager.focusedKey != null && (manager.focusedKey !== lastFocusedKey.current || didAutoFocusRef.current) && scrollRef.current && ref.current) {
2005
- let modality = $8f5a2122b0992be3$export$630ff653c5ada6a9();
2006
- let element = $22bbea12c2567021$export$c3d8340acf92597f(ref, manager.focusedKey);
2007
- if (!(element instanceof HTMLElement))
2008
- return;
2009
- if (modality === "keyboard" || didAutoFocusRef.current) {
2010
- if (raf.current) cancelAnimationFrame(raf.current);
2011
- raf.current = requestAnimationFrame(() => {
2012
- if (scrollRef.current) {
2013
- $51a3e22a5186a962$export$53a0910f038337bd(scrollRef.current, element);
2014
- if (modality !== "virtual") $51a3e22a5186a962$export$c826860796309d1b(element, {
2015
- containingElement: ref.current
2016
- });
2017
- }
2018
- });
2019
- }
2020
- }
2021
- if (!shouldUseVirtualFocus && manager.isFocused && manager.focusedKey == null && lastFocusedKey.current != null && ref.current) $f192c2f16961cbe0$export$80f3e147d781571c(ref.current);
2022
- lastFocusedKey.current = manager.focusedKey;
2023
- didAutoFocusRef.current = false;
2024
- });
2025
- useEffect(() => {
2026
- return () => {
2027
- if (raf.current) cancelAnimationFrame(raf.current);
2028
- };
2029
- }, []);
2030
- $600b3cf69ae46262$export$90fc3a17d93f704c(ref, "react-aria-focus-scope-restore", (e) => {
2031
- e.preventDefault();
2032
- manager.setFocused(true);
2033
- });
2034
- let handlers = {
2035
- ...$bbaa08b3cd72f041$export$9d1611c77c2fe928(keyboardProps, repeatKeyboardProps),
2036
- onFocus,
2037
- onBlur,
2038
- onMouseDown(e) {
2039
- if (scrollRef.current === $23f2114a1b82827e$export$e58f029f0fbfdb29(e))
2040
- e.preventDefault();
2041
- }
2042
- };
2043
- let { typeSelectProps } = $f5a4a9a3486154da$export$e32c88dfddc6e1d8({
2044
- keyboardDelegate: delegate,
2045
- selectionManager: manager
2046
- });
2047
- if (!disallowTypeAhead)
2048
- handlers = $bbaa08b3cd72f041$export$9d1611c77c2fe928(typeSelectProps, handlers);
2049
- let tabIndex = void 0;
2050
- if (!shouldUseVirtualFocus) tabIndex = manager.focusedKey == null ? 0 : -1;
2051
- let collectionId = $22bbea12c2567021$export$881eb0d9f3605d9d(manager.collection);
2052
- return {
2053
- // oxlint-disable-next-line react/react-compiler
2054
- collectionProps: $bbaa08b3cd72f041$export$9d1611c77c2fe928(handlers, {
2055
- tabIndex,
2056
- "data-collection": collectionId
2057
- })
2058
- };
2059
- }
2060
- class $a83747cc3f035330$export$8f5ed9ff9f511381 {
2061
- constructor(ref) {
2062
- this.ref = ref;
2063
- }
2064
- getItemRect(key) {
2065
- let container = this.ref.current;
2066
- if (!container) return null;
2067
- let item = key != null ? $22bbea12c2567021$export$c3d8340acf92597f(this.ref, key) : null;
2068
- if (!item) return null;
2069
- let containerRect = container.getBoundingClientRect();
2070
- let itemRect = item.getBoundingClientRect();
2071
- return {
2072
- x: itemRect.left - containerRect.left - container.clientLeft + container.scrollLeft,
2073
- y: itemRect.top - containerRect.top - container.clientTop + container.scrollTop,
2074
- width: itemRect.width,
2075
- height: itemRect.height
506
+ class $a83747cc3f035330$export$8f5ed9ff9f511381 {
507
+ constructor(ref) {
508
+ this.ref = ref;
509
+ }
510
+ getItemRect(key) {
511
+ let container = this.ref.current;
512
+ if (!container) return null;
513
+ let item = key != null ? $22bbea12c2567021$export$c3d8340acf92597f(this.ref, key) : null;
514
+ if (!item) return null;
515
+ let containerRect = container.getBoundingClientRect();
516
+ let itemRect = item.getBoundingClientRect();
517
+ return {
518
+ x: itemRect.left - containerRect.left - container.clientLeft + container.scrollLeft,
519
+ y: itemRect.top - containerRect.top - container.clientTop + container.scrollTop,
520
+ width: itemRect.width,
521
+ height: itemRect.height
2076
522
  };
2077
523
  }
2078
524
  getContentSize() {
@@ -2085,1144 +531,213 @@ class $a83747cc3f035330$export$8f5ed9ff9f511381 {
2085
531
  getVisibleRect() {
2086
532
  let container = this.ref.current;
2087
533
  return {
2088
- x: container?.scrollLeft ?? 0,
2089
- y: container?.scrollTop ?? 0,
2090
- width: container?.clientWidth ?? 0,
2091
- height: container?.clientHeight ?? 0
2092
- };
2093
- }
2094
- }
2095
- class $ae8f8d98b2b18f2f$export$a05409b8bb224a5a {
2096
- constructor(...args) {
2097
- if (args.length === 1) {
2098
- let opts = args[0];
2099
- this.collection = opts.collection;
2100
- this.ref = opts.ref;
2101
- this.collator = opts.collator;
2102
- this.disabledKeys = opts.disabledKeys || /* @__PURE__ */ new Set();
2103
- this.disabledBehavior = opts.disabledBehavior || "all";
2104
- this.orientation = opts.orientation || "vertical";
2105
- this.direction = opts.direction;
2106
- this.layout = opts.layout || "stack";
2107
- this.layoutDelegate = opts.layoutDelegate || new $a83747cc3f035330$export$8f5ed9ff9f511381(opts.ref);
2108
- } else {
2109
- this.collection = args[0];
2110
- this.disabledKeys = args[1];
2111
- this.ref = args[2];
2112
- this.collator = args[3];
2113
- this.layout = "stack";
2114
- this.orientation = "vertical";
2115
- this.disabledBehavior = "all";
2116
- this.layoutDelegate = new $a83747cc3f035330$export$8f5ed9ff9f511381(this.ref);
2117
- }
2118
- if (this.layout === "stack" && this.orientation === "vertical") {
2119
- this.getKeyLeftOf = void 0;
2120
- this.getKeyRightOf = void 0;
2121
- }
2122
- }
2123
- isDisabled(item) {
2124
- return this.disabledBehavior === "all" && (item.props?.isDisabled || this.disabledKeys.has(item.key)) && item.props?.disabledBehavior !== "selection";
2125
- }
2126
- findNextNonDisabled(key, getNext, includeDisabled = false) {
2127
- let nextKey = key;
2128
- while (nextKey != null) {
2129
- let item = this.collection.getItem(nextKey);
2130
- if (item?.type === "item" && (includeDisabled || !this.isDisabled(item))) return nextKey;
2131
- nextKey = getNext(nextKey);
2132
- }
2133
- return null;
2134
- }
2135
- getNextKey(key, options) {
2136
- let nextKey = key;
2137
- nextKey = this.collection.getKeyAfter(nextKey);
2138
- return this.findNextNonDisabled(nextKey, (key2) => this.collection.getKeyAfter(key2), options?.includeDisabled);
2139
- }
2140
- getPreviousKey(key, options) {
2141
- let nextKey = key;
2142
- nextKey = this.collection.getKeyBefore(nextKey);
2143
- return this.findNextNonDisabled(nextKey, (key2) => this.collection.getKeyBefore(key2), options?.includeDisabled);
2144
- }
2145
- findKey(key, nextKey, shouldSkip) {
2146
- let tempKey = key;
2147
- let itemRect = this.layoutDelegate.getItemRect(tempKey);
2148
- if (!itemRect || tempKey == null) return null;
2149
- let prevRect = itemRect;
2150
- do {
2151
- tempKey = nextKey(tempKey);
2152
- if (tempKey == null) break;
2153
- itemRect = this.layoutDelegate.getItemRect(tempKey);
2154
- } while (itemRect && shouldSkip(prevRect, itemRect) && tempKey != null);
2155
- return tempKey;
2156
- }
2157
- isSameRow(prevRect, itemRect) {
2158
- return prevRect.y === itemRect.y || prevRect.x !== itemRect.x;
2159
- }
2160
- isSameColumn(prevRect, itemRect) {
2161
- return prevRect.x === itemRect.x || prevRect.y !== itemRect.y;
2162
- }
2163
- // checks to see if the next/prev key is spatially above/below the current key. If not, that means we are in
2164
- // a reversed column layout and need to adjust appropriately
2165
- // TODO: still need to see how this works with virtualizer once there is handling for the reverse layout
2166
- // this felt like a simpler approach then changing getKeyAbove/Below to be purely spatial calculations
2167
- isReversed(key) {
2168
- let nextKey = this.getNextKey(key);
2169
- let currentEl = $22bbea12c2567021$export$c3d8340acf92597f(this.ref, key);
2170
- if (nextKey != null) {
2171
- let nextEl = $22bbea12c2567021$export$c3d8340acf92597f(this.ref, nextKey);
2172
- if (!currentEl || !nextEl) return false;
2173
- return currentEl.getBoundingClientRect().top > nextEl.getBoundingClientRect().top;
2174
- }
2175
- let prevKey = this.getPreviousKey(key);
2176
- if (prevKey != null) {
2177
- let prevEl = $22bbea12c2567021$export$c3d8340acf92597f(this.ref, prevKey);
2178
- if (!currentEl || !prevEl) return false;
2179
- return prevEl.getBoundingClientRect().top > currentEl.getBoundingClientRect().top;
2180
- }
2181
- return false;
2182
- }
2183
- getKeyBelow(key, options) {
2184
- if (this.layout === "grid" && this.orientation === "vertical") return this.findKey(key, (key2) => this.getNextKey(key2, options), this.isSameRow);
2185
- else if (this.orientation === "vertical") return this.isReversed(key) ? this.getPreviousKey(key, options) : this.getNextKey(key, options);
2186
- else return this.getNextKey(key, options);
2187
- }
2188
- getKeyAbove(key, options) {
2189
- if (this.layout === "grid" && this.orientation === "vertical") return this.findKey(key, (key2) => this.getPreviousKey(key2, options), this.isSameRow);
2190
- else if (this.orientation === "vertical") return this.isReversed(key) ? this.getNextKey(key, options) : this.getPreviousKey(key, options);
2191
- else return this.getPreviousKey(key, options);
2192
- }
2193
- getNextColumn(key, right, options) {
2194
- return right ? this.getPreviousKey(key, options) : this.getNextKey(key, options);
2195
- }
2196
- getKeyRightOf(key, options) {
2197
- let layoutDelegateMethod = this.direction === "ltr" ? "getKeyRightOf" : "getKeyLeftOf";
2198
- if (this.layoutDelegate[layoutDelegateMethod]) {
2199
- key = this.layoutDelegate[layoutDelegateMethod](key);
2200
- return this.findNextNonDisabled(key, (key2) => this.layoutDelegate[layoutDelegateMethod](key2), options?.includeDisabled);
2201
- }
2202
- if (this.layout === "grid") {
2203
- if (this.orientation === "vertical") return this.getNextColumn(key, this.direction === "rtl", options);
2204
- else return this.findKey(key, (key2) => this.getNextColumn(key2, this.direction === "rtl", options), this.isSameColumn);
2205
- } else if (this.orientation === "horizontal") return this.getNextColumn(key, this.direction === "rtl", options);
2206
- return null;
2207
- }
2208
- getKeyLeftOf(key, options) {
2209
- let layoutDelegateMethod = this.direction === "ltr" ? "getKeyLeftOf" : "getKeyRightOf";
2210
- if (this.layoutDelegate[layoutDelegateMethod]) {
2211
- key = this.layoutDelegate[layoutDelegateMethod](key);
2212
- return this.findNextNonDisabled(key, (key2) => this.layoutDelegate[layoutDelegateMethod](key2), options?.includeDisabled);
2213
- }
2214
- if (this.layout === "grid") {
2215
- if (this.orientation === "vertical") return this.getNextColumn(key, this.direction === "ltr", options);
2216
- else return this.findKey(key, (key2) => this.getNextColumn(key2, this.direction === "ltr", options), this.isSameColumn);
2217
- } else if (this.orientation === "horizontal") return this.getNextColumn(key, this.direction === "ltr", options);
2218
- return null;
2219
- }
2220
- getFirstKey() {
2221
- let key = this.collection.getFirstKey();
2222
- return this.findNextNonDisabled(key, (key2) => this.collection.getKeyAfter(key2));
2223
- }
2224
- getLastKey() {
2225
- let key = this.collection.getLastKey();
2226
- return this.findNextNonDisabled(key, (key2) => this.collection.getKeyBefore(key2));
2227
- }
2228
- getKeyPageAbove(key) {
2229
- let menu = this.ref.current;
2230
- let itemRect = this.layoutDelegate.getItemRect(key);
2231
- if (!itemRect) return null;
2232
- let reversed = this.isReversed(key);
2233
- if (menu && !$901761b40e390936$export$2bb74740c4e19def(menu)) return this.getFirstKey();
2234
- let nextKey = key;
2235
- if (this.orientation === "horizontal") {
2236
- let pageX = Math.max(0, itemRect.x + itemRect.width - this.layoutDelegate.getVisibleRect().width);
2237
- while (itemRect && itemRect.x > pageX && nextKey != null) {
2238
- nextKey = this.getKeyAbove(nextKey);
2239
- itemRect = nextKey == null ? null : this.layoutDelegate.getItemRect(nextKey);
2240
- }
2241
- } else {
2242
- let visibleRect = this.layoutDelegate.getVisibleRect();
2243
- let pageY = reversed ? itemRect.y - visibleRect.height : Math.max(0, itemRect.y + itemRect.height - visibleRect.height);
2244
- while (itemRect && itemRect.y > pageY && nextKey != null) {
2245
- nextKey = this.getKeyAbove(nextKey);
2246
- itemRect = nextKey == null ? null : this.layoutDelegate.getItemRect(nextKey);
2247
- }
2248
- }
2249
- return nextKey ?? (reversed ? this.getLastKey() : this.getFirstKey());
2250
- }
2251
- getKeyPageBelow(key) {
2252
- let menu = this.ref.current;
2253
- let itemRect = this.layoutDelegate.getItemRect(key);
2254
- if (!itemRect) return null;
2255
- let reversed = this.isReversed(key);
2256
- if (menu && !$901761b40e390936$export$2bb74740c4e19def(menu)) return this.getLastKey();
2257
- let nextKey = key;
2258
- if (this.orientation === "horizontal") {
2259
- let pageX = Math.min(this.layoutDelegate.getContentSize().width, itemRect.x - itemRect.width + this.layoutDelegate.getVisibleRect().width);
2260
- while (itemRect && itemRect.x < pageX && nextKey != null) {
2261
- nextKey = this.getKeyBelow(nextKey);
2262
- itemRect = nextKey == null ? null : this.layoutDelegate.getItemRect(nextKey);
2263
- }
2264
- } else {
2265
- let pageY = Math.min(this.layoutDelegate.getContentSize().height, itemRect.y - itemRect.height + this.layoutDelegate.getVisibleRect().height);
2266
- while (itemRect && itemRect.y < pageY && nextKey != null) {
2267
- nextKey = this.getKeyBelow(nextKey);
2268
- itemRect = nextKey == null ? null : this.layoutDelegate.getItemRect(nextKey);
2269
- }
2270
- }
2271
- return nextKey ?? (reversed ? this.getFirstKey() : this.getLastKey());
2272
- }
2273
- getKeyForSearch(search, fromKey) {
2274
- if (!this.collator) return null;
2275
- let collection = this.collection;
2276
- let key = fromKey || this.getFirstKey();
2277
- while (key != null) {
2278
- let item = collection.getItem(key);
2279
- if (!item) return null;
2280
- let substring = item.textValue.slice(0, search.length);
2281
- if (item.textValue && this.collator.compare(substring, search) === 0) return key;
2282
- key = this.getNextKey(key);
2283
- }
2284
- return null;
2285
- }
2286
- }
2287
- let $673d46fce3e5717d$var$cache = /* @__PURE__ */ new Map();
2288
- function $673d46fce3e5717d$export$a16aca283550c30d(options) {
2289
- let { locale } = $2eb8e6d23f3d0cb0$export$43bb16f9c6d9e3f7();
2290
- let cacheKey = locale + (options ? Object.entries(options).sort((a, b) => a[0] < b[0] ? -1 : 1).join() : "");
2291
- if ($673d46fce3e5717d$var$cache.has(cacheKey)) return $673d46fce3e5717d$var$cache.get(cacheKey);
2292
- let formatter = new Intl.Collator(locale, options);
2293
- $673d46fce3e5717d$var$cache.set(cacheKey, formatter);
2294
- return formatter;
2295
- }
2296
- const $7b01448eaad0fe7c$var$DEFAULT_THRESHOLD = 500;
2297
- function $7b01448eaad0fe7c$export$c24ed0104d07eab9(props) {
2298
- let { isDisabled, pointerType, onLongPressStart, onLongPressEnd, onLongPress, threshold = $7b01448eaad0fe7c$var$DEFAULT_THRESHOLD, accessibilityDescription } = props;
2299
- const timeRef = useRef(void 0);
2300
- let { addGlobalListener, removeAllGlobalListeners } = $48a7d519b337145d$export$4eaf04e54aa8eed6();
2301
- let isAcceptedPointerType = (e) => pointerType ? e.pointerType === pointerType : e.pointerType === "mouse" || e.pointerType === "touch";
2302
- let { pressProps } = $d27d541f9569d26d$export$45712eceda6fad21({
2303
- isDisabled,
2304
- onPressStart(e) {
2305
- e.continuePropagation();
2306
- if (isAcceptedPointerType(e)) {
2307
- if (onLongPressStart) onLongPressStart({
2308
- ...e,
2309
- type: "longpressstart"
2310
- });
2311
- timeRef.current = setTimeout(() => {
2312
- e.target.dispatchEvent(new PointerEvent("pointercancel", {
2313
- bubbles: true
2314
- }));
2315
- addGlobalListener(e.target, "click", (e2) => e2.preventDefault(), {
2316
- once: true
2317
- });
2318
- if ($d447af545b77c9f1$export$b204af158042fbac(e.target).activeElement !== e.target) $1969ac565cfec8d0$export$de79e2c695e052f3(e.target);
2319
- if (onLongPress) onLongPress({
2320
- ...e,
2321
- type: "longpress"
2322
- });
2323
- timeRef.current = void 0;
2324
- }, threshold);
2325
- if (e.pointerType === "touch") addGlobalListener(e.target, "contextmenu", (e2) => e2.preventDefault(), {
2326
- once: true
2327
- });
2328
- let ownerWindow = $d447af545b77c9f1$export$f21a1ffae260145a(e.target);
2329
- addGlobalListener(ownerWindow, "pointerup", () => {
2330
- setTimeout(() => {
2331
- removeAllGlobalListeners();
2332
- }, 100);
2333
- }, {
2334
- once: true
2335
- });
2336
- }
2337
- },
2338
- onPressEnd(e) {
2339
- if (timeRef.current) clearTimeout(timeRef.current);
2340
- if (onLongPressEnd && isAcceptedPointerType(e)) onLongPressEnd({
2341
- ...e,
2342
- type: "longpressend"
2343
- });
2344
- }
2345
- });
2346
- let descriptionProps = $121970af65029459$export$f8aeda7b10753fa1(onLongPress && !isDisabled ? accessibilityDescription : void 0);
2347
- return {
2348
- longPressProps: $bbaa08b3cd72f041$export$9d1611c77c2fe928(pressProps, descriptionProps)
2349
- };
2350
- }
2351
- function $f6ba6936bfd098a0$export$ecf600387e221c37(options) {
2352
- let { id, selectionManager: manager, key, ref, shouldSelectOnPressUp, shouldUseVirtualFocus, focus, isDisabled, onAction, allowsDifferentPressOrigin, linkBehavior = "action" } = options;
2353
- let router = $caaf0dd3060ed57c$export$9a302a45f65d0572();
2354
- id = $390e54f620492c70$export$f680877a34711e37(id);
2355
- let onSelect = (e) => {
2356
- if (e.pointerType === "keyboard" && $22bbea12c2567021$export$d3e3bd3e26688c04(e)) manager.toggleSelection(key);
2357
- else {
2358
- if (manager.selectionMode === "none") return;
2359
- if (manager.isLink(key)) {
2360
- if (linkBehavior === "selection" && ref.current) {
2361
- let itemProps2 = manager.getItemProps(key);
2362
- router.open(ref.current, e, itemProps2.href, itemProps2.routerOptions);
2363
- manager.setSelectedKeys(manager.selectedKeys);
2364
- return;
2365
- } else if (linkBehavior === "override" || linkBehavior === "none") return;
2366
- }
2367
- if (manager.selectionMode === "single") {
2368
- if (manager.isSelected(key) && !manager.disallowEmptySelection) manager.toggleSelection(key);
2369
- else manager.replaceSelection(key);
2370
- } else if (e && e.shiftKey) manager.extendSelection(key);
2371
- else if (manager.selectionBehavior === "toggle" || e && ($bb39c0fc1c19b34c$export$16792effe837dba3(e) || e.pointerType === "touch" || e.pointerType === "virtual"))
2372
- manager.toggleSelection(key);
2373
- else manager.replaceSelection(key);
2374
- }
2375
- };
2376
- useEffect(() => {
2377
- let isFocused = key === manager.focusedKey;
2378
- if (isFocused && manager.isFocused) {
2379
- if (!shouldUseVirtualFocus) {
2380
- if (focus) focus();
2381
- else if ($23f2114a1b82827e$export$cd4e5573fbe2b576() !== ref.current && ref.current) $f192c2f16961cbe0$export$80f3e147d781571c(ref.current);
2382
- } else $b72f3f7b3b5f42c6$export$76e4e37e5339496d(ref.current);
2383
- }
2384
- }, [
2385
- ref,
2386
- key,
2387
- manager.focusedKey,
2388
- manager.childFocusStrategy,
2389
- manager.isFocused,
2390
- shouldUseVirtualFocus
2391
- ]);
2392
- isDisabled = isDisabled || manager.isDisabled(key);
2393
- let itemProps = {};
2394
- if (!shouldUseVirtualFocus && !isDisabled) itemProps = {
2395
- tabIndex: key === manager.focusedKey ? 0 : -1,
2396
- onFocus(e) {
2397
- if ($23f2114a1b82827e$export$e58f029f0fbfdb29(e) === ref.current) manager.setFocusedKey(key);
2398
- }
2399
- };
2400
- else if (isDisabled) itemProps.onMouseDown = (e) => {
2401
- e.preventDefault();
2402
- };
2403
- useEffect(() => {
2404
- if (isDisabled && manager.focusedKey === key) manager.setFocusedKey(null);
2405
- }, [
2406
- manager,
2407
- isDisabled,
2408
- key
2409
- ]);
2410
- let isLinkOverride = manager.isLink(key) && linkBehavior === "override";
2411
- let isActionOverride = onAction && options["UNSTABLE_itemBehavior"] === "action";
2412
- let hasLinkAction = manager.isLink(key) && linkBehavior !== "selection" && linkBehavior !== "none";
2413
- let allowsSelection = !isDisabled && manager.canSelectItem(key) && !isLinkOverride && !isActionOverride;
2414
- let allowsActions = (onAction || hasLinkAction) && !isDisabled;
2415
- let hasPrimaryAction = allowsActions && (manager.selectionBehavior === "replace" ? !allowsSelection : !allowsSelection || manager.isEmpty);
2416
- let hasSecondaryAction = allowsActions && allowsSelection && manager.selectionBehavior === "replace";
2417
- let hasAction = hasPrimaryAction || hasSecondaryAction;
2418
- let modality = useRef(null);
2419
- let longPressEnabled = hasAction && allowsSelection;
2420
- let longPressEnabledOnPressStart = useRef(false);
2421
- let hadPrimaryActionOnPressStart = useRef(false);
2422
- let collectionItemProps = manager.getItemProps(key);
2423
- let performAction = (e) => {
2424
- if (onAction) {
2425
- onAction();
2426
- ref.current?.dispatchEvent(new CustomEvent("react-aria-item-action", {
2427
- bubbles: true
2428
- }));
2429
- }
2430
- if (hasLinkAction && ref.current) router.open(ref.current, e, collectionItemProps.href, collectionItemProps.routerOptions);
2431
- };
2432
- let itemPressProps = {
2433
- ref
2434
- };
2435
- if (shouldSelectOnPressUp) {
2436
- itemPressProps.onPressStart = (e) => {
2437
- modality.current = e.pointerType;
2438
- longPressEnabledOnPressStart.current = longPressEnabled;
2439
- if (e.pointerType === "keyboard" && (!hasAction || $f6ba6936bfd098a0$var$isSelectionKey(e.key))) onSelect(e);
2440
- };
2441
- if (!allowsDifferentPressOrigin)
2442
- itemPressProps.onPress = (e) => {
2443
- if (hasPrimaryAction || hasSecondaryAction && e.pointerType !== "mouse") {
2444
- if (e.pointerType === "keyboard" && !$f6ba6936bfd098a0$var$isActionKey(e.key)) return;
2445
- performAction(e);
2446
- } else if (e.pointerType !== "keyboard" && allowsSelection) onSelect(e);
2447
- };
2448
- else {
2449
- itemPressProps.onPressUp = hasPrimaryAction ? void 0 : (e) => {
2450
- if (e.pointerType === "mouse" && allowsSelection) onSelect(e);
2451
- };
2452
- itemPressProps.onPress = hasPrimaryAction ? performAction : (e) => {
2453
- if (e.pointerType !== "keyboard" && e.pointerType !== "mouse" && allowsSelection) onSelect(e);
2454
- };
2455
- }
2456
- } else {
2457
- itemPressProps.onPressStart = (e) => {
2458
- modality.current = e.pointerType;
2459
- longPressEnabledOnPressStart.current = longPressEnabled;
2460
- hadPrimaryActionOnPressStart.current = hasPrimaryAction;
2461
- if (allowsSelection && (e.pointerType === "mouse" && !hasPrimaryAction || e.pointerType === "keyboard" && (!allowsActions || $f6ba6936bfd098a0$var$isSelectionKey(e.key)))) onSelect(e);
2462
- };
2463
- itemPressProps.onPress = (e) => {
2464
- if (e.pointerType === "touch" || e.pointerType === "pen" || e.pointerType === "virtual" || e.pointerType === "keyboard" && hasAction && $f6ba6936bfd098a0$var$isActionKey(e.key) || e.pointerType === "mouse" && hadPrimaryActionOnPressStart.current) {
2465
- if (hasAction) performAction(e);
2466
- else if (allowsSelection) onSelect(e);
2467
- }
2468
- };
2469
- }
2470
- let collectionId = $22bbea12c2567021$export$6aeb1680a0ae8741(manager.collection);
2471
- itemProps["data-collection"] = collectionId;
2472
- itemProps["data-key"] = key;
2473
- itemPressProps.preventFocusOnPress = shouldUseVirtualFocus;
2474
- if (shouldUseVirtualFocus)
2475
- itemPressProps = $bbaa08b3cd72f041$export$9d1611c77c2fe928(itemPressProps, {
2476
- onPressStart(e) {
2477
- if (e.pointerType !== "touch") {
2478
- manager.setFocused(true);
2479
- manager.setFocusedKey(key);
2480
- }
2481
- },
2482
- onPress(e) {
2483
- if (e.pointerType === "touch") {
2484
- manager.setFocused(true);
2485
- manager.setFocusedKey(key);
2486
- }
2487
- }
2488
- });
2489
- if (collectionItemProps) {
2490
- for (let key2 of [
2491
- "onPressStart",
2492
- "onPressEnd",
2493
- "onPressChange",
2494
- "onPress",
2495
- "onPressUp",
2496
- "onClick"
2497
- ]) if (collectionItemProps[key2])
2498
- itemPressProps[key2] = $a4e76a5424781910$export$e08e3b67e392101e(itemPressProps[key2], collectionItemProps[key2]);
2499
- }
2500
- let { pressProps, isPressed } = $d27d541f9569d26d$export$45712eceda6fad21(itemPressProps);
2501
- let onDoubleClick = hasSecondaryAction ? (e) => {
2502
- if (modality.current === "mouse") {
2503
- e.stopPropagation();
2504
- e.preventDefault();
2505
- performAction(e);
2506
- }
2507
- } : void 0;
2508
- let { longPressProps } = $7b01448eaad0fe7c$export$c24ed0104d07eab9({
2509
- isDisabled: !longPressEnabled,
2510
- onLongPress(e) {
2511
- if (e.pointerType === "touch") {
2512
- onSelect(e);
2513
- manager.setSelectionBehavior("toggle");
2514
- }
2515
- }
2516
- });
2517
- let onDragStartCapture = (e) => {
2518
- if (modality.current === "touch" && longPressEnabledOnPressStart.current) e.preventDefault();
2519
- };
2520
- let onClick = linkBehavior !== "none" && manager.isLink(key) ? (e) => {
2521
- if (!$caaf0dd3060ed57c$export$95185d699e05d4d7.isOpening) e.preventDefault();
2522
- } : void 0;
2523
- let mergedItemProps = $bbaa08b3cd72f041$export$9d1611c77c2fe928(
2524
- // oxlint-disable-next-line react/react-compiler
2525
- itemProps,
2526
- allowsSelection || hasPrimaryAction || shouldUseVirtualFocus && !isDisabled ? pressProps : {},
2527
- longPressEnabled ? longPressProps : {},
2528
- // oxlint-disable-next-line react/react-compiler
2529
- {
2530
- onDoubleClick,
2531
- onDragStartCapture,
2532
- onClick,
2533
- id
2534
- },
2535
- // Prevent DOM focus from moving on mouse down when using virtual focus
2536
- shouldUseVirtualFocus ? {
2537
- onMouseDown: (e) => e.preventDefault()
2538
- } : void 0
2539
- );
2540
- let isChildInteraction = (target) => {
2541
- let el = target;
2542
- while (el && el !== ref.current) {
2543
- let elCollection = el.getAttribute("data-collection");
2544
- if (elCollection != null) return elCollection !== collectionId;
2545
- el = el.parentElement;
2546
- }
2547
- return $3b8b240c1bf84ab9$export$bebd5a1431fec25d(target);
2548
- };
2549
- let baseOnPointerDown = mergedItemProps.onPointerDown;
2550
- mergedItemProps.onPointerDown = (e) => {
2551
- let target = $23f2114a1b82827e$export$e58f029f0fbfdb29(e);
2552
- if (target && target !== ref.current && isChildInteraction(target)) {
2553
- e.stopPropagation();
2554
- return;
2555
- }
2556
- baseOnPointerDown?.(e);
2557
- };
2558
- let baseOnMouseDown = mergedItemProps.onMouseDown;
2559
- mergedItemProps.onMouseDown = (e) => {
2560
- let target = $23f2114a1b82827e$export$e58f029f0fbfdb29(e);
2561
- if (target && target !== ref.current && isChildInteraction(target)) {
2562
- e.stopPropagation();
2563
- return;
2564
- }
2565
- baseOnMouseDown?.(e);
2566
- };
2567
- return {
2568
- itemProps: mergedItemProps,
2569
- isPressed,
2570
- isSelected: manager.isSelected(key),
2571
- isFocused: manager.isFocused && manager.focusedKey === key,
2572
- isDisabled,
2573
- allowsSelection,
2574
- hasAction
2575
- };
2576
- }
2577
- function $f6ba6936bfd098a0$var$isActionKey(key) {
2578
- return key === "Enter";
2579
- }
2580
- function $f6ba6936bfd098a0$var$isSelectionKey(key) {
2581
- return key === " ";
2582
- }
2583
- function $cd5ea4b915021f1d$export$1005530eda016c13(node, collection) {
2584
- if (typeof collection.getChildren === "function") return collection.getChildren(node.key);
2585
- return node.childNodes;
2586
- }
2587
- function $cd5ea4b915021f1d$export$fbdeaa6a76694f71(iterable) {
2588
- return $cd5ea4b915021f1d$export$5f3398f8733f90e2(iterable, 0);
2589
- }
2590
- function $cd5ea4b915021f1d$export$5f3398f8733f90e2(iterable, index) {
2591
- if (index < 0) return void 0;
2592
- let i = 0;
2593
- for (let item of iterable) {
2594
- if (i === index) return item;
2595
- i++;
2596
- }
2597
- }
2598
- function $cd5ea4b915021f1d$export$7475b2c64539e4cf(iterable) {
2599
- let lastItem = void 0;
2600
- for (let value of iterable) lastItem = value;
2601
- return lastItem;
2602
- }
2603
- function $cd5ea4b915021f1d$export$8c434b3a7a4dad6(collection, a, b) {
2604
- if (a.parentKey === b.parentKey) return a.index - b.index;
2605
- let aAncestors = [
2606
- ...$cd5ea4b915021f1d$var$getAncestors(collection, a),
2607
- a
2608
- ];
2609
- let bAncestors = [
2610
- ...$cd5ea4b915021f1d$var$getAncestors(collection, b),
2611
- b
2612
- ];
2613
- let firstNonMatchingAncestor = aAncestors.slice(0, bAncestors.length).findIndex((a2, i) => a2 !== bAncestors[i]);
2614
- if (firstNonMatchingAncestor !== -1) {
2615
- a = aAncestors[firstNonMatchingAncestor];
2616
- b = bAncestors[firstNonMatchingAncestor];
2617
- return a.index - b.index;
2618
- }
2619
- if (aAncestors.findIndex((node) => node === b) >= 0) return 1;
2620
- else if (bAncestors.findIndex((node) => node === a) >= 0) return -1;
2621
- return -1;
2622
- }
2623
- function $cd5ea4b915021f1d$var$getAncestors(collection, node) {
2624
- let parents = [];
2625
- let currNode = node;
2626
- while (currNode?.parentKey != null) {
2627
- currNode = collection.getItem(currNode.parentKey);
2628
- if (currNode) parents.unshift(currNode);
2629
- }
2630
- return parents;
2631
- }
2632
- function $b24d1bc31a0f941d$export$a9d04c5684123369(value) {
2633
- const pieces = version.split(".");
2634
- const major = parseInt(pieces[0], 10);
2635
- if (major >= 19) return value;
2636
- return value ? "true" : void 0;
2637
- }
2638
- class $8b2540e09867b15e$export$52baac22726c72bf extends Set {
2639
- constructor(keys, anchorKey, currentKey) {
2640
- super(keys);
2641
- if (keys instanceof $8b2540e09867b15e$export$52baac22726c72bf) {
2642
- this.anchorKey = anchorKey ?? keys.anchorKey;
2643
- this.currentKey = currentKey ?? keys.currentKey;
2644
- } else {
2645
- this.anchorKey = anchorKey ?? null;
2646
- this.currentKey = currentKey ?? null;
2647
- }
2648
- }
2649
- }
2650
- function $60f19cefd567a3e4$var$equalSets(setA, setB) {
2651
- if (setA.size !== setB.size) return false;
2652
- for (let item of setA) {
2653
- if (!setB.has(item)) return false;
2654
- }
2655
- return true;
2656
- }
2657
- function $60f19cefd567a3e4$export$253fe78d46329472(props) {
2658
- let { selectionMode = "none", disallowEmptySelection = false, allowDuplicateSelectionEvents, selectionBehavior: selectionBehaviorProp = "toggle", disabledBehavior = "all" } = props;
2659
- let isFocusedRef = useRef(false);
2660
- let [, setFocused] = useState(false);
2661
- let focusedKeyRef = useRef(null);
2662
- let childFocusStrategyRef = useRef(null);
2663
- let [, setFocusedKey] = useState(null);
2664
- let selectedKeysProp = useMemo(() => $60f19cefd567a3e4$var$convertSelection(props.selectedKeys), [
2665
- props.selectedKeys
2666
- ]);
2667
- let defaultSelectedKeys = useMemo(() => $60f19cefd567a3e4$var$convertSelection(props.defaultSelectedKeys, new $8b2540e09867b15e$export$52baac22726c72bf()), [
2668
- props.defaultSelectedKeys
2669
- ]);
2670
- let [selectedKeys, setSelectedKeys] = $3e6197669829fe11$export$40bfa8c7b0832715(selectedKeysProp, defaultSelectedKeys, props.onSelectionChange);
2671
- let disabledKeysProp = useMemo(() => props.disabledKeys ? new Set(props.disabledKeys) : /* @__PURE__ */ new Set(), [
2672
- props.disabledKeys
2673
- ]);
2674
- let [selectionBehavior, setSelectionBehavior] = useState(selectionBehaviorProp);
2675
- if (selectionBehaviorProp === "replace" && selectionBehavior === "toggle" && typeof selectedKeys === "object" && selectedKeys.size === 0) setSelectionBehavior("replace");
2676
- let lastSelectionBehavior = useRef(selectionBehaviorProp);
2677
- useEffect(() => {
2678
- if (selectionBehaviorProp !== lastSelectionBehavior.current) {
2679
- setSelectionBehavior(selectionBehaviorProp);
2680
- lastSelectionBehavior.current = selectionBehaviorProp;
2681
- }
2682
- }, [
2683
- selectionBehaviorProp
2684
- ]);
2685
- return {
2686
- selectionMode,
2687
- disallowEmptySelection,
2688
- selectionBehavior,
2689
- setSelectionBehavior,
2690
- get isFocused() {
2691
- return isFocusedRef.current;
2692
- },
2693
- setFocused(f) {
2694
- isFocusedRef.current = f;
2695
- setFocused(f);
2696
- },
2697
- get focusedKey() {
2698
- return focusedKeyRef.current;
2699
- },
2700
- get childFocusStrategy() {
2701
- return childFocusStrategyRef.current;
2702
- },
2703
- setFocusedKey(k, childFocusStrategy = "first") {
2704
- focusedKeyRef.current = k;
2705
- childFocusStrategyRef.current = childFocusStrategy;
2706
- setFocusedKey(k);
2707
- },
2708
- selectedKeys,
2709
- setSelectedKeys(keys) {
2710
- if (allowDuplicateSelectionEvents || !$60f19cefd567a3e4$var$equalSets(keys, selectedKeys)) setSelectedKeys(keys);
2711
- },
2712
- disabledKeys: disabledKeysProp,
2713
- disabledBehavior
2714
- };
2715
- }
2716
- function $60f19cefd567a3e4$var$convertSelection(selection, defaultValue) {
2717
- if (!selection) return defaultValue;
2718
- return selection === "all" ? "all" : new $8b2540e09867b15e$export$52baac22726c72bf(selection);
2719
- }
2720
- class $4a07ac835f260f78$export$6c8a5aaad13c9852 {
2721
- constructor(collection, state, options) {
2722
- this.collection = collection;
2723
- this.state = state;
2724
- this.allowsCellSelection = options?.allowsCellSelection ?? false;
2725
- this._isSelectAll = null;
2726
- this.layoutDelegate = options?.layoutDelegate || null;
2727
- this.fullCollection = options?.fullCollection || null;
2728
- }
2729
- /**
2730
- * The type of selection that is allowed in the collection.
2731
- */
2732
- get selectionMode() {
2733
- return this.state.selectionMode;
2734
- }
2735
- /**
2736
- * Whether the collection allows empty selection.
2737
- */
2738
- get disallowEmptySelection() {
2739
- return this.state.disallowEmptySelection;
2740
- }
2741
- /**
2742
- * The selection behavior for the collection.
2743
- */
2744
- get selectionBehavior() {
2745
- return this.state.selectionBehavior;
2746
- }
2747
- /**
2748
- * Sets the selection behavior for the collection.
2749
- */
2750
- setSelectionBehavior(selectionBehavior) {
2751
- this.state.setSelectionBehavior(selectionBehavior);
2752
- }
2753
- /**
2754
- * Whether the collection is currently focused.
2755
- */
2756
- get isFocused() {
2757
- return this.state.isFocused;
2758
- }
2759
- /**
2760
- * Sets whether the collection is focused.
2761
- */
2762
- setFocused(isFocused) {
2763
- this.state.setFocused(isFocused);
2764
- }
2765
- /**
2766
- * The current focused key in the collection.
2767
- */
2768
- get focusedKey() {
2769
- return this.state.focusedKey;
2770
- }
2771
- /** Whether the first or last child of the focused key should receive focus. */
2772
- get childFocusStrategy() {
2773
- return this.state.childFocusStrategy;
2774
- }
2775
- /**
2776
- * Sets the focused key.
2777
- */
2778
- setFocusedKey(key, childFocusStrategy) {
2779
- if (key == null || this.collection.getItem(key)) this.state.setFocusedKey(key, childFocusStrategy);
2780
- }
2781
- /**
2782
- * The currently selected keys in the collection.
2783
- */
2784
- get selectedKeys() {
2785
- return this.state.selectedKeys === "all" ? new Set(this.getSelectAllKeys()) : this.state.selectedKeys;
2786
- }
2787
- /**
2788
- * The raw selection value for the collection.
2789
- * Either 'all' for select all, or a set of keys.
2790
- */
2791
- get rawSelection() {
2792
- return this.state.selectedKeys;
2793
- }
2794
- /**
2795
- * Returns whether a key is selected.
2796
- */
2797
- isSelected(key) {
2798
- if (this.state.selectionMode === "none") return false;
2799
- let mappedKey = this.getKey(key);
2800
- if (mappedKey == null) return false;
2801
- return this.state.selectedKeys === "all" ? this.canSelectItem(mappedKey) : this.state.selectedKeys.has(mappedKey);
2802
- }
2803
- /**
2804
- * Whether the selection is empty.
2805
- */
2806
- get isEmpty() {
2807
- return this.state.selectedKeys !== "all" && this.state.selectedKeys.size === 0;
2808
- }
2809
- /**
2810
- * Whether all items in the collection are selected.
2811
- */
2812
- get isSelectAll() {
2813
- if (this.isEmpty) return false;
2814
- if (this.state.selectedKeys === "all") return true;
2815
- if (this._isSelectAll != null) return this._isSelectAll;
2816
- let allKeys = this.getSelectAllKeys();
2817
- let selectedKeys = this.state.selectedKeys;
2818
- this._isSelectAll = allKeys.every((k) => selectedKeys.has(k));
2819
- return this._isSelectAll;
2820
- }
2821
- get firstSelectedKey() {
2822
- let first = null;
2823
- for (let key of this.state.selectedKeys) {
2824
- let item = this.collection.getItem(key);
2825
- if (!first || item && $cd5ea4b915021f1d$export$8c434b3a7a4dad6(this.collection, item, first) < 0) first = item;
2826
- }
2827
- return first?.key ?? null;
2828
- }
2829
- get lastSelectedKey() {
2830
- let last = null;
2831
- for (let key of this.state.selectedKeys) {
2832
- let item = this.collection.getItem(key);
2833
- if (!last || item && $cd5ea4b915021f1d$export$8c434b3a7a4dad6(this.collection, item, last) > 0) last = item;
2834
- }
2835
- return last?.key ?? null;
2836
- }
2837
- get disabledKeys() {
2838
- return this.state.disabledKeys;
2839
- }
2840
- get disabledBehavior() {
2841
- return this.state.disabledBehavior;
534
+ x: container?.scrollLeft ?? 0,
535
+ y: container?.scrollTop ?? 0,
536
+ width: container?.clientWidth ?? 0,
537
+ height: container?.clientHeight ?? 0
538
+ };
2842
539
  }
2843
- /**
2844
- * Extends the selection to the given key.
2845
- */
2846
- extendSelection(toKey) {
2847
- if (this.selectionMode === "none") return;
2848
- if (this.selectionMode === "single") {
2849
- this.replaceSelection(toKey);
2850
- return;
2851
- }
2852
- let mappedToKey = this.getKey(toKey);
2853
- if (mappedToKey == null) return;
2854
- let selection;
2855
- if (this.state.selectedKeys === "all") selection = new $8b2540e09867b15e$export$52baac22726c72bf([
2856
- mappedToKey
2857
- ], mappedToKey, mappedToKey);
2858
- else {
2859
- let selectedKeys = this.state.selectedKeys;
2860
- let anchorKey = selectedKeys.anchorKey ?? mappedToKey;
2861
- selection = new $8b2540e09867b15e$export$52baac22726c72bf(selectedKeys, anchorKey, mappedToKey);
2862
- for (let key of this.getKeyRange(anchorKey, selectedKeys.currentKey ?? mappedToKey)) selection.delete(key);
2863
- for (let key of this.getKeyRange(mappedToKey, anchorKey)) if (this.canSelectItem(key)) selection.add(key);
2864
- }
2865
- this.state.setSelectedKeys(selection);
2866
- }
2867
- getKeyRange(from, to) {
2868
- let fromItem = this.collection.getItem(from);
2869
- let toItem = this.collection.getItem(to);
2870
- if (fromItem && toItem) {
2871
- if ($cd5ea4b915021f1d$export$8c434b3a7a4dad6(this.collection, fromItem, toItem) <= 0) return this.getKeyRangeInternal(from, to);
2872
- return this.getKeyRangeInternal(to, from);
540
+ }
541
+ class $ae8f8d98b2b18f2f$export$a05409b8bb224a5a {
542
+ constructor(...args) {
543
+ if (args.length === 1) {
544
+ let opts = args[0];
545
+ this.collection = opts.collection;
546
+ this.ref = opts.ref;
547
+ this.collator = opts.collator;
548
+ this.disabledKeys = opts.disabledKeys || /* @__PURE__ */ new Set();
549
+ this.disabledBehavior = opts.disabledBehavior || "all";
550
+ this.orientation = opts.orientation || "vertical";
551
+ this.direction = opts.direction;
552
+ this.layout = opts.layout || "stack";
553
+ this.layoutDelegate = opts.layoutDelegate || new $a83747cc3f035330$export$8f5ed9ff9f511381(opts.ref);
554
+ } else {
555
+ this.collection = args[0];
556
+ this.disabledKeys = args[1];
557
+ this.ref = args[2];
558
+ this.collator = args[3];
559
+ this.layout = "stack";
560
+ this.orientation = "vertical";
561
+ this.disabledBehavior = "all";
562
+ this.layoutDelegate = new $a83747cc3f035330$export$8f5ed9ff9f511381(this.ref);
2873
563
  }
2874
- return [];
2875
- }
2876
- getKeyRangeInternal(from, to) {
2877
- if (this.layoutDelegate?.getKeyRange) return this.layoutDelegate.getKeyRange(from, to);
2878
- let keys = [];
2879
- let key = from;
2880
- while (key != null) {
2881
- let item = this.collection.getItem(key);
2882
- if (item && (item.type === "item" || item.type === "cell" && this.allowsCellSelection)) keys.push(key);
2883
- if (key === to) return keys;
2884
- key = this.collection.getKeyAfter(key);
564
+ if (this.layout === "stack" && this.orientation === "vertical") {
565
+ this.getKeyLeftOf = void 0;
566
+ this.getKeyRightOf = void 0;
2885
567
  }
2886
- return [];
2887
568
  }
2888
- getKey(key) {
2889
- let item = this.collection.getItem(key);
2890
- if (!item)
2891
- return key;
2892
- if (item.type === "cell" && this.allowsCellSelection) return key;
2893
- while (item && item.type !== "item" && item.parentKey != null) item = this.collection.getItem(item.parentKey);
2894
- if (!item || item.type !== "item") return null;
2895
- return item.key;
569
+ isDisabled(item) {
570
+ return this.disabledBehavior === "all" && (item.props?.isDisabled || this.disabledKeys.has(item.key)) && item.props?.disabledBehavior !== "selection";
2896
571
  }
2897
- /**
2898
- * Toggles whether the given key is selected.
2899
- */
2900
- toggleSelection(key) {
2901
- if (this.selectionMode === "none") return;
2902
- if (this.selectionMode === "single" && !this.isSelected(key)) {
2903
- this.replaceSelection(key);
2904
- return;
2905
- }
2906
- let mappedKey = this.getKey(key);
2907
- if (mappedKey == null) return;
2908
- let keys = new $8b2540e09867b15e$export$52baac22726c72bf(this.state.selectedKeys === "all" ? this.getSelectAllKeys() : this.state.selectedKeys);
2909
- if (keys.has(mappedKey)) keys.delete(mappedKey);
2910
- else if (this.canSelectItem(mappedKey)) {
2911
- keys.add(mappedKey);
2912
- keys.anchorKey = mappedKey;
2913
- keys.currentKey = mappedKey;
572
+ findNextNonDisabled(key, getNext, includeDisabled = false) {
573
+ let nextKey = key;
574
+ while (nextKey != null) {
575
+ let item = this.collection.getItem(nextKey);
576
+ if (item?.type === "item" && (includeDisabled || !this.isDisabled(item))) return nextKey;
577
+ nextKey = getNext(nextKey);
2914
578
  }
2915
- if (this.disallowEmptySelection && keys.size === 0) return;
2916
- this.state.setSelectedKeys(keys);
579
+ return null;
2917
580
  }
2918
- /**
2919
- * Replaces the selection with only the given key.
2920
- */
2921
- replaceSelection(key) {
2922
- if (this.selectionMode === "none") return;
2923
- let mappedKey = this.getKey(key);
2924
- if (mappedKey == null) return;
2925
- let selection = this.canSelectItem(mappedKey) ? new $8b2540e09867b15e$export$52baac22726c72bf([
2926
- mappedKey
2927
- ], mappedKey, mappedKey) : new $8b2540e09867b15e$export$52baac22726c72bf();
2928
- this.state.setSelectedKeys(selection);
581
+ getNextKey(key, options) {
582
+ let nextKey = key;
583
+ nextKey = this.collection.getKeyAfter(nextKey);
584
+ return this.findNextNonDisabled(nextKey, (key2) => this.collection.getKeyAfter(key2), options?.includeDisabled);
2929
585
  }
2930
- /**
2931
- * Replaces the selection with the given keys.
2932
- */
2933
- setSelectedKeys(keys) {
2934
- if (this.selectionMode === "none") return;
2935
- let selection = new $8b2540e09867b15e$export$52baac22726c72bf();
2936
- for (let key of keys) {
2937
- let mappedKey = this.getKey(key);
2938
- if (mappedKey != null) {
2939
- selection.add(mappedKey);
2940
- if (this.selectionMode === "single") break;
2941
- }
2942
- }
2943
- this.state.setSelectedKeys(selection);
2944
- }
2945
- getSelectAllKeys() {
2946
- let collection = this.fullCollection ?? this.collection;
2947
- let keys = [];
2948
- let addKeys = (key) => {
2949
- while (key != null) {
2950
- if (this.canSelectItemIn(key, collection)) {
2951
- let item = collection.getItem(key);
2952
- if (item?.type === "item") keys.push(key);
2953
- if (item?.hasChildNodes && (this.allowsCellSelection || item.type !== "item")) addKeys($cd5ea4b915021f1d$export$fbdeaa6a76694f71($cd5ea4b915021f1d$export$1005530eda016c13(item, collection))?.key ?? null);
2954
- }
2955
- key = collection.getKeyAfter(key);
2956
- }
2957
- };
2958
- addKeys(collection.getFirstKey());
2959
- return keys;
586
+ getPreviousKey(key, options) {
587
+ let nextKey = key;
588
+ nextKey = this.collection.getKeyBefore(nextKey);
589
+ return this.findNextNonDisabled(nextKey, (key2) => this.collection.getKeyBefore(key2), options?.includeDisabled);
2960
590
  }
2961
- /**
2962
- * Selects all items in the collection.
2963
- */
2964
- selectAll() {
2965
- if (!this.isSelectAll && this.selectionMode === "multiple") this.state.setSelectedKeys("all");
591
+ findKey(key, nextKey, shouldSkip) {
592
+ let tempKey = key;
593
+ let itemRect = this.layoutDelegate.getItemRect(tempKey);
594
+ if (!itemRect || tempKey == null) return null;
595
+ let prevRect = itemRect;
596
+ do {
597
+ tempKey = nextKey(tempKey);
598
+ if (tempKey == null) break;
599
+ itemRect = this.layoutDelegate.getItemRect(tempKey);
600
+ } while (itemRect && shouldSkip(prevRect, itemRect) && tempKey != null);
601
+ return tempKey;
2966
602
  }
2967
- /**
2968
- * Removes all keys from the selection.
2969
- */
2970
- clearSelection() {
2971
- if (!this.disallowEmptySelection && (this.state.selectedKeys === "all" || this.state.selectedKeys.size > 0)) this.state.setSelectedKeys(new $8b2540e09867b15e$export$52baac22726c72bf());
603
+ isSameRow(prevRect, itemRect) {
604
+ return prevRect.y === itemRect.y || prevRect.x !== itemRect.x;
2972
605
  }
2973
- /**
2974
- * Toggles between select all and an empty selection.
2975
- */
2976
- toggleSelectAll() {
2977
- if (this.isSelectAll) this.clearSelection();
2978
- else this.selectAll();
2979
- }
2980
- select(key, e) {
2981
- if (this.selectionMode === "none") return;
2982
- if (this.selectionMode === "single") {
2983
- if (this.isSelected(key) && !this.disallowEmptySelection) this.toggleSelection(key);
2984
- else this.replaceSelection(key);
2985
- } else if (this.selectionBehavior === "toggle" || e && (e.pointerType === "touch" || e.pointerType === "virtual"))
2986
- this.toggleSelection(key);
2987
- else this.replaceSelection(key);
606
+ isSameColumn(prevRect, itemRect) {
607
+ return prevRect.x === itemRect.x || prevRect.y !== itemRect.y;
2988
608
  }
2989
- /**
2990
- * Returns whether the current selection is equal to the given selection.
2991
- */
2992
- isSelectionEqual(selection) {
2993
- if (selection === this.state.selectedKeys) return true;
2994
- let selectedKeys = this.selectedKeys;
2995
- if (selection.size !== selectedKeys.size) return false;
2996
- for (let key of selection) {
2997
- if (!selectedKeys.has(key)) return false;
609
+ // checks to see if the next/prev key is spatially above/below the current key. If not, that means we are in
610
+ // a reversed column layout and need to adjust appropriately
611
+ // TODO: still need to see how this works with virtualizer once there is handling for the reverse layout
612
+ // this felt like a simpler approach then changing getKeyAbove/Below to be purely spatial calculations
613
+ isReversed(key) {
614
+ let nextKey = this.getNextKey(key);
615
+ let currentEl = $22bbea12c2567021$export$c3d8340acf92597f(this.ref, key);
616
+ if (nextKey != null) {
617
+ let nextEl = $22bbea12c2567021$export$c3d8340acf92597f(this.ref, nextKey);
618
+ if (!currentEl || !nextEl) return false;
619
+ return currentEl.getBoundingClientRect().top > nextEl.getBoundingClientRect().top;
2998
620
  }
2999
- for (let key of selectedKeys) {
3000
- if (!selection.has(key)) return false;
621
+ let prevKey = this.getPreviousKey(key);
622
+ if (prevKey != null) {
623
+ let prevEl = $22bbea12c2567021$export$c3d8340acf92597f(this.ref, prevKey);
624
+ if (!currentEl || !prevEl) return false;
625
+ return prevEl.getBoundingClientRect().top > currentEl.getBoundingClientRect().top;
3001
626
  }
3002
- return true;
627
+ return false;
3003
628
  }
3004
- canSelectItem(key) {
3005
- return this.canSelectItemIn(key, this.collection);
629
+ getKeyBelow(key, options) {
630
+ if (this.layout === "grid" && this.orientation === "vertical") return this.findKey(key, (key2) => this.getNextKey(key2, options), this.isSameRow);
631
+ else if (this.orientation === "vertical") return this.isReversed(key) ? this.getPreviousKey(key, options) : this.getNextKey(key, options);
632
+ else return this.getNextKey(key, options);
633
+ }
634
+ getKeyAbove(key, options) {
635
+ if (this.layout === "grid" && this.orientation === "vertical") return this.findKey(key, (key2) => this.getPreviousKey(key2, options), this.isSameRow);
636
+ else if (this.orientation === "vertical") return this.isReversed(key) ? this.getNextKey(key, options) : this.getPreviousKey(key, options);
637
+ else return this.getPreviousKey(key, options);
3006
638
  }
3007
- canSelectItemIn(key, collection) {
3008
- if (this.state.selectionMode === "none" || this.state.disabledKeys.has(key)) return false;
3009
- let item = collection.getItem(key);
3010
- if (!item || item?.props?.isDisabled || item.type === "cell" && !this.allowsCellSelection) return false;
3011
- return true;
639
+ getNextColumn(key, right, options) {
640
+ return right ? this.getPreviousKey(key, options) : this.getNextKey(key, options);
3012
641
  }
3013
- isDisabled(key) {
3014
- let item = this.collection.getItem(key);
3015
- return this.state.disabledBehavior === "all" && (this.state.disabledKeys.has(key) || !!item?.props?.isDisabled) && item?.props?.disabledBehavior !== "selection";
642
+ getKeyRightOf(key, options) {
643
+ let layoutDelegateMethod = this.direction === "ltr" ? "getKeyRightOf" : "getKeyLeftOf";
644
+ if (this.layoutDelegate[layoutDelegateMethod]) {
645
+ key = this.layoutDelegate[layoutDelegateMethod](key);
646
+ return this.findNextNonDisabled(key, (key2) => this.layoutDelegate[layoutDelegateMethod](key2), options?.includeDisabled);
647
+ }
648
+ if (this.layout === "grid") {
649
+ if (this.orientation === "vertical") return this.getNextColumn(key, this.direction === "rtl", options);
650
+ else return this.findKey(key, (key2) => this.getNextColumn(key2, this.direction === "rtl", options), this.isSameColumn);
651
+ } else if (this.orientation === "horizontal") return this.getNextColumn(key, this.direction === "rtl", options);
652
+ return null;
3016
653
  }
3017
- isLink(key) {
3018
- return !!this.collection.getItem(key)?.props?.href;
654
+ getKeyLeftOf(key, options) {
655
+ let layoutDelegateMethod = this.direction === "ltr" ? "getKeyLeftOf" : "getKeyRightOf";
656
+ if (this.layoutDelegate[layoutDelegateMethod]) {
657
+ key = this.layoutDelegate[layoutDelegateMethod](key);
658
+ return this.findNextNonDisabled(key, (key2) => this.layoutDelegate[layoutDelegateMethod](key2), options?.includeDisabled);
659
+ }
660
+ if (this.layout === "grid") {
661
+ if (this.orientation === "vertical") return this.getNextColumn(key, this.direction === "ltr", options);
662
+ else return this.findKey(key, (key2) => this.getNextColumn(key2, this.direction === "ltr", options), this.isSameColumn);
663
+ } else if (this.orientation === "horizontal") return this.getNextColumn(key, this.direction === "ltr", options);
664
+ return null;
3019
665
  }
3020
- getItemProps(key) {
3021
- return this.collection.getItem(key)?.props;
666
+ getFirstKey() {
667
+ let key = this.collection.getFirstKey();
668
+ return this.findNextNonDisabled(key, (key2) => this.collection.getKeyAfter(key2));
3022
669
  }
3023
- withCollection(collection) {
3024
- return new $4a07ac835f260f78$export$6c8a5aaad13c9852(collection, this.state, {
3025
- allowsCellSelection: this.allowsCellSelection,
3026
- layoutDelegate: this.layoutDelegate || void 0,
3027
- fullCollection: this.fullCollection ?? this.collection
3028
- });
670
+ getLastKey() {
671
+ let key = this.collection.getLastKey();
672
+ return this.findNextNonDisabled(key, (key2) => this.collection.getKeyBefore(key2));
3029
673
  }
3030
- }
3031
- class $bda7a7e55e1ff206$export$bf788dd355e3a401 {
3032
- build(props, context) {
3033
- this.context = context;
3034
- return $bda7a7e55e1ff206$var$iterable(() => this.iterateCollection(props));
3035
- }
3036
- *iterateCollection(props) {
3037
- let { children, items } = props;
3038
- if (React__default.isValidElement(children) && children.type === React__default.Fragment) yield* this.iterateCollection({
3039
- children: children.props.children,
3040
- items
3041
- });
3042
- else if (typeof children === "function") {
3043
- if (!items) throw new Error("props.children was a function but props.items is missing");
3044
- let index = 0;
3045
- for (let item of items) {
3046
- yield* this.getFullNode({
3047
- value: item,
3048
- index
3049
- }, {
3050
- renderer: children
3051
- });
3052
- index++;
674
+ getKeyPageAbove(key) {
675
+ let menu = this.ref.current;
676
+ let itemRect = this.layoutDelegate.getItemRect(key);
677
+ if (!itemRect) return null;
678
+ let reversed = this.isReversed(key);
679
+ if (menu && !$901761b40e390936$export$2bb74740c4e19def(menu)) return this.getFirstKey();
680
+ let nextKey = key;
681
+ if (this.orientation === "horizontal") {
682
+ let pageX = Math.max(0, itemRect.x + itemRect.width - this.layoutDelegate.getVisibleRect().width);
683
+ while (itemRect && itemRect.x > pageX && nextKey != null) {
684
+ nextKey = this.getKeyAbove(nextKey);
685
+ itemRect = nextKey == null ? null : this.layoutDelegate.getItemRect(nextKey);
3053
686
  }
3054
687
  } else {
3055
- let items2 = [];
3056
- React__default.Children.forEach(children, (child) => {
3057
- if (child) items2.push(child);
3058
- });
3059
- let index = 0;
3060
- for (let item of items2) {
3061
- let nodes = this.getFullNode({
3062
- element: item,
3063
- index
3064
- }, {});
3065
- for (let node of nodes) {
3066
- index++;
3067
- yield node;
3068
- }
688
+ let visibleRect = this.layoutDelegate.getVisibleRect();
689
+ let pageY = reversed ? itemRect.y - visibleRect.height : Math.max(0, itemRect.y + itemRect.height - visibleRect.height);
690
+ while (itemRect && itemRect.y > pageY && nextKey != null) {
691
+ nextKey = this.getKeyAbove(nextKey);
692
+ itemRect = nextKey == null ? null : this.layoutDelegate.getItemRect(nextKey);
3069
693
  }
3070
694
  }
695
+ return nextKey ?? (reversed ? this.getLastKey() : this.getFirstKey());
3071
696
  }
3072
- getKey(item, partialNode, state, parentKey) {
3073
- if (item.key != null) return item.key;
3074
- if (partialNode.type === "cell" && partialNode.key != null) return `${parentKey}${partialNode.key}`;
3075
- let v = partialNode.value;
3076
- if (v != null) {
3077
- let key = v.key ?? v.id;
3078
- if (key == null) throw new Error("No key found for item");
3079
- return key;
3080
- }
3081
- return parentKey ? `${parentKey}.${partialNode.index}` : `$.${partialNode.index}`;
3082
- }
3083
- getChildState(state, partialNode) {
3084
- return {
3085
- renderer: partialNode.renderer || state.renderer
3086
- };
3087
- }
3088
- *getFullNode(partialNode, state, parentKey, parentNode) {
3089
- if (React__default.isValidElement(partialNode.element) && partialNode.element.type === React__default.Fragment) {
3090
- let children = [];
3091
- React__default.Children.forEach(partialNode.element.props.children, (child) => {
3092
- children.push(child);
3093
- });
3094
- let index = partialNode.index ?? 0;
3095
- for (const child of children) yield* this.getFullNode({
3096
- element: child,
3097
- index: index++
3098
- }, state, parentKey, parentNode);
3099
- return;
3100
- }
3101
- let element = partialNode.element;
3102
- if (!element && partialNode.value && state && state.renderer) {
3103
- let cached = this.cache.get(partialNode.value);
3104
- if (cached && (!cached.shouldInvalidate || !cached.shouldInvalidate(this.context))) {
3105
- cached.index = partialNode.index;
3106
- cached.parentKey = parentNode ? parentNode.key : null;
3107
- yield cached;
3108
- return;
3109
- }
3110
- element = state.renderer(partialNode.value);
3111
- }
3112
- if (React__default.isValidElement(element)) {
3113
- let type = element.type;
3114
- if (typeof type !== "function" && typeof type.getCollectionNode !== "function") {
3115
- let name = element.type;
3116
- throw new Error(`Unknown element <${name}> in collection.`);
697
+ getKeyPageBelow(key) {
698
+ let menu = this.ref.current;
699
+ let itemRect = this.layoutDelegate.getItemRect(key);
700
+ if (!itemRect) return null;
701
+ let reversed = this.isReversed(key);
702
+ if (menu && !$901761b40e390936$export$2bb74740c4e19def(menu)) return this.getLastKey();
703
+ let nextKey = key;
704
+ if (this.orientation === "horizontal") {
705
+ let pageX = Math.min(this.layoutDelegate.getContentSize().width, itemRect.x - itemRect.width + this.layoutDelegate.getVisibleRect().width);
706
+ while (itemRect && itemRect.x < pageX && nextKey != null) {
707
+ nextKey = this.getKeyBelow(nextKey);
708
+ itemRect = nextKey == null ? null : this.layoutDelegate.getItemRect(nextKey);
3117
709
  }
3118
- let childNodes = type.getCollectionNode(element.props, this.context);
3119
- let index = partialNode.index ?? 0;
3120
- let result = childNodes.next();
3121
- while (!result.done && result.value) {
3122
- let childNode = result.value;
3123
- partialNode.index = index;
3124
- let nodeKey = childNode.key ?? null;
3125
- if (nodeKey == null) nodeKey = childNode.element ? null : this.getKey(element, partialNode, state, parentKey);
3126
- let nodes = this.getFullNode({
3127
- ...childNode,
3128
- key: nodeKey,
3129
- index,
3130
- wrapper: $bda7a7e55e1ff206$var$compose(partialNode.wrapper, childNode.wrapper)
3131
- }, this.getChildState(state, childNode), parentKey ? `${parentKey}${element.key}` : element.key, parentNode);
3132
- let children = [
3133
- ...nodes
3134
- ];
3135
- for (let node2 of children) {
3136
- node2.value = childNode.value ?? partialNode.value ?? null;
3137
- if (node2.value) this.cache.set(node2.value, node2);
3138
- if (partialNode.type && node2.type !== partialNode.type) throw new Error(`Unsupported type <${$bda7a7e55e1ff206$var$capitalize(node2.type)}> in <${$bda7a7e55e1ff206$var$capitalize(parentNode?.type ?? "unknown parent type")}>. Only <${$bda7a7e55e1ff206$var$capitalize(partialNode.type)}> is supported.`);
3139
- index++;
3140
- yield node2;
3141
- }
3142
- result = childNodes.next(children);
710
+ } else {
711
+ let pageY = Math.min(this.layoutDelegate.getContentSize().height, itemRect.y - itemRect.height + this.layoutDelegate.getVisibleRect().height);
712
+ while (itemRect && itemRect.y < pageY && nextKey != null) {
713
+ nextKey = this.getKeyBelow(nextKey);
714
+ itemRect = nextKey == null ? null : this.layoutDelegate.getItemRect(nextKey);
3143
715
  }
3144
- return;
3145
716
  }
3146
- if (partialNode.key == null || partialNode.type == null) return;
3147
- let builder = this;
3148
- let node = {
3149
- type: partialNode.type,
3150
- props: partialNode.props,
3151
- key: partialNode.key,
3152
- parentKey: parentNode ? parentNode.key : null,
3153
- value: partialNode.value ?? null,
3154
- level: (parentNode?.level ?? 0) + (parentNode?.type === "item" ? 1 : 0),
3155
- index: partialNode.index,
3156
- rendered: partialNode.rendered,
3157
- textValue: partialNode.textValue ?? "",
3158
- "aria-label": partialNode["aria-label"],
3159
- wrapper: partialNode.wrapper,
3160
- shouldInvalidate: partialNode.shouldInvalidate,
3161
- hasChildNodes: partialNode.hasChildNodes || false,
3162
- childNodes: $bda7a7e55e1ff206$var$iterable(function* () {
3163
- if (!partialNode.hasChildNodes || !partialNode.childNodes) return;
3164
- let index = 0;
3165
- for (let child of partialNode.childNodes()) {
3166
- if (child.key != null)
3167
- child.key = `${node.key}${child.key}`;
3168
- let nodes = builder.getFullNode({
3169
- ...child,
3170
- index
3171
- }, builder.getChildState(state, child), node.key, node);
3172
- for (let node2 of nodes) {
3173
- index++;
3174
- yield node2;
3175
- }
3176
- }
3177
- })
3178
- };
3179
- yield node;
3180
- }
3181
- constructor() {
3182
- this.cache = /* @__PURE__ */ new WeakMap();
717
+ return nextKey ?? (reversed ? this.getFirstKey() : this.getLastKey());
3183
718
  }
3184
- }
3185
- function $bda7a7e55e1ff206$var$iterable(iterator) {
3186
- let cache = [];
3187
- let iterable = null;
3188
- return {
3189
- *[Symbol.iterator]() {
3190
- for (let item of cache) yield item;
3191
- if (!iterable) iterable = iterator();
3192
- for (let item of iterable) {
3193
- cache.push(item);
3194
- yield item;
3195
- }
719
+ getKeyForSearch(search, fromKey) {
720
+ if (!this.collator) return null;
721
+ let collection = this.collection;
722
+ let key = fromKey || this.getFirstKey();
723
+ while (key != null) {
724
+ let item = collection.getItem(key);
725
+ if (!item) return null;
726
+ let substring = item.textValue.slice(0, search.length);
727
+ if (item.textValue && this.collator.compare(substring, search) === 0) return key;
728
+ key = this.getNextKey(key);
3196
729
  }
3197
- };
3198
- }
3199
- function $bda7a7e55e1ff206$var$compose(outer, inner) {
3200
- if (outer && inner) return (element) => outer(inner(element));
3201
- if (outer) return outer;
3202
- if (inner) return inner;
3203
- }
3204
- function $bda7a7e55e1ff206$var$capitalize(str) {
3205
- return str[0].toUpperCase() + str.slice(1);
730
+ return null;
731
+ }
3206
732
  }
3207
- function $d03379b88399b8c5$export$6cd28814d92fa9c9(props, factory, context) {
3208
- let builder = useMemo(() => new $bda7a7e55e1ff206$export$bf788dd355e3a401(), []);
3209
- let { children, items, collection } = props;
3210
- let result = useMemo(() => {
3211
- if (collection) return collection;
3212
- let nodes = builder.build({
3213
- children,
3214
- items
3215
- }, context);
3216
- return factory(nodes);
3217
- }, [
3218
- builder,
3219
- children,
3220
- items,
3221
- collection,
3222
- context,
3223
- factory
3224
- ]);
3225
- return result;
733
+ let $673d46fce3e5717d$var$cache = /* @__PURE__ */ new Map();
734
+ function $673d46fce3e5717d$export$a16aca283550c30d(options) {
735
+ let { locale } = $2eb8e6d23f3d0cb0$export$43bb16f9c6d9e3f7();
736
+ let cacheKey = locale + (options ? Object.entries(options).sort((a, b) => a[0] < b[0] ? -1 : 1).join() : "");
737
+ if ($673d46fce3e5717d$var$cache.has(cacheKey)) return $673d46fce3e5717d$var$cache.get(cacheKey);
738
+ let formatter = new Intl.Collator(locale, options);
739
+ $673d46fce3e5717d$var$cache.set(cacheKey, formatter);
740
+ return formatter;
3226
741
  }
3227
742
  function $0407362eaf54473e$export$ccaea96c28e8b9e7(props, ref) {
3228
743
  let { collection, onLoadMore, scrollOffset = 1, direction = "end" } = props;
@@ -3837,37 +1352,6 @@ function $2b2556a8276954c1$var$diffSelection(a, b) {
3837
1352
  for (let key of a.keys()) if (!b.has(key)) res.add(key);
3838
1353
  return res;
3839
1354
  }
3840
- function $bf14c9739fda2eb3$export$eac1895992b9f3d6(ref, options) {
3841
- let isDisabled = options?.isDisabled;
3842
- let [hasTabbableChild, setHasTabbableChild] = useState(false);
3843
- $c4867b2f328c2698$export$e5c5a5f917a5871c(() => {
3844
- if (ref?.current && !isDisabled) {
3845
- let update = () => {
3846
- if (ref.current) {
3847
- let walker = $535772f9d2c1f38d$export$2d6ec8fc375ceafa(ref.current, {
3848
- tabbable: true
3849
- });
3850
- setHasTabbableChild(!!walker.nextNode());
3851
- }
3852
- };
3853
- update();
3854
- let observer = new MutationObserver(update);
3855
- observer.observe(ref.current, {
3856
- subtree: true,
3857
- childList: true,
3858
- attributes: true,
3859
- attributeFilter: [
3860
- "tabIndex",
3861
- "disabled"
3862
- ]
3863
- });
3864
- return () => {
3865
- observer.disconnect();
3866
- };
3867
- }
3868
- });
3869
- return isDisabled ? false : hasTabbableChild;
3870
- }
3871
1355
  function $parcel$interopDefault$7(a) {
3872
1356
  return a && a.__esModule ? a.default : a;
3873
1357
  }