@datawire-ai/busyfile-design-library 1.30.1 → 1.30.3

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 (316) hide show
  1. package/dist/index.js +164 -15903
  2. package/dist/index10.js +109 -0
  3. package/dist/index100.js +72 -0
  4. package/dist/index101.js +13 -0
  5. package/dist/index102.js +128 -0
  6. package/dist/index103.js +138 -0
  7. package/dist/index104.js +17 -0
  8. package/dist/index105.js +18 -0
  9. package/dist/index106.js +11 -0
  10. package/dist/index107.js +52 -0
  11. package/dist/index108.js +184 -0
  12. package/dist/index109.js +10 -0
  13. package/dist/index11.js +21 -0
  14. package/dist/index110.js +222 -0
  15. package/dist/index111.js +32 -0
  16. package/dist/index112.js +13 -0
  17. package/dist/index113.js +6 -0
  18. package/dist/index114.js +15 -0
  19. package/dist/index115.js +16 -0
  20. package/dist/index116.js +229 -0
  21. package/dist/index117.js +653 -0
  22. package/dist/index118.js +17 -0
  23. package/dist/index119.js +6 -0
  24. package/dist/index12.js +109 -0
  25. package/dist/index120.js +49 -0
  26. package/dist/index121.js +27 -0
  27. package/dist/index122.js +24 -0
  28. package/dist/index123.js +41 -0
  29. package/dist/index124.js +20 -0
  30. package/dist/index125.js +4 -0
  31. package/dist/index126.js +4 -0
  32. package/dist/index127.js +14 -0
  33. package/dist/index128.js +208 -0
  34. package/dist/index129.js +24 -0
  35. package/dist/index13.js +191 -0
  36. package/dist/index130.js +402 -0
  37. package/dist/index131.js +8 -0
  38. package/dist/index132.js +27 -0
  39. package/dist/index133.js +31 -0
  40. package/dist/index134.js +7 -0
  41. package/dist/index135.js +4 -0
  42. package/dist/index136.js +55 -0
  43. package/dist/index137.js +67 -0
  44. package/dist/index138.js +54 -0
  45. package/dist/index139.js +7 -0
  46. package/dist/index14.js +30 -0
  47. package/dist/index140.js +7 -0
  48. package/dist/index141.js +18 -0
  49. package/dist/index142.js +8 -0
  50. package/dist/index143.js +11 -0
  51. package/dist/index144.js +19 -0
  52. package/dist/index145.js +7 -0
  53. package/dist/index146.js +7 -0
  54. package/dist/index147.js +8 -0
  55. package/dist/index148.js +8 -0
  56. package/dist/index149.js +7 -0
  57. package/dist/index15.js +118 -0
  58. package/dist/index150.js +7 -0
  59. package/dist/index151.js +9 -0
  60. package/dist/index152.js +27 -0
  61. package/dist/index153.js +9 -0
  62. package/dist/index154.js +7 -0
  63. package/dist/index155.js +9 -0
  64. package/dist/index156.js +8 -0
  65. package/dist/index157.js +7 -0
  66. package/dist/index158.js +8 -0
  67. package/dist/index159.js +7 -0
  68. package/dist/index16.js +41 -0
  69. package/dist/index160.js +11 -0
  70. package/dist/index161.js +8 -0
  71. package/dist/index162.js +7 -0
  72. package/dist/index163.js +7 -0
  73. package/dist/index164.js +9 -0
  74. package/dist/index165.js +61 -0
  75. package/dist/index166.js +69 -0
  76. package/dist/index167.js +243 -0
  77. package/dist/index168.js +42 -0
  78. package/dist/index169.js +7 -0
  79. package/dist/index17.js +78 -0
  80. package/dist/index170.js +10 -0
  81. package/dist/index171.js +16 -0
  82. package/dist/index172.js +10 -0
  83. package/dist/index173.js +13 -0
  84. package/dist/index174.js +13 -0
  85. package/dist/index175.js +11 -0
  86. package/dist/index176.js +19 -0
  87. package/dist/index177.js +26 -0
  88. package/dist/index178.js +22 -0
  89. package/dist/index179.js +56 -0
  90. package/dist/index18.js +44 -0
  91. package/dist/index180.js +44 -0
  92. package/dist/index181.js +12 -0
  93. package/dist/index182.js +23 -0
  94. package/dist/index183.js +19 -0
  95. package/dist/index184.js +9 -0
  96. package/dist/index185.js +26 -0
  97. package/dist/index186.js +21 -0
  98. package/dist/index187.js +18 -0
  99. package/dist/index188.js +9 -0
  100. package/dist/index189.js +7 -0
  101. package/dist/index19.js +86 -0
  102. package/dist/index190.js +7 -0
  103. package/dist/index191.js +7 -0
  104. package/dist/index192.js +7 -0
  105. package/dist/index193.js +6 -0
  106. package/dist/index194.js +9 -0
  107. package/dist/index195.js +10 -0
  108. package/dist/index196.js +9 -0
  109. package/dist/index197.js +8 -0
  110. package/dist/index198.js +6 -0
  111. package/dist/index199.js +6 -0
  112. package/dist/index20.js +15 -0
  113. package/dist/index200.js +6 -0
  114. package/dist/index201.js +6 -0
  115. package/dist/index202.js +7 -0
  116. package/dist/index203.js +6 -0
  117. package/dist/index204.js +6 -0
  118. package/dist/index205.js +6 -0
  119. package/dist/index206.js +7 -0
  120. package/dist/index207.js +5 -0
  121. package/dist/index208.js +26 -0
  122. package/dist/index209.js +112 -0
  123. package/dist/index21.js +43 -0
  124. package/dist/index210.js +18 -0
  125. package/dist/index211.js +527 -0
  126. package/dist/index212.js +130 -0
  127. package/dist/index213.js +136 -0
  128. package/dist/index214.js +4 -0
  129. package/dist/index215.js +4 -0
  130. package/dist/index216.js +11 -0
  131. package/dist/index217.js +22 -0
  132. package/dist/index218.js +19 -0
  133. package/dist/index219.js +8 -0
  134. package/dist/index22.js +110 -0
  135. package/dist/index220.js +8 -0
  136. package/dist/index221.js +9 -0
  137. package/dist/index222.js +7 -0
  138. package/dist/index223.js +10 -0
  139. package/dist/index224.js +20 -0
  140. package/dist/index225.js +8 -0
  141. package/dist/index226.js +8 -0
  142. package/dist/index227.js +16 -0
  143. package/dist/index228.js +13 -0
  144. package/dist/index229.js +17 -0
  145. package/dist/index23.js +45 -0
  146. package/dist/index230.js +8 -0
  147. package/dist/index231.js +9 -0
  148. package/dist/index232.js +11 -0
  149. package/dist/index233.js +9 -0
  150. package/dist/index234.js +59 -0
  151. package/dist/index235.js +12 -0
  152. package/dist/index236.js +8 -0
  153. package/dist/index237.js +8 -0
  154. package/dist/index238.js +12 -0
  155. package/dist/index239.js +8 -0
  156. package/dist/index24.js +17 -0
  157. package/dist/index240.js +8 -0
  158. package/dist/index241.js +7 -0
  159. package/dist/index242.js +14 -0
  160. package/dist/index243.js +13 -0
  161. package/dist/index244.js +13 -0
  162. package/dist/index245.js +14 -0
  163. package/dist/index246.js +14 -0
  164. package/dist/index247.js +13 -0
  165. package/dist/index248.js +10 -0
  166. package/dist/index249.js +9 -0
  167. package/dist/index25.js +22 -0
  168. package/dist/index250.js +8 -0
  169. package/dist/index251.js +9 -0
  170. package/dist/index252.js +11 -0
  171. package/dist/index253.js +9 -0
  172. package/dist/index254.js +26 -0
  173. package/dist/index255.js +21 -0
  174. package/dist/index256.js +10 -0
  175. package/dist/index257.js +13 -0
  176. package/dist/index258.js +13 -0
  177. package/dist/index259.js +24 -0
  178. package/dist/index26.js +20 -0
  179. package/dist/index260.js +13 -0
  180. package/dist/index261.js +12 -0
  181. package/dist/index262.js +12 -0
  182. package/dist/index263.js +7 -0
  183. package/dist/index264.js +8 -0
  184. package/dist/index265.js +19 -0
  185. package/dist/index266.js +12 -0
  186. package/dist/index267.js +21 -0
  187. package/dist/index268.js +18 -0
  188. package/dist/index269.js +15 -0
  189. package/dist/index27.js +61 -0
  190. package/dist/index270.js +32 -0
  191. package/dist/index271.js +15 -0
  192. package/dist/index272.js +28 -0
  193. package/dist/index273.js +8 -0
  194. package/dist/index274.js +67 -0
  195. package/dist/index275.js +71 -0
  196. package/dist/index276.js +11 -0
  197. package/dist/index277.js +16 -0
  198. package/dist/index278.js +68 -0
  199. package/dist/index279.js +70 -0
  200. package/dist/index28.js +543 -0
  201. package/dist/index280.js +33 -0
  202. package/dist/index281.js +11 -0
  203. package/dist/index282.js +155 -0
  204. package/dist/index283.js +110 -0
  205. package/dist/index284.js +7 -0
  206. package/dist/index285.js +15 -0
  207. package/dist/index286.js +6 -0
  208. package/dist/index287.js +25 -0
  209. package/dist/index288.js +8 -0
  210. package/dist/index289.js +8 -0
  211. package/dist/index29.js +80 -0
  212. package/dist/index290.js +6 -0
  213. package/dist/index291.js +18 -0
  214. package/dist/index292.js +11 -0
  215. package/dist/index293.js +8 -0
  216. package/dist/index294.js +7 -0
  217. package/dist/index295.js +515 -0
  218. package/dist/index296.js +52 -0
  219. package/dist/index297.js +20 -0
  220. package/dist/index298.js +9 -0
  221. package/dist/index299.js +11 -0
  222. package/dist/index3.js +26 -0
  223. package/dist/index30.js +239 -0
  224. package/dist/index300.js +10 -0
  225. package/dist/index301.js +11 -0
  226. package/dist/index302.js +15 -0
  227. package/dist/index303.js +13 -0
  228. package/dist/index304.js +17 -0
  229. package/dist/index305.js +9 -0
  230. package/dist/index306.js +18 -0
  231. package/dist/index307.js +31 -0
  232. package/dist/index308.js +15 -0
  233. package/dist/index309.js +25 -0
  234. package/dist/index31.js +118 -0
  235. package/dist/index310.js +15 -0
  236. package/dist/index311.js +30 -0
  237. package/dist/index312.js +7 -0
  238. package/dist/index313.js +7 -0
  239. package/dist/index314.js +59 -0
  240. package/dist/index32.js +6 -0
  241. package/dist/index33.js +135 -0
  242. package/dist/index34.js +45 -0
  243. package/dist/index35.js +171 -0
  244. package/dist/index36.js +252 -0
  245. package/dist/index37.js +8 -0
  246. package/dist/index38.js +17 -0
  247. package/dist/index39.js +2731 -0
  248. package/dist/index4.js +28 -0
  249. package/dist/index40.js +8 -0
  250. package/dist/index41.js +59 -0
  251. package/dist/index42.js +29 -0
  252. package/dist/index43.js +134 -0
  253. package/dist/index44.js +25 -0
  254. package/dist/index45.js +240 -0
  255. package/dist/index46.js +31 -0
  256. package/dist/index47.js +253 -0
  257. package/dist/index48.js +20 -0
  258. package/dist/index49.js +12 -0
  259. package/dist/index5.js +36 -0
  260. package/dist/index50.js +263 -0
  261. package/dist/index51.js +15 -0
  262. package/dist/index52.js +33 -0
  263. package/dist/index53.js +341 -0
  264. package/dist/index54.js +43 -0
  265. package/dist/index55.js +29 -0
  266. package/dist/index56.js +21 -0
  267. package/dist/index57.js +15 -0
  268. package/dist/index58.js +12 -0
  269. package/dist/index59.js +15 -0
  270. package/dist/index6.js +22 -0
  271. package/dist/index60.js +77 -0
  272. package/dist/index61.js +91 -0
  273. package/dist/index62.js +15 -0
  274. package/dist/index63.js +21 -0
  275. package/dist/index64.js +24 -0
  276. package/dist/index65.js +73 -0
  277. package/dist/index66.js +17 -0
  278. package/dist/index67.js +21 -0
  279. package/dist/index68.js +21 -0
  280. package/dist/index69.js +16 -0
  281. package/dist/index7.js +137 -0
  282. package/dist/index70.js +4 -0
  283. package/dist/index71.js +12 -0
  284. package/dist/index72.js +16 -0
  285. package/dist/index73.js +8 -0
  286. package/dist/index74.js +15 -0
  287. package/dist/index75.js +24 -0
  288. package/dist/index76.js +165 -0
  289. package/dist/index77.js +25 -0
  290. package/dist/index78.js +35 -0
  291. package/dist/index79.js +15 -0
  292. package/dist/index8.js +35 -0
  293. package/dist/index80.js +21 -0
  294. package/dist/index81.js +178 -0
  295. package/dist/index82.js +12 -0
  296. package/dist/index83.js +864 -0
  297. package/dist/index84.js +38 -0
  298. package/dist/index85.js +12 -0
  299. package/dist/index86.js +245 -0
  300. package/dist/index87.js +313 -0
  301. package/dist/index88.js +229 -0
  302. package/dist/index89.js +12 -0
  303. package/dist/index9.js +56 -0
  304. package/dist/index90.js +4 -0
  305. package/dist/index91.js +35 -0
  306. package/dist/index92.js +245 -0
  307. package/dist/index93.js +29 -0
  308. package/dist/index94.js +9 -0
  309. package/dist/index95.js +70 -0
  310. package/dist/index96.js +54 -0
  311. package/dist/index97.js +8 -0
  312. package/dist/index98.js +27 -0
  313. package/dist/index99.js +36 -0
  314. package/dist/style.css +1 -1
  315. package/package.json +4 -3
  316. package/dist/index.umd.cjs +0 -202
@@ -0,0 +1,864 @@
1
+ "use client";
2
+ import * as t from "react";
3
+ import * as Re from "react-dom";
4
+ import { clamp as Te } from "./index119.js";
5
+ import { composeEventHandlers as E } from "./index94.js";
6
+ import { createCollection as nt } from "./index120.js";
7
+ import { useComposedRefs as k } from "./index93.js";
8
+ import { createContextScope as rt } from "./index95.js";
9
+ import { useDirection as st } from "./index109.js";
10
+ import { DismissableLayer as lt } from "./index102.js";
11
+ import { useFocusGuards as ct } from "./index105.js";
12
+ import { FocusScope as it } from "./index103.js";
13
+ import { useId as ye } from "./index101.js";
14
+ import { createPopperScope as Ee, Root as at, Anchor as dt, Content as ut, Arrow as pt } from "./index110.js";
15
+ import { Portal as ft } from "./index104.js";
16
+ import { Primitive as M } from "./index99.js";
17
+ import { createSlot as mt } from "./index41.js";
18
+ import { useCallbackRef as ht } from "./index112.js";
19
+ import { useControllableState as Pe } from "./index96.js";
20
+ import { useLayoutEffect as z } from "./index113.js";
21
+ import { usePrevious as vt } from "./index97.js";
22
+ import { VISUALLY_HIDDEN_STYLES as gt } from "./index111.js";
23
+ import { hideOthers as St } from "./index107.js";
24
+ import xt from "./index106.js";
25
+ import { j as d } from "./index40.js";
26
+ var wt = [" ", "Enter", "ArrowUp", "ArrowDown"], Ct = [" ", "Enter"], J = "Select", [ie, ae, yt] = nt(J), [te, io] = rt(J, [
27
+ yt,
28
+ Ee
29
+ ]), de = Ee(), [It, Y] = te(J), [Tt, Pt] = te(J), be = (n) => {
30
+ const {
31
+ __scopeSelect: c,
32
+ children: e,
33
+ open: i,
34
+ defaultOpen: l,
35
+ onOpenChange: p,
36
+ value: r,
37
+ defaultValue: s,
38
+ onValueChange: o,
39
+ dir: f,
40
+ name: g,
41
+ autoComplete: w,
42
+ disabled: P,
43
+ required: R,
44
+ form: T
45
+ } = n, a = de(c), [v, C] = t.useState(null), [u, h] = t.useState(null), [A, O] = t.useState(!1), oe = st(f), [b, L] = Pe({
46
+ prop: i,
47
+ defaultProp: l ?? !1,
48
+ onChange: p,
49
+ caller: J
50
+ }), [W, X] = Pe({
51
+ prop: r,
52
+ defaultProp: s,
53
+ onChange: o,
54
+ caller: J
55
+ }), B = t.useRef(null), V = v ? T || !!v.closest("form") : !0, [K, H] = t.useState(/* @__PURE__ */ new Set()), F = Array.from(K).map((_) => _.props.value).join(";");
56
+ return /* @__PURE__ */ d.jsx(at, { ...a, children: /* @__PURE__ */ d.jsxs(
57
+ It,
58
+ {
59
+ required: R,
60
+ scope: c,
61
+ trigger: v,
62
+ onTriggerChange: C,
63
+ valueNode: u,
64
+ onValueNodeChange: h,
65
+ valueNodeHasChildren: A,
66
+ onValueNodeHasChildrenChange: O,
67
+ contentId: ye(),
68
+ value: W,
69
+ onValueChange: X,
70
+ open: b,
71
+ onOpenChange: L,
72
+ dir: oe,
73
+ triggerPointerDownPosRef: B,
74
+ disabled: P,
75
+ children: [
76
+ /* @__PURE__ */ d.jsx(ie.Provider, { scope: c, children: /* @__PURE__ */ d.jsx(
77
+ Tt,
78
+ {
79
+ scope: n.__scopeSelect,
80
+ onNativeOptionAdd: t.useCallback((_) => {
81
+ H((j) => new Set(j).add(_));
82
+ }, []),
83
+ onNativeOptionRemove: t.useCallback((_) => {
84
+ H((j) => {
85
+ const U = new Set(j);
86
+ return U.delete(_), U;
87
+ });
88
+ }, []),
89
+ children: e
90
+ }
91
+ ) }),
92
+ V ? /* @__PURE__ */ d.jsxs(
93
+ Qe,
94
+ {
95
+ "aria-hidden": !0,
96
+ required: R,
97
+ tabIndex: -1,
98
+ name: g,
99
+ autoComplete: w,
100
+ value: W,
101
+ onChange: (_) => X(_.target.value),
102
+ disabled: P,
103
+ form: T,
104
+ children: [
105
+ W === void 0 ? /* @__PURE__ */ d.jsx("option", { value: "" }) : null,
106
+ Array.from(K)
107
+ ]
108
+ },
109
+ F
110
+ ) : null
111
+ ]
112
+ }
113
+ ) });
114
+ };
115
+ be.displayName = J;
116
+ var _e = "SelectTrigger", Ne = t.forwardRef(
117
+ (n, c) => {
118
+ const { __scopeSelect: e, disabled: i = !1, ...l } = n, p = de(e), r = Y(_e, e), s = r.disabled || i, o = k(c, r.onTriggerChange), f = ae(e), g = t.useRef("touch"), [w, P, R] = tt((a) => {
119
+ const v = f().filter((h) => !h.disabled), C = v.find((h) => h.value === r.value), u = ot(v, a, C);
120
+ u !== void 0 && r.onValueChange(u.value);
121
+ }), T = (a) => {
122
+ s || (r.onOpenChange(!0), R()), a && (r.triggerPointerDownPosRef.current = {
123
+ x: Math.round(a.pageX),
124
+ y: Math.round(a.pageY)
125
+ });
126
+ };
127
+ return /* @__PURE__ */ d.jsx(dt, { asChild: !0, ...p, children: /* @__PURE__ */ d.jsx(
128
+ M.button,
129
+ {
130
+ type: "button",
131
+ role: "combobox",
132
+ "aria-controls": r.contentId,
133
+ "aria-expanded": r.open,
134
+ "aria-required": r.required,
135
+ "aria-autocomplete": "none",
136
+ dir: r.dir,
137
+ "data-state": r.open ? "open" : "closed",
138
+ disabled: s,
139
+ "data-disabled": s ? "" : void 0,
140
+ "data-placeholder": et(r.value) ? "" : void 0,
141
+ ...l,
142
+ ref: o,
143
+ onClick: E(l.onClick, (a) => {
144
+ a.currentTarget.focus(), g.current !== "mouse" && T(a);
145
+ }),
146
+ onPointerDown: E(l.onPointerDown, (a) => {
147
+ g.current = a.pointerType;
148
+ const v = a.target;
149
+ v.hasPointerCapture(a.pointerId) && v.releasePointerCapture(a.pointerId), a.button === 0 && a.ctrlKey === !1 && a.pointerType === "mouse" && (T(a), a.preventDefault());
150
+ }),
151
+ onKeyDown: E(l.onKeyDown, (a) => {
152
+ const v = w.current !== "";
153
+ !(a.ctrlKey || a.altKey || a.metaKey) && a.key.length === 1 && P(a.key), !(v && a.key === " ") && wt.includes(a.key) && (T(), a.preventDefault());
154
+ })
155
+ }
156
+ ) });
157
+ }
158
+ );
159
+ Ne.displayName = _e;
160
+ var Me = "SelectValue", Ae = t.forwardRef(
161
+ (n, c) => {
162
+ const { __scopeSelect: e, className: i, style: l, children: p, placeholder: r = "", ...s } = n, o = Y(Me, e), { onValueNodeHasChildrenChange: f } = o, g = p !== void 0, w = k(c, o.onValueNodeChange);
163
+ return z(() => {
164
+ f(g);
165
+ }, [f, g]), /* @__PURE__ */ d.jsx(
166
+ M.span,
167
+ {
168
+ ...s,
169
+ ref: w,
170
+ style: { pointerEvents: "none" },
171
+ children: et(o.value) ? /* @__PURE__ */ d.jsx(d.Fragment, { children: r }) : p
172
+ }
173
+ );
174
+ }
175
+ );
176
+ Ae.displayName = Me;
177
+ var Rt = "SelectIcon", Oe = t.forwardRef(
178
+ (n, c) => {
179
+ const { __scopeSelect: e, children: i, ...l } = n;
180
+ return /* @__PURE__ */ d.jsx(M.span, { "aria-hidden": !0, ...l, ref: c, children: i || "▼" });
181
+ }
182
+ );
183
+ Oe.displayName = Rt;
184
+ var Et = "SelectPortal", De = (n) => /* @__PURE__ */ d.jsx(ft, { asChild: !0, ...n });
185
+ De.displayName = Et;
186
+ var Q = "SelectContent", Le = t.forwardRef(
187
+ (n, c) => {
188
+ const e = Y(Q, n.__scopeSelect), [i, l] = t.useState();
189
+ if (z(() => {
190
+ l(new DocumentFragment());
191
+ }, []), !e.open) {
192
+ const p = i;
193
+ return p ? Re.createPortal(
194
+ /* @__PURE__ */ d.jsx(je, { scope: n.__scopeSelect, children: /* @__PURE__ */ d.jsx(ie.Slot, { scope: n.__scopeSelect, children: /* @__PURE__ */ d.jsx("div", { children: n.children }) }) }),
195
+ p
196
+ ) : null;
197
+ }
198
+ return /* @__PURE__ */ d.jsx(ke, { ...n, ref: c });
199
+ }
200
+ );
201
+ Le.displayName = Q;
202
+ var D = 10, [je, q] = te(Q), bt = "SelectContentImpl", _t = mt("SelectContent.RemoveScroll"), ke = t.forwardRef(
203
+ (n, c) => {
204
+ const {
205
+ __scopeSelect: e,
206
+ position: i = "item-aligned",
207
+ onCloseAutoFocus: l,
208
+ onEscapeKeyDown: p,
209
+ onPointerDownOutside: r,
210
+ //
211
+ // PopperContent props
212
+ side: s,
213
+ sideOffset: o,
214
+ align: f,
215
+ alignOffset: g,
216
+ arrowPadding: w,
217
+ collisionBoundary: P,
218
+ collisionPadding: R,
219
+ sticky: T,
220
+ hideWhenDetached: a,
221
+ avoidCollisions: v,
222
+ //
223
+ ...C
224
+ } = n, u = Y(Q, e), [h, A] = t.useState(null), [O, oe] = t.useState(null), b = k(c, (m) => A(m)), [L, W] = t.useState(null), [X, B] = t.useState(
225
+ null
226
+ ), V = ae(e), [K, H] = t.useState(!1), F = t.useRef(!1);
227
+ t.useEffect(() => {
228
+ if (h) return St(h);
229
+ }, [h]), ct();
230
+ const _ = t.useCallback(
231
+ (m) => {
232
+ const [I, ...N] = V().map((x) => x.ref.current), [y] = N.slice(-1), S = document.activeElement;
233
+ for (const x of m)
234
+ if (x === S || (x == null || x.scrollIntoView({ block: "nearest" }), x === I && O && (O.scrollTop = 0), x === y && O && (O.scrollTop = O.scrollHeight), x == null || x.focus(), document.activeElement !== S)) return;
235
+ },
236
+ [V, O]
237
+ ), j = t.useCallback(
238
+ () => _([L, h]),
239
+ [_, L, h]
240
+ );
241
+ t.useEffect(() => {
242
+ K && j();
243
+ }, [K, j]);
244
+ const { onOpenChange: U, triggerPointerDownPosRef: G } = u;
245
+ t.useEffect(() => {
246
+ if (h) {
247
+ let m = { x: 0, y: 0 };
248
+ const I = (y) => {
249
+ var S, x;
250
+ m = {
251
+ x: Math.abs(Math.round(y.pageX) - (((S = G.current) == null ? void 0 : S.x) ?? 0)),
252
+ y: Math.abs(Math.round(y.pageY) - (((x = G.current) == null ? void 0 : x.y) ?? 0))
253
+ };
254
+ }, N = (y) => {
255
+ m.x <= 10 && m.y <= 10 ? y.preventDefault() : h.contains(y.target) || U(!1), document.removeEventListener("pointermove", I), G.current = null;
256
+ };
257
+ return G.current !== null && (document.addEventListener("pointermove", I), document.addEventListener("pointerup", N, { capture: !0, once: !0 })), () => {
258
+ document.removeEventListener("pointermove", I), document.removeEventListener("pointerup", N, { capture: !0 });
259
+ };
260
+ }
261
+ }, [h, U, G]), t.useEffect(() => {
262
+ const m = () => U(!1);
263
+ return window.addEventListener("blur", m), window.addEventListener("resize", m), () => {
264
+ window.removeEventListener("blur", m), window.removeEventListener("resize", m);
265
+ };
266
+ }, [U]);
267
+ const [ue, se] = tt((m) => {
268
+ const I = V().filter((S) => !S.disabled), N = I.find((S) => S.ref.current === document.activeElement), y = ot(I, m, N);
269
+ y && setTimeout(() => y.ref.current.focus());
270
+ }), pe = t.useCallback(
271
+ (m, I, N) => {
272
+ const y = !F.current && !N;
273
+ (u.value !== void 0 && u.value === I || y) && (W(m), y && (F.current = !0));
274
+ },
275
+ [u.value]
276
+ ), fe = t.useCallback(() => h == null ? void 0 : h.focus(), [h]), ee = t.useCallback(
277
+ (m, I, N) => {
278
+ const y = !F.current && !N;
279
+ (u.value !== void 0 && u.value === I || y) && B(m);
280
+ },
281
+ [u.value]
282
+ ), le = i === "popper" ? ge : Be, ne = le === ge ? {
283
+ side: s,
284
+ sideOffset: o,
285
+ align: f,
286
+ alignOffset: g,
287
+ arrowPadding: w,
288
+ collisionBoundary: P,
289
+ collisionPadding: R,
290
+ sticky: T,
291
+ hideWhenDetached: a,
292
+ avoidCollisions: v
293
+ } : {};
294
+ return /* @__PURE__ */ d.jsx(
295
+ je,
296
+ {
297
+ scope: e,
298
+ content: h,
299
+ viewport: O,
300
+ onViewportChange: oe,
301
+ itemRefCallback: pe,
302
+ selectedItem: L,
303
+ onItemLeave: fe,
304
+ itemTextRefCallback: ee,
305
+ focusSelectedItem: j,
306
+ selectedItemText: X,
307
+ position: i,
308
+ isPositioned: K,
309
+ searchRef: ue,
310
+ children: /* @__PURE__ */ d.jsx(xt, { as: _t, allowPinchZoom: !0, children: /* @__PURE__ */ d.jsx(
311
+ it,
312
+ {
313
+ asChild: !0,
314
+ trapped: u.open,
315
+ onMountAutoFocus: (m) => {
316
+ m.preventDefault();
317
+ },
318
+ onUnmountAutoFocus: E(l, (m) => {
319
+ var I;
320
+ (I = u.trigger) == null || I.focus({ preventScroll: !0 }), m.preventDefault();
321
+ }),
322
+ children: /* @__PURE__ */ d.jsx(
323
+ lt,
324
+ {
325
+ asChild: !0,
326
+ disableOutsidePointerEvents: !0,
327
+ onEscapeKeyDown: p,
328
+ onPointerDownOutside: r,
329
+ onFocusOutside: (m) => m.preventDefault(),
330
+ onDismiss: () => u.onOpenChange(!1),
331
+ children: /* @__PURE__ */ d.jsx(
332
+ le,
333
+ {
334
+ role: "listbox",
335
+ id: u.contentId,
336
+ "data-state": u.open ? "open" : "closed",
337
+ dir: u.dir,
338
+ onContextMenu: (m) => m.preventDefault(),
339
+ ...C,
340
+ ...ne,
341
+ onPlaced: () => H(!0),
342
+ ref: b,
343
+ style: {
344
+ // flex layout so we can place the scroll buttons properly
345
+ display: "flex",
346
+ flexDirection: "column",
347
+ // reset the outline by default as the content MAY get focused
348
+ outline: "none",
349
+ ...C.style
350
+ },
351
+ onKeyDown: E(C.onKeyDown, (m) => {
352
+ const I = m.ctrlKey || m.altKey || m.metaKey;
353
+ if (m.key === "Tab" && m.preventDefault(), !I && m.key.length === 1 && se(m.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(m.key)) {
354
+ let y = V().filter((S) => !S.disabled).map((S) => S.ref.current);
355
+ if (["ArrowUp", "End"].includes(m.key) && (y = y.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(m.key)) {
356
+ const S = m.target, x = y.indexOf(S);
357
+ y = y.slice(x + 1);
358
+ }
359
+ setTimeout(() => _(y)), m.preventDefault();
360
+ }
361
+ })
362
+ }
363
+ )
364
+ }
365
+ )
366
+ }
367
+ ) })
368
+ }
369
+ );
370
+ }
371
+ );
372
+ ke.displayName = bt;
373
+ var Nt = "SelectItemAlignedPosition", Be = t.forwardRef((n, c) => {
374
+ const { __scopeSelect: e, onPlaced: i, ...l } = n, p = Y(Q, e), r = q(Q, e), [s, o] = t.useState(null), [f, g] = t.useState(null), w = k(c, (b) => g(b)), P = ae(e), R = t.useRef(!1), T = t.useRef(!0), { viewport: a, selectedItem: v, selectedItemText: C, focusSelectedItem: u } = r, h = t.useCallback(() => {
375
+ if (p.trigger && p.valueNode && s && f && a && v && C) {
376
+ const b = p.trigger.getBoundingClientRect(), L = f.getBoundingClientRect(), W = p.valueNode.getBoundingClientRect(), X = C.getBoundingClientRect();
377
+ if (p.dir !== "rtl") {
378
+ const S = X.left - L.left, x = W.left - S, Z = b.left - x, $ = b.width + Z, me = Math.max($, L.width), he = window.innerWidth - D, ve = Te(x, [
379
+ D,
380
+ // Prevents the content from going off the starting edge of the
381
+ // viewport. It may still go off the ending edge, but this can be
382
+ // controlled by the user since they may want to manage overflow in a
383
+ // specific way.
384
+ // https://github.com/radix-ui/primitives/issues/2049
385
+ Math.max(D, he - me)
386
+ ]);
387
+ s.style.minWidth = $ + "px", s.style.left = ve + "px";
388
+ } else {
389
+ const S = L.right - X.right, x = window.innerWidth - W.right - S, Z = window.innerWidth - b.right - x, $ = b.width + Z, me = Math.max($, L.width), he = window.innerWidth - D, ve = Te(x, [
390
+ D,
391
+ Math.max(D, he - me)
392
+ ]);
393
+ s.style.minWidth = $ + "px", s.style.right = ve + "px";
394
+ }
395
+ const B = P(), V = window.innerHeight - D * 2, K = a.scrollHeight, H = window.getComputedStyle(f), F = parseInt(H.borderTopWidth, 10), _ = parseInt(H.paddingTop, 10), j = parseInt(H.borderBottomWidth, 10), U = parseInt(H.paddingBottom, 10), G = F + _ + K + U + j, ue = Math.min(v.offsetHeight * 5, G), se = window.getComputedStyle(a), pe = parseInt(se.paddingTop, 10), fe = parseInt(se.paddingBottom, 10), ee = b.top + b.height / 2 - D, le = V - ee, ne = v.offsetHeight / 2, m = v.offsetTop + ne, I = F + _ + m, N = G - I;
396
+ if (I <= ee) {
397
+ const S = B.length > 0 && v === B[B.length - 1].ref.current;
398
+ s.style.bottom = "0px";
399
+ const x = f.clientHeight - a.offsetTop - a.offsetHeight, Z = Math.max(
400
+ le,
401
+ ne + // viewport might have padding bottom, include it to avoid a scrollable viewport
402
+ (S ? fe : 0) + x + j
403
+ ), $ = I + Z;
404
+ s.style.height = $ + "px";
405
+ } else {
406
+ const S = B.length > 0 && v === B[0].ref.current;
407
+ s.style.top = "0px";
408
+ const Z = Math.max(
409
+ ee,
410
+ F + a.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
411
+ (S ? pe : 0) + ne
412
+ ) + N;
413
+ s.style.height = Z + "px", a.scrollTop = I - ee + a.offsetTop;
414
+ }
415
+ s.style.margin = `${D}px 0`, s.style.minHeight = ue + "px", s.style.maxHeight = V + "px", i == null || i(), requestAnimationFrame(() => R.current = !0);
416
+ }
417
+ }, [
418
+ P,
419
+ p.trigger,
420
+ p.valueNode,
421
+ s,
422
+ f,
423
+ a,
424
+ v,
425
+ C,
426
+ p.dir,
427
+ i
428
+ ]);
429
+ z(() => h(), [h]);
430
+ const [A, O] = t.useState();
431
+ z(() => {
432
+ f && O(window.getComputedStyle(f).zIndex);
433
+ }, [f]);
434
+ const oe = t.useCallback(
435
+ (b) => {
436
+ b && T.current === !0 && (h(), u == null || u(), T.current = !1);
437
+ },
438
+ [h, u]
439
+ );
440
+ return /* @__PURE__ */ d.jsx(
441
+ At,
442
+ {
443
+ scope: e,
444
+ contentWrapper: s,
445
+ shouldExpandOnScrollRef: R,
446
+ onScrollButtonChange: oe,
447
+ children: /* @__PURE__ */ d.jsx(
448
+ "div",
449
+ {
450
+ ref: o,
451
+ style: {
452
+ display: "flex",
453
+ flexDirection: "column",
454
+ position: "fixed",
455
+ zIndex: A
456
+ },
457
+ children: /* @__PURE__ */ d.jsx(
458
+ M.div,
459
+ {
460
+ ...l,
461
+ ref: w,
462
+ style: {
463
+ // When we get the height of the content, it includes borders. If we were to set
464
+ // the height without having `boxSizing: 'border-box'` it would be too big.
465
+ boxSizing: "border-box",
466
+ // We need to ensure the content doesn't get taller than the wrapper
467
+ maxHeight: "100%",
468
+ ...l.style
469
+ }
470
+ }
471
+ )
472
+ }
473
+ )
474
+ }
475
+ );
476
+ });
477
+ Be.displayName = Nt;
478
+ var Mt = "SelectPopperPosition", ge = t.forwardRef((n, c) => {
479
+ const {
480
+ __scopeSelect: e,
481
+ align: i = "start",
482
+ collisionPadding: l = D,
483
+ ...p
484
+ } = n, r = de(e);
485
+ return /* @__PURE__ */ d.jsx(
486
+ ut,
487
+ {
488
+ ...r,
489
+ ...p,
490
+ ref: c,
491
+ align: i,
492
+ collisionPadding: l,
493
+ style: {
494
+ // Ensure border-box for floating-ui calculations
495
+ boxSizing: "border-box",
496
+ ...p.style,
497
+ "--radix-select-content-transform-origin": "var(--radix-popper-transform-origin)",
498
+ "--radix-select-content-available-width": "var(--radix-popper-available-width)",
499
+ "--radix-select-content-available-height": "var(--radix-popper-available-height)",
500
+ "--radix-select-trigger-width": "var(--radix-popper-anchor-width)",
501
+ "--radix-select-trigger-height": "var(--radix-popper-anchor-height)"
502
+ }
503
+ }
504
+ );
505
+ });
506
+ ge.displayName = Mt;
507
+ var [At, Ie] = te(Q, {}), Se = "SelectViewport", Ve = t.forwardRef(
508
+ (n, c) => {
509
+ const { __scopeSelect: e, nonce: i, ...l } = n, p = q(Se, e), r = Ie(Se, e), s = k(c, p.onViewportChange), o = t.useRef(0);
510
+ return /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
511
+ /* @__PURE__ */ d.jsx(
512
+ "style",
513
+ {
514
+ dangerouslySetInnerHTML: {
515
+ __html: "[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"
516
+ },
517
+ nonce: i
518
+ }
519
+ ),
520
+ /* @__PURE__ */ d.jsx(ie.Slot, { scope: e, children: /* @__PURE__ */ d.jsx(
521
+ M.div,
522
+ {
523
+ "data-radix-select-viewport": "",
524
+ role: "presentation",
525
+ ...l,
526
+ ref: s,
527
+ style: {
528
+ // we use position: 'relative' here on the `viewport` so that when we call
529
+ // `selectedItem.offsetTop` in calculations, the offset is relative to the viewport
530
+ // (independent of the scrollUpButton).
531
+ position: "relative",
532
+ flex: 1,
533
+ // Viewport should only be scrollable in the vertical direction.
534
+ // This won't work in vertical writing modes, so we'll need to
535
+ // revisit this if/when that is supported
536
+ // https://developer.chrome.com/blog/vertical-form-controls
537
+ overflow: "hidden auto",
538
+ ...l.style
539
+ },
540
+ onScroll: E(l.onScroll, (f) => {
541
+ const g = f.currentTarget, { contentWrapper: w, shouldExpandOnScrollRef: P } = r;
542
+ if (P != null && P.current && w) {
543
+ const R = Math.abs(o.current - g.scrollTop);
544
+ if (R > 0) {
545
+ const T = window.innerHeight - D * 2, a = parseFloat(w.style.minHeight), v = parseFloat(w.style.height), C = Math.max(a, v);
546
+ if (C < T) {
547
+ const u = C + R, h = Math.min(T, u), A = u - h;
548
+ w.style.height = h + "px", w.style.bottom === "0px" && (g.scrollTop = A > 0 ? A : 0, w.style.justifyContent = "flex-end");
549
+ }
550
+ }
551
+ }
552
+ o.current = g.scrollTop;
553
+ })
554
+ }
555
+ ) })
556
+ ] });
557
+ }
558
+ );
559
+ Ve.displayName = Se;
560
+ var He = "SelectGroup", [Ot, Dt] = te(He), Fe = t.forwardRef(
561
+ (n, c) => {
562
+ const { __scopeSelect: e, ...i } = n, l = ye();
563
+ return /* @__PURE__ */ d.jsx(Ot, { scope: e, id: l, children: /* @__PURE__ */ d.jsx(M.div, { role: "group", "aria-labelledby": l, ...i, ref: c }) });
564
+ }
565
+ );
566
+ Fe.displayName = He;
567
+ var Ue = "SelectLabel", We = t.forwardRef(
568
+ (n, c) => {
569
+ const { __scopeSelect: e, ...i } = n, l = Dt(Ue, e);
570
+ return /* @__PURE__ */ d.jsx(M.div, { id: l.id, ...i, ref: c });
571
+ }
572
+ );
573
+ We.displayName = Ue;
574
+ var ce = "SelectItem", [Lt, Ke] = te(ce), Ge = t.forwardRef(
575
+ (n, c) => {
576
+ const {
577
+ __scopeSelect: e,
578
+ value: i,
579
+ disabled: l = !1,
580
+ textValue: p,
581
+ ...r
582
+ } = n, s = Y(ce, e), o = q(ce, e), f = s.value === i, [g, w] = t.useState(p ?? ""), [P, R] = t.useState(!1), T = k(
583
+ c,
584
+ (u) => {
585
+ var h;
586
+ return (h = o.itemRefCallback) == null ? void 0 : h.call(o, u, i, l);
587
+ }
588
+ ), a = ye(), v = t.useRef("touch"), C = () => {
589
+ l || (s.onValueChange(i), s.onOpenChange(!1));
590
+ };
591
+ if (i === "")
592
+ throw new Error(
593
+ "A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder."
594
+ );
595
+ return /* @__PURE__ */ d.jsx(
596
+ Lt,
597
+ {
598
+ scope: e,
599
+ value: i,
600
+ disabled: l,
601
+ textId: a,
602
+ isSelected: f,
603
+ onItemTextChange: t.useCallback((u) => {
604
+ w((h) => h || ((u == null ? void 0 : u.textContent) ?? "").trim());
605
+ }, []),
606
+ children: /* @__PURE__ */ d.jsx(
607
+ ie.ItemSlot,
608
+ {
609
+ scope: e,
610
+ value: i,
611
+ disabled: l,
612
+ textValue: g,
613
+ children: /* @__PURE__ */ d.jsx(
614
+ M.div,
615
+ {
616
+ role: "option",
617
+ "aria-labelledby": a,
618
+ "data-highlighted": P ? "" : void 0,
619
+ "aria-selected": f && P,
620
+ "data-state": f ? "checked" : "unchecked",
621
+ "aria-disabled": l || void 0,
622
+ "data-disabled": l ? "" : void 0,
623
+ tabIndex: l ? void 0 : -1,
624
+ ...r,
625
+ ref: T,
626
+ onFocus: E(r.onFocus, () => R(!0)),
627
+ onBlur: E(r.onBlur, () => R(!1)),
628
+ onClick: E(r.onClick, () => {
629
+ v.current !== "mouse" && C();
630
+ }),
631
+ onPointerUp: E(r.onPointerUp, () => {
632
+ v.current === "mouse" && C();
633
+ }),
634
+ onPointerDown: E(r.onPointerDown, (u) => {
635
+ v.current = u.pointerType;
636
+ }),
637
+ onPointerMove: E(r.onPointerMove, (u) => {
638
+ var h;
639
+ v.current = u.pointerType, l ? (h = o.onItemLeave) == null || h.call(o) : v.current === "mouse" && u.currentTarget.focus({ preventScroll: !0 });
640
+ }),
641
+ onPointerLeave: E(r.onPointerLeave, (u) => {
642
+ var h;
643
+ u.currentTarget === document.activeElement && ((h = o.onItemLeave) == null || h.call(o));
644
+ }),
645
+ onKeyDown: E(r.onKeyDown, (u) => {
646
+ var A;
647
+ ((A = o.searchRef) == null ? void 0 : A.current) !== "" && u.key === " " || (Ct.includes(u.key) && C(), u.key === " " && u.preventDefault());
648
+ })
649
+ }
650
+ )
651
+ }
652
+ )
653
+ }
654
+ );
655
+ }
656
+ );
657
+ Ge.displayName = ce;
658
+ var re = "SelectItemText", ze = t.forwardRef(
659
+ (n, c) => {
660
+ const { __scopeSelect: e, className: i, style: l, ...p } = n, r = Y(re, e), s = q(re, e), o = Ke(re, e), f = Pt(re, e), [g, w] = t.useState(null), P = k(
661
+ c,
662
+ (C) => w(C),
663
+ o.onItemTextChange,
664
+ (C) => {
665
+ var u;
666
+ return (u = s.itemTextRefCallback) == null ? void 0 : u.call(s, C, o.value, o.disabled);
667
+ }
668
+ ), R = g == null ? void 0 : g.textContent, T = t.useMemo(
669
+ () => /* @__PURE__ */ d.jsx("option", { value: o.value, disabled: o.disabled, children: R }, o.value),
670
+ [o.disabled, o.value, R]
671
+ ), { onNativeOptionAdd: a, onNativeOptionRemove: v } = f;
672
+ return z(() => (a(T), () => v(T)), [a, v, T]), /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
673
+ /* @__PURE__ */ d.jsx(M.span, { id: o.textId, ...p, ref: P }),
674
+ o.isSelected && r.valueNode && !r.valueNodeHasChildren ? Re.createPortal(p.children, r.valueNode) : null
675
+ ] });
676
+ }
677
+ );
678
+ ze.displayName = re;
679
+ var Ye = "SelectItemIndicator", qe = t.forwardRef(
680
+ (n, c) => {
681
+ const { __scopeSelect: e, ...i } = n;
682
+ return Ke(Ye, e).isSelected ? /* @__PURE__ */ d.jsx(M.span, { "aria-hidden": !0, ...i, ref: c }) : null;
683
+ }
684
+ );
685
+ qe.displayName = Ye;
686
+ var xe = "SelectScrollUpButton", Xe = t.forwardRef((n, c) => {
687
+ const e = q(xe, n.__scopeSelect), i = Ie(xe, n.__scopeSelect), [l, p] = t.useState(!1), r = k(c, i.onScrollButtonChange);
688
+ return z(() => {
689
+ if (e.viewport && e.isPositioned) {
690
+ let s = function() {
691
+ const f = o.scrollTop > 0;
692
+ p(f);
693
+ };
694
+ const o = e.viewport;
695
+ return s(), o.addEventListener("scroll", s), () => o.removeEventListener("scroll", s);
696
+ }
697
+ }, [e.viewport, e.isPositioned]), l ? /* @__PURE__ */ d.jsx(
698
+ $e,
699
+ {
700
+ ...n,
701
+ ref: r,
702
+ onAutoScroll: () => {
703
+ const { viewport: s, selectedItem: o } = e;
704
+ s && o && (s.scrollTop = s.scrollTop - o.offsetHeight);
705
+ }
706
+ }
707
+ ) : null;
708
+ });
709
+ Xe.displayName = xe;
710
+ var we = "SelectScrollDownButton", Ze = t.forwardRef((n, c) => {
711
+ const e = q(we, n.__scopeSelect), i = Ie(we, n.__scopeSelect), [l, p] = t.useState(!1), r = k(c, i.onScrollButtonChange);
712
+ return z(() => {
713
+ if (e.viewport && e.isPositioned) {
714
+ let s = function() {
715
+ const f = o.scrollHeight - o.clientHeight, g = Math.ceil(o.scrollTop) < f;
716
+ p(g);
717
+ };
718
+ const o = e.viewport;
719
+ return s(), o.addEventListener("scroll", s), () => o.removeEventListener("scroll", s);
720
+ }
721
+ }, [e.viewport, e.isPositioned]), l ? /* @__PURE__ */ d.jsx(
722
+ $e,
723
+ {
724
+ ...n,
725
+ ref: r,
726
+ onAutoScroll: () => {
727
+ const { viewport: s, selectedItem: o } = e;
728
+ s && o && (s.scrollTop = s.scrollTop + o.offsetHeight);
729
+ }
730
+ }
731
+ ) : null;
732
+ });
733
+ Ze.displayName = we;
734
+ var $e = t.forwardRef((n, c) => {
735
+ const { __scopeSelect: e, onAutoScroll: i, ...l } = n, p = q("SelectScrollButton", e), r = t.useRef(null), s = ae(e), o = t.useCallback(() => {
736
+ r.current !== null && (window.clearInterval(r.current), r.current = null);
737
+ }, []);
738
+ return t.useEffect(() => () => o(), [o]), z(() => {
739
+ var g;
740
+ const f = s().find((w) => w.ref.current === document.activeElement);
741
+ (g = f == null ? void 0 : f.ref.current) == null || g.scrollIntoView({ block: "nearest" });
742
+ }, [s]), /* @__PURE__ */ d.jsx(
743
+ M.div,
744
+ {
745
+ "aria-hidden": !0,
746
+ ...l,
747
+ ref: c,
748
+ style: { flexShrink: 0, ...l.style },
749
+ onPointerDown: E(l.onPointerDown, () => {
750
+ r.current === null && (r.current = window.setInterval(i, 50));
751
+ }),
752
+ onPointerMove: E(l.onPointerMove, () => {
753
+ var f;
754
+ (f = p.onItemLeave) == null || f.call(p), r.current === null && (r.current = window.setInterval(i, 50));
755
+ }),
756
+ onPointerLeave: E(l.onPointerLeave, () => {
757
+ o();
758
+ })
759
+ }
760
+ );
761
+ }), jt = "SelectSeparator", Je = t.forwardRef(
762
+ (n, c) => {
763
+ const { __scopeSelect: e, ...i } = n;
764
+ return /* @__PURE__ */ d.jsx(M.div, { "aria-hidden": !0, ...i, ref: c });
765
+ }
766
+ );
767
+ Je.displayName = jt;
768
+ var Ce = "SelectArrow", kt = t.forwardRef(
769
+ (n, c) => {
770
+ const { __scopeSelect: e, ...i } = n, l = de(e), p = Y(Ce, e), r = q(Ce, e);
771
+ return p.open && r.position === "popper" ? /* @__PURE__ */ d.jsx(pt, { ...l, ...i, ref: c }) : null;
772
+ }
773
+ );
774
+ kt.displayName = Ce;
775
+ var Bt = "SelectBubbleInput", Qe = t.forwardRef(
776
+ ({ __scopeSelect: n, value: c, ...e }, i) => {
777
+ const l = t.useRef(null), p = k(i, l), r = vt(c);
778
+ return t.useEffect(() => {
779
+ const s = l.current;
780
+ if (!s) return;
781
+ const o = window.HTMLSelectElement.prototype, g = Object.getOwnPropertyDescriptor(
782
+ o,
783
+ "value"
784
+ ).set;
785
+ if (r !== c && g) {
786
+ const w = new Event("change", { bubbles: !0 });
787
+ g.call(s, c), s.dispatchEvent(w);
788
+ }
789
+ }, [r, c]), /* @__PURE__ */ d.jsx(
790
+ M.select,
791
+ {
792
+ ...e,
793
+ style: { ...gt, ...e.style },
794
+ ref: p,
795
+ defaultValue: c
796
+ }
797
+ );
798
+ }
799
+ );
800
+ Qe.displayName = Bt;
801
+ function et(n) {
802
+ return n === "" || n === void 0;
803
+ }
804
+ function tt(n) {
805
+ const c = ht(n), e = t.useRef(""), i = t.useRef(0), l = t.useCallback(
806
+ (r) => {
807
+ const s = e.current + r;
808
+ c(s), function o(f) {
809
+ e.current = f, window.clearTimeout(i.current), f !== "" && (i.current = window.setTimeout(() => o(""), 1e3));
810
+ }(s);
811
+ },
812
+ [c]
813
+ ), p = t.useCallback(() => {
814
+ e.current = "", window.clearTimeout(i.current);
815
+ }, []);
816
+ return t.useEffect(() => () => window.clearTimeout(i.current), []), [e, l, p];
817
+ }
818
+ function ot(n, c, e) {
819
+ const l = c.length > 1 && Array.from(c).every((f) => f === c[0]) ? c[0] : c, p = e ? n.indexOf(e) : -1;
820
+ let r = Vt(n, Math.max(p, 0));
821
+ l.length === 1 && (r = r.filter((f) => f !== e));
822
+ const o = r.find(
823
+ (f) => f.textValue.toLowerCase().startsWith(l.toLowerCase())
824
+ );
825
+ return o !== e ? o : void 0;
826
+ }
827
+ function Vt(n, c) {
828
+ return n.map((e, i) => n[(c + i) % n.length]);
829
+ }
830
+ var ao = be, uo = Ne, po = Ae, fo = Oe, mo = De, ho = Le, vo = Ve, go = Fe, So = We, xo = Ge, wo = ze, Co = qe, yo = Xe, Io = Ze, To = Je;
831
+ export {
832
+ ho as Content,
833
+ go as Group,
834
+ fo as Icon,
835
+ xo as Item,
836
+ Co as ItemIndicator,
837
+ wo as ItemText,
838
+ So as Label,
839
+ mo as Portal,
840
+ ao as Root,
841
+ Io as ScrollDownButton,
842
+ yo as ScrollUpButton,
843
+ be as Select,
844
+ kt as SelectArrow,
845
+ Le as SelectContent,
846
+ Fe as SelectGroup,
847
+ Oe as SelectIcon,
848
+ Ge as SelectItem,
849
+ qe as SelectItemIndicator,
850
+ ze as SelectItemText,
851
+ We as SelectLabel,
852
+ De as SelectPortal,
853
+ Ze as SelectScrollDownButton,
854
+ Xe as SelectScrollUpButton,
855
+ Je as SelectSeparator,
856
+ Ne as SelectTrigger,
857
+ Ae as SelectValue,
858
+ Ve as SelectViewport,
859
+ To as Separator,
860
+ uo as Trigger,
861
+ po as Value,
862
+ vo as Viewport,
863
+ io as createSelectScope
864
+ };