@anoki/fse-ui 1.0.456 → 1.0.457

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 (273) hide show
  1. package/dist/components/ui/BaseModal/BaseModalHeader/BaseModalHeader.css +1 -0
  2. package/dist/components/ui/ModalsHeader/ModalsHeader.css +1 -1
  3. package/dist/index.cjs214.js +1 -1
  4. package/dist/index.cjs215.js +1 -1
  5. package/dist/index.cjs221.js +1 -1
  6. package/dist/index.cjs222.js +1 -1
  7. package/dist/index.cjs226.js +1 -1
  8. package/dist/index.cjs231.js +1 -1
  9. package/dist/index.cjs233.js +1 -1
  10. package/dist/index.cjs280.js +1 -1
  11. package/dist/index.cjs301.js +1 -1
  12. package/dist/index.cjs302.js +1 -1
  13. package/dist/index.cjs306.js +1 -1
  14. package/dist/index.cjs307.js +1 -1
  15. package/dist/index.cjs308.js +1 -1
  16. package/dist/index.cjs309.js +1 -1
  17. package/dist/index.cjs315.js +1 -1
  18. package/dist/index.cjs316.js +1 -1
  19. package/dist/index.cjs322.js +1 -1
  20. package/dist/index.cjs322.js.map +1 -1
  21. package/dist/index.cjs323.js +1 -1
  22. package/dist/index.cjs323.js.map +1 -1
  23. package/dist/index.cjs324.js +1 -1
  24. package/dist/index.cjs324.js.map +1 -1
  25. package/dist/index.cjs325.js +1 -1
  26. package/dist/index.cjs325.js.map +1 -1
  27. package/dist/index.cjs326.js +1 -1
  28. package/dist/index.cjs326.js.map +1 -1
  29. package/dist/index.cjs327.js +1 -1
  30. package/dist/index.cjs327.js.map +1 -1
  31. package/dist/index.cjs328.js +1 -1
  32. package/dist/index.cjs328.js.map +1 -1
  33. package/dist/index.cjs329.js +1 -1
  34. package/dist/index.cjs329.js.map +1 -1
  35. package/dist/index.cjs330.js +1 -1
  36. package/dist/index.cjs330.js.map +1 -1
  37. package/dist/{index.cjs356.js → index.cjs331.js} +2 -2
  38. package/dist/index.cjs331.js.map +1 -0
  39. package/dist/index.cjs332.js +2 -0
  40. package/dist/index.cjs332.js.map +1 -0
  41. package/dist/index.cjs333.js +2 -0
  42. package/dist/index.cjs333.js.map +1 -0
  43. package/dist/index.cjs334.js +2 -0
  44. package/dist/index.cjs334.js.map +1 -0
  45. package/dist/index.cjs335.js +2 -0
  46. package/dist/index.cjs335.js.map +1 -0
  47. package/dist/index.cjs336.js +2 -0
  48. package/dist/index.cjs336.js.map +1 -0
  49. package/dist/index.cjs337.js +1 -1
  50. package/dist/index.cjs337.js.map +1 -1
  51. package/dist/index.cjs344.js +2 -0
  52. package/dist/index.cjs344.js.map +1 -0
  53. package/dist/index.cjs345.js +2 -0
  54. package/dist/index.cjs345.js.map +1 -0
  55. package/dist/index.cjs346.js +2 -0
  56. package/dist/index.cjs346.js.map +1 -0
  57. package/dist/index.cjs347.js +2 -0
  58. package/dist/index.cjs347.js.map +1 -0
  59. package/dist/index.cjs348.js +1 -1
  60. package/dist/index.cjs348.js.map +1 -1
  61. package/dist/index.cjs349.js +1 -1
  62. package/dist/index.cjs349.js.map +1 -1
  63. package/dist/index.cjs350.js +1 -1
  64. package/dist/index.cjs350.js.map +1 -1
  65. package/dist/index.cjs351.js +1 -1
  66. package/dist/index.cjs351.js.map +1 -1
  67. package/dist/index.cjs352.js +1 -1
  68. package/dist/index.cjs352.js.map +1 -1
  69. package/dist/index.cjs353.js +1 -1
  70. package/dist/index.cjs353.js.map +1 -1
  71. package/dist/index.cjs354.js +1 -1
  72. package/dist/index.cjs354.js.map +1 -1
  73. package/dist/index.cjs362.js +1 -1
  74. package/dist/index.cjs362.js.map +1 -1
  75. package/dist/index.cjs363.js +1 -1
  76. package/dist/index.cjs363.js.map +1 -1
  77. package/dist/index.cjs364.js +1 -1
  78. package/dist/index.cjs364.js.map +1 -1
  79. package/dist/index.cjs365.js +1 -1
  80. package/dist/index.cjs365.js.map +1 -1
  81. package/dist/index.cjs366.js +1 -1
  82. package/dist/index.cjs366.js.map +1 -1
  83. package/dist/index.cjs371.js +1 -1
  84. package/dist/index.cjs373.js +1 -1
  85. package/dist/index.cjs375.js +1 -1
  86. package/dist/index.cjs375.js.map +1 -1
  87. package/dist/index.cjs376.js +1 -38
  88. package/dist/index.cjs376.js.map +1 -1
  89. package/dist/index.cjs377.js +1 -1
  90. package/dist/index.cjs377.js.map +1 -1
  91. package/dist/index.cjs378.js +1 -1
  92. package/dist/index.cjs378.js.map +1 -1
  93. package/dist/index.cjs379.js +38 -1
  94. package/dist/index.cjs379.js.map +1 -1
  95. package/dist/index.cjs380.js +1 -1
  96. package/dist/index.cjs380.js.map +1 -1
  97. package/dist/index.cjs381.js +1 -1
  98. package/dist/index.cjs381.js.map +1 -1
  99. package/dist/index.cjs382.js +1 -1
  100. package/dist/index.cjs382.js.map +1 -1
  101. package/dist/index.cjs387.js +1 -1
  102. package/dist/index.cjs387.js.map +1 -1
  103. package/dist/index.cjs388.js +1 -1
  104. package/dist/index.cjs388.js.map +1 -1
  105. package/dist/index.cjs389.js +1 -1
  106. package/dist/index.cjs389.js.map +1 -1
  107. package/dist/index.cjs390.js +1 -1
  108. package/dist/index.cjs390.js.map +1 -1
  109. package/dist/index.cjs391.js +1 -1
  110. package/dist/index.cjs391.js.map +1 -1
  111. package/dist/index.cjs392.js +1 -1
  112. package/dist/index.cjs392.js.map +1 -1
  113. package/dist/index.cjs393.js +2 -0
  114. package/dist/index.cjs393.js.map +1 -0
  115. package/dist/index.cjs398.js +1 -1
  116. package/dist/index.es214.js +14 -14
  117. package/dist/index.es215.js +1 -1
  118. package/dist/index.es221.js +1 -1
  119. package/dist/index.es222.js +1 -1
  120. package/dist/index.es226.js +1 -1
  121. package/dist/index.es231.js +1 -1
  122. package/dist/index.es233.js +1 -1
  123. package/dist/index.es280.js +4 -4
  124. package/dist/index.es301.js +1 -1
  125. package/dist/index.es302.js +1 -1
  126. package/dist/index.es306.js +1 -1
  127. package/dist/index.es307.js +1 -1
  128. package/dist/index.es308.js +12 -12
  129. package/dist/index.es309.js +1 -1
  130. package/dist/index.es315.js +1 -1
  131. package/dist/index.es316.js +1 -1
  132. package/dist/index.es322.js +2 -125
  133. package/dist/index.es322.js.map +1 -1
  134. package/dist/index.es323.js +2 -135
  135. package/dist/index.es323.js.map +1 -1
  136. package/dist/index.es324.js +7 -14
  137. package/dist/index.es324.js.map +1 -1
  138. package/dist/index.es325.js +21 -63
  139. package/dist/index.es325.js.map +1 -1
  140. package/dist/index.es326.js +67 -32
  141. package/dist/index.es326.js.map +1 -1
  142. package/dist/index.es327.js +10 -14
  143. package/dist/index.es327.js.map +1 -1
  144. package/dist/index.es328.js +30 -9
  145. package/dist/index.es328.js.map +1 -1
  146. package/dist/index.es329.js +122 -47
  147. package/dist/index.es329.js.map +1 -1
  148. package/dist/index.es330.js +127 -39
  149. package/dist/index.es330.js.map +1 -1
  150. package/dist/{index.es356.js → index.es331.js} +3 -3
  151. package/dist/index.es331.js.map +1 -0
  152. package/dist/index.es332.js +72 -0
  153. package/dist/index.es332.js.map +1 -0
  154. package/dist/index.es333.js +36 -0
  155. package/dist/index.es333.js.map +1 -0
  156. package/dist/index.es334.js +18 -0
  157. package/dist/index.es334.js.map +1 -0
  158. package/dist/index.es335.js +12 -0
  159. package/dist/index.es335.js.map +1 -0
  160. package/dist/index.es336.js +53 -0
  161. package/dist/index.es336.js.map +1 -0
  162. package/dist/index.es337.js +47 -2
  163. package/dist/index.es337.js.map +1 -1
  164. package/dist/index.es344.js +14 -0
  165. package/dist/index.es344.js.map +1 -0
  166. package/dist/index.es345.js +45 -0
  167. package/dist/index.es345.js.map +1 -0
  168. package/dist/index.es346.js +49 -0
  169. package/dist/index.es346.js.map +1 -0
  170. package/dist/index.es347.js +11 -0
  171. package/dist/index.es347.js.map +1 -0
  172. package/dist/index.es348.js +124 -10
  173. package/dist/index.es348.js.map +1 -1
  174. package/dist/index.es349.js +13 -40
  175. package/dist/index.es349.js.map +1 -1
  176. package/dist/index.es350.js +130 -41
  177. package/dist/index.es350.js.map +1 -1
  178. package/dist/index.es351.js +217 -7
  179. package/dist/index.es351.js.map +1 -1
  180. package/dist/index.es352.js +13 -124
  181. package/dist/index.es352.js.map +1 -1
  182. package/dist/index.es353.js +176 -13
  183. package/dist/index.es353.js.map +1 -1
  184. package/dist/index.es354.js +4 -135
  185. package/dist/index.es354.js.map +1 -1
  186. package/dist/index.es362.js +2 -12
  187. package/dist/index.es362.js.map +1 -1
  188. package/dist/index.es363.js +10 -203
  189. package/dist/index.es363.js.map +1 -1
  190. package/dist/index.es364.js +203 -20
  191. package/dist/index.es364.js.map +1 -1
  192. package/dist/index.es365.js +21 -392
  193. package/dist/index.es365.js.map +1 -1
  194. package/dist/index.es366.js +393 -2
  195. package/dist/index.es366.js.map +1 -1
  196. package/dist/index.es371.js +1 -1
  197. package/dist/index.es373.js +4 -4
  198. package/dist/index.es375.js +512 -54
  199. package/dist/index.es375.js.map +1 -1
  200. package/dist/index.es376.js +126 -68
  201. package/dist/index.es376.js.map +1 -1
  202. package/dist/index.es377.js +128 -8
  203. package/dist/index.es377.js.map +1 -1
  204. package/dist/index.es378.js +64 -13
  205. package/dist/index.es378.js.map +1 -1
  206. package/dist/index.es379.js +68 -61
  207. package/dist/index.es379.js.map +1 -1
  208. package/dist/index.es380.js +7 -521
  209. package/dist/index.es380.js.map +1 -1
  210. package/dist/index.es381.js +13 -126
  211. package/dist/index.es381.js.map +1 -1
  212. package/dist/index.es382.js +60 -127
  213. package/dist/index.es382.js.map +1 -1
  214. package/dist/index.es387.js +11 -26
  215. package/dist/index.es387.js.map +1 -1
  216. package/dist/index.es388.js +27 -4
  217. package/dist/index.es388.js.map +1 -1
  218. package/dist/index.es389.js +5 -53
  219. package/dist/index.es389.js.map +1 -1
  220. package/dist/index.es390.js +50 -24
  221. package/dist/index.es390.js.map +1 -1
  222. package/dist/index.es391.js +25 -5
  223. package/dist/index.es391.js.map +1 -1
  224. package/dist/index.es392.js +6 -8
  225. package/dist/index.es392.js.map +1 -1
  226. package/dist/index.es393.js +12 -0
  227. package/dist/index.es393.js.map +1 -0
  228. package/dist/index.es398.js +1 -1
  229. package/package.json +1 -1
  230. package/dist/index.cjs317.js +0 -2
  231. package/dist/index.cjs317.js.map +0 -1
  232. package/dist/index.cjs318.js +0 -2
  233. package/dist/index.cjs318.js.map +0 -1
  234. package/dist/index.cjs319.js +0 -2
  235. package/dist/index.cjs319.js.map +0 -1
  236. package/dist/index.cjs320.js +0 -2
  237. package/dist/index.cjs320.js.map +0 -1
  238. package/dist/index.cjs321.js +0 -2
  239. package/dist/index.cjs321.js.map +0 -1
  240. package/dist/index.cjs338.js +0 -2
  241. package/dist/index.cjs338.js.map +0 -1
  242. package/dist/index.cjs355.js +0 -2
  243. package/dist/index.cjs355.js.map +0 -1
  244. package/dist/index.cjs356.js.map +0 -1
  245. package/dist/index.cjs357.js +0 -2
  246. package/dist/index.cjs357.js.map +0 -1
  247. package/dist/index.cjs358.js +0 -2
  248. package/dist/index.cjs358.js.map +0 -1
  249. package/dist/index.cjs386.js +0 -2
  250. package/dist/index.cjs386.js.map +0 -1
  251. package/dist/index.es317.js +0 -10
  252. package/dist/index.es317.js.map +0 -1
  253. package/dist/index.es318.js +0 -30
  254. package/dist/index.es318.js.map +0 -1
  255. package/dist/index.es319.js +0 -71
  256. package/dist/index.es319.js.map +0 -1
  257. package/dist/index.es320.js +0 -14
  258. package/dist/index.es320.js.map +0 -1
  259. package/dist/index.es321.js +0 -33
  260. package/dist/index.es321.js.map +0 -1
  261. package/dist/index.es338.js +0 -5
  262. package/dist/index.es338.js.map +0 -1
  263. package/dist/index.es355.js +0 -221
  264. package/dist/index.es355.js.map +0 -1
  265. package/dist/index.es356.js.map +0 -1
  266. package/dist/index.es357.js +0 -181
  267. package/dist/index.es357.js.map +0 -1
  268. package/dist/index.es358.js +0 -7
  269. package/dist/index.es358.js.map +0 -1
  270. package/dist/index.es386.js +0 -16
  271. package/dist/index.es386.js.map +0 -1
  272. /package/dist/components/ui/{DoctorConfirmModal/DoctorConfirmModalContent/DoctorConfirmModalContent.css → ConsentModal/ConsentModalContent/ConsentModalContent.css} +0 -0
  273. /package/dist/components/ui/{DoctorConfirmModal/DoctorConfirmModalFooter/DoctorConfirmModalFooter.css → DoctorModal/DoctorModalFooter/DoctorModalFooter.css} +0 -0
@@ -0,0 +1,45 @@
1
+ import * as l from "react";
2
+ import { composeRefs as u } from "./index.es304.js";
3
+ import { j as c } from "./index.es173.js";
4
+ var m = l.forwardRef((r, n) => {
5
+ const { children: e, ...t } = r, o = l.Children.toArray(e), i = o.find(g);
6
+ if (i) {
7
+ const s = i.props.children, a = o.map((f) => f === i ? l.Children.count(s) > 1 ? l.Children.only(null) : l.isValidElement(s) ? s.props.children : null : f);
8
+ return /* @__PURE__ */ c.jsx(p, { ...t, ref: n, children: l.isValidElement(s) ? l.cloneElement(s, void 0, a) : null });
9
+ }
10
+ return /* @__PURE__ */ c.jsx(p, { ...t, ref: n, children: e });
11
+ });
12
+ m.displayName = "Slot";
13
+ var p = l.forwardRef((r, n) => {
14
+ const { children: e, ...t } = r;
15
+ if (l.isValidElement(e)) {
16
+ const o = h(e), i = y(t, e.props);
17
+ return e.type !== l.Fragment && (i.ref = n ? u(n, o) : o), l.cloneElement(e, i);
18
+ }
19
+ return l.Children.count(e) > 1 ? l.Children.only(null) : null;
20
+ });
21
+ p.displayName = "SlotClone";
22
+ var d = ({ children: r }) => /* @__PURE__ */ c.jsx(c.Fragment, { children: r });
23
+ function g(r) {
24
+ return l.isValidElement(r) && r.type === d;
25
+ }
26
+ function y(r, n) {
27
+ const e = { ...n };
28
+ for (const t in n) {
29
+ const o = r[t], i = n[t];
30
+ /^on[A-Z]/.test(t) ? o && i ? e[t] = (...a) => {
31
+ i(...a), o(...a);
32
+ } : o && (e[t] = o) : t === "style" ? e[t] = { ...o, ...i } : t === "className" && (e[t] = [o, i].filter(Boolean).join(" "));
33
+ }
34
+ return { ...r, ...e };
35
+ }
36
+ function h(r) {
37
+ var t, o;
38
+ let n = (t = Object.getOwnPropertyDescriptor(r.props, "ref")) == null ? void 0 : t.get, e = n && "isReactWarning" in n && n.isReactWarning;
39
+ return e ? r.ref : (n = (o = Object.getOwnPropertyDescriptor(r, "ref")) == null ? void 0 : o.get, e = n && "isReactWarning" in n && n.isReactWarning, e ? r.props.ref : r.props.ref || r.ref);
40
+ }
41
+ export {
42
+ m as Slot,
43
+ d as Slottable
44
+ };
45
+ //# sourceMappingURL=index.es345.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.es345.js","sources":["../node_modules/@radix-ui/react-slot/dist/index.mjs"],"sourcesContent":["// packages/react/slot/src/slot.tsx\nimport * as React from \"react\";\nimport { composeRefs } from \"@radix-ui/react-compose-refs\";\nimport { Fragment as Fragment2, jsx } from \"react/jsx-runtime\";\nvar Slot = React.forwardRef((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n const childrenArray = React.Children.toArray(children);\n const slottable = childrenArray.find(isSlottable);\n if (slottable) {\n const newElement = slottable.props.children;\n const newChildren = childrenArray.map((child) => {\n if (child === slottable) {\n if (React.Children.count(newElement) > 1) return React.Children.only(null);\n return React.isValidElement(newElement) ? newElement.props.children : null;\n } else {\n return child;\n }\n });\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });\n }\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });\n});\nSlot.displayName = \"Slot\";\nvar SlotClone = React.forwardRef((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n if (React.isValidElement(children)) {\n const childrenRef = getElementRef(children);\n const props2 = mergeProps(slotProps, children.props);\n if (children.type !== React.Fragment) {\n props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;\n }\n return React.cloneElement(children, props2);\n }\n return React.Children.count(children) > 1 ? React.Children.only(null) : null;\n});\nSlotClone.displayName = \"SlotClone\";\nvar Slottable = ({ children }) => {\n return /* @__PURE__ */ jsx(Fragment2, { children });\n};\nfunction isSlottable(child) {\n return React.isValidElement(child) && child.type === Slottable;\n}\nfunction mergeProps(slotProps, childProps) {\n const overrideProps = { ...childProps };\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n if (slotPropValue && childPropValue) {\n overrideProps[propName] = (...args) => {\n childPropValue(...args);\n slotPropValue(...args);\n };\n } else if (slotPropValue) {\n overrideProps[propName] = slotPropValue;\n }\n } else if (propName === \"style\") {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue };\n } else if (propName === \"className\") {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(\" \");\n }\n }\n return { ...slotProps, ...overrideProps };\n}\nfunction getElementRef(element) {\n let getter = Object.getOwnPropertyDescriptor(element.props, \"ref\")?.get;\n let mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.ref;\n }\n getter = Object.getOwnPropertyDescriptor(element, \"ref\")?.get;\n mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n return element.props.ref || element.ref;\n}\nvar Root = Slot;\nexport {\n Root,\n Slot,\n Slottable\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["Slot","React","props","forwardedRef","children","slotProps","childrenArray","slottable","isSlottable","newElement","newChildren","child","jsx","SlotClone","childrenRef","getElementRef","props2","mergeProps","composeRefs","Slottable","Fragment2","childProps","overrideProps","propName","slotPropValue","childPropValue","args","element","getter","_a","mayWarn","_b"],"mappings":";;;AAIG,IAACA,IAAOC,EAAM,WAAW,CAACC,GAAOC,MAAiB;AACnD,QAAM,EAAE,UAAAC,GAAU,GAAGC,EAAS,IAAKH,GAC7BI,IAAgBL,EAAM,SAAS,QAAQG,CAAQ,GAC/CG,IAAYD,EAAc,KAAKE,CAAW;AAChD,MAAID,GAAW;AACb,UAAME,IAAaF,EAAU,MAAM,UAC7BG,IAAcJ,EAAc,IAAI,CAACK,MACjC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AiBJ,EAAWE,CAAQ;AAE1C,IADkB,WAAW,KAAKA,CAAQ,IAEpCC,KAAiBC,IACnBH,EAAcC,CAAQ,IAAI,IAAIG,MAAS;AACrC,MAAAD,EAAe,GAAGC,CAAI,GACtBF,EAAc,GAAGE,CAAI;AAAA,IACtB,IACQF,MACTF,EAAcC,CAAQ,IAAIC,KAEnBD,MAAa,UACtBD,EAAcC,CAAQ,IAAI,EAAE,GAAGC,GAAe,GAAGC,EAAgB,IACxDF,MAAa,gBACtBD,EAAcC,CAAQ,IAAI,CAACC,GAAeC,CAAc,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAAA,EAExF;AACE,SAAO,EAAE,GAAGpB,GAAW,GAAGiB,EAAe;AAC3C;AACA,SAASP,EAAcY,GAAS;;AAC9B,MAAIC,KAASC,IAAA,OAAO,yBAAyBF,EAAQ,OAAO,KAAK,MAApD,gBAAAE,EAAuD,KAChEC,IAAUF,KAAU,oBAAoBA,KAAUA,EAAO;AAC7D,SAAIE,IACKH,EAAQ,OAEjBC,KAASG,IAAA,OAAO,yBAAyBJ,GAAS,KAAK,MAA9C,gBAAAI,EAAiD,KAC1DD,IAAUF,KAAU,oBAAoBA,KAAUA,EAAO,gBACrDE,IACKH,EAAQ,MAAM,MAEhBA,EAAQ,MAAM,OAAOA,EAAQ;AACtC;","x_google_ignoreList":[0]}
@@ -0,0 +1,49 @@
1
+ import n from "react";
2
+ import { createContextScope as O } from "./index.es305.js";
3
+ import { useComposedRefs as I } from "./index.es304.js";
4
+ import { Slot as S } from "./index.es345.js";
5
+ import { j as u } from "./index.es173.js";
6
+ function L(s) {
7
+ const f = s + "CollectionProvider", [A, E] = O(f), [N, m] = A(
8
+ f,
9
+ { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
10
+ ), a = (c) => {
11
+ const { scope: e, children: l } = c, o = n.useRef(null), t = n.useRef(/* @__PURE__ */ new Map()).current;
12
+ return /* @__PURE__ */ u.jsx(N, { scope: e, itemMap: t, collectionRef: o, children: l });
13
+ };
14
+ a.displayName = f;
15
+ const d = s + "CollectionSlot", p = n.forwardRef(
16
+ (c, e) => {
17
+ const { scope: l, children: o } = c, t = m(d, l), r = I(e, t.collectionRef);
18
+ return /* @__PURE__ */ u.jsx(S, { ref: r, children: o });
19
+ }
20
+ );
21
+ p.displayName = d;
22
+ const C = s + "CollectionItemSlot", R = "data-radix-collection-item", x = n.forwardRef(
23
+ (c, e) => {
24
+ const { scope: l, children: o, ...t } = c, r = n.useRef(null), M = I(e, r), i = m(C, l);
25
+ return n.useEffect(() => (i.itemMap.set(r, { ref: r, ...t }), () => void i.itemMap.delete(r))), /* @__PURE__ */ u.jsx(S, { [R]: "", ref: M, children: o });
26
+ }
27
+ );
28
+ x.displayName = C;
29
+ function _(c) {
30
+ const e = m(s + "CollectionConsumer", c);
31
+ return n.useCallback(() => {
32
+ const o = e.collectionRef.current;
33
+ if (!o) return [];
34
+ const t = Array.from(o.querySelectorAll(`[${R}]`));
35
+ return Array.from(e.itemMap.values()).sort(
36
+ (i, T) => t.indexOf(i.ref.current) - t.indexOf(T.ref.current)
37
+ );
38
+ }, [e.collectionRef, e.itemMap]);
39
+ }
40
+ return [
41
+ { Provider: a, Slot: p, ItemSlot: x },
42
+ _,
43
+ E
44
+ ];
45
+ }
46
+ export {
47
+ L as createCollection
48
+ };
49
+ //# sourceMappingURL=index.es346.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.es346.js","sources":["../node_modules/@radix-ui/react-collection/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// packages/react/collection/src/collection.tsx\nimport React from \"react\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { jsx } from \"react/jsx-runtime\";\nfunction createCollection(name) {\n const PROVIDER_NAME = name + \"CollectionProvider\";\n const [createCollectionContext, createCollectionScope] = createContextScope(PROVIDER_NAME);\n const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(\n PROVIDER_NAME,\n { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }\n );\n const CollectionProvider = (props) => {\n const { scope, children } = props;\n const ref = React.useRef(null);\n const itemMap = React.useRef(/* @__PURE__ */ new Map()).current;\n return /* @__PURE__ */ jsx(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });\n };\n CollectionProvider.displayName = PROVIDER_NAME;\n const COLLECTION_SLOT_NAME = name + \"CollectionSlot\";\n const CollectionSlot = React.forwardRef(\n (props, forwardedRef) => {\n const { scope, children } = props;\n const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);\n const composedRefs = useComposedRefs(forwardedRef, context.collectionRef);\n return /* @__PURE__ */ jsx(Slot, { ref: composedRefs, children });\n }\n );\n CollectionSlot.displayName = COLLECTION_SLOT_NAME;\n const ITEM_SLOT_NAME = name + \"CollectionItemSlot\";\n const ITEM_DATA_ATTR = \"data-radix-collection-item\";\n const CollectionItemSlot = React.forwardRef(\n (props, forwardedRef) => {\n const { scope, children, ...itemData } = props;\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const context = useCollectionContext(ITEM_SLOT_NAME, scope);\n React.useEffect(() => {\n context.itemMap.set(ref, { ref, ...itemData });\n return () => void context.itemMap.delete(ref);\n });\n return /* @__PURE__ */ jsx(Slot, { ...{ [ITEM_DATA_ATTR]: \"\" }, ref: composedRefs, children });\n }\n );\n CollectionItemSlot.displayName = ITEM_SLOT_NAME;\n function useCollection(scope) {\n const context = useCollectionContext(name + \"CollectionConsumer\", scope);\n const getItems = React.useCallback(() => {\n const collectionNode = context.collectionRef.current;\n if (!collectionNode) return [];\n const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));\n const items = Array.from(context.itemMap.values());\n const orderedItems = items.sort(\n (a, b) => orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current)\n );\n return orderedItems;\n }, [context.collectionRef, context.itemMap]);\n return getItems;\n }\n return [\n { Provider: CollectionProvider, Slot: CollectionSlot, ItemSlot: CollectionItemSlot },\n useCollection,\n createCollectionScope\n ];\n}\nexport {\n createCollection\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["createCollection","name","PROVIDER_NAME","createCollectionContext","createCollectionScope","createContextScope","CollectionProviderImpl","useCollectionContext","CollectionProvider","props","scope","children","ref","React","itemMap","jsx","COLLECTION_SLOT_NAME","CollectionSlot","forwardedRef","context","composedRefs","useComposedRefs","Slot","ITEM_SLOT_NAME","ITEM_DATA_ATTR","CollectionItemSlot","itemData","useCollection","collectionNode","orderedNodes","a","b"],"mappings":";;;;;AAQA,SAASA,EAAiBC,GAAM;AAC9B,QAAMC,IAAgBD,IAAO,sBACvB,CAACE,GAAyBC,CAAqB,IAAIC,EAAmBH,CAAa,GACnF,CAACI,GAAwBC,CAAoB,IAAIJ;AAAA,IACrDD;AAAA,IACA,EAAE,eAAe,EAAE,SAAS,KAAI,GAAI,SAAyB,oBAAI,IAAK,EAAA;AAAA,EACvE,GACKM,IAAqB,CAACC,MAAU;AACpC,UAAM,EAAE,OAAAC,GAAO,UAAAC,EAAQ,IAAKF,GACtBG,IAAMC,EAAM,OAAO,IAAI,GACvBC,IAAUD,EAAM,OAAuB,oBAAI,IAAG,CAAE,EAAE;AACxD,WAAuBE,gBAAAA,EAAG,IAACT,GAAwB,EAAE,OAAAI,GAAO,SAAAI,GAAS,eAAeF,GAAK,UAAAD,GAAU;AAAA,EACpG;AACD,EAAAH,EAAmB,cAAcN;AACjC,QAAMc,IAAuBf,IAAO,kBAC9BgB,IAAiBJ,EAAM;AAAA,IAC3B,CAACJ,GAAOS,MAAiB;AACvB,YAAM,EAAE,OAAAR,GAAO,UAAAC,EAAQ,IAAKF,GACtBU,IAAUZ,EAAqBS,GAAsBN,CAAK,GAC1DU,IAAeC,EAAgBH,GAAcC,EAAQ,aAAa;AACxE,aAAuBJ,gBAAAA,EAAAA,IAAIO,GAAM,EAAE,KAAK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IACAvB;AAAA,EACD;AACH;","x_google_ignoreList":[0]}
@@ -0,0 +1,11 @@
1
+ import * as t from "react";
2
+ import "./index.es173.js";
3
+ var r = t.createContext(void 0);
4
+ function n(o) {
5
+ const e = t.useContext(r);
6
+ return o || e || "ltr";
7
+ }
8
+ export {
9
+ n as useDirection
10
+ };
11
+ //# sourceMappingURL=index.es347.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.es347.js","sources":["../node_modules/@radix-ui/react-direction/dist/index.mjs"],"sourcesContent":["// packages/react/direction/src/Direction.tsx\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nvar DirectionContext = React.createContext(void 0);\nvar DirectionProvider = (props) => {\n const { dir, children } = props;\n return /* @__PURE__ */ jsx(DirectionContext.Provider, { value: dir, children });\n};\nfunction useDirection(localDir) {\n const globalDir = React.useContext(DirectionContext);\n return localDir || globalDir || \"ltr\";\n}\nvar Provider = DirectionProvider;\nexport {\n DirectionProvider,\n Provider,\n useDirection\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["DirectionContext","React","useDirection","localDir","globalDir"],"mappings":";;AAGA,IAAIA,IAAmBC,EAAM,cAAc,MAAM;AAKjD,SAASC,EAAaC,GAAU;AAC9B,QAAMC,IAAYH,EAAM,WAAWD,CAAgB;AACnD,SAAOG,KAAYC,KAAa;AAClC;","x_google_ignoreList":[0]}
@@ -1,14 +1,128 @@
1
- import * as r from "react";
2
- function o(t) {
3
- const e = r.useRef(t);
4
- return r.useEffect(() => {
5
- e.current = t;
6
- }), r.useMemo(() => (...n) => {
7
- var u;
8
- return (u = e.current) == null ? void 0 : u.call(e, ...n);
9
- }, []);
1
+ import * as n from "react";
2
+ import { composeEventHandlers as m } from "./index.es303.js";
3
+ import { Primitive as R, dispatchDiscreteCustomEvent as k } from "./index.es307.js";
4
+ import { useComposedRefs as g } from "./index.es304.js";
5
+ import { useCallbackRef as w } from "./index.es344.js";
6
+ import { useEscapeKeydown as U } from "./index.es363.js";
7
+ import { j as x } from "./index.es173.js";
8
+ var j = "DismissableLayer", p = "dismissableLayer.update", z = "dismissableLayer.pointerDownOutside", H = "dismissableLayer.focusOutside", L, T = n.createContext({
9
+ layers: /* @__PURE__ */ new Set(),
10
+ layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
11
+ branches: /* @__PURE__ */ new Set()
12
+ }), M = n.forwardRef(
13
+ (r, e) => {
14
+ const {
15
+ disableOutsidePointerEvents: i = !1,
16
+ onEscapeKeyDown: o,
17
+ onPointerDownOutside: t,
18
+ onFocusOutside: a,
19
+ onInteractOutside: l,
20
+ onDismiss: d,
21
+ ...v
22
+ } = r, c = n.useContext(T), [u, S] = n.useState(null), f = (u == null ? void 0 : u.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, F] = n.useState({}), W = g(e, (s) => S(s)), y = Array.from(c.layers), [A] = [...c.layersWithOutsidePointerEventsDisabled].slice(-1), N = y.indexOf(A), b = u ? y.indexOf(u) : -1, I = c.layersWithOutsidePointerEventsDisabled.size > 0, P = b >= N, _ = q((s) => {
23
+ const E = s.target, C = [...c.branches].some((h) => h.contains(E));
24
+ !P || C || (t == null || t(s), l == null || l(s), s.defaultPrevented || d == null || d());
25
+ }, f), D = G((s) => {
26
+ const E = s.target;
27
+ [...c.branches].some((h) => h.contains(E)) || (a == null || a(s), l == null || l(s), s.defaultPrevented || d == null || d());
28
+ }, f);
29
+ return U((s) => {
30
+ b === c.layers.size - 1 && (o == null || o(s), !s.defaultPrevented && d && (s.preventDefault(), d()));
31
+ }, f), n.useEffect(() => {
32
+ if (u)
33
+ return i && (c.layersWithOutsidePointerEventsDisabled.size === 0 && (L = f.body.style.pointerEvents, f.body.style.pointerEvents = "none"), c.layersWithOutsidePointerEventsDisabled.add(u)), c.layers.add(u), O(), () => {
34
+ i && c.layersWithOutsidePointerEventsDisabled.size === 1 && (f.body.style.pointerEvents = L);
35
+ };
36
+ }, [u, f, i, c]), n.useEffect(() => () => {
37
+ u && (c.layers.delete(u), c.layersWithOutsidePointerEventsDisabled.delete(u), O());
38
+ }, [u, c]), n.useEffect(() => {
39
+ const s = () => F({});
40
+ return document.addEventListener(p, s), () => document.removeEventListener(p, s);
41
+ }, []), /* @__PURE__ */ x.jsx(
42
+ R.div,
43
+ {
44
+ ...v,
45
+ ref: W,
46
+ style: {
47
+ pointerEvents: I ? P ? "auto" : "none" : void 0,
48
+ ...r.style
49
+ },
50
+ onFocusCapture: m(r.onFocusCapture, D.onFocusCapture),
51
+ onBlurCapture: m(r.onBlurCapture, D.onBlurCapture),
52
+ onPointerDownCapture: m(
53
+ r.onPointerDownCapture,
54
+ _.onPointerDownCapture
55
+ )
56
+ }
57
+ );
58
+ }
59
+ );
60
+ M.displayName = j;
61
+ var X = "DismissableLayerBranch", Y = n.forwardRef((r, e) => {
62
+ const i = n.useContext(T), o = n.useRef(null), t = g(e, o);
63
+ return n.useEffect(() => {
64
+ const a = o.current;
65
+ if (a)
66
+ return i.branches.add(a), () => {
67
+ i.branches.delete(a);
68
+ };
69
+ }, [i.branches]), /* @__PURE__ */ x.jsx(R.div, { ...r, ref: t });
70
+ });
71
+ Y.displayName = X;
72
+ function q(r, e = globalThis == null ? void 0 : globalThis.document) {
73
+ const i = w(r), o = n.useRef(!1), t = n.useRef(() => {
74
+ });
75
+ return n.useEffect(() => {
76
+ const a = (d) => {
77
+ if (d.target && !o.current) {
78
+ let v = function() {
79
+ B(
80
+ z,
81
+ i,
82
+ c,
83
+ { discrete: !0 }
84
+ );
85
+ };
86
+ const c = { originalEvent: d };
87
+ d.pointerType === "touch" ? (e.removeEventListener("click", t.current), t.current = v, e.addEventListener("click", t.current, { once: !0 })) : v();
88
+ } else
89
+ e.removeEventListener("click", t.current);
90
+ o.current = !1;
91
+ }, l = window.setTimeout(() => {
92
+ e.addEventListener("pointerdown", a);
93
+ }, 0);
94
+ return () => {
95
+ window.clearTimeout(l), e.removeEventListener("pointerdown", a), e.removeEventListener("click", t.current);
96
+ };
97
+ }, [e, i]), {
98
+ // ensures we check React component tree (not just DOM tree)
99
+ onPointerDownCapture: () => o.current = !0
100
+ };
101
+ }
102
+ function G(r, e = globalThis == null ? void 0 : globalThis.document) {
103
+ const i = w(r), o = n.useRef(!1);
104
+ return n.useEffect(() => {
105
+ const t = (a) => {
106
+ a.target && !o.current && B(H, i, { originalEvent: a }, {
107
+ discrete: !1
108
+ });
109
+ };
110
+ return e.addEventListener("focusin", t), () => e.removeEventListener("focusin", t);
111
+ }, [e, i]), {
112
+ onFocusCapture: () => o.current = !0,
113
+ onBlurCapture: () => o.current = !1
114
+ };
115
+ }
116
+ function O() {
117
+ const r = new CustomEvent(p);
118
+ document.dispatchEvent(r);
119
+ }
120
+ function B(r, e, i, { discrete: o }) {
121
+ const t = i.originalEvent.target, a = new CustomEvent(r, { bubbles: !1, cancelable: !0, detail: i });
122
+ e && t.addEventListener(r, e, { once: !0 }), o ? k(t, a) : t.dispatchEvent(a);
10
123
  }
11
124
  export {
12
- o as useCallbackRef
125
+ M as DismissableLayer,
126
+ Y as DismissableLayerBranch
13
127
  };
14
128
  //# sourceMappingURL=index.es348.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es348.js","sources":["../node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs"],"sourcesContent":["// packages/react/use-callback-ref/src/useCallbackRef.tsx\nimport * as React from \"react\";\nfunction useCallbackRef(callback) {\n const callbackRef = React.useRef(callback);\n React.useEffect(() => {\n callbackRef.current = callback;\n });\n return React.useMemo(() => (...args) => callbackRef.current?.(...args), []);\n}\nexport {\n useCallbackRef\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["useCallbackRef","callback","callbackRef","React","args","_a"],"mappings":";AAEA,SAASA,EAAeC,GAAU;AAChC,QAAMC,IAAcC,EAAM,OAAOF,CAAQ;AACzC,SAAAE,EAAM,UAAU,MAAM;AACpB,IAAAD,EAAY,UAAUD;AAAA,EAC1B,CAAG,GACME,EAAM,QAAQ,MAAM,IAAIC;;AAAS,YAAAC,IAAAH,EAAY,YAAZ,gBAAAG,EAAA,KAAAH,GAAsB,GAAGE;AAAA,KAAO,EAAE;AAC5E;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.es348.js","sources":["../node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// packages/react/dismissable-layer/src/dismissable-layer.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { Primitive, dispatchDiscreteCustomEvent } from \"@radix-ui/react-primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useEscapeKeydown } from \"@radix-ui/react-use-escape-keydown\";\nimport { jsx } from \"react/jsx-runtime\";\nvar DISMISSABLE_LAYER_NAME = \"DismissableLayer\";\nvar CONTEXT_UPDATE = \"dismissableLayer.update\";\nvar POINTER_DOWN_OUTSIDE = \"dismissableLayer.pointerDownOutside\";\nvar FOCUS_OUTSIDE = \"dismissableLayer.focusOutside\";\nvar originalBodyPointerEvents;\nvar DismissableLayerContext = React.createContext({\n layers: /* @__PURE__ */ new Set(),\n layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),\n branches: /* @__PURE__ */ new Set()\n});\nvar DismissableLayer = React.forwardRef(\n (props, forwardedRef) => {\n const {\n disableOutsidePointerEvents = false,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n onDismiss,\n ...layerProps\n } = props;\n const context = React.useContext(DismissableLayerContext);\n const [node, setNode] = React.useState(null);\n const ownerDocument = node?.ownerDocument ?? globalThis?.document;\n const [, force] = React.useState({});\n const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));\n const layers = Array.from(context.layers);\n const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);\n const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled);\n const index = node ? layers.indexOf(node) : -1;\n const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;\n const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;\n const pointerDownOutside = usePointerDownOutside((event) => {\n const target = event.target;\n const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target));\n if (!isPointerEventsEnabled || isPointerDownOnBranch) return;\n onPointerDownOutside?.(event);\n onInteractOutside?.(event);\n if (!event.defaultPrevented) onDismiss?.();\n }, ownerDocument);\n const focusOutside = useFocusOutside((event) => {\n const target = event.target;\n const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target));\n if (isFocusInBranch) return;\n onFocusOutside?.(event);\n onInteractOutside?.(event);\n if (!event.defaultPrevented) onDismiss?.();\n }, ownerDocument);\n useEscapeKeydown((event) => {\n const isHighestLayer = index === context.layers.size - 1;\n if (!isHighestLayer) return;\n onEscapeKeyDown?.(event);\n if (!event.defaultPrevented && onDismiss) {\n event.preventDefault();\n onDismiss();\n }\n }, ownerDocument);\n React.useEffect(() => {\n if (!node) return;\n if (disableOutsidePointerEvents) {\n if (context.layersWithOutsidePointerEventsDisabled.size === 0) {\n originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;\n ownerDocument.body.style.pointerEvents = \"none\";\n }\n context.layersWithOutsidePointerEventsDisabled.add(node);\n }\n context.layers.add(node);\n dispatchUpdate();\n return () => {\n if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) {\n ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;\n }\n };\n }, [node, ownerDocument, disableOutsidePointerEvents, context]);\n React.useEffect(() => {\n return () => {\n if (!node) return;\n context.layers.delete(node);\n context.layersWithOutsidePointerEventsDisabled.delete(node);\n dispatchUpdate();\n };\n }, [node, context]);\n React.useEffect(() => {\n const handleUpdate = () => force({});\n document.addEventListener(CONTEXT_UPDATE, handleUpdate);\n return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);\n }, []);\n return /* @__PURE__ */ jsx(\n Primitive.div,\n {\n ...layerProps,\n ref: composedRefs,\n style: {\n pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? \"auto\" : \"none\" : void 0,\n ...props.style\n },\n onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture),\n onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture),\n onPointerDownCapture: composeEventHandlers(\n props.onPointerDownCapture,\n pointerDownOutside.onPointerDownCapture\n )\n }\n );\n }\n);\nDismissableLayer.displayName = DISMISSABLE_LAYER_NAME;\nvar BRANCH_NAME = \"DismissableLayerBranch\";\nvar DismissableLayerBranch = React.forwardRef((props, forwardedRef) => {\n const context = React.useContext(DismissableLayerContext);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n React.useEffect(() => {\n const node = ref.current;\n if (node) {\n context.branches.add(node);\n return () => {\n context.branches.delete(node);\n };\n }\n }, [context.branches]);\n return /* @__PURE__ */ jsx(Primitive.div, { ...props, ref: composedRefs });\n});\nDismissableLayerBranch.displayName = BRANCH_NAME;\nfunction usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {\n const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);\n const isPointerInsideReactTreeRef = React.useRef(false);\n const handleClickRef = React.useRef(() => {\n });\n React.useEffect(() => {\n const handlePointerDown = (event) => {\n if (event.target && !isPointerInsideReactTreeRef.current) {\n let handleAndDispatchPointerDownOutsideEvent2 = function() {\n handleAndDispatchCustomEvent(\n POINTER_DOWN_OUTSIDE,\n handlePointerDownOutside,\n eventDetail,\n { discrete: true }\n );\n };\n var handleAndDispatchPointerDownOutsideEvent = handleAndDispatchPointerDownOutsideEvent2;\n const eventDetail = { originalEvent: event };\n if (event.pointerType === \"touch\") {\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2;\n ownerDocument.addEventListener(\"click\", handleClickRef.current, { once: true });\n } else {\n handleAndDispatchPointerDownOutsideEvent2();\n }\n } else {\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n }\n isPointerInsideReactTreeRef.current = false;\n };\n const timerId = window.setTimeout(() => {\n ownerDocument.addEventListener(\"pointerdown\", handlePointerDown);\n }, 0);\n return () => {\n window.clearTimeout(timerId);\n ownerDocument.removeEventListener(\"pointerdown\", handlePointerDown);\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n };\n }, [ownerDocument, handlePointerDownOutside]);\n return {\n // ensures we check React component tree (not just DOM tree)\n onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true\n };\n}\nfunction useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {\n const handleFocusOutside = useCallbackRef(onFocusOutside);\n const isFocusInsideReactTreeRef = React.useRef(false);\n React.useEffect(() => {\n const handleFocus = (event) => {\n if (event.target && !isFocusInsideReactTreeRef.current) {\n const eventDetail = { originalEvent: event };\n handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {\n discrete: false\n });\n }\n };\n ownerDocument.addEventListener(\"focusin\", handleFocus);\n return () => ownerDocument.removeEventListener(\"focusin\", handleFocus);\n }, [ownerDocument, handleFocusOutside]);\n return {\n onFocusCapture: () => isFocusInsideReactTreeRef.current = true,\n onBlurCapture: () => isFocusInsideReactTreeRef.current = false\n };\n}\nfunction dispatchUpdate() {\n const event = new CustomEvent(CONTEXT_UPDATE);\n document.dispatchEvent(event);\n}\nfunction handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {\n const target = detail.originalEvent.target;\n const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });\n if (handler) target.addEventListener(name, handler, { once: true });\n if (discrete) {\n dispatchDiscreteCustomEvent(target, event);\n } else {\n target.dispatchEvent(event);\n }\n}\nvar Root = DismissableLayer;\nvar Branch = DismissableLayerBranch;\nexport {\n Branch,\n DismissableLayer,\n DismissableLayerBranch,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["DISMISSABLE_LAYER_NAME","CONTEXT_UPDATE","POINTER_DOWN_OUTSIDE","FOCUS_OUTSIDE","originalBodyPointerEvents","DismissableLayerContext","React","DismissableLayer","props","forwardedRef","disableOutsidePointerEvents","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","layerProps","context","node","setNode","ownerDocument","force","composedRefs","useComposedRefs","node2","layers","highestLayerWithOutsidePointerEventsDisabled","highestLayerWithOutsidePointerEventsDisabledIndex","index","isBodyPointerEventsDisabled","isPointerEventsEnabled","pointerDownOutside","usePointerDownOutside","event","target","isPointerDownOnBranch","branch","focusOutside","useFocusOutside","useEscapeKeydown","dispatchUpdate","handleUpdate","jsx","Primitive","composeEventHandlers","BRANCH_NAME","DismissableLayerBranch","ref","handlePointerDownOutside","useCallbackRef","isPointerInsideReactTreeRef","handleClickRef","handlePointerDown","handleAndDispatchPointerDownOutsideEvent2","handleAndDispatchCustomEvent","eventDetail","timerId","handleFocusOutside","isFocusInsideReactTreeRef","handleFocus","name","handler","detail","discrete","dispatchDiscreteCustomEvent"],"mappings":";;;;;;;AAUA,IAAIA,IAAyB,oBACzBC,IAAiB,2BACjBC,IAAuB,uCACvBC,IAAgB,iCAChBC,GACAC,IAA0BC,EAAM,cAAc;AAAA,EAChD,QAAwB,oBAAI,IAAK;AAAA,EACjC,wCAAwD,oBAAI,IAAK;AAAA,EACjE,UAA0B,oBAAI,IAAG;AACnC,CAAC,GACGC,IAAmBD,EAAM;AAAA,EAC3B,CAACE,GAAOC,MAAiB;AACvB,UAAM;AAAA,MACJ,6BAAAC,IAA8B;AAAA,MAC9B,iBAAAC;AAAA,MACA,sBAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,mBAAAC;AAAA,MACA,WAAAC;AAAA,MACA,GAAGC;AAAA,IACT,IAAQR,GACES,IAAUX,EAAM,WAAWD,CAAuB,GAClD,CAACa,GAAMC,CAAO,IAAIb,EAAM,SAAS,IAAI,GACrCc,K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B,GAAQD,CAAK,IAEzCC,EAAO,cAAcD,CAAK;AAE9B;","x_google_ignoreList":[0]}
@@ -1,45 +1,18 @@
1
- import * as l from "react";
2
- import { composeRefs as u } from "./index.es304.js";
3
- import { j as c } from "./index.es173.js";
4
- var m = l.forwardRef((r, n) => {
5
- const { children: e, ...t } = r, o = l.Children.toArray(e), i = o.find(g);
6
- if (i) {
7
- const s = i.props.children, a = o.map((f) => f === i ? l.Children.count(s) > 1 ? l.Children.only(null) : l.isValidElement(s) ? s.props.children : null : f);
8
- return /* @__PURE__ */ c.jsx(p, { ...t, ref: n, children: l.isValidElement(s) ? l.cloneElement(s, void 0, a) : null });
9
- }
10
- return /* @__PURE__ */ c.jsx(p, { ...t, ref: n, children: e });
11
- });
12
- m.displayName = "Slot";
13
- var p = l.forwardRef((r, n) => {
14
- const { children: e, ...t } = r;
15
- if (l.isValidElement(e)) {
16
- const o = h(e), i = y(t, e.props);
17
- return e.type !== l.Fragment && (i.ref = n ? u(n, o) : o), l.cloneElement(e, i);
18
- }
19
- return l.Children.count(e) > 1 ? l.Children.only(null) : null;
20
- });
21
- p.displayName = "SlotClone";
22
- var d = ({ children: r }) => /* @__PURE__ */ c.jsx(c.Fragment, { children: r });
23
- function g(r) {
24
- return l.isValidElement(r) && r.type === d;
1
+ import * as r from "react";
2
+ var t = 0;
3
+ function a() {
4
+ r.useEffect(() => {
5
+ const e = document.querySelectorAll("[data-radix-focus-guard]");
6
+ return document.body.insertAdjacentElement("afterbegin", e[0] ?? n()), document.body.insertAdjacentElement("beforeend", e[1] ?? n()), t++, () => {
7
+ t === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((o) => o.remove()), t--;
8
+ };
9
+ }, []);
25
10
  }
26
- function y(r, n) {
27
- const e = { ...n };
28
- for (const t in n) {
29
- const o = r[t], i = n[t];
30
- /^on[A-Z]/.test(t) ? o && i ? e[t] = (...a) => {
31
- i(...a), o(...a);
32
- } : o && (e[t] = o) : t === "style" ? e[t] = { ...o, ...i } : t === "className" && (e[t] = [o, i].filter(Boolean).join(" "));
33
- }
34
- return { ...r, ...e };
35
- }
36
- function h(r) {
37
- var t, o;
38
- let n = (t = Object.getOwnPropertyDescriptor(r.props, "ref")) == null ? void 0 : t.get, e = n && "isReactWarning" in n && n.isReactWarning;
39
- return e ? r.ref : (n = (o = Object.getOwnPropertyDescriptor(r, "ref")) == null ? void 0 : o.get, e = n && "isReactWarning" in n && n.isReactWarning, e ? r.props.ref : r.props.ref || r.ref);
11
+ function n() {
12
+ const e = document.createElement("span");
13
+ return e.setAttribute("data-radix-focus-guard", ""), e.tabIndex = 0, e.style.outline = "none", e.style.opacity = "0", e.style.position = "fixed", e.style.pointerEvents = "none", e;
40
14
  }
41
15
  export {
42
- m as Slot,
43
- d as Slottable
16
+ a as useFocusGuards
44
17
  };
45
18
  //# sourceMappingURL=index.es349.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es349.js","sources":["../node_modules/@radix-ui/react-slot/dist/index.mjs"],"sourcesContent":["// packages/react/slot/src/slot.tsx\nimport * as React from \"react\";\nimport { composeRefs } from \"@radix-ui/react-compose-refs\";\nimport { Fragment as Fragment2, jsx } from \"react/jsx-runtime\";\nvar Slot = React.forwardRef((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n const childrenArray = React.Children.toArray(children);\n const slottable = childrenArray.find(isSlottable);\n if (slottable) {\n const newElement = slottable.props.children;\n const newChildren = childrenArray.map((child) => {\n if (child === slottable) {\n if (React.Children.count(newElement) > 1) return React.Children.only(null);\n return React.isValidElement(newElement) ? newElement.props.children : null;\n } else {\n return child;\n }\n });\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });\n }\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });\n});\nSlot.displayName = \"Slot\";\nvar SlotClone = React.forwardRef((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n if (React.isValidElement(children)) {\n const childrenRef = getElementRef(children);\n const props2 = mergeProps(slotProps, children.props);\n if (children.type !== React.Fragment) {\n props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;\n }\n return React.cloneElement(children, props2);\n }\n return React.Children.count(children) > 1 ? React.Children.only(null) : null;\n});\nSlotClone.displayName = \"SlotClone\";\nvar Slottable = ({ children }) => {\n return /* @__PURE__ */ jsx(Fragment2, { children });\n};\nfunction isSlottable(child) {\n return React.isValidElement(child) && child.type === Slottable;\n}\nfunction mergeProps(slotProps, childProps) {\n const overrideProps = { ...childProps };\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n if (slotPropValue && childPropValue) {\n overrideProps[propName] = (...args) => {\n childPropValue(...args);\n slotPropValue(...args);\n };\n } else if (slotPropValue) {\n overrideProps[propName] = slotPropValue;\n }\n } else if (propName === \"style\") {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue };\n } else if (propName === \"className\") {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(\" \");\n }\n }\n return { ...slotProps, ...overrideProps };\n}\nfunction getElementRef(element) {\n let getter = Object.getOwnPropertyDescriptor(element.props, \"ref\")?.get;\n let mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.ref;\n }\n getter = Object.getOwnPropertyDescriptor(element, \"ref\")?.get;\n mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n return element.props.ref || element.ref;\n}\nvar Root = Slot;\nexport {\n Root,\n Slot,\n Slottable\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["Slot","React","props","forwardedRef","children","slotProps","childrenArray","slottable","isSlottable","newElement","newChildren","child","jsx","SlotClone","childrenRef","getElementRef","props2","mergeProps","composeRefs","Slottable","Fragment2","childProps","overrideProps","propName","slotPropValue","childPropValue","args","element","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AAAf,QACMQ,gBAAAA,MAAIQ,EAAAA,UAAW,EAAE,UAAAhB,GAAU;AAEpD,SAASI,EAAYG,GAAO;AAC1B,SAAOV,EAAM,eAAeU,CAAK,KAAKA,EAAM,SAASQ;AACvD;AACA,SAASF,EAAWZ,GAAWgB,GAAY;AACzC,QAAMC,IAAgB,EAAE,GAAGD,EAAY;AACvC,aAAWE,KAAYF,GAAY;AACjC,UAAMG,IAAgBnB,EAAUkB,CAAQ,GAClCE,IAAiBJ,EAAWE,CAAQ;AAE1C,IADkB,WAAW,KAAKA,CAAQ,IAEpCC,KAAiBC,IACnBH,EAAcC,CAAQ,IAAI,IAAIG,MAAS;AACrC,MAAAD,EAAe,GAAGC,CAAI,GACtBF,EAAc,GAAGE,CAAI;AAAA,IACtB,IACQF,MACTF,EAAcC,CAAQ,IAAIC,KAEnBD,MAAa,UACtBD,EAAcC,CAAQ,IAAI,EAAE,GAAGC,GAAe,GAAGC,EAAgB,IACxDF,MAAa,gBACtBD,EAAcC,CAAQ,IAAI,CAACC,GAAeC,CAAc,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAAA,EAExF;AACE,SAAO,EAAE,GAAGpB,GAAW,GAAGiB,EAAe;AAC3C;AACA,SAASP,EAAcY,GAAS;;AAC9B,MAAIC,KAASC,IAAA,OAAO,yBAAyBF,EAAQ,OAAO,KAAK,MAApD,gBAAAE,EAAuD,KAChEC,IAAUF,KAAU,oBAAoBA,KAAUA,EAAO;AAC7D,SAAIE,IACKH,EAAQ,OAEjBC,KAASG,IAAA,OAAO,yBAAyBJ,GAAS,KAAK,MAA9C,gBAAAI,EAAiD,KAC1DD,IAAUF,KAAU,oBAAoBA,KAAUA,EAAO,gBACrDE,IACKH,EAAQ,MAAM,MAEhBA,EAAQ,MAAM,OAAOA,EAAQ;AACtC;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.es349.js","sources":["../node_modules/@radix-ui/react-focus-guards/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// packages/react/focus-guards/src/FocusGuards.tsx\nimport * as React from \"react\";\nvar count = 0;\nfunction FocusGuards(props) {\n useFocusGuards();\n return props.children;\n}\nfunction useFocusGuards() {\n React.useEffect(() => {\n const edgeGuards = document.querySelectorAll(\"[data-radix-focus-guard]\");\n document.body.insertAdjacentElement(\"afterbegin\", edgeGuards[0] ?? createFocusGuard());\n document.body.insertAdjacentElement(\"beforeend\", edgeGuards[1] ?? createFocusGuard());\n count++;\n return () => {\n if (count === 1) {\n document.querySelectorAll(\"[data-radix-focus-guard]\").forEach((node) => node.remove());\n }\n count--;\n };\n }, []);\n}\nfunction createFocusGuard() {\n const element = document.createElement(\"span\");\n element.setAttribute(\"data-radix-focus-guard\", \"\");\n element.tabIndex = 0;\n element.style.outline = \"none\";\n element.style.opacity = \"0\";\n element.style.position = \"fixed\";\n element.style.pointerEvents = \"none\";\n return element;\n}\nvar Root = FocusGuards;\nexport {\n FocusGuards,\n Root,\n useFocusGuards\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["count","useFocusGuards","React","edgeGuards","createFocusGuard","node","element"],"mappings":";AAIA,IAAIA,IAAQ;AAKZ,SAASC,IAAiB;AACxB,EAAAC,EAAM,UAAU,MAAM;AACpB,UAAMC,IAAa,SAAS,iBAAiB,0BAA0B;AACvE,oBAAS,KAAK,sBAAsB,cAAcA,EAAW,CAAC,KAAKC,GAAkB,GACrF,SAAS,KAAK,sBAAsB,aAAaD,EAAW,CAAC,KAAKC,GAAkB,GACpFJ,KACO,MAAM;AACX,MAAIA,MAAU,KACZ,SAAS,iBAAiB,0BAA0B,EAAE,QAAQ,CAACK,MAASA,EAAK,QAAQ,GAEvFL;AAAA,IACD;AAAA,EACF,GAAE,EAAE;AACP;AACA,SAASI,IAAmB;AAC1B,QAAME,IAAU,SAAS,cAAc,MAAM;AAC7C,SAAAA,EAAQ,aAAa,0BAA0B,EAAE,GACjDA,EAAQ,WAAW,GACnBA,EAAQ,MAAM,UAAU,QACxBA,EAAQ,MAAM,UAAU,KACxBA,EAAQ,MAAM,WAAW,SACzBA,EAAQ,MAAM,gBAAgB,QACvBA;AACT;","x_google_ignoreList":[0]}
@@ -1,49 +1,138 @@
1
- import n from "react";
2
- import { createContextScope as O } from "./index.es305.js";
3
- import { useComposedRefs as I } from "./index.es304.js";
4
- import { Slot as S } from "./index.es349.js";
5
- import { j as u } from "./index.es173.js";
6
- function L(s) {
7
- const f = s + "CollectionProvider", [A, E] = O(f), [N, m] = A(
8
- f,
9
- { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
10
- ), a = (c) => {
11
- const { scope: e, children: l } = c, o = n.useRef(null), t = n.useRef(/* @__PURE__ */ new Map()).current;
12
- return /* @__PURE__ */ u.jsx(N, { scope: e, itemMap: t, collectionRef: o, children: l });
13
- };
14
- a.displayName = f;
15
- const d = s + "CollectionSlot", p = n.forwardRef(
16
- (c, e) => {
17
- const { scope: l, children: o } = c, t = m(d, l), r = I(e, t.collectionRef);
18
- return /* @__PURE__ */ u.jsx(S, { ref: r, children: o });
1
+ import * as d from "react";
2
+ import { useComposedRefs as P } from "./index.es304.js";
3
+ import { Primitive as M } from "./index.es307.js";
4
+ import { useCallbackRef as y } from "./index.es344.js";
5
+ import { j as _ } from "./index.es173.js";
6
+ var F = "focusScope.autoFocusOnMount", T = "focusScope.autoFocusOnUnmount", N = { bubbles: !1, cancelable: !0 }, K = "FocusScope", k = d.forwardRef((e, n) => {
7
+ const {
8
+ loop: t = !1,
9
+ trapped: u = !1,
10
+ onMountAutoFocus: p,
11
+ onUnmountAutoFocus: L,
12
+ ...g
13
+ } = e, [o, R] = d.useState(null), E = y(p), v = y(L), b = d.useRef(null), U = P(n, (s) => R(s)), a = d.useRef({
14
+ paused: !1,
15
+ pause() {
16
+ this.paused = !0;
17
+ },
18
+ resume() {
19
+ this.paused = !1;
19
20
  }
20
- );
21
- p.displayName = d;
22
- const C = s + "CollectionItemSlot", R = "data-radix-collection-item", x = n.forwardRef(
23
- (c, e) => {
24
- const { scope: l, children: o, ...t } = c, r = n.useRef(null), M = I(e, r), i = m(C, l);
25
- return n.useEffect(() => (i.itemMap.set(r, { ref: r, ...t }), () => void i.itemMap.delete(r))), /* @__PURE__ */ u.jsx(S, { [R]: "", ref: M, children: o });
21
+ }).current;
22
+ d.useEffect(() => {
23
+ if (u) {
24
+ let s = function(i) {
25
+ if (a.paused || !o) return;
26
+ const c = i.target;
27
+ o.contains(c) ? b.current = c : f(b.current, { select: !0 });
28
+ }, l = function(i) {
29
+ if (a.paused || !o) return;
30
+ const c = i.relatedTarget;
31
+ c !== null && (o.contains(c) || f(b.current, { select: !0 }));
32
+ }, r = function(i) {
33
+ if (document.activeElement === document.body)
34
+ for (const h of i)
35
+ h.removedNodes.length > 0 && f(o);
36
+ };
37
+ document.addEventListener("focusin", s), document.addEventListener("focusout", l);
38
+ const m = new MutationObserver(r);
39
+ return o && m.observe(o, { childList: !0, subtree: !0 }), () => {
40
+ document.removeEventListener("focusin", s), document.removeEventListener("focusout", l), m.disconnect();
41
+ };
26
42
  }
43
+ }, [u, o, a.paused]), d.useEffect(() => {
44
+ if (o) {
45
+ S.add(a);
46
+ const s = document.activeElement;
47
+ if (!o.contains(s)) {
48
+ const r = new CustomEvent(F, N);
49
+ o.addEventListener(F, E), o.dispatchEvent(r), r.defaultPrevented || (w(V(I(o)), { select: !0 }), document.activeElement === s && f(o));
50
+ }
51
+ return () => {
52
+ o.removeEventListener(F, E), setTimeout(() => {
53
+ const r = new CustomEvent(T, N);
54
+ o.addEventListener(T, v), o.dispatchEvent(r), r.defaultPrevented || f(s ?? document.body, { select: !0 }), o.removeEventListener(T, v), S.remove(a);
55
+ }, 0);
56
+ };
57
+ }
58
+ }, [o, E, v, a]);
59
+ const A = d.useCallback(
60
+ (s) => {
61
+ if (!t && !u || a.paused) return;
62
+ const l = s.key === "Tab" && !s.altKey && !s.ctrlKey && !s.metaKey, r = document.activeElement;
63
+ if (l && r) {
64
+ const m = s.currentTarget, [i, c] = x(m);
65
+ i && c ? !s.shiftKey && r === c ? (s.preventDefault(), t && f(i, { select: !0 })) : s.shiftKey && r === i && (s.preventDefault(), t && f(c, { select: !0 })) : r === m && s.preventDefault();
66
+ }
67
+ },
68
+ [t, u, a.paused]
27
69
  );
28
- x.displayName = C;
29
- function _(c) {
30
- const e = m(s + "CollectionConsumer", c);
31
- return n.useCallback(() => {
32
- const o = e.collectionRef.current;
33
- if (!o) return [];
34
- const t = Array.from(o.querySelectorAll(`[${R}]`));
35
- return Array.from(e.itemMap.values()).sort(
36
- (i, T) => t.indexOf(i.ref.current) - t.indexOf(T.ref.current)
37
- );
38
- }, [e.collectionRef, e.itemMap]);
70
+ return /* @__PURE__ */ _.jsx(M.div, { tabIndex: -1, ...g, ref: U, onKeyDown: A });
71
+ });
72
+ k.displayName = K;
73
+ function w(e, { select: n = !1 } = {}) {
74
+ const t = document.activeElement;
75
+ for (const u of e)
76
+ if (f(u, { select: n }), document.activeElement !== t) return;
77
+ }
78
+ function x(e) {
79
+ const n = I(e), t = O(n, e), u = O(n.reverse(), e);
80
+ return [t, u];
81
+ }
82
+ function I(e) {
83
+ const n = [], t = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
84
+ acceptNode: (u) => {
85
+ const p = u.tagName === "INPUT" && u.type === "hidden";
86
+ return u.disabled || u.hidden || p ? NodeFilter.FILTER_SKIP : u.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
87
+ }
88
+ });
89
+ for (; t.nextNode(); ) n.push(t.currentNode);
90
+ return n;
91
+ }
92
+ function O(e, n) {
93
+ for (const t of e)
94
+ if (!D(t, { upTo: n })) return t;
95
+ }
96
+ function D(e, { upTo: n }) {
97
+ if (getComputedStyle(e).visibility === "hidden") return !0;
98
+ for (; e; ) {
99
+ if (n !== void 0 && e === n) return !1;
100
+ if (getComputedStyle(e).display === "none") return !0;
101
+ e = e.parentElement;
39
102
  }
40
- return [
41
- { Provider: a, Slot: p, ItemSlot: x },
42
- _,
43
- E
44
- ];
103
+ return !1;
104
+ }
105
+ function H(e) {
106
+ return e instanceof HTMLInputElement && "select" in e;
107
+ }
108
+ function f(e, { select: n = !1 } = {}) {
109
+ if (e && e.focus) {
110
+ const t = document.activeElement;
111
+ e.focus({ preventScroll: !0 }), e !== t && H(e) && n && e.select();
112
+ }
113
+ }
114
+ var S = j();
115
+ function j() {
116
+ let e = [];
117
+ return {
118
+ add(n) {
119
+ const t = e[0];
120
+ n !== t && (t == null || t.pause()), e = C(e, n), e.unshift(n);
121
+ },
122
+ remove(n) {
123
+ var t;
124
+ e = C(e, n), (t = e[0]) == null || t.resume();
125
+ }
126
+ };
127
+ }
128
+ function C(e, n) {
129
+ const t = [...e], u = t.indexOf(n);
130
+ return u !== -1 && t.splice(u, 1), t;
131
+ }
132
+ function V(e) {
133
+ return e.filter((n) => n.tagName !== "A");
45
134
  }
46
135
  export {
47
- L as createCollection
136
+ k as FocusScope
48
137
  };
49
138
  //# sourceMappingURL=index.es350.js.map