@minimalstuff/ui 3.2.0 → 4.1.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.
@@ -28,9 +28,12 @@ var S = {
28
28
  lg: "rounded-lg",
29
29
  xl: "rounded-xl",
30
30
  full: "rounded-full"
31
- }, C = "outline-hidden focus-visible:outline-2 focus-visible:outline-offset-2", w = "focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent", T = "focus-within:outline-none focus-within:ring-2 focus-within:ring-offset-2 focus-within:ring-offset-white dark:focus-within:ring-offset-gray-900", E = "focus-within:ring-blue-500", D = "focus-within:ring-red-500", O = {
31
+ }, C = {
32
+ ...S,
33
+ full: S.lg
34
+ }, w = "outline-hidden focus-visible:outline-2 focus-visible:outline-offset-2", T = "focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent", E = "has-[:focus-visible]:outline-none has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-offset-2 has-[:focus-visible]:ring-offset-white dark:has-[:focus-visible]:ring-offset-gray-900", D = "has-[:focus-visible]:ring-blue-500", O = "has-[:focus-visible]:ring-red-500", k = "outline-hidden focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-blue-500 dark:focus-visible:outline-blue-400", A = {
32
35
  primary: {
33
- solid: "border-transparent bg-blue-600 text-white enabled:hover:bg-blue-700 enabled:active:bg-blue-800 dark:bg-blue-500 dark:enabled:hover:bg-blue-600 dark:enabled:active:bg-blue-700",
36
+ solid: "border-transparent bg-blue-600 text-white enabled:hover:bg-blue-700 enabled:active:bg-blue-800",
34
37
  outline: "border-blue-300 bg-transparent text-blue-700 enabled:hover:bg-blue-50 enabled:active:bg-blue-100 dark:border-blue-800 dark:text-blue-400 dark:enabled:hover:bg-blue-950/40 dark:enabled:active:bg-blue-950/60",
35
38
  ghost: "border-transparent bg-transparent text-blue-700 enabled:hover:bg-blue-50 enabled:active:bg-blue-100 dark:text-blue-400 dark:enabled:hover:bg-blue-950/40 dark:enabled:active:bg-blue-950/60",
36
39
  subtle: "border-transparent bg-blue-50 text-blue-700 enabled:hover:bg-blue-100 enabled:active:bg-blue-200 dark:bg-blue-500/10 dark:text-blue-400 dark:enabled:hover:bg-blue-500/20 dark:enabled:active:bg-blue-500/30",
@@ -41,42 +44,42 @@ var S = {
41
44
  outline: "border-gray-300 bg-transparent text-gray-700 enabled:hover:bg-gray-50 enabled:active:bg-gray-100 dark:border-gray-600 dark:text-gray-300 dark:enabled:hover:bg-gray-800/50 dark:enabled:active:bg-gray-800/80",
42
45
  ghost: "border-transparent bg-transparent text-gray-700 enabled:hover:bg-gray-100 enabled:active:bg-gray-200 dark:text-gray-300 dark:enabled:hover:bg-gray-700/50 dark:enabled:active:bg-gray-700/80",
43
46
  subtle: "border-transparent bg-gray-100 text-gray-700 enabled:hover:bg-gray-200 enabled:active:bg-gray-300 dark:bg-gray-700/50 dark:text-gray-300 dark:enabled:hover:bg-gray-600/50 dark:enabled:active:bg-gray-600/80",
44
- focusOutline: "focus-visible:outline-gray-400"
47
+ focusOutline: "focus-visible:outline-gray-500 dark:focus-visible:outline-gray-400"
45
48
  },
46
49
  danger: {
47
- solid: "border-transparent bg-red-600 text-white enabled:hover:bg-red-700 enabled:active:bg-red-800 dark:bg-red-500 dark:enabled:hover:bg-red-600 dark:enabled:active:bg-red-700",
50
+ solid: "border-transparent bg-red-600 text-white enabled:hover:bg-red-700 enabled:active:bg-red-800",
48
51
  outline: "border-red-300 bg-transparent text-red-700 enabled:hover:bg-red-50 enabled:active:bg-red-100 dark:border-red-800 dark:text-red-400 dark:enabled:hover:bg-red-950/40 dark:enabled:active:bg-red-950/60",
49
52
  ghost: "border-transparent bg-transparent text-red-700 enabled:hover:bg-red-50 enabled:active:bg-red-100 dark:text-red-400 dark:enabled:hover:bg-red-950/40 dark:enabled:active:bg-red-950/60",
50
53
  subtle: "border-transparent bg-red-50 text-red-700 enabled:hover:bg-red-100 enabled:active:bg-red-200 dark:bg-red-500/10 dark:text-red-400 dark:enabled:hover:bg-red-500/20 dark:enabled:active:bg-red-500/30",
51
54
  focusOutline: "focus-visible:outline-red-500"
52
55
  },
53
56
  success: {
54
- solid: "border-transparent bg-green-600 text-white enabled:hover:bg-green-700 enabled:active:bg-green-800 dark:bg-green-500 dark:enabled:hover:bg-green-600 dark:enabled:active:bg-green-700",
57
+ solid: "border-transparent bg-green-700 text-white enabled:hover:bg-green-800 enabled:active:bg-green-900",
55
58
  outline: "border-green-300 bg-transparent text-green-700 enabled:hover:bg-green-50 enabled:active:bg-green-100 dark:border-green-800 dark:text-green-400 dark:enabled:hover:bg-green-950/40 dark:enabled:active:bg-green-950/60",
56
59
  ghost: "border-transparent bg-transparent text-green-700 enabled:hover:bg-green-50 enabled:active:bg-green-100 dark:text-green-400 dark:enabled:hover:bg-green-950/40 dark:enabled:active:bg-green-950/60",
57
60
  subtle: "border-transparent bg-green-50 text-green-700 enabled:hover:bg-green-100 enabled:active:bg-green-200 dark:bg-green-500/10 dark:text-green-400 dark:enabled:hover:bg-green-500/20 dark:enabled:active:bg-green-500/30",
58
- focusOutline: "focus-visible:outline-green-500"
61
+ focusOutline: "focus-visible:outline-green-600"
59
62
  },
60
63
  warning: {
61
- solid: "border-transparent bg-yellow-600 text-white enabled:hover:bg-yellow-700 enabled:active:bg-yellow-800 dark:bg-yellow-500 dark:enabled:hover:bg-yellow-600 dark:enabled:active:bg-yellow-700",
64
+ solid: "border-transparent bg-yellow-700 text-white enabled:hover:bg-yellow-800 enabled:active:bg-yellow-900",
62
65
  outline: "border-yellow-300 bg-transparent text-yellow-700 enabled:hover:bg-yellow-50 enabled:active:bg-yellow-100 dark:border-yellow-800 dark:text-yellow-400 dark:enabled:hover:bg-yellow-950/40 dark:enabled:active:bg-yellow-950/60",
63
66
  ghost: "border-transparent bg-transparent text-yellow-700 enabled:hover:bg-yellow-50 enabled:active:bg-yellow-100 dark:text-yellow-400 dark:enabled:hover:bg-yellow-950/40 dark:enabled:active:bg-yellow-950/60",
64
67
  subtle: "border-transparent bg-yellow-50 text-yellow-700 enabled:hover:bg-yellow-100 enabled:active:bg-yellow-200 dark:bg-yellow-500/10 dark:text-yellow-400 dark:enabled:hover:bg-yellow-500/20 dark:enabled:active:bg-yellow-500/30",
65
- focusOutline: "focus-visible:outline-yellow-500"
68
+ focusOutline: "focus-visible:outline-yellow-700 dark:focus-visible:outline-yellow-500"
66
69
  }
67
- }, k = "inline-flex items-center justify-center disabled:opacity-50 disabled:cursor-not-allowed", A = `cursor-pointer transition-[color,background-color,border-color,transform] duration-200 enabled:active:duration-75 enabled:active:scale-[0.95] ${C}`, j = {
70
+ }, j = "inline-flex items-center justify-center disabled:opacity-50 disabled:cursor-not-allowed", M = `cursor-pointer transition-[color,background-color,border-color,transform] duration-200 enabled:active:duration-75 enabled:active:scale-[0.95] ${w}`, N = {
68
71
  xs: "h-6 w-6 text-xs",
69
72
  sm: "h-8 w-8 text-sm",
70
73
  md: "h-10 w-10 text-base",
71
74
  lg: "h-12 w-12 text-xl"
72
- }, M = new Intl.Segmenter(void 0, { granularity: "grapheme" });
73
- function N(e) {
75
+ }, P = new Intl.Segmenter(void 0, { granularity: "grapheme" });
76
+ function F(e) {
74
77
  let t = e.trim();
75
78
  if (t.length === 0) return "";
76
- let [n] = M.segment(t);
79
+ let [n] = P.segment(t);
77
80
  return n.segment.toUpperCase();
78
81
  }
79
- function P({ name: e, src: t, size: n = "sm", color: r = "primary", radius: i = "full", unstyled: a = !1, className: o }) {
82
+ function I({ name: e, src: t, size: n = "sm", color: r = "primary", radius: i = "full", unstyled: a = !1, className: o }) {
80
83
  let [s, c] = p(null), l = t !== void 0 && t !== s, u = e.trim().length > 0, d = l ? /* @__PURE__ */ g("img", {
81
84
  src: t,
82
85
  alt: "",
@@ -84,47 +87,47 @@ function P({ name: e, src: t, size: n = "sm", color: r = "primary", radius: i =
84
87
  className: "h-full w-full object-cover"
85
88
  }) : /* @__PURE__ */ g("span", {
86
89
  "aria-hidden": "true",
87
- children: N(e)
90
+ children: F(e)
88
91
  });
89
92
  return /* @__PURE__ */ g("span", {
90
93
  role: u ? "img" : void 0,
91
94
  "aria-label": u ? e : void 0,
92
95
  "aria-hidden": !u || void 0,
93
- className: x("inline-flex flex-shrink-0 items-center justify-center overflow-hidden", j[n], !a && S[i], !a && !l && ["border font-semibold", O[r].solid], o),
96
+ className: x("inline-flex flex-shrink-0 items-center justify-center overflow-hidden", N[n], !a && S[i], !a && !l && ["border font-semibold", A[r].solid], o),
94
97
  children: d
95
98
  });
96
99
  }
97
100
  //#endregion
98
101
  //#region src/components/badge/badge.tsx
99
- var F = {
102
+ var L = {
100
103
  xs: "px-1.5 py-0.5 text-xs",
101
104
  sm: "px-2.5 py-1 text-sm",
102
105
  md: "px-3 py-1 text-base",
103
106
  lg: "px-3.5 py-1.5 text-lg"
104
- }, I = ({ children: e, color: t = "primary", variant: n = "subtle", size: r = "sm", radius: i = "md", className: a, ...o }) => /* @__PURE__ */ g("span", {
105
- className: x("inline-flex items-center gap-1 border", S[i], F[r], O[t][n], a),
107
+ }, R = ({ children: e, color: t = "primary", variant: n = "subtle", size: r = "sm", radius: i = "md", className: a, ...o }) => /* @__PURE__ */ g("span", {
108
+ className: x("inline-flex items-center gap-1 border", S[i], L[r], A[t][n], a),
106
109
  ...o,
107
110
  children: e
108
- }), ee = {
111
+ }), z = {
109
112
  xs: "px-2 py-1 text-xs",
110
113
  sm: "px-3 py-1.5 text-sm",
111
114
  md: "px-4 py-2 text-sm",
112
115
  lg: "px-4 py-3 text-base"
113
- }, L = {
116
+ }, ee = {
114
117
  xs: "w-3.5 h-3.5",
115
118
  sm: "w-4 h-4",
116
119
  md: "w-4 h-4",
117
120
  lg: "w-5 h-5"
118
121
  };
119
- function R(e) {
120
- let { unstyled: t = !1, variant: n = "solid", color: r = "primary", size: i = "md", radius: a = "md", children: o, className: s, fullWidth: c = !1, loading: l = !1, startIcon: u, endIcon: d, disabled: f, ...p } = e, m = O[r], h = L[i];
122
+ function te(e) {
123
+ let { unstyled: t = !1, variant: n = "solid", color: r = "primary", size: i = "md", radius: a = "md", children: o, className: s, fullWidth: c = !1, loading: l = !1, startIcon: u, endIcon: d, disabled: f, ...p } = e, m = A[r], h = ee[i];
121
124
  return /* @__PURE__ */ _("button", {
122
125
  type: "button",
123
- className: x(k, !t && [
124
- A,
126
+ className: x(j, !t && [
127
+ M,
125
128
  "gap-2 font-medium border",
126
129
  S[a],
127
- ee[i],
130
+ z[i],
128
131
  m[n],
129
132
  m.focusOutline
130
133
  ], c && "w-full", s),
@@ -150,13 +153,13 @@ function R(e) {
150
153
  }
151
154
  //#endregion
152
155
  //#region src/components/shared/surface_tokens.ts
153
- var te = "border-gray-300 dark:border-gray-600", ne = "bg-white dark:bg-gray-800", re = "border-gray-100 dark:border-gray-800", z = "bg-white dark:bg-gray-900", ie = {
156
+ var B = "border-gray-300 dark:border-gray-600", V = "bg-white dark:bg-gray-800", ne = "border-gray-200 dark:border-gray-700", H = "border-gray-100 dark:border-gray-800", re = "bg-white dark:bg-gray-900", U = {
154
157
  2: "h2",
155
158
  3: "h3",
156
159
  4: "h4"
157
160
  };
158
- function ae({ title: e, titleId: t, level: n, description: r, actions: i }) {
159
- let a = ie[n];
161
+ function W({ title: e, titleId: t, level: n, description: r, actions: i }) {
162
+ let a = U[n];
160
163
  return /* @__PURE__ */ _("div", {
161
164
  className: "mb-4",
162
165
  children: [/* @__PURE__ */ _("div", {
@@ -174,13 +177,13 @@ function ae({ title: e, titleId: t, level: n, description: r, actions: i }) {
174
177
  }
175
178
  //#endregion
176
179
  //#region src/components/card/card.tsx
177
- var oe = {
180
+ var ie = {
178
181
  none: "",
179
182
  sm: "p-4",
180
183
  md: "p-6",
181
184
  lg: "p-8"
182
185
  };
183
- function se({ children: e, title: t, description: n, actions: r, headingLevel: i = 2, padding: a = "md", radius: o = "lg", unstyled: s = !1, className: c }) {
186
+ function ae({ children: e, title: t, description: n, actions: r, headingLevel: i = 2, padding: a = "md", radius: o = "lg", unstyled: s = !1, className: c }) {
184
187
  let u = l(), d = !!t;
185
188
  return /* @__PURE__ */ _("div", {
186
189
  role: d ? "region" : void 0,
@@ -190,9 +193,9 @@ function se({ children: e, title: t, description: n, actions: r, headingLevel: i
190
193
  "bg-white dark:bg-gray-800",
191
194
  "border-gray-200 dark:border-gray-700",
192
195
  S[o],
193
- oe[a]
196
+ ie[a]
194
197
  ], c),
195
- children: [d && /* @__PURE__ */ g(ae, {
198
+ children: [d && /* @__PURE__ */ g(W, {
196
199
  title: t,
197
200
  titleId: u,
198
201
  level: i,
@@ -203,67 +206,135 @@ function se({ children: e, title: t, description: n, actions: r, headingLevel: i
203
206
  }
204
207
  //#endregion
205
208
  //#region src/components/character_count/character_count.tsx
206
- var ce = "text-xs text-gray-500 dark:text-gray-400 mt-1 text-right";
207
- function le(e, t) {
208
- return t ? "" : e === "overLimit" ? "text-red-600 dark:text-red-400" : e === "atLimit" ? "text-amber-600 dark:text-amber-400" : "";
209
+ var G = "text-xs text-gray-500 dark:text-gray-400 mt-1 text-right";
210
+ function oe(e, t) {
211
+ return t ? "" : e === "overLimit" ? "text-red-600 dark:text-red-400" : e === "atLimit" ? "text-amber-700 dark:text-amber-400" : "";
209
212
  }
210
- function ue({ current: e, min: t, max: n, showMin: r, showMax: i, unstyled: a = !1, className: o }) {
211
- let s = r === !0 || i === !0, c = t !== void 0 && e <= t ? "atLimit" : "ok", l = n !== void 0 && e > n ? "overLimit" : n !== void 0 && e >= n ? "atLimit" : "ok", u = s ? `${e}/${t} min` : `${e} (min ${t})`, d = s ? `${e}/${n} max` : `${e}/${n}`;
213
+ function K({ current: e, min: t, max: n, showMin: r, showMax: i, unstyled: a = !1, id: o, className: s }) {
214
+ let c = r === !0 || i === !0, l = t !== void 0 && e <= t ? "atLimit" : "ok", u = n !== void 0 && e > n ? "overLimit" : n !== void 0 && e >= n ? "atLimit" : "ok", d = c ? `${e}/${t} min` : `${e} (min ${t})`, f = c ? `${e}/${n} max` : `${e}/${n}`;
212
215
  return /* @__PURE__ */ _("div", {
213
- className: x(!a && ce, o),
216
+ id: o,
217
+ className: x(!a && G, s),
214
218
  children: [
215
219
  r && t !== void 0 && /* @__PURE__ */ g("span", {
216
- className: le(c, a),
217
- children: u
220
+ className: oe(l, a),
221
+ children: d
218
222
  }),
219
223
  r && i && " · ",
220
224
  i && n !== void 0 && /* @__PURE__ */ g("span", {
221
- className: le(l, a),
222
- children: d
225
+ className: oe(u, a),
226
+ children: f
223
227
  }),
224
228
  !r && !i && n !== void 0 && /* @__PURE__ */ g("span", {
225
- className: le(l, a),
226
- children: d
229
+ className: oe(u, a),
230
+ children: f
227
231
  }),
228
232
  !r && !i && t !== void 0 && n === void 0 && /* @__PURE__ */ g("span", {
229
- className: le(c, a),
230
- children: u
233
+ className: oe(l, a),
234
+ children: d
231
235
  })
232
236
  ]
233
237
  });
234
238
  }
235
239
  //#endregion
236
- //#region src/components/shared/field_styles.ts
237
- var de = `w-full border ${te} ${ne} text-gray-900 dark:text-gray-100 placeholder-gray-500 dark:placeholder-gray-400 ${w} transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed`, fe = "text-xs text-gray-500 dark:text-gray-400", pe = "text-xs text-red-600 dark:text-red-400", me = "border-red-500 dark:border-red-400", he = ({ id: e, error: t, className: n }) => t ? /* @__PURE__ */ g("p", {
238
- id: e,
239
- className: x(pe, n),
240
- role: "alert",
241
- children: t
242
- }) : null;
240
+ //#region src/lib/merge_refs.ts
241
+ function se(...e) {
242
+ return (t) => {
243
+ for (let n of e) typeof n == "function" ? n(t) : n && (n.current = t);
244
+ };
245
+ }
246
+ //#endregion
247
+ //#region src/components/shared/join_ids.ts
248
+ function q(...e) {
249
+ return e.filter(Boolean).join(" ") || void 0;
250
+ }
251
+ //#endregion
252
+ //#region src/components/shared/dash_icon.tsx
253
+ function ce() {
254
+ return /* @__PURE__ */ g("svg", {
255
+ className: "h-3 w-3 text-white",
256
+ viewBox: "0 0 12 12",
257
+ fill: "none",
258
+ stroke: "currentColor",
259
+ strokeWidth: "2.5",
260
+ strokeLinecap: "round",
261
+ children: /* @__PURE__ */ g("line", {
262
+ x1: "2.5",
263
+ y1: "6",
264
+ x2: "9.5",
265
+ y2: "6"
266
+ })
267
+ });
268
+ }
269
+ var le = `w-full border ${B} ${V} text-gray-900 dark:text-gray-100 placeholder-gray-500 dark:placeholder-gray-400 ${T} transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed`, ue = "text-sm font-medium text-gray-700 dark:text-gray-300", de = "text-xs text-gray-600 dark:text-gray-400", fe = "text-xs text-red-600 dark:text-red-400", pe = "border-red-500 dark:border-red-400", me = r(!0);
270
+ function he() {
271
+ return s(me);
272
+ }
273
+ //#endregion
274
+ //#region src/components/shared/field_error.tsx
275
+ var J = ({ id: e, error: t, className: n }) => {
276
+ let r = he();
277
+ return t ? /* @__PURE__ */ g("p", {
278
+ id: e,
279
+ className: x(fe, n),
280
+ role: r ? "alert" : void 0,
281
+ children: t
282
+ }) : null;
283
+ };
243
284
  //#endregion
244
285
  //#region src/components/shared/use_field_ids.ts
245
- function B(e) {
286
+ function Y(e) {
246
287
  let t = l(), n = e ?? t;
247
288
  return {
248
289
  fieldId: n,
249
290
  errorId: `${n}-error`,
250
- descriptionId: `${n}-description`
291
+ descriptionId: `${n}-description`,
292
+ labelId: `${n}-label`,
293
+ characterCountId: `${n}-character-count`
251
294
  };
252
295
  }
253
296
  //#endregion
297
+ //#region src/components/shared/checkmark_icon.tsx
298
+ function ge() {
299
+ return /* @__PURE__ */ g("svg", {
300
+ className: "h-3 w-3 text-white",
301
+ viewBox: "0 0 12 12",
302
+ fill: "none",
303
+ stroke: "currentColor",
304
+ strokeWidth: "2.5",
305
+ strokeLinecap: "round",
306
+ strokeLinejoin: "round",
307
+ children: /* @__PURE__ */ g("polyline", { points: "2 6 5 9 10 3" })
308
+ });
309
+ }
310
+ //#endregion
254
311
  //#region src/components/shared/field_description.tsx
255
- var ge = ({ id: e, description: t, className: n }) => t ? typeof t == "string" ? /* @__PURE__ */ g("p", {
312
+ var _e = ({ id: e, description: t, className: n }) => t ? typeof t == "string" ? /* @__PURE__ */ g("p", {
256
313
  id: e,
257
- className: x(fe, n),
314
+ className: x(de, n),
258
315
  children: t
259
316
  }) : /* @__PURE__ */ g("span", {
260
317
  id: e,
261
- className: x(fe, "block", n),
318
+ className: x(de, "block", n),
262
319
  children: t
263
320
  }) : null;
264
321
  //#endregion
322
+ //#region src/components/shared/option_card_styles.ts
323
+ function ve(e) {
324
+ let { isSelected: t, isError: n, isDisabled: r, radius: i, unstyled: a } = e;
325
+ return x("flex cursor-pointer items-start gap-3 transition-colors duration-150", E, n ? O : D, !a && [
326
+ S[i],
327
+ "border px-3 py-2.5",
328
+ t ? n ? x("border-red-500 dark:border-red-400", "bg-red-50 dark:bg-red-950/20") : "border-blue-500 bg-blue-50 dark:border-blue-500 dark:bg-blue-950/25" : n ? "border-red-300 bg-white dark:border-red-800/50 dark:bg-gray-800/50" : x("border-gray-200 dark:border-gray-700", "bg-gray-50 hover:border-gray-300 hover:bg-white dark:bg-gray-800/50 dark:hover:border-gray-600 dark:hover:bg-gray-800")
329
+ ], r && "cursor-not-allowed opacity-50");
330
+ }
331
+ function ye(e) {
332
+ let { isSelected: t, isError: n } = e;
333
+ return t ? n ? pe : "border-blue-600 dark:border-blue-500" : n ? "border-red-400 dark:border-red-600" : B;
334
+ }
335
+ //#endregion
265
336
  //#region src/components/shared/use_controlled_state.ts
266
- function _e(e, t) {
337
+ function be(e, t) {
267
338
  let [n, r] = p(t), i = e !== void 0, a = o((e) => {
268
339
  i || r(e);
269
340
  }, [i]);
@@ -271,73 +342,232 @@ function _e(e, t) {
271
342
  }
272
343
  //#endregion
273
344
  //#region src/components/checkbox/checkbox.tsx
274
- function ve({ label: e, description: t, error: n, radius: r = "sm", unstyled: i = !1, className: a, wrapperClassName: o, checked: s, defaultChecked: c = !1, onChange: l, id: u, ...d }) {
275
- let { fieldId: f, errorId: p, descriptionId: m } = B(u), [v, y] = _e(s, c), b = [t && m, n && p].filter(Boolean).join(" ") || void 0;
345
+ function xe(e, t, n) {
346
+ return e === void 0 ? null : typeof e == "string" ? /* @__PURE__ */ _("span", {
347
+ className: t,
348
+ children: [e, n && /* @__PURE__ */ g("span", {
349
+ className: "text-red-500 dark:text-red-400 ml-1",
350
+ children: "*"
351
+ })]
352
+ }) : /* @__PURE__ */ _(h, { children: [e, n && /* @__PURE__ */ g("span", {
353
+ className: "text-red-500 dark:text-red-400 ml-1",
354
+ children: "*"
355
+ })] });
356
+ }
357
+ function Se({ label: e, indeterminate: t = !1, description: n, error: r, radius: i = "sm", unstyled: a = !1, fullWidth: o = !1, variant: s = "inline", className: l, wrapperClassName: u, checked: p, defaultChecked: m = !1, onChange: h, id: v, "aria-describedby": y, ref: b, ...C }) {
358
+ let { fieldId: w, errorId: T, descriptionId: E } = Y(v), [D, O] = be(p, m), k = f(null), A = s === "card", j = D || t, M = q(y, !!n && E, r && T), N = d(() => se(k, b), [b]);
359
+ c(() => {
360
+ k.current && (k.current.indeterminate = t);
361
+ });
362
+ let P = (e) => {
363
+ e.target.indeterminate = t, O(e.target.checked), h?.(e);
364
+ }, F = A ? ve({
365
+ isSelected: j,
366
+ isError: !!r,
367
+ isDisabled: C.disabled === !0,
368
+ radius: i,
369
+ unstyled: a
370
+ }) : x("flex items-start gap-3 cursor-pointer", C.disabled && "cursor-not-allowed opacity-50"), I = A ? x("select-none text-sm font-medium", j ? r ? "text-red-700 dark:text-red-300" : "text-blue-700 dark:text-blue-300" : "text-gray-700 dark:text-gray-300") : x(ue, "select-none"), L = x("relative shrink-0", S[i], !A && ["has-[:focus-visible]:outline-none has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-offset-2 has-[:focus-visible]:ring-offset-white dark:has-[:focus-visible]:ring-offset-gray-900", r ? "has-[:focus-visible]:ring-red-500" : "has-[:focus-visible]:ring-blue-500"]), R = xe(e, I, C.required === !0);
276
371
  return /* @__PURE__ */ _("div", {
277
- className: x("w-full", o),
372
+ className: x(o ? "w-full" : "w-fit", u),
278
373
  children: [
279
374
  /* @__PURE__ */ _("label", {
280
- htmlFor: f,
281
- className: x("flex items-start gap-3 cursor-pointer", d.disabled && "cursor-not-allowed opacity-50"),
375
+ htmlFor: w,
376
+ className: F,
282
377
  children: [/* @__PURE__ */ _("span", {
283
- className: x("relative shrink-0", S[r], T, n ? D : E),
378
+ className: L,
284
379
  children: [/* @__PURE__ */ g("input", {
285
380
  type: "checkbox",
286
- id: f,
381
+ ref: N,
382
+ id: w,
287
383
  className: "sr-only",
288
- checked: v,
289
- onChange: (e) => {
290
- y(e.target.checked), l?.(e);
291
- },
292
- "aria-invalid": !!n,
293
- "aria-describedby": b,
294
- ...d
384
+ checked: D,
385
+ onChange: P,
386
+ "aria-invalid": !!r,
387
+ "aria-describedby": M,
388
+ ...C
295
389
  }), /* @__PURE__ */ g("span", {
296
- className: x("flex h-5 w-5 items-center justify-center transition-all duration-200", !i && [
297
- S[r],
390
+ className: x("flex h-5 w-5 items-center justify-center transition-all duration-200", !a && [
391
+ S[i],
298
392
  "border-2",
299
- v ? x("border-blue-600 dark:border-blue-500", "bg-blue-600 dark:bg-blue-500") : x("border-gray-300 dark:border-gray-600", "bg-white dark:bg-gray-800"),
300
- n && "border-red-500 dark:border-red-400"
301
- ], a),
393
+ j ? x("border-blue-600 dark:border-blue-500", "bg-blue-600 dark:bg-blue-500") : x("border-gray-300 dark:border-gray-600", "bg-white dark:bg-gray-800"),
394
+ r && "border-red-500 dark:border-red-400"
395
+ ], l),
302
396
  "aria-hidden": !0,
303
- children: v && /* @__PURE__ */ g("svg", {
304
- className: "h-3 w-3 text-white",
305
- viewBox: "0 0 12 12",
306
- fill: "none",
307
- stroke: "currentColor",
308
- strokeWidth: "2.5",
309
- strokeLinecap: "round",
310
- strokeLinejoin: "round",
311
- children: /* @__PURE__ */ g("polyline", { points: "2 6 5 9 10 3" })
312
- })
397
+ children: t ? /* @__PURE__ */ g(ce, {}) : D && /* @__PURE__ */ g(ge, {})
313
398
  })]
314
- }), e !== void 0 && (typeof e == "string" ? /* @__PURE__ */ _("span", {
315
- className: x("text-sm font-medium text-gray-700 dark:text-gray-300", "select-none"),
316
- children: [e, d.required && /* @__PURE__ */ g("span", {
317
- className: "text-red-500 dark:text-red-400 ml-1",
318
- children: "*"
399
+ }), A ? /* @__PURE__ */ _("span", {
400
+ className: "flex min-w-0 flex-col",
401
+ children: [R, n && /* @__PURE__ */ g("span", {
402
+ id: E,
403
+ className: x("text-xs text-gray-600 dark:text-gray-400", "mt-0.5"),
404
+ children: n
405
+ })]
406
+ }) : R]
407
+ }),
408
+ !A && /* @__PURE__ */ g(_e, {
409
+ id: E,
410
+ description: n,
411
+ className: "mt-1 ml-8"
412
+ }),
413
+ /* @__PURE__ */ g(J, {
414
+ id: T,
415
+ error: r,
416
+ className: A ? "mt-1" : "mt-1 ml-8"
417
+ })
418
+ ]
419
+ });
420
+ }
421
+ var Ce = r({
422
+ close: "Close",
423
+ confirm: "Confirm",
424
+ cancel: "Cancel",
425
+ noResults: "No results found",
426
+ clearSelection: "Clear selection",
427
+ search: "Search",
428
+ clear: "Clear",
429
+ required: "required",
430
+ currentTheme: (e) => `Current theme: ${e}`,
431
+ overflowCount: (e) => `+${e} more`,
432
+ selectedCount: (e) => `${e} selected`,
433
+ maxSelectedHint: (e) => `You can select up to ${e} items`
434
+ });
435
+ //#endregion
436
+ //#region src/components/ui_provider/use_labels.ts
437
+ function we() {
438
+ return s(Ce);
439
+ }
440
+ //#endregion
441
+ //#region src/components/shared/option_row.tsx
442
+ function Te({ item: e, htmlFor: t, descriptionId: n, orientation: r, isSelected: i, isDisabled: a, isError: o, radius: s, unstyled: c, className: l, control: u, indicator: d }) {
443
+ return /* @__PURE__ */ _("label", {
444
+ htmlFor: t,
445
+ className: x(ve({
446
+ isSelected: i,
447
+ isError: o,
448
+ isDisabled: a,
449
+ radius: s,
450
+ unstyled: c
451
+ }), r === "horizontal" && "flex-1", l),
452
+ children: [
453
+ u,
454
+ d,
455
+ /* @__PURE__ */ _("span", {
456
+ className: "flex min-w-0 flex-col",
457
+ children: [/* @__PURE__ */ _("span", {
458
+ className: "flex items-center gap-1.5",
459
+ children: [e.icon && /* @__PURE__ */ g("span", {
460
+ className: x(e.icon, "h-4 w-4 shrink-0", i ? o ? "text-red-600 dark:text-red-400" : "text-blue-600 dark:text-blue-400" : "text-gray-500 dark:text-gray-400"),
461
+ "aria-hidden": !0
462
+ }), /* @__PURE__ */ g("span", {
463
+ className: x("select-none text-sm font-medium", i ? o ? "text-red-700 dark:text-red-300" : "text-blue-700 dark:text-blue-300" : "text-gray-700 dark:text-gray-300"),
464
+ children: e.label
319
465
  })]
320
- }) : /* @__PURE__ */ _(h, { children: [e, d.required && /* @__PURE__ */ g("span", {
466
+ }), e.description && /* @__PURE__ */ g("span", {
467
+ id: n,
468
+ className: x("text-xs text-gray-600 dark:text-gray-400", "mt-0.5"),
469
+ children: e.description
470
+ })]
471
+ })
472
+ ]
473
+ });
474
+ }
475
+ //#endregion
476
+ //#region src/components/checkbox_options/checkbox_option_row.tsx
477
+ function Ee({ option: e, optionId: t, descriptionId: n, name: r, orientation: i, isSelected: a, isDisabled: o, error: s, radius: c, unstyled: l, className: u, onToggle: d }) {
478
+ let f = !!s;
479
+ return /* @__PURE__ */ g(Te, {
480
+ item: e,
481
+ htmlFor: t,
482
+ descriptionId: n,
483
+ orientation: i,
484
+ isSelected: a,
485
+ isDisabled: o,
486
+ isError: f,
487
+ radius: c,
488
+ unstyled: l,
489
+ className: u,
490
+ control: /* @__PURE__ */ g("input", {
491
+ type: "checkbox",
492
+ id: t,
493
+ name: r,
494
+ value: e.value,
495
+ checked: a,
496
+ onChange: () => d(e.value),
497
+ disabled: o,
498
+ "aria-invalid": s ? !0 : void 0,
499
+ "aria-describedby": e.description ? n : void 0,
500
+ className: "sr-only"
501
+ }),
502
+ indicator: /* @__PURE__ */ g("span", {
503
+ className: x("mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center border-2 transition-colors duration-150", S.sm, ye({
504
+ isSelected: a,
505
+ isError: f
506
+ }), a && (f ? "bg-red-500 dark:bg-red-400" : "bg-blue-600 dark:bg-blue-500")),
507
+ "aria-hidden": !0,
508
+ children: a && /* @__PURE__ */ g(ge, {})
509
+ })
510
+ });
511
+ }
512
+ //#endregion
513
+ //#region src/components/checkbox_options/checkbox_options.tsx
514
+ function De(e, t, n) {
515
+ let r = t.includes(n) ? t.filter((e) => e !== n) : [...t, n];
516
+ return e.map((e) => e.value).filter((e) => r.includes(e));
517
+ }
518
+ function Oe({ options: e, orientation: t = "vertical", values: n, defaultValues: r, onChange: i, name: a, label: o, error: s, required: c, requiredLabel: l, disabled: u, radius: d = "lg", unstyled: f = !1, className: p, wrapperClassName: m, id: v, "aria-describedby": y, ...b }) {
519
+ let S = we(), { fieldId: C, errorId: w } = Y(v), T = a ?? C, [E, D] = be(n, r ?? []), O = e.map((e) => typeof e == "string" ? {
520
+ value: e,
521
+ label: e
522
+ } : e), k = (e) => {
523
+ let t = De(O, E, e);
524
+ D(t), i?.(t);
525
+ };
526
+ return /* @__PURE__ */ _("fieldset", {
527
+ className: x("m-0 border-0 p-0", m),
528
+ disabled: u,
529
+ "aria-describedby": q(y, s && w),
530
+ ...b,
531
+ children: [
532
+ o && /* @__PURE__ */ _("legend", {
533
+ className: x("text-sm font-medium text-gray-700 dark:text-gray-300", "mb-2"),
534
+ children: [o, c && /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("span", {
321
535
  className: "text-red-500 dark:text-red-400 ml-1",
536
+ "aria-hidden": "true",
322
537
  children: "*"
323
- })] }))]
538
+ }), /* @__PURE__ */ g("span", {
539
+ className: "sr-only",
540
+ children: ` (${l ?? S.required})`
541
+ })] })]
324
542
  }),
325
- /* @__PURE__ */ g(ge, {
326
- id: m,
327
- description: t,
328
- className: "mt-1 ml-8"
543
+ /* @__PURE__ */ g("div", {
544
+ className: x(t === "horizontal" ? "flex flex-row gap-2" : "flex flex-col gap-2"),
545
+ children: O.map((e, n) => /* @__PURE__ */ g(Ee, {
546
+ option: e,
547
+ optionId: `${C}-${n}`,
548
+ descriptionId: `${C}-${n}-desc`,
549
+ name: T,
550
+ orientation: t,
551
+ isSelected: E.includes(e.value),
552
+ isDisabled: u === !0 || e.disabled === !0,
553
+ error: s,
554
+ radius: d,
555
+ unstyled: f,
556
+ className: p,
557
+ onToggle: k
558
+ }, e.value))
329
559
  }),
330
- /* @__PURE__ */ g(he, {
331
- id: p,
332
- error: n,
333
- className: "mt-1 ml-8"
560
+ /* @__PURE__ */ g(J, {
561
+ id: w,
562
+ error: s,
563
+ className: "mt-2"
334
564
  })
335
565
  ]
336
566
  });
337
567
  }
338
568
  //#endregion
339
569
  //#region src/hooks/use_is_client/use_is_client.tsx
340
- var ye = () => {
570
+ var ke = () => {
341
571
  let [e, t] = p(!1);
342
572
  return c(() => {
343
573
  requestAnimationFrame(() => {
@@ -347,146 +577,206 @@ var ye = () => {
347
577
  };
348
578
  //#endregion
349
579
  //#region src/components/client_only/client_only.tsx
350
- function be({ children: e, fallback: t }) {
351
- return ye() ? /* @__PURE__ */ g(h, { children: e }) : t ?? null;
580
+ function Ae({ children: e, fallback: t }) {
581
+ return ke() ? /* @__PURE__ */ g(h, { children: e }) : t ?? null;
352
582
  }
353
583
  //#endregion
354
584
  //#region src/components/shared/field.tsx
355
- var xe = ({ fieldId: e, errorId: t, label: n, error: r, required: i = !1, wrapperClassName: a, children: o }) => /* @__PURE__ */ _("div", {
356
- className: x("w-full", a),
585
+ var je = ({ fieldId: e, errorId: t, descriptionId: n, label: r, description: i, error: a, required: o = !1, wrapperClassName: s, children: c }) => /* @__PURE__ */ _("div", {
586
+ className: x("w-full", s),
357
587
  children: [
358
- n !== void 0 && (typeof n == "string" ? /* @__PURE__ */ _("label", {
588
+ r !== void 0 && (typeof r == "string" ? /* @__PURE__ */ _("label", {
589
+ id: `${e}-label`,
359
590
  className: x("text-sm font-medium text-gray-700 dark:text-gray-300", "block mb-1"),
360
591
  htmlFor: e,
361
- children: [n, i && /* @__PURE__ */ g("span", {
592
+ children: [r, o && /* @__PURE__ */ g("span", {
362
593
  className: "text-red-500 dark:text-red-400 ml-1",
594
+ "aria-hidden": "true",
363
595
  children: "*"
364
596
  })]
365
- }) : /* @__PURE__ */ _(h, { children: [n, i && /* @__PURE__ */ g("span", {
597
+ }) : /* @__PURE__ */ _(h, { children: [r, o && /* @__PURE__ */ g("span", {
366
598
  className: "text-red-500 dark:text-red-400 ml-1",
599
+ "aria-hidden": "true",
367
600
  children: "*"
368
601
  })] })),
369
- o,
370
- /* @__PURE__ */ g(he, {
602
+ c,
603
+ n && /* @__PURE__ */ g(_e, {
604
+ id: n,
605
+ description: i,
606
+ className: "mt-1"
607
+ }),
608
+ /* @__PURE__ */ g(J, {
371
609
  id: t,
372
- error: r,
610
+ error: a,
373
611
  className: "mt-1"
374
612
  })
375
613
  ]
376
- });
614
+ }), Me = -1;
615
+ function Ne(e, t) {
616
+ return e >= 0 && e < t ? e : Me;
617
+ }
618
+ function Pe({ optionCount: e, getOptionId: t, isOpen: n }) {
619
+ let [r, i] = p(Me), a = Ne(r, e), s = o((t) => {
620
+ e !== 0 && i((n) => {
621
+ let r = Ne(n, e) + t;
622
+ return r < 0 ? e - 1 : r >= e ? 0 : r;
623
+ });
624
+ }, [e]), l = o(() => {
625
+ i(0);
626
+ }, []), u = o(() => {
627
+ i(e - 1);
628
+ }, [e]), d = o(() => {
629
+ i(Me);
630
+ }, []), f = n && a >= 0 ? t(a) : void 0;
631
+ return c(() => {
632
+ f !== void 0 && document.getElementById(f)?.scrollIntoView?.({ block: "nearest" });
633
+ }, [f]), {
634
+ activeIndex: a,
635
+ activeOptionId: f,
636
+ move: s,
637
+ first: l,
638
+ last: u,
639
+ reset: d
640
+ };
641
+ }
377
642
  //#endregion
378
643
  //#region src/components/combobox/combobox.tsx
379
- function Se({ options: e, label: t, error: n, placeholder: r, noResultsText: i = "No results found", clearLabel: a = "Clear selection", radius: o = "md", unstyled: s = !1, disabled: c = !1, required: l = !1, className: u, wrapperClassName: f, value: m, defaultValue: h = "", onChange: v, id: y }) {
380
- let { fieldId: b, errorId: C } = B(y), w = `${b}-listbox`, [T, E] = _e(m, h), D = e.find((e) => e.value === T), [O, k] = p(""), [A, j] = p(!1), [M, N] = p(!1), [P, F] = p(-1), I = d(() => A ? e.filter((e) => e.label.toLowerCase().includes(O.toLowerCase())) : e, [
644
+ function Fe({ options: e, label: t, "aria-label": n, error: r, placeholder: i, noResultsText: a, clearLabel: o, radius: s = "md", unstyled: c = !1, disabled: l = !1, required: u = !1, className: m, wrapperClassName: h, value: v, defaultValue: y = "", onChange: b, id: C }) {
645
+ let w = we(), { fieldId: T, errorId: E } = Y(C), D = `${T}-listbox`, O = f(null), [k, j] = be(v, y), M = e.find((e) => e.value === k), [N, P] = p(""), [F, I] = p(!1), [L, R] = p(!1), z = d(() => F ? e.filter((e) => e.label.toLowerCase().includes(N.toLowerCase())) : e, [
381
646
  e,
382
- A,
383
- O
384
- ]), ee = M ? O : D?.label ?? "", L = () => {
385
- c || (k(D?.label ?? ""), j(!1), N(!0), F(-1));
386
- }, R = () => {
387
- N(!1), j(!1), F(-1);
388
- }, te = (e) => {
389
- E(e.value), v?.(e.value), R();
390
- }, ne = () => {
391
- E(""), v?.(""), k("");
392
- }, re = (e) => {
393
- k(e.target.value), j(!0), N(!0), F(0);
394
- }, z = (e) => {
395
- I.length !== 0 && F((t) => {
396
- let n = t + e;
397
- return n < 0 ? I.length - 1 : n >= I.length ? 0 : n;
398
- });
647
+ F,
648
+ N
649
+ ]), { activeIndex: ee, activeOptionId: te, move: B, first: V, last: ne, reset: H } = Pe({
650
+ optionCount: z.length,
651
+ getOptionId: (e) => `${D}-option-${e}`,
652
+ isOpen: L
653
+ }), re = L ? N : M?.label ?? "", U = () => {
654
+ l || (P(M?.label ?? ""), I(!1), R(!0), H());
655
+ }, W = () => {
656
+ R(!1), I(!1), H();
399
657
  }, ie = (e) => {
400
- if (e.key === "ArrowDown") {
401
- e.preventDefault(), M ? z(1) : L();
658
+ j(e.value), b?.(e.value), W();
659
+ }, ae = () => {
660
+ j(""), b?.(""), P(""), O.current?.focus();
661
+ }, G = (e) => {
662
+ P(e.target.value), I(!0), R(!0), V();
663
+ }, oe = () => {
664
+ L || U();
665
+ }, K = (e) => {
666
+ if (e.preventDefault(), e.altKey) {
667
+ L || U();
402
668
  return;
403
669
  }
404
- if (e.key === "ArrowUp") {
405
- e.preventDefault(), M ? z(-1) : L();
670
+ if (!L) {
671
+ U(), V();
406
672
  return;
407
673
  }
408
- if (e.key === "Enter") {
409
- if (!M) return;
410
- e.preventDefault();
411
- let t = I[P];
412
- t && te(t);
674
+ B(1);
675
+ }, se = (e) => {
676
+ if (e.preventDefault(), e.altKey) {
677
+ L && W();
413
678
  return;
414
679
  }
415
- if (e.key === "Escape") {
416
- if (!M) return;
417
- e.preventDefault(), R();
680
+ if (!L) {
681
+ U(), ne();
682
+ return;
418
683
  }
419
- }, ae = M && P >= 0 ? `${w}-option-${P}` : void 0;
420
- return /* @__PURE__ */ g(xe, {
421
- fieldId: b,
422
- errorId: C,
684
+ B(-1);
685
+ }, q = (e) => {
686
+ if (!L) return;
687
+ let t = z[ee];
688
+ if (!t) {
689
+ W();
690
+ return;
691
+ }
692
+ e.preventDefault(), ie(t);
693
+ }, ce = (e) => {
694
+ L && (e.preventDefault(), W());
695
+ };
696
+ return /* @__PURE__ */ g(je, {
697
+ fieldId: T,
698
+ errorId: E,
423
699
  label: t,
424
- error: n,
425
- required: l,
426
- wrapperClassName: f,
700
+ error: r,
701
+ required: u,
702
+ wrapperClassName: h,
427
703
  children: /* @__PURE__ */ _("div", {
428
704
  className: "relative",
429
705
  children: [
430
- !s && /* @__PURE__ */ g("span", {
706
+ !c && /* @__PURE__ */ g("span", {
431
707
  className: "i-mdi-magnify absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 dark:text-gray-500 pointer-events-none",
432
708
  "aria-hidden": !0
433
709
  }),
434
710
  /* @__PURE__ */ g("input", {
435
- id: b,
711
+ ref: O,
712
+ id: T,
436
713
  role: "combobox",
437
714
  type: "text",
438
715
  autoComplete: "off",
439
- disabled: c,
440
- placeholder: r,
441
- value: ee,
442
- onChange: re,
443
- onFocus: L,
444
- onBlur: R,
445
- onKeyDown: ie,
446
- "aria-expanded": M,
447
- "aria-controls": w,
716
+ disabled: l,
717
+ placeholder: i,
718
+ value: re,
719
+ onChange: G,
720
+ onClick: oe,
721
+ onBlur: W,
722
+ onKeyDown: (e) => {
723
+ if (e.key === "ArrowDown") return K(e);
724
+ if (e.key === "ArrowUp") return se(e);
725
+ if (e.key === "Enter") return q(e);
726
+ if (e.key === "Escape") return ce(e);
727
+ },
728
+ "aria-expanded": L,
729
+ "aria-controls": D,
448
730
  "aria-autocomplete": "list",
449
- "aria-activedescendant": ae,
450
- "aria-invalid": !!n,
451
- "aria-describedby": n ? C : void 0,
452
- className: x("w-full disabled:opacity-50 disabled:cursor-not-allowed", !s && [
453
- de,
454
- S[o],
731
+ "aria-label": n,
732
+ "aria-activedescendant": te,
733
+ "aria-invalid": !!r,
734
+ "aria-required": u || void 0,
735
+ "aria-describedby": r ? E : void 0,
736
+ className: x("w-full disabled:opacity-50 disabled:cursor-not-allowed", !c && [
737
+ le,
738
+ S[s],
455
739
  "pl-9 pr-8 py-2 text-sm"
456
- ], !s && n && x("border-red-500 dark:border-red-400", "focus:ring-red-500"), u)
740
+ ], !c && r && x("border-red-500 dark:border-red-400", "focus:ring-red-500"), m)
457
741
  }),
458
- !s && D && !c && /* @__PURE__ */ g("button", {
742
+ !c && M && !l && /* @__PURE__ */ g("button", {
459
743
  type: "button",
460
- "aria-label": a,
461
- onMouseDown: (e) => e.preventDefault(),
462
- onClick: ne,
463
- className: "absolute right-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 hover:text-gray-600 dark:text-gray-500 dark:hover:text-gray-300",
744
+ "aria-label": o ?? w.clearSelection,
745
+ onMouseDown: (e) => {
746
+ e.preventDefault();
747
+ },
748
+ onClick: ae,
749
+ className: x("absolute right-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 hover:text-gray-600 dark:text-gray-500 dark:hover:text-gray-300", "outline-hidden focus-visible:outline-2 focus-visible:outline-offset-2", A.primary.focusOutline),
464
750
  children: /* @__PURE__ */ g("span", {
465
751
  className: "i-mdi-close block w-4 h-4",
466
752
  "aria-hidden": !0
467
753
  })
468
754
  }),
469
- M && /* @__PURE__ */ g("ul", {
470
- id: w,
471
- role: "listbox",
472
- className: x("absolute z-10 mt-1 w-full max-h-60 overflow-auto py-1 text-sm shadow-lg", !s && [
755
+ L && /* @__PURE__ */ _("div", {
756
+ className: x("absolute z-10 mt-1 w-full text-sm shadow-lg", !c && [
473
757
  "border",
474
758
  "bg-white dark:bg-gray-900",
475
759
  "border-gray-100 dark:border-gray-800",
476
- S[o]
760
+ S[s]
477
761
  ]),
478
- children: I.length === 0 ? /* @__PURE__ */ g("li", {
479
- className: "px-3 py-2 text-gray-500 dark:text-gray-400",
480
- children: i
481
- }) : I.map((e, t) => /* @__PURE__ */ g("li", {
482
- id: `${w}-option-${t}`,
483
- role: "option",
484
- "aria-selected": e.value === T,
485
- onMouseDown: (e) => e.preventDefault(),
486
- onClick: () => te(e),
487
- className: x("px-3 py-2 cursor-pointer text-gray-900 dark:text-gray-100", t === P ? "bg-blue-50 dark:bg-blue-900/40" : "hover:bg-gray-50 dark:hover:bg-gray-800/60", e.value === T && "font-medium"),
488
- children: e.label
489
- }, e.value))
762
+ children: [/* @__PURE__ */ g("ul", {
763
+ id: D,
764
+ role: "listbox",
765
+ className: "max-h-60 overflow-auto py-1",
766
+ children: z.map((e, t) => /* @__PURE__ */ g("li", {
767
+ id: `${D}-option-${t}`,
768
+ role: "option",
769
+ "aria-selected": e.value === k,
770
+ onMouseDown: (e) => e.preventDefault(),
771
+ onClick: () => ie(e),
772
+ className: x("px-3 py-2 cursor-pointer text-gray-900 dark:text-gray-100", t === ee ? x("bg-blue-50 dark:bg-blue-900/40", "outline-2 -outline-offset-2 outline-blue-500 dark:outline-blue-400") : "hover:bg-gray-50 dark:hover:bg-gray-800/60", e.value === k && "font-medium"),
773
+ children: e.label
774
+ }, e.value))
775
+ }), /* @__PURE__ */ g("div", {
776
+ role: "status",
777
+ className: z.length === 0 ? "px-3 py-2 text-gray-500 dark:text-gray-400" : void 0,
778
+ children: z.length === 0 ? a ?? w.noResults : ""
779
+ })]
490
780
  })
491
781
  ]
492
782
  })
@@ -494,75 +784,75 @@ function Se({ options: e, label: t, error: n, placeholder: r, noResultsText: i =
494
784
  }
495
785
  //#endregion
496
786
  //#region node_modules/.pnpm/@floating-ui+utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
497
- var Ce = Math.min, V = Math.max, we = Math.round, Te = Math.floor, H = (e) => ({
787
+ var Ie = Math.min, Le = Math.max, Re = Math.round, ze = Math.floor, X = (e) => ({
498
788
  x: e,
499
789
  y: e
500
- }), Ee = {
790
+ }), Be = {
501
791
  left: "right",
502
792
  right: "left",
503
793
  bottom: "top",
504
794
  top: "bottom"
505
795
  };
506
- function De(e, t, n) {
507
- return V(e, Ce(t, n));
796
+ function Ve(e, t, n) {
797
+ return Le(e, Ie(t, n));
508
798
  }
509
- function Oe(e, t) {
799
+ function He(e, t) {
510
800
  return typeof e == "function" ? e(t) : e;
511
801
  }
512
- function U(e) {
802
+ function Ue(e) {
513
803
  return e.split("-")[0];
514
804
  }
515
- function ke(e) {
805
+ function We(e) {
516
806
  return e.split("-")[1];
517
807
  }
518
- function Ae(e) {
808
+ function Ge(e) {
519
809
  return e === "x" ? "y" : "x";
520
810
  }
521
- function je(e) {
811
+ function Ke(e) {
522
812
  return e === "y" ? "height" : "width";
523
813
  }
524
- function W(e) {
814
+ function qe(e) {
525
815
  let t = e[0];
526
816
  return t === "t" || t === "b" ? "y" : "x";
527
817
  }
528
- function Me(e) {
529
- return Ae(W(e));
818
+ function Je(e) {
819
+ return Ge(qe(e));
530
820
  }
531
- function Ne(e, t, n) {
821
+ function Ye(e, t, n) {
532
822
  n === void 0 && (n = !1);
533
- let r = ke(e), i = Me(e), a = je(i), o = i === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
534
- return t.reference[a] > t.floating[a] && (o = He(o)), [o, He(o)];
823
+ let r = We(e), i = Je(e), a = Ke(i), o = i === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
824
+ return t.reference[a] > t.floating[a] && (o = it(o)), [o, it(o)];
535
825
  }
536
- function Pe(e) {
537
- let t = He(e);
826
+ function Xe(e) {
827
+ let t = it(e);
538
828
  return [
539
- Fe(e),
829
+ Ze(e),
540
830
  t,
541
- Fe(t)
831
+ Ze(t)
542
832
  ];
543
833
  }
544
- function Fe(e) {
834
+ function Ze(e) {
545
835
  return e.includes("start") ? e.replace("start", "end") : e.replace("end", "start");
546
836
  }
547
- var Ie = ["left", "right"], Le = ["right", "left"], Re = ["top", "bottom"], ze = ["bottom", "top"];
548
- function Be(e, t, n) {
837
+ var Qe = ["left", "right"], $e = ["right", "left"], et = ["top", "bottom"], tt = ["bottom", "top"];
838
+ function nt(e, t, n) {
549
839
  switch (e) {
550
840
  case "top":
551
- case "bottom": return n ? t ? Le : Ie : t ? Ie : Le;
841
+ case "bottom": return n ? t ? $e : Qe : t ? Qe : $e;
552
842
  case "left":
553
- case "right": return t ? Re : ze;
843
+ case "right": return t ? et : tt;
554
844
  default: return [];
555
845
  }
556
846
  }
557
- function Ve(e, t, n, r) {
558
- let i = ke(e), a = Be(U(e), n === "start", r);
559
- return i && (a = a.map((e) => e + "-" + i), t && (a = a.concat(a.map(Fe)))), a;
847
+ function rt(e, t, n, r) {
848
+ let i = We(e), a = nt(Ue(e), n === "start", r);
849
+ return i && (a = a.map((e) => e + "-" + i), t && (a = a.concat(a.map(Ze)))), a;
560
850
  }
561
- function He(e) {
562
- let t = U(e);
563
- return Ee[t] + e.slice(t.length);
851
+ function it(e) {
852
+ let t = Ue(e);
853
+ return Be[t] + e.slice(t.length);
564
854
  }
565
- function Ue(e) {
855
+ function at(e) {
566
856
  return {
567
857
  top: e.top ?? 0,
568
858
  right: e.right ?? 0,
@@ -570,15 +860,15 @@ function Ue(e) {
570
860
  left: e.left ?? 0
571
861
  };
572
862
  }
573
- function We(e) {
863
+ function ot(e) {
574
864
  return typeof e == "number" ? {
575
865
  top: e,
576
866
  right: e,
577
867
  bottom: e,
578
868
  left: e
579
- } : Ue(e);
869
+ } : at(e);
580
870
  }
581
- function Ge(e) {
871
+ function st(e) {
582
872
  let { x: t, y: n, width: r, height: i } = e;
583
873
  return {
584
874
  width: r,
@@ -593,8 +883,8 @@ function Ge(e) {
593
883
  }
594
884
  //#endregion
595
885
  //#region node_modules/.pnpm/@floating-ui+core@1.8.0/node_modules/@floating-ui/core/dist/floating-ui.core.mjs
596
- function Ke(e, t, n) {
597
- let { reference: r, floating: i } = e, a = W(t), o = Me(t), s = je(o), c = U(t), l = a === "y", u = r.x + r.width / 2 - i.width / 2, d = r.y + r.height / 2 - i.height / 2, f = r[s] / 2 - i[s] / 2, p;
886
+ function ct(e, t, n) {
887
+ let { reference: r, floating: i } = e, a = qe(t), o = Je(t), s = Ke(o), c = Ue(t), l = a === "y", u = r.x + r.width / 2 - i.width / 2, d = r.y + r.height / 2 - i.height / 2, f = r[s] / 2 - i[s] / 2, p;
598
888
  switch (c) {
599
889
  case "top":
600
890
  p = {
@@ -625,12 +915,12 @@ function Ke(e, t, n) {
625
915
  y: r.y
626
916
  };
627
917
  }
628
- let m = ke(t);
918
+ let m = We(t);
629
919
  return m && (p[o] += f * (m === "end" ? 1 : -1) * (n && l ? -1 : 1)), p;
630
920
  }
631
- async function qe(e, t) {
921
+ async function lt(e, t) {
632
922
  t === void 0 && (t = {});
633
- let { x: n, y: r, platform: i, rects: a, elements: o, strategy: s } = e, { boundary: c = "clippingAncestors", rootBoundary: l = "viewport", elementContext: u = "floating", altBoundary: d = !1, padding: f = 0 } = Oe(t, e), p = We(f), m = o[d ? u === "floating" ? "reference" : "floating" : u], h = Ge(await i.getClippingRect({
923
+ let { x: n, y: r, platform: i, rects: a, elements: o, strategy: s } = e, { boundary: c = "clippingAncestors", rootBoundary: l = "viewport", elementContext: u = "floating", altBoundary: d = !1, padding: f = 0 } = He(t, e), p = ot(f), m = o[d ? u === "floating" ? "reference" : "floating" : u], h = st(await i.getClippingRect({
634
924
  element: await (i.isElement == null ? void 0 : i.isElement(m)) ?? !0 ? m : m.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(o.floating)),
635
925
  boundary: c,
636
926
  rootBoundary: l,
@@ -643,7 +933,7 @@ async function qe(e, t) {
643
933
  } : a.reference, _ = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(o.floating)), v = await (i.isElement == null ? void 0 : i.isElement(_)) && await (i.getScale == null ? void 0 : i.getScale(_)) || {
644
934
  x: 1,
645
935
  y: 1
646
- }, y = Ge(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
936
+ }, y = st(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
647
937
  elements: o,
648
938
  rect: g,
649
939
  offsetParent: _,
@@ -656,15 +946,15 @@ async function qe(e, t) {
656
946
  right: (y.right - h.right + p.right) / v.x
657
947
  };
658
948
  }
659
- var Je = 50, Ye = async (e, t, n) => {
949
+ var ut = 50, dt = async (e, t, n) => {
660
950
  let { placement: r = "bottom", strategy: i = "absolute", middleware: a = [], platform: o } = n, s = o.detectOverflow ? o : {
661
951
  ...o,
662
- detectOverflow: qe
952
+ detectOverflow: lt
663
953
  }, c = await (o.isRTL == null ? void 0 : o.isRTL(t)), l = await o.getElementRects({
664
954
  reference: e,
665
955
  floating: t,
666
956
  strategy: i
667
- }), { x: u, y: d } = Ke(l, r, c), f = r, p = 0, m = {};
957
+ }), { x: u, y: d } = ct(l, r, c), f = r, p = 0, m = {};
668
958
  for (let n = 0; n < a.length; n++) {
669
959
  let h = a[n];
670
960
  if (!h) continue;
@@ -685,11 +975,11 @@ var Je = 50, Ye = async (e, t, n) => {
685
975
  u = v ?? u, d = y ?? d, m[g] = {
686
976
  ...m[g],
687
977
  ...b
688
- }, x && p < Je && (p++, typeof x == "object" && (x.placement && (f = x.placement), x.rects && (l = x.rects === !0 ? await o.getElementRects({
978
+ }, x && p < ut && (p++, typeof x == "object" && (x.placement && (f = x.placement), x.rects && (l = x.rects === !0 ? await o.getElementRects({
689
979
  reference: e,
690
980
  floating: t,
691
981
  strategy: i
692
- }) : x.rects), {x: u, y: d} = Ke(l, f, c)), n = -1);
982
+ }) : x.rects), {x: u, y: d} = ct(l, f, c)), n = -1);
693
983
  }
694
984
  return {
695
985
  x: u,
@@ -698,18 +988,18 @@ var Je = 50, Ye = async (e, t, n) => {
698
988
  strategy: i,
699
989
  middlewareData: m
700
990
  };
701
- }, Xe = (e) => ({
991
+ }, ft = (e) => ({
702
992
  name: "arrow",
703
993
  options: e,
704
994
  async fn(t) {
705
- let { x: n, y: r, placement: i, rects: a, platform: o, elements: s, middlewareData: c } = t, { element: l, padding: u = 0 } = Oe(e, t) || {};
995
+ let { x: n, y: r, placement: i, rects: a, platform: o, elements: s, middlewareData: c } = t, { element: l, padding: u = 0 } = He(e, t) || {};
706
996
  if (l == null) return {};
707
- let d = We(u), f = {
997
+ let d = ot(u), f = {
708
998
  x: n,
709
999
  y: r
710
- }, p = Me(i), m = je(p), h = await o.getDimensions(l), g = p === "y", _ = g ? "top" : "left", v = g ? "bottom" : "right", y = g ? "clientHeight" : "clientWidth", b = a.reference[m] + a.reference[p] - f[p] - a.floating[m], x = f[p] - a.reference[p], S = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(l)), C = S ? S[y] : 0;
1000
+ }, p = Je(i), m = Ke(p), h = await o.getDimensions(l), g = p === "y", _ = g ? "top" : "left", v = g ? "bottom" : "right", y = g ? "clientHeight" : "clientWidth", b = a.reference[m] + a.reference[p] - f[p] - a.floating[m], x = f[p] - a.reference[p], S = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(l)), C = S ? S[y] : 0;
711
1001
  (!C || !await (o.isElement == null ? void 0 : o.isElement(S))) && (C = s.floating[y] || a.floating[m]);
712
- let w = b / 2 - x / 2, T = C / 2 - h[m] / 2 - 1, E = Ce(d[_], T), D = Ce(d[v], T), O = C - h[m] - D, k = C / 2 - h[m] / 2 + w, A = De(E, k, O), j = !c.arrow && ke(i) != null && k !== A && a.reference[m] / 2 - (k < E ? E : D) - h[m] / 2 < 0, M = j ? k < E ? k - E : k - O : 0;
1002
+ let w = b / 2 - x / 2, T = C / 2 - h[m] / 2 - 1, E = Ie(d[_], T), D = Ie(d[v], T), O = C - h[m] - D, k = C / 2 - h[m] / 2 + w, A = Ve(E, k, O), j = !c.arrow && We(i) != null && k !== A && a.reference[m] / 2 - (k < E ? E : D) - h[m] / 2 < 0, M = j ? k < E ? k - E : k - O : 0;
713
1003
  return {
714
1004
  [p]: f[p] + M,
715
1005
  data: {
@@ -720,19 +1010,19 @@ var Je = 50, Ye = async (e, t, n) => {
720
1010
  reset: j
721
1011
  };
722
1012
  }
723
- }), Ze = function(e) {
1013
+ }), pt = function(e) {
724
1014
  return e === void 0 && (e = {}), {
725
1015
  name: "flip",
726
1016
  options: e,
727
1017
  async fn(t) {
728
1018
  var n;
729
- let { placement: r, middlewareData: i, rects: a, initialPlacement: o, platform: s, elements: c } = t, { mainAxis: l = !0, crossAxis: u = !0, fallbackPlacements: d, fallbackStrategy: f = "bestFit", fallbackAxisSideDirection: p = "none", flipAlignment: m = !0, ...h } = Oe(e, t);
1019
+ let { placement: r, middlewareData: i, rects: a, initialPlacement: o, platform: s, elements: c } = t, { mainAxis: l = !0, crossAxis: u = !0, fallbackPlacements: d, fallbackStrategy: f = "bestFit", fallbackAxisSideDirection: p = "none", flipAlignment: m = !0, ...h } = He(e, t);
730
1020
  if ((n = i.arrow) != null && n.alignmentOffset) return {};
731
- let g = U(r), _ = W(o), v = U(o) === o, y = await (s.isRTL == null ? void 0 : s.isRTL(c.floating)), b = d || (v || !m ? [He(o)] : Pe(o)), x = p !== "none";
732
- !d && x && b.push(...Ve(o, m, p, y));
1021
+ let g = Ue(r), _ = qe(o), v = Ue(o) === o, y = await (s.isRTL == null ? void 0 : s.isRTL(c.floating)), b = d || (v || !m ? [it(o)] : Xe(o)), x = p !== "none";
1022
+ !d && x && b.push(...rt(o, m, p, y));
733
1023
  let S = [o, ...b], C = await s.detectOverflow(t, h), w = [], T = i.flip?.overflows || [];
734
1024
  if (l && w.push(C[g]), u) {
735
- let e = Ne(r, a, y);
1025
+ let e = Ye(r, a, y);
736
1026
  w.push(C[e[0]], C[e[1]]);
737
1027
  }
738
1028
  if (T = [...T, {
@@ -740,7 +1030,7 @@ var Je = 50, Ye = async (e, t, n) => {
740
1030
  overflows: w
741
1031
  }], !w.every((e) => e <= 0)) {
742
1032
  let e = (i.flip?.index || 0) + 1, t = S[e];
743
- if (t && (u !== "alignment" || _ === W(t) || T.every((e) => W(e.placement) !== _ || e.overflows[0] > 0))) return {
1033
+ if (t && (u !== "alignment" || _ === qe(t) || T.every((e) => qe(e.placement) !== _ || e.overflows[0] > 0))) return {
744
1034
  data: {
745
1035
  index: e,
746
1036
  overflows: T
@@ -752,7 +1042,7 @@ var Je = 50, Ye = async (e, t, n) => {
752
1042
  case "bestFit": {
753
1043
  let e = T.filter((e) => {
754
1044
  if (x) {
755
- let t = W(e.placement);
1045
+ let t = qe(e.placement);
756
1046
  return t === _ || t === "y";
757
1047
  }
758
1048
  return !0;
@@ -767,9 +1057,9 @@ var Je = 50, Ye = async (e, t, n) => {
767
1057
  return {};
768
1058
  }
769
1059
  };
770
- }, Qe = /*#__PURE__*/ new Set(["left", "top"]);
771
- async function $e(e, t) {
772
- let { placement: n, platform: r, elements: i } = e, a = await (r.isRTL == null ? void 0 : r.isRTL(i.floating)), o = U(n), s = ke(n), c = W(n) === "y", l = Qe.has(o) ? -1 : 1, u = a && c ? -1 : 1, d = Oe(t, e), { mainAxis: f, crossAxis: p, alignmentAxis: m } = typeof d == "number" ? {
1060
+ }, mt = /*#__PURE__*/ new Set(["left", "top"]);
1061
+ async function ht(e, t) {
1062
+ let { placement: n, platform: r, elements: i } = e, a = await (r.isRTL == null ? void 0 : r.isRTL(i.floating)), o = Ue(n), s = We(n), c = qe(n) === "y", l = mt.has(o) ? -1 : 1, u = a && c ? -1 : 1, d = He(t, e), { mainAxis: f, crossAxis: p, alignmentAxis: m } = typeof d == "number" ? {
773
1063
  mainAxis: d,
774
1064
  crossAxis: 0,
775
1065
  alignmentAxis: null
@@ -786,13 +1076,13 @@ async function $e(e, t) {
786
1076
  y: p * u
787
1077
  };
788
1078
  }
789
- var et = function(e) {
1079
+ var gt = function(e) {
790
1080
  return e === void 0 && (e = 0), {
791
1081
  name: "offset",
792
1082
  options: e,
793
1083
  async fn(t) {
794
1084
  var n;
795
- let { x: r, y: i, placement: a, middlewareData: o } = t, s = await $e(t, e);
1085
+ let { x: r, y: i, placement: a, middlewareData: o } = t, s = await ht(t, e);
796
1086
  return a === o.offset?.placement && (n = o.arrow) != null && n.alignmentOffset ? {} : {
797
1087
  x: r + s.x,
798
1088
  y: i + s.y,
@@ -803,7 +1093,7 @@ var et = function(e) {
803
1093
  };
804
1094
  }
805
1095
  };
806
- }, tt = function(e) {
1096
+ }, _t = function(e) {
807
1097
  return e === void 0 && (e = {}), {
808
1098
  name: "shift",
809
1099
  options: e,
@@ -814,10 +1104,10 @@ var et = function(e) {
814
1104
  x: t,
815
1105
  y: n
816
1106
  };
817
- } }, ...l } = Oe(e, t), u = {
1107
+ } }, ...l } = He(e, t), u = {
818
1108
  x: n,
819
1109
  y: r
820
- }, d = await a.detectOverflow(t, l), f = W(i), p = Ae(f), m = u[p], h = u[f], g = (e, t) => De(t + d[e === "y" ? "top" : "left"], t, t - d[e === "y" ? "bottom" : "right"]);
1110
+ }, d = await a.detectOverflow(t, l), f = qe(i), p = Ge(f), m = u[p], h = u[f], g = (e, t) => Ve(t + d[e === "y" ? "top" : "left"], t, t - d[e === "y" ? "bottom" : "right"]);
821
1111
  o && (m = g(p, m)), s && (h = g(f, h));
822
1112
  let _ = c.fn({
823
1113
  ...t,
@@ -840,39 +1130,39 @@ var et = function(e) {
840
1130
  };
841
1131
  //#endregion
842
1132
  //#region node_modules/.pnpm/@floating-ui+utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
843
- function nt() {
1133
+ function vt() {
844
1134
  return typeof window < "u";
845
1135
  }
846
- function G(e) {
847
- return rt(e) ? (e.nodeName || "").toLowerCase() : "#document";
1136
+ function yt(e) {
1137
+ return xt(e) ? (e.nodeName || "").toLowerCase() : "#document";
848
1138
  }
849
- function K(e) {
1139
+ function Z(e) {
850
1140
  var t;
851
1141
  return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
852
1142
  }
853
- function q(e) {
854
- return ((rt(e) ? e.ownerDocument : e.document) || window.document)?.documentElement;
1143
+ function bt(e) {
1144
+ return ((xt(e) ? e.ownerDocument : e.document) || window.document)?.documentElement;
855
1145
  }
856
- function rt(e) {
857
- return nt() ? e instanceof Node || e instanceof K(e).Node : !1;
1146
+ function xt(e) {
1147
+ return vt() ? e instanceof Node || e instanceof Z(e).Node : !1;
858
1148
  }
859
- function J(e) {
860
- return nt() ? e instanceof Element || e instanceof K(e).Element : !1;
1149
+ function Q(e) {
1150
+ return vt() ? e instanceof Element || e instanceof Z(e).Element : !1;
861
1151
  }
862
- function Y(e) {
863
- return nt() ? e instanceof HTMLElement || e instanceof K(e).HTMLElement : !1;
1152
+ function St(e) {
1153
+ return vt() ? e instanceof HTMLElement || e instanceof Z(e).HTMLElement : !1;
864
1154
  }
865
- function it(e) {
866
- return !nt() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof K(e).ShadowRoot;
1155
+ function Ct(e) {
1156
+ return !vt() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof Z(e).ShadowRoot;
867
1157
  }
868
- function at(e) {
869
- let { overflow: t, overflowX: n, overflowY: r, display: i } = Z(e);
1158
+ function wt(e) {
1159
+ let { overflow: t, overflowX: n, overflowY: r, display: i } = $(e);
870
1160
  return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && i !== "inline" && i !== "contents";
871
1161
  }
872
- function ot(e) {
873
- return /^(table|td|th)$/.test(G(e));
1162
+ function Tt(e) {
1163
+ return /^(table|td|th)$/.test(yt(e));
874
1164
  }
875
- function st(e) {
1165
+ function Et(e) {
876
1166
  try {
877
1167
  if (e.matches(":popover-open")) return !0;
878
1168
  } catch {}
@@ -882,31 +1172,31 @@ function st(e) {
882
1172
  return !1;
883
1173
  }
884
1174
  }
885
- var ct = /transform|translate|scale|rotate|perspective|filter/, lt = /paint|layout|strict|content/, X = (e) => !!e && e !== "none", ut;
886
- function dt(e) {
887
- let t = J(e) ? Z(e) : e;
888
- return X(t.transform) || X(t.translate) || X(t.scale) || X(t.rotate) || X(t.perspective) || !pt() && (X(t.backdropFilter) || X(t.filter)) || ct.test(t.willChange || "") || lt.test(t.contain || "");
889
- }
890
- function ft(e) {
891
- let t = Q(e);
892
- for (; Y(t) && !mt(t);) {
893
- if (dt(t)) return t;
894
- if (st(t)) return null;
895
- t = Q(t);
1175
+ var Dt = /transform|translate|scale|rotate|perspective|filter/, Ot = /paint|layout|strict|content/, kt = (e) => !!e && e !== "none", At;
1176
+ function jt(e) {
1177
+ let t = Q(e) ? $(e) : e;
1178
+ return kt(t.transform) || kt(t.translate) || kt(t.scale) || kt(t.rotate) || kt(t.perspective) || !Nt() && (kt(t.backdropFilter) || kt(t.filter)) || Dt.test(t.willChange || "") || Ot.test(t.contain || "");
1179
+ }
1180
+ function Mt(e) {
1181
+ let t = It(e);
1182
+ for (; St(t) && !Pt(t);) {
1183
+ if (jt(t)) return t;
1184
+ if (Et(t)) return null;
1185
+ t = It(t);
896
1186
  }
897
1187
  return null;
898
1188
  }
899
- function pt() {
900
- return ut ??= typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none"), ut;
1189
+ function Nt() {
1190
+ return At ??= typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none"), At;
901
1191
  }
902
- function mt(e) {
903
- return /^(html|body|#document)$/.test(G(e));
1192
+ function Pt(e) {
1193
+ return /^(html|body|#document)$/.test(yt(e));
904
1194
  }
905
- function Z(e) {
906
- return K(e).getComputedStyle(e);
1195
+ function $(e) {
1196
+ return Z(e).getComputedStyle(e);
907
1197
  }
908
- function ht(e) {
909
- return J(e) ? {
1198
+ function Ft(e) {
1199
+ return Q(e) ? {
910
1200
  scrollLeft: e.scrollLeft,
911
1201
  scrollTop: e.scrollTop
912
1202
  } : {
@@ -914,102 +1204,102 @@ function ht(e) {
914
1204
  scrollTop: e.scrollY
915
1205
  };
916
1206
  }
917
- function Q(e) {
918
- if (G(e) === "html") return e;
919
- let t = e.assignedSlot || e.parentNode || it(e) && e.host || q(e);
920
- return it(t) ? t.host : t;
1207
+ function It(e) {
1208
+ if (yt(e) === "html") return e;
1209
+ let t = e.assignedSlot || e.parentNode || Ct(e) && e.host || bt(e);
1210
+ return Ct(t) ? t.host : t;
921
1211
  }
922
- function gt(e) {
923
- let t = Q(e);
924
- return mt(t) ? (e.ownerDocument || e).body : Y(t) && at(t) ? t : gt(t);
1212
+ function Lt(e) {
1213
+ let t = It(e);
1214
+ return Pt(t) ? (e.ownerDocument || e).body : St(t) && wt(t) ? t : Lt(t);
925
1215
  }
926
- function _t(e, t, n) {
1216
+ function Rt(e, t, n) {
927
1217
  t === void 0 && (t = []), n === void 0 && (n = !0);
928
- let r = gt(e), i = r === e.ownerDocument?.body, a = K(r);
1218
+ let r = Lt(e), i = r === e.ownerDocument?.body, a = Z(r);
929
1219
  if (i) {
930
- let e = vt(a);
931
- return t.concat(a, a.visualViewport || [], at(r) ? r : [], e && n ? _t(e) : []);
1220
+ let e = zt(a);
1221
+ return t.concat(a, a.visualViewport || [], wt(r) ? r : [], e && n ? Rt(e) : []);
932
1222
  }
933
- return t.concat(r, _t(r, [], n));
1223
+ return t.concat(r, Rt(r, [], n));
934
1224
  }
935
- function vt(e) {
1225
+ function zt(e) {
936
1226
  return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
937
1227
  }
938
1228
  //#endregion
939
1229
  //#region node_modules/.pnpm/@floating-ui+dom@1.8.0/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
940
- function yt(e) {
941
- let t = Z(e), n = parseFloat(t.width) || 0, r = parseFloat(t.height) || 0, i = Y(e), a = i ? e.offsetWidth : n, o = i ? e.offsetHeight : r, s = we(n) !== a || we(r) !== o;
1230
+ function Bt(e) {
1231
+ let t = $(e), n = parseFloat(t.width) || 0, r = parseFloat(t.height) || 0, i = St(e), a = i ? e.offsetWidth : n, o = i ? e.offsetHeight : r, s = Re(n) !== a || Re(r) !== o;
942
1232
  return s && (n = a, r = o), {
943
1233
  width: n,
944
1234
  height: r,
945
1235
  $: s
946
1236
  };
947
1237
  }
948
- function bt(e) {
949
- return J(e) ? e : e.contextElement;
1238
+ function Vt(e) {
1239
+ return Q(e) ? e : e.contextElement;
950
1240
  }
951
- function xt(e) {
952
- let t = bt(e);
953
- if (!Y(t)) return H(1);
954
- let n = t.getBoundingClientRect(), { width: r, height: i, $: a } = yt(t), o = (a ? we(n.width) : n.width) / r, s = (a ? we(n.height) : n.height) / i;
1241
+ function Ht(e) {
1242
+ let t = Vt(e);
1243
+ if (!St(t)) return X(1);
1244
+ let n = t.getBoundingClientRect(), { width: r, height: i, $: a } = Bt(t), o = (a ? Re(n.width) : n.width) / r, s = (a ? Re(n.height) : n.height) / i;
955
1245
  return (!o || !Number.isFinite(o)) && (o = 1), (!s || !Number.isFinite(s)) && (s = 1), {
956
1246
  x: o,
957
1247
  y: s
958
1248
  };
959
1249
  }
960
- var St = /*#__PURE__*/ H(0);
961
- function Ct(e) {
962
- let t = K(e);
963
- return !pt() || !t.visualViewport ? St : {
1250
+ var Ut = /*#__PURE__*/ X(0);
1251
+ function Wt(e) {
1252
+ let t = Z(e);
1253
+ return !Nt() || !t.visualViewport ? Ut : {
964
1254
  x: t.visualViewport.offsetLeft,
965
1255
  y: t.visualViewport.offsetTop
966
1256
  };
967
1257
  }
968
- function wt(e, t, n) {
969
- return t === void 0 && (t = !1), !!n && t && n === K(e);
1258
+ function Gt(e, t, n) {
1259
+ return t === void 0 && (t = !1), !!n && t && n === Z(e);
970
1260
  }
971
- function $(e, t, n, r) {
1261
+ function Kt(e, t, n, r) {
972
1262
  t === void 0 && (t = !1), n === void 0 && (n = !1);
973
- let i = e.getBoundingClientRect(), a = bt(e), o = H(1);
974
- t && (r ? J(r) && (o = xt(r)) : o = xt(e));
975
- let s = wt(a, n, r) ? Ct(a) : H(0), c = (i.left + s.x) / o.x, l = (i.top + s.y) / o.y, u = i.width / o.x, d = i.height / o.y;
1263
+ let i = e.getBoundingClientRect(), a = Vt(e), o = X(1);
1264
+ t && (r ? Q(r) && (o = Ht(r)) : o = Ht(e));
1265
+ let s = Gt(a, n, r) ? Wt(a) : X(0), c = (i.left + s.x) / o.x, l = (i.top + s.y) / o.y, u = i.width / o.x, d = i.height / o.y;
976
1266
  if (a && r) {
977
- let e = K(a), t = J(r) ? K(r) : r, n = e, i = vt(n);
1267
+ let e = Z(a), t = Q(r) ? Z(r) : r, n = e, i = zt(n);
978
1268
  for (; i && t !== n;) {
979
- let e = xt(i), t = i.getBoundingClientRect(), r = Z(i), a = t.left + (i.clientLeft + parseFloat(r.paddingLeft)) * e.x, o = t.top + (i.clientTop + parseFloat(r.paddingTop)) * e.y;
980
- c *= e.x, l *= e.y, u *= e.x, d *= e.y, c += a, l += o, n = K(i), i = vt(n);
1269
+ let e = Ht(i), t = i.getBoundingClientRect(), r = $(i), a = t.left + (i.clientLeft + parseFloat(r.paddingLeft)) * e.x, o = t.top + (i.clientTop + parseFloat(r.paddingTop)) * e.y;
1270
+ c *= e.x, l *= e.y, u *= e.x, d *= e.y, c += a, l += o, n = Z(i), i = zt(n);
981
1271
  }
982
1272
  }
983
- return Ge({
1273
+ return st({
984
1274
  width: u,
985
1275
  height: d,
986
1276
  x: c,
987
1277
  y: l
988
1278
  });
989
1279
  }
990
- function Tt(e, t) {
991
- let n = ht(e).scrollLeft;
992
- return t ? t.left + n : $(q(e)).left + n;
1280
+ function qt(e, t) {
1281
+ let n = Ft(e).scrollLeft;
1282
+ return t ? t.left + n : Kt(bt(e)).left + n;
993
1283
  }
994
- function Et(e, t) {
1284
+ function Jt(e, t) {
995
1285
  let n = e.getBoundingClientRect();
996
1286
  return {
997
- x: n.left + t.scrollLeft - Tt(e, n),
1287
+ x: n.left + t.scrollLeft - qt(e, n),
998
1288
  y: n.top + t.scrollTop
999
1289
  };
1000
1290
  }
1001
- function Dt(e) {
1002
- let { elements: t, rect: n, offsetParent: r, strategy: i } = e, a = i === "fixed", o = q(r), s = t ? st(t.floating) : !1;
1291
+ function Yt(e) {
1292
+ let { elements: t, rect: n, offsetParent: r, strategy: i } = e, a = i === "fixed", o = bt(r), s = t ? Et(t.floating) : !1;
1003
1293
  if (r === o || s && a) return n;
1004
1294
  let c = {
1005
1295
  scrollLeft: 0,
1006
1296
  scrollTop: 0
1007
- }, l = H(1), u = H(0), d = Y(r);
1008
- if ((d || !a) && ((G(r) !== "body" || at(o)) && (c = ht(r)), d)) {
1009
- let e = $(r);
1010
- l = xt(r), u.x = e.x + r.clientLeft, u.y = e.y + r.clientTop;
1297
+ }, l = X(1), u = X(0), d = St(r);
1298
+ if ((d || !a) && ((yt(r) !== "body" || wt(o)) && (c = Ft(r)), d)) {
1299
+ let e = Kt(r);
1300
+ l = Ht(r), u.x = e.x + r.clientLeft, u.y = e.y + r.clientTop;
1011
1301
  }
1012
- let f = o && !d && !a ? Et(o, c) : H(0);
1302
+ let f = o && !d && !a ? Jt(o, c) : X(0);
1013
1303
  return {
1014
1304
  width: n.width * l.x,
1015
1305
  height: n.height * l.y,
@@ -1017,29 +1307,29 @@ function Dt(e) {
1017
1307
  y: n.y * l.y - c.scrollTop * l.y + u.y + f.y
1018
1308
  };
1019
1309
  }
1020
- function Ot(e) {
1310
+ function Xt(e) {
1021
1311
  return e.getClientRects ? Array.from(e.getClientRects()) : [];
1022
1312
  }
1023
- function kt(e) {
1024
- let t = ht(e), n = e.ownerDocument.body, r = V(e.scrollWidth, e.clientWidth, n.scrollWidth, n.clientWidth), i = V(e.scrollHeight, e.clientHeight, n.scrollHeight, n.clientHeight), a = -t.scrollLeft + Tt(e), o = -t.scrollTop;
1025
- return Z(n).direction === "rtl" && (a += V(e.clientWidth, n.clientWidth) - r), {
1313
+ function Zt(e) {
1314
+ let t = Ft(e), n = e.ownerDocument.body, r = Le(e.scrollWidth, e.clientWidth, n.scrollWidth, n.clientWidth), i = Le(e.scrollHeight, e.clientHeight, n.scrollHeight, n.clientHeight), a = -t.scrollLeft + qt(e), o = -t.scrollTop;
1315
+ return $(n).direction === "rtl" && (a += Le(e.clientWidth, n.clientWidth) - r), {
1026
1316
  width: r,
1027
1317
  height: i,
1028
1318
  x: a,
1029
1319
  y: o
1030
1320
  };
1031
1321
  }
1032
- var At = 25;
1033
- function jt(e, t, n) {
1322
+ var Qt = 25;
1323
+ function $t(e, t, n) {
1034
1324
  n === void 0 && (n = "viewport");
1035
- let r = n === "layoutViewport", i = K(e), a = q(e), o = i.visualViewport, s = a.clientWidth, c = a.clientHeight, l = 0, u = 0;
1325
+ let r = n === "layoutViewport", i = Z(e), a = bt(e), o = i.visualViewport, s = a.clientWidth, c = a.clientHeight, l = 0, u = 0;
1036
1326
  if (o) {
1037
- let e = !pt() || t === "fixed";
1327
+ let e = !Nt() || t === "fixed";
1038
1328
  r ? e || (l = -o.offsetLeft, u = -o.offsetTop) : (s = o.width, c = o.height, e && (l = o.offsetLeft, u = o.offsetTop));
1039
1329
  }
1040
- if (Tt(a) <= 0) {
1330
+ if (qt(a) <= 0) {
1041
1331
  let e = a.ownerDocument, t = e.body, n = getComputedStyle(t), r = e.compatMode === "CSS1Compat" && parseFloat(n.marginLeft) + parseFloat(n.marginRight) || 0, i = Math.abs(a.clientWidth - t.clientWidth - r), o = getComputedStyle(a).scrollbarGutter === "stable both-edges" ? i / 2 : i;
1042
- o <= At && (s -= o);
1332
+ o <= Qt && (s -= o);
1043
1333
  }
1044
1334
  return {
1045
1335
  width: s,
@@ -1048,8 +1338,8 @@ function jt(e, t, n) {
1048
1338
  y: u
1049
1339
  };
1050
1340
  }
1051
- function Mt(e, t) {
1052
- let n = $(e, !0, t === "fixed"), r = n.top + e.clientTop, i = n.left + e.clientLeft, a = xt(e);
1341
+ function en(e, t) {
1342
+ let n = Kt(e, !0, t === "fixed"), r = n.top + e.clientTop, i = n.left + e.clientLeft, a = Ht(e);
1053
1343
  return {
1054
1344
  width: e.clientWidth * a.x,
1055
1345
  height: e.clientHeight * a.y,
@@ -1057,13 +1347,13 @@ function Mt(e, t) {
1057
1347
  y: r * a.y
1058
1348
  };
1059
1349
  }
1060
- function Nt(e, t, n) {
1350
+ function tn(e, t, n) {
1061
1351
  let r;
1062
- if (t === "viewport" || t === "layoutViewport") r = jt(e, n, t);
1063
- else if (t === "document") r = kt(q(e));
1064
- else if (J(t)) r = Mt(t, n);
1352
+ if (t === "viewport" || t === "layoutViewport") r = $t(e, n, t);
1353
+ else if (t === "document") r = Zt(bt(e));
1354
+ else if (Q(t)) r = en(t, n);
1065
1355
  else {
1066
- let n = Ct(e);
1356
+ let n = Wt(e);
1067
1357
  r = {
1068
1358
  x: t.x - n.x,
1069
1359
  y: t.y - n.y,
@@ -1071,23 +1361,23 @@ function Nt(e, t, n) {
1071
1361
  height: t.height
1072
1362
  };
1073
1363
  }
1074
- return Ge(r);
1364
+ return st(r);
1075
1365
  }
1076
- function Pt(e, t) {
1366
+ function nn(e, t) {
1077
1367
  let n = t.get(e);
1078
1368
  if (n) return n;
1079
- let r = _t(e, [], !1).filter((e) => J(e) && G(e) !== "body"), i = null, a = Z(e).position === "fixed", o = a ? Q(e) : e;
1080
- for (; J(o) && !mt(o);) {
1081
- let e = Z(o), t = dt(o), n = i ? i.position : a ? "fixed" : "";
1082
- !t && (n === "fixed" || n === "absolute" && e.position === "static") ? r = r.filter((e) => e !== o) : i = e, o = Q(o);
1369
+ let r = Rt(e, [], !1).filter((e) => Q(e) && yt(e) !== "body"), i = null, a = $(e).position === "fixed", o = a ? It(e) : e;
1370
+ for (; Q(o) && !Pt(o);) {
1371
+ let e = $(o), t = jt(o), n = i ? i.position : a ? "fixed" : "";
1372
+ !t && (n === "fixed" || n === "absolute" && e.position === "static") ? r = r.filter((e) => e !== o) : i = e, o = It(o);
1083
1373
  }
1084
1374
  return t.set(e, r), r;
1085
1375
  }
1086
- function Ft(e) {
1087
- let { element: t, boundary: n, rootBoundary: r, strategy: i } = e, a = [...n === "clippingAncestors" ? st(t) ? [] : Pt(t, this._c) : [].concat(n), r], o = Nt(t, a[0], i), s = o.top, c = o.right, l = o.bottom, u = o.left;
1376
+ function rn(e) {
1377
+ let { element: t, boundary: n, rootBoundary: r, strategy: i } = e, a = [...n === "clippingAncestors" ? Et(t) ? [] : nn(t, this._c) : [].concat(n), r], o = tn(t, a[0], i), s = o.top, c = o.right, l = o.bottom, u = o.left;
1088
1378
  for (let e = 1; e < a.length; e++) {
1089
- let n = Nt(t, a[e], i);
1090
- s = V(n.top, s), c = Ce(n.right, c), l = Ce(n.bottom, l), u = V(n.left, u);
1379
+ let n = tn(t, a[e], i);
1380
+ s = Le(n.top, s), c = Ie(n.right, c), l = Ie(n.bottom, l), u = Le(n.left, u);
1091
1381
  }
1092
1382
  return {
1093
1383
  width: c - u,
@@ -1096,24 +1386,24 @@ function Ft(e) {
1096
1386
  y: s
1097
1387
  };
1098
1388
  }
1099
- function It(e) {
1100
- let { width: t, height: n } = yt(e);
1389
+ function an(e) {
1390
+ let { width: t, height: n } = Bt(e);
1101
1391
  return {
1102
1392
  width: t,
1103
1393
  height: n
1104
1394
  };
1105
1395
  }
1106
- function Lt(e, t, n) {
1107
- let r = Y(t), i = q(t), a = n === "fixed", o = $(e, !0, a, t), s = {
1396
+ function on(e, t, n) {
1397
+ let r = St(t), i = bt(t), a = n === "fixed", o = Kt(e, !0, a, t), s = {
1108
1398
  scrollLeft: 0,
1109
1399
  scrollTop: 0
1110
- }, c = H(0);
1111
- if ((r || !a) && ((G(t) !== "body" || at(i)) && (s = ht(t)), r)) {
1112
- let e = $(t, !0, a, t);
1400
+ }, c = X(0);
1401
+ if ((r || !a) && ((yt(t) !== "body" || wt(i)) && (s = Ft(t)), r)) {
1402
+ let e = Kt(t, !0, a, t);
1113
1403
  c.x = e.x + t.clientLeft, c.y = e.y + t.clientTop;
1114
1404
  }
1115
- !r && i && (c.x = Tt(i));
1116
- let l = i && !r && !a ? Et(i, s) : H(0);
1405
+ !r && i && (c.x = qt(i));
1406
+ let l = i && !r && !a ? Jt(i, s) : X(0);
1117
1407
  return {
1118
1408
  x: o.left + s.scrollLeft - c.x - l.x,
1119
1409
  y: o.top + s.scrollTop - c.y - l.y,
@@ -1121,34 +1411,34 @@ function Lt(e, t, n) {
1121
1411
  height: o.height
1122
1412
  };
1123
1413
  }
1124
- function Rt(e) {
1125
- return Z(e).position === "static";
1414
+ function sn(e) {
1415
+ return $(e).position === "static";
1126
1416
  }
1127
- function zt(e, t) {
1128
- if (!Y(e) || Z(e).position === "fixed") return null;
1417
+ function cn(e, t) {
1418
+ if (!St(e) || $(e).position === "fixed") return null;
1129
1419
  if (t) return t(e);
1130
1420
  let n = e.offsetParent;
1131
- return q(e) === n && (n = n.ownerDocument.body), n;
1132
- }
1133
- function Bt(e, t) {
1134
- let n = K(e);
1135
- if (st(e)) return n;
1136
- if (!Y(e)) {
1137
- let t = Q(e);
1138
- for (; t && !mt(t);) {
1139
- if (J(t) && !Rt(t)) return t;
1140
- t = Q(t);
1421
+ return bt(e) === n && (n = n.ownerDocument.body), n;
1422
+ }
1423
+ function ln(e, t) {
1424
+ let n = Z(e);
1425
+ if (Et(e)) return n;
1426
+ if (!St(e)) {
1427
+ let t = It(e);
1428
+ for (; t && !Pt(t);) {
1429
+ if (Q(t) && !sn(t)) return t;
1430
+ t = It(t);
1141
1431
  }
1142
1432
  return n;
1143
1433
  }
1144
- let r = zt(e, t);
1145
- for (; r && ot(r) && Rt(r);) r = zt(r, t);
1146
- return r && mt(r) && Rt(r) && !dt(r) ? n : r || ft(e) || n;
1434
+ let r = cn(e, t);
1435
+ for (; r && Tt(r) && sn(r);) r = cn(r, t);
1436
+ return r && Pt(r) && sn(r) && !jt(r) ? n : r || Mt(e) || n;
1147
1437
  }
1148
- var Vt = async function(e) {
1149
- let t = this.getOffsetParent || Bt, n = this.getDimensions, r = await n(e.floating);
1438
+ var un = async function(e) {
1439
+ let t = this.getOffsetParent || ln, n = this.getDimensions, r = await n(e.floating);
1150
1440
  return {
1151
- reference: Lt(e.reference, await t(e.floating), e.strategy),
1441
+ reference: on(e.reference, await t(e.floating), e.strategy),
1152
1442
  floating: {
1153
1443
  x: 0,
1154
1444
  y: 0,
@@ -1157,26 +1447,26 @@ var Vt = async function(e) {
1157
1447
  }
1158
1448
  };
1159
1449
  };
1160
- function Ht(e) {
1161
- return Z(e).direction === "rtl";
1162
- }
1163
- var Ut = {
1164
- convertOffsetParentRelativeRectToViewportRelativeRect: Dt,
1165
- getDocumentElement: q,
1166
- getClippingRect: Ft,
1167
- getOffsetParent: Bt,
1168
- getElementRects: Vt,
1169
- getClientRects: Ot,
1170
- getDimensions: It,
1171
- getScale: xt,
1172
- isElement: J,
1173
- isRTL: Ht
1450
+ function dn(e) {
1451
+ return $(e).direction === "rtl";
1452
+ }
1453
+ var fn = {
1454
+ convertOffsetParentRelativeRectToViewportRelativeRect: Yt,
1455
+ getDocumentElement: bt,
1456
+ getClippingRect: rn,
1457
+ getOffsetParent: ln,
1458
+ getElementRects: un,
1459
+ getClientRects: Xt,
1460
+ getDimensions: an,
1461
+ getScale: Ht,
1462
+ isElement: Q,
1463
+ isRTL: dn
1174
1464
  };
1175
- function Wt(e, t) {
1465
+ function pn(e, t) {
1176
1466
  return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
1177
1467
  }
1178
- function Gt(e, t, n) {
1179
- let r = null, i, a = q(e);
1468
+ function mn(e, t, n) {
1469
+ let r = null, i, a = bt(e);
1180
1470
  function o() {
1181
1471
  var e;
1182
1472
  clearTimeout(i), (e = r) == null || e.disconnect(), r = null;
@@ -1185,13 +1475,13 @@ function Gt(e, t, n) {
1185
1475
  n === void 0 && (n = !1), c === void 0 && (c = 1), o();
1186
1476
  let l = e.getBoundingClientRect(), { left: u, top: d, width: f, height: p } = l;
1187
1477
  if (n || t(), !f || !p) return;
1188
- let m = Te(d), h = Te(a.clientWidth - (u + f)), g = Te(a.clientHeight - (d + p)), _ = Te(u), v = {
1478
+ let m = ze(d), h = ze(a.clientWidth - (u + f)), g = ze(a.clientHeight - (d + p)), _ = ze(u), v = {
1189
1479
  rootMargin: -m + "px " + -h + "px " + -g + "px " + -_ + "px",
1190
- threshold: V(0, Ce(1, c)) || 1
1480
+ threshold: Le(0, Ie(1, c)) || 1
1191
1481
  }, y = !0;
1192
1482
  function b(t) {
1193
1483
  let n = t[0].intersectionRatio;
1194
- if (!Wt(l, e.getBoundingClientRect())) return s();
1484
+ if (!pn(l, e.getBoundingClientRect())) return s();
1195
1485
  if (n !== c) {
1196
1486
  if (!y) return s();
1197
1487
  n ? s(!1, n) : i = setTimeout(() => {
@@ -1210,18 +1500,18 @@ function Gt(e, t, n) {
1210
1500
  }
1211
1501
  r.observe(e);
1212
1502
  }
1213
- let c = K(e), l = () => s(n);
1503
+ let c = Z(e), l = () => s(n);
1214
1504
  return c.addEventListener("resize", l), s(!0), () => {
1215
1505
  c.removeEventListener("resize", l), o();
1216
1506
  };
1217
1507
  }
1218
- function Kt(e, t, n, r) {
1508
+ function hn(e, t, n, r) {
1219
1509
  r === void 0 && (r = {});
1220
- let { ancestorScroll: i = !0, ancestorResize: a = !0, elementResize: o = typeof ResizeObserver == "function", layoutShift: s = typeof IntersectionObserver == "function", animationFrame: c = !1 } = r, l = bt(e), u = i || a ? [...l ? _t(l) : [], ...t ? _t(t) : []] : [];
1510
+ let { ancestorScroll: i = !0, ancestorResize: a = !0, elementResize: o = typeof ResizeObserver == "function", layoutShift: s = typeof IntersectionObserver == "function", animationFrame: c = !1 } = r, l = Vt(e), u = i || a ? [...l ? Rt(l) : [], ...t ? Rt(t) : []] : [];
1221
1511
  u.forEach((e) => {
1222
1512
  i && e.addEventListener("scroll", n), a && e.addEventListener("resize", n);
1223
1513
  });
1224
- let d = l && s ? Gt(l, n, a) : null, f = -1, p = null;
1514
+ let d = l && s ? mn(l, n, a) : null, f = -1, p = null;
1225
1515
  o && (p = new ResizeObserver((e) => {
1226
1516
  let [r] = e;
1227
1517
  r && r.target === l && p && t && (p.unobserve(t), cancelAnimationFrame(f), f = requestAnimationFrame(() => {
@@ -1229,11 +1519,11 @@ function Kt(e, t, n, r) {
1229
1519
  (e = p) == null || e.observe(t);
1230
1520
  })), n();
1231
1521
  }), l && !c && p.observe(l), t && p.observe(t));
1232
- let m, h = c ? $(e) : null;
1522
+ let m, h = c ? Kt(e) : null;
1233
1523
  c && g();
1234
1524
  function g() {
1235
- let t = $(e);
1236
- h && !Wt(h, t) && n(), h = t, m = requestAnimationFrame(g);
1525
+ let t = Kt(e);
1526
+ h && !pn(h, t) && n(), h = t, m = requestAnimationFrame(g);
1237
1527
  }
1238
1528
  return n(), () => {
1239
1529
  var e;
@@ -1242,18 +1532,18 @@ function Kt(e, t, n, r) {
1242
1532
  }), d?.(), (e = p) == null || e.disconnect(), p = null, c && cancelAnimationFrame(m);
1243
1533
  };
1244
1534
  }
1245
- var qt = et, Jt = tt, Yt = Ze, Xt = Xe, Zt = (e, t, n) => {
1535
+ var gn = gt, _n = _t, vn = pt, yn = ft, bn = (e, t, n) => {
1246
1536
  let r = /* @__PURE__ */ new Map(), i = n ?? {}, a = {
1247
- ...Ut,
1537
+ ...fn,
1248
1538
  ...i.platform,
1249
1539
  _c: r
1250
1540
  };
1251
- return Ye(e, t, {
1541
+ return dt(e, t, {
1252
1542
  ...i,
1253
1543
  platform: a
1254
1544
  });
1255
- }, Qt = typeof document < "u" ? u : function() {};
1256
- function $t(e, t) {
1545
+ }, xn = typeof document < "u" ? u : function() {};
1546
+ function Sn(e, t) {
1257
1547
  if (e === t) return !0;
1258
1548
  if (typeof e != typeof t) return !1;
1259
1549
  if (typeof e == "function" && e.toString() === t.toString()) return !0;
@@ -1261,33 +1551,33 @@ function $t(e, t) {
1261
1551
  if (e && t && typeof e == "object") {
1262
1552
  if (Array.isArray(e)) {
1263
1553
  if (n = e.length, n !== t.length) return !1;
1264
- for (r = n; r-- !== 0;) if (!$t(e[r], t[r])) return !1;
1554
+ for (r = n; r-- !== 0;) if (!Sn(e[r], t[r])) return !1;
1265
1555
  return !0;
1266
1556
  }
1267
1557
  if (i = Object.keys(e), n = i.length, n !== Object.keys(t).length) return !1;
1268
1558
  for (r = n; r-- !== 0;) if (!{}.hasOwnProperty.call(t, i[r])) return !1;
1269
1559
  for (r = n; r-- !== 0;) {
1270
1560
  let n = i[r];
1271
- if (!(n === "_owner" && e.$$typeof) && !$t(e[n], t[n])) return !1;
1561
+ if (!(n === "_owner" && e.$$typeof) && !Sn(e[n], t[n])) return !1;
1272
1562
  }
1273
1563
  return !0;
1274
1564
  }
1275
1565
  return e !== e && t !== t;
1276
1566
  }
1277
- function en(e) {
1567
+ function Cn(e) {
1278
1568
  return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
1279
1569
  }
1280
- function tn(e, t) {
1281
- let n = en(e);
1570
+ function wn(e, t) {
1571
+ let n = Cn(e);
1282
1572
  return Math.round(t * n) / n;
1283
1573
  }
1284
- function nn(t) {
1574
+ function Tn(t) {
1285
1575
  let n = e.useRef(t);
1286
- return Qt(() => {
1576
+ return xn(() => {
1287
1577
  n.current = t;
1288
1578
  }), n;
1289
1579
  }
1290
- function rn(t) {
1580
+ function En(t) {
1291
1581
  t === void 0 && (t = {});
1292
1582
  let { placement: n = "bottom", strategy: r = "absolute", middleware: i = [], platform: a, elements: { reference: o, floating: s } = {}, transform: c = !0, whileElementsMounted: l, open: u } = t, [d, f] = e.useState({
1293
1583
  x: 0,
@@ -1297,24 +1587,24 @@ function rn(t) {
1297
1587
  middlewareData: {},
1298
1588
  isPositioned: !1
1299
1589
  }), [p, m] = e.useState(i);
1300
- $t(p, i) || m(i);
1590
+ Sn(p, i) || m(i);
1301
1591
  let [h, g] = e.useState(null), [_, y] = e.useState(null), b = e.useCallback((e) => {
1302
1592
  e !== w.current && (w.current = e, g(e));
1303
1593
  }, []), x = e.useCallback((e) => {
1304
1594
  e !== T.current && (T.current = e, y(e));
1305
- }, []), S = o || h, C = s || _, w = e.useRef(null), T = e.useRef(null), E = e.useRef(d), D = l != null, O = nn(l), k = nn(a), A = nn(u), j = e.useCallback(() => {
1595
+ }, []), S = o || h, C = s || _, w = e.useRef(null), T = e.useRef(null), E = e.useRef(d), D = l != null, O = Tn(l), k = Tn(a), A = Tn(u), j = e.useCallback(() => {
1306
1596
  if (!w.current || !T.current) return;
1307
1597
  let e = {
1308
1598
  placement: n,
1309
1599
  strategy: r,
1310
1600
  middleware: p
1311
1601
  };
1312
- k.current && (e.platform = k.current), Zt(w.current, T.current, e).then((e) => {
1602
+ k.current && (e.platform = k.current), bn(w.current, T.current, e).then((e) => {
1313
1603
  let t = {
1314
1604
  ...e,
1315
1605
  isPositioned: A.current !== !1
1316
1606
  };
1317
- M.current && !$t(E.current, t) && (E.current = t, v.flushSync(() => {
1607
+ M.current && !Sn(E.current, t) && (E.current = t, v.flushSync(() => {
1318
1608
  f(t);
1319
1609
  }));
1320
1610
  });
@@ -1325,16 +1615,16 @@ function rn(t) {
1325
1615
  k,
1326
1616
  A
1327
1617
  ]);
1328
- Qt(() => {
1618
+ xn(() => {
1329
1619
  u === !1 && E.current.isPositioned && (E.current.isPositioned = !1, f((e) => ({
1330
1620
  ...e,
1331
1621
  isPositioned: !1
1332
1622
  })));
1333
1623
  }, [u]);
1334
1624
  let M = e.useRef(!1);
1335
- Qt(() => (M.current = !0, () => {
1625
+ xn(() => (M.current = !0, () => {
1336
1626
  M.current = !1;
1337
- }), []), Qt(() => {
1627
+ }), []), xn(() => {
1338
1628
  if (S && (w.current = S), C && (T.current = C), S && C) {
1339
1629
  if (O.current) return O.current(S, C, j);
1340
1630
  j();
@@ -1361,11 +1651,11 @@ function rn(t) {
1361
1651
  top: 0
1362
1652
  };
1363
1653
  if (!P.floating) return e;
1364
- let t = tn(P.floating, d.x), n = tn(P.floating, d.y);
1654
+ let t = wn(P.floating, d.x), n = wn(P.floating, d.y);
1365
1655
  return c ? {
1366
1656
  ...e,
1367
1657
  transform: "translate(" + t + "px, " + n + "px)",
1368
- ...en(P.floating) >= 1.5 && { willChange: "transform" }
1658
+ ...Cn(P.floating) >= 1.5 && { willChange: "transform" }
1369
1659
  } : {
1370
1660
  position: r,
1371
1661
  left: t,
@@ -1392,7 +1682,7 @@ function rn(t) {
1392
1682
  F
1393
1683
  ]);
1394
1684
  }
1395
- var an = (e) => {
1685
+ var Dn = (e) => {
1396
1686
  function t(e) {
1397
1687
  return {}.hasOwnProperty.call(e, "current");
1398
1688
  }
@@ -1401,61 +1691,92 @@ var an = (e) => {
1401
1691
  options: e,
1402
1692
  fn(n) {
1403
1693
  let { element: r, padding: i } = typeof e == "function" ? e(n) : e;
1404
- return r && t(r) ? r.current == null ? {} : Xt({
1694
+ return r && t(r) ? r.current == null ? {} : yn({
1405
1695
  element: r.current,
1406
1696
  padding: i
1407
- }).fn(n) : r ? Xt({
1697
+ }).fn(n) : r ? yn({
1408
1698
  element: r,
1409
1699
  padding: i
1410
1700
  }).fn(n) : {};
1411
1701
  }
1412
1702
  };
1413
- }, on = (e, t) => {
1414
- let n = qt(e);
1703
+ }, On = (e, t) => {
1704
+ let n = gn(e);
1415
1705
  return {
1416
1706
  name: n.name,
1417
1707
  fn: n.fn,
1418
1708
  options: [e, t]
1419
1709
  };
1420
- }, sn = (e, t) => {
1421
- let n = Jt(e);
1710
+ }, kn = (e, t) => {
1711
+ let n = _n(e);
1422
1712
  return {
1423
1713
  name: n.name,
1424
1714
  fn: n.fn,
1425
1715
  options: [e, t]
1426
1716
  };
1427
- }, cn = (e, t) => {
1428
- let n = Yt(e);
1717
+ }, An = (e, t) => {
1718
+ let n = vn(e);
1429
1719
  return {
1430
1720
  name: n.name,
1431
1721
  fn: n.fn,
1432
1722
  options: [e, t]
1433
1723
  };
1434
- }, ln = (e, t) => {
1435
- let n = an(e);
1724
+ }, jn = (e, t) => {
1725
+ let n = Dn(e);
1436
1726
  return {
1437
1727
  name: n.name,
1438
1728
  fn: n.fn,
1439
1729
  options: [e, t]
1440
1730
  };
1441
- }, un = r(null);
1442
- function dn() {
1443
- return s(un);
1731
+ }, Mn = r(null);
1732
+ function Nn() {
1733
+ return s(Mn);
1734
+ }
1735
+ //#endregion
1736
+ //#region src/components/menu/find_typeahead_index.ts
1737
+ var Pn = -1;
1738
+ function Fn(e, t, n) {
1739
+ let r = n.toLowerCase(), i = e.length;
1740
+ for (let n = 1; n <= i; n += 1) {
1741
+ let a = (t + n + i) % i;
1742
+ if (e[a]?.toLowerCase().startsWith(r)) return a;
1743
+ }
1744
+ return Pn;
1444
1745
  }
1445
1746
  //#endregion
1446
1747
  //#region src/components/menu/menu_surface.tsx
1447
- var fn = ":not(:disabled):not([aria-disabled=\"true\"])", pn = `[role="menuitem"]${fn}, [role="menuitemradio"]${fn}`;
1448
- function mn(e, t) {
1449
- let n = Array.from(e.querySelectorAll(pn));
1748
+ var In = ":not(:disabled):not([aria-disabled=\"true\"])", Ln = `[role="menuitem"]${In}, [role="menuitemradio"]${In}`;
1749
+ function Rn(e) {
1750
+ return Array.from(e.querySelectorAll(Ln));
1751
+ }
1752
+ function zn(e, t) {
1753
+ let n = Rn(e);
1450
1754
  n.length !== 0 && n[(t % n.length + n.length) % n.length]?.focus({ preventScroll: !0 });
1451
1755
  }
1452
- function hn({ setFloating: e, floatingStyles: t, isVisible: n, isPositioned: r, radius: i, onClose: a, children: o }) {
1453
- let s = f(null);
1756
+ function Bn(e, t, n, r) {
1757
+ if (e.key === "ArrowDown") zn(t, r + 1);
1758
+ else if (e.key === "ArrowUp") zn(t, r - 1);
1759
+ else if (e.key === "Home") zn(t, 0);
1760
+ else if (e.key === "End") zn(t, n.length - 1);
1761
+ else return !1;
1762
+ return e.preventDefault(), !0;
1763
+ }
1764
+ function Vn(e) {
1765
+ return e.key.length === 1 && e.key !== " " && !e.ctrlKey && !e.metaKey && !e.altKey;
1766
+ }
1767
+ function Hn(e, t, n, r) {
1768
+ let i = Fn(t.map((e) => e.textContent?.trim() ?? ""), n, r);
1769
+ i !== -1 && zn(e, i);
1770
+ }
1771
+ function Un({ setFloating: e, floatingStyles: t, isVisible: n, isPositioned: r, radius: i, onClose: a, children: o, id: s, labelledBy: l, "aria-label": u, initialFocus: d = "first" }) {
1772
+ let p = f(null);
1454
1773
  return c(() => {
1455
1774
  if (!r) return;
1456
- let e = s.current;
1457
- e && e.querySelector(pn)?.focus({ preventScroll: !0 });
1458
- }, [r]), y(/* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("div", {
1775
+ let e = p.current;
1776
+ if (!e) return;
1777
+ let t = Rn(e);
1778
+ (d === "last" ? t[t.length - 1] : t[0])?.focus({ preventScroll: !0 });
1779
+ }, [r, d]), y(/* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("div", {
1459
1780
  className: "fixed inset-0 z-40",
1460
1781
  onClick: a,
1461
1782
  "aria-hidden": "true"
@@ -1464,19 +1785,22 @@ function hn({ setFloating: e, floatingStyles: t, isVisible: n, isPositioned: r,
1464
1785
  style: t,
1465
1786
  className: "z-50",
1466
1787
  children: /* @__PURE__ */ g("div", {
1467
- ref: s,
1788
+ ref: p,
1789
+ id: s,
1468
1790
  role: "menu",
1791
+ "aria-label": u,
1792
+ "aria-labelledby": l,
1469
1793
  tabIndex: -1,
1470
1794
  "data-state": n ? "open" : "closed",
1471
1795
  onKeyDown: (e) => {
1472
- let t = s.current;
1796
+ let t = p.current;
1473
1797
  if (!t) return;
1474
- let n = Array.from(t.querySelectorAll(pn)), r = n.indexOf(document.activeElement);
1475
- e.key === "ArrowDown" ? (e.preventDefault(), mn(t, r + 1)) : e.key === "ArrowUp" ? (e.preventDefault(), mn(t, r - 1)) : e.key === "Home" ? (e.preventDefault(), mn(t, 0)) : e.key === "End" ? (e.preventDefault(), mn(t, n.length - 1)) : (e.key === "Escape" || e.key === "Tab") && a();
1798
+ let n = Rn(t), r = n.indexOf(document.activeElement);
1799
+ Bn(e, t, n, r) || (e.key === "Escape" ? (e.preventDefault(), a()) : e.key === "Tab" ? a() : Vn(e) && Hn(t, n, r, e.key));
1476
1800
  },
1477
- className: x("w-max min-w-40 max-w-xs origin-top border py-1 shadow-lg backdrop-blur-sm", "transition-[opacity,transform] duration-150 ease-out", n ? "scale-100 opacity-100" : "scale-95 opacity-0", z, re, S[i]),
1801
+ className: x("w-max min-w-40 max-w-xs origin-top border py-1 shadow-lg backdrop-blur-sm", "transition-[opacity,transform] duration-150 ease-out", n ? "scale-100 opacity-100" : "scale-95 opacity-0", re, H, S[i]),
1478
1802
  onClick: (e) => e.stopPropagation(),
1479
- children: /* @__PURE__ */ g(un.Provider, {
1803
+ children: /* @__PURE__ */ g(Mn.Provider, {
1480
1804
  value: a,
1481
1805
  children: o
1482
1806
  })
@@ -1485,7 +1809,7 @@ function hn({ setFloating: e, floatingStyles: t, isVisible: n, isPositioned: r,
1485
1809
  }
1486
1810
  //#endregion
1487
1811
  //#region src/components/shared/use_overlay_state.ts
1488
- function gn() {
1812
+ function Wn() {
1489
1813
  let [e, t] = p(!1), [n, r] = p(!1), i = f(void 0);
1490
1814
  return c(() => () => clearTimeout(i.current), []), {
1491
1815
  isMounted: e,
@@ -1499,7 +1823,7 @@ function gn() {
1499
1823
  }, [])
1500
1824
  };
1501
1825
  }
1502
- function _n(e, t, n) {
1826
+ function Gn(e, t, n) {
1503
1827
  c(() => {
1504
1828
  if (!e || !t) return;
1505
1829
  let r = requestAnimationFrame(() => n(!0));
@@ -1512,8 +1836,8 @@ function _n(e, t, n) {
1512
1836
  }
1513
1837
  //#endregion
1514
1838
  //#region src/components/context_menu/context_menu.tsx
1515
- var vn = 2;
1516
- function yn(e, t) {
1839
+ var Kn = 2;
1840
+ function qn(e, t) {
1517
1841
  return { getBoundingClientRect: () => ({
1518
1842
  width: 0,
1519
1843
  height: 0,
@@ -1525,7 +1849,7 @@ function yn(e, t) {
1525
1849
  bottom: t
1526
1850
  }) };
1527
1851
  }
1528
- function bn(e) {
1852
+ function Jn(e) {
1529
1853
  if (e.clientX !== 0 || e.clientY !== 0) return {
1530
1854
  x: e.clientX,
1531
1855
  y: e.clientY
@@ -1539,43 +1863,44 @@ function bn(e) {
1539
1863
  y: 0
1540
1864
  };
1541
1865
  }
1542
- function xn({ children: e, items: t, radius: n = "md", className: r, ref: i }) {
1543
- let a = f(null), { isMounted: s, isVisible: c, setIsVisible: l, open: u, close: d } = gn(), { refs: p, floatingStyles: m, isPositioned: h } = rn({
1866
+ function Yn({ children: e, items: t, radius: n = "md", className: r, ref: i, "aria-label": a }) {
1867
+ let s = f(null), { isMounted: c, isVisible: l, setIsVisible: u, open: d, close: p } = Wn(), { refs: m, floatingStyles: h, isPositioned: v } = En({
1544
1868
  placement: "bottom-start",
1545
- open: s,
1546
- whileElementsMounted: Kt,
1869
+ open: c,
1870
+ whileElementsMounted: hn,
1547
1871
  middleware: [
1548
- on(vn),
1549
- cn(),
1550
- sn({ padding: 8 })
1872
+ On(Kn),
1873
+ An(),
1874
+ kn({ padding: 8 })
1551
1875
  ]
1552
1876
  });
1553
- _n(s, h, l);
1554
- let v = o(() => {
1555
- d(), a.current?.focus();
1556
- }, [d]);
1877
+ Gn(c, v, u);
1878
+ let y = o(() => {
1879
+ p(), s.current?.focus();
1880
+ }, [p]);
1557
1881
  return /* @__PURE__ */ _("div", {
1558
1882
  ref: i,
1559
1883
  className: r,
1560
1884
  onContextMenu: (e) => {
1561
- e.preventDefault(), a.current = document.activeElement;
1562
- let { x: t, y: n } = bn(e);
1563
- p.setReference(yn(t, n)), u(!1);
1885
+ e.preventDefault(), s.current = document.activeElement;
1886
+ let { x: t, y: n } = Jn(e);
1887
+ m.setReference(qn(t, n)), d(!1);
1564
1888
  },
1565
- children: [e, s && /* @__PURE__ */ g(hn, {
1566
- setFloating: p.setFloating,
1567
- floatingStyles: m,
1568
- isVisible: c,
1569
- isPositioned: h,
1889
+ children: [e, c && /* @__PURE__ */ g(Un, {
1890
+ "aria-label": a,
1891
+ setFloating: m.setFloating,
1892
+ floatingStyles: h,
1893
+ isVisible: l,
1894
+ isPositioned: v,
1570
1895
  radius: n,
1571
- onClose: v,
1896
+ onClose: y,
1572
1897
  children: t
1573
1898
  })]
1574
1899
  });
1575
1900
  }
1576
1901
  //#endregion
1577
1902
  //#region src/lib/surface_error.ts
1578
- function Sn(e, t) {
1903
+ function Xn(e, t) {
1579
1904
  if (t) {
1580
1905
  t(e);
1581
1906
  return;
@@ -1586,23 +1911,23 @@ function Sn(e, t) {
1586
1911
  }
1587
1912
  //#endregion
1588
1913
  //#region src/components/copy_button/copy_button.tsx
1589
- var Cn = 2e3;
1590
- function wn({ value: e, children: t, onError: n }) {
1914
+ var Zn = 2e3;
1915
+ function Qn({ value: e, children: t, onError: n }) {
1591
1916
  let [r, i] = p(!1), a = f(void 0);
1592
1917
  return c(() => () => clearTimeout(a.current), []), /* @__PURE__ */ g(h, { children: t({
1593
1918
  copied: r,
1594
1919
  copy: async () => {
1595
1920
  try {
1596
- await navigator.clipboard.writeText(e), i(!0), clearTimeout(a.current), a.current = setTimeout(() => i(!1), Cn);
1921
+ await navigator.clipboard.writeText(e), i(!0), clearTimeout(a.current), a.current = setTimeout(() => i(!1), Zn);
1597
1922
  } catch (e) {
1598
- Sn(e, n);
1923
+ Xn(e, n);
1599
1924
  }
1600
1925
  }
1601
1926
  }) });
1602
1927
  }
1603
1928
  //#endregion
1604
1929
  //#region src/lib/split_into_highlight_segments.ts
1605
- function Tn(e, t) {
1930
+ function $n(e, t) {
1606
1931
  if (t.length === 0) return [{
1607
1932
  text: e,
1608
1933
  isMatch: !1
@@ -1625,56 +1950,210 @@ function Tn(e, t) {
1625
1950
  }
1626
1951
  //#endregion
1627
1952
  //#region src/components/highlight/highlight.tsx
1628
- function En({ text: e, ranges: t }) {
1629
- let n = Tn(e, t), r = 0;
1630
- return /* @__PURE__ */ g(h, { children: n.map((e) => {
1631
- let t = r;
1632
- return r += e.text.length, e.isMatch ? /* @__PURE__ */ g("mark", {
1633
- className: "rounded bg-yellow-200 text-yellow-900 dark:bg-yellow-800 dark:text-yellow-100",
1634
- children: e.text
1635
- }, t) : /* @__PURE__ */ g("span", { children: e.text }, t);
1636
- }) });
1953
+ function er(e) {
1954
+ let t = 0;
1955
+ return e.map((e) => {
1956
+ let n = t;
1957
+ return t += e.text.length, {
1958
+ ...e,
1959
+ start: n
1960
+ };
1961
+ });
1962
+ }
1963
+ function tr({ text: e, ranges: t }) {
1964
+ let n = er($n(e, t));
1965
+ return /* @__PURE__ */ g(h, { children: n.map((e) => e.isMatch ? /* @__PURE__ */ g("mark", {
1966
+ className: "rounded bg-yellow-200 text-yellow-900 dark:bg-yellow-800 dark:text-yellow-100",
1967
+ children: e.text
1968
+ }, e.start) : /* @__PURE__ */ g("span", { children: e.text }, e.start)) });
1969
+ }
1970
+ //#endregion
1971
+ //#region src/components/shared/portal_target.ts
1972
+ var nr = [
1973
+ "main",
1974
+ "nav",
1975
+ "aside",
1976
+ "header",
1977
+ "footer",
1978
+ "form[aria-label]",
1979
+ "form[aria-labelledby]",
1980
+ "section[aria-label]",
1981
+ "section[aria-labelledby]",
1982
+ "[role=main]",
1983
+ "[role=navigation]",
1984
+ "[role=complementary]",
1985
+ "[role=banner]",
1986
+ "[role=contentinfo]",
1987
+ "[role=region]",
1988
+ "[role=search]",
1989
+ "[role=form]",
1990
+ "dialog",
1991
+ "[role=dialog]",
1992
+ "[role=alertdialog]"
1993
+ ].join(", ");
1994
+ function rr(e) {
1995
+ return e?.closest(nr) ?? (e?.ownerDocument ?? document).body;
1996
+ }
1997
+ //#endregion
1998
+ //#region src/components/shared/accessible_name.ts
1999
+ function ir(e) {
2000
+ return (e ?? "").replace(/\s+/g, " ").trim();
2001
+ }
2002
+ function ar(e, t) {
2003
+ return t.split(/\s+/).map((t) => e.ownerDocument.getElementById(t)?.textContent).join(" ");
2004
+ }
2005
+ function or(e) {
2006
+ let t = ir(e.getAttribute("aria-label"));
2007
+ if (t) return t;
2008
+ let n = e.getAttribute("aria-labelledby");
2009
+ return (n ? ir(ar(e, n)) : "") || ir(e.textContent);
2010
+ }
2011
+ //#endregion
2012
+ //#region src/components/tooltip/tooltip.tsx
2013
+ var sr = 8, cr = 8, lr = {
2014
+ top: "data-[state=closed]:translate-y-1",
2015
+ bottom: "data-[state=closed]:-translate-y-1",
2016
+ left: "data-[state=closed]:translate-x-1",
2017
+ right: "data-[state=closed]:-translate-x-1"
2018
+ }, ur = {
2019
+ top: "bottom",
2020
+ bottom: "top",
2021
+ left: "right",
2022
+ right: "left"
2023
+ };
2024
+ function dr({ content: e, children: t, position: r = "top", showOnClick: i = !1, temporaryContent: s, temporaryDuration: d = 2e3, disabled: m = !1, radius: v = "lg", onTemporaryShow: b, className: C, describeChild: w, portalContainer: T, ref: E }) {
2025
+ let { isMounted: D, isVisible: O, setIsVisible: k, open: A, close: j } = Wn(), [M, N] = p(!1), P = l(), F = f(null), [I, L] = p(null), [R, z] = p(null), [ee, te] = p(null), B = f(void 0), { refs: V, floatingStyles: ne, placement: H, middlewareData: re, isPositioned: U } = En({
2026
+ placement: r,
2027
+ strategy: "fixed",
2028
+ open: D,
2029
+ whileElementsMounted: hn,
2030
+ middleware: [
2031
+ On(sr),
2032
+ An(),
2033
+ kn({ padding: 8 }),
2034
+ jn({ element: F })
2035
+ ]
2036
+ }), W = H.split("-")[0];
2037
+ Gn(D, U, k);
2038
+ let ie = o((e) => se(V.setReference, L, E)(e), [V, E]), ae = o((e) => se(V.setFloating, z)(e), [V]);
2039
+ u(() => {
2040
+ let e = I?.firstElementChild;
2041
+ te(R && e ? ir(R.textContent) === or(e) : null);
2042
+ }, [
2043
+ I,
2044
+ R,
2045
+ e,
2046
+ s,
2047
+ M
2048
+ ]);
2049
+ let G = o(() => {
2050
+ N(!1), j();
2051
+ }, [j]), oe = () => {
2052
+ !m && s && (N(!0), A(U), clearTimeout(B.current), B.current = setTimeout(G, d), b?.());
2053
+ }, K = () => {
2054
+ m || A(U);
2055
+ }, ce = o(() => {
2056
+ clearTimeout(B.current), G();
2057
+ }, [G]);
2058
+ c(() => () => clearTimeout(B.current), []), c(() => {
2059
+ if (!D) return;
2060
+ let e = (e) => {
2061
+ e.key === "Escape" && ce();
2062
+ };
2063
+ return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
2064
+ }, [D, ce]);
2065
+ let le = D && !m, ue = M && s ? s : e, de = {
2066
+ onClick: (e) => {
2067
+ i && s && oe(), a(t) && t.props.onClick?.(e);
2068
+ },
2069
+ "aria-describedby": q(a(t) ? t.props["aria-describedby"] : void 0, le && (w ?? (ee !== null && !ee)) && P)
2070
+ }, fe = a(t) ? n(t, de) : t, pe = T ?? rr(I), me = re.arrow?.x, he = re.arrow?.y, J = ur[W];
2071
+ return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ _("span", {
2072
+ ref: ie,
2073
+ className: x("inline-block", C),
2074
+ onMouseEnter: K,
2075
+ onMouseLeave: ce,
2076
+ onFocus: K,
2077
+ onBlur: ce,
2078
+ children: [fe, s !== void 0 && /* @__PURE__ */ g("span", {
2079
+ role: "status",
2080
+ className: "sr-only",
2081
+ children: M ? s : null
2082
+ })]
2083
+ }), le && y(/* @__PURE__ */ g("div", {
2084
+ ref: ae,
2085
+ style: ne,
2086
+ className: "z-50 inline-block pointer-events-none",
2087
+ children: /* @__PURE__ */ _("div", {
2088
+ id: P,
2089
+ role: "tooltip",
2090
+ "data-state": O ? "open" : "closed",
2091
+ className: x("px-3 py-1.5 text-sm whitespace-nowrap", "text-white dark:text-gray-900 bg-gray-900 dark:bg-gray-100 shadow-lg", "transition-[opacity,transform] duration-150 ease-out", O ? "opacity-100" : "opacity-0", lr[W], S[v]),
2092
+ children: [ue, /* @__PURE__ */ g("div", {
2093
+ ref: F,
2094
+ style: {
2095
+ position: "absolute",
2096
+ width: `${cr}px`,
2097
+ height: `${cr}px`,
2098
+ left: me === void 0 ? void 0 : `${me}px`,
2099
+ top: he === void 0 ? void 0 : `${he}px`,
2100
+ [J]: `-${cr / 2}px`
2101
+ },
2102
+ className: "rotate-45 bg-gray-900 dark:bg-gray-100"
2103
+ })]
2104
+ })
2105
+ }), pe)] });
1637
2106
  }
1638
2107
  //#endregion
1639
2108
  //#region src/components/icon_button/icon_button.tsx
1640
- var Dn = {
2109
+ var fr = {
1641
2110
  xs: "p-1",
1642
2111
  sm: "p-2",
1643
2112
  md: "p-2",
1644
2113
  lg: "p-3"
1645
- }, On = {
2114
+ }, pr = {
1646
2115
  xs: "w-4 h-4",
1647
2116
  sm: "w-4 h-4",
1648
2117
  md: "w-5 h-5",
1649
2118
  lg: "w-6 h-6"
1650
2119
  };
1651
- function kn(e) {
1652
- let { icon: t, "aria-label": n, unstyled: r = !1, variant: i = "outline", color: a = "neutral", size: o = "md", radius: s = "md", className: c, children: l, ref: u, ...d } = e, f = O[a];
1653
- return /* @__PURE__ */ _("button", {
1654
- ref: u,
2120
+ function mr(e) {
2121
+ if (e) return e === !0 ? {} : typeof e == "string" ? { position: e } : e;
2122
+ }
2123
+ function hr(e) {
2124
+ let { icon: t, "aria-label": n, unstyled: r = !1, variant: i = "outline", color: a = "neutral", size: o = "md", radius: s = "md", className: c, children: l, tooltip: u, ref: d, ...f } = e, p = A[a], m = mr(u), h = /* @__PURE__ */ _("button", {
2125
+ ref: d,
1655
2126
  type: "button",
1656
2127
  "aria-label": n,
1657
- className: x(k, !r && [
1658
- A,
2128
+ className: x(j, !r && [
2129
+ M,
1659
2130
  "border",
1660
2131
  S[s],
1661
- Dn[o],
1662
- f[i],
1663
- f.focusOutline
2132
+ fr[o],
2133
+ p[i],
2134
+ p.focusOutline
1664
2135
  ], c),
1665
- ...d,
1666
- children: [/* @__PURE__ */ g("div", { className: x(t, On[o], l && "mr-1") }), l]
2136
+ ...f,
2137
+ children: [/* @__PURE__ */ g("div", { className: x(t, pr[o], l && "mr-1") }), l]
2138
+ });
2139
+ if (!m) return h;
2140
+ let v = m.content !== void 0;
2141
+ return /* @__PURE__ */ g(dr, {
2142
+ content: v ? m.content : n,
2143
+ position: m.position,
2144
+ describeChild: v ? void 0 : !1,
2145
+ children: h
1667
2146
  });
1668
2147
  }
1669
2148
  //#endregion
1670
2149
  //#region src/components/shared/use_controlled_length.ts
1671
- function An(e) {
2150
+ function gr(e) {
1672
2151
  return typeof e == "string" ? e.length : 0;
1673
2152
  }
1674
- function jn(e, t) {
1675
- let [n, r] = p(An(t)), i = e !== void 0;
2153
+ function _r(e, t) {
2154
+ let [n, r] = p(gr(t)), i = e !== void 0;
1676
2155
  return {
1677
- length: i ? An(e) : n,
2156
+ length: i ? gr(e) : n,
1678
2157
  trackLength: (e) => {
1679
2158
  i || r(e.length);
1680
2159
  }
@@ -1682,108 +2161,109 @@ function jn(e, t) {
1682
2161
  }
1683
2162
  //#endregion
1684
2163
  //#region src/components/input/input.tsx
1685
- function Mn({ label: e, error: t, showCharCount: n = !1, minLength: r, maxLength: i, radius: a = "md", unstyled: o = !1, className: s, wrapperClassName: c, value: l, defaultValue: u, onChange: d, id: f, ...p }) {
1686
- let { fieldId: m, errorId: h } = B(f), { length: v, trackLength: y } = jn(l, u), b = n && (r !== void 0 || i !== void 0), C = (e) => {
1687
- y(e.target.value), d?.(e);
2164
+ function vr({ label: e, description: t, error: n, showCharCount: r = !1, minLength: i, maxLength: a, radius: o = "md", unstyled: s = !1, className: c, wrapperClassName: l, value: u, defaultValue: d, onChange: f, id: p, "aria-describedby": m, ...h }) {
2165
+ let { fieldId: v, errorId: y, descriptionId: b, characterCountId: C } = Y(p), { length: w, trackLength: T } = _r(u, d), E = r && (i !== void 0 || a !== void 0), D = (e) => {
2166
+ T(e.target.value), f?.(e);
1688
2167
  };
1689
- return /* @__PURE__ */ _(xe, {
1690
- fieldId: m,
1691
- errorId: h,
2168
+ return /* @__PURE__ */ _(je, {
2169
+ fieldId: v,
2170
+ errorId: y,
2171
+ descriptionId: b,
1692
2172
  label: e,
1693
- error: t,
1694
- required: p.required,
1695
- wrapperClassName: c,
2173
+ description: t,
2174
+ error: n,
2175
+ required: h.required,
2176
+ wrapperClassName: l,
1696
2177
  children: [/* @__PURE__ */ g("input", {
1697
- id: m,
1698
- className: x("w-full disabled:opacity-50 disabled:cursor-not-allowed", !o && [
1699
- de,
1700
- S[a],
2178
+ id: v,
2179
+ className: x("w-full disabled:opacity-50 disabled:cursor-not-allowed", !s && [
2180
+ le,
2181
+ S[o],
1701
2182
  "px-3 py-2 text-sm"
1702
- ], !o && t && x("border-red-500 dark:border-red-400", "focus:ring-red-500"), s),
1703
- ...l === void 0 ? { defaultValue: u } : { value: l },
1704
- minLength: r,
1705
- maxLength: i,
1706
- onChange: C,
1707
- "aria-invalid": !!t,
1708
- "aria-describedby": t ? h : void 0,
1709
- ...p
1710
- }), b && /* @__PURE__ */ g(ue, {
1711
- current: v,
1712
- min: r,
1713
- max: i,
1714
- showMin: r !== void 0,
1715
- showMax: i !== void 0
2183
+ ], !s && n && x("border-red-500 dark:border-red-400", "focus:ring-red-500"), c),
2184
+ ...u === void 0 ? { defaultValue: d } : { value: u },
2185
+ minLength: i,
2186
+ maxLength: a,
2187
+ onChange: D,
2188
+ "aria-invalid": !!n,
2189
+ "aria-describedby": q(m, !!t && b, n && y, E && C),
2190
+ ...h
2191
+ }), E && /* @__PURE__ */ g(K, {
2192
+ id: C,
2193
+ current: w,
2194
+ min: i,
2195
+ max: a,
2196
+ showMin: i !== void 0,
2197
+ showMax: a !== void 0
1716
2198
  })]
1717
2199
  });
1718
2200
  }
1719
2201
  //#endregion
1720
2202
  //#region src/components/kbd/kbd.tsx
1721
- var Nn = {
2203
+ var yr = {
1722
2204
  xs: "px-1.5 py-0.5 text-xs",
1723
2205
  sm: "px-2 py-0.5 text-xs",
1724
2206
  md: "px-2.5 py-1 text-sm",
1725
2207
  lg: "px-3 py-1 text-base"
1726
- }, Pn = ({ children: e, size: t = "sm", radius: n = "sm", unstyled: r = !1, className: i }) => /* @__PURE__ */ g("kbd", {
1727
- className: x("inline-flex items-center", Nn[t], !r && [
2208
+ }, br = ({ children: e, size: t = "sm", radius: n = "sm", unstyled: r = !1, className: i }) => /* @__PURE__ */ g("kbd", {
2209
+ className: x("inline-flex items-center", yr[t], !r && [
1728
2210
  "border font-semibold uppercase",
1729
- "text-gray-500 dark:text-gray-400",
2211
+ "text-gray-600 dark:text-gray-300",
1730
2212
  "bg-gray-100 dark:bg-gray-700",
1731
2213
  "border-gray-200 dark:border-gray-600",
1732
2214
  S[n]
1733
2215
  ], i),
1734
2216
  children: e
1735
- });
1736
- //#endregion
1737
- //#region src/lib/merge_refs.ts
1738
- function Fn(...e) {
1739
- return (t) => {
1740
- for (let n of e) typeof n == "function" ? n(t) : n && (n.current = t);
1741
- };
1742
- }
1743
- //#endregion
1744
- //#region src/components/menu/menu.tsx
1745
- var In = 4;
1746
- function Ln(e, t) {
2217
+ }), xr = 4;
2218
+ function Sr(e, t) {
1747
2219
  return t === "center" ? e : `${e}-${t}`;
1748
2220
  }
1749
- function Rn({ trigger: e, children: t, side: r = "bottom", align: i = "start", radius: s = "md", className: c, ref: l }) {
1750
- let u = f(null), { isMounted: d, isVisible: p, setIsVisible: m, open: h, close: v } = gn(), { refs: y, floatingStyles: b, isPositioned: S } = rn({
1751
- placement: Ln(r, i),
1752
- open: d,
1753
- whileElementsMounted: Kt,
2221
+ function Cr({ trigger: e, children: t, side: r = "bottom", align: i = "start", radius: s = "md", className: c, ref: u }) {
2222
+ let d = f(null), [m, h] = p("first"), { isMounted: v, isVisible: y, setIsVisible: b, open: S, close: C } = Wn(), { refs: w, floatingStyles: T, isPositioned: E } = En({
2223
+ placement: Sr(r, i),
2224
+ open: v,
2225
+ whileElementsMounted: hn,
1754
2226
  middleware: [
1755
- on(In),
1756
- cn(),
1757
- sn({ padding: 8 })
2227
+ On(xr),
2228
+ An(),
2229
+ kn({ padding: 8 })
1758
2230
  ]
1759
2231
  });
1760
- _n(d, S, m);
1761
- let C = o(() => {
1762
- v(), u.current?.querySelector("button, [href], [tabindex]")?.focus();
1763
- }, [v]), w = o((e) => Fn(y.setReference, u, l)(e), [y, l]), T = {
2232
+ Gn(v, E, b);
2233
+ let D = l(), O = (a(e) ? e.props.id : void 0) ?? D, k = `${O}-menu`, A = o(() => {
2234
+ C(), d.current?.querySelector("button, [href], [tabindex]")?.focus();
2235
+ }, [C]), j = o((e) => se(w.setReference, d, u)(e), [w, u]), M = {
2236
+ id: O,
1764
2237
  onClick: (t) => {
1765
- t.stopPropagation(), p ? v() : h(S), a(e) && e.props.onClick?.(t);
2238
+ t.stopPropagation(), y ? C() : (h("first"), S(E)), a(e) && e.props.onClick?.(t);
2239
+ },
2240
+ onKeyDown: (t) => {
2241
+ !y && t.key === "ArrowDown" ? (t.preventDefault(), h("first"), S(E)) : !y && t.key === "ArrowUp" && (t.preventDefault(), h("last"), S(E)), a(e) && e.props.onKeyDown?.(t);
1766
2242
  },
1767
2243
  "aria-haspopup": "menu",
1768
- "aria-expanded": d
1769
- }, E = a(e) ? n(e, T) : e;
2244
+ "aria-expanded": v,
2245
+ "aria-controls": v ? k : void 0
2246
+ }, N = a(e) ? n(e, M) : e;
1770
2247
  return /* @__PURE__ */ _("span", {
1771
- ref: w,
2248
+ ref: j,
1772
2249
  className: x("inline-block", c),
1773
- children: [E, d && /* @__PURE__ */ g(hn, {
1774
- setFloating: y.setFloating,
1775
- floatingStyles: b,
1776
- isVisible: p,
1777
- isPositioned: S,
2250
+ children: [N, v && /* @__PURE__ */ g(Un, {
2251
+ id: k,
2252
+ labelledBy: O,
2253
+ setFloating: w.setFloating,
2254
+ floatingStyles: T,
2255
+ isVisible: y,
2256
+ isPositioned: E,
1778
2257
  radius: s,
1779
- onClose: C,
2258
+ onClose: A,
2259
+ initialFocus: m,
1780
2260
  children: t
1781
2261
  })]
1782
2262
  });
1783
2263
  }
1784
2264
  //#endregion
1785
2265
  //#region src/components/menu_group/menu_group.tsx
1786
- function zn({ label: e, children: t, unstyled: n = !1, className: r, wrapperClassName: i }) {
2266
+ function wr({ label: e, children: t, unstyled: n = !1, className: r, wrapperClassName: i }) {
1787
2267
  let a = l();
1788
2268
  return /* @__PURE__ */ _("div", {
1789
2269
  role: "group",
@@ -1799,7 +2279,7 @@ function zn({ label: e, children: t, unstyled: n = !1, className: r, wrapperClas
1799
2279
  }
1800
2280
  //#endregion
1801
2281
  //#region src/components/menu_item/menu_item_end.tsx
1802
- function Bn({ trailing: e, selected: t }) {
2282
+ function Tr({ trailing: e, selected: t }) {
1803
2283
  let n = t !== void 0;
1804
2284
  return !e && !n ? null : /* @__PURE__ */ _("span", {
1805
2285
  className: "ml-auto flex flex-shrink-0 items-center gap-2 pl-2",
@@ -1814,41 +2294,45 @@ function Bn({ trailing: e, selected: t }) {
1814
2294
  }
1815
2295
  //#endregion
1816
2296
  //#region src/components/menu_item/menu_item_styles.ts
1817
- var Vn = ["flex w-full cursor-pointer items-center gap-2 whitespace-nowrap px-4 py-2 text-left text-sm transition-colors", "focus-visible:bg-gray-100 focus-visible:outline-none dark:focus-visible:bg-gray-700"];
1818
- function Hn(e, t, n) {
1819
- return x(Vn, e, t ? "text-red-600 dark:text-red-400" : "text-gray-700 dark:text-gray-300", n);
2297
+ var Er = [
2298
+ "flex w-full cursor-pointer items-center gap-2 whitespace-nowrap px-4 py-2 text-left text-sm transition-colors",
2299
+ "focus-visible:bg-gray-100 dark:focus-visible:bg-gray-700",
2300
+ k
2301
+ ];
2302
+ function Dr(e, t, n) {
2303
+ return x(Er, e, t ? "text-red-700 dark:text-red-300" : "text-gray-700 dark:text-gray-300", n);
1820
2304
  }
1821
2305
  //#endregion
1822
2306
  //#region src/components/menu_item/menu_item_content.tsx
1823
- var Un = ({ icon: e, children: t }) => /* @__PURE__ */ _(h, { children: [e && /* @__PURE__ */ g("div", {
2307
+ var Or = ({ icon: e, children: t }) => /* @__PURE__ */ _(h, { children: [e && /* @__PURE__ */ g("div", {
1824
2308
  className: x(e, "h-4 w-4 flex-shrink-0"),
1825
2309
  "aria-hidden": "true"
1826
- }), t] }), Wn = "_blank", Gn = "noopener noreferrer", Kn = ["no-underline hover:bg-gray-100 dark:hover:bg-gray-700", "aria-disabled:pointer-events-none aria-disabled:cursor-not-allowed aria-disabled:opacity-50"];
1827
- function qn({ icon: e, trailing: t, href: n, target: r, rel: i, danger: a = !1, disabled: o = !1, children: s, className: c, ref: l }) {
1828
- let u = dn();
2310
+ }), t] }), kr = "_blank", Ar = "noopener noreferrer", jr = ["no-underline hover:bg-gray-100 dark:hover:bg-gray-700", "aria-disabled:pointer-events-none aria-disabled:cursor-not-allowed aria-disabled:opacity-50"];
2311
+ function Mr({ icon: e, trailing: t, href: n, target: r, rel: i, danger: a = !1, disabled: o = !1, children: s, className: c, ref: l }) {
2312
+ let u = Nn();
1829
2313
  return /* @__PURE__ */ _("a", {
1830
2314
  ref: l,
1831
2315
  role: "menuitem",
1832
2316
  tabIndex: -1,
1833
2317
  href: o ? void 0 : n,
1834
2318
  target: r,
1835
- rel: i ?? (r === Wn ? Gn : void 0),
2319
+ rel: i ?? (r === kr ? Ar : void 0),
1836
2320
  "aria-disabled": o || void 0,
1837
2321
  onClick: (e) => {
1838
2322
  e.stopPropagation(), u?.();
1839
2323
  },
1840
- className: Hn(Kn, a, c),
1841
- children: [/* @__PURE__ */ g(Un, {
2324
+ className: Dr(jr, a, c),
2325
+ children: [/* @__PURE__ */ g(Or, {
1842
2326
  icon: e,
1843
2327
  children: s
1844
- }), /* @__PURE__ */ g(Bn, { trailing: t })]
2328
+ }), /* @__PURE__ */ g(Tr, { trailing: t })]
1845
2329
  });
1846
2330
  }
1847
2331
  //#endregion
1848
2332
  //#region src/components/menu_item/menu_item_button.tsx
1849
- var Jn = ["hover:enabled:bg-gray-100 dark:hover:enabled:bg-gray-700", "disabled:cursor-not-allowed disabled:opacity-50"];
1850
- function Yn({ icon: e, trailing: t, onClick: n, selected: r, danger: i = !1, disabled: a = !1, children: o, className: s, ref: c }) {
1851
- let l = dn();
2333
+ var Nr = ["hover:enabled:bg-gray-100 dark:hover:enabled:bg-gray-700", "disabled:cursor-not-allowed disabled:opacity-50"];
2334
+ function Pr({ icon: e, trailing: t, onClick: n, selected: r, danger: i = !1, disabled: a = !1, children: o, className: s, ref: c }) {
2335
+ let l = Nn();
1852
2336
  return /* @__PURE__ */ _("button", {
1853
2337
  ref: c,
1854
2338
  type: "button",
@@ -1859,11 +2343,11 @@ function Yn({ icon: e, trailing: t, onClick: n, selected: r, danger: i = !1, dis
1859
2343
  e.stopPropagation(), n(e), l?.();
1860
2344
  },
1861
2345
  disabled: a,
1862
- className: Hn(Jn, i, s),
1863
- children: [/* @__PURE__ */ g(Un, {
2346
+ className: Dr(Nr, i, s),
2347
+ children: [/* @__PURE__ */ g(Or, {
1864
2348
  icon: e,
1865
2349
  children: o
1866
- }), /* @__PURE__ */ g(Bn, {
2350
+ }), /* @__PURE__ */ g(Tr, {
1867
2351
  trailing: t,
1868
2352
  selected: r
1869
2353
  })]
@@ -1871,17 +2355,17 @@ function Yn({ icon: e, trailing: t, onClick: n, selected: r, danger: i = !1, dis
1871
2355
  }
1872
2356
  //#endregion
1873
2357
  //#region src/components/menu_item/menu_item.tsx
1874
- function Xn(e) {
1875
- return e.href === void 0 ? /* @__PURE__ */ g(Yn, { ...e }) : /* @__PURE__ */ g(qn, { ...e });
2358
+ function Fr(e) {
2359
+ return e.href === void 0 ? /* @__PURE__ */ g(Pr, { ...e }) : /* @__PURE__ */ g(Mr, { ...e });
1876
2360
  }
1877
2361
  //#endregion
1878
2362
  //#region src/components/menu_separator/menu_separator.tsx
1879
- var Zn = ({ unstyled: e = !1, className: t }) => /* @__PURE__ */ g("hr", {
2363
+ var Ir = ({ unstyled: e = !1, className: t }) => /* @__PURE__ */ g("hr", {
1880
2364
  role: "separator",
1881
2365
  "aria-orientation": "horizontal",
1882
2366
  className: x("w-full", !e && ["my-1 border-0 border-t", "border-gray-200 dark:border-gray-700"], t)
1883
- }), Qn = [];
1884
- function $n() {
2367
+ }), Lr = [];
2368
+ function Rr() {
1885
2369
  let e = 0, t = [], n = null, r = /* @__PURE__ */ new Set(), i = () => {
1886
2370
  for (let e of r) e(t);
1887
2371
  };
@@ -1902,7 +2386,7 @@ function $n() {
1902
2386
  r.delete(i), r.size || (e = 0, t = [], n = null);
1903
2387
  }),
1904
2388
  getSnapshot: () => t,
1905
- getServerSnapshot: () => Qn,
2389
+ getServerSnapshot: () => Lr,
1906
2390
  getListenersSize: () => r.size,
1907
2391
  getUpsertPromise: () => n,
1908
2392
  setUpsertPromise: (e) => {
@@ -1910,9 +2394,9 @@ function $n() {
1910
2394
  }
1911
2395
  };
1912
2396
  }
1913
- var er = /* @__PURE__ */ new Map();
1914
- function tr(e, t = 0) {
1915
- let n = { current: $n() }, r = (e) => (r) => {
2397
+ var zr = /* @__PURE__ */ new Map();
2398
+ function Br(e, t = 0) {
2399
+ let n = { current: Rr() }, r = (e) => (r) => {
1916
2400
  let i = /* @__PURE__ */ new Set();
1917
2401
  n.current.set(e, (e) => (e.resolve(r), i.add(e.promise), {
1918
2402
  ...e,
@@ -1998,84 +2482,164 @@ function tr(e, t = 0) {
1998
2482
  set: (r) => {
1999
2483
  if (t || (e = r, !r)) return;
2000
2484
  t = !0;
2001
- let i = er.get(r);
2002
- i ? n.current = i : er.set(r, n.current);
2485
+ let i = zr.get(r);
2486
+ i ? n.current = i : zr.set(r, n.current);
2003
2487
  }
2004
2488
  });
2005
2489
  }
2006
2490
  return d;
2007
2491
  }
2008
2492
  //#endregion
2493
+ //#region src/components/shared/tabbable.ts
2494
+ var Vr = [
2495
+ "a[href]",
2496
+ "button",
2497
+ "input",
2498
+ "select",
2499
+ "textarea",
2500
+ "summary",
2501
+ "audio[controls]",
2502
+ "video[controls]",
2503
+ "[contenteditable]:not([contenteditable=\"false\"])",
2504
+ "[tabindex]"
2505
+ ].join(", ");
2506
+ function Hr(e) {
2507
+ return e.matches(":disabled");
2508
+ }
2509
+ function Ur(e) {
2510
+ return e.getAttribute("tabindex") === "-1";
2511
+ }
2512
+ function Wr(e) {
2513
+ return e.matches("input[type=\"hidden\"]");
2514
+ }
2515
+ function Gr(e) {
2516
+ return e.closest("[inert]") !== null;
2517
+ }
2518
+ function Kr(e) {
2519
+ return typeof e.checkVisibility != "function" || e.checkVisibility();
2520
+ }
2521
+ function qr(e) {
2522
+ return !Hr(e) && !Ur(e) && !Wr(e) && !Gr(e) && Kr(e);
2523
+ }
2524
+ function Jr(e) {
2525
+ return e instanceof HTMLInputElement && e.type === "radio" && e.name !== "";
2526
+ }
2527
+ function Yr(e) {
2528
+ let t = /* @__PURE__ */ new Map();
2529
+ for (let n of e) {
2530
+ let e = t.get(n.form) ?? /* @__PURE__ */ new Map();
2531
+ t.set(n.form, e);
2532
+ let r = e.get(n.name) ?? [];
2533
+ r.push(n), e.set(n.name, r);
2534
+ }
2535
+ return Array.from(t.values()).flatMap((e) => Array.from(e.values()));
2536
+ }
2537
+ function Xr(e) {
2538
+ return e.find((e) => e.checked) ?? e[0];
2539
+ }
2540
+ function Zr(e) {
2541
+ let t = Array.from(e.querySelectorAll(Vr)).filter(qr), n = t.filter(Jr), r = new Set(Yr(n).map(Xr));
2542
+ return t.filter((e) => !Jr(e) || r.has(e));
2543
+ }
2544
+ //#endregion
2545
+ //#region src/components/modal/modal_stack.ts
2546
+ var Qr = [];
2547
+ function $r(e) {
2548
+ return Qr.push(e), () => {
2549
+ let t = Qr.indexOf(e);
2550
+ t !== -1 && Qr.splice(t, 1);
2551
+ };
2552
+ }
2553
+ function ei(e) {
2554
+ return Qr[Qr.length - 1] === e;
2555
+ }
2556
+ //#endregion
2009
2557
  //#region src/components/modal/modal_shell.tsx
2010
- var nr = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])", rr = {
2558
+ var ti = r(null), ni = {
2011
2559
  sm: "max-w-md",
2012
2560
  md: "max-w-lg",
2013
2561
  lg: "max-w-2xl",
2014
2562
  xl: "max-w-4xl"
2015
2563
  };
2016
- function ir({ isEnded: e, onDismiss: t, title: n, children: r, footer: i, size: a = "md", radius: o = "xl", className: s, dismissible: u = !0, closeLabel: d = "Close" }) {
2017
- let [m, h] = p(!1), v = f(null), b = f(null), C = f(null), w = l();
2564
+ function ri({ isEnded: e, onDismiss: t, title: n, children: r, footer: i, size: a = "md", radius: o = "xl", className: s, dismissible: u = !0, closeLabel: d, role: m = "dialog", initialFocusRef: h, "aria-label": v }) {
2565
+ let b = we(), [C, w] = p(!1), [T] = p(() => Symbol("modal")), [E, D] = p(null), O = f(null), k = f(null), A = f(null), j = l(), M = l();
2018
2566
  c(() => {
2019
- document.body.style.overflow = "hidden", C.current = document.activeElement;
2020
- let e = v.current;
2021
- (b.current?.querySelector(nr) ?? e?.querySelector(nr) ?? e)?.focus();
2022
- let t = requestAnimationFrame(() => {
2023
- requestAnimationFrame(() => h(!0));
2567
+ if (!e) return $r(T);
2568
+ }, [e, T]), c(() => {
2569
+ document.body.style.overflow = "hidden", A.current = document.activeElement;
2570
+ let e = requestAnimationFrame(() => {
2571
+ requestAnimationFrame(() => w(!0));
2024
2572
  });
2025
2573
  return () => {
2026
- cancelAnimationFrame(t), document.body.style.overflow = "";
2574
+ cancelAnimationFrame(e), document.body.style.overflow = "";
2027
2575
  };
2028
2576
  }, []), c(() => {
2029
- e && C.current?.focus();
2577
+ if (!E) return;
2578
+ let e = O.current, t = (k.current && Zr(k.current)[0]) ?? (e && Zr(e)[0]);
2579
+ (h?.current ?? t ?? e)?.focus();
2580
+ }, [E]), c(() => {
2581
+ e && A.current?.focus();
2030
2582
  }, [e]), c(() => {
2031
2583
  if (e) return;
2032
2584
  let n = (e) => {
2585
+ if (!ei(T)) return;
2033
2586
  if (e.key === "Escape") {
2034
- u && t();
2587
+ if (e.defaultPrevented) return;
2588
+ e.preventDefault(), u && t();
2035
2589
  return;
2036
2590
  }
2037
2591
  if (e.key !== "Tab") return;
2038
- let n = v.current;
2592
+ let n = O.current;
2039
2593
  if (!n) return;
2040
- let r = Array.from(n.querySelectorAll(nr));
2041
- if (r.length === 0) return;
2042
- let i = r[0], a = r[r.length - 1];
2043
- e.shiftKey && document.activeElement === i ? (e.preventDefault(), a.focus()) : !e.shiftKey && document.activeElement === a && (e.preventDefault(), i.focus());
2594
+ let r = Zr(n);
2595
+ if (r.length === 0) {
2596
+ e.preventDefault(), n.focus();
2597
+ return;
2598
+ }
2599
+ let i = r[0], a = r[r.length - 1], o = document.activeElement;
2600
+ if ((o instanceof HTMLElement ? r.indexOf(o) : -1) === -1) {
2601
+ e.preventDefault(), (e.shiftKey ? a : i).focus();
2602
+ return;
2603
+ }
2604
+ e.shiftKey && o === i ? (e.preventDefault(), a.focus()) : !e.shiftKey && o === a && (e.preventDefault(), i.focus());
2044
2605
  };
2045
2606
  return document.addEventListener("keydown", n), () => document.removeEventListener("keydown", n);
2046
2607
  }, [
2047
2608
  e,
2048
2609
  t,
2049
- u
2610
+ u,
2611
+ T
2050
2612
  ]);
2051
- let T = () => {
2613
+ let N = () => {
2052
2614
  !e && u && t();
2053
- }, E = m && !e;
2615
+ }, P = m === "alertdialog" && !!r, F = C && !e;
2054
2616
  return y(/* @__PURE__ */ _("div", {
2055
- className: x("fixed inset-0 z-50 flex items-start justify-center", "p-2 sm:py-[3rem] lg:py-[5rem]", "transition-opacity duration-200 ease-out", E ? "opacity-100" : "opacity-0"),
2056
- onClick: T,
2617
+ className: x("fixed inset-0 z-50 flex items-start justify-center", "p-2 sm:py-[3rem] lg:py-[5rem]", "transition-opacity duration-200 ease-out", F ? "opacity-100" : "opacity-0"),
2618
+ onClick: N,
2057
2619
  children: [/* @__PURE__ */ g("div", {
2058
- className: x("fixed inset-0 bg-black/60 backdrop-blur-md", "transition-opacity duration-200 ease-out", E ? "opacity-100" : "opacity-0"),
2620
+ className: x("fixed inset-0 bg-black/60 backdrop-blur-md", "transition-opacity duration-200 ease-out", F ? "opacity-100" : "opacity-0"),
2059
2621
  "aria-hidden": "true"
2060
2622
  }), /* @__PURE__ */ _("div", {
2061
- ref: v,
2062
- role: "dialog",
2623
+ ref: O,
2624
+ role: m,
2063
2625
  "aria-modal": "true",
2064
- "aria-labelledby": n ? w : void 0,
2626
+ "aria-labelledby": n ? j : void 0,
2627
+ "aria-label": n ? void 0 : v,
2628
+ "aria-describedby": P ? M : void 0,
2065
2629
  tabIndex: -1,
2066
- className: x("relative w-full", rr[a], z, "shadow-2xl", S[o], "max-h-[calc(100vh-4rem)] sm:max-h-[calc(100vh-10rem)] overflow-hidden flex flex-col", "transition-all duration-200 ease-out", "focus:outline-none", E ? "opacity-100 scale-100 translate-y-0" : "opacity-0 scale-95 translate-y-1"),
2630
+ className: x("relative w-full", ni[a], re, "shadow-2xl", S[o], "max-h-[calc(100vh-4rem)] sm:max-h-[calc(100vh-10rem)] overflow-hidden flex flex-col", "transition-all duration-200 ease-out", "focus:outline-none", F ? "opacity-100 scale-100 translate-y-0" : "opacity-0 scale-95 translate-y-1"),
2067
2631
  onClick: (e) => e.stopPropagation(),
2068
2632
  children: [
2069
2633
  n && /* @__PURE__ */ _("div", {
2070
2634
  className: "flex items-center justify-between gap-4 px-6 pt-5 pb-4 flex-shrink-0",
2071
2635
  children: [/* @__PURE__ */ g("h2", {
2072
- id: w,
2636
+ id: j,
2073
2637
  className: "text-base font-medium tracking-tight text-gray-900 dark:text-gray-100",
2074
2638
  children: n
2075
- }), u && /* @__PURE__ */ g(kn, {
2639
+ }), u && /* @__PURE__ */ g(hr, {
2076
2640
  icon: "i-mdi-close",
2077
2641
  onClick: t,
2078
- "aria-label": d,
2642
+ "aria-label": d ?? b.close,
2079
2643
  variant: "subtle",
2080
2644
  size: "sm",
2081
2645
  radius: "full",
@@ -2083,12 +2647,17 @@ function ir({ isEnded: e, onDismiss: t, title: n, children: r, footer: i, size:
2083
2647
  })]
2084
2648
  }),
2085
2649
  /* @__PURE__ */ g("div", {
2086
- ref: b,
2650
+ ref: k,
2651
+ id: P ? M : void 0,
2087
2652
  className: x("flex-1 overflow-y-auto px-6 pb-6 text-sm leading-relaxed text-gray-600 dark:text-gray-400 min-h-0", !n && "pt-6", s),
2088
- children: r
2653
+ children: /* @__PURE__ */ g(ti.Provider, {
2654
+ value: E,
2655
+ children: r
2656
+ })
2089
2657
  }),
2090
- i && /* @__PURE__ */ g("div", {
2091
- className: x("flex items-center justify-end gap-3 px-6 py-4 border-t flex-shrink-0", "border-gray-100 dark:border-gray-800"),
2658
+ /* @__PURE__ */ g("div", {
2659
+ ref: D,
2660
+ className: x("flex items-center justify-end gap-3 px-6 py-4 border-t flex-shrink-0 empty:hidden", H),
2092
2661
  children: i
2093
2662
  })
2094
2663
  ]
@@ -2096,8 +2665,8 @@ function ir({ isEnded: e, onDismiss: t, title: n, children: r, footer: i, size:
2096
2665
  }), document.body);
2097
2666
  }
2098
2667
  //#endregion
2099
- //#region node_modules/.pnpm/zustand@5.0.15_@types+react@19.2.18_react@19.2.8_use-sync-external-store@1.6.0_react@19.2.8_/node_modules/zustand/esm/vanilla.mjs
2100
- var ar = (e) => {
2668
+ //#region node_modules/.pnpm/zustand@5.0.15_@types+react@19.3.0_react@19.3.0_use-sync-external-store@1.6.0_react@19.3.0_/node_modules/zustand/esm/vanilla.mjs
2669
+ var ii = (e) => {
2101
2670
  let t, n = /* @__PURE__ */ new Set(), r = (e, r) => {
2102
2671
  let i = typeof e == "function" ? e(t) : e;
2103
2672
  if (!Object.is(i, t)) {
@@ -2111,47 +2680,47 @@ var ar = (e) => {
2111
2680
  subscribe: (e) => (n.add(e), () => n.delete(e))
2112
2681
  }, o = t = e(r, i, a);
2113
2682
  return a;
2114
- }, or = ((e) => e ? ar(e) : ar), sr = (e) => e;
2115
- function cr(e, n = sr) {
2683
+ }, ai = ((e) => e ? ii(e) : ii), oi = (e) => e;
2684
+ function si(e, n = oi) {
2116
2685
  let r = t.useSyncExternalStore(e.subscribe, t.useCallback(() => n(e.getState()), [e, n]), t.useCallback(() => n(e.getInitialState()), [e, n]));
2117
2686
  return t.useDebugValue(r), r;
2118
2687
  }
2119
- var lr = (e) => {
2120
- let t = or(e), n = (e) => cr(t, e);
2688
+ var ci = (e) => {
2689
+ let t = ai(e), n = (e) => si(t, e);
2121
2690
  return Object.assign(n, t), n;
2122
- }, ur = ((e) => e ? lr(e) : lr), dr = ur((e) => ({
2691
+ }, li = ((e) => e ? ci(e) : ci), ui = li((e) => ({
2123
2692
  globalHotkeysEnabled: !0,
2124
2693
  setGlobalHotkeysEnabled: (t) => e({ globalHotkeysEnabled: t })
2125
- })), fr = 0;
2126
- function pr() {
2127
- c(() => (fr += 1, fr === 1 && dr.getState().setGlobalHotkeysEnabled(!1), () => {
2128
- --fr, fr === 0 && dr.getState().setGlobalHotkeysEnabled(!0);
2694
+ })), di = 0;
2695
+ function fi() {
2696
+ c(() => (di += 1, di === 1 && ui.getState().setGlobalHotkeysEnabled(!1), () => {
2697
+ --di, di === 0 && ui.getState().setGlobalHotkeysEnabled(!0);
2129
2698
  }), []);
2130
2699
  }
2131
2700
  //#endregion
2132
2701
  //#region src/components/modal/confirm_modal.tsx
2133
- var mr = {
2702
+ var pi = {
2134
2703
  danger: "i-mdi-alert-circle",
2135
2704
  primary: "i-mdi-help-circle",
2136
2705
  success: "i-mdi-check-circle"
2137
- }, hr = {
2706
+ }, mi = {
2138
2707
  danger: "bg-red-50 text-red-600 dark:bg-red-500/10 dark:text-red-400",
2139
2708
  primary: "bg-blue-50 text-blue-600 dark:bg-blue-500/10 dark:text-blue-400",
2140
2709
  success: "bg-green-50 text-green-600 dark:bg-green-500/10 dark:text-green-400"
2141
2710
  };
2142
- function gr({ title: e, color: t }) {
2711
+ function hi({ title: e, color: t }) {
2143
2712
  return /* @__PURE__ */ _("div", {
2144
2713
  className: "flex items-center gap-3",
2145
2714
  children: [/* @__PURE__ */ g("span", {
2146
- className: x("flex h-9 w-9 shrink-0 items-center justify-center rounded-full", hr[t]),
2715
+ className: x("flex h-9 w-9 shrink-0 items-center justify-center rounded-full", mi[t]),
2147
2716
  "aria-hidden": "true",
2148
- children: /* @__PURE__ */ g("span", { className: x(mr[t], "h-5 w-5") })
2717
+ children: /* @__PURE__ */ g("span", { className: x(pi[t], "h-5 w-5") })
2149
2718
  }), e]
2150
2719
  });
2151
2720
  }
2152
- var _r = tr(({ call: e, title: t, children: n, confirmLabel: r, cancelLabel: i, confirmColor: a, radius: o, closeLabel: s, onConfirm: c, onError: l }) => {
2153
- pr();
2154
- let [u, d] = p(!1), f = () => e.end(!1), m = async () => {
2721
+ var gi = Br(({ call: e, title: t, children: n, confirmLabel: r, cancelLabel: i, confirmColor: a, radius: o, closeLabel: s, onConfirm: c, onError: l }) => {
2722
+ fi();
2723
+ let [u, d] = p(!1), m = f(null), v = () => e.end(!1), y = async () => {
2155
2724
  if (!c) {
2156
2725
  e.end(!0);
2157
2726
  return;
@@ -2160,138 +2729,365 @@ var _r = tr(({ call: e, title: t, children: n, confirmLabel: r, cancelLabel: i,
2160
2729
  try {
2161
2730
  await c(), e.end(!0);
2162
2731
  } catch (e) {
2163
- d(!1), Sn(e, l);
2732
+ d(!1), Xn(e, l);
2164
2733
  }
2165
- }, v = u, y = r ?? "Confirm", b = i ?? "Cancel", x = a ?? "primary";
2166
- return /* @__PURE__ */ g(ir, {
2734
+ }, b = we(), x = u, S = r ?? b.confirm, C = i ?? b.cancel, w = a ?? "primary";
2735
+ return /* @__PURE__ */ g(ri, {
2167
2736
  isEnded: e.ended,
2168
- onDismiss: f,
2169
- title: /* @__PURE__ */ g(gr, {
2737
+ onDismiss: v,
2738
+ title: /* @__PURE__ */ g(hi, {
2170
2739
  title: t,
2171
- color: x
2740
+ color: w
2172
2741
  }),
2173
2742
  size: "sm",
2174
2743
  radius: o,
2175
2744
  closeLabel: s,
2176
- footer: /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(R, {
2745
+ role: "alertdialog",
2746
+ initialFocusRef: m,
2747
+ footer: /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(te, {
2748
+ ref: m,
2177
2749
  variant: "outline",
2178
2750
  color: "neutral",
2179
- onClick: f,
2180
- disabled: v,
2751
+ onClick: v,
2752
+ disabled: x,
2181
2753
  size: "sm",
2182
- children: b
2183
- }), /* @__PURE__ */ g(R, {
2184
- color: x,
2754
+ children: C
2755
+ }), /* @__PURE__ */ g(te, {
2756
+ color: w,
2185
2757
  onClick: () => {
2186
- m();
2758
+ y();
2187
2759
  },
2188
- loading: v,
2189
- disabled: v,
2760
+ loading: x,
2761
+ disabled: x,
2190
2762
  size: "sm",
2191
- children: y
2763
+ children: S
2192
2764
  })] }),
2193
2765
  children: n
2194
2766
  });
2195
2767
  }, 200);
2196
2768
  //#endregion
2197
2769
  //#region src/components/modal/modal.tsx
2198
- function vr(e, t) {
2770
+ function _i(e, t) {
2199
2771
  return typeof e == "function" ? e(t) : e;
2200
2772
  }
2201
- var yr = r(null), br = tr(({ call: e, title: t, children: n, size: r, radius: i, className: a, dismissible: o, closeLabel: s }) => {
2202
- pr();
2203
- let [c, l] = p(null), u = () => e.end();
2204
- return /* @__PURE__ */ g(ir, {
2773
+ var vi = Br(({ call: e, title: t, children: n, size: r, radius: i, className: a, dismissible: o, closeLabel: s, role: c, initialFocusRef: l, "aria-label": u }) => {
2774
+ fi();
2775
+ let d = () => e.end();
2776
+ return /* @__PURE__ */ g(ri, {
2205
2777
  isEnded: e.ended,
2206
- onDismiss: u,
2778
+ onDismiss: d,
2207
2779
  title: t,
2208
- footer: c,
2209
2780
  size: r,
2210
2781
  radius: i,
2211
2782
  className: a,
2212
2783
  dismissible: o,
2213
2784
  closeLabel: s,
2214
- children: /* @__PURE__ */ g(yr.Provider, {
2215
- value: l,
2216
- children: vr(n, u)
2217
- })
2785
+ role: c,
2786
+ initialFocusRef: l,
2787
+ "aria-label": u,
2788
+ children: _i(n, d)
2218
2789
  });
2219
2790
  }, 200);
2220
2791
  //#endregion
2221
2792
  //#region src/components/modal/modal_footer.tsx
2222
- function xr({ children: e }) {
2223
- let t = s(yr);
2224
- return c(() => (t?.(e), () => t?.(null)), [t, e]), null;
2793
+ function yi({ children: e }) {
2794
+ let t = s(ti);
2795
+ return t ? y(e, t) : null;
2225
2796
  }
2226
2797
  //#endregion
2227
2798
  //#region src/components/modal_provider/modal_provider.tsx
2228
- function Sr() {
2229
- return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(br, {}), /* @__PURE__ */ g(_r, {})] });
2799
+ function bi() {
2800
+ return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(vi, {}), /* @__PURE__ */ g(gi, {})] });
2801
+ }
2802
+ //#endregion
2803
+ //#region src/components/multi_combobox/multi_combobox.tsx
2804
+ var xi = 2;
2805
+ function Si(e, t, n, r) {
2806
+ return r?.(e, t) ? !0 : n === void 0 || t.includes(e) ? !1 : t.length >= n;
2807
+ }
2808
+ function Ci(e, t) {
2809
+ return e.includes(t) ? e.filter((e) => e !== t) : [...e, t];
2810
+ }
2811
+ function wi(e, t) {
2812
+ if (e.length <= t) return {
2813
+ visibleOptions: e,
2814
+ hiddenCount: 0
2815
+ };
2816
+ let n = Math.max(t - 1, 0);
2817
+ return {
2818
+ visibleOptions: e.slice(0, n),
2819
+ hiddenCount: e.length - n
2820
+ };
2821
+ }
2822
+ var Ti = "inline-flex items-center rounded-full bg-gray-200 dark:bg-gray-700 px-2 py-0.5 text-xs text-gray-900 dark:text-gray-100";
2823
+ function Ei({ options: e, label: t, "aria-label": n, error: r, placeholder: i, searchPlaceholder: a, noResultsText: s, clearLabel: l, clearText: u, maxSelectedValues: m, isOptionDisabled: v, maxDisplayedValues: y = xi, formatOverflowCount: b, formatSelectedCount: w, formatMaxSelectedHint: T, radius: E = "sm", unstyled: D = !1, disabled: O = !1, required: k = !1, className: j, wrapperClassName: M, values: N, defaultValues: P = [], onChange: F, onDropdownClose: I, id: L }) {
2824
+ let R = we(), { fieldId: z, errorId: ee, labelId: te } = Y(L), B = `${z}-listbox`, V = `${z}-max-hint`, ne = f(null), H = f(null), re = f(null), [U, W] = be(N, P), [ie, ae] = p(""), [G, oe] = p(!1), K = d(() => {
2825
+ let t = ie.trim().toLowerCase();
2826
+ return t ? e.filter((e) => e.label.toLowerCase().includes(t)) : e;
2827
+ }, [e, ie]), { activeIndex: se, activeOptionId: q, move: ce, first: ue, last: de, reset: fe } = Pe({
2828
+ optionCount: K.length,
2829
+ getOptionId: (e) => `${B}-option-${e}`,
2830
+ isOpen: G
2831
+ }), pe = d(() => e.filter((e) => U.includes(e.value)), [e, U]), { visibleOptions: me, hiddenCount: he } = wi(pe, y), J = () => {
2832
+ O || oe(!0);
2833
+ }, ge = o(() => {
2834
+ oe(!1), ae(""), fe(), I?.(U);
2835
+ }, [
2836
+ fe,
2837
+ I,
2838
+ U
2839
+ ]), _e = () => {
2840
+ G ? ge() : J();
2841
+ }, ve = (e) => {
2842
+ if (Si(e, U, m, v)) return;
2843
+ let t = Ci(U, e);
2844
+ W(t), F?.(t);
2845
+ }, ye = () => {
2846
+ W([]), F?.([]);
2847
+ }, xe = (e) => {
2848
+ e.stopPropagation(), ye(), G || I?.([]), ne.current?.focus();
2849
+ }, Se = () => {
2850
+ ye(), re.current?.focus();
2851
+ }, Ce = () => {
2852
+ O || _e();
2853
+ }, Te = (e) => {
2854
+ ae(e.target.value), fe();
2855
+ }, Ee = (e) => {
2856
+ if (e.preventDefault(), !G) {
2857
+ J(), ue();
2858
+ return;
2859
+ }
2860
+ ce(1);
2861
+ }, De = (e) => {
2862
+ if (e.preventDefault(), !G) {
2863
+ J(), de();
2864
+ return;
2865
+ }
2866
+ ce(-1);
2867
+ }, Oe = (e) => {
2868
+ if (!G) return;
2869
+ e.preventDefault();
2870
+ let t = K[se];
2871
+ t && ve(t.value);
2872
+ }, ke = (e) => {
2873
+ G && (e.preventDefault(), ge(), ne.current?.focus());
2874
+ }, Ae = (e) => {
2875
+ if (e.key === "ArrowDown") return Ee(e);
2876
+ if (e.key === "ArrowUp") return De(e);
2877
+ if (e.key === "Enter") return Oe(e);
2878
+ if (e.key === "Escape") return ke(e);
2879
+ };
2880
+ return c(() => {
2881
+ if (!G) return;
2882
+ let e = (e) => {
2883
+ H.current && !H.current.contains(e.target) && ge();
2884
+ };
2885
+ return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
2886
+ }, [G, ge]), /* @__PURE__ */ g(je, {
2887
+ fieldId: z,
2888
+ errorId: ee,
2889
+ label: t,
2890
+ error: r,
2891
+ required: k,
2892
+ wrapperClassName: M,
2893
+ children: /* @__PURE__ */ _("div", {
2894
+ ref: H,
2895
+ className: "relative",
2896
+ onBlur: (e) => {
2897
+ if (!G) return;
2898
+ let t = e.relatedTarget;
2899
+ t instanceof Node && H.current?.contains(t) || ge();
2900
+ },
2901
+ children: [
2902
+ /* @__PURE__ */ g("button", {
2903
+ ref: ne,
2904
+ type: "button",
2905
+ id: z,
2906
+ role: "combobox",
2907
+ disabled: O,
2908
+ "aria-expanded": G,
2909
+ "aria-controls": B,
2910
+ "aria-haspopup": "listbox",
2911
+ "aria-invalid": !!r,
2912
+ "aria-required": k || void 0,
2913
+ "aria-describedby": r ? ee : void 0,
2914
+ "aria-labelledby": typeof t == "string" ? te : void 0,
2915
+ "aria-label": n,
2916
+ onClick: Ce,
2917
+ onKeyDown: Ae,
2918
+ className: x("w-full flex flex-wrap items-center gap-1 text-left disabled:opacity-50 disabled:cursor-not-allowed", !D && [
2919
+ le,
2920
+ S[E],
2921
+ "pl-3 pr-8 py-2 text-sm min-h-10"
2922
+ ], !D && r && x("border-red-500 dark:border-red-400", "focus:ring-red-500"), j),
2923
+ children: pe.length === 0 ? /* @__PURE__ */ g("span", {
2924
+ className: x(!D && "text-gray-500 dark:text-gray-400"),
2925
+ children: i
2926
+ }) : /* @__PURE__ */ _(h, { children: [me.map((e) => /* @__PURE__ */ g("span", {
2927
+ className: x(!D && Ti),
2928
+ children: e.label
2929
+ }, e.value)), he > 0 && /* @__PURE__ */ g("span", {
2930
+ className: x(!D && Ti),
2931
+ children: (b ?? R.overflowCount)(he)
2932
+ })] })
2933
+ }),
2934
+ !D && U.length > 0 && !O && /* @__PURE__ */ g("button", {
2935
+ type: "button",
2936
+ "aria-label": l ?? R.clearSelection,
2937
+ onMouseDown: (e) => e.preventDefault(),
2938
+ onClick: xe,
2939
+ className: x("absolute right-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 hover:text-gray-600 dark:text-gray-500 dark:hover:text-gray-300", "outline-hidden focus-visible:outline-2 focus-visible:outline-offset-2", A.primary.focusOutline),
2940
+ children: /* @__PURE__ */ g("span", {
2941
+ className: "i-mdi-close block w-4 h-4",
2942
+ "aria-hidden": !0
2943
+ })
2944
+ }),
2945
+ G && /* @__PURE__ */ _("div", {
2946
+ onMouseDown: (e) => {
2947
+ e.target !== re.current && e.preventDefault();
2948
+ },
2949
+ className: x("absolute z-10 mt-1 w-full text-sm shadow-lg", !D && [
2950
+ "border overflow-hidden",
2951
+ "bg-white dark:bg-gray-900",
2952
+ "border-gray-100 dark:border-gray-800",
2953
+ C[E]
2954
+ ]),
2955
+ children: [
2956
+ /* @__PURE__ */ g("input", {
2957
+ ref: re,
2958
+ type: "text",
2959
+ autoFocus: !0,
2960
+ autoComplete: "off",
2961
+ value: ie,
2962
+ onChange: Te,
2963
+ onKeyDown: Ae,
2964
+ placeholder: a ?? R.search,
2965
+ "aria-label": a ?? R.search,
2966
+ "aria-controls": B,
2967
+ "aria-activedescendant": q,
2968
+ "aria-describedby": m === void 0 ? void 0 : V,
2969
+ className: x("w-full", !D && [
2970
+ "px-3 py-2 border-b bg-transparent focus:outline-none",
2971
+ "text-gray-900 dark:text-gray-100 placeholder-gray-500 dark:placeholder-gray-400",
2972
+ "border-gray-100 dark:border-gray-800"
2973
+ ])
2974
+ }),
2975
+ m !== void 0 && /* @__PURE__ */ g("div", {
2976
+ id: V,
2977
+ className: x("px-3 py-1 text-xs", !D && ["border-b", "border-gray-100 dark:border-gray-800"], !D && "text-gray-500 dark:text-gray-400"),
2978
+ children: (T ?? R.maxSelectedHint)(m)
2979
+ }),
2980
+ /* @__PURE__ */ g("ul", {
2981
+ id: B,
2982
+ role: "listbox",
2983
+ "aria-multiselectable": !0,
2984
+ className: "max-h-60 overflow-auto py-1",
2985
+ children: K.map((e, t) => {
2986
+ let n = U.includes(e.value), r = Si(e.value, U, m, v);
2987
+ return /* @__PURE__ */ _("li", {
2988
+ id: `${B}-option-${t}`,
2989
+ role: "option",
2990
+ "aria-selected": n,
2991
+ "aria-disabled": r,
2992
+ onClick: () => ve(e.value),
2993
+ className: x("px-3 py-2 flex items-center gap-2 text-gray-900 dark:text-gray-100", r ? "opacity-50 cursor-not-allowed" : "cursor-pointer", t === se ? x("bg-blue-50 dark:bg-blue-900/40", "outline-2 -outline-offset-2 outline-blue-500 dark:outline-blue-400") : !r && "hover:bg-gray-50 dark:hover:bg-gray-800/60"),
2994
+ children: [/* @__PURE__ */ g("span", {
2995
+ "aria-hidden": !0,
2996
+ className: x("flex h-4 w-4 shrink-0 items-center justify-center", !D && [
2997
+ "border-2",
2998
+ S[E],
2999
+ n ? x("border-blue-600 dark:border-blue-500", "bg-blue-600 dark:bg-blue-500") : x("border-gray-300 dark:border-gray-600", "bg-white dark:bg-gray-800")
3000
+ ]),
3001
+ children: n && /* @__PURE__ */ g("svg", {
3002
+ className: "h-3 w-3 text-white",
3003
+ viewBox: "0 0 12 12",
3004
+ fill: "none",
3005
+ stroke: "currentColor",
3006
+ strokeWidth: "2.5",
3007
+ strokeLinecap: "round",
3008
+ strokeLinejoin: "round",
3009
+ children: /* @__PURE__ */ g("polyline", { points: "2 6 5 9 10 3" })
3010
+ })
3011
+ }), e.label]
3012
+ }, e.value);
3013
+ })
3014
+ }),
3015
+ /* @__PURE__ */ g("div", {
3016
+ role: "status",
3017
+ className: K.length === 0 ? "px-3 py-2 text-gray-500 dark:text-gray-400" : void 0,
3018
+ children: K.length === 0 ? s ?? R.noResults : ""
3019
+ }),
3020
+ m !== void 0 && /* @__PURE__ */ _("div", {
3021
+ className: x("flex items-center justify-between px-3 py-2", !D && ["border-t", "border-gray-100 dark:border-gray-800"]),
3022
+ children: [/* @__PURE__ */ g("span", {
3023
+ className: "text-xs text-gray-500 dark:text-gray-400",
3024
+ children: (w ?? R.selectedCount)(U.length)
3025
+ }), /* @__PURE__ */ g("button", {
3026
+ type: "button",
3027
+ disabled: U.length === 0,
3028
+ onClick: Se,
3029
+ className: "text-xs font-medium text-blue-600 hover:text-blue-700 disabled:opacity-50 disabled:cursor-not-allowed dark:text-blue-400 dark:hover:text-blue-300",
3030
+ children: u ?? R.clear
3031
+ })]
3032
+ })
3033
+ ]
3034
+ })
3035
+ ]
3036
+ })
3037
+ });
2230
3038
  }
2231
3039
  //#endregion
2232
3040
  //#region src/components/radio_options/radio_option_row.tsx
2233
- function Cr({ option: e, optionId: t, descriptionId: n, name: r, orientation: i, isSelected: a, isDisabled: o, isFirstOption: s, required: c, error: l, radius: u, unstyled: d, className: f, onSelect: p }) {
2234
- return /* @__PURE__ */ _("label", {
3041
+ function Di({ option: e, optionId: t, descriptionId: n, name: r, orientation: i, isSelected: a, isDisabled: o, isFirstOption: s, required: c, error: l, radius: u, unstyled: d, className: f, onSelect: p }) {
3042
+ let m = !!l;
3043
+ return /* @__PURE__ */ g(Te, {
3044
+ item: e,
2235
3045
  htmlFor: t,
2236
- className: x("flex cursor-pointer items-start gap-3 transition-colors duration-150", i === "horizontal" && "flex-1", T, l ? D : E, !d && [
2237
- S[u],
2238
- "border px-3 py-2.5",
2239
- a ? l ? x("border-red-500 dark:border-red-400", "bg-red-50 dark:bg-red-950/20") : "border-blue-500 bg-blue-50 dark:border-blue-500 dark:bg-blue-950/25" : l ? "border-red-300 bg-white dark:border-red-800/50 dark:bg-gray-800/50" : x("border-gray-200 dark:border-gray-700", "bg-gray-50 hover:border-gray-300 hover:bg-white dark:bg-gray-800/50 dark:hover:border-gray-600 dark:hover:bg-gray-800")
2240
- ], o && "cursor-not-allowed opacity-50", f),
2241
- children: [
2242
- /* @__PURE__ */ g("input", {
2243
- type: "radio",
2244
- id: t,
2245
- name: r,
2246
- value: e.value,
2247
- checked: a,
2248
- onChange: () => p(e.value),
2249
- disabled: o,
2250
- required: c && s,
2251
- "aria-invalid": l ? !0 : void 0,
2252
- "aria-describedby": e.description ? n : void 0,
2253
- className: "sr-only"
2254
- }),
2255
- /* @__PURE__ */ g("span", {
2256
- className: x("mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded-full border-2 transition-colors duration-150", a ? l ? me : "border-blue-600 dark:border-blue-500" : l ? "border-red-400 dark:border-red-600" : te),
2257
- "aria-hidden": !0,
2258
- children: a && /* @__PURE__ */ g("span", { className: x("h-2 w-2 rounded-full", l ? "bg-red-500 dark:bg-red-400" : "bg-blue-600 dark:bg-blue-500") })
2259
- }),
2260
- /* @__PURE__ */ _("span", {
2261
- className: "flex min-w-0 flex-col",
2262
- children: [/* @__PURE__ */ _("span", {
2263
- className: "flex items-center gap-1.5",
2264
- children: [e.icon && /* @__PURE__ */ g("span", {
2265
- className: x(e.icon, "h-4 w-4 shrink-0", a ? l ? "text-red-600 dark:text-red-400" : "text-blue-600 dark:text-blue-400" : "text-gray-500 dark:text-gray-400"),
2266
- "aria-hidden": !0
2267
- }), /* @__PURE__ */ g("span", {
2268
- className: x("select-none text-sm font-medium", a ? l ? "text-red-700 dark:text-red-300" : "text-blue-700 dark:text-blue-300" : "text-gray-700 dark:text-gray-300"),
2269
- children: e.label
2270
- })]
2271
- }), e.description && /* @__PURE__ */ g("span", {
2272
- id: n,
2273
- className: x("text-xs text-gray-500 dark:text-gray-400", "mt-0.5"),
2274
- children: e.description
2275
- })]
2276
- })
2277
- ]
3046
+ descriptionId: n,
3047
+ orientation: i,
3048
+ isSelected: a,
3049
+ isDisabled: o,
3050
+ isError: m,
3051
+ radius: u,
3052
+ unstyled: d,
3053
+ className: f,
3054
+ control: /* @__PURE__ */ g("input", {
3055
+ type: "radio",
3056
+ id: t,
3057
+ name: r,
3058
+ value: e.value,
3059
+ checked: a,
3060
+ onChange: () => p(e.value),
3061
+ disabled: o,
3062
+ required: c && s,
3063
+ "aria-invalid": l ? !0 : void 0,
3064
+ "aria-describedby": e.description ? n : void 0,
3065
+ className: "sr-only"
3066
+ }),
3067
+ indicator: /* @__PURE__ */ g("span", {
3068
+ className: x("mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded-full border-2 transition-colors duration-150", ye({
3069
+ isSelected: a,
3070
+ isError: m
3071
+ })),
3072
+ "aria-hidden": !0,
3073
+ children: a && /* @__PURE__ */ g("span", { className: x("h-2 w-2 rounded-full", l ? "bg-red-500 dark:bg-red-400" : "bg-blue-600 dark:bg-blue-500") })
3074
+ })
2278
3075
  });
2279
3076
  }
2280
3077
  //#endregion
2281
3078
  //#region src/components/radio_options/radio_options.tsx
2282
- function wr({ options: e, orientation: t = "vertical", value: n, defaultValue: r, onChange: i, name: a, label: o, error: s, required: c, disabled: l, radius: u = "lg", unstyled: d = !1, className: f, wrapperClassName: p, id: m, ...h }) {
2283
- let { fieldId: v, errorId: y } = B(m), b = a ?? v, [S, C] = _e(n, r ?? ""), w = e.map((e) => typeof e == "string" ? {
3079
+ function Oi({ options: e, orientation: t = "vertical", value: n, defaultValue: r, onChange: i, name: a, label: o, error: s, required: c, disabled: l, radius: u = "lg", unstyled: d = !1, className: f, wrapperClassName: p, id: m, "aria-describedby": h, ...v }) {
3080
+ let { fieldId: y, errorId: b } = Y(m), S = a ?? y, [C, w] = be(n, r ?? ""), T = e.map((e) => typeof e == "string" ? {
2284
3081
  value: e,
2285
3082
  label: e
2286
- } : e), T = (e) => {
2287
- C(e), i?.(e);
3083
+ } : e), E = (e) => {
3084
+ w(e), i?.(e);
2288
3085
  };
2289
3086
  return /* @__PURE__ */ _("fieldset", {
2290
3087
  className: x("m-0 border-0 p-0", p),
2291
3088
  disabled: l,
2292
- "aria-describedby": s ? y : void 0,
2293
- "aria-required": c,
2294
- ...h,
3089
+ "aria-describedby": q(h, s && b),
3090
+ ...v,
2295
3091
  children: [
2296
3092
  o && /* @__PURE__ */ _("legend", {
2297
3093
  className: x("text-sm font-medium text-gray-700 dark:text-gray-300", "mb-2"),
@@ -2302,13 +3098,13 @@ function wr({ options: e, orientation: t = "vertical", value: n, defaultValue: r
2302
3098
  }),
2303
3099
  /* @__PURE__ */ g("div", {
2304
3100
  className: x(t === "horizontal" ? "flex flex-row gap-2" : "flex flex-col gap-2"),
2305
- children: w.map((e, n) => /* @__PURE__ */ g(Cr, {
3101
+ children: T.map((e, n) => /* @__PURE__ */ g(Di, {
2306
3102
  option: e,
2307
- optionId: `${v}-${n}`,
2308
- descriptionId: `${v}-${n}-desc`,
2309
- name: b,
3103
+ optionId: `${y}-${n}`,
3104
+ descriptionId: `${y}-${n}-desc`,
3105
+ name: S,
2310
3106
  orientation: t,
2311
- isSelected: S === e.value,
3107
+ isSelected: C === e.value,
2312
3108
  isDisabled: l === !0 || e.disabled === !0,
2313
3109
  isFirstOption: n === 0,
2314
3110
  required: c,
@@ -2316,11 +3112,11 @@ function wr({ options: e, orientation: t = "vertical", value: n, defaultValue: r
2316
3112
  radius: u,
2317
3113
  unstyled: d,
2318
3114
  className: f,
2319
- onSelect: T
3115
+ onSelect: E
2320
3116
  }, e.value))
2321
3117
  }),
2322
- /* @__PURE__ */ g(he, {
2323
- id: y,
3118
+ /* @__PURE__ */ g(J, {
3119
+ id: b,
2324
3120
  error: s,
2325
3121
  className: "mt-2"
2326
3122
  })
@@ -2329,31 +3125,33 @@ function wr({ options: e, orientation: t = "vertical", value: n, defaultValue: r
2329
3125
  }
2330
3126
  //#endregion
2331
3127
  //#region src/components/select/select.tsx
2332
- function Tr({ options: e, label: t, error: n, placeholder: r, radius: i = "md", unstyled: a = !1, className: o, wrapperClassName: s, value: c, defaultValue: l, onChange: u, id: d, ...f }) {
2333
- let { fieldId: p, errorId: m } = B(d);
2334
- return /* @__PURE__ */ g(xe, {
2335
- fieldId: p,
2336
- errorId: m,
3128
+ function ki({ options: e, label: t, description: n, error: r, placeholder: i, radius: a = "md", unstyled: o = !1, className: s, wrapperClassName: c, value: l, defaultValue: u, onChange: d, id: f, "aria-describedby": p, ...m }) {
3129
+ let { fieldId: h, errorId: v, descriptionId: y } = Y(f);
3130
+ return /* @__PURE__ */ g(je, {
3131
+ fieldId: h,
3132
+ errorId: v,
3133
+ descriptionId: y,
2337
3134
  label: t,
2338
- error: n,
2339
- required: f.required,
2340
- wrapperClassName: s,
3135
+ description: n,
3136
+ error: r,
3137
+ required: m.required,
3138
+ wrapperClassName: c,
2341
3139
  children: /* @__PURE__ */ _("select", {
2342
- id: p,
2343
- className: x("w-full disabled:opacity-50 disabled:cursor-not-allowed", !a && [
2344
- de,
2345
- S[i],
3140
+ id: h,
3141
+ className: x("w-full disabled:opacity-50 disabled:cursor-not-allowed", !o && [
3142
+ le,
3143
+ S[a],
2346
3144
  "pl-3 pr-8 py-2 text-sm appearance-none bg-[length:1rem_1rem] bg-[position:right_0.5rem_center] bg-no-repeat",
2347
3145
  "bg-[url(\"data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 fill=%27none%27 viewBox=%270 0 20 20%27%3e%3cpath stroke=%27%236b7280%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27 stroke-width=%271.5%27 d=%27M6 8l4 4 4-4%27/%3e%3c/svg%3e\")]"
2348
- ], !a && n && x("border-red-500 dark:border-red-400", "focus:ring-red-500"), o),
2349
- ...c === void 0 ? { defaultValue: l } : { value: c },
2350
- onChange: u,
2351
- "aria-invalid": !!n,
2352
- "aria-describedby": n ? m : void 0,
2353
- ...f,
2354
- children: [r !== void 0 && /* @__PURE__ */ g("option", {
3146
+ ], !o && r && x("border-red-500 dark:border-red-400", "focus:ring-red-500"), s),
3147
+ ...l === void 0 ? { defaultValue: u } : { value: l },
3148
+ onChange: d,
3149
+ "aria-invalid": !!r,
3150
+ "aria-describedby": q(p, !!n && y, r && v),
3151
+ ...m,
3152
+ children: [i !== void 0 && /* @__PURE__ */ g("option", {
2355
3153
  value: "",
2356
- children: r
3154
+ children: i
2357
3155
  }), e.map((e) => /* @__PURE__ */ g("option", {
2358
3156
  value: e.value,
2359
3157
  children: e.label
@@ -2363,54 +3161,54 @@ function Tr({ options: e, label: t, error: n, placeholder: r, radius: i = "md",
2363
3161
  }
2364
3162
  //#endregion
2365
3163
  //#region src/components/switch/switch.tsx
2366
- function Er({ label: e, description: t, error: n, unstyled: r = !1, className: i, wrapperClassName: a, checked: o, defaultChecked: s = !1, onChange: c, id: l, ...u }) {
2367
- let { fieldId: d, errorId: f, descriptionId: p } = B(l), [m, v] = _e(o, s), y = [t && p, n && f].filter(Boolean).join(" ") || void 0;
3164
+ function Ai({ label: e, description: t, error: n, unstyled: r = !1, fullWidth: i = !1, className: a, wrapperClassName: o, checked: s, defaultChecked: c = !1, onChange: l, id: u, "aria-describedby": d, ...f }) {
3165
+ let { fieldId: p, errorId: m, descriptionId: v } = Y(u), [y, b] = be(s, c), S = q(d, !!t && v, n && m);
2368
3166
  return /* @__PURE__ */ _("div", {
2369
- className: x("w-full", a),
3167
+ className: x(i ? "w-full" : "w-fit", o),
2370
3168
  children: [
2371
3169
  /* @__PURE__ */ _("label", {
2372
- htmlFor: d,
2373
- className: x("flex items-center gap-3 cursor-pointer", u.disabled && "cursor-not-allowed opacity-50"),
3170
+ htmlFor: p,
3171
+ className: x("flex items-center gap-3 cursor-pointer", f.disabled && "cursor-not-allowed opacity-50"),
2374
3172
  children: [/* @__PURE__ */ _("span", {
2375
- className: x("relative inline-flex w-11 shrink-0", "transition-colors duration-200 ease-in-out", T, E, !r && [
3173
+ className: x("relative inline-flex w-11 shrink-0", "transition-colors duration-200 ease-in-out", E, D, !r && [
2376
3174
  "rounded-full border-2 border-transparent",
2377
- m ? "bg-blue-600 dark:bg-blue-500" : "bg-gray-200 dark:bg-gray-600",
3175
+ y ? "bg-blue-600 dark:bg-blue-500" : "bg-gray-200 dark:bg-gray-600",
2378
3176
  n && "ring-2 ring-red-500 dark:ring-red-400"
2379
- ], i),
3177
+ ], a),
2380
3178
  children: [/* @__PURE__ */ g("input", {
2381
3179
  type: "checkbox",
2382
3180
  role: "switch",
2383
- id: d,
3181
+ id: p,
2384
3182
  className: "sr-only",
2385
- checked: m,
3183
+ checked: y,
2386
3184
  onChange: (e) => {
2387
- v(e.target.checked), c?.(e);
3185
+ b(e.target.checked), l?.(e);
2388
3186
  },
2389
3187
  "aria-invalid": !!n,
2390
- "aria-describedby": y,
2391
- ...u
3188
+ "aria-describedby": S,
3189
+ ...f
2392
3190
  }), /* @__PURE__ */ g("span", {
2393
- className: x("pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0", "transition duration-200 ease-in-out", m ? "translate-x-5.25" : "translate-x-0"),
3191
+ className: x("pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0", "transition duration-200 ease-in-out", y ? "translate-x-5.25" : "translate-x-0"),
2394
3192
  "aria-hidden": !0
2395
3193
  })]
2396
3194
  }), e && /* @__PURE__ */ g(h, { children: typeof e == "string" ? /* @__PURE__ */ _("span", {
2397
3195
  className: x("text-sm font-medium text-gray-700 dark:text-gray-300", "select-none"),
2398
- children: [e, u.required && /* @__PURE__ */ g("span", {
3196
+ children: [e, f.required && /* @__PURE__ */ g("span", {
2399
3197
  className: "text-red-500 dark:text-red-400 ml-1",
2400
3198
  children: "*"
2401
3199
  })]
2402
- }) : /* @__PURE__ */ _(h, { children: [e, u.required && /* @__PURE__ */ g("span", {
3200
+ }) : /* @__PURE__ */ _(h, { children: [e, f.required && /* @__PURE__ */ g("span", {
2403
3201
  className: "text-red-500 dark:text-red-400 ml-1",
2404
3202
  children: "*"
2405
3203
  })] }) })]
2406
3204
  }),
2407
- /* @__PURE__ */ g(ge, {
2408
- id: p,
3205
+ /* @__PURE__ */ g(_e, {
3206
+ id: v,
2409
3207
  description: t,
2410
3208
  className: "mt-1 ml-14"
2411
3209
  }),
2412
- /* @__PURE__ */ g(he, {
2413
- id: f,
3210
+ /* @__PURE__ */ g(J, {
3211
+ id: m,
2414
3212
  error: n,
2415
3213
  className: "mt-1 ml-14"
2416
3214
  })
@@ -2418,134 +3216,314 @@ function Er({ label: e, description: t, error: n, unstyled: r = !1, className: i
2418
3216
  });
2419
3217
  }
2420
3218
  //#endregion
3219
+ //#region src/components/tabs/tabs_styles.ts
3220
+ var ji = {
3221
+ line: {
3222
+ list: `gap-1 border-b ${ne}`,
3223
+ tab: "-mb-px border-b-2",
3224
+ activeTab: "border-transparent text-gray-900 dark:text-gray-100",
3225
+ idleTab: "border-transparent text-gray-500 dark:text-gray-400",
3226
+ idleHover: "hover:text-gray-900 hover:border-gray-300 dark:hover:text-gray-100 dark:hover:border-gray-600",
3227
+ indicator: "absolute inset-x-0 -bottom-0.5 h-0.5 bg-blue-600 dark:bg-blue-400"
3228
+ },
3229
+ segmented: {
3230
+ list: "gap-1 p-1 bg-gray-100 dark:bg-gray-800/50",
3231
+ tab: "",
3232
+ activeTab: "text-gray-900 dark:text-gray-100",
3233
+ idleTab: "text-gray-600 dark:text-gray-400",
3234
+ idleHover: "hover:text-gray-900 dark:hover:text-gray-100",
3235
+ indicator: `absolute inset-0 ${V} border border-gray-200 dark:border-gray-700`
3236
+ }
3237
+ }, Mi = {
3238
+ xs: "px-2 py-1 text-xs",
3239
+ sm: "px-3 py-1.5 text-sm",
3240
+ md: "px-4 py-2.5 text-sm",
3241
+ lg: "px-5 py-3 text-base"
3242
+ }, Ni = {
3243
+ xs: "w-3.5 h-3.5",
3244
+ sm: "w-4 h-4",
3245
+ md: "w-4 h-4",
3246
+ lg: "w-5 h-5"
3247
+ }, Pi = x(w, A.primary.focusOutline);
3248
+ function Fi(e) {
3249
+ let { variant: t, radius: n, unstyled: r, isFullWidth: i, className: a } = e;
3250
+ return x("flex items-center", i && "w-full", !r && ji[t].list, !r && t === "segmented" && S[n], a);
3251
+ }
3252
+ function Ii(e) {
3253
+ let { variant: t, size: n, radius: r, unstyled: i, isActive: a, isDisabled: o, isFullWidth: s, className: c } = e, l = ji[t];
3254
+ return x("relative flex items-center gap-2 whitespace-nowrap", s && "flex-1 justify-center", o ? "opacity-50 cursor-not-allowed" : "cursor-pointer", !i && [
3255
+ "font-medium transition-colors duration-200",
3256
+ Mi[n],
3257
+ l.tab,
3258
+ a ? l.activeTab : [l.idleTab, !o && l.idleHover],
3259
+ t === "segmented" && S[r],
3260
+ Pi
3261
+ ], c);
3262
+ }
3263
+ function Li(e) {
3264
+ let { variant: t, radius: n } = e;
3265
+ return x("tabs-indicator pointer-events-none", ji[t].indicator, t === "segmented" && S[n]);
3266
+ }
3267
+ //#endregion
3268
+ //#region src/components/tabs/tab_button.tsx
3269
+ function Ri({ item: e, isActive: t, isTabStop: n, isFullWidth: r, variant: i, size: a, radius: o, unstyled: s, tabId: c, panelId: l, onSelect: u, onKeyDown: d, ref: f, indicatorRef: p }) {
3270
+ let m = !!e.disabled;
3271
+ return /* @__PURE__ */ _("button", {
3272
+ ref: f,
3273
+ id: c,
3274
+ role: "tab",
3275
+ type: "button",
3276
+ "aria-selected": t,
3277
+ "aria-disabled": e.disabled,
3278
+ "aria-controls": t ? l : void 0,
3279
+ tabIndex: n ? 0 : -1,
3280
+ disabled: e.disabled,
3281
+ onClick: u,
3282
+ onKeyDown: d,
3283
+ className: Ii({
3284
+ variant: i,
3285
+ size: a,
3286
+ radius: o,
3287
+ unstyled: s,
3288
+ isActive: t,
3289
+ isDisabled: m,
3290
+ isFullWidth: r
3291
+ }),
3292
+ children: [
3293
+ t && !s && /* @__PURE__ */ g("span", {
3294
+ ref: p,
3295
+ "aria-hidden": "true",
3296
+ className: Li({
3297
+ variant: i,
3298
+ radius: o
3299
+ })
3300
+ }),
3301
+ e.icon && /* @__PURE__ */ g("span", {
3302
+ "aria-hidden": "true",
3303
+ className: x("relative shrink-0", Ni[a], e.icon)
3304
+ }),
3305
+ /* @__PURE__ */ g("span", {
3306
+ className: "relative",
3307
+ children: e.title
3308
+ })
3309
+ ]
3310
+ });
3311
+ }
3312
+ //#endregion
3313
+ //#region src/components/tabs/use_tab_indicator_transition.ts
3314
+ var zi = 200, Bi = "ease-out", Vi = "(prefers-reduced-motion: reduce)";
3315
+ function Hi() {
3316
+ return typeof window > "u" || typeof window.matchMedia != "function" ? !1 : window.matchMedia(Vi).matches;
3317
+ }
3318
+ function Ui(e, t, n) {
3319
+ e.animate([{
3320
+ transform: `translateX(${t.left - n.left}px)`,
3321
+ width: `${t.width}px`
3322
+ }, {
3323
+ transform: "none",
3324
+ width: `${n.width}px`
3325
+ }], {
3326
+ duration: zi,
3327
+ easing: Bi
3328
+ });
3329
+ }
3330
+ function Wi(e, t, n) {
3331
+ return !e || !t || !n ? !1 : !Hi();
3332
+ }
3333
+ function Gi(e) {
3334
+ let { activeIndex: t, indicatorRef: n, isAnimated: r } = e, i = f(null);
3335
+ u(() => {
3336
+ let e = n.current;
3337
+ if (!e) {
3338
+ i.current = null;
3339
+ return;
3340
+ }
3341
+ let t = e.getBoundingClientRect(), a = typeof e.animate == "function";
3342
+ Wi(i.current, r, a) && Ui(e, i.current, t), i.current = t;
3343
+ }, [
3344
+ t,
3345
+ n,
3346
+ r
3347
+ ]);
3348
+ }
3349
+ //#endregion
3350
+ //#region src/components/tabs/use_tabs_keyboard_navigation.ts
3351
+ var Ki = {
3352
+ ArrowRight: (e, t) => (e + 1) % t,
3353
+ ArrowLeft: (e, t) => (e - 1 + t) % t,
3354
+ Home: () => 0,
3355
+ End: (e, t) => t - 1
3356
+ };
3357
+ function qi(e) {
3358
+ return e.flatMap((e, t) => e.disabled ? [] : [t]);
3359
+ }
3360
+ function Ji(e, t) {
3361
+ let n = e[t];
3362
+ return n && !n.disabled ? t : qi(e)[0] ?? -1;
3363
+ }
3364
+ function Yi(e) {
3365
+ let { items: t, activeIndex: n, onNavigate: r } = e;
3366
+ return (e) => {
3367
+ let i = Ki[e.key];
3368
+ if (!i) return;
3369
+ let a = qi(t);
3370
+ if (a.length === 0) return;
3371
+ e.preventDefault();
3372
+ let o = i(a.indexOf(n), a.length);
3373
+ r(a[o]);
3374
+ };
3375
+ }
3376
+ //#endregion
2421
3377
  //#region src/components/tabs/tabs.tsx
2422
- function Dr({ items: e, value: t, defaultIndex: n = 0, radius: r = "md", unstyled: i = !1, className: a, tabListClassName: o, panelClassName: s, onChange: c }) {
2423
- let [u, d] = _e(t, n), p = l(), m = f([]), h = (t) => {
2424
- e[t]?.disabled || (d(t), c?.(t));
2425
- }, v = (e) => {
2426
- m.current[e]?.focus(), h(e);
2427
- }, y = (t) => {
2428
- let n = e.map((e, t) => t).filter((t) => !e[t]?.disabled);
2429
- if (n.length === 0) return;
2430
- let r = n.indexOf(u);
2431
- t.key === "ArrowRight" ? (t.preventDefault(), v(n[(r + 1) % n.length])) : t.key === "ArrowLeft" ? (t.preventDefault(), v(n[(r - 1 + n.length) % n.length])) : t.key === "Home" ? (t.preventDefault(), v(n[0])) : t.key === "End" && (t.preventDefault(), v(n[n.length - 1]));
2432
- }, b = e[u];
2433
- return /* @__PURE__ */ _("div", {
2434
- className: x("w-full", a),
3378
+ function Xi({ items: e, value: t, defaultIndex: n = 0, variant: r = "line", size: i = "md", radius: a = "md", fullWidth: o = !1, unstyled: s = !1, animated: c = !0, className: u, tabListClassName: d, panelClassName: p, onChange: m }) {
3379
+ let [h, v] = be(t, n), y = l(), b = f([]), S = f(null), C = (t) => {
3380
+ e[t]?.disabled || (v(t), m?.(t));
3381
+ }, w = (e) => {
3382
+ b.current[e]?.focus(), C(e);
3383
+ }, T = Ji(e, h), E = Yi({
3384
+ items: e,
3385
+ activeIndex: T,
3386
+ onNavigate: w
3387
+ }), D = e[h];
3388
+ return Gi({
3389
+ activeIndex: h,
3390
+ indicatorRef: S,
3391
+ isAnimated: c
3392
+ }), /* @__PURE__ */ _("div", {
3393
+ className: x("w-full", u),
2435
3394
  children: [/* @__PURE__ */ g("div", {
2436
3395
  role: "tablist",
2437
- className: x("flex gap-1 p-1", !i && [
2438
- "bg-gray-100 dark:bg-gray-800/50 border",
2439
- "border-gray-200 dark:border-gray-700",
2440
- S[r]
2441
- ], o),
2442
- children: e.map((e, t) => /* @__PURE__ */ _("button", {
3396
+ className: Fi({
3397
+ variant: r,
3398
+ radius: a,
3399
+ unstyled: s,
3400
+ isFullWidth: o,
3401
+ className: d
3402
+ }),
3403
+ children: e.map((e, t) => /* @__PURE__ */ g(Ri, {
2443
3404
  ref: (e) => {
2444
- m.current[t] = e;
3405
+ b.current[t] = e;
2445
3406
  },
2446
- id: `${p}-tab-${t}`,
2447
- role: "tab",
2448
- type: "button",
2449
- "aria-selected": u === t,
2450
- "aria-disabled": e.disabled,
2451
- "aria-controls": `${p}-panel-${t}`,
2452
- tabIndex: u === t ? 0 : -1,
2453
- disabled: e.disabled,
2454
- onClick: () => h(t),
2455
- onKeyDown: y,
2456
- className: x("flex items-center gap-2 px-4 py-2.5 text-sm font-medium", e.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer", !i && [S[r], u === t ? x("bg-white dark:bg-gray-700 text-blue-600 dark:text-blue-400 shadow-sm border", "border-gray-200 dark:border-gray-700") : x("text-gray-600 dark:text-gray-400 border border-transparent", !e.disabled && "hover:text-gray-900 dark:hover:text-gray-200 hover:bg-gray-200/50 dark:hover:bg-gray-700/50")]),
2457
- children: [e.icon && /* @__PURE__ */ g("span", { className: x("w-4 h-4 block shrink-0", e.icon, !i && (u === t ? "text-blue-600 dark:text-blue-400" : "text-gray-500 dark:text-gray-400")) }), e.title]
3407
+ indicatorRef: S,
3408
+ item: e,
3409
+ isActive: h === t,
3410
+ isTabStop: T === t,
3411
+ isFullWidth: o,
3412
+ variant: r,
3413
+ size: i,
3414
+ radius: a,
3415
+ unstyled: s,
3416
+ tabId: `${y}-tab-${t}`,
3417
+ panelId: `${y}-panel-${t}`,
3418
+ onSelect: () => C(t),
3419
+ onKeyDown: E
2458
3420
  }, e.title))
2459
3421
  }), /* @__PURE__ */ g("div", {
2460
3422
  role: "tabpanel",
2461
- id: `${p}-panel-${u}`,
2462
- "aria-labelledby": `${p}-tab-${u}`,
3423
+ id: `${y}-panel-${h}`,
3424
+ "aria-labelledby": `${y}-tab-${h}`,
2463
3425
  tabIndex: 0,
2464
- className: x("mt-3 overflow-hidden focus:outline-none", !i && [
2465
- "border bg-white dark:bg-gray-800/50 p-4",
2466
- "border-gray-200 dark:border-gray-700",
2467
- S[r]
2468
- ], s),
3426
+ className: x(!s && [
3427
+ "mt-4",
3428
+ "outline-hidden focus-visible:outline-2 focus-visible:outline-offset-2",
3429
+ A.primary.focusOutline
3430
+ ], p),
2469
3431
  children: /* @__PURE__ */ g("div", {
2470
- className: "tabs-panel-inner",
2471
- children: b?.content
2472
- }, u)
3432
+ className: x(c && !s && "tabs-panel-inner"),
3433
+ children: D?.content
3434
+ }, h)
2473
3435
  })]
2474
3436
  });
2475
3437
  }
2476
3438
  //#endregion
2477
3439
  //#region src/components/textarea/textarea.tsx
2478
- function Or({ label: e, error: t, showCharCount: n = !1, minLength: r, maxLength: i, radius: a = "md", unstyled: o = !1, className: s, wrapperClassName: c, value: l, defaultValue: u, onChange: d, id: f, ...p }) {
2479
- let { fieldId: m, errorId: h } = B(f), { length: v, trackLength: y } = jn(l, u), b = n && (r !== void 0 || i !== void 0), C = (e) => {
2480
- y(e.target.value), d?.(e);
3440
+ function Zi({ label: e, description: t, error: n, showCharCount: r = !1, minLength: i, maxLength: a, radius: o = "md", unstyled: s = !1, className: c, wrapperClassName: l, value: u, defaultValue: d, onChange: f, id: p, "aria-describedby": m, ...h }) {
3441
+ let { fieldId: v, errorId: y, descriptionId: b, characterCountId: C } = Y(p), { length: w, trackLength: T } = _r(u, d), E = r && (i !== void 0 || a !== void 0), D = (e) => {
3442
+ T(e.target.value), f?.(e);
2481
3443
  };
2482
- return /* @__PURE__ */ _(xe, {
2483
- fieldId: m,
2484
- errorId: h,
3444
+ return /* @__PURE__ */ _(je, {
3445
+ fieldId: v,
3446
+ errorId: y,
3447
+ descriptionId: b,
2485
3448
  label: e,
2486
- error: t,
2487
- required: p.required,
2488
- wrapperClassName: c,
3449
+ description: t,
3450
+ error: n,
3451
+ required: h.required,
3452
+ wrapperClassName: l,
2489
3453
  children: [/* @__PURE__ */ g("textarea", {
2490
- id: m,
2491
- className: x("w-full min-h-[80px] resize-y disabled:opacity-50 disabled:cursor-not-allowed", !o && [
2492
- de,
2493
- S[a],
3454
+ id: v,
3455
+ className: x("w-full min-h-[80px] resize-y disabled:opacity-50 disabled:cursor-not-allowed", !s && [
3456
+ le,
3457
+ S[o],
2494
3458
  "px-3 py-2 text-sm"
2495
- ], !o && t && x("border-red-500 dark:border-red-400", "focus:ring-red-500"), s),
2496
- ...l === void 0 ? { defaultValue: u } : { value: l },
2497
- minLength: r,
2498
- maxLength: i,
2499
- onChange: C,
2500
- "aria-invalid": !!t,
2501
- "aria-describedby": t ? h : void 0,
2502
- ...p
2503
- }), b && /* @__PURE__ */ g(ue, {
2504
- current: v,
2505
- min: r,
2506
- max: i,
2507
- showMin: r !== void 0,
2508
- showMax: i !== void 0
3459
+ ], !s && n && x("border-red-500 dark:border-red-400", "focus:ring-red-500"), c),
3460
+ ...u === void 0 ? { defaultValue: d } : { value: u },
3461
+ minLength: i,
3462
+ maxLength: a,
3463
+ onChange: D,
3464
+ "aria-invalid": !!n,
3465
+ "aria-describedby": q(m, !!t && b, n && y, E && C),
3466
+ ...h
3467
+ }), E && /* @__PURE__ */ g(K, {
3468
+ id: C,
3469
+ current: w,
3470
+ min: i,
3471
+ max: a,
3472
+ showMin: i !== void 0,
3473
+ showMax: a !== void 0
2509
3474
  })]
2510
3475
  });
2511
3476
  }
2512
3477
  //#endregion
3478
+ //#region src/lib/is_webkit_gtk.ts
3479
+ var Qi = "AppleWebKit", $i = ["Linux", "X11"], ea = [
3480
+ "Chrome",
3481
+ "Chromium",
3482
+ "Edg",
3483
+ "Android",
3484
+ "CriOS",
3485
+ "FxiOS"
3486
+ ];
3487
+ function ta(e) {
3488
+ return !e.includes(Qi) || !$i.some((t) => e.includes(t)) ? !1 : !ea.some((t) => e.includes(t));
3489
+ }
3490
+ //#endregion
2513
3491
  //#region src/stores/theme_store/theme_store.ts
2514
- var kr = "theme";
2515
- function Ar(e) {
3492
+ var na = "theme";
3493
+ function ra(e) {
2516
3494
  return e === "light" || e === "dark" || e === "system";
2517
3495
  }
2518
- function jr() {
3496
+ function ia() {
2519
3497
  return globalThis.window !== void 0 && globalThis.document !== void 0;
2520
3498
  }
2521
- function Mr(e) {
3499
+ function aa(e) {
2522
3500
  let t = window.matchMedia("(prefers-color-scheme: dark)").matches, n = e === "dark" || e === "system" && t;
2523
3501
  document.documentElement.classList.toggle("dark", n);
2524
3502
  }
2525
- function Nr() {
2526
- if (!jr()) return "system";
2527
- let e = globalThis.localStorage.getItem(kr);
2528
- return Ar(e) ? e : "system";
3503
+ function oa() {
3504
+ if (!ia()) return "system";
3505
+ let e = globalThis.localStorage.getItem(na);
3506
+ return ra(e) ? e : "system";
2529
3507
  }
2530
- var Pr = Nr();
2531
- jr() && Mr(Pr);
2532
- var Fr = ur((e) => ({
2533
- theme: Pr,
3508
+ var sa = oa();
3509
+ ia() && aa(sa);
3510
+ var ca = li((e) => ({
3511
+ theme: sa,
2534
3512
  setTheme: (t) => {
2535
- Mr(t), jr() && globalThis.localStorage.setItem(kr, t), e({ theme: t });
3513
+ aa(t), ia() && globalThis.localStorage.setItem(na, t), e({ theme: t });
2536
3514
  }
2537
3515
  }));
2538
- jr() && (globalThis.addEventListener("storage", (e) => {
2539
- if (e.key !== kr) return;
2540
- let t = Ar(e.newValue) ? e.newValue : "system";
2541
- Mr(t), Fr.setState({ theme: t });
3516
+ ia() && (globalThis.addEventListener("storage", (e) => {
3517
+ if (e.key !== na) return;
3518
+ let t = ra(e.newValue) ? e.newValue : "system";
3519
+ aa(t), ca.setState({ theme: t });
2542
3520
  }), globalThis.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", () => {
2543
- Fr.getState().theme === "system" && Mr("system");
3521
+ ca.getState().theme === "system" && aa("system");
2544
3522
  }));
2545
3523
  //#endregion
2546
3524
  //#region src/lib/theme_transition.ts
2547
- var Ir = 750, Lr = "ease-in-out";
2548
- async function Rr({ theme: e, element: t, transitionDuration: n = Ir, transitionEasing: r = Lr, applyThemeCallback: i }) {
3525
+ var la = 750, ua = "ease-in-out";
3526
+ async function da({ theme: e, element: t, transitionDuration: n = la, transitionEasing: r = ua, applyThemeCallback: i }) {
2549
3527
  if (!document.startViewTransition || globalThis.matchMedia("(prefers-reduced-motion: reduce)").matches) {
2550
3528
  i(e);
2551
3529
  return;
@@ -2559,129 +3537,192 @@ async function Rr({ theme: e, element: t, transitionDuration: n = Ir, transition
2559
3537
  pseudoElement: "::view-transition-new(root)"
2560
3538
  });
2561
3539
  }
2562
- function zr(e) {
3540
+ function fa(e) {
2563
3541
  return e === "light" ? "dark" : e === "dark" ? "system" : "light";
2564
3542
  }
2565
3543
  //#endregion
2566
3544
  //#region src/components/theme_toggle/theme_toggle.tsx
2567
- var Br = {
3545
+ var pa = {
2568
3546
  light: "i-tabler-sun text-yellow-500",
2569
3547
  dark: "i-tabler-moon-stars text-gray-700 dark:text-yellow-500",
2570
3548
  system: "i-tabler-device-desktop text-blue-500"
2571
- }, Vr = "i-tabler-device-desktop text-gray-400";
2572
- function Hr(e) {
2573
- return `Current theme: ${e}`;
2574
- }
2575
- function Ur({ isTransitionEnabled: e = !0, transitionDuration: t, transitionEasing: n, size: r = "md", radius: i, variant: a, getAriaLabel: s = Hr }) {
2576
- let c = Fr((e) => e.theme), l = Fr((e) => e.setTheme), u = ye(), d = f(null), p = o(async () => {
2577
- let r = zr(c), i = d.current;
2578
- i && e ? await Rr({
3549
+ }, ma = "i-tabler-device-desktop text-gray-400";
3550
+ function ha({ isTransitionEnabled: e, transitionDuration: t, transitionEasing: n, size: r = "md", radius: i, variant: a, getAriaLabel: s, tooltip: c }) {
3551
+ let l = ca((e) => e.theme), u = ca((e) => e.setTheme), d = we(), p = ke(), m = f(null), h = o(async () => {
3552
+ let r = fa(l), i = m.current, a = e ?? !ta(navigator.userAgent);
3553
+ i && a ? await da({
2579
3554
  theme: r,
2580
3555
  element: i,
2581
3556
  transitionDuration: t,
2582
3557
  transitionEasing: n,
2583
- applyThemeCallback: l
2584
- }) : l(r);
3558
+ applyThemeCallback: u
3559
+ }) : u(r);
2585
3560
  }, [
2586
- c,
3561
+ l,
2587
3562
  e,
2588
3563
  t,
2589
3564
  n,
2590
- l
2591
- ]), m = u ? Br[c] : Vr;
2592
- return /* @__PURE__ */ g(kn, {
2593
- ref: d,
2594
- icon: m,
2595
- "aria-label": s(c),
3565
+ u
3566
+ ]), _ = p ? pa[l] : ma;
3567
+ return /* @__PURE__ */ g(hr, {
3568
+ ref: m,
3569
+ icon: _,
3570
+ "aria-label": (s ?? d.currentTheme)(l),
2596
3571
  size: r,
2597
3572
  radius: i,
2598
3573
  variant: a,
3574
+ tooltip: c,
2599
3575
  onClick: () => {
2600
- p();
3576
+ h();
2601
3577
  }
2602
3578
  });
2603
3579
  }
2604
3580
  //#endregion
2605
- //#region src/components/tooltip/tooltip.tsx
2606
- var Wr = 8, Gr = 8, Kr = {
2607
- top: "data-[state=closed]:translate-y-1",
2608
- bottom: "data-[state=closed]:-translate-y-1",
2609
- left: "data-[state=closed]:translate-x-1",
2610
- right: "data-[state=closed]:-translate-x-1"
2611
- }, qr = {
2612
- top: "bottom",
2613
- bottom: "top",
2614
- left: "right",
2615
- right: "left"
3581
+ //#region src/components/toolbar/toolbar_items.ts
3582
+ var ga = [
3583
+ "a[href]",
3584
+ "button",
3585
+ "input:not([type=\"hidden\"])",
3586
+ "select",
3587
+ "textarea",
3588
+ "summary",
3589
+ "[contenteditable]:not([contenteditable=\"false\"])",
3590
+ "[tabindex]"
3591
+ ].join(", "), _a = [
3592
+ "textarea",
3593
+ "[contenteditable]:not([contenteditable=\"false\"])",
3594
+ `input:not(${[
3595
+ "button",
3596
+ "checkbox",
3597
+ "color",
3598
+ "file",
3599
+ "image",
3600
+ "radio",
3601
+ "range",
3602
+ "reset",
3603
+ "submit"
3604
+ ].map((e) => `[type="${e}"]`).join(", ")})`
3605
+ ].join(", ");
3606
+ function va(e) {
3607
+ return e.matches(":disabled, [aria-disabled=\"true\"]");
3608
+ }
3609
+ function ya(e) {
3610
+ return Array.from(e.querySelectorAll(ga));
3611
+ }
3612
+ function ba(e) {
3613
+ return ya(e).filter((e) => !va(e));
3614
+ }
3615
+ function xa(e) {
3616
+ return e instanceof HTMLElement && e.matches(_a);
3617
+ }
3618
+ //#endregion
3619
+ //#region src/components/toolbar/toolbar_navigation.ts
3620
+ var Sa = (e, t) => (e + 1) % t, Ca = (e, t) => (e - 1 + t) % t, wa = () => 0, Ta = (e, t) => t - 1, Ea = {
3621
+ horizontal: {
3622
+ ArrowRight: Sa,
3623
+ ArrowLeft: Ca,
3624
+ Home: wa,
3625
+ End: Ta
3626
+ },
3627
+ vertical: {
3628
+ ArrowDown: Sa,
3629
+ ArrowUp: Ca,
3630
+ Home: wa,
3631
+ End: Ta
3632
+ }
2616
3633
  };
2617
- function Jr({ content: e, children: t, position: r = "top", showOnClick: i = !1, temporaryContent: s, temporaryDuration: u = 2e3, disabled: d = !1, radius: m = "lg", onTemporaryShow: v, className: b, ref: C }) {
2618
- let { isMounted: w, isVisible: T, setIsVisible: E, open: D, close: O } = gn(), [k, A] = p(!1), j = l(), M = f(null), N = f(void 0), { refs: P, floatingStyles: F, placement: I, middlewareData: ee, isPositioned: L } = rn({
2619
- placement: r,
2620
- open: w,
2621
- whileElementsMounted: Kt,
2622
- middleware: [
2623
- on(Wr),
2624
- cn(),
2625
- sn({ padding: 8 }),
2626
- ln({ element: M })
2627
- ]
2628
- }), R = I.split("-")[0];
2629
- _n(w, L, E);
2630
- let te = o((e) => Fn(P.setReference, C)(e), [P, C]), ne = () => {
2631
- A(!1), O();
2632
- }, re = () => {
2633
- d || !s || (A(!0), D(L), clearTimeout(N.current), N.current = setTimeout(ne, u), v?.());
2634
- }, z = () => {
2635
- d || D(L);
2636
- }, ie = () => {
2637
- clearTimeout(N.current), ne();
3634
+ function Da(e) {
3635
+ let { key: t, orientation: n, currentPosition: r, itemCount: i } = e, a = Ea[n][t];
3636
+ if (a && i !== 0) return a(r, i);
3637
+ }
3638
+ //#endregion
3639
+ //#region src/components/toolbar/use_toolbar_roving_focus.ts
3640
+ var Oa = ["disabled", "aria-disabled"];
3641
+ function ka(e, t) {
3642
+ let n = f(null), r = o(() => {
3643
+ let t = e.current;
3644
+ if (!t) return;
3645
+ let r = ba(t), i = n.current, a = i && r.includes(i) ? i : r[0];
3646
+ for (let e of ya(t)) e.tabIndex = e === a ? 0 : -1;
3647
+ }, [e]);
3648
+ return c(() => {
3649
+ let t = e.current;
3650
+ if (!t) return;
3651
+ r();
3652
+ let n = new MutationObserver(r);
3653
+ return n.observe(t, {
3654
+ subtree: !0,
3655
+ childList: !0,
3656
+ attributes: !0,
3657
+ attributeFilter: Oa
3658
+ }), () => n.disconnect();
3659
+ }, [e, r]), {
3660
+ handleFocus: (t) => {
3661
+ let i = e.current;
3662
+ if (!i) return;
3663
+ let a = ba(i).find((e) => e === t.target);
3664
+ a && (n.current = a, r());
3665
+ },
3666
+ handleKeyDown: (n) => {
3667
+ let r = e.current;
3668
+ if (!r || xa(n.target)) return;
3669
+ let i = ba(r), a = Da({
3670
+ key: n.key,
3671
+ orientation: t,
3672
+ currentPosition: i.findIndex((e) => e === n.target),
3673
+ itemCount: i.length
3674
+ });
3675
+ a !== void 0 && (n.preventDefault(), i[a].focus());
3676
+ }
2638
3677
  };
2639
- c(() => () => clearTimeout(N.current), []);
2640
- let ae = w && !d, oe = k && s ? s : e, se = {
2641
- onClick: (e) => {
2642
- i && s && re(), a(t) && t.props.onClick?.(e);
3678
+ }
3679
+ //#endregion
3680
+ //#region src/components/toolbar/toolbar.tsx
3681
+ var Aa = {
3682
+ horizontal: "flex items-center gap-1",
3683
+ vertical: "flex flex-col items-stretch gap-1"
3684
+ };
3685
+ function ja(e) {
3686
+ let { orientation: t = "horizontal", unstyled: n = !1, className: r, ref: i, onFocus: a, onKeyDown: o, ...s } = e, c = f(null), { handleFocus: l, handleKeyDown: u } = ka(c, t);
3687
+ return /* @__PURE__ */ g("div", {
3688
+ ...s,
3689
+ ref: se(c, i),
3690
+ role: "toolbar",
3691
+ "aria-orientation": t,
3692
+ className: x(!n && Aa[t], r),
3693
+ onFocus: (e) => {
3694
+ l(e), a?.(e);
2643
3695
  },
2644
- "aria-describedby": ae ? j : void 0
2645
- }, ce = a(t) ? n(t, se) : t, le = ee.arrow?.x, ue = ee.arrow?.y, de = qr[R];
2646
- return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("span", {
2647
- ref: te,
2648
- className: x("inline-block", b),
2649
- onMouseEnter: z,
2650
- onMouseLeave: ie,
2651
- onFocus: z,
2652
- onBlur: ie,
2653
- children: ce
2654
- }), ae && y(/* @__PURE__ */ g("div", {
2655
- ref: P.setFloating,
2656
- style: F,
2657
- className: "z-50 inline-block pointer-events-none",
2658
- children: /* @__PURE__ */ _("div", {
2659
- id: j,
2660
- role: "tooltip",
2661
- "data-state": T ? "open" : "closed",
2662
- className: x("px-3 py-1.5 text-sm whitespace-nowrap", "text-white dark:text-gray-900 bg-gray-900 dark:bg-gray-100 shadow-lg", "transition-[opacity,transform] duration-150 ease-out", T ? "opacity-100" : "opacity-0", Kr[R], S[m]),
2663
- children: [oe, /* @__PURE__ */ g("div", {
2664
- ref: M,
2665
- style: {
2666
- position: "absolute",
2667
- width: `${Gr}px`,
2668
- height: `${Gr}px`,
2669
- left: le === void 0 ? void 0 : `${le}px`,
2670
- top: ue === void 0 ? void 0 : `${ue}px`,
2671
- [de]: `-${Gr / 2}px`
2672
- },
2673
- className: "rotate-45 bg-gray-900 dark:bg-gray-100"
2674
- })]
3696
+ onKeyDown: (e) => {
3697
+ o?.(e), !e.defaultPrevented && u(e);
3698
+ }
3699
+ });
3700
+ }
3701
+ //#endregion
3702
+ //#region src/components/ui_provider/ui_provider.tsx
3703
+ function Ma(e = {}) {
3704
+ return Object.fromEntries(Object.entries(e).filter(([, e]) => e !== void 0));
3705
+ }
3706
+ function Na({ labels: e, announceFieldErrors: t, children: n }) {
3707
+ let r = s(Ce), i = he(), a = d(() => ({
3708
+ ...r,
3709
+ ...Ma(e)
3710
+ }), [r, e]);
3711
+ return /* @__PURE__ */ g(Ce.Provider, {
3712
+ value: a,
3713
+ children: /* @__PURE__ */ g(me.Provider, {
3714
+ value: t ?? i,
3715
+ children: n
2675
3716
  })
2676
- }), document.body)] });
3717
+ });
2677
3718
  }
2678
3719
  //#endregion
2679
3720
  //#region src/hooks/use_is_client/with_client_only.tsx
2680
- var Yr = (e) => {
3721
+ var Pa = (e) => {
2681
3722
  function t(t) {
2682
- return ye() ? /* @__PURE__ */ g(e, { ...t }) : null;
3723
+ return ke() ? /* @__PURE__ */ g(e, { ...t }) : null;
2683
3724
  }
2684
3725
  return t;
2685
3726
  };
2686
3727
  //#endregion
2687
- export { P as Avatar, de as BASE_INPUT_STYLES, I as Badge, R as Button, se as Card, ue as CharacterCount, ve as Checkbox, be as ClientOnly, Se as Combobox, _r as ConfirmModal, xn as ContextMenu, wn as CopyButton, En as Highlight, kn as IconButton, Mn as Input, Pn as Kbd, Rn as Menu, zn as MenuGroup, Xn as MenuItem, Zn as MenuSeparator, br as Modal, xr as ModalFooter, Sr as ModalProvider, wr as RadioOptions, Tr as Select, Er as Switch, Dr as Tabs, Or as Textarea, Ur as ThemeToggle, Jr as Tooltip, Tn as splitIntoHighlightSegments, pr as useDisableHotkeysWhileMounted, dr as useGlobalHotkeysStore, ye as useIsClient, Fr as useThemeStore, Yr as withClientOnly };
3728
+ export { I as Avatar, le as BASE_INPUT_STYLES, R as Badge, te as Button, ae as Card, K as CharacterCount, Se as Checkbox, Oe as CheckboxOptions, Ae as ClientOnly, Fe as Combobox, gi as ConfirmModal, Yn as ContextMenu, Qn as CopyButton, tr as Highlight, hr as IconButton, vr as Input, br as Kbd, Cr as Menu, wr as MenuGroup, Fr as MenuItem, Ir as MenuSeparator, vi as Modal, yi as ModalFooter, bi as ModalProvider, Ei as MultiCombobox, Oi as RadioOptions, ki as Select, Ai as Switch, Xi as Tabs, Zi as Textarea, ha as ThemeToggle, ja as Toolbar, dr as Tooltip, Na as UIProvider, $n as splitIntoHighlightSegments, fi as useDisableHotkeysWhileMounted, ui as useGlobalHotkeysStore, ke as useIsClient, ca as useThemeStore, Pa as withClientOnly };