@mechane-ai/elements 0.11.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/README.md +23 -4
  2. package/dist/ai.js +167 -141
  3. package/dist/{categorical-values-FYc43JCa.js → categorical-values-DwobbjBq.js} +2 -2
  4. package/dist/{chart-frame-Bczk5sWj.js → chart-frame-DAxsgMyl.js} +4 -4
  5. package/dist/{chart-input-CbzVN76m.js → chart-input-B0snxbMH.js} +2 -2
  6. package/dist/charts/cartesian.js +6 -6
  7. package/dist/charts/distribution.js +2 -2
  8. package/dist/charts/graph.js +3 -3
  9. package/dist/charts/hierarchy.js +3 -3
  10. package/dist/charts/matrix.js +2 -2
  11. package/dist/charts/timeline.js +4 -4
  12. package/dist/charts.js +1 -1
  13. package/dist/{code-block-B7xzM3tD.js → code-block-VwrOHz5j.js} +2 -2
  14. package/dist/collections.js +402 -267
  15. package/dist/content/code.js +1 -1
  16. package/dist/content/diff.js +3 -3
  17. package/dist/content/link.js +1 -1
  18. package/dist/content/markdown.js +2 -2
  19. package/dist/content/tree.js +2 -2
  20. package/dist/{content-link-CatGOrbo.js → content-link-Oj-MtNYi.js} +1 -1
  21. package/dist/content.js +3 -4
  22. package/dist/elements.css +141 -96
  23. package/dist/feedback.js +1 -1
  24. package/dist/forms/dates.js +22 -23
  25. package/dist/forms.js +1 -1
  26. package/dist/index.js +1 -1
  27. package/dist/layout.js +223 -237
  28. package/dist/navigation/commands.js +3 -3
  29. package/dist/navigation.js +26 -12
  30. package/dist/overlays.js +1 -1
  31. package/dist/packages/ai/src/index.d.ts +2 -2
  32. package/dist/packages/ai/src/prompt-input.d.ts +4 -0
  33. package/dist/packages/collections/src/collection-controls.d.ts +1 -1
  34. package/dist/packages/collections/src/data-table.d.ts +24 -6
  35. package/dist/packages/collections/src/index.d.ts +2 -2
  36. package/dist/packages/core/src/actions.d.ts +5 -8
  37. package/dist/packages/feedback/src/async-region.d.ts +15 -9
  38. package/dist/packages/feedback/src/control-placeholders.d.ts +21 -0
  39. package/dist/packages/feedback/src/index.d.ts +4 -3
  40. package/dist/packages/forms/src/field-styles.d.ts +2 -74
  41. package/dist/packages/forms/src/form-actions.d.ts +11 -0
  42. package/dist/packages/forms/src/form-controls.d.ts +1 -1
  43. package/dist/packages/forms/src/forms.d.ts +3 -3
  44. package/dist/packages/forms/src/index.d.ts +2 -0
  45. package/dist/packages/forms/src/select.d.ts +2 -2
  46. package/dist/packages/forms/src/selection-styles.d.ts +0 -13
  47. package/dist/packages/foundations/src/control-styles.d.ts +122 -0
  48. package/dist/packages/foundations/src/style-composition.d.ts +0 -2
  49. package/dist/packages/foundations/src/tokens.stylex.d.ts +13 -2
  50. package/dist/packages/layout/src/frame.stylex.d.ts +0 -1
  51. package/dist/packages/layout/src/index.d.ts +2 -0
  52. package/dist/packages/layout/src/page-content.d.ts +5 -0
  53. package/dist/packages/layout/src/page-toolbar.d.ts +1 -1
  54. package/dist/packages/layout/src/sidebar.d.ts +3 -3
  55. package/dist/packages/navigation/src/index.d.ts +2 -2
  56. package/dist/packages/navigation/src/page-navigation.d.ts +5 -0
  57. package/dist/{pierre-diff--zsiHCCB.js → pierre-diff-sUAU-xeL.js} +1 -1
  58. package/dist/{pierre-theme-D9hnHv3Z.js → pierre-theme-CBAncKdH.js} +1 -1
  59. package/dist/{pierre-tree-D47uA7lb.js → pierre-tree-Db1yaDM2.js} +3 -3
  60. package/dist/src-B0UTwpOz.js +1003 -0
  61. package/dist/{src-D05isEh_.js → src-BNlyCwOr.js} +141 -69
  62. package/dist/{src-Cs0dRc4X.js → src-CVlgjAlw.js} +1 -1
  63. package/dist/src-DMsnWyru.js +1184 -0
  64. package/dist/tokens.js +18 -8
  65. package/package.json +1 -1
  66. package/packages/foundations/src/tokens.stylex.ts +15 -5
  67. package/dist/packages/feedback/src/loading.d.ts +0 -7
  68. package/dist/src-C_heP5kL.js +0 -1264
  69. package/dist/src-DXsGTJgv.js +0 -969
@@ -0,0 +1,1003 @@
1
+ import { O as e, i as t, s as n } from "./src-BNlyCwOr.js";
2
+ import { controls as r, layers as i, loading as a, spacing as o } from "./tokens.js";
3
+ import { t as s } from "./accessibility-C-aIZ1Yx.js";
4
+ import { mergeProps as c } from "@base-ui/react/merge-props";
5
+ import * as l from "@stylexjs/stylex";
6
+ import u, { createContext as d, useContext as f, useEffect as p, useRef as m, useState as h } from "react";
7
+ import { Fragment as ee, jsx as g, jsxs as _ } from "react/jsx-runtime";
8
+ import { Box as v, CircleCheck as y, CircleX as b, Info as te, LoaderCircle as x, TriangleAlert as S, X as C } from "lucide-react";
9
+ import { Meter as w } from "@base-ui/react/meter";
10
+ import { Progress as T } from "@base-ui/react/progress";
11
+ import E from "react-dom";
12
+ // packages/feedback/src/feedback.tsx
13
+ function ne({ title: e, children: r, action: i, ...a }) {
14
+ return /* @__PURE__ */ _("div", {
15
+ ...c({ className: "x78zum5 xdt5ytf x6s0dn4 xl56j7k x2b8uid xeuugli x193iq5w x9f619 x9w77qv xnx3t7k x1n8ia3y x1hz01jw xj57cvi xvmahel xj0a0fe" }, a),
16
+ children: [
17
+ /* @__PURE__ */ g(v, {
18
+ size: 22,
19
+ "aria-hidden": !0,
20
+ className: "x153jb6y x2lah0s"
21
+ }),
22
+ /* @__PURE__ */ g(n, { children: e }),
23
+ r != null && /* @__PURE__ */ g(t, { children: r }),
24
+ i != null && /* @__PURE__ */ g("div", {
25
+ className: "x78zum5 xl56j7k x1a02dak x1hnptsi xeuugli x193iq5w",
26
+ children: i
27
+ })
28
+ ]
29
+ });
30
+ }
31
+ function re({ error: e = !1, ...t }) {
32
+ return /* @__PURE__ */ g("div", { ...c({ role: e ? "alert" : "status" }, {
33
+ 0: { className: "xeuugli x193iq5w x9f619 x1qokhjc x1doqdfy x1ok0vyi x1hz01jw xvmahel xtqrqnz x1778rvt xj57cvi x1dqe72f x1f9ixgr xj0a0fe" },
34
+ 1: { className: "xeuugli x193iq5w x9f619 x1qokhjc x1doqdfy x1ok0vyi x1hz01jw xvmahel xtqrqnz x1778rvt xj57cvi xj0a0fe xr5kp14 xcqwzn" }
35
+ }[!!e | 0], t) });
36
+ }
37
+ // packages/feedback/src/skeleton.tsx
38
+ var D = {
39
+ skeleton: {
40
+ k1xSpc: "x1lliihq",
41
+ ks0D6T: "x193iq5w",
42
+ kWkggS: "x1fa40ue",
43
+ kaIpWk: "x1ok0vyi",
44
+ kmuXW: "x2lah0s",
45
+ $$css: !0
46
+ },
47
+ dimensions: (e, t) => [{
48
+ kzqmXN: e == null ? e : "x5lhr3w",
49
+ kZKoxP: t == null ? t : "x16ye13r",
50
+ $$css: !0
51
+ }, {
52
+ "--x-width": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(e),
53
+ "--x-height": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(t)
54
+ }],
55
+ width: (e) => [{
56
+ kzqmXN: e == null ? e : "x5lhr3w",
57
+ $$css: !0
58
+ }, { "--x-width": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(e) }],
59
+ circle: {
60
+ kaIpWk: "x16rqkct",
61
+ $$css: !0
62
+ },
63
+ rectangle: { $$css: !0 },
64
+ text: {
65
+ k1xSpc: "x3nfvp2",
66
+ kXwgrk: "xdt5ytf",
67
+ k7Eaqz: "xeuugli",
68
+ ks0D6T: "x193iq5w",
69
+ kXLuUW: "x16dsc37",
70
+ $$css: !0
71
+ },
72
+ label: {
73
+ k7Eaqz: "xeuugli",
74
+ $$css: !0
75
+ }
76
+ }, O = {
77
+ rectangle: D.rectangle,
78
+ circle: D.circle
79
+ };
80
+ function k({ width: e = "100%", height: t = 8, shape: n = "rectangle" }) {
81
+ return /* @__PURE__ */ g("span", {
82
+ "aria-hidden": !0,
83
+ ...l.props(D.skeleton, D.dimensions(e, t), O[n])
84
+ });
85
+ }
86
+ function A({ lines: e = 1, width: t = "100%" }) {
87
+ return /* @__PURE__ */ g("span", {
88
+ "aria-hidden": !0,
89
+ ...l.props(D.text, D.width(t)),
90
+ children: Array.from({ length: e }, (t, n) => /* @__PURE__ */ g("span", {
91
+ className: "x78zum5 x6s0dn4 xg2ss61",
92
+ children: /* @__PURE__ */ g(k, {
93
+ width: e > 1 && n === e - 1 ? "65%" : "100%",
94
+ height: "0.6em"
95
+ })
96
+ }, `placeholder-${n}`))
97
+ });
98
+ }
99
+ function j({ label: e, showLabel: t = !1 }) {
100
+ return /* @__PURE__ */ _("span", {
101
+ role: "status",
102
+ className: "x3nfvp2 x1n2onr6 x6s0dn4 xeuugli x193iq5w x1hnptsi x153jb6y x1hz01jw xtqrqnz x1778rvt xj57cvi xj0a0fe",
103
+ children: [/* @__PURE__ */ g(x, {
104
+ "aria-hidden": !0,
105
+ className: "xtwnzbg x18utl2x x2lah0s"
106
+ }), /* @__PURE__ */ g("span", {
107
+ ...l.props(D.label, !t && s.hidden),
108
+ children: e
109
+ })]
110
+ });
111
+ }
112
+ // packages/feedback/src/control-placeholders.tsx
113
+ var M = {
114
+ ks0D6T: "x193iq5w",
115
+ $$css: !0
116
+ }, N = {
117
+ kZKoxP: "x16ye13r",
118
+ $$css: !0
119
+ }, P = {
120
+ button: {
121
+ kWkggS: "x1r7kqkb",
122
+ kXLuUW: "xxymvpz",
123
+ $$css: !0
124
+ },
125
+ singleLine: {
126
+ k1xSpc: "x78zum5",
127
+ kGNEyG: "x6s0dn4",
128
+ $$css: !0
129
+ },
130
+ width: (e) => [
131
+ M,
132
+ {
133
+ kzqmXN: e == null ? e : "x5lhr3w",
134
+ $$css: !0
135
+ },
136
+ { "--x-width": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(e) }
137
+ ],
138
+ rows: (e) => [N, { "--x-height": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(`calc(${e} * 1lh + 2 * ${r.paddingBlock} + 2px)`) }]
139
+ };
140
+ function F({ width: t = "7ch", icon: n = !1, xstyle: i }) {
141
+ return /* @__PURE__ */ g("span", {
142
+ "aria-hidden": !0,
143
+ inert: !0,
144
+ ...l.props(e.base, e.button, n && e.iconButton, P.button, i),
145
+ children: n ? /* @__PURE__ */ g(k, {
146
+ width: r.iconSize,
147
+ height: r.iconSize
148
+ }) : /* @__PURE__ */ g(A, { width: t })
149
+ });
150
+ }
151
+ function I({ label: t, hint: n, multiline: r = !1, rows: i = 4, width: a = "100%", xstyle: o }) {
152
+ let s = r ? Math.min(i, 6) : 1;
153
+ return /* @__PURE__ */ _("div", {
154
+ "aria-hidden": !0,
155
+ ...l.props(e.fieldRoot, P.width(a), o),
156
+ children: [
157
+ t !== void 0 && /* @__PURE__ */ g("span", {
158
+ ...l.props(e.label),
159
+ children: t
160
+ }),
161
+ /* @__PURE__ */ g("div", {
162
+ ...l.props(e.base, e.field, !r && P.singleLine, r && e.textarea, r && P.rows(i)),
163
+ children: /* @__PURE__ */ g(A, {
164
+ width: "60%",
165
+ lines: s
166
+ })
167
+ }),
168
+ n !== void 0 && /* @__PURE__ */ g("span", {
169
+ ...l.props(e.description),
170
+ children: n
171
+ })
172
+ ]
173
+ });
174
+ }
175
+ // packages/feedback/src/progress.tsx
176
+ function ie({ label: e, value: t, max: n, valueLabel: r }) {
177
+ return /* @__PURE__ */ _(T.Root, {
178
+ value: t,
179
+ max: n,
180
+ locale: "en-US",
181
+ getAriaValueText: () => r,
182
+ className: "x78zum5 xdt5ytf x1hnptsi xh8yej3 xeuugli x1hz01jw xtqrqnz x1778rvt xj57cvi xbixft xj0a0fe",
183
+ children: [/* @__PURE__ */ _("div", {
184
+ className: "x78zum5 x1pha0wt x1qughib x1n8ia3y x1a02dak",
185
+ children: [/* @__PURE__ */ g(T.Label, {
186
+ className: "xeuugli x193iq5w",
187
+ children: e
188
+ }), /* @__PURE__ */ g("span", {
189
+ className: "xeuugli x193iq5w x153jb6y xss6m8b",
190
+ children: r
191
+ })]
192
+ }), /* @__PURE__ */ g(T.Track, {
193
+ ...{
194
+ 0: { className: "xqu0tyb xh8yej3 x1ok0vyi x1fa40ue xb3r6kr" },
195
+ 1: { className: "xqu0tyb xh8yej3 x1ok0vyi xb3r6kr x1r7kqkb xmkeg23 xbsl7fq xqrc7c3 x9f619" }
196
+ }[t === null | 0],
197
+ children: t !== null && /* @__PURE__ */ g(T.Indicator, { className: "x5yr21d x1pt885t x1ok0vyi" })
198
+ })]
199
+ });
200
+ }
201
+ function L({ label: e, value: t, max: n, valueLabel: r }) {
202
+ return t === null ? /* @__PURE__ */ _("div", {
203
+ className: "x78zum5 xdt5ytf x1hnptsi xh8yej3 xeuugli x1hz01jw xtqrqnz x1778rvt xj57cvi xbixft xj0a0fe",
204
+ children: [/* @__PURE__ */ _("div", {
205
+ className: "x78zum5 x1pha0wt x1qughib x1n8ia3y x1a02dak",
206
+ children: [/* @__PURE__ */ g("span", {
207
+ className: "xeuugli x193iq5w",
208
+ children: e
209
+ }), /* @__PURE__ */ g("span", {
210
+ className: "xeuugli x193iq5w x153jb6y xss6m8b",
211
+ children: r
212
+ })]
213
+ }), /* @__PURE__ */ g("div", {
214
+ "aria-hidden": !0,
215
+ className: "xqu0tyb xh8yej3 x1ok0vyi xb3r6kr x1r7kqkb xmkeg23 xbsl7fq xqrc7c3 x9f619"
216
+ })]
217
+ }) : /* @__PURE__ */ _(w.Root, {
218
+ value: t,
219
+ max: n,
220
+ locale: "en-US",
221
+ getAriaValueText: () => r,
222
+ className: "x78zum5 xdt5ytf x1hnptsi xh8yej3 xeuugli x1hz01jw xtqrqnz x1778rvt xj57cvi xbixft xj0a0fe",
223
+ children: [/* @__PURE__ */ _("div", {
224
+ className: "x78zum5 x1pha0wt x1qughib x1n8ia3y x1a02dak",
225
+ children: [/* @__PURE__ */ g(w.Label, {
226
+ className: "xeuugli x193iq5w",
227
+ children: e
228
+ }), /* @__PURE__ */ g("span", {
229
+ className: "xeuugli x193iq5w x153jb6y xss6m8b",
230
+ children: r
231
+ })]
232
+ }), /* @__PURE__ */ g(w.Track, {
233
+ className: "xqu0tyb xh8yej3 x1ok0vyi x1fa40ue xb3r6kr",
234
+ children: /* @__PURE__ */ g(w.Indicator, { className: "x5yr21d x1pt885t x1ok0vyi" })
235
+ })]
236
+ });
237
+ }
238
+ // ../../../node_modules/.pnpm/sonner@2.0.8_@types+react@19.3.0_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/sonner/dist/index.mjs
239
+ var ae = (e) => {
240
+ switch (e) {
241
+ case "success": return ce;
242
+ case "info": return le;
243
+ case "warning": return R;
244
+ case "error": return z;
245
+ default: return null;
246
+ }
247
+ }, oe = Array(12).fill(0), se = ({ visible: e, className: t }) => /*#__PURE__*/ u.createElement("div", {
248
+ className: ["sonner-loading-wrapper", t].filter(Boolean).join(" "),
249
+ "data-visible": e
250
+ }, /*#__PURE__*/ u.createElement("div", { className: "sonner-spinner" }, oe.map((e, t) => /*#__PURE__*/ u.createElement("div", {
251
+ className: "sonner-loading-bar",
252
+ key: `spinner-bar-${t}`
253
+ })))), ce = /*#__PURE__*/ u.createElement("svg", {
254
+ xmlns: "http://www.w3.org/2000/svg",
255
+ viewBox: "0 0 20 20",
256
+ fill: "currentColor",
257
+ height: "20",
258
+ width: "20",
259
+ "aria-hidden": "true"
260
+ }, /*#__PURE__*/ u.createElement("path", {
261
+ fillRule: "evenodd",
262
+ d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",
263
+ clipRule: "evenodd"
264
+ })), R = /*#__PURE__*/ u.createElement("svg", {
265
+ xmlns: "http://www.w3.org/2000/svg",
266
+ viewBox: "0 0 24 24",
267
+ fill: "currentColor",
268
+ height: "20",
269
+ width: "20",
270
+ "aria-hidden": "true"
271
+ }, /*#__PURE__*/ u.createElement("path", {
272
+ fillRule: "evenodd",
273
+ d: "M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",
274
+ clipRule: "evenodd"
275
+ })), le = /*#__PURE__*/ u.createElement("svg", {
276
+ xmlns: "http://www.w3.org/2000/svg",
277
+ viewBox: "0 0 20 20",
278
+ fill: "currentColor",
279
+ height: "20",
280
+ width: "20",
281
+ "aria-hidden": "true"
282
+ }, /*#__PURE__*/ u.createElement("path", {
283
+ fillRule: "evenodd",
284
+ d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",
285
+ clipRule: "evenodd"
286
+ })), z = /*#__PURE__*/ u.createElement("svg", {
287
+ xmlns: "http://www.w3.org/2000/svg",
288
+ viewBox: "0 0 20 20",
289
+ fill: "currentColor",
290
+ height: "20",
291
+ width: "20",
292
+ "aria-hidden": "true"
293
+ }, /*#__PURE__*/ u.createElement("path", {
294
+ fillRule: "evenodd",
295
+ d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",
296
+ clipRule: "evenodd"
297
+ })), ue = /*#__PURE__*/ u.createElement("svg", {
298
+ xmlns: "http://www.w3.org/2000/svg",
299
+ width: "12",
300
+ height: "12",
301
+ viewBox: "0 0 24 24",
302
+ fill: "none",
303
+ stroke: "currentColor",
304
+ strokeWidth: "1.5",
305
+ strokeLinecap: "round",
306
+ strokeLinejoin: "round",
307
+ "aria-hidden": "true"
308
+ }, /*#__PURE__*/ u.createElement("line", {
309
+ x1: "18",
310
+ y1: "6",
311
+ x2: "6",
312
+ y2: "18"
313
+ }), /*#__PURE__*/ u.createElement("line", {
314
+ x1: "6",
315
+ y1: "6",
316
+ x2: "18",
317
+ y2: "18"
318
+ })), de = () => {
319
+ let [e, t] = u.useState(document.hidden);
320
+ return u.useEffect(() => {
321
+ let e = () => {
322
+ t(document.hidden);
323
+ };
324
+ return document.addEventListener("visibilitychange", e), () => document.removeEventListener("visibilitychange", e);
325
+ }, []), e;
326
+ }, fe = 1, pe = 100, B = (e) => typeof e?.id == "number" || e?.id?.length > 0 ? e.id : fe++, V = new class {
327
+ constructor() {
328
+ this.subscribe = (e) => (this.subscribers.push(e), this.getActiveToasts().forEach((t) => e(t)), () => {
329
+ let t = this.subscribers.indexOf(e);
330
+ this.subscribers.splice(t, 1);
331
+ }), this.publish = (e) => {
332
+ this.subscribers.forEach((t) => t(e));
333
+ }, this.addToast = (e) => {
334
+ this.publish(e), this.toasts = [...this.toasts, e], this.trimHistory();
335
+ }, this.trimHistory = () => {
336
+ let e = this.toasts.length - pe;
337
+ e <= 0 || (this.toasts = this.toasts.filter((t) => e > 0 && this.dismissedToasts.has(t.id) ? (this.dismissedToasts.delete(t.id), e--, !1) : !0));
338
+ }, this.create = (e) => {
339
+ let { message: t, ...n } = e, r = B(e), i = this.pendingDismissals.get(r);
340
+ i !== void 0 && (cancelAnimationFrame(i), this.pendingDismissals.delete(r), this.dismissedToasts.delete(r));
341
+ let a = this.dismissedToasts.has(r), o = e.dismissible === void 0 || e.dismissible;
342
+ return a && (this.dismissedToasts.delete(r), this.toasts = this.toasts.filter((e) => e.id !== r)), !a && this.toasts.find((e) => e.id === r) ? this.toasts = this.toasts.map((n) => n.id === r ? (this.publish({
343
+ ...n,
344
+ ...e,
345
+ id: r,
346
+ title: t
347
+ }), {
348
+ ...n,
349
+ ...e,
350
+ id: r,
351
+ dismissible: o,
352
+ title: t
353
+ }) : n) : this.addToast({
354
+ title: t,
355
+ ...n,
356
+ dismissible: o,
357
+ id: r
358
+ }), r;
359
+ }, this.dismiss = (e) => {
360
+ if (e == null) return this.getActiveToasts().forEach((e) => {
361
+ this.dismissedToasts.add(e.id), this.subscribers.forEach((t) => t({
362
+ id: e.id,
363
+ dismiss: !0
364
+ }));
365
+ }), e;
366
+ this.dismissedToasts.add(e);
367
+ let t = this.pendingDismissals.get(e);
368
+ return t !== void 0 && cancelAnimationFrame(t), this.pendingDismissals.set(e, requestAnimationFrame(() => {
369
+ this.pendingDismissals.delete(e), this.subscribers.forEach((t) => t({
370
+ id: e,
371
+ dismiss: !0
372
+ }));
373
+ })), e;
374
+ }, this.message = (e, t) => this.create({
375
+ ...t,
376
+ message: e,
377
+ type: void 0
378
+ }), this.error = (e, t) => this.create({
379
+ ...t,
380
+ message: e,
381
+ type: "error"
382
+ }), this.success = (e, t) => this.create({
383
+ ...t,
384
+ type: "success",
385
+ message: e
386
+ }), this.info = (e, t) => this.create({
387
+ ...t,
388
+ type: "info",
389
+ message: e
390
+ }), this.warning = (e, t) => this.create({
391
+ ...t,
392
+ type: "warning",
393
+ message: e
394
+ }), this.loading = (e, t) => this.create({
395
+ ...t,
396
+ type: "loading",
397
+ message: e
398
+ }), this.promise = (e, t) => {
399
+ if (!t) return;
400
+ let n;
401
+ t.loading !== void 0 && (n = this.create({
402
+ ...t,
403
+ promise: e,
404
+ type: "loading",
405
+ message: t.loading,
406
+ description: typeof t.description == "function" ? void 0 : t.description
407
+ }));
408
+ let r = Promise.resolve(e instanceof Function ? e() : e), i = n !== void 0, a, o = r.then(async (e) => {
409
+ if (a = ["resolve", e], u.isValidElement(e)) i = !1, this.create({
410
+ id: n,
411
+ type: "default",
412
+ message: e
413
+ });
414
+ else if (me(e) && !e.ok) {
415
+ i = !1;
416
+ let r = typeof t.error == "function" ? await t.error(`HTTP error! status: ${e.status}`) : t.error, a = typeof t.description == "function" ? await t.description(`HTTP error! status: ${e.status}`) : t.description, o = typeof r == "object" && !u.isValidElement(r) ? r : { message: r };
417
+ this.create({
418
+ id: n,
419
+ type: "error",
420
+ description: a,
421
+ ...o
422
+ });
423
+ } else if (e instanceof Error) {
424
+ i = !1;
425
+ let r = typeof t.error == "function" ? await t.error(e) : t.error, a = typeof t.description == "function" ? await t.description(e) : t.description, o = typeof r == "object" && !u.isValidElement(r) ? r : { message: r };
426
+ this.create({
427
+ id: n,
428
+ type: "error",
429
+ description: a,
430
+ ...o
431
+ });
432
+ } else if (t.success !== void 0) {
433
+ i = !1;
434
+ let r = typeof t.success == "function" ? await t.success(e) : t.success, a = typeof t.description == "function" ? await t.description(e) : t.description, o = typeof r == "object" && !u.isValidElement(r) ? r : { message: r };
435
+ this.create({
436
+ id: n,
437
+ type: "success",
438
+ description: a,
439
+ ...o
440
+ });
441
+ }
442
+ }).catch(async (e) => {
443
+ if (a = ["reject", e], t.error !== void 0) {
444
+ i = !1;
445
+ let r = typeof t.error == "function" ? await t.error(e) : t.error, a = typeof t.description == "function" ? await t.description(e) : t.description, o = typeof r == "object" && !u.isValidElement(r) ? r : { message: r };
446
+ this.create({
447
+ id: n,
448
+ type: "error",
449
+ description: a,
450
+ ...o
451
+ });
452
+ }
453
+ }).finally(() => {
454
+ i && (this.dismiss(n), n = void 0), t.finally == null || t.finally.call(t);
455
+ }), s = () => new Promise((e, t) => o.then(() => a[0] === "reject" ? t(a[1]) : e(a[1])).catch(t));
456
+ return typeof n != "string" && typeof n != "number" ? { unwrap: s } : Object.assign(n, { unwrap: s });
457
+ }, this.custom = (e, t) => {
458
+ let n = B(t);
459
+ return this.create({
460
+ ...t,
461
+ jsx: e(n),
462
+ id: n,
463
+ type: void 0
464
+ }), n;
465
+ }, this.getActiveToasts = () => this.toasts.filter((e) => !this.dismissedToasts.has(e.id)), this.subscribers = [], this.toasts = [], this.dismissedToasts = /* @__PURE__ */ new Set(), this.pendingDismissals = /* @__PURE__ */ new Map();
466
+ }
467
+ }(), H = (e, t) => V.message(e, t), me = (e) => e && typeof e == "object" && "ok" in e && typeof e.ok == "boolean" && "status" in e && typeof e.status == "number", he = Object.assign(H, {
468
+ success: V.success,
469
+ info: V.info,
470
+ warning: V.warning,
471
+ error: V.error,
472
+ custom: V.custom,
473
+ message: V.message,
474
+ promise: V.promise,
475
+ dismiss: V.dismiss,
476
+ loading: V.loading
477
+ }, {
478
+ getHistory: () => V.toasts,
479
+ getToasts: () => V.getActiveToasts()
480
+ });
481
+ function U(e) {
482
+ return e.label !== void 0;
483
+ }
484
+ var W = 3, ge = "24px", _e = "16px", ve = 4e3, G = 356, K = 14, ye = 45, be = 200;
485
+ function q(...e) {
486
+ return e.filter(Boolean).join(" ");
487
+ }
488
+ function xe(e) {
489
+ let [t, n] = e.split("-"), r = [];
490
+ return t && r.push(t), n && r.push(n), r;
491
+ }
492
+ var Se = (e) => {
493
+ let { invert: t, toast: n, unstyled: r, interacting: i, setHeights: a, visibleToasts: o, heights: s, index: c, toasts: l, expanded: d, removeToast: f, defaultRichColors: p, closeButton: m, style: h, cancelButtonStyle: ee, actionButtonStyle: g, className: _ = "", descriptionClassName: v = "", duration: y, position: b, gap: te, expandByDefault: x, classNames: S, icons: C, closeButtonAriaLabel: w = "Close toast" } = e, [T, E] = u.useState(null), [ne, re] = u.useState(null), [D, O] = u.useState(!1), [k, A] = u.useState(!1), [j, M] = u.useState(!1), [N, P] = u.useState(!1), [F, I] = u.useState(!1), [ie, L] = u.useState(0), [oe, ce] = u.useState(0), R = u.useRef(n.duration || y || ve), le = u.useRef(null), z = u.useRef(null), fe = c === 0, pe = c + 1 <= o, B = n.type, V = B ?? "default", H = n.dismissible !== !1, me = n.className || "", he = n.descriptionClassName || "", W = u.useMemo(() => s.findIndex((e) => e.toastId === n.id) || 0, [s, n.id]), ge = u.useMemo(() => n.closeButton ?? m, [n.closeButton, m]), _e = u.useMemo(() => n.duration || y || ve, [n.duration, y]), G = u.useRef(0), K = u.useRef(0), Se = u.useRef(0), J = u.useRef(null), [Ce, we] = b.split("-"), Te = u.useMemo(() => s.reduce((e, t, n) => n >= W ? e : e + t.height, 0), [s, W]), Y = de(), X = u.useMemo(() => e.swipeDirections ?? xe(b), [e.swipeDirections, b]), Z = n.invert || t, Q = B === "loading";
494
+ K.current = u.useMemo(() => W * te + Te, [W, Te]), u.useEffect(() => {
495
+ R.current = _e;
496
+ }, [_e]), u.useEffect(() => {
497
+ O(!0);
498
+ }, []), u.useEffect(() => {
499
+ let e = z.current;
500
+ if (e) {
501
+ let t = e.getBoundingClientRect().height;
502
+ return ce(t), a((e) => [{
503
+ toastId: n.id,
504
+ height: t,
505
+ position: n.position
506
+ }, ...e]), () => a((e) => e.filter((e) => e.toastId !== n.id));
507
+ }
508
+ }, [a, n.id]), u.useLayoutEffect(() => {
509
+ if (!D) return;
510
+ let e = z.current, t = e.style.height;
511
+ e.style.height = "auto";
512
+ let r = e.getBoundingClientRect().height;
513
+ e.style.height = t, ce(r), a((e) => e.find((e) => e.toastId === n.id) ? e.map((e) => e.toastId === n.id ? {
514
+ ...e,
515
+ height: r
516
+ } : e) : [{
517
+ toastId: n.id,
518
+ height: r,
519
+ position: n.position
520
+ }, ...e]);
521
+ }, [
522
+ D,
523
+ n.title,
524
+ n.description,
525
+ a,
526
+ n.id,
527
+ n.jsx,
528
+ n.action,
529
+ n.cancel
530
+ ]);
531
+ let $ = u.useCallback(() => {
532
+ A(!0), L(K.current), a((e) => e.filter((e) => e.toastId !== n.id)), setTimeout(() => {
533
+ f(n);
534
+ }, be);
535
+ }, [
536
+ n,
537
+ f,
538
+ a,
539
+ K
540
+ ]);
541
+ u.useEffect(() => {
542
+ if (n.promise && B === "loading" || n.duration === Infinity || n.type === "loading") return;
543
+ let e;
544
+ return d || i || Y ? (() => {
545
+ if (Se.current < G.current) {
546
+ let e = (/* @__PURE__ */ new Date()).getTime() - G.current;
547
+ R.current -= e;
548
+ }
549
+ Se.current = (/* @__PURE__ */ new Date()).getTime();
550
+ })() : R.current !== Infinity && (G.current = (/* @__PURE__ */ new Date()).getTime(), e = setTimeout(() => {
551
+ n.onAutoClose == null || n.onAutoClose.call(n, n), $();
552
+ }, R.current)), () => clearTimeout(e);
553
+ }, [
554
+ d,
555
+ i,
556
+ n,
557
+ B,
558
+ Y,
559
+ $
560
+ ]), u.useEffect(() => {
561
+ n.delete && ($(), n.onDismiss == null || n.onDismiss.call(n, n));
562
+ }, [$, n.delete]);
563
+ function Ee() {
564
+ return C?.loading ? /*#__PURE__*/ u.createElement("div", {
565
+ className: q(S?.loader, n?.classNames?.loader, "sonner-loader"),
566
+ "data-visible": B === "loading"
567
+ }, C.loading) : /*#__PURE__*/ u.createElement(se, {
568
+ className: q(S?.loader, n?.classNames?.loader),
569
+ visible: B === "loading"
570
+ });
571
+ }
572
+ let De = n.icon || C?.[B] || ae(B);
573
+ return /*#__PURE__*/ u.createElement("li", {
574
+ tabIndex: 0,
575
+ ref: z,
576
+ className: q(_, me, S?.toast, n?.classNames?.toast, S?.[V], n?.classNames?.[V]),
577
+ "data-sonner-toast": "",
578
+ "data-rich-colors": n.richColors ?? p,
579
+ "data-styled": !(n.jsx || n.unstyled || r),
580
+ "data-mounted": D,
581
+ "data-promise": !!n.promise,
582
+ "data-swiped": F,
583
+ "data-removed": k,
584
+ "data-visible": pe,
585
+ "data-y-position": Ce,
586
+ "data-x-position": we,
587
+ "data-index": c,
588
+ "data-front": fe,
589
+ "data-swiping": j,
590
+ "data-dismissible": H,
591
+ "data-type": B,
592
+ "data-invert": Z,
593
+ "data-swipe-out": N,
594
+ "data-swipe-direction": ne,
595
+ "data-expanded": !!(d || x && D),
596
+ "data-testid": n.testId,
597
+ style: {
598
+ "--index": c,
599
+ "--toasts-before": c,
600
+ "--z-index": l.length - c,
601
+ "--offset": `${k ? ie : K.current}px`,
602
+ "--initial-height": x ? "auto" : `${oe}px`,
603
+ ...h,
604
+ ...n.style
605
+ },
606
+ onDragEnd: () => {
607
+ M(!1), E(null), J.current = null;
608
+ },
609
+ onPointerDown: (e) => {
610
+ e.button !== 2 && !Q && H && (le.current = /* @__PURE__ */ new Date(), L(K.current), e.target.setPointerCapture(e.pointerId), e.target.tagName !== "BUTTON" && (M(!0), J.current = {
611
+ x: e.clientX,
612
+ y: e.clientY
613
+ }));
614
+ },
615
+ onPointerUp: () => {
616
+ if (N || !H) return;
617
+ J.current = null;
618
+ let e = Number(z.current?.style.getPropertyValue("--swipe-amount-x").replace("px", "") || 0), t = Number(z.current?.style.getPropertyValue("--swipe-amount-y").replace("px", "") || 0), r = (/* @__PURE__ */ new Date()).getTime() - le.current?.getTime(), i = T === "x" ? e : t, a = Math.abs(i) / r;
619
+ if ((T === "x" ? X.includes(e > 0 ? "right" : "left") : X.includes(t > 0 ? "bottom" : "top")) && (Math.abs(i) >= ye || a > .11)) L(K.current), n.onDismiss == null || n.onDismiss.call(n, n), re(T === "x" ? e > 0 ? "right" : "left" : t > 0 ? "down" : "up"), $(), P(!0);
620
+ else {
621
+ var o, s;
622
+ (o = z.current) == null || o.style.setProperty("--swipe-amount-x", "0px"), (s = z.current) == null || s.style.setProperty("--swipe-amount-y", "0px"), I(!1), M(!1), E(null);
623
+ }
624
+ },
625
+ onPointerMove: (e) => {
626
+ var t, n;
627
+ if (!J.current || !H || window.getSelection()?.toString().length > 0) return;
628
+ let r = e.clientY - J.current.y, i = e.clientX - J.current.x;
629
+ !T && (Math.abs(i) > 1 || Math.abs(r) > 1) && E(Math.abs(i) > Math.abs(r) ? "x" : "y");
630
+ let a = {
631
+ x: 0,
632
+ y: 0
633
+ }, o = (e) => 1 / (1.5 + Math.abs(e) / 20);
634
+ if (T === "y") {
635
+ if (X.includes("top") || X.includes("bottom")) {
636
+ if (X.includes("top") && r < 0 || X.includes("bottom") && r > 0) a.y = r;
637
+ else {
638
+ let e = r * o(r);
639
+ a.y = Math.abs(e) < Math.abs(r) ? e : r;
640
+ }
641
+ }
642
+ } else if (T === "x" && (X.includes("left") || X.includes("right"))) {
643
+ if (X.includes("left") && i < 0 || X.includes("right") && i > 0) a.x = i;
644
+ else {
645
+ let e = i * o(i);
646
+ a.x = Math.abs(e) < Math.abs(i) ? e : i;
647
+ }
648
+ }
649
+ (Math.abs(a.x) > 0 || Math.abs(a.y) > 0) && I(!0), (t = z.current) == null || t.style.setProperty("--swipe-amount-x", `${a.x}px`), (n = z.current) == null || n.style.setProperty("--swipe-amount-y", `${a.y}px`);
650
+ }
651
+ }, ge && !n.jsx && B !== "loading" ? /*#__PURE__*/ u.createElement("button", {
652
+ "aria-label": w,
653
+ "data-disabled": Q,
654
+ "data-close-button": !0,
655
+ onClick: Q || !H ? () => {} : () => {
656
+ $(), n.onDismiss == null || n.onDismiss.call(n, n);
657
+ },
658
+ className: q(S?.closeButton, n?.classNames?.closeButton)
659
+ }, C?.close ?? ue) : null, (B || n.icon || n.promise) && n.icon !== null && (C?.[B] !== null || n.icon) ? /*#__PURE__*/ u.createElement("div", {
660
+ "data-icon": "",
661
+ className: q(S?.icon, n?.classNames?.icon)
662
+ }, B === "loading" ? n.icon || Ee() : n.promise ? Ee() : null, B === "loading" ? null : De) : null, /*#__PURE__*/ u.createElement("div", {
663
+ "data-content": "",
664
+ className: q(S?.content, n?.classNames?.content)
665
+ }, /*#__PURE__*/ u.createElement("div", {
666
+ "data-title": "",
667
+ className: q(S?.title, n?.classNames?.title)
668
+ }, n.jsx ? n.jsx : typeof n.title == "function" ? n.title() : n.title), n.description ? /*#__PURE__*/ u.createElement("div", {
669
+ "data-description": "",
670
+ className: q(v, he, S?.description, n?.classNames?.description)
671
+ }, typeof n.description == "function" ? n.description() : n.description) : null), /*#__PURE__*/ u.isValidElement(n.cancel) ? n.cancel : n.cancel && U(n.cancel) ? /*#__PURE__*/ u.createElement("button", {
672
+ "data-button": !0,
673
+ "data-cancel": !0,
674
+ style: n.cancelButtonStyle || ee,
675
+ onClick: (e) => {
676
+ U(n.cancel) && H && (n.cancel.onClick == null || n.cancel.onClick.call(n.cancel, e), $());
677
+ },
678
+ className: q(S?.cancelButton, n?.classNames?.cancelButton)
679
+ }, n.cancel.label) : null, /*#__PURE__*/ u.isValidElement(n.action) ? n.action : n.action && U(n.action) ? /*#__PURE__*/ u.createElement("button", {
680
+ "data-button": !0,
681
+ "data-action": !0,
682
+ style: n.actionButtonStyle || g,
683
+ onClick: (e) => {
684
+ U(n.action) && (n.action.onClick == null || n.action.onClick.call(n.action, e), e.defaultPrevented || $());
685
+ },
686
+ className: q(S?.actionButton, n?.classNames?.actionButton)
687
+ }, n.action.label) : null);
688
+ };
689
+ function J() {
690
+ if (typeof window > "u" || typeof document > "u") return "ltr";
691
+ let e = document.documentElement.getAttribute("dir");
692
+ return e === "auto" || !e ? window.getComputedStyle(document.documentElement).direction : e;
693
+ }
694
+ function Ce(e, t) {
695
+ let n = {};
696
+ return [e, t].forEach((e, t) => {
697
+ let r = t === 1, i = r ? "--mobile-offset" : "--offset", a = r ? _e : ge;
698
+ function o(e) {
699
+ [
700
+ "top",
701
+ "right",
702
+ "bottom",
703
+ "left"
704
+ ].forEach((t) => {
705
+ n[`${i}-${t}`] = typeof e == "number" ? `${e}px` : e;
706
+ });
707
+ }
708
+ typeof e == "number" || typeof e == "string" ? o(e) : typeof e == "object" ? [
709
+ "top",
710
+ "right",
711
+ "bottom",
712
+ "left"
713
+ ].forEach((t) => {
714
+ e[t] === void 0 ? n[`${i}-${t}`] = a : n[`${i}-${t}`] = typeof e[t] == "number" ? `${e[t]}px` : e[t];
715
+ }) : o(a);
716
+ }), n;
717
+ }
718
+ var we = /*#__PURE__*/ u.forwardRef(function(e, t) {
719
+ let { id: n, invert: r, position: i = "bottom-right", hotkey: a = ["altKey", "KeyT"], expand: o, closeButton: s, className: c, offset: l, mobileOffset: d, theme: f = "light", richColors: p, duration: m, style: h, visibleToasts: ee = W, toastOptions: g, dir: _ = J(), gap: v = K, icons: y, customAriaLabel: b, containerAriaLabel: te = "Notifications" } = e, [x, S] = u.useState([]), C = u.useMemo(() => n ? x.filter((e) => e.toasterId === n) : x.filter((e) => !e.toasterId), [x, n]), w = u.useMemo(() => Array.from(new Set([i].concat(C.filter((e) => e.position).map((e) => e.position)))), [C, i]), [T, ne] = u.useState([]), [re, D] = u.useState(!1), [O, k] = u.useState(!1), [A, j] = u.useState(f === "system" ? typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : f), M = u.useRef(null), N = a.join("+").replace(/Key/g, "").replace(/Digit/g, ""), P = u.useRef(null), F = u.useRef(!1), I = u.useCallback((e) => {
720
+ S((t) => (t.find((t) => t.id === e.id)?.delete || V.dismiss(e.id), t.filter(({ id: t }) => t !== e.id)));
721
+ }, []);
722
+ return u.useEffect(() => V.subscribe((e) => {
723
+ e.dismiss ? requestAnimationFrame(() => {
724
+ S((t) => t.map((t) => t.id === e.id ? {
725
+ ...t,
726
+ delete: !0
727
+ } : t));
728
+ }) : setTimeout(() => {
729
+ E.flushSync(() => {
730
+ S((t) => {
731
+ let n = t.findIndex((t) => t.id === e.id);
732
+ return n === -1 ? [e, ...t] : [
733
+ ...t.slice(0, n),
734
+ {
735
+ ...t[n],
736
+ ...e
737
+ },
738
+ ...t.slice(n + 1)
739
+ ];
740
+ });
741
+ });
742
+ });
743
+ }), []), u.useEffect(() => {
744
+ if (f !== "system") {
745
+ j(f);
746
+ return;
747
+ }
748
+ if (f === "system" && (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? j("dark") : j("light")), typeof window > "u") return;
749
+ let e = window.matchMedia("(prefers-color-scheme: dark)");
750
+ try {
751
+ e.addEventListener("change", ({ matches: e }) => {
752
+ j(e ? "dark" : "light");
753
+ });
754
+ } catch {
755
+ e.addListener(({ matches: e }) => {
756
+ try {
757
+ j(e ? "dark" : "light");
758
+ } catch (e) {
759
+ console.error(e);
760
+ }
761
+ });
762
+ }
763
+ }, [f]), u.useEffect(() => {
764
+ x.length <= 1 && D(!1);
765
+ }, [x]), u.useEffect(() => {
766
+ let e = (e) => {
767
+ if (a.length > 0 && a.every((t) => e[t] || e.code === t)) {
768
+ var t;
769
+ D(!0), (t = M.current) == null || t.focus();
770
+ }
771
+ e.code === "Escape" && (document.activeElement === M.current || M.current?.contains(document.activeElement)) && D(!1);
772
+ };
773
+ return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
774
+ }, [a]), u.useEffect(() => {
775
+ if (M.current) return () => {
776
+ P.current && (P.current.focus({ preventScroll: !0 }), P.current = null, F.current = !1);
777
+ };
778
+ }, [M.current]), /*#__PURE__*/ u.createElement("section", {
779
+ ref: t,
780
+ "aria-label": b ?? `${te} ${N}`,
781
+ tabIndex: -1,
782
+ "aria-live": "polite",
783
+ "aria-relevant": "additions text",
784
+ "aria-atomic": "false",
785
+ suppressHydrationWarning: !0,
786
+ "data-react-aria-top-layer": !0
787
+ }, w.map((t, n) => {
788
+ let [i, a] = t.split("-");
789
+ return C.length ? /*#__PURE__*/ u.createElement("ol", {
790
+ key: t,
791
+ dir: _ === "auto" ? J() : _,
792
+ tabIndex: -1,
793
+ ref: M,
794
+ className: c,
795
+ "data-sonner-toaster": !0,
796
+ "data-sonner-theme": A,
797
+ "data-y-position": i,
798
+ "data-x-position": a,
799
+ style: {
800
+ "--front-toast-height": `${T[0]?.height || 0}px`,
801
+ "--width": `${G}px`,
802
+ "--gap": `${v}px`,
803
+ ...h,
804
+ ...Ce(l, d)
805
+ },
806
+ onBlur: (e) => {
807
+ F.current && !e.currentTarget.contains(e.relatedTarget) && (F.current = !1, P.current &&= (P.current.focus({ preventScroll: !0 }), null));
808
+ },
809
+ onFocus: (e) => {
810
+ e.target instanceof HTMLElement && e.target.dataset.dismissible === "false" || F.current || (F.current = !0, P.current = e.relatedTarget);
811
+ },
812
+ onMouseEnter: () => D(!0),
813
+ onMouseMove: () => D(!0),
814
+ onMouseLeave: () => {
815
+ O || D(!1);
816
+ },
817
+ onDragEnd: () => D(!1),
818
+ onPointerDown: (e) => {
819
+ e.target instanceof HTMLElement && e.target.dataset.dismissible === "false" || k(!0);
820
+ },
821
+ onPointerUp: () => k(!1)
822
+ }, C.filter((e) => !e.position && n === 0 || e.position === t).map((n, i) => /*#__PURE__*/ u.createElement(Se, {
823
+ key: n.id,
824
+ icons: y,
825
+ index: i,
826
+ toast: n,
827
+ defaultRichColors: p,
828
+ duration: g?.duration ?? m,
829
+ className: g?.className,
830
+ descriptionClassName: g?.descriptionClassName,
831
+ invert: r,
832
+ visibleToasts: ee,
833
+ closeButton: g?.closeButton ?? s,
834
+ interacting: O,
835
+ position: t,
836
+ style: g?.style,
837
+ unstyled: g?.unstyled,
838
+ classNames: g?.classNames,
839
+ cancelButtonStyle: g?.cancelButtonStyle,
840
+ actionButtonStyle: g?.actionButtonStyle,
841
+ closeButtonAriaLabel: g?.closeButtonAriaLabel,
842
+ removeToast: I,
843
+ toasts: C.filter((e) => e.position == n.position),
844
+ heights: T.filter((e) => e.position == n.position),
845
+ setHeights: ne,
846
+ expandByDefault: o,
847
+ gap: v,
848
+ expanded: re,
849
+ swipeDirections: e.swipeDirections
850
+ }))) : null;
851
+ }));
852
+ });
853
+ // packages/feedback/src/toast.tsx
854
+ function Te({ closeButton: e = !0, closeButtonAriaLabel: t = "Dismiss notification", offset: n = o.xl, mobileOffset: r = o.lg, ...a }) {
855
+ return /* @__PURE__ */ g(we, {
856
+ ...a,
857
+ className: "x1xzild6 xkwcdv0 x19hn9gq x350ok5 x1dknavn x1qgcmqu x19j7ixz xgam3oh x7s97pk",
858
+ style: {
859
+ zIndex: i.popup,
860
+ transitionProperty: "opacity, transform"
861
+ },
862
+ offset: n,
863
+ mobileOffset: r,
864
+ closeButton: e,
865
+ icons: {
866
+ success: /* @__PURE__ */ g(y, {
867
+ "aria-hidden": !0,
868
+ className: "xtwnzbg x18utl2x x7zct4q x7ixh4y"
869
+ }),
870
+ error: /* @__PURE__ */ g(b, {
871
+ "aria-hidden": !0,
872
+ className: "xtwnzbg x18utl2x x7zct4q xr5kp14"
873
+ }),
874
+ warning: /* @__PURE__ */ g(S, {
875
+ "aria-hidden": !0,
876
+ className: "xtwnzbg x18utl2x x7zct4q x1f9ixgr"
877
+ }),
878
+ info: /* @__PURE__ */ g(te, {
879
+ "aria-hidden": !0,
880
+ className: "xtwnzbg x18utl2x x7zct4q x153jb6y"
881
+ }),
882
+ loading: /* @__PURE__ */ g(x, {
883
+ "aria-hidden": !0,
884
+ className: "xtwnzbg x18utl2x x7zct4q x153jb6y"
885
+ }),
886
+ close: /* @__PURE__ */ g(C, {
887
+ "aria-hidden": !0,
888
+ className: "xtwnzbg x18utl2x x7zct4q"
889
+ })
890
+ },
891
+ toastOptions: {
892
+ unstyled: !0,
893
+ closeButtonAriaLabel: t,
894
+ style: { transitionProperty: "opacity, transform" },
895
+ classNames: {
896
+ toast: { className: "x1bl4301 x78zum5 x1a02dak x6s0dn4 x1hnptsi x1c8xbx5 xx4ccz x7ottyg xmkeg23 x1y0btm7 x1ey3b81 xy32g2j xpvm0e4 xbixft x16hm2kh x1hz01jw xvmahel xtqrqnz x1778rvt xj57cvi x1xzild6 xkwcdv0 x19hn9gq x350ok5 x1dknavn x1qgcmqu x19j7ixz xgam3oh x7s97pk x-default-marker" }.className ?? "",
897
+ title: { className: "xk4h15q" }.className ?? "",
898
+ description: { className: "x153jb6y" }.className ?? "",
899
+ content: { className: "x78zum5 xdt5ytf x1slnebi xeuugli xfko13i x1hc1fzr xnglhca x19991ni xkwcdv0 x19hn9gq" }.className ?? "",
900
+ icon: { className: "x78zum5 x1n2onr6 x2lah0s xtwnzbg x18utl2x x1hc1fzr xnglhca x19991ni xkwcdv0 x19hn9gq" }.className ?? "",
901
+ loader: { className: "x1xzild6 xkwcdv0 x19hn9gq x350ok5 x1dknavn" }.className ?? "",
902
+ actionButton: { className: "x3nfvp2 x6s0dn4 xl56j7k x2lah0s x9f619 xeuugli x193iq5w x17tes2r xwu7q15 x1hmw7ec x1atzlso xc342km x1ok0vyi x1hz01jw xtqrqnz x1778rvt xk4h15q xeaf4i8 xj0a0fe x1ypdohk x1pt885t x1ymx3u3 xbhuexu x1eou8nq x1qgcmqu x19j7ixz xgam3oh x7s97pk x1hc1fzr xnglhca x19991ni xkwcdv0 x19hn9gq" }.className ?? "",
903
+ cancelButton: { className: "x3nfvp2 x6s0dn4 xl56j7k x2lah0s x9f619 xeuugli x193iq5w x17tes2r xwu7q15 x1hmw7ec x1atzlso xc342km x1ok0vyi x1hz01jw xtqrqnz x1778rvt xk4h15q xeaf4i8 xj0a0fe x1ypdohk x1r7kqkb xbixft xxg5jw2 x1ecmtor x1qgcmqu x19j7ixz xgam3oh x7s97pk x1hc1fzr xnglhca x19991ni xkwcdv0 x19hn9gq" }.className ?? "",
904
+ closeButton: { className: "x3nfvp2 x6s0dn4 xl56j7k x2lah0s x9f619 x193iq5w x17tes2r xwu7q15 x1hmw7ec xc342km x1ok0vyi x1hz01jw xtqrqnz x1778rvt xk4h15q xeaf4i8 xj0a0fe x1ypdohk x10l6tqk x1m7q2ru x1b86y6l x16opp91 xidce53 xnjsko4 xjbqb8w x153jb6y xg54am9 xfkdqyo x1snzz31 xqu5dr6 x1qgcmqu x19j7ixz xgam3oh x7s97pk x1hc1fzr xnglhca x19991ni xkwcdv0 x19hn9gq" }.className ?? ""
905
+ }
906
+ }
907
+ });
908
+ }
909
+ // packages/feedback/src/async-region.tsx
910
+ var Y = d(void 0), X = d(!1), Z = a.delaySeconds * 1e3;
911
+ function Q({ identity: e, children: t }) {
912
+ let [n, r] = h(() => ({
913
+ identity: e,
914
+ startedAt: Date.now()
915
+ })), i = n;
916
+ return n.identity !== e && (i = {
917
+ identity: e,
918
+ startedAt: Date.now()
919
+ }, r(i)), /* @__PURE__ */ g(Y, {
920
+ value: i,
921
+ children: t
922
+ });
923
+ }
924
+ function $({ enter: e, children: t }) {
925
+ let n = f(X), [r, i] = h(e && !n), a = m(null);
926
+ return p(() => {
927
+ let e = a.current;
928
+ if (!r || e === null) return;
929
+ let t = !0;
930
+ return Promise.allSettled(e.getAnimations().map((e) => e.finished)).then(() => {
931
+ t && i(!1);
932
+ }), () => {
933
+ t = !1;
934
+ };
935
+ }, [r]), /* @__PURE__ */ g("div", {
936
+ ref: a,
937
+ ...{
938
+ 0: { className: "xeuugli x2lwn1j x78zum5 xdt5ytf x98rzlu" },
939
+ 1: { className: "xeuugli x2lwn1j x78zum5 xdt5ytf x98rzlu xqcmdr3 xcgnenq xk4ixfy x1c3o69q" }
940
+ }[!!r | 0],
941
+ children: /* @__PURE__ */ g(X, {
942
+ value: n || r,
943
+ children: t
944
+ })
945
+ });
946
+ }
947
+ function Ee({ label: e, placeholder: t, startedAt: n }) {
948
+ let [r, i] = h(() => Date.now() - n >= Z ? n : void 0), a = r === n;
949
+ return p(() => {
950
+ let e = Math.max(0, Z - (Date.now() - n)), t = setTimeout(() => i(n), e);
951
+ return () => clearTimeout(t);
952
+ }, [n]), /* @__PURE__ */ _(ee, { children: [/* @__PURE__ */ g("div", {
953
+ "aria-busy": !0,
954
+ className: "xeuugli x2lwn1j x78zum5 xdt5ytf x98rzlu",
955
+ children: /* @__PURE__ */ g("div", {
956
+ "aria-hidden": !0,
957
+ inert: !0,
958
+ ...{
959
+ 0: { className: "xeuugli x2lwn1j x78zum5 xdt5ytf x98rzlu x1nked9z" },
960
+ 2: { className: "xeuugli x2lwn1j x78zum5 xdt5ytf x98rzlu xlshs6z x1nked9z" },
961
+ 1: { className: "xeuugli x2lwn1j x78zum5 xdt5ytf x98rzlu xqcmdr3 xcgnenq x1c3o69q x1nked9z" },
962
+ 3: { className: "xeuugli x2lwn1j x78zum5 xdt5ytf x98rzlu xlshs6z xqcmdr3 xcgnenq x1c3o69q x1nked9z" }
963
+ }[!a << 1 | !!a],
964
+ children: t
965
+ })
966
+ }), a && /* @__PURE__ */ g("span", {
967
+ role: "status",
968
+ ...l.props(s.hidden),
969
+ children: e
970
+ })] });
971
+ }
972
+ function De(e) {
973
+ let t = f(Y), [n, r] = h(() => ({
974
+ state: e.state,
975
+ scope: t,
976
+ startedAt: t?.startedAt ?? Date.now(),
977
+ wasPending: e.state === "pending"
978
+ })), i = n;
979
+ if (n.scope !== t || n.state !== e.state) {
980
+ let a = n.scope !== t, o = n.startedAt;
981
+ a ? o = t?.startedAt ?? Date.now() : e.state === "pending" && (o = Date.now()), i = {
982
+ state: e.state,
983
+ scope: t,
984
+ startedAt: o,
985
+ wasPending: e.state === "pending" || !a && n.wasPending
986
+ }, r(i);
987
+ }
988
+ return /* @__PURE__ */ g("div", {
989
+ className: "x1n2onr6 xeuugli x2lwn1j x78zum5 xdt5ytf x98rzlu",
990
+ children: e.state === "pending" ? /* @__PURE__ */ g(Ee, {
991
+ label: e.label,
992
+ placeholder: e.placeholder,
993
+ startedAt: i.startedAt
994
+ }) : e.state === "failed" ? /* @__PURE__ */ g("div", {
995
+ className: "xeuugli x2lwn1j x78zum5 xdt5ytf x98rzlu",
996
+ children: e.children
997
+ }) : /* @__PURE__ */ g($, {
998
+ enter: i.wasPending,
999
+ children: e.children
1000
+ })
1001
+ });
1002
+ }
1003
+ export { he as a, F as c, A as d, j as f, Te as i, I as l, re as m, $ as n, L as o, ne as p, Q as r, ie as s, De as t, k as u };