@handamade/psi-react 0.10.0 → 0.12.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.
package/dist/index.js CHANGED
@@ -1,64 +1,64 @@
1
- import { jsx as n, jsxs as _, Fragment as V } from "react/jsx-runtime";
2
- import { createContext as K, useId as O, useRef as z, useEffect as x, useContext as B, useState as se, useCallback as C, cloneElement as Y, isValidElement as q, useMemo as ie, Children as H, Fragment as X } from "react";
3
- const ae = "_button_c94w9_3", ce = "_disabled_c94w9_30", le = "_size24_c94w9_44", de = "_size32_c94w9_54", ue = "_size40_c94w9_64", he = "_size48_c94w9_74", _e = "_accent_c94w9_87", fe = "_accentSubtle_c94w9_99", pe = "_neutral_c94w9_111", be = "_neutralSubtle_c94w9_123", ve = "_ghost_c94w9_135", ge = "_danger_c94w9_147", ye = "_dangerSubtle_c94w9_159", we = "_outline_c94w9_171", b = {
4
- button: ae,
5
- disabled: ce,
6
- size24: le,
7
- size32: de,
8
- size40: ue,
9
- size48: he,
10
- accent: _e,
11
- accentSubtle: fe,
12
- neutral: pe,
13
- neutralSubtle: be,
14
- ghost: ve,
15
- danger: ge,
16
- dangerSubtle: ye,
17
- outline: we
18
- }, me = {
19
- accent: b.accent,
20
- "accent-subtle": b.accentSubtle,
21
- neutral: b.neutral,
22
- "neutral-subtle": b.neutralSubtle,
23
- ghost: b.ghost,
24
- danger: b.danger,
25
- "danger-subtle": b.dangerSubtle,
26
- outline: b.outline
27
- }, ke = {
28
- 24: b.size24,
29
- 32: b.size32,
30
- 40: b.size40,
31
- 48: b.size48
1
+ import { jsx as n, jsxs as p, Fragment as G } from "react/jsx-runtime";
2
+ import { createContext as K, useId as U, useRef as N, useEffect as S, useContext as z, useState as le, useCallback as m, cloneElement as ee, isValidElement as O, useMemo as de, Children as W, Fragment as re } from "react";
3
+ const ye = "_button_c94w9_3", me = "_disabled_c94w9_30", we = "_size24_c94w9_44", ke = "_size32_c94w9_54", xe = "_size40_c94w9_64", Ce = "_size48_c94w9_74", Be = "_accent_c94w9_87", Ne = "_accentSubtle_c94w9_99", Se = "_neutral_c94w9_111", $e = "_neutralSubtle_c94w9_123", Le = "_ghost_c94w9_135", ze = "_danger_c94w9_147", je = "_dangerSubtle_c94w9_159", Ie = "_outline_c94w9_171", w = {
4
+ button: ye,
5
+ disabled: me,
6
+ size24: we,
7
+ size32: ke,
8
+ size40: xe,
9
+ size48: Ce,
10
+ accent: Be,
11
+ accentSubtle: Ne,
12
+ neutral: Se,
13
+ neutralSubtle: $e,
14
+ ghost: Le,
15
+ danger: ze,
16
+ dangerSubtle: je,
17
+ outline: Ie
18
+ }, Te = {
19
+ accent: w.accent,
20
+ "accent-subtle": w.accentSubtle,
21
+ neutral: w.neutral,
22
+ "neutral-subtle": w.neutralSubtle,
23
+ ghost: w.ghost,
24
+ danger: w.danger,
25
+ "danger-subtle": w.dangerSubtle,
26
+ outline: w.outline
27
+ }, Ee = {
28
+ 24: w.size24,
29
+ 32: w.size32,
30
+ 40: w.size40,
31
+ 48: w.size48
32
32
  };
33
- function xe({
33
+ function Me({
34
34
  variant: e = "neutral",
35
35
  size: t = 32,
36
- href: s,
37
- target: i,
36
+ href: i,
37
+ target: a,
38
38
  rel: c,
39
39
  disabled: r,
40
40
  className: o,
41
- onClick: a,
41
+ onClick: s,
42
42
  ref: d,
43
43
  ...l
44
44
  }) {
45
45
  const u = [
46
- b.button,
47
- me[e],
48
- ke[t],
49
- s !== void 0 && r ? b.disabled : void 0,
46
+ w.button,
47
+ Te[e],
48
+ Ee[t],
49
+ i !== void 0 && r ? w.disabled : void 0,
50
50
  o
51
51
  ].filter(Boolean).join(" ");
52
- return s !== void 0 ? /* @__PURE__ */ n(
52
+ return i !== void 0 ? /* @__PURE__ */ n(
53
53
  "a",
54
54
  {
55
55
  ref: d,
56
56
  className: u,
57
- href: r ? void 0 : s,
58
- target: i,
57
+ href: r ? void 0 : i,
58
+ target: a,
59
59
  rel: c,
60
60
  "aria-disabled": r || void 0,
61
- onClick: r ? void 0 : a,
61
+ onClick: r ? void 0 : s,
62
62
  ...l
63
63
  }
64
64
  ) : /* @__PURE__ */ n(
@@ -67,62 +67,62 @@ function xe({
67
67
  ref: d,
68
68
  className: u,
69
69
  disabled: r,
70
- onClick: a,
70
+ onClick: s,
71
71
  ...l
72
72
  }
73
73
  );
74
74
  }
75
- const Ce = "_iconButton_129ca_3", Be = "_disabled_129ca_29", $e = "_size24_129ca_37", ze = "_size32_129ca_42", je = "_size40_129ca_47", Le = "_size48_129ca_52", Ne = "_accent_129ca_60", Se = "_neutral_129ca_72", Ie = "_ghost_129ca_84", Me = "_danger_129ca_96", k = {
76
- iconButton: Ce,
77
- disabled: Be,
78
- size24: $e,
79
- size32: ze,
80
- size40: je,
81
- size48: Le,
82
- accent: Ne,
83
- neutral: Se,
84
- ghost: Ie,
85
- danger: Me
86
- }, Ee = {
87
- accent: k.accent,
88
- neutral: k.neutral,
89
- ghost: k.ghost,
90
- danger: k.danger
91
- }, Te = {
92
- 24: k.size24,
93
- 32: k.size32,
94
- 40: k.size40,
95
- 48: k.size48
75
+ const We = "_iconButton_129ca_3", Ae = "_disabled_129ca_29", Pe = "_size24_129ca_37", De = "_size32_129ca_42", Re = "_size40_129ca_47", He = "_size48_129ca_52", Ve = "_accent_129ca_60", qe = "_neutral_129ca_72", Fe = "_ghost_129ca_84", Oe = "_danger_129ca_96", L = {
76
+ iconButton: We,
77
+ disabled: Ae,
78
+ size24: Pe,
79
+ size32: De,
80
+ size40: Re,
81
+ size48: He,
82
+ accent: Ve,
83
+ neutral: qe,
84
+ ghost: Fe,
85
+ danger: Oe
86
+ }, Ke = {
87
+ accent: L.accent,
88
+ neutral: L.neutral,
89
+ ghost: L.ghost,
90
+ danger: L.danger
91
+ }, Ue = {
92
+ 24: L.size24,
93
+ 32: L.size32,
94
+ 40: L.size40,
95
+ 48: L.size48
96
96
  };
97
- function U({
97
+ function X({
98
98
  variant: e = "neutral",
99
99
  size: t = 32,
100
- href: s,
101
- target: i,
100
+ href: i,
101
+ target: a,
102
102
  rel: c,
103
103
  disabled: r,
104
104
  className: o,
105
- onClick: a,
105
+ onClick: s,
106
106
  ref: d,
107
107
  ...l
108
108
  }) {
109
109
  const u = [
110
- k.iconButton,
111
- Ee[e],
112
- Te[t],
113
- s !== void 0 && r ? k.disabled : void 0,
110
+ L.iconButton,
111
+ Ke[e],
112
+ Ue[t],
113
+ i !== void 0 && r ? L.disabled : void 0,
114
114
  o
115
115
  ].filter(Boolean).join(" ");
116
- return s !== void 0 ? /* @__PURE__ */ n(
116
+ return i !== void 0 ? /* @__PURE__ */ n(
117
117
  "a",
118
118
  {
119
119
  ref: d,
120
120
  className: u,
121
- href: r ? void 0 : s,
122
- target: i,
121
+ href: r ? void 0 : i,
122
+ target: a,
123
123
  rel: c,
124
124
  "aria-disabled": r || void 0,
125
- onClick: r ? void 0 : a,
125
+ onClick: r ? void 0 : s,
126
126
  ...l
127
127
  }
128
128
  ) : /* @__PURE__ */ n(
@@ -131,190 +131,190 @@ function U({
131
131
  ref: d,
132
132
  className: u,
133
133
  disabled: r,
134
- onClick: a,
134
+ onClick: s,
135
135
  ...l
136
136
  }
137
137
  );
138
138
  }
139
- const We = "_card_1btb3_1", Ae = "_stacked_1btb3_8", Pe = "_featured_1btb3_10", He = "_media_1btb3_22", Re = "_body_1btb3_23", De = "_hoverLift_1btb3_31", L = {
140
- card: We,
141
- stacked: Ae,
142
- featured: Pe,
143
- media: He,
144
- body: Re,
145
- hoverLift: De
139
+ const Ye = "_card_1btb3_1", Ze = "_stacked_1btb3_8", Ge = "_featured_1btb3_10", Xe = "_media_1btb3_22", Je = "_body_1btb3_23", Qe = "_hoverLift_1btb3_31", T = {
140
+ card: Ye,
141
+ stacked: Ze,
142
+ featured: Ge,
143
+ media: Xe,
144
+ body: Je,
145
+ hoverLift: Qe
146
146
  };
147
- function An({
147
+ function yo({
148
148
  variant: e = "stacked",
149
149
  media: t,
150
- hoverLift: s = !1,
151
- className: i,
150
+ hoverLift: i = !1,
151
+ className: a,
152
152
  children: c,
153
153
  ref: r,
154
154
  ...o
155
155
  }) {
156
- const a = [
157
- L.card,
158
- e === "featured" ? L.featured : L.stacked,
159
- s ? L.hoverLift : void 0,
160
- i
156
+ const s = [
157
+ T.card,
158
+ e === "featured" ? T.featured : T.stacked,
159
+ i ? T.hoverLift : void 0,
160
+ a
161
161
  ].filter(Boolean).join(" ");
162
- return /* @__PURE__ */ _("div", { ref: r, className: a, ...o, children: [
163
- t != null && /* @__PURE__ */ n("div", { className: L.media, children: t }),
164
- /* @__PURE__ */ n("div", { className: L.body, children: c })
162
+ return /* @__PURE__ */ p("div", { ref: r, className: s, ...o, children: [
163
+ t != null && /* @__PURE__ */ n("div", { className: T.media, children: t }),
164
+ /* @__PURE__ */ n("div", { className: T.body, children: c })
165
165
  ] });
166
166
  }
167
- const Ve = "_panel_jn8w4_1", qe = "_padding16_jn8w4_8", J = {
168
- panel: Ve,
169
- padding16: qe
167
+ const et = "_panel_jn8w4_1", tt = "_padding16_jn8w4_8", ie = {
168
+ panel: et,
169
+ padding16: tt
170
170
  };
171
- function Pn({ padding: e = 24, className: t, children: s, ref: i, ...c }) {
172
- const r = [J.panel, e === 16 ? J.padding16 : void 0, t].filter(Boolean).join(" ");
173
- return /* @__PURE__ */ n("div", { ref: i, className: r, ...c, children: s });
174
- }
175
- const Fe = "_navbar_1gyow_1", Ke = "_inner_1gyow_12", Oe = "_brand_1gyow_19", Ue = "_links_1gyow_20", Ye = "_actions_1gyow_50", W = {
176
- navbar: Fe,
177
- inner: Ke,
178
- brand: Oe,
179
- links: Ue,
180
- actions: Ye
171
+ function mo({ padding: e = 24, className: t, children: i, ref: a, ...c }) {
172
+ const r = [ie.panel, e === 16 ? ie.padding16 : void 0, t].filter(Boolean).join(" ");
173
+ return /* @__PURE__ */ n("div", { ref: a, className: r, ...c, children: i });
174
+ }
175
+ const nt = "_navbar_1gyow_1", ot = "_inner_1gyow_12", rt = "_brand_1gyow_19", it = "_links_1gyow_20", st = "_actions_1gyow_50", V = {
176
+ navbar: nt,
177
+ inner: ot,
178
+ brand: rt,
179
+ links: it,
180
+ actions: st
181
181
  };
182
- function Hn({ brand: e, actions: t, children: s, className: i, ref: c, ...r }) {
183
- const o = [W.navbar, i].filter(Boolean).join(" ");
184
- return /* @__PURE__ */ n("header", { ref: c, className: o, ...r, children: /* @__PURE__ */ _("div", { className: `psi-container ${W.inner}`, children: [
185
- e != null && /* @__PURE__ */ n("div", { className: W.brand, children: e }),
186
- /* @__PURE__ */ n("nav", { className: W.links, children: s }),
187
- t != null && /* @__PURE__ */ n("div", { className: W.actions, children: t })
182
+ function wo({ brand: e, actions: t, children: i, className: a, ref: c, ...r }) {
183
+ const o = [V.navbar, a].filter(Boolean).join(" ");
184
+ return /* @__PURE__ */ n("header", { ref: c, className: o, ...r, children: /* @__PURE__ */ p("div", { className: `psi-container ${V.inner}`, children: [
185
+ e != null && /* @__PURE__ */ n("div", { className: V.brand, children: e }),
186
+ /* @__PURE__ */ n("nav", { className: V.links, children: i }),
187
+ t != null && /* @__PURE__ */ n("div", { className: V.actions, children: t })
188
188
  ] }) });
189
189
  }
190
- const Ze = "_frame_et4fc_1", Ge = {
191
- frame: Ze
190
+ const at = "_frame_et4fc_1", ct = {
191
+ frame: at
192
192
  };
193
- function Rn({ ratio: e, className: t, style: s, children: i, ref: c, ...r }) {
194
- const o = [Ge.frame, t].filter(Boolean).join(" ");
195
- return /* @__PURE__ */ n("div", { ref: c, className: o, style: { aspectRatio: String(e), ...s }, ...r, children: i });
196
- }
197
- const Xe = "_field_lplye_1", Je = "_label_lplye_10", Qe = "_marker_lplye_16", et = "_message_lplye_20", tt = "_invalid_lplye_26", N = {
198
- field: Xe,
199
- label: Je,
200
- marker: Qe,
201
- message: et,
202
- invalid: tt
203
- }, Z = K(null);
204
- function Dn({
193
+ function ko({ ratio: e, className: t, style: i, children: a, ref: c, ...r }) {
194
+ const o = [ct.frame, t].filter(Boolean).join(" ");
195
+ return /* @__PURE__ */ n("div", { ref: c, className: o, style: { aspectRatio: String(e), ...i }, ...r, children: a });
196
+ }
197
+ const lt = "_field_lplye_1", dt = "_label_lplye_10", ut = "_marker_lplye_16", ht = "_message_lplye_20", _t = "_invalid_lplye_26", E = {
198
+ field: lt,
199
+ label: dt,
200
+ marker: ut,
201
+ message: ht,
202
+ invalid: _t
203
+ }, te = K(null);
204
+ function xo({
205
205
  label: e,
206
206
  description: t,
207
- error: s,
208
- required: i = !1,
207
+ error: i,
208
+ required: a = !1,
209
209
  group: c = !1,
210
210
  htmlFor: r,
211
211
  className: o,
212
- children: a,
212
+ children: s,
213
213
  ref: d,
214
214
  ...l
215
215
  }) {
216
- const u = O(), f = r ?? u, h = !!s, y = h ? s : t, w = y != null && y !== !1 ? `${f}-message` : void 0, j = [N.field, h && N.invalid, o].filter(Boolean).join(" "), p = e != null ? /* @__PURE__ */ _(V, { children: [
216
+ const u = U(), h = r ?? u, _ = !!i, b = _ ? i : t, y = b != null && b !== !1 ? `${h}-message` : void 0, j = [E.field, _ && E.invalid, o].filter(Boolean).join(" "), x = e != null ? /* @__PURE__ */ p(G, { children: [
217
217
  e,
218
- i && /* @__PURE__ */ n("span", { "aria-hidden": "true", className: N.marker, children: " *" })
219
- ] }) : null, R = /* @__PURE__ */ _(V, { children: [
220
- p != null && (c ? /* @__PURE__ */ n("legend", { className: N.label, children: p }) : /* @__PURE__ */ n("label", { className: N.label, htmlFor: f, children: p })),
221
- /* @__PURE__ */ n(Z.Provider, { value: { id: f, describedBy: w, invalid: h, required: i }, children: a }),
222
- w && /* @__PURE__ */ n("p", { id: w, className: N.message, "aria-live": "polite", children: y })
218
+ a && /* @__PURE__ */ n("span", { "aria-hidden": "true", className: E.marker, children: " *" })
219
+ ] }) : null, g = /* @__PURE__ */ p(G, { children: [
220
+ x != null && (c ? /* @__PURE__ */ n("legend", { className: E.label, children: x }) : /* @__PURE__ */ n("label", { className: E.label, htmlFor: h, children: x })),
221
+ /* @__PURE__ */ n(te.Provider, { value: { id: h, describedBy: y, invalid: _, required: a }, children: s }),
222
+ y && /* @__PURE__ */ n("p", { id: y, className: E.message, "aria-live": "polite", children: b })
223
223
  ] });
224
224
  return c ? /* @__PURE__ */ n(
225
225
  "fieldset",
226
226
  {
227
227
  ref: d,
228
228
  className: j,
229
- "aria-describedby": w,
229
+ "aria-describedby": y,
230
230
  ...l,
231
- children: R
231
+ children: g
232
232
  }
233
- ) : /* @__PURE__ */ n("div", { ref: d, className: j, ...l, children: R });
233
+ ) : /* @__PURE__ */ n("div", { ref: d, className: j, ...l, children: g });
234
234
  }
235
- function Vn({ size: e = 20, ...t }) {
236
- return /* @__PURE__ */ _("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", ...t, children: [
235
+ function Co({ size: e = 20, ...t }) {
236
+ return /* @__PURE__ */ p("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", ...t, children: [
237
237
  /* @__PURE__ */ n("line", { x1: "12", y1: "5", x2: "12", y2: "19" }),
238
238
  /* @__PURE__ */ n("line", { x1: "5", y1: "12", x2: "19", y2: "12" })
239
239
  ] });
240
240
  }
241
- function qn({ size: e = 20, ...t }) {
241
+ function Bo({ size: e = 20, ...t }) {
242
242
  return /* @__PURE__ */ n("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", ...t, children: /* @__PURE__ */ n("line", { x1: "5", y1: "12", x2: "19", y2: "12" }) });
243
243
  }
244
- function nt({ size: e = 20, ...t }) {
245
- return /* @__PURE__ */ _("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", ...t, children: [
244
+ function ue({ size: e = 20, ...t }) {
245
+ return /* @__PURE__ */ p("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", ...t, children: [
246
246
  /* @__PURE__ */ n("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
247
247
  /* @__PURE__ */ n("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
248
248
  ] });
249
249
  }
250
- function Fn({ size: e = 20, ...t }) {
250
+ function ft({ size: e = 20, ...t }) {
251
251
  return /* @__PURE__ */ n("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", ...t, children: /* @__PURE__ */ n("polyline", { points: "20 6 9 17 4 12" }) });
252
252
  }
253
- function Kn({ size: e = 20, ...t }) {
253
+ function No({ size: e = 20, ...t }) {
254
254
  return /* @__PURE__ */ n("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", ...t, children: /* @__PURE__ */ n("polyline", { points: "6 9 12 15 18 9" }) });
255
255
  }
256
- function On({ size: e = 20, ...t }) {
256
+ function So({ size: e = 20, ...t }) {
257
257
  return /* @__PURE__ */ n("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", ...t, children: /* @__PURE__ */ n("polyline", { points: "9 18 15 12 9 6" }) });
258
258
  }
259
- function Un({ size: e = 20, ...t }) {
260
- return /* @__PURE__ */ _("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", ...t, children: [
259
+ function $o({ size: e = 20, ...t }) {
260
+ return /* @__PURE__ */ p("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", ...t, children: [
261
261
  /* @__PURE__ */ n("circle", { cx: "11", cy: "11", r: "8" }),
262
262
  /* @__PURE__ */ n("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" })
263
263
  ] });
264
264
  }
265
- function Yn({ size: e = 20, ...t }) {
266
- return /* @__PURE__ */ _("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", ...t, children: [
265
+ function Lo({ size: e = 20, ...t }) {
266
+ return /* @__PURE__ */ p("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", ...t, children: [
267
267
  /* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "3" }),
268
268
  /* @__PURE__ */ n("path", { d: "M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z" })
269
269
  ] });
270
270
  }
271
- function Zn({ size: e = 20, ...t }) {
272
- return /* @__PURE__ */ _("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", ...t, children: [
271
+ function zo({ size: e = 20, ...t }) {
272
+ return /* @__PURE__ */ p("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", ...t, children: [
273
273
  /* @__PURE__ */ n("path", { d: "M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" }),
274
274
  /* @__PURE__ */ n("circle", { cx: "12", cy: "7", r: "4" })
275
275
  ] });
276
276
  }
277
- function Gn({ size: e = 20, ...t }) {
278
- return /* @__PURE__ */ _("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", ...t, children: [
277
+ function jo({ size: e = 20, ...t }) {
278
+ return /* @__PURE__ */ p("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", ...t, children: [
279
279
  /* @__PURE__ */ n("path", { d: "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }),
280
280
  /* @__PURE__ */ n("path", { d: "M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z" })
281
281
  ] });
282
282
  }
283
- function Xn({ size: e = 20, ...t }) {
284
- return /* @__PURE__ */ _("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", ...t, children: [
283
+ function Io({ size: e = 20, ...t }) {
284
+ return /* @__PURE__ */ p("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", ...t, children: [
285
285
  /* @__PURE__ */ n("polyline", { points: "3 6 5 6 21 6" }),
286
286
  /* @__PURE__ */ n("path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" })
287
287
  ] });
288
288
  }
289
- function Jn({ size: e = 20, ...t }) {
290
- return /* @__PURE__ */ _("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", ...t, children: [
289
+ function To({ size: e = 20, ...t }) {
290
+ return /* @__PURE__ */ p("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", ...t, children: [
291
291
  /* @__PURE__ */ n("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2", ry: "2" }),
292
292
  /* @__PURE__ */ n("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
293
293
  ] });
294
294
  }
295
- function Qn({ size: e = 20, ...t }) {
296
- return /* @__PURE__ */ _("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", ...t, children: [
295
+ function Eo({ size: e = 20, ...t }) {
296
+ return /* @__PURE__ */ p("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", ...t, children: [
297
297
  /* @__PURE__ */ n("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" }),
298
298
  /* @__PURE__ */ n("polyline", { points: "15 3 21 3 21 9" }),
299
299
  /* @__PURE__ */ n("line", { x1: "10", y1: "14", x2: "21", y2: "3" })
300
300
  ] });
301
301
  }
302
- function eo({ size: e = 20, ...t }) {
303
- return /* @__PURE__ */ _("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", ...t, children: [
302
+ function Mo({ size: e = 20, ...t }) {
303
+ return /* @__PURE__ */ p("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", ...t, children: [
304
304
  /* @__PURE__ */ n("path", { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" }),
305
305
  /* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "3" })
306
306
  ] });
307
307
  }
308
- function to({ size: e = 20, ...t }) {
309
- return /* @__PURE__ */ _("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", ...t, children: [
308
+ function Wo({ size: e = 20, ...t }) {
309
+ return /* @__PURE__ */ p("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", ...t, children: [
310
310
  /* @__PURE__ */ n("path", { d: "M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94" }),
311
311
  /* @__PURE__ */ n("path", { d: "M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19" }),
312
312
  /* @__PURE__ */ n("path", { d: "M14.12 14.12a3 3 0 1 1-4.24-4.24" }),
313
313
  /* @__PURE__ */ n("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
314
314
  ] });
315
315
  }
316
- function no({ size: e = 20, ...t }) {
317
- return /* @__PURE__ */ _("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", ...t, children: [
316
+ function Ao({ size: e = 20, ...t }) {
317
+ return /* @__PURE__ */ p("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", ...t, children: [
318
318
  /* @__PURE__ */ n("line", { x1: "12", y1: "2", x2: "12", y2: "6" }),
319
319
  /* @__PURE__ */ n("line", { x1: "12", y1: "18", x2: "12", y2: "22" }),
320
320
  /* @__PURE__ */ n("line", { x1: "4.93", y1: "4.93", x2: "7.76", y2: "7.76" }),
@@ -325,122 +325,152 @@ function no({ size: e = 20, ...t }) {
325
325
  /* @__PURE__ */ n("line", { x1: "16.24", y1: "7.76", x2: "19.07", y2: "4.93" })
326
326
  ] });
327
327
  }
328
- function oo({ size: e = 20, ...t }) {
329
- return /* @__PURE__ */ _("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", ...t, children: [
328
+ function Po({ size: e = 20, ...t }) {
329
+ return /* @__PURE__ */ p("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", ...t, children: [
330
330
  /* @__PURE__ */ n("line", { x1: "12", y1: "5", x2: "12", y2: "19" }),
331
331
  /* @__PURE__ */ n("polyline", { points: "19 12 12 19 5 12" })
332
332
  ] });
333
333
  }
334
- function ro({ size: e = 20, ...t }) {
335
- return /* @__PURE__ */ _("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", ...t, children: [
334
+ function Do({ size: e = 20, ...t }) {
335
+ return /* @__PURE__ */ p("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", ...t, children: [
336
336
  /* @__PURE__ */ n("line", { x1: "7", y1: "17", x2: "17", y2: "7" }),
337
337
  /* @__PURE__ */ n("polyline", { points: "7 7 17 7 17 17" })
338
338
  ] });
339
339
  }
340
- function so({ size: e = 20, ...t }) {
340
+ function Ro({ size: e = 20, ...t }) {
341
341
  return /* @__PURE__ */ n("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true", ...t, children: /* @__PURE__ */ n("path", { d: "M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z" }) });
342
342
  }
343
- function io({ size: e = 20, ...t }) {
343
+ function Ho({ size: e = 20, ...t }) {
344
344
  return /* @__PURE__ */ n("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true", ...t, children: /* @__PURE__ */ n("path", { d: "M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" }) });
345
345
  }
346
- function ao({ size: e = 20, ...t }) {
346
+ function Vo({ size: e = 20, ...t }) {
347
347
  return /* @__PURE__ */ n("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true", ...t, children: /* @__PURE__ */ n("path", { d: "M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932ZM17.61 20.644h2.039L6.486 3.24H4.298Z" }) });
348
348
  }
349
- function co({ size: e = 20, ...t }) {
350
- return /* @__PURE__ */ _("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", ...t, children: [
349
+ function qo({ size: e = 20, ...t }) {
350
+ return /* @__PURE__ */ p("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", ...t, children: [
351
351
  /* @__PURE__ */ n("rect", { x: "2", y: "2", width: "20", height: "20", rx: "5", ry: "5" }),
352
352
  /* @__PURE__ */ n("path", { d: "M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z" }),
353
353
  /* @__PURE__ */ n("line", { x1: "17.5", y1: "6.5", x2: "17.51", y2: "6.5" })
354
354
  ] });
355
355
  }
356
- const ot = "_dialog_l23jf_2", rt = "_w400_l23jf_31", st = "_w560_l23jf_32", it = "_w720_l23jf_33", at = "_panel_l23jf_35", ct = "_header_l23jf_41", lt = "_title_l23jf_48", dt = "_footer_l23jf_54", $ = {
357
- dialog: ot,
358
- w400: rt,
359
- w560: st,
360
- w720: it,
361
- panel: at,
362
- header: ct,
363
- title: lt,
364
- footer: dt
365
- }, ut = {
356
+ function pt({ size: e = 20, ...t }) {
357
+ return /* @__PURE__ */ p("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", ...t, children: [
358
+ /* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "10" }),
359
+ /* @__PURE__ */ n("line", { x1: "12", y1: "11", x2: "12", y2: "16" }),
360
+ /* @__PURE__ */ n("line", { x1: "12", y1: "8", x2: "12", y2: "8" })
361
+ ] });
362
+ }
363
+ function vt({ size: e = 20, ...t }) {
364
+ return /* @__PURE__ */ p("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", ...t, children: [
365
+ /* @__PURE__ */ n("path", { d: "M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0Z" }),
366
+ /* @__PURE__ */ n("line", { x1: "12", y1: "9", x2: "12", y2: "13" }),
367
+ /* @__PURE__ */ n("line", { x1: "12", y1: "17", x2: "12", y2: "17" })
368
+ ] });
369
+ }
370
+ function gt({ size: e = 20, ...t }) {
371
+ return /* @__PURE__ */ p("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", ...t, children: [
372
+ /* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "10" }),
373
+ /* @__PURE__ */ n("line", { x1: "12", y1: "8", x2: "12", y2: "12" }),
374
+ /* @__PURE__ */ n("line", { x1: "12", y1: "16", x2: "12", y2: "16" })
375
+ ] });
376
+ }
377
+ const bt = "_dialog_h5f0e_2", yt = "_center_h5f0e_32", mt = "_inlineStart_h5f0e_40", wt = "_inlineEnd_h5f0e_41", kt = "_w400_h5f0e_90", xt = "_w560_h5f0e_91", Ct = "_w720_h5f0e_92", Bt = "_panel_h5f0e_94", Nt = "_header_h5f0e_114", St = "_title_h5f0e_121", $t = "_footer_h5f0e_127", $ = {
378
+ dialog: bt,
379
+ center: yt,
380
+ inlineStart: mt,
381
+ inlineEnd: wt,
382
+ w400: kt,
383
+ w560: xt,
384
+ w720: Ct,
385
+ panel: Bt,
386
+ header: Nt,
387
+ title: St,
388
+ footer: $t
389
+ }, Lt = {
366
390
  400: $.w400,
367
391
  560: $.w560,
368
392
  720: $.w720
393
+ }, zt = {
394
+ center: $.center,
395
+ "inline-start": $.inlineStart,
396
+ "inline-end": $.inlineEnd
369
397
  };
370
- function lo({
398
+ function Fo({
371
399
  open: e,
372
400
  onClose: t,
373
- title: s,
374
- footer: i,
401
+ title: i,
402
+ footer: a,
375
403
  width: c = 560,
376
- dismissible: r = !0,
377
- className: o,
378
- children: a,
379
- ref: d,
380
- ...l
404
+ placement: r = "center",
405
+ dismissible: o = !0,
406
+ className: s,
407
+ children: d,
408
+ ref: l,
409
+ ...u
381
410
  }) {
382
- const u = z(null), f = O(), h = (p) => {
383
- u.current = p, typeof d == "function" ? d(p) : d && (d.current = p);
411
+ const h = N(null), _ = U(), b = (g) => {
412
+ h.current = g, typeof l == "function" ? l(g) : l && (l.current = g);
384
413
  };
385
- x(() => {
386
- const p = u.current;
387
- p && (e && !p.open ? p.showModal() : !e && p.open && p.close());
388
- }, [e]), x(() => {
414
+ S(() => {
415
+ const g = h.current;
416
+ g && (e && !g.open ? g.showModal() : !e && g.open && g.close());
417
+ }, [e]), S(() => {
389
418
  if (!e) return;
390
- const p = document.body.style.overflow;
419
+ const g = document.body.style.overflow;
391
420
  return document.body.style.overflow = "hidden", () => {
392
- document.body.style.overflow = p;
421
+ document.body.style.overflow = g;
393
422
  };
394
423
  }, [e]);
395
- const y = (p) => {
396
- p.preventDefault(), r && t("esc");
397
- }, w = (p) => {
398
- r && p.target === u.current && t("backdrop");
399
- }, j = [$.dialog, ut[c], o].filter(Boolean).join(" ");
424
+ const y = (g) => {
425
+ g.preventDefault(), o && t("esc");
426
+ }, j = (g) => {
427
+ o && g.target === h.current && t("backdrop");
428
+ }, x = [$.dialog, Lt[c], zt[r], s].filter(Boolean).join(" ");
400
429
  return /* @__PURE__ */ n(
401
430
  "dialog",
402
431
  {
403
- ref: h,
404
- className: j,
405
- "aria-labelledby": s != null ? f : void 0,
432
+ ref: b,
433
+ className: x,
434
+ "data-placement": r,
435
+ "aria-labelledby": i != null ? _ : void 0,
406
436
  onCancel: y,
407
- onClick: w,
408
- ...l,
409
- children: /* @__PURE__ */ _("div", { className: $.panel, children: [
410
- (s != null || r) && /* @__PURE__ */ _("div", { className: $.header, children: [
411
- s != null && /* @__PURE__ */ n("h2", { id: f, className: $.title, children: s }),
412
- r && /* @__PURE__ */ n(
413
- U,
437
+ onClick: j,
438
+ ...u,
439
+ children: /* @__PURE__ */ p("div", { className: $.panel, children: [
440
+ (i != null || o) && /* @__PURE__ */ p("div", { className: $.header, children: [
441
+ i != null && /* @__PURE__ */ n("h2", { id: _, className: $.title, children: i }),
442
+ o && /* @__PURE__ */ n(
443
+ X,
414
444
  {
415
445
  variant: "ghost",
416
446
  size: 32,
417
447
  "aria-label": "Close dialog",
418
448
  onClick: () => t("close-button"),
419
- children: /* @__PURE__ */ n(nt, { "aria-hidden": "true" })
449
+ children: /* @__PURE__ */ n(ue, { "aria-hidden": "true" })
420
450
  }
421
451
  )
422
452
  ] }),
423
- a,
424
- i != null && /* @__PURE__ */ n("div", { className: $.footer, children: i })
453
+ d,
454
+ a != null && /* @__PURE__ */ n("div", { className: $.footer, children: a })
425
455
  ] })
426
456
  }
427
457
  );
428
458
  }
429
- const ht = "_input_hpei8_3", _t = "_size24_hpei8_37", ft = "_size32_hpei8_43", pt = "_size40_hpei8_49", bt = "_size48_hpei8_55", vt = "_error_hpei8_63", I = {
430
- input: ht,
431
- size24: _t,
432
- size32: ft,
433
- size40: pt,
434
- size48: bt,
435
- error: vt
436
- }, gt = {
437
- 24: I.size24,
438
- 32: I.size32,
439
- 40: I.size40,
440
- 48: I.size48
459
+ const jt = "_input_hpei8_3", It = "_size24_hpei8_37", Tt = "_size32_hpei8_43", Et = "_size40_hpei8_49", Mt = "_size48_hpei8_55", Wt = "_error_hpei8_63", A = {
460
+ input: jt,
461
+ size24: It,
462
+ size32: Tt,
463
+ size40: Et,
464
+ size48: Mt,
465
+ error: Wt
466
+ }, At = {
467
+ 24: A.size24,
468
+ 32: A.size32,
469
+ 40: A.size40,
470
+ 48: A.size48
441
471
  };
442
- function uo({ size: e = 32, error: t = !1, type: s = "text", className: i, ref: c, ...r }) {
443
- const o = B(Z), a = t || ((o == null ? void 0 : o.invalid) ?? !1), d = [o == null ? void 0 : o.describedBy, r["aria-describedby"]].filter(Boolean).join(" ") || void 0, l = [I.input, gt[e], a && I.error, i].filter(Boolean).join(" ");
472
+ function Oo({ size: e = 32, error: t = !1, type: i = "text", className: a, ref: c, ...r }) {
473
+ const o = z(te), s = t || ((o == null ? void 0 : o.invalid) ?? !1), d = [o == null ? void 0 : o.describedBy, r["aria-describedby"]].filter(Boolean).join(" ") || void 0, l = [A.input, At[e], s && A.error, a].filter(Boolean).join(" ");
444
474
  return /* @__PURE__ */ n(
445
475
  "input",
446
476
  {
@@ -449,43 +479,43 @@ function uo({ size: e = 32, error: t = !1, type: s = "text", className: i, ref:
449
479
  id: r.id ?? (o == null ? void 0 : o.id),
450
480
  required: r.required ?? ((o == null ? void 0 : o.required) || void 0),
451
481
  "aria-invalid": (o == null ? void 0 : o.invalid) || void 0,
452
- type: s,
482
+ type: i,
453
483
  ...r,
454
484
  "aria-describedby": d
455
485
  }
456
486
  );
457
487
  }
458
- const yt = "_select_4x9ck_3", wt = "_size24_4x9ck_37", mt = "_size32_4x9ck_45", kt = "_size40_4x9ck_53", xt = "_size48_4x9ck_61", Ct = "_error_4x9ck_71", M = {
459
- select: yt,
460
- size24: wt,
461
- size32: mt,
462
- size40: kt,
463
- size48: xt,
464
- error: Ct
465
- }, Bt = {
466
- 24: M.size24,
467
- 32: M.size32,
468
- 40: M.size40,
469
- 48: M.size48
488
+ const Pt = "_select_4x9ck_3", Dt = "_size24_4x9ck_37", Rt = "_size32_4x9ck_45", Ht = "_size40_4x9ck_53", Vt = "_size48_4x9ck_61", qt = "_error_4x9ck_71", P = {
489
+ select: Pt,
490
+ size24: Dt,
491
+ size32: Rt,
492
+ size40: Ht,
493
+ size48: Vt,
494
+ error: qt
495
+ }, Ft = {
496
+ 24: P.size24,
497
+ 32: P.size32,
498
+ 40: P.size40,
499
+ 48: P.size48
470
500
  };
471
- function ho({
501
+ function Ko({
472
502
  size: e = 32,
473
503
  error: t = !1,
474
- className: s,
475
- ref: i,
504
+ className: i,
505
+ ref: a,
476
506
  children: c,
477
507
  ...r
478
508
  }) {
479
- const o = B(Z), a = t || ((o == null ? void 0 : o.invalid) ?? !1), d = [o == null ? void 0 : o.describedBy, r["aria-describedby"]].filter(Boolean).join(" ") || void 0, l = [
480
- M.select,
481
- Bt[e],
482
- a && M.error,
483
- s
509
+ const o = z(te), s = t || ((o == null ? void 0 : o.invalid) ?? !1), d = [o == null ? void 0 : o.describedBy, r["aria-describedby"]].filter(Boolean).join(" ") || void 0, l = [
510
+ P.select,
511
+ Ft[e],
512
+ s && P.error,
513
+ i
484
514
  ].filter(Boolean).join(" ");
485
515
  return /* @__PURE__ */ n(
486
516
  "select",
487
517
  {
488
- ref: i,
518
+ ref: a,
489
519
  className: l,
490
520
  id: r.id ?? (o == null ? void 0 : o.id),
491
521
  required: r.required ?? ((o == null ? void 0 : o.required) || void 0),
@@ -496,114 +526,114 @@ function ho({
496
526
  }
497
527
  );
498
528
  }
499
- const $t = "_label_1v4vv_3", zt = "_disabled_1v4vv_13", jt = "_input_1v4vv_20", Lt = "_indicator_1v4vv_34", Nt = "_text_1v4vv_75", A = {
500
- label: $t,
501
- disabled: zt,
502
- input: jt,
503
- indicator: Lt,
504
- text: Nt
529
+ const Ot = "_label_1v4vv_3", Kt = "_disabled_1v4vv_13", Ut = "_input_1v4vv_20", Yt = "_indicator_1v4vv_34", Zt = "_text_1v4vv_75", q = {
530
+ label: Ot,
531
+ disabled: Kt,
532
+ input: Ut,
533
+ indicator: Yt,
534
+ text: Zt
505
535
  };
506
- function te({
536
+ function he({
507
537
  children: e,
508
538
  className: t,
509
- disabled: s,
510
- ref: i,
539
+ disabled: i,
540
+ ref: a,
511
541
  ...c
512
542
  }) {
513
- const r = [A.label, s && A.disabled, t].filter(Boolean).join(" ");
514
- return /* @__PURE__ */ _("label", { className: r, children: [
543
+ const r = [q.label, i && q.disabled, t].filter(Boolean).join(" ");
544
+ return /* @__PURE__ */ p("label", { className: r, children: [
515
545
  /* @__PURE__ */ n(
516
546
  "input",
517
547
  {
518
- ref: i,
548
+ ref: a,
519
549
  type: "checkbox",
520
- className: A.input,
521
- disabled: s,
550
+ className: q.input,
551
+ disabled: i,
522
552
  ...c
523
553
  }
524
554
  ),
525
- /* @__PURE__ */ n("span", { className: A.indicator, "aria-hidden": "true" }),
526
- e && /* @__PURE__ */ n("span", { className: A.text, children: e })
555
+ /* @__PURE__ */ n("span", { className: q.indicator, "aria-hidden": "true" }),
556
+ e && /* @__PURE__ */ n("span", { className: q.text, children: e })
527
557
  ] });
528
558
  }
529
- const St = "_label_jru2c_3", It = "_disabled_jru2c_13", Mt = "_input_jru2c_20", Et = "_track_jru2c_34", Tt = "_thumb_jru2c_58", Wt = "_text_jru2c_75", S = {
530
- label: St,
531
- disabled: It,
532
- input: Mt,
533
- track: Et,
534
- thumb: Tt,
535
- text: Wt
559
+ const Gt = "_label_jru2c_3", Xt = "_disabled_jru2c_13", Jt = "_input_jru2c_20", Qt = "_track_jru2c_34", en = "_thumb_jru2c_58", tn = "_text_jru2c_75", M = {
560
+ label: Gt,
561
+ disabled: Xt,
562
+ input: Jt,
563
+ track: Qt,
564
+ thumb: en,
565
+ text: tn
536
566
  };
537
- function _o({
567
+ function Uo({
538
568
  children: e,
539
569
  className: t,
540
- disabled: s,
541
- ref: i,
570
+ disabled: i,
571
+ ref: a,
542
572
  ...c
543
573
  }) {
544
- const r = [S.label, s && S.disabled, t].filter(Boolean).join(" ");
545
- return /* @__PURE__ */ _("label", { className: r, children: [
574
+ const r = [M.label, i && M.disabled, t].filter(Boolean).join(" ");
575
+ return /* @__PURE__ */ p("label", { className: r, children: [
546
576
  /* @__PURE__ */ n(
547
577
  "input",
548
578
  {
549
- ref: i,
579
+ ref: a,
550
580
  type: "checkbox",
551
581
  role: "switch",
552
- className: S.input,
553
- disabled: s,
582
+ className: M.input,
583
+ disabled: i,
554
584
  ...c
555
585
  }
556
586
  ),
557
- /* @__PURE__ */ n("span", { className: S.track, "aria-hidden": "true", children: /* @__PURE__ */ n("span", { className: S.thumb }) }),
558
- e && /* @__PURE__ */ n("span", { className: S.text, children: e })
587
+ /* @__PURE__ */ n("span", { className: M.track, "aria-hidden": "true", children: /* @__PURE__ */ n("span", { className: M.thumb }) }),
588
+ e && /* @__PURE__ */ n("span", { className: M.text, children: e })
559
589
  ] });
560
590
  }
561
- const At = "_tag_3oysa_3", Pt = "_dismiss_3oysa_17", Ht = "_neutral_3oysa_43", Rt = "_accent_3oysa_48", Dt = "_success_3oysa_53", Vt = "_warning_3oysa_58", qt = "_danger_3oysa_63", Ft = "_neutralSubtle_3oysa_70", Kt = "_accentSubtle_3oysa_75", Ot = "_successSubtle_3oysa_80", Ut = "_warningSubtle_3oysa_85", Yt = "_dangerSubtle_3oysa_90", m = {
562
- tag: At,
563
- dismiss: Pt,
564
- neutral: Ht,
565
- accent: Rt,
566
- success: Dt,
567
- warning: Vt,
568
- danger: qt,
569
- neutralSubtle: Ft,
570
- accentSubtle: Kt,
571
- successSubtle: Ot,
572
- warningSubtle: Ut,
573
- dangerSubtle: Yt
574
- }, Zt = {
575
- neutral: m.neutral,
576
- accent: m.accent,
577
- success: m.success,
578
- warning: m.warning,
579
- danger: m.danger
580
- }, Gt = {
581
- neutral: m.neutralSubtle,
582
- accent: m.accentSubtle,
583
- success: m.successSubtle,
584
- warning: m.warningSubtle,
585
- danger: m.dangerSubtle
591
+ const nn = "_tag_3oysa_3", on = "_dismiss_3oysa_17", rn = "_neutral_3oysa_43", sn = "_accent_3oysa_48", an = "_success_3oysa_53", cn = "_warning_3oysa_58", ln = "_danger_3oysa_63", dn = "_neutralSubtle_3oysa_70", un = "_accentSubtle_3oysa_75", hn = "_successSubtle_3oysa_80", _n = "_warningSubtle_3oysa_85", fn = "_dangerSubtle_3oysa_90", C = {
592
+ tag: nn,
593
+ dismiss: on,
594
+ neutral: rn,
595
+ accent: sn,
596
+ success: an,
597
+ warning: cn,
598
+ danger: ln,
599
+ neutralSubtle: dn,
600
+ accentSubtle: un,
601
+ successSubtle: hn,
602
+ warningSubtle: _n,
603
+ dangerSubtle: fn
604
+ }, pn = {
605
+ neutral: C.neutral,
606
+ accent: C.accent,
607
+ success: C.success,
608
+ warning: C.warning,
609
+ danger: C.danger
610
+ }, vn = {
611
+ neutral: C.neutralSubtle,
612
+ accent: C.accentSubtle,
613
+ success: C.successSubtle,
614
+ warning: C.warningSubtle,
615
+ danger: C.dangerSubtle
586
616
  };
587
- function fo({
617
+ function Yo({
588
618
  variant: e = "neutral",
589
619
  subtle: t = !1,
590
- onDismiss: s,
591
- className: i,
620
+ onDismiss: i,
621
+ className: a,
592
622
  children: c,
593
623
  ref: r,
594
624
  ...o
595
625
  }) {
596
- const a = t ? Gt : Zt, d = [m.tag, a[e], i].filter(Boolean).join(" ");
597
- return /* @__PURE__ */ _("span", { ref: r, className: d, ...o, children: [
626
+ const s = t ? vn : pn, d = [C.tag, s[e], a].filter(Boolean).join(" ");
627
+ return /* @__PURE__ */ p("span", { ref: r, className: d, ...o, children: [
598
628
  c,
599
- s && /* @__PURE__ */ n(
629
+ i && /* @__PURE__ */ n(
600
630
  "button",
601
631
  {
602
632
  type: "button",
603
- className: m.dismiss,
604
- onClick: s,
633
+ className: C.dismiss,
634
+ onClick: i,
605
635
  "aria-label": "Dismiss",
606
- children: /* @__PURE__ */ _(
636
+ children: /* @__PURE__ */ p(
607
637
  "svg",
608
638
  {
609
639
  width: "12",
@@ -625,93 +655,93 @@ function fo({
625
655
  )
626
656
  ] });
627
657
  }
628
- const Xt = "_wrapper_1eu6z_3", Jt = "_tooltip_1eu6z_10", Qt = "_top_1eu6z_24", en = "_bottom_1eu6z_31", tn = "_left_1eu6z_38", nn = "_right_1eu6z_45", E = {
629
- wrapper: Xt,
630
- tooltip: Jt,
631
- top: Qt,
632
- bottom: en,
633
- left: tn,
634
- right: nn
635
- }, on = {
636
- top: E.top,
637
- bottom: E.bottom,
638
- left: E.left,
639
- right: E.right
640
- }, rn = 150;
641
- function po({
658
+ const gn = "_wrapper_1eu6z_3", bn = "_tooltip_1eu6z_10", yn = "_top_1eu6z_24", mn = "_bottom_1eu6z_31", wn = "_left_1eu6z_38", kn = "_right_1eu6z_45", D = {
659
+ wrapper: gn,
660
+ tooltip: bn,
661
+ top: yn,
662
+ bottom: mn,
663
+ left: wn,
664
+ right: kn
665
+ }, xn = {
666
+ top: D.top,
667
+ bottom: D.bottom,
668
+ left: D.left,
669
+ right: D.right
670
+ }, Cn = 150;
671
+ function Zo({
642
672
  content: e,
643
673
  children: t,
644
- placement: s = "top"
674
+ placement: i = "top"
645
675
  }) {
646
- const [i, c] = se(!1), r = O(), o = z(void 0), a = C(() => {
676
+ const [a, c] = le(!1), r = U(), o = N(void 0), s = m(() => {
647
677
  o.current !== void 0 && (window.clearTimeout(o.current), o.current = void 0);
648
- }, []), d = C(() => c(!0), []), l = C(() => c(!1), []);
649
- x(() => a, [a]), x(() => {
650
- if (!i) return;
651
- const f = (h) => {
652
- h.key === "Escape" && l();
678
+ }, []), d = m(() => c(!0), []), l = m(() => c(!1), []);
679
+ S(() => s, [s]), S(() => {
680
+ if (!a) return;
681
+ const h = (_) => {
682
+ _.key === "Escape" && l();
653
683
  };
654
- return document.addEventListener("keydown", f), () => document.removeEventListener("keydown", f);
655
- }, [i, l]);
656
- const u = Y(t, {
657
- "aria-describedby": i ? r : void 0,
658
- onMouseEnter: (f) => {
659
- a(), o.current = window.setTimeout(d, rn);
660
- const h = t.props.onMouseEnter;
661
- h == null || h(f);
684
+ return document.addEventListener("keydown", h), () => document.removeEventListener("keydown", h);
685
+ }, [a, l]);
686
+ const u = ee(t, {
687
+ "aria-describedby": a ? r : void 0,
688
+ onMouseEnter: (h) => {
689
+ s(), o.current = window.setTimeout(d, Cn);
690
+ const _ = t.props.onMouseEnter;
691
+ _ == null || _(h);
662
692
  },
663
- onMouseLeave: (f) => {
664
- a(), l();
665
- const h = t.props.onMouseLeave;
666
- h == null || h(f);
693
+ onMouseLeave: (h) => {
694
+ s(), l();
695
+ const _ = t.props.onMouseLeave;
696
+ _ == null || _(h);
667
697
  },
668
- onFocus: (f) => {
698
+ onFocus: (h) => {
669
699
  d();
670
- const h = t.props.onFocus;
671
- h == null || h(f);
700
+ const _ = t.props.onFocus;
701
+ _ == null || _(h);
672
702
  },
673
- onBlur: (f) => {
674
- a(), l();
675
- const h = t.props.onBlur;
676
- h == null || h(f);
703
+ onBlur: (h) => {
704
+ s(), l();
705
+ const _ = t.props.onBlur;
706
+ _ == null || _(h);
677
707
  }
678
708
  });
679
- return /* @__PURE__ */ _("span", { className: E.wrapper, children: [
709
+ return /* @__PURE__ */ p("span", { className: D.wrapper, children: [
680
710
  u,
681
- i && /* @__PURE__ */ n(
711
+ a && /* @__PURE__ */ n(
682
712
  "span",
683
713
  {
684
714
  id: r,
685
715
  role: "tooltip",
686
- className: [E.tooltip, on[s]].filter(Boolean).join(" "),
716
+ className: [D.tooltip, xn[i]].filter(Boolean).join(" "),
687
717
  children: e
688
718
  }
689
719
  )
690
720
  ] });
691
721
  }
692
- const sn = "_toolbar_1i848_1", an = "_gap8_1i848_7", cn = "_gap12_1i848_8", ln = "_gap16_1i848_9", D = {
693
- toolbar: sn,
694
- gap8: an,
695
- gap12: cn,
696
- gap16: ln
697
- }, dn = { 8: D.gap8, 12: D.gap12, 16: D.gap16 };
698
- function bo({ gap: e = 8, className: t, children: s, ref: i, ...c }) {
699
- const r = [D.toolbar, dn[e], t].filter(Boolean).join(" ");
700
- return /* @__PURE__ */ n("div", { ref: i, role: c["aria-label"] != null ? "group" : void 0, className: r, ...c, children: s });
701
- }
702
- const un = "_trigger_vpa0u_4", hn = "_menu_vpa0u_16", _n = "_item_vpa0u_37", fn = "_separator_vpa0u_74", F = {
703
- trigger: un,
704
- menu: hn,
705
- item: _n,
706
- separator: fn
707
- }, pn = 500;
708
- function bn({ popoverRef: e, triggerRef: t, open: s, onEsc: i }) {
709
- const c = z(""), r = z(0), o = C(() => {
722
+ const Bn = "_toolbar_1i848_1", Nn = "_gap8_1i848_7", Sn = "_gap12_1i848_8", $n = "_gap16_1i848_9", Z = {
723
+ toolbar: Bn,
724
+ gap8: Nn,
725
+ gap12: Sn,
726
+ gap16: $n
727
+ }, Ln = { 8: Z.gap8, 12: Z.gap12, 16: Z.gap16 };
728
+ function Go({ gap: e = 8, className: t, children: i, ref: a, ...c }) {
729
+ const r = [Z.toolbar, Ln[e], t].filter(Boolean).join(" ");
730
+ return /* @__PURE__ */ n("div", { ref: a, role: c["aria-label"] != null ? "group" : void 0, className: r, ...c, children: i });
731
+ }
732
+ const zn = "_trigger_vpa0u_4", jn = "_menu_vpa0u_16", In = "_item_vpa0u_37", Tn = "_separator_vpa0u_74", J = {
733
+ trigger: zn,
734
+ menu: jn,
735
+ item: In,
736
+ separator: Tn
737
+ }, En = 500;
738
+ function Mn({ popoverRef: e, triggerRef: t, open: i, onEsc: a }) {
739
+ const c = N(""), r = N(0), o = m(() => {
710
740
  const l = e.current;
711
741
  return l ? Array.from(
712
742
  l.querySelectorAll('[data-psi-menu-item]:not([aria-disabled="true"])')
713
743
  ) : [];
714
- }, [e]), a = C(
744
+ }, [e]), s = m(
715
745
  (l) => {
716
746
  if (l) {
717
747
  for (const u of o()) u.tabIndex = u === l ? 0 : -1;
@@ -719,415 +749,614 @@ function bn({ popoverRef: e, triggerRef: t, open: s, onEsc: i }) {
719
749
  }
720
750
  },
721
751
  [o]
722
- ), d = C(() => {
752
+ ), d = m(() => {
723
753
  var u;
724
754
  const l = (u = t.current) == null ? void 0 : u.querySelector("button, a, [tabindex]");
725
755
  l == null || l.focus();
726
756
  }, [t]);
727
- return x(() => {
728
- if (!s) return;
757
+ return S(() => {
758
+ if (!i) return;
729
759
  const l = o();
730
- return a(l[0]), () => {
760
+ return s(l[0]), () => {
731
761
  var u;
732
762
  (u = e.current) != null && u.contains(document.activeElement) && d();
733
763
  };
734
- }, [s, e, o, a, d]), C(
764
+ }, [i, e, o, s, d]), m(
735
765
  (l) => {
736
766
  if (l.key === "Escape") {
737
- l.preventDefault(), i();
767
+ l.preventDefault(), a();
738
768
  return;
739
769
  }
740
770
  const u = o();
741
771
  if (u.length === 0) return;
742
- const f = u.indexOf(document.activeElement);
772
+ const h = u.indexOf(document.activeElement);
743
773
  switch (l.key) {
744
774
  case "ArrowDown":
745
- l.preventDefault(), a(u[(f + 1 + u.length) % u.length]);
775
+ l.preventDefault(), s(u[(h + 1 + u.length) % u.length]);
746
776
  return;
747
777
  case "ArrowUp":
748
- l.preventDefault(), a(u[f <= 0 ? u.length - 1 : f - 1]);
778
+ l.preventDefault(), s(u[h <= 0 ? u.length - 1 : h - 1]);
749
779
  return;
750
780
  case "Home":
751
- l.preventDefault(), a(u[0]);
781
+ l.preventDefault(), s(u[0]);
752
782
  return;
753
783
  case "End":
754
- l.preventDefault(), a(u[u.length - 1]);
784
+ l.preventDefault(), s(u[u.length - 1]);
755
785
  return;
756
786
  }
757
787
  if (l.key.length !== 1 || l.metaKey || l.ctrlKey || l.altKey) return;
758
- const h = Date.now();
759
- c.current = h - r.current > pn ? l.key.toLowerCase() : c.current + l.key.toLowerCase(), r.current = h;
760
- const y = u.find(
761
- (w) => (w.textContent ?? "").trim().toLowerCase().startsWith(c.current)
788
+ const _ = Date.now();
789
+ c.current = _ - r.current > En ? l.key.toLowerCase() : c.current + l.key.toLowerCase(), r.current = _;
790
+ const b = u.find(
791
+ (y) => (y.textContent ?? "").trim().toLowerCase().startsWith(c.current)
762
792
  );
763
- y && (l.preventDefault(), a(y));
793
+ b && (l.preventDefault(), s(b));
764
794
  },
765
- [o, a, i]
795
+ [o, s, a]
766
796
  );
767
797
  }
768
- function vn() {
798
+ function Wn() {
769
799
  return typeof CSS < "u" && CSS.supports("anchor-name", "--x");
770
800
  }
771
- function gn({ popoverRef: e, triggerRef: t, open: s, placement: i, anchorName: c }) {
772
- x(() => {
801
+ function An({ popoverRef: e, triggerRef: t, open: i, placement: a, anchorName: c }) {
802
+ S(() => {
773
803
  const r = t.current, o = e.current;
774
804
  !r || !o || (r.style.setProperty("anchor-name", c), o.style.setProperty("position-anchor", c));
775
- }, [e, t, c]), x(() => {
776
- if (!s || vn()) return;
805
+ }, [e, t, c]), S(() => {
806
+ if (!i || Wn()) return;
777
807
  const r = t.current, o = e.current;
778
808
  if (!r || !o) return;
779
- const a = () => {
780
- const d = r.getBoundingClientRect(), l = i.startsWith("bottom"), u = i.endsWith("end"), f = getComputedStyle(r).direction === "rtl", h = u !== f;
781
- o.style.position = "fixed", o.style.top = l ? `${d.bottom}px` : "", o.style.bottom = l ? "" : `${window.innerHeight - d.top}px`, o.style.left = h ? "" : `${d.left}px`, o.style.right = h ? `${window.innerWidth - d.right}px` : "";
809
+ const s = () => {
810
+ const d = r.getBoundingClientRect(), l = a.startsWith("bottom"), u = a.endsWith("end"), h = getComputedStyle(r).direction === "rtl", _ = u !== h;
811
+ o.style.position = "fixed", o.style.top = l ? `${d.bottom}px` : "", o.style.bottom = l ? "" : `${window.innerHeight - d.top}px`, o.style.left = _ ? "" : `${d.left}px`, o.style.right = _ ? `${window.innerWidth - d.right}px` : "";
782
812
  };
783
- return a(), window.addEventListener("scroll", a, !0), window.addEventListener("resize", a), () => {
784
- window.removeEventListener("scroll", a, !0), window.removeEventListener("resize", a);
813
+ return s(), window.addEventListener("scroll", s, !0), window.addEventListener("resize", s), () => {
814
+ window.removeEventListener("scroll", s, !0), window.removeEventListener("resize", s);
785
815
  };
786
- }, [s, i, e, t]);
816
+ }, [i, a, e, t]);
787
817
  }
788
- const ne = K({ close: () => {
818
+ const _e = K({ close: () => {
789
819
  } });
790
- function Q(e) {
820
+ function se(e) {
791
821
  return e.hasAttribute("data-open") || e.matches(":popover-open");
792
822
  }
793
- function vo({
823
+ function Xo({
794
824
  open: e,
795
825
  onClose: t,
796
- trigger: s,
797
- placement: i = "bottom-start",
826
+ trigger: i,
827
+ placement: a = "bottom-start",
798
828
  children: c,
799
829
  className: r,
800
830
  ref: o,
801
- ...a
831
+ ...s
802
832
  }) {
803
- const d = z(null), l = z(null), u = z(!1), f = `--psi-menu-${O().replace(/:/g, "")}`;
804
- gn({ popoverRef: d, triggerRef: l, open: e, placement: i, anchorName: f });
805
- const h = (v) => {
806
- d.current = v, typeof o == "function" ? o(v) : o && (o.current = v);
833
+ const d = N(null), l = N(null), u = N(!1), h = `--psi-menu-${U().replace(/:/g, "")}`;
834
+ An({ popoverRef: d, triggerRef: l, open: e, placement: a, anchorName: h });
835
+ const _ = (f) => {
836
+ d.current = f, typeof o == "function" ? o(f) : o && (o.current = f);
807
837
  };
808
- x(() => {
809
- const v = d.current;
810
- if (!v) return;
811
- const G = Q(v);
812
- e && !G ? v.showPopover() : !e && G && (u.current = !0, v.hidePopover());
838
+ S(() => {
839
+ const f = d.current;
840
+ if (!f) return;
841
+ const v = se(f);
842
+ e && !v ? f.showPopover() : !e && v && (u.current = !0, f.hidePopover());
813
843
  }, [e]);
814
- const y = C(() => {
815
- const v = d.current;
816
- if (v) {
844
+ const b = m(() => {
845
+ const f = d.current;
846
+ if (f) {
817
847
  if (u.current) {
818
848
  u.current = !1;
819
849
  return;
820
850
  }
821
- Q(v) || e && t("outside");
851
+ se(f) || e && t("outside");
822
852
  }
823
- }, [t, e]), w = bn({
853
+ }, [t, e]), y = Mn({
824
854
  popoverRef: d,
825
855
  triggerRef: l,
826
856
  open: e,
827
857
  onEsc: () => t("esc")
828
- }), j = C(
829
- (v) => {
830
- t(v);
858
+ }), j = m(
859
+ (f) => {
860
+ t(f);
831
861
  },
832
862
  [t]
833
- ), p = q(s);
834
- x(() => {
835
- p || console.warn(
863
+ ), x = O(i);
864
+ S(() => {
865
+ x || console.warn(
836
866
  "Psi Menu: `trigger` must be a single React element that forwards props to a focusable node. Menu clones it to attach aria-haspopup and aria-expanded; a string, fragment or array cannot carry them, so the menu renders without its trigger ARIA."
837
867
  );
838
- }, [p]);
839
- const R = p ? Y(s, { "aria-haspopup": "menu", "aria-expanded": e }) : s;
840
- return /* @__PURE__ */ _(V, { children: [
841
- /* @__PURE__ */ n("div", { ref: l, className: F.trigger, "data-psi-menu-trigger": !0, children: R }),
868
+ }, [x]);
869
+ const g = x ? ee(i, { "aria-haspopup": "menu", "aria-expanded": e }) : i;
870
+ return /* @__PURE__ */ p(G, { children: [
871
+ /* @__PURE__ */ n("div", { ref: l, className: J.trigger, "data-psi-menu-trigger": !0, children: g }),
842
872
  /* @__PURE__ */ n(
843
873
  "div",
844
874
  {
845
- ...a,
846
- ref: h,
875
+ ...s,
876
+ ref: _,
847
877
  popover: "auto",
848
878
  role: "menu",
849
879
  "data-psi-menu": !0,
850
- "data-placement": i,
851
- className: [F.menu, r].filter(Boolean).join(" "),
852
- onToggle: y,
853
- onKeyDown: w,
854
- children: /* @__PURE__ */ n(ne.Provider, { value: { close: j }, children: c })
880
+ "data-placement": a,
881
+ className: [J.menu, r].filter(Boolean).join(" "),
882
+ onToggle: b,
883
+ onKeyDown: y,
884
+ children: /* @__PURE__ */ n(_e.Provider, { value: { close: j }, children: c })
855
885
  }
856
886
  )
857
887
  ] });
858
888
  }
859
- function go({ children: e, onSelect: t, variant: s = "neutral", disabled: i = !1 }) {
860
- const { close: c } = B(ne);
889
+ function Jo({ children: e, onSelect: t, variant: i = "neutral", disabled: a = !1 }) {
890
+ const { close: c } = z(_e);
861
891
  return /* @__PURE__ */ n(
862
892
  "button",
863
893
  {
864
894
  type: "button",
865
895
  role: "menuitem",
866
896
  "data-psi-menu-item": !0,
867
- "data-variant": s,
868
- "aria-disabled": i || void 0,
897
+ "data-variant": i,
898
+ "aria-disabled": a || void 0,
869
899
  tabIndex: -1,
870
- className: F.item,
900
+ className: J.item,
871
901
  onClick: () => {
872
- i || (t(), c("item-select"));
902
+ a || (t(), c("item-select"));
873
903
  },
874
904
  children: e
875
905
  }
876
906
  );
877
907
  }
878
- function yo() {
879
- return /* @__PURE__ */ n("div", { role: "separator", "data-psi-menu-separator": !0, className: F.separator });
880
- }
881
- const yn = "_table_146hc_3", wn = "_headerCell_146hc_13", mn = "_cell_146hc_19", kn = "_sortButton_146hc_30", xn = "_sortIndicator_146hc_47", Cn = "_selectCell_146hc_79", Bn = "_body_146hc_86", $n = "_row_146hc_89", zn = "_sticky_146hc_111", g = {
882
- table: yn,
883
- headerCell: wn,
884
- cell: mn,
885
- sortButton: kn,
886
- sortIndicator: xn,
887
- selectCell: Cn,
888
- body: Bn,
889
- row: $n,
890
- sticky: zn
891
- }, oe = /* @__PURE__ */ new Set(), T = K({
908
+ function Qo() {
909
+ return /* @__PURE__ */ n("div", { role: "separator", "data-psi-menu-separator": !0, className: J.separator });
910
+ }
911
+ const Pn = "_table_146hc_3", Dn = "_headerCell_146hc_13", Rn = "_cell_146hc_19", Hn = "_sortButton_146hc_30", Vn = "_sortIndicator_146hc_47", qn = "_selectCell_146hc_79", Fn = "_body_146hc_86", On = "_row_146hc_89", Kn = "_sticky_146hc_111", k = {
912
+ table: Pn,
913
+ headerCell: Dn,
914
+ cell: Rn,
915
+ sortButton: Hn,
916
+ sortIndicator: Vn,
917
+ selectCell: qn,
918
+ body: Fn,
919
+ row: On,
920
+ sticky: Kn
921
+ }, fe = /* @__PURE__ */ new Set(), R = K({
892
922
  size: 40,
893
923
  sortable: !1,
894
924
  sort: null,
895
925
  selectable: !1,
896
- selected: oe
897
- }), re = K([]);
898
- function jn({ children: e, className: t }) {
899
- return /* @__PURE__ */ n("tbody", { className: [g.body, t].filter(Boolean).join(" "), children: e });
926
+ selected: fe
927
+ }), pe = K([]);
928
+ function Un({ children: e, className: t }) {
929
+ return /* @__PURE__ */ n("tbody", { className: [k.body, t].filter(Boolean).join(" "), children: e });
900
930
  }
901
- function Ln(e) {
931
+ function Yn(e) {
902
932
  const t = [];
903
- let s = !1, i = !1;
933
+ let i = !1, a = !1;
904
934
  const c = (r) => {
905
- H.forEach(r, function o(a) {
906
- if (!q(a)) return;
907
- if (a.type === X) {
908
- H.forEach(a.props.children, o);
935
+ W.forEach(r, function o(s) {
936
+ if (!O(s)) return;
937
+ if (s.type === re) {
938
+ W.forEach(s.props.children, o);
909
939
  return;
910
940
  }
911
- const d = a.props.rowId;
912
- typeof d == "string" ? t.push(d) : i = !0;
941
+ const d = s.props.rowId;
942
+ typeof d == "string" ? t.push(d) : a = !0;
913
943
  });
914
944
  };
915
- return H.forEach(e, function r(o) {
916
- if (q(o)) {
917
- if (o.type === X) {
918
- H.forEach(o.props.children, r);
945
+ return W.forEach(e, function r(o) {
946
+ if (O(o)) {
947
+ if (o.type === re) {
948
+ W.forEach(o.props.children, r);
919
949
  return;
920
950
  }
921
- o.type === jn && (s = !0, c(o.props.children));
951
+ o.type === Un && (i = !0, c(o.props.children));
922
952
  }
923
- }), { ids: t, sawBody: s, hasRowWithoutId: i };
953
+ }), { ids: t, sawBody: i, hasRowWithoutId: a };
924
954
  }
925
- function wo({
955
+ function er({
926
956
  size: e = 40,
927
957
  stickyHeader: t,
928
- sortable: s = !1,
929
- sort: i = null,
958
+ sortable: i = !1,
959
+ sort: a = null,
930
960
  onSortChange: c,
931
961
  selectable: r = !1,
932
- selected: o = oe,
933
- onSelectionChange: a,
962
+ selected: o = fe,
963
+ onSelectionChange: s,
934
964
  children: d,
935
965
  className: l,
936
966
  ref: u
937
967
  }) {
938
- const f = [g.table, t && g.sticky, l].filter(Boolean).join(" "), { ids: h, sawBody: y, hasRowWithoutId: w } = ie(() => Ln(d), [d]);
939
- return process.env.NODE_ENV !== "production" && (s && !c && console.warn("Psi Table: `sortable` is set without `onSortChange`; sorting will not respond."), r && !a && console.warn("Psi Table: `selectable` is set without `onSelectionChange`; selection will not respond."), r && !y && console.warn("Psi Table: `selectable` is set but no `TableBody` is visible to `Table`. Wrapping `TableBody` in a component other than a Fragment hides its rows, and select-all will clear the selection instead of filling it."), r && w && console.warn("Psi Table: `selectable` is set but a row in `TableBody` has no `rowId`. That row will render without a selection checkbox and select-all will not include it.")), /* @__PURE__ */ n(T.Provider, { value: { size: e, sortable: s, sort: i, onSortChange: c, selectable: r, selected: o, onSelectionChange: a }, children: /* @__PURE__ */ n(re.Provider, { value: h, children: /* @__PURE__ */ n("table", { ref: u, className: f, "data-size": e, children: d }) }) });
968
+ const h = [k.table, t && k.sticky, l].filter(Boolean).join(" "), { ids: _, sawBody: b, hasRowWithoutId: y } = de(() => Yn(d), [d]);
969
+ return process.env.NODE_ENV !== "production" && (i && !c && console.warn("Psi Table: `sortable` is set without `onSortChange`; sorting will not respond."), r && !s && console.warn("Psi Table: `selectable` is set without `onSelectionChange`; selection will not respond."), r && !b && console.warn("Psi Table: `selectable` is set but no `TableBody` is visible to `Table`. Wrapping `TableBody` in a component other than a Fragment hides its rows, and select-all will clear the selection instead of filling it."), r && y && console.warn("Psi Table: `selectable` is set but a row in `TableBody` has no `rowId`. That row will render without a selection checkbox and select-all will not include it.")), /* @__PURE__ */ n(R.Provider, { value: { size: e, sortable: i, sort: a, onSortChange: c, selectable: r, selected: o, onSelectionChange: s }, children: /* @__PURE__ */ n(pe.Provider, { value: _, children: /* @__PURE__ */ n("table", { ref: u, className: h, "data-size": e, children: d }) }) });
940
970
  }
941
- function Nn({ rowId: e, label: t }) {
942
- const { selected: s, onSelectionChange: i } = B(T), c = () => {
943
- const r = new Set(s);
944
- r.has(e) ? r.delete(e) : r.add(e), i == null || i(r);
971
+ function Zn({ rowId: e, label: t }) {
972
+ const { selected: i, onSelectionChange: a } = z(R), c = () => {
973
+ const r = new Set(i);
974
+ r.has(e) ? r.delete(e) : r.add(e), a == null || a(r);
945
975
  };
946
- return /* @__PURE__ */ n("td", { className: `${g.cell} ${g.selectCell}`, children: /* @__PURE__ */ n(te, { "aria-label": t, checked: s.has(e), onChange: c }) });
976
+ return /* @__PURE__ */ n("td", { className: `${k.cell} ${k.selectCell}`, children: /* @__PURE__ */ n(he, { "aria-label": t, checked: i.has(e), onChange: c }) });
947
977
  }
948
- function Sn() {
949
- const { selected: e, onSelectionChange: t } = B(T), s = B(re), i = z(null), c = s.length > 0 && s.every((a) => e.has(a)), r = s.some((a) => e.has(a));
950
- x(() => {
951
- i.current && (i.current.indeterminate = r && !c);
978
+ function Gn() {
979
+ const { selected: e, onSelectionChange: t } = z(R), i = z(pe), a = N(null), c = i.length > 0 && i.every((s) => e.has(s)), r = i.some((s) => e.has(s));
980
+ S(() => {
981
+ a.current && (a.current.indeterminate = r && !c);
952
982
  }, [r, c]);
953
983
  const o = () => {
954
- const a = new Set(e);
955
- c ? s.forEach((d) => a.delete(d)) : s.forEach((d) => a.add(d)), t == null || t(a);
984
+ const s = new Set(e);
985
+ c ? i.forEach((d) => s.delete(d)) : i.forEach((d) => s.add(d)), t == null || t(s);
956
986
  };
957
- return /* @__PURE__ */ n("th", { scope: "col", className: `${g.headerCell} ${g.selectCell}`, children: /* @__PURE__ */ n(te, { ref: i, "aria-label": "Select all rows", checked: c, onChange: o }) });
958
- }
959
- function mo({ children: e, className: t }) {
960
- const { selectable: s } = B(T);
961
- let i = !1;
962
- const c = s ? H.map(e, (r) => {
963
- if (i || !q(r)) return r;
964
- i = !0;
987
+ return /* @__PURE__ */ n("th", { scope: "col", className: `${k.headerCell} ${k.selectCell}`, children: /* @__PURE__ */ n(he, { ref: a, "aria-label": "Select all rows", checked: c, onChange: o }) });
988
+ }
989
+ function tr({ children: e, className: t }) {
990
+ const { selectable: i } = z(R);
991
+ let a = !1;
992
+ const c = i ? W.map(e, (r) => {
993
+ if (a || !O(r)) return r;
994
+ a = !0;
965
995
  const o = r;
966
- return Y(
996
+ return ee(
967
997
  o,
968
998
  void 0,
969
- /* @__PURE__ */ _(V, { children: [
970
- /* @__PURE__ */ n(Sn, {}),
999
+ /* @__PURE__ */ p(G, { children: [
1000
+ /* @__PURE__ */ n(Gn, {}),
971
1001
  o.props.children
972
1002
  ] })
973
1003
  );
974
1004
  }) : e;
975
- return /* @__PURE__ */ n("thead", { className: [g.head, t].filter(Boolean).join(" "), children: c });
1005
+ return /* @__PURE__ */ n("thead", { className: [k.head, t].filter(Boolean).join(" "), children: c });
976
1006
  }
977
- function ko({ rowId: e, selectLabel: t, children: s, className: i }) {
978
- const { selectable: c, selected: r } = B(T), o = e !== void 0 && r.has(e);
979
- return /* @__PURE__ */ _(
1007
+ function nr({ rowId: e, selectLabel: t, children: i, className: a }) {
1008
+ const { selectable: c, selected: r } = z(R), o = e !== void 0 && r.has(e);
1009
+ return /* @__PURE__ */ p(
980
1010
  "tr",
981
1011
  {
982
- className: [g.row, i].filter(Boolean).join(" "),
1012
+ className: [k.row, a].filter(Boolean).join(" "),
983
1013
  "data-row-id": e,
984
1014
  "data-selected": o || void 0,
985
1015
  children: [
986
- c && e !== void 0 && /* @__PURE__ */ n(Nn, { rowId: e, label: t ?? `Select row ${e}` }),
987
- s
1016
+ c && e !== void 0 && /* @__PURE__ */ n(Zn, { rowId: e, label: t ?? `Select row ${e}` }),
1017
+ i
988
1018
  ]
989
1019
  }
990
1020
  );
991
1021
  }
992
- function xo({ sortKey: e, numeric: t, children: s, className: i }) {
993
- const { sortable: c, sort: r, onSortChange: o } = B(T), a = c && e !== void 0, d = a && (r == null ? void 0 : r.key) === e, l = a ? d ? r.direction === "asc" ? "ascending" : "descending" : "none" : void 0, u = () => {
1022
+ function or({ sortKey: e, numeric: t, children: i, className: a }) {
1023
+ const { sortable: c, sort: r, onSortChange: o } = z(R), s = c && e !== void 0, d = s && (r == null ? void 0 : r.key) === e, l = s ? d ? r.direction === "asc" ? "ascending" : "descending" : "none" : void 0, u = () => {
994
1024
  if (!e) return;
995
- const f = d && r.direction === "asc" ? "desc" : "asc";
996
- o == null || o({ key: e, direction: f });
1025
+ const h = d && r.direction === "asc" ? "desc" : "asc";
1026
+ o == null || o({ key: e, direction: h });
997
1027
  };
998
1028
  return /* @__PURE__ */ n(
999
1029
  "th",
1000
1030
  {
1001
1031
  scope: "col",
1002
- className: [g.headerCell, i].filter(Boolean).join(" "),
1032
+ className: [k.headerCell, a].filter(Boolean).join(" "),
1003
1033
  "data-numeric": t || void 0,
1004
1034
  "aria-sort": l,
1005
- children: a ? /* @__PURE__ */ _("button", { type: "button", className: g.sortButton, onClick: u, children: [
1006
- s,
1007
- /* @__PURE__ */ n("span", { className: g.sortIndicator, "aria-hidden": "true", children: d ? r.direction === "asc" ? "↑" : "↓" : "" })
1008
- ] }) : s
1035
+ children: s ? /* @__PURE__ */ p("button", { type: "button", className: k.sortButton, onClick: u, children: [
1036
+ i,
1037
+ /* @__PURE__ */ n("span", { className: k.sortIndicator, "aria-hidden": "true", children: d ? r.direction === "asc" ? "↑" : "↓" : "" })
1038
+ ] }) : i
1009
1039
  }
1010
1040
  );
1011
1041
  }
1012
- function Co({ numeric: e, children: t, className: s }) {
1013
- return /* @__PURE__ */ n("td", { className: [g.cell, s].filter(Boolean).join(" "), "data-numeric": e || void 0, children: t });
1042
+ function rr({ numeric: e, children: t, className: i }) {
1043
+ return /* @__PURE__ */ n("td", { className: [k.cell, i].filter(Boolean).join(" "), "data-numeric": e || void 0, children: t });
1014
1044
  }
1015
- const In = "_nav_166vs_6", Mn = "_ellipsis_166vs_12", ee = {
1016
- nav: In,
1017
- ellipsis: Mn
1045
+ const Xn = "_nav_166vs_6", Jn = "_ellipsis_166vs_12", ae = {
1046
+ nav: Xn,
1047
+ ellipsis: Jn
1018
1048
  };
1019
- function P(e, t) {
1020
- return Array.from({ length: t - e + 1 }, (s, i) => e + i);
1049
+ function F(e, t) {
1050
+ return Array.from({ length: t - e + 1 }, (i, a) => e + a);
1021
1051
  }
1022
- function En(e, t, s) {
1023
- const i = Math.max(0, s), c = i * 2 + 1, r = c + 4;
1052
+ function Qn(e, t, i) {
1053
+ const a = Math.max(0, i), c = a * 2 + 1, r = c + 4;
1024
1054
  if (t <= r)
1025
- return P(1, t);
1026
- const o = Math.max(e - i, 1), a = Math.min(e + i, t), d = o > 3, l = a < t - 2;
1055
+ return F(1, t);
1056
+ const o = Math.max(e - a, 1), s = Math.min(e + a, t), d = o > 3, l = s < t - 2;
1027
1057
  if (!d && l) {
1028
- const u = Math.max(a, c);
1029
- return [...P(1, u), "ellipsis", t];
1058
+ const u = Math.max(s, c);
1059
+ return [...F(1, u), "ellipsis", t];
1030
1060
  }
1031
1061
  if (d && !l) {
1032
1062
  const u = Math.min(o, t - c + 1);
1033
- return [1, "ellipsis", ...P(u, t)];
1063
+ return [1, "ellipsis", ...F(u, t)];
1034
1064
  }
1035
- return d && l ? [1, "ellipsis", ...P(o, a), "ellipsis", t] : P(1, t);
1065
+ return d && l ? [1, "ellipsis", ...F(o, s), "ellipsis", t] : F(1, t);
1036
1066
  }
1037
- function Bo({
1067
+ function ir({
1038
1068
  page: e,
1039
1069
  pageCount: t,
1040
- onPageChange: s,
1041
- siblingCount: i = 1,
1070
+ onPageChange: i,
1071
+ siblingCount: a = 1,
1042
1072
  "aria-label": c = "Pagination",
1043
1073
  className: r
1044
1074
  }) {
1045
- const o = En(e, t, i);
1046
- return /* @__PURE__ */ _("nav", { "aria-label": c, className: [ee.nav, r].filter(Boolean).join(" "), children: [
1075
+ const o = Qn(e, t, a);
1076
+ return /* @__PURE__ */ p("nav", { "aria-label": c, className: [ae.nav, r].filter(Boolean).join(" "), children: [
1047
1077
  /* @__PURE__ */ n(
1048
- U,
1078
+ X,
1049
1079
  {
1050
1080
  "aria-label": "Previous page",
1051
1081
  size: 32,
1052
1082
  variant: "ghost",
1053
1083
  disabled: e <= 1,
1054
- onClick: () => s(e - 1),
1084
+ onClick: () => i(e - 1),
1055
1085
  children: /* @__PURE__ */ n("svg", { "aria-hidden": "true", viewBox: "0 0 16 16", width: "16", height: "16", children: /* @__PURE__ */ n("path", { d: "M10 3 5 8l5 5", fill: "none", stroke: "currentColor", strokeWidth: "1.5" }) })
1056
1086
  }
1057
1087
  ),
1058
1088
  o.map(
1059
- (a, d) => a === "ellipsis" ? /* @__PURE__ */ n("span", { className: ee.ellipsis, "aria-hidden": "true", children: "…" }, `e${d}`) : /* @__PURE__ */ n(
1060
- xe,
1089
+ (s, d) => s === "ellipsis" ? /* @__PURE__ */ n("span", { className: ae.ellipsis, "aria-hidden": "true", children: "…" }, `e${d}`) : /* @__PURE__ */ n(
1090
+ Me,
1061
1091
  {
1062
1092
  size: 32,
1063
- variant: a === e ? "accent-subtle" : "ghost",
1064
- "aria-current": a === e ? "page" : void 0,
1065
- onClick: () => s(a),
1066
- children: String(a)
1093
+ variant: s === e ? "accent-subtle" : "ghost",
1094
+ "aria-current": s === e ? "page" : void 0,
1095
+ onClick: () => i(s),
1096
+ children: String(s)
1067
1097
  },
1068
- a
1098
+ s
1069
1099
  )
1070
1100
  ),
1071
1101
  /* @__PURE__ */ n(
1072
- U,
1102
+ X,
1073
1103
  {
1074
1104
  "aria-label": "Next page",
1075
1105
  size: 32,
1076
1106
  variant: "ghost",
1077
1107
  disabled: e >= t,
1078
- onClick: () => s(e + 1),
1108
+ onClick: () => i(e + 1),
1079
1109
  children: /* @__PURE__ */ n("svg", { "aria-hidden": "true", viewBox: "0 0 16 16", width: "16", height: "16", children: /* @__PURE__ */ n("path", { d: "m6 3 5 5-5 5", fill: "none", stroke: "currentColor", strokeWidth: "1.5" }) })
1080
1110
  }
1081
1111
  )
1082
1112
  ] });
1083
1113
  }
1114
+ const eo = "_toast_7toru_10", to = "_icon_7toru_39", no = "_iconNeutral_7toru_44", oo = "_iconSuccess_7toru_45", ro = "_iconWarning_7toru_46", io = "_iconDanger_7toru_47", so = "_body_7toru_51", ao = "_action_7toru_55", co = "_srOnly_7toru_60", lo = "_region_7toru_74", uo = "_live_7toru_104", B = {
1115
+ toast: eo,
1116
+ icon: to,
1117
+ iconNeutral: no,
1118
+ iconSuccess: oo,
1119
+ iconWarning: ro,
1120
+ iconDanger: io,
1121
+ body: so,
1122
+ action: ao,
1123
+ srOnly: co,
1124
+ region: lo,
1125
+ live: uo
1126
+ }, ho = {
1127
+ neutral: pt,
1128
+ success: ft,
1129
+ warning: vt,
1130
+ danger: gt
1131
+ }, _o = {
1132
+ neutral: null,
1133
+ success: "Success:",
1134
+ warning: "Warning:",
1135
+ danger: "Error:"
1136
+ }, fo = {
1137
+ neutral: B.iconNeutral,
1138
+ success: B.iconSuccess,
1139
+ warning: B.iconWarning,
1140
+ danger: B.iconDanger
1141
+ };
1142
+ function ve({
1143
+ variant: e = "neutral",
1144
+ children: t,
1145
+ action: i,
1146
+ onDismiss: a,
1147
+ className: c,
1148
+ ref: r
1149
+ }) {
1150
+ const o = ho[e], s = _o[e], d = [B.toast, c].filter(Boolean).join(" ");
1151
+ return /* @__PURE__ */ p("div", { ref: r, className: d, "data-variant": e, "data-psi-toast": !0, children: [
1152
+ /* @__PURE__ */ n("span", { className: [B.icon, fo[e]].join(" "), children: /* @__PURE__ */ n(o, { size: 20, "aria-hidden": "true" }) }),
1153
+ /* @__PURE__ */ p("div", { className: B.body, children: [
1154
+ s && /* @__PURE__ */ n("span", { className: B.srOnly, children: s }),
1155
+ t
1156
+ ] }),
1157
+ i != null && /* @__PURE__ */ n("div", { className: B.action, children: i }),
1158
+ a && /* @__PURE__ */ n(
1159
+ X,
1160
+ {
1161
+ variant: "ghost",
1162
+ size: 32,
1163
+ "aria-label": "Dismiss notification",
1164
+ onClick: a,
1165
+ children: /* @__PURE__ */ n(ue, { "aria-hidden": "true" })
1166
+ }
1167
+ )
1168
+ ] });
1169
+ }
1170
+ const po = /* @__PURE__ */ new Set(["warning", "danger"]);
1171
+ function ce(e) {
1172
+ if (!O(e) || e.type !== ve) return !1;
1173
+ const { variant: t } = e.props;
1174
+ return po.has(t ?? "neutral");
1175
+ }
1176
+ function vo({
1177
+ placement: e = "bottom-end",
1178
+ "aria-label": t = "Notifications",
1179
+ children: i,
1180
+ className: a,
1181
+ ref: c
1182
+ }) {
1183
+ const r = N(null), o = (u) => {
1184
+ r.current = u, typeof c == "function" ? c(u) : c && (c.current = u);
1185
+ };
1186
+ S(() => {
1187
+ var h;
1188
+ const u = r.current;
1189
+ if (u)
1190
+ return (h = u.showPopover) == null || h.call(u), () => {
1191
+ var _;
1192
+ (_ = u.hidePopover) == null || _.call(u);
1193
+ };
1194
+ }, []);
1195
+ const s = W.toArray(i), d = s.filter(ce), l = s.filter((u) => !ce(u));
1196
+ return /* @__PURE__ */ p(
1197
+ "div",
1198
+ {
1199
+ ref: o,
1200
+ popover: "manual",
1201
+ "aria-label": t,
1202
+ "data-placement": e,
1203
+ "data-psi-toast-region": !0,
1204
+ className: [B.region, a].filter(Boolean).join(" "),
1205
+ children: [
1206
+ /* @__PURE__ */ n("div", { role: "status", "aria-live": "polite", className: B.live, children: l }),
1207
+ /* @__PURE__ */ n("div", { role: "alert", "aria-live": "assertive", className: B.live, children: d })
1208
+ ]
1209
+ }
1210
+ );
1211
+ }
1212
+ const ge = K(null);
1213
+ function sr() {
1214
+ const e = z(ge);
1215
+ if (!e)
1216
+ throw new Error(
1217
+ "Psi useToast: no ToastProvider found. Wrap your app (or the subtree that raises toasts) in <ToastProvider> — it owns the queue, the auto-dismiss timers and the single ToastRegion."
1218
+ );
1219
+ return e;
1220
+ }
1221
+ function ar({
1222
+ limit: e = 3,
1223
+ duration: t = 5e3,
1224
+ actionDuration: i = 1e4,
1225
+ placement: a = "bottom-end",
1226
+ children: c
1227
+ }) {
1228
+ const [r, o] = le([]), s = N(/* @__PURE__ */ new Map()), d = N(!1), l = N(0), u = U(), h = m((f) => {
1229
+ const v = s.current.get(f);
1230
+ (v == null ? void 0 : v.handle) !== void 0 && clearTimeout(v.handle), s.current.delete(f), o((I) => I.filter((H) => H.id !== f));
1231
+ }, []), _ = m(
1232
+ (f, v) => {
1233
+ const I = d.current ? { handle: void 0, remaining: v, startedAt: void 0 } : { handle: setTimeout(() => h(f), v), remaining: v, startedAt: Date.now() };
1234
+ s.current.set(f, I);
1235
+ },
1236
+ [h]
1237
+ ), b = m(
1238
+ ({ variant: f = "neutral", message: v, action: I }) => {
1239
+ const H = `${u}-${l.current++}`, ne = I != null ? i : t;
1240
+ return o((be) => {
1241
+ const Q = [...be, { id: H, variant: f, message: v, action: I, duration: ne }];
1242
+ for (; Q.length > e; ) {
1243
+ const oe = Q.shift(), Y = s.current.get(oe.id);
1244
+ (Y == null ? void 0 : Y.handle) !== void 0 && clearTimeout(Y.handle), s.current.delete(oe.id);
1245
+ }
1246
+ return Q;
1247
+ }), _(H, ne), H;
1248
+ },
1249
+ [i, _, t, u, e]
1250
+ ), y = m(() => {
1251
+ for (const f of s.current.values())
1252
+ f.handle !== void 0 && clearTimeout(f.handle);
1253
+ s.current.clear(), o([]);
1254
+ }, []), j = m(() => {
1255
+ if (!d.current) {
1256
+ d.current = !0;
1257
+ for (const [f, v] of s.current) {
1258
+ if (v.handle === void 0) continue;
1259
+ clearTimeout(v.handle);
1260
+ const I = v.startedAt === void 0 ? 0 : Date.now() - v.startedAt;
1261
+ s.current.set(f, {
1262
+ handle: void 0,
1263
+ remaining: Math.max(0, v.remaining - I),
1264
+ startedAt: void 0
1265
+ });
1266
+ }
1267
+ }
1268
+ }, []), x = m(() => {
1269
+ if (d.current) {
1270
+ d.current = !1;
1271
+ for (const [f, v] of s.current)
1272
+ v.handle === void 0 && s.current.set(f, {
1273
+ handle: setTimeout(() => h(f), v.remaining),
1274
+ remaining: v.remaining,
1275
+ startedAt: Date.now()
1276
+ });
1277
+ }
1278
+ }, [h]);
1279
+ S(() => {
1280
+ const f = s.current;
1281
+ return () => {
1282
+ for (const v of f.values())
1283
+ v.handle !== void 0 && clearTimeout(v.handle);
1284
+ f.clear();
1285
+ };
1286
+ }, []);
1287
+ const g = de(
1288
+ () => ({ show: b, dismiss: h, clear: y }),
1289
+ [b, h, y]
1290
+ );
1291
+ return /* @__PURE__ */ p(ge.Provider, { value: g, children: [
1292
+ c,
1293
+ /* @__PURE__ */ n(
1294
+ "div",
1295
+ {
1296
+ onPointerEnter: j,
1297
+ onPointerLeave: x,
1298
+ onFocusCapture: j,
1299
+ onBlurCapture: x,
1300
+ children: /* @__PURE__ */ n(vo, { placement: a, children: r.map((f) => /* @__PURE__ */ n(ve, { variant: f.variant, action: f.action, onDismiss: () => h(f.id), children: f.message }, f.id)) })
1301
+ }
1302
+ )
1303
+ ] });
1304
+ }
1084
1305
  export {
1085
- Rn as AspectRatio,
1086
- xe as Button,
1087
- An as Card,
1088
- te as Checkbox,
1089
- lo as Dialog,
1090
- Dn as Field,
1091
- oo as IconArrowDown,
1092
- ro as IconArrowUpRight,
1093
- U as IconButton,
1094
- Fn as IconCheck,
1095
- Kn as IconChevronDown,
1096
- On as IconChevronRight,
1097
- nt as IconClose,
1098
- Jn as IconCopy,
1099
- Gn as IconEdit,
1100
- Qn as IconExternalLink,
1101
- eo as IconEye,
1102
- to as IconEyeOff,
1103
- io as IconGitHub,
1104
- co as IconInstagram,
1105
- so as IconLinkedIn,
1106
- no as IconLoader,
1107
- qn as IconMinus,
1108
- Vn as IconPlus,
1109
- Un as IconSearch,
1110
- Yn as IconSettings,
1111
- Xn as IconTrash,
1112
- Zn as IconUser,
1113
- ao as IconX,
1114
- uo as Input,
1115
- vo as Menu,
1116
- ne as MenuContext,
1117
- go as MenuItem,
1118
- yo as MenuSeparator,
1119
- Hn as NavBar,
1120
- Bo as Pagination,
1121
- Pn as Panel,
1122
- ho as Select,
1123
- _o as Switch,
1124
- wo as Table,
1125
- jn as TableBody,
1126
- Co as TableCell,
1127
- mo as TableHead,
1128
- xo as TableHeaderCell,
1129
- ko as TableRow,
1130
- fo as Tag,
1131
- bo as Toolbar,
1132
- po as Tooltip
1306
+ ko as AspectRatio,
1307
+ Me as Button,
1308
+ yo as Card,
1309
+ he as Checkbox,
1310
+ Fo as Dialog,
1311
+ xo as Field,
1312
+ gt as IconAlertCircle,
1313
+ vt as IconAlertTriangle,
1314
+ Po as IconArrowDown,
1315
+ Do as IconArrowUpRight,
1316
+ X as IconButton,
1317
+ ft as IconCheck,
1318
+ No as IconChevronDown,
1319
+ So as IconChevronRight,
1320
+ ue as IconClose,
1321
+ To as IconCopy,
1322
+ jo as IconEdit,
1323
+ Eo as IconExternalLink,
1324
+ Mo as IconEye,
1325
+ Wo as IconEyeOff,
1326
+ Ho as IconGitHub,
1327
+ pt as IconInfo,
1328
+ qo as IconInstagram,
1329
+ Ro as IconLinkedIn,
1330
+ Ao as IconLoader,
1331
+ Bo as IconMinus,
1332
+ Co as IconPlus,
1333
+ $o as IconSearch,
1334
+ Lo as IconSettings,
1335
+ Io as IconTrash,
1336
+ zo as IconUser,
1337
+ Vo as IconX,
1338
+ Oo as Input,
1339
+ Xo as Menu,
1340
+ _e as MenuContext,
1341
+ Jo as MenuItem,
1342
+ Qo as MenuSeparator,
1343
+ wo as NavBar,
1344
+ ir as Pagination,
1345
+ mo as Panel,
1346
+ Ko as Select,
1347
+ Uo as Switch,
1348
+ er as Table,
1349
+ Un as TableBody,
1350
+ rr as TableCell,
1351
+ tr as TableHead,
1352
+ or as TableHeaderCell,
1353
+ nr as TableRow,
1354
+ Yo as Tag,
1355
+ ve as Toast,
1356
+ ge as ToastContext,
1357
+ ar as ToastProvider,
1358
+ vo as ToastRegion,
1359
+ Go as Toolbar,
1360
+ Zo as Tooltip,
1361
+ sr as useToast
1133
1362
  };