@alfadocs/ui-kit-debug 1.28.3 → 1.30.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 (126) hide show
  1. package/dist/_chunks/{anamnesis-summary-rows-DwjqZgR5.js → anamnesis-summary-rows-DMO3MWSt.js} +2 -2
  2. package/dist/_chunks/{anamnesis-summary-rows-DwjqZgR5.js.map → anamnesis-summary-rows-DMO3MWSt.js.map} +1 -1
  3. package/dist/_chunks/{booking-BtSOKjQu.js → booking-AabCk7CI.js} +1205 -1148
  4. package/dist/_chunks/booking-AabCk7CI.js.map +1 -0
  5. package/dist/_chunks/{sparkline-BmGcEyZO.js → sparkline-Dx_sxK3J.js} +228 -198
  6. package/dist/_chunks/sparkline-Dx_sxK3J.js.map +1 -0
  7. package/dist/_chunks/use-zoom-drilldown-qCX34w9I.js +210 -0
  8. package/dist/_chunks/use-zoom-drilldown-qCX34w9I.js.map +1 -0
  9. package/dist/agent-catalog.json +5 -2
  10. package/dist/agent-i18n/en.json +1 -1
  11. package/dist/components/booking/booking-types.d.ts +15 -0
  12. package/dist/components/booking/booking-types.d.ts.map +1 -1
  13. package/dist/components/booking/booking.d.ts.map +1 -1
  14. package/dist/components/booking/details-form.d.ts +7 -0
  15. package/dist/components/booking/details-form.d.ts.map +1 -1
  16. package/dist/components/booking/index.js +1 -1
  17. package/dist/components/index.d.ts +2 -2
  18. package/dist/components/index.d.ts.map +1 -1
  19. package/dist/components/sparkline/index.js +1 -1
  20. package/dist/components/sparkline/sparkline.agent.d.ts.map +1 -1
  21. package/dist/components/sparkline/sparkline.d.ts +6 -0
  22. package/dist/components/sparkline/sparkline.d.ts.map +1 -1
  23. package/dist/hooks/index.d.ts +1 -0
  24. package/dist/hooks/index.d.ts.map +1 -1
  25. package/dist/hooks/index.js +56 -54
  26. package/dist/hooks/use-zoom-drilldown.d.ts +23 -0
  27. package/dist/hooks/use-zoom-drilldown.d.ts.map +1 -0
  28. package/dist/host-compat.css +4 -1
  29. package/dist/i18n/locales/ar.d.ts +4 -0
  30. package/dist/i18n/locales/ar.d.ts.map +1 -1
  31. package/dist/i18n/locales/ar.js +4 -0
  32. package/dist/i18n/locales/ar.js.map +1 -1
  33. package/dist/i18n/locales/de.d.ts +4 -0
  34. package/dist/i18n/locales/de.d.ts.map +1 -1
  35. package/dist/i18n/locales/de.js +4 -0
  36. package/dist/i18n/locales/de.js.map +1 -1
  37. package/dist/i18n/locales/el.d.ts +4 -0
  38. package/dist/i18n/locales/el.d.ts.map +1 -1
  39. package/dist/i18n/locales/el.js +4 -0
  40. package/dist/i18n/locales/el.js.map +1 -1
  41. package/dist/i18n/locales/en.d.ts +4 -0
  42. package/dist/i18n/locales/en.d.ts.map +1 -1
  43. package/dist/i18n/locales/en.js +4 -0
  44. package/dist/i18n/locales/en.js.map +1 -1
  45. package/dist/i18n/locales/es.d.ts +4 -0
  46. package/dist/i18n/locales/es.d.ts.map +1 -1
  47. package/dist/i18n/locales/es.js +4 -0
  48. package/dist/i18n/locales/es.js.map +1 -1
  49. package/dist/i18n/locales/fr.d.ts +4 -0
  50. package/dist/i18n/locales/fr.d.ts.map +1 -1
  51. package/dist/i18n/locales/fr.js +4 -0
  52. package/dist/i18n/locales/fr.js.map +1 -1
  53. package/dist/i18n/locales/hi.d.ts +4 -0
  54. package/dist/i18n/locales/hi.d.ts.map +1 -1
  55. package/dist/i18n/locales/hi.js +4 -0
  56. package/dist/i18n/locales/hi.js.map +1 -1
  57. package/dist/i18n/locales/it.d.ts +4 -0
  58. package/dist/i18n/locales/it.d.ts.map +1 -1
  59. package/dist/i18n/locales/it.js +4 -0
  60. package/dist/i18n/locales/it.js.map +1 -1
  61. package/dist/i18n/locales/ja.d.ts +4 -0
  62. package/dist/i18n/locales/ja.d.ts.map +1 -1
  63. package/dist/i18n/locales/ja.js +4 -0
  64. package/dist/i18n/locales/ja.js.map +1 -1
  65. package/dist/i18n/locales/nl.d.ts +4 -0
  66. package/dist/i18n/locales/nl.d.ts.map +1 -1
  67. package/dist/i18n/locales/nl.js +4 -0
  68. package/dist/i18n/locales/nl.js.map +1 -1
  69. package/dist/i18n/locales/pl.d.ts +4 -0
  70. package/dist/i18n/locales/pl.d.ts.map +1 -1
  71. package/dist/i18n/locales/pl.js +4 -0
  72. package/dist/i18n/locales/pl.js.map +1 -1
  73. package/dist/i18n/locales/pt.d.ts +4 -0
  74. package/dist/i18n/locales/pt.d.ts.map +1 -1
  75. package/dist/i18n/locales/pt.js +4 -0
  76. package/dist/i18n/locales/pt.js.map +1 -1
  77. package/dist/i18n/locales/ro.d.ts +4 -0
  78. package/dist/i18n/locales/ro.d.ts.map +1 -1
  79. package/dist/i18n/locales/ro.js +4 -0
  80. package/dist/i18n/locales/ro.js.map +1 -1
  81. package/dist/i18n/locales/ru.d.ts +4 -0
  82. package/dist/i18n/locales/ru.d.ts.map +1 -1
  83. package/dist/i18n/locales/ru.js +4 -0
  84. package/dist/i18n/locales/ru.js.map +1 -1
  85. package/dist/i18n/locales/sq.d.ts +4 -0
  86. package/dist/i18n/locales/sq.d.ts.map +1 -1
  87. package/dist/i18n/locales/sq.js +4 -0
  88. package/dist/i18n/locales/sq.js.map +1 -1
  89. package/dist/i18n/locales/sv.d.ts +4 -0
  90. package/dist/i18n/locales/sv.d.ts.map +1 -1
  91. package/dist/i18n/locales/sv.js +4 -0
  92. package/dist/i18n/locales/sv.js.map +1 -1
  93. package/dist/i18n/locales/tr.d.ts +4 -0
  94. package/dist/i18n/locales/tr.d.ts.map +1 -1
  95. package/dist/i18n/locales/tr.js +4 -0
  96. package/dist/i18n/locales/tr.js.map +1 -1
  97. package/dist/i18n/locales/zh.d.ts +4 -0
  98. package/dist/i18n/locales/zh.d.ts.map +1 -1
  99. package/dist/i18n/locales/zh.js +4 -0
  100. package/dist/i18n/locales/zh.js.map +1 -1
  101. package/dist/index.js +1072 -1070
  102. package/dist/locales/ar.json +4 -0
  103. package/dist/locales/de.json +4 -0
  104. package/dist/locales/el.json +4 -0
  105. package/dist/locales/en.json +4 -0
  106. package/dist/locales/es.json +4 -0
  107. package/dist/locales/fr.json +4 -0
  108. package/dist/locales/hi.json +4 -0
  109. package/dist/locales/it.json +4 -0
  110. package/dist/locales/ja.json +4 -0
  111. package/dist/locales/nl.json +4 -0
  112. package/dist/locales/pl.json +4 -0
  113. package/dist/locales/pt.json +4 -0
  114. package/dist/locales/ro.json +4 -0
  115. package/dist/locales/ru.json +4 -0
  116. package/dist/locales/sq.json +4 -0
  117. package/dist/locales/sv.json +4 -0
  118. package/dist/locales/tr.json +4 -0
  119. package/dist/locales/zh.json +4 -0
  120. package/dist/patterns/anamnesis/index.js +1 -1
  121. package/dist/tokens.css +1 -1
  122. package/package.json +1 -1
  123. package/dist/_chunks/booking-BtSOKjQu.js.map +0 -1
  124. package/dist/_chunks/sparkline-BmGcEyZO.js.map +0 -1
  125. package/dist/_chunks/use-signing-session-CyOZWinp.js +0 -147
  126. package/dist/_chunks/use-signing-session-CyOZWinp.js.map +0 -1
@@ -1,25 +1,25 @@
1
- import { jsx as c, jsxs as V } from "react/jsx-runtime";
2
- import { forwardRef as pe, useId as ue, useMemo as A, useRef as z, useState as W, useEffect as S, useImperativeHandle as he } from "react";
3
- import { c as K } from "./index-D2ZczOXr.js";
4
- import { useTranslation as me } from "react-i18next";
5
- import ge from "react-apexcharts";
6
- import E from "apexcharts";
7
- import { g as Q, u as fe } from "./apexcharts-theme-B_AxGC_h.js";
8
- import { m as ye } from "./annotation-marker-CsUJGZjQ.js";
9
- import { u as be } from "./registry-DvAUVLHh.js";
10
- function ve(t) {
11
- if (t.length < 2)
1
+ import { jsx as u, jsxs as K } from "react/jsx-runtime";
2
+ import { forwardRef as ve, useId as we, useMemo as _, useRef as k, useState as $, useEffect as H, useImperativeHandle as ke } from "react";
3
+ import { c as j } from "./index-D2ZczOXr.js";
4
+ import { useTranslation as xe } from "react-i18next";
5
+ import Ie from "react-apexcharts";
6
+ import P from "apexcharts";
7
+ import { g as re, u as Ne } from "./apexcharts-theme-B_AxGC_h.js";
8
+ import { m as Re } from "./annotation-marker-CsUJGZjQ.js";
9
+ import { u as Me } from "./registry-DvAUVLHh.js";
10
+ function Te(n) {
11
+ if (n.length < 2)
12
12
  return { slope: 0, direction: "steady" };
13
- const a = t.length, m = (a - 1) / 2, l = t.reduce((r, i) => r + i, 0) / a;
14
- let s = 0, p = 0;
15
- for (let r = 0; r < a; r++) {
16
- const i = r - m;
17
- s += i * (t[r] - l), p += i * i;
13
+ const r = n.length, g = (r - 1) / 2, p = n.reduce((c, d) => c + d, 0) / r;
14
+ let a = 0, h = 0;
15
+ for (let c = 0; c < r; c++) {
16
+ const d = c - g;
17
+ a += d * (n[c] - p), h += d * d;
18
18
  }
19
- const h = p === 0 ? 0 : s / p, k = 0.01 * (Math.max(...t) - Math.min(...t) || 1), g = Math.abs(h) < k ? "steady" : h > 0 ? "increasing" : "decreasing";
20
- return { slope: h, direction: g };
19
+ const f = h === 0 ? 0 : a / h, N = 0.01 * (Math.max(...n) - Math.min(...n) || 1), b = Math.abs(f) < N ? "steady" : f > 0 ? "increasing" : "decreasing";
20
+ return { slope: f, direction: b };
21
21
  }
22
- const we = {
22
+ const Ce = {
23
23
  id: "sparkline",
24
24
  capabilities: [],
25
25
  // `select_annotation` enforces two preconditions silently and
@@ -39,19 +39,19 @@ const we = {
39
39
  type: "string[]",
40
40
  descriptionKey: "ui.agent.sparkline.state.annotationIds",
41
41
  description: "Ids of the annotations currently drawn, in declaration order. The only ids `select_annotation` will accept — check against this before calling. Ids only, never annotation labels.",
42
- read: (t) => t.getAnnotationIds()
42
+ read: (n) => n.getAnnotationIds()
43
43
  },
44
44
  selectable: {
45
45
  type: "boolean",
46
46
  descriptionKey: "ui.agent.sparkline.state.selectable",
47
47
  description: "True when the host wired an annotation-select handler. False means every `select_annotation` call is a no-op, whatever id is passed.",
48
- read: (t) => t.isSelectable()
48
+ read: (n) => n.isSelectable()
49
49
  },
50
50
  pointCount: {
51
51
  type: "number",
52
52
  descriptionKey: "ui.agent.sparkline.state.pointCount",
53
53
  description: "Number of positions in the currently rendered series, unmeasured gaps included — reflecting whichever applied last, the `data` prop or an `update_series` call. A count only; the plotted values are never exposed.",
54
- read: (t) => t.getPointCount()
54
+ read: (n) => n.getPointCount()
55
55
  }
56
56
  },
57
57
  actions: {
@@ -73,9 +73,12 @@ const we = {
73
73
  },
74
74
  idempotent: !0,
75
75
  descriptionKey: "ui.agent.sparkline.actions.updateSeries",
76
- description: "Replace the sparkline data without remounting. Writes straight into ApexCharts, bypassing React — read the `pointCount` slot back rather than expecting the host tree to reflect it.",
77
- invoke: (t, a) => {
78
- t.updateSeries(a.data);
76
+ description: "Replace the sparkline data without remounting. Writes straight into ApexCharts, bypassing React — read the `pointCount` slot back rather than expecting the host tree to reflect it. Host-supplied point labels are not updated, so the tooltip title is hidden after this call.",
77
+ errors: [
78
+ "Per-point tooltip titles are hidden after this call — the host point labels describe the previous series, not the one written."
79
+ ],
80
+ invoke: (n, r) => {
81
+ n.updateSeries(r.data);
79
82
  }
80
83
  },
81
84
  export_png: {
@@ -88,7 +91,7 @@ const we = {
88
91
  },
89
92
  descriptionKey: "ui.agent.sparkline.actions.exportPng",
90
93
  description: "Return a PNG data URI of the sparkline.",
91
- invoke: (t) => t.dataURI()
94
+ invoke: (n) => n.dataURI()
92
95
  },
93
96
  select_annotation: {
94
97
  // Routes the host somewhere — the same thing a pointer press on the
@@ -113,8 +116,8 @@ const we = {
113
116
  "Silently ignored when `selectable` is false — the host wired no annotation-select handler.",
114
117
  "Silently ignored when the id is not in `annotationIds` — that annotation is not currently drawn."
115
118
  ],
116
- invoke: (t, a) => {
117
- t.selectAnnotation(a.annotationId);
119
+ invoke: (n, r) => {
120
+ n.selectAnnotation(r.annotationId);
118
121
  }
119
122
  }
120
123
  },
@@ -126,7 +129,7 @@ const we = {
126
129
  description: "Sourced from the id prop."
127
130
  }
128
131
  }
129
- }, X = K("ds:relative ds:inline-block ds:w-full", {
132
+ }, ae = j("ds:relative ds:inline-block ds:w-full", {
130
133
  variants: {
131
134
  size: {
132
135
  xs: "ds:h-6",
@@ -138,7 +141,7 @@ const we = {
138
141
  }
139
142
  },
140
143
  defaultVariants: { size: "md" }
141
- }), Y = K("", {
144
+ }), se = j("", {
142
145
  variants: {
143
146
  tone: {
144
147
  neutral: "ds:[--annotation-color:var(--muted-foreground)]",
@@ -153,7 +156,7 @@ const we = {
153
156
  }
154
157
  },
155
158
  defaultVariants: { tone: "neutral" }
156
- }), ke = K(
159
+ }), Ae = j(
157
160
  "ds:pointer-events-none ds:absolute ds:inset-x-[2px]",
158
161
  {
159
162
  variants: {
@@ -169,204 +172,231 @@ const we = {
169
172
  },
170
173
  defaultVariants: { size: "md" }
171
174
  }
172
- ), xe = {
175
+ ), Oe = {
173
176
  increasing: "↑",
174
177
  decreasing: "↓",
175
178
  steady: "→"
176
- }, Ie = {
179
+ }, Se = {
177
180
  xs: 24,
178
181
  sm: 32,
179
182
  md: 40
180
- }, N = 2, ee = 2.5, te = 44;
181
- function Ne(t, a, m = te) {
182
- const l = t.map((s) => ({
183
- annotation: s,
184
- centre: ne(s.position) * a
185
- })).sort((s, p) => s.centre - p.centre);
186
- return l.map((s, p) => {
187
- const h = l[p - 1], w = l[p + 1], k = h ? (h.centre + s.centre) / 2 : 0, g = w ? (s.centre + w.centre) / 2 : a, r = Math.max(0, k), i = Math.min(a, g), b = Math.min(m, Math.max(0, i - r)), T = Math.min(
188
- Math.max(s.centre - b / 2, r),
189
- i - b
183
+ }, M = 2, ie = 2.5, oe = 44;
184
+ function ze(n, r, g = oe) {
185
+ const p = n.map((a) => ({
186
+ annotation: a,
187
+ centre: de(a.position) * r
188
+ })).sort((a, h) => a.centre - h.centre);
189
+ return p.map((a, h) => {
190
+ const f = p[h - 1], x = p[h + 1], N = f ? (f.centre + a.centre) / 2 : 0, b = x ? (a.centre + x.centre) / 2 : r, c = Math.max(0, N), d = Math.min(r, b), s = Math.min(g, Math.max(0, d - c)), y = Math.min(
191
+ Math.max(a.centre - s / 2, c),
192
+ d - s
190
193
  );
191
- return { annotation: s.annotation, x: T, width: b };
194
+ return { annotation: a.annotation, x: y, width: s };
192
195
  });
193
196
  }
194
- function ne(t) {
195
- return Number.isFinite(t) ? Math.min(1, Math.max(0, t)) : 0;
197
+ function de(n) {
198
+ return Number.isFinite(n) ? Math.min(1, Math.max(0, n)) : 0;
196
199
  }
197
- function Te(t) {
198
- return t.filter((a) => a != null);
200
+ function _e(n) {
201
+ return n.filter((r) => r != null);
199
202
  }
200
- function Me() {
203
+ function He() {
201
204
  return typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
202
205
  }
203
- const Ce = pe(
206
+ const Pe = ve(
204
207
  ({
205
- id: t,
206
- data: a,
207
- variant: m = "line",
208
- size: l = "md",
209
- label: s,
210
- color: p,
211
- showEndpoint: h = !1,
212
- showTooltip: w = !1,
213
- width: k,
214
- height: g,
215
- annotations: r,
216
- onAnnotationSelect: i,
217
- className: b,
218
- ...T
219
- }, ae) => {
220
- var J;
221
- const { t: y, i18n: $ } = me(), j = ue(), x = A(
222
- () => `sparkline-${j.replace(/[^a-zA-Z0-9-_]/g, "")}`,
223
- [j]
224
- ), M = z(null), [_, re] = W(0), [se, ie] = W(te), u = A(() => Te(a), [a]), { direction: O } = ve(u), B = A(() => {
225
- const e = r && r.length > 0 ? y("sparkline.annotations", {
226
- list: r.map((v) => v.label).join(", ")
227
- }) : "", n = (v) => e ? `${v}. ${e}` : v;
228
- if (u.length === 0)
229
- return n(y("sparkline.noData", "No data"));
230
- const o = (v) => new Intl.NumberFormat($.language).format(v), f = y(`sparkline.direction.${O}`), d = {
231
- min: o(Math.min(...u)),
232
- max: o(Math.max(...u)),
233
- current: o(u[u.length - 1]),
234
- direction: f
208
+ id: n,
209
+ data: r,
210
+ variant: g = "line",
211
+ size: p = "md",
212
+ label: a,
213
+ color: h,
214
+ showEndpoint: f = !1,
215
+ showTooltip: x = !1,
216
+ seriesName: N,
217
+ pointLabels: b,
218
+ width: c,
219
+ height: d,
220
+ annotations: s,
221
+ onAnnotationSelect: y,
222
+ className: G,
223
+ ...L
224
+ }, ce) => {
225
+ var ne;
226
+ const { t: v, i18n: q } = xe(), Z = we(), w = _(
227
+ () => `sparkline-${Z.replace(/[^a-zA-Z0-9-_]/g, "")}`,
228
+ [Z]
229
+ ), T = k(null), [D, le] = $(0), [ue, pe] = $(oe), m = _(() => _e(r), [r]), { direction: F } = Te(m), J = _(() => {
230
+ const e = s && s.length > 0 ? v("sparkline.annotations", {
231
+ list: s.map((I) => I.label).join(", ")
232
+ }) : "", t = (I) => e ? `${I}. ${e}` : I;
233
+ if (m.length === 0)
234
+ return t(v("sparkline.noData", "No data"));
235
+ const i = (I) => new Intl.NumberFormat(q.language).format(I), l = v(`sparkline.direction.${F}`), o = {
236
+ min: i(Math.min(...m)),
237
+ max: i(Math.max(...m)),
238
+ current: i(m[m.length - 1]),
239
+ direction: l
235
240
  };
236
- return n(s ? y("sparkline.summary", { label: s, ...d }) : y("sparkline.summaryNoLabel", d));
237
- }, [u, r, s, O, $.language, y]), [C, oe] = W(
241
+ return t(a ? v("sparkline.summary", { label: a, ...o }) : v("sparkline.summaryNoLabel", o));
242
+ }, [m, s, a, F, q.language, v]), [C, he] = $(
238
243
  () => {
239
244
  try {
240
- return Q();
245
+ return re();
241
246
  } catch {
242
247
  return {};
243
248
  }
244
249
  }
245
250
  );
246
- S(() => {
251
+ H(() => {
247
252
  let e;
248
- const n = new MutationObserver(() => {
253
+ const t = new MutationObserver(() => {
249
254
  clearTimeout(e), e = setTimeout(() => {
250
255
  try {
251
- oe(Q());
256
+ he(re());
252
257
  } catch {
253
258
  }
254
259
  }, 50);
255
260
  });
256
- return n.observe(document.documentElement, {
261
+ return t.observe(document.documentElement, {
257
262
  attributes: !0,
258
263
  attributeFilter: ["class"]
259
264
  }), () => {
260
- clearTimeout(e), n.disconnect();
265
+ clearTimeout(e), t.disconnect();
261
266
  };
262
- }, []), S(() => {
263
- const e = M.current;
267
+ }, []), H(() => {
268
+ const e = T.current;
264
269
  if (!e) return;
265
- const n = () => {
266
- const f = getComputedStyle(e).getPropertyValue("--min-target-size"), d = Number.parseFloat(f);
267
- Number.isFinite(d) && d > 0 && ie(d);
270
+ const t = () => {
271
+ const l = getComputedStyle(e).getPropertyValue("--min-target-size"), o = Number.parseFloat(l);
272
+ Number.isFinite(o) && o > 0 && pe(o);
268
273
  };
269
- n();
270
- const o = new ResizeObserver((f) => {
271
- const d = f[0];
272
- d && re(Math.floor(d.contentRect.width)), n();
274
+ t();
275
+ const i = new ResizeObserver((l) => {
276
+ const o = l[0];
277
+ o && le(Math.floor(o.contentRect.width)), t();
273
278
  });
274
- return o.observe(e), () => o.disconnect();
275
- }, []), fe(M);
276
- const I = z(i);
277
- S(() => {
278
- I.current = i;
279
- }, [i]);
280
- const H = z(r);
281
- H.current = r;
282
- const P = z(a.length);
283
- S(() => {
284
- P.current = a.length;
285
- }, [a]);
286
- const D = A(
279
+ return i.observe(e), () => i.disconnect();
280
+ }, []), Ne(T);
281
+ const R = k(y);
282
+ H(() => {
283
+ R.current = y;
284
+ }, [y]);
285
+ const U = k(s);
286
+ U.current = s;
287
+ const V = N ?? a ?? "", Q = k(V);
288
+ Q.current = V;
289
+ const W = k(r.length), A = k({ shown: !1 }), O = k(!1);
290
+ H(() => {
291
+ var e;
292
+ W.current = r.length, O.current && (O.current = !1, A.current.shown && ((e = P.getChartByID(w)) == null || e.updateOptions({
293
+ tooltip: { x: { show: !0 } }
294
+ })));
295
+ }, [r, w]);
296
+ const B = _(
287
297
  () => ({
288
298
  updateSeries(e) {
289
- var n;
290
- (n = E.getChartByID(x)) == null || n.updateSeries([{ data: e }]), P.current = e.length;
299
+ const t = P.getChartByID(w);
300
+ t == null || t.updateSeries([{ name: Q.current, data: e }]), W.current = e.length, A.current.shown && (O.current = !0, t == null || t.updateOptions({ tooltip: { x: { show: !1 } } }));
291
301
  },
292
302
  updateOptions(e) {
293
- var n;
294
- (n = E.getChartByID(x)) == null || n.updateOptions(e);
303
+ var t;
304
+ (t = P.getChartByID(w)) == null || t.updateOptions(e);
295
305
  },
296
306
  async dataURI() {
297
- const e = E.getChartByID(x);
307
+ const e = P.getChartByID(w);
298
308
  return e ? (await e.dataURI()).imgURI : "";
299
309
  },
300
310
  selectAnnotation(e) {
301
- var o, f;
302
- (o = H.current) != null && o.some((d) => d.id === e) && ((f = I.current) == null || f.call(I, e));
311
+ var i, l;
312
+ (i = U.current) != null && i.some((o) => o.id === e) && ((l = R.current) == null || l.call(R, e));
303
313
  },
304
314
  // Read-back for the two preconditions `selectAnnotation` enforces
305
315
  // silently — without these an agent can check neither and gets no
306
316
  // signal from either failure.
307
- getAnnotationIds: () => (H.current ?? []).map((e) => e.id),
308
- isSelectable: () => I.current != null,
309
- getPointCount: () => P.current
317
+ getAnnotationIds: () => (U.current ?? []).map((e) => e.id),
318
+ isSelectable: () => R.current != null,
319
+ getPointCount: () => W.current
310
320
  }),
311
- [x]
321
+ [w]
312
322
  );
313
- he(ae, () => D, [D]), be(we, D, t);
314
- const F = p ?? ((J = C.colors) == null ? void 0 : J[0]) ?? "currentColor";
315
- if (u.length === 0)
316
- return /* @__PURE__ */ c(
323
+ ke(ce, () => B, [B]), Me(Ce, B, n);
324
+ const E = h ?? ((ne = C.colors) == null ? void 0 : ne[0]) ?? "currentColor";
325
+ if (m.length === 0)
326
+ return /* @__PURE__ */ u(
317
327
  "div",
318
328
  {
319
- ref: M,
329
+ ref: T,
320
330
  role: "img",
321
- "aria-label": B,
331
+ "aria-label": J,
322
332
  dir: "ltr",
323
- className: X({
324
- size: g !== void 0 ? "auto" : l,
325
- className: b
333
+ className: ae({
334
+ size: d !== void 0 ? "auto" : p,
335
+ className: G
326
336
  }),
327
337
  "data-component": "sparkline",
328
- "data-component-id": t,
329
- ...T
338
+ "data-component-id": n,
339
+ ...L
330
340
  }
331
341
  );
332
- const G = Me(), U = a.length > u.length, L = U ? a.flatMap((e, n) => e == null ? [] : [{ x: n, y: e }]) : u, de = {
342
+ const X = He(), S = r.length > m.length, Y = S ? r.flatMap((e, t) => e == null ? [] : [{ x: t, y: e }]) : m, me = S ? r.flatMap((e, t) => e == null ? [] : [t]) : void 0;
343
+ A.current = {
344
+ labels: b,
345
+ slotOf: me,
346
+ shown: x && b !== void 0
347
+ };
348
+ const fe = x ? {
349
+ enabled: !0,
350
+ x: b ? {
351
+ show: !0,
352
+ formatter: (e, t) => {
353
+ const { labels: i, slotOf: l } = A.current;
354
+ if (O.current || !i) return "";
355
+ const o = (t == null ? void 0 : t.dataPointIndex) ?? -1;
356
+ return i[l ? l[o] ?? -1 : o] ?? "";
357
+ }
358
+ } : (
359
+ // No labels: hide the title rather than show a raw index.
360
+ { show: !1 }
361
+ )
362
+ } : { enabled: !1 }, ge = {
333
363
  ...C,
334
364
  chart: {
335
365
  ...C.chart,
336
- id: x,
337
- type: m,
366
+ id: w,
367
+ type: g,
338
368
  sparkline: { enabled: !0 },
339
369
  toolbar: { show: !1 },
340
370
  animations: {
341
- enabled: !G,
371
+ enabled: !X,
342
372
  // A gapped series is re-rendered as {x, y} pairs, and Apex's
343
373
  // update tween interpolates between the old and new paths point by
344
374
  // point. Across a width change the two have different lengths and
345
375
  // the tween emits `d="… NaN …"` for a few frames. The finished
346
376
  // render is correct either way; switching the tween off keeps the
347
377
  // console clean.
348
- dynamicAnimation: { enabled: !G && !U }
378
+ dynamicAnimation: { enabled: !X && !S }
349
379
  },
350
380
  zoom: { enabled: !1 },
351
381
  parentHeightOffset: 0
352
382
  },
353
- colors: [F],
383
+ colors: [E],
354
384
  stroke: {
355
385
  curve: "smooth",
356
- width: m === "bar" ? 0 : 2
386
+ width: g === "bar" ? 0 : 2
357
387
  },
358
388
  fill: {
359
- opacity: m === "area" ? 0.15 : 1
389
+ opacity: g === "area" ? 0.15 : 1
360
390
  },
361
391
  xaxis: {
362
392
  crosshairs: { show: !1 },
363
393
  // Pin the extent to the slot count so a gap at either end still holds
364
394
  // its place — otherwise the plot would rescale to the measurements
365
395
  // and the annotation fractions would no longer mean the same thing.
366
- ...U ? { type: "numeric", min: 0, max: a.length - 1 } : {}
396
+ ...S ? { type: "numeric", min: 0, max: r.length - 1 } : {}
367
397
  },
368
- tooltip: { enabled: w },
369
- markers: h ? {
398
+ tooltip: fe,
399
+ markers: f ? {
370
400
  size: [0],
371
401
  discrete: [
372
402
  {
@@ -374,9 +404,9 @@ const Ce = pe(
374
404
  // removed — so this is the last MEASURED point, never a slot
375
405
  // the parameter was not measured at.
376
406
  seriesIndex: 0,
377
- dataPointIndex: L.length - 1,
378
- fillColor: F,
379
- strokeColor: F,
407
+ dataPointIndex: Y.length - 1,
408
+ fillColor: E,
409
+ strokeColor: E,
380
410
  size: 4
381
411
  }
382
412
  ]
@@ -387,40 +417,40 @@ const Ce = pe(
387
417
  // ApexCharts grid.padding uses physical keys (not CSS logical properties).
388
418
  // The chart wrapper enforces dir="ltr" so these always resolve correctly.
389
419
  padding: {
390
- top: N,
391
- right: N,
392
- bottom: N,
393
- left: N
420
+ top: M,
421
+ right: M,
422
+ bottom: M,
423
+ left: M
394
424
  }
395
425
  }
396
- }, ce = k ?? (_ > 0 ? _ : "100%"), le = g ?? Ie[l ?? "md"], R = r != null && r.length ? r : void 0, q = _ - N * 2, Z = i && R && q > 0 ? Ne(R, q, se) : void 0;
397
- return /* @__PURE__ */ V(
426
+ }, ye = c ?? (D > 0 ? D : "100%"), be = d ?? Se[p ?? "md"], z = s != null && s.length ? s : void 0, ee = D - M * 2, te = y && z && ee > 0 ? ze(z, ee, ue) : void 0;
427
+ return /* @__PURE__ */ K(
398
428
  "div",
399
429
  {
400
- ref: M,
430
+ ref: T,
401
431
  role: "img",
402
- "aria-label": B,
432
+ "aria-label": J,
403
433
  dir: "ltr",
404
- className: X({
405
- size: g !== void 0 ? "auto" : l,
406
- className: b
434
+ className: ae({
435
+ size: d !== void 0 ? "auto" : p,
436
+ className: G
407
437
  }),
408
438
  "data-component": "sparkline",
409
- "data-component-id": t,
410
- ...T,
439
+ "data-component-id": n,
440
+ ...L,
411
441
  children: [
412
- /* @__PURE__ */ c(
413
- ge,
442
+ /* @__PURE__ */ u(
443
+ Ie,
414
444
  {
415
- type: m,
416
- series: [{ data: L }],
417
- options: de,
418
- width: ce,
419
- height: le,
445
+ type: g,
446
+ series: [{ name: V, data: Y }],
447
+ options: ge,
448
+ width: ye,
449
+ height: be,
420
450
  "aria-hidden": "true"
421
451
  }
422
452
  ),
423
- R && /* Drawn over the plot rather than through ApexCharts' own xaxis
453
+ z && /* Drawn over the plot rather than through ApexCharts' own xaxis
424
454
  annotations: a fraction of the measured extent is the one
425
455
  positioning rule that survives series of different lengths, which
426
456
  is what makes a column of sparklines share an x. */
@@ -430,32 +460,32 @@ const Ce = pe(
430
460
  equal PLOT_EDGE_PADDING — Tailwind needs a static literal, so the
431
461
  two cannot share one source; change them together or the first and
432
462
  last annotation drift off the first and last data point. */
433
- /* @__PURE__ */ c("div", { className: "ds:pointer-events-none ds:absolute ds:inset-y-0 ds:inset-x-[2px]", children: /* @__PURE__ */ c(
463
+ /* @__PURE__ */ u("div", { className: "ds:pointer-events-none ds:absolute ds:inset-y-0 ds:inset-x-[2px]", children: /* @__PURE__ */ u(
434
464
  "svg",
435
465
  {
436
466
  "aria-hidden": "true",
437
467
  focusable: "false",
438
468
  "data-testid": "sparkline-annotations",
439
469
  className: "ds:size-full",
440
- children: R.map((e) => {
441
- const n = ne(e.position);
470
+ children: z.map((e) => {
471
+ const t = de(e.position);
442
472
  return (
443
473
  /* A nested viewport placed at a percentage of the plot: the
444
474
  one positioning rule that needs no measurement, so a column
445
475
  of sparklines shares an x whatever their widths. */
446
- /* @__PURE__ */ V(
476
+ /* @__PURE__ */ K(
447
477
  "svg",
448
478
  {
449
- x: `${n * 100}%`,
479
+ x: `${t * 100}%`,
450
480
  y: "0",
451
481
  width: "1",
452
482
  height: "100%",
453
483
  overflow: "visible",
454
484
  "data-annotation-id": e.id,
455
- "data-annotation-position": n,
456
- className: Y({ tone: e.tone }),
485
+ "data-annotation-position": t,
486
+ className: se({ tone: e.tone }),
457
487
  children: [
458
- /* @__PURE__ */ c(
488
+ /* @__PURE__ */ u(
459
489
  "line",
460
490
  {
461
491
  x1: 0,
@@ -465,14 +495,14 @@ const Ce = pe(
465
495
  className: "ds:[stroke:var(--annotation-color)] ds:[stroke-dasharray:2_3] ds:[stroke-width:1]"
466
496
  }
467
497
  ),
468
- /* @__PURE__ */ c(
498
+ /* @__PURE__ */ u(
469
499
  "path",
470
500
  {
471
- d: ye(
501
+ d: Re(
472
502
  e.shape ?? "diamond",
473
503
  0,
474
- ee,
475
- ee
504
+ ie,
505
+ ie
476
506
  ),
477
507
  className: "ds:[fill:var(--annotation-color)]"
478
508
  }
@@ -485,41 +515,41 @@ const Ce = pe(
485
515
  })
486
516
  }
487
517
  ) }),
488
- Z && i && /* Sized in px, not percentages: the target size is a measurement,
518
+ te && y && /* Sized in px, not percentages: the target size is a measurement,
489
519
  not a fraction of a box the reader can resize.
490
520
  `pointer-events-none` holds all the way down to the bands, so the
491
521
  only live pixels are the token-width each annotation owns. */
492
- /* @__PURE__ */ c(
522
+ /* @__PURE__ */ u(
493
523
  "div",
494
524
  {
495
- className: ke({
496
- size: g !== void 0 ? "auto" : l
525
+ className: Ae({
526
+ size: d !== void 0 ? "auto" : p
497
527
  }),
498
- children: /* @__PURE__ */ c(
528
+ children: /* @__PURE__ */ u(
499
529
  "svg",
500
530
  {
501
531
  "aria-hidden": "true",
502
532
  focusable: "false",
503
533
  "data-testid": "sparkline-annotation-hits",
504
534
  className: "ds:size-full",
505
- children: Z.map(({ annotation: e, x: n, width: o }) => /* @__PURE__ */ V(
535
+ children: te.map(({ annotation: e, x: t, width: i }) => /* @__PURE__ */ K(
506
536
  "g",
507
537
  {
508
538
  "data-annotation-hit-id": e.id,
509
- onClick: () => i(e.id),
510
- className: `ds:group ds:pointer-events-auto ds:cursor-pointer ${Y(
539
+ onClick: () => y(e.id),
540
+ className: `ds:group ds:pointer-events-auto ds:cursor-pointer ${se(
511
541
  { tone: e.tone }
512
542
  )}`,
513
543
  children: [
514
- /* @__PURE__ */ c("title", { children: y("sparkline.annotationAction", {
544
+ /* @__PURE__ */ u("title", { children: v("sparkline.annotationAction", {
515
545
  label: e.label
516
546
  }) }),
517
- /* @__PURE__ */ c(
547
+ /* @__PURE__ */ u(
518
548
  "rect",
519
549
  {
520
- x: n,
550
+ x: t,
521
551
  y: 0,
522
- width: o,
552
+ width: i,
523
553
  height: "100%",
524
554
  className: "ds:[fill:var(--annotation-color)] ds:opacity-0 ds:transition-opacity ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none ds:group-hover:opacity-20"
525
555
  }
@@ -532,12 +562,12 @@ const Ce = pe(
532
562
  )
533
563
  }
534
564
  ),
535
- h && /* @__PURE__ */ c(
565
+ f && /* @__PURE__ */ u(
536
566
  "span",
537
567
  {
538
568
  "aria-hidden": "true",
539
569
  className: "ds:pointer-events-none ds:absolute ds:end-0 ds:top-0 ds:text-[length:var(--font-size-xs)] ds:leading-none",
540
- children: xe[O]
570
+ children: Oe[F]
541
571
  }
542
572
  )
543
573
  ]
@@ -545,10 +575,10 @@ const Ce = pe(
545
575
  );
546
576
  }
547
577
  );
548
- Ce.displayName = "Sparkline";
578
+ Pe.displayName = "Sparkline";
549
579
  export {
550
- Ce as S,
551
- we as s,
552
- ve as u
580
+ Pe as S,
581
+ Ce as s,
582
+ Te as u
553
583
  };
554
- //# sourceMappingURL=sparkline-BmGcEyZO.js.map
584
+ //# sourceMappingURL=sparkline-Dx_sxK3J.js.map