@rpcbase/ui 0.177.0 → 0.178.0

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 (345) hide show
  1. package/dist/components/HourPickerField/index.d.ts.map +1 -1
  2. package/dist/components/PhoneNumberInput/suggestions.d.ts.map +1 -1
  3. package/dist/index10.js +1 -1
  4. package/dist/index100.js +3 -3
  5. package/dist/index100.js.map +1 -1
  6. package/dist/index101.js +4 -6
  7. package/dist/index101.js.map +1 -1
  8. package/dist/index102.js +6 -145
  9. package/dist/index102.js.map +1 -1
  10. package/dist/index103.js +144 -38
  11. package/dist/index103.js.map +1 -1
  12. package/dist/index104.js +39 -4
  13. package/dist/index104.js.map +1 -1
  14. package/dist/index105.js +4 -7
  15. package/dist/index105.js.map +1 -1
  16. package/dist/index106.js +6 -12
  17. package/dist/index106.js.map +1 -1
  18. package/dist/index107.js +13 -13
  19. package/dist/index107.js.map +1 -1
  20. package/dist/index108.js +13 -7
  21. package/dist/index108.js.map +1 -1
  22. package/dist/index109.js +6 -30
  23. package/dist/index109.js.map +1 -1
  24. package/dist/index11.js +269 -269
  25. package/dist/index11.js.map +1 -1
  26. package/dist/index110.js +31 -10
  27. package/dist/index110.js.map +1 -1
  28. package/dist/index111.js +10 -10
  29. package/dist/index111.js.map +1 -1
  30. package/dist/index112.js +10 -8
  31. package/dist/index112.js.map +1 -1
  32. package/dist/index113.js +8 -13
  33. package/dist/index113.js.map +1 -1
  34. package/dist/index114.js +13 -101
  35. package/dist/index114.js.map +1 -1
  36. package/dist/index115.js +102 -20
  37. package/dist/index115.js.map +1 -1
  38. package/dist/index116.js +20 -54
  39. package/dist/index116.js.map +1 -1
  40. package/dist/index117.js +51 -70
  41. package/dist/index117.js.map +1 -1
  42. package/dist/index118.js +72 -9
  43. package/dist/index118.js.map +1 -1
  44. package/dist/index119.js +9 -20
  45. package/dist/index119.js.map +1 -1
  46. package/dist/index12.js +1 -1
  47. package/dist/index120.js +20 -16
  48. package/dist/index120.js.map +1 -1
  49. package/dist/index121.js +16 -23
  50. package/dist/index121.js.map +1 -1
  51. package/dist/index122.js +23 -6
  52. package/dist/index122.js.map +1 -1
  53. package/dist/index123.js +6 -5
  54. package/dist/index123.js.map +1 -1
  55. package/dist/index124.js +5 -23
  56. package/dist/index124.js.map +1 -1
  57. package/dist/index125.js +24 -35
  58. package/dist/index125.js.map +1 -1
  59. package/dist/index126.js +35 -16
  60. package/dist/index126.js.map +1 -1
  61. package/dist/index127.js +16 -7
  62. package/dist/index127.js.map +1 -1
  63. package/dist/index128.js +6 -4
  64. package/dist/index128.js.map +1 -1
  65. package/dist/index129.js +4 -4
  66. package/dist/index129.js.map +1 -1
  67. package/dist/index13.js +2 -2
  68. package/dist/index130.js +4 -4
  69. package/dist/index130.js.map +1 -1
  70. package/dist/index131.js +4 -4
  71. package/dist/index131.js.map +1 -1
  72. package/dist/index132.js +4 -3
  73. package/dist/index132.js.map +1 -1
  74. package/dist/index133.js +3 -6
  75. package/dist/index133.js.map +1 -1
  76. package/dist/index134.js +7 -24
  77. package/dist/index134.js.map +1 -1
  78. package/dist/index135.js +24 -8
  79. package/dist/index135.js.map +1 -1
  80. package/dist/index136.js +7 -6
  81. package/dist/index136.js.map +1 -1
  82. package/dist/index137.js +6 -5
  83. package/dist/index137.js.map +1 -1
  84. package/dist/index138.js +5 -3
  85. package/dist/index138.js.map +1 -1
  86. package/dist/index139.js +3 -3
  87. package/dist/index139.js.map +1 -1
  88. package/dist/index14.js +4 -4
  89. package/dist/index140.js +3 -4
  90. package/dist/index140.js.map +1 -1
  91. package/dist/index141.js +4 -3
  92. package/dist/index141.js.map +1 -1
  93. package/dist/index142.js +3 -4
  94. package/dist/index142.js.map +1 -1
  95. package/dist/index143.js +4 -3
  96. package/dist/index143.js.map +1 -1
  97. package/dist/index144.js +3 -3
  98. package/dist/index144.js.map +1 -1
  99. package/dist/index145.js +3 -3
  100. package/dist/index145.js.map +1 -1
  101. package/dist/index146.js +3 -46
  102. package/dist/index146.js.map +1 -1
  103. package/dist/index147.js +44 -51
  104. package/dist/index147.js.map +1 -1
  105. package/dist/index148.js +2 -2
  106. package/dist/index15.js +1 -1
  107. package/dist/index150.js +2 -2
  108. package/dist/index153.js +5 -605
  109. package/dist/index153.js.map +1 -1
  110. package/dist/index154.js +68 -5
  111. package/dist/index154.js.map +1 -1
  112. package/dist/index155.js +2 -69
  113. package/dist/index155.js.map +1 -1
  114. package/dist/index156.js +364 -2
  115. package/dist/index156.js.map +1 -1
  116. package/dist/index157.js +201 -303
  117. package/dist/index157.js.map +1 -1
  118. package/dist/index158.js +46 -247
  119. package/dist/index158.js.map +1 -1
  120. package/dist/index159.js +42 -56
  121. package/dist/index159.js.map +1 -1
  122. package/dist/index16.js +1 -1
  123. package/dist/index160.js +169 -46
  124. package/dist/index160.js.map +1 -1
  125. package/dist/index161.js +96 -156
  126. package/dist/index161.js.map +1 -1
  127. package/dist/index162.js +24 -109
  128. package/dist/index162.js.map +1 -1
  129. package/dist/index163.js +8 -25
  130. package/dist/index163.js.map +1 -1
  131. package/dist/index164.js +5 -8
  132. package/dist/index164.js.map +1 -1
  133. package/dist/index165.js +5 -4
  134. package/dist/index165.js.map +1 -1
  135. package/dist/index166.js +4 -5
  136. package/dist/index166.js.map +1 -1
  137. package/dist/index167.js +466 -4
  138. package/dist/index167.js.map +1 -1
  139. package/dist/index168.js +139 -420
  140. package/dist/index168.js.map +1 -1
  141. package/dist/index169.js +71 -149
  142. package/dist/index169.js.map +1 -1
  143. package/dist/index17.js +1 -1
  144. package/dist/index170.js +229 -74
  145. package/dist/index170.js.map +1 -1
  146. package/dist/index171.js +9 -262
  147. package/dist/index171.js.map +1 -1
  148. package/dist/index172.js +42 -9
  149. package/dist/index172.js.map +1 -1
  150. package/dist/index173.js +4 -42
  151. package/dist/index173.js.map +1 -1
  152. package/dist/index174.js +605 -4
  153. package/dist/index174.js.map +1 -1
  154. package/dist/index179.js +1 -1
  155. package/dist/index18.js +314 -312
  156. package/dist/index18.js.map +1 -1
  157. package/dist/index19.js +7 -7
  158. package/dist/index20.js +6 -6
  159. package/dist/index20.js.map +1 -1
  160. package/dist/index21.js +1 -1
  161. package/dist/index22.js +1 -1
  162. package/dist/index226.js +1 -1
  163. package/dist/index227.js +1 -1
  164. package/dist/index229.js +1 -1
  165. package/dist/index23.js +2 -2
  166. package/dist/index231.js +1 -1
  167. package/dist/index232.js +1 -1
  168. package/dist/index233.js +4 -4
  169. package/dist/index234.js +2 -2
  170. package/dist/index238.js +12 -66
  171. package/dist/index238.js.map +1 -1
  172. package/dist/index239.js +150 -176
  173. package/dist/index239.js.map +1 -1
  174. package/dist/index24.js +1 -1
  175. package/dist/index240.js +27 -43
  176. package/dist/index240.js.map +1 -1
  177. package/dist/index241.js +9 -13
  178. package/dist/index241.js.map +1 -1
  179. package/dist/index242.js +40 -147
  180. package/dist/index242.js.map +1 -1
  181. package/dist/index243.js +10 -29
  182. package/dist/index243.js.map +1 -1
  183. package/dist/index244.js +44 -9
  184. package/dist/index244.js.map +1 -1
  185. package/dist/index245.js +88 -40
  186. package/dist/index245.js.map +1 -1
  187. package/dist/index246.js +85 -10
  188. package/dist/index246.js.map +1 -1
  189. package/dist/index247.js +102 -41
  190. package/dist/index247.js.map +1 -1
  191. package/dist/index248.js +45 -88
  192. package/dist/index248.js.map +1 -1
  193. package/dist/index249.js +10 -85
  194. package/dist/index249.js.map +1 -1
  195. package/dist/index250.js +28 -96
  196. package/dist/index250.js.map +1 -1
  197. package/dist/index251.js +8 -52
  198. package/dist/index251.js.map +1 -1
  199. package/dist/index252.js +115 -10
  200. package/dist/index252.js.map +1 -1
  201. package/dist/index253.js +16 -36
  202. package/dist/index253.js.map +1 -1
  203. package/dist/index254.js +15 -8
  204. package/dist/index254.js.map +1 -1
  205. package/dist/index255.js +3 -116
  206. package/dist/index255.js.map +1 -1
  207. package/dist/index256.js +35 -16
  208. package/dist/index256.js.map +1 -1
  209. package/dist/index257.js +19 -14
  210. package/dist/index257.js.map +1 -1
  211. package/dist/index258.js +9 -3
  212. package/dist/index258.js.map +1 -1
  213. package/dist/index259.js +8 -36
  214. package/dist/index259.js.map +1 -1
  215. package/dist/index260.js +67 -20
  216. package/dist/index260.js.map +1 -1
  217. package/dist/index261.js +180 -9
  218. package/dist/index261.js.map +1 -1
  219. package/dist/index262.js +46 -8
  220. package/dist/index262.js.map +1 -1
  221. package/dist/index263.js +4 -4
  222. package/dist/index265.js +2 -2
  223. package/dist/index27.js +37 -3
  224. package/dist/index27.js.map +1 -1
  225. package/dist/index277.js +1 -1
  226. package/dist/index28.js +3 -125
  227. package/dist/index28.js.map +1 -1
  228. package/dist/index29.js +120 -227
  229. package/dist/index29.js.map +1 -1
  230. package/dist/index30.js +229 -21
  231. package/dist/index30.js.map +1 -1
  232. package/dist/index31.js +23 -50
  233. package/dist/index31.js.map +1 -1
  234. package/dist/index32.js +50 -2640
  235. package/dist/index32.js.map +1 -1
  236. package/dist/index33.js +2598 -351
  237. package/dist/index33.js.map +1 -1
  238. package/dist/index34.js +375 -214
  239. package/dist/index34.js.map +1 -1
  240. package/dist/index35.js +230 -19
  241. package/dist/index35.js.map +1 -1
  242. package/dist/index36.js +18 -138
  243. package/dist/index36.js.map +1 -1
  244. package/dist/index37.js +125 -170
  245. package/dist/index37.js.map +1 -1
  246. package/dist/index38.js +174 -64
  247. package/dist/index38.js.map +1 -1
  248. package/dist/index39.js +74 -88
  249. package/dist/index39.js.map +1 -1
  250. package/dist/index4.js +8 -8
  251. package/dist/index4.js.map +1 -1
  252. package/dist/index40.js +98 -5
  253. package/dist/index40.js.map +1 -1
  254. package/dist/index41.js +5 -843
  255. package/dist/index41.js.map +1 -1
  256. package/dist/index42.js +832 -54
  257. package/dist/index42.js.map +1 -1
  258. package/dist/index43.js +66 -37
  259. package/dist/index43.js.map +1 -1
  260. package/dist/index46.js +1 -1
  261. package/dist/index47.js +1 -1
  262. package/dist/index48.js +7 -205
  263. package/dist/index48.js.map +1 -1
  264. package/dist/index49.js +33 -6
  265. package/dist/index49.js.map +1 -1
  266. package/dist/index5.js +1 -1
  267. package/dist/index50.js +26 -33
  268. package/dist/index50.js.map +1 -1
  269. package/dist/index51.js +7 -26
  270. package/dist/index51.js.map +1 -1
  271. package/dist/index52.js +11 -7
  272. package/dist/index52.js.map +1 -1
  273. package/dist/index53.js +205 -12
  274. package/dist/index53.js.map +1 -1
  275. package/dist/index55.js +2 -2
  276. package/dist/index56.js +1 -1
  277. package/dist/index57.js +1 -1
  278. package/dist/index59.js +4 -4
  279. package/dist/index61.js +4 -4
  280. package/dist/index62.js +2 -2
  281. package/dist/index63.js +2 -2
  282. package/dist/index67.js +2 -2
  283. package/dist/index70.js +6 -2
  284. package/dist/index70.js.map +1 -1
  285. package/dist/index71.js +8 -2
  286. package/dist/index71.js.map +1 -1
  287. package/dist/index72.js +5 -5
  288. package/dist/index72.js.map +1 -1
  289. package/dist/index73.js +53 -7
  290. package/dist/index73.js.map +1 -1
  291. package/dist/index74.js +2 -6
  292. package/dist/index74.js.map +1 -1
  293. package/dist/index75.js +2 -52
  294. package/dist/index75.js.map +1 -1
  295. package/dist/index76.js +52 -5
  296. package/dist/index76.js.map +1 -1
  297. package/dist/index77.js +4 -4
  298. package/dist/index77.js.map +1 -1
  299. package/dist/index78.js +4 -15
  300. package/dist/index78.js.map +1 -1
  301. package/dist/index79.js +15 -5
  302. package/dist/index79.js.map +1 -1
  303. package/dist/index8.js +1 -1
  304. package/dist/index80.js +5 -7
  305. package/dist/index80.js.map +1 -1
  306. package/dist/index81.js +6 -15
  307. package/dist/index81.js.map +1 -1
  308. package/dist/index82.js +16 -4
  309. package/dist/index82.js.map +1 -1
  310. package/dist/index83.js +1 -1
  311. package/dist/index83.js.map +1 -1
  312. package/dist/index84.js +4 -5
  313. package/dist/index84.js.map +1 -1
  314. package/dist/index85.js +4 -4
  315. package/dist/index85.js.map +1 -1
  316. package/dist/index86.js +5 -4
  317. package/dist/index86.js.map +1 -1
  318. package/dist/index87.js +2 -2
  319. package/dist/index87.js.map +1 -1
  320. package/dist/index88.js +3 -5
  321. package/dist/index88.js.map +1 -1
  322. package/dist/index89.js +6 -24
  323. package/dist/index89.js.map +1 -1
  324. package/dist/index9.js +1 -1
  325. package/dist/index90.js +24 -6
  326. package/dist/index90.js.map +1 -1
  327. package/dist/index91.js +6 -4
  328. package/dist/index91.js.map +1 -1
  329. package/dist/index92.js +3 -5
  330. package/dist/index92.js.map +1 -1
  331. package/dist/index93.js +6 -5
  332. package/dist/index93.js.map +1 -1
  333. package/dist/index94.js +5 -4
  334. package/dist/index94.js.map +1 -1
  335. package/dist/index95.js +3 -4
  336. package/dist/index95.js.map +1 -1
  337. package/dist/index96.js +5 -4
  338. package/dist/index96.js.map +1 -1
  339. package/dist/index97.js +4 -8
  340. package/dist/index97.js.map +1 -1
  341. package/dist/index98.js +8 -5
  342. package/dist/index98.js.map +1 -1
  343. package/dist/index99.js +5 -4
  344. package/dist/index99.js.map +1 -1
  345. package/package.json +1 -1
package/dist/index18.js CHANGED
@@ -1,183 +1,185 @@
1
- import { j as f } from "./index27.js";
1
+ import { j as a } from "./index28.js";
2
2
  import { Check as ue, ChevronDown as oe, ChevronUp as ae } from "lucide-react";
3
3
  import * as r from "react";
4
- import { DismissableLayerBranch as fe } from "./index28.js";
4
+ import { DismissableLayerBranch as fe } from "./index29.js";
5
5
  import { createPortal as de } from "react-dom";
6
6
  import { IMaskInput as me } from "react-imask";
7
7
  import pe, { InputMask as he } from "imask";
8
8
  import { Select as ve, SelectTrigger as be, SelectValue as ge, SelectContent as xe, SelectItem as we } from "./index20.js";
9
9
  import { useIsTouchDevice as ke } from "./index4.js";
10
- import { cn as q } from "./index2.js";
10
+ import { cn as W } from "./index2.js";
11
11
  const te = pe;
12
12
  typeof te.InputMask != "function" && (te.InputMask = he);
13
- function Z(m) {
14
- return String(m).padStart(2, "0");
13
+ function Z(d) {
14
+ return String(d).padStart(2, "0");
15
15
  }
16
- function ye(m) {
17
- const d = m.trim();
18
- if (!d) return null;
19
- const n = /^(\d{1,2}):(\d{2})$/.exec(d);
16
+ function Te(d) {
17
+ const f = d.trim();
18
+ if (!f) return null;
19
+ const n = /^(\d{1,2}):(\d{2})$/.exec(f);
20
20
  if (!n)
21
21
  return null;
22
22
  const i = Number(n[1]), o = Number(n[2]);
23
23
  return !Number.isFinite(i) || !Number.isFinite(o) || i < 0 || i > 23 || o < 0 || o > 59 ? null : `${Z(i)}:${Z(o)}`;
24
24
  }
25
- function Q(m, d) {
26
- const n = ye(m);
25
+ function Q(d, f) {
26
+ const n = Te(d);
27
27
  if (!n) return null;
28
- const i = d.find((o) => o.value === n);
29
- return B(i) ? { parsed: n, selectableValue: n } : { parsed: n, selectableValue: null };
28
+ const i = f.find((o) => o.value === n);
29
+ return z(i) ? { parsed: n, selectableValue: n } : { parsed: n, selectableValue: null };
30
30
  }
31
- function U(m) {
32
- const d = /^(\d{2}):(\d{2})$/.exec(m);
33
- if (!d)
31
+ function U(d) {
32
+ const f = /^(\d{2}):(\d{2})$/.exec(d);
33
+ if (!f)
34
34
  return null;
35
- const n = Number(d[1]), i = Number(d[2]);
35
+ const n = Number(f[1]), i = Number(f[2]);
36
36
  return !Number.isFinite(n) || !Number.isFinite(i) ? null : n * 60 + i;
37
37
  }
38
- function B(m) {
39
- return m ? !m.disabled : !1;
38
+ function z(d) {
39
+ return d ? !d.disabled : !1;
40
40
  }
41
- function re(m, d) {
41
+ function re(d, f) {
42
42
  let n = null, i = Number.POSITIVE_INFINITY, o = Number.NEGATIVE_INFINITY;
43
- for (const v of d) {
44
- if (!B(v)) continue;
45
- const g = U(v.value);
43
+ for (const h of f) {
44
+ if (!z(h)) continue;
45
+ const g = U(h.value);
46
46
  if (g == null) continue;
47
- const N = Math.abs(g - m);
48
- (N < i || N === i && g > o) && (n = v, i = N, o = g);
47
+ const N = Math.abs(g - d);
48
+ (N < i || N === i && g > o) && (n = h, i = N, o = g);
49
49
  }
50
50
  return n;
51
51
  }
52
52
  function ne({
53
- direction: m,
54
- viewportRef: d,
53
+ direction: d,
54
+ viewportRef: f,
55
55
  speed: n = 400,
56
56
  className: i
57
57
  }) {
58
- const [o, v] = r.useState(!0), g = r.useRef(void 0), N = r.useRef(void 0), p = r.useRef(!1), h = r.useCallback(() => {
59
- const y = d.current;
60
- if (!y) {
61
- v(!0);
58
+ const [o, h] = r.useState(!0), g = r.useRef(void 0), N = r.useRef(void 0), m = r.useRef(!1), p = r.useCallback(() => {
59
+ const T = f.current;
60
+ if (!T) {
61
+ h(!0);
62
62
  return;
63
63
  }
64
- const { scrollTop: x, scrollHeight: b, clientHeight: M } = y, w = 2, F = x > w, D = x < b - M - w;
65
- if (!(b > M + w)) {
66
- v(!0);
64
+ const { scrollTop: x, scrollHeight: v, clientHeight: E } = T, w = 2, F = x > w, M = x < v - E - w;
65
+ if (!(v > E + w)) {
66
+ h(!0);
67
67
  return;
68
68
  }
69
- v(m === "up" ? !F : !D);
70
- }, [m, d]);
69
+ h(d === "up" ? !F : !M);
70
+ }, [d, f]);
71
71
  r.useEffect(() => {
72
- const y = d.current;
73
- if (!y) return;
74
- h();
75
- const x = () => h(), b = () => h();
76
- y.addEventListener("scroll", x, { passive: !0 });
77
- const M = new ResizeObserver(b);
78
- M.observe(y);
79
- const w = new MutationObserver(b);
80
- return w.observe(y, { childList: !0, subtree: !0 }), () => {
81
- y.removeEventListener("scroll", x), M.disconnect(), w.disconnect();
72
+ const T = f.current;
73
+ if (!T) return;
74
+ p();
75
+ const x = () => p(), v = () => p();
76
+ T.addEventListener("scroll", x, { passive: !0 });
77
+ const E = new ResizeObserver(v);
78
+ E.observe(T);
79
+ const w = new MutationObserver(v);
80
+ return w.observe(T, { childList: !0, subtree: !0 }), () => {
81
+ T.removeEventListener("scroll", x), E.disconnect(), w.disconnect();
82
82
  };
83
- }, [d, h]);
84
- const I = r.useCallback(() => {
85
- g.current && (cancelAnimationFrame(g.current), g.current = void 0), p.current = !1, N.current = void 0;
86
- }, []), C = r.useCallback(
87
- (y) => {
88
- const x = d.current;
89
- if (!x || o || !p.current) {
90
- I();
83
+ }, [f, p]);
84
+ const j = r.useCallback(() => {
85
+ g.current && (cancelAnimationFrame(g.current), g.current = void 0), m.current = !1, N.current = void 0;
86
+ }, []), P = r.useCallback(
87
+ (T) => {
88
+ const x = f.current;
89
+ if (!x || o || !m.current) {
90
+ j();
91
91
  return;
92
92
  }
93
- N.current || (N.current = y);
94
- const b = y - N.current, M = n * b / 1e3;
95
- if (M < 0.1) {
96
- g.current = requestAnimationFrame(C);
93
+ N.current || (N.current = T);
94
+ const v = T - N.current, E = n * v / 1e3;
95
+ if (E < 0.1) {
96
+ g.current = requestAnimationFrame(P);
97
97
  return;
98
98
  }
99
99
  const w = x.scrollTop, F = x.scrollHeight - x.clientHeight;
100
- let D;
101
- m === "up" ? D = Math.max(0, w - M) : D = Math.min(F, w + M), x.scrollTop = D, N.current = y;
102
- const R = 1;
103
- (m === "up" ? D > R : D < F - R) && Math.abs(D - w) > 0.01 ? g.current = requestAnimationFrame(C) : (I(), setTimeout(h, 16));
100
+ let M;
101
+ d === "up" ? M = Math.max(0, w - E) : M = Math.min(F, w + E), x.scrollTo({ top: M }), N.current = T;
102
+ const L = 1;
103
+ (d === "up" ? M > L : M < F - L) && Math.abs(M - w) > 0.01 ? g.current = requestAnimationFrame(P) : (j(), setTimeout(p, 16));
104
104
  },
105
- [h, m, o, n, I, d]
106
- ), V = r.useCallback(() => {
107
- o || !d.current || p.current || (p.current = !0, N.current = void 0, g.current = requestAnimationFrame(C));
108
- }, [o, C, d]);
109
- return r.useEffect(() => I, [I]), /* @__PURE__ */ f.jsx(
105
+ [p, d, o, n, j, f]
106
+ ), q = r.useCallback(() => {
107
+ o || !f.current || m.current || (m.current = !0, N.current = void 0, g.current = requestAnimationFrame(P));
108
+ }, [o, P, f]);
109
+ return r.useEffect(() => j, [j]), /* @__PURE__ */ a.jsx(
110
110
  "div",
111
111
  {
112
- className: q(
112
+ className: W(
113
113
  "flex items-center justify-center py-1 select-none",
114
114
  o ? "cursor-default opacity-40" : "cursor-pointer opacity-100 hover:bg-accent/20",
115
115
  i
116
116
  ),
117
117
  onPointerEnter: () => {
118
- o || V();
118
+ o || q();
119
119
  },
120
120
  onPointerMove: () => {
121
- !o && !p.current && V();
121
+ !o && !m.current && q();
122
122
  },
123
123
  onPointerLeave: () => {
124
- I();
124
+ j();
125
125
  },
126
- children: m === "up" ? /* @__PURE__ */ f.jsx(ae, { "aria-hidden": !0, className: "h-4 w-4 opacity-50" }) : /* @__PURE__ */ f.jsx(oe, { "aria-hidden": !0, className: "h-4 w-4 opacity-50" })
126
+ children: d === "up" ? /* @__PURE__ */ a.jsx(ae, { "aria-hidden": !0, className: "h-4 w-4 opacity-50" }) : /* @__PURE__ */ a.jsx(oe, { "aria-hidden": !0, className: "h-4 w-4 opacity-50" })
127
127
  }
128
128
  );
129
129
  }
130
130
  function se({
131
- id: m,
132
- value: d,
131
+ id: d,
132
+ value: f,
133
133
  onChange: n,
134
134
  onValueUpdate: i,
135
135
  options: o,
136
- placeholder: v = "Select time",
136
+ placeholder: h = "Select time",
137
137
  className: g,
138
138
  inputClassName: N,
139
- disabled: p,
140
- readOnly: h,
141
- open: I,
142
- onOpenChange: C,
143
- triggerTestId: V,
144
- contentTestId: y,
139
+ disabled: m,
140
+ readOnly: p,
141
+ open: j,
142
+ onOpenChange: P,
143
+ triggerTestId: q,
144
+ contentTestId: T,
145
145
  isHydrated: x
146
146
  }) {
147
- const b = r.useId(), M = m ?? `hours-picker-${b}`, w = r.useRef(null), F = r.useRef(null), D = r.useRef(null), R = r.useRef(!1), [L, W] = r.useState(null), j = r.useRef(null), _ = r.useRef(null), z = r.useRef(null), [t, l] = r.useState(() => ({
147
+ const v = r.useId(), E = d ?? `hours-picker-${v}`, w = r.useRef(null), F = r.useRef(null), M = r.useCallback((e) => {
148
+ F.current = e;
149
+ }, []), L = r.useRef(null), C = r.useRef(!1), [O, I] = r.useState(null), J = r.useRef(null), _ = r.useRef(null), t = r.useRef(null), [l, k] = r.useState(() => ({
148
150
  left: 0,
149
151
  top: 0,
150
152
  width: 0
151
- })), [k, S] = r.useState(!1), u = I ?? k, H = C ?? S, X = typeof window > "u" ? r.useEffect : r.useLayoutEffect;
153
+ })), [S, R] = r.useState(!1), b = j ?? S, V = P ?? R;
152
154
  r.useEffect(() => {
153
- if (!u || p || h)
155
+ if (!b || m || p)
154
156
  return;
155
157
  const e = w.current;
156
158
  e instanceof HTMLInputElement && (typeof document < "u" && document.activeElement === e || e.focus({ preventScroll: !0 }));
157
- }, [p, u, h]);
159
+ }, [m, b, p]);
158
160
  const $ = r.useCallback((e) => {
159
- D.current = e, W(e);
161
+ L.current = e, I(e);
160
162
  }, []), ie = r.useCallback(() => {
161
- R.current = !0;
163
+ C.current = !0;
162
164
  }, []);
163
165
  r.useEffect(() => {
164
- if (!u) return;
165
- const e = o.find((c) => c.value === d);
166
- if (e && B(e)) {
166
+ if (!b) return;
167
+ const e = o.find((c) => c.value === f);
168
+ if (e && z(e)) {
167
169
  $(e.value);
168
170
  return;
169
171
  }
170
- const s = o.find((c) => B(c));
172
+ const s = o.find((c) => z(c));
171
173
  $(s?.value ?? null);
172
- }, [u, o, $, d]);
173
- const ce = r.useCallback(
174
+ }, [b, o, $, f]);
175
+ const le = r.useCallback(
174
176
  (e) => {
175
177
  if (e === null) {
176
178
  i && i(null);
177
179
  return;
178
180
  }
179
181
  const s = o.find((c) => c.value === e);
180
- B(s) && i && i(e);
182
+ z(s) && i && i(e);
181
183
  },
182
184
  [i, o]
183
185
  ), ee = r.useCallback(
@@ -187,191 +189,191 @@ function se({
187
189
  return;
188
190
  }
189
191
  const s = o.find((c) => c.value === e);
190
- B(s) && (i && i(e), n(e));
192
+ z(s) && (i && i(e), n(e));
191
193
  },
192
194
  [n, i, o]
193
195
  );
194
196
  r.useEffect(() => {
195
- if (!u) return;
197
+ if (!b) return;
196
198
  const e = (s) => {
197
199
  const c = s.target;
198
200
  if (!(c instanceof Node))
199
201
  return;
200
- const a = j.current;
201
- !a || a.contains(c) || _.current?.contains(c) || H(!1);
202
+ const u = J.current;
203
+ !u || u.contains(c) || _.current?.contains(c) || V(!1);
202
204
  };
203
205
  return document.addEventListener("pointerdown", e, !0), () => {
204
206
  document.removeEventListener("pointerdown", e, !0);
205
207
  };
206
- }, [u, H]), r.useEffect(() => {
207
- if (!u)
208
+ }, [b, V]), r.useEffect(() => {
209
+ if (!b)
208
210
  return;
209
211
  const e = _.current;
210
212
  if (!e)
211
213
  return;
212
214
  const s = (c) => {
213
- const a = z.current;
214
- if (!a)
215
+ const u = t.current;
216
+ if (!u)
215
217
  return;
216
- const E = c.deltaY;
217
- if (E === 0)
218
+ const D = c.deltaY;
219
+ if (D === 0)
218
220
  return;
219
- const A = Math.max(0, a.scrollHeight - a.clientHeight), T = a.scrollTop <= 0, G = a.scrollTop >= A, O = c.target;
220
- if (O instanceof Node && a.contains(O)) {
221
- (E < 0 && T || E > 0 && G) && c.preventDefault();
221
+ const A = Math.max(0, u.scrollHeight - u.clientHeight), y = u.scrollTop <= 0, G = u.scrollTop >= A, B = c.target;
222
+ if (B instanceof Node && u.contains(B)) {
223
+ (D < 0 && y || D > 0 && G) && c.preventDefault();
222
224
  return;
223
225
  }
224
226
  c.preventDefault();
225
- const K = Math.min(A, Math.max(0, a.scrollTop + E));
226
- a.scrollTop = K;
227
+ const K = Math.min(A, Math.max(0, u.scrollTop + D));
228
+ u.scrollTop = K;
227
229
  };
228
230
  return e.addEventListener("wheel", s, { passive: !1 }), () => {
229
231
  e.removeEventListener("wheel", s);
230
232
  };
231
- }, [u]), r.useEffect(() => {
232
- if (!u || I !== void 0 && !C || typeof window > "u" || !("IntersectionObserver" in window))
233
+ }, [b]), r.useEffect(() => {
234
+ if (!b || j !== void 0 && !P || typeof window > "u" || !("IntersectionObserver" in window))
233
235
  return;
234
236
  const e = w.current;
235
237
  if (!(e instanceof HTMLElement))
236
238
  return;
237
239
  let s = !0;
238
- const c = new IntersectionObserver((a) => {
240
+ const c = new IntersectionObserver((u) => {
239
241
  if (!s)
240
242
  return;
241
- const E = a[0];
242
- E && !E.isIntersecting && H(!1);
243
+ const D = u[0];
244
+ D && !D.isIntersecting && V(!1);
243
245
  });
244
246
  return c.observe(e), () => {
245
247
  s = !1, c.disconnect();
246
248
  };
247
- }, [C, u, I, H]);
249
+ }, [P, b, j, V]);
248
250
  const Y = r.useCallback(() => {
249
251
  if (typeof window > "u") return;
250
252
  const e = w.current, s = _.current;
251
253
  if (!(e instanceof HTMLElement) || !s) return;
252
- const c = e.getBoundingClientRect(), a = s.offsetHeight, E = window.innerWidth ?? 0, A = window.innerHeight ?? 0, T = 8, G = c.width;
253
- let O = c.left;
254
- O + G > E - T && (O = Math.max(T, E - G - T)), O < T && (O = T);
255
- let P = c.bottom + T;
256
- const K = P + a > A - T, J = c.top - a - T;
257
- K && J >= T && (P = J), P < T && (P = T), P + a > A - T && (P = Math.max(T, A - a - T)), l({ left: O, top: P, width: G });
254
+ const c = e.getBoundingClientRect(), u = s.offsetHeight, D = window.innerWidth ?? 0, A = window.innerHeight ?? 0, y = 8, G = c.width;
255
+ let B = c.left;
256
+ B + G > D - y && (B = Math.max(y, D - G - y)), B < y && (B = y);
257
+ let H = c.bottom + y;
258
+ const K = H + u > A - y, X = c.top - u - y;
259
+ K && X >= y && (H = X), H < y && (H = y), H + u > A - y && (H = Math.max(y, A - u - y)), k({ left: B, top: H, width: G });
258
260
  }, []);
259
- return X(() => {
260
- if (!u || p || typeof window > "u") return;
261
+ return r.useLayoutEffect(() => {
262
+ if (!b || m || typeof window > "u") return;
261
263
  Y();
262
264
  const e = window.requestAnimationFrame(Y);
263
265
  return window.addEventListener("scroll", Y, !0), window.addEventListener("resize", Y), () => {
264
266
  window.cancelAnimationFrame(e), window.removeEventListener("scroll", Y, !0), window.removeEventListener("resize", Y);
265
267
  };
266
- }, [p, u, Y]), r.useEffect(() => {
267
- if (!u) return;
268
- const e = z.current;
268
+ }, [m, b, Y]), r.useEffect(() => {
269
+ if (!b) return;
270
+ const e = t.current;
269
271
  if (!e) return;
270
272
  const c = requestAnimationFrame(() => {
271
- const a = e.querySelector('[role="option"][data-state="checked"]');
272
- if (a instanceof HTMLElement) {
273
- const K = a.offsetTop - 8, J = a.offsetTop + a.offsetHeight + 8;
273
+ const u = e.querySelector('[role="option"][data-state="checked"]');
274
+ if (u instanceof HTMLElement) {
275
+ const K = u.offsetTop - 8, X = u.offsetTop + u.offsetHeight + 8;
274
276
  if (K < e.scrollTop) {
275
277
  e.scrollTop = Math.max(0, K);
276
278
  return;
277
279
  }
278
- const le = e.scrollTop + e.clientHeight;
279
- J > le && (e.scrollTop = Math.max(0, J - e.clientHeight));
280
+ const ce = e.scrollTop + e.clientHeight;
281
+ X > ce && (e.scrollTop = Math.max(0, X - e.clientHeight));
280
282
  return;
281
283
  }
282
- const E = Array.from(e.querySelectorAll('[role="option"]'));
283
- if (!E.length) return;
284
- let A, T;
285
- for (const P of E) {
286
- if (!P.hasAttribute("data-disabled")) {
287
- A = P;
284
+ const D = Array.from(e.querySelectorAll('[role="option"]'));
285
+ if (!D.length) return;
286
+ let A, y;
287
+ for (const H of D) {
288
+ if (!H.hasAttribute("data-disabled")) {
289
+ A = H;
288
290
  break;
289
291
  }
290
- T = P;
292
+ y = H;
291
293
  }
292
294
  if (!A) return;
293
- const O = Math.max(0, (T || A).offsetTop - 8);
294
- e.scrollTop = O;
295
+ const B = Math.max(0, (y || A).offsetTop - 8);
296
+ e.scrollTop = B;
295
297
  });
296
298
  return () => cancelAnimationFrame(c);
297
- }, [u, o]), r.useEffect(() => {
298
- if (!u || !L || !R.current) return;
299
- const e = z.current;
299
+ }, [b, o]), r.useEffect(() => {
300
+ if (!b || !O || !C.current) return;
301
+ const e = t.current;
300
302
  if (!e) return;
301
- const s = e.querySelector(`[role="option"][data-value="${L}"]`);
303
+ const s = e.querySelector(`[role="option"][data-value="${O}"]`);
302
304
  if (!(s instanceof HTMLElement)) return;
303
- const c = 8, a = s.offsetTop - c, E = s.offsetTop + s.offsetHeight + c;
304
- if (a < e.scrollTop) {
305
- e.scrollTop = Math.max(0, a);
305
+ const c = 8, u = s.offsetTop - c, D = s.offsetTop + s.offsetHeight + c;
306
+ if (u < e.scrollTop) {
307
+ e.scrollTop = Math.max(0, u);
306
308
  return;
307
309
  }
308
310
  const A = e.scrollTop + e.clientHeight;
309
- E > A && (e.scrollTop = Math.max(0, E - e.clientHeight));
310
- }, [L, u]), /* @__PURE__ */ f.jsx(
311
+ D > A && (e.scrollTop = Math.max(0, D - e.clientHeight));
312
+ }, [O, b]), /* @__PURE__ */ a.jsx(
311
313
  "div",
312
314
  {
313
315
  "data-slot": "hours-picker-input",
314
- className: q("w-[150px]", g),
315
- ref: j,
316
- children: /* @__PURE__ */ f.jsxs("div", { className: "relative", children: [
317
- /* @__PURE__ */ f.jsx(
318
- Ee,
316
+ className: W("w-[150px]", g),
317
+ ref: J,
318
+ children: /* @__PURE__ */ a.jsxs("div", { className: "relative", children: [
319
+ /* @__PURE__ */ a.jsx(
320
+ De,
319
321
  {
320
- id: M,
321
- placeholder: v,
322
- value: d,
323
- onValueUpdate: ce,
322
+ id: E,
323
+ placeholder: h,
324
+ value: f,
325
+ onValueUpdate: le,
324
326
  onCommit: ee,
325
327
  options: o,
326
- disabled: p,
327
- readOnly: h,
328
- open: u,
329
- setOpen: H,
328
+ disabled: m,
329
+ readOnly: p,
330
+ open: b,
331
+ setOpen: V,
330
332
  inputClassName: N,
331
- triggerTestId: V,
333
+ triggerTestId: q,
332
334
  isHydrated: x,
333
- highlightedValueRef: D,
335
+ highlightedValueRef: L,
334
336
  setHighlightedValue: $,
335
337
  markKeyboardNavigation: ie,
336
338
  inputRef: (e) => {
337
339
  w.current = e;
338
340
  },
339
- setDraftValueRef: F
341
+ onDraftValueHandlerChange: M
340
342
  }
341
343
  ),
342
- u ? (() => {
343
- const e = /* @__PURE__ */ f.jsx(fe, { children: /* @__PURE__ */ f.jsxs(
344
+ b ? (() => {
345
+ const e = /* @__PURE__ */ a.jsx(fe, { children: /* @__PURE__ */ a.jsxs(
344
346
  "div",
345
347
  {
346
348
  ref: _,
347
- "data-testid": y,
349
+ "data-testid": T,
348
350
  "data-state": "open",
349
- className: q(
351
+ className: W(
350
352
  "pointer-events-auto fixed z-[60] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md",
351
353
  "data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95"
352
354
  ),
353
355
  style: {
354
- left: t.left,
355
- top: t.top,
356
- width: t.width
356
+ left: l.left,
357
+ top: l.top,
358
+ width: l.width
357
359
  },
358
360
  children: [
359
- /* @__PURE__ */ f.jsx(
361
+ /* @__PURE__ */ a.jsx(
360
362
  ne,
361
363
  {
362
364
  direction: "up",
363
- viewportRef: z
365
+ viewportRef: t
364
366
  }
365
367
  ),
366
- /* @__PURE__ */ f.jsx(
368
+ /* @__PURE__ */ a.jsx(
367
369
  "div",
368
370
  {
369
- ref: z,
371
+ ref: t,
370
372
  role: "listbox",
371
373
  className: "max-h-64 overflow-y-auto p-1 [overscroll-behavior:contain] [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",
372
374
  children: o.map((s) => {
373
- const c = s.value === d;
374
- return /* @__PURE__ */ f.jsxs(
375
+ const c = s.value === f;
376
+ return /* @__PURE__ */ a.jsxs(
375
377
  "div",
376
378
  {
377
379
  role: "option",
@@ -379,28 +381,28 @@ function se({
379
381
  "data-value": s.value,
380
382
  "data-state": c ? "checked" : "unchecked",
381
383
  "data-disabled": s.disabled ? "" : void 0,
382
- className: q(
384
+ className: W(
383
385
  "relative flex w-full select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none cursor-pointer",
384
386
  s.disabled && "pointer-events-none opacity-50",
385
- L === s.value && "bg-accent text-accent-foreground"
387
+ O === s.value && "bg-accent text-accent-foreground"
386
388
  ),
387
- onMouseDown: (a) => {
388
- a.preventDefault();
389
+ onMouseDown: (u) => {
390
+ u.preventDefault();
389
391
  },
390
392
  onClick: () => {
391
- s.disabled || (F.current?.(s.value), $(s.value), w.current?.focus({ preventScroll: !0 }), ee(s.value), H(!1));
393
+ s.disabled || (F.current?.(s.value), $(s.value), w.current?.focus({ preventScroll: !0 }), ee(s.value), V(!1));
392
394
  },
393
395
  onPointerEnter: () => {
394
- R.current || (R.current = !1, $(s.value));
396
+ C.current || (C.current = !1, $(s.value));
395
397
  },
396
- onPointerMove: (a) => {
397
- R.current && a.movementX === 0 && a.movementY === 0 || (R.current = !1, $(s.value));
398
+ onPointerMove: (u) => {
399
+ C.current && u.movementX === 0 && u.movementY === 0 || (C.current = !1, $(s.value));
398
400
  },
399
401
  children: [
400
- /* @__PURE__ */ f.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: c ? /* @__PURE__ */ f.jsx(ue, { "aria-hidden": !0, className: "h-4 w-4" }) : null }),
401
- /* @__PURE__ */ f.jsxs("div", { className: "flex flex-col", children: [
402
- /* @__PURE__ */ f.jsx("span", { children: s.label }),
403
- s.description != null ? /* @__PURE__ */ f.jsx("span", { "data-slot": "description", className: "text-xs text-muted-foreground", children: s.description }) : null
402
+ /* @__PURE__ */ a.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: c ? /* @__PURE__ */ a.jsx(ue, { "aria-hidden": !0, className: "h-4 w-4" }) : null }),
403
+ /* @__PURE__ */ a.jsxs("div", { className: "flex flex-col", children: [
404
+ /* @__PURE__ */ a.jsx("span", { children: s.label }),
405
+ s.description != null ? /* @__PURE__ */ a.jsx("span", { "data-slot": "description", className: "text-xs text-muted-foreground", children: s.description }) : null
404
406
  ] })
405
407
  ]
406
408
  },
@@ -409,11 +411,11 @@ function se({
409
411
  })
410
412
  }
411
413
  ),
412
- /* @__PURE__ */ f.jsx(
414
+ /* @__PURE__ */ a.jsx(
413
415
  ne,
414
416
  {
415
417
  direction: "down",
416
- viewportRef: z
418
+ viewportRef: t
417
419
  }
418
420
  )
419
421
  ]
@@ -426,71 +428,71 @@ function se({
426
428
  );
427
429
  }
428
430
  se.displayName = "HourPickerInput";
429
- function Te({
430
- id: m,
431
- value: d,
431
+ function ye({
432
+ id: d,
433
+ value: f,
432
434
  onChange: n,
433
435
  onValueUpdate: i,
434
436
  options: o,
435
- placeholder: v = "Select time",
437
+ placeholder: h = "Select time",
436
438
  className: g,
437
439
  inputClassName: N,
438
- disabled: p,
439
- open: h,
440
- onOpenChange: I,
441
- triggerTestId: C,
442
- contentTestId: V,
443
- isHydrated: y
440
+ disabled: m,
441
+ open: p,
442
+ onOpenChange: j,
443
+ triggerTestId: P,
444
+ contentTestId: q,
445
+ isHydrated: T
444
446
  }) {
445
447
  const x = r.useCallback(
446
- (b) => {
447
- const M = o.find((w) => w.value === b);
448
- B(M) && (i && i(b), n(b));
448
+ (v) => {
449
+ const E = o.find((w) => w.value === v);
450
+ z(E) && (i && i(v), n(v));
449
451
  },
450
452
  [n, i, o]
451
453
  );
452
- return /* @__PURE__ */ f.jsx("div", { "data-slot": "hours-picker-field", className: q("w-[150px]", g), children: /* @__PURE__ */ f.jsxs(
454
+ return /* @__PURE__ */ a.jsx("div", { "data-slot": "hours-picker-field", className: W("w-[150px]", g), children: /* @__PURE__ */ a.jsxs(
453
455
  ve,
454
456
  {
455
- disabled: p,
456
- open: h,
457
- onOpenChange: I,
458
- value: d ?? "",
459
- onValueChange: (b) => x(b),
457
+ disabled: m,
458
+ open: p,
459
+ onOpenChange: j,
460
+ value: f ?? "",
461
+ onValueChange: (v) => x(v),
460
462
  children: [
461
- /* @__PURE__ */ f.jsx(
463
+ /* @__PURE__ */ a.jsx(
462
464
  be,
463
465
  {
464
- id: m,
465
- "data-testid": C,
466
- "data-hydrated": y ? "true" : void 0,
467
- className: q(
466
+ id: d,
467
+ "data-testid": P,
468
+ "data-hydrated": T ? "true" : void 0,
469
+ className: W(
468
470
  "transition-colors hover:bg-accent hover:text-accent-foreground",
469
- !d && "text-muted-foreground",
470
- h && "ring-2 ring-primary ring-offset-2",
471
+ !f && "text-muted-foreground",
472
+ p && "ring-2 ring-primary ring-offset-2",
471
473
  "[&_[data-slot='description']]:hidden",
472
474
  N
473
475
  ),
474
- children: /* @__PURE__ */ f.jsx(ge, { placeholder: v })
476
+ children: /* @__PURE__ */ a.jsx(ge, { placeholder: h })
475
477
  }
476
478
  ),
477
- /* @__PURE__ */ f.jsx(
479
+ /* @__PURE__ */ a.jsx(
478
480
  xe,
479
481
  {
480
- "data-testid": V,
482
+ "data-testid": q,
481
483
  autoScroll: "firstEnabledWithContext",
482
484
  className: "max-h-64 overflow-y-auto",
483
- children: o.map((b) => /* @__PURE__ */ f.jsxs(
485
+ children: o.map((v) => /* @__PURE__ */ a.jsxs(
484
486
  we,
485
487
  {
486
- value: b.value,
487
- disabled: b.disabled,
488
+ value: v.value,
489
+ disabled: v.disabled,
488
490
  children: [
489
- /* @__PURE__ */ f.jsx("span", { children: b.label }),
490
- b.description != null ? /* @__PURE__ */ f.jsx("span", { "data-slot": "description", className: "block text-xs text-muted-foreground", children: b.description }) : null
491
+ /* @__PURE__ */ a.jsx("span", { children: v.label }),
492
+ v.description != null ? /* @__PURE__ */ a.jsx("span", { "data-slot": "description", className: "block text-xs text-muted-foreground", children: v.description }) : null
491
493
  ]
492
494
  },
493
- b.value
495
+ v.value
494
496
  ))
495
497
  }
496
498
  )
@@ -498,73 +500,73 @@ function Te({
498
500
  }
499
501
  ) });
500
502
  }
501
- function Se(m) {
502
- return ke() ? /* @__PURE__ */ f.jsx(Te, { ...m }) : /* @__PURE__ */ f.jsx(se, { ...m });
503
+ function Se(d) {
504
+ return ke() ? /* @__PURE__ */ a.jsx(ye, { ...d }) : /* @__PURE__ */ a.jsx(se, { ...d });
503
505
  }
504
506
  Se.displayName = "HourPickerField";
505
- function Ee({
506
- id: m,
507
- placeholder: d,
507
+ function De({
508
+ id: d,
509
+ placeholder: f,
508
510
  value: n,
509
511
  onValueUpdate: i,
510
512
  onCommit: o,
511
- options: v,
513
+ options: h,
512
514
  disabled: g,
513
515
  readOnly: N,
514
- open: p,
515
- setOpen: h,
516
- inputClassName: I,
517
- triggerTestId: C,
518
- isHydrated: V,
519
- highlightedValueRef: y,
516
+ open: m,
517
+ setOpen: p,
518
+ inputClassName: j,
519
+ triggerTestId: P,
520
+ isHydrated: q,
521
+ highlightedValueRef: T,
520
522
  setHighlightedValue: x,
521
- markKeyboardNavigation: b,
522
- inputRef: M,
523
- setDraftValueRef: w
523
+ markKeyboardNavigation: v,
524
+ inputRef: E,
525
+ onDraftValueHandlerChange: w
524
526
  }) {
525
- const F = r.useRef(!1), D = r.useRef(!1), R = r.useRef(!1), L = r.useRef(null), [W, j] = r.useState(() => n || "");
526
- r.useEffect(() => (w.current = (t) => {
527
- j(t);
528
- }, () => {
529
- w.current = null;
527
+ const F = r.useRef(!1), M = r.useRef(!1), L = r.useRef(!1), C = r.useRef(null), [O, I] = r.useState(() => n || "");
528
+ r.useEffect(() => (w((t) => {
529
+ I(t);
530
+ }), () => {
531
+ w(null);
530
532
  }), [w]);
531
- const _ = r.useCallback(
533
+ const J = r.useCallback(
532
534
  (t) => {
533
- const l = y.current ?? n ?? "";
534
- let k = v.findIndex((S) => S.value === l);
535
- k === -1 && (k = t === 1 ? -1 : v.length);
536
- for (let S = k + t; S >= 0 && S < v.length; S += t) {
537
- const u = v[S];
538
- if (B(u)) {
539
- x(u.value), L.current = u.value, j(u.value), i(u.value);
535
+ const l = T.current ?? n ?? "";
536
+ let k = h.findIndex((S) => S.value === l);
537
+ k === -1 && (k = t === 1 ? -1 : h.length);
538
+ for (let S = k + t; S >= 0 && S < h.length; S += t) {
539
+ const R = h[S];
540
+ if (z(R)) {
541
+ x(R.value), C.current = R.value, I(R.value), i(R.value);
540
542
  return;
541
543
  }
542
544
  }
543
545
  },
544
- [y, i, v, x, n]
546
+ [T, i, h, x, n]
545
547
  );
546
548
  r.useEffect(() => {
547
- F.current || j(n || "");
549
+ F.current || I(n || "");
548
550
  }, [n]);
549
- const z = q(
551
+ const _ = W(
550
552
  "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 pr-10 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
551
553
  "transition-colors group-hover:bg-accent group-hover:text-accent-foreground",
552
- !W && "text-muted-foreground",
553
- p && "ring-2 ring-primary ring-offset-2",
554
+ !O && "text-muted-foreground",
555
+ m && "ring-2 ring-primary ring-offset-2",
554
556
  "[&_[data-slot='description']]:hidden",
555
- I
557
+ j
556
558
  );
557
- return /* @__PURE__ */ f.jsxs("div", { className: "relative group", children: [
558
- /* @__PURE__ */ f.jsx(
559
+ return /* @__PURE__ */ a.jsxs("div", { className: "relative group", children: [
560
+ /* @__PURE__ */ a.jsx(
559
561
  me,
560
562
  {
561
- id: m,
562
- "data-testid": C,
563
- "data-hydrated": V ? "true" : void 0,
563
+ id: d,
564
+ "data-testid": P,
565
+ "data-hydrated": q ? "true" : void 0,
564
566
  type: "text",
565
567
  disabled: g,
566
568
  readOnly: N,
567
- inputRef: M,
569
+ inputRef: E,
568
570
  autoComplete: "off",
569
571
  mask: [
570
572
  { mask: "00:00", lazy: !0 },
@@ -574,26 +576,26 @@ function Ee({
574
576
  const k = (l.value + t).replace(/\D/g, "");
575
577
  if (k.length <= 2 || k.length >= 4) return l.compiledMasks[0];
576
578
  const S = Z(Number(k.slice(0, 2)));
577
- return v.some((H) => H.value.startsWith(`${S}:`)) ? l.compiledMasks[0] : l.compiledMasks[1];
579
+ return h.some((b) => b.value.startsWith(`${S}:`)) ? l.compiledMasks[0] : l.compiledMasks[1];
578
580
  },
579
- placeholder: d,
580
- value: W,
581
- className: z,
581
+ placeholder: f,
582
+ value: O,
583
+ className: _,
582
584
  onAccept: (t) => {
583
585
  const l = typeof t == "string" ? t : String(t ?? "");
584
- j(l), l.replace(/\D/g, "").length === 0 && n && o(null);
586
+ I(l), l.replace(/\D/g, "").length === 0 && n && o(null);
585
587
  },
586
588
  onComplete: (t) => {
587
589
  const l = typeof t == "string" ? t : String(t ?? "");
588
- if (L.current === l) {
589
- L.current = null;
590
+ if (C.current === l) {
591
+ C.current = null;
590
592
  return;
591
593
  }
592
- const k = Q(l, v);
594
+ const k = Q(l, h);
593
595
  if (!k)
594
596
  return;
595
597
  if (k.selectableValue) {
596
- if (x(k.selectableValue), j(k.selectableValue), n === k.selectableValue)
598
+ if (x(k.selectableValue), I(k.selectableValue), n === k.selectableValue)
597
599
  return;
598
600
  o(k.selectableValue);
599
601
  return;
@@ -601,104 +603,104 @@ function Ee({
601
603
  const S = U(k.parsed);
602
604
  if (S == null)
603
605
  return;
604
- const u = re(S, v);
605
- u && x(u.value);
606
+ const R = re(S, h);
607
+ R && x(R.value);
606
608
  },
607
609
  onPointerDown: () => {
608
- D.current = !0, !g && (p || h(!0));
610
+ M.current = !0, !g && (m || p(!0));
609
611
  },
610
612
  onMouseDown: (t) => {
611
- D.current = !0, R.current = typeof document < "u" && document.activeElement === t.currentTarget, !g && (p || h(!0));
613
+ M.current = !0, L.current = typeof document < "u" && document.activeElement === t.currentTarget, !g && (m || p(!0));
612
614
  },
613
615
  onClick: () => {
614
- g || p || h(!0);
616
+ g || m || p(!0);
615
617
  },
616
618
  onKeyDown: (t) => {
617
619
  if (!g) {
618
- if (t.key === "Tab" && p && !t.defaultPrevented) {
619
- h(!1);
620
+ if (t.key === "Tab" && m && !t.defaultPrevented) {
621
+ p(!1);
620
622
  return;
621
623
  }
622
624
  if (t.key === "Escape") {
623
- if (!p)
625
+ if (!m)
624
626
  return;
625
- t.preventDefault(), h(!1);
627
+ t.preventDefault(), p(!1);
626
628
  return;
627
629
  }
628
- if (!p && !t.defaultPrevented && (t.key.length === 1 || t.key === "Backspace" || t.key === "Delete") && !t.ctrlKey && !t.metaKey && !t.altKey && h(!0), t.key === "ArrowDown" || t.key === "ArrowUp") {
629
- if (b(), t.preventDefault(), !p) {
630
- h(!0);
630
+ if (!m && !t.defaultPrevented && (t.key.length === 1 || t.key === "Backspace" || t.key === "Delete") && !t.ctrlKey && !t.metaKey && !t.altKey && p(!0), t.key === "ArrowDown" || t.key === "ArrowUp") {
631
+ if (v(), t.preventDefault(), !m) {
632
+ p(!0);
631
633
  return;
632
634
  }
633
- _(t.key === "ArrowDown" ? 1 : -1);
635
+ J(t.key === "ArrowDown" ? 1 : -1);
634
636
  return;
635
637
  }
636
638
  if (t.key === "Enter") {
637
- b();
638
- const l = Q(W, v);
639
+ v();
640
+ const l = Q(O, h);
639
641
  if (!l) {
640
- if (!p || W.trim() !== "")
642
+ if (!m || O.trim() !== "")
641
643
  return;
642
- const u = v.find((X) => X.value === y.current), H = (B(u) ? u?.value : void 0) ?? v.find((X) => B(X))?.value;
643
- if (!H)
644
+ const R = h.find((V) => V.value === T.current), b = (z(R) ? R?.value : void 0) ?? h.find((V) => z(V))?.value;
645
+ if (!b)
644
646
  return;
645
- t.preventDefault(), x(H), j(H), o(H), h(!1);
647
+ t.preventDefault(), x(b), I(b), o(b), p(!1);
646
648
  return;
647
649
  }
648
650
  if (l.selectableValue) {
649
- t.preventDefault(), x(l.selectableValue), j(l.selectableValue), o(l.selectableValue), h(!1);
651
+ t.preventDefault(), x(l.selectableValue), I(l.selectableValue), o(l.selectableValue), p(!1);
650
652
  return;
651
653
  }
652
654
  const k = U(l.parsed);
653
655
  if (k == null)
654
656
  return;
655
- const S = re(k, v);
657
+ const S = re(k, h);
656
658
  if (!S)
657
659
  return;
658
- t.preventDefault(), x(S.value), j(S.value), o(S.value), h(!1);
660
+ t.preventDefault(), x(S.value), I(S.value), o(S.value), p(!1);
659
661
  return;
660
662
  }
661
663
  }
662
664
  },
663
665
  onFocus: (t) => {
664
- const l = !D.current || !R.current;
665
- if (D.current = !1, R.current = !1, F.current = !0, l) {
666
+ const l = !M.current || !L.current;
667
+ if (M.current = !1, L.current = !1, F.current = !0, l) {
666
668
  const k = t.currentTarget;
667
669
  requestAnimationFrame(() => k.select());
668
670
  }
669
- g || p || h(!0);
671
+ g || m || p(!0);
670
672
  },
671
673
  onBlur: () => {
672
674
  F.current = !1;
673
- const t = W.trim();
675
+ const t = O.trim();
674
676
  if (!t) {
675
- j(n || "");
677
+ I(n || "");
676
678
  return;
677
679
  }
678
- const l = Q(t, v);
680
+ const l = Q(t, h);
679
681
  if (!l) {
680
- j(n || "");
682
+ I(n || "");
681
683
  return;
682
684
  }
683
685
  if (!l.selectableValue) {
684
- j(n || "");
686
+ I(n || "");
685
687
  return;
686
688
  }
687
- j(l.selectableValue), n !== l.selectableValue && o(l.selectableValue);
689
+ I(l.selectableValue), n !== l.selectableValue && o(l.selectableValue);
688
690
  }
689
691
  }
690
692
  ),
691
- /* @__PURE__ */ f.jsx(
693
+ /* @__PURE__ */ a.jsx(
692
694
  "button",
693
695
  {
694
696
  type: "button",
695
697
  tabIndex: -1,
696
698
  disabled: g,
697
699
  "data-slot": "hours-picker-input-toggle",
698
- className: q(
700
+ className: W(
699
701
  "absolute right-1 top-1/2 inline-flex size-8 -translate-y-1/2 items-center justify-center rounded-md text-muted-foreground transition-colors hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"
700
702
  ),
701
- "aria-label": p ? "Close time picker" : "Open time picker",
703
+ "aria-label": m ? "Close time picker" : "Open time picker",
702
704
  onPointerDown: (t) => {
703
705
  t.preventDefault();
704
706
  },
@@ -706,9 +708,9 @@ function Ee({
706
708
  t.preventDefault();
707
709
  },
708
710
  onClick: () => {
709
- g || h(!p);
711
+ g || p(!m);
710
712
  },
711
- children: /* @__PURE__ */ f.jsx(oe, { "aria-hidden": !0, className: "size-4" })
713
+ children: /* @__PURE__ */ a.jsx(oe, { "aria-hidden": !0, className: "size-4" })
712
714
  }
713
715
  )
714
716
  ] });