@alfadocs/ui-kit 1.132.0 → 1.134.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 (257) hide show
  1. package/dist/_chunks/{agenda-card-B8hV3dZV.js → agenda-card-B9wgX_Ed.js} +2 -2
  2. package/dist/_chunks/{agenda-tray-Bu46s3dI.js → agenda-tray-CGcS_qoM.js} +2 -2
  3. package/dist/_chunks/appointment-card-DG3m9yN-.js +504 -0
  4. package/dist/_chunks/{appointment-peek-DZa6xyUb.js → appointment-peek-BK0tDs4C.js} +2 -2
  5. package/dist/_chunks/{appointment-timeline-DQePqpyH.js → appointment-timeline-BiI2riRZ.js} +2 -2
  6. package/dist/_chunks/appointment-tray-ClJCtYQj.js +200 -0
  7. package/dist/_chunks/{appointment-workflow-status-DMjuIK90.js → appointment-workflow-status-S-lx81Yz.js} +2 -2
  8. package/dist/_chunks/ban-CiSCCcOE.js +15 -0
  9. package/dist/_chunks/{calendar-BIoOeBTT.js → calendar-CyLtLBNP.js} +2 -2
  10. package/dist/_chunks/calendar-appointment-editor-dialog-BSkIYGlW.js +13773 -0
  11. package/dist/_chunks/{calendar-event-card-BNEzkjm-.js → calendar-event-card-BJifpYZQ.js} +7 -6
  12. package/dist/_chunks/{care-plan-card-DKScH9Ss.js → care-plan-card-CjHq6PLo.js} +6 -6
  13. package/dist/_chunks/{care-plan-entry-card-AG1y3nyW.js → care-plan-entry-card-DY1toF6E.js} +2 -2
  14. package/dist/_chunks/{care-plan-header-Dx5OMkc9.js → care-plan-header-CeFXUDnL.js} +6 -6
  15. package/dist/_chunks/check-in-documents-CEVcgcYZ.js +136 -0
  16. package/dist/_chunks/{clinical-note-card-pPaeWWnu.js → clinical-note-card-D--IwbZa.js} +2 -2
  17. package/dist/_chunks/document-preview-DLVIrOYV.js +385 -0
  18. package/dist/_chunks/{entity-card-fpm-KUKc.js → entity-card-p-LANpYt.js} +18 -17
  19. package/dist/_chunks/{error-page-B0fGNTRB.js → error-page-WLhmWUTq.js} +100 -115
  20. package/dist/_chunks/finished-terminal-unDnXT4j.js +191 -0
  21. package/dist/_chunks/house-DGCypGTo.js +21 -0
  22. package/dist/_chunks/is-safe-url-CEy9CEml.js +8 -0
  23. package/dist/_chunks/keypad-DBH_keVs.js +152 -0
  24. package/dist/_chunks/keypad-button-mOaPQRrH.js +114 -0
  25. package/dist/_chunks/{message-card-BG3_3nN1.js → message-card-Bw_q1qKx.js} +2 -2
  26. package/dist/_chunks/{message-tray-BjZv0Fsk.js → message-tray-pLGgLmoG.js} +2 -2
  27. package/dist/_chunks/{note-attachment-MNTIqdSz.js → note-attachment-JTIy9iXN.js} +2 -2
  28. package/dist/_chunks/{note-timeline-BQeW0VZY.js → note-timeline-BbjHMhkL.js} +2 -2
  29. package/dist/_chunks/{notes-panel-Cm-_pCRJ.js → notes-panel-BAyPOr8N.js} +2 -2
  30. package/dist/_chunks/{operator-hero-CnfWckNQ.js → operator-hero-D4wfVu2l.js} +2 -2
  31. package/dist/_chunks/otp-input-BNOTlxq3.js +342 -0
  32. package/dist/_chunks/patient-account-settings-BkAtIxJW.js +546 -0
  33. package/dist/_chunks/patient-card-DTh3QTyS.js +125 -0
  34. package/dist/_chunks/patient-check-in-resume-xhqjC6gf.js +742 -0
  35. package/dist/_chunks/patient-sign-in-pin-CDBqV254.js +432 -0
  36. package/dist/_chunks/patient-sign-in-steps-C2JSqlok.js +199 -0
  37. package/dist/_chunks/{patient-summary-card-BUcZ-gaL.js → patient-summary-card-Bl2NknPe.js} +2 -2
  38. package/dist/_chunks/{payment-request-card-Dv4WbRBe.js → payment-request-card-CNW00DCx.js} +6 -6
  39. package/dist/_chunks/{pdf-viewer-BnBKdx0y.js → pdf-viewer-TRC5jEm5.js} +472 -425
  40. package/dist/_chunks/pin-entry-BugWQMOS.js +219 -0
  41. package/dist/_chunks/pin-indicator-Cb-n40UI.js +124 -0
  42. package/dist/_chunks/portal-details-CTEsm705.js +478 -0
  43. package/dist/_chunks/portal-documents-D8skew0h.js +902 -0
  44. package/dist/_chunks/portal-parts-BdR29P7z.js +285 -0
  45. package/dist/_chunks/{privacy-mask-DJ1gee4c.js → privacy-mask-C19dJFMk.js} +5 -5
  46. package/dist/_chunks/{product-hub-panel-a8wdVOUt.js → product-hub-panel-K4QbULG7.js} +2 -2
  47. package/dist/_chunks/{registration-form-CwbhtKcy.js → registration-form-DS3RuKHu.js} +2 -2
  48. package/dist/_chunks/{reserved.agent-W8mR179D.js → reserved.agent-DOzOBUW7.js} +2 -2
  49. package/dist/_chunks/session-countdown-DOx1IBUB.js +232 -0
  50. package/dist/_chunks/{sign-document-CQZVzfpk.js → sign-document-DDZbmYHu.js} +2 -2
  51. package/dist/_chunks/{signature-field-DjabvRZm.js → signature-field-BjlY_yXH.js} +39 -34
  52. package/dist/_chunks/{signature-request-4pGq3YBe.js → signature-request-CHsM_iWi.js} +2 -2
  53. package/dist/_chunks/{signature-status-chip-pIoQjvH8.js → signature-status-chip-DS9hHwIt.js} +66 -69
  54. package/dist/_chunks/signing-end-screen-an9P8DOT.js +1041 -0
  55. package/dist/_chunks/sms-code-entry-Dgp4GwlM.js +316 -0
  56. package/dist/_chunks/step-up-dialog-C2JqJmCA.js +132 -0
  57. package/dist/_chunks/{task-editor-BL2hHxNz.js → task-editor-g1AGfxhr.js} +38 -38
  58. package/dist/_chunks/{use-appointment-details-read-_b7FRB1x.js → use-appointment-details-read-Dzc6fEzG.js} +6 -6
  59. package/dist/_chunks/use-zoom-drilldown-Cr1baU5X.js +221 -0
  60. package/dist/_chunks/{user-x-DYszNtIg.js → user-x-BJZg4kaP.js} +8 -19
  61. package/dist/_chunks/{verify-identity-types-CxtrBXsZ.js → verify-identity-types-C6Bam8v6.js} +2 -2
  62. package/dist/agent-catalog.json +723 -364
  63. package/dist/agent-i18n/en.json +75 -18
  64. package/dist/browser-support.js +1 -1
  65. package/dist/components/_shared/is-safe-url.d.ts +3 -1
  66. package/dist/components/agenda-card/index.js +2 -2
  67. package/dist/components/agenda-tray/index.js +1 -1
  68. package/dist/components/appointment-card/appointment-card.d.ts +45 -0
  69. package/dist/components/appointment-card/appointment-tray.d.ts +11 -0
  70. package/dist/components/appointment-card/index.js +3 -3
  71. package/dist/components/appointment-details-panel/index.js +1 -1
  72. package/dist/components/appointment-peek/index.js +1 -1
  73. package/dist/components/appointment-timeline/index.js +1 -1
  74. package/dist/components/booking/index.js +1 -1
  75. package/dist/components/calendar/index.js +1 -1
  76. package/dist/components/calendar-event-card/index.js +1 -1
  77. package/dist/components/care-plan-card/index.js +1 -1
  78. package/dist/components/care-plan-entry-card/index.js +1 -1
  79. package/dist/components/care-plan-header/index.js +1 -1
  80. package/dist/components/clinical-note-card/index.js +1 -1
  81. package/dist/components/document-preview/document-preview.d.ts +61 -7
  82. package/dist/components/document-preview/index.js +1 -1
  83. package/dist/components/finished-terminal/finished-terminal.d.ts +63 -6
  84. package/dist/components/finished-terminal/index.d.ts +1 -1
  85. package/dist/components/finished-terminal/index.js +1 -1
  86. package/dist/components/index.d.ts +12 -0
  87. package/dist/components/keypad/index.d.ts +3 -0
  88. package/dist/components/keypad/index.js +6 -0
  89. package/dist/components/keypad/keypad.d.ts +54 -0
  90. package/dist/components/keypad-button/index.d.ts +3 -0
  91. package/dist/components/keypad-button/index.js +6 -0
  92. package/dist/components/keypad-button/keypad-button.d.ts +33 -0
  93. package/dist/components/message-card/index.js +2 -2
  94. package/dist/components/message-tray/index.js +1 -1
  95. package/dist/components/note-timeline/index.js +1 -1
  96. package/dist/components/notes-panel/index.js +1 -1
  97. package/dist/components/operator-hero/index.js +1 -1
  98. package/dist/components/otp-input/index.js +1 -1
  99. package/dist/components/otp-input/otp-input.d.ts +11 -0
  100. package/dist/components/patient-summary-card/index.js +1 -1
  101. package/dist/components/payment-card/index.js +1 -1
  102. package/dist/components/pdf-viewer/index.js +1 -1
  103. package/dist/components/pdf-viewer/pdf-viewer.d.ts +7 -0
  104. package/dist/components/pin-entry/index.d.ts +3 -0
  105. package/dist/components/pin-entry/index.js +5 -0
  106. package/dist/components/pin-entry/pin-entry.agent.d.ts +4 -0
  107. package/dist/components/pin-entry/pin-entry.d.ts +64 -0
  108. package/dist/components/pin-indicator/index.d.ts +3 -0
  109. package/dist/components/pin-indicator/index.js +9 -0
  110. package/dist/components/pin-indicator/pin-indicator.d.ts +34 -0
  111. package/dist/components/product-hub-tray/index.js +2 -2
  112. package/dist/components/session-countdown/index.js +1 -1
  113. package/dist/components/session-countdown/session-countdown.d.ts +19 -0
  114. package/dist/components/sign-document/index.js +1 -1
  115. package/dist/components/signature-field/index.js +1 -1
  116. package/dist/components/signature-field/signature-field.d.ts +17 -6
  117. package/dist/components/signature-status-chip/index.js +1 -1
  118. package/dist/components/signature-status-chip/signature-status-chip.d.ts +3 -2
  119. package/dist/components/sms-code-entry/index.d.ts +3 -0
  120. package/dist/components/sms-code-entry/index.js +5 -0
  121. package/dist/components/sms-code-entry/sms-code-entry.agent.d.ts +4 -0
  122. package/dist/components/sms-code-entry/sms-code-entry.d.ts +156 -0
  123. package/dist/components/step-up-dialog/index.d.ts +3 -0
  124. package/dist/components/step-up-dialog/index.js +5 -0
  125. package/dist/components/step-up-dialog/step-up-dialog.d.ts +108 -0
  126. package/dist/components/task-editor/index.js +1 -1
  127. package/dist/components/workflow-status/index.js +1 -1
  128. package/dist/core.css +1 -1
  129. package/dist/hooks/index.js +1 -1
  130. package/dist/hooks/use-signing-session.d.ts +7 -2
  131. package/dist/host-compat.css +10 -1
  132. package/dist/i18n/locales/ar.d.ts +514 -1
  133. package/dist/i18n/locales/ar.js +512 -4
  134. package/dist/i18n/locales/de.d.ts +514 -1
  135. package/dist/i18n/locales/de.js +520 -5
  136. package/dist/i18n/locales/el.d.ts +514 -1
  137. package/dist/i18n/locales/el.js +515 -5
  138. package/dist/i18n/locales/en.d.ts +516 -1
  139. package/dist/i18n/locales/en.js +522 -4
  140. package/dist/i18n/locales/es.d.ts +514 -1
  141. package/dist/i18n/locales/es.js +513 -5
  142. package/dist/i18n/locales/fr.d.ts +514 -1
  143. package/dist/i18n/locales/fr.js +513 -5
  144. package/dist/i18n/locales/hi.d.ts +514 -1
  145. package/dist/i18n/locales/hi.js +513 -5
  146. package/dist/i18n/locales/it.d.ts +514 -1
  147. package/dist/i18n/locales/it.js +520 -5
  148. package/dist/i18n/locales/ja.d.ts +514 -1
  149. package/dist/i18n/locales/ja.js +513 -5
  150. package/dist/i18n/locales/nl.d.ts +514 -1
  151. package/dist/i18n/locales/nl.js +520 -5
  152. package/dist/i18n/locales/pl.d.ts +514 -1
  153. package/dist/i18n/locales/pl.js +520 -5
  154. package/dist/i18n/locales/pt.d.ts +514 -1
  155. package/dist/i18n/locales/pt.js +520 -5
  156. package/dist/i18n/locales/ro.d.ts +514 -1
  157. package/dist/i18n/locales/ro.js +520 -5
  158. package/dist/i18n/locales/ru.d.ts +514 -1
  159. package/dist/i18n/locales/ru.js +512 -4
  160. package/dist/i18n/locales/sq.d.ts +514 -1
  161. package/dist/i18n/locales/sq.js +513 -5
  162. package/dist/i18n/locales/sv.d.ts +514 -1
  163. package/dist/i18n/locales/sv.js +513 -5
  164. package/dist/i18n/locales/tr.d.ts +514 -1
  165. package/dist/i18n/locales/tr.js +515 -5
  166. package/dist/i18n/locales/zh.d.ts +514 -1
  167. package/dist/i18n/locales/zh.js +513 -5
  168. package/dist/index.js +1271 -1204
  169. package/dist/locales/ar.json +516 -3
  170. package/dist/locales/de.json +517 -4
  171. package/dist/locales/el.json +517 -4
  172. package/dist/locales/en.json +516 -3
  173. package/dist/locales/es.json +517 -4
  174. package/dist/locales/fr.json +517 -4
  175. package/dist/locales/hi.json +517 -4
  176. package/dist/locales/it.json +517 -4
  177. package/dist/locales/ja.json +517 -4
  178. package/dist/locales/nl.json +517 -4
  179. package/dist/locales/pl.json +517 -4
  180. package/dist/locales/pt.json +517 -4
  181. package/dist/locales/ro.json +517 -4
  182. package/dist/locales/ru.json +516 -3
  183. package/dist/locales/sq.json +517 -4
  184. package/dist/locales/sv.json +517 -4
  185. package/dist/locales/tr.json +517 -4
  186. package/dist/locales/zh.json +517 -4
  187. package/dist/patterns/calendar/calendar.journey.d.ts +4 -0
  188. package/dist/patterns/calendar/calendar.surface.d.ts +15 -1
  189. package/dist/patterns/calendar/calendar.types.d.ts +4 -0
  190. package/dist/patterns/calendar/index.js +1 -1
  191. package/dist/patterns/check-in-documents/check-in-documents.d.ts +61 -0
  192. package/dist/patterns/check-in-documents/check-in-signable-document.d.ts +32 -0
  193. package/dist/patterns/check-in-documents/index.d.ts +4 -0
  194. package/dist/patterns/check-in-documents/index.js +5 -0
  195. package/dist/patterns/error-page/index.js +1 -1
  196. package/dist/patterns/patient-account-settings/index.d.ts +4 -0
  197. package/dist/patterns/patient-account-settings/index.js +5 -0
  198. package/dist/patterns/patient-account-settings/patient-account-settings-panels.d.ts +36 -0
  199. package/dist/patterns/patient-account-settings/patient-account-settings.d.ts +94 -0
  200. package/dist/patterns/patient-account-settings/patient-account-settings.types.d.ts +91 -0
  201. package/dist/patterns/patient-check-in/index.d.ts +20 -0
  202. package/dist/patterns/patient-check-in/index.js +13 -0
  203. package/dist/patterns/patient-check-in/patient-check-in-changed.d.ts +33 -0
  204. package/dist/patterns/patient-check-in/patient-check-in-connection-notice.d.ts +29 -0
  205. package/dist/patterns/patient-check-in/patient-check-in-done.d.ts +25 -0
  206. package/dist/patterns/patient-check-in/patient-check-in-entry.d.ts +29 -0
  207. package/dist/patterns/patient-check-in/patient-check-in-hub-empty.d.ts +23 -0
  208. package/dist/patterns/patient-check-in/patient-check-in-hub.d.ts +61 -0
  209. package/dist/patterns/patient-check-in/patient-check-in-personal-data.d.ts +73 -0
  210. package/dist/patterns/patient-check-in/patient-check-in-privacy.d.ts +9 -0
  211. package/dist/patterns/patient-check-in/patient-check-in-resume.d.ts +29 -0
  212. package/dist/patterns/patient-check-in/patient-check-in-shell.d.ts +60 -0
  213. package/dist/patterns/patient-check-in/patient-check-in-types.d.ts +92 -0
  214. package/dist/patterns/patient-portal/index.d.ts +12 -0
  215. package/dist/patterns/patient-portal/index.js +13 -0
  216. package/dist/patterns/patient-portal/portal-appointments.d.ts +70 -0
  217. package/dist/patterns/patient-portal/portal-details.d.ts +148 -0
  218. package/dist/patterns/patient-portal/portal-documents.d.ts +74 -0
  219. package/dist/patterns/patient-portal/portal-format.d.ts +14 -0
  220. package/dist/patterns/patient-portal/portal-home.d.ts +71 -0
  221. package/dist/patterns/patient-portal/portal-parts.d.ts +107 -0
  222. package/dist/patterns/patient-portal/portal-shell.d.ts +84 -0
  223. package/dist/patterns/patient-portal/portal-types.d.ts +157 -0
  224. package/dist/patterns/patient-sign-in/index.d.ts +7 -0
  225. package/dist/patterns/patient-sign-in/index.js +15 -0
  226. package/dist/patterns/patient-sign-in/patient-card.d.ts +74 -0
  227. package/dist/patterns/patient-sign-in/patient-sign-in-email.d.ts +109 -0
  228. package/dist/patterns/patient-sign-in/patient-sign-in-pin.d.ts +157 -0
  229. package/dist/patterns/patient-sign-in/patient-sign-in-steps.d.ts +143 -0
  230. package/dist/patterns/registration-form/index.js +1 -1
  231. package/dist/patterns/signature-request/index.js +1 -1
  232. package/dist/patterns/signing/index.d.ts +25 -0
  233. package/dist/patterns/signing/index.js +16 -0
  234. package/dist/patterns/signing/multi-field-signer.d.ts +117 -0
  235. package/dist/patterns/signing/signing-awaiting-screen.d.ts +25 -0
  236. package/dist/patterns/signing/signing-chrome.d.ts +30 -0
  237. package/dist/patterns/signing/signing-document-screen.d.ts +87 -0
  238. package/dist/patterns/signing/signing-end-screen.d.ts +27 -0
  239. package/dist/patterns/signing/signing-finished-screen.d.ts +34 -0
  240. package/dist/patterns/signing/signing-footer.d.ts +56 -0
  241. package/dist/patterns/signing/signing-handoff-screen.d.ts +37 -0
  242. package/dist/patterns/signing/signing-message-dialog.d.ts +29 -0
  243. package/dist/patterns/signing/signing-progress-chip.d.ts +27 -0
  244. package/dist/patterns/signing/signing-roster.d.ts +44 -0
  245. package/dist/patterns/signing/signing-staff-id-confirmation.d.ts +49 -0
  246. package/dist/patterns/verify-identity/index.js +1 -1
  247. package/dist/tokens.css +1 -1
  248. package/package.json +49 -1
  249. package/dist/_chunks/appointment-card-OAOur8lH.js +0 -434
  250. package/dist/_chunks/appointment-tray-DSFqO5Rm.js +0 -193
  251. package/dist/_chunks/calendar-appointment-editor-dialog-WW6V1SGh.js +0 -13663
  252. package/dist/_chunks/document-preview-_kQ9QvZV.js +0 -291
  253. package/dist/_chunks/finished-terminal-FR8uc_Ws.js +0 -122
  254. package/dist/_chunks/is-safe-url-DkETxeHz.js +0 -7
  255. package/dist/_chunks/otp-input-gV1446Dw.js +0 -301
  256. package/dist/_chunks/session-countdown-C4tzbJVc.js +0 -223
  257. package/dist/_chunks/use-zoom-drilldown-qCX34w9I.js +0 -210
@@ -0,0 +1,478 @@
1
+ import { jsxs as d, jsx as t, Fragment as T } from "react/jsx-runtime";
2
+ import { useRef as L, useEffect as O, useId as X } from "react";
3
+ import { useTranslation as z } from "react-i18next";
4
+ import { A as Q } from "./alert-C4WKViaS.js";
5
+ import { B as I } from "./button-DohK_Ak_.js";
6
+ import { C as st } from "./checkbox-DV4sNDeB.js";
7
+ import { C as ot } from "./country-select-C2GdvRtS.js";
8
+ import { D as P } from "./description-list-BxzDN9o2.js";
9
+ import { E as rt } from "./error-summary-DxNhwf_G.js";
10
+ import { E as ct } from "./email-input-DxwbREpx.js";
11
+ import { F as v } from "./form-field-CyHfOVKF.js";
12
+ import { T as S } from "./text-input-B6iAgCr3.js";
13
+ import { V as mt } from "./visually-hidden-BHxEUGyT.js";
14
+ import { P as pt } from "./privacy-mask-C19dJFMk.js";
15
+ import { u as W } from "./use-controllable-state-BiY4xTzM.js";
16
+ import { u as Y, P as dt, a as ut, b as ht, c as gt, d as Pt, f as bt } from "./portal-parts-BdR29P7z.js";
17
+ import { p as V } from "./privacy-mask-text-B8YfzB7L.js";
18
+ const Z = (n, u) => `${n}-${u}`;
19
+ function Nt({
20
+ values: n,
21
+ onChange: u,
22
+ fieldErrors: a,
23
+ disabled: m = !1,
24
+ idPrefix: y,
25
+ announceErrors: c = !0,
26
+ fieldAddon: i,
27
+ showMarketing: x = !0,
28
+ className: r
29
+ }) {
30
+ const { t: o } = z("ui"), N = X(), p = (s) => Z(y ?? N, s), h = (s, j) => u({ ...n, [s]: j });
31
+ return /* @__PURE__ */ d(
32
+ "div",
33
+ {
34
+ "data-component": "portal-details-fields",
35
+ className: ["ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", r].filter(Boolean).join(" "),
36
+ children: [
37
+ /* @__PURE__ */ t(
38
+ v,
39
+ {
40
+ label: o("patientPortal.details.firstName"),
41
+ labelEnd: i == null ? void 0 : i.firstName,
42
+ error: a == null ? void 0 : a.firstName,
43
+ announceError: c,
44
+ children: /* @__PURE__ */ t(
45
+ S,
46
+ {
47
+ value: n.firstName,
48
+ onChange: (s) => h("firstName", s.target.value),
49
+ autoComplete: "given-name",
50
+ disabled: m,
51
+ id: p("firstName"),
52
+ dir: "auto",
53
+ "data-field": "firstName"
54
+ }
55
+ )
56
+ }
57
+ ),
58
+ /* @__PURE__ */ t(
59
+ v,
60
+ {
61
+ label: o("patientPortal.details.lastName"),
62
+ labelEnd: i == null ? void 0 : i.lastName,
63
+ error: a == null ? void 0 : a.lastName,
64
+ announceError: c,
65
+ children: /* @__PURE__ */ t(
66
+ S,
67
+ {
68
+ value: n.lastName,
69
+ onChange: (s) => h("lastName", s.target.value),
70
+ autoComplete: "family-name",
71
+ disabled: m,
72
+ id: p("lastName"),
73
+ dir: "auto",
74
+ "data-field": "lastName"
75
+ }
76
+ )
77
+ }
78
+ ),
79
+ /* @__PURE__ */ t(
80
+ v,
81
+ {
82
+ label: o("patientPortal.details.address"),
83
+ labelEnd: i == null ? void 0 : i.address,
84
+ error: a == null ? void 0 : a.address,
85
+ announceError: c,
86
+ children: /* @__PURE__ */ t(
87
+ S,
88
+ {
89
+ value: n.address,
90
+ onChange: (s) => h("address", s.target.value),
91
+ autoComplete: "street-address",
92
+ disabled: m,
93
+ id: p("address"),
94
+ dir: "auto",
95
+ "data-field": "address"
96
+ }
97
+ )
98
+ }
99
+ ),
100
+ /* @__PURE__ */ t(
101
+ v,
102
+ {
103
+ label: o("patientPortal.details.country"),
104
+ labelEnd: i == null ? void 0 : i.country,
105
+ error: a == null ? void 0 : a.country,
106
+ announceError: c,
107
+ children: /* @__PURE__ */ t(
108
+ ot,
109
+ {
110
+ value: n.country,
111
+ onValueChange: (s) => h("country", s),
112
+ placeholder: o("patientPortal.details.countryPlaceholder"),
113
+ "aria-label": o("patientPortal.details.country"),
114
+ id: p("country"),
115
+ disabled: m,
116
+ tone: a != null && a.country ? "error" : "default"
117
+ }
118
+ )
119
+ }
120
+ ),
121
+ /* @__PURE__ */ t(
122
+ v,
123
+ {
124
+ label: o("patientPortal.details.contactEmail"),
125
+ labelEnd: i == null ? void 0 : i.contactEmail,
126
+ description: o("patientPortal.details.contactEmailNote"),
127
+ error: a == null ? void 0 : a.contactEmail,
128
+ announceError: c,
129
+ children: /* @__PURE__ */ t(
130
+ ct,
131
+ {
132
+ value: n.contactEmail,
133
+ onChange: (s) => h("contactEmail", s.target.value),
134
+ autoComplete: "email",
135
+ disableBuiltInValidation: !0,
136
+ errorMessage: null,
137
+ disabled: m,
138
+ id: p("contactEmail"),
139
+ dir: "ltr",
140
+ "data-field": "contactEmail"
141
+ }
142
+ )
143
+ }
144
+ ),
145
+ /* @__PURE__ */ t(
146
+ v,
147
+ {
148
+ label: o("patientPortal.details.phone"),
149
+ labelEnd: i == null ? void 0 : i.phone,
150
+ error: a == null ? void 0 : a.phone,
151
+ announceError: c,
152
+ children: /* @__PURE__ */ t(
153
+ S,
154
+ {
155
+ value: n.phone,
156
+ onChange: (s) => h("phone", s.target.value),
157
+ type: "tel",
158
+ autoComplete: "tel",
159
+ disabled: m,
160
+ id: p("phone"),
161
+ dir: "ltr",
162
+ "data-field": "phone"
163
+ }
164
+ )
165
+ }
166
+ ),
167
+ x ? /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
168
+ /* @__PURE__ */ t(
169
+ st,
170
+ {
171
+ id: p("marketing"),
172
+ label: o("patientPortal.details.marketingConsent"),
173
+ checked: n.marketing === 1,
174
+ onCheckedChange: (s) => h("marketing", s === !0 ? 1 : 0),
175
+ "aria-invalid": a != null && a.marketing ? !0 : void 0,
176
+ "aria-describedby": a != null && a.marketing ? `${p("marketing")}-error` : void 0,
177
+ disabled: m
178
+ }
179
+ ),
180
+ a != null && a.marketing ? /* @__PURE__ */ t(
181
+ "p",
182
+ {
183
+ id: `${p("marketing")}-error`,
184
+ role: c ? "alert" : void 0,
185
+ className: "type-meta ds:m-0 ds:text-[color:var(--destructive)]",
186
+ children: a.marketing
187
+ }
188
+ ) : null
189
+ ] }) : null
190
+ ]
191
+ }
192
+ );
193
+ }
194
+ function Ct({
195
+ readOnly: n,
196
+ locale: u,
197
+ recordMark: a,
198
+ privacy: m = !1,
199
+ className: y
200
+ }) {
201
+ const { t: c } = z("ui"), i = Y(u), x = c("patientPortal.details.fiscalCode"), r = [
202
+ [
203
+ c("patientPortal.details.birthDate"),
204
+ m ? V() : bt(n.birthDateIso, i)
205
+ ],
206
+ [
207
+ c("patientPortal.details.fiscalCode"),
208
+ m ? V() : n.fiscalCode
209
+ ]
210
+ ];
211
+ return n.maskedMobile && r.push([
212
+ c("patientPortal.details.mobile"),
213
+ m ? V() : /* @__PURE__ */ t("bdi", { dir: "ltr", children: n.maskedMobile }, "mobile")
214
+ ]), /* @__PURE__ */ t("div", { "data-component": "portal-details-read-only-list", className: y, children: /* @__PURE__ */ t(P, { layout: "responsive", divider: "between", children: r.map(([o, N]) => /* @__PURE__ */ d(P.Row, { children: [
215
+ /* @__PURE__ */ t(P.Term, { children: o }),
216
+ /* @__PURE__ */ t(P.Detail, { children: /* @__PURE__ */ d("span", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]", children: [
217
+ o === x ? /* @__PURE__ */ t("bdi", { dir: "ltr", children: N }) : /* @__PURE__ */ t("bdi", { children: N }),
218
+ a
219
+ ] }) })
220
+ ] }, o)) }) });
221
+ }
222
+ function vt(n) {
223
+ return (u) => {
224
+ if (!u) return "";
225
+ try {
226
+ return new Intl.DisplayNames([n], { type: "region" }).of(
227
+ u.toUpperCase()
228
+ ) ?? u;
229
+ } catch {
230
+ return u;
231
+ }
232
+ };
233
+ }
234
+ function Rt({
235
+ values: n,
236
+ readOnly: u,
237
+ draft: a,
238
+ defaultDraft: m,
239
+ onDraftChange: y,
240
+ editing: c,
241
+ defaultEditing: i = !1,
242
+ onEditingChange: x,
243
+ fieldErrors: r,
244
+ saveState: o = "idle",
245
+ onSave: N,
246
+ status: p = "ready",
247
+ onRetry: h,
248
+ stepUp: s = null,
249
+ locale: j,
250
+ headingLevel: F = 1,
251
+ focusOnMount: _ = !1,
252
+ privacy: g = !1,
253
+ className: A
254
+ }) {
255
+ const { t: e } = z("ui"), R = Y(j), E = vt(R), [tt, D] = W({
256
+ value: a,
257
+ defaultValue: m ?? n,
258
+ onChange: y
259
+ }), [at, $] = W({
260
+ value: c,
261
+ defaultValue: i,
262
+ onChange: x
263
+ }), H = tt ?? n, b = at === !0, k = o === "saving", q = L(null), G = L(null), K = L(b);
264
+ O(() => {
265
+ var l, f, w;
266
+ K.current !== b && (K.current = b, !s && (b ? (f = (l = q.current) == null ? void 0 : l.querySelector("input")) == null || f.focus() : (w = G.current) == null || w.focus()));
267
+ }, [b, s]);
268
+ const U = X(), J = L(null), et = [
269
+ "firstName",
270
+ "lastName",
271
+ "address",
272
+ "country",
273
+ "contactEmail",
274
+ "phone",
275
+ "marketing"
276
+ ], nt = {
277
+ firstName: e("patientPortal.details.firstName"),
278
+ lastName: e("patientPortal.details.lastName"),
279
+ address: e("patientPortal.details.address"),
280
+ country: e("patientPortal.details.country"),
281
+ contactEmail: e("patientPortal.details.contactEmail"),
282
+ phone: e("patientPortal.details.phone"),
283
+ marketing: e("patientPortal.details.marketing")
284
+ }, B = et.filter((l) => r == null ? void 0 : r[l]), it = B.map((l) => `${l}:${r == null ? void 0 : r[l]}`).join("|"), M = b && !g && B.length > 0;
285
+ O(() => {
286
+ var l;
287
+ M && ((l = J.current) == null || l.focus({ preventScroll: !1 }));
288
+ }, [it, M]);
289
+ const C = (l) => g ? V() : l, lt = [
290
+ [e("patientPortal.details.firstName"), C(n.firstName), !1],
291
+ [e("patientPortal.details.lastName"), C(n.lastName), !1],
292
+ [e("patientPortal.details.address"), C(n.address), !1],
293
+ [
294
+ e("patientPortal.details.country"),
295
+ C(E(n.country)),
296
+ !1
297
+ ],
298
+ [
299
+ e("patientPortal.details.contactEmail"),
300
+ C(n.contactEmail),
301
+ !0
302
+ ],
303
+ [e("patientPortal.details.phone"), C(n.phone), !0],
304
+ [
305
+ e("patientPortal.details.marketing"),
306
+ n.marketing === 1 ? e("patientPortal.details.on") : e("patientPortal.details.off"),
307
+ !1
308
+ ]
309
+ ];
310
+ return /* @__PURE__ */ d(
311
+ dt,
312
+ {
313
+ component: "portal-details",
314
+ title: e("patientPortal.details.title"),
315
+ description: e("patientPortal.details.intro"),
316
+ headingLevel: F,
317
+ focusOnMount: _,
318
+ privacy: g,
319
+ className: A,
320
+ status: p,
321
+ loadingLabel: e("patientPortal.details.loading"),
322
+ errorLabel: e("patientPortal.details.error.title"),
323
+ message: o === "saved" ? e("patientPortal.details.saved") : void 0,
324
+ children: [
325
+ p === "loading" ? /* @__PURE__ */ t(ut, {}) : p === "error" ? /* @__PURE__ */ t(
326
+ ht,
327
+ {
328
+ kind: "error",
329
+ title: e("patientPortal.details.error.title"),
330
+ body: e("patientPortal.home.error.body"),
331
+ headingLevel: F,
332
+ onRetry: h
333
+ }
334
+ ) : /* @__PURE__ */ d(T, { children: [
335
+ o === "saved" ? (
336
+ // PortalScreen's live region, mounted before the text, says it
337
+ // once; the visible alert stays quiet (05-accessibility).
338
+ /* @__PURE__ */ t(Q, { variant: "success", announce: "off", children: /* @__PURE__ */ t(Q.Description, { children: e("patientPortal.details.saved") }) })
339
+ ) : null,
340
+ /* @__PURE__ */ d("section", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
341
+ /* @__PURE__ */ t(
342
+ Ct,
343
+ {
344
+ readOnly: u,
345
+ locale: R,
346
+ privacy: g
347
+ }
348
+ ),
349
+ /* @__PURE__ */ t(gt, { children: e("patientPortal.details.readOnly") })
350
+ ] }),
351
+ b ? g ? /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
352
+ /* @__PURE__ */ t(pt, { block: "details-form" }),
353
+ /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
354
+ I,
355
+ {
356
+ type: "button",
357
+ intent: "ghost",
358
+ className: "ds:min-h-[var(--min-target-size)]",
359
+ "data-action": "discard-details",
360
+ onClick: () => {
361
+ D(n), $(!1);
362
+ },
363
+ children: e("patientPortal.details.discard")
364
+ }
365
+ ) })
366
+ ] }) : /* @__PURE__ */ d(
367
+ "form",
368
+ {
369
+ ref: q,
370
+ noValidate: !0,
371
+ className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
372
+ onSubmit: (l) => {
373
+ l.preventDefault(), k || N(H);
374
+ },
375
+ children: [
376
+ M ? /* @__PURE__ */ t(
377
+ rt,
378
+ {
379
+ ref: J,
380
+ headingLevel: F === 1 ? 2 : 3,
381
+ errors: B.map((l) => ({
382
+ field: l,
383
+ label: nt[l],
384
+ message: (r == null ? void 0 : r[l]) ?? "",
385
+ targetId: Z(U, l)
386
+ }))
387
+ }
388
+ ) : null,
389
+ /* @__PURE__ */ t(
390
+ Nt,
391
+ {
392
+ values: H,
393
+ onChange: D,
394
+ fieldErrors: r,
395
+ idPrefix: U,
396
+ announceErrors: !1,
397
+ disabled: k
398
+ }
399
+ ),
400
+ /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-wrap ds:gap-[var(--spacing-sm)]", children: [
401
+ /* @__PURE__ */ t(
402
+ I,
403
+ {
404
+ type: "submit",
405
+ intent: "primary",
406
+ className: "ds:min-h-[var(--min-target-size)]",
407
+ loading: k,
408
+ "data-action": "save-details",
409
+ children: e(k ? "patientPortal.details.saving" : "patientPortal.details.save")
410
+ }
411
+ ),
412
+ /* @__PURE__ */ t(
413
+ I,
414
+ {
415
+ type: "button",
416
+ intent: "ghost",
417
+ className: "ds:min-h-[var(--min-target-size)]",
418
+ disabled: k,
419
+ "data-action": "discard-details",
420
+ onClick: () => {
421
+ D(n), $(!1);
422
+ },
423
+ children: e("patientPortal.details.discard")
424
+ }
425
+ )
426
+ ] })
427
+ ]
428
+ }
429
+ ) : /* @__PURE__ */ d(T, { children: [
430
+ /* @__PURE__ */ t(P, { layout: "responsive", divider: "between", children: lt.map(([l, f, w]) => /* @__PURE__ */ d(P.Row, { children: [
431
+ /* @__PURE__ */ t(P.Term, { children: l }),
432
+ /* @__PURE__ */ t(P.Detail, { children: f ? /* @__PURE__ */ t(
433
+ "bdi",
434
+ {
435
+ dir: w && !g ? "ltr" : void 0,
436
+ className: "ds:break-words",
437
+ children: f
438
+ }
439
+ ) : /* @__PURE__ */ d(T, { children: [
440
+ /* @__PURE__ */ t("span", { "aria-hidden": "true", children: "–" }),
441
+ /* @__PURE__ */ t(mt, { children: e("patientPortal.details.notGiven") })
442
+ ] }) })
443
+ ] }, l)) }),
444
+ g ? null : /* @__PURE__ */ t(
445
+ I,
446
+ {
447
+ ref: G,
448
+ type: "button",
449
+ intent: "secondary",
450
+ className: "ds:min-h-[var(--min-target-size)] ds:self-start",
451
+ "data-action": "edit-details",
452
+ onClick: () => {
453
+ D(n), $(!0);
454
+ },
455
+ children: e("patientPortal.details.edit")
456
+ }
457
+ )
458
+ ] })
459
+ ] }),
460
+ /* @__PURE__ */ t(
461
+ Pt,
462
+ {
463
+ config: s,
464
+ privacy: g,
465
+ defaultSubject: e("patientPortal.details.stepUp.saveSubject")
466
+ }
467
+ )
468
+ ]
469
+ }
470
+ );
471
+ }
472
+ export {
473
+ Rt as P,
474
+ Nt as a,
475
+ Ct as b,
476
+ Z as p
477
+ };
478
+ //# sourceMappingURL=portal-details-CTEsm705.js.map