@alfadocs/ui-kit 0.14.1 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/_chunks/carousel.agent-2dXpQoqp.js +1661 -0
  2. package/dist/_chunks/{header-D0ULgQl3.js → header-DqmKROIY.js} +42 -52
  3. package/dist/_chunks/{map-view-Dd48BxVB.js → map-view-DVP-Kp9l.js} +445 -444
  4. package/dist/_chunks/menu-XRhW3_99.js +16 -0
  5. package/dist/_chunks/{patient-shell-CL20JnVJ.js → patient-shell-BE0CdPOJ.js} +2 -2
  6. package/dist/_chunks/public-header.agent-AzJSINlU.js +237 -0
  7. package/dist/_chunks/stat-DEkZx0Mx.js +318 -0
  8. package/dist/_chunks/use-count-up-BLLetaZ8.js +109 -0
  9. package/dist/agent-catalog.json +92 -1
  10. package/dist/components/carousel/carousel.agent.d.ts +4 -0
  11. package/dist/components/carousel/carousel.d.ts +45 -0
  12. package/dist/components/carousel/index.d.ts +3 -0
  13. package/dist/components/carousel/index.js +6 -0
  14. package/dist/components/header/index.js +1 -1
  15. package/dist/components/index.d.ts +2 -0
  16. package/dist/components/map-view/index.js +1 -1
  17. package/dist/components/map-view/map-view.d.ts +8 -0
  18. package/dist/components/public-header/index.d.ts +3 -0
  19. package/dist/components/public-header/index.js +6 -0
  20. package/dist/components/public-header/public-header.agent.d.ts +4 -0
  21. package/dist/components/public-header/public-header.d.ts +43 -0
  22. package/dist/components/stat/index.js +1 -1
  23. package/dist/components/stat/stat.d.ts +31 -0
  24. package/dist/hooks/index.d.ts +2 -0
  25. package/dist/hooks/index.js +10 -8
  26. package/dist/hooks/use-count-up.d.ts +88 -0
  27. package/dist/i18n/config.js +51 -0
  28. package/dist/i18n/resources.d.ts +51 -0
  29. package/dist/index.js +367 -361
  30. package/dist/locales/de.json +17 -0
  31. package/dist/locales/en.json +17 -0
  32. package/dist/locales/it.json +17 -0
  33. package/dist/patterns/patient-shell/index.js +1 -1
  34. package/dist/tokens.css +1 -1
  35. package/package.json +10 -1
  36. package/dist/_chunks/stat-CDQ_a0vk.js +0 -228
@@ -0,0 +1,1661 @@
1
+ import { jsx as V, jsxs as De } from "react/jsx-runtime";
2
+ import { useRef as Pe, useState as ne, useCallback as le, useEffect as de, forwardRef as xe, useId as xt, useMemo as Qe, useImperativeHandle as yt, Children as et, isValidElement as tt, createContext as It, useContext as Ct } from "react";
3
+ import { c as nt } from "./index-D2ZczOXr.js";
4
+ import { useTranslation as ye } from "react-i18next";
5
+ import { I as Je } from "./icon-button-C4CGcYuz.js";
6
+ import { C as Lt } from "./chevron-left-CX1jqD2M.js";
7
+ import { C as wt } from "./chevron-right-BrpYejk0.js";
8
+ function Et(e) {
9
+ return Object.prototype.toString.call(e) === "[object Object]";
10
+ }
11
+ function Xe(e) {
12
+ return Et(e) || Array.isArray(e);
13
+ }
14
+ function Tt() {
15
+ return !!(typeof window < "u" && window.document && window.document.createElement);
16
+ }
17
+ function Me(e, t) {
18
+ const n = Object.keys(e), r = Object.keys(t);
19
+ if (n.length !== r.length) return !1;
20
+ const i = JSON.stringify(Object.keys(e.breakpoints || {})), s = JSON.stringify(Object.keys(t.breakpoints || {}));
21
+ return i !== s ? !1 : n.every((o) => {
22
+ const u = e[o], c = t[o];
23
+ return typeof u == "function" ? `${u}` == `${c}` : !Xe(u) || !Xe(c) ? u === c : Me(u, c);
24
+ });
25
+ }
26
+ function Ye(e) {
27
+ return e.concat().sort((t, n) => t.name > n.name ? 1 : -1).map((t) => t.options);
28
+ }
29
+ function Dt(e, t) {
30
+ if (e.length !== t.length) return !1;
31
+ const n = Ye(e), r = Ye(t);
32
+ return n.every((i, s) => {
33
+ const o = r[s];
34
+ return Me(i, o);
35
+ });
36
+ }
37
+ function ke(e) {
38
+ return typeof e == "number";
39
+ }
40
+ function Ae(e) {
41
+ return typeof e == "string";
42
+ }
43
+ function Ie(e) {
44
+ return typeof e == "boolean";
45
+ }
46
+ function Ze(e) {
47
+ return Object.prototype.toString.call(e) === "[object Object]";
48
+ }
49
+ function N(e) {
50
+ return Math.abs(e);
51
+ }
52
+ function Oe(e) {
53
+ return Math.sign(e);
54
+ }
55
+ function pe(e, t) {
56
+ return N(e - t);
57
+ }
58
+ function Pt(e, t) {
59
+ if (e === 0 || t === 0 || N(e) <= N(t)) return 0;
60
+ const n = pe(N(e), N(t));
61
+ return N(n / e);
62
+ }
63
+ function At(e) {
64
+ return Math.round(e * 100) / 100;
65
+ }
66
+ function me(e) {
67
+ return ge(e).map(Number);
68
+ }
69
+ function J(e) {
70
+ return e[be(e)];
71
+ }
72
+ function be(e) {
73
+ return Math.max(0, e.length - 1);
74
+ }
75
+ function Fe(e, t) {
76
+ return t === be(e);
77
+ }
78
+ function We(e, t = 0) {
79
+ return Array.from(Array(e), (n, r) => t + r);
80
+ }
81
+ function ge(e) {
82
+ return Object.keys(e);
83
+ }
84
+ function ot(e, t) {
85
+ return [e, t].reduce((n, r) => (ge(r).forEach((i) => {
86
+ const s = n[i], o = r[i], u = Ze(s) && Ze(o);
87
+ n[i] = u ? ot(s, o) : o;
88
+ }), n), {});
89
+ }
90
+ function Ne(e, t) {
91
+ return typeof t.MouseEvent < "u" && e instanceof t.MouseEvent;
92
+ }
93
+ function Nt(e, t) {
94
+ const n = {
95
+ start: r,
96
+ center: i,
97
+ end: s
98
+ };
99
+ function r() {
100
+ return 0;
101
+ }
102
+ function i(c) {
103
+ return s(c) / 2;
104
+ }
105
+ function s(c) {
106
+ return t - c;
107
+ }
108
+ function o(c, l) {
109
+ return Ae(e) ? n[e](c) : e(t, c, l);
110
+ }
111
+ return {
112
+ measure: o
113
+ };
114
+ }
115
+ function he() {
116
+ let e = [];
117
+ function t(i, s, o, u = {
118
+ passive: !0
119
+ }) {
120
+ let c;
121
+ if ("addEventListener" in i)
122
+ i.addEventListener(s, o, u), c = () => i.removeEventListener(s, o, u);
123
+ else {
124
+ const l = i;
125
+ l.addListener(o), c = () => l.removeListener(o);
126
+ }
127
+ return e.push(c), r;
128
+ }
129
+ function n() {
130
+ e = e.filter((i) => i());
131
+ }
132
+ const r = {
133
+ add: t,
134
+ clear: n
135
+ };
136
+ return r;
137
+ }
138
+ function Mt(e, t, n, r) {
139
+ const i = he(), s = 1e3 / 60;
140
+ let o = null, u = 0, c = 0;
141
+ function l() {
142
+ i.add(e, "visibilitychange", () => {
143
+ e.hidden && d();
144
+ });
145
+ }
146
+ function b() {
147
+ v(), i.clear();
148
+ }
149
+ function p(h) {
150
+ if (!c) return;
151
+ o || (o = h, n(), n());
152
+ const f = h - o;
153
+ for (o = h, u += f; u >= s; )
154
+ n(), u -= s;
155
+ const a = u / s;
156
+ r(a), c && (c = t.requestAnimationFrame(p));
157
+ }
158
+ function m() {
159
+ c || (c = t.requestAnimationFrame(p));
160
+ }
161
+ function v() {
162
+ t.cancelAnimationFrame(c), o = null, u = 0, c = 0;
163
+ }
164
+ function d() {
165
+ o = null, u = 0;
166
+ }
167
+ return {
168
+ init: l,
169
+ destroy: b,
170
+ start: m,
171
+ stop: v,
172
+ update: n,
173
+ render: r
174
+ };
175
+ }
176
+ function kt(e, t) {
177
+ const n = t === "rtl", r = e === "y", i = r ? "y" : "x", s = r ? "x" : "y", o = !r && n ? -1 : 1, u = b(), c = p();
178
+ function l(d) {
179
+ const {
180
+ height: g,
181
+ width: h
182
+ } = d;
183
+ return r ? g : h;
184
+ }
185
+ function b() {
186
+ return r ? "top" : n ? "right" : "left";
187
+ }
188
+ function p() {
189
+ return r ? "bottom" : n ? "left" : "right";
190
+ }
191
+ function m(d) {
192
+ return d * o;
193
+ }
194
+ return {
195
+ scroll: i,
196
+ cross: s,
197
+ startEdge: u,
198
+ endEdge: c,
199
+ measureSize: l,
200
+ direction: m
201
+ };
202
+ }
203
+ function ce(e = 0, t = 0) {
204
+ const n = N(e - t);
205
+ function r(l) {
206
+ return l < e;
207
+ }
208
+ function i(l) {
209
+ return l > t;
210
+ }
211
+ function s(l) {
212
+ return r(l) || i(l);
213
+ }
214
+ function o(l) {
215
+ return s(l) ? r(l) ? e : t : l;
216
+ }
217
+ function u(l) {
218
+ return n ? l - n * Math.ceil((l - t) / n) : l;
219
+ }
220
+ return {
221
+ length: n,
222
+ max: t,
223
+ min: e,
224
+ constrain: o,
225
+ reachedAny: s,
226
+ reachedMax: i,
227
+ reachedMin: r,
228
+ removeOffset: u
229
+ };
230
+ }
231
+ function rt(e, t, n) {
232
+ const {
233
+ constrain: r
234
+ } = ce(0, e), i = e + 1;
235
+ let s = o(t);
236
+ function o(m) {
237
+ return n ? N((i + m) % i) : r(m);
238
+ }
239
+ function u() {
240
+ return s;
241
+ }
242
+ function c(m) {
243
+ return s = o(m), p;
244
+ }
245
+ function l(m) {
246
+ return b().set(u() + m);
247
+ }
248
+ function b() {
249
+ return rt(e, u(), n);
250
+ }
251
+ const p = {
252
+ get: u,
253
+ set: c,
254
+ add: l,
255
+ clone: b
256
+ };
257
+ return p;
258
+ }
259
+ function Ot(e, t, n, r, i, s, o, u, c, l, b, p, m, v, d, g, h, f, a) {
260
+ const {
261
+ cross: S,
262
+ direction: C
263
+ } = e, L = ["INPUT", "SELECT", "TEXTAREA"], w = {
264
+ passive: !1
265
+ }, y = he(), I = he(), E = ce(50, 225).constrain(v.measure(20)), P = {
266
+ mouse: 300,
267
+ touch: 400
268
+ }, T = {
269
+ mouse: 500,
270
+ touch: 600
271
+ }, j = d ? 43 : 25;
272
+ let M = !1, B = 0, R = 0, q = !1, X = !1, _ = !1, K = !1;
273
+ function oe(x) {
274
+ if (!a) return;
275
+ function D(G) {
276
+ (Ie(a) || a(x, G)) && k(G);
277
+ }
278
+ const z = t;
279
+ y.add(z, "dragstart", (G) => G.preventDefault(), w).add(z, "touchmove", () => {
280
+ }, w).add(z, "touchend", () => {
281
+ }).add(z, "touchstart", D).add(z, "mousedown", D).add(z, "touchcancel", F).add(z, "contextmenu", F).add(z, "click", $, !0);
282
+ }
283
+ function U() {
284
+ y.clear(), I.clear();
285
+ }
286
+ function W() {
287
+ const x = K ? n : t;
288
+ I.add(x, "touchmove", O, w).add(x, "touchend", F).add(x, "mousemove", O, w).add(x, "mouseup", F);
289
+ }
290
+ function ee(x) {
291
+ const D = x.nodeName || "";
292
+ return L.includes(D);
293
+ }
294
+ function Q() {
295
+ return (d ? T : P)[K ? "mouse" : "touch"];
296
+ }
297
+ function re(x, D) {
298
+ const z = p.add(Oe(x) * -1), G = b.byDistance(x, !d).distance;
299
+ return d || N(x) < E ? G : h && D ? G * 0.5 : b.byIndex(z.get(), 0).distance;
300
+ }
301
+ function k(x) {
302
+ const D = Ne(x, r);
303
+ K = D, _ = d && D && !x.buttons && M, M = pe(i.get(), o.get()) >= 2, !(D && x.button !== 0) && (ee(x.target) || (q = !0, s.pointerDown(x), l.useFriction(0).useDuration(0), i.set(o), W(), B = s.readPoint(x), R = s.readPoint(x, S), m.emit("pointerDown")));
304
+ }
305
+ function O(x) {
306
+ if (!Ne(x, r) && x.touches.length >= 2) return F(x);
307
+ const z = s.readPoint(x), G = s.readPoint(x, S), Y = pe(z, B), Z = pe(G, R);
308
+ if (!X && !K && (!x.cancelable || (X = Y > Z, !X)))
309
+ return F(x);
310
+ const se = s.pointerMove(x);
311
+ Y > g && (_ = !0), l.useFriction(0.3).useDuration(0.75), u.start(), i.add(C(se)), x.preventDefault();
312
+ }
313
+ function F(x) {
314
+ const z = b.byDistance(0, !1).index !== p.get(), G = s.pointerUp(x) * Q(), Y = re(C(G), z), Z = Pt(G, Y), se = j - 10 * Z, te = f + Z / 50;
315
+ X = !1, q = !1, I.clear(), l.useDuration(se).useFriction(te), c.distance(Y, !d), K = !1, m.emit("pointerUp");
316
+ }
317
+ function $(x) {
318
+ _ && (x.stopPropagation(), x.preventDefault(), _ = !1);
319
+ }
320
+ function H() {
321
+ return q;
322
+ }
323
+ return {
324
+ init: oe,
325
+ destroy: U,
326
+ pointerDown: H
327
+ };
328
+ }
329
+ function Ft(e, t) {
330
+ let r, i;
331
+ function s(p) {
332
+ return p.timeStamp;
333
+ }
334
+ function o(p, m) {
335
+ const d = `client${(m || e.scroll) === "x" ? "X" : "Y"}`;
336
+ return (Ne(p, t) ? p : p.touches[0])[d];
337
+ }
338
+ function u(p) {
339
+ return r = p, i = p, o(p);
340
+ }
341
+ function c(p) {
342
+ const m = o(p) - o(i), v = s(p) - s(r) > 170;
343
+ return i = p, v && (r = p), m;
344
+ }
345
+ function l(p) {
346
+ if (!r || !i) return 0;
347
+ const m = o(i) - o(r), v = s(p) - s(r), d = s(p) - s(i) > 170, g = m / v;
348
+ return v && !d && N(g) > 0.1 ? g : 0;
349
+ }
350
+ return {
351
+ pointerDown: u,
352
+ pointerMove: c,
353
+ pointerUp: l,
354
+ readPoint: o
355
+ };
356
+ }
357
+ function zt() {
358
+ function e(n) {
359
+ const {
360
+ offsetTop: r,
361
+ offsetLeft: i,
362
+ offsetWidth: s,
363
+ offsetHeight: o
364
+ } = n;
365
+ return {
366
+ top: r,
367
+ right: i + s,
368
+ bottom: r + o,
369
+ left: i,
370
+ width: s,
371
+ height: o
372
+ };
373
+ }
374
+ return {
375
+ measure: e
376
+ };
377
+ }
378
+ function Vt(e) {
379
+ function t(r) {
380
+ return e * (r / 100);
381
+ }
382
+ return {
383
+ measure: t
384
+ };
385
+ }
386
+ function jt(e, t, n, r, i, s, o) {
387
+ const u = [e].concat(r);
388
+ let c, l, b = [], p = !1;
389
+ function m(h) {
390
+ return i.measureSize(o.measure(h));
391
+ }
392
+ function v(h) {
393
+ if (!s) return;
394
+ l = m(e), b = r.map(m);
395
+ function f(a) {
396
+ for (const S of a) {
397
+ if (p) return;
398
+ const C = S.target === e, L = r.indexOf(S.target), w = C ? l : b[L], y = m(C ? e : r[L]);
399
+ if (N(y - w) >= 0.5) {
400
+ h.reInit(), t.emit("resize");
401
+ break;
402
+ }
403
+ }
404
+ }
405
+ c = new ResizeObserver((a) => {
406
+ (Ie(s) || s(h, a)) && f(a);
407
+ }), n.requestAnimationFrame(() => {
408
+ u.forEach((a) => c.observe(a));
409
+ });
410
+ }
411
+ function d() {
412
+ p = !0, c && c.disconnect();
413
+ }
414
+ return {
415
+ init: v,
416
+ destroy: d
417
+ };
418
+ }
419
+ function Bt(e, t, n, r, i, s) {
420
+ let o = 0, u = 0, c = i, l = s, b = e.get(), p = 0;
421
+ function m() {
422
+ const w = r.get() - e.get(), y = !c;
423
+ let I = 0;
424
+ return y ? (o = 0, n.set(r), e.set(r), I = w) : (n.set(e), o += w / c, o *= l, b += o, e.add(o), I = b - p), u = Oe(I), p = b, L;
425
+ }
426
+ function v() {
427
+ const w = r.get() - t.get();
428
+ return N(w) < 1e-3;
429
+ }
430
+ function d() {
431
+ return c;
432
+ }
433
+ function g() {
434
+ return u;
435
+ }
436
+ function h() {
437
+ return o;
438
+ }
439
+ function f() {
440
+ return S(i);
441
+ }
442
+ function a() {
443
+ return C(s);
444
+ }
445
+ function S(w) {
446
+ return c = w, L;
447
+ }
448
+ function C(w) {
449
+ return l = w, L;
450
+ }
451
+ const L = {
452
+ direction: g,
453
+ duration: d,
454
+ velocity: h,
455
+ seek: m,
456
+ settled: v,
457
+ useBaseFriction: a,
458
+ useBaseDuration: f,
459
+ useFriction: C,
460
+ useDuration: S
461
+ };
462
+ return L;
463
+ }
464
+ function Rt(e, t, n, r, i) {
465
+ const s = i.measure(10), o = i.measure(50), u = ce(0.1, 0.99);
466
+ let c = !1;
467
+ function l() {
468
+ return !(c || !e.reachedAny(n.get()) || !e.reachedAny(t.get()));
469
+ }
470
+ function b(v) {
471
+ if (!l()) return;
472
+ const d = e.reachedMin(t.get()) ? "min" : "max", g = N(e[d] - t.get()), h = n.get() - t.get(), f = u.constrain(g / o);
473
+ n.subtract(h * f), !v && N(h) < s && (n.set(e.constrain(n.get())), r.useDuration(25).useBaseFriction());
474
+ }
475
+ function p(v) {
476
+ c = !v;
477
+ }
478
+ return {
479
+ shouldConstrain: l,
480
+ constrain: b,
481
+ toggleActive: p
482
+ };
483
+ }
484
+ function Ht(e, t, n, r, i) {
485
+ const s = ce(-t + e, 0), o = p(), u = b(), c = m();
486
+ function l(d, g) {
487
+ return pe(d, g) <= 1;
488
+ }
489
+ function b() {
490
+ const d = o[0], g = J(o), h = o.lastIndexOf(d), f = o.indexOf(g) + 1;
491
+ return ce(h, f);
492
+ }
493
+ function p() {
494
+ return n.map((d, g) => {
495
+ const {
496
+ min: h,
497
+ max: f
498
+ } = s, a = s.constrain(d), S = !g, C = Fe(n, g);
499
+ return S ? f : C || l(h, a) ? h : l(f, a) ? f : a;
500
+ }).map((d) => parseFloat(d.toFixed(3)));
501
+ }
502
+ function m() {
503
+ if (t <= e + i) return [s.max];
504
+ if (r === "keepSnaps") return o;
505
+ const {
506
+ min: d,
507
+ max: g
508
+ } = u;
509
+ return o.slice(d, g);
510
+ }
511
+ return {
512
+ snapsContained: c,
513
+ scrollContainLimit: u
514
+ };
515
+ }
516
+ function Gt(e, t, n) {
517
+ const r = t[0], i = n ? r - e : J(t);
518
+ return {
519
+ limit: ce(i, r)
520
+ };
521
+ }
522
+ function Ut(e, t, n, r) {
523
+ const s = t.min + 0.1, o = t.max + 0.1, {
524
+ reachedMin: u,
525
+ reachedMax: c
526
+ } = ce(s, o);
527
+ function l(m) {
528
+ return m === 1 ? c(n.get()) : m === -1 ? u(n.get()) : !1;
529
+ }
530
+ function b(m) {
531
+ if (!l(m)) return;
532
+ const v = e * (m * -1);
533
+ r.forEach((d) => d.add(v));
534
+ }
535
+ return {
536
+ loop: b
537
+ };
538
+ }
539
+ function $t(e) {
540
+ const {
541
+ max: t,
542
+ length: n
543
+ } = e;
544
+ function r(s) {
545
+ const o = s - t;
546
+ return n ? o / -n : 0;
547
+ }
548
+ return {
549
+ get: r
550
+ };
551
+ }
552
+ function qt(e, t, n, r, i) {
553
+ const {
554
+ startEdge: s,
555
+ endEdge: o
556
+ } = e, {
557
+ groupSlides: u
558
+ } = i, c = p().map(t.measure), l = m(), b = v();
559
+ function p() {
560
+ return u(r).map((g) => J(g)[o] - g[0][s]).map(N);
561
+ }
562
+ function m() {
563
+ return r.map((g) => n[s] - g[s]).map((g) => -N(g));
564
+ }
565
+ function v() {
566
+ return u(l).map((g) => g[0]).map((g, h) => g + c[h]);
567
+ }
568
+ return {
569
+ snaps: l,
570
+ snapsAligned: b
571
+ };
572
+ }
573
+ function _t(e, t, n, r, i, s) {
574
+ const {
575
+ groupSlides: o
576
+ } = i, {
577
+ min: u,
578
+ max: c
579
+ } = r, l = b();
580
+ function b() {
581
+ const m = o(s), v = !e || t === "keepSnaps";
582
+ return n.length === 1 ? [s] : v ? m : m.slice(u, c).map((d, g, h) => {
583
+ const f = !g, a = Fe(h, g);
584
+ if (f) {
585
+ const S = J(h[0]) + 1;
586
+ return We(S);
587
+ }
588
+ if (a) {
589
+ const S = be(s) - J(h)[0] + 1;
590
+ return We(S, J(h)[0]);
591
+ }
592
+ return d;
593
+ });
594
+ }
595
+ return {
596
+ slideRegistry: l
597
+ };
598
+ }
599
+ function Kt(e, t, n, r, i) {
600
+ const {
601
+ reachedAny: s,
602
+ removeOffset: o,
603
+ constrain: u
604
+ } = r;
605
+ function c(d) {
606
+ return d.concat().sort((g, h) => N(g) - N(h))[0];
607
+ }
608
+ function l(d) {
609
+ const g = e ? o(d) : u(d), h = t.map((a, S) => ({
610
+ diff: b(a - g, 0),
611
+ index: S
612
+ })).sort((a, S) => N(a.diff) - N(S.diff)), {
613
+ index: f
614
+ } = h[0];
615
+ return {
616
+ index: f,
617
+ distance: g
618
+ };
619
+ }
620
+ function b(d, g) {
621
+ const h = [d, d + n, d - n];
622
+ if (!e) return d;
623
+ if (!g) return c(h);
624
+ const f = h.filter((a) => Oe(a) === g);
625
+ return f.length ? c(f) : J(h) - n;
626
+ }
627
+ function p(d, g) {
628
+ const h = t[d] - i.get(), f = b(h, g);
629
+ return {
630
+ index: d,
631
+ distance: f
632
+ };
633
+ }
634
+ function m(d, g) {
635
+ const h = i.get() + d, {
636
+ index: f,
637
+ distance: a
638
+ } = l(h), S = !e && s(h);
639
+ if (!g || S) return {
640
+ index: f,
641
+ distance: d
642
+ };
643
+ const C = t[f] - a, L = d + b(C, 0);
644
+ return {
645
+ index: f,
646
+ distance: L
647
+ };
648
+ }
649
+ return {
650
+ byDistance: m,
651
+ byIndex: p,
652
+ shortcut: b
653
+ };
654
+ }
655
+ function Qt(e, t, n, r, i, s, o) {
656
+ function u(p) {
657
+ const m = p.distance, v = p.index !== t.get();
658
+ s.add(m), m && (r.duration() ? e.start() : (e.update(), e.render(1), e.update())), v && (n.set(t.get()), t.set(p.index), o.emit("select"));
659
+ }
660
+ function c(p, m) {
661
+ const v = i.byDistance(p, m);
662
+ u(v);
663
+ }
664
+ function l(p, m) {
665
+ const v = t.clone().set(p), d = i.byIndex(v.get(), m);
666
+ u(d);
667
+ }
668
+ return {
669
+ distance: c,
670
+ index: l
671
+ };
672
+ }
673
+ function Jt(e, t, n, r, i, s, o, u) {
674
+ const c = {
675
+ passive: !0,
676
+ capture: !0
677
+ };
678
+ let l = 0;
679
+ function b(v) {
680
+ if (!u) return;
681
+ function d(g) {
682
+ if ((/* @__PURE__ */ new Date()).getTime() - l > 10) return;
683
+ o.emit("slideFocusStart"), e.scrollLeft = 0;
684
+ const a = n.findIndex((S) => S.includes(g));
685
+ ke(a) && (i.useDuration(0), r.index(a, 0), o.emit("slideFocus"));
686
+ }
687
+ s.add(document, "keydown", p, !1), t.forEach((g, h) => {
688
+ s.add(g, "focus", (f) => {
689
+ (Ie(u) || u(v, f)) && d(h);
690
+ }, c);
691
+ });
692
+ }
693
+ function p(v) {
694
+ v.code === "Tab" && (l = (/* @__PURE__ */ new Date()).getTime());
695
+ }
696
+ return {
697
+ init: b
698
+ };
699
+ }
700
+ function fe(e) {
701
+ let t = e;
702
+ function n() {
703
+ return t;
704
+ }
705
+ function r(c) {
706
+ t = o(c);
707
+ }
708
+ function i(c) {
709
+ t += o(c);
710
+ }
711
+ function s(c) {
712
+ t -= o(c);
713
+ }
714
+ function o(c) {
715
+ return ke(c) ? c : c.get();
716
+ }
717
+ return {
718
+ get: n,
719
+ set: r,
720
+ add: i,
721
+ subtract: s
722
+ };
723
+ }
724
+ function st(e, t) {
725
+ const n = e.scroll === "x" ? o : u, r = t.style;
726
+ let i = null, s = !1;
727
+ function o(m) {
728
+ return `translate3d(${m}px,0px,0px)`;
729
+ }
730
+ function u(m) {
731
+ return `translate3d(0px,${m}px,0px)`;
732
+ }
733
+ function c(m) {
734
+ if (s) return;
735
+ const v = At(e.direction(m));
736
+ v !== i && (r.transform = n(v), i = v);
737
+ }
738
+ function l(m) {
739
+ s = !m;
740
+ }
741
+ function b() {
742
+ s || (r.transform = "", t.getAttribute("style") || t.removeAttribute("style"));
743
+ }
744
+ return {
745
+ clear: b,
746
+ to: c,
747
+ toggleActive: l
748
+ };
749
+ }
750
+ function Xt(e, t, n, r, i, s, o, u, c) {
751
+ const b = me(i), p = me(i).reverse(), m = f().concat(a());
752
+ function v(y, I) {
753
+ return y.reduce((E, P) => E - i[P], I);
754
+ }
755
+ function d(y, I) {
756
+ return y.reduce((E, P) => v(E, I) > 0 ? E.concat([P]) : E, []);
757
+ }
758
+ function g(y) {
759
+ return s.map((I, E) => ({
760
+ start: I - r[E] + 0.5 + y,
761
+ end: I + t - 0.5 + y
762
+ }));
763
+ }
764
+ function h(y, I, E) {
765
+ const P = g(I);
766
+ return y.map((T) => {
767
+ const j = E ? 0 : -n, M = E ? n : 0, B = E ? "end" : "start", R = P[T][B];
768
+ return {
769
+ index: T,
770
+ loopPoint: R,
771
+ slideLocation: fe(-1),
772
+ translate: st(e, c[T]),
773
+ target: () => u.get() > R ? j : M
774
+ };
775
+ });
776
+ }
777
+ function f() {
778
+ const y = o[0], I = d(p, y);
779
+ return h(I, n, !1);
780
+ }
781
+ function a() {
782
+ const y = t - o[0] - 1, I = d(b, y);
783
+ return h(I, -n, !0);
784
+ }
785
+ function S() {
786
+ return m.every(({
787
+ index: y
788
+ }) => {
789
+ const I = b.filter((E) => E !== y);
790
+ return v(I, t) <= 0.1;
791
+ });
792
+ }
793
+ function C() {
794
+ m.forEach((y) => {
795
+ const {
796
+ target: I,
797
+ translate: E,
798
+ slideLocation: P
799
+ } = y, T = I();
800
+ T !== P.get() && (E.to(T), P.set(T));
801
+ });
802
+ }
803
+ function L() {
804
+ m.forEach((y) => y.translate.clear());
805
+ }
806
+ return {
807
+ canLoop: S,
808
+ clear: L,
809
+ loop: C,
810
+ loopPoints: m
811
+ };
812
+ }
813
+ function Yt(e, t, n) {
814
+ let r, i = !1;
815
+ function s(c) {
816
+ if (!n) return;
817
+ function l(b) {
818
+ for (const p of b)
819
+ if (p.type === "childList") {
820
+ c.reInit(), t.emit("slidesChanged");
821
+ break;
822
+ }
823
+ }
824
+ r = new MutationObserver((b) => {
825
+ i || (Ie(n) || n(c, b)) && l(b);
826
+ }), r.observe(e, {
827
+ childList: !0
828
+ });
829
+ }
830
+ function o() {
831
+ r && r.disconnect(), i = !0;
832
+ }
833
+ return {
834
+ init: s,
835
+ destroy: o
836
+ };
837
+ }
838
+ function Zt(e, t, n, r) {
839
+ const i = {};
840
+ let s = null, o = null, u, c = !1;
841
+ function l() {
842
+ u = new IntersectionObserver((d) => {
843
+ c || (d.forEach((g) => {
844
+ const h = t.indexOf(g.target);
845
+ i[h] = g;
846
+ }), s = null, o = null, n.emit("slidesInView"));
847
+ }, {
848
+ root: e.parentElement,
849
+ threshold: r
850
+ }), t.forEach((d) => u.observe(d));
851
+ }
852
+ function b() {
853
+ u && u.disconnect(), c = !0;
854
+ }
855
+ function p(d) {
856
+ return ge(i).reduce((g, h) => {
857
+ const f = parseInt(h), {
858
+ isIntersecting: a
859
+ } = i[f];
860
+ return (d && a || !d && !a) && g.push(f), g;
861
+ }, []);
862
+ }
863
+ function m(d = !0) {
864
+ if (d && s) return s;
865
+ if (!d && o) return o;
866
+ const g = p(d);
867
+ return d && (s = g), d || (o = g), g;
868
+ }
869
+ return {
870
+ init: l,
871
+ destroy: b,
872
+ get: m
873
+ };
874
+ }
875
+ function Wt(e, t, n, r, i, s) {
876
+ const {
877
+ measureSize: o,
878
+ startEdge: u,
879
+ endEdge: c
880
+ } = e, l = n[0] && i, b = d(), p = g(), m = n.map(o), v = h();
881
+ function d() {
882
+ if (!l) return 0;
883
+ const a = n[0];
884
+ return N(t[u] - a[u]);
885
+ }
886
+ function g() {
887
+ if (!l) return 0;
888
+ const a = s.getComputedStyle(J(r));
889
+ return parseFloat(a.getPropertyValue(`margin-${c}`));
890
+ }
891
+ function h() {
892
+ return n.map((a, S, C) => {
893
+ const L = !S, w = Fe(C, S);
894
+ return L ? m[S] + b : w ? m[S] + p : C[S + 1][u] - a[u];
895
+ }).map(N);
896
+ }
897
+ return {
898
+ slideSizes: m,
899
+ slideSizesWithGaps: v,
900
+ startGap: b,
901
+ endGap: p
902
+ };
903
+ }
904
+ function en(e, t, n, r, i, s, o, u, c) {
905
+ const {
906
+ startEdge: l,
907
+ endEdge: b,
908
+ direction: p
909
+ } = e, m = ke(n);
910
+ function v(f, a) {
911
+ return me(f).filter((S) => S % a === 0).map((S) => f.slice(S, S + a));
912
+ }
913
+ function d(f) {
914
+ return f.length ? me(f).reduce((a, S, C) => {
915
+ const L = J(a) || 0, w = L === 0, y = S === be(f), I = i[l] - s[L][l], E = i[l] - s[S][b], P = !r && w ? p(o) : 0, T = !r && y ? p(u) : 0, j = N(E - T - (I + P));
916
+ return C && j > t + c && a.push(S), y && a.push(f.length), a;
917
+ }, []).map((a, S, C) => {
918
+ const L = Math.max(C[S - 1] || 0);
919
+ return f.slice(L, a);
920
+ }) : [];
921
+ }
922
+ function g(f) {
923
+ return m ? v(f, n) : d(f);
924
+ }
925
+ return {
926
+ groupSlides: g
927
+ };
928
+ }
929
+ function tn(e, t, n, r, i, s, o) {
930
+ const {
931
+ align: u,
932
+ axis: c,
933
+ direction: l,
934
+ startIndex: b,
935
+ loop: p,
936
+ duration: m,
937
+ dragFree: v,
938
+ dragThreshold: d,
939
+ inViewThreshold: g,
940
+ slidesToScroll: h,
941
+ skipSnaps: f,
942
+ containScroll: a,
943
+ watchResize: S,
944
+ watchSlides: C,
945
+ watchDrag: L,
946
+ watchFocus: w
947
+ } = s, y = 2, I = zt(), E = I.measure(t), P = n.map(I.measure), T = kt(c, l), j = T.measureSize(E), M = Vt(j), B = Nt(u, j), R = !p && !!a, q = p || !!a, {
948
+ slideSizes: X,
949
+ slideSizesWithGaps: _,
950
+ startGap: K,
951
+ endGap: oe
952
+ } = Wt(T, E, P, n, q, i), U = en(T, j, h, p, E, P, K, oe, y), {
953
+ snaps: W,
954
+ snapsAligned: ee
955
+ } = qt(T, B, E, P, U), Q = -J(W) + J(_), {
956
+ snapsContained: re,
957
+ scrollContainLimit: k
958
+ } = Ht(j, Q, ee, a, y), O = R ? re : ee, {
959
+ limit: F
960
+ } = Gt(Q, O, p), $ = rt(be(O), b, p), H = $.clone(), A = me(n), x = ({
961
+ dragHandler: ae,
962
+ scrollBody: Ee,
963
+ scrollBounds: Te,
964
+ options: {
965
+ loop: ve
966
+ }
967
+ }) => {
968
+ ve || Te.constrain(ae.pointerDown()), Ee.seek();
969
+ }, D = ({
970
+ scrollBody: ae,
971
+ translate: Ee,
972
+ location: Te,
973
+ offsetLocation: ve,
974
+ previousLocation: dt,
975
+ scrollLooper: pt,
976
+ slideLooper: mt,
977
+ dragHandler: gt,
978
+ animation: ht,
979
+ eventHandler: Ge,
980
+ scrollBounds: bt,
981
+ options: {
982
+ loop: Ue
983
+ }
984
+ }, $e) => {
985
+ const qe = ae.settled(), vt = !bt.shouldConstrain(), _e = Ue ? qe : qe && vt, Ke = _e && !gt.pointerDown();
986
+ Ke && ht.stop();
987
+ const St = Te.get() * $e + dt.get() * (1 - $e);
988
+ ve.set(St), Ue && (pt.loop(ae.direction()), mt.loop()), Ee.to(ve.get()), Ke && Ge.emit("settle"), _e || Ge.emit("scroll");
989
+ }, z = Mt(r, i, () => x(we), (ae) => D(we, ae)), G = 0.68, Y = O[$.get()], Z = fe(Y), se = fe(Y), te = fe(Y), ie = fe(Y), ue = Bt(Z, te, se, ie, m, G), Ce = Kt(p, O, Q, F, ie), Le = Qt(z, $, H, ue, Ce, ie, o), Be = $t(F), Re = he(), lt = Zt(t, n, o, g), {
990
+ slideRegistry: He
991
+ } = _t(R, a, O, k, U, A), ft = Jt(e, n, He, Le, ue, Re, o, w), we = {
992
+ ownerDocument: r,
993
+ ownerWindow: i,
994
+ eventHandler: o,
995
+ containerRect: E,
996
+ slideRects: P,
997
+ animation: z,
998
+ axis: T,
999
+ dragHandler: Ot(T, e, r, i, ie, Ft(T, i), Z, z, Le, ue, Ce, $, o, M, v, d, f, G, L),
1000
+ eventStore: Re,
1001
+ percentOfView: M,
1002
+ index: $,
1003
+ indexPrevious: H,
1004
+ limit: F,
1005
+ location: Z,
1006
+ offsetLocation: te,
1007
+ previousLocation: se,
1008
+ options: s,
1009
+ resizeHandler: jt(t, o, i, n, T, S, I),
1010
+ scrollBody: ue,
1011
+ scrollBounds: Rt(F, te, ie, ue, M),
1012
+ scrollLooper: Ut(Q, F, te, [Z, te, se, ie]),
1013
+ scrollProgress: Be,
1014
+ scrollSnapList: O.map(Be.get),
1015
+ scrollSnaps: O,
1016
+ scrollTarget: Ce,
1017
+ scrollTo: Le,
1018
+ slideLooper: Xt(T, j, Q, X, _, W, O, te, n),
1019
+ slideFocus: ft,
1020
+ slidesHandler: Yt(t, o, C),
1021
+ slidesInView: lt,
1022
+ slideIndexes: A,
1023
+ slideRegistry: He,
1024
+ slidesToScroll: U,
1025
+ target: ie,
1026
+ translate: st(T, t)
1027
+ };
1028
+ return we;
1029
+ }
1030
+ function nn() {
1031
+ let e = {}, t;
1032
+ function n(l) {
1033
+ t = l;
1034
+ }
1035
+ function r(l) {
1036
+ return e[l] || [];
1037
+ }
1038
+ function i(l) {
1039
+ return r(l).forEach((b) => b(t, l)), c;
1040
+ }
1041
+ function s(l, b) {
1042
+ return e[l] = r(l).concat([b]), c;
1043
+ }
1044
+ function o(l, b) {
1045
+ return e[l] = r(l).filter((p) => p !== b), c;
1046
+ }
1047
+ function u() {
1048
+ e = {};
1049
+ }
1050
+ const c = {
1051
+ init: n,
1052
+ emit: i,
1053
+ off: o,
1054
+ on: s,
1055
+ clear: u
1056
+ };
1057
+ return c;
1058
+ }
1059
+ const on = {
1060
+ align: "center",
1061
+ axis: "x",
1062
+ container: null,
1063
+ slides: null,
1064
+ containScroll: "trimSnaps",
1065
+ direction: "ltr",
1066
+ slidesToScroll: 1,
1067
+ inViewThreshold: 0,
1068
+ breakpoints: {},
1069
+ dragFree: !1,
1070
+ dragThreshold: 10,
1071
+ loop: !1,
1072
+ skipSnaps: !1,
1073
+ duration: 25,
1074
+ startIndex: 0,
1075
+ active: !0,
1076
+ watchDrag: !0,
1077
+ watchResize: !0,
1078
+ watchSlides: !0,
1079
+ watchFocus: !0
1080
+ };
1081
+ function rn(e) {
1082
+ function t(s, o) {
1083
+ return ot(s, o || {});
1084
+ }
1085
+ function n(s) {
1086
+ const o = s.breakpoints || {}, u = ge(o).filter((c) => e.matchMedia(c).matches).map((c) => o[c]).reduce((c, l) => t(c, l), {});
1087
+ return t(s, u);
1088
+ }
1089
+ function r(s) {
1090
+ return s.map((o) => ge(o.breakpoints || {})).reduce((o, u) => o.concat(u), []).map(e.matchMedia);
1091
+ }
1092
+ return {
1093
+ mergeOptions: t,
1094
+ optionsAtMedia: n,
1095
+ optionsMediaQueries: r
1096
+ };
1097
+ }
1098
+ function sn(e) {
1099
+ let t = [];
1100
+ function n(s, o) {
1101
+ return t = o.filter(({
1102
+ options: u
1103
+ }) => e.optionsAtMedia(u).active !== !1), t.forEach((u) => u.init(s, e)), o.reduce((u, c) => Object.assign(u, {
1104
+ [c.name]: c
1105
+ }), {});
1106
+ }
1107
+ function r() {
1108
+ t = t.filter((s) => s.destroy());
1109
+ }
1110
+ return {
1111
+ init: n,
1112
+ destroy: r
1113
+ };
1114
+ }
1115
+ function Se(e, t, n) {
1116
+ const r = e.ownerDocument, i = r.defaultView, s = rn(i), o = sn(s), u = he(), c = nn(), {
1117
+ mergeOptions: l,
1118
+ optionsAtMedia: b,
1119
+ optionsMediaQueries: p
1120
+ } = s, {
1121
+ on: m,
1122
+ off: v,
1123
+ emit: d
1124
+ } = c, g = T;
1125
+ let h = !1, f, a = l(on, Se.globalOptions), S = l(a), C = [], L, w, y;
1126
+ function I() {
1127
+ const {
1128
+ container: A,
1129
+ slides: x
1130
+ } = S;
1131
+ w = (Ae(A) ? e.querySelector(A) : A) || e.children[0];
1132
+ const z = Ae(x) ? w.querySelectorAll(x) : x;
1133
+ y = [].slice.call(z || w.children);
1134
+ }
1135
+ function E(A) {
1136
+ const x = tn(e, w, y, r, i, A, c);
1137
+ if (A.loop && !x.slideLooper.canLoop()) {
1138
+ const D = Object.assign({}, A, {
1139
+ loop: !1
1140
+ });
1141
+ return E(D);
1142
+ }
1143
+ return x;
1144
+ }
1145
+ function P(A, x) {
1146
+ h || (a = l(a, A), S = b(a), C = x || C, I(), f = E(S), p([a, ...C.map(({
1147
+ options: D
1148
+ }) => D)]).forEach((D) => u.add(D, "change", T)), S.active && (f.translate.to(f.location.get()), f.animation.init(), f.slidesInView.init(), f.slideFocus.init(H), f.eventHandler.init(H), f.resizeHandler.init(H), f.slidesHandler.init(H), f.options.loop && f.slideLooper.loop(), w.offsetParent && y.length && f.dragHandler.init(H), L = o.init(H, C)));
1149
+ }
1150
+ function T(A, x) {
1151
+ const D = U();
1152
+ j(), P(l({
1153
+ startIndex: D
1154
+ }, A), x), c.emit("reInit");
1155
+ }
1156
+ function j() {
1157
+ f.dragHandler.destroy(), f.eventStore.clear(), f.translate.clear(), f.slideLooper.clear(), f.resizeHandler.destroy(), f.slidesHandler.destroy(), f.slidesInView.destroy(), f.animation.destroy(), o.destroy(), u.clear();
1158
+ }
1159
+ function M() {
1160
+ h || (h = !0, u.clear(), j(), c.emit("destroy"), c.clear());
1161
+ }
1162
+ function B(A, x, D) {
1163
+ !S.active || h || (f.scrollBody.useBaseFriction().useDuration(x === !0 ? 0 : S.duration), f.scrollTo.index(A, D || 0));
1164
+ }
1165
+ function R(A) {
1166
+ const x = f.index.add(1).get();
1167
+ B(x, A, -1);
1168
+ }
1169
+ function q(A) {
1170
+ const x = f.index.add(-1).get();
1171
+ B(x, A, 1);
1172
+ }
1173
+ function X() {
1174
+ return f.index.add(1).get() !== U();
1175
+ }
1176
+ function _() {
1177
+ return f.index.add(-1).get() !== U();
1178
+ }
1179
+ function K() {
1180
+ return f.scrollSnapList;
1181
+ }
1182
+ function oe() {
1183
+ return f.scrollProgress.get(f.offsetLocation.get());
1184
+ }
1185
+ function U() {
1186
+ return f.index.get();
1187
+ }
1188
+ function W() {
1189
+ return f.indexPrevious.get();
1190
+ }
1191
+ function ee() {
1192
+ return f.slidesInView.get();
1193
+ }
1194
+ function Q() {
1195
+ return f.slidesInView.get(!1);
1196
+ }
1197
+ function re() {
1198
+ return L;
1199
+ }
1200
+ function k() {
1201
+ return f;
1202
+ }
1203
+ function O() {
1204
+ return e;
1205
+ }
1206
+ function F() {
1207
+ return w;
1208
+ }
1209
+ function $() {
1210
+ return y;
1211
+ }
1212
+ const H = {
1213
+ canScrollNext: X,
1214
+ canScrollPrev: _,
1215
+ containerNode: F,
1216
+ internalEngine: k,
1217
+ destroy: M,
1218
+ off: v,
1219
+ on: m,
1220
+ emit: d,
1221
+ plugins: re,
1222
+ previousScrollSnap: W,
1223
+ reInit: g,
1224
+ rootNode: O,
1225
+ scrollNext: R,
1226
+ scrollPrev: q,
1227
+ scrollProgress: oe,
1228
+ scrollSnapList: K,
1229
+ scrollTo: B,
1230
+ selectedScrollSnap: U,
1231
+ slideNodes: $,
1232
+ slidesInView: ee,
1233
+ slidesNotInView: Q
1234
+ };
1235
+ return P(t, n), setTimeout(() => c.emit("init"), 0), H;
1236
+ }
1237
+ Se.globalOptions = void 0;
1238
+ function ze(e = {}, t = []) {
1239
+ const n = Pe(e), r = Pe(t), [i, s] = ne(), [o, u] = ne(), c = le(() => {
1240
+ i && i.reInit(n.current, r.current);
1241
+ }, [i]);
1242
+ return de(() => {
1243
+ Me(n.current, e) || (n.current = e, c());
1244
+ }, [e, c]), de(() => {
1245
+ Dt(r.current, t) || (r.current = t, c());
1246
+ }, [t, c]), de(() => {
1247
+ if (Tt() && o) {
1248
+ Se.globalOptions = ze.globalOptions;
1249
+ const l = Se(o, n.current, r.current);
1250
+ return s(l), () => l.destroy();
1251
+ } else
1252
+ s(void 0);
1253
+ }, [o, s]), [u, i];
1254
+ }
1255
+ ze.globalOptions = void 0;
1256
+ const cn = nt(
1257
+ "ds:relative ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
1258
+ {
1259
+ variants: {
1260
+ size: {
1261
+ sm: "ds:[--carousel-item-inline-size:14rem]",
1262
+ md: "ds:[--carousel-item-inline-size:20rem]",
1263
+ lg: "ds:[--carousel-item-inline-size:28rem]"
1264
+ }
1265
+ },
1266
+ defaultVariants: { size: "md" }
1267
+ }
1268
+ ), an = nt(
1269
+ [
1270
+ "ds:shrink-0 ds:basis-[var(--carousel-item-inline-size)]",
1271
+ "ds:min-w-0",
1272
+ "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
1273
+ "ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
1274
+ "ds:rounded-[var(--radius-md)]"
1275
+ ].join(" ")
1276
+ ), it = It(null);
1277
+ function ct(e) {
1278
+ const t = Ct(it);
1279
+ if (!t)
1280
+ throw new Error(
1281
+ `[Carousel] \`${e}\` must be rendered inside <Carousel>.`
1282
+ );
1283
+ return t;
1284
+ }
1285
+ function un() {
1286
+ const [e, t] = ne(() => typeof window > "u" || !window.matchMedia ? !1 : window.matchMedia("(prefers-reduced-motion: reduce)").matches);
1287
+ return de(() => {
1288
+ if (typeof window > "u" || !window.matchMedia) return;
1289
+ const n = window.matchMedia("(prefers-reduced-motion: reduce)"), r = () => t(n.matches);
1290
+ return n.addEventListener("change", r), () => n.removeEventListener("change", r);
1291
+ }, []), e;
1292
+ }
1293
+ function ln(e) {
1294
+ let t = null;
1295
+ const n = [];
1296
+ return et.forEach(e, (r) => {
1297
+ tt(r) && r.type.displayName === "Carousel.Header" ? t = r : n.push(r);
1298
+ }), { header: t, items: n };
1299
+ }
1300
+ const at = xe(
1301
+ ({
1302
+ children: e,
1303
+ size: t = "md",
1304
+ showControls: n = !0,
1305
+ showIndicators: r = !0,
1306
+ viewAllSlot: i,
1307
+ snap: s = "mandatory",
1308
+ id: o,
1309
+ className: u,
1310
+ "aria-label": c,
1311
+ ...l
1312
+ }, b) => {
1313
+ const { t: p } = ye(), m = un(), v = xt(), d = `${o ?? v}-track`, g = `${o ?? v}-live`, h = Qe(
1314
+ () => ({
1315
+ align: "start",
1316
+ // `mandatory` → embla's default tight snap; `proximity` → free-scroll.
1317
+ dragFree: s === "proximity",
1318
+ // Reduced-motion disables embla's tween entirely (snap is instant).
1319
+ duration: m ? 0 : 25,
1320
+ // Prevents over-scroll at the ends so the last item snaps cleanly.
1321
+ containScroll: "trimSnaps"
1322
+ }),
1323
+ [s, m]
1324
+ ), [f, a] = ze(h), [S, C] = ne(0), [L, w] = ne(0), [y, I] = ne(!1), [E, P] = ne(!1), [T, j] = ne(""), M = Pe("init");
1325
+ de(() => {
1326
+ if (!a) return;
1327
+ w(a.scrollSnapList().length), C(a.selectedScrollSnap()), I(a.canScrollPrev()), P(a.canScrollNext());
1328
+ const k = () => {
1329
+ const H = a.selectedScrollSnap();
1330
+ C(H), I(a.canScrollPrev()), P(a.canScrollNext()), M.current === "control" && j(
1331
+ p("carousel.slideAnnouncement", {
1332
+ current: H + 1,
1333
+ total: a.scrollSnapList().length
1334
+ })
1335
+ );
1336
+ }, O = () => {
1337
+ M.current = "drag";
1338
+ }, F = () => {
1339
+ M.current = "init";
1340
+ }, $ = () => {
1341
+ w(a.scrollSnapList().length), C(a.selectedScrollSnap()), I(a.canScrollPrev()), P(a.canScrollNext());
1342
+ };
1343
+ return a.on("select", k), a.on("pointerDown", O), a.on("pointerUp", F), a.on("reInit", $), () => {
1344
+ a.off("select", k), a.off("pointerDown", O), a.off("pointerUp", F), a.off("reInit", $);
1345
+ };
1346
+ }, [a, p]);
1347
+ const B = le(() => {
1348
+ a && (M.current = "control", a.scrollPrev());
1349
+ }, [a]), R = le(() => {
1350
+ a && (M.current = "control", a.scrollNext());
1351
+ }, [a]), q = le(
1352
+ (k) => {
1353
+ a && (M.current = "control", a.scrollTo(k));
1354
+ },
1355
+ [a]
1356
+ ), X = le(
1357
+ (k) => {
1358
+ if (a)
1359
+ switch (k.key) {
1360
+ case "ArrowRight":
1361
+ k.preventDefault(), a.scrollNext(), M.current = "control";
1362
+ break;
1363
+ case "ArrowLeft":
1364
+ k.preventDefault(), a.scrollPrev(), M.current = "control";
1365
+ break;
1366
+ case "Home":
1367
+ k.preventDefault(), a.scrollTo(0), M.current = "control";
1368
+ break;
1369
+ case "End":
1370
+ k.preventDefault(), a.scrollTo(a.scrollSnapList().length - 1), M.current = "control";
1371
+ break;
1372
+ case "PageDown":
1373
+ case "PageUp": {
1374
+ k.preventDefault();
1375
+ const O = a.slidesInView().length || 1, F = k.key === "PageDown" ? 1 : -1, $ = Math.max(
1376
+ 0,
1377
+ Math.min(
1378
+ a.selectedScrollSnap() + F * O,
1379
+ a.scrollSnapList().length - 1
1380
+ )
1381
+ );
1382
+ a.scrollTo($), M.current = "control";
1383
+ break;
1384
+ }
1385
+ }
1386
+ },
1387
+ [a]
1388
+ );
1389
+ yt(
1390
+ b,
1391
+ () => ({
1392
+ scrollTo: q,
1393
+ getActiveIndex: () => S,
1394
+ getCount: () => L,
1395
+ scrollPrev: B,
1396
+ scrollNext: R
1397
+ }),
1398
+ [q, B, R, S, L]
1399
+ );
1400
+ const { header: _, items: K } = ln(e), oe = K.length, U = Math.max(L, oe), W = n && U > 1 || i != null, ee = _ == null && W, Q = r && L > 1, re = Qe(
1401
+ () => ({
1402
+ api: a,
1403
+ activeIndex: S,
1404
+ count: L,
1405
+ canScrollPrev: y,
1406
+ canScrollNext: E,
1407
+ scrollPrev: B,
1408
+ scrollNext: R,
1409
+ scrollToIndex: q,
1410
+ trackId: d
1411
+ }),
1412
+ [
1413
+ a,
1414
+ S,
1415
+ L,
1416
+ y,
1417
+ E,
1418
+ B,
1419
+ R,
1420
+ q,
1421
+ d
1422
+ ]
1423
+ );
1424
+ return /* @__PURE__ */ V(it.Provider, { value: re, children: /* @__PURE__ */ De(
1425
+ "section",
1426
+ {
1427
+ ...l,
1428
+ "aria-label": c ?? p("carousel.label", "Carousel"),
1429
+ "aria-roledescription": p("carousel.roleDescription", "carousel"),
1430
+ tabIndex: 0,
1431
+ onKeyDown: X,
1432
+ "data-component": "carousel",
1433
+ "data-component-id": o,
1434
+ "data-size": t,
1435
+ "data-state": m ? "reduced-motion" : void 0,
1436
+ className: cn({ size: t, className: u }),
1437
+ children: [
1438
+ _,
1439
+ ee ? /* @__PURE__ */ V("div", { className: "ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-md)]", children: /* @__PURE__ */ De("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)] ds:ms-auto", children: [
1440
+ i,
1441
+ n && U > 1 ? /* @__PURE__ */ V(dn, {}) : null
1442
+ ] }) }) : null,
1443
+ /* @__PURE__ */ V("div", { ref: f, className: "ds:overflow-hidden", children: /* @__PURE__ */ V(
1444
+ "div",
1445
+ {
1446
+ id: d,
1447
+ role: "presentation",
1448
+ className: "ds:flex ds:gap-[var(--spacing-md)]",
1449
+ children: et.map(K, (k, O) => tt(k) ? /* @__PURE__ */ V(fn, { index: O, total: U, children: k }) : k)
1450
+ }
1451
+ ) }),
1452
+ Q ? /* @__PURE__ */ V(pn, {}) : null,
1453
+ /* @__PURE__ */ V(
1454
+ "div",
1455
+ {
1456
+ id: g,
1457
+ role: "status",
1458
+ "aria-live": "polite",
1459
+ "aria-atomic": "true",
1460
+ className: "ds:sr-only",
1461
+ children: T
1462
+ }
1463
+ )
1464
+ ]
1465
+ }
1466
+ ) });
1467
+ }
1468
+ );
1469
+ at.displayName = "Carousel";
1470
+ const Ve = xe(
1471
+ ({ children: e, className: t, ...n }, r) => /* @__PURE__ */ V(
1472
+ "div",
1473
+ {
1474
+ ref: r,
1475
+ ...n,
1476
+ tabIndex: -1,
1477
+ className: an({ className: t }),
1478
+ children: e
1479
+ }
1480
+ )
1481
+ );
1482
+ Ve.displayName = "Carousel.Item";
1483
+ function fn({
1484
+ children: e,
1485
+ index: t,
1486
+ total: n
1487
+ }) {
1488
+ const { t: r } = ye(), i = e.props, s = i["aria-label"] ?? r("carousel.slideLabel", {
1489
+ current: t + 1,
1490
+ total: n,
1491
+ defaultValue: "{{current}} of {{total}}"
1492
+ }), o = {
1493
+ ...i,
1494
+ role: "group",
1495
+ "aria-roledescription": r("carousel.slideRoleDescription", "slide"),
1496
+ "aria-label": s,
1497
+ "data-slide-index": t,
1498
+ "data-slide-id": i.id
1499
+ };
1500
+ return /* @__PURE__ */ V(Ve, { ...o });
1501
+ }
1502
+ const ut = xe(
1503
+ ({ children: e, className: t, ...n }, r) => /* @__PURE__ */ V(
1504
+ "div",
1505
+ {
1506
+ ref: r,
1507
+ ...n,
1508
+ className: [
1509
+ "ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-md)]",
1510
+ t
1511
+ ].filter(Boolean).join(" "),
1512
+ children: e
1513
+ }
1514
+ )
1515
+ );
1516
+ ut.displayName = "Carousel.Header";
1517
+ function dn() {
1518
+ return /* @__PURE__ */ V(je, {});
1519
+ }
1520
+ const je = xe(({ className: e, ...t }, n) => {
1521
+ const { t: r } = ye(), { canScrollPrev: i, canScrollNext: s, scrollPrev: o, scrollNext: u, trackId: c } = ct("Carousel.Controls");
1522
+ return /* @__PURE__ */ De(
1523
+ "div",
1524
+ {
1525
+ ref: n,
1526
+ ...t,
1527
+ className: [
1528
+ "ds:hidden ds:md:flex ds:items-center ds:gap-[var(--spacing-2xs)]",
1529
+ e
1530
+ ].filter(Boolean).join(" "),
1531
+ children: [
1532
+ /* @__PURE__ */ V(
1533
+ Je,
1534
+ {
1535
+ size: "sm",
1536
+ intent: "ghost",
1537
+ flipIconInRtl: !0,
1538
+ icon: /* @__PURE__ */ V(Lt, { "aria-hidden": "true" }),
1539
+ "aria-controls": c,
1540
+ "aria-label": r("carousel.previous", "Previous slide"),
1541
+ disabled: !i,
1542
+ onClick: o
1543
+ }
1544
+ ),
1545
+ /* @__PURE__ */ V(
1546
+ Je,
1547
+ {
1548
+ size: "sm",
1549
+ intent: "ghost",
1550
+ flipIconInRtl: !0,
1551
+ icon: /* @__PURE__ */ V(wt, { "aria-hidden": "true" }),
1552
+ "aria-controls": c,
1553
+ "aria-label": r("carousel.next", "Next slide"),
1554
+ disabled: !s,
1555
+ onClick: u
1556
+ }
1557
+ )
1558
+ ]
1559
+ }
1560
+ );
1561
+ });
1562
+ je.displayName = "Carousel.Controls";
1563
+ function pn() {
1564
+ const { t: e } = ye(), { activeIndex: t, count: n, scrollToIndex: r, trackId: i } = ct(
1565
+ "Carousel.Indicators"
1566
+ );
1567
+ return /* @__PURE__ */ V(
1568
+ "ol",
1569
+ {
1570
+ role: "tablist",
1571
+ "aria-label": e("carousel.indicatorsLabel", "Slides"),
1572
+ className: "ds:flex ds:items-center ds:justify-center ds:gap-[var(--spacing-2xs)]",
1573
+ children: Array.from({ length: n }).map((s, o) => {
1574
+ const u = o === t;
1575
+ return /* @__PURE__ */ V("li", { className: "ds:flex", children: /* @__PURE__ */ V(
1576
+ "button",
1577
+ {
1578
+ type: "button",
1579
+ role: "tab",
1580
+ "aria-controls": i,
1581
+ "aria-current": u ? "true" : void 0,
1582
+ "aria-label": e("carousel.goToSlide", {
1583
+ index: o + 1,
1584
+ defaultValue: "Go to slide {{index}}"
1585
+ }),
1586
+ onClick: () => r(o),
1587
+ "data-active": u ? "true" : void 0,
1588
+ className: [
1589
+ "ds:size-2 ds:rounded-[var(--radius-full)]",
1590
+ "ds:transition-[background-color,inline-size] ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
1591
+ "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
1592
+ "ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
1593
+ u ? "ds:bg-[var(--primary)] ds:w-[length:var(--spacing-md)]" : "ds:bg-[var(--border)] ds:hover:bg-[var(--muted-foreground)]"
1594
+ ].join(" ")
1595
+ }
1596
+ ) }, o);
1597
+ })
1598
+ }
1599
+ );
1600
+ }
1601
+ const yn = Object.assign(at, {
1602
+ Header: ut,
1603
+ Item: Ve,
1604
+ Controls: je
1605
+ }), In = {
1606
+ id: "carousel",
1607
+ capabilities: ["navigate", "view_change"],
1608
+ state: {
1609
+ activeIndex: {
1610
+ type: "number",
1611
+ description: "Zero-based index of the currently snapped slide.",
1612
+ read: (e) => e.getActiveIndex()
1613
+ },
1614
+ count: {
1615
+ type: "number",
1616
+ description: "Total slide count.",
1617
+ read: (e) => e.getCount()
1618
+ }
1619
+ },
1620
+ actions: {
1621
+ scroll_to: {
1622
+ safety: "read",
1623
+ argsType: "{ index: number }",
1624
+ description: "Scroll to the slide at the given index.",
1625
+ invoke: (e, t) => {
1626
+ e.scrollTo(t.index);
1627
+ }
1628
+ },
1629
+ scroll_prev: {
1630
+ safety: "read",
1631
+ description: "Scroll to the previous slide.",
1632
+ invoke: (e) => {
1633
+ e.scrollPrev();
1634
+ }
1635
+ },
1636
+ scroll_next: {
1637
+ safety: "read",
1638
+ description: "Scroll to the next slide.",
1639
+ invoke: (e) => {
1640
+ e.scrollNext();
1641
+ }
1642
+ }
1643
+ },
1644
+ domHooks: {
1645
+ root: { attr: "data-component", value: "carousel" },
1646
+ instanceId: {
1647
+ attr: "data-component-id",
1648
+ sourceProp: "id",
1649
+ description: "Sourced from the id prop on Carousel."
1650
+ },
1651
+ item: {
1652
+ attr: "data-slide-id",
1653
+ description: "Each Carousel.Item emits its `id` prop as `data-slide-id`. `data-slide-index` carries the zero-based position alongside."
1654
+ }
1655
+ }
1656
+ };
1657
+ export {
1658
+ yn as C,
1659
+ In as c
1660
+ };
1661
+ //# sourceMappingURL=carousel.agent-2dXpQoqp.js.map