@donkit-ai/design-system 1.4.1 → 1.4.3

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,36 +136,36 @@ 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
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,
@@ -189,14 +189,14 @@ 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
201
  p(W[F]);
202
202
  Object.freeze && Object.freeze(W);
@@ -205,12 +205,12 @@ function as() {
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
207
  else p(W);
208
- if (U.call(N, "key")) {
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
243
  function p(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));
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",
@@ -305,40 +305,42 @@ function fe({
305
305
  state: o = "idle",
306
306
  onClick: l,
307
307
  type: m = "button",
308
- href: u,
308
+ href: d,
309
309
  "aria-label": f,
310
- ...p
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
- ...p,
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
  }
@@ -346,18 +348,18 @@ function fe({
346
348
  "button",
347
349
  {
348
350
  type: m,
349
- className: k,
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
- ...p,
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,
@@ -367,10 +369,10 @@ function Os({
367
369
  onIconRightClick: o,
368
370
  size: l = "m",
369
371
  disabled: m,
370
- id: u,
372
+ id: d,
371
373
  ...f
372
374
  }) {
373
- const p = u || `input-${q.useId()}`, h = r ? `${p}-hint` : void 0, d = t ? `${p}-error` : void 0, x = d || h;
375
+ const p = d || `input-${K.useId()}`, h = r ? `${p}-hint` : void 0, u = t ? `${p}-error` : void 0, b = u || h;
374
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: [
375
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: [
@@ -382,7 +384,7 @@ function Os({
382
384
  className: `ds-input ds-input--${l} ${a ? "ds-input--with-icon" : ""} ${n ? "ds-input--with-icon-right" : ""} ${t ? "ds-input--error" : ""}`,
383
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,
@@ -412,9 +414,9 @@ function zs({
412
414
  id: o,
413
415
  resize: l = !0,
414
416
  rows: m = 3,
415
- ...u
417
+ ...d
416
418
  }) {
417
- const f = o || `textarea-${q.useId()}`, p = r ? `${f}-hint` : void 0, h = t ? `${f}-error` : void 0, d = h || p;
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,
429
+ "aria-describedby": u,
428
430
  rows: m,
429
- ...u
431
+ ...d
430
432
  }
431
433
  ),
432
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,
@@ -443,147 +445,147 @@ function Fs({
443
445
  fullWidth: o = !0,
444
446
  size: l = "m",
445
447
  disabled: m = !1,
446
- id: u,
448
+ id: d,
447
449
  ...f
448
450
  }) {
449
- const [p, 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(() => {
471
+ M(() => {
470
472
  if (p)
471
- return y(), window.addEventListener("scroll", y, !0), window.addEventListener("resize", y), () => {
472
- window.removeEventListener("scroll", y, !0), window.removeEventListener("resize", y);
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
- }, [p]), 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 (!p || A < 0 || !D.current) return;
482
- (c = D.current.querySelectorAll(".ds-select-option")[A]) == null || c.scrollIntoView({ block: "nearest" });
483
- }, [A, p]);
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(), p ? 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(), p ? 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
- p && (w.preventDefault(), k(0));
495
+ p && (g.preventDefault(), $(0));
494
496
  break;
495
497
  case "End":
496
- p && (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(), p ? 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
- p && (w.preventDefault(), U(!0));
505
+ p && (g.preventDefault(), U(!0));
504
506
  break;
505
507
  case "Tab":
506
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 = p && /* @__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
548
  return /* @__PURE__ */ e.jsxs("div", { className: `ds-select-wrapper ${o ? "ds-select-wrapper--full" : ""} ${m ? "ds-select-wrapper--disabled" : ""}`, children: [
547
- s && /* @__PURE__ */ e.jsx("label", { id: Y, className: "ds-select-label", children: s }),
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
558
  "aria-expanded": p,
557
- "aria-activedescendant": p && A >= 0 ? `${z}-opt-${A}` : void 0,
558
- "aria-labelledby": s ? Y : void 0,
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
- m || (p ? U() : _());
565
+ m || (p ? U() : x());
564
566
  },
565
- onKeyDown: L,
567
+ onKeyDown: k,
566
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 ${p && E === "down" ? "ds-select-icon--open" : ""} ${p && 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,
@@ -593,41 +595,41 @@ function Ws({
593
595
  size: o = "m",
594
596
  disabled: l = !1,
595
597
  hint: m,
596
- error: u,
598
+ error: d,
597
599
  ...f
598
600
  }) {
599
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,
@@ -661,15 +663,15 @@ function Ws({
661
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
- m && !u && /* @__PURE__ */ e.jsx("div", { className: "ds-stepper-hint", children: m }),
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,32 +682,32 @@ 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 p = 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
@@ -714,35 +716,35 @@ function ls({
714
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, m] = S(!1), u = () => {
802
+ const n = E(null), o = K.useId(), [l, m] = A(!1), d = () => {
801
803
  !r || l || (m(!0), setTimeout(() => {
802
804
  m(!1), r();
803
- }, us));
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), p = 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,12 +827,12 @@ 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
  )
@@ -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,15 +856,15 @@ function fs({
854
856
  className: o = "",
855
857
  ...l
856
858
  }) {
857
- const [m, u] = S(r), f = i !== void 0, p = f ? i : m, 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
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
  {
@@ -875,7 +877,7 @@ function fs({
875
877
  /* @__PURE__ */ e.jsx(
876
878
  xe,
877
879
  {
878
- size: I[2],
880
+ size: D[2],
879
881
  strokeWidth: 1.5,
880
882
  className: `ds-code-accordion__icon ${p ? "ds-code-accordion__icon--expanded" : ""}`
881
883
  }
@@ -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, ...m }) {
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"
918
+ d && "ds-tab--icon-only"
917
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",
@@ -953,29 +955,29 @@ function Zs({ children: s, selected: t = !1, onClick: r, size: i = "m", variant:
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, m] = S(!1), u = $(!1), f = $(null), p = $(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) : (m(!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
972
  return p.current = h, Ve(() => {
971
- const d = f.current !== t;
972
- f.current = t, u.current = l && d, h();
973
- }), B(() => {
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, p.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, m] = S(r), u = i !== void 0, f = u ? i : l, p = () => {
1028
- u ? a == null || a(!i) : m((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}`,
@@ -1044,7 +1046,7 @@ function Fe({
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,45 +1077,45 @@ 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" }), [m, u] = S(r || "top"), f = $(null), p = $(null), h = $(!1), d = () => {
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 = () => {
1092
1094
  if (!f.current || !p.current) return;
1093
- const b = f.current.getBoundingClientRect(), R = p.current.getBoundingClientRect(), E = r || ps(b, R.height, R.width), { top: g, left: A, arrowOffset: k } = ms(E, b, R);
1094
- u(E), l({
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
1121
  ref: p,
@@ -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,7 +1156,7 @@ function st({
1154
1156
  id: n,
1155
1157
  ...o
1156
1158
  }) {
1157
- const l = n || `toggle-${q.useId()}`, m = [
1159
+ const l = n || `toggle-${K.useId()}`, m = [
1158
1160
  "ds-toggle",
1159
1161
  `ds-toggle--${r}`,
1160
1162
  i && "ds-toggle--disabled"
@@ -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,11 +1187,11 @@ function tt({
1185
1187
  id: n,
1186
1188
  ...o
1187
1189
  }) {
1188
- const l = n || `checkbox-${q.useId()}`, m = [
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;
1194
+ ].filter(Boolean).join(" "), d = r === "xs" ? 10 : r === "small" ? 14 : r === "large" ? 20 : 16;
1193
1195
  return /* @__PURE__ */ e.jsxs("label", { className: m, htmlFor: l, children: [
1194
1196
  /* @__PURE__ */ e.jsx(
1195
1197
  "input",
@@ -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",
@@ -1225,17 +1227,17 @@ function rt({
1225
1227
  id: l,
1226
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
1243
  onChange: (p) => t == null ? void 0 : t(p.target.checked),
@@ -1249,7 +1251,7 @@ function rt({
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 ?? ""), [m, 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 && !m ? /* @__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,13 +1336,13 @@ 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, exiting: a, updated: n, className: o = "", onClick: l, ...m }) {
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
  {
@@ -1359,11 +1361,11 @@ function lt({ children: s, interactive: t, selected: r, subheader: i, exiting: a
1359
1361
  }
1360
1362
  );
1361
1363
  }
1362
- function ct({ children: s, colSpan: t = 999, ...r }) {
1364
+ function xt({ children: s, colSpan: t = 999, ...r }) {
1363
1365
  return /* @__PURE__ */ e.jsx("tr", { className: "ds-table-row ds-table-row--subheader", ...r, children: /* @__PURE__ */ e.jsx("td", { colSpan: t, children: s }) });
1364
1366
  }
1365
- function dt({ children: s, align: t = "left", sortDir: r, onSort: i, width: a, className: n = "", style: o = {}, ...l }) {
1366
- const m = !!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;
1367
1369
  return /* @__PURE__ */ e.jsx(
1368
1370
  "th",
1369
1371
  {
@@ -1379,12 +1381,12 @@ function dt({ children: s, align: t = "left", sortDir: r, onSort: i, width: a, c
1379
1381
  ...l,
1380
1382
  children: m ? /* @__PURE__ */ e.jsxs("span", { className: "ds-th__inner", children: [
1381
1383
  s,
1382
- /* @__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 }) })
1383
1385
  ] }) : s
1384
1386
  }
1385
1387
  );
1386
1388
  }
1387
- 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 }) {
1388
1390
  return /* @__PURE__ */ e.jsx(
1389
1391
  "td",
1390
1392
  {
@@ -1402,7 +1404,7 @@ function ut({ children: s, align: t = "left", secondary: r, muted: i, truncate:
1402
1404
  }
1403
1405
  );
1404
1406
  }
1405
- function ft({
1407
+ function jt({
1406
1408
  icon: s,
1407
1409
  title: t,
1408
1410
  description: r,
@@ -1425,7 +1427,7 @@ function ft({
1425
1427
  }
1426
1428
  );
1427
1429
  }
1428
- function mt({
1430
+ function vt({
1429
1431
  label: s,
1430
1432
  hint: t,
1431
1433
  error: r,
@@ -1435,9 +1437,9 @@ function mt({
1435
1437
  children: o,
1436
1438
  className: l = "",
1437
1439
  style: m,
1438
- ...u
1440
+ ...d
1439
1441
  }) {
1440
- const f = q.useId(), p = n ?? f, h = `${p}-hint`, d = `${p}-error`;
1442
+ const f = K.useId(), p = n ?? f, h = `${p}-hint`, u = `${p}-error`;
1441
1443
  return /* @__PURE__ */ e.jsxs(
1442
1444
  "div",
1443
1445
  {
@@ -1446,17 +1448,17 @@ function mt({
1446
1448
  "data-required": i ? "" : void 0,
1447
1449
  "data-disabled": a ? "" : void 0,
1448
1450
  style: m,
1449
- ...u,
1451
+ ...d,
1450
1452
  children: [
1451
1453
  s && /* @__PURE__ */ e.jsx("label", { className: "ds-field-label", htmlFor: p, children: s }),
1452
1454
  /* @__PURE__ */ e.jsx("div", { className: "ds-field-control", children: o }),
1453
1455
  t && !r && /* @__PURE__ */ e.jsx("p", { className: "ds-field-hint", id: h, children: t }),
1454
- 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 })
1455
1457
  ]
1456
1458
  }
1457
1459
  );
1458
1460
  }
1459
- function pt({ label: s, value: t, delta: r, size: i = "m", inline: a = !1, className: n = "", style: o, ...l }) {
1461
+ function Nt({ label: s, value: t, delta: r, size: i = "m", inline: a = !1, className: n = "", style: o, ...l }) {
1460
1462
  const m = r != null && r.startsWith("+") ? "up" : r != null && r.startsWith("-") ? "down" : "neutral";
1461
1463
  return /* @__PURE__ */ e.jsxs(
1462
1464
  "div",
@@ -1477,7 +1479,7 @@ function pt({ label: s, value: t, delta: r, size: i = "m", inline: a = !1, class
1477
1479
  }
1478
1480
  );
1479
1481
  }
1480
- function ht({
1482
+ function wt({
1481
1483
  children: s,
1482
1484
  separator: t = "/",
1483
1485
  "aria-label": r = "Breadcrumb",
@@ -1485,7 +1487,7 @@ function ht({
1485
1487
  style: a,
1486
1488
  ...n
1487
1489
  }) {
1488
- const o = q.Children.toArray(s).filter(Boolean);
1490
+ const o = K.Children.toArray(s).filter(Boolean);
1489
1491
  return /* @__PURE__ */ e.jsx(
1490
1492
  "nav",
1491
1493
  {
@@ -1500,7 +1502,7 @@ function ht({
1500
1502
  }
1501
1503
  );
1502
1504
  }
1503
- function xt({
1505
+ function gt({
1504
1506
  page: s,
1505
1507
  total: t,
1506
1508
  onChange: r,
@@ -1510,7 +1512,7 @@ function xt({
1510
1512
  style: o,
1511
1513
  ...l
1512
1514
  }) {
1513
- const m = bs(s, t, i);
1515
+ const m = vs(s, t, i);
1514
1516
  return /* @__PURE__ */ e.jsxs(
1515
1517
  "nav",
1516
1518
  {
@@ -1526,20 +1528,20 @@ function xt({
1526
1528
  onClick: () => r == null ? void 0 : r(s - 1),
1527
1529
  disabled: s <= 1,
1528
1530
  "aria-label": "Previous page",
1529
- children: /* @__PURE__ */ e.jsx(Xe, { size: 16 })
1531
+ children: /* @__PURE__ */ e.jsx(Ge, { size: 16 })
1530
1532
  }
1531
1533
  ),
1532
1534
  m.map(
1533
- (u, f) => u === "…" ? /* @__PURE__ */ e.jsx("span", { className: "ds-pagination-gap", "aria-hidden": "true", children: "…" }, `gap-${f}`) : /* @__PURE__ */ e.jsx(
1535
+ (d, f) => d === "…" ? /* @__PURE__ */ e.jsx("span", { className: "ds-pagination-gap", "aria-hidden": "true", children: "…" }, `gap-${f}`) : /* @__PURE__ */ e.jsx(
1534
1536
  "button",
1535
1537
  {
1536
- className: `ds-pagination-page${u === s ? " ds-pagination-page--current" : ""}`,
1537
- onClick: () => u !== s && (r == null ? void 0 : r(u)),
1538
- "aria-current": u === s ? "page" : void 0,
1539
- "aria-label": `Page ${u}`,
1540
- 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
1541
1543
  },
1542
- u
1544
+ d
1543
1545
  )
1544
1546
  ),
1545
1547
  /* @__PURE__ */ e.jsx(
@@ -1549,44 +1551,44 @@ function xt({
1549
1551
  onClick: () => r == null ? void 0 : r(s + 1),
1550
1552
  disabled: s >= t,
1551
1553
  "aria-label": "Next page",
1552
- children: /* @__PURE__ */ e.jsx(Oe, { size: 16 })
1554
+ children: /* @__PURE__ */ e.jsx(Xe, { size: 16 })
1553
1555
  }
1554
1556
  )
1555
1557
  ]
1556
1558
  }
1557
1559
  );
1558
1560
  }
1559
- function bs(s, t, r) {
1561
+ function vs(s, t, r) {
1560
1562
  if (t <= 7) return Array.from({ length: t }, (o, l) => l + 1);
1561
1563
  const i = Math.max(2, s - r), a = Math.min(t - 1, s + r), n = [1];
1562
1564
  i > 2 && n.push("…");
1563
1565
  for (let o = i; o <= a; o++) n.push(o);
1564
1566
  return a < t - 1 && n.push("…"), n.push(t), n;
1565
1567
  }
1566
- const vs = 200;
1567
- function _t({
1568
+ const Ns = 200;
1569
+ function yt({
1568
1570
  children: s,
1569
1571
  title: t,
1570
1572
  onClose: r,
1571
1573
  side: i = "right",
1572
1574
  ...a
1573
1575
  }) {
1574
- const n = $(null), o = q.useId(), [l, m] = S(!1), u = () => {
1576
+ const n = E(null), o = K.useId(), [l, m] = A(!1), d = () => {
1575
1577
  !r || l || (m(!0), setTimeout(() => {
1576
1578
  m(!1), r();
1577
- }, vs));
1579
+ }, Ns));
1578
1580
  };
1579
- B(() => {
1580
- const d = (b) => {
1581
- b.key === "Escape" && u();
1582
- }, x = (b) => {
1583
- 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();
1584
1586
  };
1585
- return document.addEventListener("keydown", d), document.addEventListener("mousedown", x), () => {
1586
- 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);
1587
1589
  };
1588
1590
  }, [r, l]);
1589
- const f = q.Children.toArray(s), p = 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);
1590
1592
  return /* @__PURE__ */ e.jsx(
1591
1593
  "div",
1592
1594
  {
@@ -1604,7 +1606,7 @@ function _t({
1604
1606
  children: [
1605
1607
  /* @__PURE__ */ e.jsxs("header", { className: "ds-drawer-header", children: [
1606
1608
  t && /* @__PURE__ */ e.jsx("h3", { id: o, className: "ds-drawer-title", children: t }),
1607
- 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 }) })
1608
1610
  ] }),
1609
1611
  /* @__PURE__ */ e.jsx("div", { className: "ds-drawer-body", children: h }),
1610
1612
  p
@@ -1614,16 +1616,16 @@ function _t({
1614
1616
  }
1615
1617
  );
1616
1618
  }
1617
- function De({ children: s }) {
1619
+ function Be({ children: s }) {
1618
1620
  return /* @__PURE__ */ e.jsx("footer", { className: "ds-drawer-footer", children: s });
1619
1621
  }
1620
- const Ns = {
1622
+ const ws = {
1621
1623
  info: ke,
1622
- success: ge,
1623
- warning: ye,
1624
+ success: ye,
1625
+ warning: ge,
1624
1626
  error: we
1625
1627
  };
1626
- function jt({
1628
+ function kt({
1627
1629
  children: s,
1628
1630
  variant: t = "info",
1629
1631
  action: r,
@@ -1632,7 +1634,7 @@ function jt({
1632
1634
  role: n,
1633
1635
  ...o
1634
1636
  }) {
1635
- const l = Ns[t], m = n || (t === "error" ? "alert" : "status");
1637
+ const l = ws[t], m = n || (t === "error" ? "alert" : "status");
1636
1638
  return /* @__PURE__ */ e.jsxs(
1637
1639
  "div",
1638
1640
  {
@@ -1640,7 +1642,7 @@ function jt({
1640
1642
  role: m,
1641
1643
  ...o,
1642
1644
  children: [
1643
- 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 }) }),
1644
1646
  /* @__PURE__ */ e.jsx("span", { className: "ds-banner-text", children: s }),
1645
1647
  r && /* @__PURE__ */ e.jsx(
1646
1648
  "button",
@@ -1658,14 +1660,14 @@ function jt({
1658
1660
  className: "ds-banner-dismiss",
1659
1661
  onClick: a,
1660
1662
  "aria-label": "Dismiss",
1661
- children: /* @__PURE__ */ e.jsx(ne, { size: I[2], strokeWidth: 1.5 })
1663
+ children: /* @__PURE__ */ e.jsx(ne, { size: D[2], strokeWidth: 1.5 })
1662
1664
  }
1663
1665
  )
1664
1666
  ]
1665
1667
  }
1666
1668
  );
1667
1669
  }
1668
- function bt({
1670
+ function Et({
1669
1671
  trigger: s,
1670
1672
  items: t = [],
1671
1673
  open: r,
@@ -1675,131 +1677,133 @@ function bt({
1675
1677
  style: o,
1676
1678
  ...l
1677
1679
  }) {
1678
- const [m, u] = S(!1), [f, p] = S(!1), h = r !== void 0, d = h ? r : m, 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 = () => {
1679
1681
  if (h)
1680
1682
  i == null || i(!1);
1681
1683
  else {
1682
1684
  if (f) return;
1683
- p(!0), k.current = setTimeout(() => {
1684
- u(!1), p(!1);
1685
+ p(!0), $.current = setTimeout(() => {
1686
+ d(!1), p(!1);
1685
1687
  }, O);
1686
1688
  }
1687
- }, v = () => {
1688
- const _ = !d;
1689
- h ? i == null || i(_) : _ ? (clearTimeout(k.current), p(!1), u(!0)) : D();
1690
- }, M = () => {
1691
- d || (h ? i == null || i(!0) : (clearTimeout(k.current), p(!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)));
1692
1694
  };
1693
- B(() => () => clearTimeout(k.current), []), B(() => {
1694
- if (!d) return;
1695
- const _ = () => {
1696
- var L;
1697
- const y = (L = x.current) == null ? void 0 : L.getBoundingClientRect();
1698
- y && A(
1699
- 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 }
1700
1704
  );
1701
1705
  };
1702
- return _(), window.addEventListener("scroll", _, !0), window.addEventListener("resize", _), () => {
1703
- 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);
1704
1708
  };
1705
- }, [d, a]);
1706
- const z = () => {
1707
- var y;
1708
- 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(
1709
1713
  'button:not([disabled]), [href], [tabindex]:not([tabindex="-1"]), input, select, textarea'
1710
1714
  );
1711
- _ == null || _.focus();
1715
+ x == null || x.focus();
1712
1716
  };
1713
- B(() => {
1714
- if (!d) return;
1715
- const _ = (L) => {
1716
- var C, K;
1717
- !((C = x.current) != null && C.contains(L.target)) && !((K = b.current) != null && K.contains(L.target)) && D();
1718
- }, y = (L) => {
1719
- 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());
1720
1724
  };
1721
- return document.addEventListener("mousedown", _), document.addEventListener("keydown", y), () => {
1722
- 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);
1723
1727
  };
1724
- }, [d]), B(() => {
1725
- if (!d || !E.current || !b.current) return;
1726
- const _ = Y(), y = E.current === "last" ? _[_.length - 1] : _[0];
1727
- y == null || y.focus(), E.current = null;
1728
- }, [d]);
1729
- 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(
1730
1734
  'button:not([disabled]), a[href]:not([aria-disabled="true"]), [tabindex]:not([tabindex="-1"])'
1731
- )] : [], H = (_) => {
1732
- var y, L;
1733
- if (_.key === "ArrowDown")
1734
- _.preventDefault(), d ? (y = Y()[0]) == null || y.focus() : (E.current = "first", M());
1735
- else if (_.key === "ArrowUp")
1736
- if (_.preventDefault(), !d)
1737
- 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();
1738
1742
  else {
1739
- const C = Y();
1740
- (L = C[C.length - 1]) == null || L.focus();
1743
+ const L = N();
1744
+ (k = L[L.length - 1]) == null || k.focus();
1741
1745
  }
1742
- }, X = (_) => {
1743
- var C, K, Z, w;
1744
- const y = Y(), L = y.findIndex((c) => c === document.activeElement);
1745
- 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) {
1746
1750
  case "ArrowDown":
1747
- _.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();
1748
1752
  break;
1749
1753
  case "ArrowUp":
1750
- _.preventDefault(), L <= 0 ? z() : (K = y[L - 1]) == null || K.focus();
1754
+ x.preventDefault(), k <= 0 ? P() : (H = v[k - 1]) == null || H.focus();
1751
1755
  break;
1752
1756
  case "Home":
1753
- _.preventDefault(), (Z = y[0]) == null || Z.focus();
1757
+ x.preventDefault(), (X = v[0]) == null || X.focus();
1754
1758
  break;
1755
1759
  case "End":
1756
- _.preventDefault(), (w = y[y.length - 1]) == null || w.focus();
1760
+ x.preventDefault(), (g = v[v.length - 1]) == null || g.focus();
1757
1761
  break;
1758
1762
  case "Tab":
1759
- D();
1763
+ I();
1760
1764
  break;
1761
1765
  }
1762
- }, U = d && /* @__PURE__ */ e.jsx(
1766
+ }, U = u && /* @__PURE__ */ e.jsx(
1763
1767
  "div",
1764
1768
  {
1765
- ref: b,
1769
+ ref: j,
1766
1770
  role: "menu",
1767
1771
  className: [
1768
1772
  "ds-dropdown__menu",
1769
1773
  `ds-dropdown__menu--${a}`,
1770
1774
  f && "ds-dropdown__menu--closing"
1771
1775
  ].filter(Boolean).join(" "),
1772
- style: g,
1773
- onKeyDown: X,
1774
- children: t.map((_, y) => {
1775
- if (_.separator)
1776
- return /* @__PURE__ */ e.jsx("div", { className: "ds-dropdown__separator" }, y);
1777
- 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")
1778
1782
  return /* @__PURE__ */ e.jsxs("div", { className: "ds-dropdown__section", children: [
1779
- _.label && /* @__PURE__ */ e.jsx("div", { className: "ds-dropdown__section-label", children: _.label }),
1780
- /* @__PURE__ */ e.jsx("div", { className: "ds-dropdown__section-content", children: _.content })
1781
- ] }, y);
1782
- 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 };
1783
1787
  return /* @__PURE__ */ e.jsxs(
1784
- C,
1788
+ L,
1785
1789
  {
1786
1790
  role: "menuitem",
1787
1791
  className: [
1788
1792
  "ds-dropdown__item",
1789
- _.danger && "ds-dropdown__item--danger"
1793
+ x.danger && "ds-dropdown__item--danger"
1790
1794
  ].filter(Boolean).join(" "),
1791
- ...K,
1795
+ ...H,
1792
1796
  onClick: () => {
1793
- var Z;
1794
- (Z = _.onClick) == null || Z.call(_), D();
1797
+ var X;
1798
+ (X = x.onClick) == null || X.call(x), I();
1795
1799
  },
1796
1800
  children: [
1797
- _.icon && /* @__PURE__ */ e.jsx("span", { className: "ds-dropdown__item-icon", children: _.icon }),
1798
- /* @__PURE__ */ e.jsx("span", { className: "ds-dropdown__item-label", children: _.label }),
1799
- _.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 })
1800
1804
  ]
1801
1805
  },
1802
- y
1806
+ v
1803
1807
  );
1804
1808
  })
1805
1809
  }
@@ -1807,7 +1811,7 @@ function bt({
1807
1811
  return /* @__PURE__ */ e.jsxs(
1808
1812
  "div",
1809
1813
  {
1810
- ref: x,
1814
+ ref: b,
1811
1815
  className: ["ds-dropdown", n].filter(Boolean).join(" "),
1812
1816
  style: o,
1813
1817
  ...l,
@@ -1815,19 +1819,19 @@ function bt({
1815
1819
  /* @__PURE__ */ e.jsx(
1816
1820
  "div",
1817
1821
  {
1818
- ref: R,
1822
+ ref: S,
1819
1823
  className: "ds-dropdown__trigger",
1820
- onClick: v,
1821
- onKeyDown: H,
1824
+ onClick: Y,
1825
+ onKeyDown: C,
1822
1826
  children: s
1823
1827
  }
1824
1828
  ),
1825
- typeof document < "u" && me.createPortal(U, document.body)
1829
+ typeof document < "u" && pe.createPortal(U, document.body)
1826
1830
  ]
1827
1831
  }
1828
1832
  );
1829
1833
  }
1830
- function vt({
1834
+ function $t({
1831
1835
  value: s = 0,
1832
1836
  size: t = "m",
1833
1837
  variant: r = "default",
@@ -1864,10 +1868,10 @@ function vt({
1864
1868
  }
1865
1869
  );
1866
1870
  }
1867
- const ws = (s) => 1 - Math.pow(1 - s, 3), ys = () => typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
1868
- function gs(s, { duration: t = 600 } = {}) {
1869
- const [r, i] = S(s), a = $(s), n = $(null);
1870
- 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(() => {
1871
1875
  if (ys()) {
1872
1876
  i(s), a.current = s;
1873
1877
  return;
@@ -1875,27 +1879,27 @@ function gs(s, { duration: t = 600 } = {}) {
1875
1879
  const o = a.current, l = s - o;
1876
1880
  if (l === 0) return;
1877
1881
  let m = null;
1878
- const u = (f) => {
1882
+ const d = (f) => {
1879
1883
  m || (m = f);
1880
1884
  const p = Math.min((f - m) / t, 1);
1881
- i(o + l * ws(p)), p < 1 ? n.current = requestAnimationFrame(u) : a.current = s;
1885
+ i(o + l * gs(p)), p < 1 ? n.current = requestAnimationFrame(d) : a.current = s;
1882
1886
  };
1883
- return n.current = requestAnimationFrame(u), () => cancelAnimationFrame(n.current);
1887
+ return n.current = requestAnimationFrame(d), () => cancelAnimationFrame(n.current);
1884
1888
  }, [s, t]), r;
1885
1889
  }
1886
- function Nt({
1890
+ function Tt({
1887
1891
  value: s,
1888
1892
  duration: t = 600,
1889
1893
  decimals: r = 0,
1890
1894
  prefix: i = "",
1891
1895
  suffix: a = ""
1892
1896
  }) {
1893
- const o = gs(s, { duration: t }).toFixed(r);
1897
+ const o = ks(s, { duration: t }).toFixed(r);
1894
1898
  return `${i}${o}${a}`;
1895
1899
  }
1896
- function ks({ threshold: s = 0.1, rootMargin: t = "0px", once: r = !1 } = {}) {
1897
- const i = $(null), [a, n] = S(!1);
1898
- 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(() => {
1899
1903
  const o = i.current;
1900
1904
  if (!o) return;
1901
1905
  const l = new IntersectionObserver(
@@ -1907,7 +1911,7 @@ function ks({ threshold: s = 0.1, rootMargin: t = "0px", once: r = !1 } = {}) {
1907
1911
  return l.observe(o), () => l.disconnect();
1908
1912
  }, [s, t, r]), { ref: i, inView: a };
1909
1913
  }
1910
- function wt({
1914
+ function Rt({
1911
1915
  children: s,
1912
1916
  as: t = "div",
1913
1917
  once: r = !1,
@@ -1917,31 +1921,31 @@ function wt({
1917
1921
  onLeave: o,
1918
1922
  ...l
1919
1923
  }) {
1920
- const { ref: m, inView: u } = ks({ threshold: i, rootMargin: a, once: r }), f = $(!1);
1921
- return B(() => {
1922
- u && !f.current && (n == null || n()), !u && f.current && (o == null || o()), f.current = u;
1923
- }, [u]), /* @__PURE__ */ e.jsx(t, { ref: m, ...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 });
1924
1928
  }
1925
- const Be = {
1929
+ const Me = {
1926
1930
  default: ke,
1927
- success: ge,
1928
- warning: ye,
1931
+ success: ye,
1932
+ warning: ge,
1929
1933
  error: we
1930
1934
  };
1931
- let ce = [];
1932
- const Ne = /* @__PURE__ */ new Set();
1935
+ let de = [];
1936
+ const ve = /* @__PURE__ */ new Set();
1933
1937
  function We() {
1934
- Ne.forEach((s) => s([...ce]));
1935
- }
1936
- function Es(s) {
1937
- ce = [...ce, s], We();
1938
+ ve.forEach((s) => s([...de]));
1938
1939
  }
1939
1940
  function $s(s) {
1940
- ce = ce.filter((t) => t.id !== s), We();
1941
+ de = [...de, s], We();
1941
1942
  }
1942
- function yt() {
1943
+ function Ts(s) {
1944
+ de = de.filter((t) => t.id !== s), We();
1945
+ }
1946
+ function St() {
1943
1947
  const s = (t, r = {}) => {
1944
- Es({
1948
+ $s({
1945
1949
  id: `${Date.now()}-${Math.random()}`,
1946
1950
  message: t,
1947
1951
  type: "default",
@@ -1951,13 +1955,13 @@ function yt() {
1951
1955
  };
1952
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 };
1953
1957
  }
1954
- function Ts({ data: s, onDismiss: t }) {
1955
- const [r, i] = S(!1), a = $(null);
1956
- 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)), []);
1957
1961
  function n() {
1958
1962
  i(!1), setTimeout(() => t(s.id), 250);
1959
1963
  }
1960
- const o = Be[s.type] ?? Be.default;
1964
+ const o = Me[s.type] ?? Me.default;
1961
1965
  return /* @__PURE__ */ e.jsxs(
1962
1966
  "div",
1963
1967
  {
@@ -1969,7 +1973,7 @@ function Ts({ data: s, onDismiss: t }) {
1969
1973
  role: s.type === "error" ? "alert" : "status",
1970
1974
  "aria-live": "polite",
1971
1975
  children: [
1972
- /* @__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 }) }),
1973
1977
  /* @__PURE__ */ e.jsx("span", { className: "ds-toast__message", children: s.message }),
1974
1978
  /* @__PURE__ */ e.jsx(
1975
1979
  "button",
@@ -1977,26 +1981,26 @@ function Ts({ data: s, onDismiss: t }) {
1977
1981
  className: "ds-toast__close",
1978
1982
  onClick: n,
1979
1983
  "aria-label": "Закрыть",
1980
- children: /* @__PURE__ */ e.jsx(ne, { size: I[3], strokeWidth: 1.5 })
1984
+ children: /* @__PURE__ */ e.jsx(ne, { size: D[3], strokeWidth: 1.5 })
1981
1985
  }
1982
1986
  )
1983
1987
  ]
1984
1988
  }
1985
1989
  );
1986
1990
  }
1987
- function gt({ position: s = "bottom-right" }) {
1988
- const [t, r] = S(() => [...ce]);
1989
- return B(() => (Ne.add(r), () => Ne.delete(r)), []), !t.length || typeof document > "u" ? null : me.createPortal(
1990
- /* @__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)) }),
1991
1995
  document.body
1992
1996
  );
1993
1997
  }
1994
- const Rs = {
1995
- running: /* @__PURE__ */ e.jsx(pe, { size: "xs", variant: "info", children: "Running..." }),
1996
- success: /* @__PURE__ */ e.jsx(pe, { size: "xs", variant: "success", children: "Done" }),
1997
- 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" })
1998
2002
  };
1999
- function kt({
2003
+ function Dt({
2000
2004
  label: s,
2001
2005
  status: t = "idle",
2002
2006
  icon: r,
@@ -2004,88 +2008,82 @@ function kt({
2004
2008
  defaultExpanded: a = !1,
2005
2009
  expanded: n,
2006
2010
  onToggle: o,
2007
- padding: l = "s",
2008
- children: m,
2009
- ...u
2011
+ children: l,
2012
+ className: m = "",
2013
+ ...d
2010
2014
  }) {
2011
- const p = `tc-body-${Ye().replace(/:/g, "")}`, [h, d] = S(a), x = n !== void 0, b = x ? n : h, R = () => {
2012
- x ? o == null || o(!n) : d((E) => !E);
2013
- };
2014
- return /* @__PURE__ */ e.jsxs(ls, { padding: l, ...u, children: [
2015
- /* @__PURE__ */ e.jsxs(
2016
- "button",
2017
- {
2018
- type: "button",
2019
- className: "ds-tool-card__header",
2020
- onClick: R,
2021
- "aria-expanded": b,
2022
- "aria-controls": p,
2023
- children: [
2024
- /* @__PURE__ */ e.jsx(
2025
- Oe,
2026
- {
2027
- size: I[1],
2028
- strokeWidth: 1.5,
2029
- className: `ds-tool-card__chevron${b ? " ds-tool-card__chevron--expanded" : ""}`
2030
- }
2031
- ),
2032
- r && /* @__PURE__ */ e.jsx("span", { className: "ds-tool-card__icon", children: r }),
2033
- /* @__PURE__ */ e.jsx("span", { className: "ds-tool-card__label", children: s }),
2034
- Rs[t],
2035
- i
2036
- ]
2037
- }
2038
- ),
2039
- b && /* @__PURE__ */ e.jsx("div", { id: p, className: "ds-tool-card__body", children: m })
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
2040
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
+ );
2041
2039
  }
2042
- function Et({
2040
+ function As({
2043
2041
  text: s,
2044
2042
  size: t = "xs",
2045
2043
  timeout: r = 2e3,
2046
2044
  "aria-label": i = "Copy to clipboard",
2047
2045
  ...a
2048
2046
  }) {
2049
- const [n, o] = S(!1), l = () => {
2047
+ const [n, o] = A(!1), l = () => {
2050
2048
  navigator.clipboard.writeText(s).then(() => {
2051
2049
  o(!0), setTimeout(() => o(!1), r);
2052
2050
  });
2053
2051
  };
2054
2052
  return /* @__PURE__ */ e.jsx(
2055
- fe,
2053
+ me,
2056
2054
  {
2057
2055
  variant: "ghost",
2058
2056
  size: t,
2059
- 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 }),
2060
2058
  "aria-label": i,
2061
2059
  onClick: l,
2062
2060
  ...a
2063
2061
  }
2064
2062
  );
2065
2063
  }
2066
- function $t({ content: s, streaming: t = !1, ...r }) {
2067
- const [i, a] = S(t);
2068
- return B(() => {
2064
+ function It({ content: s, streaming: t = !1, ...r }) {
2065
+ const [i, a] = A(t);
2066
+ return M(() => {
2069
2067
  a(!!t);
2070
2068
  }, [t]), /* @__PURE__ */ e.jsx(
2071
- Fe,
2069
+ Ee,
2072
2070
  {
2073
2071
  expanded: i,
2074
2072
  onToggle: a,
2075
2073
  padding: "s",
2076
2074
  title: /* @__PURE__ */ e.jsxs("div", { className: "ds-reasoning__title", children: [
2077
- /* @__PURE__ */ e.jsx(Ze, { size: I[1], strokeWidth: 1.5, className: "ds-reasoning__icon" }),
2078
- /* @__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" })
2079
2077
  ] }),
2080
2078
  ...r,
2081
- 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: [
2082
2080
  s,
2083
2081
  t && /* @__PURE__ */ e.jsx("span", { className: "ds-cursor ds-cursor--line" })
2084
2082
  ] })
2085
2083
  }
2086
2084
  );
2087
2085
  }
2088
- function Tt({
2086
+ function Bt({
2089
2087
  count: s,
2090
2088
  current: t = 0,
2091
2089
  done: r = [],
@@ -2096,8 +2094,8 @@ function Tt({
2096
2094
  ...l
2097
2095
  }) {
2098
2096
  return /* @__PURE__ */ e.jsxs("div", { className: ["ds-step-indicator", n].filter(Boolean).join(" "), ...l, children: [
2099
- /* @__PURE__ */ e.jsx("div", { className: "ds-step-indicator__dots", role: "tablist", "aria-label": o, children: Array.from({ length: s }, (m, u) => {
2100
- const f = u === t, p = 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 = [
2101
2099
  "ds-step-indicator__dot",
2102
2100
  f && "ds-step-indicator__dot--active",
2103
2101
  p && "ds-step-indicator__dot--done"
@@ -2106,25 +2104,25 @@ function Tt({
2106
2104
  "button",
2107
2105
  {
2108
2106
  type: "button",
2109
- className: d,
2107
+ className: u,
2110
2108
  role: "tab",
2111
2109
  "aria-selected": f,
2112
- "aria-label": `Step ${u + 1}`,
2113
- disabled: !h || u === t,
2114
- onClick: () => i == null ? void 0 : i(u),
2110
+ "aria-label": `Step ${d + 1}`,
2111
+ disabled: !h || d === t,
2112
+ onClick: () => i == null ? void 0 : i(d),
2115
2113
  children: p ? /* @__PURE__ */ e.jsx(he, { size: 8, strokeWidth: 3 }) : null
2116
2114
  },
2117
- u
2115
+ d
2118
2116
  );
2119
2117
  }) }),
2120
- 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: [
2121
2119
  t + 1,
2122
2120
  " / ",
2123
2121
  s
2124
2122
  ] })
2125
2123
  ] });
2126
2124
  }
2127
- function Rt({
2125
+ function Mt({
2128
2126
  content: s,
2129
2127
  isStreaming: t = !1,
2130
2128
  cursor: r = "line",
@@ -2132,15 +2130,15 @@ function Rt({
2132
2130
  className: a = "",
2133
2131
  ...n
2134
2132
  }) {
2135
- const o = $(s);
2136
- return B(() => {
2133
+ const o = E(s);
2134
+ return M(() => {
2137
2135
  s !== o.current && (i == null || i(s), o.current = s);
2138
2136
  }, [s, i]), /* @__PURE__ */ e.jsxs("span", { className: ["ds-streaming-text", a].filter(Boolean).join(" "), ...n, children: [
2139
2137
  s,
2140
2138
  t && r !== "none" && /* @__PURE__ */ e.jsx("span", { className: `ds-cursor ds-cursor--${r}`, "aria-hidden": "true" })
2141
2139
  ] });
2142
2140
  }
2143
- function St({
2141
+ function Pt({
2144
2142
  role: s = "assistant",
2145
2143
  header: t,
2146
2144
  footer: r,
@@ -2167,9 +2165,9 @@ function St({
2167
2165
  r && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__footer", children: r })
2168
2166
  ] });
2169
2167
  }
2170
- function At(s, { containerRef: t, smartPause: r = !0 } = {}) {
2171
- const i = $(!1), a = $(0);
2172
- B(() => {
2168
+ function Lt(s, { containerRef: t, smartPause: r = !0 } = {}) {
2169
+ const i = E(!1), a = E(0);
2170
+ M(() => {
2173
2171
  const n = t == null ? void 0 : t.current;
2174
2172
  if (!n) return;
2175
2173
  const o = () => {
@@ -2177,12 +2175,12 @@ function At(s, { containerRef: t, smartPause: r = !0 } = {}) {
2177
2175
  !l && n.scrollTop < a.current && (i.current = !0), l && (i.current = !1), a.current = n.scrollTop;
2178
2176
  };
2179
2177
  return n.addEventListener("scroll", o, { passive: !0 }), () => n.removeEventListener("scroll", o);
2180
- }, [t]), B(() => {
2178
+ }, [t]), M(() => {
2181
2179
  const n = t == null ? void 0 : t.current;
2182
2180
  n && (r && i.current || (n.scrollTop = n.scrollHeight));
2183
2181
  }, s);
2184
2182
  }
2185
- function Ss({
2183
+ function Ds({
2186
2184
  prompts: s,
2187
2185
  enabled: t,
2188
2186
  typingSpeed: r = 38,
@@ -2191,36 +2189,36 @@ function Ss({
2191
2189
  betweenTime: n = 380,
2192
2190
  manualPauseMs: o = 5e3
2193
2191
  }) {
2194
- const [l, m] = S(0), [u, f] = S(""), p = $("typing"), h = $(0), d = $(0), x = $(null), b = $(0);
2195
- B(() => {
2196
- d.current = l;
2197
- }, [l]), B(() => {
2198
- if (x.current && (clearTimeout(x.current), x.current = null), !t || s.length === 0) {
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) {
2199
2197
  f(""), h.current = 0, p.current = "typing";
2200
2198
  return;
2201
2199
  }
2202
- const k = () => {
2200
+ const $ = () => {
2203
2201
  const O = Date.now();
2204
- if (b.current > O) {
2205
- x.current = setTimeout(k, b.current - O);
2202
+ if (j.current > O) {
2203
+ b.current = setTimeout($, j.current - O);
2206
2204
  return;
2207
2205
  }
2208
- const D = s[d.current % s.length] ?? "";
2209
- p.current === "typing" ? (h.current += 1, f(D.slice(0, h.current)), h.current >= D.length ? (p.current = "holding", x.current = setTimeout(k, a)) : x.current = setTimeout(k, r + Math.random() * 28)) : p.current === "holding" ? (p.current = "erasing", x.current = setTimeout(k, i)) : (h.current = Math.max(0, h.current - 1), f(D.slice(0, h.current)), h.current <= 0 ? (p.current = "typing", d.current = (d.current + 1) % s.length, m(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));
2210
2208
  };
2211
- return x.current = setTimeout(k, 260), () => {
2212
- x.current && clearTimeout(x.current);
2209
+ return b.current = setTimeout($, 260), () => {
2210
+ b.current && clearTimeout(b.current);
2213
2211
  };
2214
2212
  }, [t, s, r, i, a, n]);
2215
- const R = (k) => {
2213
+ const S = ($) => {
2216
2214
  if (s.length === 0) return;
2217
- const O = (k % s.length + s.length) % s.length, D = s[O];
2218
- d.current = O, h.current = D.length, p.current = "holding", b.current = Date.now() + o, m(O), f(D);
2219
- }, E = () => R(d.current + 1), g = () => R(d.current - 1), A = s[l % s.length] ?? "";
2220
- 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 };
2221
2219
  }
2222
- let As = 0;
2223
- function It({
2220
+ let Is = 0;
2221
+ function zt({
2224
2222
  value: s = "",
2225
2223
  onChange: t,
2226
2224
  onSubmit: r,
@@ -2230,121 +2228,121 @@ function It({
2230
2228
  disabled: o = !1,
2231
2229
  placeholder: l = "Let's get things done...",
2232
2230
  animatedPlaceholders: m,
2233
- attachments: u,
2231
+ attachments: d,
2234
2232
  images: f,
2235
2233
  onAttachFiles: p,
2236
2234
  onAttachImages: h,
2237
- onRemoveAttachment: d,
2238
- onRemoveImage: x,
2239
- acceptImage: b,
2240
- acceptFile: R,
2241
- maxImages: E,
2242
- maxImageSize: g,
2243
- leftSlot: A,
2244
- 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: $,
2245
2243
  className: O = "",
2246
- ...D
2244
+ ...I
2247
2245
  }) {
2248
- const v = $(null), M = $(null), z = $(0), [Y, H] = S(!1), [X, U] = S([]), _ = (j) => {
2249
- const T = ++As;
2250
- U((V) => [...V, { id: T, msg: j }]), setTimeout(() => U((V) => V.filter((G) => G.id !== T)), 6e3);
2251
- }, 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) => {
2252
- const T = [], V = [], G = [], J = [];
2253
- let ee = 0, oe = E != null ? E - ((f == null ? void 0 : f.length) ?? 0) : 1 / 0;
2254
- for (const se of j)
2255
- 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);
2256
- return { imageFiles: T, docFiles: V, tooLarge: G, skipped: J, limitExceeded: ee };
2257
- }, c = (j) => {
2258
- const { imageFiles: T, docFiles: V, tooLarge: G, skipped: J, limitExceeded: ee } = w(j);
2259
- 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);
2260
- const oe = V.concat(h ? [] : T);
2261
- p && oe.length && p(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);
2262
2260
  };
2263
- B(() => {
2264
- const j = M.current;
2265
- j && (j.style.height = "auto", j.style.height = `${Math.min(j.scrollHeight, 200)}px`);
2266
- }, [s]), B(() => {
2267
- const j = (T) => {
2268
- 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;
2269
2267
  if (n || o) return;
2270
- const V = (G = T.target) == null ? void 0 : G.tagName;
2271
- 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();
2272
2270
  };
2273
- return document.addEventListener("keydown", j), () => document.removeEventListener("keydown", j);
2271
+ return document.addEventListener("keydown", _), () => document.removeEventListener("keydown", _);
2274
2272
  }, [n, o]);
2275
- const N = (j) => {
2276
- j.preventDefault(), z.current++, j.dataTransfer.types.includes("Files") && H(!0);
2277
- }, P = (j) => {
2278
- j.preventDefault(), z.current--, z.current === 0 && H(!1);
2279
- }, F = (j) => j.preventDefault(), te = (j) => {
2280
- j.preventDefault(), z.current = 0, H(!1);
2281
- 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);
2282
2280
  T.length && c(T);
2283
- }, ae = (j) => {
2284
- const T = Array.from(j.target.files || []);
2285
- v.current && (v.current.value = ""), T.length && c(T);
2286
- }, W = (j) => {
2281
+ }, ie = (_) => {
2282
+ const T = Array.from(_.target.files || []);
2283
+ Y.current && (Y.current.value = ""), T.length && c(T);
2284
+ }, W = (_) => {
2287
2285
  var se;
2288
2286
  if (!h) return;
2289
- const T = (se = j.clipboardData) == null ? void 0 : se.items;
2287
+ const T = (se = _.clipboardData) == null ? void 0 : se.items;
2290
2288
  if (!T) return;
2291
2289
  const V = [];
2292
2290
  for (const Ue of T) {
2293
- const $e = Ue.getAsFile();
2294
- $e && V.push($e);
2291
+ const Te = Ue.getAsFile();
2292
+ Te && V.push(Te);
2295
2293
  }
2296
2294
  if (V.length === 0) return;
2297
- const { imageFiles: G, tooLarge: J, skipped: ee, limitExceeded: oe } = w(V);
2298
- 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));
2299
- }, Q = !n && !o && !!(m != null && m.length) && s.length === 0, ie = Ss({
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({
2300
2298
  prompts: m ?? [],
2301
2299
  enabled: Q
2302
- }), _e = (j) => {
2300
+ }), be = (_) => {
2303
2301
  if (Q) {
2304
- if (j.key === "ArrowDown" || j.key === "ArrowRight") {
2305
- j.preventDefault(), ie.next();
2302
+ if (_.key === "ArrowDown" || _.key === "ArrowRight") {
2303
+ _.preventDefault(), oe.next();
2306
2304
  return;
2307
2305
  }
2308
- if (j.key === "ArrowUp" || j.key === "ArrowLeft") {
2309
- j.preventDefault(), ie.prev();
2306
+ if (_.key === "ArrowUp" || _.key === "ArrowLeft") {
2307
+ _.preventDefault(), oe.prev();
2310
2308
  return;
2311
2309
  }
2312
- if (j.key === "Tab" && !j.shiftKey) {
2313
- j.preventDefault(), t == null || t(ie.currentPrompt);
2310
+ if (_.key === "Tab" && !_.shiftKey) {
2311
+ _.preventDefault(), t == null || t(oe.currentPrompt);
2314
2312
  return;
2315
2313
  }
2316
2314
  }
2317
- a == null || a(j);
2318
- }, Ce = (s.trim() || (f == null ? void 0 : f.length) > 0 || (u == null ? void 0 : u.length) > 0) && !o, Ee = p || h;
2319
- return /* @__PURE__ */ e.jsxs("div", { className: ["ds-prompt-input", O].filter(Boolean).join(" "), ...D, children: [
2320
- 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(
2321
2319
  "input",
2322
2320
  {
2323
- ref: v,
2321
+ ref: Y,
2324
2322
  type: "file",
2325
2323
  multiple: !0,
2326
2324
  accept: "*/*",
2327
2325
  className: "ds-prompt-input__file-input",
2328
- onChange: ae
2326
+ onChange: ie
2329
2327
  }
2330
2328
  ),
2331
2329
  /* @__PURE__ */ e.jsxs(
2332
2330
  "div",
2333
2331
  {
2334
- className: ["ds-prompt-input__box", Y && "ds-prompt-input__box--dragging"].filter(Boolean).join(" "),
2335
- onDragEnter: N,
2336
- onDragLeave: P,
2332
+ className: ["ds-prompt-input__box", N && "ds-prompt-input__box--dragging"].filter(Boolean).join(" "),
2333
+ onDragEnter: w,
2334
+ onDragLeave: z,
2337
2335
  onDragOver: F,
2338
2336
  onDrop: te,
2339
2337
  children: [
2340
- 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" }),
2341
2339
  /* @__PURE__ */ e.jsx(
2342
2340
  "textarea",
2343
2341
  {
2344
- ref: M,
2342
+ ref: q,
2345
2343
  value: s,
2346
- onChange: (j) => t == null ? void 0 : t(j.target.value),
2347
- onKeyDown: _e,
2344
+ onChange: (_) => t == null ? void 0 : t(_.target.value),
2345
+ onKeyDown: be,
2348
2346
  onPaste: W,
2349
2347
  placeholder: Q ? "" : l,
2350
2348
  disabled: n || o,
@@ -2353,80 +2351,80 @@ function It({
2353
2351
  }
2354
2352
  ),
2355
2353
  Q && /* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__anim", "aria-hidden": "true", children: [
2356
- /* @__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 }),
2357
2355
  /* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__anim-cursor" })
2358
2356
  ] }),
2359
- 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: [
2360
- /* @__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: "" }),
2361
2359
  /* @__PURE__ */ e.jsx(
2362
2360
  "button",
2363
2361
  {
2364
2362
  className: "ds-prompt-input__image-remove",
2365
- onClick: () => x == null ? void 0 : x(T),
2363
+ onClick: () => b == null ? void 0 : b(T),
2366
2364
  "aria-label": "Remove image",
2367
2365
  type: "button",
2368
2366
  children: /* @__PURE__ */ e.jsx(ne, { size: 12, strokeWidth: 2 })
2369
2367
  }
2370
2368
  )
2371
2369
  ] }, T)) }),
2372
- 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: [
2373
- /* @__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 }),
2374
2372
  /* @__PURE__ */ e.jsx(
2375
2373
  "button",
2376
2374
  {
2377
2375
  type: "button",
2378
2376
  className: "ds-prompt-input__warning-close",
2379
- onClick: () => y(j.id),
2377
+ onClick: () => v(_.id),
2380
2378
  "aria-label": "Dismiss",
2381
- children: /* @__PURE__ */ e.jsx(ne, { size: I[1], strokeWidth: 1.5 })
2379
+ children: /* @__PURE__ */ e.jsx(ne, { size: D[1], strokeWidth: 1.5 })
2382
2380
  }
2383
2381
  )
2384
- ] }, j.id)) }),
2385
- 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: [
2386
- j.uploading ? /* @__PURE__ */ e.jsx(Qe, { size: I[1], strokeWidth: 1.5, className: "spin" }) : /* @__PURE__ */ e.jsx(Te, { size: I[1], strokeWidth: 1.5 }),
2387
- j.filename,
2388
- 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(
2389
2387
  "button",
2390
2388
  {
2391
2389
  type: "button",
2392
2390
  className: "ds-prompt-input__remove-btn",
2393
- onClick: () => d == null ? void 0 : d(T),
2394
- 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 })
2395
2393
  }
2396
2394
  )
2397
2395
  ] }) }, T)) }),
2398
2396
  /* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__toolbar", children: [
2399
- Ee && /* @__PURE__ */ e.jsx(
2400
- fe,
2397
+ $e && /* @__PURE__ */ e.jsx(
2398
+ me,
2401
2399
  {
2402
2400
  variant: "ghost",
2403
2401
  size: "xs",
2404
- icon: /* @__PURE__ */ e.jsx(Te, { size: I[2], strokeWidth: 1.5 }),
2402
+ icon: /* @__PURE__ */ e.jsx(Re, { size: D[2], strokeWidth: 1.5 }),
2405
2403
  "aria-label": "Attach files",
2406
2404
  onClick: () => {
2407
- var j;
2408
- return (j = v.current) == null ? void 0 : j.click();
2405
+ var _;
2406
+ return (_ = Y.current) == null ? void 0 : _.click();
2409
2407
  }
2410
2408
  }
2411
2409
  ),
2412
- A,
2413
- k,
2410
+ y,
2411
+ $,
2414
2412
  /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__spacer" }),
2415
2413
  n ? /* @__PURE__ */ e.jsx(
2416
- fe,
2414
+ me,
2417
2415
  {
2418
2416
  variant: "primary",
2419
2417
  size: "xs",
2420
- icon: /* @__PURE__ */ e.jsx(es, { size: I[2], strokeWidth: 1.5 }),
2418
+ icon: /* @__PURE__ */ e.jsx(es, { size: D[2], strokeWidth: 1.5 }),
2421
2419
  onClick: i,
2422
2420
  "aria-label": "Stop"
2423
2421
  }
2424
2422
  ) : /* @__PURE__ */ e.jsx(
2425
- fe,
2423
+ me,
2426
2424
  {
2427
2425
  variant: "primary",
2428
2426
  size: "xs",
2429
- icon: /* @__PURE__ */ e.jsx(ss, { size: I[2], strokeWidth: 1.5 }),
2427
+ icon: /* @__PURE__ */ e.jsx(ss, { size: D[2], strokeWidth: 1.5 }),
2430
2428
  onClick: r,
2431
2429
  disabled: !Ce,
2432
2430
  "aria-label": "Send"
@@ -2438,8 +2436,8 @@ function It({
2438
2436
  )
2439
2437
  ] });
2440
2438
  }
2441
- const Pe = { fast: 0, standard: 1, premium: 2 };
2442
- function Dt({
2439
+ const Pe = { fast: 0, standard: 1, premium: 2 }, Le = { fast: "data-5", standard: "data-3", premium: "data-6" };
2440
+ function Ot({
2443
2441
  models: s = [],
2444
2442
  value: t,
2445
2443
  onChange: r,
@@ -2450,52 +2448,57 @@ function Dt({
2450
2448
  className: l = "",
2451
2449
  ...m
2452
2450
  }) {
2453
- const [u, f] = S(!1), p = $(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);
2454
- B(() => {
2455
- var Y;
2456
- if (!u) return;
2457
- const v = (Y = p.current) == null ? void 0 : Y.getBoundingClientRect();
2458
- v && x({
2459
- position: "fixed",
2460
- zIndex: "var(--z-dropdown, 500)",
2461
- top: v.bottom + 4,
2462
- right: window.innerWidth - v.right
2463
- });
2464
- const M = (H) => {
2465
- var X, U;
2466
- !((X = p.current) != null && X.contains(H.target)) && !((U = h.current) != null && U.contains(H.target)) && f(!1);
2467
- }, z = (H) => {
2468
- 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
+ left: x.left,
2463
+ ...k ? { bottom: window.innerHeight - x.top + 4, top: "auto" } : { top: x.bottom + 4, bottom: "auto" }
2464
+ });
2469
2465
  };
2470
- return document.addEventListener("mousedown", M), document.addEventListener("keydown", z), () => {
2471
- 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);
2472
2472
  };
2473
- }, [u]);
2474
- const A = (v) => {
2475
- r == null || r(v), f(!1);
2476
- }, 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(
2477
2480
  "button",
2478
2481
  {
2479
2482
  type: "button",
2480
2483
  className: [
2481
2484
  "ds-model-picker__item",
2482
- v.name === t && "ds-model-picker__item--active"
2485
+ N.name === t && "ds-model-picker__item--active"
2483
2486
  ].filter(Boolean).join(" "),
2484
- onClick: () => A(v.name),
2487
+ onClick: () => I(N.name),
2485
2488
  children: [
2486
- 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" }),
2487
- /* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-name", children: v.displayName || v.name }),
2488
- 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 })
2489
2492
  ]
2490
2493
  },
2491
- v.name
2492
- ), O = () => o ? ["fast", "standard", "premium"].flatMap((v) => {
2493
- const M = E.filter((z) => z.tier === v);
2494
- return M.length ? [
2495
- /* @__PURE__ */ e.jsx("div", { className: "ds-model-picker__group-label", "data-tier": v, children: v.charAt(0).toUpperCase() + v.slice(1) }, `lbl-${v}`),
2496
- ...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)
2497
2500
  ] : [];
2498
- }) : 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: [
2499
2502
  n && R && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2500
2503
  /* @__PURE__ */ e.jsxs(
2501
2504
  "button",
@@ -2506,16 +2509,16 @@ function Dt({
2506
2509
  "ds-model-picker__item--auto",
2507
2510
  t === "auto" && "ds-model-picker__item--active"
2508
2511
  ].filter(Boolean).join(" "),
2509
- onClick: () => A("auto"),
2512
+ onClick: () => I("auto"),
2510
2513
  children: [
2511
2514
  /* @__PURE__ */ e.jsx(ts, { size: 12, strokeWidth: 1.5, className: "ds-model-picker__item-icon" }),
2512
2515
  /* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-name", children: "Auto (smart routing)" })
2513
2516
  ]
2514
2517
  }
2515
2518
  ),
2516
- 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" })
2517
2520
  ] }),
2518
- O()
2521
+ q()
2519
2522
  ] });
2520
2523
  return /* @__PURE__ */ e.jsxs(
2521
2524
  "div",
@@ -2527,52 +2530,57 @@ function Dt({
2527
2530
  /* @__PURE__ */ e.jsxs(
2528
2531
  "button",
2529
2532
  {
2533
+ ref: h,
2530
2534
  type: "button",
2531
2535
  className: "ds-model-picker__trigger",
2532
- onClick: () => f((v) => !v),
2536
+ onClick: () => f((N) => !N),
2533
2537
  "aria-haspopup": "listbox",
2534
- "aria-expanded": u,
2538
+ "aria-expanded": d,
2535
2539
  children: [
2536
- g != null && g.icon ? /* @__PURE__ */ e.jsx("span", { children: g.icon }) : /* @__PURE__ */ e.jsx(Re, { size: 12, strokeWidth: 1.5 }),
2537
- /* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__trigger-name", children: (g == null ? void 0 : g.displayName) || (g == null ? void 0 : g.name) || t }),
2538
- (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 })
2539
2543
  ]
2540
2544
  }
2541
2545
  ),
2542
- typeof document < "u" && me.createPortal(D, document.body)
2546
+ typeof document < "u" && pe.createPortal(P, document.body)
2543
2547
  ]
2544
2548
  }
2545
2549
  );
2546
2550
  }
2547
- 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) {
2548
2556
  return s != null && s.length ? "p. " + s.join(", ") : null;
2549
2557
  }
2550
- function Is(s) {
2558
+ function Ms(s) {
2551
2559
  const t = /* @__PURE__ */ new Map();
2552
2560
  for (const r of s)
2553
2561
  t.has(r.filename) || t.set(r.filename, { filename: r.filename, url: r.url, items: [] }), t.get(r.filename).items.push(r);
2554
2562
  return [...t.values()];
2555
2563
  }
2556
- function Bt({
2564
+ function Ft({
2557
2565
  sources: s = [],
2558
2566
  layout: t = "list",
2559
2567
  title: r = "Sources",
2560
2568
  maxVisible: i = 5,
2561
2569
  onSourceClick: a
2562
2570
  }) {
2563
- const [n, o] = S(!1), l = Is(s), m = l.length > i, u = 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(" ");
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(" ");
2564
2572
  return t === "compact" ? /* @__PURE__ */ e.jsxs("div", { className: p, children: [
2565
- u.map((h) => {
2566
- const d = h.items.map((b) => b.page).filter(Boolean), x = !!a;
2573
+ d.map((h) => {
2574
+ const u = h.items.map((j) => j.page).filter(Boolean), b = !!a;
2567
2575
  return /* @__PURE__ */ e.jsxs(
2568
2576
  "div",
2569
2577
  {
2570
- className: `ds-sources-panel__compact-row${x ? " ds-sources-panel__compact-row--clickable" : ""}`,
2571
- 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,
2572
2580
  children: [
2573
- /* @__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" }),
2574
2582
  /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children: h.filename }),
2575
- 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) })
2576
2584
  ]
2577
2585
  },
2578
2586
  h.filename
@@ -2585,35 +2593,32 @@ function Bt({
2585
2593
  ] })
2586
2594
  ] }) : /* @__PURE__ */ e.jsxs("div", { className: p, children: [
2587
2595
  r && /* @__PURE__ */ e.jsx("div", { className: "ds-sources-panel__title", children: r }),
2588
- u.map((h) => {
2589
- 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;
2590
2598
  return f ? /* @__PURE__ */ e.jsx(
2591
- Fe,
2599
+ Ee,
2592
2600
  {
2593
- title: /* @__PURE__ */ e.jsxs("span", { style: { display: "flex", alignItems: "center", gap: "var(--space-2)", minWidth: 0 }, children: [
2594
- /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children: h.filename }),
2595
- d.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children: je(d) })
2596
- ] }),
2601
+ title: /* @__PURE__ */ e.jsx(Bs, { filename: h.filename, pages: u }),
2597
2602
  padding: "s",
2598
- children: h.items.map((b, R) => /* @__PURE__ */ e.jsx(
2603
+ children: h.items.map((j, S) => /* @__PURE__ */ e.jsx(
2599
2604
  "div",
2600
2605
  {
2601
- className: `ds-sources-panel__snippet${x ? " ds-sources-panel__snippet--clickable" : ""}`,
2602
- onClick: x ? () => a(b) : void 0,
2603
- 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}`
2604
2609
  },
2605
- R
2610
+ S
2606
2611
  ))
2607
2612
  },
2608
2613
  h.filename
2609
2614
  ) : /* @__PURE__ */ e.jsxs(
2610
2615
  "div",
2611
2616
  {
2612
- className: `ds-sources-panel__row${x ? " ds-sources-panel__row--clickable" : ""}`,
2613
- 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,
2614
2619
  children: [
2615
2620
  /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children: h.filename }),
2616
- 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) })
2617
2622
  ]
2618
2623
  },
2619
2624
  h.filename
@@ -2626,10 +2631,10 @@ function Bt({
2626
2631
  ] })
2627
2632
  ] });
2628
2633
  }
2629
- function Me(s) {
2634
+ function ze(s) {
2630
2635
  return s >= 1e6 ? (s / 1e6).toFixed(1).replace(/\.0$/, "") + "M" : s >= 1e3 ? (s / 1e3).toFixed(1).replace(/\.0$/, "") + "K" : String(s);
2631
2636
  }
2632
- function Pt({
2637
+ function Wt({
2633
2638
  used: s,
2634
2639
  limit: t,
2635
2640
  size: r = "s",
@@ -2638,7 +2643,7 @@ function Pt({
2638
2643
  warningThreshold: n = 0.8,
2639
2644
  errorThreshold: o = 1
2640
2645
  }) {
2641
- const l = t > 0 ? s / t : 0, m = 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";
2642
2647
  return /* @__PURE__ */ e.jsxs(
2643
2648
  "div",
2644
2649
  {
@@ -2650,15 +2655,15 @@ function Pt({
2650
2655
  /* @__PURE__ */ e.jsx("div", { className: "ds-token-counter__track", children: /* @__PURE__ */ e.jsx(
2651
2656
  "div",
2652
2657
  {
2653
- className: `ds-token-counter__fill ds-token-counter__fill--${u}`,
2658
+ className: `ds-token-counter__fill ds-token-counter__fill--${d}`,
2654
2659
  style: { width: `${m}%` }
2655
2660
  }
2656
2661
  ) }),
2657
- (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: [
2658
2663
  i && /* @__PURE__ */ e.jsxs("span", { children: [
2659
- Me(s),
2664
+ ze(s),
2660
2665
  " / ",
2661
- Me(t),
2666
+ ze(t),
2662
2667
  " tokens"
2663
2668
  ] }),
2664
2669
  a && /* @__PURE__ */ e.jsxs("span", { children: [
@@ -2670,24 +2675,24 @@ function Pt({
2670
2675
  }
2671
2676
  );
2672
2677
  }
2673
- const Le = 5;
2674
- function Ds(s) {
2678
+ const Oe = 5;
2679
+ function Ps(s) {
2675
2680
  return s < 0.34 ? "low" : s < 0.67 ? "medium" : "high";
2676
2681
  }
2677
- function Mt({
2682
+ function Ct({
2678
2683
  value: s = 0,
2679
2684
  size: t = "xs",
2680
2685
  showLabel: r = "none",
2681
2686
  layout: i = "inline"
2682
2687
  }) {
2683
- 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);
2684
2689
  return /* @__PURE__ */ e.jsxs("div", { className: [
2685
2690
  "ds-confidence-bar",
2686
2691
  `ds-confidence-bar--${t}`,
2687
2692
  `ds-confidence-bar--${o}`,
2688
2693
  i === "block" && "ds-confidence-bar--block"
2689
2694
  ].filter(Boolean).join(" "), children: [
2690
- /* @__PURE__ */ e.jsx("div", { className: "ds-confidence-bar__segments", "aria-hidden": "true", children: Array.from({ length: Le }, (l, m) => /* @__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(
2691
2696
  "div",
2692
2697
  {
2693
2698
  className: `ds-confidence-bar__seg${m < n ? " ds-confidence-bar__seg--filled" : ""}`
@@ -2697,15 +2702,15 @@ function Mt({
2697
2702
  r === "text" && /* @__PURE__ */ e.jsx("span", { className: "ds-confidence-bar__label", children: o })
2698
2703
  ] });
2699
2704
  }
2700
- const Bs = { add: "+", remove: "-", context: " " };
2701
- function be({ line: s, lineNumbers: t }) {
2705
+ const Ls = { add: "+", remove: "-", context: " " };
2706
+ function _e({ line: s, lineNumbers: t }) {
2702
2707
  return /* @__PURE__ */ e.jsxs("div", { className: `ds-diff-view__line ds-diff-view__line--${s.type}`, children: [
2703
2708
  t && s.lineNo != null && /* @__PURE__ */ e.jsx("span", { className: "ds-diff-view__lineno", children: s.lineNo }),
2704
- /* @__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] }),
2705
2710
  /* @__PURE__ */ e.jsx("span", { className: "ds-diff-view__text", children: s.text })
2706
2711
  ] });
2707
2712
  }
2708
- function Lt({
2713
+ function Ut({
2709
2714
  lines: s = [],
2710
2715
  layout: t = "inline",
2711
2716
  wordWrap: r = !1,
@@ -2719,88 +2724,216 @@ function Lt({
2719
2724
  r && "ds-diff-view--wrap"
2720
2725
  ].filter(Boolean).join(" "), l = a ? { maxHeight: a, overflowY: "auto" } : void 0;
2721
2726
  if (t === "split") {
2722
- const m = 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");
2723
2728
  return /* @__PURE__ */ e.jsxs("div", { className: o, children: [
2724
2729
  n && /* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__title", children: n }),
2725
2730
  /* @__PURE__ */ e.jsxs("div", { className: "ds-diff-view__body", style: l, children: [
2726
- /* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col", children: m.map((f, p) => /* @__PURE__ */ e.jsx(be, { line: f, lineNumbers: i }, p)) }),
2727
- /* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col", children: u.map((f, p) => /* @__PURE__ */ e.jsx(be, { line: f, lineNumbers: i }, p)) })
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)) })
2728
2733
  ] })
2729
2734
  ] });
2730
2735
  }
2731
2736
  return /* @__PURE__ */ e.jsxs("div", { className: o, children: [
2732
2737
  n && /* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__title", children: n }),
2733
- /* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__body", style: l, children: s.map((m, u) => /* @__PURE__ */ e.jsx(be, { line: m, 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)) })
2734
2739
  ] });
2735
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 ds-message-action", children: f }),
2859
+ m && /* @__PURE__ */ e.jsx(Os, { className: "ds-message-action", value: i, onLike: a, onDislike: n }),
2860
+ d && /* @__PURE__ */ e.jsx(As, { className: "ds-message-action", text: t }),
2861
+ s === "assistant" && f && /* @__PURE__ */ e.jsx("span", { className: "ds-message-footer__timestamp ds-message-action", children: f })
2862
+ ]
2863
+ }
2864
+ );
2865
+ }
2736
2866
  export {
2737
- Fe as Accordion,
2738
- Hs as Alert,
2739
- Nt as AnimatedNumber,
2740
- nt as Avatar,
2741
- pe as Badge,
2742
- jt as Banner,
2743
- ht as Breadcrumb,
2744
- fe as Button,
2745
- ls as Card,
2746
- St as ChatMessage,
2747
- tt as Checkbox,
2748
- Gs as Code,
2749
- fs as CodeAccordion,
2750
- Mt as ConfidenceBar,
2751
- Et as CopyButton,
2752
- Lt as DiffView,
2753
- _t as Drawer,
2754
- De as DrawerFooter,
2755
- bt as Dropdown,
2756
- ft as EmptyState,
2757
- mt as FormField,
2758
- Cs as H1,
2759
- Us as H2,
2760
- Vs as H3,
2761
- Ys as H4,
2762
- wt as InView,
2763
- Os as Input,
2764
- Xs as Link,
2765
- 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,
2766
2898
  Ie as ModalFooter,
2767
- Dt as ModelPicker,
2768
- qs as P1,
2769
- cs as P2,
2770
- ze as P3,
2771
- xt as Pagination,
2772
- vt as ProgressBar,
2773
- It as PromptInput,
2774
- rt as Radio,
2775
- $t as ReasoningBlock,
2776
- Qs as SegmentedControl,
2777
- Fs as Select,
2778
- hs as Skeleton,
2779
- Bt as SourcesPanel,
2780
- is as Spinner,
2781
- pt as Stat,
2782
- Tt as StepIndicator,
2783
- Ws as Stepper,
2784
- Rt as StreamingText,
2785
- Zs as Tab,
2786
- at as Table,
2787
- ot as TableBody,
2788
- it as TableHead,
2789
- lt as TableRow,
2790
- ct as TableSubheaderRow,
2791
- Js as Tabs,
2792
- ut as Td,
2793
- zs as Textarea,
2794
- dt as Th,
2795
- gt as ToastContainer,
2796
- st as Toggle,
2797
- Pt as TokenCounter,
2798
- kt as ToolCallCard,
2799
- et as Tooltip,
2800
- I as iconSizes,
2801
- gs as useAnimatedNumber,
2802
- Ss as useAnimatedPlaceholder,
2803
- ks as useInView,
2804
- At as useStreamScroll,
2805
- 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
2806
2939
  };