@donkit-ai/design-system 1.4.0 → 1.4.2

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.es.js CHANGED
@@ -1,14 +1,14 @@
1
- import q, { useState as S, useRef as $, useEffect as B, useLayoutEffect as Ve, useId as Ye } from "react";
2
- import { Check as he, X as ne, ChevronDown as xe, Minus as qe, Plus as He, XCircle as we, AlertTriangle as ye, CheckCircle as ge, Info as ke, ChevronUp as Ke, ChevronsUpDown as Ge, ChevronLeft as Xe, ChevronRight as Oe, Copy as Je, Brain as Ze, Loader as Qe, Paperclip as Te, Square as es, ArrowUp as ss, Zap as ts, Cpu as Re, FileText as rs } from "lucide-react";
3
- import me from "react-dom";
4
- const I = {
1
+ import K, { useState as A, useRef as E, useEffect as M, useLayoutEffect as Ve } from "react";
2
+ import { Check as he, X as ne, ChevronDown as xe, Minus as Ye, Plus as He, XCircle as we, AlertTriangle as ge, CheckCircle as ye, Info as ke, ChevronUp as qe, ChevronsUpDown as Ke, ChevronLeft as Ge, ChevronRight as Xe, Copy as Je, Brain as Ze, Loader as Qe, Paperclip as Re, Square as es, ArrowUp as ss, Zap as ts, Cpu as Se, FileText as rs, ThumbsUp as ns, ThumbsDown as as } from "lucide-react";
3
+ import pe from "react-dom";
4
+ const D = {
5
5
  1: 16,
6
6
  2: 20,
7
7
  3: 24,
8
8
  4: 28,
9
9
  5: 48
10
10
  };
11
- var ve = { exports: {} }, de = {};
11
+ var je = { exports: {} }, ue = {};
12
12
  /**
13
13
  * @license React
14
14
  * react-jsx-runtime.production.js
@@ -18,10 +18,10 @@ var ve = { exports: {} }, de = {};
18
18
  * This source code is licensed under the MIT license found in the
19
19
  * LICENSE file in the root directory of this source tree.
20
20
  */
21
- var Se;
22
- function ns() {
23
- if (Se) return de;
24
- Se = 1;
21
+ var Ae;
22
+ function is() {
23
+ if (Ae) return ue;
24
+ Ae = 1;
25
25
  var s = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
26
26
  function r(i, a, n) {
27
27
  var o = null;
@@ -38,9 +38,9 @@ function ns() {
38
38
  props: n
39
39
  };
40
40
  }
41
- return de.Fragment = t, de.jsx = r, de.jsxs = r, de;
41
+ return ue.Fragment = t, ue.jsx = r, ue.jsxs = r, ue;
42
42
  }
43
- var ue = {};
43
+ var fe = {};
44
44
  /**
45
45
  * @license React
46
46
  * react-jsx-runtime.development.js
@@ -50,47 +50,47 @@ var ue = {};
50
50
  * This source code is licensed under the MIT license found in the
51
51
  * LICENSE file in the root directory of this source tree.
52
52
  */
53
- var Ae;
54
- function as() {
55
- return Ae || (Ae = 1, process.env.NODE_ENV !== "production" && function() {
53
+ var De;
54
+ function os() {
55
+ return De || (De = 1, process.env.NODE_ENV !== "production" && function() {
56
56
  function s(c) {
57
57
  if (c == null) return null;
58
58
  if (typeof c == "function")
59
- return c.$$typeof === H ? null : c.displayName || c.name || null;
59
+ return c.$$typeof === C ? null : c.displayName || c.name || null;
60
60
  if (typeof c == "string") return c;
61
61
  switch (c) {
62
- case R:
62
+ case S:
63
63
  return "Fragment";
64
- case g:
64
+ case B:
65
65
  return "Profiler";
66
- case E:
66
+ case R:
67
67
  return "StrictMode";
68
- case D:
68
+ case I:
69
69
  return "Suspense";
70
- case v:
71
- return "SuspenseList";
72
70
  case Y:
71
+ return "SuspenseList";
72
+ case N:
73
73
  return "Activity";
74
74
  }
75
75
  if (typeof c == "object")
76
76
  switch (typeof c.tag == "number" && console.error(
77
77
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
78
78
  ), c.$$typeof) {
79
- case b:
79
+ case j:
80
80
  return "Portal";
81
- case k:
81
+ case $:
82
82
  return c.displayName || "Context";
83
- case A:
83
+ case y:
84
84
  return (c._context.displayName || "Context") + ".Consumer";
85
85
  case O:
86
- var N = c.render;
87
- return c = c.displayName, c || (c = N.displayName || N.name || "", c = c !== "" ? "ForwardRef(" + c + ")" : "ForwardRef"), c;
88
- case M:
89
- return N = c.displayName || null, N !== null ? N : s(c.type) || "Memo";
90
- case z:
91
- N = c._payload, c = c._init;
86
+ var w = c.render;
87
+ return c = c.displayName, c || (c = w.displayName || w.name || "", c = c !== "" ? "ForwardRef(" + c + ")" : "ForwardRef"), c;
88
+ case q:
89
+ return w = c.displayName || null, w !== null ? w : s(c.type) || "Memo";
90
+ case P:
91
+ w = c._payload, c = c._init;
92
92
  try {
93
- return s(c(N));
93
+ return s(c(w));
94
94
  } catch {
95
95
  }
96
96
  }
@@ -102,33 +102,33 @@ function as() {
102
102
  function r(c) {
103
103
  try {
104
104
  t(c);
105
- var N = !1;
105
+ var w = !1;
106
106
  } catch {
107
- N = !0;
107
+ w = !0;
108
108
  }
109
- if (N) {
110
- N = console;
111
- var P = N.error, F = typeof Symbol == "function" && Symbol.toStringTag && c[Symbol.toStringTag] || c.constructor.name || "Object";
112
- return P.call(
113
- N,
109
+ if (w) {
110
+ w = console;
111
+ var z = w.error, F = typeof Symbol == "function" && Symbol.toStringTag && c[Symbol.toStringTag] || c.constructor.name || "Object";
112
+ return z.call(
113
+ w,
114
114
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
115
115
  F
116
116
  ), t(c);
117
117
  }
118
118
  }
119
119
  function i(c) {
120
- if (c === R) return "<>";
121
- if (typeof c == "object" && c !== null && c.$$typeof === z)
120
+ if (c === S) return "<>";
121
+ if (typeof c == "object" && c !== null && c.$$typeof === P)
122
122
  return "<...>";
123
123
  try {
124
- var N = s(c);
125
- return N ? "<" + N + ">" : "<...>";
124
+ var w = s(c);
125
+ return w ? "<" + w + ">" : "<...>";
126
126
  } catch {
127
127
  return "<...>";
128
128
  }
129
129
  }
130
130
  function a() {
131
- var c = X.A;
131
+ var c = G.A;
132
132
  return c === null ? null : c.getOwner();
133
133
  }
134
134
  function n() {
@@ -136,40 +136,40 @@ function as() {
136
136
  }
137
137
  function o(c) {
138
138
  if (U.call(c, "key")) {
139
- var N = Object.getOwnPropertyDescriptor(c, "key").get;
140
- if (N && N.isReactWarning) return !1;
139
+ var w = Object.getOwnPropertyDescriptor(c, "key").get;
140
+ if (w && w.isReactWarning) return !1;
141
141
  }
142
142
  return c.key !== void 0;
143
143
  }
144
- function l(c, N) {
145
- function P() {
146
- L || (L = !0, console.error(
144
+ function l(c, w) {
145
+ function z() {
146
+ k || (k = !0, console.error(
147
147
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
148
- N
148
+ w
149
149
  ));
150
150
  }
151
- P.isReactWarning = !0, Object.defineProperty(c, "key", {
152
- get: P,
151
+ z.isReactWarning = !0, Object.defineProperty(c, "key", {
152
+ get: z,
153
153
  configurable: !0
154
154
  });
155
155
  }
156
- function p() {
156
+ function m() {
157
157
  var c = s(this.type);
158
- return C[c] || (C[c] = !0, console.error(
158
+ return L[c] || (L[c] = !0, console.error(
159
159
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
160
160
  )), c = this.props.ref, c !== void 0 ? c : null;
161
161
  }
162
- function u(c, N, P, F, te, ae) {
163
- var W = P.ref;
162
+ function d(c, w, z, F, te, ie) {
163
+ var W = z.ref;
164
164
  return c = {
165
- $$typeof: x,
165
+ $$typeof: b,
166
166
  type: c,
167
- key: N,
168
- props: P,
167
+ key: w,
168
+ props: z,
169
169
  _owner: F
170
170
  }, (W !== void 0 ? W : null) !== null ? Object.defineProperty(c, "ref", {
171
171
  enumerable: !1,
172
- get: p
172
+ get: m
173
173
  }) : Object.defineProperty(c, "ref", { enumerable: !1, value: null }), c._store = {}, Object.defineProperty(c._store, "validated", {
174
174
  configurable: !1,
175
175
  enumerable: !1,
@@ -189,28 +189,28 @@ function as() {
189
189
  configurable: !1,
190
190
  enumerable: !1,
191
191
  writable: !0,
192
- value: ae
192
+ value: ie
193
193
  }), Object.freeze && (Object.freeze(c.props), Object.freeze(c)), c;
194
194
  }
195
- function f(c, N, P, F, te, ae) {
196
- var W = N.children;
195
+ function f(c, w, z, F, te, ie) {
196
+ var W = w.children;
197
197
  if (W !== void 0)
198
198
  if (F)
199
- if (_(W)) {
199
+ if (x(W)) {
200
200
  for (F = 0; F < W.length; F++)
201
- m(W[F]);
201
+ p(W[F]);
202
202
  Object.freeze && Object.freeze(W);
203
203
  } else
204
204
  console.error(
205
205
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
206
206
  );
207
- else m(W);
208
- if (U.call(N, "key")) {
207
+ else p(W);
208
+ if (U.call(w, "key")) {
209
209
  W = s(c);
210
- var Q = Object.keys(N).filter(function(_e) {
211
- return _e !== "key";
210
+ var Q = Object.keys(w).filter(function(be) {
211
+ return be !== "key";
212
212
  });
213
- F = 0 < Q.length ? "{key: someKey, " + Q.join(": ..., ") + ": ...}" : "{key: someKey}", w[W + F] || (Q = 0 < Q.length ? "{" + Q.join(": ..., ") + ": ...}" : "{}", console.error(
213
+ F = 0 < Q.length ? "{key: someKey, " + Q.join(": ..., ") + ": ...}" : "{key: someKey}", g[W + F] || (Q = 0 < Q.length ? "{" + Q.join(": ..., ") + ": ...}" : "{}", console.error(
214
214
  `A props object containing a "key" prop is being spread into JSX:
215
215
  let props = %s;
216
216
  <%s {...props} />
@@ -221,69 +221,69 @@ React keys must be passed directly to JSX without using spread:
221
221
  W,
222
222
  Q,
223
223
  W
224
- ), w[W + F] = !0);
224
+ ), g[W + F] = !0);
225
225
  }
226
- if (W = null, P !== void 0 && (r(P), W = "" + P), o(N) && (r(N.key), W = "" + N.key), "key" in N) {
227
- P = {};
228
- for (var ie in N)
229
- ie !== "key" && (P[ie] = N[ie]);
230
- } else P = N;
226
+ if (W = null, z !== void 0 && (r(z), W = "" + z), o(w) && (r(w.key), W = "" + w.key), "key" in w) {
227
+ z = {};
228
+ for (var oe in w)
229
+ oe !== "key" && (z[oe] = w[oe]);
230
+ } else z = w;
231
231
  return W && l(
232
- P,
232
+ z,
233
233
  typeof c == "function" ? c.displayName || c.name || "Unknown" : c
234
- ), u(
234
+ ), d(
235
235
  c,
236
236
  W,
237
- P,
237
+ z,
238
238
  a(),
239
239
  te,
240
- ae
240
+ ie
241
241
  );
242
242
  }
243
- function m(c) {
244
- h(c) ? c._store && (c._store.validated = 1) : typeof c == "object" && c !== null && c.$$typeof === z && (c._payload.status === "fulfilled" ? h(c._payload.value) && c._payload.value._store && (c._payload.value._store.validated = 1) : c._store && (c._store.validated = 1));
243
+ function p(c) {
244
+ h(c) ? c._store && (c._store.validated = 1) : typeof c == "object" && c !== null && c.$$typeof === P && (c._payload.status === "fulfilled" ? h(c._payload.value) && c._payload.value._store && (c._payload.value._store.validated = 1) : c._store && (c._store.validated = 1));
245
245
  }
246
246
  function h(c) {
247
- return typeof c == "object" && c !== null && c.$$typeof === x;
247
+ return typeof c == "object" && c !== null && c.$$typeof === b;
248
248
  }
249
- var d = q, x = Symbol.for("react.transitional.element"), b = Symbol.for("react.portal"), R = Symbol.for("react.fragment"), E = Symbol.for("react.strict_mode"), g = Symbol.for("react.profiler"), A = Symbol.for("react.consumer"), k = Symbol.for("react.context"), O = Symbol.for("react.forward_ref"), D = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), M = Symbol.for("react.memo"), z = Symbol.for("react.lazy"), Y = Symbol.for("react.activity"), H = Symbol.for("react.client.reference"), X = d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, U = Object.prototype.hasOwnProperty, _ = Array.isArray, y = console.createTask ? console.createTask : function() {
249
+ var u = K, b = Symbol.for("react.transitional.element"), j = Symbol.for("react.portal"), S = Symbol.for("react.fragment"), R = Symbol.for("react.strict_mode"), B = Symbol.for("react.profiler"), y = Symbol.for("react.consumer"), $ = Symbol.for("react.context"), O = Symbol.for("react.forward_ref"), I = Symbol.for("react.suspense"), Y = Symbol.for("react.suspense_list"), q = Symbol.for("react.memo"), P = Symbol.for("react.lazy"), N = Symbol.for("react.activity"), C = Symbol.for("react.client.reference"), G = u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, U = Object.prototype.hasOwnProperty, x = Array.isArray, v = console.createTask ? console.createTask : function() {
250
250
  return null;
251
251
  };
252
- d = {
252
+ u = {
253
253
  react_stack_bottom_frame: function(c) {
254
254
  return c();
255
255
  }
256
256
  };
257
- var L, C = {}, K = d.react_stack_bottom_frame.bind(
258
- d,
257
+ var k, L = {}, H = u.react_stack_bottom_frame.bind(
258
+ u,
259
259
  n
260
- )(), Z = y(i(n)), w = {};
261
- ue.Fragment = R, ue.jsx = function(c, N, P) {
262
- var F = 1e4 > X.recentlyCreatedOwnerStacks++;
260
+ )(), X = v(i(n)), g = {};
261
+ fe.Fragment = S, fe.jsx = function(c, w, z) {
262
+ var F = 1e4 > G.recentlyCreatedOwnerStacks++;
263
263
  return f(
264
264
  c,
265
- N,
266
- P,
265
+ w,
266
+ z,
267
267
  !1,
268
- F ? Error("react-stack-top-frame") : K,
269
- F ? y(i(c)) : Z
268
+ F ? Error("react-stack-top-frame") : H,
269
+ F ? v(i(c)) : X
270
270
  );
271
- }, ue.jsxs = function(c, N, P) {
272
- var F = 1e4 > X.recentlyCreatedOwnerStacks++;
271
+ }, fe.jsxs = function(c, w, z) {
272
+ var F = 1e4 > G.recentlyCreatedOwnerStacks++;
273
273
  return f(
274
274
  c,
275
- N,
276
- P,
275
+ w,
276
+ z,
277
277
  !0,
278
- F ? Error("react-stack-top-frame") : K,
279
- F ? y(i(c)) : Z
278
+ F ? Error("react-stack-top-frame") : H,
279
+ F ? v(i(c)) : X
280
280
  );
281
281
  };
282
- }()), ue;
282
+ }()), fe;
283
283
  }
284
- process.env.NODE_ENV === "production" ? ve.exports = ns() : ve.exports = as();
285
- var e = ve.exports;
286
- function is({ size: s = "m", color: t = "default", className: r = "", ...i }) {
284
+ process.env.NODE_ENV === "production" ? je.exports = is() : je.exports = os();
285
+ var e = je.exports;
286
+ function ls({ size: s = "m", color: t = "default", className: r = "", ...i }) {
287
287
  return /* @__PURE__ */ e.jsx(
288
288
  "span",
289
289
  {
@@ -294,8 +294,8 @@ function is({ size: s = "m", color: t = "default", className: r = "", ...i }) {
294
294
  }
295
295
  );
296
296
  }
297
- const os = { xs: 12, s: 14, m: 16, l: 20 };
298
- function fe({
297
+ const cs = { xs: 12, s: 14, m: 16, l: 20 };
298
+ function me({
299
299
  children: s,
300
300
  variant: t = "primary",
301
301
  size: r = "m",
@@ -304,60 +304,62 @@ function fe({
304
304
  disabled: n = !1,
305
305
  state: o = "idle",
306
306
  onClick: l,
307
- type: p = "button",
308
- href: u,
307
+ type: m = "button",
308
+ href: d,
309
309
  "aria-label": f,
310
- ...m
310
+ className: p = "",
311
+ ...h
311
312
  }) {
312
- const h = a && !s, d = o === "loading", x = o === "success", b = o === "error", R = d || x || b, E = r === "xs" ? "s" : "m", g = os[r] ?? 16, A = d ? /* @__PURE__ */ e.jsx(is, { size: E }) : x ? /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(he, { size: g, strokeWidth: 2.5 }) }) : b ? /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(ne, { size: g, strokeWidth: 2.5 }) }) : null, k = [
313
+ const u = a && !s, b = o === "loading", j = o === "success", S = o === "error", R = b || j || S, B = r === "xs" ? "s" : "m", y = cs[r] ?? 16, $ = b ? /* @__PURE__ */ e.jsx(ls, { size: B }) : j ? /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(he, { size: y, strokeWidth: 2.5 }) }) : S ? /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(ne, { size: y, strokeWidth: 2.5 }) }) : null, O = [
313
314
  "ds-button",
314
315
  `ds-button--${t}`,
315
316
  `ds-button--${r}`,
316
317
  i && "ds-button--full",
317
- h && "ds-button--icon-only"
318
- ].filter(Boolean).join(" "), O = o !== "idle" ? o : void 0, D = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
319
- R ? A : a && /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: a }),
318
+ u && "ds-button--icon-only",
319
+ p
320
+ ].filter(Boolean).join(" "), I = o !== "idle" ? o : void 0, Y = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
321
+ R ? $ : a && /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: a }),
320
322
  s
321
323
  ] });
322
- if (u) {
323
- const v = (M) => {
324
- if (n || d) {
325
- M.preventDefault();
324
+ if (d) {
325
+ const q = (P) => {
326
+ if (n || b) {
327
+ P.preventDefault();
326
328
  return;
327
329
  }
328
- M.metaKey || M.ctrlKey || M.button === 1 || (M.preventDefault(), l == null || l(M));
330
+ P.metaKey || P.ctrlKey || P.button === 1 || (P.preventDefault(), l == null || l(P));
329
331
  };
330
332
  return /* @__PURE__ */ e.jsx(
331
333
  "a",
332
334
  {
333
- className: k,
334
- href: n || d ? void 0 : u,
335
- onClick: v,
335
+ className: O,
336
+ href: n || b ? void 0 : d,
337
+ onClick: q,
336
338
  "aria-label": f,
337
- "aria-disabled": n || d ? "true" : void 0,
338
- "aria-busy": d ? "true" : void 0,
339
- "data-state": O,
340
- ...m,
341
- children: D
339
+ "aria-disabled": n || b ? "true" : void 0,
340
+ "aria-busy": b ? "true" : void 0,
341
+ "data-state": I,
342
+ ...h,
343
+ children: Y
342
344
  }
343
345
  );
344
346
  }
345
347
  return /* @__PURE__ */ e.jsx(
346
348
  "button",
347
349
  {
348
- type: p,
349
- className: k,
350
+ type: m,
351
+ className: O,
350
352
  disabled: n,
351
- onClick: d ? void 0 : l,
353
+ onClick: b ? void 0 : l,
352
354
  "aria-label": f,
353
- "aria-busy": d ? "true" : void 0,
354
- "data-state": O,
355
- ...m,
356
- children: D
355
+ "aria-busy": b ? "true" : void 0,
356
+ "data-state": I,
357
+ ...h,
358
+ children: Y
357
359
  }
358
360
  );
359
361
  }
360
- function Os({
362
+ function Vs({
361
363
  label: s,
362
364
  error: t,
363
365
  hint: r,
@@ -366,23 +368,23 @@ function Os({
366
368
  iconRight: n,
367
369
  onIconRightClick: o,
368
370
  size: l = "m",
369
- disabled: p,
370
- id: u,
371
+ disabled: m,
372
+ id: d,
371
373
  ...f
372
374
  }) {
373
- const m = u || `input-${q.useId()}`, h = r ? `${m}-hint` : void 0, d = t ? `${m}-error` : void 0, x = d || h;
374
- return /* @__PURE__ */ e.jsxs("div", { className: `ds-input-wrapper ${i ? "ds-input-wrapper--full" : ""} ${p ? "ds-input-wrapper--disabled" : ""} ${t ? "ds-input-wrapper--error" : ""}`, children: [
375
- s && /* @__PURE__ */ e.jsx("label", { className: "ds-input-label", htmlFor: m, children: s }),
375
+ const p = d || `input-${K.useId()}`, h = r ? `${p}-hint` : void 0, u = t ? `${p}-error` : void 0, b = u || h;
376
+ return /* @__PURE__ */ e.jsxs("div", { className: `ds-input-wrapper ${i ? "ds-input-wrapper--full" : ""} ${m ? "ds-input-wrapper--disabled" : ""} ${t ? "ds-input-wrapper--error" : ""}`, children: [
377
+ s && /* @__PURE__ */ e.jsx("label", { className: "ds-input-label", htmlFor: p, children: s }),
376
378
  /* @__PURE__ */ e.jsxs("div", { className: "ds-input-container", children: [
377
379
  a && /* @__PURE__ */ e.jsx("span", { className: `ds-input-icon ds-input-icon--${l}`, "aria-hidden": "true", children: a }),
378
380
  /* @__PURE__ */ e.jsx(
379
381
  "input",
380
382
  {
381
- id: m,
383
+ id: p,
382
384
  className: `ds-input ds-input--${l} ${a ? "ds-input--with-icon" : ""} ${n ? "ds-input--with-icon-right" : ""} ${t ? "ds-input--error" : ""}`,
383
- disabled: p,
385
+ disabled: m,
384
386
  "aria-invalid": t ? "true" : "false",
385
- "aria-describedby": x,
387
+ "aria-describedby": b,
386
388
  ...f
387
389
  }
388
390
  ),
@@ -399,10 +401,10 @@ function Os({
399
401
  )
400
402
  ] }),
401
403
  r && !t && /* @__PURE__ */ e.jsx("span", { id: h, className: "ds-input-hint", children: r }),
402
- /* @__PURE__ */ e.jsx("div", { className: "ds-input-error-wrap", children: /* @__PURE__ */ e.jsx("div", { className: "ds-input-error-inner", children: t && /* @__PURE__ */ e.jsx("span", { id: d, className: "ds-input-error", role: "alert", children: t }) }) })
404
+ /* @__PURE__ */ e.jsx("div", { className: "ds-input-error-wrap", children: /* @__PURE__ */ e.jsx("div", { className: "ds-input-error-inner", children: t && /* @__PURE__ */ e.jsx("span", { id: u, className: "ds-input-error", role: "alert", children: t }) }) })
403
405
  ] });
404
406
  }
405
- function zs({
407
+ function Ys({
406
408
  label: s,
407
409
  error: t,
408
410
  hint: r,
@@ -411,10 +413,10 @@ function zs({
411
413
  disabled: n,
412
414
  id: o,
413
415
  resize: l = !0,
414
- rows: p = 3,
415
- ...u
416
+ rows: m = 3,
417
+ ...d
416
418
  }) {
417
- const f = o || `textarea-${q.useId()}`, m = r ? `${f}-hint` : void 0, h = t ? `${f}-error` : void 0, d = h || m;
419
+ const f = o || `textarea-${K.useId()}`, p = r ? `${f}-hint` : void 0, h = t ? `${f}-error` : void 0, u = h || p;
418
420
  return /* @__PURE__ */ e.jsxs("div", { className: `ds-textarea-wrapper ${i ? "ds-textarea-wrapper--full" : ""} ${n ? "ds-textarea-wrapper--disabled" : ""}`, children: [
419
421
  s && /* @__PURE__ */ e.jsx("label", { className: "ds-textarea-label", htmlFor: f, children: s }),
420
422
  /* @__PURE__ */ e.jsx(
@@ -424,16 +426,16 @@ function zs({
424
426
  className: `ds-textarea ds-textarea--${a} ${t ? "ds-textarea--error" : ""} ${l ? "" : "ds-textarea--no-resize"}`,
425
427
  disabled: n,
426
428
  "aria-invalid": t ? "true" : "false",
427
- "aria-describedby": d,
428
- rows: p,
429
- ...u
429
+ "aria-describedby": u,
430
+ rows: m,
431
+ ...d
430
432
  }
431
433
  ),
432
- r && !t && /* @__PURE__ */ e.jsx("span", { id: m, className: "ds-textarea-hint", children: r }),
434
+ r && !t && /* @__PURE__ */ e.jsx("span", { id: p, className: "ds-textarea-hint", children: r }),
433
435
  t && /* @__PURE__ */ e.jsx("span", { id: h, className: "ds-textarea-error", role: "alert", children: t })
434
436
  ] });
435
437
  }
436
- function Fs({
438
+ function Hs({
437
439
  label: s,
438
440
  value: t,
439
441
  onChange: r,
@@ -442,148 +444,148 @@ function Fs({
442
444
  error: n,
443
445
  fullWidth: o = !0,
444
446
  size: l = "m",
445
- disabled: p = !1,
446
- id: u,
447
+ disabled: m = !1,
448
+ id: d,
447
449
  ...f
448
450
  }) {
449
- const [m, h] = S(!1), [d, x] = S(!1), [b, R] = S({}), [E, g] = S("down"), [A, k] = S(-1), O = $(null), D = $(null), v = $(null), M = $(null), z = u || `select-${q.useId()}`, Y = `${z}-label`, H = n ? `${z}-error` : void 0, X = 150, U = (w = !1) => {
450
- d || (x(!0), k(-1), M.current = setTimeout(() => {
451
+ const [p, h] = A(!1), [u, b] = A(!1), [j, S] = A({}), [R, B] = A("down"), [y, $] = A(-1), O = E(null), I = E(null), Y = E(null), q = E(null), P = d || `select-${K.useId()}`, N = `${P}-label`, C = n ? `${P}-error` : void 0, G = 150, U = (g = !1) => {
452
+ u || (b(!0), $(-1), q.current = setTimeout(() => {
451
453
  var c;
452
- h(!1), x(!1), w && ((c = v.current) == null || c.focus());
453
- }, X));
454
- }, _ = (w) => {
455
- clearTimeout(M.current), x(!1);
456
- const c = w !== void 0 ? w : Math.max(i.findIndex((N) => N.value === t), 0);
457
- k(c), h(!0);
454
+ h(!1), b(!1), g && ((c = Y.current) == null || c.focus());
455
+ }, G));
456
+ }, x = (g) => {
457
+ clearTimeout(q.current), b(!1);
458
+ const c = g !== void 0 ? g : Math.max(i.findIndex((w) => w.value === t), 0);
459
+ $(c), h(!0);
458
460
  };
459
- B(() => () => clearTimeout(M.current), []);
460
- const y = () => {
461
- var ae;
462
- const w = (ae = O.current) == null ? void 0 : ae.getBoundingClientRect();
463
- if (!w) return;
464
- const c = window.innerHeight, N = c - w.bottom, P = w.top, te = N < 300 && P > N;
465
- g(te ? "up" : "down"), R(
466
- te ? { bottom: c - w.top + 4, left: w.left, width: w.width } : { top: w.bottom + 4, left: w.left, width: w.width }
461
+ M(() => () => clearTimeout(q.current), []);
462
+ const v = () => {
463
+ var ie;
464
+ const g = (ie = O.current) == null ? void 0 : ie.getBoundingClientRect();
465
+ if (!g) return;
466
+ const c = window.innerHeight, w = c - g.bottom, z = g.top, te = w < 300 && z > w;
467
+ B(te ? "up" : "down"), S(
468
+ te ? { bottom: c - g.top + 4, left: g.left, width: g.width } : { top: g.bottom + 4, left: g.left, width: g.width }
467
469
  );
468
470
  };
469
- B(() => {
470
- if (m)
471
- return y(), window.addEventListener("scroll", y, !0), window.addEventListener("resize", y), () => {
472
- window.removeEventListener("scroll", y, !0), window.removeEventListener("resize", y);
471
+ M(() => {
472
+ if (p)
473
+ return v(), window.addEventListener("scroll", v, !0), window.addEventListener("resize", v), () => {
474
+ window.removeEventListener("scroll", v, !0), window.removeEventListener("resize", v);
473
475
  };
474
- }, [m]), B(() => {
475
- const w = (c) => {
476
- O.current && !O.current.contains(c.target) && D.current && !D.current.contains(c.target) && U();
476
+ }, [p]), M(() => {
477
+ const g = (c) => {
478
+ O.current && !O.current.contains(c.target) && I.current && !I.current.contains(c.target) && U();
477
479
  };
478
- return document.addEventListener("mousedown", w), () => document.removeEventListener("mousedown", w);
479
- }, [d]), B(() => {
480
+ return document.addEventListener("mousedown", g), () => document.removeEventListener("mousedown", g);
481
+ }, [u]), M(() => {
480
482
  var c;
481
- if (!m || A < 0 || !D.current) return;
482
- (c = D.current.querySelectorAll(".ds-select-option")[A]) == null || c.scrollIntoView({ block: "nearest" });
483
- }, [A, m]);
484
- const L = (w) => {
485
- switch (w.key) {
483
+ if (!p || y < 0 || !I.current) return;
484
+ (c = I.current.querySelectorAll(".ds-select-option")[y]) == null || c.scrollIntoView({ block: "nearest" });
485
+ }, [y, p]);
486
+ const k = (g) => {
487
+ switch (g.key) {
486
488
  case "ArrowDown":
487
- w.preventDefault(), m ? k((c) => Math.min(c + 1, i.length - 1)) : _();
489
+ g.preventDefault(), p ? $((c) => Math.min(c + 1, i.length - 1)) : x();
488
490
  break;
489
491
  case "ArrowUp":
490
- w.preventDefault(), m ? k((c) => Math.max(c - 1, 0)) : _(i.length - 1);
492
+ g.preventDefault(), p ? $((c) => Math.max(c - 1, 0)) : x(i.length - 1);
491
493
  break;
492
494
  case "Home":
493
- m && (w.preventDefault(), k(0));
495
+ p && (g.preventDefault(), $(0));
494
496
  break;
495
497
  case "End":
496
- m && (w.preventDefault(), k(i.length - 1));
498
+ p && (g.preventDefault(), $(i.length - 1));
497
499
  break;
498
500
  case "Enter":
499
501
  case " ":
500
- w.preventDefault(), m ? A >= 0 && (r == null || r(i[A].value), U(!0)) : _();
502
+ g.preventDefault(), p ? y >= 0 && (r == null || r(i[y].value), U(!0)) : x();
501
503
  break;
502
504
  case "Escape":
503
- m && (w.preventDefault(), U(!0));
505
+ p && (g.preventDefault(), U(!0));
504
506
  break;
505
507
  case "Tab":
506
- m && U(!1);
508
+ p && U(!1);
507
509
  break;
508
510
  }
509
- }, C = i.find((w) => w.value === t), K = l === "xs" ? I[1] : l === "small" ? I[2] : I[3], Z = m && /* @__PURE__ */ e.jsx(
511
+ }, L = i.find((g) => g.value === t), H = l === "xs" ? D[1] : l === "small" ? D[2] : D[3], X = p && /* @__PURE__ */ e.jsx(
510
512
  "div",
511
513
  {
512
- ref: D,
514
+ ref: I,
513
515
  role: "listbox",
514
- "aria-labelledby": s ? Y : void 0,
516
+ "aria-labelledby": s ? N : void 0,
515
517
  tabIndex: -1,
516
518
  className: [
517
519
  "ds-select-dropdown",
518
520
  `ds-select-dropdown--${l}`,
519
- `ds-select-dropdown--${E}`,
520
- d && "ds-select-dropdown--closing"
521
+ `ds-select-dropdown--${R}`,
522
+ u && "ds-select-dropdown--closing"
521
523
  ].filter(Boolean).join(" "),
522
- style: b,
523
- children: i.map((w, c) => /* @__PURE__ */ e.jsx(
524
+ style: j,
525
+ children: i.map((g, c) => /* @__PURE__ */ e.jsx(
524
526
  "button",
525
527
  {
526
- id: `${z}-opt-${c}`,
528
+ id: `${P}-opt-${c}`,
527
529
  type: "button",
528
530
  role: "option",
529
531
  tabIndex: -1,
530
- "aria-selected": t === w.value,
532
+ "aria-selected": t === g.value,
531
533
  className: [
532
534
  "ds-select-option",
533
535
  `ds-select-option--${l}`,
534
- t === w.value && "ds-select-option--selected",
535
- c === A && "ds-select-option--active"
536
+ t === g.value && "ds-select-option--selected",
537
+ c === y && "ds-select-option--active"
536
538
  ].filter(Boolean).join(" "),
537
539
  onClick: () => {
538
- r == null || r(w.value), U(!0);
540
+ r == null || r(g.value), U(!0);
539
541
  },
540
- children: w.label
542
+ children: g.label
541
543
  },
542
- w.value
544
+ g.value
543
545
  ))
544
546
  }
545
547
  );
546
- return /* @__PURE__ */ e.jsxs("div", { className: `ds-select-wrapper ${o ? "ds-select-wrapper--full" : ""} ${p ? "ds-select-wrapper--disabled" : ""}`, children: [
547
- s && /* @__PURE__ */ e.jsx("label", { id: Y, className: "ds-select-label", children: s }),
548
+ return /* @__PURE__ */ e.jsxs("div", { className: `ds-select-wrapper ${o ? "ds-select-wrapper--full" : ""} ${m ? "ds-select-wrapper--disabled" : ""}`, children: [
549
+ s && /* @__PURE__ */ e.jsx("label", { id: N, className: "ds-select-label", children: s }),
548
550
  /* @__PURE__ */ e.jsx("div", { className: "ds-select-container", ref: O, children: /* @__PURE__ */ e.jsxs(
549
551
  "button",
550
552
  {
551
- ref: v,
553
+ ref: Y,
552
554
  type: "button",
553
- id: z,
555
+ id: P,
554
556
  role: "combobox",
555
557
  "aria-haspopup": "listbox",
556
- "aria-expanded": m,
557
- "aria-activedescendant": m && A >= 0 ? `${z}-opt-${A}` : void 0,
558
- "aria-labelledby": s ? Y : void 0,
558
+ "aria-expanded": p,
559
+ "aria-activedescendant": p && y >= 0 ? `${P}-opt-${y}` : void 0,
560
+ "aria-labelledby": s ? N : void 0,
559
561
  "aria-invalid": n ? "true" : "false",
560
- "aria-describedby": H,
562
+ "aria-describedby": C,
561
563
  className: `ds-select-trigger ds-select-trigger--${l} ${n ? "ds-select-trigger--error" : ""}`,
562
564
  onClick: () => {
563
- p || (m ? U() : _());
565
+ m || (p ? U() : x());
564
566
  },
565
- onKeyDown: L,
566
- disabled: p,
567
+ onKeyDown: k,
568
+ disabled: m,
567
569
  ...f,
568
570
  children: [
569
- /* @__PURE__ */ e.jsx("span", { className: C ? "" : "ds-select-placeholder", children: (C == null ? void 0 : C.label) || a }),
571
+ /* @__PURE__ */ e.jsx("span", { className: L ? "" : "ds-select-placeholder", children: (L == null ? void 0 : L.label) || a }),
570
572
  /* @__PURE__ */ e.jsx(
571
573
  xe,
572
574
  {
573
- size: K,
575
+ size: H,
574
576
  strokeWidth: 1.5,
575
- className: `ds-select-icon ${m && E === "down" ? "ds-select-icon--open" : ""} ${m && E === "up" ? "ds-select-icon--up" : ""}`,
577
+ className: `ds-select-icon ${p && R === "down" ? "ds-select-icon--open" : ""} ${p && R === "up" ? "ds-select-icon--up" : ""}`,
576
578
  "aria-hidden": "true"
577
579
  }
578
580
  )
579
581
  ]
580
582
  }
581
583
  ) }),
582
- n && /* @__PURE__ */ e.jsx("span", { id: H, className: "ds-select-error", role: "alert", children: n }),
583
- typeof document < "u" && me.createPortal(Z, document.body)
584
+ n && /* @__PURE__ */ e.jsx("span", { id: C, className: "ds-select-error", role: "alert", children: n }),
585
+ typeof document < "u" && pe.createPortal(X, document.body)
584
586
  ] });
585
587
  }
586
- function Ws({
588
+ function qs({
587
589
  label: s,
588
590
  value: t = 0,
589
591
  onChange: r,
@@ -592,42 +594,42 @@ function Ws({
592
594
  step: n = 1,
593
595
  size: o = "m",
594
596
  disabled: l = !1,
595
- hint: p,
596
- error: u,
597
+ hint: m,
598
+ error: d,
597
599
  ...f
598
600
  }) {
599
- const m = () => {
601
+ const p = () => {
600
602
  if (l) return;
601
- const E = Math.min(Number(t) + n, a);
602
- r == null || r(E);
603
+ const R = Math.min(Number(t) + n, a);
604
+ r == null || r(R);
603
605
  }, h = () => {
604
606
  if (l) return;
605
- const E = Math.max(Number(t) - n, i);
606
- r == null || r(E);
607
- }, d = (E) => {
607
+ const R = Math.max(Number(t) - n, i);
608
+ r == null || r(R);
609
+ }, u = (R) => {
608
610
  if (l) return;
609
- const g = E.target.value;
610
- if (g === "") {
611
+ const B = R.target.value;
612
+ if (B === "") {
611
613
  r == null || r(i);
612
614
  return;
613
615
  }
614
- const A = Number(g);
615
- if (!isNaN(A)) {
616
- const k = Math.min(Math.max(A, i), a);
617
- r == null || r(k);
616
+ const y = Number(B);
617
+ if (!isNaN(y)) {
618
+ const $ = Math.min(Math.max(y, i), a);
619
+ r == null || r($);
618
620
  }
619
- }, x = [
621
+ }, b = [
620
622
  "ds-stepper-wrapper",
621
623
  l && "ds-stepper-wrapper--disabled",
622
- u && "ds-stepper-wrapper--error"
623
- ].filter(Boolean).join(" "), b = [
624
+ d && "ds-stepper-wrapper--error"
625
+ ].filter(Boolean).join(" "), j = [
624
626
  "ds-stepper",
625
627
  `ds-stepper--${o}`,
626
628
  l && "ds-stepper--disabled"
627
- ].filter(Boolean).join(" "), R = o === "xs" ? I[1] : o === "small" ? I[2] : I[3];
628
- return /* @__PURE__ */ e.jsxs("div", { className: x, children: [
629
+ ].filter(Boolean).join(" "), S = o === "xs" ? D[1] : o === "small" ? D[2] : D[3];
630
+ return /* @__PURE__ */ e.jsxs("div", { className: b, children: [
629
631
  s && /* @__PURE__ */ e.jsx("label", { className: "ds-stepper-label", children: s }),
630
- /* @__PURE__ */ e.jsxs("div", { className: b, children: [
632
+ /* @__PURE__ */ e.jsxs("div", { className: j, children: [
631
633
  /* @__PURE__ */ e.jsx(
632
634
  "button",
633
635
  {
@@ -636,7 +638,7 @@ function Ws({
636
638
  onClick: h,
637
639
  disabled: l || t <= i,
638
640
  "aria-label": "Decrease",
639
- children: /* @__PURE__ */ e.jsx(qe, { size: R, strokeWidth: 1.5 })
641
+ children: /* @__PURE__ */ e.jsx(Ye, { size: S, strokeWidth: 1.5 })
640
642
  }
641
643
  ),
642
644
  /* @__PURE__ */ e.jsx(
@@ -645,7 +647,7 @@ function Ws({
645
647
  type: "number",
646
648
  className: "ds-stepper-input",
647
649
  value: t,
648
- onChange: d,
650
+ onChange: u,
649
651
  min: i,
650
652
  max: a,
651
653
  step: n,
@@ -658,18 +660,18 @@ function Ws({
658
660
  {
659
661
  type: "button",
660
662
  className: "ds-stepper-button ds-stepper-button--plus",
661
- onClick: m,
663
+ onClick: p,
662
664
  disabled: l || t >= a,
663
665
  "aria-label": "Increase",
664
- children: /* @__PURE__ */ e.jsx(He, { size: R, strokeWidth: 1.5 })
666
+ children: /* @__PURE__ */ e.jsx(He, { size: S, strokeWidth: 1.5 })
665
667
  }
666
668
  )
667
669
  ] }),
668
- p && !u && /* @__PURE__ */ e.jsx("div", { className: "ds-stepper-hint", children: p }),
669
- u && /* @__PURE__ */ e.jsx("div", { className: "ds-stepper-error", children: u })
670
+ m && !d && /* @__PURE__ */ e.jsx("div", { className: "ds-stepper-hint", children: m }),
671
+ d && /* @__PURE__ */ e.jsx("div", { className: "ds-stepper-error", children: d })
670
672
  ] });
671
673
  }
672
- function ls({
674
+ function Ks({
673
675
  children: s,
674
676
  padding: t = "m",
675
677
  variant: r = "info",
@@ -680,69 +682,69 @@ function ls({
680
682
  disabled: o = !1,
681
683
  ...l
682
684
  }) {
683
- const u = (i ? "interactive" : r) === "interactive" || a || n, f = [
685
+ const d = (i ? "interactive" : r) === "interactive" || a || n, f = [
684
686
  "ds-card",
685
687
  `ds-card--${t}`,
686
- u && "ds-card--interactive"
688
+ d && "ds-card--interactive"
687
689
  ].filter(Boolean).join(" ");
688
690
  if (n) {
689
- const d = (x) => {
691
+ const u = (b) => {
690
692
  if (o) {
691
- x.preventDefault();
693
+ b.preventDefault();
692
694
  return;
693
695
  }
694
- x.metaKey || x.ctrlKey || x.button === 1 || (x.preventDefault(), a == null || a(x));
696
+ b.metaKey || b.ctrlKey || b.button === 1 || (b.preventDefault(), a == null || a(b));
695
697
  };
696
698
  return /* @__PURE__ */ e.jsx(
697
699
  "a",
698
700
  {
699
701
  className: f,
700
702
  href: o ? void 0 : n,
701
- onClick: d,
703
+ onClick: u,
702
704
  "aria-disabled": o ? "true" : void 0,
703
705
  ...l,
704
706
  children: s
705
707
  }
706
708
  );
707
709
  }
708
- const m = u && a ? "button" : "div", h = u && a ? {
710
+ const p = d && a ? "button" : "div", h = d && a ? {
709
711
  type: "button",
710
712
  onClick: a,
711
713
  disabled: o
712
714
  } : {};
713
715
  return /* @__PURE__ */ e.jsx(
714
- m,
716
+ p,
715
717
  {
716
718
  className: f,
717
- role: u && !a ? "article" : void 0,
719
+ role: d && !a ? "article" : void 0,
718
720
  ...h,
719
721
  ...l,
720
722
  children: s
721
723
  }
722
724
  );
723
725
  }
724
- function Cs({ children: s, ...t }) {
726
+ function Gs({ children: s, ...t }) {
725
727
  return /* @__PURE__ */ e.jsx("h1", { className: "ds-h1", ...t, children: s });
726
728
  }
727
- function Us({ children: s, ...t }) {
729
+ function Xs({ children: s, ...t }) {
728
730
  return /* @__PURE__ */ e.jsx("h2", { className: "ds-h2", ...t, children: s });
729
731
  }
730
- function Vs({ children: s, ...t }) {
732
+ function Js({ children: s, ...t }) {
731
733
  return /* @__PURE__ */ e.jsx("h3", { className: "ds-h3", ...t, children: s });
732
734
  }
733
- function Ys({ children: s, ...t }) {
735
+ function Zs({ children: s, ...t }) {
734
736
  return /* @__PURE__ */ e.jsx("h4", { className: "ds-h4", ...t, children: s });
735
737
  }
736
- function qs({ children: s, secondary: t = !1, ...r }) {
738
+ function Qs({ children: s, secondary: t = !1, ...r }) {
737
739
  return /* @__PURE__ */ e.jsx("p", { className: `ds-p1 ${t ? "ds-p1--secondary" : ""}`, ...r, children: s });
738
740
  }
739
- function cs({ children: s, secondary: t = !1, ...r }) {
741
+ function ds({ children: s, secondary: t = !1, ...r }) {
740
742
  return /* @__PURE__ */ e.jsx("p", { className: `ds-p2 ${t ? "ds-p2--secondary" : ""}`, ...r, children: s });
741
743
  }
742
- function ze({ children: s, secondary: t = !1, ...r }) {
744
+ function Fe({ children: s, secondary: t = !1, ...r }) {
743
745
  return /* @__PURE__ */ e.jsx("p", { className: `ds-p3 ${t ? "ds-p3--secondary" : ""}`, ...r, children: s });
744
746
  }
745
- function pe({
747
+ function ae({
746
748
  children: s,
747
749
  variant: t = "default",
748
750
  size: r = "m",
@@ -756,13 +758,13 @@ function pe({
756
758
  ].filter(Boolean).join(" "), o = i || (["info", "success", "warning", "error"].includes(t) ? "status" : void 0);
757
759
  return /* @__PURE__ */ e.jsx("span", { className: n, role: o, ...a, children: s });
758
760
  }
759
- const ds = {
761
+ const us = {
760
762
  info: ke,
761
- success: ge,
762
- warning: ye,
763
+ success: ye,
764
+ warning: ge,
763
765
  error: we
764
766
  };
765
- function Hs({
767
+ function et({
766
768
  children: s,
767
769
  variant: t = "info",
768
770
  title: r,
@@ -770,9 +772,9 @@ function Hs({
770
772
  role: a,
771
773
  ...n
772
774
  }) {
773
- const o = ds[t], l = a || (t === "error" ? "alert" : "status");
775
+ const o = us[t], l = a || (t === "error" ? "alert" : "status");
774
776
  return /* @__PURE__ */ e.jsxs("div", { className: `ds-alert ds-alert--${t} ${r ? "" : "ds-alert--no-title"}`, role: l, ...n, children: [
775
- o && /* @__PURE__ */ e.jsx("div", { className: "ds-alert__icon", children: /* @__PURE__ */ e.jsx(o, { size: I[3], strokeWidth: 1.5 }) }),
777
+ o && /* @__PURE__ */ e.jsx("div", { className: "ds-alert__icon", children: /* @__PURE__ */ e.jsx(o, { size: D[3], strokeWidth: 1.5 }) }),
776
778
  /* @__PURE__ */ e.jsxs("div", { className: "ds-alert__content", children: [
777
779
  r && /* @__PURE__ */ e.jsx("div", { className: "ds-alert__title", children: r }),
778
780
  s && /* @__PURE__ */ e.jsx("div", { className: "ds-alert__message", children: s })
@@ -784,35 +786,35 @@ function Hs({
784
786
  className: "ds-alert__close",
785
787
  onClick: i,
786
788
  "aria-label": "Close alert",
787
- children: /* @__PURE__ */ e.jsx(ne, { size: I[3], strokeWidth: 1.5 })
789
+ children: /* @__PURE__ */ e.jsx(ne, { size: D[3], strokeWidth: 1.5 })
788
790
  }
789
791
  )
790
792
  ] });
791
793
  }
792
- const us = 200;
793
- function Ks({
794
+ const fs = 200;
795
+ function st({
794
796
  children: s,
795
797
  title: t,
796
798
  onClose: r,
797
799
  size: i = "m",
798
800
  ...a
799
801
  }) {
800
- const n = $(null), o = q.useId(), [l, p] = S(!1), u = () => {
801
- !r || l || (p(!0), setTimeout(() => {
802
- p(!1), r();
803
- }, us));
802
+ const n = E(null), o = K.useId(), [l, m] = A(!1), d = () => {
803
+ !r || l || (m(!0), setTimeout(() => {
804
+ m(!1), r();
805
+ }, fs));
804
806
  };
805
- B(() => {
806
- const d = (b) => {
807
- b.key === "Escape" && u();
808
- }, x = (b) => {
809
- n.current && !n.current.contains(b.target) && u();
807
+ M(() => {
808
+ const u = (j) => {
809
+ j.key === "Escape" && d();
810
+ }, b = (j) => {
811
+ n.current && !n.current.contains(j.target) && d();
810
812
  };
811
- return document.addEventListener("keydown", d), document.addEventListener("mousedown", x), () => {
812
- document.removeEventListener("keydown", d), document.removeEventListener("mousedown", x);
813
+ return document.addEventListener("keydown", u), document.addEventListener("mousedown", b), () => {
814
+ document.removeEventListener("keydown", u), document.removeEventListener("mousedown", b);
813
815
  };
814
816
  }, [r, l]);
815
- const f = q.Children.toArray(s), m = f.find((d) => (d == null ? void 0 : d.type) === Ie), h = f.filter((d) => (d == null ? void 0 : d.type) !== Ie);
817
+ const f = K.Children.toArray(s), p = f.find((u) => (u == null ? void 0 : u.type) === Ie), h = f.filter((u) => (u == null ? void 0 : u.type) !== Ie);
816
818
  return /* @__PURE__ */ e.jsx("div", { className: ["ds-modal-overlay", l && "ds-modal-overlay--closing"].filter(Boolean).join(" "), ...a, children: /* @__PURE__ */ e.jsxs(
817
819
  "div",
818
820
  {
@@ -825,18 +827,18 @@ function Ks({
825
827
  (t || r) && /* @__PURE__ */ e.jsxs("div", { className: "ds-modal__header", children: [
826
828
  t && /* @__PURE__ */ e.jsx("h3", { id: o, className: "ds-modal__title", children: t }),
827
829
  r && /* @__PURE__ */ e.jsx(
828
- fe,
830
+ me,
829
831
  {
830
832
  variant: "ghost",
831
833
  size: "small",
832
- icon: /* @__PURE__ */ e.jsx(ne, { size: I[2], strokeWidth: 1.5 }),
833
- onClick: u,
834
+ icon: /* @__PURE__ */ e.jsx(ne, { size: D[2], strokeWidth: 1.5 }),
835
+ onClick: d,
834
836
  "aria-label": "Close modal"
835
837
  }
836
838
  )
837
839
  ] }),
838
840
  /* @__PURE__ */ e.jsx("div", { className: "ds-modal__body", children: h }),
839
- m
841
+ p
840
842
  ]
841
843
  }
842
844
  ) });
@@ -844,7 +846,7 @@ function Ks({
844
846
  function Ie({ children: s }) {
845
847
  return /* @__PURE__ */ e.jsx("div", { className: "ds-modal__footer", children: s });
846
848
  }
847
- function fs({
849
+ function ms({
848
850
  children: s,
849
851
  title: t = "Code",
850
852
  defaultExpanded: r = !1,
@@ -854,30 +856,30 @@ function fs({
854
856
  className: o = "",
855
857
  ...l
856
858
  }) {
857
- const [p, u] = S(r), f = i !== void 0, m = f ? i : p, h = () => {
858
- f ? a == null || a(!i) : u((x) => !x);
859
- }, d = [
859
+ const [m, d] = A(r), f = i !== void 0, p = f ? i : m, h = () => {
860
+ f ? a == null || a(!i) : d((b) => !b);
861
+ }, u = [
860
862
  "ds-code-accordion",
861
863
  `ds-code-accordion--${n}`,
862
- m && "ds-code-accordion--expanded",
864
+ p && "ds-code-accordion--expanded",
863
865
  o
864
866
  ].filter(Boolean).join(" ");
865
- return /* @__PURE__ */ e.jsxs("div", { className: d, ...l, children: [
867
+ return /* @__PURE__ */ e.jsxs("div", { className: u, ...l, children: [
866
868
  /* @__PURE__ */ e.jsxs(
867
869
  "button",
868
870
  {
869
871
  type: "button",
870
872
  className: "ds-code-accordion__header",
871
873
  onClick: h,
872
- "aria-expanded": m,
874
+ "aria-expanded": p,
873
875
  children: [
874
876
  /* @__PURE__ */ e.jsx("span", { className: "ds-code-accordion__title", children: t }),
875
877
  /* @__PURE__ */ e.jsx(
876
878
  xe,
877
879
  {
878
- size: I[2],
880
+ size: D[2],
879
881
  strokeWidth: 1.5,
880
- className: `ds-code-accordion__icon ${m ? "ds-code-accordion__icon--expanded" : ""}`
882
+ className: `ds-code-accordion__icon ${p ? "ds-code-accordion__icon--expanded" : ""}`
881
883
  }
882
884
  )
883
885
  ]
@@ -886,10 +888,10 @@ function fs({
886
888
  /* @__PURE__ */ e.jsx("div", { className: "ds-code-accordion__content", children: /* @__PURE__ */ e.jsx("div", { className: "ds-code-accordion__inner", children: /* @__PURE__ */ e.jsx("pre", { className: "ds-code-accordion__pre", children: /* @__PURE__ */ e.jsx("code", { children: s }) }) }) })
887
889
  ] });
888
890
  }
889
- function Gs({ children: s, block: t = !1, collapsible: r = !1, title: i = "Code", defaultExpanded: a = !1, ...n }) {
890
- return t ? r ? /* @__PURE__ */ e.jsx(fs, { title: i, defaultExpanded: a, ...n, children: s }) : /* @__PURE__ */ e.jsx("pre", { className: "ds-code-block", ...n, children: /* @__PURE__ */ e.jsx("code", { children: s }) }) : /* @__PURE__ */ e.jsx("code", { className: "ds-code-inline", ...n, children: s });
891
+ function tt({ children: s, block: t = !1, collapsible: r = !1, title: i = "Code", defaultExpanded: a = !1, ...n }) {
892
+ return t ? r ? /* @__PURE__ */ e.jsx(ms, { title: i, defaultExpanded: a, ...n, children: s }) : /* @__PURE__ */ e.jsx("pre", { className: "ds-code-block", ...n, children: /* @__PURE__ */ e.jsx("code", { children: s }) }) : /* @__PURE__ */ e.jsx("code", { className: "ds-code-inline", ...n, children: s });
891
893
  }
892
- function Xs({ href: s, children: t, onClick: r, target: i, rel: a, ...n }) {
894
+ function rt({ href: s, children: t, onClick: r, target: i, rel: a, ...n }) {
893
895
  const l = i === "_blank" ? a ? `${a} noopener noreferrer` : "noopener noreferrer" : a;
894
896
  return /* @__PURE__ */ e.jsx(
895
897
  "a",
@@ -904,27 +906,27 @@ function Xs({ href: s, children: t, onClick: r, target: i, rel: a, ...n }) {
904
906
  }
905
907
  );
906
908
  }
907
- function Js({ children: s, size: t = "m", variant: r = "ghost", ...i }) {
908
- return /* @__PURE__ */ e.jsx("div", { className: "ds-tabs", role: "tablist", ...i, children: q.Children.map(s, (a) => q.isValidElement(a) ? q.cloneElement(a, { size: t, variant: r }) : a) });
909
+ function nt({ children: s, size: t = "m", variant: r = "ghost", ...i }) {
910
+ return /* @__PURE__ */ e.jsx("div", { className: "ds-tabs", role: "tablist", ...i, children: K.Children.map(s, (a) => K.isValidElement(a) ? K.cloneElement(a, { size: t, variant: r }) : a) });
909
911
  }
910
- function Zs({ children: s, selected: t = !1, onClick: r, size: i = "m", variant: a = "ghost", disabled: n = !1, icon: o, href: l, ...p }) {
911
- const u = o && !s, f = [
912
+ function at({ children: s, selected: t = !1, onClick: r, size: i = "m", variant: a = "ghost", disabled: n = !1, icon: o, href: l, ...m }) {
913
+ const d = o && !s, f = [
912
914
  "ds-tab",
913
915
  `ds-tab--${i}`,
914
916
  `ds-tab--${a}`,
915
917
  t && "ds-tab--selected",
916
- u && "ds-tab--icon-only"
917
- ].filter(Boolean).join(" "), m = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
918
+ d && "ds-tab--icon-only"
919
+ ].filter(Boolean).join(" "), p = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
918
920
  o && /* @__PURE__ */ e.jsx("span", { className: "ds-tab-icon", children: o }),
919
921
  s
920
922
  ] });
921
923
  if (l) {
922
- const h = (d) => {
924
+ const h = (u) => {
923
925
  if (n) {
924
- d.preventDefault();
926
+ u.preventDefault();
925
927
  return;
926
928
  }
927
- d.metaKey || d.ctrlKey || d.button === 1 || (d.preventDefault(), r == null || r(d));
929
+ u.metaKey || u.ctrlKey || u.button === 1 || (u.preventDefault(), r == null || r(u));
928
930
  };
929
931
  return /* @__PURE__ */ e.jsx(
930
932
  "a",
@@ -935,8 +937,8 @@ function Zs({ children: s, selected: t = !1, onClick: r, size: i = "m", variant:
935
937
  className: f,
936
938
  href: n ? void 0 : l,
937
939
  onClick: h,
938
- ...p,
939
- children: m
940
+ ...m,
941
+ children: p
940
942
  }
941
943
  );
942
944
  }
@@ -948,34 +950,34 @@ function Zs({ children: s, selected: t = !1, onClick: r, size: i = "m", variant:
948
950
  className: f,
949
951
  onClick: r,
950
952
  disabled: n,
951
- ...p,
952
- children: m
953
+ ...m,
954
+ children: p
953
955
  }
954
956
  );
955
957
  }
956
- function Qs({ options: s, value: t, onChange: r, size: i = "m", disabled: a = !1 }) {
957
- const n = $(null), o = $(null), [l, p] = S(!1), u = $(!1), f = $(null), m = $(null), h = () => {
958
+ function it({ options: s, value: t, onChange: r, size: i = "m", disabled: a = !1 }) {
959
+ const n = E(null), o = E(null), [l, m] = A(!1), d = E(!1), f = E(null), p = E(null), h = () => {
958
960
  if (!n.current) return;
959
- const d = n.current.querySelector(`[data-value="${t}"]`);
960
- if (!d) return;
961
- const x = n.current.getBoundingClientRect(), b = d.getBoundingClientRect(), R = b.left - x.left, E = b.width;
962
- o.current ? (o.current.style.transition = u.current ? "left var(--transition-normal), width var(--transition-normal)" : "none", o.current.style.left = R + "px", o.current.style.width = E + "px", u.current = !1) : (p(!0), requestAnimationFrame(() => {
961
+ const u = n.current.querySelector(`[data-value="${t}"]`);
962
+ if (!u) return;
963
+ const b = n.current.getBoundingClientRect(), j = u.getBoundingClientRect(), S = j.left - b.left, R = j.width;
964
+ o.current ? (o.current.style.transition = d.current ? "left var(--transition-normal), width var(--transition-normal)" : "none", o.current.style.left = S + "px", o.current.style.width = R + "px", d.current = !1) : (m(!0), requestAnimationFrame(() => {
963
965
  if (!o.current || !n.current) return;
964
- const g = n.current.querySelector(`[data-value="${t}"]`);
965
- if (!g) return;
966
- const A = n.current.getBoundingClientRect(), k = g.getBoundingClientRect();
967
- o.current.style.transition = "none", o.current.style.left = k.left - A.left + "px", o.current.style.width = k.width + "px";
966
+ const B = n.current.querySelector(`[data-value="${t}"]`);
967
+ if (!B) return;
968
+ const y = n.current.getBoundingClientRect(), $ = B.getBoundingClientRect();
969
+ o.current.style.transition = "none", o.current.style.left = $.left - y.left + "px", o.current.style.width = $.width + "px";
968
970
  }));
969
971
  };
970
- return m.current = h, Ve(() => {
971
- const d = f.current !== t;
972
- f.current = t, u.current = l && d, h();
973
- }), B(() => {
972
+ return p.current = h, Ve(() => {
973
+ const u = f.current !== t;
974
+ f.current = t, d.current = l && u, h();
975
+ }), M(() => {
974
976
  if (!n.current) return;
975
- const d = new ResizeObserver(() => {
976
- u.current = !1, m.current();
977
+ const u = new ResizeObserver(() => {
978
+ d.current = !1, p.current();
977
979
  });
978
- return d.observe(n.current), () => d.disconnect();
980
+ return u.observe(n.current), () => u.disconnect();
979
981
  }, []), /* @__PURE__ */ e.jsxs(
980
982
  "div",
981
983
  {
@@ -995,27 +997,27 @@ function Qs({ options: s, value: t, onChange: r, size: i = "m", disabled: a = !1
995
997
  "aria-hidden": "true"
996
998
  }
997
999
  ),
998
- s.map((d) => /* @__PURE__ */ e.jsxs(
1000
+ s.map((u) => /* @__PURE__ */ e.jsxs(
999
1001
  "button",
1000
1002
  {
1001
1003
  type: "button",
1002
- "data-value": d.value,
1003
- className: ["ds-seg__btn", t === d.value && "ds-seg__btn--active"].filter(Boolean).join(" "),
1004
- onClick: () => !a && r(d.value),
1005
- "aria-pressed": t === d.value,
1004
+ "data-value": u.value,
1005
+ className: ["ds-seg__btn", t === u.value && "ds-seg__btn--active"].filter(Boolean).join(" "),
1006
+ onClick: () => !a && r(u.value),
1007
+ "aria-pressed": t === u.value,
1006
1008
  disabled: a,
1007
1009
  children: [
1008
- d.icon && /* @__PURE__ */ e.jsx("span", { className: "ds-seg__btn-icon", "aria-hidden": "true", children: d.icon }),
1009
- d.label
1010
+ u.icon && /* @__PURE__ */ e.jsx("span", { className: "ds-seg__btn-icon", "aria-hidden": "true", children: u.icon }),
1011
+ u.label
1010
1012
  ]
1011
1013
  },
1012
- d.value
1014
+ u.value
1013
1015
  ))
1014
1016
  ]
1015
1017
  }
1016
1018
  );
1017
1019
  }
1018
- function Fe({
1020
+ function Ee({
1019
1021
  children: s,
1020
1022
  title: t,
1021
1023
  defaultExpanded: r = !1,
@@ -1024,8 +1026,8 @@ function Fe({
1024
1026
  padding: n = "m",
1025
1027
  ...o
1026
1028
  }) {
1027
- const [l, p] = S(r), u = i !== void 0, f = u ? i : l, m = () => {
1028
- u ? a == null || a(!i) : p((d) => !d);
1029
+ const [l, m] = A(r), d = i !== void 0, f = d ? i : l, p = () => {
1030
+ d ? a == null || a(!i) : m((u) => !u);
1029
1031
  }, h = [
1030
1032
  "ds-accordion",
1031
1033
  `ds-accordion--${n}`,
@@ -1037,14 +1039,14 @@ function Fe({
1037
1039
  {
1038
1040
  type: "button",
1039
1041
  className: "ds-accordion__header",
1040
- onClick: m,
1042
+ onClick: p,
1041
1043
  "aria-expanded": f,
1042
1044
  children: [
1043
1045
  /* @__PURE__ */ e.jsx("span", { className: "ds-accordion__title", children: t }),
1044
1046
  /* @__PURE__ */ e.jsx(
1045
1047
  xe,
1046
1048
  {
1047
- size: I[2],
1049
+ size: D[2],
1048
1050
  strokeWidth: 1.5,
1049
1051
  className: `ds-accordion__icon ${f ? "ds-accordion__icon--expanded" : ""}`
1050
1052
  }
@@ -1055,8 +1057,8 @@ function Fe({
1055
1057
  /* @__PURE__ */ e.jsx("div", { className: "ds-accordion__content", children: /* @__PURE__ */ e.jsx("div", { className: "ds-accordion__content-inner", children: /* @__PURE__ */ e.jsx("div", { className: "ds-accordion__content-body", children: s }) }) })
1056
1058
  ] });
1057
1059
  }
1058
- const re = 8, le = 8;
1059
- function ms(s, t, r) {
1060
+ const re = 8, ce = 8;
1061
+ function ps(s, t, r) {
1060
1062
  const i = window.innerWidth;
1061
1063
  let a, n;
1062
1064
  switch (s) {
@@ -1075,49 +1077,49 @@ function ms(s, t, r) {
1075
1077
  default:
1076
1078
  a = t.bottom + re, n = t.left;
1077
1079
  }
1078
- const o = Math.max(le, Math.min(i - r.width - le, n)), l = n - o;
1080
+ const o = Math.max(ce, Math.min(i - r.width - ce, n)), l = n - o;
1079
1081
  return { top: a, left: o, arrowOffset: l };
1080
1082
  }
1081
- function ps(s, t, r) {
1083
+ function hs(s, t, r) {
1082
1084
  const i = window.innerWidth, a = window.innerHeight;
1083
- if (s.top >= t + re + le) return "top";
1084
- if (a - s.bottom >= t + re + le) return "bottom";
1085
- if (i - s.right >= r + re + le) return "right";
1086
- if (s.left >= r + re + le) return "left";
1085
+ if (s.top >= t + re + ce) return "top";
1086
+ if (a - s.bottom >= t + re + ce) return "bottom";
1087
+ if (i - s.right >= r + re + ce) return "right";
1088
+ if (s.left >= r + re + ce) return "left";
1087
1089
  const n = Math.max(s.top, a - s.bottom, s.left, i - s.right);
1088
1090
  return n === s.top ? "top" : n === a - s.bottom ? "bottom" : n === i - s.right ? "right" : "left";
1089
1091
  }
1090
- function et({ children: s, content: t, position: r, ...i }) {
1091
- const [a, n] = S(!1), [o, l] = S({ visibility: "hidden" }), [p, u] = S(r || "top"), f = $(null), m = $(null), h = $(!1), d = () => {
1092
- if (!f.current || !m.current) return;
1093
- const b = f.current.getBoundingClientRect(), R = m.current.getBoundingClientRect(), E = r || ps(b, R.height, R.width), { top: g, left: A, arrowOffset: k } = ms(E, b, R);
1094
- u(E), l({
1092
+ function ot({ children: s, content: t, position: r, ...i }) {
1093
+ const [a, n] = A(!1), [o, l] = A({ visibility: "hidden" }), [m, d] = A(r || "top"), f = E(null), p = E(null), h = E(!1), u = () => {
1094
+ if (!f.current || !p.current) return;
1095
+ const j = f.current.getBoundingClientRect(), S = p.current.getBoundingClientRect(), R = r || hs(j, S.height, S.width), { top: B, left: y, arrowOffset: $ } = ps(R, j, S);
1096
+ d(R), l({
1095
1097
  position: "fixed",
1096
- top: g,
1097
- left: A,
1098
+ top: B,
1099
+ left: y,
1098
1100
  visibility: "visible",
1099
- "--arrow-offset": `${k}px`
1101
+ "--arrow-offset": `${$}px`
1100
1102
  });
1101
1103
  };
1102
- if (B(() => {
1104
+ if (M(() => {
1103
1105
  if (!a) return;
1104
1106
  l({ position: "fixed", visibility: "hidden" });
1105
- const b = requestAnimationFrame(d);
1106
- return window.addEventListener("scroll", d, !0), window.addEventListener("resize", d), () => {
1107
- cancelAnimationFrame(b), window.removeEventListener("scroll", d, !0), window.removeEventListener("resize", d);
1107
+ const j = requestAnimationFrame(u);
1108
+ return window.addEventListener("scroll", u, !0), window.addEventListener("resize", u), () => {
1109
+ cancelAnimationFrame(j), window.removeEventListener("scroll", u, !0), window.removeEventListener("resize", u);
1108
1110
  };
1109
- }, [a, r]), B(() => {
1111
+ }, [a, r]), M(() => {
1110
1112
  if (!a) return;
1111
- const b = (R) => {
1112
- f.current && !f.current.contains(R.target) && n(!1);
1113
+ const j = (S) => {
1114
+ f.current && !f.current.contains(S.target) && n(!1);
1113
1115
  };
1114
- return document.addEventListener("touchstart", b), () => document.removeEventListener("touchstart", b);
1116
+ return document.addEventListener("touchstart", j), () => document.removeEventListener("touchstart", j);
1115
1117
  }, [a]), !t) return s;
1116
- const x = a && /* @__PURE__ */ e.jsx(
1118
+ const b = a && /* @__PURE__ */ e.jsx(
1117
1119
  "div",
1118
1120
  {
1119
- ref: m,
1120
- className: `ds-tooltip ds-tooltip--${p}`,
1121
+ ref: p,
1122
+ className: `ds-tooltip ds-tooltip--${m}`,
1121
1123
  role: "tooltip",
1122
1124
  style: o,
1123
1125
  children: t
@@ -1135,17 +1137,17 @@ function et({ children: s, content: t, position: r, ...i }) {
1135
1137
  h.current || n(!1);
1136
1138
  },
1137
1139
  onTouchStart: () => {
1138
- h.current = !0, n((b) => !b);
1140
+ h.current = !0, n((j) => !j);
1139
1141
  },
1140
1142
  ...i,
1141
1143
  children: [
1142
1144
  s,
1143
- typeof document < "u" && me.createPortal(x, document.body)
1145
+ typeof document < "u" && pe.createPortal(b, document.body)
1144
1146
  ]
1145
1147
  }
1146
1148
  );
1147
1149
  }
1148
- function st({
1150
+ function lt({
1149
1151
  checked: s = !1,
1150
1152
  onChange: t,
1151
1153
  size: r = "m",
@@ -1154,12 +1156,12 @@ function st({
1154
1156
  id: n,
1155
1157
  ...o
1156
1158
  }) {
1157
- const l = n || `toggle-${q.useId()}`, p = [
1159
+ const l = n || `toggle-${K.useId()}`, m = [
1158
1160
  "ds-toggle",
1159
1161
  `ds-toggle--${r}`,
1160
1162
  i && "ds-toggle--disabled"
1161
1163
  ].filter(Boolean).join(" ");
1162
- return /* @__PURE__ */ e.jsxs("label", { className: p, htmlFor: l, children: [
1164
+ return /* @__PURE__ */ e.jsxs("label", { className: m, htmlFor: l, children: [
1163
1165
  /* @__PURE__ */ e.jsx(
1164
1166
  "input",
1165
1167
  {
@@ -1167,7 +1169,7 @@ function st({
1167
1169
  id: l,
1168
1170
  className: "ds-toggle__input",
1169
1171
  checked: s,
1170
- onChange: (u) => t == null ? void 0 : t(u.target.checked),
1172
+ onChange: (d) => t == null ? void 0 : t(d.target.checked),
1171
1173
  disabled: i,
1172
1174
  ...o
1173
1175
  }
@@ -1176,7 +1178,7 @@ function st({
1176
1178
  a && /* @__PURE__ */ e.jsx("span", { className: "ds-toggle__label", children: a })
1177
1179
  ] });
1178
1180
  }
1179
- function tt({
1181
+ function ct({
1180
1182
  checked: s = !1,
1181
1183
  onChange: t,
1182
1184
  size: r = "m",
@@ -1185,12 +1187,12 @@ function tt({
1185
1187
  id: n,
1186
1188
  ...o
1187
1189
  }) {
1188
- const l = n || `checkbox-${q.useId()}`, p = [
1190
+ const l = n || `checkbox-${K.useId()}`, m = [
1189
1191
  "ds-checkbox",
1190
1192
  `ds-checkbox--${r}`,
1191
1193
  i && "ds-checkbox--disabled"
1192
- ].filter(Boolean).join(" "), u = r === "xs" ? 10 : r === "small" ? 14 : r === "large" ? 20 : 16;
1193
- return /* @__PURE__ */ e.jsxs("label", { className: p, htmlFor: l, children: [
1194
+ ].filter(Boolean).join(" "), d = r === "xs" ? 10 : r === "small" ? 14 : r === "large" ? 20 : 16;
1195
+ return /* @__PURE__ */ e.jsxs("label", { className: m, htmlFor: l, children: [
1194
1196
  /* @__PURE__ */ e.jsx(
1195
1197
  "input",
1196
1198
  {
@@ -1206,7 +1208,7 @@ function tt({
1206
1208
  /* @__PURE__ */ e.jsx("span", { className: "ds-checkbox__box", children: s && /* @__PURE__ */ e.jsx(
1207
1209
  he,
1208
1210
  {
1209
- size: u,
1211
+ size: d,
1210
1212
  strokeWidth: 2.5,
1211
1213
  className: "ds-checkbox__icon"
1212
1214
  }
@@ -1214,7 +1216,7 @@ function tt({
1214
1216
  a && /* @__PURE__ */ e.jsx("span", { className: "ds-checkbox__label", children: a })
1215
1217
  ] });
1216
1218
  }
1217
- function rt({
1219
+ function dt({
1218
1220
  checked: s = !1,
1219
1221
  onChange: t,
1220
1222
  size: r = "m",
@@ -1223,33 +1225,33 @@ function rt({
1223
1225
  name: n,
1224
1226
  value: o,
1225
1227
  id: l,
1226
- ...p
1228
+ ...m
1227
1229
  }) {
1228
- const u = l || `radio-${q.useId()}`, f = [
1230
+ const d = l || `radio-${K.useId()}`, f = [
1229
1231
  "ds-radio",
1230
1232
  `ds-radio--${r}`,
1231
1233
  i && "ds-radio--disabled"
1232
1234
  ].filter(Boolean).join(" ");
1233
- return /* @__PURE__ */ e.jsxs("label", { className: f, htmlFor: u, children: [
1235
+ return /* @__PURE__ */ e.jsxs("label", { className: f, htmlFor: d, children: [
1234
1236
  /* @__PURE__ */ e.jsx(
1235
1237
  "input",
1236
1238
  {
1237
1239
  type: "radio",
1238
- id: u,
1240
+ id: d,
1239
1241
  className: "ds-radio__input",
1240
1242
  checked: s,
1241
- onChange: (m) => t == null ? void 0 : t(m.target.checked),
1243
+ onChange: (p) => t == null ? void 0 : t(p.target.checked),
1242
1244
  disabled: i,
1243
1245
  name: n,
1244
1246
  value: o,
1245
- ...p
1247
+ ...m
1246
1248
  }
1247
1249
  ),
1248
1250
  /* @__PURE__ */ e.jsx("span", { className: "ds-radio__circle", children: /* @__PURE__ */ e.jsx("span", { className: "ds-radio__dot" }) }),
1249
1251
  a && /* @__PURE__ */ e.jsx("span", { className: "ds-radio__label", children: a })
1250
1252
  ] });
1251
1253
  }
1252
- function hs({ width: s, height: t, shape: r = "rect", aspectRatio: i, className: a = "", style: n = {}, ...o }) {
1254
+ function xs({ width: s, height: t, shape: r = "rect", aspectRatio: i, className: a = "", style: n = {}, ...o }) {
1253
1255
  return /* @__PURE__ */ e.jsx(
1254
1256
  "span",
1255
1257
  {
@@ -1260,7 +1262,7 @@ function hs({ width: s, height: t, shape: r = "rect", aspectRatio: i, className:
1260
1262
  }
1261
1263
  );
1262
1264
  }
1263
- function xs({ lines: s = 1, lastLineWidth: t = "70%", gap: r, className: i = "", style: a = {}, ...n }) {
1265
+ function bs({ lines: s = 1, lastLineWidth: t = "70%", gap: r, className: i = "", style: a = {}, ...n }) {
1264
1266
  return /* @__PURE__ */ e.jsx(
1265
1267
  "span",
1266
1268
  {
@@ -1279,7 +1281,7 @@ function xs({ lines: s = 1, lastLineWidth: t = "70%", gap: r, className: i = "",
1279
1281
  }
1280
1282
  );
1281
1283
  }
1282
- hs.Text = xs;
1284
+ xs.Text = bs;
1283
1285
  function _s(s) {
1284
1286
  let t = 2166136261;
1285
1287
  for (let r = 0; r < s.length; r++)
@@ -1291,8 +1293,8 @@ function js(s) {
1291
1293
  const t = s.trim().split(/\s+/);
1292
1294
  return t.length >= 2 ? (t[0][0] + t[1][0]).toUpperCase() : s[0].toUpperCase();
1293
1295
  }
1294
- function nt({ seed: s, icon: t, src: r, size: i = 32, className: a = "", style: n = {}, ...o }) {
1295
- const l = _s(s ?? ""), [p, u] = S(!1), f = t ?? /* @__PURE__ */ e.jsx("span", { className: "ds-avatar__initials", children: js(s) });
1296
+ function ut({ seed: s, icon: t, src: r, size: i = 32, className: a = "", style: n = {}, ...o }) {
1297
+ const l = _s(s ?? ""), [m, d] = A(!1), f = t ?? /* @__PURE__ */ e.jsx("span", { className: "ds-avatar__initials", children: js(s) });
1296
1298
  return /* @__PURE__ */ e.jsx(
1297
1299
  "div",
1298
1300
  {
@@ -1300,11 +1302,11 @@ function nt({ seed: s, icon: t, src: r, size: i = 32, className: a = "", style:
1300
1302
  style: { width: i, height: i, "--ds-avatar-h": l, ...n },
1301
1303
  "aria-hidden": "true",
1302
1304
  ...o,
1303
- children: r && !p ? /* @__PURE__ */ e.jsx("img", { src: r, alt: "", onError: () => u(!0) }) : f
1305
+ children: r && !m ? /* @__PURE__ */ e.jsx("img", { src: r, alt: "", onError: () => d(!0) }) : f
1304
1306
  }
1305
1307
  );
1306
1308
  }
1307
- function at({
1309
+ function ft({
1308
1310
  children: s,
1309
1311
  size: t = "compact",
1310
1312
  stickyTop: r,
@@ -1334,40 +1336,42 @@ function at({
1334
1336
  }
1335
1337
  );
1336
1338
  }
1337
- function it({ children: s, ...t }) {
1339
+ function mt({ children: s, ...t }) {
1338
1340
  return /* @__PURE__ */ e.jsx("thead", { ...t, children: s });
1339
1341
  }
1340
- function ot({ children: s, ...t }) {
1342
+ function pt({ children: s, ...t }) {
1341
1343
  return /* @__PURE__ */ e.jsx("tbody", { ...t, children: s });
1342
1344
  }
1343
- function lt({ children: s, interactive: t, selected: r, subheader: i, className: a = "", onClick: n, ...o }) {
1345
+ function ht({ children: s, interactive: t, selected: r, subheader: i, exiting: a, updated: n, className: o = "", onClick: l, ...m }) {
1344
1346
  return /* @__PURE__ */ e.jsx(
1345
1347
  "tr",
1346
1348
  {
1347
1349
  className: [
1348
1350
  "ds-table-row",
1349
- t || n ? "ds-table-row--interactive" : "",
1351
+ t || l ? "ds-table-row--interactive" : "",
1350
1352
  r ? "ds-table-row--selected" : "",
1351
1353
  i ? "ds-table-row--subheader" : "",
1352
- a
1354
+ a ? "ds-table-row--exiting" : "",
1355
+ n ? "ds-table-row--updated" : "",
1356
+ o
1353
1357
  ].filter(Boolean).join(" "),
1354
- onClick: n,
1355
- ...o,
1358
+ onClick: l,
1359
+ ...m,
1356
1360
  children: s
1357
1361
  }
1358
1362
  );
1359
1363
  }
1360
- function ct({ children: s, colSpan: t = 999, ...r }) {
1364
+ function xt({ children: s, colSpan: t = 999, ...r }) {
1361
1365
  return /* @__PURE__ */ e.jsx("tr", { className: "ds-table-row ds-table-row--subheader", ...r, children: /* @__PURE__ */ e.jsx("td", { colSpan: t, children: s }) });
1362
1366
  }
1363
- function dt({ children: s, align: t = "left", sortDir: r, onSort: i, width: a, className: n = "", style: o = {}, ...l }) {
1364
- const p = !!i || r !== void 0, u = r === "asc" ? Ke : r === "desc" ? xe : Ge;
1367
+ function bt({ children: s, align: t = "left", sortDir: r, onSort: i, width: a, className: n = "", style: o = {}, ...l }) {
1368
+ const m = !!i || r !== void 0, d = r === "asc" ? qe : r === "desc" ? xe : Ke;
1365
1369
  return /* @__PURE__ */ e.jsx(
1366
1370
  "th",
1367
1371
  {
1368
1372
  className: [
1369
1373
  "ds-th",
1370
- p ? "ds-th--sortable" : "",
1374
+ m ? "ds-th--sortable" : "",
1371
1375
  r ? "ds-th--sorted" : "",
1372
1376
  t !== "left" ? `ds-table-cell--${t}` : "",
1373
1377
  n
@@ -1375,14 +1379,14 @@ function dt({ children: s, align: t = "left", sortDir: r, onSort: i, width: a, c
1375
1379
  onClick: i,
1376
1380
  style: { width: a, ...o },
1377
1381
  ...l,
1378
- children: p ? /* @__PURE__ */ e.jsxs("span", { className: "ds-th__inner", children: [
1382
+ children: m ? /* @__PURE__ */ e.jsxs("span", { className: "ds-th__inner", children: [
1379
1383
  s,
1380
- /* @__PURE__ */ e.jsx("span", { className: "ds-th__sort-icon", children: /* @__PURE__ */ e.jsx(u, { size: 11, strokeWidth: 2.5 }) })
1384
+ /* @__PURE__ */ e.jsx("span", { className: "ds-th__sort-icon", children: /* @__PURE__ */ e.jsx(d, { size: 11, strokeWidth: 2.5 }) })
1381
1385
  ] }) : s
1382
1386
  }
1383
1387
  );
1384
1388
  }
1385
- function ut({ children: s, align: t = "left", secondary: r, muted: i, truncate: a, nowrap: n, className: o = "", ...l }) {
1389
+ function _t({ children: s, align: t = "left", secondary: r, muted: i, truncate: a, nowrap: n, className: o = "", ...l }) {
1386
1390
  return /* @__PURE__ */ e.jsx(
1387
1391
  "td",
1388
1392
  {
@@ -1400,7 +1404,7 @@ function ut({ children: s, align: t = "left", secondary: r, muted: i, truncate:
1400
1404
  }
1401
1405
  );
1402
1406
  }
1403
- function ft({
1407
+ function jt({
1404
1408
  icon: s,
1405
1409
  title: t,
1406
1410
  description: r,
@@ -1423,7 +1427,7 @@ function ft({
1423
1427
  }
1424
1428
  );
1425
1429
  }
1426
- function mt({
1430
+ function vt({
1427
1431
  label: s,
1428
1432
  hint: t,
1429
1433
  error: r,
@@ -1432,10 +1436,10 @@ function mt({
1432
1436
  htmlFor: n,
1433
1437
  children: o,
1434
1438
  className: l = "",
1435
- style: p,
1436
- ...u
1439
+ style: m,
1440
+ ...d
1437
1441
  }) {
1438
- const f = q.useId(), m = n ?? f, h = `${m}-hint`, d = `${m}-error`;
1442
+ const f = K.useId(), p = n ?? f, h = `${p}-hint`, u = `${p}-error`;
1439
1443
  return /* @__PURE__ */ e.jsxs(
1440
1444
  "div",
1441
1445
  {
@@ -1443,19 +1447,19 @@ function mt({
1443
1447
  "data-state": r ? "error" : void 0,
1444
1448
  "data-required": i ? "" : void 0,
1445
1449
  "data-disabled": a ? "" : void 0,
1446
- style: p,
1447
- ...u,
1450
+ style: m,
1451
+ ...d,
1448
1452
  children: [
1449
- s && /* @__PURE__ */ e.jsx("label", { className: "ds-field-label", htmlFor: m, children: s }),
1453
+ s && /* @__PURE__ */ e.jsx("label", { className: "ds-field-label", htmlFor: p, children: s }),
1450
1454
  /* @__PURE__ */ e.jsx("div", { className: "ds-field-control", children: o }),
1451
1455
  t && !r && /* @__PURE__ */ e.jsx("p", { className: "ds-field-hint", id: h, children: t }),
1452
- r && /* @__PURE__ */ e.jsx("p", { className: "ds-field-error", id: d, role: "alert", children: r })
1456
+ r && /* @__PURE__ */ e.jsx("p", { className: "ds-field-error", id: u, role: "alert", children: r })
1453
1457
  ]
1454
1458
  }
1455
1459
  );
1456
1460
  }
1457
- function pt({ label: s, value: t, delta: r, size: i = "m", inline: a = !1, className: n = "", style: o, ...l }) {
1458
- const p = r != null && r.startsWith("+") ? "up" : r != null && r.startsWith("-") ? "down" : "neutral";
1461
+ function Nt({ label: s, value: t, delta: r, size: i = "m", inline: a = !1, className: n = "", style: o, ...l }) {
1462
+ const m = r != null && r.startsWith("+") ? "up" : r != null && r.startsWith("-") ? "down" : "neutral";
1459
1463
  return /* @__PURE__ */ e.jsxs(
1460
1464
  "div",
1461
1465
  {
@@ -1470,12 +1474,12 @@ function pt({ label: s, value: t, delta: r, size: i = "m", inline: a = !1, class
1470
1474
  children: [
1471
1475
  s && /* @__PURE__ */ e.jsx("span", { className: "ds-stat-label", children: s }),
1472
1476
  t != null && /* @__PURE__ */ e.jsx("span", { className: "ds-stat-value", children: t }),
1473
- r != null && /* @__PURE__ */ e.jsx("span", { className: `ds-stat-delta ds-stat-delta--${p}`, children: r })
1477
+ r != null && /* @__PURE__ */ e.jsx("span", { className: `ds-stat-delta ds-stat-delta--${m}`, children: r })
1474
1478
  ]
1475
1479
  }
1476
1480
  );
1477
1481
  }
1478
- function ht({
1482
+ function wt({
1479
1483
  children: s,
1480
1484
  separator: t = "/",
1481
1485
  "aria-label": r = "Breadcrumb",
@@ -1483,7 +1487,7 @@ function ht({
1483
1487
  style: a,
1484
1488
  ...n
1485
1489
  }) {
1486
- const o = q.Children.toArray(s).filter(Boolean);
1490
+ const o = K.Children.toArray(s).filter(Boolean);
1487
1491
  return /* @__PURE__ */ e.jsx(
1488
1492
  "nav",
1489
1493
  {
@@ -1491,14 +1495,14 @@ function ht({
1491
1495
  "aria-label": r,
1492
1496
  style: a,
1493
1497
  ...n,
1494
- children: /* @__PURE__ */ e.jsx("ol", { className: "ds-breadcrumb-list", children: o.map((l, p) => /* @__PURE__ */ e.jsxs("li", { className: "ds-breadcrumb-item", children: [
1498
+ children: /* @__PURE__ */ e.jsx("ol", { className: "ds-breadcrumb-list", children: o.map((l, m) => /* @__PURE__ */ e.jsxs("li", { className: "ds-breadcrumb-item", children: [
1495
1499
  l,
1496
- p < o.length - 1 && /* @__PURE__ */ e.jsx("span", { className: "ds-breadcrumb-sep", "aria-hidden": "true", children: t })
1497
- ] }, p)) })
1500
+ m < o.length - 1 && /* @__PURE__ */ e.jsx("span", { className: "ds-breadcrumb-sep", "aria-hidden": "true", children: t })
1501
+ ] }, m)) })
1498
1502
  }
1499
1503
  );
1500
1504
  }
1501
- function xt({
1505
+ function gt({
1502
1506
  page: s,
1503
1507
  total: t,
1504
1508
  onChange: r,
@@ -1508,7 +1512,7 @@ function xt({
1508
1512
  style: o,
1509
1513
  ...l
1510
1514
  }) {
1511
- const p = bs(s, t, i);
1515
+ const m = vs(s, t, i);
1512
1516
  return /* @__PURE__ */ e.jsxs(
1513
1517
  "nav",
1514
1518
  {
@@ -1524,20 +1528,20 @@ function xt({
1524
1528
  onClick: () => r == null ? void 0 : r(s - 1),
1525
1529
  disabled: s <= 1,
1526
1530
  "aria-label": "Previous page",
1527
- children: /* @__PURE__ */ e.jsx(Xe, { size: 16 })
1531
+ children: /* @__PURE__ */ e.jsx(Ge, { size: 16 })
1528
1532
  }
1529
1533
  ),
1530
- p.map(
1531
- (u, f) => u === "…" ? /* @__PURE__ */ e.jsx("span", { className: "ds-pagination-gap", "aria-hidden": "true", children: "…" }, `gap-${f}`) : /* @__PURE__ */ e.jsx(
1534
+ m.map(
1535
+ (d, f) => d === "…" ? /* @__PURE__ */ e.jsx("span", { className: "ds-pagination-gap", "aria-hidden": "true", children: "…" }, `gap-${f}`) : /* @__PURE__ */ e.jsx(
1532
1536
  "button",
1533
1537
  {
1534
- className: `ds-pagination-page${u === s ? " ds-pagination-page--current" : ""}`,
1535
- onClick: () => u !== s && (r == null ? void 0 : r(u)),
1536
- "aria-current": u === s ? "page" : void 0,
1537
- "aria-label": `Page ${u}`,
1538
- children: u
1538
+ className: `ds-pagination-page${d === s ? " ds-pagination-page--current" : ""}`,
1539
+ onClick: () => d !== s && (r == null ? void 0 : r(d)),
1540
+ "aria-current": d === s ? "page" : void 0,
1541
+ "aria-label": `Page ${d}`,
1542
+ children: d
1539
1543
  },
1540
- u
1544
+ d
1541
1545
  )
1542
1546
  ),
1543
1547
  /* @__PURE__ */ e.jsx(
@@ -1547,44 +1551,44 @@ function xt({
1547
1551
  onClick: () => r == null ? void 0 : r(s + 1),
1548
1552
  disabled: s >= t,
1549
1553
  "aria-label": "Next page",
1550
- children: /* @__PURE__ */ e.jsx(Oe, { size: 16 })
1554
+ children: /* @__PURE__ */ e.jsx(Xe, { size: 16 })
1551
1555
  }
1552
1556
  )
1553
1557
  ]
1554
1558
  }
1555
1559
  );
1556
1560
  }
1557
- function bs(s, t, r) {
1561
+ function vs(s, t, r) {
1558
1562
  if (t <= 7) return Array.from({ length: t }, (o, l) => l + 1);
1559
1563
  const i = Math.max(2, s - r), a = Math.min(t - 1, s + r), n = [1];
1560
1564
  i > 2 && n.push("…");
1561
1565
  for (let o = i; o <= a; o++) n.push(o);
1562
1566
  return a < t - 1 && n.push("…"), n.push(t), n;
1563
1567
  }
1564
- const vs = 200;
1565
- function _t({
1568
+ const Ns = 200;
1569
+ function yt({
1566
1570
  children: s,
1567
1571
  title: t,
1568
1572
  onClose: r,
1569
1573
  side: i = "right",
1570
1574
  ...a
1571
1575
  }) {
1572
- const n = $(null), o = q.useId(), [l, p] = S(!1), u = () => {
1573
- !r || l || (p(!0), setTimeout(() => {
1574
- p(!1), r();
1575
- }, vs));
1576
+ const n = E(null), o = K.useId(), [l, m] = A(!1), d = () => {
1577
+ !r || l || (m(!0), setTimeout(() => {
1578
+ m(!1), r();
1579
+ }, Ns));
1576
1580
  };
1577
- B(() => {
1578
- const d = (b) => {
1579
- b.key === "Escape" && u();
1580
- }, x = (b) => {
1581
- n.current && !n.current.contains(b.target) && u();
1581
+ M(() => {
1582
+ const u = (j) => {
1583
+ j.key === "Escape" && d();
1584
+ }, b = (j) => {
1585
+ n.current && !n.current.contains(j.target) && d();
1582
1586
  };
1583
- return document.addEventListener("keydown", d), document.addEventListener("mousedown", x), () => {
1584
- document.removeEventListener("keydown", d), document.removeEventListener("mousedown", x);
1587
+ return document.addEventListener("keydown", u), document.addEventListener("mousedown", b), () => {
1588
+ document.removeEventListener("keydown", u), document.removeEventListener("mousedown", b);
1585
1589
  };
1586
1590
  }, [r, l]);
1587
- const f = q.Children.toArray(s), m = f.find((d) => (d == null ? void 0 : d.type) === De), h = f.filter((d) => (d == null ? void 0 : d.type) !== De);
1591
+ const f = K.Children.toArray(s), p = f.find((u) => (u == null ? void 0 : u.type) === Be), h = f.filter((u) => (u == null ? void 0 : u.type) !== Be);
1588
1592
  return /* @__PURE__ */ e.jsx(
1589
1593
  "div",
1590
1594
  {
@@ -1602,26 +1606,26 @@ function _t({
1602
1606
  children: [
1603
1607
  /* @__PURE__ */ e.jsxs("header", { className: "ds-drawer-header", children: [
1604
1608
  t && /* @__PURE__ */ e.jsx("h3", { id: o, className: "ds-drawer-title", children: t }),
1605
- r && /* @__PURE__ */ e.jsx("button", { className: "ds-drawer-close", onClick: u, "aria-label": "Close drawer", children: /* @__PURE__ */ e.jsx(ne, { size: I[2], strokeWidth: 1.5 }) })
1609
+ r && /* @__PURE__ */ e.jsx("button", { className: "ds-drawer-close", onClick: d, "aria-label": "Close drawer", children: /* @__PURE__ */ e.jsx(ne, { size: D[2], strokeWidth: 1.5 }) })
1606
1610
  ] }),
1607
1611
  /* @__PURE__ */ e.jsx("div", { className: "ds-drawer-body", children: h }),
1608
- m
1612
+ p
1609
1613
  ]
1610
1614
  }
1611
1615
  )
1612
1616
  }
1613
1617
  );
1614
1618
  }
1615
- function De({ children: s }) {
1619
+ function Be({ children: s }) {
1616
1620
  return /* @__PURE__ */ e.jsx("footer", { className: "ds-drawer-footer", children: s });
1617
1621
  }
1618
- const Ns = {
1622
+ const ws = {
1619
1623
  info: ke,
1620
- success: ge,
1621
- warning: ye,
1624
+ success: ye,
1625
+ warning: ge,
1622
1626
  error: we
1623
1627
  };
1624
- function jt({
1628
+ function kt({
1625
1629
  children: s,
1626
1630
  variant: t = "info",
1627
1631
  action: r,
@@ -1630,15 +1634,15 @@ function jt({
1630
1634
  role: n,
1631
1635
  ...o
1632
1636
  }) {
1633
- const l = Ns[t], p = n || (t === "error" ? "alert" : "status");
1637
+ const l = ws[t], m = n || (t === "error" ? "alert" : "status");
1634
1638
  return /* @__PURE__ */ e.jsxs(
1635
1639
  "div",
1636
1640
  {
1637
1641
  className: `ds-banner ds-banner--${t}`,
1638
- role: p,
1642
+ role: m,
1639
1643
  ...o,
1640
1644
  children: [
1641
- l && /* @__PURE__ */ e.jsx("span", { className: "ds-banner-icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(l, { size: I[2], strokeWidth: 1.5 }) }),
1645
+ l && /* @__PURE__ */ e.jsx("span", { className: "ds-banner-icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(l, { size: D[2], strokeWidth: 1.5 }) }),
1642
1646
  /* @__PURE__ */ e.jsx("span", { className: "ds-banner-text", children: s }),
1643
1647
  r && /* @__PURE__ */ e.jsx(
1644
1648
  "button",
@@ -1656,14 +1660,14 @@ function jt({
1656
1660
  className: "ds-banner-dismiss",
1657
1661
  onClick: a,
1658
1662
  "aria-label": "Dismiss",
1659
- children: /* @__PURE__ */ e.jsx(ne, { size: I[2], strokeWidth: 1.5 })
1663
+ children: /* @__PURE__ */ e.jsx(ne, { size: D[2], strokeWidth: 1.5 })
1660
1664
  }
1661
1665
  )
1662
1666
  ]
1663
1667
  }
1664
1668
  );
1665
1669
  }
1666
- function bt({
1670
+ function Et({
1667
1671
  trigger: s,
1668
1672
  items: t = [],
1669
1673
  open: r,
@@ -1673,131 +1677,133 @@ function bt({
1673
1677
  style: o,
1674
1678
  ...l
1675
1679
  }) {
1676
- const [p, u] = S(!1), [f, m] = S(!1), h = r !== void 0, d = h ? r : p, x = $(null), b = $(null), R = $(null), E = $(null), [g, A] = S({}), k = $(null), O = 150, D = () => {
1680
+ const [m, d] = A(!1), [f, p] = A(!1), h = r !== void 0, u = h ? r : m, b = E(null), j = E(null), S = E(null), R = E(null), [B, y] = A({}), $ = E(null), O = 150, I = () => {
1677
1681
  if (h)
1678
1682
  i == null || i(!1);
1679
1683
  else {
1680
1684
  if (f) return;
1681
- m(!0), k.current = setTimeout(() => {
1682
- u(!1), m(!1);
1685
+ p(!0), $.current = setTimeout(() => {
1686
+ d(!1), p(!1);
1683
1687
  }, O);
1684
1688
  }
1685
- }, v = () => {
1686
- const _ = !d;
1687
- h ? i == null || i(_) : _ ? (clearTimeout(k.current), m(!1), u(!0)) : D();
1688
- }, M = () => {
1689
- d || (h ? i == null || i(!0) : (clearTimeout(k.current), m(!1), u(!0)));
1689
+ }, Y = () => {
1690
+ const x = !u;
1691
+ h ? i == null || i(x) : x ? (clearTimeout($.current), p(!1), d(!0)) : I();
1692
+ }, q = () => {
1693
+ u || (h ? i == null || i(!0) : (clearTimeout($.current), p(!1), d(!0)));
1690
1694
  };
1691
- B(() => () => clearTimeout(k.current), []), B(() => {
1692
- if (!d) return;
1693
- const _ = () => {
1694
- var L;
1695
- const y = (L = x.current) == null ? void 0 : L.getBoundingClientRect();
1696
- y && A(
1697
- a === "right" ? { top: y.bottom + 4, right: window.innerWidth - y.right } : { top: y.bottom + 4, left: y.left }
1695
+ M(() => () => clearTimeout($.current), []), M(() => {
1696
+ if (!u) return;
1697
+ const x = 300, v = () => {
1698
+ var X;
1699
+ const k = (X = b.current) == null ? void 0 : X.getBoundingClientRect();
1700
+ if (!k) return;
1701
+ const L = window.innerHeight - k.bottom, H = L < x + 8 && k.top > L;
1702
+ y(
1703
+ a === "right" ? H ? { bottom: window.innerHeight - k.top + 4, top: "auto", right: window.innerWidth - k.right } : { top: k.bottom + 4, bottom: "auto", right: window.innerWidth - k.right } : H ? { bottom: window.innerHeight - k.top + 4, top: "auto", left: k.left } : { top: k.bottom + 4, bottom: "auto", left: k.left }
1698
1704
  );
1699
1705
  };
1700
- return _(), window.addEventListener("scroll", _, !0), window.addEventListener("resize", _), () => {
1701
- window.removeEventListener("scroll", _, !0), window.removeEventListener("resize", _);
1706
+ return v(), window.addEventListener("scroll", v, !0), window.addEventListener("resize", v), () => {
1707
+ window.removeEventListener("scroll", v, !0), window.removeEventListener("resize", v);
1702
1708
  };
1703
- }, [d, a]);
1704
- const z = () => {
1705
- var y;
1706
- const _ = (y = R.current) == null ? void 0 : y.querySelector(
1709
+ }, [u, a]);
1710
+ const P = () => {
1711
+ var v;
1712
+ const x = (v = S.current) == null ? void 0 : v.querySelector(
1707
1713
  'button:not([disabled]), [href], [tabindex]:not([tabindex="-1"]), input, select, textarea'
1708
1714
  );
1709
- _ == null || _.focus();
1715
+ x == null || x.focus();
1710
1716
  };
1711
- B(() => {
1712
- if (!d) return;
1713
- const _ = (L) => {
1714
- var C, K;
1715
- !((C = x.current) != null && C.contains(L.target)) && !((K = b.current) != null && K.contains(L.target)) && D();
1716
- }, y = (L) => {
1717
- L.key === "Escape" && (D(), z());
1717
+ M(() => {
1718
+ if (!u) return;
1719
+ const x = (k) => {
1720
+ var L, H;
1721
+ !((L = b.current) != null && L.contains(k.target)) && !((H = j.current) != null && H.contains(k.target)) && I();
1722
+ }, v = (k) => {
1723
+ k.key === "Escape" && (I(), P());
1718
1724
  };
1719
- return document.addEventListener("mousedown", _), document.addEventListener("keydown", y), () => {
1720
- document.removeEventListener("mousedown", _), document.removeEventListener("keydown", y);
1725
+ return document.addEventListener("mousedown", x), document.addEventListener("keydown", v), () => {
1726
+ document.removeEventListener("mousedown", x), document.removeEventListener("keydown", v);
1721
1727
  };
1722
- }, [d]), B(() => {
1723
- if (!d || !E.current || !b.current) return;
1724
- const _ = Y(), y = E.current === "last" ? _[_.length - 1] : _[0];
1725
- y == null || y.focus(), E.current = null;
1726
- }, [d]);
1727
- const Y = () => b.current ? [...b.current.querySelectorAll(
1728
+ }, [u]), M(() => {
1729
+ if (!u || !R.current || !j.current) return;
1730
+ const x = N(), v = R.current === "last" ? x[x.length - 1] : x[0];
1731
+ v == null || v.focus(), R.current = null;
1732
+ }, [u]);
1733
+ const N = () => j.current ? [...j.current.querySelectorAll(
1728
1734
  'button:not([disabled]), a[href]:not([aria-disabled="true"]), [tabindex]:not([tabindex="-1"])'
1729
- )] : [], H = (_) => {
1730
- var y, L;
1731
- if (_.key === "ArrowDown")
1732
- _.preventDefault(), d ? (y = Y()[0]) == null || y.focus() : (E.current = "first", M());
1733
- else if (_.key === "ArrowUp")
1734
- if (_.preventDefault(), !d)
1735
- E.current = "last", M();
1735
+ )] : [], C = (x) => {
1736
+ var v, k;
1737
+ if (x.key === "ArrowDown")
1738
+ x.preventDefault(), u ? (v = N()[0]) == null || v.focus() : (R.current = "first", q());
1739
+ else if (x.key === "ArrowUp")
1740
+ if (x.preventDefault(), !u)
1741
+ R.current = "last", q();
1736
1742
  else {
1737
- const C = Y();
1738
- (L = C[C.length - 1]) == null || L.focus();
1743
+ const L = N();
1744
+ (k = L[L.length - 1]) == null || k.focus();
1739
1745
  }
1740
- }, X = (_) => {
1741
- var C, K, Z, w;
1742
- const y = Y(), L = y.findIndex((c) => c === document.activeElement);
1743
- switch (_.key) {
1746
+ }, G = (x) => {
1747
+ var L, H, X, g;
1748
+ const v = N(), k = v.findIndex((c) => c === document.activeElement);
1749
+ switch (x.key) {
1744
1750
  case "ArrowDown":
1745
- _.preventDefault(), (C = y[Math.min(L + 1, y.length - 1)]) == null || C.focus();
1751
+ x.preventDefault(), (L = v[Math.min(k + 1, v.length - 1)]) == null || L.focus();
1746
1752
  break;
1747
1753
  case "ArrowUp":
1748
- _.preventDefault(), L <= 0 ? z() : (K = y[L - 1]) == null || K.focus();
1754
+ x.preventDefault(), k <= 0 ? P() : (H = v[k - 1]) == null || H.focus();
1749
1755
  break;
1750
1756
  case "Home":
1751
- _.preventDefault(), (Z = y[0]) == null || Z.focus();
1757
+ x.preventDefault(), (X = v[0]) == null || X.focus();
1752
1758
  break;
1753
1759
  case "End":
1754
- _.preventDefault(), (w = y[y.length - 1]) == null || w.focus();
1760
+ x.preventDefault(), (g = v[v.length - 1]) == null || g.focus();
1755
1761
  break;
1756
1762
  case "Tab":
1757
- D();
1763
+ I();
1758
1764
  break;
1759
1765
  }
1760
- }, U = d && /* @__PURE__ */ e.jsx(
1766
+ }, U = u && /* @__PURE__ */ e.jsx(
1761
1767
  "div",
1762
1768
  {
1763
- ref: b,
1769
+ ref: j,
1764
1770
  role: "menu",
1765
1771
  className: [
1766
1772
  "ds-dropdown__menu",
1767
1773
  `ds-dropdown__menu--${a}`,
1768
1774
  f && "ds-dropdown__menu--closing"
1769
1775
  ].filter(Boolean).join(" "),
1770
- style: g,
1771
- onKeyDown: X,
1772
- children: t.map((_, y) => {
1773
- if (_.separator)
1774
- return /* @__PURE__ */ e.jsx("div", { className: "ds-dropdown__separator" }, y);
1775
- if (_.type === "section")
1776
+ style: B,
1777
+ onKeyDown: G,
1778
+ children: t.map((x, v) => {
1779
+ if (x.separator)
1780
+ return /* @__PURE__ */ e.jsx("div", { className: "ds-dropdown__separator" }, v);
1781
+ if (x.type === "section")
1776
1782
  return /* @__PURE__ */ e.jsxs("div", { className: "ds-dropdown__section", children: [
1777
- _.label && /* @__PURE__ */ e.jsx("div", { className: "ds-dropdown__section-label", children: _.label }),
1778
- /* @__PURE__ */ e.jsx("div", { className: "ds-dropdown__section-content", children: _.content })
1779
- ] }, y);
1780
- const L = !!_.href, C = L ? "a" : "button", K = L ? { href: _.disabled ? void 0 : _.href, "aria-disabled": _.disabled ? "true" : void 0 } : { type: "button", disabled: _.disabled };
1783
+ x.label && /* @__PURE__ */ e.jsx("div", { className: "ds-dropdown__section-label", children: x.label }),
1784
+ /* @__PURE__ */ e.jsx("div", { className: "ds-dropdown__section-content", children: x.content })
1785
+ ] }, v);
1786
+ const k = !!x.href, L = k ? "a" : "button", H = k ? { href: x.disabled ? void 0 : x.href, "aria-disabled": x.disabled ? "true" : void 0 } : { type: "button", disabled: x.disabled };
1781
1787
  return /* @__PURE__ */ e.jsxs(
1782
- C,
1788
+ L,
1783
1789
  {
1784
1790
  role: "menuitem",
1785
1791
  className: [
1786
1792
  "ds-dropdown__item",
1787
- _.danger && "ds-dropdown__item--danger"
1793
+ x.danger && "ds-dropdown__item--danger"
1788
1794
  ].filter(Boolean).join(" "),
1789
- ...K,
1795
+ ...H,
1790
1796
  onClick: () => {
1791
- var Z;
1792
- (Z = _.onClick) == null || Z.call(_), D();
1797
+ var X;
1798
+ (X = x.onClick) == null || X.call(x), I();
1793
1799
  },
1794
1800
  children: [
1795
- _.icon && /* @__PURE__ */ e.jsx("span", { className: "ds-dropdown__item-icon", children: _.icon }),
1796
- /* @__PURE__ */ e.jsx("span", { className: "ds-dropdown__item-label", children: _.label }),
1797
- _.shortcut && /* @__PURE__ */ e.jsx("span", { className: "ds-dropdown__item-shortcut", children: _.shortcut })
1801
+ x.icon && /* @__PURE__ */ e.jsx("span", { className: "ds-dropdown__item-icon", children: x.icon }),
1802
+ /* @__PURE__ */ e.jsx("span", { className: "ds-dropdown__item-label", children: x.label }),
1803
+ x.shortcut && /* @__PURE__ */ e.jsx("span", { className: "ds-dropdown__item-shortcut", children: x.shortcut })
1798
1804
  ]
1799
1805
  },
1800
- y
1806
+ v
1801
1807
  );
1802
1808
  })
1803
1809
  }
@@ -1805,7 +1811,7 @@ function bt({
1805
1811
  return /* @__PURE__ */ e.jsxs(
1806
1812
  "div",
1807
1813
  {
1808
- ref: x,
1814
+ ref: b,
1809
1815
  className: ["ds-dropdown", n].filter(Boolean).join(" "),
1810
1816
  style: o,
1811
1817
  ...l,
@@ -1813,19 +1819,19 @@ function bt({
1813
1819
  /* @__PURE__ */ e.jsx(
1814
1820
  "div",
1815
1821
  {
1816
- ref: R,
1822
+ ref: S,
1817
1823
  className: "ds-dropdown__trigger",
1818
- onClick: v,
1819
- onKeyDown: H,
1824
+ onClick: Y,
1825
+ onKeyDown: C,
1820
1826
  children: s
1821
1827
  }
1822
1828
  ),
1823
- typeof document < "u" && me.createPortal(U, document.body)
1829
+ typeof document < "u" && pe.createPortal(U, document.body)
1824
1830
  ]
1825
1831
  }
1826
1832
  );
1827
1833
  }
1828
- function vt({
1834
+ function $t({
1829
1835
  value: s = 0,
1830
1836
  size: t = "m",
1831
1837
  variant: r = "default",
@@ -1833,7 +1839,7 @@ function vt({
1833
1839
  min: a = 2,
1834
1840
  animate: n = !0
1835
1841
  }) {
1836
- const o = Math.min(100, Math.max(0, s)), l = Math.max(a, o), p = r === "auto" ? o >= 70 ? "success" : o >= 50 ? "warning" : "danger" : r;
1842
+ const o = Math.min(100, Math.max(0, s)), l = Math.max(a, o), m = r === "auto" ? o >= 70 ? "success" : o >= 50 ? "warning" : "danger" : r;
1837
1843
  return /* @__PURE__ */ e.jsxs(
1838
1844
  "div",
1839
1845
  {
@@ -1850,7 +1856,7 @@ function vt({
1850
1856
  /* @__PURE__ */ e.jsx("div", { className: "ds-progress__track", children: /* @__PURE__ */ e.jsx(
1851
1857
  "div",
1852
1858
  {
1853
- className: `ds-progress__fill ds-progress__fill--${p}`,
1859
+ className: `ds-progress__fill ds-progress__fill--${m}`,
1854
1860
  style: { width: `${l}%` }
1855
1861
  }
1856
1862
  ) }),
@@ -1862,50 +1868,50 @@ function vt({
1862
1868
  }
1863
1869
  );
1864
1870
  }
1865
- const ws = (s) => 1 - Math.pow(1 - s, 3), ys = () => typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
1866
- function gs(s, { duration: t = 600 } = {}) {
1867
- const [r, i] = S(s), a = $(s), n = $(null);
1868
- return B(() => {
1871
+ const gs = (s) => 1 - Math.pow(1 - s, 3), ys = () => typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
1872
+ function ks(s, { duration: t = 600 } = {}) {
1873
+ const [r, i] = A(s), a = E(s), n = E(null);
1874
+ return M(() => {
1869
1875
  if (ys()) {
1870
1876
  i(s), a.current = s;
1871
1877
  return;
1872
1878
  }
1873
1879
  const o = a.current, l = s - o;
1874
1880
  if (l === 0) return;
1875
- let p = null;
1876
- const u = (f) => {
1877
- p || (p = f);
1878
- const m = Math.min((f - p) / t, 1);
1879
- i(o + l * ws(m)), m < 1 ? n.current = requestAnimationFrame(u) : a.current = s;
1881
+ let m = null;
1882
+ const d = (f) => {
1883
+ m || (m = f);
1884
+ const p = Math.min((f - m) / t, 1);
1885
+ i(o + l * gs(p)), p < 1 ? n.current = requestAnimationFrame(d) : a.current = s;
1880
1886
  };
1881
- return n.current = requestAnimationFrame(u), () => cancelAnimationFrame(n.current);
1887
+ return n.current = requestAnimationFrame(d), () => cancelAnimationFrame(n.current);
1882
1888
  }, [s, t]), r;
1883
1889
  }
1884
- function Nt({
1890
+ function Tt({
1885
1891
  value: s,
1886
1892
  duration: t = 600,
1887
1893
  decimals: r = 0,
1888
1894
  prefix: i = "",
1889
1895
  suffix: a = ""
1890
1896
  }) {
1891
- const o = gs(s, { duration: t }).toFixed(r);
1897
+ const o = ks(s, { duration: t }).toFixed(r);
1892
1898
  return `${i}${o}${a}`;
1893
1899
  }
1894
- function ks({ threshold: s = 0.1, rootMargin: t = "0px", once: r = !1 } = {}) {
1895
- const i = $(null), [a, n] = S(!1);
1896
- return B(() => {
1900
+ function Es({ threshold: s = 0.1, rootMargin: t = "0px", once: r = !1 } = {}) {
1901
+ const i = E(null), [a, n] = A(!1);
1902
+ return M(() => {
1897
1903
  const o = i.current;
1898
1904
  if (!o) return;
1899
1905
  const l = new IntersectionObserver(
1900
- ([p]) => {
1901
- p.isIntersecting ? (n(!0), r && l.disconnect()) : r || n(!1);
1906
+ ([m]) => {
1907
+ m.isIntersecting ? (n(!0), r && l.disconnect()) : r || n(!1);
1902
1908
  },
1903
1909
  { threshold: s, rootMargin: t }
1904
1910
  );
1905
1911
  return l.observe(o), () => l.disconnect();
1906
1912
  }, [s, t, r]), { ref: i, inView: a };
1907
1913
  }
1908
- function wt({
1914
+ function Rt({
1909
1915
  children: s,
1910
1916
  as: t = "div",
1911
1917
  once: r = !1,
@@ -1915,31 +1921,31 @@ function wt({
1915
1921
  onLeave: o,
1916
1922
  ...l
1917
1923
  }) {
1918
- const { ref: p, inView: u } = ks({ threshold: i, rootMargin: a, once: r }), f = $(!1);
1919
- return B(() => {
1920
- u && !f.current && (n == null || n()), !u && f.current && (o == null || o()), f.current = u;
1921
- }, [u]), /* @__PURE__ */ e.jsx(t, { ref: p, ...l, children: typeof s == "function" ? s(u) : s });
1924
+ const { ref: m, inView: d } = Es({ threshold: i, rootMargin: a, once: r }), f = E(!1);
1925
+ return M(() => {
1926
+ d && !f.current && (n == null || n()), !d && f.current && (o == null || o()), f.current = d;
1927
+ }, [d]), /* @__PURE__ */ e.jsx(t, { ref: m, ...l, children: typeof s == "function" ? s(d) : s });
1922
1928
  }
1923
- const Be = {
1929
+ const Me = {
1924
1930
  default: ke,
1925
- success: ge,
1926
- warning: ye,
1931
+ success: ye,
1932
+ warning: ge,
1927
1933
  error: we
1928
1934
  };
1929
- let ce = [];
1930
- const Ne = /* @__PURE__ */ new Set();
1935
+ let de = [];
1936
+ const ve = /* @__PURE__ */ new Set();
1931
1937
  function We() {
1932
- Ne.forEach((s) => s([...ce]));
1933
- }
1934
- function Es(s) {
1935
- ce = [...ce, s], We();
1938
+ ve.forEach((s) => s([...de]));
1936
1939
  }
1937
1940
  function $s(s) {
1938
- ce = ce.filter((t) => t.id !== s), We();
1941
+ de = [...de, s], We();
1942
+ }
1943
+ function Ts(s) {
1944
+ de = de.filter((t) => t.id !== s), We();
1939
1945
  }
1940
- function yt() {
1946
+ function St() {
1941
1947
  const s = (t, r = {}) => {
1942
- Es({
1948
+ $s({
1943
1949
  id: `${Date.now()}-${Math.random()}`,
1944
1950
  message: t,
1945
1951
  type: "default",
@@ -1949,13 +1955,13 @@ function yt() {
1949
1955
  };
1950
1956
  return s.success = (t, r) => s(t, { ...r, type: "success" }), s.error = (t, r) => s(t, { ...r, type: "error" }), s.warning = (t, r) => s(t, { ...r, type: "warning" }), { toast: s };
1951
1957
  }
1952
- function Ts({ data: s, onDismiss: t }) {
1953
- const [r, i] = S(!1), a = $(null);
1954
- B(() => (requestAnimationFrame(() => i(!0)), s.duration > 0 && (a.current = setTimeout(() => n(), s.duration)), () => clearTimeout(a.current)), []);
1958
+ function Rs({ data: s, onDismiss: t }) {
1959
+ const [r, i] = A(!1), a = E(null);
1960
+ M(() => (requestAnimationFrame(() => i(!0)), s.duration > 0 && (a.current = setTimeout(() => n(), s.duration)), () => clearTimeout(a.current)), []);
1955
1961
  function n() {
1956
1962
  i(!1), setTimeout(() => t(s.id), 250);
1957
1963
  }
1958
- const o = Be[s.type] ?? Be.default;
1964
+ const o = Me[s.type] ?? Me.default;
1959
1965
  return /* @__PURE__ */ e.jsxs(
1960
1966
  "div",
1961
1967
  {
@@ -1967,7 +1973,7 @@ function Ts({ data: s, onDismiss: t }) {
1967
1973
  role: s.type === "error" ? "alert" : "status",
1968
1974
  "aria-live": "polite",
1969
1975
  children: [
1970
- /* @__PURE__ */ e.jsx("div", { className: "ds-toast__icon", children: /* @__PURE__ */ e.jsx(o, { size: I[3], strokeWidth: 1.5 }) }),
1976
+ /* @__PURE__ */ e.jsx("div", { className: "ds-toast__icon", children: /* @__PURE__ */ e.jsx(o, { size: D[3], strokeWidth: 1.5 }) }),
1971
1977
  /* @__PURE__ */ e.jsx("span", { className: "ds-toast__message", children: s.message }),
1972
1978
  /* @__PURE__ */ e.jsx(
1973
1979
  "button",
@@ -1975,26 +1981,26 @@ function Ts({ data: s, onDismiss: t }) {
1975
1981
  className: "ds-toast__close",
1976
1982
  onClick: n,
1977
1983
  "aria-label": "Закрыть",
1978
- children: /* @__PURE__ */ e.jsx(ne, { size: I[3], strokeWidth: 1.5 })
1984
+ children: /* @__PURE__ */ e.jsx(ne, { size: D[3], strokeWidth: 1.5 })
1979
1985
  }
1980
1986
  )
1981
1987
  ]
1982
1988
  }
1983
1989
  );
1984
1990
  }
1985
- function gt({ position: s = "bottom-right" }) {
1986
- const [t, r] = S(() => [...ce]);
1987
- return B(() => (Ne.add(r), () => Ne.delete(r)), []), !t.length || typeof document > "u" ? null : me.createPortal(
1988
- /* @__PURE__ */ e.jsx("div", { className: ["ds-toast-container", `ds-toast-container--${s}`].join(" "), children: t.map((i) => /* @__PURE__ */ e.jsx(Ts, { data: i, onDismiss: $s }, i.id)) }),
1991
+ function At({ position: s = "bottom-right" }) {
1992
+ const [t, r] = A(() => [...de]);
1993
+ return M(() => (ve.add(r), () => ve.delete(r)), []), !t.length || typeof document > "u" ? null : pe.createPortal(
1994
+ /* @__PURE__ */ e.jsx("div", { className: ["ds-toast-container", `ds-toast-container--${s}`].join(" "), children: t.map((i) => /* @__PURE__ */ e.jsx(Rs, { data: i, onDismiss: Ts }, i.id)) }),
1989
1995
  document.body
1990
1996
  );
1991
1997
  }
1992
- const Rs = {
1993
- running: /* @__PURE__ */ e.jsx(pe, { size: "xs", variant: "info", children: "Running..." }),
1994
- success: /* @__PURE__ */ e.jsx(pe, { size: "xs", variant: "success", children: "Done" }),
1995
- error: /* @__PURE__ */ e.jsx(pe, { size: "xs", variant: "error", children: "Error" })
1998
+ const Ss = {
1999
+ running: /* @__PURE__ */ e.jsx(ae, { size: "xs", variant: "info", children: "Running..." }),
2000
+ success: /* @__PURE__ */ e.jsx(ae, { size: "xs", variant: "success", children: "Done" }),
2001
+ error: /* @__PURE__ */ e.jsx(ae, { size: "xs", variant: "error", children: "Error" })
1996
2002
  };
1997
- function kt({
2003
+ function Dt({
1998
2004
  label: s,
1999
2005
  status: t = "idle",
2000
2006
  icon: r,
@@ -2002,88 +2008,82 @@ function kt({
2002
2008
  defaultExpanded: a = !1,
2003
2009
  expanded: n,
2004
2010
  onToggle: o,
2005
- padding: l = "s",
2006
- children: p,
2007
- ...u
2011
+ children: l,
2012
+ className: m = "",
2013
+ ...d
2008
2014
  }) {
2009
- const m = `tc-body-${Ye().replace(/:/g, "")}`, [h, d] = S(a), x = n !== void 0, b = x ? n : h, R = () => {
2010
- x ? o == null || o(!n) : d((E) => !E);
2011
- };
2012
- return /* @__PURE__ */ e.jsxs(ls, { padding: l, ...u, children: [
2013
- /* @__PURE__ */ e.jsxs(
2014
- "button",
2015
- {
2016
- type: "button",
2017
- className: "ds-tool-card__header",
2018
- onClick: R,
2019
- "aria-expanded": b,
2020
- "aria-controls": m,
2021
- children: [
2022
- /* @__PURE__ */ e.jsx(
2023
- Oe,
2024
- {
2025
- size: I[1],
2026
- strokeWidth: 1.5,
2027
- className: `ds-tool-card__chevron${b ? " ds-tool-card__chevron--expanded" : ""}`
2028
- }
2029
- ),
2030
- r && /* @__PURE__ */ e.jsx("span", { className: "ds-tool-card__icon", children: r }),
2031
- /* @__PURE__ */ e.jsx("span", { className: "ds-tool-card__label", children: s }),
2032
- Rs[t],
2033
- i
2034
- ]
2035
- }
2036
- ),
2037
- b && /* @__PURE__ */ e.jsx("div", { id: m, className: "ds-tool-card__body", children: p })
2015
+ const f = /* @__PURE__ */ e.jsxs("span", { className: "ds-tool-card__title-row", children: [
2016
+ r && /* @__PURE__ */ e.jsx("span", { className: "ds-tool-card__icon", children: r }),
2017
+ /* @__PURE__ */ e.jsx("span", { className: "ds-tool-card__label", children: s }),
2018
+ Ss[t],
2019
+ i
2038
2020
  ] });
2021
+ return /* @__PURE__ */ e.jsx(
2022
+ "div",
2023
+ {
2024
+ className: ["ds-tool-card", m].filter(Boolean).join(" "),
2025
+ ...d,
2026
+ children: /* @__PURE__ */ e.jsx(
2027
+ Ee,
2028
+ {
2029
+ title: f,
2030
+ padding: "s",
2031
+ defaultExpanded: a,
2032
+ expanded: n,
2033
+ onToggle: o,
2034
+ children: /* @__PURE__ */ e.jsx("div", { className: "ds-tool-card__body", children: l })
2035
+ }
2036
+ )
2037
+ }
2038
+ );
2039
2039
  }
2040
- function Et({
2040
+ function As({
2041
2041
  text: s,
2042
2042
  size: t = "xs",
2043
2043
  timeout: r = 2e3,
2044
2044
  "aria-label": i = "Copy to clipboard",
2045
2045
  ...a
2046
2046
  }) {
2047
- const [n, o] = S(!1), l = () => {
2047
+ const [n, o] = A(!1), l = () => {
2048
2048
  navigator.clipboard.writeText(s).then(() => {
2049
2049
  o(!0), setTimeout(() => o(!1), r);
2050
2050
  });
2051
2051
  };
2052
2052
  return /* @__PURE__ */ e.jsx(
2053
- fe,
2053
+ me,
2054
2054
  {
2055
2055
  variant: "ghost",
2056
2056
  size: t,
2057
- icon: n ? /* @__PURE__ */ e.jsx(he, { size: I[1], strokeWidth: 1.5 }) : /* @__PURE__ */ e.jsx(Je, { size: I[1], strokeWidth: 1.5 }),
2057
+ icon: n ? /* @__PURE__ */ e.jsx(he, { size: D[1], strokeWidth: 1.5 }) : /* @__PURE__ */ e.jsx(Je, { size: D[1], strokeWidth: 1.5 }),
2058
2058
  "aria-label": i,
2059
2059
  onClick: l,
2060
2060
  ...a
2061
2061
  }
2062
2062
  );
2063
2063
  }
2064
- function $t({ content: s, streaming: t = !1, ...r }) {
2065
- const [i, a] = S(t);
2066
- return B(() => {
2064
+ function It({ content: s, streaming: t = !1, ...r }) {
2065
+ const [i, a] = A(t);
2066
+ return M(() => {
2067
2067
  a(!!t);
2068
2068
  }, [t]), /* @__PURE__ */ e.jsx(
2069
- Fe,
2069
+ Ee,
2070
2070
  {
2071
2071
  expanded: i,
2072
2072
  onToggle: a,
2073
2073
  padding: "s",
2074
2074
  title: /* @__PURE__ */ e.jsxs("div", { className: "ds-reasoning__title", children: [
2075
- /* @__PURE__ */ e.jsx(Ze, { size: I[1], strokeWidth: 1.5, className: "ds-reasoning__icon" }),
2076
- /* @__PURE__ */ e.jsx(cs, { secondary: !0, children: "Thinking" })
2075
+ /* @__PURE__ */ e.jsx(Ze, { size: D[1], strokeWidth: 1.5, className: "ds-reasoning__icon" }),
2076
+ /* @__PURE__ */ e.jsx(ds, { secondary: !0, children: "Thinking" })
2077
2077
  ] }),
2078
2078
  ...r,
2079
- children: /* @__PURE__ */ e.jsxs(ze, { secondary: !0, style: { whiteSpace: "pre-wrap" }, children: [
2079
+ children: /* @__PURE__ */ e.jsxs(Fe, { secondary: !0, style: { whiteSpace: "pre-wrap" }, children: [
2080
2080
  s,
2081
2081
  t && /* @__PURE__ */ e.jsx("span", { className: "ds-cursor ds-cursor--line" })
2082
2082
  ] })
2083
2083
  }
2084
2084
  );
2085
2085
  }
2086
- function Tt({
2086
+ function Bt({
2087
2087
  count: s,
2088
2088
  current: t = 0,
2089
2089
  done: r = [],
@@ -2094,35 +2094,35 @@ function Tt({
2094
2094
  ...l
2095
2095
  }) {
2096
2096
  return /* @__PURE__ */ e.jsxs("div", { className: ["ds-step-indicator", n].filter(Boolean).join(" "), ...l, children: [
2097
- /* @__PURE__ */ e.jsx("div", { className: "ds-step-indicator__dots", role: "tablist", "aria-label": o, children: Array.from({ length: s }, (p, u) => {
2098
- const f = u === t, m = r.includes(u) && !f, h = i && (u <= t || r.includes(u)), d = [
2097
+ /* @__PURE__ */ e.jsx("div", { className: "ds-step-indicator__dots", role: "tablist", "aria-label": o, children: Array.from({ length: s }, (m, d) => {
2098
+ const f = d === t, p = r.includes(d) && !f, h = i && (d <= t || r.includes(d)), u = [
2099
2099
  "ds-step-indicator__dot",
2100
2100
  f && "ds-step-indicator__dot--active",
2101
- m && "ds-step-indicator__dot--done"
2101
+ p && "ds-step-indicator__dot--done"
2102
2102
  ].filter(Boolean).join(" ");
2103
2103
  return /* @__PURE__ */ e.jsx(
2104
2104
  "button",
2105
2105
  {
2106
2106
  type: "button",
2107
- className: d,
2107
+ className: u,
2108
2108
  role: "tab",
2109
2109
  "aria-selected": f,
2110
- "aria-label": `Step ${u + 1}`,
2111
- disabled: !h || u === t,
2112
- onClick: () => i == null ? void 0 : i(u),
2113
- children: m ? /* @__PURE__ */ e.jsx(he, { size: 8, strokeWidth: 3 }) : null
2110
+ "aria-label": `Step ${d + 1}`,
2111
+ disabled: !h || d === t,
2112
+ onClick: () => i == null ? void 0 : i(d),
2113
+ children: p ? /* @__PURE__ */ e.jsx(he, { size: 8, strokeWidth: 3 }) : null
2114
2114
  },
2115
- u
2115
+ d
2116
2116
  );
2117
2117
  }) }),
2118
- a && /* @__PURE__ */ e.jsxs(ze, { secondary: !0, className: "ds-step-indicator__counter", children: [
2118
+ a && /* @__PURE__ */ e.jsxs(Fe, { secondary: !0, className: "ds-step-indicator__counter", children: [
2119
2119
  t + 1,
2120
2120
  " / ",
2121
2121
  s
2122
2122
  ] })
2123
2123
  ] });
2124
2124
  }
2125
- function Rt({
2125
+ function Mt({
2126
2126
  content: s,
2127
2127
  isStreaming: t = !1,
2128
2128
  cursor: r = "line",
@@ -2130,15 +2130,15 @@ function Rt({
2130
2130
  className: a = "",
2131
2131
  ...n
2132
2132
  }) {
2133
- const o = $(s);
2134
- return B(() => {
2133
+ const o = E(s);
2134
+ return M(() => {
2135
2135
  s !== o.current && (i == null || i(s), o.current = s);
2136
2136
  }, [s, i]), /* @__PURE__ */ e.jsxs("span", { className: ["ds-streaming-text", a].filter(Boolean).join(" "), ...n, children: [
2137
2137
  s,
2138
2138
  t && r !== "none" && /* @__PURE__ */ e.jsx("span", { className: `ds-cursor ds-cursor--${r}`, "aria-hidden": "true" })
2139
2139
  ] });
2140
2140
  }
2141
- function St({
2141
+ function Pt({
2142
2142
  role: s = "assistant",
2143
2143
  header: t,
2144
2144
  footer: r,
@@ -2148,26 +2148,26 @@ function St({
2148
2148
  className: o = "",
2149
2149
  ...l
2150
2150
  }) {
2151
- const p = [
2151
+ const m = [
2152
2152
  "ds-chat-message",
2153
2153
  `ds-chat-message--${s}`,
2154
2154
  a && "ds-chat-message--streaming",
2155
2155
  o
2156
2156
  ].filter(Boolean).join(" ");
2157
- return s === "system" ? /* @__PURE__ */ e.jsx("div", { className: p, ...l, children: /* @__PURE__ */ e.jsx("span", { className: "ds-chat-message__system-label", children: n }) }) : s === "user" ? /* @__PURE__ */ e.jsxs("div", { className: p, ...l, children: [
2157
+ return s === "system" ? /* @__PURE__ */ e.jsx("div", { className: m, ...l, children: /* @__PURE__ */ e.jsx("span", { className: "ds-chat-message__system-label", children: n }) }) : s === "user" ? /* @__PURE__ */ e.jsxs("div", { className: m, ...l, children: [
2158
2158
  i && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__attachments", children: i }),
2159
2159
  /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__bubble", children: n }),
2160
2160
  r && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__footer", children: r })
2161
- ] }) : /* @__PURE__ */ e.jsxs("div", { className: p, ...l, children: [
2161
+ ] }) : /* @__PURE__ */ e.jsxs("div", { className: m, ...l, children: [
2162
2162
  t && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__header", children: t }),
2163
2163
  i && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__attachments", children: i }),
2164
2164
  /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__body", children: n }),
2165
2165
  r && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__footer", children: r })
2166
2166
  ] });
2167
2167
  }
2168
- function At(s, { containerRef: t, smartPause: r = !0 } = {}) {
2169
- const i = $(!1), a = $(0);
2170
- B(() => {
2168
+ function Lt(s, { containerRef: t, smartPause: r = !0 } = {}) {
2169
+ const i = E(!1), a = E(0);
2170
+ M(() => {
2171
2171
  const n = t == null ? void 0 : t.current;
2172
2172
  if (!n) return;
2173
2173
  const o = () => {
@@ -2175,12 +2175,12 @@ function At(s, { containerRef: t, smartPause: r = !0 } = {}) {
2175
2175
  !l && n.scrollTop < a.current && (i.current = !0), l && (i.current = !1), a.current = n.scrollTop;
2176
2176
  };
2177
2177
  return n.addEventListener("scroll", o, { passive: !0 }), () => n.removeEventListener("scroll", o);
2178
- }, [t]), B(() => {
2178
+ }, [t]), M(() => {
2179
2179
  const n = t == null ? void 0 : t.current;
2180
2180
  n && (r && i.current || (n.scrollTop = n.scrollHeight));
2181
2181
  }, s);
2182
2182
  }
2183
- function Ss({
2183
+ function Ds({
2184
2184
  prompts: s,
2185
2185
  enabled: t,
2186
2186
  typingSpeed: r = 38,
@@ -2189,36 +2189,36 @@ function Ss({
2189
2189
  betweenTime: n = 380,
2190
2190
  manualPauseMs: o = 5e3
2191
2191
  }) {
2192
- const [l, p] = S(0), [u, f] = S(""), m = $("typing"), h = $(0), d = $(0), x = $(null), b = $(0);
2193
- B(() => {
2194
- d.current = l;
2195
- }, [l]), B(() => {
2196
- if (x.current && (clearTimeout(x.current), x.current = null), !t || s.length === 0) {
2197
- f(""), h.current = 0, m.current = "typing";
2192
+ const [l, m] = A(0), [d, f] = A(""), p = E("typing"), h = E(0), u = E(0), b = E(null), j = E(0);
2193
+ M(() => {
2194
+ u.current = l;
2195
+ }, [l]), M(() => {
2196
+ if (b.current && (clearTimeout(b.current), b.current = null), !t || s.length === 0) {
2197
+ f(""), h.current = 0, p.current = "typing";
2198
2198
  return;
2199
2199
  }
2200
- const k = () => {
2200
+ const $ = () => {
2201
2201
  const O = Date.now();
2202
- if (b.current > O) {
2203
- x.current = setTimeout(k, b.current - O);
2202
+ if (j.current > O) {
2203
+ b.current = setTimeout($, j.current - O);
2204
2204
  return;
2205
2205
  }
2206
- const D = s[d.current % s.length] ?? "";
2207
- m.current === "typing" ? (h.current += 1, f(D.slice(0, h.current)), h.current >= D.length ? (m.current = "holding", x.current = setTimeout(k, a)) : x.current = setTimeout(k, r + Math.random() * 28)) : m.current === "holding" ? (m.current = "erasing", x.current = setTimeout(k, i)) : (h.current = Math.max(0, h.current - 1), f(D.slice(0, h.current)), h.current <= 0 ? (m.current = "typing", d.current = (d.current + 1) % s.length, p(d.current), x.current = setTimeout(k, n)) : x.current = setTimeout(k, i));
2206
+ const I = s[u.current % s.length] ?? "";
2207
+ p.current === "typing" ? (h.current += 1, f(I.slice(0, h.current)), h.current >= I.length ? (p.current = "holding", b.current = setTimeout($, a)) : b.current = setTimeout($, r + Math.random() * 28)) : p.current === "holding" ? (p.current = "erasing", b.current = setTimeout($, i)) : (h.current = Math.max(0, h.current - 1), f(I.slice(0, h.current)), h.current <= 0 ? (p.current = "typing", u.current = (u.current + 1) % s.length, m(u.current), b.current = setTimeout($, n)) : b.current = setTimeout($, i));
2208
2208
  };
2209
- return x.current = setTimeout(k, 260), () => {
2210
- x.current && clearTimeout(x.current);
2209
+ return b.current = setTimeout($, 260), () => {
2210
+ b.current && clearTimeout(b.current);
2211
2211
  };
2212
2212
  }, [t, s, r, i, a, n]);
2213
- const R = (k) => {
2213
+ const S = ($) => {
2214
2214
  if (s.length === 0) return;
2215
- const O = (k % s.length + s.length) % s.length, D = s[O];
2216
- d.current = O, h.current = D.length, m.current = "holding", b.current = Date.now() + o, p(O), f(D);
2217
- }, E = () => R(d.current + 1), g = () => R(d.current - 1), A = s[l % s.length] ?? "";
2218
- return { displayed: u, currentPrompt: A, index: l, next: E, prev: g };
2215
+ const O = ($ % s.length + s.length) % s.length, I = s[O];
2216
+ u.current = O, h.current = I.length, p.current = "holding", j.current = Date.now() + o, m(O), f(I);
2217
+ }, R = () => S(u.current + 1), B = () => S(u.current - 1), y = s[l % s.length] ?? "";
2218
+ return { displayed: d, currentPrompt: y, index: l, next: R, prev: B };
2219
2219
  }
2220
- let As = 0;
2221
- function It({
2220
+ let Is = 0;
2221
+ function zt({
2222
2222
  value: s = "",
2223
2223
  onChange: t,
2224
2224
  onSubmit: r,
@@ -2227,122 +2227,122 @@ function It({
2227
2227
  loading: n = !1,
2228
2228
  disabled: o = !1,
2229
2229
  placeholder: l = "Let's get things done...",
2230
- animatedPlaceholders: p,
2231
- attachments: u,
2230
+ animatedPlaceholders: m,
2231
+ attachments: d,
2232
2232
  images: f,
2233
- onAttachFiles: m,
2233
+ onAttachFiles: p,
2234
2234
  onAttachImages: h,
2235
- onRemoveAttachment: d,
2236
- onRemoveImage: x,
2237
- acceptImage: b,
2238
- acceptFile: R,
2239
- maxImages: E,
2240
- maxImageSize: g,
2241
- leftSlot: A,
2242
- rightSlot: k,
2235
+ onRemoveAttachment: u,
2236
+ onRemoveImage: b,
2237
+ acceptImage: j,
2238
+ acceptFile: S,
2239
+ maxImages: R,
2240
+ maxImageSize: B,
2241
+ leftSlot: y,
2242
+ rightSlot: $,
2243
2243
  className: O = "",
2244
- ...D
2244
+ ...I
2245
2245
  }) {
2246
- const v = $(null), M = $(null), z = $(0), [Y, H] = S(!1), [X, U] = S([]), _ = (j) => {
2247
- const T = ++As;
2248
- U((V) => [...V, { id: T, msg: j }]), setTimeout(() => U((V) => V.filter((G) => G.id !== T)), 6e3);
2249
- }, y = (j) => U((T) => T.filter((V) => V.id !== j)), L = (j) => j.type.startsWith("image/"), C = () => !0, K = b ?? L, Z = R ?? C, w = (j) => {
2250
- const T = [], V = [], G = [], J = [];
2251
- let ee = 0, oe = E != null ? E - ((f == null ? void 0 : f.length) ?? 0) : 1 / 0;
2252
- for (const se of j)
2253
- K(se) ? g && se.size > g ? G.push(se.name) : oe > 0 ? (T.push(se), oe--) : ee++ : Z(se) ? V.push(se) : J.push(se.name);
2254
- return { imageFiles: T, docFiles: V, tooLarge: G, skipped: J, limitExceeded: ee };
2255
- }, c = (j) => {
2256
- const { imageFiles: T, docFiles: V, tooLarge: G, skipped: J, limitExceeded: ee } = w(j);
2257
- G.length && _(`File${G.length > 1 ? "s" : ""} too large${g ? ` (max ${g / 1024 / 1024}MB)` : ""}: ${G.join(", ")}`), J.length && _(`Skipped unsupported file${J.length > 1 ? "s" : ""}: ${J.join(", ")}`), ee && _(`Max ${E} images per message`), h && T.length && h(T);
2258
- const oe = V.concat(h ? [] : T);
2259
- m && oe.length && m(oe);
2246
+ const Y = E(null), q = E(null), P = E(0), [N, C] = A(!1), [G, U] = A([]), x = (_) => {
2247
+ const T = ++Is;
2248
+ U((V) => [...V, { id: T, msg: _ }]), setTimeout(() => U((V) => V.filter((J) => J.id !== T)), 6e3);
2249
+ }, v = (_) => U((T) => T.filter((V) => V.id !== _)), k = (_) => _.type.startsWith("image/"), L = () => !0, H = j ?? k, X = S ?? L, g = (_) => {
2250
+ const T = [], V = [], J = [], Z = [];
2251
+ let ee = 0, le = R != null ? R - ((f == null ? void 0 : f.length) ?? 0) : 1 / 0;
2252
+ for (const se of _)
2253
+ H(se) ? B && se.size > B ? J.push(se.name) : le > 0 ? (T.push(se), le--) : ee++ : X(se) ? V.push(se) : Z.push(se.name);
2254
+ return { imageFiles: T, docFiles: V, tooLarge: J, skipped: Z, limitExceeded: ee };
2255
+ }, c = (_) => {
2256
+ const { imageFiles: T, docFiles: V, tooLarge: J, skipped: Z, limitExceeded: ee } = g(_);
2257
+ J.length && x(`File${J.length > 1 ? "s" : ""} too large${B ? ` (max ${B / 1024 / 1024}MB)` : ""}: ${J.join(", ")}`), Z.length && x(`Skipped unsupported file${Z.length > 1 ? "s" : ""}: ${Z.join(", ")}`), ee && x(`Max ${R} images per message`), h && T.length && h(T);
2258
+ const le = V.concat(h ? [] : T);
2259
+ p && le.length && p(le);
2260
2260
  };
2261
- B(() => {
2262
- const j = M.current;
2263
- j && (j.style.height = "auto", j.style.height = `${Math.min(j.scrollHeight, 200)}px`);
2264
- }, [s]), B(() => {
2265
- const j = (T) => {
2266
- var G, J, ee;
2261
+ M(() => {
2262
+ const _ = q.current;
2263
+ _ && (_.style.height = "auto", _.style.height = `${Math.min(_.scrollHeight, 200)}px`);
2264
+ }, [s]), M(() => {
2265
+ const _ = (T) => {
2266
+ var J, Z, ee;
2267
2267
  if (n || o) return;
2268
- const V = (G = T.target) == null ? void 0 : G.tagName;
2269
- V === "INPUT" || V === "TEXTAREA" || V === "SELECT" || (J = T.target) != null && J.isContentEditable || T.ctrlKey || T.metaKey || T.altKey || T.key.length !== 1 && T.key !== "Backspace" && T.key !== "Delete" || (ee = M.current) == null || ee.focus();
2268
+ const V = (J = T.target) == null ? void 0 : J.tagName;
2269
+ V === "INPUT" || V === "TEXTAREA" || V === "SELECT" || (Z = T.target) != null && Z.isContentEditable || T.ctrlKey || T.metaKey || T.altKey || T.key.length !== 1 && T.key !== "Backspace" && T.key !== "Delete" || (ee = q.current) == null || ee.focus();
2270
2270
  };
2271
- return document.addEventListener("keydown", j), () => document.removeEventListener("keydown", j);
2271
+ return document.addEventListener("keydown", _), () => document.removeEventListener("keydown", _);
2272
2272
  }, [n, o]);
2273
- const N = (j) => {
2274
- j.preventDefault(), z.current++, j.dataTransfer.types.includes("Files") && H(!0);
2275
- }, P = (j) => {
2276
- j.preventDefault(), z.current--, z.current === 0 && H(!1);
2277
- }, F = (j) => j.preventDefault(), te = (j) => {
2278
- j.preventDefault(), z.current = 0, H(!1);
2279
- const T = Array.from(j.dataTransfer.files);
2273
+ const w = (_) => {
2274
+ _.preventDefault(), P.current++, _.dataTransfer.types.includes("Files") && C(!0);
2275
+ }, z = (_) => {
2276
+ _.preventDefault(), P.current--, P.current === 0 && C(!1);
2277
+ }, F = (_) => _.preventDefault(), te = (_) => {
2278
+ _.preventDefault(), P.current = 0, C(!1);
2279
+ const T = Array.from(_.dataTransfer.files);
2280
2280
  T.length && c(T);
2281
- }, ae = (j) => {
2282
- const T = Array.from(j.target.files || []);
2283
- v.current && (v.current.value = ""), T.length && c(T);
2284
- }, W = (j) => {
2281
+ }, ie = (_) => {
2282
+ const T = Array.from(_.target.files || []);
2283
+ Y.current && (Y.current.value = ""), T.length && c(T);
2284
+ }, W = (_) => {
2285
2285
  var se;
2286
2286
  if (!h) return;
2287
- const T = (se = j.clipboardData) == null ? void 0 : se.items;
2287
+ const T = (se = _.clipboardData) == null ? void 0 : se.items;
2288
2288
  if (!T) return;
2289
2289
  const V = [];
2290
2290
  for (const Ue of T) {
2291
- const $e = Ue.getAsFile();
2292
- $e && V.push($e);
2291
+ const Te = Ue.getAsFile();
2292
+ Te && V.push(Te);
2293
2293
  }
2294
2294
  if (V.length === 0) return;
2295
- const { imageFiles: G, tooLarge: J, skipped: ee, limitExceeded: oe } = w(V);
2296
- J.length && _(`File${J.length > 1 ? "s" : ""} too large: ${J.join(", ")}`), ee.length && _(`Skipped unsupported file${ee.length > 1 ? "s" : ""}: ${ee.join(", ")}`), oe && _(`Max ${E} images per message`), G.length && (j.preventDefault(), h(G));
2297
- }, Q = !n && !o && !!(p != null && p.length) && s.length === 0, ie = Ss({
2298
- prompts: p ?? [],
2295
+ const { imageFiles: J, tooLarge: Z, skipped: ee, limitExceeded: le } = g(V);
2296
+ Z.length && x(`File${Z.length > 1 ? "s" : ""} too large: ${Z.join(", ")}`), ee.length && x(`Skipped unsupported file${ee.length > 1 ? "s" : ""}: ${ee.join(", ")}`), le && x(`Max ${R} images per message`), J.length && (_.preventDefault(), h(J));
2297
+ }, Q = !n && !o && !!(m != null && m.length) && s.length === 0, oe = Ds({
2298
+ prompts: m ?? [],
2299
2299
  enabled: Q
2300
- }), _e = (j) => {
2300
+ }), be = (_) => {
2301
2301
  if (Q) {
2302
- if (j.key === "ArrowDown" || j.key === "ArrowRight") {
2303
- j.preventDefault(), ie.next();
2302
+ if (_.key === "ArrowDown" || _.key === "ArrowRight") {
2303
+ _.preventDefault(), oe.next();
2304
2304
  return;
2305
2305
  }
2306
- if (j.key === "ArrowUp" || j.key === "ArrowLeft") {
2307
- j.preventDefault(), ie.prev();
2306
+ if (_.key === "ArrowUp" || _.key === "ArrowLeft") {
2307
+ _.preventDefault(), oe.prev();
2308
2308
  return;
2309
2309
  }
2310
- if (j.key === "Tab" && !j.shiftKey) {
2311
- j.preventDefault(), t == null || t(ie.currentPrompt);
2310
+ if (_.key === "Tab" && !_.shiftKey) {
2311
+ _.preventDefault(), t == null || t(oe.currentPrompt);
2312
2312
  return;
2313
2313
  }
2314
2314
  }
2315
- a == null || a(j);
2316
- }, Ce = (s.trim() || (f == null ? void 0 : f.length) > 0 || (u == null ? void 0 : u.length) > 0) && !o, Ee = m || h;
2317
- return /* @__PURE__ */ e.jsxs("div", { className: ["ds-prompt-input", O].filter(Boolean).join(" "), ...D, children: [
2318
- Ee && /* @__PURE__ */ e.jsx(
2315
+ a == null || a(_);
2316
+ }, Ce = (s.trim() || (f == null ? void 0 : f.length) > 0 || (d == null ? void 0 : d.length) > 0) && !o, $e = p || h;
2317
+ return /* @__PURE__ */ e.jsxs("div", { className: ["ds-prompt-input", O].filter(Boolean).join(" "), ...I, children: [
2318
+ $e && /* @__PURE__ */ e.jsx(
2319
2319
  "input",
2320
2320
  {
2321
- ref: v,
2321
+ ref: Y,
2322
2322
  type: "file",
2323
2323
  multiple: !0,
2324
2324
  accept: "*/*",
2325
2325
  className: "ds-prompt-input__file-input",
2326
- onChange: ae
2326
+ onChange: ie
2327
2327
  }
2328
2328
  ),
2329
2329
  /* @__PURE__ */ e.jsxs(
2330
2330
  "div",
2331
2331
  {
2332
- className: ["ds-prompt-input__box", Y && "ds-prompt-input__box--dragging"].filter(Boolean).join(" "),
2333
- onDragEnter: N,
2334
- onDragLeave: P,
2332
+ className: ["ds-prompt-input__box", N && "ds-prompt-input__box--dragging"].filter(Boolean).join(" "),
2333
+ onDragEnter: w,
2334
+ onDragLeave: z,
2335
2335
  onDragOver: F,
2336
2336
  onDrop: te,
2337
2337
  children: [
2338
- Y && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__drag-overlay", children: "Drop files here" }),
2338
+ N && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__drag-overlay", children: "Drop files here" }),
2339
2339
  /* @__PURE__ */ e.jsx(
2340
2340
  "textarea",
2341
2341
  {
2342
- ref: M,
2342
+ ref: q,
2343
2343
  value: s,
2344
- onChange: (j) => t == null ? void 0 : t(j.target.value),
2345
- onKeyDown: _e,
2344
+ onChange: (_) => t == null ? void 0 : t(_.target.value),
2345
+ onKeyDown: be,
2346
2346
  onPaste: W,
2347
2347
  placeholder: Q ? "" : l,
2348
2348
  disabled: n || o,
@@ -2351,80 +2351,80 @@ function It({
2351
2351
  }
2352
2352
  ),
2353
2353
  Q && /* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__anim", "aria-hidden": "true", children: [
2354
- /* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__anim-text", children: ie.displayed }),
2354
+ /* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__anim-text", children: oe.displayed }),
2355
2355
  /* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__anim-cursor" })
2356
2356
  ] }),
2357
- f && f.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__images", children: f.map((j, T) => /* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__image-thumb", children: [
2358
- /* @__PURE__ */ e.jsx("img", { src: j.preview, alt: "" }),
2357
+ f && f.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__images", children: f.map((_, T) => /* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__image-thumb", children: [
2358
+ /* @__PURE__ */ e.jsx("img", { src: _.preview, alt: "" }),
2359
2359
  /* @__PURE__ */ e.jsx(
2360
2360
  "button",
2361
2361
  {
2362
2362
  className: "ds-prompt-input__image-remove",
2363
- onClick: () => x == null ? void 0 : x(T),
2363
+ onClick: () => b == null ? void 0 : b(T),
2364
2364
  "aria-label": "Remove image",
2365
2365
  type: "button",
2366
2366
  children: /* @__PURE__ */ e.jsx(ne, { size: 12, strokeWidth: 2 })
2367
2367
  }
2368
2368
  )
2369
2369
  ] }, T)) }),
2370
- X.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__warnings", children: X.map((j) => /* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__warning", role: "alert", children: [
2371
- /* @__PURE__ */ e.jsx("span", { children: j.msg }),
2370
+ G.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__warnings", children: G.map((_) => /* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__warning", role: "alert", children: [
2371
+ /* @__PURE__ */ e.jsx("span", { children: _.msg }),
2372
2372
  /* @__PURE__ */ e.jsx(
2373
2373
  "button",
2374
2374
  {
2375
2375
  type: "button",
2376
2376
  className: "ds-prompt-input__warning-close",
2377
- onClick: () => y(j.id),
2377
+ onClick: () => v(_.id),
2378
2378
  "aria-label": "Dismiss",
2379
- children: /* @__PURE__ */ e.jsx(ne, { size: I[1], strokeWidth: 1.5 })
2379
+ children: /* @__PURE__ */ e.jsx(ne, { size: D[1], strokeWidth: 1.5 })
2380
2380
  }
2381
2381
  )
2382
- ] }, j.id)) }),
2383
- u && u.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__attachments", children: u.map((j, T) => /* @__PURE__ */ e.jsx(pe, { size: "xs", children: /* @__PURE__ */ e.jsxs("span", { className: "ds-prompt-input__badge-content", children: [
2384
- j.uploading ? /* @__PURE__ */ e.jsx(Qe, { size: I[1], strokeWidth: 1.5, className: "spin" }) : /* @__PURE__ */ e.jsx(Te, { size: I[1], strokeWidth: 1.5 }),
2385
- j.filename,
2386
- j.uploading ? /* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__uploading", children: "Uploading..." }) : /* @__PURE__ */ e.jsx(
2382
+ ] }, _.id)) }),
2383
+ d && d.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__attachments", children: d.map((_, T) => /* @__PURE__ */ e.jsx(ae, { size: "xs", children: /* @__PURE__ */ e.jsxs("span", { className: "ds-prompt-input__badge-content", children: [
2384
+ _.uploading ? /* @__PURE__ */ e.jsx(Qe, { size: D[1], strokeWidth: 1.5, className: "spin" }) : /* @__PURE__ */ e.jsx(Re, { size: D[1], strokeWidth: 1.5 }),
2385
+ _.filename,
2386
+ _.uploading ? /* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__uploading", children: "Uploading..." }) : /* @__PURE__ */ e.jsx(
2387
2387
  "button",
2388
2388
  {
2389
2389
  type: "button",
2390
2390
  className: "ds-prompt-input__remove-btn",
2391
- onClick: () => d == null ? void 0 : d(T),
2392
- children: /* @__PURE__ */ e.jsx(ne, { size: I[1], strokeWidth: 1.5 })
2391
+ onClick: () => u == null ? void 0 : u(T),
2392
+ children: /* @__PURE__ */ e.jsx(ne, { size: D[1], strokeWidth: 1.5 })
2393
2393
  }
2394
2394
  )
2395
2395
  ] }) }, T)) }),
2396
2396
  /* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__toolbar", children: [
2397
- Ee && /* @__PURE__ */ e.jsx(
2398
- fe,
2397
+ $e && /* @__PURE__ */ e.jsx(
2398
+ me,
2399
2399
  {
2400
2400
  variant: "ghost",
2401
2401
  size: "xs",
2402
- icon: /* @__PURE__ */ e.jsx(Te, { size: I[2], strokeWidth: 1.5 }),
2402
+ icon: /* @__PURE__ */ e.jsx(Re, { size: D[2], strokeWidth: 1.5 }),
2403
2403
  "aria-label": "Attach files",
2404
2404
  onClick: () => {
2405
- var j;
2406
- return (j = v.current) == null ? void 0 : j.click();
2405
+ var _;
2406
+ return (_ = Y.current) == null ? void 0 : _.click();
2407
2407
  }
2408
2408
  }
2409
2409
  ),
2410
- A,
2411
- k,
2410
+ y,
2411
+ $,
2412
2412
  /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__spacer" }),
2413
2413
  n ? /* @__PURE__ */ e.jsx(
2414
- fe,
2414
+ me,
2415
2415
  {
2416
2416
  variant: "primary",
2417
2417
  size: "xs",
2418
- icon: /* @__PURE__ */ e.jsx(es, { size: I[2], strokeWidth: 1.5 }),
2418
+ icon: /* @__PURE__ */ e.jsx(es, { size: D[2], strokeWidth: 1.5 }),
2419
2419
  onClick: i,
2420
2420
  "aria-label": "Stop"
2421
2421
  }
2422
2422
  ) : /* @__PURE__ */ e.jsx(
2423
- fe,
2423
+ me,
2424
2424
  {
2425
2425
  variant: "primary",
2426
2426
  size: "xs",
2427
- icon: /* @__PURE__ */ e.jsx(ss, { size: I[2], strokeWidth: 1.5 }),
2427
+ icon: /* @__PURE__ */ e.jsx(ss, { size: D[2], strokeWidth: 1.5 }),
2428
2428
  onClick: r,
2429
2429
  disabled: !Ce,
2430
2430
  "aria-label": "Send"
@@ -2436,8 +2436,8 @@ function It({
2436
2436
  )
2437
2437
  ] });
2438
2438
  }
2439
- const Pe = { fast: 0, standard: 1, premium: 2 };
2440
- function Dt({
2439
+ const Pe = { fast: 0, standard: 1, premium: 2 }, Le = { fast: "data-5", standard: "data-3", premium: "data-6" };
2440
+ function Ot({
2441
2441
  models: s = [],
2442
2442
  value: t,
2443
2443
  onChange: r,
@@ -2446,54 +2446,59 @@ function Dt({
2446
2446
  showAutoOption: n = !1,
2447
2447
  groupByTier: o = !0,
2448
2448
  className: l = "",
2449
- ...p
2449
+ ...m
2450
2450
  }) {
2451
- const [u, f] = S(!1), m = $(null), h = $(null), [d, x] = S({}), b = s.filter((v) => !a || v.name === "auto" ? !0 : (Pe[v.tier] ?? 1) >= (Pe[a] ?? 1)), R = b.find((v) => v.name === "auto"), E = b.filter((v) => v.name !== "auto"), g = s.find((v) => v.name === t);
2452
- B(() => {
2453
- var Y;
2454
- if (!u) return;
2455
- const v = (Y = m.current) == null ? void 0 : Y.getBoundingClientRect();
2456
- v && x({
2457
- position: "fixed",
2458
- zIndex: "var(--z-dropdown, 500)",
2459
- top: v.bottom + 4,
2460
- right: window.innerWidth - v.right
2461
- });
2462
- const M = (H) => {
2463
- var X, U;
2464
- !((X = m.current) != null && X.contains(H.target)) && !((U = h.current) != null && U.contains(H.target)) && f(!1);
2465
- }, z = (H) => {
2466
- H.key === "Escape" && f(!1);
2451
+ const [d, f] = A(!1), p = E(null), h = E(null), u = E(null), [b, j] = A({}), S = s.filter((N) => !a || N.name === "auto" ? !0 : (Pe[N.tier] ?? 1) >= (Pe[a] ?? 1)), R = S.find((N) => N.name === "auto"), B = S.filter((N) => N.name !== "auto"), y = s.find((N) => N.name === t), O = new Set(B.map((N) => N.tier).filter(Boolean)).size > 1;
2452
+ M(() => {
2453
+ if (!d) return;
2454
+ const N = 320, C = () => {
2455
+ var L;
2456
+ const x = (L = h.current) == null ? void 0 : L.getBoundingClientRect();
2457
+ if (!x) return;
2458
+ const v = window.innerHeight - x.bottom, k = v < N + 8 && x.top > v;
2459
+ j({
2460
+ position: "fixed",
2461
+ zIndex: "var(--z-dropdown, 500)",
2462
+ right: window.innerWidth - x.right,
2463
+ ...k ? { bottom: window.innerHeight - x.top + 4, top: "auto" } : { top: x.bottom + 4, bottom: "auto" }
2464
+ });
2467
2465
  };
2468
- return document.addEventListener("mousedown", M), document.addEventListener("keydown", z), () => {
2469
- document.removeEventListener("mousedown", M), document.removeEventListener("keydown", z);
2466
+ C(), window.addEventListener("scroll", C, !0), window.addEventListener("resize", C);
2467
+ const G = (x) => {
2468
+ var v, k;
2469
+ !((v = p.current) != null && v.contains(x.target)) && !((k = u.current) != null && k.contains(x.target)) && f(!1);
2470
+ }, U = (x) => {
2471
+ x.key === "Escape" && f(!1);
2470
2472
  };
2471
- }, [u]);
2472
- const A = (v) => {
2473
- r == null || r(v), f(!1);
2474
- }, k = (v) => /* @__PURE__ */ e.jsxs(
2473
+ return document.addEventListener("mousedown", G), document.addEventListener("keydown", U), () => {
2474
+ window.removeEventListener("scroll", C, !0), window.removeEventListener("resize", C), document.removeEventListener("mousedown", G), document.removeEventListener("keydown", U);
2475
+ };
2476
+ }, [d]);
2477
+ const I = (N) => {
2478
+ r == null || r(N), f(!1);
2479
+ }, Y = (N) => /* @__PURE__ */ e.jsxs(
2475
2480
  "button",
2476
2481
  {
2477
2482
  type: "button",
2478
2483
  className: [
2479
2484
  "ds-model-picker__item",
2480
- v.name === t && "ds-model-picker__item--active"
2485
+ N.name === t && "ds-model-picker__item--active"
2481
2486
  ].filter(Boolean).join(" "),
2482
- onClick: () => A(v.name),
2487
+ onClick: () => I(N.name),
2483
2488
  children: [
2484
- v.icon ? /* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-icon", children: v.icon }) : /* @__PURE__ */ e.jsx(Re, { size: 12, strokeWidth: 1.5, className: "ds-model-picker__item-icon" }),
2485
- /* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-name", children: v.displayName || v.name }),
2486
- v.tier && /* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__tier-badge", "data-tier": v.tier, children: v.tier })
2489
+ N.icon ? /* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-icon", children: N.icon }) : /* @__PURE__ */ e.jsx(Se, { size: 12, strokeWidth: 1.5, className: "ds-model-picker__item-icon" }),
2490
+ /* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-name", children: N.displayName || N.name }),
2491
+ O && N.tier && /* @__PURE__ */ e.jsx(ae, { size: "xs", variant: Le[N.tier] || "default", children: N.tier })
2487
2492
  ]
2488
2493
  },
2489
- v.name
2490
- ), O = () => o ? ["fast", "standard", "premium"].flatMap((v) => {
2491
- const M = E.filter((z) => z.tier === v);
2492
- return M.length ? [
2493
- /* @__PURE__ */ e.jsx("div", { className: "ds-model-picker__group-label", "data-tier": v, children: v.charAt(0).toUpperCase() + v.slice(1) }, `lbl-${v}`),
2494
- ...M.map(k)
2494
+ N.name
2495
+ ), q = () => !o || !O ? B.map(Y) : ["fast", "standard", "premium"].flatMap((N) => {
2496
+ const C = B.filter((G) => G.tier === N);
2497
+ return C.length ? [
2498
+ /* @__PURE__ */ e.jsx("div", { className: "ds-model-picker__group-label", "data-tier": N, children: N.charAt(0).toUpperCase() + N.slice(1) }, `lbl-${N}`),
2499
+ ...C.map(Y)
2495
2500
  ] : [];
2496
- }) : E.map(k), D = u && /* @__PURE__ */ e.jsxs("div", { ref: h, className: "ds-model-picker__menu", style: d, children: [
2501
+ }), P = d && /* @__PURE__ */ e.jsxs("div", { ref: u, className: "ds-model-picker__menu", style: b, children: [
2497
2502
  n && R && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2498
2503
  /* @__PURE__ */ e.jsxs(
2499
2504
  "button",
@@ -2504,130 +2509,132 @@ function Dt({
2504
2509
  "ds-model-picker__item--auto",
2505
2510
  t === "auto" && "ds-model-picker__item--active"
2506
2511
  ].filter(Boolean).join(" "),
2507
- onClick: () => A("auto"),
2512
+ onClick: () => I("auto"),
2508
2513
  children: [
2509
2514
  /* @__PURE__ */ e.jsx(ts, { size: 12, strokeWidth: 1.5, className: "ds-model-picker__item-icon" }),
2510
2515
  /* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-name", children: "Auto (smart routing)" })
2511
2516
  ]
2512
2517
  }
2513
2518
  ),
2514
- E.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-model-picker__separator" })
2519
+ B.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-model-picker__separator" })
2515
2520
  ] }),
2516
- O()
2521
+ q()
2517
2522
  ] });
2518
2523
  return /* @__PURE__ */ e.jsxs(
2519
2524
  "div",
2520
2525
  {
2521
- ref: m,
2526
+ ref: p,
2522
2527
  className: ["ds-model-picker", l].filter(Boolean).join(" "),
2523
- ...p,
2528
+ ...m,
2524
2529
  children: [
2525
2530
  /* @__PURE__ */ e.jsxs(
2526
2531
  "button",
2527
2532
  {
2533
+ ref: h,
2528
2534
  type: "button",
2529
2535
  className: "ds-model-picker__trigger",
2530
- onClick: () => f((v) => !v),
2536
+ onClick: () => f((N) => !N),
2531
2537
  "aria-haspopup": "listbox",
2532
- "aria-expanded": u,
2538
+ "aria-expanded": d,
2533
2539
  children: [
2534
- g != null && g.icon ? /* @__PURE__ */ e.jsx("span", { children: g.icon }) : /* @__PURE__ */ e.jsx(Re, { size: 12, strokeWidth: 1.5 }),
2535
- /* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__trigger-name", children: (g == null ? void 0 : g.displayName) || (g == null ? void 0 : g.name) || t }),
2536
- (g == null ? void 0 : g.tier) && /* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__tier-badge", "data-tier": g.tier, children: g.tier })
2540
+ y != null && y.icon ? /* @__PURE__ */ e.jsx("span", { children: y.icon }) : /* @__PURE__ */ e.jsx(Se, { size: 12, strokeWidth: 1.5 }),
2541
+ /* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__trigger-name", children: (y == null ? void 0 : y.displayName) || (y == null ? void 0 : y.name) || t }),
2542
+ O && (y == null ? void 0 : y.tier) && /* @__PURE__ */ e.jsx(ae, { size: "xs", variant: Le[y.tier] || "default", children: y.tier })
2537
2543
  ]
2538
2544
  }
2539
2545
  ),
2540
- typeof document < "u" && me.createPortal(D, document.body)
2546
+ typeof document < "u" && pe.createPortal(P, document.body)
2541
2547
  ]
2542
2548
  }
2543
2549
  );
2544
2550
  }
2545
- function je(s) {
2551
+ const Bs = ({ filename: s, pages: t }) => /* @__PURE__ */ e.jsxs("span", { style: { display: "flex", alignItems: "center", gap: "var(--space-2)", minWidth: 0 }, children: [
2552
+ /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children: s }),
2553
+ t.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children: Ne(t) })
2554
+ ] });
2555
+ function Ne(s) {
2546
2556
  return s != null && s.length ? "p. " + s.join(", ") : null;
2547
2557
  }
2548
- function Is(s) {
2558
+ function Ms(s) {
2549
2559
  const t = /* @__PURE__ */ new Map();
2550
2560
  for (const r of s)
2551
2561
  t.has(r.filename) || t.set(r.filename, { filename: r.filename, url: r.url, items: [] }), t.get(r.filename).items.push(r);
2552
2562
  return [...t.values()];
2553
2563
  }
2554
- function Bt({
2564
+ function Ft({
2555
2565
  sources: s = [],
2556
2566
  layout: t = "list",
2557
2567
  title: r = "Sources",
2558
2568
  maxVisible: i = 5,
2559
2569
  onSourceClick: a
2560
2570
  }) {
2561
- const [n, o] = S(!1), l = Is(s), p = l.length > i, u = n ? l : l.slice(0, i), f = s.some((h) => h.snippet), m = ["ds-sources-panel", t === "compact" && "ds-sources-panel--compact"].filter(Boolean).join(" ");
2562
- return t === "compact" ? /* @__PURE__ */ e.jsxs("div", { className: m, children: [
2563
- u.map((h) => {
2564
- const d = h.items.map((b) => b.page).filter(Boolean), x = !!a;
2571
+ const [n, o] = A(!1), l = Ms(s), m = l.length > i, d = n ? l : l.slice(0, i), f = s.some((h) => h.snippet), p = ["ds-sources-panel", t === "compact" && "ds-sources-panel--compact"].filter(Boolean).join(" ");
2572
+ return t === "compact" ? /* @__PURE__ */ e.jsxs("div", { className: p, children: [
2573
+ d.map((h) => {
2574
+ const u = h.items.map((j) => j.page).filter(Boolean), b = !!a;
2565
2575
  return /* @__PURE__ */ e.jsxs(
2566
2576
  "div",
2567
2577
  {
2568
- className: `ds-sources-panel__compact-row${x ? " ds-sources-panel__compact-row--clickable" : ""}`,
2569
- onClick: x ? () => a(h.items[0]) : void 0,
2578
+ className: `ds-sources-panel__compact-row${b ? " ds-sources-panel__compact-row--clickable" : ""}`,
2579
+ onClick: b ? () => a(h.items[0]) : void 0,
2570
2580
  children: [
2571
- /* @__PURE__ */ e.jsx(rs, { size: I[1], strokeWidth: 1.5, className: "ds-sources-panel__compact-icon" }),
2581
+ /* @__PURE__ */ e.jsx(rs, { size: D[1], strokeWidth: 1.5, className: "ds-sources-panel__compact-icon" }),
2572
2582
  /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children: h.filename }),
2573
- d.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children: je(d) })
2583
+ u.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children: Ne(u) })
2574
2584
  ]
2575
2585
  },
2576
2586
  h.filename
2577
2587
  );
2578
2588
  }),
2579
- p && !n && /* @__PURE__ */ e.jsxs("button", { className: "ds-sources-panel__more", onClick: () => o(!0), children: [
2589
+ m && !n && /* @__PURE__ */ e.jsxs("button", { className: "ds-sources-panel__more", onClick: () => o(!0), children: [
2580
2590
  "+",
2581
2591
  l.length - i,
2582
2592
  " more sources"
2583
2593
  ] })
2584
- ] }) : /* @__PURE__ */ e.jsxs("div", { className: m, children: [
2594
+ ] }) : /* @__PURE__ */ e.jsxs("div", { className: p, children: [
2585
2595
  r && /* @__PURE__ */ e.jsx("div", { className: "ds-sources-panel__title", children: r }),
2586
- u.map((h) => {
2587
- const d = h.items.map((b) => b.page).filter(Boolean), x = !!a;
2596
+ d.map((h) => {
2597
+ const u = h.items.map((j) => j.page).filter(Boolean), b = !!a;
2588
2598
  return f ? /* @__PURE__ */ e.jsx(
2589
- Fe,
2599
+ Ee,
2590
2600
  {
2591
- title: /* @__PURE__ */ e.jsxs("span", { style: { display: "flex", alignItems: "center", gap: "var(--space-2)", minWidth: 0 }, children: [
2592
- /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children: h.filename }),
2593
- d.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children: je(d) })
2594
- ] }),
2601
+ title: /* @__PURE__ */ e.jsx(Bs, { filename: h.filename, pages: u }),
2595
2602
  padding: "s",
2596
- children: h.items.map((b, R) => /* @__PURE__ */ e.jsx(
2603
+ children: h.items.map((j, S) => /* @__PURE__ */ e.jsx(
2597
2604
  "div",
2598
2605
  {
2599
- className: `ds-sources-panel__snippet${x ? " ds-sources-panel__snippet--clickable" : ""}`,
2600
- onClick: x ? () => a(b) : void 0,
2601
- children: b.snippet ?? `p. ${b.page}`
2606
+ className: `ds-sources-panel__snippet${b ? " ds-sources-panel__snippet--clickable" : ""}`,
2607
+ onClick: b ? () => a(j) : void 0,
2608
+ children: j.snippet ?? `p. ${j.page}`
2602
2609
  },
2603
- R
2610
+ S
2604
2611
  ))
2605
2612
  },
2606
2613
  h.filename
2607
2614
  ) : /* @__PURE__ */ e.jsxs(
2608
2615
  "div",
2609
2616
  {
2610
- className: `ds-sources-panel__row${x ? " ds-sources-panel__row--clickable" : ""}`,
2611
- onClick: x ? () => a(h.items[0]) : void 0,
2617
+ className: `ds-sources-panel__row${b ? " ds-sources-panel__row--clickable" : ""}`,
2618
+ onClick: b ? () => a(h.items[0]) : void 0,
2612
2619
  children: [
2613
2620
  /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children: h.filename }),
2614
- d.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children: je(d) })
2621
+ u.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children: Ne(u) })
2615
2622
  ]
2616
2623
  },
2617
2624
  h.filename
2618
2625
  );
2619
2626
  }),
2620
- p && !n && /* @__PURE__ */ e.jsxs("button", { className: "ds-sources-panel__more", onClick: () => o(!0), children: [
2627
+ m && !n && /* @__PURE__ */ e.jsxs("button", { className: "ds-sources-panel__more", onClick: () => o(!0), children: [
2621
2628
  "+",
2622
2629
  l.length - i,
2623
2630
  " more sources"
2624
2631
  ] })
2625
2632
  ] });
2626
2633
  }
2627
- function Me(s) {
2634
+ function ze(s) {
2628
2635
  return s >= 1e6 ? (s / 1e6).toFixed(1).replace(/\.0$/, "") + "M" : s >= 1e3 ? (s / 1e3).toFixed(1).replace(/\.0$/, "") + "K" : String(s);
2629
2636
  }
2630
- function Pt({
2637
+ function Wt({
2631
2638
  used: s,
2632
2639
  limit: t,
2633
2640
  size: r = "s",
@@ -2636,7 +2643,7 @@ function Pt({
2636
2643
  warningThreshold: n = 0.8,
2637
2644
  errorThreshold: o = 1
2638
2645
  }) {
2639
- const l = t > 0 ? s / t : 0, p = Math.min(l * 100, 100), u = l >= o ? "error" : l >= n ? "warning" : "normal";
2646
+ const l = t > 0 ? s / t : 0, m = Math.min(l * 100, 100), d = l >= o ? "error" : l >= n ? "warning" : "normal";
2640
2647
  return /* @__PURE__ */ e.jsxs(
2641
2648
  "div",
2642
2649
  {
@@ -2648,15 +2655,15 @@ function Pt({
2648
2655
  /* @__PURE__ */ e.jsx("div", { className: "ds-token-counter__track", children: /* @__PURE__ */ e.jsx(
2649
2656
  "div",
2650
2657
  {
2651
- className: `ds-token-counter__fill ds-token-counter__fill--${u}`,
2652
- style: { width: `${p}%` }
2658
+ className: `ds-token-counter__fill ds-token-counter__fill--${d}`,
2659
+ style: { width: `${m}%` }
2653
2660
  }
2654
2661
  ) }),
2655
- (i || a) && /* @__PURE__ */ e.jsxs("div", { className: `ds-token-counter__label ds-token-counter__label--${u}`, children: [
2662
+ (i || a) && /* @__PURE__ */ e.jsxs("div", { className: `ds-token-counter__label ds-token-counter__label--${d}`, children: [
2656
2663
  i && /* @__PURE__ */ e.jsxs("span", { children: [
2657
- Me(s),
2664
+ ze(s),
2658
2665
  " / ",
2659
- Me(t),
2666
+ ze(t),
2660
2667
  " tokens"
2661
2668
  ] }),
2662
2669
  a && /* @__PURE__ */ e.jsxs("span", { children: [
@@ -2668,42 +2675,42 @@ function Pt({
2668
2675
  }
2669
2676
  );
2670
2677
  }
2671
- const Le = 5;
2672
- function Ds(s) {
2678
+ const Oe = 5;
2679
+ function Ps(s) {
2673
2680
  return s < 0.34 ? "low" : s < 0.67 ? "medium" : "high";
2674
2681
  }
2675
- function Mt({
2682
+ function Ct({
2676
2683
  value: s = 0,
2677
2684
  size: t = "xs",
2678
2685
  showLabel: r = "none",
2679
2686
  layout: i = "inline"
2680
2687
  }) {
2681
- const a = Math.max(0, Math.min(1, s)), n = Math.round(a * Le), o = Ds(a);
2688
+ const a = Math.max(0, Math.min(1, s)), n = Math.round(a * Oe), o = Ps(a);
2682
2689
  return /* @__PURE__ */ e.jsxs("div", { className: [
2683
2690
  "ds-confidence-bar",
2684
2691
  `ds-confidence-bar--${t}`,
2685
2692
  `ds-confidence-bar--${o}`,
2686
2693
  i === "block" && "ds-confidence-bar--block"
2687
2694
  ].filter(Boolean).join(" "), children: [
2688
- /* @__PURE__ */ e.jsx("div", { className: "ds-confidence-bar__segments", "aria-hidden": "true", children: Array.from({ length: Le }, (l, p) => /* @__PURE__ */ e.jsx(
2695
+ /* @__PURE__ */ e.jsx("div", { className: "ds-confidence-bar__segments", "aria-hidden": "true", children: Array.from({ length: Oe }, (l, m) => /* @__PURE__ */ e.jsx(
2689
2696
  "div",
2690
2697
  {
2691
- className: `ds-confidence-bar__seg${p < n ? " ds-confidence-bar__seg--filled" : ""}`
2698
+ className: `ds-confidence-bar__seg${m < n ? " ds-confidence-bar__seg--filled" : ""}`
2692
2699
  },
2693
- p
2700
+ m
2694
2701
  )) }),
2695
2702
  r === "text" && /* @__PURE__ */ e.jsx("span", { className: "ds-confidence-bar__label", children: o })
2696
2703
  ] });
2697
2704
  }
2698
- const Bs = { add: "+", remove: "-", context: " " };
2699
- function be({ line: s, lineNumbers: t }) {
2705
+ const Ls = { add: "+", remove: "-", context: " " };
2706
+ function _e({ line: s, lineNumbers: t }) {
2700
2707
  return /* @__PURE__ */ e.jsxs("div", { className: `ds-diff-view__line ds-diff-view__line--${s.type}`, children: [
2701
2708
  t && s.lineNo != null && /* @__PURE__ */ e.jsx("span", { className: "ds-diff-view__lineno", children: s.lineNo }),
2702
- /* @__PURE__ */ e.jsx("span", { className: "ds-diff-view__prefix", children: Bs[s.type] }),
2709
+ /* @__PURE__ */ e.jsx("span", { className: "ds-diff-view__prefix", children: Ls[s.type] }),
2703
2710
  /* @__PURE__ */ e.jsx("span", { className: "ds-diff-view__text", children: s.text })
2704
2711
  ] });
2705
2712
  }
2706
- function Lt({
2713
+ function Ut({
2707
2714
  lines: s = [],
2708
2715
  layout: t = "inline",
2709
2716
  wordWrap: r = !1,
@@ -2717,88 +2724,216 @@ function Lt({
2717
2724
  r && "ds-diff-view--wrap"
2718
2725
  ].filter(Boolean).join(" "), l = a ? { maxHeight: a, overflowY: "auto" } : void 0;
2719
2726
  if (t === "split") {
2720
- const p = s.filter((f) => f.type === "remove" || f.type === "context"), u = s.filter((f) => f.type === "add" || f.type === "context");
2727
+ const m = s.filter((f) => f.type === "remove" || f.type === "context"), d = s.filter((f) => f.type === "add" || f.type === "context");
2721
2728
  return /* @__PURE__ */ e.jsxs("div", { className: o, children: [
2722
2729
  n && /* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__title", children: n }),
2723
2730
  /* @__PURE__ */ e.jsxs("div", { className: "ds-diff-view__body", style: l, children: [
2724
- /* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col", children: p.map((f, m) => /* @__PURE__ */ e.jsx(be, { line: f, lineNumbers: i }, m)) }),
2725
- /* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col", children: u.map((f, m) => /* @__PURE__ */ e.jsx(be, { line: f, lineNumbers: i }, m)) })
2731
+ /* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col", children: m.map((f, p) => /* @__PURE__ */ e.jsx(_e, { line: f, lineNumbers: i }, p)) }),
2732
+ /* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col", children: d.map((f, p) => /* @__PURE__ */ e.jsx(_e, { line: f, lineNumbers: i }, p)) })
2726
2733
  ] })
2727
2734
  ] });
2728
2735
  }
2729
2736
  return /* @__PURE__ */ e.jsxs("div", { className: o, children: [
2730
2737
  n && /* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__title", children: n }),
2731
- /* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__body", style: l, children: s.map((p, u) => /* @__PURE__ */ e.jsx(be, { line: p, lineNumbers: i }, u)) })
2738
+ /* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__body", style: l, children: s.map((m, d) => /* @__PURE__ */ e.jsx(_e, { line: m, lineNumbers: i }, d)) })
2732
2739
  ] });
2733
2740
  }
2741
+ const zs = {
2742
+ running: /* @__PURE__ */ e.jsx(ae, { size: "xs", variant: "info", children: "Running…" }),
2743
+ success: /* @__PURE__ */ e.jsx(ae, { size: "xs", variant: "success", children: "Done" }),
2744
+ error: /* @__PURE__ */ e.jsx(ae, { size: "xs", variant: "error", children: "Error" })
2745
+ };
2746
+ function Vt({
2747
+ label: s,
2748
+ status: t = "idle",
2749
+ icon: r,
2750
+ badge: i,
2751
+ className: a = "",
2752
+ ...n
2753
+ }) {
2754
+ return /* @__PURE__ */ e.jsxs(
2755
+ "div",
2756
+ {
2757
+ className: ["ds-tool-bubble", a].filter(Boolean).join(" "),
2758
+ ...n,
2759
+ children: [
2760
+ r && /* @__PURE__ */ e.jsx("span", { className: "ds-tool-bubble__icon", children: r }),
2761
+ /* @__PURE__ */ e.jsx("span", { className: "ds-tool-bubble__label", children: s }),
2762
+ zs[t],
2763
+ i
2764
+ ]
2765
+ }
2766
+ );
2767
+ }
2768
+ function Os({
2769
+ value: s = "idle",
2770
+ onLike: t,
2771
+ onDislike: r,
2772
+ className: i = "",
2773
+ ...a
2774
+ }) {
2775
+ const n = s !== "idle";
2776
+ return /* @__PURE__ */ e.jsxs(
2777
+ "div",
2778
+ {
2779
+ className: [
2780
+ "ds-message-feedback",
2781
+ n && "ds-message-feedback--voted",
2782
+ i
2783
+ ].filter(Boolean).join(" "),
2784
+ ...a,
2785
+ children: [
2786
+ (!n || s === "liked") && /* @__PURE__ */ e.jsx(
2787
+ "button",
2788
+ {
2789
+ className: [
2790
+ "ds-message-feedback__btn",
2791
+ s === "liked" && "ds-message-feedback__btn--liked"
2792
+ ].filter(Boolean).join(" "),
2793
+ onClick: t,
2794
+ disabled: n,
2795
+ "aria-label": "Like",
2796
+ "aria-pressed": s === "liked",
2797
+ children: /* @__PURE__ */ e.jsx(
2798
+ ns,
2799
+ {
2800
+ size: D[1],
2801
+ strokeWidth: 1.5,
2802
+ fill: s === "liked" ? "currentColor" : "none"
2803
+ }
2804
+ )
2805
+ }
2806
+ ),
2807
+ (!n || s === "disliked") && /* @__PURE__ */ e.jsx(
2808
+ "button",
2809
+ {
2810
+ className: [
2811
+ "ds-message-feedback__btn",
2812
+ s === "disliked" && "ds-message-feedback__btn--disliked"
2813
+ ].filter(Boolean).join(" "),
2814
+ onClick: r,
2815
+ disabled: n,
2816
+ "aria-label": "Dislike",
2817
+ "aria-pressed": s === "disliked",
2818
+ children: /* @__PURE__ */ e.jsx(
2819
+ as,
2820
+ {
2821
+ size: D[1],
2822
+ strokeWidth: 1.5,
2823
+ fill: s === "disliked" ? "currentColor" : "none"
2824
+ }
2825
+ )
2826
+ }
2827
+ )
2828
+ ]
2829
+ }
2830
+ );
2831
+ }
2832
+ function Fs(s) {
2833
+ const t = s instanceof Date ? s : new Date(s);
2834
+ if (isNaN(t)) return null;
2835
+ const r = /* @__PURE__ */ new Date(), i = t.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", hour12: !1 }), a = new Date(r.getFullYear(), r.getMonth(), r.getDate()), n = new Date(a - 864e5);
2836
+ if (t >= a) return i;
2837
+ if (t >= n) return `Yesterday ${i}`;
2838
+ const o = t.getDate(), l = t.toLocaleString([], { month: "short" });
2839
+ return `${o} ${l} ${i}`;
2840
+ }
2841
+ function Yt({
2842
+ role: s = "assistant",
2843
+ text: t,
2844
+ timestamp: r,
2845
+ feedbackValue: i = "idle",
2846
+ onLike: a,
2847
+ onDislike: n,
2848
+ className: o = "",
2849
+ ...l
2850
+ }) {
2851
+ const m = s === "assistant" && (a || n), d = !!t, f = r ? Fs(r) : null;
2852
+ return !m && !d && !f ? null : /* @__PURE__ */ e.jsxs(
2853
+ "div",
2854
+ {
2855
+ className: ["ds-message-footer", `ds-message-footer--${s}`, o].filter(Boolean).join(" "),
2856
+ ...l,
2857
+ children: [
2858
+ s === "user" && f && /* @__PURE__ */ e.jsx("span", { className: "ds-message-footer__timestamp", children: f }),
2859
+ m && /* @__PURE__ */ e.jsx(Os, { value: i, onLike: a, onDislike: n }),
2860
+ d && /* @__PURE__ */ e.jsx(As, { text: t }),
2861
+ s === "assistant" && f && /* @__PURE__ */ e.jsx("span", { className: "ds-message-footer__timestamp", children: f })
2862
+ ]
2863
+ }
2864
+ );
2865
+ }
2734
2866
  export {
2735
- Fe as Accordion,
2736
- Hs as Alert,
2737
- Nt as AnimatedNumber,
2738
- nt as Avatar,
2739
- pe as Badge,
2740
- jt as Banner,
2741
- ht as Breadcrumb,
2742
- fe as Button,
2743
- ls as Card,
2744
- St as ChatMessage,
2745
- tt as Checkbox,
2746
- Gs as Code,
2747
- fs as CodeAccordion,
2748
- Mt as ConfidenceBar,
2749
- Et as CopyButton,
2750
- Lt as DiffView,
2751
- _t as Drawer,
2752
- De as DrawerFooter,
2753
- bt as Dropdown,
2754
- ft as EmptyState,
2755
- mt as FormField,
2756
- Cs as H1,
2757
- Us as H2,
2758
- Vs as H3,
2759
- Ys as H4,
2760
- wt as InView,
2761
- Os as Input,
2762
- Xs as Link,
2763
- Ks as Modal,
2867
+ Ee as Accordion,
2868
+ et as Alert,
2869
+ Tt as AnimatedNumber,
2870
+ ut as Avatar,
2871
+ ae as Badge,
2872
+ kt as Banner,
2873
+ wt as Breadcrumb,
2874
+ me as Button,
2875
+ Ks as Card,
2876
+ Pt as ChatMessage,
2877
+ ct as Checkbox,
2878
+ tt as Code,
2879
+ ms as CodeAccordion,
2880
+ Ct as ConfidenceBar,
2881
+ As as CopyButton,
2882
+ Ut as DiffView,
2883
+ yt as Drawer,
2884
+ Be as DrawerFooter,
2885
+ Et as Dropdown,
2886
+ jt as EmptyState,
2887
+ vt as FormField,
2888
+ Gs as H1,
2889
+ Xs as H2,
2890
+ Js as H3,
2891
+ Zs as H4,
2892
+ Rt as InView,
2893
+ Vs as Input,
2894
+ rt as Link,
2895
+ Os as MessageFeedback,
2896
+ Yt as MessageFooter,
2897
+ st as Modal,
2764
2898
  Ie as ModalFooter,
2765
- Dt as ModelPicker,
2766
- qs as P1,
2767
- cs as P2,
2768
- ze as P3,
2769
- xt as Pagination,
2770
- vt as ProgressBar,
2771
- It as PromptInput,
2772
- rt as Radio,
2773
- $t as ReasoningBlock,
2774
- Qs as SegmentedControl,
2775
- Fs as Select,
2776
- hs as Skeleton,
2777
- Bt as SourcesPanel,
2778
- is as Spinner,
2779
- pt as Stat,
2780
- Tt as StepIndicator,
2781
- Ws as Stepper,
2782
- Rt as StreamingText,
2783
- Zs as Tab,
2784
- at as Table,
2785
- ot as TableBody,
2786
- it as TableHead,
2787
- lt as TableRow,
2788
- ct as TableSubheaderRow,
2789
- Js as Tabs,
2790
- ut as Td,
2791
- zs as Textarea,
2792
- dt as Th,
2793
- gt as ToastContainer,
2794
- st as Toggle,
2795
- Pt as TokenCounter,
2796
- kt as ToolCallCard,
2797
- et as Tooltip,
2798
- I as iconSizes,
2799
- gs as useAnimatedNumber,
2800
- Ss as useAnimatedPlaceholder,
2801
- ks as useInView,
2802
- At as useStreamScroll,
2803
- yt as useToast
2899
+ Ot as ModelPicker,
2900
+ Qs as P1,
2901
+ ds as P2,
2902
+ Fe as P3,
2903
+ gt as Pagination,
2904
+ $t as ProgressBar,
2905
+ zt as PromptInput,
2906
+ dt as Radio,
2907
+ It as ReasoningBlock,
2908
+ it as SegmentedControl,
2909
+ Hs as Select,
2910
+ xs as Skeleton,
2911
+ Ft as SourcesPanel,
2912
+ ls as Spinner,
2913
+ Nt as Stat,
2914
+ Bt as StepIndicator,
2915
+ qs as Stepper,
2916
+ Mt as StreamingText,
2917
+ at as Tab,
2918
+ ft as Table,
2919
+ pt as TableBody,
2920
+ mt as TableHead,
2921
+ ht as TableRow,
2922
+ xt as TableSubheaderRow,
2923
+ nt as Tabs,
2924
+ _t as Td,
2925
+ Ys as Textarea,
2926
+ bt as Th,
2927
+ At as ToastContainer,
2928
+ lt as Toggle,
2929
+ Wt as TokenCounter,
2930
+ Vt as ToolCallBubble,
2931
+ Dt as ToolCallCard,
2932
+ ot as Tooltip,
2933
+ D as iconSizes,
2934
+ ks as useAnimatedNumber,
2935
+ Ds as useAnimatedPlaceholder,
2936
+ Es as useInView,
2937
+ Lt as useStreamScroll,
2938
+ St as useToast
2804
2939
  };