@alfadocs/ui-kit-debug 1.90.1 → 1.91.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 (380) hide show
  1. package/dist/_chunks/address-autocomplete-DR4Xn23Z.js +519 -0
  2. package/dist/_chunks/address-autocomplete-DR4Xn23Z.js.map +1 -0
  3. package/dist/_chunks/{address-fields-CfnXK8RT.js → address-fields-qxQkGwPf.js} +5 -5
  4. package/dist/_chunks/{address-fields-CfnXK8RT.js.map → address-fields-qxQkGwPf.js.map} +1 -1
  5. package/dist/_chunks/{agenda-card-BDuvreCe.js → agenda-card-BhY342MA.js} +2 -2
  6. package/dist/_chunks/{agenda-card-BDuvreCe.js.map → agenda-card-BhY342MA.js.map} +1 -1
  7. package/dist/_chunks/{agenda-tray-D-jvptdo.js → agenda-tray-BmxBGEci.js} +2 -2
  8. package/dist/_chunks/{agenda-tray-D-jvptdo.js.map → agenda-tray-BmxBGEci.js.map} +1 -1
  9. package/dist/_chunks/{ai-permission-notice-CoW22jx1.js → ai-permission-notice-VNh3W57L.js} +2 -2
  10. package/dist/_chunks/{ai-permission-notice-CoW22jx1.js.map → ai-permission-notice-VNh3W57L.js.map} +1 -1
  11. package/dist/_chunks/{alia-sidebar-CsTRAxC8.js → alia-sidebar-ovRX_oti.js} +3 -3
  12. package/dist/_chunks/{alia-sidebar-CsTRAxC8.js.map → alia-sidebar-ovRX_oti.js.map} +1 -1
  13. package/dist/_chunks/{anamnesis-summary-rows-fbEQwcuW.js → anamnesis-summary-rows-EKPfVCmh.js} +2 -2
  14. package/dist/_chunks/{anamnesis-summary-rows-fbEQwcuW.js.map → anamnesis-summary-rows-EKPfVCmh.js.map} +1 -1
  15. package/dist/_chunks/{appointment-card-5JMWi9_f.js → appointment-card-Bstc1p7a.js} +2 -2
  16. package/dist/_chunks/{appointment-card-5JMWi9_f.js.map → appointment-card-Bstc1p7a.js.map} +1 -1
  17. package/dist/_chunks/{appointment-peek-39BwVMUf.js → appointment-peek-C0kKqnFk.js} +2 -2
  18. package/dist/_chunks/{appointment-peek-39BwVMUf.js.map → appointment-peek-C0kKqnFk.js.map} +1 -1
  19. package/dist/_chunks/{appointment-timeline-1-Za2miy.js → appointment-timeline-rbt9AwHO.js} +2 -2
  20. package/dist/_chunks/{appointment-timeline-1-Za2miy.js.map → appointment-timeline-rbt9AwHO.js.map} +1 -1
  21. package/dist/_chunks/{appointment-tray-Dwc8MSIQ.js → appointment-tray-6zd8RLIL.js} +2 -2
  22. package/dist/_chunks/{appointment-tray-Dwc8MSIQ.js.map → appointment-tray-6zd8RLIL.js.map} +1 -1
  23. package/dist/_chunks/autocomplete-BXMcNoa3.js +562 -0
  24. package/dist/_chunks/autocomplete-BXMcNoa3.js.map +1 -0
  25. package/dist/_chunks/{avatar-BPiPL7ND.js → avatar-a6042Ox2.js} +52 -52
  26. package/dist/_chunks/avatar-a6042Ox2.js.map +1 -0
  27. package/dist/_chunks/{balance-badge-cell-C4FYwmrZ.js → balance-badge-cell-BtJvre1-.js} +3 -3
  28. package/dist/_chunks/{balance-badge-cell-C4FYwmrZ.js.map → balance-badge-cell-BtJvre1-.js.map} +1 -1
  29. package/dist/_chunks/booking-opt_h7Uc.js +4590 -0
  30. package/dist/_chunks/booking-opt_h7Uc.js.map +1 -0
  31. package/dist/_chunks/{calendar-ClB-jWH1.js → calendar-CmiMS4FJ.js} +2 -2
  32. package/dist/_chunks/{calendar-ClB-jWH1.js.map → calendar-CmiMS4FJ.js.map} +1 -1
  33. package/dist/_chunks/{calendar-appointment-editor-dialog-C1v2MNE4.js → calendar-appointment-editor-dialog-sJKLoVJ2.js} +11 -11
  34. package/dist/_chunks/{calendar-appointment-editor-dialog-C1v2MNE4.js.map → calendar-appointment-editor-dialog-sJKLoVJ2.js.map} +1 -1
  35. package/dist/_chunks/{care-plan-card-BYCPNDvA.js → care-plan-card-DD9rEWYN.js} +2 -2
  36. package/dist/_chunks/{care-plan-card-BYCPNDvA.js.map → care-plan-card-DD9rEWYN.js.map} +1 -1
  37. package/dist/_chunks/{care-plan-header-BzsAg6oY.js → care-plan-header-CXUJQt8Q.js} +2 -2
  38. package/dist/_chunks/{care-plan-header-BzsAg6oY.js.map → care-plan-header-CXUJQt8Q.js.map} +1 -1
  39. package/dist/_chunks/{chat-message-CmFJdEre.js → chat-message-LRO_6Ee3.js} +2 -2
  40. package/dist/_chunks/{chat-message-CmFJdEre.js.map → chat-message-LRO_6Ee3.js.map} +1 -1
  41. package/dist/_chunks/{checkbox-BjDv-r3o.js → checkbox-a7Sh-dXb.js} +32 -31
  42. package/dist/_chunks/checkbox-a7Sh-dXb.js.map +1 -0
  43. package/dist/_chunks/{checkbox-group-Cw2H5qaq.js → checkbox-group-eGdv9fZc.js} +2 -2
  44. package/dist/_chunks/{checkbox-group-Cw2H5qaq.js.map → checkbox-group-eGdv9fZc.js.map} +1 -1
  45. package/dist/_chunks/{city-input-CJVGswxp.js → city-input-CA59CjnV.js} +2 -2
  46. package/dist/_chunks/{city-input-CJVGswxp.js.map → city-input-CA59CjnV.js.map} +1 -1
  47. package/dist/_chunks/{clinical-note-card-Caidqcwa.js → clinical-note-card-Cut2lNmu.js} +3 -3
  48. package/dist/_chunks/{clinical-note-card-Caidqcwa.js.map → clinical-note-card-Cut2lNmu.js.map} +1 -1
  49. package/dist/_chunks/{combobox-CDPm_n0p.js → combobox-D-gpgEDy.js} +314 -294
  50. package/dist/_chunks/combobox-D-gpgEDy.js.map +1 -0
  51. package/dist/_chunks/{contact-card-Czu60UvU.js → contact-card-ClvEDM9e.js} +2 -2
  52. package/dist/_chunks/{contact-card-Czu60UvU.js.map → contact-card-ClvEDM9e.js.map} +1 -1
  53. package/dist/_chunks/{contact-profile-card-Da1vmJQI.js → contact-profile-card-CX45mZA3.js} +106 -95
  54. package/dist/_chunks/contact-profile-card-CX45mZA3.js.map +1 -0
  55. package/dist/_chunks/{country-select-DQ8q7ypA.js → country-select-BfmX9y5i.js} +2 -2
  56. package/dist/_chunks/{country-select-DQ8q7ypA.js.map → country-select-BfmX9y5i.js.map} +1 -1
  57. package/dist/_chunks/{data-table-B_IcS0Ke.js → data-table-CqQgoNsU.js} +2 -2
  58. package/dist/_chunks/{data-table-B_IcS0Ke.js.map → data-table-CqQgoNsU.js.map} +1 -1
  59. package/dist/_chunks/{dependent-selector-C4kOgO8b.js → dependent-selector-CyNi7M_f.js} +2 -2
  60. package/dist/_chunks/{dependent-selector-C4kOgO8b.js.map → dependent-selector-CyNi7M_f.js.map} +1 -1
  61. package/dist/_chunks/{entity-summary-BLxzSSXK.js → entity-summary-B_bOloqP.js} +3 -3
  62. package/dist/_chunks/{entity-summary-BLxzSSXK.js.map → entity-summary-B_bOloqP.js.map} +1 -1
  63. package/dist/_chunks/error-page-B0fGNTRB.js +419 -0
  64. package/dist/_chunks/error-page-B0fGNTRB.js.map +1 -0
  65. package/dist/_chunks/{face-scheme-BgJGFDTa.js → face-scheme-BKSE98bo.js} +2 -2
  66. package/dist/_chunks/{face-scheme-BgJGFDTa.js.map → face-scheme-BKSE98bo.js.map} +1 -1
  67. package/dist/_chunks/{file-manager-C9YOT-Dn.js → file-manager-BnI1ZWZu.js} +2 -2
  68. package/dist/_chunks/{file-manager-C9YOT-Dn.js.map → file-manager-BnI1ZWZu.js.map} +1 -1
  69. package/dist/_chunks/{header-settings-BVhjndtV.js → header-settings-BeA2fnol.js} +24 -23
  70. package/dist/_chunks/header-settings-BeA2fnol.js.map +1 -0
  71. package/dist/_chunks/{heatmap-HTz3Jvzy.js → heatmap-fCxwNz2o.js} +2 -2
  72. package/dist/_chunks/{heatmap-HTz3Jvzy.js.map → heatmap-fCxwNz2o.js.map} +1 -1
  73. package/dist/_chunks/{languages-CZqBaPwI.js → languages-CGLX6Qpe.js} +3 -15
  74. package/dist/_chunks/languages-CGLX6Qpe.js.map +1 -0
  75. package/dist/_chunks/link-DtCfnLnF.js +332 -0
  76. package/dist/_chunks/link-DtCfnLnF.js.map +1 -0
  77. package/dist/_chunks/{link-cell-renderer-C0ynDik7.js → link-cell-renderer-BS3V4LA6.js} +4 -4
  78. package/dist/_chunks/{link-cell-renderer-C0ynDik7.js.map → link-cell-renderer-BS3V4LA6.js.map} +1 -1
  79. package/dist/_chunks/{login-dev-card-DYwbL5sD.js → login-dev-card-BZBR58mu.js} +2 -2
  80. package/dist/_chunks/{login-dev-card-DYwbL5sD.js.map → login-dev-card-BZBR58mu.js.map} +1 -1
  81. package/dist/_chunks/{map-view-Bvi06RVh.js → map-view-UrNgxBy3.js} +260 -237
  82. package/dist/_chunks/map-view-UrNgxBy3.js.map +1 -0
  83. package/dist/_chunks/{index.modern-BeRXQVdc.js → maps-core-gate-DkNqGkm3.js} +360 -319
  84. package/dist/_chunks/maps-core-gate-DkNqGkm3.js.map +1 -0
  85. package/dist/_chunks/{marketplace-app-shell-x_abo_ye.js → marketplace-app-shell-CJQtx3sv.js} +3 -3
  86. package/dist/_chunks/{marketplace-app-shell-x_abo_ye.js.map → marketplace-app-shell-CJQtx3sv.js.map} +1 -1
  87. package/dist/_chunks/{message-card-CvCnCssc.js → message-card-B6SduXJv.js} +2 -2
  88. package/dist/_chunks/{message-card-CvCnCssc.js.map → message-card-B6SduXJv.js.map} +1 -1
  89. package/dist/_chunks/{message-tray-IJYvy6Cf.js → message-tray-Cllf-v0G.js} +2 -2
  90. package/dist/_chunks/{message-tray-IJYvy6Cf.js.map → message-tray-Cllf-v0G.js.map} +1 -1
  91. package/dist/_chunks/{nav-grid-Oc4aCPrg.js → nav-grid-D2xVcHTO.js} +2 -2
  92. package/dist/_chunks/{nav-grid-Oc4aCPrg.js.map → nav-grid-D2xVcHTO.js.map} +1 -1
  93. package/dist/_chunks/{note-attachment-DIlIQ7JF.js → note-attachment-cnj2JRrg.js} +2 -2
  94. package/dist/_chunks/{note-attachment-DIlIQ7JF.js.map → note-attachment-cnj2JRrg.js.map} +1 -1
  95. package/dist/_chunks/{note-timeline-KzL52MmB.js → note-timeline-BrjHBQfx.js} +2 -2
  96. package/dist/_chunks/{note-timeline-KzL52MmB.js.map → note-timeline-BrjHBQfx.js.map} +1 -1
  97. package/dist/_chunks/{notes-panel-CZO1qsD-.js → notes-panel-ib7I3aNf.js} +3 -3
  98. package/dist/_chunks/{notes-panel-CZO1qsD-.js.map → notes-panel-ib7I3aNf.js.map} +1 -1
  99. package/dist/_chunks/{operator-hero-6aAIQaFZ.js → operator-hero-C_5B-8Qp.js} +43 -41
  100. package/dist/_chunks/operator-hero-C_5B-8Qp.js.map +1 -0
  101. package/dist/_chunks/{patient-details-D0P5eog5.js → patient-details-BjcUpD9S.js} +3 -3
  102. package/dist/_chunks/{patient-details-D0P5eog5.js.map → patient-details-BjcUpD9S.js.map} +1 -1
  103. package/dist/_chunks/{patient-field-row-R73dZJY6.js → patient-field-row-B0tdiaWi.js} +6 -6
  104. package/dist/_chunks/{patient-field-row-R73dZJY6.js.map → patient-field-row-B0tdiaWi.js.map} +1 -1
  105. package/dist/_chunks/patient-search-Ca9j5cWb.js +1306 -0
  106. package/dist/_chunks/patient-search-Ca9j5cWb.js.map +1 -0
  107. package/dist/_chunks/{patient-summary-card-6U74-ivO.js → patient-summary-card-Cvv6_Ugk.js} +4 -4
  108. package/dist/_chunks/{patient-summary-card-6U74-ivO.js.map → patient-summary-card-Cvv6_Ugk.js.map} +1 -1
  109. package/dist/_chunks/{payment-request-card-MndSlVoK.js → payment-request-card-BfGauFY0.js} +2 -2
  110. package/dist/_chunks/{payment-request-card-MndSlVoK.js.map → payment-request-card-BfGauFY0.js.map} +1 -1
  111. package/dist/_chunks/{periodontal-diagnosis-B9YmmVmM.js → periodontal-diagnosis-DD3hrg9X.js} +2 -2
  112. package/dist/_chunks/{periodontal-diagnosis-B9YmmVmM.js.map → periodontal-diagnosis-DD3hrg9X.js.map} +1 -1
  113. package/dist/_chunks/{permission-matrix-BoQjENGV.js → permission-matrix-BJ6sg3Zp.js} +3 -3
  114. package/dist/_chunks/{permission-matrix-BoQjENGV.js.map → permission-matrix-BJ6sg3Zp.js.map} +1 -1
  115. package/dist/_chunks/{practice-profile-hero-qfrsFQI_.js → practice-profile-hero-ClzE-4CB.js} +76 -73
  116. package/dist/_chunks/practice-profile-hero-ClzE-4CB.js.map +1 -0
  117. package/dist/_chunks/{practice-results-B61krlwu.js → practice-results-CQ_KvEXK.js} +517 -514
  118. package/dist/_chunks/practice-results-CQ_KvEXK.js.map +1 -0
  119. package/dist/_chunks/{product-hub-panel-Blag8t8f.js → product-hub-panel-bHi7lkVD.js} +2 -2
  120. package/dist/_chunks/{product-hub-panel-Blag8t8f.js.map → product-hub-panel-bHi7lkVD.js.map} +1 -1
  121. package/dist/_chunks/{province-select-CPdTwEob.js → province-select-D64whw0m.js} +2 -2
  122. package/dist/_chunks/{province-select-CPdTwEob.js.map → province-select-D64whw0m.js.map} +1 -1
  123. package/dist/_chunks/public-footer-IoRWoAMz.js +596 -0
  124. package/dist/_chunks/public-footer-IoRWoAMz.js.map +1 -0
  125. package/dist/_chunks/{registration-form-DmP3YUfp.js → registration-form-CRm6DaB9.js} +2 -2
  126. package/dist/_chunks/{registration-form-DmP3YUfp.js.map → registration-form-CRm6DaB9.js.map} +1 -1
  127. package/dist/_chunks/{reviews-panel-UzQQLb-z.js → reviews-panel-B7InBORU.js} +42 -41
  128. package/dist/_chunks/reviews-panel-B7InBORU.js.map +1 -0
  129. package/dist/_chunks/{rich-text-editor-BZTyxQBd.js → rich-text-editor-BfEu57dk.js} +3 -3
  130. package/dist/_chunks/{rich-text-editor-BZTyxQBd.js.map → rich-text-editor-BfEu57dk.js.map} +1 -1
  131. package/dist/_chunks/{signature-request-DjY-X62H.js → signature-request-DvhyrRpn.js} +3 -3
  132. package/dist/_chunks/{signature-request-DjY-X62H.js.map → signature-request-DvhyrRpn.js.map} +1 -1
  133. package/dist/_chunks/{signed-out-frame-G-3ATOdu.js → signed-out-frame-CgRXOUzi.js} +2 -2
  134. package/dist/_chunks/{signed-out-frame-G-3ATOdu.js.map → signed-out-frame-CgRXOUzi.js.map} +1 -1
  135. package/dist/_chunks/{slot-grid-Bb13H9Rl.js → slot-grid-B-IAFX3C.js} +183 -170
  136. package/dist/_chunks/slot-grid-B-IAFX3C.js.map +1 -0
  137. package/dist/_chunks/{task-editor-BOETWbjU.js → task-editor-CI1SKUNc.js} +2 -2
  138. package/dist/_chunks/{task-editor-BOETWbjU.js.map → task-editor-CI1SKUNc.js.map} +1 -1
  139. package/dist/_chunks/{timeline-wUuTDFY_.js → timeline-BcYHdP56.js} +2 -2
  140. package/dist/_chunks/{timeline-wUuTDFY_.js.map → timeline-BcYHdP56.js.map} +1 -1
  141. package/dist/_chunks/{use-appointment-details-read-CWN-nJCZ.js → use-appointment-details-read-D8vDg0sg.js} +5 -5
  142. package/dist/_chunks/{use-appointment-details-read-CWN-nJCZ.js.map → use-appointment-details-read-D8vDg0sg.js.map} +1 -1
  143. package/dist/_chunks/{voice-control-panel-BziKE-KK.js → voice-control-panel-BP0otrID.js} +2 -2
  144. package/dist/_chunks/{voice-control-panel-BziKE-KK.js.map → voice-control-panel-BP0otrID.js.map} +1 -1
  145. package/dist/_chunks/{workflow-webhook-action-DulCpCRz.js → workflow-webhook-action-B_nBJ_ht.js} +2 -2
  146. package/dist/_chunks/{workflow-webhook-action-DulCpCRz.js.map → workflow-webhook-action-B_nBJ_ht.js.map} +1 -1
  147. package/dist/agent-catalog.json +3 -3
  148. package/dist/agent-i18n/en.json +1 -1
  149. package/dist/components/_shared/maps-core-gate.d.ts +18 -0
  150. package/dist/components/_shared/maps-core-gate.d.ts.map +1 -0
  151. package/dist/components/_shared/social-brand-icons.d.ts +29 -0
  152. package/dist/components/_shared/social-brand-icons.d.ts.map +1 -0
  153. package/dist/components/address-autocomplete/address-autocomplete.d.ts.map +1 -1
  154. package/dist/components/address-autocomplete/index.js +1 -1
  155. package/dist/components/address-fields/index.js +1 -1
  156. package/dist/components/agenda-card/index.js +1 -1
  157. package/dist/components/agenda-tray/index.js +1 -1
  158. package/dist/components/ai-permission-notice/index.js +1 -1
  159. package/dist/components/appointment-card/index.js +2 -2
  160. package/dist/components/appointment-details-panel/index.js +1 -1
  161. package/dist/components/appointment-peek/index.js +1 -1
  162. package/dist/components/appointment-timeline/index.js +1 -1
  163. package/dist/components/autocomplete/autocomplete.agent.d.ts.map +1 -1
  164. package/dist/components/autocomplete/autocomplete.d.ts.map +1 -1
  165. package/dist/components/autocomplete/index.js +1 -1
  166. package/dist/components/avatar/avatar.d.ts +14 -0
  167. package/dist/components/avatar/avatar.d.ts.map +1 -1
  168. package/dist/components/avatar/index.js +1 -1
  169. package/dist/components/booking/booking-types.d.ts +26 -0
  170. package/dist/components/booking/booking-types.d.ts.map +1 -1
  171. package/dist/components/booking/booking.d.ts.map +1 -1
  172. package/dist/components/booking/details-form.d.ts.map +1 -1
  173. package/dist/components/booking/index.js +1 -1
  174. package/dist/components/booking/slot-load-state.d.ts +11 -0
  175. package/dist/components/booking/slot-load-state.d.ts.map +1 -0
  176. package/dist/components/calendar/index.js +1 -1
  177. package/dist/components/care-plan-card/index.js +1 -1
  178. package/dist/components/care-plan-header/index.js +1 -1
  179. package/dist/components/chat-message/index.js +1 -1
  180. package/dist/components/checkbox/checkbox.d.ts.map +1 -1
  181. package/dist/components/checkbox/index.js +1 -1
  182. package/dist/components/checkbox-group/index.js +1 -1
  183. package/dist/components/city-input/index.js +1 -1
  184. package/dist/components/clinical-note-card/index.js +1 -1
  185. package/dist/components/combobox/combobox.d.ts.map +1 -1
  186. package/dist/components/combobox/index.js +1 -1
  187. package/dist/components/contact-card/index.js +1 -1
  188. package/dist/components/contact-profile-card/index.js +1 -1
  189. package/dist/components/country-select/index.js +1 -1
  190. package/dist/components/data-table/index.js +2 -2
  191. package/dist/components/dependent-selector/index.js +1 -1
  192. package/dist/components/entity-summary/index.js +1 -1
  193. package/dist/components/face-scheme/index.js +1 -1
  194. package/dist/components/file-manager/index.js +1 -1
  195. package/dist/components/header-settings/header-settings.d.ts +2 -1
  196. package/dist/components/header-settings/header-settings.d.ts.map +1 -1
  197. package/dist/components/header-settings/index.js +1 -1
  198. package/dist/components/heatmap/index.js +1 -1
  199. package/dist/components/link/index.js +1 -1
  200. package/dist/components/link/link.d.ts +10 -1
  201. package/dist/components/link/link.d.ts.map +1 -1
  202. package/dist/components/link/social-url.d.ts +71 -0
  203. package/dist/components/link/social-url.d.ts.map +1 -0
  204. package/dist/components/map-view/index.js +1 -1
  205. package/dist/components/map-view/map-view.d.ts.map +1 -1
  206. package/dist/components/message-card/index.js +1 -1
  207. package/dist/components/message-tray/index.js +1 -1
  208. package/dist/components/nav-grid/index.js +1 -1
  209. package/dist/components/note-timeline/index.js +1 -1
  210. package/dist/components/notes-panel/index.js +1 -1
  211. package/dist/components/operator-hero/index.js +1 -1
  212. package/dist/components/operator-hero/operator-hero.d.ts +6 -0
  213. package/dist/components/operator-hero/operator-hero.d.ts.map +1 -1
  214. package/dist/components/patient-details/index.js +1 -1
  215. package/dist/components/patient-search/index.js +1 -1
  216. package/dist/components/patient-search/patient-search.d.ts.map +1 -1
  217. package/dist/components/patient-summary-card/index.js +1 -1
  218. package/dist/components/patient-table/index.js +1 -1
  219. package/dist/components/payment-card/index.js +1 -1
  220. package/dist/components/periodontal-diagnosis/index.js +1 -1
  221. package/dist/components/permission-matrix/index.js +1 -1
  222. package/dist/components/practice-profile-hero/index.js +1 -1
  223. package/dist/components/practice-profile-hero/practice-profile-hero.d.ts +6 -0
  224. package/dist/components/practice-profile-hero/practice-profile-hero.d.ts.map +1 -1
  225. package/dist/components/practice-results/index.js +1 -1
  226. package/dist/components/practice-results/practice-results.d.ts +8 -2
  227. package/dist/components/practice-results/practice-results.d.ts.map +1 -1
  228. package/dist/components/product-hub-tray/index.js +1 -1
  229. package/dist/components/province-select/index.js +1 -1
  230. package/dist/components/public-footer/index.js +1 -1
  231. package/dist/components/public-footer/public-footer.d.ts +13 -1
  232. package/dist/components/public-footer/public-footer.d.ts.map +1 -1
  233. package/dist/components/public-footer/socials.d.ts +6 -5
  234. package/dist/components/public-footer/socials.d.ts.map +1 -1
  235. package/dist/components/reviews-panel/index.js +1 -1
  236. package/dist/components/reviews-panel/reviews-panel.d.ts.map +1 -1
  237. package/dist/components/rich-text-editor/index.js +1 -1
  238. package/dist/components/slot-grid/index.js +1 -1
  239. package/dist/components/slot-grid/slot-grid.d.ts +2 -0
  240. package/dist/components/slot-grid/slot-grid.d.ts.map +1 -1
  241. package/dist/components/task-editor/index.js +1 -1
  242. package/dist/components/timeline/index.js +1 -1
  243. package/dist/components/voice-control-panel/index.js +1 -1
  244. package/dist/host-compat.css +1 -10
  245. package/dist/i18n/config.d.ts.map +1 -1
  246. package/dist/i18n/config.js +224 -96
  247. package/dist/i18n/config.js.map +1 -1
  248. package/dist/i18n/locales/ar.d.ts +3 -0
  249. package/dist/i18n/locales/ar.d.ts.map +1 -1
  250. package/dist/i18n/locales/ar.js +4 -1
  251. package/dist/i18n/locales/ar.js.map +1 -1
  252. package/dist/i18n/locales/de.d.ts +3 -0
  253. package/dist/i18n/locales/de.d.ts.map +1 -1
  254. package/dist/i18n/locales/de.js +4 -1
  255. package/dist/i18n/locales/de.js.map +1 -1
  256. package/dist/i18n/locales/el.d.ts +3 -0
  257. package/dist/i18n/locales/el.d.ts.map +1 -1
  258. package/dist/i18n/locales/el.js +4 -1
  259. package/dist/i18n/locales/el.js.map +1 -1
  260. package/dist/i18n/locales/en.d.ts +3 -0
  261. package/dist/i18n/locales/en.d.ts.map +1 -1
  262. package/dist/i18n/locales/en.js +3 -0
  263. package/dist/i18n/locales/en.js.map +1 -1
  264. package/dist/i18n/locales/es.d.ts +3 -0
  265. package/dist/i18n/locales/es.d.ts.map +1 -1
  266. package/dist/i18n/locales/es.js +4 -1
  267. package/dist/i18n/locales/es.js.map +1 -1
  268. package/dist/i18n/locales/fr.d.ts +3 -0
  269. package/dist/i18n/locales/fr.d.ts.map +1 -1
  270. package/dist/i18n/locales/fr.js +4 -1
  271. package/dist/i18n/locales/fr.js.map +1 -1
  272. package/dist/i18n/locales/hi.d.ts +3 -0
  273. package/dist/i18n/locales/hi.d.ts.map +1 -1
  274. package/dist/i18n/locales/hi.js +4 -1
  275. package/dist/i18n/locales/hi.js.map +1 -1
  276. package/dist/i18n/locales/it.d.ts +3 -0
  277. package/dist/i18n/locales/it.d.ts.map +1 -1
  278. package/dist/i18n/locales/it.js +4 -1
  279. package/dist/i18n/locales/it.js.map +1 -1
  280. package/dist/i18n/locales/ja.d.ts +3 -0
  281. package/dist/i18n/locales/ja.d.ts.map +1 -1
  282. package/dist/i18n/locales/ja.js +4 -1
  283. package/dist/i18n/locales/ja.js.map +1 -1
  284. package/dist/i18n/locales/nl.d.ts +3 -0
  285. package/dist/i18n/locales/nl.d.ts.map +1 -1
  286. package/dist/i18n/locales/nl.js +4 -1
  287. package/dist/i18n/locales/nl.js.map +1 -1
  288. package/dist/i18n/locales/pl.d.ts +3 -0
  289. package/dist/i18n/locales/pl.d.ts.map +1 -1
  290. package/dist/i18n/locales/pl.js +4 -1
  291. package/dist/i18n/locales/pl.js.map +1 -1
  292. package/dist/i18n/locales/pt.d.ts +3 -0
  293. package/dist/i18n/locales/pt.d.ts.map +1 -1
  294. package/dist/i18n/locales/pt.js +4 -1
  295. package/dist/i18n/locales/pt.js.map +1 -1
  296. package/dist/i18n/locales/ro.d.ts +3 -0
  297. package/dist/i18n/locales/ro.d.ts.map +1 -1
  298. package/dist/i18n/locales/ro.js +4 -1
  299. package/dist/i18n/locales/ro.js.map +1 -1
  300. package/dist/i18n/locales/ru.d.ts +3 -0
  301. package/dist/i18n/locales/ru.d.ts.map +1 -1
  302. package/dist/i18n/locales/ru.js +4 -1
  303. package/dist/i18n/locales/ru.js.map +1 -1
  304. package/dist/i18n/locales/sq.d.ts +3 -0
  305. package/dist/i18n/locales/sq.d.ts.map +1 -1
  306. package/dist/i18n/locales/sq.js +4 -1
  307. package/dist/i18n/locales/sq.js.map +1 -1
  308. package/dist/i18n/locales/sv.d.ts +3 -0
  309. package/dist/i18n/locales/sv.d.ts.map +1 -1
  310. package/dist/i18n/locales/sv.js +4 -1
  311. package/dist/i18n/locales/sv.js.map +1 -1
  312. package/dist/i18n/locales/tr.d.ts +3 -0
  313. package/dist/i18n/locales/tr.d.ts.map +1 -1
  314. package/dist/i18n/locales/tr.js +4 -1
  315. package/dist/i18n/locales/tr.js.map +1 -1
  316. package/dist/i18n/locales/zh.d.ts +3 -0
  317. package/dist/i18n/locales/zh.d.ts.map +1 -1
  318. package/dist/i18n/locales/zh.js +4 -1
  319. package/dist/i18n/locales/zh.js.map +1 -1
  320. package/dist/index.js +68 -68
  321. package/dist/locales/ar.json +4 -1
  322. package/dist/locales/de.json +4 -1
  323. package/dist/locales/el.json +4 -1
  324. package/dist/locales/en.json +3 -0
  325. package/dist/locales/es.json +4 -1
  326. package/dist/locales/fr.json +4 -1
  327. package/dist/locales/hi.json +4 -1
  328. package/dist/locales/it.json +4 -1
  329. package/dist/locales/ja.json +4 -1
  330. package/dist/locales/nl.json +4 -1
  331. package/dist/locales/pl.json +4 -1
  332. package/dist/locales/pt.json +4 -1
  333. package/dist/locales/ro.json +4 -1
  334. package/dist/locales/ru.json +4 -1
  335. package/dist/locales/sq.json +4 -1
  336. package/dist/locales/sv.json +4 -1
  337. package/dist/locales/tr.json +4 -1
  338. package/dist/locales/zh.json +4 -1
  339. package/dist/patterns/alia-assistant/index.js +1 -1
  340. package/dist/patterns/anamnesis/index.js +1 -1
  341. package/dist/patterns/calendar/index.js +1 -1
  342. package/dist/patterns/error-page/error-page-english.d.ts +71 -0
  343. package/dist/patterns/error-page/error-page-english.d.ts.map +1 -0
  344. package/dist/patterns/error-page/error-page.d.ts.map +1 -1
  345. package/dist/patterns/error-page/index.js +1 -1
  346. package/dist/patterns/login-form/index.js +1 -1
  347. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  348. package/dist/patterns/registration-form/index.js +1 -1
  349. package/dist/patterns/signature-request/index.js +1 -1
  350. package/dist/patterns/signed-out-frame/index.js +1 -1
  351. package/dist/patterns/workflow-webhook-action/index.js +1 -1
  352. package/dist/tokens.css +1 -1
  353. package/package.json +1 -1
  354. package/dist/_chunks/address-autocomplete-bPR2mNBt.js +0 -498
  355. package/dist/_chunks/address-autocomplete-bPR2mNBt.js.map +0 -1
  356. package/dist/_chunks/autocomplete-CnB1mHGc.js +0 -539
  357. package/dist/_chunks/autocomplete-CnB1mHGc.js.map +0 -1
  358. package/dist/_chunks/avatar-BPiPL7ND.js.map +0 -1
  359. package/dist/_chunks/booking-C0FoW8Yx.js +0 -4336
  360. package/dist/_chunks/booking-C0FoW8Yx.js.map +0 -1
  361. package/dist/_chunks/checkbox-BjDv-r3o.js.map +0 -1
  362. package/dist/_chunks/combobox-CDPm_n0p.js.map +0 -1
  363. package/dist/_chunks/contact-profile-card-Da1vmJQI.js.map +0 -1
  364. package/dist/_chunks/error-page-Bhai-spN.js +0 -344
  365. package/dist/_chunks/error-page-Bhai-spN.js.map +0 -1
  366. package/dist/_chunks/header-settings-BVhjndtV.js.map +0 -1
  367. package/dist/_chunks/index.modern-BeRXQVdc.js.map +0 -1
  368. package/dist/_chunks/languages-CZqBaPwI.js.map +0 -1
  369. package/dist/_chunks/link-N5_YpLtm.js +0 -138
  370. package/dist/_chunks/link-N5_YpLtm.js.map +0 -1
  371. package/dist/_chunks/map-view-Bvi06RVh.js.map +0 -1
  372. package/dist/_chunks/operator-hero-6aAIQaFZ.js.map +0 -1
  373. package/dist/_chunks/patient-search-CCOUZABE.js +0 -1196
  374. package/dist/_chunks/patient-search-CCOUZABE.js.map +0 -1
  375. package/dist/_chunks/practice-profile-hero-qfrsFQI_.js.map +0 -1
  376. package/dist/_chunks/practice-results-B61krlwu.js.map +0 -1
  377. package/dist/_chunks/public-footer-CXOrdAaS.js +0 -568
  378. package/dist/_chunks/public-footer-CXOrdAaS.js.map +0 -1
  379. package/dist/_chunks/reviews-panel-UzQQLb-z.js.map +0 -1
  380. package/dist/_chunks/slot-grid-Bb13H9Rl.js.map +0 -1
@@ -1,4336 +0,0 @@
1
- import { jsx as n, jsxs as S, Fragment as ie } from "react/jsx-runtime";
2
- import { forwardRef as Cn, useId as at, useRef as M, useCallback as ke, useState as H, useEffect as q, useMemo as $, Fragment as ns, useLayoutEffect as an, useImperativeHandle as ss } from "react";
3
- import { c as At } from "./index-D2ZczOXr.js";
4
- import { useTranslation as Z, Trans as Tn } from "react-i18next";
5
- import { u as rs } from "./registry-DvAUVLHh.js";
6
- import { A as oe } from "./alert-9kEwDza3.js";
7
- import { B as we } from "./button-DohK_Ak_.js";
8
- import { C as bt } from "./checkbox-BjDv-r3o.js";
9
- import { C as is } from "./checkbox-group-Cw2H5qaq.js";
10
- import { R as os } from "./radio-BZQs6_36.js";
11
- import { R as as } from "./radio-group-ChIKyeSJ.js";
12
- import { D as cs } from "./date-picker-CdhXlgVI.js";
13
- import { E as ds } from "./email-input-C7THAwh2.js";
14
- import { F as Ke } from "./form-field-CyHfOVKF.js";
15
- import { P as ls } from "./phone-input-DJ4BN8tG.js";
16
- import { T as us } from "./text-area-COMVJ1yE.js";
17
- import { T as qt } from "./text-input-CaG9ApoE.js";
18
- import { A as ms } from "./address-fields-CfnXK8RT.js";
19
- import { S as An } from "./spinner-CoflYlEx.js";
20
- import { a as Zt } from "./format-price-BcFBa-WP.js";
21
- import { C as ps } from "./credit-card-D9XZsHGA.js";
22
- import { C as fs } from "./card-BA4Ig_kn.js";
23
- import { O as gs } from "./otp-input-gV1446Dw.js";
24
- import { i as hs } from "./safe-href-5dbsfbQn.js";
25
- import { B as Dn } from "./badge-BUk4RjTS.js";
26
- import { I as bn } from "./icon-button-S8_weU3g.js";
27
- import { S as Xt } from "./select-4S-eYZUf.js";
28
- import { C as un } from "./combobox-CDPm_n0p.js";
29
- import { M as mn } from "./multi-select-i5MFRpXg.js";
30
- import { c as vs } from "./option-row-Dc7BrbK8.js";
31
- import { S as Jt } from "./skeleton-tTWJpvAq.js";
32
- import { E as Mn } from "./empty-state-DwJ5YNzz.js";
33
- import { S as bs } from "./stepper-accordion-DDTSOUHc.js";
34
- import { S as ys } from "./stepper-progress-D6H8wQiV.js";
35
- import { S as ks } from "./slot-grid-Bb13H9Rl.js";
36
- import { p as fe } from "./parseISO-DZZ5a-zK.js";
37
- import { C as Ss } from "./chevron-down-DWE7GSq9.js";
38
- import { s as yt, f as Gt, d as yn } from "./format--x5jypvH.js";
39
- import { x as On, a as kt, b as sn, i as xs, s as Tt, m as Is, y as zt } from "./date-picker-variants-Dt6UbonG.js";
40
- import { s as Ns } from "./subDays-DKISP2nE.js";
41
- import { C as ws } from "./chevron-left-B8cOyH-V.js";
42
- import { C as Cs } from "./chevron-right-I9AeSxH2.js";
43
- import { c as Ce } from "./createLucideIcon-DhHxpK9K.js";
44
- import { M as Ts, S as As } from "./sun-Bj9Mr553.js";
45
- import { S as Ds } from "./stethoscope-sZXGC43m.js";
46
- import { H as Ms } from "./heart-pulse-BCppJyN2.js";
47
- import { E as Os } from "./eye-BjhN2nYf.js";
48
- import { B as Es } from "./baby-Dku-Xvg9.js";
49
- import { S as Fs } from "./scan-line-CNseIHQ0.js";
50
- import { A as Rs } from "./astroid-BN4f5VXU.js";
51
- import { C as _s } from "./clipboard-check-BeAGxDVT.js";
52
- /**
53
- * @license lucide-react v1.22.0 - ISC
54
- *
55
- * This source code is licensed under the ISC license.
56
- * See the LICENSE file in the root directory of this source tree.
57
- */
58
- const Ls = [
59
- [
60
- "path",
61
- {
62
- d: "M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",
63
- key: "169zse"
64
- }
65
- ]
66
- ], Bs = Ce("activity", Ls);
67
- /**
68
- * @license lucide-react v1.22.0 - ISC
69
- *
70
- * This source code is licensed under the ISC license.
71
- * See the LICENSE file in the root directory of this source tree.
72
- */
73
- const Ps = [
74
- [
75
- "path",
76
- {
77
- d: "M17 10c.7-.7 1.69 0 2.5 0a2.5 2.5 0 1 0 0-5 .5.5 0 0 1-.5-.5 2.5 2.5 0 1 0-5 0c0 .81.7 1.8 0 2.5l-7 7c-.7.7-1.69 0-2.5 0a2.5 2.5 0 0 0 0 5c.28 0 .5.22.5.5a2.5 2.5 0 1 0 5 0c0-.81-.7-1.8 0-2.5Z",
78
- key: "w610uw"
79
- }
80
- ]
81
- ], Vs = Ce("bone", Ps);
82
- /**
83
- * @license lucide-react v1.22.0 - ISC
84
- *
85
- * This source code is licensed under the ISC license.
86
- * See the LICENSE file in the root directory of this source tree.
87
- */
88
- const $s = [
89
- ["path", { d: "M12 18V5", key: "adv99a" }],
90
- ["path", { d: "M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4", key: "1e3is1" }],
91
- ["path", { d: "M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5", key: "1gqd8o" }],
92
- ["path", { d: "M17.997 5.125a4 4 0 0 1 2.526 5.77", key: "iwvgf7" }],
93
- ["path", { d: "M18 18a4 4 0 0 0 2-7.464", key: "efp6ie" }],
94
- ["path", { d: "M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517", key: "1gq6am" }],
95
- ["path", { d: "M6 18a4 4 0 0 1-2-7.464", key: "k1g0md" }],
96
- ["path", { d: "M6.003 5.125a4 4 0 0 0-2.526 5.77", key: "q97ue3" }]
97
- ], qs = Ce("brain", $s);
98
- /**
99
- * @license lucide-react v1.22.0 - ISC
100
- *
101
- * This source code is licensed under the ISC license.
102
- * See the LICENSE file in the root directory of this source tree.
103
- */
104
- const zs = [
105
- ["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
106
- ["path", { d: "M16 2v4", key: "4m81vk" }],
107
- ["path", { d: "M3 10h18", key: "8toen8" }],
108
- ["path", { d: "M8 2v4", key: "1cmpym" }],
109
- ["path", { d: "M17 14h-6", key: "bkmgh3" }],
110
- ["path", { d: "M13 18H7", key: "bb0bb7" }],
111
- ["path", { d: "M7 14h.01", key: "1qa3f1" }],
112
- ["path", { d: "M17 18h.01", key: "1bdyru" }]
113
- ], Ks = Ce("calendar-range", zs);
114
- /**
115
- * @license lucide-react v1.22.0 - ISC
116
- *
117
- * This source code is licensed under the ISC license.
118
- * See the LICENSE file in the root directory of this source tree.
119
- */
120
- const js = [
121
- ["path", { d: "M6 8.5a6.5 6.5 0 1 1 13 0c0 6-6 6-6 10a3.5 3.5 0 1 1-7 0", key: "1dfaln" }],
122
- ["path", { d: "M15 8.5a2.5 2.5 0 0 0-5 0v1a2 2 0 1 1 0 4", key: "1qnva7" }]
123
- ], Us = Ce("ear", js);
124
- /**
125
- * @license lucide-react v1.22.0 - ISC
126
- *
127
- * This source code is licensed under the ISC license.
128
- * See the LICENSE file in the root directory of this source tree.
129
- */
130
- const Hs = [
131
- ["path", { d: "M6 18h8", key: "1borvv" }],
132
- ["path", { d: "M3 22h18", key: "8prr45" }],
133
- ["path", { d: "M14 22a7 7 0 1 0 0-14h-1", key: "1jwaiy" }],
134
- ["path", { d: "M9 14h2", key: "197e7h" }],
135
- ["path", { d: "M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z", key: "1bmzmy" }],
136
- ["path", { d: "M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3", key: "1drr47" }]
137
- ], Gs = Ce("microscope", Hs);
138
- /**
139
- * @license lucide-react v1.22.0 - ISC
140
- *
141
- * This source code is licensed under the ISC license.
142
- * See the LICENSE file in the root directory of this source tree.
143
- */
144
- const Js = [
145
- [
146
- "path",
147
- { d: "m10.5 20.5 10-10a4.95 4.95 0 1 0-7-7l-10 10a4.95 4.95 0 1 0 7 7Z", key: "wa1lgi" }
148
- ],
149
- ["path", { d: "m8.5 8.5 7 7", key: "rvfmvr" }]
150
- ], Ws = Ce("pill", Js);
151
- /**
152
- * @license lucide-react v1.22.0 - ISC
153
- *
154
- * This source code is licensed under the ISC license.
155
- * See the LICENSE file in the root directory of this source tree.
156
- */
157
- const Ys = [
158
- ["circle", { cx: "6", cy: "6", r: "3", key: "1lh9wr" }],
159
- ["path", { d: "M8.12 8.12 12 12", key: "1alkpv" }],
160
- ["path", { d: "M20 4 8.12 15.88", key: "xgtan2" }],
161
- ["circle", { cx: "6", cy: "18", r: "3", key: "fqmcym" }],
162
- ["path", { d: "M14.8 14.8 20 20", key: "ptml3r" }]
163
- ], Zs = Ce("scissors", Ys);
164
- /**
165
- * @license lucide-react v1.22.0 - ISC
166
- *
167
- * This source code is licensed under the ISC license.
168
- * See the LICENSE file in the root directory of this source tree.
169
- */
170
- const Xs = [
171
- ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
172
- ["path", { d: "M8 14s1.5 2 4 2 4-2 4-2", key: "1y1vjs" }],
173
- ["line", { x1: "9", x2: "9.01", y1: "9", y2: "9", key: "yxxnd0" }],
174
- ["line", { x1: "15", x2: "15.01", y1: "9", y2: "9", key: "1p4y9e" }]
175
- ], Qs = Ce("smile", Xs);
176
- /**
177
- * @license lucide-react v1.22.0 - ISC
178
- *
179
- * This source code is licensed under the ISC license.
180
- * See the LICENSE file in the root directory of this source tree.
181
- */
182
- const er = [
183
- ["path", { d: "M12 10V2", key: "16sf7g" }],
184
- ["path", { d: "m4.93 10.93 1.41 1.41", key: "2a7f42" }],
185
- ["path", { d: "M2 18h2", key: "j10viu" }],
186
- ["path", { d: "M20 18h2", key: "wocana" }],
187
- ["path", { d: "m19.07 10.93-1.41 1.41", key: "15zs5n" }],
188
- ["path", { d: "M22 22H2", key: "19qnx5" }],
189
- ["path", { d: "m16 6-4 4-4-4", key: "6wukr" }],
190
- ["path", { d: "M16 18a4 4 0 0 0-8 0", key: "1lzouq" }]
191
- ], tr = Ce("sunset", er);
192
- /**
193
- * @license lucide-react v1.22.0 - ISC
194
- *
195
- * This source code is licensed under the ISC license.
196
- * See the LICENSE file in the root directory of this source tree.
197
- */
198
- const nr = [
199
- ["path", { d: "m18 2 4 4", key: "22kx64" }],
200
- ["path", { d: "m17 7 3-3", key: "1w1zoj" }],
201
- ["path", { d: "M19 9 8.7 19.3c-1 1-2.5 1-3.4 0l-.6-.6c-1-1-1-2.5 0-3.4L15 5", key: "1exhtz" }],
202
- ["path", { d: "m9 11 4 4", key: "rovt3i" }],
203
- ["path", { d: "m5 19-3 3", key: "59f2uf" }],
204
- ["path", { d: "m14 4 6 6", key: "yqp9t2" }]
205
- ], kn = Ce("syringe", nr);
206
- function sr(e, t, s) {
207
- return On(e, -1, s);
208
- }
209
- const rr = {
210
- id: "booking",
211
- // `view_change` removed (0.69): the layout `variant` is a fixed prop — the
212
- // handle exposes only `getVariant` (state), no action mutates it. The flow's
213
- // only navigation is step-to-step (`goto_step` → `navigate`).
214
- capabilities: ["navigate"],
215
- state: {
216
- variant: {
217
- type: "string",
218
- descriptionKey: "ui.agent.booking.state.variant",
219
- description: "Active variant — one of `inline-list`, `accordion`, `calendar`, `flexible`, `progress`.",
220
- read: (e) => e.getVariant()
221
- },
222
- currentStep: {
223
- type: "number",
224
- descriptionKey: "ui.agent.booking.state.currentStep",
225
- description: 'The step the flow is on: 1 insurance, 2 specialty, 3 service, 4 provider, 5 date, 6 time, 7 patient details, payment or optional SMS code verification, 8 confirmation after all required steps succeed, including the "Time reserved" view that opens a host address after a short delay. Read this back after `goto_step` to see where the clamp landed.',
226
- read: (e) => e.getCurrentStep()
227
- }
228
- },
229
- actions: {
230
- reset: {
231
- // destructive: clears the whole in-progress booking value (patient
232
- // identity, contact, slot choice) — irreversibly loses user input.
233
- safety: "destructive",
234
- idempotent: !0,
235
- descriptionKey: "ui.agent.booking.actions.reset",
236
- description: "Clear the booking value back to an empty state. Use to abandon an in-progress flow.",
237
- errors: [
238
- "Refused while a payment session is open (step 7): the consumer must cancel the hold first.",
239
- "Refused while SMS code verification is pending (step 7): the locked form and code box stay, and the submitted booking remains active. The host owns cancellation."
240
- ],
241
- invoke: (e) => {
242
- e.reset();
243
- }
244
- },
245
- goto_step: {
246
- safety: "read",
247
- argsType: "{ step: 1 | 2 | 3 | 4 | 5 | 6 | 7 }",
248
- argsSchema: {
249
- type: "object",
250
- properties: {
251
- step: {
252
- type: "integer",
253
- enum: [1, 2, 3, 4, 5, 6, 7],
254
- description: "Target step (1-7)."
255
- }
256
- },
257
- required: ["step"]
258
- },
259
- idempotent: !0,
260
- descriptionKey: "ui.agent.booking.actions.gotoStep",
261
- description: "Jump to the given step. A step that is hidden for this practice, or that sits ahead of the first incomplete step, clamps to that first incomplete step — read `currentStep` back to see where it landed.",
262
- errors: [
263
- "Navigation stays on step 7 while payment or SMS code verification is pending.",
264
- "Requested step is not yet reachable — clamped to the first incomplete step.",
265
- "Requested step is hidden for this practice (e.g. insurance outside Germany, or provider choice turned off) — clamped to the first incomplete step."
266
- ],
267
- examples: [{ args: { step: 1 }, note: "Return to the first step." }],
268
- invoke: (e, t) => {
269
- e.goToStep(t.step);
270
- }
271
- }
272
- },
273
- domHooks: {
274
- root: {
275
- attr: "data-component",
276
- value: "booking",
277
- description: 'Marks the Booking root region. The host prop hideEmail (boolean, default false) hides the email field, skips its validation and omits email from submission. The host prop emailOptional (boolean, default false) keeps email visible and optional unless used for confirmation. Email is marked and validated as required when selected in the channel picker or singleConfirmationChannel radio, or when the effective confirmation channel is email. With a hidden picker, the form and success screen use the sole enabled channel, or email when multiple channels are enabled. This includes payment and blocked-payment flows, which omit stored selections from submission. Omitting confirmationChannels also defaults to email. Selecting SMS without email makes the field optional again. The optional/required marker updates visually when the channel changes, with no announcement of that change. Validation updates immediately using the existing email error. With emailOptional, surrounding spaces are trimmed before validation, even when email is required for confirmation. Optional blank values are omitted from submission; filled values are sent trimmed. hideEmail takes precedence over emailOptional. Neither prop changes confirmation channels; pair with confirmationChannels ["sms"] for SMS-only confirmation with no channel picker. The optional codeStep prop adds SMS verification after submission and before any payment: the submitted form stays in place but locked (controls disabled, text still readable, not hidden), the code box opens below it, and a Change button, for the patient only (no agent action unlocks it), unlocks the form for a new booking request (the host keeps the earlier request until it expires; the kit cannot cancel it). With payment, a correct code opens the payment stage, and the step remains 7 until payment succeeds; without payment it remains 7 until verification succeeds. It then becomes 8. Patient contact details and verification codes are never exposed through this adapter.'
278
- },
279
- instanceId: {
280
- attr: "data-component-id",
281
- sourceProp: "id",
282
- description: "Sourced from the id prop."
283
- }
284
- }
285
- }, cn = [
286
- "email",
287
- "whatsapp",
288
- "sms"
289
- ], Re = "all", ir = "de";
290
- function or(e) {
291
- const t = e.lockedOperatorId;
292
- return [...t ? e.operatorsByService ? e.specialties.filter(
293
- (i) => e.services.some(
294
- (r) => {
295
- var c;
296
- return r.specialtyId === i.id && ((c = r.operatorIds) == null ? void 0 : c.includes(t));
297
- }
298
- )
299
- ) : e.specialties.filter((i) => {
300
- var r;
301
- return (r = i.operatorIds) == null ? void 0 : r.includes(t);
302
- }) : e.specialties].sort((i, r) => {
303
- const c = i.sequenceNumber ?? Number.POSITIVE_INFINITY, a = r.sequenceNumber ?? Number.POSITIVE_INFINITY;
304
- return c - a;
305
- });
306
- }
307
- function ar(e) {
308
- let t = e.services;
309
- if (e.lockedOperatorId && (t = t.filter(
310
- (i) => {
311
- var r;
312
- return (r = i.operatorIds) == null ? void 0 : r.includes(e.lockedOperatorId);
313
- }
314
- )), e.useSpecialties === void 0 ? e.specialties.length > 0 : e.useSpecialties) {
315
- const i = et(e.value);
316
- i.length > 0 && (t = t.filter(
317
- (r) => r.specialtyId !== void 0 && i.includes(r.specialtyId)
318
- ));
319
- }
320
- return t;
321
- }
322
- function cr(e) {
323
- const t = e.useSpecialties === void 0 ? e.specialties.length > 0 : e.useSpecialties, s = Ue(e.value);
324
- if ((!t || e.operatorsByService) && s.length > 0)
325
- return e.operators.filter(
326
- (i) => {
327
- var r;
328
- return (r = i.appointmentBookingReasonIds) == null ? void 0 : r.some((c) => s.includes(c));
329
- }
330
- );
331
- if (t) {
332
- const i = et(e.value);
333
- if (i.length > 0)
334
- return e.operators.filter(
335
- (r) => {
336
- var c;
337
- return (c = r.specialtyIds) == null ? void 0 : c.some((a) => i.includes(a));
338
- }
339
- );
340
- }
341
- return [];
342
- }
343
- function dr(e, t) {
344
- const s = e.country === ir, i = !s || e.value.insuranceType !== void 0, c = (e.useSpecialties === void 0 ? e.specialties.length > 0 : e.useSpecialties) && i, a = et(e.value).length > 0, m = !c || a, p = Ue(e.value).length > 0, f = !m || p, v = t.operators, h = !!e.allowOperatorSelection && f && p && !e.lockedOperatorId && v.length > 1, d = f && p, I = (!d || e.value.date !== void 0) && e.value.date !== void 0, F = (!I || e.value.slotKey !== void 0) && e.value.slotKey !== void 0, N = p && v.length === 0;
345
- return {
346
- insurance: s,
347
- specialty: c,
348
- service: m,
349
- operator: h,
350
- date: d,
351
- slot: I,
352
- details: F,
353
- onboardingIncomplete: N
354
- };
355
- }
356
- function lr(e, t) {
357
- const s = [];
358
- return t.insurance && s.push(1), t.specialty && s.push(2), s.push(3), t.operator && s.push(4), s.push(5), s.push(6), s.push(7), {
359
- currentStep: s.find(
360
- (r) => !je(r, e.value)
361
- ) ?? 7,
362
- visibleSteps: s
363
- };
364
- }
365
- function je(e, t) {
366
- switch (e) {
367
- case 1:
368
- return t.insuranceType !== void 0;
369
- // 0.34.0: array-or-single — satisfied when EITHER form is present.
370
- case 2:
371
- return et(t).length > 0;
372
- case 3:
373
- return Ue(t).length > 0;
374
- // Always satisfied, like its gate: "no preference" is a valid answer,
375
- // whether it is the `'all'` sentinel or an empty multi-select.
376
- case 4:
377
- return !0;
378
- case 5:
379
- return t.date !== void 0;
380
- case 6:
381
- return t.slotKey !== void 0;
382
- // Details fulfilment is owned by the form's own validation.
383
- case 7:
384
- return !1;
385
- }
386
- }
387
- function ur(e) {
388
- const t = {
389
- specialties: or(e),
390
- services: ar(e),
391
- operators: cr(e)
392
- }, s = dr(e, t), { currentStep: i, visibleSteps: r } = lr(e, s);
393
- let c;
394
- if (e.value.date && e.value.slotKey) {
395
- const f = e.availableSlots[e.value.date];
396
- f && (c = f.find((v) => v.key === e.value.slotKey));
397
- }
398
- const a = Ue(e.value), l = a.length > 0 ? e.services.find((f) => f.id === a[0]) : void 0, m = et(e.value).length > 0, p = a.length > 0 && e.value.date !== void 0 && e.value.slotKey !== void 0 && (!s.insurance || e.value.insuranceType !== void 0) && (!s.specialty || m);
399
- return {
400
- gates: s,
401
- filtered: t,
402
- currentStep: i,
403
- totalSteps: r.length,
404
- visibleSteps: r,
405
- isReadyToSubmit: p,
406
- durationMin: l == null ? void 0 : l.durationMin,
407
- selectedSlot: c
408
- };
409
- }
410
- function En(e, t) {
411
- return {
412
- ...e,
413
- insuranceType: t,
414
- specialtyId: void 0,
415
- serviceId: void 0,
416
- operatorId: void 0,
417
- date: void 0,
418
- slotKey: void 0,
419
- details: void 0
420
- };
421
- }
422
- function Fn(e, t) {
423
- return {
424
- ...e,
425
- specialtyId: t,
426
- specialtyIds: void 0,
427
- serviceId: void 0,
428
- serviceIds: void 0,
429
- operatorId: void 0,
430
- operatorIds: void 0,
431
- date: void 0,
432
- slotKey: void 0,
433
- details: void 0
434
- };
435
- }
436
- function Rn(e, t) {
437
- return {
438
- ...e,
439
- specialtyId: void 0,
440
- specialtyIds: t,
441
- serviceId: void 0,
442
- serviceIds: void 0,
443
- operatorId: void 0,
444
- operatorIds: void 0,
445
- date: void 0,
446
- slotKey: void 0,
447
- details: void 0
448
- };
449
- }
450
- function _n(e, t) {
451
- return {
452
- ...e,
453
- serviceId: t,
454
- serviceIds: void 0,
455
- // Default the operator to the "All operators" sentinel so a patient
456
- // who doesn't care about picking lands on a satisfied step 4 without
457
- // any further input.
458
- operatorId: t ? Re : void 0,
459
- operatorIds: void 0,
460
- date: void 0,
461
- slotKey: void 0,
462
- details: void 0
463
- };
464
- }
465
- function Ln(e, t) {
466
- const s = !!t && t.length > 0;
467
- return {
468
- ...e,
469
- serviceId: void 0,
470
- serviceIds: t,
471
- operatorId: s ? Re : void 0,
472
- operatorIds: void 0,
473
- date: void 0,
474
- slotKey: void 0,
475
- details: void 0
476
- };
477
- }
478
- function Bn(e, t) {
479
- return {
480
- ...e,
481
- operatorId: t,
482
- operatorIds: void 0,
483
- date: void 0,
484
- slotKey: void 0,
485
- details: void 0
486
- };
487
- }
488
- function Pn(e, t) {
489
- return {
490
- ...e,
491
- operatorId: void 0,
492
- operatorIds: t,
493
- date: void 0,
494
- slotKey: void 0,
495
- details: void 0
496
- };
497
- }
498
- function et(e) {
499
- return e.specialtyIds && e.specialtyIds.length > 0 ? e.specialtyIds : e.specialtyId ? [e.specialtyId] : [];
500
- }
501
- function Ue(e) {
502
- return e.serviceIds && e.serviceIds.length > 0 ? e.serviceIds : e.serviceId ? [e.serviceId] : [];
503
- }
504
- function dn(e) {
505
- return e.operatorIds && e.operatorIds.length > 0 ? e.operatorIds : e.operatorId ? [e.operatorId] : [];
506
- }
507
- function Qt(e, t) {
508
- return {
509
- ...e,
510
- date: t,
511
- slotKey: void 0
512
- // Keep details — date/slot changes shouldn't wipe the patient form
513
- // since the user has already filled some fields.
514
- };
515
- }
516
- function Vn(e, t) {
517
- return {
518
- ...e,
519
- slotKey: t
520
- };
521
- }
522
- function mr(e, t) {
523
- let s = e;
524
- if (t.lockedOperatorId && s.operatorId !== t.lockedOperatorId && (s = { ...s, operatorId: t.lockedOperatorId }), (t.useSpecialties === void 0 ? t.specialties.length > 0 : t.useSpecialties) && t.specialties.length === 1 && s.specialtyId === void 0 && s.specialtyIds === void 0 && (s = { ...s, specialtyId: t.specialties[0].id }), t.autoSelectSingleService) {
525
- const r = et(s), c = r.length > 0 ? t.services.filter(
526
- (a) => a.specialtyId && r.includes(a.specialtyId)
527
- ) : t.services;
528
- c.length === 1 && s.serviceId === void 0 && s.serviceIds === void 0 && (s = { ...s, serviceId: c[0].id }, s.operatorId === void 0 && s.operatorIds === void 0 && (s = { ...s, operatorId: Re }));
529
- }
530
- return s;
531
- }
532
- function $n(e) {
533
- if (e.operatorId && e.operatorId !== Re)
534
- return e.operatorId;
535
- }
536
- function pr(e) {
537
- if (!e) return !1;
538
- const t = e.trim();
539
- return /^\+?\d[\d\s\-()]{6,}$/.test(t);
540
- }
541
- function pn(e) {
542
- const t = e && e.length > 0 ? e : ["email"], s = new Set(t);
543
- return cn.filter((i) => s.has(i));
544
- }
545
- function qn(e, t) {
546
- return t ?? (e.length === 1 ? e : ["email"]);
547
- }
548
- function fr(e, t, s) {
549
- const i = pn(e), r = new Set(i);
550
- if (s)
551
- return cn.filter(
552
- (p) => s.includes(p) && r.has(p)
553
- );
554
- const c = [];
555
- r.has("email") && c.push("email");
556
- const a = pr(t), l = r.has("whatsapp");
557
- l && a && c.push("whatsapp"), !l && r.has("sms") && c.push("sms");
558
- const m = new Set(c);
559
- return cn.filter((p) => m.has(p));
560
- }
561
- const gr = /https?:\/\/(?:(?![.,;:!?'»›]https?:\/\/)[^\s<>"\u060C\u061B\u061F\u06D4\u2000-\u206F\u3000-\u303F\uFF00-\uFFEF])+/gi, hr = /* @__PURE__ */ new Set([
562
- ".",
563
- ",",
564
- ";",
565
- ":",
566
- "!",
567
- "?",
568
- "'",
569
- "»",
570
- "›"
571
- ]), vr = { ")": "(", "]": "[", "}": "{" }, Sn = (e, t) => e.split(t).length - 1;
572
- function br(e) {
573
- const t = {};
574
- for (const [i, r] of Object.entries(vr))
575
- t[i] = Sn(e, i) - Sn(e, r);
576
- let s = e.length;
577
- for (; s > 0; ) {
578
- const i = e[s - 1];
579
- if (hr.has(i))
580
- s -= 1;
581
- else if (i in t && t[i] > 0)
582
- t[i] -= 1, s -= 1;
583
- else
584
- break;
585
- }
586
- return e.slice(0, s);
587
- }
588
- const yr = /[\u0600-\u06FF\u3040-\u30FF\u3400-\u9FFF\uAC00-\uD7AF]/, kr = /[A-Za-z0-9]/;
589
- function Sr(e) {
590
- const t = e.search(yr);
591
- return t > 0 && kr.test(e[t - 1]) ? e.slice(0, t) : e;
592
- }
593
- function xr(e) {
594
- try {
595
- const { protocol: t, hostname: s } = new URL(e);
596
- return (t === "http:" || t === "https:") && s !== "";
597
- } catch {
598
- return !1;
599
- }
600
- }
601
- function Ir(e) {
602
- const t = [];
603
- let s = 0;
604
- const i = (r) => {
605
- if (r === "") return;
606
- const c = t[t.length - 1];
607
- (c == null ? void 0 : c.kind) === "text" ? c.text += r : t.push({ kind: "text", text: r });
608
- };
609
- for (const r of e.matchAll(gr)) {
610
- const c = r.index ?? 0, a = br(Sr(r[0]));
611
- xr(a) && (i(e.slice(s, c)), t.push({ kind: "link", text: a, href: a }), s = c + a.length);
612
- }
613
- return i(e.slice(s)), t;
614
- }
615
- const xn = 500, Nr = /^[A-Z0-9]{16}$/, wr = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, In = 300, rn = "ds:rounded-[var(--radius-sm)] ds:underline ds:text-[var(--foreground)] ds:focus-visible:outline-solid ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]", Kt = (e) => e && /^https?:\/\//i.test(e) ? e : void 0, Cr = (e, t) => ({
616
- street: (e == null ? void 0 : e.address.line1) ?? "",
617
- city: (e == null ? void 0 : e.address.city) ?? "",
618
- postcode: (e == null ? void 0 : e.address.postalCode) ?? "",
619
- province: (e == null ? void 0 : e.address.state) ?? "",
620
- // The practice's country only until the patient has an address at all.
621
- country: (e ? e.address.country : t).toLowerCase(),
622
- formatted: ""
623
- }), Tr = (e, t, s = null) => ({
624
- name: t,
625
- address: {
626
- line1: e.street,
627
- line2: s,
628
- city: e.city,
629
- state: e.province,
630
- postalCode: e.postcode,
631
- country: e.country.toUpperCase()
632
- }
633
- }), Ar = At("ds:flex ds:flex-col ds:border", {
634
- variants: {
635
- noticeStyle: {
636
- plain: "ds:gap-[var(--spacing-xs)] ds:rounded-[var(--radius-md)] ds:border-[var(--border)] ds:bg-[var(--muted)] ds:p-[var(--spacing-sm)]",
637
- highlighted: "ds:gap-[var(--spacing-sm)] ds:rounded-[var(--radius-lg)] ds:border-[color-mix(in_srgb,var(--primary)_30%,var(--border))] ds:bg-[color-mix(in_srgb,var(--primary)_8%,var(--card))] ds:p-[var(--spacing-md)]"
638
- }
639
- },
640
- defaultVariants: { noticeStyle: "highlighted" }
641
- }), Dr = ["it", "ch", "de", "at", "fr", "sm"], G = {
642
- country: "billing.country",
643
- street: "billing.street",
644
- city: "billing.city",
645
- postcode: "billing.postcode",
646
- province: "billing.province"
647
- }, zn = /^\d{5}$/, Mr = (e) => {
648
- if (!e) return !1;
649
- const { line1: t, city: s, postalCode: i, country: r, state: c } = e.address;
650
- return !t.trim() || !s.trim() || !i.trim() || !r.trim() ? !1 : r.toUpperCase() !== "IT" ? !0 : !!c.trim() && zn.test(i.trim());
651
- }, Or = (e, t) => {
652
- var s;
653
- return {
654
- name: t,
655
- address: {
656
- line1: e.address.line1.trim(),
657
- line2: ((s = e.address.line2) == null ? void 0 : s.trim()) || null,
658
- city: e.address.city.trim(),
659
- state: e.address.state.trim(),
660
- postalCode: e.address.postalCode.trim(),
661
- country: e.address.country.trim().toUpperCase()
662
- }
663
- };
664
- }, jt = { state: "idle" }, Nn = [
665
- "firstName",
666
- "lastName",
667
- "email",
668
- "mobilePhone",
669
- "codiceFiscale",
670
- "dateOfBirth",
671
- "insuranceNumber",
672
- G.country,
673
- G.street,
674
- G.city,
675
- G.postcode,
676
- G.province
677
- ], Er = /* @__PURE__ */ new Set(), fn = Cn(
678
- ({
679
- value: e,
680
- onChange: t,
681
- onSubmit: s,
682
- hideEmail: i = !1,
683
- emailOptional: r = !1,
684
- requireCodiceFiscale: c = !1,
685
- requireDateOfBirth: a = !1,
686
- requireInsuranceNumber: l = !1,
687
- insuranceType: m,
688
- showNote: p = !1,
689
- showReturningPatientFlag: f = !1,
690
- privacyPolicyUrl: v,
691
- termsUrl: h,
692
- practiceConsent: d,
693
- payment: g,
694
- paymentTermsUrl: I,
695
- paymentBlocked: u = !1,
696
- billingInDetails: F = !1,
697
- paymentNoticeStyle: N = "highlighted",
698
- criticalInformationToAccept: w,
699
- validateCodiceFiscale: x,
700
- validateInsuranceNumber: O,
701
- submitting: R = !1,
702
- locked: _ = !1,
703
- summarySlot: b,
704
- defaultPhoneCountry: C,
705
- confirmationChannels: P,
706
- defaultConfirmationChannels: A,
707
- singleConfirmationChannel: L = !1,
708
- submitError: B
709
- }, D) => {
710
- var xt, It, Nt, wt, Ct;
711
- const { t: k, i18n: Y } = Z("ui"), X = at(), _e = M(null), Le = ke(
712
- (o) => {
713
- _e.current = o, typeof D == "function" ? D(o) : D && (D.current = o);
714
- },
715
- [D]
716
- ), [E, J] = H(0);
717
- q(() => {
718
- var y;
719
- if (E === 0) return;
720
- const o = (y = _e.current) == null ? void 0 : y.querySelectorAll(
721
- '[aria-invalid="true"], [role="checkbox"][aria-required="true"][aria-checked="false"], [data-unanswered] [role="checkbox"]'
722
- );
723
- for (const T of o ?? [])
724
- if (T.focus(), document.activeElement === T) return;
725
- }, [E]);
726
- const W = M(!1), [Q, Be] = H(!1), [tt, ge] = H(!1), te = R || Q, [me, Se] = H(jt), [xe, Te] = H(jt), [ce, Pe] = H({}), ee = ke(
727
- (o) => Pe((y) => ({ ...y, [o]: !0 })),
728
- []
729
- ), [le, Dt] = H(Er), Ve = M(null), nt = M(
730
- null
731
- );
732
- q(
733
- () => () => {
734
- Ve.current && clearTimeout(Ve.current), nt.current && clearTimeout(nt.current);
735
- },
736
- []
737
- );
738
- const z = ke(
739
- (o) => {
740
- ge(!1), t({ ...e, ...o });
741
- },
742
- [e, t]
743
- ), Ae = g ? JSON.stringify([
744
- g.serviceId,
745
- g.kind,
746
- g.amountCents,
747
- g.currencyCode,
748
- I
749
- ]) : void 0, [tn, He] = H(
750
- () => e.paymentAccepted ? Ae : void 0
751
- ), Mt = M(Ae), ct = !!(g && e.paymentAccepted && tn === Ae);
752
- q(() => {
753
- Mt.current !== Ae && (Mt.current = Ae, He(void 0), e.paymentAccepted !== void 0 && z({ paymentAccepted: g ? !1 : void 0 }));
754
- }, [Ae, g, z, e.paymentAccepted]);
755
- const Ge = typeof (d == null ? void 0 : d.label) == "string" && d.label.trim() !== "", De = d && Ge ? JSON.stringify([
756
- d.label,
757
- d.url ?? null,
758
- d.required
759
- ]) : void 0, [nn, ae] = H(
760
- () => e.practiceConsentAccepted ? De : void 0
761
- ), Ot = M(De), ue = !!(De !== void 0 && e.practiceConsentAccepted && nn === De);
762
- q(() => {
763
- Ot.current !== De && (Ot.current = De, ae(void 0), e.practiceConsentAccepted !== void 0 && z({ practiceConsentAccepted: void 0 }));
764
- }, [De, z, e.practiceConsentAccepted]);
765
- const $e = g ? Zt(g.amountCents, g.currencyCode, Y.language) : "", Me = Kt(I), he = F && !!g && !u, V = c, dt = (C || "it").toLowerCase(), st = !he || Mr(e.billing), rt = Cr(e.billing, dt), de = rt.country === "it", Oe = M(null), Je = M(
766
- null
767
- ), We = (xt = e.billing) == null ? void 0 : xt.address.line1.trim(), pe = ((Nt = (It = e.billing) == null ? void 0 : It.address.line2) == null ? void 0 : Nt.trim()) || null;
768
- q(() => {
769
- var o;
770
- We !== void 0 && pe ? Je.current = { street: We, line2: pe } : (We === void 0 || We === ((o = Je.current) == null ? void 0 : o.street)) && (Je.current = null);
771
- }, [We, pe]);
772
- const qe = (o) => (
773
- // Nothing for a block not shown, nor for a province outside Italy.
774
- !he || !ce[G[o]] || o === "province" && !de ? void 0 : rt[o].trim() ? (
775
- // The one format the block itself checks: an Italian CAP.
776
- o === "postcode" && de && !zn.test(rt.postcode.trim()) ? k("inputs.postalCode.invalid") : void 0
777
- ) : k("booking.details.fieldRequired")
778
- ), Et = ke(
779
- () => Pe(
780
- (o) => o[G.province] ? o : {
781
- ...o,
782
- codiceFiscale: !0,
783
- ...Object.fromEntries(
784
- Object.values(G).map((y) => [y, !0])
785
- )
786
- }
787
- ),
788
- []
789
- ), Ee = $(
790
- () => pn(P),
791
- [P]
792
- ), ze = !g && !u && Ee.length >= 2, Ye = M(!1);
793
- q(() => {
794
- if (g || u) return;
795
- if (!ze) {
796
- e.confirmationChannels !== void 0 && z({ confirmationChannels: void 0 });
797
- return;
798
- }
799
- if (e.confirmationChannels !== void 0) {
800
- Ye.current = !0, L && e.confirmationChannels.length > 1 && z({
801
- confirmationChannels: e.confirmationChannels.slice(0, 1)
802
- });
803
- return;
804
- }
805
- const o = L ? [
806
- (A == null ? void 0 : A.find(
807
- (y) => Ee.includes(y)
808
- )) ?? Ee[0]
809
- ] : fr(
810
- Ee,
811
- e.mobilePhone,
812
- A
813
- );
814
- Ye.current = !0, z({ confirmationChannels: o });
815
- }, [
816
- ze,
817
- g,
818
- u,
819
- Ee,
820
- e.mobilePhone,
821
- A,
822
- L
823
- ]);
824
- const Ie = $(
825
- () => e.confirmationChannels ?? [],
826
- [e.confirmationChannels]
827
- ), K = ze && Ie.length === 0, j = qn(
828
- Ee,
829
- ze ? Ie : void 0
830
- ), lt = !r || j.includes("email"), it = M(x), ut = M(O);
831
- q(() => {
832
- it.current = x, ut.current = O;
833
- }, [x, O]);
834
- const Ft = !!x, Rt = !!O;
835
- q(() => {
836
- const o = e.codiceFiscale;
837
- if (!V || !Ft || !o) {
838
- Se(jt);
839
- return;
840
- }
841
- if (!Nr.test(o)) {
842
- Se({
843
- state: "invalid",
844
- hint: k("booking.details.codiceFiscale.invalidFormat")
845
- });
846
- return;
847
- }
848
- Se({ state: "pending" });
849
- let y = !0;
850
- return Ve.current && clearTimeout(Ve.current), Ve.current = setTimeout(async () => {
851
- try {
852
- const T = it.current;
853
- if (!T) return;
854
- const U = await T(o);
855
- y && Se({
856
- state: U.valid ? "valid" : "invalid",
857
- hint: U.hint,
858
- value: o
859
- });
860
- } catch {
861
- y && Se({
862
- state: "invalid",
863
- hint: k("booking.details.codiceFiscale.unavailable"),
864
- value: o
865
- });
866
- }
867
- }, In), () => {
868
- y = !1, Ve.current && clearTimeout(Ve.current);
869
- };
870
- }, [V, Ft, e.codiceFiscale, k]);
871
- const Ze = l && m === "public";
872
- q(() => {
873
- const o = e.insuranceNumber;
874
- if (!Ze || !Rt || !o) {
875
- Te(jt);
876
- return;
877
- }
878
- Te({ state: "pending" }), nt.current && clearTimeout(nt.current), nt.current = setTimeout(() => {
879
- const y = ut.current;
880
- y && y(o).then(
881
- (T) => Te(
882
- T.valid ? { state: "valid" } : { state: "invalid", hint: T.hint }
883
- )
884
- ).catch(
885
- () => Te({
886
- state: "invalid",
887
- hint: k("booking.details.insuranceNumber.unavailable")
888
- })
889
- );
890
- }, In);
891
- }, [Ze, Rt, e.insuranceNumber, k]);
892
- const mt = $(() => {
893
- var y;
894
- if (i) return !0;
895
- const o = r ? (y = e.email) == null ? void 0 : y.trim() : e.email;
896
- return !lt && !o ? !0 : !!(o && wr.test(o));
897
- }, [i, r, lt, e.email]), pt = $(
898
- () => !!(e.mobilePhone && e.mobilePhone.length >= 6),
899
- [e.mobilePhone]
900
- ), _t = $(() => {
901
- var o, y;
902
- return !(!((o = e.firstName) != null && o.trim()) || !((y = e.lastName) != null && y.trim()) || !mt || !pt || V && (me.state !== "valid" || me.value !== e.codiceFiscale) || !st || a && !e.dateOfBirth || Ze && xe.state !== "valid");
903
- }, [
904
- e.firstName,
905
- e.lastName,
906
- mt,
907
- pt,
908
- V,
909
- st,
910
- me.state,
911
- me.value,
912
- e.codiceFiscale,
913
- a,
914
- e.dateOfBirth,
915
- Ze,
916
- xe.state
917
- ]), ft = w != null && w.trim() ? w : void 0, Fe = ft !== void 0, Lt = !Fe || !!e.criticalInformationAccepted, gt = !Ge || !(d != null && d.required) || ue, Xe = !!(e.privacyConsent && e.termsConsent && Lt && gt), Bt = !ze || Ie.length > 0, ht = _t && Xe && Bt && (!g || ct) && !u && !te, ve = !ht && !te && !u, Pt = `${X}-submit-hint`, ne = {
918
- firstName: ce.firstName && !((wt = e.firstName) != null && wt.trim()) ? k("booking.details.firstName.required") : void 0,
919
- lastName: ce.lastName && !((Ct = e.lastName) != null && Ct.trim()) ? k("booking.details.lastName.required") : void 0,
920
- email: !i && ce.email && !mt ? k("booking.details.email.invalid") : void 0,
921
- mobilePhone: ce.mobilePhone && !pt ? k("booking.details.mobilePhone.invalid") : void 0,
922
- codiceFiscale: ce.codiceFiscale && me.state === "invalid" ? me.hint ?? k("booking.details.codiceFiscale.invalid") : ce.codiceFiscale && !e.codiceFiscale ? k("booking.details.fieldRequired") : void 0,
923
- dateOfBirth: ce.dateOfBirth && !e.dateOfBirth ? k("booking.details.dateOfBirth.required") : void 0,
924
- insuranceNumber: ce.insuranceNumber && xe.state === "invalid" ? xe.hint ?? k("booking.details.insuranceNumber.invalid") : void 0,
925
- [G.country]: qe("country"),
926
- [G.street]: qe("street"),
927
- [G.city]: qe("city"),
928
- [G.postcode]: qe("postcode"),
929
- [G.province]: qe("province")
930
- }, vt = Nn.filter(
931
- (o) => le.has(o) && ne[o] !== void 0
932
- );
933
- vt.length !== le.size && Dt(new Set(vt));
934
- const se = (o) => !le.has(o), be = async (o) => {
935
- var T;
936
- if (o.preventDefault(), !te && !W.current && !ht && Dt(
937
- new Set(
938
- Nn.filter(
939
- (U) => le.has(U) || !ne[U]
940
- )
941
- )
942
- ), Pe({
943
- firstName: !0,
944
- lastName: !0,
945
- email: !i,
946
- mobilePhone: !0,
947
- codiceFiscale: !0,
948
- dateOfBirth: !0,
949
- insuranceNumber: !0,
950
- ...Object.fromEntries(
951
- Object.values(G).map((U) => [U, !0])
952
- )
953
- }), te || W.current) return;
954
- if (!ht) {
955
- J((U) => U + 1);
956
- return;
957
- }
958
- const y = {
959
- firstName: e.firstName.trim(),
960
- lastName: e.lastName.trim(),
961
- ...!i && ((T = e.email) != null && T.trim()) ? { email: e.email.trim() } : {},
962
- mobilePhone: e.mobilePhone,
963
- privacyConsent: !0,
964
- termsConsent: !0,
965
- // Only present when the service carried text to accept — a
966
- // reason without it leaves the key out of the payload entirely.
967
- ...Fe ? { criticalInformationAccepted: !0 } : {},
968
- // Sent whenever the practice's box is shown, ticked or not, so the
969
- // server can record the answer; left out when there is no box.
970
- ...Ge ? { practiceConsentAccepted: ue } : {},
971
- ...g ? { paymentAccepted: !0 } : {},
972
- codiceFiscale: e.codiceFiscale,
973
- dateOfBirth: e.dateOfBirth,
974
- insuranceNumber: e.insuranceNumber,
975
- note: e.note,
976
- returningPatient: e.returningPatient,
977
- // Only include when the picker was visible; otherwise the single
978
- // implicit channel is inferred backend-side from the practice
979
- // config.
980
- confirmationChannels: ze ? Ie : void 0,
981
- ...he && e.billing ? {
982
- billing: Or(
983
- e.billing,
984
- `${e.firstName.trim()} ${e.lastName.trim()}`
985
- )
986
- } : {}
987
- };
988
- W.current = !0, Be(!0), ge(!1);
989
- try {
990
- await s(y);
991
- } catch {
992
- ge(!0);
993
- } finally {
994
- W.current = !1, Be(!1);
995
- }
996
- }, Qe = /* @__PURE__ */ n(
997
- Ke,
998
- {
999
- label: k("booking.details.codiceFiscale.label"),
1000
- required: !0,
1001
- description: me.state === "pending" ? k("booking.details.codiceFiscale.checking") : k("booking.details.codiceFiscale.helper"),
1002
- error: ne.codiceFiscale,
1003
- announceError: se("codiceFiscale"),
1004
- children: /* @__PURE__ */ n(
1005
- qt,
1006
- {
1007
- value: e.codiceFiscale ?? "",
1008
- maxLength: 16,
1009
- onChange: (o) => z({
1010
- codiceFiscale: o.target.value.slice(0, 16).toUpperCase()
1011
- }),
1012
- onBlur: () => ee("codiceFiscale")
1013
- }
1014
- )
1015
- }
1016
- ), Vt = (o, y) => {
1017
- const T = Kt(y);
1018
- return T ? /* @__PURE__ */ n(
1019
- Tn,
1020
- {
1021
- ns: "ui",
1022
- i18nKey: o,
1023
- components: {
1024
- // The `<Trans>` runtime injects link text from the i18n
1025
- // string. The anchor renders empty at static-analysis time,
1026
- // so `jsx-a11y/anchor-has-content` would false-flag — silence
1027
- // it; the runtime content is the localised policy / terms
1028
- // label.
1029
- policyLink: (
1030
- // eslint-disable-next-line jsx-a11y/anchor-has-content
1031
- /* @__PURE__ */ n(
1032
- "a",
1033
- {
1034
- href: T,
1035
- target: "_blank",
1036
- rel: "noopener noreferrer",
1037
- className: rn
1038
- }
1039
- )
1040
- )
1041
- }
1042
- }
1043
- ) : k(o);
1044
- };
1045
- return /* @__PURE__ */ S(
1046
- "form",
1047
- {
1048
- ref: Le,
1049
- id: X,
1050
- noValidate: !0,
1051
- onSubmit: be,
1052
- onFocus: (o) => {
1053
- const y = Oe.current;
1054
- !y || !o.currentTarget.contains(o.target) || !y.contains(o.target) && y.compareDocumentPosition(o.target) & Node.DOCUMENT_POSITION_FOLLOWING && Et();
1055
- },
1056
- "aria-busy": te || void 0,
1057
- className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
1058
- children: [
1059
- b,
1060
- /* @__PURE__ */ S("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-sm)] ds:sm:grid-cols-2", children: [
1061
- /* @__PURE__ */ n(
1062
- Ke,
1063
- {
1064
- label: k("booking.details.firstName.label"),
1065
- required: !0,
1066
- error: ne.firstName,
1067
- announceError: se("firstName"),
1068
- children: /* @__PURE__ */ n(
1069
- qt,
1070
- {
1071
- autoComplete: "given-name",
1072
- value: e.firstName ?? "",
1073
- onChange: (o) => z({ firstName: o.target.value }),
1074
- onBlur: () => ee("firstName")
1075
- }
1076
- )
1077
- }
1078
- ),
1079
- /* @__PURE__ */ n(
1080
- Ke,
1081
- {
1082
- label: k("booking.details.lastName.label"),
1083
- required: !0,
1084
- error: ne.lastName,
1085
- announceError: se("lastName"),
1086
- children: /* @__PURE__ */ n(
1087
- qt,
1088
- {
1089
- autoComplete: "family-name",
1090
- value: e.lastName ?? "",
1091
- onChange: (o) => z({ lastName: o.target.value }),
1092
- onBlur: () => ee("lastName")
1093
- }
1094
- )
1095
- }
1096
- )
1097
- ] }),
1098
- /* @__PURE__ */ S(
1099
- "div",
1100
- {
1101
- className: `ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-sm)]${i ? "" : " ds:sm:grid-cols-2"}`,
1102
- children: [
1103
- !i && /* @__PURE__ */ n(
1104
- Ke,
1105
- {
1106
- label: k("booking.details.email.label"),
1107
- ...lt ? { required: !0 } : { optional: !0 },
1108
- error: ne.email,
1109
- announceError: se("email"),
1110
- children: /* @__PURE__ */ n(
1111
- ds,
1112
- {
1113
- disableBuiltInValidation: r,
1114
- value: e.email ?? "",
1115
- onChange: (o) => z({ email: o.target.value }),
1116
- onBlur: () => ee("email")
1117
- }
1118
- )
1119
- }
1120
- ),
1121
- /* @__PURE__ */ n(
1122
- Ke,
1123
- {
1124
- label: k("booking.details.mobilePhone.label"),
1125
- required: !0,
1126
- error: ne.mobilePhone,
1127
- announceError: se("mobilePhone"),
1128
- children: /* @__PURE__ */ n(
1129
- ls,
1130
- {
1131
- value: e.mobilePhone ?? "",
1132
- defaultCountry: C == null ? void 0 : C.toUpperCase(),
1133
- onChange: (o) => {
1134
- z({ mobilePhone: o }), ee("mobilePhone");
1135
- }
1136
- }
1137
- )
1138
- }
1139
- )
1140
- ]
1141
- }
1142
- ),
1143
- V && !he || a ? /* @__PURE__ */ S("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-sm)] ds:sm:grid-cols-2", children: [
1144
- V && !he ? Qe : null,
1145
- a ? /* @__PURE__ */ n(
1146
- Ke,
1147
- {
1148
- label: k("booking.details.dateOfBirth.label"),
1149
- required: !0,
1150
- error: ne.dateOfBirth,
1151
- announceError: se("dateOfBirth"),
1152
- children: /* @__PURE__ */ n(
1153
- cs,
1154
- {
1155
- value: e.dateOfBirth ? new Date(e.dateOfBirth) : void 0,
1156
- onChange: (o) => {
1157
- z({
1158
- dateOfBirth: o ? o.toISOString().slice(0, 10) : void 0
1159
- }), ee("dateOfBirth");
1160
- }
1161
- }
1162
- )
1163
- }
1164
- ) : null
1165
- ] }) : null,
1166
- Ze ? /* @__PURE__ */ n(
1167
- Ke,
1168
- {
1169
- label: k("booking.details.insuranceNumber.label"),
1170
- required: !0,
1171
- description: xe.state === "pending" ? k("booking.details.insuranceNumber.checking") : void 0,
1172
- error: ne.insuranceNumber,
1173
- announceError: se("insuranceNumber"),
1174
- children: /* @__PURE__ */ n(
1175
- qt,
1176
- {
1177
- value: e.insuranceNumber ?? "",
1178
- onChange: (o) => z({ insuranceNumber: o.target.value }),
1179
- onBlur: () => ee("insuranceNumber")
1180
- }
1181
- )
1182
- }
1183
- ) : null,
1184
- he ? /* @__PURE__ */ S(
1185
- "div",
1186
- {
1187
- ref: Oe,
1188
- "data-component": "booking-billing",
1189
- role: "group",
1190
- "aria-labelledby": `${X}-billing-heading`,
1191
- "aria-describedby": `${X}-billing-intro`,
1192
- className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:rounded-[var(--radius-md)] ds:border ds:border-[var(--border)] ds:p-[var(--spacing-sm)]",
1193
- onBlur: (o) => {
1194
- var T;
1195
- const y = (T = o.target.closest("[data-address-field]")) == null ? void 0 : T.getAttribute("data-address-field");
1196
- (y === "street" || y === "city" || y === "postcode") && ee(G[y]);
1197
- },
1198
- children: [
1199
- /* @__PURE__ */ S("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]", children: [
1200
- /* @__PURE__ */ n(
1201
- "h3",
1202
- {
1203
- id: `${X}-billing-heading`,
1204
- className: "type-label ds:m-0 ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)]",
1205
- children: k("booking.details.billing.heading")
1206
- }
1207
- ),
1208
- /* @__PURE__ */ n(
1209
- "p",
1210
- {
1211
- id: `${X}-billing-intro`,
1212
- className: "type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]",
1213
- children: k("booking.details.billing.intro")
1214
- }
1215
- )
1216
- ] }),
1217
- V ? Qe : null,
1218
- /* @__PURE__ */ n(
1219
- ms,
1220
- {
1221
- value: rt,
1222
- onChange: (o) => {
1223
- var y;
1224
- return (
1225
- // The name is set from the patient's own on submit.
1226
- z({
1227
- billing: Tr(
1228
- o,
1229
- "",
1230
- // A second line belongs to its street: it goes when the
1231
- // patient writes another, and returns with the first.
1232
- o.street.trim() === ((y = Je.current) == null ? void 0 : y.street) ? Je.current.line2 : null
1233
- )
1234
- })
1235
- );
1236
- },
1237
- popularCountries: Dr,
1238
- layout: "grid",
1239
- fields: de ? void 0 : ["street", "city", "postcode"],
1240
- required: de ? ["country", "street", "city", "postcode", "province"] : ["country", "street", "city", "postcode"],
1241
- errors: {
1242
- country: ne[G.country],
1243
- street: ne[G.street],
1244
- city: ne[G.city],
1245
- postcode: ne[G.postcode],
1246
- province: ne[G.province]
1247
- },
1248
- announceErrors: {
1249
- country: se(G.country),
1250
- street: se(G.street),
1251
- city: se(G.city),
1252
- postcode: se(G.postcode),
1253
- province: se(G.province)
1254
- }
1255
- }
1256
- )
1257
- ]
1258
- }
1259
- ) : null,
1260
- p ? /* @__PURE__ */ n(
1261
- Ke,
1262
- {
1263
- label: k("booking.details.note.label"),
1264
- optional: !0,
1265
- description: k("booking.details.note.helper", {
1266
- max: xn
1267
- }),
1268
- children: /* @__PURE__ */ n(
1269
- us,
1270
- {
1271
- value: e.note ?? "",
1272
- maxLength: xn,
1273
- rows: 3,
1274
- onChange: (o) => z({ note: o.target.value })
1275
- }
1276
- )
1277
- }
1278
- ) : null,
1279
- f ? /* @__PURE__ */ n(
1280
- bt,
1281
- {
1282
- checked: !!e.returningPatient,
1283
- onCheckedChange: (o) => z({ returningPatient: o === !0 }),
1284
- label: k("booking.details.returningPatient.label")
1285
- }
1286
- ) : null,
1287
- ft !== void 0 ? /* @__PURE__ */ S(
1288
- "div",
1289
- {
1290
- "data-component": "booking-critical-information",
1291
- role: "group",
1292
- "aria-labelledby": `${X}-critical-information-heading`,
1293
- className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)] ds:rounded-[var(--radius-md)] ds:border ds:border-[var(--border)] ds:bg-[var(--muted)] ds:p-[var(--spacing-sm)]",
1294
- children: [
1295
- /* @__PURE__ */ n(
1296
- "h3",
1297
- {
1298
- id: `${X}-critical-information-heading`,
1299
- className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0",
1300
- children: k("booking.details.criticalInformation.heading")
1301
- }
1302
- ),
1303
- /* @__PURE__ */ n(
1304
- "p",
1305
- {
1306
- dir: "auto",
1307
- className: "type-body-sm ds:m-0 ds:whitespace-pre-wrap ds:break-words ds:text-[var(--foreground)]",
1308
- children: Ir(ft).map(
1309
- (o, y) => o.kind === "link" ? /* @__PURE__ */ n(
1310
- "a",
1311
- {
1312
- href: o.href,
1313
- target: "_blank",
1314
- rel: "noopener noreferrer",
1315
- dir: "ltr",
1316
- className: rn,
1317
- children: o.text
1318
- },
1319
- y
1320
- ) : /* @__PURE__ */ n(ns, { children: o.text }, y)
1321
- )
1322
- }
1323
- ),
1324
- /* @__PURE__ */ n(
1325
- bt,
1326
- {
1327
- checked: !!e.criticalInformationAccepted,
1328
- onCheckedChange: (o) => z({ criticalInformationAccepted: o === !0 }),
1329
- "aria-required": !0,
1330
- label: /* @__PURE__ */ S(ie, { children: [
1331
- k("booking.details.criticalInformation.accept"),
1332
- /* @__PURE__ */ n(
1333
- "span",
1334
- {
1335
- "aria-hidden": "true",
1336
- className: "ds:text-[var(--destructive)] ds:ms-[var(--spacing-2xs)]",
1337
- children: "*"
1338
- }
1339
- )
1340
- ] })
1341
- }
1342
- )
1343
- ]
1344
- }
1345
- ) : null,
1346
- g ? /* @__PURE__ */ S(
1347
- "div",
1348
- {
1349
- "data-component": "booking-payment-notice",
1350
- role: "group",
1351
- "aria-labelledby": `${X}-payment-heading`,
1352
- "data-notice-style": N,
1353
- className: Ar({
1354
- noticeStyle: N
1355
- }),
1356
- children: [
1357
- N === "highlighted" ? /* @__PURE__ */ S("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
1358
- /* @__PURE__ */ n("span", { className: "ds:flex ds:size-9 ds:shrink-0 ds:items-center ds:justify-center ds:rounded-full ds:bg-[var(--primary)] ds:text-[var(--primary-foreground)]", children: /* @__PURE__ */ n(ps, { "aria-hidden": "true", className: "ds:size-5" }) }),
1359
- /* @__PURE__ */ n(
1360
- "h3",
1361
- {
1362
- id: `${X}-payment-heading`,
1363
- className: "type-title-item ds:m-0 ds:flex-1",
1364
- children: k("booking.payment.noticeTitle")
1365
- }
1366
- ),
1367
- /* @__PURE__ */ n(
1368
- "span",
1369
- {
1370
- "aria-hidden": "true",
1371
- className: "type-title-card ds:shrink-0 ds:text-[var(--foreground)]",
1372
- children: $e
1373
- }
1374
- )
1375
- ] }) : /* @__PURE__ */ n(
1376
- "h3",
1377
- {
1378
- id: `${X}-payment-heading`,
1379
- className: "type-label ds:m-0",
1380
- children: k("booking.payment.noticeTitle")
1381
- }
1382
- ),
1383
- /* @__PURE__ */ n("p", { className: "type-body-sm ds:m-0", children: k("booking.payment.noticeBody", { amount: $e }) }),
1384
- Me ? /* @__PURE__ */ n(
1385
- "a",
1386
- {
1387
- href: Me,
1388
- target: "_blank",
1389
- rel: "noopener noreferrer",
1390
- className: "type-body-sm ds:inline-flex ds:items-center ds:self-start ds:min-h-[var(--min-target-size)] ds:rounded-[var(--radius-sm)] ds:underline ds:text-[var(--foreground)] ds:focus-visible:outline-solid ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
1391
- children: k("booking.payment.terms")
1392
- }
1393
- ) : null,
1394
- /* @__PURE__ */ n(
1395
- bt,
1396
- {
1397
- checked: ct,
1398
- onCheckedChange: (o) => {
1399
- He(
1400
- o === !0 ? Ae : void 0
1401
- ), z({ paymentAccepted: o === !0 });
1402
- },
1403
- "aria-required": !0,
1404
- label: /* @__PURE__ */ S(ie, { children: [
1405
- k("booking.payment.accept", { amount: $e }),
1406
- /* @__PURE__ */ n(
1407
- "span",
1408
- {
1409
- "aria-hidden": "true",
1410
- className: "ds:text-[var(--destructive)] ds:ms-[var(--spacing-2xs)]",
1411
- children: "*"
1412
- }
1413
- )
1414
- ] })
1415
- }
1416
- )
1417
- ]
1418
- }
1419
- ) : null,
1420
- /* @__PURE__ */ S("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
1421
- /* @__PURE__ */ n(
1422
- bt,
1423
- {
1424
- checked: !!e.privacyConsent,
1425
- onCheckedChange: (o) => z({ privacyConsent: o === !0 }),
1426
- "aria-required": !0,
1427
- label: /* @__PURE__ */ S(ie, { children: [
1428
- Vt(
1429
- "booking.details.consent.privacy.label",
1430
- v
1431
- ),
1432
- /* @__PURE__ */ n(
1433
- "span",
1434
- {
1435
- "aria-hidden": "true",
1436
- className: "ds:text-[var(--destructive)] ds:ms-[var(--spacing-2xs)]",
1437
- children: "*"
1438
- }
1439
- )
1440
- ] })
1441
- }
1442
- ),
1443
- /* @__PURE__ */ n(
1444
- bt,
1445
- {
1446
- checked: !!e.termsConsent,
1447
- onCheckedChange: (o) => z({ termsConsent: o === !0 }),
1448
- "aria-required": !0,
1449
- label: /* @__PURE__ */ S(ie, { children: [
1450
- Vt(
1451
- "booking.details.consent.terms.label",
1452
- h
1453
- ),
1454
- /* @__PURE__ */ n(
1455
- "span",
1456
- {
1457
- "aria-hidden": "true",
1458
- className: "ds:text-[var(--destructive)] ds:ms-[var(--spacing-2xs)]",
1459
- children: "*"
1460
- }
1461
- )
1462
- ] })
1463
- }
1464
- ),
1465
- d && Ge ? /* @__PURE__ */ n(
1466
- bt,
1467
- {
1468
- checked: ue,
1469
- onCheckedChange: (o) => {
1470
- ae(
1471
- o === !0 ? De : void 0
1472
- ), z({ practiceConsentAccepted: o === !0 });
1473
- },
1474
- "aria-required": d.required || void 0,
1475
- label: /* @__PURE__ */ S(ie, { children: [
1476
- Kt(d.url) ? /* @__PURE__ */ n(
1477
- "a",
1478
- {
1479
- dir: "auto",
1480
- href: Kt(d.url),
1481
- target: "_blank",
1482
- rel: "noopener noreferrer",
1483
- className: rn,
1484
- children: d.label
1485
- }
1486
- ) : /* @__PURE__ */ n("span", { dir: "auto", children: d.label }),
1487
- d.required ? /* @__PURE__ */ n(
1488
- "span",
1489
- {
1490
- "aria-hidden": "true",
1491
- className: "ds:text-[var(--destructive)] ds:ms-[var(--spacing-2xs)]",
1492
- children: "*"
1493
- }
1494
- ) : null
1495
- ] })
1496
- }
1497
- ) : null
1498
- ] }),
1499
- ze ? /* @__PURE__ */ n(
1500
- "div",
1501
- {
1502
- "data-component": "booking-confirmation-channels",
1503
- "data-unanswered": K || void 0,
1504
- className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]",
1505
- children: L ? /* @__PURE__ */ n(
1506
- as,
1507
- {
1508
- variant: "horizontal",
1509
- label: k("booking.confirmation.heading"),
1510
- value: Ie[0] ?? "",
1511
- onValueChange: (o) => z({
1512
- confirmationChannels: [o]
1513
- }),
1514
- error: K ? k("booking.confirmation.atLeastOne") : void 0,
1515
- children: Ee.map((o) => /* @__PURE__ */ n(
1516
- os,
1517
- {
1518
- value: o,
1519
- label: k(`booking.confirmation.channel.${o}`)
1520
- },
1521
- o
1522
- ))
1523
- }
1524
- ) : /* @__PURE__ */ n(
1525
- is,
1526
- {
1527
- label: k("booking.confirmation.heading"),
1528
- helperText: k("booking.confirmation.helper"),
1529
- value: Ie,
1530
- onChange: (o) => z({
1531
- confirmationChannels: o
1532
- }),
1533
- orientation: "vertical",
1534
- options: Ee.map((o) => ({
1535
- value: o,
1536
- label: k(`booking.confirmation.channel.${o}`)
1537
- })),
1538
- error: K ? k("booking.confirmation.atLeastOne") : void 0
1539
- }
1540
- )
1541
- }
1542
- ) : null,
1543
- !_ && (B || tt || u) ? /* @__PURE__ */ n(oe, { variant: "error", children: /* @__PURE__ */ n(oe.Description, { children: B ?? k(
1544
- u ? "booking.payment.unavailable" : "booking.payment.submitFailed"
1545
- ) }) }) : null,
1546
- _ ? null : /* @__PURE__ */ S("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
1547
- ve ? /* @__PURE__ */ n(
1548
- "p",
1549
- {
1550
- id: Pt,
1551
- "data-slot": "submit-hint",
1552
- className: "type-body-sm ds:m-0 ds:text-[var(--muted-foreground)]",
1553
- children: k("booking.details.submitHint")
1554
- }
1555
- ) : null,
1556
- /* @__PURE__ */ n(
1557
- we,
1558
- {
1559
- intent: "primary",
1560
- size: "md",
1561
- type: "submit",
1562
- disabled: te || u,
1563
- "aria-disabled": !ht || void 0,
1564
- "aria-describedby": ve ? Pt : void 0,
1565
- startIcon: te ? /* @__PURE__ */ n(An, { variant: "pulse", size: "sm" }) : void 0,
1566
- children: g ? k("booking.payment.submit", { amount: $e }) : k("booking.details.submit")
1567
- }
1568
- )
1569
- ] })
1570
- ]
1571
- }
1572
- );
1573
- }
1574
- );
1575
- fn.displayName = "BookingDetailsForm";
1576
- const Wt = [
1577
- "ds:focus-visible:outline-[length:var(--focus-ring-width)]",
1578
- "ds:focus-visible:outline-solid",
1579
- "ds:focus-visible:outline-[var(--ring)]",
1580
- "ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
1581
- "ds:forced-colors:focus-visible:outline-[CanvasText]"
1582
- ].join(" ");
1583
- function ln(e) {
1584
- if (typeof window > "u") return !1;
1585
- if (typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches)
1586
- return !0;
1587
- if (!e) return !1;
1588
- if (e.closest(".theme-accessible")) return !0;
1589
- const t = getComputedStyle(e).getPropertyValue(
1590
- "--animation-duration"
1591
- );
1592
- return t.trim() !== "" && parseFloat(t) === 0;
1593
- }
1594
- function Kn(e, t) {
1595
- if (!e || typeof e.scrollIntoView != "function") return !1;
1596
- const s = getComputedStyle(e), i = getComputedStyle(document.documentElement), r = (parseFloat(s.scrollMarginTop) || 0) + (parseFloat(i.scrollPaddingTop) || 0), c = (parseFloat(s.scrollMarginBottom) || 0) + (parseFloat(i.scrollPaddingBottom) || 0), a = e.getBoundingClientRect();
1597
- if (a.top >= r && a.bottom <= window.innerHeight - c) return !1;
1598
- try {
1599
- e.scrollIntoView({
1600
- behavior: ln(e) ? "auto" : "smooth",
1601
- block: t
1602
- });
1603
- } catch {
1604
- e.scrollIntoView();
1605
- }
1606
- return !0;
1607
- }
1608
- function Fr(e, t = 1e3) {
1609
- let s = !1;
1610
- const i = () => {
1611
- s || (s = !0, window.removeEventListener("scrollend", i), clearTimeout(r), e());
1612
- }, r = setTimeout(i, t);
1613
- return window.addEventListener("scrollend", i), () => {
1614
- s = !0, window.removeEventListener("scrollend", i), clearTimeout(r);
1615
- };
1616
- }
1617
- function Rr({
1618
- length: e = 5,
1619
- onVerify: t,
1620
- onResend: s,
1621
- resendSeconds: i = 60,
1622
- phoneHint: r,
1623
- onVerified: c,
1624
- onBusyChange: a
1625
- }) {
1626
- const { t: l, i18n: m } = Z("ui"), p = at(), f = at(), v = M(null), h = M(null), d = M(null), g = M(null), I = M(!1), u = M(!1), [F, N] = H(null), [w, x] = H(!1), [O, R] = H(null), [_, b] = H(
1627
- null
1628
- ), [C, P] = H(0), A = Number.isFinite(i) ? Math.max(0, Math.ceil(i)) : 60, [L, B] = H(
1629
- () => Date.now() + A * 1e3
1630
- ), [D, k] = H(A), Y = O === "too-many-attempts";
1631
- q(() => {
1632
- a == null || a(!!F);
1633
- }, [F, a]), q(() => (I.current = !0, () => {
1634
- I.current = !1;
1635
- }), []), q(() => {
1636
- var E;
1637
- (E = d.current) == null || E.focus({ preventScroll: !0 }), Kn(h.current, "center");
1638
- }, [C]), q(() => {
1639
- var W, Q;
1640
- if (F || !Y && _ !== "resend") return;
1641
- const E = document.activeElement, J = (W = v.current) == null ? void 0 : W.closest("section");
1642
- E && E !== document.body && !(J != null && J.contains(E)) || (g.current && !g.current.disabled ? g.current.focus() : (Q = v.current) == null || Q.focus());
1643
- }, [F, Y, _]), q(() => {
1644
- if (D === 0) return;
1645
- const E = setTimeout(() => {
1646
- k(Math.max(0, Math.ceil((L - Date.now()) / 1e3)));
1647
- }, 1e3);
1648
- return () => clearTimeout(E);
1649
- }, [L, D]);
1650
- const X = async (E) => {
1651
- if (!(u.current || Y)) {
1652
- u.current = !0, N("verify"), x(!1), R(null), b(null);
1653
- try {
1654
- const J = await t(E);
1655
- if (!I.current) return;
1656
- J.ok ? c(J.redirectUrl) : (R(J.reason), J.reason !== "too-many-attempts" && P((W) => W + 1));
1657
- } catch {
1658
- if (!I.current) return;
1659
- b("verify"), P((J) => J + 1);
1660
- } finally {
1661
- u.current = !1, I.current && N(null);
1662
- }
1663
- }
1664
- }, _e = async () => {
1665
- if (!(u.current || Date.now() < L)) {
1666
- u.current = !0, N("resend"), x(!1), b(null);
1667
- try {
1668
- if (await s(), !I.current) return;
1669
- B(Date.now() + A * 1e3), k(A), R(null), x(!0), P((E) => E + 1);
1670
- } catch {
1671
- I.current && b("resend");
1672
- } finally {
1673
- u.current = !1, I.current && N(null);
1674
- }
1675
- }
1676
- }, Le = O === "wrong" ? l("booking.code.wrong") : O === "expired" ? l("booking.code.expired") : Y ? l("booking.code.tooManyAttempts") : void 0;
1677
- return /* @__PURE__ */ n(fs, { variant: "elevated", asChild: !0, children: /* @__PURE__ */ S(
1678
- "section",
1679
- {
1680
- ref: h,
1681
- "aria-labelledby": p,
1682
- "data-component": "booking-code-step",
1683
- className: "ds:items-center ds:gap-[var(--spacing-md)] ds:p-[var(--spacing-md)] ds:text-center",
1684
- children: [
1685
- /* @__PURE__ */ n(
1686
- "h3",
1687
- {
1688
- ref: v,
1689
- id: p,
1690
- tabIndex: -1,
1691
- className: `type-title-card ds:m-0 ${Wt}`,
1692
- children: l("booking.code.heading")
1693
- }
1694
- ),
1695
- /* @__PURE__ */ n("p", { id: f, className: "type-body ds:m-0", children: r ? /* @__PURE__ */ n(
1696
- Tn,
1697
- {
1698
- t: l,
1699
- ns: "ui",
1700
- i18nKey: "booking.code.instructionWithPhone",
1701
- values: { phone: r },
1702
- components: { phone: /* @__PURE__ */ n("bdi", {}) }
1703
- }
1704
- ) : l("booking.code.instruction") }),
1705
- /* @__PURE__ */ n(Ke, { label: l("booking.code.label"), error: Le, children: /* @__PURE__ */ n("div", { dir: "ltr", children: /* @__PURE__ */ n(
1706
- gs,
1707
- {
1708
- ref: d,
1709
- length: e,
1710
- mode: "alphanumeric",
1711
- "aria-describedby": f,
1712
- disabled: !!F || Y,
1713
- onComplete: X
1714
- },
1715
- C
1716
- ) }) }),
1717
- _ ? /* @__PURE__ */ n(oe, { variant: "error", className: "ds:self-stretch ds:text-start", children: /* @__PURE__ */ n(oe.Description, { children: l(_ === "verify" ? "booking.code.verifyFailed" : "booking.code.resendFailed") }) }) : null,
1718
- /* @__PURE__ */ n("p", { role: "status", className: "type-body ds:m-0", children: F === "verify" ? l("booking.code.verifying") : w ? l("booking.code.resent") : null }),
1719
- /* @__PURE__ */ n(
1720
- we,
1721
- {
1722
- ref: g,
1723
- type: "button",
1724
- intent: "secondary",
1725
- disabled: D > 0 || !!F,
1726
- loading: F === "resend",
1727
- onClick: _e,
1728
- children: D > 0 ? l("booking.code.resendCountdown", {
1729
- seconds: new Intl.NumberFormat(m.language).format(
1730
- D
1731
- )
1732
- }) : l("booking.code.resend")
1733
- }
1734
- )
1735
- ]
1736
- }
1737
- ) });
1738
- }
1739
- function jn(e) {
1740
- const t = e.payment;
1741
- if (!t) return;
1742
- const s = (t.currencyCode ?? "EUR").toUpperCase();
1743
- if (!(!Number.isSafeInteger(t.amountCents) || t.amountCents <= 0 || !["full", "deposit"].includes(t.kind) || !/^[A-Z]{3}$/.test(s)))
1744
- return {
1745
- serviceId: e.id,
1746
- kind: t.kind,
1747
- amountCents: t.amountCents,
1748
- currencyCode: s
1749
- };
1750
- }
1751
- function _r(e) {
1752
- var r;
1753
- const t = (r = e.priceLabel) != null && r.trim() ? e.priceLabel : void 0, s = t ? { label: t } : void 0;
1754
- if (!e.payment) return { price: s };
1755
- const i = jn(e);
1756
- return i ? {
1757
- price: s ?? (i.kind === "full" ? { amount: i } : void 0),
1758
- payment: i
1759
- } : { price: s, payment: "unavailable" };
1760
- }
1761
- function Lr(e, t, s) {
1762
- const i = e.filter(
1763
- (c) => t.includes(c.id)
1764
- ), r = (s == null ? void 0 : s.serviceId) ?? (t.length === 1 ? t[0] : void 0);
1765
- if (r) {
1766
- const c = i.find((l) => l.id === r);
1767
- if (!c) return { blocked: !0 };
1768
- const a = jn(c);
1769
- return { payment: a, blocked: !!(c.payment && !a) };
1770
- }
1771
- return { blocked: i.some((c) => !!c.payment) };
1772
- }
1773
- function Ut(e) {
1774
- return e ? JSON.stringify([
1775
- e.serviceId,
1776
- e.kind,
1777
- e.amountCents,
1778
- e.currencyCode
1779
- ]) : "";
1780
- }
1781
- function Br({
1782
- services: e,
1783
- value: t,
1784
- availableSlots: s,
1785
- onSubmit: i,
1786
- onChange: r,
1787
- paymentState: c,
1788
- submitting: a,
1789
- paymentTermsUrl: l,
1790
- renderPayment: m,
1791
- codeStep: p
1792
- }) {
1793
- var Le, E, J;
1794
- const f = JSON.stringify([
1795
- t.insuranceType,
1796
- t.specialtyId,
1797
- t.specialtyIds,
1798
- Ue(t),
1799
- t.operatorId,
1800
- t.operatorIds,
1801
- t.date,
1802
- t.slotKey
1803
- ]), v = M(
1804
- void 0
1805
- ), d = (t.date ? (Le = s[t.date]) == null ? void 0 : Le.find((W) => W.key === t.slotKey) : void 0) ?? (((E = v.current) == null ? void 0 : E.selection) === f ? v.current.slot : void 0), g = Lr(
1806
- e,
1807
- Ue(t),
1808
- d
1809
- ), I = g.blocked || !!(g.payment && !m), u = JSON.stringify([
1810
- f,
1811
- d == null ? void 0 : d.serviceId,
1812
- Ut(g.payment),
1813
- l,
1814
- I
1815
- ]), F = g.payment ? JSON.stringify([Ut(g.payment), l]) : "", N = M(void 0), w = !!((J = t.details) != null && J.paymentAccepted);
1816
- q(() => {
1817
- if (!w) N.current = void 0;
1818
- else if (F) N.current === void 0 ? N.current = F : N.current !== F && (N.current = void 0, r({
1819
- ...t,
1820
- details: { ...t.details, paymentAccepted: !1 }
1821
- }));
1822
- else return;
1823
- }, [w, F, r, t]);
1824
- const x = M(u);
1825
- x.current = u;
1826
- const [O, R] = H({ status: "idle" }), _ = M(0), b = M(!1), C = M(!0), P = M(!1), A = M(void 0), L = M(u);
1827
- q(() => (C.current = !0, () => {
1828
- C.current = !1, _.current += 1;
1829
- }), []);
1830
- const B = O.status === "payment" || O.status === "code" || O.status === "success";
1831
- q(() => {
1832
- L.current === u || P.current || B || (L.current = u, _.current += 1, b.current = !1, R({ status: "idle" }));
1833
- }, [u, B]);
1834
- const D = B || L.current === u ? O.session : void 0, k = $(
1835
- () => D && (c == null ? void 0 : c.sessionId) === D.id ? c : D ? { sessionId: D.id, status: "ready" } : void 0,
1836
- [D, c]
1837
- );
1838
- D && k && "phase" in k && k.phase === "completion" && (A.current = D.id);
1839
- const Y = $(
1840
- () => D && A.current === D.id && k && k.status !== "paid" && (!("phase" in k) || k.phase !== "completion") ? {
1841
- sessionId: D.id,
1842
- status: "processing",
1843
- phase: "completion"
1844
- } : k,
1845
- [D, k]
1846
- );
1847
- q(() => {
1848
- if (!(!D || !Y || P.current))
1849
- if (Y.status === "paid") {
1850
- if (O.status !== "payment") return;
1851
- P.current = !0, R((W) => ({
1852
- ...W,
1853
- status: "success",
1854
- redirectUrl: Y.redirectUrl
1855
- }));
1856
- } else Y.status === "cancelled" && (_.current += 1, b.current = !1, v.current = void 0, r({
1857
- ...t,
1858
- details: { ...t.details, paymentAccepted: !1 }
1859
- }), R({ status: "idle", cancelled: !0 }));
1860
- }, [D, Y, r, t, O.status]);
1861
- const X = () => {
1862
- _.current += 1, b.current = !1, P.current = !1, A.current = void 0, v.current = void 0, L.current = x.current, R({ status: "idle" });
1863
- }, _e = async (W) => {
1864
- var Se, xe, Te, ce, Pe;
1865
- if (!(d != null && d.available) || I || a || b.current || O.status === "payment" || O.status === "code" || P.current || g.payment && !W.paymentAccepted) return;
1866
- b.current = !0;
1867
- const Q = p ? { ...p } : void 0;
1868
- v.current = { selection: f, slot: { ...d } };
1869
- const Be = ++_.current, tt = u;
1870
- L.current = tt;
1871
- const ge = {
1872
- slot: { ...d, meta: d.meta ? { ...d.meta } : void 0 },
1873
- value: {
1874
- ...t,
1875
- serviceIds: (Se = t.serviceIds) == null ? void 0 : Se.slice(),
1876
- specialtyIds: (xe = t.specialtyIds) == null ? void 0 : xe.slice(),
1877
- operatorIds: (Te = t.operatorIds) == null ? void 0 : Te.slice(),
1878
- operatorId: $n(t) ?? t.operatorId,
1879
- details: { ...W }
1880
- },
1881
- details: {
1882
- ...W,
1883
- confirmationChannels: (ce = W.confirmationChannels) == null ? void 0 : ce.slice()
1884
- },
1885
- ...g.payment ? { payment: { ...g.payment } } : {}
1886
- }, te = () => C.current && _.current === Be && x.current === tt;
1887
- R({ status: "submitting" });
1888
- let me = !1;
1889
- try {
1890
- const ee = await i(ge);
1891
- if (!te()) return;
1892
- if (ge.payment) {
1893
- const le = ee == null ? void 0 : ee.paymentSession;
1894
- if (!((Pe = le == null ? void 0 : le.id) != null && Pe.trim()) || Ut(le.payment) !== Ut(ge.payment)) {
1895
- R({ status: "error" });
1896
- return;
1897
- }
1898
- me = !0, R({
1899
- status: Q ? "code" : "payment",
1900
- snapshot: ge,
1901
- session: { id: le.id, payment: { ...le.payment } },
1902
- codeStep: Q
1903
- });
1904
- } else ee != null && ee.paymentSession ? R({ status: "error" }) : (P.current = !0, R({
1905
- status: Q ? "code" : "success",
1906
- snapshot: ge,
1907
- codeStep: Q
1908
- }));
1909
- } catch {
1910
- te() && R({ status: "error" });
1911
- } finally {
1912
- te() && !me && (b.current = !1);
1913
- }
1914
- };
1915
- return {
1916
- ...O,
1917
- payment: g.payment,
1918
- blocked: I,
1919
- state: Y,
1920
- activeSession: D,
1921
- submit: _e,
1922
- reset: X,
1923
- completeCode: (W) => {
1924
- R(
1925
- (Q) => Q.status !== "code" ? Q : Q.session ? { ...Q, status: "payment", codeVerified: !0 } : {
1926
- ...Q,
1927
- status: "success",
1928
- codeVerified: !0,
1929
- redirectUrl: W
1930
- }
1931
- );
1932
- }
1933
- };
1934
- }
1935
- const Pr = 5e3, Vr = "ds:[stroke-dasharray:1] ds:[stroke-dashoffset:1] ds:animate-[stepper-icon-draw_calc(var(--animation-duration)*3)_var(--ease-out)_forwards]", $r = "ds:block ds:[block-size:100%] ds:rounded-full ds:bg-[var(--primary)] ds:animate-[reserved-bar-fill_linear_forwards] ds:[animation-duration:var(--handover-ms)]";
1936
- function qr({
1937
- url: e,
1938
- delayMs: t,
1939
- onNavigate: s,
1940
- date: i,
1941
- time: r,
1942
- details: c,
1943
- shouldTakeFocus: a
1944
- }) {
1945
- const { t: l } = Z("ui"), m = M(null), p = M(null), f = M(void 0), v = at(), h = M(null), [d, g] = H(!1), [I, u] = H(() => ln(null)), F = () => {
1946
- clearTimeout(f.current);
1947
- try {
1948
- s ? s(e) : window.location.assign(e);
1949
- } catch {
1950
- }
1951
- }, N = () => {
1952
- var x;
1953
- clearTimeout(f.current), g(!0), (x = h.current) == null || x.focus({ preventScroll: !0 });
1954
- }, w = M(F);
1955
- return w.current = F, an(() => {
1956
- u(ln(m.current));
1957
- }, []), q(() => {
1958
- const x = p.current;
1959
- x && m.current && a(m.current) && x.focus({ preventScroll: !0 });
1960
- }, []), q(() => (f.current = setTimeout(() => w.current(), t), () => clearTimeout(f.current)), [e, t]), /* @__PURE__ */ S(
1961
- "div",
1962
- {
1963
- ref: m,
1964
- "data-component": "booking-reserved",
1965
- className: "ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-md)] ds:text-center",
1966
- children: [
1967
- /* @__PURE__ */ n(
1968
- "span",
1969
- {
1970
- "aria-hidden": "true",
1971
- className: "ds:flex ds:size-[var(--spacing-2xl)] ds:items-center ds:justify-center ds:rounded-full ds:bg-[color-mix(in_srgb,var(--success)_10%,transparent)] ds:text-[var(--success)]",
1972
- children: /* @__PURE__ */ n(
1973
- "svg",
1974
- {
1975
- viewBox: "0 0 24 24",
1976
- fill: "none",
1977
- stroke: "currentColor",
1978
- strokeWidth: "3",
1979
- strokeLinecap: "round",
1980
- strokeLinejoin: "round",
1981
- className: "ds:size-[var(--spacing-lg)]",
1982
- children: /* @__PURE__ */ n("path", { pathLength: "1", d: "M5 12l5 5L20 7", className: Vr })
1983
- }
1984
- )
1985
- }
1986
- ),
1987
- /* @__PURE__ */ S("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
1988
- /* @__PURE__ */ n(
1989
- "h3",
1990
- {
1991
- ref: p,
1992
- tabIndex: -1,
1993
- "aria-describedby": v,
1994
- className: "type-title-card ds:m-0 ds:outline-none",
1995
- children: l("booking.reserved.heading")
1996
- }
1997
- ),
1998
- /* @__PURE__ */ n("p", { className: "type-body ds:m-0 ds:text-[var(--foreground)]", children: i ? l("booking.reserved.when", { date: i, time: r }) : r }),
1999
- c ? /* @__PURE__ */ n("p", { className: "type-body ds:m-0 ds:text-[var(--muted-foreground)]", children: c }) : null
2000
- ] }),
2001
- /* @__PURE__ */ n("p", { id: v, role: "status", className: "type-body ds:m-0", children: l(d ? "booking.reserved.stayed" : "booking.reserved.redirecting") }),
2002
- I || d || t > Pr ? null : (
2003
- // Decorative: the sentence above already says a redirect is coming,
2004
- // and a progressbar with no value to read would only add noise.
2005
- /* @__PURE__ */ n(
2006
- "div",
2007
- {
2008
- "aria-hidden": "true",
2009
- "data-slot": "booking-reserved-bar",
2010
- className: "ds:[block-size:var(--spacing-xs)] ds:[inline-size:100%] ds:[max-inline-size:calc(var(--spacing-2xl)*5)] ds:overflow-hidden ds:rounded-full ds:bg-[var(--secondary)]",
2011
- children: /* @__PURE__ */ n(
2012
- "span",
2013
- {
2014
- className: $r,
2015
- style: { "--handover-ms": `${t}ms` }
2016
- }
2017
- )
2018
- }
2019
- )
2020
- ),
2021
- /* @__PURE__ */ n(
2022
- we,
2023
- {
2024
- ref: h,
2025
- type: "button",
2026
- intent: "secondary",
2027
- size: "lg",
2028
- onClick: F,
2029
- children: l("booking.reserved.goNow")
2030
- }
2031
- ),
2032
- d ? null : /* @__PURE__ */ n(we, { type: "button", intent: "ghost", size: "md", onClick: N, children: l("booking.reserved.stay") })
2033
- ]
2034
- }
2035
- );
2036
- }
2037
- const zr = 3e3;
2038
- function Kr(e) {
2039
- if (typeof e != "string") return;
2040
- const t = e.trim();
2041
- try {
2042
- const { protocol: s } = new URL(t);
2043
- return (s === "https:" || s === "http:") && hs(t) ? t : void 0;
2044
- } catch {
2045
- return;
2046
- }
2047
- }
2048
- const jr = 2 ** 31 - 1;
2049
- function Ur(e) {
2050
- return typeof e == "number" && Number.isFinite(e) && e >= 0 ? Math.min(e, jr) : zr;
2051
- }
2052
- const Hr = At(
2053
- // --booking-held-height: see the step-8 effects (runtime-measured height).
2054
- "ds:flex ds:w-full ds:flex-col ds:text-[var(--foreground)] ds:[min-block-size:var(--booking-held-height,auto)]",
2055
- {
2056
- variants: {
2057
- variant: {
2058
- "inline-list": "ds:gap-[var(--spacing-md)]",
2059
- accordion: "ds:gap-[var(--spacing-md)]",
2060
- calendar: "ds:gap-[var(--spacing-md)]",
2061
- flexible: "ds:gap-[var(--spacing-lg)]",
2062
- progress: "ds:gap-[var(--spacing-sm)]"
2063
- },
2064
- // `surface="elevated"` matches `Card variant="elevated"` — same
2065
- // tokens, same padding, same boundary behaviour — so consumers can
2066
- // drop their own Card wraps without a double-card look. Default
2067
- // `'flat'` preserves 0.30.x rendering.
2068
- surface: {
2069
- flat: "",
2070
- elevated: [
2071
- "ds:rounded-[var(--radius-lg)]",
2072
- "ds:bg-[var(--card)] ds:text-[var(--card-foreground)]",
2073
- "ds:border ds:border-[color:var(--card-border)]",
2074
- "ds:shadow-[var(--shadow-card)]",
2075
- "ds:p-[var(--spacing-md)]"
2076
- ].join(" ")
2077
- }
2078
- },
2079
- defaultVariants: { variant: "inline-list", surface: "flat" }
2080
- }
2081
- ), Gr = [
2082
- [
2083
- /\b(estetic|aesthetic|botox|filler|mesoterap|chirurgia\s*plastic)/i,
2084
- kn
2085
- ],
2086
- [/\b(cardio|ecg|elettrocardio|ecocardio|cuore|heart)/i, Ms],
2087
- [/\b(dent|odonto|tooth|teeth|pulizia|igien|smile)/i, Qs],
2088
- [/\b(oftalmo|ocul|ophthal|vision|occhi|eye)/i, Os],
2089
- [/\b(otorin|udito|orecchi|hearing|ear)/i, Us],
2090
- [/\b(neuro|brain|cervello)/i, qs],
2091
- [/\b(pediatr|child|bambin)/i, Es],
2092
- [/\b(ortop|ortho|osteo|skeleton|ossa|bone)/i, Vs],
2093
- [/\b(lab|analis|test|sang|esami)/i, Gs],
2094
- [/\b(farmaco|pharm|pillol|refill)/i, Ws],
2095
- [/\b(chirurg|surg|intervent|operat)/i, Zs],
2096
- [/\b(scan|rx|x-?ray|raggi|imag|radio|risonan|ecograf|ultras)/i, Fs],
2097
- [/\b(vacc|inject|inie|punto)/i, kn],
2098
- [/\b(derma|skin|pelle)/i, Rs],
2099
- [/\b(prima\s*visit|first\s*visit|consult|consulto|valutaz)/i, _s],
2100
- [/\b(general|medicin|family|control|check[-\s]?up)/i, Bs]
2101
- ];
2102
- function Jr(e) {
2103
- for (const [t, s] of Gr)
2104
- if (t.test(e)) return s;
2105
- return null;
2106
- }
2107
- function Wr(e) {
2108
- const t = Jr(e.label) ?? Ds;
2109
- return /* @__PURE__ */ n(t, { "aria-hidden": "true", className: "ds:size-5" });
2110
- }
2111
- function Un() {
2112
- const { t: e, i18n: t } = Z("ui");
2113
- return (s) => {
2114
- const i = _r(s), r = (a) => Zt(a.amountCents, a.currencyCode, t.language), c = i.price ? "label" in i.price ? i.price.label : r(i.price.amount) : void 0;
2115
- return i.payment === "unavailable" ? {
2116
- price: c,
2117
- payment: e("booking.payment.unavailable"),
2118
- paymentTone: "error"
2119
- } : {
2120
- price: c,
2121
- payment: i.payment ? e(`booking.payment.${i.payment.kind}`, {
2122
- amount: r(i.payment)
2123
- }) : void 0,
2124
- paymentTone: "default"
2125
- };
2126
- };
2127
- }
2128
- function ot(e) {
2129
- return Gt(e, "yyyy-MM-dd");
2130
- }
2131
- const Yr = [
2132
- "ds:relative ds:flex ds:items-center ds:justify-center",
2133
- "ds:min-h-[var(--min-target-size)] ds:min-w-[var(--min-target-size)]",
2134
- "ds:rounded-[var(--radius-sm)]",
2135
- "ds:text-[length:var(--font-size-sm)]",
2136
- "ds:transition-colors ds:duration-[var(--animation-duration)]",
2137
- "ds:motion-reduce:transition-none",
2138
- "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
2139
- "ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
2140
- "ds:forced-colors:focus-visible:outline-[CanvasText]"
2141
- ].join(" "), Zr = At(Yr, {
2142
- variants: {
2143
- state: {
2144
- available: "ds:cursor-pointer ds:text-[var(--foreground)] ds:hover:bg-[var(--muted)]/30",
2145
- unavailable: "ds:cursor-not-allowed ds:text-[var(--muted-foreground)]/60",
2146
- selected: "ds:bg-[var(--primary)] ds:text-[var(--primary-foreground)] ds:font-[var(--font-weight-semibold)]",
2147
- outside: "ds:text-[var(--muted-foreground)]/40"
2148
- }
2149
- },
2150
- defaultVariants: { state: "unavailable" }
2151
- });
2152
- function Xr({
2153
- availableDates: e,
2154
- selectedDate: t,
2155
- onSelectDate: s,
2156
- locale: i,
2157
- loading: r
2158
- }) {
2159
- const { t: c } = Z("ui"), a = $(() => t ? Tt(fe(t)) : e.length > 0 ? Tt(fe(e[0])) : Tt(/* @__PURE__ */ new Date()), [t, e]), [l, m] = H(a), [p, f] = H(null), v = $(() => {
2160
- const N = Tt(l), w = Is(l), x = N.getDay(), O = w.getDate(), R = [];
2161
- for (let _ = x; _ > 0; _ -= 1) {
2162
- const b = new Date(N);
2163
- b.setDate(N.getDate() - _), R.push(b);
2164
- }
2165
- for (let _ = 0; _ < O; _ += 1) {
2166
- const b = new Date(N);
2167
- b.setDate(N.getDate() + _), R.push(b);
2168
- }
2169
- for (; R.length < 42; ) {
2170
- const _ = R[R.length - 1], b = new Date(_);
2171
- b.setDate(_.getDate() + 1), R.push(b);
2172
- }
2173
- return R;
2174
- }, [l]), h = $(() => {
2175
- try {
2176
- return new Intl.DateTimeFormat(i, {
2177
- month: "long",
2178
- year: "numeric"
2179
- }).format(l);
2180
- } catch {
2181
- return Gt(l, "MMMM yyyy");
2182
- }
2183
- }, [l, i]), d = $(() => {
2184
- const N = new Date(2024, 0, 7);
2185
- return Array.from({ length: 7 }, (w, x) => {
2186
- const O = new Date(N);
2187
- O.setDate(N.getDate() + x);
2188
- try {
2189
- return new Intl.DateTimeFormat(i, { weekday: "short" }).format(O);
2190
- } catch {
2191
- return Gt(O, "EEE");
2192
- }
2193
- });
2194
- }, [i]), g = $(() => new Set(e), [e]), I = ke(
2195
- (N) => g.has(ot(N)),
2196
- [g]
2197
- ), u = $(() => {
2198
- if (p) return p;
2199
- if (t) return fe(t);
2200
- const N = v.find(
2201
- (w) => zt(w, l) && I(w)
2202
- );
2203
- return N || (v.find((w) => zt(w, l)) ?? null);
2204
- }, [p, t, v, l, I]), F = ke(
2205
- (N, w) => {
2206
- let x = null;
2207
- switch (N.key) {
2208
- case "ArrowLeft":
2209
- x = new Date(w), x.setDate(w.getDate() - 1);
2210
- break;
2211
- case "ArrowRight":
2212
- x = new Date(w), x.setDate(w.getDate() + 1);
2213
- break;
2214
- case "ArrowUp":
2215
- x = new Date(w), x.setDate(w.getDate() - 7);
2216
- break;
2217
- case "ArrowDown":
2218
- x = new Date(w), x.setDate(w.getDate() + 7);
2219
- break;
2220
- case "Home":
2221
- x = new Date(w), x.setDate(w.getDate() - w.getDay());
2222
- break;
2223
- case "End":
2224
- x = new Date(w), x.setDate(w.getDate() + (6 - w.getDay()));
2225
- break;
2226
- case "Enter":
2227
- case " ": {
2228
- N.preventDefault(), I(w) && s(ot(w));
2229
- return;
2230
- }
2231
- default:
2232
- return;
2233
- }
2234
- x && (N.preventDefault(), zt(x, l) || m(Tt(x)), f(x));
2235
- },
2236
- [I, s, l]
2237
- );
2238
- return r ? /* @__PURE__ */ S(
2239
- "div",
2240
- {
2241
- role: "status",
2242
- "aria-live": "polite",
2243
- "aria-label": c("common.loading"),
2244
- className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
2245
- children: [
2246
- /* @__PURE__ */ n(Jt, { variant: "text", width: "40%" }),
2247
- /* @__PURE__ */ n("div", { className: "ds:grid ds:grid-cols-7 ds:gap-[var(--spacing-2xs)]", children: Array.from({ length: 42 }, (N, w) => /* @__PURE__ */ n(Jt, { variant: "rounded", height: "2.5rem" }, `mg-skel-${w}`)) })
2248
- ]
2249
- }
2250
- ) : /* @__PURE__ */ S("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
2251
- /* @__PURE__ */ S("div", { className: "ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
2252
- /* @__PURE__ */ n(
2253
- bn,
2254
- {
2255
- icon: /* @__PURE__ */ n(ws, {}),
2256
- "aria-label": c("booking.previousMonth"),
2257
- size: "sm",
2258
- intent: "ghost",
2259
- flipIconInRtl: !0,
2260
- onClick: () => {
2261
- m((N) => sr(N)), f(null);
2262
- }
2263
- }
2264
- ),
2265
- /* @__PURE__ */ n(
2266
- "span",
2267
- {
2268
- className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)]",
2269
- "aria-live": "polite",
2270
- children: h
2271
- }
2272
- ),
2273
- /* @__PURE__ */ n(
2274
- bn,
2275
- {
2276
- icon: /* @__PURE__ */ n(Cs, {}),
2277
- "aria-label": c("booking.nextMonth"),
2278
- size: "sm",
2279
- intent: "ghost",
2280
- flipIconInRtl: !0,
2281
- onClick: () => {
2282
- m((N) => On(N, 1)), f(null);
2283
- }
2284
- }
2285
- )
2286
- ] }),
2287
- /* @__PURE__ */ S(
2288
- "div",
2289
- {
2290
- role: "grid",
2291
- "aria-label": c("booking.monthGridLabel"),
2292
- className: "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]",
2293
- children: [
2294
- /* @__PURE__ */ n(
2295
- "div",
2296
- {
2297
- role: "row",
2298
- className: "ds:grid ds:grid-cols-7 ds:gap-[var(--spacing-2xs)]",
2299
- children: d.map((N, w) => /* @__PURE__ */ n(
2300
- "div",
2301
- {
2302
- role: "columnheader",
2303
- className: "type-meta ds:text-center ds:text-[var(--muted-foreground)] ds:font-[var(--font-weight-medium)]",
2304
- children: N
2305
- },
2306
- `wd-${w}`
2307
- ))
2308
- }
2309
- ),
2310
- Array.from({ length: 6 }, (N, w) => /* @__PURE__ */ n(
2311
- "div",
2312
- {
2313
- role: "row",
2314
- className: "ds:grid ds:grid-cols-7 ds:gap-[var(--spacing-2xs)]",
2315
- children: v.slice(w * 7, w * 7 + 7).map((x, O) => {
2316
- const R = w * 7 + O, _ = zt(x, l), b = _ && I(x), C = t ? yn(x, fe(t)) : !1, P = _ ? C ? "selected" : b ? "available" : "unavailable" : "outside", A = u ? yn(u, x) : !1, L = (() => {
2317
- try {
2318
- return new Intl.DateTimeFormat(i, {
2319
- dateStyle: "full"
2320
- }).format(x);
2321
- } catch {
2322
- return Gt(x, "PPP");
2323
- }
2324
- })();
2325
- return /* @__PURE__ */ n(
2326
- "button",
2327
- {
2328
- type: "button",
2329
- role: "gridcell",
2330
- "aria-label": L,
2331
- "aria-selected": C || void 0,
2332
- "aria-disabled": !b || void 0,
2333
- tabIndex: A ? 0 : -1,
2334
- disabled: !b,
2335
- onClick: () => {
2336
- b && s(ot(x));
2337
- },
2338
- onKeyDown: (B) => F(B, x),
2339
- className: Zr({ state: P }),
2340
- children: /* @__PURE__ */ n("span", { "aria-hidden": "true", children: x.getDate() })
2341
- },
2342
- `mg-cell-${R}`
2343
- );
2344
- })
2345
- },
2346
- `mg-row-${w}`
2347
- ))
2348
- ]
2349
- }
2350
- )
2351
- ] });
2352
- }
2353
- const Qr = At(
2354
- [
2355
- "ds:relative ds:flex ds:w-full ds:items-center ds:gap-[var(--spacing-md)]",
2356
- "ds:min-h-[var(--min-target-size)]",
2357
- "ds:rounded-[var(--radius-md)]",
2358
- "ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]",
2359
- "ds:pt-[var(--spacing-sm)] ds:pb-[var(--spacing-sm)]",
2360
- "ds:text-start",
2361
- "ds:transition-[background-color,box-shadow]",
2362
- "ds:duration-[var(--animation-duration)]",
2363
- "ds:motion-reduce:transition-none",
2364
- "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
2365
- "ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
2366
- "ds:forced-colors:[outline:1px_solid_CanvasText]",
2367
- "ds:cursor-pointer"
2368
- ].join(" "),
2369
- {
2370
- variants: {
2371
- state: {
2372
- idle: "ds:bg-[var(--card)] ds:shadow-[var(--shadow-sm)] ds:hover:shadow-[var(--shadow-md)]",
2373
- selected: "ds:bg-[color-mix(in_srgb,var(--primary)_8%,var(--card))] ds:shadow-[var(--shadow-sm)]"
2374
- }
2375
- },
2376
- defaultVariants: { state: "idle" }
2377
- }
2378
- );
2379
- function ei({
2380
- services: e,
2381
- selectedServiceId: t,
2382
- onSelect: s,
2383
- showDuration: i
2384
- }) {
2385
- const { t: r } = Z("ui"), c = Un(), a = at(), [l, m] = H(() => {
2386
- if (t) {
2387
- const h = e.findIndex((d) => d.id === t);
2388
- if (h >= 0) return h;
2389
- }
2390
- return 0;
2391
- }), p = M(/* @__PURE__ */ new Map()), f = ke((h) => {
2392
- var d;
2393
- (d = p.current.get(h)) == null || d.focus();
2394
- }, []), v = ke(
2395
- (h, d, g) => {
2396
- const I = e.length;
2397
- if (I !== 0)
2398
- switch (h.key) {
2399
- case "ArrowDown":
2400
- case "ArrowRight": {
2401
- h.preventDefault();
2402
- const u = (d + 1) % I;
2403
- m(u), f(u);
2404
- break;
2405
- }
2406
- case "ArrowUp":
2407
- case "ArrowLeft": {
2408
- h.preventDefault();
2409
- const u = (d - 1 + I) % I;
2410
- m(u), f(u);
2411
- break;
2412
- }
2413
- case "Home": {
2414
- h.preventDefault(), m(0), f(0);
2415
- break;
2416
- }
2417
- case "End": {
2418
- h.preventDefault();
2419
- const u = I - 1;
2420
- m(u), f(u);
2421
- break;
2422
- }
2423
- case "Enter":
2424
- case " ": {
2425
- h.preventDefault(), s(g);
2426
- break;
2427
- }
2428
- }
2429
- },
2430
- [e.length, f, s]
2431
- );
2432
- return e.length === 0 ? null : /* @__PURE__ */ n(
2433
- "div",
2434
- {
2435
- role: "radiogroup",
2436
- "aria-label": r("booking.serviceListLabel"),
2437
- id: a,
2438
- className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
2439
- children: e.map((h, d) => {
2440
- const g = t === h.id, I = l === d, { price: u, payment: F, paymentTone: N } = c(h), w = u ? F ? r("booking.serviceCardLabelPayment", {
2441
- label: h.label,
2442
- price: u,
2443
- payment: F
2444
- }) : r("booking.serviceCardLabelPrice", {
2445
- label: h.label,
2446
- price: u
2447
- }) : F ? r("booking.serviceCardLabelPaymentNoPrice", {
2448
- label: h.label,
2449
- payment: F
2450
- }) : i ? r("booking.serviceCardLabel", {
2451
- label: h.label,
2452
- duration: h.durationMin
2453
- }) : h.label, x = Wr(h);
2454
- return /* @__PURE__ */ S(
2455
- "button",
2456
- {
2457
- ref: (O) => {
2458
- O ? p.current.set(d, O) : p.current.delete(d);
2459
- },
2460
- type: "button",
2461
- role: "radio",
2462
- "aria-checked": g,
2463
- "aria-label": w,
2464
- tabIndex: I ? 0 : -1,
2465
- onClick: () => s(h.id),
2466
- onFocus: () => m(d),
2467
- onKeyDown: (O) => v(O, d, h.id),
2468
- className: Qr({
2469
- state: g ? "selected" : "idle"
2470
- }),
2471
- children: [
2472
- /* @__PURE__ */ n(
2473
- "span",
2474
- {
2475
- "aria-hidden": "true",
2476
- className: "ds:flex ds:size-10 ds:shrink-0 ds:items-center ds:justify-center ds:rounded-[var(--radius-sm)] ds:bg-[var(--primary)]/10 ds:text-[var(--primary)]",
2477
- children: x
2478
- }
2479
- ),
2480
- /* @__PURE__ */ S("span", { className: "ds:flex ds:min-w-0 ds:flex-1 ds:flex-col ds:gap-[var(--spacing-2xs)]", children: [
2481
- /* @__PURE__ */ n(
2482
- "span",
2483
- {
2484
- dir: "auto",
2485
- className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:break-words",
2486
- children: h.label
2487
- }
2488
- ),
2489
- F ? /* @__PURE__ */ n(
2490
- "span",
2491
- {
2492
- className: vs({ tone: N }),
2493
- children: F
2494
- }
2495
- ) : u || !i ? null : /* @__PURE__ */ n("span", { className: "type-meta ds:text-[var(--muted-foreground)]", children: r("booking.serviceSummary", {
2496
- minutes: h.durationMin
2497
- }) })
2498
- ] }),
2499
- u ? /* @__PURE__ */ n(
2500
- "span",
2501
- {
2502
- "aria-hidden": "true",
2503
- className: "ds:inline-flex ds:shrink-0 ds:items-center ds:ms-auto",
2504
- children: /* @__PURE__ */ n(Dn, { variant: "accentSoft", size: "lg", children: u })
2505
- }
2506
- ) : null
2507
- ]
2508
- },
2509
- h.id
2510
- );
2511
- })
2512
- }
2513
- );
2514
- }
2515
- const ti = At(
2516
- [
2517
- "ds:inline-flex ds:items-center ds:justify-center ds:gap-[var(--spacing-2xs)]",
2518
- "ds:min-h-[var(--min-target-size)]",
2519
- "ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]",
2520
- "ds:pt-[var(--spacing-2xs)] ds:pb-[var(--spacing-2xs)]",
2521
- "ds:rounded-[var(--radius-md)]",
2522
- "ds:text-[length:var(--font-size-sm)] ds:font-[var(--font-weight-medium)]",
2523
- "ds:transition-[background-color,color,box-shadow] ds:duration-[var(--animation-duration)]",
2524
- "ds:motion-reduce:transition-none",
2525
- "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
2526
- "ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
2527
- "ds:disabled:cursor-not-allowed ds:disabled:opacity-50",
2528
- "ds:forced-colors:[border:1px_solid_ButtonText] ds:forced-colors:text-[ButtonText]"
2529
- ].join(" "),
2530
- {
2531
- variants: {
2532
- state: {
2533
- idle: "ds:bg-[color:var(--card)] ds:text-[color:var(--foreground)] ds:shadow-[var(--shadow-sm)] ds:hover:enabled:bg-[color:var(--muted)]/40 ds:hover:enabled:shadow-[var(--shadow-md)]",
2534
- selected: "ds:bg-[color:var(--primary)] ds:text-[color:var(--primary-foreground)] ds:shadow-[var(--shadow-sm)]",
2535
- unavailable: "ds:[outline:1px_dashed_color:var(--border)] ds:[outline-offset:-1px] ds:bg-transparent ds:text-[color:var(--muted-foreground)]"
2536
- }
2537
- },
2538
- defaultVariants: { state: "idle" }
2539
- }
2540
- );
2541
- function ni(e) {
2542
- const [t] = e.split(":").map((i) => parseInt(i, 10)), s = Number.isFinite(t) ? t : 0;
2543
- return s < 12 ? "morning" : s < 17 ? "afternoon" : "evening";
2544
- }
2545
- function Yt(e, t, s) {
2546
- if (!e) return t;
2547
- try {
2548
- return new Intl.DateTimeFormat(s, {
2549
- hour: "numeric",
2550
- minute: "2-digit"
2551
- }).format(/* @__PURE__ */ new Date(`${e}T${t}:00`));
2552
- } catch {
2553
- return t;
2554
- }
2555
- }
2556
- const si = {
2557
- morning: As,
2558
- afternoon: tr,
2559
- evening: Ts
2560
- };
2561
- function ri({
2562
- date: e,
2563
- slots: t,
2564
- selectedSlotKey: s,
2565
- onSelect: i,
2566
- loading: r,
2567
- locale: c
2568
- }) {
2569
- const { t: a } = Z("ui"), l = $(() => {
2570
- try {
2571
- return new Intl.DateTimeFormat(c, {
2572
- weekday: "long",
2573
- day: "numeric",
2574
- month: "long"
2575
- }).format(fe(e));
2576
- } catch {
2577
- return e;
2578
- }
2579
- }, [e, c]), m = $(() => {
2580
- const v = {
2581
- morning: [],
2582
- afternoon: [],
2583
- evening: []
2584
- };
2585
- for (const h of t)
2586
- v[ni(h.time)].push(h);
2587
- return v;
2588
- }, [t]), p = t.filter((v) => v.available).length, f = ["morning", "afternoon", "evening"];
2589
- return r ? /* @__PURE__ */ S("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
2590
- /* @__PURE__ */ n(Jt, { variant: "text", width: "60%" }),
2591
- [0, 1].map((v) => /* @__PURE__ */ n(
2592
- "div",
2593
- {
2594
- className: "ds:grid ds:grid-cols-3 ds:gap-[var(--spacing-xs)]",
2595
- children: [0, 1, 2].map((h) => /* @__PURE__ */ n(Jt, { variant: "rounded", height: "44px" }, h))
2596
- },
2597
- v
2598
- ))
2599
- ] }) : p === 0 ? /* @__PURE__ */ n(Mn, { variant: "no-results", title: a("booking.noSlotsForDate") }) : /* @__PURE__ */ S("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
2600
- /* @__PURE__ */ S("div", { className: "ds:flex ds:items-baseline ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
2601
- /* @__PURE__ */ S("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
2602
- /* @__PURE__ */ n(
2603
- Ks,
2604
- {
2605
- "aria-hidden": "true",
2606
- className: "ds:size-4 ds:text-[color:var(--accent)]"
2607
- }
2608
- ),
2609
- /* @__PURE__ */ n("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: l })
2610
- ] }),
2611
- /* @__PURE__ */ n("span", { className: "type-meta ds:text-[var(--muted-foreground)]", children: a("booking.slotsAvailable", { count: p }) })
2612
- ] }),
2613
- f.map((v) => {
2614
- const h = m[v];
2615
- if (h.length === 0) return null;
2616
- const d = si[v];
2617
- return /* @__PURE__ */ S(
2618
- "div",
2619
- {
2620
- className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]",
2621
- children: [
2622
- /* @__PURE__ */ S("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)] ds:text-[color:var(--muted-foreground)]", children: [
2623
- /* @__PURE__ */ n(d, { "aria-hidden": "true", className: "ds:size-3.5" }),
2624
- /* @__PURE__ */ n("span", { className: "type-meta ds:font-[var(--font-weight-semibold)] ds:uppercase", children: a(`booking.timeOfDay.${v}`) })
2625
- ] }),
2626
- /* @__PURE__ */ n(
2627
- "div",
2628
- {
2629
- role: "group",
2630
- "aria-label": a(`booking.timeOfDay.${v}`),
2631
- className: "ds:grid ds:grid-cols-3 ds:gap-[var(--spacing-xs)] ds:sm:grid-cols-4",
2632
- children: h.map((g) => {
2633
- const I = g.key === s, u = g.available ? I ? "selected" : "idle" : "unavailable";
2634
- return /* @__PURE__ */ n(
2635
- "button",
2636
- {
2637
- type: "button",
2638
- "data-slot-id": g.key,
2639
- disabled: !g.available,
2640
- "aria-pressed": I,
2641
- "aria-label": a("booking.slotAvailableLabel", {
2642
- time: Yt(e, g.time, c)
2643
- }),
2644
- onClick: () => g.available && i(g),
2645
- className: ti({ state: u }),
2646
- children: Yt(e, g.time, c)
2647
- },
2648
- g.key
2649
- );
2650
- })
2651
- }
2652
- )
2653
- ]
2654
- },
2655
- v
2656
- );
2657
- })
2658
- ] });
2659
- }
2660
- const Ht = 4;
2661
- function ii({
2662
- availableDates: e,
2663
- availableSlots: t,
2664
- value: s,
2665
- onChange: i,
2666
- onDateSelect: r,
2667
- onWindowChange: c,
2668
- loadingDates: a,
2669
- loadingSlots: l,
2670
- locale: m,
2671
- agentIdBase: p
2672
- }) {
2673
- const f = $(() => yt(/* @__PURE__ */ new Date()), []), [v, h] = H(() => {
2674
- if (s.date) {
2675
- const b = yt(fe(s.date));
2676
- if (!kt(f, b)) return b;
2677
- }
2678
- if (e.length > 0) {
2679
- const b = yt(fe(e[0]));
2680
- if (kt(b, f)) return b;
2681
- }
2682
- return f;
2683
- }), d = $(
2684
- () => sn(v, Ht - 1),
2685
- [v]
2686
- ), g = $(() => Array.from({ length: Ht }, (b, C) => {
2687
- const P = sn(v, C), A = ot(P), B = (t[A] ?? []).map((D) => ({
2688
- id: D.key,
2689
- // SlotGrid formats `start` as a time via Intl.DateTimeFormat —
2690
- // compose a full ISO from the column's date + the slot's HH:mm
2691
- // so the locale-formatter has a real timestamp to work with.
2692
- start: `${A}T${D.time}:00`,
2693
- available: D.available
2694
- }));
2695
- return { date: A, slots: B };
2696
- }), [v, t]), I = kt(v, f), u = !0, F = ke(() => {
2697
- h((b) => {
2698
- const C = Ns(b, Ht);
2699
- return kt(f, C) ? f : C;
2700
- });
2701
- }, [f]), N = ke(() => {
2702
- h((b) => sn(b, Ht));
2703
- }, []);
2704
- q(() => {
2705
- if (e.length === 0) return;
2706
- const b = yt(fe(e[0]));
2707
- !kt(b, f) || e.some((P) => {
2708
- const A = yt(fe(P));
2709
- return !kt(A, d) && !xs(A, v);
2710
- }) || h(b);
2711
- }, [e]), q(() => {
2712
- c == null || c(ot(v), ot(d));
2713
- }, [v, d, c]);
2714
- const w = ke(
2715
- (b, C) => {
2716
- const P = typeof C.date == "string" ? C.date : ot(C.date);
2717
- i({
2718
- ...Vn(Qt(s, P), b.id)
2719
- }), r == null || r(P);
2720
- },
2721
- [i, r, s]
2722
- ), x = a || l ? "loading" : "default", O = g.some((b) => b.slots.length > 0), R = e[0];
2723
- return /* @__PURE__ */ S("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
2724
- x !== "loading" && !O && !!R ? /* @__PURE__ */ n(
2725
- gn,
2726
- {
2727
- nextAvailableDate: R,
2728
- onJump: () => h(yt(fe(R))),
2729
- locale: m
2730
- }
2731
- ) : null,
2732
- /* @__PURE__ */ n(
2733
- ks,
2734
- {
2735
- id: p ? `${p}-slots` : void 0,
2736
- days: g,
2737
- state: x,
2738
- selectedSlotId: s.slotKey,
2739
- maxInitialSlotsPerDay: 6,
2740
- locale: m,
2741
- hasPrevious: I,
2742
- hasNext: u,
2743
- onSlotSelect: w,
2744
- onPreviousDays: F,
2745
- onNextDays: N
2746
- }
2747
- )
2748
- ] });
2749
- }
2750
- function Hn(e) {
2751
- const {
2752
- inputs: t,
2753
- value: s,
2754
- onChange: i,
2755
- onDateSelect: r,
2756
- onWindowChange: c,
2757
- loadingDates: a,
2758
- loadingSlots: l,
2759
- locale: m,
2760
- datePickerStyle: p,
2761
- agentIdBase: f
2762
- } = e;
2763
- return p === "four-day-grid" ? /* @__PURE__ */ n(
2764
- ii,
2765
- {
2766
- availableDates: t.availableDates,
2767
- availableSlots: t.availableSlots,
2768
- value: s,
2769
- onChange: i,
2770
- onDateSelect: r,
2771
- onWindowChange: c,
2772
- loadingDates: a,
2773
- loadingSlots: l,
2774
- locale: m,
2775
- agentIdBase: f
2776
- }
2777
- ) : /* @__PURE__ */ n(
2778
- Xr,
2779
- {
2780
- availableDates: t.availableDates,
2781
- selectedDate: s.date,
2782
- onSelectDate: (v) => {
2783
- i(Qt(s, v)), r == null || r(v);
2784
- },
2785
- locale: m,
2786
- loading: a ?? l
2787
- }
2788
- );
2789
- }
2790
- function Gn(e) {
2791
- const { inputs: t, value: s, onChange: i, loadingSlots: r, locale: c, datePickerStyle: a } = e;
2792
- return a === "four-day-grid" || !s.date ? null : /* @__PURE__ */ n(
2793
- ri,
2794
- {
2795
- date: s.date,
2796
- slots: t.availableSlots[s.date] ?? [],
2797
- selectedSlotKey: s.slotKey,
2798
- onSelect: (l) => i(Vn(s, l.key)),
2799
- loading: r,
2800
- locale: c
2801
- }
2802
- );
2803
- }
2804
- function Jn({ value: e, onChange: t }) {
2805
- const { t: s } = Z("ui"), i = [
2806
- { value: "private", label: s("booking.insurance.private") },
2807
- { value: "public", label: s("booking.insurance.public") }
2808
- ];
2809
- return /* @__PURE__ */ S("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
2810
- /* @__PURE__ */ n("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: s("booking.insurance.heading") }),
2811
- /* @__PURE__ */ n(
2812
- Xt,
2813
- {
2814
- options: i,
2815
- value: e ?? "",
2816
- onValueChange: (r) => {
2817
- (r === "private" || r === "public") && t(r);
2818
- },
2819
- placeholder: s("booking.insurance.placeholder"),
2820
- "aria-label": s("booking.insurance.heading")
2821
- }
2822
- )
2823
- ] });
2824
- }
2825
- function Wn({
2826
- specialties: e,
2827
- value: t,
2828
- valueIds: s,
2829
- onChange: i,
2830
- onChangeIds: r,
2831
- pickerStyle: c = "select"
2832
- }) {
2833
- const { t: a } = Z("ui"), l = e.map((p) => ({
2834
- value: p.id,
2835
- label: p.label,
2836
- dir: "auto"
2837
- })), m = /* @__PURE__ */ n("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: a("booking.specialty.heading") });
2838
- return c === "multi-select" && r ? /* @__PURE__ */ S("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
2839
- m,
2840
- /* @__PURE__ */ n(
2841
- mn,
2842
- {
2843
- options: l,
2844
- value: s ?? [],
2845
- onChange: r,
2846
- placeholder: a("booking.specialty.placeholder"),
2847
- "aria-label": a("booking.specialty.heading"),
2848
- allowClear: !0
2849
- }
2850
- )
2851
- ] }) : c === "combobox" ? /* @__PURE__ */ S("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
2852
- m,
2853
- /* @__PURE__ */ n(
2854
- un,
2855
- {
2856
- options: l,
2857
- value: t ?? "",
2858
- onValueChange: (p) => i(p === "" ? "" : p),
2859
- placeholder: a("booking.specialty.placeholder"),
2860
- "aria-label": a("booking.specialty.heading"),
2861
- clearable: !0
2862
- }
2863
- )
2864
- ] }) : /* @__PURE__ */ S("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
2865
- m,
2866
- /* @__PURE__ */ n(
2867
- Xt,
2868
- {
2869
- options: l,
2870
- value: t ?? "",
2871
- onValueChange: (p) => i(p),
2872
- placeholder: a("booking.specialty.placeholder"),
2873
- "aria-label": a("booking.specialty.heading")
2874
- }
2875
- )
2876
- ] });
2877
- }
2878
- function Yn({
2879
- services: e,
2880
- value: t,
2881
- valueIds: s,
2882
- onChange: i,
2883
- onChangeIds: r,
2884
- pickerStyle: c,
2885
- compact: a,
2886
- showDuration: l
2887
- }) {
2888
- const { t: m } = Z("ui"), p = Un(), f = c ?? (a ? "select" : "cards"), v = e.map((d) => {
2889
- const { price: g, payment: I, paymentTone: u } = p(d);
2890
- return {
2891
- value: d.id,
2892
- // The practice's service name leads the label, so it decides the
2893
- // direction, even when the kit's duration is appended after it.
2894
- dir: "auto",
2895
- label: g || I || !l ? d.label : `${d.label} · ${m("booking.serviceSummary", {
2896
- minutes: d.durationMin
2897
- })}`,
2898
- ...g ? {
2899
- endContent: /* @__PURE__ */ n(Dn, { variant: "accentSoft", size: "lg", children: g })
2900
- } : {},
2901
- ...I ? { description: I, descriptionTone: u } : {}
2902
- };
2903
- }), h = /* @__PURE__ */ n("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: m("booking.service.heading") });
2904
- return f === "multi-select" && r ? /* @__PURE__ */ S("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
2905
- h,
2906
- /* @__PURE__ */ n(
2907
- mn,
2908
- {
2909
- options: v,
2910
- value: s ?? [],
2911
- onChange: r,
2912
- placeholder: m("booking.service.placeholder"),
2913
- "aria-label": m("booking.service.heading"),
2914
- allowClear: !0,
2915
- wrapOptionLabels: !0
2916
- }
2917
- )
2918
- ] }) : f === "combobox" ? /* @__PURE__ */ S("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
2919
- h,
2920
- /* @__PURE__ */ n(
2921
- un,
2922
- {
2923
- options: v,
2924
- value: t ?? "",
2925
- onValueChange: (d) => i(d === "" ? "" : d),
2926
- placeholder: m("booking.service.placeholder"),
2927
- "aria-label": m("booking.service.heading"),
2928
- clearable: !0,
2929
- wrapOptionLabels: !0
2930
- }
2931
- )
2932
- ] }) : f === "select" ? /* @__PURE__ */ S("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
2933
- h,
2934
- /* @__PURE__ */ n(
2935
- Xt,
2936
- {
2937
- options: v,
2938
- value: t ?? "",
2939
- onValueChange: (d) => i(d),
2940
- placeholder: m("booking.service.placeholder"),
2941
- "aria-label": m("booking.service.heading"),
2942
- showDescriptions: !0,
2943
- descriptionInName: !0,
2944
- wrapOptionLabels: !0
2945
- }
2946
- )
2947
- ] }) : /* @__PURE__ */ S("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
2948
- h,
2949
- /* @__PURE__ */ n(
2950
- ei,
2951
- {
2952
- services: e,
2953
- selectedServiceId: t,
2954
- onSelect: i,
2955
- showDuration: l
2956
- }
2957
- )
2958
- ] });
2959
- }
2960
- function Zn({
2961
- operators: e,
2962
- value: t,
2963
- valueIds: s,
2964
- onChange: i,
2965
- onChangeIds: r,
2966
- pickerStyle: c = "select"
2967
- }) {
2968
- const { t: a } = Z("ui"), l = /* @__PURE__ */ n("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: a("booking.operator.heading") });
2969
- if (c === "multi-select" && r) {
2970
- const p = e.map((f) => ({
2971
- value: f.id,
2972
- label: f.name,
2973
- dir: "auto"
2974
- }));
2975
- return /* @__PURE__ */ S("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
2976
- l,
2977
- /* @__PURE__ */ n(
2978
- mn,
2979
- {
2980
- options: p,
2981
- value: s ?? [],
2982
- onChange: r,
2983
- placeholder: a("booking.operator.all"),
2984
- "aria-label": a("booking.operator.heading"),
2985
- allowClear: !0
2986
- }
2987
- )
2988
- ] });
2989
- }
2990
- const m = [
2991
- { value: Re, label: a("booking.operator.all") },
2992
- ...e.map(
2993
- (p) => ({ value: p.id, label: p.name, dir: "auto" })
2994
- )
2995
- ];
2996
- return c === "combobox" ? /* @__PURE__ */ S("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
2997
- l,
2998
- /* @__PURE__ */ n(
2999
- un,
3000
- {
3001
- options: m,
3002
- value: t ?? Re,
3003
- onValueChange: (p) => i(p === "" ? Re : p),
3004
- placeholder: a("booking.operator.placeholder"),
3005
- "aria-label": a("booking.operator.heading"),
3006
- clearable: !0
3007
- }
3008
- )
3009
- ] }) : /* @__PURE__ */ S("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
3010
- l,
3011
- /* @__PURE__ */ n(
3012
- Xt,
3013
- {
3014
- options: m,
3015
- value: t ?? Re,
3016
- onValueChange: (p) => i(p),
3017
- placeholder: a("booking.operator.placeholder"),
3018
- "aria-label": a("booking.operator.heading")
3019
- }
3020
- )
3021
- ] });
3022
- }
3023
- function Xn({
3024
- customSlot: e
3025
- }) {
3026
- const { t } = Z("ui");
3027
- return e ? /* @__PURE__ */ n(ie, { children: e }) : /* @__PURE__ */ S(oe, { variant: "warning", children: [
3028
- /* @__PURE__ */ n(oe.Title, { as: "h4", children: t("booking.onboardingIncomplete.title") }),
3029
- /* @__PURE__ */ n(oe.Description, { children: t("booking.onboardingIncomplete.description") })
3030
- ] });
3031
- }
3032
- function gn({
3033
- nextAvailableDate: e,
3034
- onJump: t,
3035
- locale: s
3036
- }) {
3037
- const { t: i } = Z("ui"), r = $(() => {
3038
- try {
3039
- return new Intl.DateTimeFormat(s, { dateStyle: "long" }).format(
3040
- fe(e)
3041
- );
3042
- } catch {
3043
- return e;
3044
- }
3045
- }, [e, s]);
3046
- return /* @__PURE__ */ S(oe, { variant: "info", children: [
3047
- /* @__PURE__ */ n(oe.Description, { children: i("booking.nextAvailable.description", { date: r }) }),
3048
- /* @__PURE__ */ n(oe.Action, { children: /* @__PURE__ */ n(we, { intent: "secondary", size: "sm", onClick: t, children: i("booking.nextAvailable.cta") }) })
3049
- ] });
3050
- }
3051
- function oi({
3052
- codeVerified: e = !1,
3053
- handoverUrl: t,
3054
- handoverDelayMs: s,
3055
- onNavigate: i,
3056
- payment: r,
3057
- confirmationChannels: c,
3058
- snapshot: a,
3059
- operators: l,
3060
- specialties: m,
3061
- services: p,
3062
- locale: f,
3063
- mode: v,
3064
- showModify: h,
3065
- onReset: d,
3066
- onModify: g,
3067
- focusWasLost: I
3068
- }) {
3069
- const { t: u } = Z("ui"), F = M(null);
3070
- q(() => {
3071
- const A = F.current, L = document.activeElement, B = A == null ? void 0 : A.closest('[data-component="booking"]');
3072
- !r && !e || !A || (L && (B != null && B.contains(L)) || I()) && A.focus();
3073
- }, []);
3074
- const N = pn(c), x = qn(
3075
- N,
3076
- a.details.confirmationChannels
3077
- ).map(
3078
- (A) => u(`booking.confirmation.channel.${A}`)
3079
- ), O = r ? Zt(r.amountCents, r.currencyCode, f) : "", R = r ? u(
3080
- v === "demo" ? "booking.payment.paidDemo" : "booking.payment.paidBody",
3081
- { amount: O }
3082
- ) : e ? u(v === "demo" ? "booking.code.confirmedDemo" : "booking.code.confirmedBody") : v === "demo" ? u("booking.success.descriptionDemo") : x.length > 1 ? u("booking.success.descriptionMultiple", {
3083
- channels: x.join(" · ")
3084
- }) : u("booking.success.descriptionSingle", {
3085
- channel: x[0]
3086
- }), _ = $(() => {
3087
- if (a.date)
3088
- try {
3089
- return new Intl.DateTimeFormat(f, {
3090
- weekday: "long",
3091
- day: "numeric",
3092
- month: "long"
3093
- }).format(fe(a.date));
3094
- } catch {
3095
- return a.date;
3096
- }
3097
- }, [a.date, f]), b = $(() => {
3098
- const L = (a.operatorIds && a.operatorIds.length > 0 ? a.operatorIds : a.operatorId ? [a.operatorId] : []).filter((B) => B !== Re).map((B) => {
3099
- var D;
3100
- return (D = l.find((k) => k.id === B)) == null ? void 0 : D.name;
3101
- }).filter((B) => B !== void 0);
3102
- if (L.length === 0) return [];
3103
- try {
3104
- return new Intl.ListFormat(f === "en" ? "en-GB" : f, {
3105
- style: "long",
3106
- type: "conjunction"
3107
- }).formatToParts(L);
3108
- } catch {
3109
- return L.flatMap((B, D) => [
3110
- ...D > 0 ? [{ type: "literal", value: ", " }] : [],
3111
- { type: "element", value: B }
3112
- ]);
3113
- }
3114
- }, [a.operatorIds, a.operatorId, l, f]), C = a.specialtyId ? m.find((A) => A.id === a.specialtyId) : void 0, P = a.serviceId ? p.find((A) => A.id === a.serviceId) : void 0;
3115
- if (t) {
3116
- let A;
3117
- if (a.date)
3118
- try {
3119
- A = new Intl.DateTimeFormat(f, {
3120
- weekday: "short",
3121
- day: "numeric",
3122
- month: "short"
3123
- }).format(fe(a.date));
3124
- } catch {
3125
- A = a.date;
3126
- }
3127
- const L = (P == null ? void 0 : P.label) ?? (C == null ? void 0 : C.label), B = b.map(
3128
- (D, k) => D.type === "element" ? /* @__PURE__ */ n("bdi", { children: D.value }, k) : D.value
3129
- );
3130
- return /* @__PURE__ */ n(
3131
- qr,
3132
- {
3133
- url: t,
3134
- delayMs: Ur(s),
3135
- onNavigate: i,
3136
- date: A,
3137
- time: Yt(a.date, a.slot.time, f),
3138
- details: L || B.length > 0 ? /* @__PURE__ */ S(ie, { children: [
3139
- L ? /* @__PURE__ */ n("bdi", { children: L }) : null,
3140
- L && B.length > 0 ? " · " : null,
3141
- B
3142
- ] }) : void 0,
3143
- shouldTakeFocus: (D) => {
3144
- const k = document.activeElement, Y = D.closest('[data-component="booking"]');
3145
- return !!(k && (Y != null && Y.contains(k)) || I());
3146
- }
3147
- }
3148
- );
3149
- }
3150
- return /* @__PURE__ */ S(
3151
- "div",
3152
- {
3153
- "data-component": "booking-success",
3154
- className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
3155
- children: [
3156
- /* @__PURE__ */ S(oe, { variant: "success", children: [
3157
- /* @__PURE__ */ n(
3158
- oe.Title,
3159
- {
3160
- as: "h3",
3161
- ref: F,
3162
- tabIndex: r || e ? -1 : void 0,
3163
- className: r || e ? "ds:outline-none" : void 0,
3164
- children: u(
3165
- r ? v === "demo" ? "booking.payment.paidDemoTitle" : "booking.payment.paidTitle" : e ? "booking.code.confirmedHeading" : "booking.success.heading"
3166
- )
3167
- }
3168
- ),
3169
- /* @__PURE__ */ n(oe.Description, { children: R })
3170
- ] }),
3171
- /* @__PURE__ */ n("div", { className: "ds:rounded-[var(--radius-md)] ds:bg-[var(--secondary)] ds:p-[var(--spacing-md)]", children: /* @__PURE__ */ S("dl", { className: "ds:grid ds:grid-cols-[auto_minmax(0,1fr)] ds:gap-x-[var(--spacing-md)] ds:gap-y-[var(--spacing-xs)] ds:m-0", children: [
3172
- r && v !== "demo" ? /* @__PURE__ */ S(ie, { children: [
3173
- /* @__PURE__ */ n("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children: u("booking.payment.summaryPaid") }),
3174
- /* @__PURE__ */ n("dd", { className: "type-body ds:m-0 ds:text-[var(--foreground)]", children: O })
3175
- ] }) : null,
3176
- C ? /* @__PURE__ */ S(ie, { children: [
3177
- /* @__PURE__ */ n("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children: u("booking.success.summarySpecialty") }),
3178
- /* @__PURE__ */ n(
3179
- "dd",
3180
- {
3181
- dir: "auto",
3182
- className: "type-body ds:m-0 ds:text-[var(--foreground)]",
3183
- children: C.label
3184
- }
3185
- )
3186
- ] }) : null,
3187
- P ? /* @__PURE__ */ S(ie, { children: [
3188
- /* @__PURE__ */ n("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children: u("booking.success.summaryService") }),
3189
- /* @__PURE__ */ n(
3190
- "dd",
3191
- {
3192
- dir: "auto",
3193
- className: "type-body ds:m-0 ds:text-[var(--foreground)]",
3194
- children: P.label
3195
- }
3196
- )
3197
- ] }) : null,
3198
- _ ? /* @__PURE__ */ S(ie, { children: [
3199
- /* @__PURE__ */ n("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children: u("booking.success.summaryDate") }),
3200
- /* @__PURE__ */ n("dd", { className: "type-body ds:m-0 ds:text-[var(--foreground)]", children: _ })
3201
- ] }) : null,
3202
- /* @__PURE__ */ n("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children: u("booking.success.summaryTime") }),
3203
- /* @__PURE__ */ n("dd", { className: "type-body ds:m-0 ds:text-[var(--foreground)]", children: Yt(a.date, a.slot.time, f) }),
3204
- b.length > 0 ? /* @__PURE__ */ S(ie, { children: [
3205
- /* @__PURE__ */ n("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children: u("booking.success.summaryProvider") }),
3206
- /* @__PURE__ */ n("dd", { className: "type-body ds:m-0 ds:text-[var(--foreground)]", children: b.map(
3207
- (A, L) => A.type === "element" ? /* @__PURE__ */ n("bdi", { children: A.value }, L) : A.value
3208
- ) })
3209
- ] }) : null
3210
- ] }) }),
3211
- /* @__PURE__ */ S("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]", children: [
3212
- /* @__PURE__ */ n(we, { intent: "secondary", size: "md", onClick: d, children: u("booking.success.bookAnother") }),
3213
- h ? /* @__PURE__ */ n(we, { intent: "ghost", size: "md", onClick: g, children: u("booking.success.modifyBooking") }) : null
3214
- ] })
3215
- ]
3216
- }
3217
- );
3218
- }
3219
- function Qn({ customSlot: e }) {
3220
- const { t } = Z("ui");
3221
- return e ? /* @__PURE__ */ n(ie, { children: e }) : /* @__PURE__ */ n(
3222
- Mn,
3223
- {
3224
- variant: "no-results",
3225
- title: t("booking.emptyServices.title"),
3226
- description: t("booking.emptyServices.description")
3227
- }
3228
- );
3229
- }
3230
- const es = "data-booking-step-active", ai = `[${es}]`;
3231
- function re({
3232
- step: e,
3233
- active: t,
3234
- className: s,
3235
- id: i,
3236
- children: r
3237
- }) {
3238
- return /* @__PURE__ */ n(
3239
- "div",
3240
- {
3241
- id: i,
3242
- "data-booking-step": String(e),
3243
- ...t ? { [es]: "" } : null,
3244
- tabIndex: -1,
3245
- className: s ? `${s} ${Wt}` : Wt,
3246
- children: r
3247
- }
3248
- );
3249
- }
3250
- function hn(e, t) {
3251
- return t === "four-day-grid" ? e.filter((s) => s !== 6) : e;
3252
- }
3253
- function ci(e) {
3254
- const {
3255
- cascade: t,
3256
- inputs: s,
3257
- value: i,
3258
- onChange: r,
3259
- onSubmit: c,
3260
- emptyServicesSlot: a,
3261
- onboardingIncompleteSlot: l,
3262
- loadingDates: m,
3263
- loadingSlots: p,
3264
- onDateSelect: f,
3265
- onWindowChange: v,
3266
- datePickerStyle: h,
3267
- specialtyPickerStyle: d,
3268
- servicePickerStyle: g,
3269
- showServiceDuration: I,
3270
- operatorPickerStyle: u,
3271
- submitting: F,
3272
- locale: N,
3273
- detailsProps: w,
3274
- agentIdBase: x,
3275
- activeStep: O
3276
- } = e, { t: R } = Z("ui"), _ = St(O, h), b = (C, P) => ({
3277
- step: C,
3278
- active: C === _,
3279
- className: P
3280
- });
3281
- return /* @__PURE__ */ S("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
3282
- t.gates.insurance ? /* @__PURE__ */ n(re, { ...b(1), children: /* @__PURE__ */ n(
3283
- Jn,
3284
- {
3285
- value: i.insuranceType,
3286
- onChange: (C) => r(En(i, C))
3287
- }
3288
- ) }) : null,
3289
- t.gates.specialty ? /* @__PURE__ */ n(re, { ...b(2), children: /* @__PURE__ */ n(
3290
- Wn,
3291
- {
3292
- specialties: t.filtered.specialties,
3293
- value: i.specialtyId,
3294
- valueIds: i.specialtyIds,
3295
- onChange: (C) => r(Fn(i, C)),
3296
- onChangeIds: (C) => r(Rn(i, C)),
3297
- pickerStyle: d
3298
- }
3299
- ) }) : null,
3300
- t.gates.service ? /* @__PURE__ */ n(re, { ...b(3), children: t.filtered.services.length === 0 ? /* @__PURE__ */ n(Qn, { customSlot: a }) : /* @__PURE__ */ n(
3301
- Yn,
3302
- {
3303
- services: t.filtered.services,
3304
- value: i.serviceId,
3305
- valueIds: i.serviceIds,
3306
- onChange: (C) => r(_n(i, C)),
3307
- onChangeIds: (C) => r(Ln(i, C)),
3308
- pickerStyle: g,
3309
- showDuration: I
3310
- }
3311
- ) }) : null,
3312
- t.gates.onboardingIncomplete ? /* @__PURE__ */ n(Xn, { customSlot: l }) : null,
3313
- t.gates.operator ? /* @__PURE__ */ n(re, { ...b(4), children: /* @__PURE__ */ n(
3314
- Zn,
3315
- {
3316
- operators: t.filtered.operators,
3317
- value: i.operatorId,
3318
- valueIds: i.operatorIds,
3319
- onChange: (C) => r(Bn(i, C)),
3320
- onChangeIds: (C) => r(Pn(i, C)),
3321
- pickerStyle: u
3322
- }
3323
- ) }) : null,
3324
- t.gates.date ? /* @__PURE__ */ S(
3325
- re,
3326
- {
3327
- ...b(5, "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]"),
3328
- children: [
3329
- /* @__PURE__ */ n("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: R("booking.date.heading") }),
3330
- s.availableDates.length === 0 && s.nextAvailableDate ? /* @__PURE__ */ n(
3331
- gn,
3332
- {
3333
- nextAvailableDate: s.nextAvailableDate,
3334
- onJump: () => r(Qt(i, s.nextAvailableDate)),
3335
- locale: N
3336
- }
3337
- ) : Hn({
3338
- inputs: s,
3339
- value: i,
3340
- onChange: r,
3341
- onDateSelect: f,
3342
- onWindowChange: v,
3343
- loadingDates: m,
3344
- loadingSlots: p,
3345
- locale: N,
3346
- datePickerStyle: h,
3347
- agentIdBase: x
3348
- })
3349
- ]
3350
- }
3351
- ) : null,
3352
- t.gates.slot && i.date && h === "month-calendar" ? /* @__PURE__ */ S(
3353
- re,
3354
- {
3355
- ...b(6, "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]"),
3356
- children: [
3357
- /* @__PURE__ */ n("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: R("booking.slot.heading") }),
3358
- Gn({
3359
- inputs: s,
3360
- value: i,
3361
- onChange: r,
3362
- loadingSlots: p,
3363
- locale: N,
3364
- datePickerStyle: h
3365
- })
3366
- ]
3367
- }
3368
- ) : null,
3369
- t.gates.details && t.selectedSlot ? /* @__PURE__ */ n(re, { ...b(7), children: /* @__PURE__ */ n(
3370
- fn,
3371
- {
3372
- ...w,
3373
- value: i.details ?? {},
3374
- onChange: (C) => r({ ...i, details: C }),
3375
- onSubmit: c,
3376
- submitting: F,
3377
- defaultPhoneCountry: e.policy.country
3378
- }
3379
- ) }) : null
3380
- ] });
3381
- }
3382
- function Ne(e, t, s = {}) {
3383
- const {
3384
- cascade: i,
3385
- inputs: r,
3386
- value: c,
3387
- onChange: a,
3388
- onSubmit: l,
3389
- emptyServicesSlot: m,
3390
- onboardingIncompleteSlot: p,
3391
- loadingDates: f,
3392
- loadingSlots: v,
3393
- onDateSelect: h,
3394
- onWindowChange: d,
3395
- datePickerStyle: g,
3396
- specialtyPickerStyle: I,
3397
- servicePickerStyle: u,
3398
- showServiceDuration: F,
3399
- operatorPickerStyle: N,
3400
- submitting: w,
3401
- locale: x,
3402
- detailsProps: O,
3403
- policy: R,
3404
- agentIdBase: _
3405
- } = t;
3406
- switch (e) {
3407
- case 1:
3408
- return /* @__PURE__ */ n(
3409
- Jn,
3410
- {
3411
- value: c.insuranceType,
3412
- onChange: (b) => a(En(c, b))
3413
- }
3414
- );
3415
- case 2:
3416
- return /* @__PURE__ */ n(
3417
- Wn,
3418
- {
3419
- specialties: i.filtered.specialties,
3420
- value: c.specialtyId,
3421
- valueIds: c.specialtyIds,
3422
- onChange: (b) => a(Fn(c, b)),
3423
- onChangeIds: (b) => a(Rn(c, b)),
3424
- pickerStyle: I
3425
- }
3426
- );
3427
- case 3:
3428
- return i.filtered.services.length === 0 ? /* @__PURE__ */ n(Qn, { customSlot: m }) : i.gates.onboardingIncomplete ? /* @__PURE__ */ n(Xn, { customSlot: p }) : /* @__PURE__ */ n(
3429
- Yn,
3430
- {
3431
- services: i.filtered.services,
3432
- value: c.serviceId,
3433
- valueIds: c.serviceIds,
3434
- onChange: (b) => a(_n(c, b)),
3435
- onChangeIds: (b) => a(Ln(c, b)),
3436
- pickerStyle: u,
3437
- compact: s.compactService,
3438
- showDuration: F
3439
- }
3440
- );
3441
- case 4:
3442
- return /* @__PURE__ */ n(
3443
- Zn,
3444
- {
3445
- operators: i.filtered.operators,
3446
- value: c.operatorId,
3447
- valueIds: c.operatorIds,
3448
- onChange: (b) => a(Bn(c, b)),
3449
- onChangeIds: (b) => a(Pn(c, b)),
3450
- pickerStyle: N
3451
- }
3452
- );
3453
- case 5:
3454
- return r.availableDates.length === 0 && r.nextAvailableDate ? /* @__PURE__ */ n(
3455
- gn,
3456
- {
3457
- nextAvailableDate: r.nextAvailableDate,
3458
- onJump: () => a(Qt(c, r.nextAvailableDate)),
3459
- locale: x
3460
- }
3461
- ) : Hn({
3462
- inputs: r,
3463
- value: c,
3464
- onChange: a,
3465
- onDateSelect: h,
3466
- onWindowChange: d,
3467
- loadingDates: f,
3468
- loadingSlots: v,
3469
- locale: x,
3470
- datePickerStyle: g,
3471
- agentIdBase: _
3472
- });
3473
- case 6:
3474
- return Gn({
3475
- inputs: r,
3476
- value: c,
3477
- onChange: a,
3478
- loadingSlots: v,
3479
- locale: x,
3480
- datePickerStyle: g
3481
- });
3482
- case 7:
3483
- return i.selectedSlot ? /* @__PURE__ */ n(
3484
- fn,
3485
- {
3486
- ...O,
3487
- value: c.details ?? {},
3488
- onChange: (b) => a({ ...c, details: b }),
3489
- onSubmit: l,
3490
- submitting: w,
3491
- defaultPhoneCountry: R.country
3492
- }
3493
- ) : null;
3494
- /* c8 ignore next 2 */
3495
- default:
3496
- return null;
3497
- }
3498
- }
3499
- function en() {
3500
- const { t: e } = Z("ui");
3501
- return $(
3502
- () => ({
3503
- 1: e("booking.insurance.heading"),
3504
- 2: e("booking.specialty.heading"),
3505
- 3: e("booking.service.heading"),
3506
- 4: e("booking.operator.heading"),
3507
- 5: e("booking.date.heading"),
3508
- 6: e("booking.slot.heading"),
3509
- 7: e("booking.details.heading")
3510
- }),
3511
- [e]
3512
- );
3513
- }
3514
- function St(e, t) {
3515
- return t === "four-day-grid" && e === 6 ? 5 : e;
3516
- }
3517
- function di(e) {
3518
- const { cascade: t, value: s, activeStep: i, setActiveStep: r, datePickerStyle: c } = e, a = en(), { t: l } = Z("ui"), m = l("booking.operator.all"), p = $(
3519
- () => hn(t.visibleSteps, c),
3520
- [t.visibleSteps, c]
3521
- ), f = St(i, c), v = Math.max(0, p.indexOf(f)), h = $(
3522
- () => p.map((d) => ({
3523
- label: a[d],
3524
- summary: ts(d, s, t, m),
3525
- status: li(d, s, t),
3526
- content: /* @__PURE__ */ n(re, { step: d, active: d === f, children: Ne(d, e, { compactService: !0 }) })
3527
- })),
3528
- [
3529
- p,
3530
- s,
3531
- a,
3532
- t,
3533
- e,
3534
- f,
3535
- m
3536
- ]
3537
- );
3538
- return /* @__PURE__ */ n(
3539
- bs,
3540
- {
3541
- activeStep: v,
3542
- steps: h,
3543
- onStepChange: (d) => {
3544
- const g = p[d];
3545
- g && r(g);
3546
- }
3547
- }
3548
- );
3549
- }
3550
- function li(e, t, s) {
3551
- return je(e, t) && e < s.currentStep ? "completed" : e <= s.currentStep ? "unlocked" : void 0;
3552
- }
3553
- function wn(e, t) {
3554
- return e !== 4 ? je(e, t) : t.operatorIds && t.operatorIds.length > 0 ? !0 : $n(t) !== void 0;
3555
- }
3556
- function on(e, t) {
3557
- const s = e.map((i) => {
3558
- var r;
3559
- return (r = t.find((c) => c.id === i)) == null ? void 0 : r.label;
3560
- }).filter((i) => i !== void 0);
3561
- return s.length > 0 ? s.join(", ") : void 0;
3562
- }
3563
- function ts(e, t, s, i) {
3564
- var r;
3565
- if (je(e, t))
3566
- switch (e) {
3567
- case 1:
3568
- return t.insuranceType;
3569
- case 2:
3570
- return on(
3571
- et(t),
3572
- s.filtered.specialties
3573
- );
3574
- case 3:
3575
- return on(Ue(t), s.filtered.services);
3576
- case 4: {
3577
- const a = dn(t).filter((m) => m !== Re), l = on(
3578
- a,
3579
- s.filtered.operators.map((m) => ({
3580
- id: m.id,
3581
- label: m.name
3582
- }))
3583
- );
3584
- return l !== void 0 ? l : a.length === 0 ? i : void 0;
3585
- }
3586
- case 5:
3587
- return t.date;
3588
- case 6:
3589
- return (r = s.selectedSlot) == null ? void 0 : r.time;
3590
- case 7:
3591
- return;
3592
- }
3593
- }
3594
- function ui(e) {
3595
- const { cascade: t, value: s, activeStep: i, setActiveStep: r } = e, { t: c } = Z("ui"), a = en(), l = c("booking.operator.all"), m = `${at()}-filter`, p = St(i, e.datePickerStyle), f = t.visibleSteps.filter(
3596
- (d) => d === 1 || d === 2 || d === 3 || d === 4
3597
- ), v = f.some(
3598
- (d) => !je(d, s)
3599
- ), h = f.some(
3600
- (d) => d === i
3601
- ) ? i : f.find((d) => !je(d, s));
3602
- return /* @__PURE__ */ S("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
3603
- f.length > 0 ? /* @__PURE__ */ n(
3604
- "div",
3605
- {
3606
- role: "group",
3607
- "aria-label": c("booking.filtersLabel"),
3608
- className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]",
3609
- children: f.map((d) => {
3610
- const g = ts(
3611
- d,
3612
- s,
3613
- t,
3614
- l
3615
- ), I = d === h, u = je(d, s);
3616
- return /* @__PURE__ */ n(
3617
- we,
3618
- {
3619
- intent: I ? "primary" : "outline",
3620
- size: "sm",
3621
- endIcon: /* @__PURE__ */ n(
3622
- Ss,
3623
- {
3624
- "aria-hidden": "true",
3625
- className: I ? "ds:rotate-180" : void 0
3626
- }
3627
- ),
3628
- "aria-expanded": u ? I : void 0,
3629
- "aria-controls": u && I ? m : void 0,
3630
- "aria-current": !u && I ? "step" : void 0,
3631
- onClick: () => r(
3632
- u && I ? t.currentStep : d
3633
- ),
3634
- children: g ? /* @__PURE__ */ S(ie, { children: [
3635
- a[d],
3636
- ": ",
3637
- g
3638
- ] }) : a[d]
3639
- },
3640
- `csc-${d}`
3641
- );
3642
- })
3643
- }
3644
- ) : null,
3645
- h !== void 0 ? /* @__PURE__ */ n(
3646
- re,
3647
- {
3648
- step: h,
3649
- active: h === p,
3650
- id: m,
3651
- children: Ne(h, e, { compactService: !0 })
3652
- }
3653
- ) : null,
3654
- !v && t.gates.date ? (
3655
- // four-day-grid embeds slots inline with the day strip — the
3656
- // historic 2-col date|slot split collapses to a single column
3657
- // so the picker spans the full width instead of orphaning an
3658
- // empty right cell.
3659
- e.datePickerStyle === "four-day-grid" ? /* @__PURE__ */ n(re, { step: 5, active: p === 5, children: Ne(5, e) }) : /* @__PURE__ */ S("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:md:grid-cols-2", children: [
3660
- /* @__PURE__ */ n(
3661
- re,
3662
- {
3663
- step: 5,
3664
- active: p === 5,
3665
- className: "ds:min-w-0",
3666
- children: Ne(5, e)
3667
- }
3668
- ),
3669
- s.date ? /* @__PURE__ */ n(
3670
- re,
3671
- {
3672
- step: 6,
3673
- active: p === 6,
3674
- className: "ds:min-w-0",
3675
- children: Ne(6, e)
3676
- }
3677
- ) : /* @__PURE__ */ n("div", { className: "ds:min-w-0" })
3678
- ] })
3679
- ) : null,
3680
- t.gates.details ? /* @__PURE__ */ n(re, { step: 7, active: p === 7, children: Ne(7, e) }) : null
3681
- ] });
3682
- }
3683
- function mi(e) {
3684
- const { cascade: t, datePickerStyle: s, activeStep: i } = e, r = St(i, s), c = t.visibleSteps.filter(
3685
- (l) => l === 1 || l === 2 || l === 3 || l === 4
3686
- );
3687
- return /* @__PURE__ */ S("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
3688
- /* @__PURE__ */ S(
3689
- "div",
3690
- {
3691
- className: s === "four-day-grid" ? "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]" : "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:md:grid-cols-2",
3692
- children: [
3693
- /* @__PURE__ */ n("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: c.map((l) => /* @__PURE__ */ n(re, { step: l, active: l === r, children: Ne(l, e, { compactService: !0 }) }, `fbf-${l}`)) }),
3694
- /* @__PURE__ */ S("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
3695
- t.gates.date ? /* @__PURE__ */ n(re, { step: 5, active: r === 5, children: Ne(5, e) }) : null,
3696
- t.gates.slot && e.value.date && s === "month-calendar" ? /* @__PURE__ */ n(re, { step: 6, active: r === 6, children: Ne(6, e) }) : null
3697
- ] })
3698
- ]
3699
- }
3700
- ),
3701
- t.gates.details ? /* @__PURE__ */ n(re, { step: 7, active: r === 7, children: Ne(7, e) }) : null
3702
- ] });
3703
- }
3704
- function pi(e) {
3705
- const { cascade: t, value: s, activeStep: i, setActiveStep: r, datePickerStyle: c } = e, { t: a } = Z("ui"), l = en(), m = $(
3706
- () => hn(t.visibleSteps, c),
3707
- [t.visibleSteps, c]
3708
- ), p = St(i, c), f = Math.max(0, m.indexOf(p)), v = m.length, h = $(
3709
- () => m.map((u) => ({ label: l[u] })),
3710
- [m, l]
3711
- ), d = f > 0, g = p === 5 && c === "four-day-grid", I = f < v - 1 && je(p, s) && (!g || je(6, s));
3712
- return /* @__PURE__ */ S("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
3713
- /* @__PURE__ */ n(ys, { activeStep: f, steps: h }),
3714
- /* @__PURE__ */ n(re, { step: p, active: !0, children: Ne(p, e, { compactService: !0 }) }),
3715
- /* @__PURE__ */ S("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
3716
- /* @__PURE__ */ n(
3717
- we,
3718
- {
3719
- intent: "ghost",
3720
- size: "md",
3721
- disabled: !d,
3722
- onClick: () => {
3723
- const u = m[f - 1];
3724
- u && r(u);
3725
- },
3726
- children: a("booking.actions.back")
3727
- }
3728
- ),
3729
- p < 7 ? /* @__PURE__ */ n(
3730
- we,
3731
- {
3732
- intent: "primary",
3733
- size: "md",
3734
- disabled: !I,
3735
- onClick: () => {
3736
- const u = m[f + 1];
3737
- u && r(u);
3738
- },
3739
- children: a("booking.actions.next")
3740
- }
3741
- ) : null
3742
- ] })
3743
- ] });
3744
- }
3745
- const fi = [], gi = [];
3746
- function hi() {
3747
- return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
3748
- }
3749
- const vi = Cn(
3750
- ({
3751
- variant: e = "inline-list",
3752
- country: t,
3753
- // No default — the cascade engine treats `undefined` as "auto-on
3754
- // when `specialties` has items" so consumers who pass specialty
3755
- // data without the explicit flag still get the step.
3756
- useSpecialties: s,
3757
- allowOperatorSelection: i = !1,
3758
- lockedOperatorId: r,
3759
- operatorsByService: c = !1,
3760
- autoSelectSingleService: a = !1,
3761
- specialties: l,
3762
- services: m,
3763
- operators: p,
3764
- availableDates: f,
3765
- availableSlots: v,
3766
- nextAvailableDate: h,
3767
- hideEmail: d = !1,
3768
- emailOptional: g = !1,
3769
- requireCodiceFiscale: I,
3770
- requireDateOfBirth: u,
3771
- requireInsuranceNumber: F,
3772
- billingInDetails: N = !1,
3773
- paymentNoticeStyle: w = "highlighted",
3774
- showNote: x,
3775
- showReturningPatientFlag: O,
3776
- privacyPolicyUrl: R,
3777
- termsUrl: _,
3778
- practiceConsent: b,
3779
- paymentTermsUrl: C,
3780
- paymentState: P,
3781
- handoverDelayMs: A,
3782
- onNavigate: L,
3783
- renderPayment: B,
3784
- renderPaymentCompletion: D,
3785
- validateCodiceFiscale: k,
3786
- validateInsuranceNumber: Y,
3787
- confirmationChannels: X,
3788
- defaultConfirmationChannels: _e,
3789
- singleConfirmationChannel: Le,
3790
- value: E,
3791
- onChange: J,
3792
- onSubmit: W,
3793
- codeStep: Q,
3794
- onStepChange: Be,
3795
- onDateSelect: tt,
3796
- onWindowChange: ge,
3797
- datePickerStyle: te = "month-calendar",
3798
- specialtyPickerStyle: me,
3799
- servicePickerStyle: Se,
3800
- showServiceDuration: xe = !0,
3801
- operatorPickerStyle: Te,
3802
- loadingDates: ce,
3803
- loadingSlots: Pe,
3804
- submitting: ee,
3805
- submitError: le,
3806
- mode: Dt = "live",
3807
- showModifyOnSuccess: Ve = !0,
3808
- surface: nt = "flat",
3809
- emptyServicesSlot: z,
3810
- onboardingIncompleteSlot: Ae,
3811
- "aria-label": tn,
3812
- id: He,
3813
- className: Mt,
3814
- onFocus: ct,
3815
- onBlur: Ge,
3816
- ...De
3817
- }, nn) => {
3818
- var Nt, wt, Ct;
3819
- const { t: ae, i18n: Ot } = Z("ui"), ue = e ?? "inline-list", $e = Ot.language ?? "en", Me = l ?? fi, he = p ?? gi;
3820
- q(() => {
3821
- const o = mr(E, {
3822
- useSpecialties: s,
3823
- lockedOperatorId: r,
3824
- autoSelectSingleService: a,
3825
- specialties: Me,
3826
- services: m
3827
- });
3828
- (o.specialtyId !== E.specialtyId || o.operatorId !== E.operatorId || o.serviceId !== E.serviceId) && J(o);
3829
- }, [
3830
- r,
3831
- s,
3832
- a,
3833
- Me,
3834
- m
3835
- ]);
3836
- const V = $(
3837
- () => ur({
3838
- country: t,
3839
- useSpecialties: s,
3840
- allowOperatorSelection: i,
3841
- lockedOperatorId: r,
3842
- operatorsByService: c,
3843
- specialties: Me,
3844
- services: m,
3845
- operators: he,
3846
- availableSlots: v,
3847
- value: E
3848
- }),
3849
- [
3850
- t,
3851
- s,
3852
- i,
3853
- r,
3854
- c,
3855
- a,
3856
- Me,
3857
- m,
3858
- he,
3859
- f,
3860
- v,
3861
- E
3862
- ]
3863
- ), dt = $(
3864
- () => [
3865
- JSON.stringify(E.insuranceType),
3866
- JSON.stringify(et(E)),
3867
- JSON.stringify(Ue(E)),
3868
- JSON.stringify(dn(E)),
3869
- JSON.stringify(E.date),
3870
- JSON.stringify(E.slotKey)
3871
- ],
3872
- [E]
3873
- ), st = ue === "progress", rt = ke(
3874
- (o) => {
3875
- if (o === 4 && V.visibleSteps.includes(4) && dn(E).length === 0)
3876
- return Math.min(4, V.currentStep);
3877
- if (!st) return V.currentStep;
3878
- const y = V.visibleSteps.find(
3879
- (T) => T > o && !wn(T, E)
3880
- );
3881
- return y === void 0 ? V.currentStep : Math.min(y, V.currentStep);
3882
- },
3883
- [st, V.visibleSteps, V.currentStep, E]
3884
- ), [de, Oe] = H(
3885
- V.currentStep
3886
- ), Je = M(dt), We = M(V.visibleSteps);
3887
- q(() => {
3888
- const o = Je.current, y = We.current;
3889
- Je.current = dt, We.current = V.visibleSteps;
3890
- const T = dt.findIndex(
3891
- (ye, vn) => ye !== o[vn]
3892
- );
3893
- if (T !== -1) {
3894
- Oe(rt(T + 1));
3895
- return;
3896
- }
3897
- const U = st ? V.visibleSteps.find(
3898
- (ye) => ye < de && !y.includes(ye) && !wn(ye, E)
3899
- ) : void 0;
3900
- if (U !== void 0) {
3901
- Oe(U);
3902
- return;
3903
- }
3904
- V.visibleSteps.includes(de) || Oe(V.currentStep);
3905
- }, [
3906
- dt,
3907
- rt,
3908
- st,
3909
- V.currentStep,
3910
- V.visibleSteps,
3911
- de,
3912
- E
3913
- ]);
3914
- const pe = M(null), qe = $(
3915
- () => hn(V.visibleSteps, te),
3916
- [V.visibleSteps, te]
3917
- ), Et = en(), [Ee, ze] = H(""), Ye = M(null), Ie = M(null);
3918
- q(() => {
3919
- const o = St(de, te);
3920
- if (Ie.current === null) {
3921
- Ie.current = o;
3922
- return;
3923
- }
3924
- if (Ie.current === o) return;
3925
- Ie.current = o;
3926
- const y = qe.indexOf(o);
3927
- ze(
3928
- y === -1 ? "" : ae("booking.stepAnnouncement", {
3929
- current: y + 1,
3930
- total: qe.length,
3931
- label: Et[o]
3932
- })
3933
- );
3934
- const T = Ye.current;
3935
- if (!T || T.isConnected) return;
3936
- const U = pe.current;
3937
- if (!U) return;
3938
- const ye = document.activeElement;
3939
- if (!(ye === null || ye === document.body || !U.contains(ye))) return;
3940
- const $t = U.querySelector(ai) ?? U;
3941
- if ($t.focus({ preventScroll: !0 }), typeof $t.scrollIntoView == "function")
3942
- try {
3943
- $t.scrollIntoView({
3944
- behavior: hi() ? "auto" : "smooth",
3945
- block: "nearest"
3946
- });
3947
- } catch {
3948
- $t.scrollIntoView();
3949
- }
3950
- }, [de, te, qe, Et, ae]);
3951
- const K = Br({
3952
- services: m,
3953
- value: E,
3954
- availableSlots: v,
3955
- onSubmit: W,
3956
- onChange: J,
3957
- paymentState: P,
3958
- submitting: ee,
3959
- paymentTermsUrl: C,
3960
- renderPayment: B,
3961
- codeStep: Q
3962
- }), j = K.status, lt = K.submit, it = M(K.reset);
3963
- it.current = K.reset;
3964
- const ut = M(!1), [Ft, Rt] = H(!1);
3965
- q(() => {
3966
- var y, T;
3967
- if (!ut.current || j !== "idle") return;
3968
- ut.current = !1;
3969
- const o = (y = pe.current) == null ? void 0 : y.querySelector(
3970
- 'form input:not([type="hidden"]):not(:disabled), form select:not(:disabled), form textarea:not(:disabled)'
3971
- );
3972
- o && (o.focus({ preventScroll: !0 }), (T = o.scrollIntoView) == null || T.call(o, { block: "nearest" }));
3973
- }, [j]);
3974
- const Ze = at(), mt = M(null), pt = M(null), _t = ((Nt = K.state) == null ? void 0 : Nt.status) === "failed", ft = K.state && "phase" in K.state && K.state.phase === "completion";
3975
- q(() => {
3976
- var o, y;
3977
- if (j === "payment") {
3978
- const T = document.activeElement;
3979
- (!ft || !T || T === document.body || !((o = pe.current) != null && o.contains(T))) && ((y = mt.current) == null || y.focus());
3980
- }
3981
- }, [j, ft]), q(() => {
3982
- var o;
3983
- j === "payment" && _t && ((o = pt.current) == null || o.focus());
3984
- }, [j, _t]), ss(nn, () => pe.current, []);
3985
- const Fe = j === "success" ? 8 : j === "payment" || j === "code" ? 7 : V.currentStep, Lt = M(null), gt = M(0);
3986
- an(() => {
3987
- var o;
3988
- (j === "submitting" || j === "code" || j === "payment") && (gt.current = ((o = pe.current) == null ? void 0 : o.offsetHeight) ?? 0);
3989
- }), an(() => {
3990
- const o = pe.current;
3991
- Fe !== 8 || !o || gt.current === 0 || (o.style.setProperty(
3992
- "--booking-held-height",
3993
- `${gt.current}px`
3994
- ), gt.current = 0);
3995
- }, [Fe]), q(() => {
3996
- if (Fe === Lt.current) return;
3997
- Lt.current = Fe, Be == null || Be(Fe);
3998
- const o = pe.current;
3999
- if (Fe !== 8 || !o) return;
4000
- const y = () => o.style.removeProperty("--booking-held-height");
4001
- Kn(o, "start") ? Fr(y) : y();
4002
- }, [Fe, Be]);
4003
- const Xe = M({ activeStep: de, cascade: V, submitState: j });
4004
- q(() => {
4005
- Xe.current = { activeStep: de, cascade: V, submitState: j };
4006
- }, [de, V, j]);
4007
- const Bt = $(
4008
- () => ({
4009
- getVariant: () => ue,
4010
- getCurrentStep: () => {
4011
- const o = Xe.current;
4012
- return o.submitState === "success" ? 8 : o.submitState === "payment" || o.submitState === "code" ? 7 : o.activeStep;
4013
- },
4014
- reset: () => {
4015
- Xe.current.submitState === "payment" || Xe.current.submitState === "code" || (J({}), it.current(), Oe(1));
4016
- },
4017
- goToStep: (o) => {
4018
- const y = Xe.current, T = y.cascade.visibleSteps.includes(o), U = y.cascade.currentStep, ye = y.submitState === "payment" || y.submitState === "code" ? 7 : !T || o > U ? U : o;
4019
- Xe.current = { ...y, activeStep: ye }, Oe(ye);
4020
- }
4021
- }),
4022
- [ue, J]
4023
- );
4024
- rs(rr, Bt, He);
4025
- const ht = tn ?? ae("booking.regionLabel"), ve = K.snapshot, Pt = j === "success" && ve ? /* @__PURE__ */ n(
4026
- oi,
4027
- {
4028
- codeVerified: K.codeVerified,
4029
- handoverUrl: Kr(K.redirectUrl),
4030
- handoverDelayMs: A,
4031
- onNavigate: L,
4032
- payment: ve.payment,
4033
- confirmationChannels: X,
4034
- snapshot: {
4035
- ...ve.value,
4036
- slot: ve.slot,
4037
- details: ve.details,
4038
- serviceId: ((wt = ve.payment) == null ? void 0 : wt.serviceId) ?? ve.slot.serviceId ?? ve.value.serviceId
4039
- },
4040
- operators: he,
4041
- specialties: Me,
4042
- services: m,
4043
- locale: $e,
4044
- mode: Dt,
4045
- showModify: Ve && !ve.payment && !K.codeVerified,
4046
- onReset: () => Bt.reset(),
4047
- focusWasLost: () => {
4048
- const o = Ye.current, y = document.activeElement;
4049
- return !!(o && !o.isConnected) && (!y || y === document.body);
4050
- },
4051
- onModify: () => {
4052
- it.current(), Oe(7);
4053
- }
4054
- }
4055
- ) : null, ne = j === "code" && K.codeStep ? /* @__PURE__ */ n(
4056
- Rr,
4057
- {
4058
- ...K.codeStep,
4059
- ...Q,
4060
- onVerified: K.completeCode,
4061
- onBusyChange: Rt
4062
- }
4063
- ) : null, vt = K.activeSession, se = K.state, be = vt && se ? {
4064
- session: vt,
4065
- payment: vt.payment,
4066
- state: se,
4067
- billing: (Ct = K.snapshot) == null ? void 0 : Ct.details.billing
4068
- } : void 0, Qe = se && "phase" in se && se.phase === "completion", Vt = j === "payment" && be ? /* @__PURE__ */ S(
4069
- "section",
4070
- {
4071
- "aria-labelledby": Ze,
4072
- "data-component": "booking-payment",
4073
- "data-payment-status": be.state.status,
4074
- className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
4075
- children: [
4076
- /* @__PURE__ */ n(
4077
- "h3",
4078
- {
4079
- ref: mt,
4080
- id: Ze,
4081
- tabIndex: -1,
4082
- className: "type-title-card ds:m-0",
4083
- children: ae(
4084
- Qe ? "booking.payment.confirming" : "booking.payment.heading"
4085
- )
4086
- }
4087
- ),
4088
- Qe ? null : /* @__PURE__ */ n("p", { className: "type-body ds:m-0", children: ae("booking.payment.noticeBody", {
4089
- amount: Zt(
4090
- be.payment.amountCents,
4091
- be.payment.currencyCode,
4092
- $e
4093
- )
4094
- }) }),
4095
- /* @__PURE__ */ n(
4096
- "p",
4097
- {
4098
- role: "status",
4099
- className: be.state.status === "processing" ? "type-body ds:m-0 ds:flex ds:items-center ds:gap-[var(--spacing-sm)]" : "ds:sr-only",
4100
- children: be.state.status === "processing" ? /* @__PURE__ */ S(ie, { children: [
4101
- /* @__PURE__ */ n(An, { variant: "pulse", size: "lg", "aria-hidden": "true" }),
4102
- /* @__PURE__ */ n("span", { children: ae(
4103
- Qe ? "booking.payment.confirming" : "booking.payment.processing"
4104
- ) })
4105
- ] }) : null
4106
- }
4107
- ),
4108
- be.state.status === "failed" ? /* @__PURE__ */ n(
4109
- oe,
4110
- {
4111
- ref: pt,
4112
- variant: "error",
4113
- tabIndex: -1,
4114
- className: Wt,
4115
- children: /* @__PURE__ */ n(oe.Description, { children: be.state.error ?? ae(
4116
- Qe ? "booking.payment.completionFailed" : "booking.payment.failed"
4117
- ) })
4118
- }
4119
- ) : null,
4120
- Qe ? D == null ? void 0 : D(be) : B == null ? void 0 : B(be)
4121
- ]
4122
- }
4123
- ) : null, xt = $(() => {
4124
- const o = new Set(Ue(E)), y = m.filter((T) => o.has(T.id)).map((T) => {
4125
- var U;
4126
- return {
4127
- label: T.label,
4128
- text: ((U = T.criticalInformationToAccept) == null ? void 0 : U.trim()) ?? ""
4129
- };
4130
- }).filter((T) => T.text.length > 0);
4131
- if (y.length !== 0)
4132
- return y.length === 1 ? y[0].text : y.map((T) => `${T.label}: ${T.text}`).join(`
4133
-
4134
- `);
4135
- }, [m, E]), It = $(() => {
4136
- if (j === "success" || j === "payment") return null;
4137
- const o = ue === "accordion" ? di : ue === "calendar" ? ui : ue === "flexible" ? mi : ue === "progress" ? pi : ci, y = {
4138
- cascade: V,
4139
- inputs: {
4140
- specialties: Me,
4141
- services: m,
4142
- operators: he,
4143
- availableDates: f,
4144
- availableSlots: v,
4145
- nextAvailableDate: h
4146
- },
4147
- value: E,
4148
- onChange: J,
4149
- onSubmit: lt,
4150
- policy: { country: t, lockedOperatorId: r },
4151
- detailsProps: {
4152
- hideEmail: d,
4153
- emailOptional: g,
4154
- requireCodiceFiscale: I,
4155
- requireDateOfBirth: u,
4156
- requireInsuranceNumber: F,
4157
- insuranceType: E.insuranceType,
4158
- showNote: x,
4159
- showReturningPatientFlag: O,
4160
- privacyPolicyUrl: R,
4161
- termsUrl: _,
4162
- practiceConsent: b,
4163
- criticalInformationToAccept: xt,
4164
- locked: j === "code",
4165
- payment: K.payment,
4166
- paymentTermsUrl: C,
4167
- paymentBlocked: K.blocked,
4168
- billingInDetails: N,
4169
- paymentNoticeStyle: w,
4170
- validateCodiceFiscale: k,
4171
- validateInsuranceNumber: Y,
4172
- confirmationChannels: X,
4173
- defaultConfirmationChannels: _e,
4174
- singleConfirmationChannel: Le,
4175
- submitError: le ?? (j === "error" ? ae("booking.payment.submitFailed") : void 0)
4176
- },
4177
- emptyServicesSlot: z,
4178
- onboardingIncompleteSlot: Ae,
4179
- loadingDates: ce,
4180
- loadingSlots: Pe,
4181
- onDateSelect: tt,
4182
- onWindowChange: ge,
4183
- datePickerStyle: te,
4184
- specialtyPickerStyle: me,
4185
- servicePickerStyle: Se,
4186
- showServiceDuration: xe,
4187
- operatorPickerStyle: Te,
4188
- submitting: ee || j === "submitting",
4189
- locale: $e,
4190
- activeStep: de,
4191
- setActiveStep: Oe,
4192
- agentIdBase: He
4193
- };
4194
- return /* @__PURE__ */ n(o, { ...y });
4195
- }, [
4196
- j,
4197
- K.payment,
4198
- K.blocked,
4199
- C,
4200
- ae,
4201
- ue,
4202
- V,
4203
- Me,
4204
- m,
4205
- he,
4206
- f,
4207
- v,
4208
- h,
4209
- E,
4210
- J,
4211
- lt,
4212
- t,
4213
- r,
4214
- d,
4215
- g,
4216
- I,
4217
- u,
4218
- F,
4219
- N,
4220
- w,
4221
- le,
4222
- x,
4223
- O,
4224
- R,
4225
- _,
4226
- b,
4227
- xt,
4228
- k,
4229
- Y,
4230
- X,
4231
- _e,
4232
- Le,
4233
- z,
4234
- Ae,
4235
- ce,
4236
- Pe,
4237
- tt,
4238
- ge,
4239
- te,
4240
- me,
4241
- Se,
4242
- xe,
4243
- Te,
4244
- ee,
4245
- $e,
4246
- de,
4247
- He
4248
- ]);
4249
- return /* @__PURE__ */ S(
4250
- "div",
4251
- {
4252
- ref: pe,
4253
- role: "region",
4254
- "aria-label": ht,
4255
- id: He,
4256
- "data-component": "booking",
4257
- "data-component-id": He,
4258
- "data-variant": ue,
4259
- className: Hr({
4260
- variant: ue,
4261
- surface: nt,
4262
- className: Mt
4263
- }),
4264
- tabIndex: -1,
4265
- onFocus: (o) => {
4266
- Ye.current = o.target, ct == null || ct(o);
4267
- },
4268
- onBlur: (o) => {
4269
- const y = o.target;
4270
- window.setTimeout(() => {
4271
- var U;
4272
- const T = document.activeElement;
4273
- Ye.current === y && y.isConnected && !(T && ((U = pe.current) != null && U.contains(T))) && (Ye.current = null);
4274
- }), Ge == null || Ge(o);
4275
- },
4276
- ...De,
4277
- children: [
4278
- /* @__PURE__ */ n("div", { role: "status", className: "ds:sr-only", children: Ee }),
4279
- /* @__PURE__ */ S(
4280
- "div",
4281
- {
4282
- className: [
4283
- "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]",
4284
- "ds:rounded-[var(--radius-md)]",
4285
- "ds:bg-[color-mix(in_srgb,var(--primary)_35%,var(--background))]",
4286
- "ds:bg-[image:var(--gradient-hero-brand)]",
4287
- "ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]",
4288
- "ds:pt-[var(--spacing-md)] ds:pb-[var(--spacing-md)]"
4289
- ].join(" "),
4290
- children: [
4291
- /* @__PURE__ */ n("h2", { className: "type-title-card ds:text-[var(--foreground)] ds:m-0", children: ae("booking.regionLabel") }),
4292
- /* @__PURE__ */ n("p", { className: "type-body-sm ds:text-[var(--foreground)] ds:m-0", children: ae("booking.headingSubtitle") })
4293
- ]
4294
- }
4295
- ),
4296
- K.cancelled ? /* @__PURE__ */ n(oe, { variant: "info", children: /* @__PURE__ */ n(oe.Description, { children: ae("booking.payment.cancelled") }) }) : null,
4297
- Pt ?? Vt ?? /* @__PURE__ */ S(ie, { children: [
4298
- Q ? /* @__PURE__ */ n(
4299
- "fieldset",
4300
- {
4301
- "data-slot": "booking-form",
4302
- disabled: ne ? !0 : void 0,
4303
- className: "ds:m-0 ds:min-w-0 ds:border-0 ds:p-0",
4304
- children: It
4305
- }
4306
- ) : It,
4307
- ne ? /* @__PURE__ */ S(ie, { children: [
4308
- /* @__PURE__ */ n("div", { className: "ds:flex ds:justify-end", children: /* @__PURE__ */ n(
4309
- we,
4310
- {
4311
- type: "button",
4312
- intent: "ghost",
4313
- size: "md",
4314
- disabled: Ft,
4315
- onClick: () => {
4316
- ut.current = !0, it.current();
4317
- },
4318
- children: ae("booking.actions.change")
4319
- }
4320
- ) }),
4321
- ne
4322
- ] }) : null
4323
- ] })
4324
- ]
4325
- }
4326
- );
4327
- }
4328
- );
4329
- vi.displayName = "Booking";
4330
- export {
4331
- vi as B,
4332
- cn as C,
4333
- Re as O,
4334
- rr as b
4335
- };
4336
- //# sourceMappingURL=booking-C0FoW8Yx.js.map