@rpcbase/ui 0.260.0 → 0.262.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 (261) hide show
  1. package/dist/assets/sha256.worker-BEf4_Y9w.js.map +1 -0
  2. package/dist/components/FilesUploadField/index.d.ts +19 -6
  3. package/dist/components/FilesUploadField/index.d.ts.map +1 -1
  4. package/dist/components/FilesUploadField/sha256.d.ts +5 -0
  5. package/dist/components/FilesUploadField/sha256.d.ts.map +1 -0
  6. package/dist/components/FilesUploadField/sha256.worker.d.ts +4 -0
  7. package/dist/components/FilesUploadField/sha256.worker.d.ts.map +1 -0
  8. package/dist/components/ImagesField/index.d.ts +4 -2
  9. package/dist/components/ImagesField/index.d.ts.map +1 -1
  10. package/dist/index.js +10 -10
  11. package/dist/index298.js +11 -803
  12. package/dist/index298.js.map +1 -1
  13. package/dist/index299.js +865 -28
  14. package/dist/index299.js.map +1 -1
  15. package/dist/index300.js +26 -510
  16. package/dist/index300.js.map +1 -1
  17. package/dist/index301.js +481 -755
  18. package/dist/index301.js.map +1 -1
  19. package/dist/index302.js +786 -7428
  20. package/dist/index302.js.map +1 -1
  21. package/dist/index303.js +7429 -7
  22. package/dist/index303.js.map +1 -1
  23. package/dist/index304.js +6 -12
  24. package/dist/index304.js.map +1 -1
  25. package/dist/index305.js +12 -5
  26. package/dist/index305.js.map +1 -1
  27. package/dist/index306.js +3 -3
  28. package/dist/index306.js.map +1 -1
  29. package/dist/index307.js +5 -469
  30. package/dist/index307.js.map +1 -1
  31. package/dist/index308.js +464 -32
  32. package/dist/index308.js.map +1 -1
  33. package/dist/index309.js +36 -18
  34. package/dist/index309.js.map +1 -1
  35. package/dist/index310.js +17 -28
  36. package/dist/index310.js.map +1 -1
  37. package/dist/index311.js +30 -4
  38. package/dist/index311.js.map +1 -1
  39. package/dist/index312.js +4 -59
  40. package/dist/index312.js.map +1 -1
  41. package/dist/index313.js +59 -9
  42. package/dist/index313.js.map +1 -1
  43. package/dist/index314.js +9 -5
  44. package/dist/index314.js.map +1 -1
  45. package/dist/index315.js +5 -9
  46. package/dist/index315.js.map +1 -1
  47. package/dist/index316.js +9 -12
  48. package/dist/index316.js.map +1 -1
  49. package/dist/index317.js +13 -3
  50. package/dist/index317.js.map +1 -1
  51. package/dist/index318.js +3 -17
  52. package/dist/index318.js.map +1 -1
  53. package/dist/index319.js +14 -23
  54. package/dist/index319.js.map +1 -1
  55. package/dist/index320.js +23 -39
  56. package/dist/index320.js.map +1 -1
  57. package/dist/index321.js +41 -5
  58. package/dist/index321.js.map +1 -1
  59. package/dist/index322.js +5 -25
  60. package/dist/index322.js.map +1 -1
  61. package/dist/index323.js +24 -18
  62. package/dist/index323.js.map +1 -1
  63. package/dist/index324.js +17 -32
  64. package/dist/index324.js.map +1 -1
  65. package/dist/index325.js +34 -5
  66. package/dist/index325.js.map +1 -1
  67. package/dist/index326.js +5 -9
  68. package/dist/index326.js.map +1 -1
  69. package/dist/index327.js +8 -7
  70. package/dist/index327.js.map +1 -1
  71. package/dist/index328.js +8 -9
  72. package/dist/index328.js.map +1 -1
  73. package/dist/index329.js +9 -10
  74. package/dist/index329.js.map +1 -1
  75. package/dist/index330.js +10 -7
  76. package/dist/index330.js.map +1 -1
  77. package/dist/index331.js +7 -75
  78. package/dist/index331.js.map +1 -1
  79. package/dist/index332.js +66 -153
  80. package/dist/index332.js.map +1 -1
  81. package/dist/index333.js +147 -99
  82. package/dist/index333.js.map +1 -1
  83. package/dist/index334.js +113 -13
  84. package/dist/index334.js.map +1 -1
  85. package/dist/index335.js +12 -78
  86. package/dist/index335.js.map +1 -1
  87. package/dist/index336.js +57 -23
  88. package/dist/index336.js.map +1 -1
  89. package/dist/index337.js +45 -12
  90. package/dist/index337.js.map +1 -1
  91. package/dist/index338.js +13 -16
  92. package/dist/index338.js.map +1 -1
  93. package/dist/index339.js +15 -100
  94. package/dist/index339.js.map +1 -1
  95. package/dist/index340.js +95 -50
  96. package/dist/index340.js.map +1 -1
  97. package/dist/index341.js +5 -57
  98. package/dist/index341.js.map +1 -1
  99. package/dist/index342.js +78 -41
  100. package/dist/index342.js.map +1 -1
  101. package/dist/index343.js +58 -100
  102. package/dist/index343.js.map +1 -1
  103. package/dist/index344.js +104 -46
  104. package/dist/index344.js.map +1 -1
  105. package/dist/index345.js +51 -39
  106. package/dist/index345.js.map +1 -1
  107. package/dist/index346.js +42 -142
  108. package/dist/index346.js.map +1 -1
  109. package/dist/index347.js +123 -120
  110. package/dist/index347.js.map +1 -1
  111. package/dist/index348.js +108 -224
  112. package/dist/index348.js.map +1 -1
  113. package/dist/index349.js +174 -158
  114. package/dist/index349.js.map +1 -1
  115. package/dist/index350.js +144 -213
  116. package/dist/index350.js.map +1 -1
  117. package/dist/index351.js +309 -5
  118. package/dist/index351.js.map +1 -1
  119. package/dist/index352.js +5 -6
  120. package/dist/index352.js.map +1 -1
  121. package/dist/index353.js +6 -7
  122. package/dist/index353.js.map +1 -1
  123. package/dist/index354.js +5 -4
  124. package/dist/index354.js.map +1 -1
  125. package/dist/index355.js +4 -4
  126. package/dist/index355.js.map +1 -1
  127. package/dist/index356.js +6 -21
  128. package/dist/index356.js.map +1 -1
  129. package/dist/index357.js +21 -10
  130. package/dist/index357.js.map +1 -1
  131. package/dist/index358.js +10 -128
  132. package/dist/index358.js.map +1 -1
  133. package/dist/index359.js +122 -36
  134. package/dist/index359.js.map +1 -1
  135. package/dist/index360.js +38 -64
  136. package/dist/index360.js.map +1 -1
  137. package/dist/index361.js +66 -115
  138. package/dist/index361.js.map +1 -1
  139. package/dist/index362.js +112 -485
  140. package/dist/index362.js.map +1 -1
  141. package/dist/index363.js +490 -13
  142. package/dist/index363.js.map +1 -1
  143. package/dist/index364.js +13 -4
  144. package/dist/index364.js.map +1 -1
  145. package/dist/index365.js +4 -47
  146. package/dist/index365.js.map +1 -1
  147. package/dist/index366.js +44 -15
  148. package/dist/index366.js.map +1 -1
  149. package/dist/index367.js +19 -5
  150. package/dist/index367.js.map +1 -1
  151. package/dist/index368.js +5 -27
  152. package/dist/index368.js.map +1 -1
  153. package/dist/index369.js +27 -48
  154. package/dist/index369.js.map +1 -1
  155. package/dist/index370.js +46 -27
  156. package/dist/index370.js.map +1 -1
  157. package/dist/index371.js +27 -16
  158. package/dist/index371.js.map +1 -1
  159. package/dist/index372.js +16 -41
  160. package/dist/index372.js.map +1 -1
  161. package/dist/index373.js +42 -14
  162. package/dist/index373.js.map +1 -1
  163. package/dist/index374.js +14 -10
  164. package/dist/index374.js.map +1 -1
  165. package/dist/index375.js +9 -51
  166. package/dist/index375.js.map +1 -1
  167. package/dist/index376.js +53 -43
  168. package/dist/index376.js.map +1 -1
  169. package/dist/index377.js +43 -16
  170. package/dist/index377.js.map +1 -1
  171. package/dist/index378.js +15 -4
  172. package/dist/index378.js.map +1 -1
  173. package/dist/index379.js +4 -4
  174. package/dist/index379.js.map +1 -1
  175. package/dist/index380.js +4 -9
  176. package/dist/index380.js.map +1 -1
  177. package/dist/index381.js +9 -340
  178. package/dist/index381.js.map +1 -1
  179. package/dist/index382.js +339 -4
  180. package/dist/index382.js.map +1 -1
  181. package/dist/index383.js +5 -16
  182. package/dist/index383.js.map +1 -1
  183. package/dist/index384.js +16 -111
  184. package/dist/index384.js.map +1 -1
  185. package/dist/index385.js +109 -19
  186. package/dist/index385.js.map +1 -1
  187. package/dist/index386.js +18 -18
  188. package/dist/index386.js.map +1 -1
  189. package/dist/index387.js +21 -5
  190. package/dist/index387.js.map +1 -1
  191. package/dist/index388.js +5 -20
  192. package/dist/index388.js.map +1 -1
  193. package/dist/index389.js +19 -13
  194. package/dist/index389.js.map +1 -1
  195. package/dist/index390.js +13 -84
  196. package/dist/index390.js.map +1 -1
  197. package/dist/index391.js +84 -7
  198. package/dist/index391.js.map +1 -1
  199. package/dist/index392.js +9 -29
  200. package/dist/index392.js.map +1 -1
  201. package/dist/index393.js +28 -9
  202. package/dist/index393.js.map +1 -1
  203. package/dist/index394.js +9 -5
  204. package/dist/index394.js.map +1 -1
  205. package/dist/index395.js +6 -252
  206. package/dist/index395.js.map +1 -1
  207. package/dist/index396.js +250 -10
  208. package/dist/index396.js.map +1 -1
  209. package/dist/index397.js +11 -10
  210. package/dist/index397.js.map +1 -1
  211. package/dist/index398.js +10 -6
  212. package/dist/index398.js.map +1 -1
  213. package/dist/index399.js +6 -22
  214. package/dist/index399.js.map +1 -1
  215. package/dist/index400.js +21 -21
  216. package/dist/index400.js.map +1 -1
  217. package/dist/index401.js +21 -107
  218. package/dist/index401.js.map +1 -1
  219. package/dist/index402.js +109 -15
  220. package/dist/index402.js.map +1 -1
  221. package/dist/index403.js +15 -12
  222. package/dist/index403.js.map +1 -1
  223. package/dist/index404.js +10 -8
  224. package/dist/index404.js.map +1 -1
  225. package/dist/index405.js +8 -242
  226. package/dist/index405.js.map +1 -1
  227. package/dist/index406.js +238 -25
  228. package/dist/index406.js.map +1 -1
  229. package/dist/index407.js +29 -51
  230. package/dist/index407.js.map +1 -1
  231. package/dist/index408.js +51 -10
  232. package/dist/index408.js.map +1 -1
  233. package/dist/index409.js +11 -128
  234. package/dist/index409.js.map +1 -1
  235. package/dist/index410.js +124 -35
  236. package/dist/index410.js.map +1 -1
  237. package/dist/index411.js +36 -23
  238. package/dist/index411.js.map +1 -1
  239. package/dist/index412.js +26 -11
  240. package/dist/index412.js.map +1 -1
  241. package/dist/index413.js +11 -23
  242. package/dist/index413.js.map +1 -1
  243. package/dist/index414.js +19 -13
  244. package/dist/index414.js.map +1 -1
  245. package/dist/index415.js +14 -13
  246. package/dist/index415.js.map +1 -1
  247. package/dist/index416.js +14 -322
  248. package/dist/index416.js.map +1 -1
  249. package/dist/index417.js +323 -61
  250. package/dist/index417.js.map +1 -1
  251. package/dist/index418.js +63 -4
  252. package/dist/index418.js.map +1 -1
  253. package/dist/index419.js +4 -28
  254. package/dist/index419.js.map +1 -1
  255. package/dist/index420.js +25 -468
  256. package/dist/index420.js.map +1 -1
  257. package/dist/index421.js +452 -250
  258. package/dist/index421.js.map +1 -1
  259. package/dist/index422.js +272 -0
  260. package/dist/index422.js.map +1 -0
  261. package/package.json +2 -1
package/dist/index381.js CHANGED
@@ -1,344 +1,13 @@
1
- "use client";
2
- import { useRefWithInit as e } from "./index185.js";
3
- import { useMergedRefs as t } from "./index186.js";
4
- import { EMPTY_ARRAY as n, EMPTY_OBJECT as r } from "./index191.js";
5
- import { mergeProps as i } from "./index195.js";
6
- import { useStableCallback as a } from "./index202.js";
7
- import { useIsoLayoutEffect as o } from "./index204.js";
8
- import { none as ee } from "./index208.js";
9
- import { createChangeEventDetails as s } from "./index209.js";
10
- import { useValueAsRef as te } from "./index227.js";
11
- import { visuallyHidden as ne, visuallyHiddenInput as re } from "./index230.js";
12
- import { useClick as ie } from "./index245.js";
13
- import { useDismiss as ae } from "./index246.js";
14
- import { useOnFirstRender as oe } from "./index250.js";
15
- import { useStore as c } from "./index260.js";
16
- import { Store as se } from "./index261.js";
17
- import { useTransitionStatus as ce } from "./index265.js";
18
- import { useOpenChangeComplete as le } from "./index267.js";
19
- import { FOCUSABLE_POPUP_PROPS as ue } from "./index268.js";
20
- import { useFloatingRootContext as de } from "./index272.js";
21
- import { useListNavigation as fe } from "./index274.js";
22
- import { useTypeahead as pe } from "./index275.js";
23
- import { useValueChanged as me } from "./index291.js";
24
- import { useOpenInteractionType as he } from "./index292.js";
25
- import { usePreviousValue as ge } from "./index363.js";
26
- import { isElementDisabled as _e } from "./index364.js";
27
- import { useControlled as l } from "./index365.js";
28
- import { SelectFloatingContext as ve, SelectRootContext as ye } from "./index366.js";
29
- import { useFieldRootContext as be } from "./index369.js";
30
- import { useRegisterFieldControl as xe } from "./index370.js";
31
- import { useLabelableId as Se } from "./index372.js";
32
- import { compareItemEquality as Ce, defaultItemEquality as we, findItemIndex as Te } from "./index373.js";
33
- import { stringifyAsLabel as Ee, stringifyAsValue as u } from "./index375.js";
34
- import { selectors as d } from "./index376.js";
35
- import { useFormContext as De } from "./index377.js";
36
- import { areArraysEqual as Oe } from "./index378.js";
37
- import { getMaxScrollOffset as ke, normalizeScrollOffset as Ae } from "./index380.js";
38
- import * as f from "react";
39
- import { jsx as p, jsxs as je } from "react/jsx-runtime";
40
- //#region ../../node_modules/@base-ui/react/select/root/SelectRoot.mjs
41
- function Me(Me) {
42
- let { id: Ne, value: Pe, defaultValue: m = null, onValueChange: Fe, open: Ie, defaultOpen: Le = !1, onOpenChange: Re, name: h, form: g, autoComplete: ze, disabled: Be = !1, readOnly: _ = !1, required: v = !1, modal: y = !0, actionsRef: b, inputRef: Ve, onOpenChangeComplete: x, items: S, multiple: C = !1, itemToStringLabel: w, itemToStringValue: T, isItemEqualToValue: E = we, highlightItemOnHover: D = !0, children: He } = Me, { clearErrors: Ue } = De(), { setDirty: We, setTouched: Ge, setFocused: Ke, validityData: qe, setFilled: O, name: Je, disabled: Ye, validation: k, validationMode: Xe } = be(), A = Se({ id: Ne }), j = Ye || Be, M = Je ?? h, [N, Ze] = l({
43
- controlled: Pe,
44
- default: C ? m ?? n : m,
45
- name: "Select",
46
- state: "value"
47
- }), [P, Qe] = l({
48
- controlled: Ie,
49
- default: Le,
50
- name: "Select",
51
- state: "open"
52
- }), F = f.useRef([]), I = f.useRef([]), L = f.useRef(null), $e = f.useRef(null), et = f.useRef(0), tt = f.useRef(null), R = f.useRef([]), z = f.useRef(!1), nt = f.useRef(null), B = f.useRef(null), rt = f.useRef({
53
- allowSelectedMouseUp: !1,
54
- allowUnselectedMouseUp: !1,
55
- dragY: 0
56
- }), it = f.useRef(!1), { mounted: V, setMounted: at, transitionStatus: H } = ce(P), { openMethod: ot, triggerProps: st } = he(P), U = e(() => new se({
57
- id: A,
58
- labelId: void 0,
59
- modal: y,
60
- multiple: C,
61
- itemToStringLabel: w,
62
- itemToStringValue: T,
63
- isItemEqualToValue: E,
64
- value: N,
65
- open: P,
66
- mounted: V,
67
- transitionStatus: H,
68
- items: S,
69
- forceMount: !1,
70
- openMethod: null,
71
- activeIndex: null,
72
- selectedIndex: null,
73
- popupProps: {},
74
- triggerProps: {},
75
- triggerElement: null,
76
- positionerElement: null,
77
- listElement: null,
78
- popupSide: null,
79
- scrollUpArrowVisible: !1,
80
- scrollDownArrowVisible: !1,
81
- hasScrollArrows: !1
82
- })).current, ct = c(U, d.activeIndex), lt = c(U, d.selectedIndex), ut = c(U, d.triggerElement), dt = c(U, d.positionerElement), ft = ge(ot), pt = ot ?? ft ?? null, mt = f.useMemo(() => C ? "" : u(N, T), [
83
- C,
84
- N,
85
- T
86
- ]), ht = f.useMemo(() => C && Array.isArray(N) ? N.map((e) => u(e, T)) : u(N, T), [
87
- C,
88
- N,
89
- T
90
- ]);
91
- xe(te(U.state.triggerElement), A, N, a(() => ht), !j, h);
92
- let gt = f.useRef(N), W = C ? Array.isArray(N) && N.length > 0 : N != null && u(N, T) !== "";
93
- o(() => {
94
- N !== gt.current && U.set("forceMount", !0);
95
- }, [U, N]), o(() => {
96
- O(W);
97
- }, [W, O]), o(function() {
98
- let e = R.current, t;
99
- if (C) {
100
- let n = Array.isArray(N) ? N : [];
101
- if (n.length === 0) t = null;
102
- else {
103
- let r = n[n.length - 1], i = Te(e, r, E);
104
- t = i === -1 ? null : i;
105
- }
106
- } else {
107
- let n = Te(e, N, E);
108
- t = n === -1 ? null : n;
109
- }
110
- t === null && (B.current = null), !P && U.set("selectedIndex", t);
111
- }, [
112
- W,
113
- C,
114
- P,
115
- N,
116
- R,
117
- E,
118
- U,
119
- B
120
- ]);
121
- function _t(e) {
122
- let t = qe.initialValue;
123
- return Array.isArray(e) && Array.isArray(t) ? !Oe(e, t, (e, t) => Ce(e, t, E)) : e !== t;
124
- }
125
- me(N, () => {
126
- Ue(M), We(_t(N)), k.change(N);
127
- });
128
- let G = a((e, t) => {
129
- Re?.(e, t), !t.isCanceled && (Qe(e), !e && (t.reason === "focus-out" || t.reason === "outside-press") && (Ge(!0), Ke(!1), Xe === "onBlur" && k.commit(N)));
130
- }), K = a(() => {
131
- at(!1), U.update({
132
- activeIndex: null,
133
- openMethod: null
134
- }), x?.(!1);
135
- });
136
- le({
137
- enabled: !b,
138
- open: P,
139
- ref: L,
140
- onComplete() {
141
- P || K();
142
- }
143
- }), f.useImperativeHandle(b, () => ({ unmount: K }), [K]);
144
- let q = a((e, t) => {
145
- Fe?.(e, t), !t.isCanceled && Ze(e);
146
- }), vt = a(() => {
147
- let e = U.state.listElement || L.current;
148
- if (!e) return;
149
- let t = ke(e.scrollHeight, e.clientHeight), n = Ae(e.scrollTop, t), r = n > 0, i = n < t;
150
- U.state.scrollUpArrowVisible !== r && U.set("scrollUpArrowVisible", r), U.state.scrollDownArrowVisible !== i && U.set("scrollDownArrowVisible", i);
151
- }), J = de({
152
- open: P,
153
- onOpenChange: G,
154
- elements: {
155
- reference: ut,
156
- floating: dt
157
- }
158
- }), yt = ie(J, {
159
- enabled: !_ && !j,
160
- event: "mousedown"
161
- }), Y = ae(J), X = fe(J, {
162
- enabled: !_ && !j,
163
- listRef: F,
164
- activeIndex: ct,
165
- selectedIndex: lt,
166
- disabledIndices: n,
167
- onNavigate(e) {
168
- e === null && !P || U.set("activeIndex", e);
169
- },
170
- focusItemOnHover: D
171
- }), Z = pe(J, {
172
- enabled: !_ && !j && (P || !C),
173
- listRef: I,
174
- activeIndex: ct,
175
- selectedIndex: lt,
176
- disabledIndices: (e) => _e(F.current[e]),
177
- onMatch(e) {
178
- P ? U.set("activeIndex", e) : q(R.current[e], s("none"));
179
- },
180
- onTyping(e) {
181
- z.current = e;
182
- }
183
- }), Q = f.useMemo(() => {
184
- let e = i(Z.reference, X.reference, Y.reference, yt.reference, st);
185
- return A && (e.id = A), e;
186
- }, [
187
- yt.reference,
188
- Z.reference,
189
- X.reference,
190
- Y.reference,
191
- st,
192
- A
193
- ]), $ = f.useMemo(() => i(ue, Z.floating, X.floating, Y.floating), [
194
- Z.floating,
195
- X.floating,
196
- Y.floating
197
- ]), bt = X.item ?? r;
198
- oe(() => {
199
- U.update({
200
- popupProps: $,
201
- triggerProps: Q
202
- });
203
- }), o(() => {
204
- U.update({
205
- id: A,
206
- modal: y,
207
- multiple: C,
208
- value: N,
209
- open: P,
210
- mounted: V,
211
- transitionStatus: H,
212
- popupProps: $,
213
- triggerProps: Q,
214
- items: S,
215
- itemToStringLabel: w,
216
- itemToStringValue: T,
217
- isItemEqualToValue: E,
218
- openMethod: pt
219
- });
220
- }, [
221
- U,
222
- A,
223
- y,
224
- C,
225
- N,
226
- P,
227
- V,
228
- H,
229
- $,
230
- Q,
231
- S,
232
- w,
233
- T,
234
- E,
235
- pt
236
- ]);
237
- let xt = f.useMemo(() => ({
238
- store: U,
239
- name: M,
240
- required: v,
241
- disabled: j,
242
- readOnly: _,
243
- multiple: C,
244
- highlightItemOnHover: D,
245
- setValue: q,
246
- setOpen: G,
247
- listRef: F,
248
- popupRef: L,
249
- scrollHandlerRef: $e,
250
- handleScrollArrowVisibility: vt,
251
- scrollArrowsMountedCountRef: et,
252
- itemProps: bt,
253
- valueRef: tt,
254
- valuesRef: R,
255
- labelsRef: I,
256
- typingRef: z,
257
- selectionRef: rt,
258
- firstItemTextRef: nt,
259
- selectedItemTextRef: B,
260
- validation: k,
261
- onOpenChangeComplete: x,
262
- alignItemWithTriggerActiveRef: it,
263
- initialValueRef: gt
264
- }), [
265
- U,
266
- M,
267
- v,
268
- j,
269
- _,
270
- C,
271
- D,
272
- q,
273
- G,
274
- bt,
275
- k,
276
- x,
277
- vt
278
- ]), St = t(Ve, k.inputRef), Ct = C && Array.isArray(N) && N.length > 0, wt = C ? void 0 : M, Tt = f.useMemo(() => !C || !Array.isArray(N) || !M ? null : N.map((e) => {
279
- let t = u(e, T);
280
- return /*#__PURE__*/ p("input", {
281
- type: "hidden",
282
- form: g,
283
- name: M,
284
- value: t,
285
- disabled: j
286
- }, t);
287
- }), [
288
- C,
289
- N,
290
- g,
291
- M,
292
- T,
293
- j
294
- ]);
295
- return /*#__PURE__*/ p(ye.Provider, {
296
- value: xt,
297
- children: /*#__PURE__*/ je(ve.Provider, {
298
- value: J,
299
- children: [
300
- He,
301
- /*#__PURE__*/ p("input", {
302
- ...k.getValidationProps(j, {
303
- onFocus() {
304
- U.state.triggerElement?.focus({ focusVisible: !0 });
305
- },
306
- onChange(e) {
307
- if (e.nativeEvent.defaultPrevented || j || _) return;
308
- let t = e.currentTarget.value, n = s(ee, e.nativeEvent);
309
- function r() {
310
- if (C) return;
311
- let e = t.toLowerCase(), r = R.current.findIndex((t) => u(t, T).toLowerCase() === e || Ee(t, w).toLowerCase() === e);
312
- r === -1 && (r = R.current.findIndex((t, n) => {
313
- let r = I.current[n];
314
- return r != null && r.toLowerCase() === e;
315
- }));
316
- let i = r === -1 ? void 0 : R.current[r];
317
- i != null && q(i, n);
318
- }
319
- U.set("forceMount", !0), queueMicrotask(r);
320
- }
321
- }),
322
- id: A && wt == null ? `${A}-hidden-input` : void 0,
323
- form: g,
324
- name: wt,
325
- autoComplete: ze,
326
- value: mt,
327
- disabled: j,
328
- required: v && !Ct,
329
- readOnly: _,
330
- ref: St,
331
- style: M ? re : ne,
332
- tabIndex: -1,
333
- "aria-hidden": !0,
334
- suppressHydrationWarning: !0
335
- }),
336
- Tt
337
- ]
338
- })
339
- });
1
+ import { clamp as e } from "./index380.js";
2
+ function t(e, t) {
3
+ return Math.max(0, e - t);
4
+ }
5
+ function n(t, n) {
6
+ if (n <= 0) return 0;
7
+ let r = e(t, 0, n), i = r, a = n - r, o = i <= 1, s = a <= 1;
8
+ return o && s ? i <= a ? 0 : n : o ? 0 : s ? n : r;
340
9
  }
341
10
  //#endregion
342
- export { Me as SelectRoot };
11
+ export { t as getMaxScrollOffset, n as normalizeScrollOffset };
343
12
 
344
13
  //# sourceMappingURL=index381.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index381.js","names":["React","REASONS.none"],"sources":["../../../node_modules/@base-ui/react/select/root/SelectRoot.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { visuallyHidden, visuallyHiddenInput } from '@base-ui/utils/visuallyHidden';\nimport { useMergedRefs } from '@base-ui/utils/useMergedRefs';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { useOnFirstRender } from '@base-ui/utils/useOnFirstRender';\nimport { usePreviousValue } from '@base-ui/utils/usePreviousValue';\nimport { isElementDisabled } from '@base-ui/utils/isElementDisabled';\nimport { useControlled } from '@base-ui/utils/useControlled';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useValueAsRef } from '@base-ui/utils/useValueAsRef';\nimport { useStore, Store } from '@base-ui/utils/store';\nimport { EMPTY_ARRAY, EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { useClick, useDismiss, useFloatingRootContext, useListNavigation, useTypeahead } from \"../../floating-ui-react/index.mjs\";\nimport { SelectRootContext, SelectFloatingContext } from \"./SelectRootContext.mjs\";\nimport { useFieldRootContext } from \"../../internals/field-root-context/FieldRootContext.mjs\";\nimport { useRegisterFieldControl } from \"../../internals/field-register-control/useRegisterFieldControl.mjs\";\nimport { useLabelableId } from \"../../internals/labelable-provider/useLabelableId.mjs\";\nimport { useTransitionStatus } from \"../../internals/useTransitionStatus.mjs\";\nimport { selectors } from \"../store.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useOpenChangeComplete } from \"../../internals/useOpenChangeComplete.mjs\";\nimport { useFormContext } from \"../../internals/form-context/FormContext.mjs\";\nimport { stringifyAsLabel, stringifyAsValue } from \"../../internals/resolveValueLabel.mjs\";\nimport { compareItemEquality, defaultItemEquality, findItemIndex } from \"../../internals/itemEquality.mjs\";\nimport { areArraysEqual } from \"../../internals/areArraysEqual.mjs\";\nimport { useValueChanged } from \"../../internals/useValueChanged.mjs\";\nimport { useOpenInteractionType } from \"../../utils/useOpenInteractionType.mjs\";\nimport { getMaxScrollOffset, normalizeScrollOffset } from \"../../utils/scrollEdges.mjs\";\nimport { FOCUSABLE_POPUP_PROPS } from \"../../utils/popups/index.mjs\";\nimport { mergeProps } from \"../../merge-props/index.mjs\";\n\n/**\n * Groups all parts of the select.\n * Doesn't render its own HTML element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport function SelectRoot(props) {\n const {\n id,\n value: valueProp,\n defaultValue = null,\n onValueChange,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n name: nameProp,\n form,\n autoComplete,\n disabled: disabledProp = false,\n readOnly = false,\n required = false,\n modal = true,\n actionsRef,\n inputRef,\n onOpenChangeComplete,\n items,\n multiple = false,\n itemToStringLabel,\n itemToStringValue,\n isItemEqualToValue = defaultItemEquality,\n highlightItemOnHover = true,\n children\n } = props;\n const {\n clearErrors\n } = useFormContext();\n const {\n setDirty,\n setTouched,\n setFocused,\n validityData,\n setFilled,\n name: fieldName,\n disabled: fieldDisabled,\n validation,\n validationMode\n } = useFieldRootContext();\n const generatedId = useLabelableId({\n id\n });\n const disabled = fieldDisabled || disabledProp;\n const name = fieldName ?? nameProp;\n const [value, setValueUnwrapped] = useControlled({\n controlled: valueProp,\n default: multiple ? defaultValue ?? EMPTY_ARRAY : defaultValue,\n name: 'Select',\n state: 'value'\n });\n const [open, setOpenUnwrapped] = useControlled({\n controlled: openProp,\n default: defaultOpen,\n name: 'Select',\n state: 'open'\n });\n const listRef = React.useRef([]);\n const labelsRef = React.useRef([]);\n const popupRef = React.useRef(null);\n const scrollHandlerRef = React.useRef(null);\n const scrollArrowsMountedCountRef = React.useRef(0);\n const valueRef = React.useRef(null);\n const valuesRef = React.useRef([]);\n const typingRef = React.useRef(false);\n const firstItemTextRef = React.useRef(null);\n const selectedItemTextRef = React.useRef(null);\n const selectionRef = React.useRef({\n allowSelectedMouseUp: false,\n allowUnselectedMouseUp: false,\n dragY: 0\n });\n const alignItemWithTriggerActiveRef = React.useRef(false);\n const {\n mounted,\n setMounted,\n transitionStatus\n } = useTransitionStatus(open);\n const {\n openMethod,\n triggerProps: interactionTypeProps\n } = useOpenInteractionType(open);\n const store = useRefWithInit(() => new Store({\n id: generatedId,\n labelId: undefined,\n modal,\n multiple,\n itemToStringLabel,\n itemToStringValue,\n isItemEqualToValue,\n value,\n open,\n mounted,\n transitionStatus,\n items,\n forceMount: false,\n openMethod: null,\n activeIndex: null,\n selectedIndex: null,\n popupProps: {},\n triggerProps: {},\n triggerElement: null,\n positionerElement: null,\n listElement: null,\n popupSide: null,\n scrollUpArrowVisible: false,\n scrollDownArrowVisible: false,\n hasScrollArrows: false\n })).current;\n const activeIndex = useStore(store, selectors.activeIndex);\n const selectedIndex = useStore(store, selectors.selectedIndex);\n const triggerElement = useStore(store, selectors.triggerElement);\n const positionerElement = useStore(store, selectors.positionerElement);\n const previousOpenMethod = usePreviousValue(openMethod);\n const renderedOpenMethod = openMethod ?? previousOpenMethod ?? null;\n const serializedValue = React.useMemo(() => {\n // In multiple mode the shared input is nameless; per-value entries are submitted via\n // `hiddenInputs`. Its value is therefore irrelevant, and passing the whole array to\n // `stringifyAsValue` would invoke a user `itemToStringValue` with an array it doesn't expect.\n if (multiple) {\n return '';\n }\n return stringifyAsValue(value, itemToStringValue);\n }, [multiple, value, itemToStringValue]);\n const fieldStringValue = React.useMemo(() => {\n if (multiple && Array.isArray(value)) {\n return value.map(currentValue => stringifyAsValue(currentValue, itemToStringValue));\n }\n return stringifyAsValue(value, itemToStringValue);\n }, [multiple, value, itemToStringValue]);\n const controlRef = useValueAsRef(store.state.triggerElement);\n const getStringifiedValueForForm = useStableCallback(() => fieldStringValue);\n useRegisterFieldControl(controlRef, generatedId, value, getStringifiedValueForForm, !disabled, nameProp);\n const initialValueRef = React.useRef(value);\n // Mirror the `hasSelectedValue` store selector so the Field's filled state agrees with the\n // trigger/value placeholder semantics (a value serializing to `''` counts as empty).\n const hasSelectedValue = multiple ? Array.isArray(value) && value.length > 0 : value != null && stringifyAsValue(value, itemToStringValue) !== '';\n useIsoLayoutEffect(() => {\n // Ensure the values and labels are registered for programmatic value changes.\n if (value !== initialValueRef.current) {\n store.set('forceMount', true);\n }\n }, [store, value]);\n useIsoLayoutEffect(() => {\n setFilled(hasSelectedValue);\n }, [hasSelectedValue, setFilled]);\n useIsoLayoutEffect(function syncSelectedIndex() {\n const registry = valuesRef.current;\n let nextIndex;\n if (multiple) {\n const currentValue = Array.isArray(value) ? value : [];\n if (currentValue.length === 0) {\n nextIndex = null;\n } else {\n const lastValue = currentValue[currentValue.length - 1];\n const lastIndex = findItemIndex(registry, lastValue, isItemEqualToValue);\n nextIndex = lastIndex === -1 ? null : lastIndex;\n }\n } else {\n const index = findItemIndex(registry, value, isItemEqualToValue);\n nextIndex = index === -1 ? null : index;\n }\n if (nextIndex === null) {\n selectedItemTextRef.current = null;\n }\n if (open) {\n return;\n }\n store.set('selectedIndex', nextIndex);\n }, [hasSelectedValue, multiple, open, value, valuesRef, isItemEqualToValue, store, selectedItemTextRef]);\n function isSelectedValueDirty(currentValue) {\n const initialValue = validityData.initialValue;\n if (Array.isArray(currentValue) && Array.isArray(initialValue)) {\n return !areArraysEqual(currentValue, initialValue, (itemValue, initialItemValue) => compareItemEquality(itemValue, initialItemValue, isItemEqualToValue));\n }\n return currentValue !== initialValue;\n }\n useValueChanged(value, () => {\n clearErrors(name);\n setDirty(isSelectedValueDirty(value));\n validation.change(value);\n });\n const setOpen = useStableCallback((nextOpen, eventDetails) => {\n onOpenChange?.(nextOpen, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n setOpenUnwrapped(nextOpen);\n if (!nextOpen && (eventDetails.reason === REASONS.focusOut || eventDetails.reason === REASONS.outsidePress)) {\n setTouched(true);\n setFocused(false);\n if (validationMode === 'onBlur') {\n validation.commit(value);\n }\n }\n });\n const handleUnmount = useStableCallback(() => {\n setMounted(false);\n store.update({\n activeIndex: null,\n openMethod: null\n });\n onOpenChangeComplete?.(false);\n });\n useOpenChangeComplete({\n enabled: !actionsRef,\n open,\n ref: popupRef,\n onComplete() {\n if (!open) {\n handleUnmount();\n }\n }\n });\n React.useImperativeHandle(actionsRef, () => ({\n unmount: handleUnmount\n }), [handleUnmount]);\n const setValue = useStableCallback((nextValue, eventDetails) => {\n onValueChange?.(nextValue, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n setValueUnwrapped(nextValue);\n });\n const handleScrollArrowVisibility = useStableCallback(() => {\n const scroller = store.state.listElement || popupRef.current;\n if (!scroller) {\n return;\n }\n const maxScrollTop = getMaxScrollOffset(scroller.scrollHeight, scroller.clientHeight);\n const scrollTop = normalizeScrollOffset(scroller.scrollTop, maxScrollTop);\n const shouldShowUp = scrollTop > 0;\n const shouldShowDown = scrollTop < maxScrollTop;\n if (store.state.scrollUpArrowVisible !== shouldShowUp) {\n store.set('scrollUpArrowVisible', shouldShowUp);\n }\n if (store.state.scrollDownArrowVisible !== shouldShowDown) {\n store.set('scrollDownArrowVisible', shouldShowDown);\n }\n });\n const floatingContext = useFloatingRootContext({\n open,\n onOpenChange: setOpen,\n elements: {\n reference: triggerElement,\n floating: positionerElement\n }\n });\n const click = useClick(floatingContext, {\n enabled: !readOnly && !disabled,\n event: 'mousedown'\n });\n const dismiss = useDismiss(floatingContext);\n const listNavigation = useListNavigation(floatingContext, {\n enabled: !readOnly && !disabled,\n listRef,\n activeIndex,\n selectedIndex,\n disabledIndices: EMPTY_ARRAY,\n onNavigate(nextActiveIndex) {\n // Retain the highlight while transitioning out.\n if (nextActiveIndex === null && !open) {\n return;\n }\n store.set('activeIndex', nextActiveIndex);\n },\n focusItemOnHover: highlightItemOnHover\n });\n const typeahead = useTypeahead(floatingContext, {\n enabled: !readOnly && !disabled && (open || !multiple),\n listRef: labelsRef,\n activeIndex,\n selectedIndex,\n // Skip disabled items while matching so typeahead advances to the next selectable item\n // (a click can never select a disabled item and native `<select>` skips them too). Resolve\n // the disabled state from the element via the attribute-only `isElementDisabled` so the\n // hidden, force-mounted items used for closed-trigger typeahead aren't dropped by the\n // `elementsRef`/visibility filter that `disabledIndices` deliberately sidesteps.\n disabledIndices: index => isElementDisabled(listRef.current[index]),\n onMatch(index) {\n if (open) {\n store.set('activeIndex', index);\n } else {\n setValue(valuesRef.current[index], createChangeEventDetails('none'));\n }\n },\n onTyping(typing) {\n typingRef.current = typing;\n }\n });\n const mergedTriggerProps = React.useMemo(() => {\n const triggerInteractionProps = mergeProps(typeahead.reference, listNavigation.reference, dismiss.reference, click.reference, interactionTypeProps);\n if (generatedId) {\n triggerInteractionProps.id = generatedId;\n }\n return triggerInteractionProps;\n }, [click.reference, typeahead.reference, listNavigation.reference, dismiss.reference, interactionTypeProps, generatedId]);\n const popupProps = React.useMemo(() => mergeProps(FOCUSABLE_POPUP_PROPS, typeahead.floating, listNavigation.floating, dismiss.floating), [typeahead.floating, listNavigation.floating, dismiss.floating]);\n const itemProps = listNavigation.item ?? EMPTY_OBJECT;\n useOnFirstRender(() => {\n store.update({\n popupProps,\n triggerProps: mergedTriggerProps\n });\n });\n useIsoLayoutEffect(() => {\n store.update({\n id: generatedId,\n modal,\n multiple,\n value,\n open,\n mounted,\n transitionStatus,\n popupProps,\n triggerProps: mergedTriggerProps,\n items,\n itemToStringLabel,\n itemToStringValue,\n isItemEqualToValue,\n openMethod: renderedOpenMethod\n });\n }, [store, generatedId, modal, multiple, value, open, mounted, transitionStatus, popupProps, mergedTriggerProps, items, itemToStringLabel, itemToStringValue, isItemEqualToValue, renderedOpenMethod]);\n const contextValue = React.useMemo(() => ({\n store,\n name,\n required,\n disabled,\n readOnly,\n multiple,\n highlightItemOnHover,\n setValue,\n setOpen,\n listRef,\n popupRef,\n scrollHandlerRef,\n handleScrollArrowVisibility,\n scrollArrowsMountedCountRef,\n itemProps,\n valueRef,\n valuesRef,\n labelsRef,\n typingRef,\n selectionRef,\n firstItemTextRef,\n selectedItemTextRef,\n validation,\n onOpenChangeComplete,\n alignItemWithTriggerActiveRef,\n initialValueRef\n }), [store, name, required, disabled, readOnly, multiple, highlightItemOnHover, setValue, setOpen, itemProps, validation, onOpenChangeComplete, handleScrollArrowVisibility]);\n const ref = useMergedRefs(inputRef, validation.inputRef);\n const hasMultipleSelection = multiple && Array.isArray(value) && value.length > 0;\n const hiddenInputName = multiple ? undefined : name;\n const hiddenInputs = React.useMemo(() => {\n if (!multiple || !Array.isArray(value) || !name) {\n return null;\n }\n return value.map(v => {\n const currentSerializedValue = stringifyAsValue(v, itemToStringValue);\n return /*#__PURE__*/_jsx(\"input\", {\n type: \"hidden\",\n form: form,\n name: name,\n value: currentSerializedValue,\n disabled: disabled\n }, currentSerializedValue);\n });\n }, [multiple, value, form, name, itemToStringValue, disabled]);\n return /*#__PURE__*/_jsx(SelectRootContext.Provider, {\n value: contextValue,\n children: /*#__PURE__*/_jsxs(SelectFloatingContext.Provider, {\n value: floatingContext,\n children: [children, /*#__PURE__*/_jsx(\"input\", {\n ...validation.getValidationProps(disabled, {\n onFocus() {\n // Move focus to the trigger element when the hidden input is focused.\n store.state.triggerElement?.focus({\n // Supported in Chrome from 144 (January 2026)\n focusVisible: true\n });\n },\n // Handle browser autofill.\n onChange(event) {\n // Workaround for https://github.com/facebook/react/issues/9023\n if (event.nativeEvent.defaultPrevented || disabled || readOnly) {\n return;\n }\n const nextValue = event.currentTarget.value;\n const details = createChangeEventDetails(REASONS.none, event.nativeEvent);\n function handleChange() {\n if (multiple) {\n // Browser autofill only writes a single scalar value.\n return;\n }\n\n // Preserve the original serialized matching, then fall back to rendered text,\n // which browsers can autofill for primitive values like `value=\"US\">United States`.\n const nextValueLower = nextValue.toLowerCase();\n let matchingIndex = valuesRef.current.findIndex(candidate => stringifyAsValue(candidate, itemToStringValue).toLowerCase() === nextValueLower || stringifyAsLabel(candidate, itemToStringLabel).toLowerCase() === nextValueLower);\n if (matchingIndex === -1) {\n matchingIndex = valuesRef.current.findIndex((_, index) => {\n const renderedLabel = labelsRef.current[index];\n return renderedLabel != null && renderedLabel.toLowerCase() === nextValueLower;\n });\n }\n const matchingValue = matchingIndex === -1 ? undefined : valuesRef.current[matchingIndex];\n if (matchingValue != null) {\n // `setValue` may be canceled by `onValueChange`; rely on `useValueChanged` to\n // mark the field dirty and run validation only when the value actually changes.\n setValue(matchingValue, details);\n }\n }\n store.set('forceMount', true);\n queueMicrotask(handleChange);\n }\n }),\n id: generatedId && hiddenInputName == null ? `${generatedId}-hidden-input` : undefined,\n form: form,\n name: hiddenInputName,\n autoComplete: autoComplete,\n value: serializedValue,\n disabled: disabled,\n required: required && !hasMultipleSelection,\n readOnly: readOnly,\n ref: ref,\n style: name ? visuallyHiddenInput : visuallyHidden,\n tabIndex: -1,\n \"aria-hidden\": true,\n suppressHydrationWarning: true\n }), hiddenInputs]\n })\n });\n}"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA,SAAgB,GAAW,IAAO;CAChC,IAAM,EACJ,QACA,OAAO,IACP,kBAAe,MACf,mBACA,MAAM,IACN,kBAAc,IACd,kBACA,MAAM,GACN,SACA,kBACA,UAAU,KAAe,IACzB,cAAW,IACX,cAAW,IACX,WAAQ,IACR,eACA,cACA,yBACA,UACA,cAAW,IACX,sBACA,sBACA,wBAAqB,IACrB,0BAAuB,IACvB,iBACE,IACE,EACJ,oBACE,GAAe,GACb,EACJ,cACA,gBACA,gBACA,kBACA,cACA,MAAM,IACN,UAAU,IACV,eACA,uBACE,GAAoB,GAClB,IAAc,GAAe,EACjC,OACF,CAAC,GACK,IAAW,MAAiB,IAC5B,IAAO,MAAa,GACpB,CAAC,GAAO,MAAqB,EAAc;EAC/C,YAAY;EACZ,SAAS,IAAW,KAAgB,IAAc;EAClD,MAAM;EACN,OAAO;CACT,CAAC,GACK,CAAC,GAAM,MAAoB,EAAc;EAC7C,YAAY;EACZ,SAAS;EACT,MAAM;EACN,OAAO;CACT,CAAC,GACK,IAAUA,EAAM,OAAO,CAAC,CAAC,GACzB,IAAYA,EAAM,OAAO,CAAC,CAAC,GAC3B,IAAWA,EAAM,OAAO,IAAI,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AkB,OACpB,IAAgB,EAAU,QAAQ,WAAW,GAAG,MAAU;SACxD,IAAM,IAAgB,EAAU,QAAQ;SACxC,OAAO,KAAiB,QAAQ,EAAc,YAAY,MAAM;QAClE,CAAC;QAEH,IAAM,IAAgB,MAAkB,KAAK,KAAA,IAAY,EAAU,QAAQ;QAC3E,AAAI,KAAiB,QAGnB,EAAS,GAAe,CAAO;OAEnC;OAEA,AADA,EAAM,IAAI,cAAc,EAAI,GAC5B,eAAe,CAAY;MAC7B;KACF,CAAC;KACD,IAAI,KAAe,MAAmB,OAAO,GAAG,EAAY,iBAAiB,KAAA;KACvE;KACN,MAAM;KACQ;KACd,OAAO;KACG;KACV,UAAU,KAAY,CAAC;KACb;KACL;KACL,OAAO,IAAO,KAAsB;KACpC,UAAU;KACV,eAAe;KACf,0BAA0B;IAC5B,CAAC;IAAG;GAAY;EAClB,CAAC;CACH,CAAC;AACH"}
1
+ {"version":3,"file":"index381.js","names":[],"sources":["../../../node_modules/@base-ui/react/utils/scrollEdges.mjs"],"sourcesContent":["import { clamp } from \"../internals/clamp.mjs\";\nexport const SCROLL_EDGE_TOLERANCE_PX = 1;\nexport function getMaxScrollOffset(scrollSize, clientSize) {\n return Math.max(0, scrollSize - clientSize);\n}\nexport function normalizeScrollOffset(value, max) {\n if (max <= 0) {\n return 0;\n }\n const clamped = clamp(value, 0, max);\n const startDistance = clamped;\n const endDistance = max - clamped;\n const withinStartTolerance = startDistance <= SCROLL_EDGE_TOLERANCE_PX;\n const withinEndTolerance = endDistance <= SCROLL_EDGE_TOLERANCE_PX;\n if (withinStartTolerance && withinEndTolerance) {\n return startDistance <= endDistance ? 0 : max;\n }\n if (withinStartTolerance) {\n return 0;\n }\n if (withinEndTolerance) {\n return max;\n }\n return clamped;\n}"],"x_google_ignoreList":[0],"mappings":";AAEA,SAAgB,EAAmB,GAAY,GAAY;CACzD,OAAO,KAAK,IAAI,GAAG,IAAa,CAAU;AAC5C;AACA,SAAgB,EAAsB,GAAO,GAAK;CAChD,IAAI,KAAO,GACT,OAAO;CAET,IAAM,IAAU,EAAM,GAAO,GAAG,CAAG,GAC7B,IAAgB,GAChB,IAAc,IAAM,GACpB,IAAuB,KAAA,GACvB,IAAqB,KAAA;CAU3B,OATI,KAAwB,IACnB,KAAiB,IAAc,IAAI,IAExC,IACK,IAEL,IACK,IAEF;AACT"}