@alfadocs/ui-kit-debug 1.40.0 → 1.41.1
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/_chunks/arrow-left-BfaGqVam.js +15 -0
- package/dist/_chunks/arrow-left-BfaGqVam.js.map +1 -0
- package/dist/_chunks/{calendar-workspace-SN23GsXX.js → calendar-workspace-Bx8xxvic.js} +18 -17
- package/dist/_chunks/{calendar-workspace-SN23GsXX.js.map → calendar-workspace-Bx8xxvic.js.map} +1 -1
- package/dist/_chunks/{contact-profile-card-Zt6WNg1u.js → contact-profile-card-C0WpwpVV.js} +38 -33
- package/dist/_chunks/contact-profile-card-C0WpwpVV.js.map +1 -0
- package/dist/_chunks/editor-overlay-DwNKaI22.js +93 -0
- package/dist/_chunks/editor-overlay-DwNKaI22.js.map +1 -0
- package/dist/_chunks/format-price-DAbh61Lz.js +51 -0
- package/dist/_chunks/format-price-DAbh61Lz.js.map +1 -0
- package/dist/_chunks/help-me-write-templates-B-m7zgJa.js +775 -0
- package/dist/_chunks/help-me-write-templates-B-m7zgJa.js.map +1 -0
- package/dist/_chunks/{marketplace-app-shell-d2EtcUbe.js → marketplace-app-shell-D_g9BaDI.js} +2 -2
- package/dist/_chunks/{marketplace-app-shell-d2EtcUbe.js.map → marketplace-app-shell-D_g9BaDI.js.map} +1 -1
- package/dist/_chunks/{money-BY-HmKhZ.js → money-BXLBIRVO.js} +2 -2
- package/dist/_chunks/{money-BY-HmKhZ.js.map → money-BXLBIRVO.js.map} +1 -1
- package/dist/_chunks/{notes-panel-CmTqIWlS.js → notes-panel-Daq5T_cS.js} +2 -2
- package/dist/_chunks/{notes-panel-CmTqIWlS.js.map → notes-panel-Daq5T_cS.js.map} +1 -1
- package/dist/_chunks/{panel-subview-Cc2Wtt7D.js → panel-subview-PMBRPFOa.js} +49 -59
- package/dist/_chunks/panel-subview-PMBRPFOa.js.map +1 -0
- package/dist/_chunks/{practice-results-D_jjzwgf.js → practice-results-D11Zpt27.js} +50 -45
- package/dist/_chunks/practice-results-D11Zpt27.js.map +1 -0
- package/dist/_chunks/rich-text-editor-DUMeifwc.js +3176 -0
- package/dist/_chunks/rich-text-editor-DUMeifwc.js.map +1 -0
- package/dist/_chunks/{sidebar-C-Gr2LL-.js → sidebar-ClTY9lLI.js} +160 -169
- package/dist/_chunks/sidebar-ClTY9lLI.js.map +1 -0
- package/dist/_chunks/{treatment-receipt-dUm99mdn.js → treatment-receipt-DU0OewqH.js} +2 -2
- package/dist/_chunks/{treatment-receipt-dUm99mdn.js.map → treatment-receipt-DU0OewqH.js.map} +1 -1
- package/dist/_chunks/trending-up-C_luYBzS.js +15 -0
- package/dist/_chunks/trending-up-C_luYBzS.js.map +1 -0
- package/dist/_chunks/wand-sparkles-DAjKyhz7.js +27 -0
- package/dist/_chunks/wand-sparkles-DAjKyhz7.js.map +1 -0
- package/dist/agent-catalog.json +87 -1
- package/dist/agent-i18n/en.json +7 -0
- package/dist/components/_shared/format-price.d.ts +6 -0
- package/dist/components/_shared/format-price.d.ts.map +1 -1
- package/dist/components/_shared/index.d.ts +1 -1
- package/dist/components/_shared/index.d.ts.map +1 -1
- package/dist/components/contact-profile-card/contact-profile-card.d.ts +2 -2
- package/dist/components/contact-profile-card/contact-profile-card.d.ts.map +1 -1
- package/dist/components/contact-profile-card/index.js +1 -1
- package/dist/components/editor-overlay/editor-overlay.d.ts.map +1 -1
- package/dist/components/editor-overlay/index.js +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/money/index.js +1 -1
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/panel-subview/index.js +1 -1
- package/dist/components/practice-results/index.js +1 -1
- package/dist/components/practice-results/practice-results.d.ts +2 -1
- package/dist/components/practice-results/practice-results.d.ts.map +1 -1
- package/dist/components/rich-text-editor/editor-toolbar.d.ts +6 -1
- package/dist/components/rich-text-editor/editor-toolbar.d.ts.map +1 -1
- package/dist/components/rich-text-editor/index.d.ts +1 -1
- package/dist/components/rich-text-editor/index.d.ts.map +1 -1
- package/dist/components/rich-text-editor/index.js +1 -1
- package/dist/components/rich-text-editor/rich-text-editor.d.ts +74 -0
- package/dist/components/rich-text-editor/rich-text-editor.d.ts.map +1 -1
- package/dist/components/sidebar/index.js +1 -1
- package/dist/components/treatment-receipt/index.js +1 -1
- package/dist/host-compat.css +13 -1
- package/dist/i18n/locales/ar.d.ts +80 -0
- package/dist/i18n/locales/ar.d.ts.map +1 -1
- package/dist/i18n/locales/ar.js +81 -1
- package/dist/i18n/locales/ar.js.map +1 -1
- package/dist/i18n/locales/de.d.ts +80 -0
- package/dist/i18n/locales/de.d.ts.map +1 -1
- package/dist/i18n/locales/de.js +81 -1
- package/dist/i18n/locales/de.js.map +1 -1
- package/dist/i18n/locales/el.d.ts +80 -0
- package/dist/i18n/locales/el.d.ts.map +1 -1
- package/dist/i18n/locales/el.js +81 -1
- package/dist/i18n/locales/el.js.map +1 -1
- package/dist/i18n/locales/en.d.ts +80 -0
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +81 -1
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/i18n/locales/es.d.ts +80 -0
- package/dist/i18n/locales/es.d.ts.map +1 -1
- package/dist/i18n/locales/es.js +81 -1
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +80 -0
- package/dist/i18n/locales/fr.d.ts.map +1 -1
- package/dist/i18n/locales/fr.js +81 -1
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hi.d.ts +80 -0
- package/dist/i18n/locales/hi.d.ts.map +1 -1
- package/dist/i18n/locales/hi.js +81 -1
- package/dist/i18n/locales/hi.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +80 -0
- package/dist/i18n/locales/it.d.ts.map +1 -1
- package/dist/i18n/locales/it.js +81 -1
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/ja.d.ts +80 -0
- package/dist/i18n/locales/ja.d.ts.map +1 -1
- package/dist/i18n/locales/ja.js +81 -1
- package/dist/i18n/locales/ja.js.map +1 -1
- package/dist/i18n/locales/nl.d.ts +80 -0
- package/dist/i18n/locales/nl.d.ts.map +1 -1
- package/dist/i18n/locales/nl.js +81 -1
- package/dist/i18n/locales/nl.js.map +1 -1
- package/dist/i18n/locales/pl.d.ts +80 -0
- package/dist/i18n/locales/pl.d.ts.map +1 -1
- package/dist/i18n/locales/pl.js +81 -1
- package/dist/i18n/locales/pl.js.map +1 -1
- package/dist/i18n/locales/pt.d.ts +80 -0
- package/dist/i18n/locales/pt.d.ts.map +1 -1
- package/dist/i18n/locales/pt.js +81 -1
- package/dist/i18n/locales/pt.js.map +1 -1
- package/dist/i18n/locales/ro.d.ts +80 -0
- package/dist/i18n/locales/ro.d.ts.map +1 -1
- package/dist/i18n/locales/ro.js +81 -1
- package/dist/i18n/locales/ro.js.map +1 -1
- package/dist/i18n/locales/ru.d.ts +80 -0
- package/dist/i18n/locales/ru.d.ts.map +1 -1
- package/dist/i18n/locales/ru.js +81 -1
- package/dist/i18n/locales/ru.js.map +1 -1
- package/dist/i18n/locales/sq.d.ts +80 -0
- package/dist/i18n/locales/sq.d.ts.map +1 -1
- package/dist/i18n/locales/sq.js +81 -1
- package/dist/i18n/locales/sq.js.map +1 -1
- package/dist/i18n/locales/sv.d.ts +80 -0
- package/dist/i18n/locales/sv.d.ts.map +1 -1
- package/dist/i18n/locales/sv.js +81 -1
- package/dist/i18n/locales/sv.js.map +1 -1
- package/dist/i18n/locales/tr.d.ts +80 -0
- package/dist/i18n/locales/tr.d.ts.map +1 -1
- package/dist/i18n/locales/tr.js +81 -1
- package/dist/i18n/locales/tr.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +80 -0
- package/dist/i18n/locales/zh.d.ts.map +1 -1
- package/dist/i18n/locales/zh.js +81 -1
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/index.js +141 -134
- package/dist/index.js.map +1 -1
- package/dist/locales/ar.json +81 -1
- package/dist/locales/de.json +81 -1
- package/dist/locales/el.json +81 -1
- package/dist/locales/en.json +81 -1
- package/dist/locales/es.json +81 -1
- package/dist/locales/fr.json +81 -1
- package/dist/locales/hi.json +81 -1
- package/dist/locales/it.json +81 -1
- package/dist/locales/ja.json +81 -1
- package/dist/locales/nl.json +81 -1
- package/dist/locales/pl.json +81 -1
- package/dist/locales/pt.json +81 -1
- package/dist/locales/ro.json +81 -1
- package/dist/locales/ru.json +81 -1
- package/dist/locales/sq.json +81 -1
- package/dist/locales/sv.json +81 -1
- package/dist/locales/tr.json +81 -1
- package/dist/locales/zh.json +81 -1
- package/dist/patterns/calendar/index.js +1 -1
- package/dist/patterns/help-me-write-templates/help-me-write-templates.d.ts +164 -0
- package/dist/patterns/help-me-write-templates/help-me-write-templates.d.ts.map +1 -0
- package/dist/patterns/help-me-write-templates/index.d.ts +3 -0
- package/dist/patterns/help-me-write-templates/index.d.ts.map +1 -0
- package/dist/patterns/help-me-write-templates/index.js +10 -0
- package/dist/patterns/help-me-write-templates/index.js.map +1 -0
- package/dist/patterns/marketplace-app-shell/index.js +1 -1
- package/dist/tokens.css +51 -42
- package/package.json +5 -1
- package/dist/_chunks/contact-profile-card-Zt6WNg1u.js.map +0 -1
- package/dist/_chunks/editor-overlay-9tcPXNWt.js +0 -89
- package/dist/_chunks/editor-overlay-9tcPXNWt.js.map +0 -1
- package/dist/_chunks/format-price-BkMEbeW3.js +0 -47
- package/dist/_chunks/format-price-BkMEbeW3.js.map +0 -1
- package/dist/_chunks/panel-subview-Cc2Wtt7D.js.map +0 -1
- package/dist/_chunks/practice-results-D_jjzwgf.js.map +0 -1
- package/dist/_chunks/rich-text-editor-BJ1-Lkao.js +0 -2719
- package/dist/_chunks/rich-text-editor-BJ1-Lkao.js.map +0 -1
- package/dist/_chunks/sidebar-C-Gr2LL-.js.map +0 -1
|
@@ -2,16 +2,16 @@ import { jsxs as f, jsx as e, Fragment as I } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef as le, useId as se, useMemo as ce } from "react";
|
|
3
3
|
import { c as de } from "./index-D2ZczOXr.js";
|
|
4
4
|
import { useTranslation as pe } from "react-i18next";
|
|
5
|
-
import { B as
|
|
5
|
+
import { B as P } from "./badge-BudgzTe_.js";
|
|
6
6
|
import { C as T } from "./card-DPmk26CL.js";
|
|
7
7
|
import { K as fe, a as ue } from "./key-value-pair-DaQI_LZB.js";
|
|
8
8
|
import { L as d } from "./link-CPb_pZPr.js";
|
|
9
|
-
import {
|
|
9
|
+
import { b as me } from "./format-price-DAbh61Lz.js";
|
|
10
10
|
import { u as he } from "./registry-DvAUVLHh.js";
|
|
11
11
|
import { S as F } from "./stethoscope-sZXGC43m.js";
|
|
12
|
-
import { H } from "./heart--qCA4ffe.js";
|
|
13
|
-
import { B as
|
|
14
|
-
import { S as
|
|
12
|
+
import { H as O } from "./heart--qCA4ffe.js";
|
|
13
|
+
import { B as H, L as _ } from "./languages-CZqBaPwI.js";
|
|
14
|
+
import { S as z } from "./shield-check-DCJALLVh.js";
|
|
15
15
|
import { G as B } from "./globe-sHBW1JN5.js";
|
|
16
16
|
import { M as E } from "./mail-BqXVF2zH.js";
|
|
17
17
|
import { M as K } from "./message-circle-Bepl9JT5.js";
|
|
@@ -62,20 +62,20 @@ const ge = {
|
|
|
62
62
|
function Ce(n) {
|
|
63
63
|
return n.replace(/[^\d+]/g, "");
|
|
64
64
|
}
|
|
65
|
-
function
|
|
65
|
+
function be(n, r) {
|
|
66
66
|
const a = `https://wa.me/${n}`;
|
|
67
67
|
return r ? `${a}?text=${encodeURIComponent(r)}` : a;
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function xe(n) {
|
|
70
70
|
return `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(n.line)}`;
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function Pe() {
|
|
73
73
|
if (typeof document > "u") return "4945a3";
|
|
74
74
|
const n = getComputedStyle(document.documentElement).getPropertyValue("--map-marker-color").trim(), r = /^#?([0-9a-fA-F]{6})$/.exec(n);
|
|
75
75
|
return r ? r[1] : "4945a3";
|
|
76
76
|
}
|
|
77
77
|
function ye({ apiKey: n, center: r, zoom: a, altText: s }) {
|
|
78
|
-
const c =
|
|
78
|
+
const c = Pe(), u = `https://maps.googleapis.com/maps/api/staticmap?center=${r.lat},${r.lng}&zoom=${a}&size=640x192&scale=2&markers=color:0x${c}%7C${r.lat},${r.lng}&key=${encodeURIComponent(n)}`;
|
|
79
79
|
return /* @__PURE__ */ e(
|
|
80
80
|
"img",
|
|
81
81
|
{
|
|
@@ -104,7 +104,7 @@ const ke = le(
|
|
|
104
104
|
insurances: v,
|
|
105
105
|
firstVisitPriceCents: C,
|
|
106
106
|
currencyCode: y = "EUR",
|
|
107
|
-
profession:
|
|
107
|
+
profession: b,
|
|
108
108
|
specializedInFearPatients: L,
|
|
109
109
|
googleMapsApiKey: k,
|
|
110
110
|
mapZoom: j = 14,
|
|
@@ -117,14 +117,19 @@ const ke = le(
|
|
|
117
117
|
mapSlot: X,
|
|
118
118
|
surface: w = "elevated",
|
|
119
119
|
"aria-label": Z,
|
|
120
|
-
id:
|
|
120
|
+
id: x,
|
|
121
121
|
className: ee,
|
|
122
122
|
...ae
|
|
123
123
|
}, te) => {
|
|
124
124
|
const { t, i18n: M } = pe(), $ = se(), A = M.language ?? "en", N = n ?? t("contactProfileCard.heading"), re = Z ?? N, R = ce(() => {
|
|
125
125
|
if (C != null)
|
|
126
|
-
return me(
|
|
127
|
-
|
|
126
|
+
return me(
|
|
127
|
+
C,
|
|
128
|
+
y,
|
|
129
|
+
A,
|
|
130
|
+
t("common.freeOfCharge")
|
|
131
|
+
);
|
|
132
|
+
}, [C, y, A, t]), o = [];
|
|
128
133
|
if (a && o.push({
|
|
129
134
|
key: "address",
|
|
130
135
|
icon: /* @__PURE__ */ e(G, { "aria-hidden": "true" }),
|
|
@@ -134,7 +139,7 @@ const ke = le(
|
|
|
134
139
|
a.lat != null && a.lng != null ? /* @__PURE__ */ e(
|
|
135
140
|
d,
|
|
136
141
|
{
|
|
137
|
-
href:
|
|
142
|
+
href: xe(a),
|
|
138
143
|
external: !0,
|
|
139
144
|
intent: "default",
|
|
140
145
|
onClick: D,
|
|
@@ -162,7 +167,7 @@ const ke = le(
|
|
|
162
167
|
value: /* @__PURE__ */ e(
|
|
163
168
|
d,
|
|
164
169
|
{
|
|
165
|
-
href:
|
|
170
|
+
href: be(c, u),
|
|
166
171
|
external: !0,
|
|
167
172
|
intent: "default",
|
|
168
173
|
onClick: W,
|
|
@@ -195,36 +200,36 @@ const ke = le(
|
|
|
195
200
|
};
|
|
196
201
|
o.push({
|
|
197
202
|
key: "languages",
|
|
198
|
-
icon: /* @__PURE__ */ e(
|
|
203
|
+
icon: /* @__PURE__ */ e(_, { "aria-hidden": "true" }),
|
|
199
204
|
label: t("contactProfileCard.label.languages"),
|
|
200
|
-
value: /* @__PURE__ */ e("span", { className: "ds:flex ds:flex-wrap ds:gap-[var(--spacing-2xs)]", children: g.map((l) => /* @__PURE__ */ e(
|
|
205
|
+
value: /* @__PURE__ */ e("span", { className: "ds:flex ds:flex-wrap ds:gap-[var(--spacing-2xs)]", children: g.map((l) => /* @__PURE__ */ e(P, { variant: "neutral", children: i(l) }, l)) })
|
|
201
206
|
});
|
|
202
207
|
}
|
|
203
208
|
v && v.length > 0 && o.push({
|
|
204
209
|
key: "insurances",
|
|
205
|
-
icon: /* @__PURE__ */ e(
|
|
210
|
+
icon: /* @__PURE__ */ e(z, { "aria-hidden": "true" }),
|
|
206
211
|
label: t("contactProfileCard.label.insurances"),
|
|
207
|
-
value: /* @__PURE__ */ e("span", { className: "ds:flex ds:flex-wrap ds:gap-[var(--spacing-2xs)]", children: v.map((i) => /* @__PURE__ */ e(
|
|
212
|
+
value: /* @__PURE__ */ e("span", { className: "ds:flex ds:flex-wrap ds:gap-[var(--spacing-2xs)]", children: v.map((i) => /* @__PURE__ */ e(P, { variant: "info", children: i }, i)) })
|
|
208
213
|
}), R && o.push({
|
|
209
214
|
key: "firstVisitPrice",
|
|
210
|
-
icon: /* @__PURE__ */ e(
|
|
215
|
+
icon: /* @__PURE__ */ e(H, { "aria-hidden": "true" }),
|
|
211
216
|
label: t("contactProfileCard.label.firstVisitPrice"),
|
|
212
|
-
value: /* @__PURE__ */ e(
|
|
217
|
+
value: /* @__PURE__ */ e(P, { variant: "accentSoft", size: "lg", children: R }),
|
|
213
218
|
alignValue: "end"
|
|
214
219
|
}), L && o.push({
|
|
215
220
|
key: "expertForAnxiousPatients",
|
|
216
|
-
icon: /* @__PURE__ */ e(
|
|
221
|
+
icon: /* @__PURE__ */ e(O, { "aria-hidden": "true" }),
|
|
217
222
|
label: t("contactProfileCard.label.expertForAnxiousPatients"),
|
|
218
223
|
value: t("contactProfileCard.value.yesShort")
|
|
219
|
-
}),
|
|
224
|
+
}), b && o.push({
|
|
220
225
|
key: "profession",
|
|
221
226
|
icon: /* @__PURE__ */ e(F, { "aria-hidden": "true" }),
|
|
222
227
|
label: t("contactProfileCard.label.profession"),
|
|
223
|
-
value:
|
|
228
|
+
value: b
|
|
224
229
|
}), he(
|
|
225
230
|
ge,
|
|
226
|
-
{ getProfession: () =>
|
|
227
|
-
|
|
231
|
+
{ getProfession: () => b },
|
|
232
|
+
x
|
|
228
233
|
);
|
|
229
234
|
const ne = !!k && (a == null ? void 0 : a.lat) !== void 0 && (a == null ? void 0 : a.lng) !== void 0 ? /* @__PURE__ */ e(
|
|
230
235
|
ye,
|
|
@@ -273,8 +278,8 @@ const ke = le(
|
|
|
273
278
|
"aria-label": re,
|
|
274
279
|
"aria-labelledby": $,
|
|
275
280
|
"data-component": "contact-profile-card",
|
|
276
|
-
"data-component-id":
|
|
277
|
-
id:
|
|
281
|
+
"data-component-id": x,
|
|
282
|
+
id: x,
|
|
278
283
|
className: ve({ surface: w, className: ee }),
|
|
279
284
|
...ae,
|
|
280
285
|
children: w === "elevated" ? /* @__PURE__ */ e(T, { variant: "elevated", children: /* @__PURE__ */ e(T.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: S }) }) : /* @__PURE__ */ e("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: S })
|
|
@@ -300,10 +305,10 @@ const Le = [
|
|
|
300
305
|
whatsapp: K,
|
|
301
306
|
email: E,
|
|
302
307
|
website: B,
|
|
303
|
-
languages:
|
|
304
|
-
insurances:
|
|
305
|
-
firstVisitPrice:
|
|
306
|
-
expertForAnxiousPatients:
|
|
308
|
+
languages: _,
|
|
309
|
+
insurances: z,
|
|
310
|
+
firstVisitPrice: H,
|
|
311
|
+
expertForAnxiousPatients: O,
|
|
307
312
|
profession: F
|
|
308
313
|
};
|
|
309
314
|
export {
|
|
@@ -312,4 +317,4 @@ export {
|
|
|
312
317
|
ke as b,
|
|
313
318
|
ge as c
|
|
314
319
|
};
|
|
315
|
-
//# sourceMappingURL=contact-profile-card-
|
|
320
|
+
//# sourceMappingURL=contact-profile-card-C0WpwpVV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contact-profile-card-C0WpwpVV.js","sources":["../../src/components/contact-profile-card/contact-profile-card.agent.ts","../../src/components/contact-profile-card/contact-profile-card.tsx"],"sourcesContent":["import type { AgentAdapter } from '../../agent/types';\nimport type { ContactProfileCardHandle } from './contact-profile-card';\n\n/* -------------------------------------------------------------------- */\n/* Agent adapter — ContactProfileCard */\n/* */\n/* Read-only adapter. Surfaces the rendered profession field so an */\n/* agent / MCP runtime can resolve \"what kind of practice is this?\" */\n/* without re-parsing the DOM. No actions yet — the card is a passive */\n/* presentation surface; navigation lives on the consumer's page. */\n/* -------------------------------------------------------------------- */\n\nexport const contactProfileCardAgent: AgentAdapter<ContactProfileCardHandle> = {\n id: 'contact-profile-card',\n // Passive presentation surface — only exposes the rendered profession for\n // introspection. No interactive capability is backed by the handle.\n capabilities: [],\n state: {\n profession: {\n type: 'string',\n descriptionKey: 'ui.agent.contactProfileCard.state.profession',\n description:\n 'Profession string the card is currently rendering — undefined when the consumer omitted it.',\n read: (handle) => handle.getProfession(),\n },\n },\n actions: {},\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'contact-profile-card',\n description: 'Marks the ContactProfileCard root region.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n },\n};\n","import {\n forwardRef,\n useId,\n useMemo,\n type ComponentPropsWithoutRef,\n type ReactElement,\n type ReactNode,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport {\n Banknote,\n ExternalLink,\n Globe,\n Heart,\n Languages as LanguagesIcon,\n Mail,\n MapPin,\n MessageCircle,\n Phone,\n ShieldCheck,\n Stethoscope,\n type LucideIcon,\n} from 'lucide-react';\nimport { Badge } from '../badge/badge';\nimport { Card } from '../card/card';\nimport { KeyValueList, KeyValuePair } from '../key-value-pair/key-value-pair';\nimport { Link } from '../link/link';\nimport { formatPriceOrFree } from '../_shared/format-price';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { contactProfileCardAgent } from './contact-profile-card.agent';\n\n/* -------------------------------------------------------------------- */\n/* ContactProfileCard */\n/* */\n/* Replaces the bespoke \"Profilo\" / \"Practice info\" cards that every */\n/* AlfaDocs surface composes by hand (booking-website PracticeInfoCard, */\n/* alfascribe operator pages, builders docs example, …). Composes Card */\n/* + KeyValueList + KeyValuePair so the labels share a column (no */\n/* zigzag values) and every row uses the same lucide icon family. */\n/* */\n/* The component is intentionally opinionated: every field is optional, */\n/* but the ORDER, ICONS, and LABELS are owned by the kit. Consumers */\n/* pass the data; the kit owns the visual + i18n. */\n/* */\n/* All visible text flows through `useTranslation('ui')` against the */\n/* `contactProfileCard.*` namespace. */\n/* -------------------------------------------------------------------- */\n\n/* -------------------------------------------------------------------- */\n/* CVA */\n/* -------------------------------------------------------------------- */\n\n// Override the KVP icon colour at the card root so every inner row's\n// leading glyph paints with `--accent` (brand magenta/violet) instead\n// of the default `--muted-foreground`. The ContactProfileCard is a\n// marketing surface — muted icons read as disabled against the\n// otherwise saturated card chrome. Scoped via CSS custom property so\n// only this card's icons shift; standalone KVPs elsewhere keep\n// `--muted-foreground`.\nconst rootVariants = cva(\n 'ds:w-full ds:text-[color:var(--foreground)] ds:[--key-value-pair-icon-color:var(--accent)]',\n {\n variants: {\n // Matches the kit's other `surface` props (Booking, ReviewsPanel).\n // The card itself renders `<Card variant=\"elevated\">` so the\n // `surface=\"flat\"` opt-out is rare — most consumers want the\n // boundary.\n surface: {\n flat: '',\n elevated: '',\n },\n },\n defaultVariants: { surface: 'elevated' },\n },\n);\n\n/* -------------------------------------------------------------------- */\n/* Public types */\n/* -------------------------------------------------------------------- */\n\nexport interface ContactProfileCardAddress {\n /** Display text — already formatted by the consumer (street, postcode, city). */\n line: string;\n /** Optional lat/lng — drives the static-map link + the embedded thumbnail. */\n lat?: number;\n lng?: number;\n}\n\nexport interface ContactProfileCardHandle {\n /** Resolved consumer-supplied data — useful for agent introspection. */\n getProfession: () => string | undefined;\n}\n\nexport interface ContactProfileCardProps extends Omit<\n ComponentPropsWithoutRef<'div'>,\n 'aria-label' | 'children' | 'children'\n> {\n /**\n * Override the localised \"Profilo\" / \"Profile\" heading. Most\n * consumers leave this unset.\n */\n heading?: string;\n /**\n * Free-text intro paragraph rendered above the data rows (e.g.\n * the practice's `bookingDescription` field). When omitted, the\n * card jumps straight into the data rows.\n */\n description?: string;\n\n /* ----- Identity rows ----- */\n\n /** Street + postcode + city, with optional lat/lng for the map link. */\n address?: ContactProfileCardAddress;\n /** Phone number, displayed as-is. Compiled into a `tel:` link. */\n phone?: string;\n /**\n * WhatsApp number — digits only (no `+`, no spaces). Compiled into\n * a `https://wa.me/<number>` link with an optional pre-filled message.\n */\n whatsappNumber?: string;\n /** Optional pre-filled WhatsApp message. Consumer-localised. */\n whatsappMessage?: string;\n /** Public-facing email. Compiled into a `mailto:` link. */\n email?: string;\n /** Practice website (already an absolute URL with protocol). */\n website?: string;\n\n /* ----- Embedded map thumbnail ----- */\n\n /**\n * Google Maps Static API key. When provided alongside `address.lat`\n * and `address.lng`, renders a static-map thumbnail at the top of\n * the card — a single one-shot `<img>` fetch, no JS SDK boot, no\n * consent gate needed (the same pattern PracticeResults uses).\n *\n * Without it (or without coords), the card renders info rows only —\n * the address row's \"Open in Google Maps\" link is still emitted as\n * a real `<a>` so the spatial cue isn't lost.\n *\n * Additive — existing consumers that don't pass this prop see the\n * same render as before.\n */\n googleMapsApiKey?: string;\n /**\n * Zoom level for the embedded map thumbnail. Default `14` —\n * neighbourhood-level, shows the pin in context. Ignored when the\n * thumbnail isn't rendered.\n */\n mapZoom?: number;\n\n /* ----- Profile metadata ----- */\n\n /**\n * ISO 639-1 language codes the practice speaks. Rendered as\n * `<Badge variant=\"neutral\">` chips. Each code is auto-resolved\n * into the active locale's native language name via the kit's\n * built-in `languages.<iso>` i18n bundle (18 ISO codes × 18\n * locales). For example `languages={['it', 'en']}` with\n * `i18n.language === 'it'` renders \"Italiano\" + \"Inglese\".\n *\n * Unknown / unbundled codes fall back to the uppercase ISO code\n * (`'xyz'` → `'XYZ'`). To override a specific label — regional\n * dialect, brand-voice variant, codes the kit doesn't ship — pass\n * `languageLabels`.\n */\n languages?: string[];\n /**\n * Override map from ISO code → display label, applied on top of\n * the kit's i18n auto-resolution. Only set when you need a\n * consumer-specific label for a code — the typical case is\n * regional dialect / brand-voice variants / non-ISO codes.\n *\n * Resolution order: `languageLabels[code]` > `t('languages.<code>')`\n * > `code.toUpperCase()`.\n */\n languageLabels?: Record<string, string>;\n /**\n * Insurance / convention strings (consumer-supplied, free text).\n * Rendered as `<Badge variant=\"info\">` chips.\n */\n insurances?: string[];\n /**\n * First-visit price in the smallest currency unit (cents / centesimi).\n * Formatted via `Intl.NumberFormat`; `0` renders the translated word\n * \"Free\". Omit when the consumer doesn't want to show the price.\n */\n firstVisitPriceCents?: number;\n /** ISO-4217 currency code for the price formatter. Defaults to `EUR`. */\n currencyCode?: string;\n /** Profession line — single value or already-joined comma list. */\n profession?: string;\n /** Show the \"expert for anxious patients\" row when true. */\n specializedInFearPatients?: boolean;\n\n /* ----- Telemetry hooks ----- */\n\n /**\n * Fires when the patient clicks the phone link. The kit emits a\n * `track('practice_profile_card_phone_click')` event before\n * invoking this — gate consumer-side analytics on the same event\n * to avoid duplicate fires.\n */\n onPhoneClick?: () => void;\n /** Fires when the patient clicks the WhatsApp link. */\n onWhatsAppClick?: () => void;\n /** Fires when the patient clicks the static-map link. */\n onMapClick?: () => void;\n /** Fires when the patient clicks the email mailto link. */\n onEmailClick?: () => void;\n\n /* ----- Slots ----- */\n\n /**\n * Rendered above the heading — e.g. a `<Avatar>` for the operator\n * variant, or a coloured chip strip. Optional.\n */\n headerSlot?: ReactNode;\n /**\n * Render an arbitrary map widget at the top of the card chrome —\n * replaces the built-in static `<img>` thumbnail that\n * `googleMapsApiKey` would otherwise produce. Use this when you\n * want an interactive map inside the card boundary instead of a\n * fixed image:\n *\n * <ContactProfileCard\n * mapSlot={\n * <PracticeMap practice={practice} googleMapsApiKey={key} />\n * }\n * …\n * />\n *\n * When both `mapSlot` and `googleMapsApiKey` are provided, the slot\n * wins (explicit > implicit). When neither is provided, no map area\n * renders. The slot is unstyled — pass through any container chrome\n * the consumer wants (e.g. a fixed height wrapper). The kit\n * positions it where the static thumbnail would have lived.\n */\n mapSlot?: ReactNode;\n /**\n * Rendered at the end of the card body, below the rows. Use for\n * a \"Book now\" `<Button>` or a \"View full profile\" link.\n */\n footerSlot?: ReactNode;\n\n /* ----- Styling ----- */\n\n /**\n * `'elevated'` (default) wraps the card in `<Card variant=\"elevated\">`\n * for a defined surface — what most consumers want when the card\n * stands alone on a page. `'flat'` drops the Card chrome so the\n * content sits naked — use when an outer card / sheet already\n * provides the boundary (e.g. embedded inside a `<Sheet>` or a\n * parent `<Card.Body>`).\n */\n surface?: 'flat' | 'elevated';\n\n /* ----- a11y ----- */\n\n /** Override the default region aria-label. */\n 'aria-label'?: string;\n /** Agent-readiness consumer id, surfaced as `data-component-id`. */\n id?: string;\n}\n\n/* -------------------------------------------------------------------- */\n/* Helpers */\n/* -------------------------------------------------------------------- */\n\n/** Strip everything except digits + leading `+` for `tel:` URLs. */\nfunction normalisePhone(raw: string): string {\n return raw.replace(/[^\\d+]/g, '');\n}\n\n/** Build the WhatsApp `wa.me` URL. Number must already be digits-only. */\nfunction buildWhatsAppHref(number: string, message?: string): string {\n const base = `https://wa.me/${number}`;\n if (!message) return base;\n return `${base}?text=${encodeURIComponent(message)}`;\n}\n\n/** Google Maps search query — works without an API key. */\nfunction buildMapHref(address: ContactProfileCardAddress): string {\n const q = encodeURIComponent(address.line);\n return `https://www.google.com/maps/search/?api=1&query=${q}`;\n}\n\n/* -------------------------------------------------------------------- */\n/* MapThumbStrip — embedded Google Static Maps image */\n/* */\n/* Full-width strip rendered at the top of the card when the consumer */\n/* supplies both `address.lat`/`lng` and `googleMapsApiKey`. Same */\n/* one-shot `<img>` strategy as PracticeResults' StaticMapThumb (no JS */\n/* SDK boot → no consent gate needed), but full-card-width instead of */\n/* a 12rem aside. */\n/* -------------------------------------------------------------------- */\n\ninterface MapThumbStripProps {\n apiKey: string;\n center: { lat: number; lng: number };\n zoom: number;\n altText: string;\n}\n\n/**\n * Resolve the kit's `--map-marker-color` token to a six-character hex\n * string (no leading `#`) for Google Static Maps' `markers=color:` URL\n * parameter, which requires a literal hex value at fetch time.\n *\n * SSR-safe: when `document` is undefined we fall back to the kit's\n * brand violet. Same helper as PracticeResults — keep in sync if you\n * touch one.\n */\nfunction getStaticMapMarkerHex(): string {\n if (typeof document === 'undefined') return '4945a3';\n const raw = getComputedStyle(document.documentElement)\n .getPropertyValue('--map-marker-color')\n .trim();\n const match = /^#?([0-9a-fA-F]{6})$/.exec(raw);\n return match ? match[1] : '4945a3';\n}\n\nfunction MapThumbStrip({ apiKey, center, zoom, altText }: MapThumbStripProps) {\n // 640×192 keeps the asset under Google's 1MP free tier at scale=2\n // (1280×384 actual) and matches the strip's 12rem height at a\n // ~3.33:1 aspect ratio. Marker colour resolves from the kit's\n // `--map-marker-color` token at runtime so the value still lives\n // in `src/tokens/**` per the closed-palette constraint.\n const markerHex = getStaticMapMarkerHex();\n const src =\n `https://maps.googleapis.com/maps/api/staticmap` +\n `?center=${center.lat},${center.lng}` +\n `&zoom=${zoom}` +\n `&size=640x192&scale=2` +\n `&markers=color:0x${markerHex}%7C${center.lat},${center.lng}` +\n `&key=${encodeURIComponent(apiKey)}`;\n return (\n <img\n src={src}\n alt={altText}\n loading=\"lazy\"\n decoding=\"async\"\n width={640}\n height={192}\n className=\"ds:block ds:inline-size-full ds:block-size-[12rem] ds:[object-fit:cover] ds:rounded-[var(--radius-md)]\"\n />\n );\n}\n\n/* -------------------------------------------------------------------- */\n/* Component */\n/* -------------------------------------------------------------------- */\n\nexport const ContactProfileCard = forwardRef<\n HTMLDivElement,\n ContactProfileCardProps\n>(\n (\n {\n heading,\n description,\n address,\n phone,\n whatsappNumber,\n whatsappMessage,\n email,\n website,\n languages,\n languageLabels,\n insurances,\n firstVisitPriceCents,\n currencyCode = 'EUR',\n profession,\n specializedInFearPatients,\n googleMapsApiKey,\n mapZoom = 14,\n onPhoneClick,\n onWhatsAppClick,\n onMapClick,\n onEmailClick,\n headerSlot,\n footerSlot,\n mapSlot,\n surface = 'elevated',\n 'aria-label': ariaLabel,\n id,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation();\n const headingId = useId();\n const locale = i18n.language ?? 'en';\n\n const resolvedHeading = heading ?? t('contactProfileCard.heading');\n const resolvedAriaLabel = ariaLabel ?? resolvedHeading;\n\n const formattedPrice = useMemo(() => {\n if (firstVisitPriceCents == null) return undefined;\n // 0 is a free first visit: the chip reads \"Free\", not \"€0.00\".\n return formatPriceOrFree(\n firstVisitPriceCents,\n currencyCode,\n locale,\n t('common.freeOfCharge'),\n );\n }, [firstVisitPriceCents, currencyCode, locale, t]);\n\n // Compose the rows in display order. Each `row` carries the icon +\n // localised label + the rendered value. Skipping a field is just\n // omitting the row — `KeyValueList` collapses the subgrid cleanly.\n const rows: Array<{\n key: string;\n icon: ReactElement;\n label: string;\n value: ReactNode;\n alignValue?: 'start' | 'end';\n }> = [];\n\n if (address) {\n rows.push({\n key: 'address',\n icon: <MapPin aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.address'),\n value: (\n <span className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]\">\n <span>{address.line}</span>\n {address.lat != null && address.lng != null ? (\n <Link\n href={buildMapHref(address)}\n external\n intent=\"default\"\n onClick={onMapClick}\n >\n {t('contactProfileCard.openInGoogleMaps')}\n </Link>\n ) : null}\n </span>\n ),\n });\n }\n\n if (phone) {\n rows.push({\n key: 'phone',\n icon: <Phone aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.phone'),\n value: (\n <Link\n href={`tel:${normalisePhone(phone)}`}\n intent=\"default\"\n onClick={onPhoneClick}\n >\n {phone}\n </Link>\n ),\n });\n }\n\n if (whatsappNumber) {\n rows.push({\n key: 'whatsapp',\n icon: <MessageCircle aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.whatsapp'),\n value: (\n <Link\n href={buildWhatsAppHref(whatsappNumber, whatsappMessage)}\n external\n intent=\"default\"\n onClick={onWhatsAppClick}\n >\n {whatsappNumber}\n </Link>\n ),\n });\n }\n\n if (email) {\n rows.push({\n key: 'email',\n icon: <Mail aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.email'),\n value: (\n <Link\n href={`mailto:${email}`}\n intent=\"default\"\n onClick={onEmailClick}\n >\n {email}\n </Link>\n ),\n });\n }\n\n if (website) {\n rows.push({\n key: 'website',\n icon: <Globe aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.website'),\n value: (\n <Link href={website} external intent=\"default\">\n {website}\n </Link>\n ),\n });\n }\n\n if (languages && languages.length > 0) {\n // Resolution order, highest to lowest:\n // 1. consumer `languageLabels` override — for regional dialects,\n // brand-voice variants, or codes the kit doesn't ship.\n // 2. kit i18n bundle (`languages.<iso>`) — auto-resolves the 18\n // ISO codes the kit ships into the active locale's native\n // language name. Retires consumer-side ISO→label plumbing.\n // 3. uppercase fallback for unknown codes that the consumer\n // didn't override.\n const resolveLabel = (code: string): string => {\n if (languageLabels?.[code]) return languageLabels[code];\n const key = `languages.${code}`;\n if (i18n.exists(key)) return t(key);\n return code.toUpperCase();\n };\n rows.push({\n key: 'languages',\n icon: <LanguagesIcon aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.languages'),\n value: (\n <span className=\"ds:flex ds:flex-wrap ds:gap-[var(--spacing-2xs)]\">\n {languages.map((code) => (\n <Badge key={code} variant=\"neutral\">\n {resolveLabel(code)}\n </Badge>\n ))}\n </span>\n ),\n });\n }\n\n if (insurances && insurances.length > 0) {\n rows.push({\n key: 'insurances',\n icon: <ShieldCheck aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.insurances'),\n value: (\n <span className=\"ds:flex ds:flex-wrap ds:gap-[var(--spacing-2xs)]\">\n {insurances.map((ins) => (\n <Badge key={ins} variant=\"info\">\n {ins}\n </Badge>\n ))}\n </span>\n ),\n });\n }\n\n if (formattedPrice) {\n // The one figure on this card a patient compares between\n // practices, so it gets a chip and is pinned to the row's end.\n // Left as body text where the label happens to stop, its\n // position shifts card to card and the eye has to hunt for it.\n // `accentSoft`, not `brand`. The languages and insurance rows on\n // this card are tonal chips (`neutral` and `info`), so a solid\n // `brand` fill would read as a different class of object rather\n // than the same family. `accentSoft` is the same tonal recipe in\n // the most distinct hue on the card, so the price still leads.\n // `lg` because `md` sets the label at the smallest step of the\n // ramp, and `.theme-accessible` cannot lift it — the one figure\n // patients compare should not be the smallest text on the card.\n rows.push({\n key: 'firstVisitPrice',\n icon: <Banknote aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.firstVisitPrice'),\n value: (\n <Badge variant=\"accentSoft\" size=\"lg\">\n {formattedPrice}\n </Badge>\n ),\n alignValue: 'end',\n });\n }\n\n if (specializedInFearPatients) {\n rows.push({\n key: 'expertForAnxiousPatients',\n icon: <Heart aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.expertForAnxiousPatients'),\n value: t('contactProfileCard.value.yesShort'),\n });\n }\n\n if (profession) {\n rows.push({\n key: 'profession',\n icon: <Stethoscope aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.profession'),\n value: profession,\n });\n }\n\n // Imperative handle for agent integrations.\n useAgentRegistration(\n contactProfileCardAgent,\n { getProfession: () => profession },\n id,\n );\n\n // Embedded static-map thumbnail. Renders only when the consumer\n // supplies BOTH a usable lat/lng pair AND a `googleMapsApiKey`.\n // The d.ts-promised behaviour; without a key the strip is silently\n // omitted and the address row's \"Open in Google Maps\" link still\n // emits as the spatial-cue fallback.\n const showMapThumb =\n !!googleMapsApiKey &&\n address?.lat !== undefined &&\n address?.lng !== undefined;\n const mapThumb = showMapThumb ? (\n <MapThumbStrip\n apiKey={googleMapsApiKey!}\n center={{ lat: address!.lat!, lng: address!.lng! }}\n zoom={mapZoom}\n altText={t('contactProfileCard.map.alt', {\n address: address!.line,\n defaultValue: 'Map showing {{address}}',\n })}\n />\n ) : null;\n\n // Map area: explicit consumer slot wins over the implicit\n // googleMapsApiKey-driven static thumbnail. 0.33.4 introduces the\n // slot so consumers can embed an interactive <MapView> /\n // <PracticeMap> wrapper inside the card chrome instead of the\n // fixed static <img>. When neither is set the area renders as\n // nothing. 0.33.6 moves the area from above the heading to below\n // the data rows — the map reads as the spatial closer (\"here it\n // is on the map\") rather than a stylised hero, and any CTA in\n // footerSlot still lands at the very bottom.\n const mapArea = mapSlot ?? mapThumb;\n\n const body = (\n <>\n {description ? (\n <p className=\"type-body-sm ds:m-0 ds:whitespace-pre-line\">\n {description}\n </p>\n ) : null}\n {rows.length > 0 ? (\n <KeyValueList rowGap=\"md\">\n {rows.map((row) => (\n <KeyValuePair\n key={row.key}\n icon={row.icon}\n label={row.label}\n value={row.value}\n alignValue={row.alignValue}\n />\n ))}\n </KeyValueList>\n ) : null}\n {mapArea}\n {footerSlot}\n </>\n );\n\n // `surface=\"flat\"` skips the Card wrapper — the consumer is\n // already inside a Card / Sheet and doesn't want a double border.\n const inner = (\n <>\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]\">\n {headerSlot}\n <h2\n id={headingId}\n className=\"type-title-card ds:m-0 ds:text-[color:var(--foreground)]\"\n >\n {resolvedHeading}\n </h2>\n </div>\n {body}\n </>\n );\n\n return (\n <div\n ref={ref}\n role=\"region\"\n aria-label={resolvedAriaLabel}\n aria-labelledby={headingId}\n data-component=\"contact-profile-card\"\n data-component-id={id}\n id={id}\n className={rootVariants({ surface, className })}\n {...rest}\n >\n {surface === 'elevated' ? (\n <Card variant=\"elevated\">\n <Card.Body className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\">\n {inner}\n </Card.Body>\n </Card>\n ) : (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\">\n {inner}\n </div>\n )}\n </div>\n );\n },\n);\n\nContactProfileCard.displayName = 'ContactProfileCard';\n\n// Helper export so consumers can mirror the kit's row order if they\n// need to compose a partial alternative (rare).\nexport const CONTACT_PROFILE_CARD_ROW_KEYS = [\n 'address',\n 'phone',\n 'whatsapp',\n 'email',\n 'website',\n 'languages',\n 'insurances',\n 'firstVisitPrice',\n 'expertForAnxiousPatients',\n 'profession',\n] as const;\n\n// Defensive icon export so consumers can render the same glyph\n// outside the card if they need it for consistency.\nexport const CONTACT_PROFILE_CARD_ROW_ICONS: Record<\n (typeof CONTACT_PROFILE_CARD_ROW_KEYS)[number],\n LucideIcon\n> = {\n address: MapPin,\n phone: Phone,\n whatsapp: MessageCircle,\n email: Mail,\n website: Globe,\n languages: LanguagesIcon,\n insurances: ShieldCheck,\n firstVisitPrice: Banknote,\n expertForAnxiousPatients: Heart,\n profession: Stethoscope,\n};\n\n// Re-exports of the rootVariants type for downstream typing.\nexport type ContactProfileCardSurface = NonNullable<\n VariantProps<typeof rootVariants>['surface']\n>;\n\n// ExternalLink is exported by lucide-react and used elsewhere in the\n// kit; re-exporting here so consumers don't have to add it as a\n// peer-dep import for icon parity in their own UIs.\nexport { ExternalLink };\n"],"names":["contactProfileCardAgent","handle","rootVariants","cva","normalisePhone","raw","buildWhatsAppHref","number","message","base","buildMapHref","address","getStaticMapMarkerHex","match","MapThumbStrip","apiKey","center","zoom","altText","markerHex","src","jsx","ContactProfileCard","forwardRef","heading","description","phone","whatsappNumber","whatsappMessage","email","website","languages","languageLabels","insurances","firstVisitPriceCents","currencyCode","profession","specializedInFearPatients","googleMapsApiKey","mapZoom","onPhoneClick","onWhatsAppClick","onMapClick","onEmailClick","headerSlot","footerSlot","mapSlot","surface","ariaLabel","id","className","rest","ref","i18n","useTranslation","headingId","useId","locale","resolvedHeading","resolvedAriaLabel","formattedPrice","useMemo","formatPriceOrFree","rows","MapPin","jsxs","Link","Phone","MessageCircle","Mail","Globe","resolveLabel","code","key","LanguagesIcon","Badge","ShieldCheck","ins","Banknote","Heart","Stethoscope","useAgentRegistration","mapThumb","mapArea","body","Fragment","KeyValueList","row","KeyValuePair","inner","Card","CONTACT_PROFILE_CARD_ROW_KEYS","CONTACT_PROFILE_CARD_ROW_ICONS"],"mappings":";;;;;;;;;;;;;;;;;;;AAYO,MAAMA,KAAkE;AAAA,EAC7E,IAAI;AAAA;AAAA;AAAA,EAGJ,cAAc,CAAA;AAAA,EACd,OAAO;AAAA,IACL,YAAY;AAAA,MACV,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,cAAA;AAAA,IAAc;AAAA,EACzC;AAAA,EAEF,SAAS,CAAA;AAAA,EACT,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aAAa;AAAA,IAAA;AAAA,IAEf,YAAY;AAAA,MACV,MAAM;AAAA,MACN,YAAY;AAAA,MACZ,aAAa;AAAA,IAAA;AAAA,EACf;A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AAAA,EACA;AAAA,EACA;AACF,GAIaC,KAGT;AAAA,EACF,SAAS5B;AAAA,EACT,OAAOG;AAAA,EACP,UAAUC;AAAA,EACV,OAAOC;AAAA,EACP,SAASC;AAAA,EACT,WAAWI;AAAAA,EACX,YAAYE;AAAA,EACZ,iBAAiBE;AAAA,EACjB,0BAA0BC;AAAA,EAC1B,YAAYC;AACd;"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { jsx as r, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as o, useId as k, useEffect as v, useCallback as E } from "react";
|
|
3
|
+
import { useTranslation as j } from "react-i18next";
|
|
4
|
+
import { c as I } from "./index-D2ZczOXr.js";
|
|
5
|
+
import { I as N } from "./icon-button-CehAeZoP.js";
|
|
6
|
+
import { X as z } from "./x-B5YnXwCz.js";
|
|
7
|
+
const R = I(
|
|
8
|
+
[
|
|
9
|
+
// Spans the editor's block-end edge (a docked bar) and expands from the pill.
|
|
10
|
+
"ds:absolute ds:z-20",
|
|
11
|
+
"ds:[inset-inline-start:var(--spacing-md)] ds:[inset-inline-end:var(--spacing-md)]",
|
|
12
|
+
"ds:[inset-block-end:var(--spacing-md)]",
|
|
13
|
+
// Slim docked bar — compact but with a little breathing room.
|
|
14
|
+
"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
|
|
15
|
+
"ds:p-[var(--spacing-md)]",
|
|
16
|
+
"ds:rounded-[var(--radius-lg)]",
|
|
17
|
+
// Apple "Liquid Glass": a translucent base + backdrop blur/saturate so the
|
|
18
|
+
// editor shows through, a specular top "rim" + inner hairline ring, and a
|
|
19
|
+
// soft drop shadow for a floating slab. --card-border is theme-aware (dark
|
|
20
|
+
// hairline on light themes, bright on dark), so the rim reads in all four.
|
|
21
|
+
"ds:bg-[color-mix(in_srgb,var(--popover)_64%,transparent)]",
|
|
22
|
+
"ds:backdrop-blur-xl ds:backdrop-saturate-150",
|
|
23
|
+
"ds:border ds:border-[color-mix(in_srgb,var(--card-border)_70%,transparent)]",
|
|
24
|
+
"ds:shadow-[inset_0_1px_0_0_var(--card-border),inset_0_0_0_1px_color-mix(in_srgb,var(--card-border)_35%,transparent),var(--shadow-lg)]",
|
|
25
|
+
// Liquid-glass grow out of the pill (bottom-inline-end origin).
|
|
26
|
+
"ds:origin-bottom-right ds:animate-in ds:fade-in-0 ds:zoom-in-95",
|
|
27
|
+
"ds:motion-reduce:animate-none"
|
|
28
|
+
].join(" ")
|
|
29
|
+
), F = "ds:text-[length:var(--font-size-base)] ds:font-medium ds:text-[color:var(--foreground)]";
|
|
30
|
+
function D({
|
|
31
|
+
open: d,
|
|
32
|
+
onClose: s,
|
|
33
|
+
title: n,
|
|
34
|
+
ariaLabel: b,
|
|
35
|
+
children: g,
|
|
36
|
+
footer: i,
|
|
37
|
+
id: x,
|
|
38
|
+
className: _
|
|
39
|
+
}) {
|
|
40
|
+
const { t: h } = j(), t = o(null), c = o(null), l = k(), m = o(s);
|
|
41
|
+
v(() => {
|
|
42
|
+
m.current = s;
|
|
43
|
+
}, [s]);
|
|
44
|
+
const w = E(() => s(), [s]);
|
|
45
|
+
return v(() => {
|
|
46
|
+
if (!d) return;
|
|
47
|
+
c.current = document.activeElement;
|
|
48
|
+
const y = window.requestAnimationFrame(() => {
|
|
49
|
+
var a, f;
|
|
50
|
+
(f = ((a = t.current) == null ? void 0 : a.querySelector(
|
|
51
|
+
'input, textarea, button, [tabindex]:not([tabindex="-1"])'
|
|
52
|
+
)) ?? t.current) == null || f.focus();
|
|
53
|
+
}), u = (e) => {
|
|
54
|
+
e.key === "Escape" && !e.defaultPrevented && (e.stopPropagation(), m.current());
|
|
55
|
+
};
|
|
56
|
+
return document.addEventListener("keydown", u), () => {
|
|
57
|
+
var e, a;
|
|
58
|
+
window.cancelAnimationFrame(y), document.removeEventListener("keydown", u), (a = (e = c.current) == null ? void 0 : e.focus) == null || a.call(e);
|
|
59
|
+
};
|
|
60
|
+
}, [d]), d ? /* @__PURE__ */ r("div", { "data-component": "editor-overlay", "data-component-id": x, children: /* @__PURE__ */ p(
|
|
61
|
+
"div",
|
|
62
|
+
{
|
|
63
|
+
ref: t,
|
|
64
|
+
role: "dialog",
|
|
65
|
+
"aria-modal": "false",
|
|
66
|
+
"aria-labelledby": n ? l : void 0,
|
|
67
|
+
"aria-label": n ? void 0 : b,
|
|
68
|
+
tabIndex: -1,
|
|
69
|
+
className: [R(), _].filter(Boolean).join(" "),
|
|
70
|
+
children: [
|
|
71
|
+
n ? /* @__PURE__ */ p("div", { className: "ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
|
|
72
|
+
/* @__PURE__ */ r("div", { id: l, className: F, children: n }),
|
|
73
|
+
/* @__PURE__ */ r(
|
|
74
|
+
N,
|
|
75
|
+
{
|
|
76
|
+
size: "sm",
|
|
77
|
+
intent: "ghost",
|
|
78
|
+
icon: /* @__PURE__ */ r(z, {}),
|
|
79
|
+
"aria-label": h("common.close"),
|
|
80
|
+
onClick: w
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
] }) : null,
|
|
84
|
+
/* @__PURE__ */ r("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: g }),
|
|
85
|
+
i ? /* @__PURE__ */ r("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:justify-end ds:gap-[var(--spacing-sm)]", children: i }) : null
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
) }) : null;
|
|
89
|
+
}
|
|
90
|
+
export {
|
|
91
|
+
D as E
|
|
92
|
+
};
|
|
93
|
+
//# sourceMappingURL=editor-overlay-DwNKaI22.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-overlay-DwNKaI22.js","sources":["../../src/components/editor-overlay/editor-overlay.tsx"],"sourcesContent":["/* ------------------------------------------------------------------ */\n/* EditorOverlay — a non-modal, liquid-glass bar docked INSIDE an */\n/* editor region (Gemini / Mac Mail \"Help me write\" style). */\n/* */\n/* Unlike Dialog it does NOT centre on screen, trap focus, or make the */\n/* page inert — and there is NO scrim, so the editor stays visible and */\n/* usable behind it. It expands from the AI pill into a frosted, */\n/* translucent, rounded bar across the editor's block-end edge. The */\n/* host must be `position: relative` (the RichTextEditor editor region */\n/* is); the overlay anchors to it absolutely. Escape and the close */\n/* button dismiss it. Reusable for any editor-attached surface (AI */\n/* draft, future inline tools). */\n/* ------------------------------------------------------------------ */\n\nimport { useCallback, useEffect, useId, useRef, type ReactNode } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { X } from 'lucide-react';\nimport { cva } from 'class-variance-authority';\n\nimport { IconButton } from '../button';\n\nexport interface EditorOverlayProps {\n /** Controlled visibility. */\n open: boolean;\n /** Close request (Escape or the close button). */\n onClose: () => void;\n /** Optional visible heading; renders a header row with a close button. */\n title?: ReactNode;\n /** Accessible name for the overlay region (use when there is no visible title). */\n ariaLabel?: string;\n /** Body content. */\n children: ReactNode;\n /** Optional footer slot (e.g. action buttons), right-aligned. */\n footer?: ReactNode;\n /**\n * Opaque instance id, emitted on the wrapper as `data-component-id`. Pass it\n * when more than one overlay can be mounted so an agent / automation tool can\n * tell them apart (PRS §26 §6).\n */\n id?: string;\n /** Extra classes on the glass card. */\n className?: string;\n}\n\n// Non-blocking liquid-glass bar docked across the editor's block-end edge,\n// expanding from the AI pill. No scrim — the editor stays visible + usable.\nconst cardVariants = cva(\n [\n // Spans the editor's block-end edge (a docked bar) and expands from the pill.\n 'ds:absolute ds:z-20',\n 'ds:[inset-inline-start:var(--spacing-md)] ds:[inset-inline-end:var(--spacing-md)]',\n 'ds:[inset-block-end:var(--spacing-md)]',\n // Slim docked bar — compact but with a little breathing room.\n 'ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]',\n 'ds:p-[var(--spacing-md)]',\n 'ds:rounded-[var(--radius-lg)]',\n // Apple \"Liquid Glass\": a translucent base + backdrop blur/saturate so the\n // editor shows through, a specular top \"rim\" + inner hairline ring, and a\n // soft drop shadow for a floating slab. --card-border is theme-aware (dark\n // hairline on light themes, bright on dark), so the rim reads in all four.\n 'ds:bg-[color-mix(in_srgb,var(--popover)_64%,transparent)]',\n 'ds:backdrop-blur-xl ds:backdrop-saturate-150',\n 'ds:border ds:border-[color-mix(in_srgb,var(--card-border)_70%,transparent)]',\n 'ds:shadow-[inset_0_1px_0_0_var(--card-border),inset_0_0_0_1px_color-mix(in_srgb,var(--card-border)_35%,transparent),var(--shadow-lg)]',\n // Liquid-glass grow out of the pill (bottom-inline-end origin).\n 'ds:origin-bottom-right ds:animate-in ds:fade-in-0 ds:zoom-in-95',\n 'ds:motion-reduce:animate-none',\n ].join(' '),\n);\n\nconst titleClass =\n 'ds:text-[length:var(--font-size-base)] ds:font-medium ds:text-[color:var(--foreground)]';\n\nexport function EditorOverlay({\n open,\n onClose,\n title,\n ariaLabel,\n children,\n footer,\n id,\n className,\n}: EditorOverlayProps): React.JSX.Element | null {\n const { t } = useTranslation();\n const cardRef = useRef<HTMLDivElement>(null);\n const restoreFocusRef = useRef<HTMLElement | null>(null);\n const titleId = useId();\n\n // Latest onClose in a ref: the focus effect below must run only when `open`\n // changes. Depending on `onClose` re-ran it on every host render (a host\n // passing an inline handler), stealing focus from whatever was being typed.\n const onCloseRef = useRef(onClose);\n useEffect(() => {\n onCloseRef.current = onClose;\n }, [onClose]);\n const handleClose = useCallback(() => onClose(), [onClose]);\n\n useEffect(() => {\n if (!open) return undefined;\n restoreFocusRef.current = document.activeElement as HTMLElement | null;\n // Move focus into the overlay (non-modal: we don't trap it, just seed it).\n const raf = window.requestAnimationFrame(() => {\n const focusable = cardRef.current?.querySelector<HTMLElement>(\n 'input, textarea, button, [tabindex]:not([tabindex=\"-1\"])',\n );\n (focusable ?? cardRef.current)?.focus();\n });\n const onKeyDown = (event: KeyboardEvent): void => {\n // An Escape a nested layer already handled (a Radix menu, select or\n // dialog marks its dismiss with preventDefault) closes only that layer.\n if (event.key === 'Escape' && !event.defaultPrevented) {\n event.stopPropagation();\n onCloseRef.current();\n }\n };\n document.addEventListener('keydown', onKeyDown);\n return () => {\n window.cancelAnimationFrame(raf);\n document.removeEventListener('keydown', onKeyDown);\n restoreFocusRef.current?.focus?.();\n };\n }, [open]);\n\n if (!open) return null;\n\n return (\n <div data-component=\"editor-overlay\" data-component-id={id}>\n <div\n ref={cardRef}\n role=\"dialog\"\n aria-modal=\"false\"\n aria-labelledby={title ? titleId : undefined}\n aria-label={title ? undefined : ariaLabel}\n tabIndex={-1}\n className={[cardVariants(), className].filter(Boolean).join(' ')}\n >\n {/* Header only when there's a visible title — a title-less overlay is a\n header-less composer (named via ariaLabel) whose consumer provides\n its own inline close so no empty band is reserved for it. */}\n {title ? (\n <div className=\"ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]\">\n <div id={titleId} className={titleClass}>\n {title}\n </div>\n <IconButton\n size=\"sm\"\n intent=\"ghost\"\n icon={<X />}\n aria-label={t('common.close')}\n onClick={handleClose}\n />\n </div>\n ) : null}\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\">\n {children}\n </div>\n {footer ? (\n <div className=\"ds:flex ds:flex-wrap ds:items-center ds:justify-end ds:gap-[var(--spacing-sm)]\">\n {footer}\n </div>\n ) : null}\n </div>\n </div>\n );\n}\n"],"names":["cardVariants","cva","titleClass","EditorOverlay","open","onClose","title","ariaLabel","children","footer","id","className","t","useTranslation","cardRef","useRef","restoreFocusRef","titleId","useId","onCloseRef","useEffect","handleClose","useCallback","raf","_b","_a","onKeyDown","event","jsx","jsxs","IconButton","X"],"mappings":";;;;;;AA8CA,MAAMA,IAAeC;AAAA,EACnB;AAAA;AAAA,IAEE;AAAA,IACA;AAAA,IACA;AAAA;AAAA,IAEA;AAAA,IACA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAAA,IAEA;AAAA,IACA;AAAA,EAAA,EACA,KAAK,GAAG;AACZ,GAEMC,IACJ;AAEK,SAASC,EAAc;A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AAAA,MACX,mBAAiBR,IAAQW,IAAU;AAAA,MACnC,cAAYX,IAAQ,SAAYC;AAAA,MAChC,UAAU;AAAA,MACV,WAAW,CAACP,EAAA,GAAgBW,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAAA,MAK9D,UAAA;AAAA,QAAAL,IACC,gBAAAuB,EAAC,OAAA,EAAI,WAAU,yEACb,UAAA;AAAA,UAAA,gBAAAD,EAAC,OAAA,EAAI,IAAIX,GAAS,WAAWf,GAC1B,UAAAI,GACH;AAAA,UACA,gBAAAsB;AAAA,YAACE;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,QAAO;AAAA,cACP,wBAAOC,GAAA,EAAE;AAAA,cACT,cAAYnB,EAAE,cAAc;AAAA,cAC5B,SAASS;AAAA,YAAA;AAAA,UAAA;AAAA,QACX,EAAA,CACF,IACE;AAAA,QACJ,gBAAAO,EAAC,OAAA,EAAI,WAAU,kDACZ,UAAApB,EAAA,CACH;AAAA,QACCC,IACC,gBAAAmB,EAAC,OAAA,EAAI,WAAU,kFACZ,aACH,IACE;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,GAER,IAvCgB;AAyCpB;"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
const n = /* @__PURE__ */ new Set([
|
|
2
|
+
"BIF",
|
|
3
|
+
"CLP",
|
|
4
|
+
"DJF",
|
|
5
|
+
"GNF",
|
|
6
|
+
"IDR",
|
|
7
|
+
"JPY",
|
|
8
|
+
"KMF",
|
|
9
|
+
"KRW",
|
|
10
|
+
"MGA",
|
|
11
|
+
"PYG",
|
|
12
|
+
"RWF",
|
|
13
|
+
"UGX",
|
|
14
|
+
"VND",
|
|
15
|
+
"VUV",
|
|
16
|
+
"XAF",
|
|
17
|
+
"XOF",
|
|
18
|
+
"XPF"
|
|
19
|
+
]);
|
|
20
|
+
function s(r, a, c) {
|
|
21
|
+
const t = a.toUpperCase(), e = n.has(t) ? r : r / 100;
|
|
22
|
+
try {
|
|
23
|
+
return new Intl.NumberFormat(c, {
|
|
24
|
+
style: "currency",
|
|
25
|
+
currency: t
|
|
26
|
+
}).format(e);
|
|
27
|
+
} catch {
|
|
28
|
+
return `${n.has(t) ? String(e) : e.toFixed(2)} ${t}`;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function u(r, a, c, t) {
|
|
32
|
+
return r === 0 ? t : s(r, a, c);
|
|
33
|
+
}
|
|
34
|
+
function F(r, a, c, t = {}) {
|
|
35
|
+
const e = a.toUpperCase(), o = n.has(e) ? r : r / 100;
|
|
36
|
+
try {
|
|
37
|
+
return new Intl.NumberFormat(c, {
|
|
38
|
+
style: "currency",
|
|
39
|
+
currency: e,
|
|
40
|
+
...t
|
|
41
|
+
}).formatToParts(o);
|
|
42
|
+
} catch {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
export {
|
|
47
|
+
s as a,
|
|
48
|
+
u as b,
|
|
49
|
+
F as f
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=format-price-DAbh61Lz.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-price-DAbh61Lz.js","sources":["../../src/components/_shared/format-price.ts"],"sourcesContent":["/**\n * Shared money formatter for the kit's \"price in minor units\" convention.\n *\n * Every component that renders a price takes the amount as an integer in\n * the smallest currency unit (cents / centesimi) plus an ISO-4217\n * `currencyCode`, and the KIT does the formatting — the consumer never\n * hands the kit a pre-rendered string. Lifted from the file-local\n * duplicate in `contact-profile-card.tsx` when PracticeResults adopted\n * the same convention, so both surfaces render an identical price for\n * identical input.\n *\n * Not to be confused with `formatPaymentAmount` (payment-form): that one\n * is the checkout formatter and falls back to an `en` currency string so\n * a raw integer can never leak into a payment UI. This is the lightweight\n * leaf helper for read-only price captions — it lives in `_shared` so a\n * SERP card can use it without pulling the payment-form module graph in.\n * Both apply the same zero-decimal divisor rule; only the failure\n * behaviour differs.\n */\n\n/**\n * Currencies with no minor unit — the integer IS the major amount, so\n * dividing by 100 would render the price 100× too small. Pinned to\n * Stripe's list: https://stripe.com/docs/currencies#zero-decimal\n *\n * Kept in step with `ZERO_DECIMAL_CURRENCIES` in\n * `src/components/payment-form/payment-form.tsx`. Consolidating the two\n * into one exported set is a follow-up — payment-form is a shipped\n * subpath entry and re-pointing it is out of scope here.\n */\nconst ZERO_DECIMAL_CURRENCIES = new Set<string>([\n 'BIF',\n 'CLP',\n 'DJF',\n 'GNF',\n 'IDR',\n 'JPY',\n 'KMF',\n 'KRW',\n 'MGA',\n 'PYG',\n 'RWF',\n 'UGX',\n 'VND',\n 'VUV',\n 'XAF',\n 'XOF',\n 'XPF',\n]);\n\nexport function formatPrice(\n minorUnits: number,\n currency: string,\n locale: string,\n): string {\n const iso = currency.toUpperCase();\n const major = ZERO_DECIMAL_CURRENCIES.has(iso)\n ? minorUnits\n : minorUnits / 100;\n try {\n return new Intl.NumberFormat(locale, {\n style: 'currency',\n currency: iso,\n }).format(major);\n } catch {\n // Locale or currency code rejected. Fall back to a plain amount — but\n // keep the zero-decimal rule, or the fallback would reintroduce the very\n // bug this module exists to fix (`JPY 8000` reading as \"8000.00\"), and\n // keep the ISO code so the reader is not left with a bare number.\n const amount = ZERO_DECIMAL_CURRENCIES.has(iso)\n ? String(major)\n : major.toFixed(2);\n return `${amount} ${iso}`;\n }\n}\n\n/**\n * A first-visit price caption: `0` means the visit is free, so it reads as\n * the caller's translated word (\"Free\" / \"Gratuito\"), never as \"€0.00\".\n * Any other amount goes through {@link formatPrice} unchanged.\n */\nexport function formatPriceOrFree(\n minorUnits: number,\n currency: string,\n locale: string,\n freeLabel: string,\n): string {\n return minorUnits === 0\n ? freeLabel\n : formatPrice(minorUnits, currency, locale);\n}\n\n/**\n * The same amount as {@link formatPrice}, but broken into its typed parts so\n * a renderer can treat the fraction differently from the rest.\n *\n * Splitting a formatted price with a regex is not safe across locales: in\n * `it-IT` the group separator is `.` and the decimal is `,`, so `1.000 €`\n * would read as a fraction of `000` and a \"drop the zero fraction\" rule\n * would render it as `1 €`. `Intl.NumberFormat.formatToParts` labels each\n * piece, so the fraction is whatever the locale says it is, wherever it\n * sits relative to the currency symbol.\n *\n * Returns `null` when the locale or currency is rejected — callers fall\n * back to {@link formatPrice}, which keeps the zero-decimal rule.\n */\nexport function formatPriceParts(\n minorUnits: number,\n currency: string,\n locale: string,\n options: Pick<Intl.NumberFormatOptions, 'signDisplay'> = {},\n): Intl.NumberFormatPart[] | null {\n const iso = currency.toUpperCase();\n const major = ZERO_DECIMAL_CURRENCIES.has(iso)\n ? minorUnits\n : minorUnits / 100;\n try {\n return new Intl.NumberFormat(locale, {\n style: 'currency',\n currency: iso,\n ...options,\n }).formatToParts(major);\n } catch {\n return null;\n }\n}\n"],"names":["ZERO_DECIMAL_CURRENCIES","formatPrice","minorUnits","currency","locale","iso","major","formatPriceOrFree","freeLabel","formatPriceParts","options"],"mappings":"AA8BA,MAAMA,wBAA8B,IAAY;AAAA,EAC9C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAEM,SAASC,EACdC,GACAC,GACAC,GACQ;AACR,QAAMC,IAAMF,EAAS,YAAA,GACfG,IAAQN,EAAwB,IAAIK,CAAG,IACzCH,IACAA,IAAa;AACjB,MAAI;AACF,WAAO,IAAI,KAAK,aAAaE,GAAQ;AAAA,MACnC,OAAO;AAAA,MACP,UAAUC;AAAA,IAAA,CACX,EAAE,OAAOC,CAAK;AAAA,EACjB,QAAQ;AAQN,WAAO,GAHQN,EAAwB,IAAIK,CAAG,IAC1C,OAAOC,CAAK,IACZA,EAAM,QAAQ,CAAC,CACH,IAAID,CAAG;AAAA,EACzB;AACF;AAOO,SAASE,EACdL,GACAC,GACAC,GACAI,GACQ;AACR,SAAON,MAAe,IAClBM,IACAP,EAAYC,GAAYC,GAAUC,CAAM;AAC9C;AAgBO,SAASK,EACdP,GACAC,GACAC,GACAM,IAAyD,CAAA,GACzB;AAChC,QAAML,IAAMF,EAAS,YAAA,GACfG,IAAQN,EAAwB,IAAIK,CAAG,IACzCH,IACAA,IAAa;AACjB,MAAI;AACF,WAAO,IAAI,KAAK,aAAaE,GAAQ;AAAA,MACnC,OAAO;AAAA,MACP,UAAUC;AAAA,MACV,GAAGK;AAAA,IAAA,CACJ,EAAE,cAAcJ,CAAK;AAAA,EACxB,QAAQ;AACN,WAAO;AAAA,EACT;AACF;"}
|