@alfadocs/ui-kit-debug 1.128.0 → 1.130.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 (300) hide show
  1. package/dist/_chunks/{appointment-card-0PebvrOS.js → appointment-card-vbUsDh70.js} +49 -72
  2. package/dist/_chunks/appointment-card-vbUsDh70.js.map +1 -0
  3. package/dist/_chunks/{appointment-timeline-Czd4PBkF.js → appointment-timeline-B5pfBl-b.js} +2 -2
  4. package/dist/_chunks/{appointment-timeline-Czd4PBkF.js.map → appointment-timeline-B5pfBl-b.js.map} +1 -1
  5. package/dist/_chunks/{appointment-tray-B04zKY7g.js → appointment-tray-BhiXetjs.js} +2 -2
  6. package/dist/_chunks/{appointment-tray-B04zKY7g.js.map → appointment-tray-BhiXetjs.js.map} +1 -1
  7. package/dist/_chunks/{calendar-_sgjuH3L.js → calendar-DzR-vdJ5.js} +614 -563
  8. package/dist/_chunks/calendar-DzR-vdJ5.js.map +1 -0
  9. package/dist/_chunks/calendar-appointment-editor-dialog-CXch4Pmu.js +13663 -0
  10. package/dist/_chunks/calendar-appointment-editor-dialog-CXch4Pmu.js.map +1 -0
  11. package/dist/_chunks/{calendar-event-card-DXAYWH6k.js → calendar-event-card-BNEzkjm-.js} +142 -132
  12. package/dist/_chunks/calendar-event-card-BNEzkjm-.js.map +1 -0
  13. package/dist/_chunks/{care-plan-card-bGTIliXc.js → care-plan-card-CwgkImOD.js} +2 -2
  14. package/dist/_chunks/{care-plan-card-bGTIliXc.js.map → care-plan-card-CwgkImOD.js.map} +1 -1
  15. package/dist/_chunks/{care-plan-header-k8FslxsU.js → care-plan-header-Dx5OMkc9.js} +2 -2
  16. package/dist/_chunks/{care-plan-header-k8FslxsU.js.map → care-plan-header-Dx5OMkc9.js.map} +1 -1
  17. package/dist/_chunks/{clinical-note-card-DHn5W_bv.js → clinical-note-card-pPaeWWnu.js} +2 -2
  18. package/dist/_chunks/{clinical-note-card-DHn5W_bv.js.map → clinical-note-card-pPaeWWnu.js.map} +1 -1
  19. package/dist/_chunks/{contact-card-CGpbYuxl.js → contact-card-BSY2YpLZ.js} +2 -2
  20. package/dist/_chunks/{contact-card-CGpbYuxl.js.map → contact-card-BSY2YpLZ.js.map} +1 -1
  21. package/dist/_chunks/{contact-profile-card-CCgf0Ntt.js → contact-profile-card-CsZNMlws.js} +2 -2
  22. package/dist/_chunks/{contact-profile-card-CCgf0Ntt.js.map → contact-profile-card-CsZNMlws.js.map} +1 -1
  23. package/dist/_chunks/contact-round-DiSvB3LP.js +18 -0
  24. package/dist/_chunks/contact-round-DiSvB3LP.js.map +1 -0
  25. package/dist/_chunks/{default-tabs-DOuHEKI5.js → default-tabs-BnB6FUEW.js} +2 -2
  26. package/dist/_chunks/{default-tabs-DOuHEKI5.js.map → default-tabs-BnB6FUEW.js.map} +1 -1
  27. package/dist/_chunks/{entity-summary-BanguTa6.js → entity-summary-KHM0PnSI.js} +56 -68
  28. package/dist/_chunks/entity-summary-KHM0PnSI.js.map +1 -0
  29. package/dist/_chunks/file-pen-line-k4uMBM3h.js +29 -0
  30. package/dist/_chunks/file-pen-line-k4uMBM3h.js.map +1 -0
  31. package/dist/_chunks/{header-settings-DsvheAOt.js → header-settings-ZGvYAuKF.js} +101 -97
  32. package/dist/_chunks/header-settings-ZGvYAuKF.js.map +1 -0
  33. package/dist/_chunks/{info-tip-C-MPkShR.js → info-tip-B3cn3fY2.js} +2 -2
  34. package/dist/_chunks/{info-tip-C-MPkShR.js.map → info-tip-B3cn3fY2.js.map} +1 -1
  35. package/dist/_chunks/{link-DtCfnLnF.js → link-CeV7FoI6.js} +2 -2
  36. package/dist/_chunks/{link-DtCfnLnF.js.map → link-CeV7FoI6.js.map} +1 -1
  37. package/dist/_chunks/{marketplace-app-shell-BOBWmzoT.js → marketplace-app-shell-D_HA8CKx.js} +2 -2
  38. package/dist/_chunks/{marketplace-app-shell-BOBWmzoT.js.map → marketplace-app-shell-D_HA8CKx.js.map} +1 -1
  39. package/dist/_chunks/{nav-grid-D2xVcHTO.js → nav-grid-dEgDAri3.js} +2 -2
  40. package/dist/_chunks/{nav-grid-D2xVcHTO.js.map → nav-grid-dEgDAri3.js.map} +1 -1
  41. package/dist/_chunks/{note-attachment-cnj2JRrg.js → note-attachment-MNTIqdSz.js} +2 -2
  42. package/dist/_chunks/{note-attachment-cnj2JRrg.js.map → note-attachment-MNTIqdSz.js.map} +1 -1
  43. package/dist/_chunks/{note-timeline-BrjHBQfx.js → note-timeline-BQeW0VZY.js} +2 -2
  44. package/dist/_chunks/{note-timeline-BrjHBQfx.js.map → note-timeline-BQeW0VZY.js.map} +1 -1
  45. package/dist/_chunks/{notes-panel-n1JFNQ5u.js → notes-panel-DIY7eNsq.js} +2 -2
  46. package/dist/_chunks/{notes-panel-n1JFNQ5u.js.map → notes-panel-DIY7eNsq.js.map} +1 -1
  47. package/dist/_chunks/{patient-details-Cba9HQj_.js → patient-details-DBtEITfE.js} +2 -2
  48. package/dist/_chunks/{patient-details-Cba9HQj_.js.map → patient-details-DBtEITfE.js.map} +1 -1
  49. package/dist/_chunks/{patient-field-row-CtDihADs.js → patient-field-row-a5d4QijH.js} +2 -2
  50. package/dist/_chunks/{patient-field-row-CtDihADs.js.map → patient-field-row-a5d4QijH.js.map} +1 -1
  51. package/dist/_chunks/{patient-search-D_S7joff.js → patient-search-OAwFgOW3.js} +2 -2
  52. package/dist/_chunks/{patient-search-D_S7joff.js.map → patient-search-OAwFgOW3.js.map} +1 -1
  53. package/dist/_chunks/{patient-summary-card-DnLdbtsw.js → patient-summary-card-BUcZ-gaL.js} +3 -3
  54. package/dist/_chunks/{patient-summary-card-DnLdbtsw.js.map → patient-summary-card-BUcZ-gaL.js.map} +1 -1
  55. package/dist/_chunks/{payment-request-card-CEIalOtr.js → payment-request-card-Dv4WbRBe.js} +2 -2
  56. package/dist/_chunks/{payment-request-card-CEIalOtr.js.map → payment-request-card-Dv4WbRBe.js.map} +1 -1
  57. package/dist/_chunks/{product-hub-panel-CqRJlmb7.js → product-hub-panel-a8wdVOUt.js} +2 -2
  58. package/dist/_chunks/{product-hub-panel-CqRJlmb7.js.map → product-hub-panel-a8wdVOUt.js.map} +1 -1
  59. package/dist/_chunks/{public-footer-C8UIzqLJ.js → public-footer-D0cqScpz.js} +2 -2
  60. package/dist/_chunks/{public-footer-C8UIzqLJ.js.map → public-footer-D0cqScpz.js.map} +1 -1
  61. package/dist/_chunks/{signature-request-Dzs0jZsd.js → signature-request-DW2PSp66.js} +3 -3
  62. package/dist/_chunks/{signature-request-Dzs0jZsd.js.map → signature-request-DW2PSp66.js.map} +1 -1
  63. package/dist/_chunks/{signed-out-frame-fUf7tqs3.js → signed-out-frame-Oa2e1yps.js} +2 -2
  64. package/dist/_chunks/{signed-out-frame-fUf7tqs3.js.map → signed-out-frame-Oa2e1yps.js.map} +1 -1
  65. package/dist/_chunks/task-editor-CVRrDqpe.js +1256 -0
  66. package/dist/_chunks/task-editor-CVRrDqpe.js.map +1 -0
  67. package/dist/_chunks/{toast-BNoN8Qjh.js → toast-DQ1Zu1kk.js} +264 -251
  68. package/dist/_chunks/{toast-BNoN8Qjh.js.map → toast-DQ1Zu1kk.js.map} +1 -1
  69. package/dist/_chunks/{treatment-receipt-1VnuinhY.js → treatment-receipt-BZzwvsnY.js} +73 -56
  70. package/dist/_chunks/treatment-receipt-BZzwvsnY.js.map +1 -0
  71. package/dist/_chunks/use-appointment-details-read-BrykoTOR.js +2475 -0
  72. package/dist/_chunks/use-appointment-details-read-BrykoTOR.js.map +1 -0
  73. package/dist/_chunks/{whatsapp-button-DV9JFmtq.js → whatsapp-button-XbozeDl_.js} +32 -25
  74. package/dist/_chunks/whatsapp-button-XbozeDl_.js.map +1 -0
  75. package/dist/agent-catalog.json +49 -16
  76. package/dist/agent-i18n/en.json +5 -5
  77. package/dist/browser-support.js +1 -1
  78. package/dist/components/_shared/patient-picker.d.ts +10 -0
  79. package/dist/components/_shared/patient-picker.d.ts.map +1 -1
  80. package/dist/components/appointment-card/index.js +2 -2
  81. package/dist/components/appointment-details-panel/appointment-details-panel.d.ts +30 -1
  82. package/dist/components/appointment-details-panel/appointment-details-panel.d.ts.map +1 -1
  83. package/dist/components/appointment-details-panel/appointment-details-panel.links.d.ts +15 -0
  84. package/dist/components/appointment-details-panel/appointment-details-panel.links.d.ts.map +1 -0
  85. package/dist/components/appointment-details-panel/appointment-details-panel.recurrence.d.ts +9 -0
  86. package/dist/components/appointment-details-panel/appointment-details-panel.recurrence.d.ts.map +1 -0
  87. package/dist/components/appointment-details-panel/appointment-details-panel.sections.d.ts +12 -3
  88. package/dist/components/appointment-details-panel/appointment-details-panel.sections.d.ts.map +1 -1
  89. package/dist/components/appointment-details-panel/appointment-details-panel.types.d.ts +63 -1
  90. package/dist/components/appointment-details-panel/appointment-details-panel.types.d.ts.map +1 -1
  91. package/dist/components/appointment-details-panel/index.d.ts +2 -1
  92. package/dist/components/appointment-details-panel/index.d.ts.map +1 -1
  93. package/dist/components/appointment-details-panel/index.js +5 -4
  94. package/dist/components/appointment-timeline/index.js +1 -1
  95. package/dist/components/bill-table/index.js +1 -1
  96. package/dist/components/calendar/calendar.d.ts +22 -0
  97. package/dist/components/calendar/calendar.d.ts.map +1 -1
  98. package/dist/components/calendar/index.js +1 -1
  99. package/dist/components/calendar-event-card/calendar-event-card.d.ts +8 -0
  100. package/dist/components/calendar-event-card/calendar-event-card.d.ts.map +1 -1
  101. package/dist/components/calendar-event-card/index.js +1 -1
  102. package/dist/components/care-plan-card/index.js +1 -1
  103. package/dist/components/care-plan-header/index.js +1 -1
  104. package/dist/components/clinical-note-card/index.js +1 -1
  105. package/dist/components/contact-card/index.js +1 -1
  106. package/dist/components/contact-profile-card/index.js +1 -1
  107. package/dist/components/entity-summary/index.js +1 -1
  108. package/dist/components/header-settings/header-settings.d.ts.map +1 -1
  109. package/dist/components/header-settings/index.js +1 -1
  110. package/dist/components/info-tip/index.js +1 -1
  111. package/dist/components/link/index.js +1 -1
  112. package/dist/components/nav-grid/index.js +1 -1
  113. package/dist/components/note-timeline/index.js +1 -1
  114. package/dist/components/notes-panel/index.js +1 -1
  115. package/dist/components/patient-details/index.js +1 -1
  116. package/dist/components/patient-search/index.js +1 -1
  117. package/dist/components/patient-summary-card/index.js +1 -1
  118. package/dist/components/payment-card/index.js +1 -1
  119. package/dist/components/product-hub-tray/index.js +1 -1
  120. package/dist/components/public-footer/index.js +1 -1
  121. package/dist/components/task-editor/index.js +1 -1
  122. package/dist/components/toast/index.js +1 -1
  123. package/dist/components/toast/toast.d.ts.map +1 -1
  124. package/dist/components/treatment-receipt/index.d.ts +2 -2
  125. package/dist/components/treatment-receipt/index.d.ts.map +1 -1
  126. package/dist/components/treatment-receipt/index.js +2 -1
  127. package/dist/components/treatment-receipt/treatment-receipt.d.ts +11 -1
  128. package/dist/components/treatment-receipt/treatment-receipt.d.ts.map +1 -1
  129. package/dist/components/whatsapp-button/index.js +1 -1
  130. package/dist/components/whatsapp-button/whatsapp-button.d.ts.map +1 -1
  131. package/dist/core.css +1 -1
  132. package/dist/fullcalendar.css +5 -1
  133. package/dist/host-compat.css +4 -1
  134. package/dist/i18n/locales/ar.d.ts +119 -4
  135. package/dist/i18n/locales/ar.d.ts.map +1 -1
  136. package/dist/i18n/locales/ar.js +130 -15
  137. package/dist/i18n/locales/ar.js.map +1 -1
  138. package/dist/i18n/locales/de.d.ts +119 -4
  139. package/dist/i18n/locales/de.d.ts.map +1 -1
  140. package/dist/i18n/locales/de.js +130 -15
  141. package/dist/i18n/locales/de.js.map +1 -1
  142. package/dist/i18n/locales/el.d.ts +119 -4
  143. package/dist/i18n/locales/el.d.ts.map +1 -1
  144. package/dist/i18n/locales/el.js +130 -15
  145. package/dist/i18n/locales/el.js.map +1 -1
  146. package/dist/i18n/locales/en.d.ts +119 -4
  147. package/dist/i18n/locales/en.d.ts.map +1 -1
  148. package/dist/i18n/locales/en.js +122 -10
  149. package/dist/i18n/locales/en.js.map +1 -1
  150. package/dist/i18n/locales/es.d.ts +119 -4
  151. package/dist/i18n/locales/es.d.ts.map +1 -1
  152. package/dist/i18n/locales/es.js +130 -15
  153. package/dist/i18n/locales/es.js.map +1 -1
  154. package/dist/i18n/locales/fr.d.ts +119 -4
  155. package/dist/i18n/locales/fr.d.ts.map +1 -1
  156. package/dist/i18n/locales/fr.js +130 -15
  157. package/dist/i18n/locales/fr.js.map +1 -1
  158. package/dist/i18n/locales/hi.d.ts +119 -4
  159. package/dist/i18n/locales/hi.d.ts.map +1 -1
  160. package/dist/i18n/locales/hi.js +130 -15
  161. package/dist/i18n/locales/hi.js.map +1 -1
  162. package/dist/i18n/locales/it.d.ts +119 -4
  163. package/dist/i18n/locales/it.d.ts.map +1 -1
  164. package/dist/i18n/locales/it.js +130 -15
  165. package/dist/i18n/locales/it.js.map +1 -1
  166. package/dist/i18n/locales/ja.d.ts +119 -4
  167. package/dist/i18n/locales/ja.d.ts.map +1 -1
  168. package/dist/i18n/locales/ja.js +130 -15
  169. package/dist/i18n/locales/ja.js.map +1 -1
  170. package/dist/i18n/locales/nl.d.ts +119 -4
  171. package/dist/i18n/locales/nl.d.ts.map +1 -1
  172. package/dist/i18n/locales/nl.js +130 -15
  173. package/dist/i18n/locales/nl.js.map +1 -1
  174. package/dist/i18n/locales/pl.d.ts +119 -4
  175. package/dist/i18n/locales/pl.d.ts.map +1 -1
  176. package/dist/i18n/locales/pl.js +130 -15
  177. package/dist/i18n/locales/pl.js.map +1 -1
  178. package/dist/i18n/locales/pt.d.ts +119 -4
  179. package/dist/i18n/locales/pt.d.ts.map +1 -1
  180. package/dist/i18n/locales/pt.js +130 -15
  181. package/dist/i18n/locales/pt.js.map +1 -1
  182. package/dist/i18n/locales/ro.d.ts +119 -4
  183. package/dist/i18n/locales/ro.d.ts.map +1 -1
  184. package/dist/i18n/locales/ro.js +130 -15
  185. package/dist/i18n/locales/ro.js.map +1 -1
  186. package/dist/i18n/locales/ru.d.ts +119 -4
  187. package/dist/i18n/locales/ru.d.ts.map +1 -1
  188. package/dist/i18n/locales/ru.js +130 -15
  189. package/dist/i18n/locales/ru.js.map +1 -1
  190. package/dist/i18n/locales/sq.d.ts +119 -4
  191. package/dist/i18n/locales/sq.d.ts.map +1 -1
  192. package/dist/i18n/locales/sq.js +130 -15
  193. package/dist/i18n/locales/sq.js.map +1 -1
  194. package/dist/i18n/locales/sv.d.ts +119 -4
  195. package/dist/i18n/locales/sv.d.ts.map +1 -1
  196. package/dist/i18n/locales/sv.js +130 -15
  197. package/dist/i18n/locales/sv.js.map +1 -1
  198. package/dist/i18n/locales/tr.d.ts +119 -4
  199. package/dist/i18n/locales/tr.d.ts.map +1 -1
  200. package/dist/i18n/locales/tr.js +130 -15
  201. package/dist/i18n/locales/tr.js.map +1 -1
  202. package/dist/i18n/locales/zh.d.ts +119 -4
  203. package/dist/i18n/locales/zh.d.ts.map +1 -1
  204. package/dist/i18n/locales/zh.js +130 -15
  205. package/dist/i18n/locales/zh.js.map +1 -1
  206. package/dist/index.js +1112 -1107
  207. package/dist/locales/ar.json +130 -15
  208. package/dist/locales/de.json +130 -15
  209. package/dist/locales/el.json +130 -15
  210. package/dist/locales/en.json +122 -7
  211. package/dist/locales/es.json +130 -15
  212. package/dist/locales/fr.json +130 -15
  213. package/dist/locales/hi.json +130 -15
  214. package/dist/locales/it.json +130 -15
  215. package/dist/locales/ja.json +130 -15
  216. package/dist/locales/nl.json +130 -15
  217. package/dist/locales/pl.json +130 -15
  218. package/dist/locales/pt.json +130 -15
  219. package/dist/locales/ro.json +130 -15
  220. package/dist/locales/ru.json +130 -15
  221. package/dist/locales/sq.json +130 -15
  222. package/dist/locales/sv.json +130 -15
  223. package/dist/locales/tr.json +130 -15
  224. package/dist/locales/zh.json +130 -15
  225. package/dist/patterns/calendar/calendar-appointment-details.d.ts +83 -2
  226. package/dist/patterns/calendar/calendar-appointment-details.d.ts.map +1 -1
  227. package/dist/patterns/calendar/calendar-appointment-editor-dialog.d.ts.map +1 -1
  228. package/dist/patterns/calendar/calendar-archive.d.ts +12 -0
  229. package/dist/patterns/calendar/calendar-archive.d.ts.map +1 -0
  230. package/dist/patterns/calendar/calendar-bookings-panel.d.ts.map +1 -1
  231. package/dist/patterns/calendar/calendar-care-rules.d.ts +19 -23
  232. package/dist/patterns/calendar/calendar-care-rules.d.ts.map +1 -1
  233. package/dist/patterns/calendar/calendar-delete-confirm.d.ts +18 -0
  234. package/dist/patterns/calendar/calendar-delete-confirm.d.ts.map +1 -0
  235. package/dist/patterns/calendar/calendar-document-scope-confirm.d.ts +12 -0
  236. package/dist/patterns/calendar/calendar-document-scope-confirm.d.ts.map +1 -0
  237. package/dist/patterns/calendar/calendar-editor-guard.d.ts +12 -0
  238. package/dist/patterns/calendar/calendar-editor-guard.d.ts.map +1 -0
  239. package/dist/patterns/calendar/calendar-editor-hydration.d.ts +13 -2
  240. package/dist/patterns/calendar/calendar-editor-hydration.d.ts.map +1 -1
  241. package/dist/patterns/calendar/calendar-load-error.d.ts +11 -0
  242. package/dist/patterns/calendar/calendar-load-error.d.ts.map +1 -0
  243. package/dist/patterns/calendar/calendar-patient-locked.d.ts +13 -0
  244. package/dist/patterns/calendar/calendar-patient-locked.d.ts.map +1 -0
  245. package/dist/patterns/calendar/calendar-patient-picker.d.ts +6 -1
  246. package/dist/patterns/calendar/calendar-patient-picker.d.ts.map +1 -1
  247. package/dist/patterns/calendar/calendar-prompts.d.ts +11 -0
  248. package/dist/patterns/calendar/calendar-prompts.d.ts.map +1 -0
  249. package/dist/patterns/calendar/calendar-settings-ical.d.ts +11 -0
  250. package/dist/patterns/calendar/calendar-settings-ical.d.ts.map +1 -0
  251. package/dist/patterns/calendar/calendar-settings-overlay.d.ts +73 -0
  252. package/dist/patterns/calendar/calendar-settings-overlay.d.ts.map +1 -0
  253. package/dist/patterns/calendar/calendar-settings-panel.d.ts +62 -0
  254. package/dist/patterns/calendar/calendar-settings-panel.d.ts.map +1 -0
  255. package/dist/patterns/calendar/calendar-settings-practice.d.ts +20 -0
  256. package/dist/patterns/calendar/calendar-settings-practice.d.ts.map +1 -0
  257. package/dist/patterns/calendar/calendar-status-colours.d.ts +18 -0
  258. package/dist/patterns/calendar/calendar-status-colours.d.ts.map +1 -0
  259. package/dist/patterns/calendar/calendar-upcoming-panel.d.ts.map +1 -1
  260. package/dist/patterns/calendar/calendar-waiting-list-panel.d.ts +17 -2
  261. package/dist/patterns/calendar/calendar-waiting-list-panel.d.ts.map +1 -1
  262. package/dist/patterns/calendar/calendar-workspace.d.ts +285 -6
  263. package/dist/patterns/calendar/calendar-workspace.d.ts.map +1 -1
  264. package/dist/patterns/calendar/calendar-workspace.model.d.ts +103 -17
  265. package/dist/patterns/calendar/calendar-workspace.model.d.ts.map +1 -1
  266. package/dist/patterns/calendar/calendar.data.d.ts +9 -3
  267. package/dist/patterns/calendar/calendar.data.d.ts.map +1 -1
  268. package/dist/patterns/calendar/calendar.journey.d.ts +69 -5
  269. package/dist/patterns/calendar/calendar.journey.d.ts.map +1 -1
  270. package/dist/patterns/calendar/calendar.model.d.ts +129 -22
  271. package/dist/patterns/calendar/calendar.model.d.ts.map +1 -1
  272. package/dist/patterns/calendar/calendar.preferences.d.ts +4 -0
  273. package/dist/patterns/calendar/calendar.preferences.d.ts.map +1 -1
  274. package/dist/patterns/calendar/calendar.sheets.d.ts +129 -18
  275. package/dist/patterns/calendar/calendar.sheets.d.ts.map +1 -1
  276. package/dist/patterns/calendar/calendar.surface.d.ts +64 -6
  277. package/dist/patterns/calendar/calendar.surface.d.ts.map +1 -1
  278. package/dist/patterns/calendar/calendar.types.d.ts +231 -6
  279. package/dist/patterns/calendar/calendar.types.d.ts.map +1 -1
  280. package/dist/patterns/calendar/index.d.ts +9 -6
  281. package/dist/patterns/calendar/index.d.ts.map +1 -1
  282. package/dist/patterns/calendar/index.js +18 -15
  283. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  284. package/dist/patterns/signature-request/index.js +1 -1
  285. package/dist/patterns/signed-out-frame/index.js +1 -1
  286. package/dist/tokens.css +5 -1
  287. package/package.json +1 -1
  288. package/dist/_chunks/appointment-card-0PebvrOS.js.map +0 -1
  289. package/dist/_chunks/calendar-_sgjuH3L.js.map +0 -1
  290. package/dist/_chunks/calendar-appointment-editor-dialog-CGDDGMdo.js +0 -10974
  291. package/dist/_chunks/calendar-appointment-editor-dialog-CGDDGMdo.js.map +0 -1
  292. package/dist/_chunks/calendar-event-card-DXAYWH6k.js.map +0 -1
  293. package/dist/_chunks/entity-summary-BanguTa6.js.map +0 -1
  294. package/dist/_chunks/header-settings-DsvheAOt.js.map +0 -1
  295. package/dist/_chunks/task-editor-C05yx7JJ.js +0 -1218
  296. package/dist/_chunks/task-editor-C05yx7JJ.js.map +0 -1
  297. package/dist/_chunks/treatment-receipt-1VnuinhY.js.map +0 -1
  298. package/dist/_chunks/use-appointment-details-read-Bm408XzX.js +0 -2198
  299. package/dist/_chunks/use-appointment-details-read-Bm408XzX.js.map +0 -1
  300. package/dist/_chunks/whatsapp-button-DV9JFmtq.js.map +0 -1
@@ -0,0 +1,2475 @@
1
+ import { jsx as e, jsxs as f, Fragment as ie } from "react/jsx-runtime";
2
+ import { c as vt } from "./index-D2ZczOXr.js";
3
+ import { useId as ot, useRef as _, forwardRef as ln, useEffect as xe, useMemo as Mt, useState as H, useCallback as cn } from "react";
4
+ import { useTranslation as B } from "react-i18next";
5
+ import { u as un } from "./registry-DvAUVLHh.js";
6
+ import { u as me } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
7
+ import { c as mn } from "./compose-refs-C0k0tdqF.js";
8
+ import { h as at, g as dt } from "./handled-rejection-6gqCf5vt.js";
9
+ import { a as pn, b as Lt } from "./privacy-mask-DJ1gee4c.js";
10
+ import { A as $ } from "./alert-C4WKViaS.js";
11
+ import { B as L } from "./button-DohK_Ak_.js";
12
+ import { I as Yt } from "./icon-button-S8_weU3g.js";
13
+ import { B as hn } from "./button-group-B2MJo0Se.js";
14
+ import { D as qe } from "./dropdown-menu-Dw6sgQwJ.js";
15
+ import { E as Gt } from "./editable-description-KU56SP4P.js";
16
+ import { N as lt } from "./note-timeline-BQeW0VZY.js";
17
+ import { P as Vt } from "./panel-header-CbtlTe85.js";
18
+ import { P as it } from "./panel-subview-DCyvn-49.js";
19
+ import { P as Xt } from "./patient-summary-card-BUcZ-gaL.js";
20
+ import { S as pe } from "./section-card-CYfeQ6EQ.js";
21
+ import { C as fn, S as we } from "./skeleton-tTWJpvAq.js";
22
+ import { T as gn } from "./text-area-COMVJ1yE.js";
23
+ import { T as vn } from "./tooltip-uEBdD1-5.js";
24
+ import { T as Qt } from "./treatment-receipt-BZzwvsnY.js";
25
+ import { a as st } from "./whatsapp-button-XbozeDl_.js";
26
+ import { a as Jt, W as yn } from "./workflow-status-D0avpoeS.js";
27
+ import { u as yt, a as Ot, i as bn } from "./appointment-workflow-status-DMjuIK90.js";
28
+ import { E as kn } from "./empty-state-DwJ5YNzz.js";
29
+ import { T as Oe } from "./timeline-DXko0M1t.js";
30
+ import { C as bt } from "./calendar-clock-hbObjfGY.js";
31
+ import { T as Zt } from "./trash-2-uumy3fy1.js";
32
+ import { A as rt } from "./entity-card-fpm-KUKc.js";
33
+ import { C as wn } from "./calendar-plus-BFrIRE4r.js";
34
+ import { P as Ne } from "./pencil-B1sKKyuT.js";
35
+ import { C as ct } from "./clock-Drd4Wtis.js";
36
+ import { c as Ve } from "./createLucideIcon-DhHxpK9K.js";
37
+ import { A as Nn } from "./arrow-right-KsIrLdt0.js";
38
+ import { A as ut } from "./avatar-Dp5apm1d.js";
39
+ import { B as Xe } from "./badge-BUk4RjTS.js";
40
+ import { H as kt } from "./heart-pulse-BCppJyN2.js";
41
+ import { G as xn } from "./globe-sHBW1JN5.js";
42
+ import { T as Sn } from "./triangle-alert-CBnO6nq_.js";
43
+ import { E as In } from "./euro-Dsuz4ixO.js";
44
+ import { V as wt } from "./video-BheNGvsu.js";
45
+ import { R as en } from "./repeat-CvQa5rZt.js";
46
+ import { C as An } from "./counter-WsvRuum1.js";
47
+ import { D as je } from "./description-list-BxzDN9o2.js";
48
+ import { T as _t } from "./timestamp-DPLDWdxA.js";
49
+ import { T as Tn } from "./transaction-chip-CkYd-3ky.js";
50
+ import { H as Se } from "./hover-card-CuRIA4wN.js";
51
+ import { S as Ft } from "./smartphone-C0rFF2if.js";
52
+ import { P as En } from "./phone-FceYcIFQ.js";
53
+ import { M as Dn } from "./mail-BqXVF2zH.js";
54
+ import { M as Cn } from "./map-pin-BaY37-Km.js";
55
+ import { F as Rn } from "./file-pen-line-k4uMBM3h.js";
56
+ import { C as Pn } from "./contact-round-DiSvB3LP.js";
57
+ import { P as Mn } from "./pen-line-D0De5zdl.js";
58
+ import { C as Ln } from "./credit-card-D9XZsHGA.js";
59
+ import { R as On } from "./refresh-cw-DnI0cLFC.js";
60
+ import { C as _n } from "./calendar-days-BGWklvE-.js";
61
+ import { H as Fn } from "./hourglass-BEAzW1wE.js";
62
+ import { A as zt } from "./armchair-BaLDW6Hz.js";
63
+ import { B as zn } from "./building-2-D33bLCWL.js";
64
+ import { N as Hn } from "./notebook-pen-CO7HoM-W.js";
65
+ import { C as mt } from "./clipboard-list-rSzfIYZB.js";
66
+ import { U as $n } from "./user-plus-BtcOLgNU.js";
67
+ import { C as Bn } from "./copy-vRpqqHtY.js";
68
+ import { P as Wn } from "./plus-DzMQ_c6b.js";
69
+ import { S as Un } from "./square-check-big-dj0o8yA3.js";
70
+ import { H as Ht } from "./history-CK2JaU2g.js";
71
+ import { C as qn } from "./chevron-down-DWE7GSq9.js";
72
+ import { C as jn } from "./camera-VSklPDCv.js";
73
+ import { F as Kn } from "./file-BuG1VMAy.js";
74
+ import { F as Yn } from "./file-text-5yv6r2ls.js";
75
+ import { F as Gn } from "./folder-BghC8_S2.js";
76
+ import { R as Vn } from "./receipt-euro-B1cLM_TN.js";
77
+ /**
78
+ * @license lucide-react v1.22.0 - ISC
79
+ *
80
+ * This source code is licensed under the ISC license.
81
+ * See the LICENSE file in the root directory of this source tree.
82
+ */
83
+ const Xn = [
84
+ ["path", { d: "M20 21v-8a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8", key: "1w3rig" }],
85
+ ["path", { d: "M4 16s.5-1 2-1 2.5 2 4 2 2.5-2 4-2 2.5 2 4 2 2-1 2-1", key: "n2jgmb" }],
86
+ ["path", { d: "M2 21h20", key: "1nyx9w" }],
87
+ ["path", { d: "M7 8v3", key: "1qtyvj" }],
88
+ ["path", { d: "M12 8v3", key: "hwp4zt" }],
89
+ ["path", { d: "M17 8v3", key: "1i6e5u" }],
90
+ ["path", { d: "M7 4h.01", key: "1bh4kh" }],
91
+ ["path", { d: "M12 4h.01", key: "1ujb9j" }],
92
+ ["path", { d: "M17 4h.01", key: "1upcoc" }]
93
+ ], Qn = Ve("cake", Xn);
94
+ /**
95
+ * @license lucide-react v1.22.0 - ISC
96
+ *
97
+ * This source code is licensed under the ISC license.
98
+ * See the LICENSE file in the root directory of this source tree.
99
+ */
100
+ const Jn = [
101
+ ["path", { d: "M11 14h10", key: "1w8e9d" }],
102
+ ["path", { d: "M16 4h2a2 2 0 0 1 2 2v1.344", key: "1e62lh" }],
103
+ ["path", { d: "m17 18 4-4-4-4", key: "z2g111" }],
104
+ ["path", { d: "M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 1.793-1.113", key: "bjbb7m" }],
105
+ ["rect", { x: "8", y: "2", width: "8", height: "4", rx: "1", key: "ublpy" }]
106
+ ], $t = Ve("clipboard-paste", Jn);
107
+ /**
108
+ * @license lucide-react v1.22.0 - ISC
109
+ *
110
+ * This source code is licensed under the ISC license.
111
+ * See the LICENSE file in the root directory of this source tree.
112
+ */
113
+ const Zn = [
114
+ ["path", { d: "M16 10h2", key: "8sgtl7" }],
115
+ ["path", { d: "M16 14h2", key: "epxaof" }],
116
+ ["path", { d: "M6.17 15a3 3 0 0 1 5.66 0", key: "n6f512" }],
117
+ ["circle", { cx: "9", cy: "11", r: "2", key: "yxgjnd" }],
118
+ ["rect", { x: "2", y: "5", width: "20", height: "14", rx: "2", key: "qneu4z" }]
119
+ ], ea = Ve("id-card", Zn);
120
+ /**
121
+ * @license lucide-react v1.22.0 - ISC
122
+ *
123
+ * This source code is licensed under the ISC license.
124
+ * See the LICENSE file in the root directory of this source tree.
125
+ */
126
+ const ta = [
127
+ ["path", { d: "M12 2v20", key: "t6zp3m" }],
128
+ ["path", { d: "m15 19-3 3-3-3", key: "11eu04" }],
129
+ ["path", { d: "m19 9 3 3-3 3", key: "1mg7y2" }],
130
+ ["path", { d: "M2 12h20", key: "9i4pu4" }],
131
+ ["path", { d: "m5 9-3 3 3 3", key: "j64kie" }],
132
+ ["path", { d: "m9 5 3-3 3 3", key: "l8vdw6" }]
133
+ ], pt = Ve("move", ta), na = '[data-component="button-group"] [data-component="icon-button"][aria-haspopup="menu"]', aa = {
134
+ id: "appointment-details-panel",
135
+ // open and close back open_history and close_history; set_value backs
136
+ // set_status.
137
+ capabilities: ["open", "close", "set_value"],
138
+ state: {
139
+ eventId: {
140
+ type: "string | null",
141
+ descriptionKey: "ui.agent.appointmentDetailsPanel.state.eventId",
142
+ description: "The occurrence on screen or being read, as the host identifies it. After a failed or refused read, the occurrence it was for when the host says so. Null when there is none, or the host did not say.",
143
+ read: (t) => t.getEventId()
144
+ },
145
+ loadStatus: {
146
+ type: "'loading' | 'ready' | 'error' | 'refused'",
147
+ descriptionKey: "ui.agent.appointmentDetailsPanel.state.loadStatus",
148
+ description: "Where the read is: loading, ready, failed (with Retry) or refused. Actions need ready.",
149
+ read: (t) => t.getLoadStatus()
150
+ },
151
+ appointmentStatus: {
152
+ type: "'confirmed' | 'waiting' | 'in_care' | 'done' | 'cancelled' | 'absent' | null",
153
+ descriptionKey: "ui.agent.appointmentDetailsPanel.state.appointmentStatus",
154
+ description: "The appointment status as last saved here or read. Null when none is recorded or nothing is on screen.",
155
+ read: (t) => t.getAppointmentStatus()
156
+ },
157
+ allowedStatuses: {
158
+ type: "string[]",
159
+ descriptionKey: "ui.agent.appointmentDetailsPanel.state.allowedStatuses",
160
+ description: "The statuses set_status accepts now, in menu order. Empty when the status is read-only.",
161
+ read: (t) => t.getAllowedStatuses()
162
+ },
163
+ offeredActions: {
164
+ type: "string[]",
165
+ descriptionKey: "ui.agent.appointmentDetailsPanel.state.offeredActions",
166
+ description: "The footer actions on offer, as their data-action values (for example edit-appointment, delete-appointment), in footer order, including any folded into More.",
167
+ read: (t) => t.getOfferedActions()
168
+ },
169
+ historyOpen: {
170
+ type: "boolean",
171
+ descriptionKey: "ui.agent.appointmentDetailsPanel.state.historyOpen",
172
+ description: "Whether the History sub-view covers the details.",
173
+ read: (t) => t.isHistoryOpen()
174
+ },
175
+ privacy: {
176
+ type: "boolean",
177
+ descriptionKey: "ui.agent.appointmentDetailsPanel.state.privacy",
178
+ description: "Whether privacy mode is on. The patient identity and personal fields are then masked on screen.",
179
+ read: (t) => t.isPrivacy()
180
+ }
181
+ },
182
+ actions: {
183
+ open_history: {
184
+ safety: "read",
185
+ openWorld: !0,
186
+ idempotent: !0,
187
+ errors: ["No appointment is on screen, or History is not offered."],
188
+ descriptionKey: "ui.agent.appointmentDetailsPanel.actions.openHistory",
189
+ description: "Slide the appointment's history over the details, as its header button does; the host reads it then if it did not send it with the details. It lists who changed what, and when.",
190
+ invoke: (t) => t.openHistory()
191
+ },
192
+ close_history: {
193
+ safety: "read",
194
+ idempotent: !0,
195
+ descriptionKey: "ui.agent.appointmentDetailsPanel.actions.closeHistory",
196
+ description: "Return from History to the details.",
197
+ invoke: (t) => t.closeHistory()
198
+ },
199
+ set_status: {
200
+ safety: "phi",
201
+ openWorld: !0,
202
+ idempotent: !0,
203
+ argsType: "{ status: string }",
204
+ argsSchema: {
205
+ type: "object",
206
+ properties: {
207
+ status: {
208
+ type: "string",
209
+ enum: [
210
+ "confirmed",
211
+ "waiting",
212
+ "in_care",
213
+ "done",
214
+ "cancelled",
215
+ "absent"
216
+ ]
217
+ }
218
+ },
219
+ required: ["status"]
220
+ },
221
+ errors: [
222
+ "The status is read-only: no appointment on screen, no host save, readOnly, or no allowed statuses.",
223
+ "The status is not in allowedStatuses.",
224
+ "A status save is already in flight.",
225
+ "The host refused the change. The previous status stays and the panel shows the message."
226
+ ],
227
+ examples: [{ args: { status: "waiting" } }],
228
+ descriptionKey: "ui.agent.appointmentDetailsPanel.actions.setStatus",
229
+ description: "Save a new appointment status through the host, as the footer control does. Resolves once the host has saved it.",
230
+ invoke: (t, n) => t.setAppointmentStatus(
231
+ n.status
232
+ )
233
+ },
234
+ retry: {
235
+ safety: "read",
236
+ openWorld: !0,
237
+ errors: [
238
+ "Retry is not offered: the read has not failed or been refused as retryable, or the host offers no Retry."
239
+ ],
240
+ descriptionKey: "ui.agent.appointmentDetailsPanel.actions.retry",
241
+ description: "Ask the host to read the appointment again, after a failed read or a refusal it marked retryable.",
242
+ invoke: (t) => t.retry()
243
+ }
244
+ },
245
+ domHooks: {
246
+ root: {
247
+ attr: "data-component",
248
+ value: "appointment-details-panel",
249
+ description: `Marks the panel. It also carries data-event-id and data-status. Inside, cards carry data-card (patient, appointment, notes, treatments), footer actions data-action, and the History and description sub-views data-details-subview. An action in offeredActions with no data-action in the footer strip is folded into More: click the panel's ${na}, and its menu item carries the same data-action.`
250
+ },
251
+ instanceId: {
252
+ attr: "data-component-id",
253
+ sourceProp: "id",
254
+ description: "Sourced from the id prop, or generated."
255
+ }
256
+ }
257
+ };
258
+ function ht(t) {
259
+ const n = document.activeElement;
260
+ n && n !== document.body || t == null || t.focus({ preventScroll: !0 });
261
+ }
262
+ function _e(t) {
263
+ const n = document.getElementById(t);
264
+ n && !n.hasAttribute("tabindex") && (n.tabIndex = -1), ht(n);
265
+ }
266
+ const ue = {
267
+ advancedSignature: "setup-advanced-signature",
268
+ requestSignature: "request-signature",
269
+ signOnDevice: "sign-on-device",
270
+ openPatient: "open-patient",
271
+ renewAnamnesis: "renew-anamnesis",
272
+ unlockPayments: "unlock-payments",
273
+ carePlan: "open-care-plan"
274
+ };
275
+ function Ke(t) {
276
+ if (t)
277
+ try {
278
+ const { protocol: n } = new URL(t, "https://host.invalid");
279
+ return n === "http:" || n === "https:" ? t : void 0;
280
+ } catch {
281
+ return;
282
+ }
283
+ }
284
+ function Fe(t) {
285
+ return typeof t == "string" && /^\d{4}-\d{2}-\d{2}$/.test(t) ? /* @__PURE__ */ new Date(`${t}T00:00:00`) : new Date(t);
286
+ }
287
+ function Ge(t, n) {
288
+ try {
289
+ return new Intl.DateTimeFormat(t, {
290
+ weekday: "long",
291
+ day: "numeric",
292
+ month: "long",
293
+ year: "numeric"
294
+ }).format(Fe(n));
295
+ } catch {
296
+ return "";
297
+ }
298
+ }
299
+ function ia(t, n, i) {
300
+ const o = new Date(n), s = i ? new Date(i) : o;
301
+ try {
302
+ const d = new Intl.DateTimeFormat(t, {
303
+ hour: "2-digit",
304
+ minute: "2-digit",
305
+ hour12: !1
306
+ });
307
+ return typeof d.formatRange == "function" ? d.formatRange(o, s) : `${d.format(o)} – ${d.format(s)}`;
308
+ } catch {
309
+ return "";
310
+ }
311
+ }
312
+ const ft = {
313
+ weekday: "short",
314
+ day: "numeric",
315
+ month: "short",
316
+ hour: "2-digit",
317
+ minute: "2-digit"
318
+ };
319
+ function sa(t, n) {
320
+ const i = Fe(t), o = Fe(n);
321
+ let s = o.getFullYear() - i.getFullYear();
322
+ const d = o.getMonth() - i.getMonth();
323
+ return (d < 0 || d === 0 && o.getDate() < i.getDate()) && (s -= 1), Math.max(0, s);
324
+ }
325
+ const ra = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})$/;
326
+ function oa(t) {
327
+ const n = typeof t == "string" ? ra.exec(t) : null;
328
+ if (!n) return;
329
+ const [i, o, s, d, p, h] = n.slice(1).map(Number), c = /* @__PURE__ */ new Date(0);
330
+ if (c.setFullYear(i, o, 0), o < 1 || o > 12 || s < 1 || s > c.getDate() || d > 23 || p > 59 || h > 59)
331
+ return;
332
+ const r = /* @__PURE__ */ new Date(0);
333
+ return r.setFullYear(i, o - 1, s), r.setHours(d, p, h, 0), r;
334
+ }
335
+ function da(t) {
336
+ return t.map((n) => {
337
+ const i = Date.parse(n.atIso);
338
+ return { entry: n, time: Number.isFinite(i) ? i : -1 / 0 };
339
+ }).sort((n, i) => n.time === i.time ? 0 : i.time - n.time).map(({ entry: n }) => n);
340
+ }
341
+ const la = {
342
+ daily: "recurrenceDaily",
343
+ weekly: "recurrenceWeekly",
344
+ monthly: "recurrenceMonthly",
345
+ quarterly: "recurrenceQuarterly",
346
+ semiannual: "recurrenceSemiannual",
347
+ yearly: "recurrenceYearly"
348
+ };
349
+ function ca(t) {
350
+ return t.phones ? t.phones : t.phone ? [{ label: "mobile", number: t.phone }] : [];
351
+ }
352
+ function tn(t) {
353
+ return [t.address, t.postalCode, t.city].filter((n) => !!n).join(", ");
354
+ }
355
+ function ua(t) {
356
+ return [t.address, t.city].filter((n) => !!n).join(", ");
357
+ }
358
+ function ma(t) {
359
+ const n = tn(t);
360
+ return `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(n)}`;
361
+ }
362
+ const P = (t) => `calendarWorkspace.details.${t}`, pa = /* @__PURE__ */ new Set(["patient", "care"]), Bt = /^#?(?:[0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i, ha = (t) => {
363
+ switch (t.field) {
364
+ case "time":
365
+ return !!(t.fromIso || t.toIso);
366
+ case "duration":
367
+ return t.fromMin !== void 0 || t.toMin !== void 0;
368
+ default:
369
+ return !!(t.from || t.to);
370
+ }
371
+ };
372
+ function fa(t) {
373
+ const n = t.kind === "moved" ? [{ field: "time", fromIso: t.fromIso, toIso: t.toIso }] : t.kind === "resized" ? [{ field: "duration", fromMin: t.fromMin, toMin: t.toMin }] : t.kind === "status" ? [{ field: "status", from: t.from, to: t.to }] : [], i = ("changes" in t ? t.changes ?? [] : []).filter(
374
+ ha
375
+ ), o = new Set(n.map((s) => s.field));
376
+ return [
377
+ ...n,
378
+ ...i.filter((s) => o.has(s.field) ? !1 : (o.add(s.field), !0))
379
+ ];
380
+ }
381
+ const ga = (t, n) => t.getFullYear() === n.getFullYear() && t.getMonth() === n.getMonth() && t.getDate() === n.getDate();
382
+ function va({
383
+ history: t,
384
+ locale: n,
385
+ noteUnrecordedEdits: i = !1,
386
+ privacy: o = !1
387
+ }) {
388
+ const { t: s, i18n: d } = B("ui"), { optionFor: p } = yt(null), h = n ?? d.language, c = (a, m) => {
389
+ try {
390
+ return new Intl.DateTimeFormat(h, m).format(
391
+ new Date(a)
392
+ );
393
+ } catch {
394
+ return a;
395
+ }
396
+ }, r = (a) => c(a, ft), l = s(P("history.notSet")), g = (a) => {
397
+ switch (a.field) {
398
+ case "status":
399
+ return {
400
+ from: a.from && p(a.from).label,
401
+ to: a.to && p(a.to).label
402
+ };
403
+ case "time": {
404
+ const m = a.fromIso && new Date(a.fromIso), k = a.toIso && new Date(a.toIso), b = m && k && ga(m, k) ? c(a.toIso, {
405
+ hour: "2-digit",
406
+ minute: "2-digit"
407
+ }) : void 0;
408
+ return {
409
+ from: a.fromIso && r(a.fromIso),
410
+ to: b ?? (a.toIso && r(a.toIso))
411
+ };
412
+ }
413
+ case "duration":
414
+ return {
415
+ from: a.fromMin === void 0 ? void 0 : s(P("history.minutes"), { n: a.fromMin }),
416
+ to: a.toMin === void 0 ? void 0 : s(P("history.minutes"), { n: a.toMin })
417
+ };
418
+ default:
419
+ return { from: a.from || void 0, to: a.to || void 0 };
420
+ }
421
+ }, w = (a) => {
422
+ const m = s(P(`history.fields.${a.field}`)), { from: k, to: b } = g(a);
423
+ return a.field === "colour" && [k, b].some((A) => A && Bt.test(A)) ? s(P("history.changed.colour")) : k && !b ? s(P("history.changeCleared"), { field: m, from: k }) : !k && b ? s(P("history.changeSet"), { field: m, to: b }) : s(P("history.changeFromTo"), {
424
+ field: m,
425
+ from: k ?? l,
426
+ to: b ?? l
427
+ });
428
+ }, v = (a) => {
429
+ const m = (T, S) => T && a.field === "colour" && Bt.test(T) ? /* @__PURE__ */ e(
430
+ "span",
431
+ {
432
+ className: "ds:inline-block ds:size-4 ds:shrink-0 ds:rounded-[var(--radius-full)] ds:border ds:border-[color:var(--border)] ds:[background-color:var(--history-swatch)] ds:forced-colors:[forced-color-adjust:none]",
433
+ style: {
434
+ "--history-swatch": T.startsWith("#") ? T : `#${T}`
435
+ }
436
+ }
437
+ ) : T ? /* @__PURE__ */ e(
438
+ "span",
439
+ {
440
+ className: S ? "ds:min-w-0 ds:font-[var(--font-weight-medium)] ds:text-[color:var(--foreground)]" : "ds:min-w-0 ds:text-[color:var(--muted-foreground)]",
441
+ children: T
442
+ }
443
+ ) : /* @__PURE__ */ e("span", { className: "ds:min-w-0 ds:text-[color:var(--muted-foreground)]", children: l }), k = (T) => T ? /* @__PURE__ */ e(
444
+ Jt,
445
+ {
446
+ value: T,
447
+ option: p(T),
448
+ size: "sm"
449
+ }
450
+ ) : m(void 0, !1), { from: b, to: A } = g(a);
451
+ return /* @__PURE__ */ f("div", { className: "ds:min-w-0", "data-history-change": a.field, children: [
452
+ /* @__PURE__ */ e("span", { className: "ds:sr-only", children: w(a) }),
453
+ /* @__PURE__ */ f(
454
+ "div",
455
+ {
456
+ "aria-hidden": "true",
457
+ className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]",
458
+ children: [
459
+ a.field === "status" ? k(a.from) : m(b, !1),
460
+ /* @__PURE__ */ e(
461
+ Nn,
462
+ {
463
+ className: "ds:size-4 ds:shrink-0 ds:text-[color:var(--muted-foreground)] ds:rtl:rotate-180",
464
+ "aria-hidden": "true"
465
+ }
466
+ ),
467
+ a.field === "status" ? k(a.to) : m(A, !0)
468
+ ]
469
+ }
470
+ )
471
+ ] });
472
+ }, N = (a) => {
473
+ switch (a.kind) {
474
+ case "created":
475
+ return {
476
+ title: s(P("history.created")),
477
+ type: "success",
478
+ icon: /* @__PURE__ */ e(wn, { size: 16, "aria-hidden": "true" })
479
+ };
480
+ case "confirmedByPatient": {
481
+ const y = rt.confirmed.Icon;
482
+ return {
483
+ title: s(P("history.confirmedByPatient")),
484
+ type: "success",
485
+ icon: /* @__PURE__ */ e(y, { size: 16, "aria-hidden": "true" })
486
+ };
487
+ }
488
+ case "deleted":
489
+ return {
490
+ title: s(P("history.deleted")),
491
+ type: "error",
492
+ icon: /* @__PURE__ */ e(Zt, { size: 16, "aria-hidden": "true" })
493
+ };
494
+ }
495
+ const m = fa(a), k = o ? m.filter((y) => !pa.has(y.field)) : m, b = new Set(k.map((y) => y.field)), A = [
496
+ ...a.kind === "edited" ? a.fields : [],
497
+ ...m.filter((y) => !b.has(y.field)).map((y) => y.field)
498
+ ].filter(
499
+ (y, M, W) => y !== "status" && !b.has(y) && W.indexOf(y) === M
500
+ ), T = A.length > 0 ? s(P("history.editedDetail"), {
501
+ fields: A.map((y) => s(P(`history.fields.${y}`))).join(", ")
502
+ }) : void 0, [S] = k;
503
+ if (k.length === 1 && S && !T)
504
+ switch (S.field) {
505
+ case "status": {
506
+ const { to: y } = S, M = y ? rt[y].Icon : Ne;
507
+ return {
508
+ title: s(P("history.status")),
509
+ type: y === "cancelled" || y === "absent" ? "warning" : "neutral",
510
+ icon: /* @__PURE__ */ e(M, { size: 16, "aria-hidden": "true" }),
511
+ detail: v(S)
512
+ };
513
+ }
514
+ case "time":
515
+ return {
516
+ title: s(P("history.moved")),
517
+ type: "info",
518
+ icon: /* @__PURE__ */ e(pt, { size: 16, "aria-hidden": "true" }),
519
+ detail: v(S)
520
+ };
521
+ case "duration":
522
+ return {
523
+ title: s(P("history.resized")),
524
+ type: "info",
525
+ icon: /* @__PURE__ */ e(ct, { size: 16, "aria-hidden": "true" }),
526
+ detail: v(S)
527
+ };
528
+ default:
529
+ return {
530
+ title: s(P(`history.changed.${S.field}`)),
531
+ type: "neutral",
532
+ icon: /* @__PURE__ */ e(Ne, { size: 16, "aria-hidden": "true" }),
533
+ detail: v(S)
534
+ };
535
+ }
536
+ if (k.length > 0) {
537
+ const y = a.kind === "moved" ? {
538
+ title: "history.moved",
539
+ icon: /* @__PURE__ */ e(pt, { size: 16, "aria-hidden": "true" })
540
+ } : a.kind === "resized" ? {
541
+ title: "history.resized",
542
+ icon: /* @__PURE__ */ e(ct, { size: 16, "aria-hidden": "true" })
543
+ } : a.kind === "status" ? {
544
+ title: "history.status",
545
+ icon: (() => {
546
+ const M = rt[a.to].Icon;
547
+ return /* @__PURE__ */ e(M, { size: 16, "aria-hidden": "true" });
548
+ })()
549
+ } : {
550
+ title: "history.edited",
551
+ icon: /* @__PURE__ */ e(Ne, { size: 16, "aria-hidden": "true" })
552
+ };
553
+ return {
554
+ title: s(P(y.title)),
555
+ type: a.kind === "moved" || a.kind === "resized" ? "info" : a.kind === "status" && (a.to === "cancelled" || a.to === "absent") ? "warning" : "neutral",
556
+ icon: y.icon,
557
+ detail: /* @__PURE__ */ f("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
558
+ /* @__PURE__ */ e(
559
+ "dl",
560
+ {
561
+ "aria-label": s(P("history.changesLabel")),
562
+ className: "ds:m-0 ds:grid ds:grid-cols-[auto_minmax(0,1fr)] ds:items-baseline ds:gap-x-[var(--spacing-sm)] ds:gap-y-[var(--spacing-xs)]",
563
+ children: k.map((M) => /* @__PURE__ */ f("div", { className: "ds:contents", children: [
564
+ /* @__PURE__ */ e("dt", { className: "type-label ds:text-[color:var(--muted-foreground)]", children: s(P(`history.fields.${M.field}`)) }),
565
+ /* @__PURE__ */ e("dd", { className: "ds:m-0 ds:min-w-0", children: v(M) })
566
+ ] }, M.field))
567
+ }
568
+ ),
569
+ T ? /* @__PURE__ */ e("p", { className: "ds:m-0", children: T }) : null
570
+ ] })
571
+ };
572
+ }
573
+ return {
574
+ title: s(P("history.edited")),
575
+ type: "neutral",
576
+ icon: /* @__PURE__ */ e(Ne, { size: 16, "aria-hidden": "true" }),
577
+ detail: T || (i ? /* @__PURE__ */ e("span", { className: "ds:text-[color:var(--muted-foreground)]", children: s(P("history.notRecorded")) }) : void 0)
578
+ };
579
+ };
580
+ return t.length === 0 ? /* @__PURE__ */ e(
581
+ kn,
582
+ {
583
+ variant: "first-use",
584
+ size: "sm",
585
+ title: s(P("historyEmpty"))
586
+ }
587
+ ) : /* @__PURE__ */ e(Oe, { order: "newest-first", "aria-label": s(P("historyTitle")), children: da(t).map((a) => {
588
+ const m = N(a);
589
+ return /* @__PURE__ */ f(
590
+ Oe.Event,
591
+ {
592
+ eventId: a.id,
593
+ type: m.type,
594
+ className: "ds:[column-gap:var(--spacing-sm)] ds:[padding-block-end:var(--spacing-lg)] ds:before:bg-[var(--primary)]",
595
+ children: [
596
+ /* @__PURE__ */ e(Oe.Dot, { icon: m.icon }),
597
+ /* @__PURE__ */ e(
598
+ Oe.Content,
599
+ {
600
+ title: m.title,
601
+ description: m.detail,
602
+ className: "ds:[padding-block-end:0] ds:[&>[data-component=card]]:border-[color:var(--card-border)] ds:[&>[data-component=card]]:shadow-[var(--shadow-card)]",
603
+ actor: a.actor.trim() ? { name: a.actor } : void 0,
604
+ children: /* @__PURE__ */ f("span", { className: "ds:mt-[var(--spacing-sm)] ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
605
+ /* @__PURE__ */ e(
606
+ bt,
607
+ {
608
+ "aria-hidden": "true",
609
+ className: "ds:size-4 ds:shrink-0 ds:text-[color:var(--muted-foreground)]"
610
+ }
611
+ ),
612
+ /* @__PURE__ */ e(
613
+ Oe.Timestamp,
614
+ {
615
+ date: a.atIso,
616
+ relative: !1,
617
+ locale: h
618
+ }
619
+ )
620
+ ] })
621
+ }
622
+ )
623
+ ]
624
+ },
625
+ a.id
626
+ );
627
+ }) });
628
+ }
629
+ const ya = {
630
+ confirmed: "success",
631
+ waiting: "info",
632
+ in_care: "accentSoft",
633
+ done: "success",
634
+ cancelled: "error",
635
+ absent: "warning"
636
+ };
637
+ function ba({ event: t }) {
638
+ const { t: n } = B("ui"), i = (s) => `calendarWorkspace.details.indicators.${s}`, o = [];
639
+ return t.isBookedOnline && o.push({
640
+ id: "online",
641
+ icon: /* @__PURE__ */ e(xn, { "aria-hidden": "true" }),
642
+ label: n(i("bookedOnline")),
643
+ variant: "info"
644
+ }), t.hasUnassignedPatient && o.push({
645
+ id: "unassigned",
646
+ icon: /* @__PURE__ */ e(Sn, { "aria-hidden": "true" }),
647
+ label: n(i("unassignedPatient")),
648
+ variant: "warning"
649
+ }), t.hasHighlightedAnamnesis && o.push({
650
+ id: "anamnesis",
651
+ icon: /* @__PURE__ */ e(kt, { "aria-hidden": "true" }),
652
+ label: n(i("anamnesis")),
653
+ variant: "accentSoft"
654
+ }), t.hasBillableAmount && o.push({
655
+ id: "billable",
656
+ icon: /* @__PURE__ */ e(In, { "aria-hidden": "true" }),
657
+ label: n(i("billable")),
658
+ variant: "warning"
659
+ }), t.isTelehealth && o.push({
660
+ id: "telehealth",
661
+ icon: /* @__PURE__ */ e(wt, { "aria-hidden": "true" }),
662
+ label: n(i("telehealth")),
663
+ variant: "info"
664
+ }), t.isRecurring && o.push({
665
+ id: "recurring",
666
+ icon: /* @__PURE__ */ e(en, { "aria-hidden": "true" }),
667
+ label: n(i("recurring")),
668
+ variant: "info"
669
+ }), o.length === 0 ? null : /* @__PURE__ */ e("span", { className: "ds:flex ds:flex-wrap ds:gap-[var(--spacing-2xs)]", children: o.map((s) => /* @__PURE__ */ e(
670
+ Xe,
671
+ {
672
+ variant: s.variant,
673
+ size: "sm",
674
+ leading: s.icon,
675
+ children: s.label
676
+ },
677
+ s.id
678
+ )) });
679
+ }
680
+ function ka({
681
+ name: t,
682
+ avatarSrc: n,
683
+ unresolved: i = !1,
684
+ status: o,
685
+ flags: s,
686
+ age: d,
687
+ onOpenPatient: p,
688
+ highlightedAnamnesisCount: h = 0,
689
+ expiredAnamnesisCount: c = 0,
690
+ anamnesisAnswers: r = [],
691
+ locale: l
692
+ }) {
693
+ const { t: g, i18n: w } = B("ui"), v = (b) => `calendarWorkspace.details.${b}`, { optionFor: N } = yt(o), a = o ? N(o) : void 0, m = h, k = c;
694
+ return /* @__PURE__ */ f("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-md)] ds:pb-0", children: [
695
+ /* @__PURE__ */ f("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
696
+ /* @__PURE__ */ e(ut, { name: t, src: n }),
697
+ /* @__PURE__ */ f("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)] ds:[min-inline-size:0]", children: [
698
+ /* @__PURE__ */ f("span", { className: "ds:flex ds:flex-wrap ds:items-baseline ds:gap-[var(--spacing-2xs)] ds:text-start", children: [
699
+ p ? /* @__PURE__ */ e(L, { size: "sm", intent: "link", onClick: () => p(), children: t }) : /* @__PURE__ */ e("span", { className: "ds:font-[var(--font-weight-semibold)] ds:truncate", children: t }),
700
+ d !== void 0 ? /* @__PURE__ */ e("span", { className: "type-body-sm ds:text-[color:var(--muted-foreground)]", children: g(v("patientAge"), { n: d }) }) : null
701
+ ] }),
702
+ i ? /* @__PURE__ */ e("span", { className: "type-body-sm ds:text-start ds:text-[color:var(--muted-foreground)]", children: g(v("patientNotLoaded")) }) : null,
703
+ o && a ? /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(
704
+ Xe,
705
+ {
706
+ variant: ya[o],
707
+ size: "sm",
708
+ leading: a.icon,
709
+ children: a.label
710
+ }
711
+ ) }) : null,
712
+ /* @__PURE__ */ e(ba, { event: s })
713
+ ] })
714
+ ] }),
715
+ m + k > 0 ? /* @__PURE__ */ f(
716
+ $,
717
+ {
718
+ variant: "warning",
719
+ announce: "off",
720
+ icon: /* @__PURE__ */ e(kt, { "aria-hidden": "true" }),
721
+ children: [
722
+ /* @__PURE__ */ e($.Title, { as: "p", children: g(v("anamnesisTitle")) }),
723
+ /* @__PURE__ */ e($.Description, { children: [
724
+ m > 0 ? g(v("anamnesisHighlighted"), { n: m }) : null,
725
+ k > 0 ? g(v("anamnesisExpired"), { n: k }) : null
726
+ ].filter((b) => b !== null).join(" · ") }),
727
+ r.length > 0 ? (
728
+ /* Question · yes or no · answer · interview date, as the
729
+ platform's details dialog lists them. A list, not a
730
+ Description, which renders a <p>. */
731
+ /* @__PURE__ */ e("ul", { className: "type-body-sm ds:m-0 ds:mt-[var(--spacing-xs)] ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-2xs)] ds:p-0", children: r.map((b) => /* @__PURE__ */ f("li", { className: "ds:text-start", children: [
732
+ /* @__PURE__ */ e("span", { className: "ds:font-[var(--font-weight-semibold)]", children: b.question }),
733
+ ` · ${g(v(b.yes ? "anamnesisYes" : "anamnesisNo"))}`,
734
+ b.answer ? ` · ${b.answer}` : "",
735
+ ` · ${Ge(l ?? w.language, b.interviewIso)}`
736
+ ] }, b.question)) })
737
+ ) : null
738
+ ]
739
+ }
740
+ ) : null
741
+ ] });
742
+ }
743
+ const wa = {
744
+ SU: 0,
745
+ MO: 1,
746
+ TU: 2,
747
+ WE: 3,
748
+ TH: 4,
749
+ FR: 5,
750
+ SA: 6
751
+ }, Na = ["MO", "TU", "WE", "TH", "FR", "SA", "SU"], xa = {
752
+ daily: "recurrenceEveryDay",
753
+ weekly: "recurrenceEveryWeek",
754
+ monthly: "recurrenceEveryMonth",
755
+ yearly: "recurrenceEveryYear"
756
+ }, Sa = {
757
+ 1: "recurrenceOrdinal1",
758
+ 2: "recurrenceOrdinal2",
759
+ 3: "recurrenceOrdinal3",
760
+ 4: "recurrenceOrdinal4"
761
+ }, Ia = /^(-1|[1-4])?(MO|TU|WE|TH|FR|SA|SU)$/;
762
+ function Wt(t, n) {
763
+ const i = new Date(2026, 0, 4 + wa[t]);
764
+ return new Intl.DateTimeFormat(n, { weekday: "long" }).format(i);
765
+ }
766
+ function Aa(t, n, i) {
767
+ const o = Fe(n);
768
+ if (!Number.isFinite(o.getTime())) return;
769
+ const s = i ? Fe(i) : void 0, d = s && s.getFullYear() === o.getFullYear();
770
+ try {
771
+ return new Intl.DateTimeFormat(t, {
772
+ day: "numeric",
773
+ month: "long",
774
+ ...d ? {} : { year: "numeric" }
775
+ }).format(o);
776
+ } catch {
777
+ return;
778
+ }
779
+ }
780
+ function Ta(t, n, i, o) {
781
+ const s = la[i.frequency];
782
+ if (!s) return;
783
+ const d = (N) => `calendarWorkspace.editor.${N}`, p = (N) => `calendarWorkspace.details.${N}`, h = xa[i.frequency], c = h && (i.interval ?? 1) > 1 ? t(d(h), { count: i.interval }) : t(d(s)), r = (i.byDay ?? []).map((N) => Ia.exec(N)).filter((N) => N !== null), l = i.frequency === "weekly" ? Na.filter(
784
+ (N) => r.some(([, a, m]) => !a && m === N)
785
+ ) : [], g = i.frequency === "monthly" || i.frequency === "yearly" ? r.find(([, N]) => N) : void 0;
786
+ let w = c;
787
+ if (l.length > 0)
788
+ w = t(p("seriesOnDays"), {
789
+ every: c,
790
+ days: new Intl.ListFormat(n, { type: "conjunction" }).format(
791
+ l.map((N) => Wt(N, n))
792
+ )
793
+ });
794
+ else if (g) {
795
+ const [, N, a] = g, m = Wt(a, n);
796
+ w = N === "-1" ? t(p("seriesOnLast"), { every: c, weekday: m }) : t(p("seriesOnNth"), {
797
+ every: c,
798
+ weekday: m,
799
+ ordinal: t(d(Sa[N]))
800
+ });
801
+ }
802
+ if (i.count !== void 0)
803
+ return t(p("seriesRule"), {
804
+ frequency: w,
805
+ count: i.count
806
+ });
807
+ const v = i.untilIso ? Aa(n, i.untilIso, o) : void 0;
808
+ return v ? t(p("seriesUntil"), { rule: w, date: v }) : w;
809
+ }
810
+ function gt({
811
+ eyebrow: t,
812
+ heading: n,
813
+ facts: i
814
+ }) {
815
+ return /* @__PURE__ */ f(ie, { children: [
816
+ /* @__PURE__ */ e(Se.Eyebrow, { children: t }),
817
+ /* @__PURE__ */ e(Se.Heading, { children: n }),
818
+ i && i.length > 0 ? /* @__PURE__ */ e(Se.Body, { children: /* @__PURE__ */ e("ul", { className: "ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-2xs)] ds:p-0 type-body-sm", children: i.map((o, s) => /* @__PURE__ */ e(
819
+ "li",
820
+ {
821
+ className: o.muted ? "ds:text-[color:var(--muted-foreground)]" : void 0,
822
+ children: o.text
823
+ },
824
+ s
825
+ )) }) }) : null
826
+ ] });
827
+ }
828
+ const Ea = "ds:inline-flex ds:cursor-pointer ds:rounded-[var(--radius-full)] ds:p-0 ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]";
829
+ function Ut({
830
+ id: t,
831
+ eyebrow: n,
832
+ heading: i,
833
+ facts: o,
834
+ children: s
835
+ }) {
836
+ return /* @__PURE__ */ f(Se, { children: [
837
+ /* @__PURE__ */ e(Se.Trigger, { asChild: !0, children: /* @__PURE__ */ e("button", { type: "button", "data-chip-hover": t, className: Ea, children: s }) }),
838
+ /* @__PURE__ */ e(Se.Content, { side: "bottom", align: "start", size: "sm", children: /* @__PURE__ */ e(gt, { eyebrow: n, heading: i, facts: o }) })
839
+ ] });
840
+ }
841
+ const u = (t) => `calendarWorkspace.details.${t}`, Da = {
842
+ missing: "consentMissing",
843
+ requested: "consentRequested",
844
+ signed: "consentSigned"
845
+ }, nn = (t) => /* @__PURE__ */ e("a", { href: `tel:${t.replace(/\s/g, "")}`, dir: "ltr", children: t }), an = (t) => /* @__PURE__ */ e("a", { href: `mailto:${t}`, dir: "ltr", children: t }), sn = (t, n, i) => new Intl.NumberFormat(t, { style: "currency", currency: i }).format(n);
846
+ function Ye({
847
+ href: t,
848
+ action: n,
849
+ icon: i,
850
+ children: o
851
+ }) {
852
+ const s = Ke(t);
853
+ return s ? /* @__PURE__ */ e(
854
+ L,
855
+ {
856
+ asChild: !0,
857
+ size: "sm",
858
+ intent: "outline",
859
+ "data-action": n,
860
+ startIcon: i,
861
+ children: /* @__PURE__ */ e("a", { href: s, children: o })
862
+ }
863
+ ) : null;
864
+ }
865
+ function qt({ rows: t }) {
866
+ const n = t.filter((i) => !!i);
867
+ return n.length === 0 ? null : /* @__PURE__ */ e(je, { layout: "inline", density: "compact", children: n.map((i) => /* @__PURE__ */ f(
868
+ je.Row,
869
+ {
870
+ "data-row": i.id,
871
+ icon: i.icon,
872
+ children: [
873
+ /* @__PURE__ */ e(je.Term, { children: i.label }),
874
+ /* @__PURE__ */ e(je.Detail, { children: i.value })
875
+ ]
876
+ },
877
+ i.id
878
+ )) });
879
+ }
880
+ function Ca({
881
+ details: t,
882
+ locale: n,
883
+ currency: i,
884
+ now: o,
885
+ mapsLink: s = !1,
886
+ shortcuts: d,
887
+ onRequestSignature: p,
888
+ onSignOnDevice: h,
889
+ onOpenPatient: c
890
+ }) {
891
+ const { t: r } = B("ui"), { patient: l, signing: g, money: w, booking: v } = t;
892
+ if (!l) return null;
893
+ const N = (g == null ? void 0 : g.consents) ?? [], a = g && (g.required > 0 || N.length > 0) ? g : void 0, m = ((a == null ? void 0 : a.toComplete) ?? 0) > 0, k = a ? [
894
+ {
895
+ text: m ? a.requestedVia === "sms" ? r(u("signingRequestedSms")) : a.requestedVia === "email" ? r(u("signingRequestedEmail")) : r(u("signingNotRequested")) : r(u("signingAllSigned"))
896
+ },
897
+ ...a.aesSetUp ? [] : [{ text: r(u("aesMissing")), muted: !0 }]
898
+ ] : [], b = ((g == null ? void 0 : g.required) ?? 0) > 0 && m, A = !!(d != null && d.advancedSignatureUrl) && ((g == null ? void 0 : g.required) ?? 0) > 0 && !(g != null && g.aesSetUp), T = !!p && b, S = !!h && b, y = l.highlightedAnamnesisCount ?? 0, M = l.expiredAnamnesisCount ?? 0, W = (l.highlightedAnamnesisAnswers ?? []).map((R) => ({
899
+ text: [
900
+ R.question,
901
+ r(u(R.yes ? "anamnesisYes" : "anamnesisNo")),
902
+ R.answer,
903
+ Ge(n, R.interviewIso)
904
+ ].filter(Boolean).join(" · ")
905
+ })), se = tn(l), re = ua(l) || se, G = N.map((R) => ({
906
+ id: `consent-${R.id}`,
907
+ label: R.name,
908
+ value: r(u(Da[R.state]))
909
+ })), U = [
910
+ ...l.dobIso ? [
911
+ {
912
+ id: "dob",
913
+ label: r(u("dob")),
914
+ icon: /* @__PURE__ */ e(Qn, {}),
915
+ value: `${Ge(n, l.dobIso)} ${r(
916
+ u("patientAge"),
917
+ {
918
+ n: sa(l.dobIso, o)
919
+ }
920
+ )}`
921
+ }
922
+ ] : [],
923
+ ...ca(l).map((R, ee) => {
924
+ const te = R.label === "mobile" || R.label === "home" || R.label === "work";
925
+ return {
926
+ id: `phone-${ee}`,
927
+ label: r(te ? `calendarWorkspace.print.phoneLabels.${R.label}` : u("phone")),
928
+ icon: R.label === "mobile" ? /* @__PURE__ */ e(Ft, {}) : /* @__PURE__ */ e(En, {}),
929
+ value: nn(R.number)
930
+ };
931
+ }),
932
+ ...l.email ? [
933
+ {
934
+ id: "email",
935
+ label: r(u("email")),
936
+ icon: /* @__PURE__ */ e(Dn, {}),
937
+ value: an(l.email)
938
+ }
939
+ ] : [],
940
+ /* P27: hidden patient details leave the address out, and with it the
941
+ row: no map link and no empty "address" line. */
942
+ ...s && se ? [
943
+ {
944
+ id: "address",
945
+ label: r(u("address")),
946
+ icon: /* @__PURE__ */ e(Cn, {}),
947
+ value: /* @__PURE__ */ e(
948
+ "a",
949
+ {
950
+ href: ma(l),
951
+ target: "_blank",
952
+ rel: "noopener noreferrer",
953
+ "aria-label": `${r(u("mapsLink"))}: ${re}`,
954
+ children: re
955
+ }
956
+ )
957
+ }
958
+ ] : []
959
+ ], V = (w == null ? void 0 : w.unpaidAmount) ?? 0, X = (w == null ? void 0 : w.billableAmount) ?? 0, J = (v == null ? void 0 : v.paidOnlineAmount) ?? 0, Z = (R, ee, te, Ie, he, ne) => /* @__PURE__ */ e(
960
+ Ut,
961
+ {
962
+ id: te,
963
+ eyebrow: r(u("hoverBilling")),
964
+ heading: r(u(Ie), {
965
+ amount: sn(n, ee, i)
966
+ }),
967
+ facts: [{ text: r(u(he)) }],
968
+ children: /* @__PURE__ */ e(
969
+ Tn,
970
+ {
971
+ "data-chip": te,
972
+ state: R,
973
+ amount: ee,
974
+ currency: i,
975
+ locale: n,
976
+ size: "md",
977
+ showLabel: !0,
978
+ label: ne,
979
+ showIcon: !1
980
+ }
981
+ )
982
+ }
983
+ );
984
+ return /* @__PURE__ */ e(
985
+ Xt,
986
+ {
987
+ "data-card": "patient",
988
+ name: l.name,
989
+ avatarUrl: l.avatarSrc,
990
+ locale: n,
991
+ surface: "elevated",
992
+ density: "compact",
993
+ flags: {
994
+ unsignedDocumentsCount: (a == null ? void 0 : a.toComplete) ?? 0,
995
+ highlightedAnamnesisCount: y
996
+ },
997
+ flagHover: {
998
+ ...a ? {
999
+ unsignedDocuments: /* @__PURE__ */ e(
1000
+ gt,
1001
+ {
1002
+ eyebrow: r(u("sectionSigning")),
1003
+ heading: a.toComplete === 1 ? r(u("signingToSignOne")) : r(u("signingToSignMany"), {
1004
+ n: a.toComplete
1005
+ }),
1006
+ facts: k
1007
+ }
1008
+ )
1009
+ } : {},
1010
+ highlightedAnamnesis: /* @__PURE__ */ e(
1011
+ gt,
1012
+ {
1013
+ eyebrow: r(u("anamnesisTitle")),
1014
+ heading: r(u("anamnesisHighlighted"), { n: y }),
1015
+ facts: W
1016
+ }
1017
+ )
1018
+ },
1019
+ extraChips: V > 0 || X > 0 || J > 0 || M > 0 || A || T || S || c ? /* @__PURE__ */ f(ie, { children: [
1020
+ /* @__PURE__ */ f("span", { className: "ds:inline-flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]", children: [
1021
+ V > 0 ? Z(
1022
+ "debt",
1023
+ V,
1024
+ "unpaid",
1025
+ "hoverUnpaidHeading",
1026
+ "hoverUnpaidFact"
1027
+ ) : null,
1028
+ X > 0 ? Z(
1029
+ "to-invoice",
1030
+ X,
1031
+ "billable",
1032
+ "hoverBillableHeading",
1033
+ "hoverBillableFact"
1034
+ ) : null,
1035
+ J > 0 ? Z(
1036
+ "settled",
1037
+ J,
1038
+ "paidOnline",
1039
+ "hoverPaidOnlineHeading",
1040
+ "hoverPaidOnlineFact",
1041
+ /* A deposit is settled money, but "Settled" hides where
1042
+ it came from: the chip says what its hover card says. */
1043
+ r(u("paidOnline"))
1044
+ ) : null
1045
+ ] }),
1046
+ T ? /* @__PURE__ */ e(
1047
+ L,
1048
+ {
1049
+ size: "sm",
1050
+ intent: "outline",
1051
+ "data-action": ue.requestSignature,
1052
+ startIcon: /* @__PURE__ */ e(Rn, { "aria-hidden": "true" }),
1053
+ onClick: () => p(t.eventId),
1054
+ children: r(u("signingRequest"))
1055
+ }
1056
+ ) : null,
1057
+ S ? /* @__PURE__ */ e(
1058
+ L,
1059
+ {
1060
+ size: "sm",
1061
+ intent: "outline",
1062
+ "data-action": ue.signOnDevice,
1063
+ "aria-label": `${r(u("signingRequest"))}: ${r(u("signingOnDevice"))}`,
1064
+ startIcon: /* @__PURE__ */ e(Ft, { "aria-hidden": "true" }),
1065
+ onClick: () => h(t.eventId),
1066
+ children: r(u("signingOnDevice"))
1067
+ }
1068
+ ) : null,
1069
+ c ? /* @__PURE__ */ e(
1070
+ L,
1071
+ {
1072
+ size: "sm",
1073
+ intent: "outline",
1074
+ "data-action": ue.openPatient,
1075
+ startIcon: /* @__PURE__ */ e(Pn, { "aria-hidden": "true" }),
1076
+ onClick: () => c(t.eventId),
1077
+ children: r(u("openPatient"))
1078
+ }
1079
+ ) : null,
1080
+ A && (d != null && d.advancedSignatureUrl) ? /* @__PURE__ */ e(
1081
+ Ye,
1082
+ {
1083
+ href: d.advancedSignatureUrl,
1084
+ action: ue.advancedSignature,
1085
+ icon: /* @__PURE__ */ e(Mn, { "aria-hidden": "true" }),
1086
+ children: r(u("aesSetUp"))
1087
+ }
1088
+ ) : null,
1089
+ d != null && d.unlockPaymentsUrl && (V > 0 || X > 0) ? /* @__PURE__ */ e(
1090
+ Ye,
1091
+ {
1092
+ href: d.unlockPaymentsUrl,
1093
+ action: ue.unlockPayments,
1094
+ icon: /* @__PURE__ */ e(Ln, { "aria-hidden": "true" }),
1095
+ children: r(u("unlockPayments"))
1096
+ }
1097
+ ) : null,
1098
+ M > 0 ? /* @__PURE__ */ e(
1099
+ Ut,
1100
+ {
1101
+ id: "anamnesisExpired",
1102
+ eyebrow: r(u("anamnesisTitle")),
1103
+ heading: r(u("anamnesisExpired"), { n: M }),
1104
+ facts: [{ text: r(u("hoverAnamnesisExpiredFact")) }],
1105
+ children: /* @__PURE__ */ e(
1106
+ Xe,
1107
+ {
1108
+ "data-chip": "anamnesisExpired",
1109
+ variant: "warning",
1110
+ size: "md",
1111
+ leading: /* @__PURE__ */ e(kt, {}),
1112
+ children: r(u("anamnesisExpired"), { n: M })
1113
+ }
1114
+ )
1115
+ }
1116
+ ) : null,
1117
+ M > 0 && (d != null && d.renewAnamnesisUrl) ? /* @__PURE__ */ e(
1118
+ Ye,
1119
+ {
1120
+ href: d.renewAnamnesisUrl,
1121
+ action: ue.renewAnamnesis,
1122
+ icon: /* @__PURE__ */ e(On, { "aria-hidden": "true" }),
1123
+ children: r(u("anamnesisRenew"))
1124
+ }
1125
+ ) : null
1126
+ ] }) : void 0,
1127
+ visibleFieldOrder: [...U, ...G].map((R) => R.id),
1128
+ sections: U.length > 0 || G.length > 0 ? [
1129
+ ...U.length > 0 ? [{ id: "contact", heading: r(u("sectionPatient")), fields: U }] : [],
1130
+ ...G.length > 0 ? [
1131
+ {
1132
+ id: "consents",
1133
+ heading: r(u("sectionSigning")),
1134
+ fields: G
1135
+ }
1136
+ ] : []
1137
+ ] : void 0
1138
+ }
1139
+ );
1140
+ }
1141
+ function Ra({
1142
+ details: t,
1143
+ locale: n,
1144
+ currency: i,
1145
+ operator: o,
1146
+ chair: s,
1147
+ description: d,
1148
+ privacy: p = !1,
1149
+ history: h
1150
+ }) {
1151
+ const { t: c } = B("ui"), { appointment: r, booking: l, patient: g } = t, w = (y) => c(`calendarWorkspace.editor.${y}`), v = new Date(r.startIso), N = new Date(v.getTime() + r.durationMin * 6e4), a = Number.isFinite(v.getTime()), { recurrence: m } = r, k = m && Ta(c, n, m, r.startIso), b = l ? [
1152
+ l.bookedAtIso && {
1153
+ id: "bookedAt",
1154
+ label: c(u("bookedAt")),
1155
+ value: /* @__PURE__ */ e(
1156
+ _t,
1157
+ {
1158
+ value: l.bookedAtIso,
1159
+ format: "absolute",
1160
+ shape: "bare",
1161
+ locale: n,
1162
+ absoluteFormat: ft
1163
+ }
1164
+ )
1165
+ },
1166
+ l.typedName && {
1167
+ id: "bookingName",
1168
+ label: c(u("bookingName")),
1169
+ value: l.typedName
1170
+ },
1171
+ l.phone && {
1172
+ id: "bookingPhone",
1173
+ label: c(u("bookingPhone")),
1174
+ value: nn(l.phone)
1175
+ },
1176
+ l.email && {
1177
+ id: "bookingEmail",
1178
+ label: c(u("bookingEmail")),
1179
+ value: an(l.email)
1180
+ },
1181
+ l.note && {
1182
+ id: "bookingNote",
1183
+ label: c(u("bookingNote")),
1184
+ value: l.note
1185
+ },
1186
+ /* With a patient the amount is a chip on the patient card. */
1187
+ !g && l.paidOnlineAmount !== void 0 && {
1188
+ id: "paidOnline",
1189
+ label: c(u("paidOnline")),
1190
+ value: sn(n, l.paidOnlineAmount, i)
1191
+ }
1192
+ ] : [], A = p ? b.filter((y) => y && y.id === "bookedAt") : b, T = A.some(Boolean), S = l || r.bookedOnline || h == null ? void 0 : h.filter(
1193
+ (y) => y.kind === "created" && y.actor.trim() !== ""
1194
+ ).sort((y, M) => Date.parse(y.atIso) - Date.parse(M.atIso))[0];
1195
+ return /* @__PURE__ */ f(
1196
+ pe,
1197
+ {
1198
+ "data-card": "appointment",
1199
+ title: c(u("sectionAppointment")),
1200
+ headingLevel: 3,
1201
+ children: [
1202
+ d,
1203
+ /* @__PURE__ */ e(
1204
+ qt,
1205
+ {
1206
+ rows: [
1207
+ a && {
1208
+ id: "date",
1209
+ label: w("date"),
1210
+ icon: /* @__PURE__ */ e(_n, {}),
1211
+ value: Ge(n, v)
1212
+ },
1213
+ a && {
1214
+ id: "time",
1215
+ label: c(u("time")),
1216
+ icon: /* @__PURE__ */ e(ct, {}),
1217
+ value: r.allDay ? w("allDay") : ia(n, v, N)
1218
+ },
1219
+ !r.allDay && {
1220
+ id: "duration",
1221
+ label: w("duration"),
1222
+ icon: /* @__PURE__ */ e(Fn, {}),
1223
+ value: `${r.durationMin} ${w("durationUnit")}`
1224
+ },
1225
+ r.isTelehealth && {
1226
+ id: "type",
1227
+ label: w("type"),
1228
+ icon: /* @__PURE__ */ e(wt, {}),
1229
+ value: w("typeTelehealth")
1230
+ },
1231
+ o && {
1232
+ id: "operator",
1233
+ label: c(u("operator")),
1234
+ /* A person, as on the grid: the avatar fills the icon slot. */
1235
+ icon: /* @__PURE__ */ e(ut, { name: o.name, src: o.avatarSrc, size: "xs" }),
1236
+ value: o.name
1237
+ },
1238
+ s && {
1239
+ id: "chair",
1240
+ label: c(u("chair")),
1241
+ icon: /* @__PURE__ */ e(zt, {}),
1242
+ value: /* @__PURE__ */ e(Xe, { variant: "neutral", size: "sm", leading: /* @__PURE__ */ e(zt, {}), children: s.name })
1243
+ },
1244
+ r.branchLabel && {
1245
+ id: "branch",
1246
+ label: w("branch"),
1247
+ icon: /* @__PURE__ */ e(zn, {}),
1248
+ value: r.branchLabel
1249
+ },
1250
+ S && {
1251
+ id: "createdBy",
1252
+ label: c(u("createdBy")),
1253
+ icon: /* @__PURE__ */ e(ut, { name: S.actor, size: "xs" }),
1254
+ value: /* @__PURE__ */ f("span", { className: "ds:inline-flex ds:flex-wrap ds:items-baseline ds:gap-x-[var(--spacing-xs)]", children: [
1255
+ /* @__PURE__ */ e("span", { children: S.actor }),
1256
+ " ",
1257
+ /* @__PURE__ */ e("span", { className: "ds:text-[color:var(--muted-foreground)]", children: /* @__PURE__ */ e(
1258
+ _t,
1259
+ {
1260
+ value: S.atIso,
1261
+ format: "absolute",
1262
+ shape: "bare",
1263
+ locale: n,
1264
+ absoluteFormat: ft
1265
+ }
1266
+ ) })
1267
+ ] })
1268
+ },
1269
+ k && {
1270
+ id: "series",
1271
+ label: c(u("seriesLabel")),
1272
+ icon: /* @__PURE__ */ e(en, {}),
1273
+ value: k
1274
+ }
1275
+ ]
1276
+ }
1277
+ ),
1278
+ T ? /* @__PURE__ */ f(
1279
+ "div",
1280
+ {
1281
+ "data-block": "booking",
1282
+ className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]",
1283
+ children: [
1284
+ /* @__PURE__ */ e("h4", { className: "ds:m-0 type-label ds:text-[color:var(--muted-foreground)]", children: c(u("sectionBooking")) }),
1285
+ /* @__PURE__ */ e(qt, { rows: A })
1286
+ ]
1287
+ }
1288
+ ) : null
1289
+ ]
1290
+ }
1291
+ );
1292
+ }
1293
+ function Pa({
1294
+ details: t,
1295
+ locale: n,
1296
+ currency: i,
1297
+ privacy: o = !1,
1298
+ carePlanUrl: s
1299
+ }) {
1300
+ const { t: d } = B("ui"), { care: p } = t, h = o || p == null ? void 0 : p.plan;
1301
+ return !p || !h && p.lines.length === 0 ? null : /* @__PURE__ */ f(
1302
+ pe,
1303
+ {
1304
+ "data-card": "treatments",
1305
+ title: d(u("sectionTreatments")),
1306
+ headingLevel: 3,
1307
+ children: [
1308
+ h ? /* @__PURE__ */ f("span", { className: "ds:flex ds:flex-wrap ds:items-center ds:justify-between ds:gap-[var(--spacing-xs)]", children: [
1309
+ /* @__PURE__ */ f("span", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)] type-title-item", children: [
1310
+ /* @__PURE__ */ e(
1311
+ mt,
1312
+ {
1313
+ "aria-hidden": "true",
1314
+ className: "ds:size-4 ds:shrink-0 ds:text-[color:var(--muted-foreground)]"
1315
+ }
1316
+ ),
1317
+ h.number ? d(u("planLine"), { number: h.number, name: h.name }) : h.name
1318
+ ] }),
1319
+ s ? /* @__PURE__ */ e(
1320
+ Ye,
1321
+ {
1322
+ href: s,
1323
+ action: ue.carePlan,
1324
+ icon: /* @__PURE__ */ e(mt, { "aria-hidden": "true" }),
1325
+ children: d(u("openCarePlan"))
1326
+ }
1327
+ ) : null
1328
+ ] }) : null,
1329
+ p.lines.length > 0 ? /* @__PURE__ */ e(
1330
+ Qt,
1331
+ {
1332
+ lines: p.lines.map(({ entryId: c, careId: r, ...l }) => ({
1333
+ id: c,
1334
+ ...l
1335
+ })),
1336
+ locale: n,
1337
+ currency: i
1338
+ }
1339
+ ) : null
1340
+ ]
1341
+ }
1342
+ );
1343
+ }
1344
+ const jt = 3;
1345
+ function Ma({
1346
+ preview: t,
1347
+ onOpenNotes: n,
1348
+ locale: i
1349
+ }) {
1350
+ const { t: o } = B("ui"), s = ot(), d = t.status ?? "ready", p = _(!1);
1351
+ me(() => {
1352
+ p.current && (d !== "loading" && (p.current = !1), _e(s));
1353
+ }, [d, s]);
1354
+ const h = t.total ?? (d === "ready" ? t.notes.length : null), c = Math.max(0, (h ?? 0) - jt), r = c > 0 ? o(u("notesMore"), { n: c }) : o(u("notesPreviewOpen"));
1355
+ return /* @__PURE__ */ f(
1356
+ pe,
1357
+ {
1358
+ "data-card": "notes",
1359
+ headingId: s,
1360
+ headingLevel: 3,
1361
+ title: h === null ? o("notesPanel.title") : o(u("notesPreviewTitle"), { count: h }),
1362
+ headerAction: n && (h ?? 0) > 0 ? /* @__PURE__ */ f("span", { className: "ds:relative ds:inline-flex", children: [
1363
+ /* @__PURE__ */ e(
1364
+ Yt,
1365
+ {
1366
+ icon: /* @__PURE__ */ e(Hn, { "aria-hidden": "true" }),
1367
+ intent: "outline",
1368
+ size: "sm",
1369
+ "data-action": "open-patient-notes",
1370
+ "aria-label": r,
1371
+ tooltip: r,
1372
+ onClick: () => n()
1373
+ }
1374
+ ),
1375
+ c > 0 ? (
1376
+ /* Decorative: the button's name already says the count. */
1377
+ /* @__PURE__ */ e(
1378
+ An,
1379
+ {
1380
+ variant: "outline",
1381
+ size: "sm",
1382
+ background: "surface",
1383
+ count: c,
1384
+ "aria-hidden": "true",
1385
+ className: "ds:pointer-events-none ds:absolute ds:-top-[var(--spacing-2xs)] ds:-end-[var(--spacing-2xs)]"
1386
+ }
1387
+ )
1388
+ ) : null
1389
+ ] }) : void 0,
1390
+ children: [
1391
+ d === "error" ? /* @__PURE__ */ f($, { variant: "error", children: [
1392
+ /* @__PURE__ */ e($.Description, { children: o("notesPanel.loadError") }),
1393
+ t.onRetry ? /* @__PURE__ */ e($.Action, { children: /* @__PURE__ */ e(
1394
+ L,
1395
+ {
1396
+ intent: "secondary",
1397
+ size: "sm",
1398
+ onClick: () => {
1399
+ var l;
1400
+ p.current = !0, (l = t.onRetry) == null || l.call(t);
1401
+ },
1402
+ children: o("notesPanel.retry")
1403
+ }
1404
+ ) }) : null
1405
+ ] }) : null,
1406
+ t.notes.length === 0 && d === "loading" ? /* @__PURE__ */ f(ie, { children: [
1407
+ /* @__PURE__ */ e("span", { role: "status", className: "ds:sr-only", children: o("notesPanel.loading") }),
1408
+ /* @__PURE__ */ e(lt, { notes: [], loading: !0, loadingRows: 2 })
1409
+ ] }) : d !== "error" || t.notes.length > 0 ? (
1410
+ /* A note click, or Enter or Space on it, goes straight to that note
1411
+ in the Notes tool; the header button opens the tool at the top. */
1412
+ /* @__PURE__ */ e(
1413
+ lt,
1414
+ {
1415
+ notes: t.notes,
1416
+ maxItems: jt,
1417
+ locale: i,
1418
+ "aria-labelledby": s,
1419
+ onNoteActivate: n,
1420
+ emptyState: /* @__PURE__ */ e("p", { className: "ds:m-0 type-body-sm ds:text-[color:var(--muted-foreground)]", children: o(u("notesPreviewEmpty")) })
1421
+ }
1422
+ )
1423
+ ) : null
1424
+ ]
1425
+ }
1426
+ );
1427
+ }
1428
+ const La = vt("ds:flex ds:h-full ds:min-h-0 ds:flex-col"), Oa = vt(
1429
+ "ds:flex ds:shrink-0 ds:items-center ds:justify-end ds:gap-[var(--spacing-xs)] ds:border-t ds:border-[color:var(--border)] ds:p-[var(--spacing-sm)]"
1430
+ ), _a = vt(
1431
+ "ds:shrink-0 ds:rounded-[var(--radius-md)] ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]"
1432
+ ), K = "ds:sm:[min-block-size:var(--accessible-target-floor,0px)]", Fa = "ds:sm:[&>button]:[min-block-size:var(--accessible-target-floor,0px)]", za = [
1433
+ "ds:sm:[&_button:has(svg.lucide-ellipsis)]:[min-block-size:var(--accessible-target-floor,0px)]",
1434
+ "ds:[&_button:has(svg.lucide-ellipsis)]:[min-inline-size:var(--accessible-target-floor,auto)]"
1435
+ ].join(" "), rn = ["40%", "33%", "50%", "25%"], Ha = [
1436
+ "bill",
1437
+ "folder",
1438
+ "template",
1439
+ "empty",
1440
+ "identification",
1441
+ "webcam"
1442
+ ], $a = {
1443
+ bill: /* @__PURE__ */ e(Vn, { "aria-hidden": "true" }),
1444
+ folder: /* @__PURE__ */ e(Gn, { "aria-hidden": "true" }),
1445
+ template: /* @__PURE__ */ e(Yn, { "aria-hidden": "true" }),
1446
+ empty: /* @__PURE__ */ e(Kn, { "aria-hidden": "true" }),
1447
+ identification: /* @__PURE__ */ e(ea, { "aria-hidden": "true" }),
1448
+ webcam: /* @__PURE__ */ e(jn, { "aria-hidden": "true" })
1449
+ }, D = (t) => `calendarWorkspace.details.${t}`;
1450
+ function Kt({
1451
+ children: t,
1452
+ startIcon: n,
1453
+ overflowItems: i,
1454
+ "data-action": o,
1455
+ intent: s,
1456
+ background: d,
1457
+ size: p,
1458
+ hideLabel: h
1459
+ }) {
1460
+ return /* @__PURE__ */ f(qe.Root, { children: [
1461
+ /* @__PURE__ */ e(vn, { label: t, side: "top", children: /* @__PURE__ */ e(qe.Trigger, { asChild: !0, children: /* @__PURE__ */ e(
1462
+ L,
1463
+ {
1464
+ intent: s,
1465
+ background: d,
1466
+ size: p,
1467
+ "data-action": o,
1468
+ className: K,
1469
+ startIcon: n,
1470
+ "aria-haspopup": "menu",
1471
+ endIcon: /* @__PURE__ */ e(qn, { "aria-hidden": "true" }),
1472
+ children: h ? /* @__PURE__ */ e("span", { className: "ds:sr-only", children: t }) : t
1473
+ }
1474
+ ) }) }),
1475
+ /* @__PURE__ */ e(qe.Content, { align: "end", children: i.map((c) => /* @__PURE__ */ e(
1476
+ qe.Item,
1477
+ {
1478
+ "data-action": c.action,
1479
+ startIcon: c.icon,
1480
+ onSelect: c.onSelect,
1481
+ children: c.label
1482
+ },
1483
+ c.label
1484
+ )) })
1485
+ ] });
1486
+ }
1487
+ function Ba() {
1488
+ const { t } = B("ui");
1489
+ return /* @__PURE__ */ f(ie, { children: [
1490
+ /* @__PURE__ */ e("span", { role: "status", className: "ds:sr-only", children: t("common.loading") }),
1491
+ /* @__PURE__ */ f(
1492
+ "div",
1493
+ {
1494
+ "aria-hidden": "true",
1495
+ className: "ds:flex ds:min-h-0 ds:flex-1 ds:flex-col ds:gap-[var(--spacing-sm)] ds:overflow-hidden ds:p-[var(--spacing-md)] ds:[&>*]:shrink-0",
1496
+ children: [
1497
+ /* @__PURE__ */ e(
1498
+ Xt,
1499
+ {
1500
+ name: "",
1501
+ loading: !0,
1502
+ surface: "elevated",
1503
+ density: "compact"
1504
+ }
1505
+ ),
1506
+ /* @__PURE__ */ f(pe, { title: t(D("sectionAppointment")), headingLevel: 3, children: [
1507
+ /* @__PURE__ */ e(Gt, { loading: !0, maxLines: 2 }),
1508
+ /* @__PURE__ */ e("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: rn.map((n, i) => /* @__PURE__ */ f(
1509
+ "div",
1510
+ {
1511
+ className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]",
1512
+ children: [
1513
+ /* @__PURE__ */ e(
1514
+ we,
1515
+ {
1516
+ variant: "rounded",
1517
+ stagger: i + 2,
1518
+ width: "var(--spacing-md)",
1519
+ height: "var(--spacing-md)",
1520
+ className: "ds:shrink-0"
1521
+ }
1522
+ ),
1523
+ /* @__PURE__ */ e(
1524
+ we,
1525
+ {
1526
+ variant: "text",
1527
+ size: "sm",
1528
+ stagger: i + 2,
1529
+ width: n
1530
+ }
1531
+ )
1532
+ ]
1533
+ },
1534
+ n
1535
+ )) })
1536
+ ] }),
1537
+ /* @__PURE__ */ e(pe, { title: t("notesPanel.title"), headingLevel: 3, children: /* @__PURE__ */ e(lt, { notes: [], loading: !0, loadingRows: 2 }) }),
1538
+ /* @__PURE__ */ e(pe, { title: t(D("sectionTreatments")), headingLevel: 3, children: /* @__PURE__ */ e(Qt, { lines: [], loading: !0 }) })
1539
+ ]
1540
+ }
1541
+ ),
1542
+ /* @__PURE__ */ f(
1543
+ "div",
1544
+ {
1545
+ "aria-hidden": "true",
1546
+ className: "ds:flex ds:shrink-0 ds:items-center ds:gap-[var(--spacing-sm)] ds:border-t ds:border-[color:var(--border)] ds:p-[var(--spacing-md)]",
1547
+ children: [
1548
+ /* @__PURE__ */ e(we, { variant: "rounded", width: "33%", height: "var(--spacing-xl)" }),
1549
+ /* @__PURE__ */ e(
1550
+ we,
1551
+ {
1552
+ variant: "rounded",
1553
+ stagger: 1,
1554
+ height: "var(--spacing-xl)",
1555
+ className: "ds:flex-1"
1556
+ }
1557
+ )
1558
+ ]
1559
+ }
1560
+ )
1561
+ ] });
1562
+ }
1563
+ function Wa({
1564
+ history: t,
1565
+ locale: n,
1566
+ onRetry: i,
1567
+ noteUnrecordedEdits: o,
1568
+ privacy: s
1569
+ }) {
1570
+ var v;
1571
+ const { t: d } = B("ui"), p = t.status ?? (t.entries ? "ready" : "loading"), h = p === "error" ? void 0 : t.entries, c = p === "loading" || p !== "error" && !h, [r, l] = H(!1);
1572
+ xe(() => l(!0), []);
1573
+ let g = "";
1574
+ c ? g = d("common.loading") : h && (g = h.length === 0 ? d(D("historyEmpty")) : d(D("historyLoaded"), { n: h.length }));
1575
+ let w;
1576
+ return p === "error" ? w = /* @__PURE__ */ f("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1577
+ /* @__PURE__ */ e($, { variant: "error", children: /* @__PURE__ */ e($.Description, { children: ((v = t.message) == null ? void 0 : v.trim()) || d("emptyState.error.description") }) }),
1578
+ i ? /* @__PURE__ */ e(
1579
+ L,
1580
+ {
1581
+ intent: "outline",
1582
+ "data-action": "retry-history",
1583
+ onClick: () => i(),
1584
+ children: d("emptyState.error.cta")
1585
+ }
1586
+ ) : null
1587
+ ] }) : c || !h ? w = /* @__PURE__ */ e(
1588
+ "div",
1589
+ {
1590
+ "aria-hidden": "true",
1591
+ className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
1592
+ children: rn.slice(0, 3).map((N, a) => /* @__PURE__ */ f(
1593
+ "div",
1594
+ {
1595
+ className: "ds:flex ds:items-start ds:gap-[var(--spacing-sm)]",
1596
+ children: [
1597
+ /* @__PURE__ */ e(
1598
+ we,
1599
+ {
1600
+ variant: "circular",
1601
+ stagger: a,
1602
+ width: "var(--spacing-xl)",
1603
+ height: "var(--spacing-xl)",
1604
+ className: "ds:shrink-0"
1605
+ }
1606
+ ),
1607
+ /* @__PURE__ */ e(
1608
+ we,
1609
+ {
1610
+ variant: "rounded",
1611
+ stagger: a,
1612
+ width: N,
1613
+ height: "var(--spacing-2xl)"
1614
+ }
1615
+ )
1616
+ ]
1617
+ },
1618
+ N
1619
+ ))
1620
+ }
1621
+ ) : w = /* @__PURE__ */ e(
1622
+ va,
1623
+ {
1624
+ history: h,
1625
+ locale: n,
1626
+ noteUnrecordedEdits: o,
1627
+ privacy: s
1628
+ }
1629
+ ), /* @__PURE__ */ f(ie, { children: [
1630
+ /* @__PURE__ */ e("span", { role: "status", className: "ds:sr-only", children: r ? g : "" }),
1631
+ w
1632
+ ] });
1633
+ }
1634
+ function Ua({
1635
+ read: t,
1636
+ refreshing: n,
1637
+ currency: i,
1638
+ now: o,
1639
+ locale: s,
1640
+ shownTitle: d,
1641
+ headingId: p,
1642
+ enter: h,
1643
+ live: c,
1644
+ statusControl: r,
1645
+ patientId: l = ((ze) => (ze = t.patient) == null ? void 0 : ze.id)(),
1646
+ operator: g,
1647
+ chair: w,
1648
+ privacy: v = !1,
1649
+ privacyTitle: N,
1650
+ mapsLink: a,
1651
+ notesPreview: m,
1652
+ onOpenNotes: k,
1653
+ history: b,
1654
+ onOpenHistory: A,
1655
+ noteUnrecordedEdits: T = !1,
1656
+ readOnly: S = !1,
1657
+ onStatusChange: y,
1658
+ allowedStatuses: M = Ot,
1659
+ onDescriptionChange: W,
1660
+ onAssignPatient: se,
1661
+ onEdit: re,
1662
+ onMove: G,
1663
+ onCopy: U,
1664
+ onDelete: V,
1665
+ onJoinTelehealth: X,
1666
+ onWhatsApp: J,
1667
+ whatsappUrl: Z,
1668
+ onBuyWhatsApp: R,
1669
+ createTaskUrl: ee,
1670
+ onRequestSignature: te,
1671
+ onSignOnDevice: Ie,
1672
+ onOpenPatient: he,
1673
+ shortcuts: ne,
1674
+ documents: oe
1675
+ }) {
1676
+ var Ct, Rt;
1677
+ const { t: x } = B("ui"), { eventId: O } = t, [Qe] = H(h), fe = { details: t, locale: s, currency: i }, E = b ? b.eventId !== void 0 && b.eventId !== O ? { status: "loading" } : b : t.history ? { entries: t.history } : void 0, He = (m == null ? void 0 : m.patientId) === void 0 || m.patientId === l, ge = m ? He ? m : l ? { notes: [], status: "loading", total: null } : void 0 : void 0, de = !!W && !S && !v, [Ae, ae] = H(!1), [Te, Q] = H(!1), le = Ae && E !== void 0, $e = Te && de, Ee = () => {
1678
+ le || !E || (ae(!0), A == null || A(O));
1679
+ }, Be = _({ history: !1, editor: !1 });
1680
+ me(() => {
1681
+ const I = Be.current;
1682
+ Be.current = { history: le, editor: $e };
1683
+ const ke = I.history && E === void 0, Pt = I.editor && !de;
1684
+ ke && ae(!1), Pt && Q(!1), (ke || Pt) && _e(p);
1685
+ });
1686
+ const ve = _(null), F = _(!1), De = (E == null ? void 0 : E.status) ?? (E != null && E.entries ? "ready" : "loading");
1687
+ me(() => {
1688
+ F.current && (De !== "loading" && (F.current = !1), ht(ve.current));
1689
+ }, [De]);
1690
+ const [Y, Ce] = H(t.appointment.name ?? "");
1691
+ xe(() => {
1692
+ Ce(t.appointment.name ?? "");
1693
+ }, [t.appointment.name]);
1694
+ const [Re, ce] = H(""), [ye, Pe] = H(!1), [C, q] = H(), be = _(null);
1695
+ xe(() => {
1696
+ Te && (ce(Y), q(void 0));
1697
+ }, [Te]);
1698
+ const We = async () => {
1699
+ if (!W) return;
1700
+ const I = Re.trim();
1701
+ Pe(!0), q(void 0);
1702
+ try {
1703
+ await W(I, O), Ce(I), Q(!1);
1704
+ } catch (ke) {
1705
+ q(
1706
+ dt(ke, x(D("descriptionSaveFailed")))
1707
+ );
1708
+ } finally {
1709
+ Pe(!1);
1710
+ }
1711
+ }, [j, Je] = H(t.appointment.status);
1712
+ xe(() => {
1713
+ Je(t.appointment.status);
1714
+ }, [t.appointment.status]);
1715
+ const Nt = _(n);
1716
+ me(() => {
1717
+ const I = Nt.current && !n;
1718
+ Nt.current = n, I && (Je(t.appointment.status), Ce(t.appointment.name ?? ""));
1719
+ }, [n]);
1720
+ const Ue = Ot.filter(
1721
+ (I) => M.includes(I)
1722
+ ), Me = yt(j, {
1723
+ statuses: Ue,
1724
+ /* Shown so the control can say it, but not a choice. */
1725
+ disabledStatuses: j && !Ue.includes(j) ? [j] : []
1726
+ }), Le = !!y && !S && Ue.some((I) => I !== j), on = async (I) => {
1727
+ if (!(!y || !bn(I))) {
1728
+ try {
1729
+ await y(I, O);
1730
+ } catch (ke) {
1731
+ throw new Error(dt(ke, x(D("statusSaveFailed"))));
1732
+ }
1733
+ Je(I);
1734
+ }
1735
+ }, xt = v ? void 0 : Z, St = Ha.filter(
1736
+ (I) => oe == null ? void 0 : oe.kinds.includes(I)
1737
+ ), dn = (((Ct = t.care) == null ? void 0 : Ct.lines.length) ?? 0) > 0, Ze = l !== void 0 && l !== "", et = x(D("status")), It = `${et}: ${Me.option.label}`, tt = _(null), At = _(Le);
1738
+ me(() => {
1739
+ const I = At.current && !Le;
1740
+ At.current = Le, I && (tt.current ? ht(tt.current) : _e(p));
1741
+ });
1742
+ const Tt = Le ? /* @__PURE__ */ e(
1743
+ yn,
1744
+ {
1745
+ ref: r,
1746
+ value: Me.value,
1747
+ options: Me.options,
1748
+ size: "sm",
1749
+ workflowLabel: et,
1750
+ className: `ds:[&>button]:bg-[color:var(--background)] ${Fa}`,
1751
+ "aria-label": It,
1752
+ onValueChange: on
1753
+ }
1754
+ ) : j ? (
1755
+ /* Named as the control is, "Status: Confirmed": the small display
1756
+ prints the value alone. */
1757
+ /* @__PURE__ */ e(
1758
+ "div",
1759
+ {
1760
+ ref: tt,
1761
+ role: "group",
1762
+ "aria-label": It,
1763
+ tabIndex: -1,
1764
+ "data-status-display": "",
1765
+ className: _a(),
1766
+ children: /* @__PURE__ */ e(
1767
+ Jt,
1768
+ {
1769
+ value: Me.value,
1770
+ size: "sm",
1771
+ workflowLabel: et,
1772
+ option: Me.option
1773
+ }
1774
+ )
1775
+ }
1776
+ )
1777
+ ) : null, z = [];
1778
+ !S && se && !Ze && z.push([
1779
+ "assign-patient",
1780
+ /* @__PURE__ */ e(
1781
+ L,
1782
+ {
1783
+ intent: "primary",
1784
+ "data-action": "assign-patient",
1785
+ className: K,
1786
+ startIcon: /* @__PURE__ */ e($n, { "aria-hidden": "true" }),
1787
+ onClick: () => se(O),
1788
+ children: x("calendarWorkspace.inc1.bookings.assignPatient")
1789
+ },
1790
+ "assign"
1791
+ )
1792
+ ]), X && z.push([
1793
+ "join-telehealth",
1794
+ /* @__PURE__ */ e(
1795
+ L,
1796
+ {
1797
+ intent: "primary",
1798
+ "data-action": "join-telehealth",
1799
+ className: K,
1800
+ startIcon: /* @__PURE__ */ e(wt, { "aria-hidden": "true" }),
1801
+ onClick: () => X(O),
1802
+ children: x(D("joinTelehealth"))
1803
+ },
1804
+ "join"
1805
+ )
1806
+ ]), !S && re && z.push([
1807
+ "edit-appointment",
1808
+ /* @__PURE__ */ e(
1809
+ L,
1810
+ {
1811
+ "data-action": "edit-appointment",
1812
+ className: K,
1813
+ startIcon: /* @__PURE__ */ e(Ne, { "aria-hidden": "true" }),
1814
+ onClick: () => re(O),
1815
+ children: x("calendarWorkspace.editor.editTitle")
1816
+ },
1817
+ "edit"
1818
+ )
1819
+ ]), !S && G && z.push([
1820
+ "move-appointment",
1821
+ /* @__PURE__ */ e(
1822
+ L,
1823
+ {
1824
+ "data-action": "move-appointment",
1825
+ className: K,
1826
+ startIcon: /* @__PURE__ */ e(pt, { "aria-hidden": "true" }),
1827
+ onClick: () => G(O),
1828
+ children: x(D("move"))
1829
+ },
1830
+ "move"
1831
+ )
1832
+ ]), !S && U && z.push([
1833
+ "copy-appointment",
1834
+ dn ? /* @__PURE__ */ e(
1835
+ Kt,
1836
+ {
1837
+ "data-action": "copy-appointment",
1838
+ "data-overflow-tip": !1,
1839
+ startIcon: /* @__PURE__ */ e($t, { "aria-hidden": "true" }),
1840
+ overflowItems: [
1841
+ {
1842
+ label: x("calendarWorkspace.editor.duplicateAppointmentOnly"),
1843
+ icon: /* @__PURE__ */ e(Bn, { "aria-hidden": "true" }),
1844
+ action: "copy-appointment-only",
1845
+ onSelect: () => U(!1, O)
1846
+ },
1847
+ {
1848
+ label: x("calendarWorkspace.editor.duplicateWithTreatments"),
1849
+ icon: /* @__PURE__ */ e(mt, { "aria-hidden": "true" }),
1850
+ action: "copy-appointment-with-treatments",
1851
+ onSelect: () => U(!0, O)
1852
+ }
1853
+ ],
1854
+ children: x(D("copy"))
1855
+ },
1856
+ "copy"
1857
+ ) : /* @__PURE__ */ e(
1858
+ L,
1859
+ {
1860
+ "data-action": "copy-appointment",
1861
+ className: K,
1862
+ startIcon: /* @__PURE__ */ e($t, { "aria-hidden": "true" }),
1863
+ onClick: () => U(!1, O),
1864
+ children: x(D("copy"))
1865
+ },
1866
+ "copy"
1867
+ )
1868
+ ]), oe && St.length > 0 && z.push([
1869
+ "open-create-document",
1870
+ /* @__PURE__ */ e(
1871
+ Kt,
1872
+ {
1873
+ "data-action": "open-create-document",
1874
+ "data-overflow-tip": !1,
1875
+ startIcon: /* @__PURE__ */ e(Wn, { "aria-hidden": "true" }),
1876
+ overflowItems: St.map((I) => ({
1877
+ label: x(D(`documents.${I}`)),
1878
+ icon: $a[I],
1879
+ action: `create-document-${I}`,
1880
+ onSelect: () => oe.onCreate(I, O)
1881
+ })),
1882
+ children: x(D("documents.label"))
1883
+ },
1884
+ "documents"
1885
+ )
1886
+ ]), J ? z.push([
1887
+ "open-whatsapp",
1888
+ /* @__PURE__ */ e(
1889
+ L,
1890
+ {
1891
+ "data-action": "open-whatsapp",
1892
+ className: K,
1893
+ startIcon: /* @__PURE__ */ e(st, { "aria-hidden": "true" }),
1894
+ onClick: () => J(O),
1895
+ children: x(D("remindWhatsApp"))
1896
+ },
1897
+ "whatsapp"
1898
+ )
1899
+ ]) : Ke(xt) ? z.push([
1900
+ "open-whatsapp",
1901
+ /* @__PURE__ */ e(
1902
+ L,
1903
+ {
1904
+ asChild: !0,
1905
+ "data-action": "open-whatsapp",
1906
+ className: K,
1907
+ startIcon: /* @__PURE__ */ e(st, { "aria-hidden": "true" }),
1908
+ children: /* @__PURE__ */ e(
1909
+ "a",
1910
+ {
1911
+ href: Ke(xt),
1912
+ target: "_blank",
1913
+ rel: "noopener noreferrer",
1914
+ children: x(D("remindWhatsApp"))
1915
+ }
1916
+ )
1917
+ },
1918
+ "whatsapp"
1919
+ )
1920
+ ]) : R && !Z && z.push([
1921
+ "buy-whatsapp",
1922
+ /* @__PURE__ */ e(
1923
+ L,
1924
+ {
1925
+ "data-action": "buy-whatsapp",
1926
+ className: K,
1927
+ startIcon: /* @__PURE__ */ e(st, { "aria-hidden": "true" }),
1928
+ onClick: () => R(O),
1929
+ children: x(D("buyWhatsApp"))
1930
+ },
1931
+ "buy-whatsapp"
1932
+ )
1933
+ ]);
1934
+ const Et = Ke(ee);
1935
+ Et && z.push([
1936
+ "create-task",
1937
+ /* @__PURE__ */ e(
1938
+ L,
1939
+ {
1940
+ asChild: !0,
1941
+ "data-action": "create-task",
1942
+ className: K,
1943
+ startIcon: /* @__PURE__ */ e(Un, { "aria-hidden": "true" }),
1944
+ children: /* @__PURE__ */ e("a", { href: Et, children: x(D("createTask")) })
1945
+ },
1946
+ "task"
1947
+ )
1948
+ ]), !S && V && z.push([
1949
+ "delete-appointment",
1950
+ /* @__PURE__ */ e(
1951
+ L,
1952
+ {
1953
+ intent: "destructiveOutline",
1954
+ "data-action": "delete-appointment",
1955
+ className: K,
1956
+ startIcon: /* @__PURE__ */ e(Zt, { "aria-hidden": "true" }),
1957
+ onClick: () => V(O),
1958
+ children: x("calendarWorkspace.editor.delete")
1959
+ },
1960
+ "delete"
1961
+ )
1962
+ ]);
1963
+ const nt = z.map(([, I]) => I);
1964
+ c.current = {
1965
+ status: j ?? null,
1966
+ allowed: Le ? Ue : [],
1967
+ offered: z.map(([I]) => I),
1968
+ historyAvailable: E !== void 0,
1969
+ historyOpen: le,
1970
+ openHistory: Ee,
1971
+ closeHistory: () => ae(!1)
1972
+ };
1973
+ const Dt = x(D("historyBack"));
1974
+ return /* @__PURE__ */ e(
1975
+ "div",
1976
+ {
1977
+ className: `ds:flex ds:min-h-0 ds:flex-1 ds:flex-col ${Qe ? fn : ""}`,
1978
+ children: /* @__PURE__ */ f(it.Host, { children: [
1979
+ /* @__PURE__ */ e(
1980
+ Vt,
1981
+ {
1982
+ title: d,
1983
+ headingId: p,
1984
+ icon: /* @__PURE__ */ e(bt, { "aria-hidden": "true" }),
1985
+ sticky: !0,
1986
+ divider: !0,
1987
+ actions: E ? /* @__PURE__ */ e(
1988
+ Yt,
1989
+ {
1990
+ size: "sm",
1991
+ intent: "ghost",
1992
+ icon: /* @__PURE__ */ e(Ht, { "aria-hidden": "true" }),
1993
+ "aria-label": x(D("historyAction")),
1994
+ tooltip: x(D("historyAction")),
1995
+ "data-action": "open-history",
1996
+ onClick: Ee
1997
+ }
1998
+ ) : void 0
1999
+ }
2000
+ ),
2001
+ /* @__PURE__ */ e(
2002
+ "div",
2003
+ {
2004
+ tabIndex: 0,
2005
+ "aria-busy": n || void 0,
2006
+ className: "ds:[min-block-size:0] ds:flex-1 ds:overflow-y-auto",
2007
+ children: /* @__PURE__ */ f("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-md)]", children: [
2008
+ v ? /* @__PURE__ */ e(pn, { mask: N }) : t.patient ? /* @__PURE__ */ e(
2009
+ Ca,
2010
+ {
2011
+ ...fe,
2012
+ now: o,
2013
+ mapsLink: a,
2014
+ shortcuts: ne,
2015
+ onRequestSignature: te,
2016
+ onSignOnDevice: Ie,
2017
+ onOpenPatient: he
2018
+ }
2019
+ ) : (
2020
+ /* No patient card to carry the identity: a patient-less, an
2021
+ unassigned or an unresolved booking keeps the strip. */
2022
+ /* @__PURE__ */ e(
2023
+ ka,
2024
+ {
2025
+ name: t.appointment.title.trim() ? t.appointment.title : x(D("patientNotLoaded")),
2026
+ unresolved: Ze,
2027
+ status: j,
2028
+ flags: {
2029
+ isTelehealth: t.appointment.isTelehealth,
2030
+ isBookedOnline: t.appointment.bookedOnline,
2031
+ isRecurring: t.appointment.recurrence !== void 0,
2032
+ hasUnassignedPatient: t.appointment.bookedOnline && !Ze,
2033
+ hasHighlightedAnamnesis: !1,
2034
+ hasBillableAmount: (((Rt = t.money) == null ? void 0 : Rt.billableAmount) ?? 0) > 0
2035
+ },
2036
+ locale: s
2037
+ }
2038
+ )
2039
+ ),
2040
+ /* @__PURE__ */ e(
2041
+ Ra,
2042
+ {
2043
+ ...fe,
2044
+ operator: g,
2045
+ chair: w,
2046
+ privacy: v,
2047
+ history: (E == null ? void 0 : E.status) === "error" || E == null ? void 0 : E.entries,
2048
+ description: (
2049
+ /* Not keyed on the text: the pencil must survive a save,
2050
+ so the sub-view can hand focus back to it. An empty
2051
+ read-only description prints nothing. Privacy hides the
2052
+ text and the pencil. */
2053
+ v ? Y ? /* @__PURE__ */ e(Lt, { block: "description" }) : void 0 : Y || W && !S ? /* @__PURE__ */ e(
2054
+ Gt,
2055
+ {
2056
+ "data-block": "description",
2057
+ role: "group",
2058
+ "aria-label": x("calendarWorkspace.editor.description"),
2059
+ value: Y,
2060
+ editLabel: x(D("editDescription")),
2061
+ onEdit: W && !S ? () => Q(!0) : void 0
2062
+ }
2063
+ ) : void 0
2064
+ )
2065
+ }
2066
+ ),
2067
+ ge && v ? /* @__PURE__ */ e(
2068
+ pe,
2069
+ {
2070
+ "data-card": "notes",
2071
+ title: x("notesPanel.title"),
2072
+ headingLevel: 3,
2073
+ children: /* @__PURE__ */ e(Lt, {})
2074
+ }
2075
+ ) : ge ? /* @__PURE__ */ e(
2076
+ Ma,
2077
+ {
2078
+ preview: ge,
2079
+ onOpenNotes: He ? k : void 0,
2080
+ locale: s
2081
+ }
2082
+ ) : null,
2083
+ /* @__PURE__ */ e(
2084
+ Pa,
2085
+ {
2086
+ ...fe,
2087
+ privacy: v,
2088
+ carePlanUrl: ne == null ? void 0 : ne.carePlanUrl
2089
+ }
2090
+ )
2091
+ ] })
2092
+ }
2093
+ ),
2094
+ Tt || nt.length > 0 ? (
2095
+ /* The body scrolls; the status and the actions stay put. The
2096
+ status keeps its own segment and never folds. The actions fold
2097
+ to icons, then into More, never onto a second line. */
2098
+ /* @__PURE__ */ f("div", { className: Oa(), children: [
2099
+ Tt,
2100
+ nt.length > 0 ? /* @__PURE__ */ e(
2101
+ hn,
2102
+ {
2103
+ label: x(D("actionsLabel")),
2104
+ overflow: "menu",
2105
+ collapseToIcons: !0,
2106
+ background: "surface",
2107
+ size: "sm",
2108
+ className: `ds:min-w-0 ds:flex-1 ds:text-end ${za}`,
2109
+ children: nt
2110
+ }
2111
+ ) : null
2112
+ ] })
2113
+ ) : null,
2114
+ E ? /* @__PURE__ */ e(
2115
+ it,
2116
+ {
2117
+ ref: ve,
2118
+ open: le,
2119
+ icon: /* @__PURE__ */ e(Ht, { "aria-hidden": "true" }),
2120
+ title: x(D("historyTitle")),
2121
+ backLabel: Dt,
2122
+ headingLevel: 3,
2123
+ onBack: () => ae(!1),
2124
+ "data-details-subview": "history",
2125
+ children: /* @__PURE__ */ e("div", { className: "ds:-m-[var(--panel-subview-inset)] ds:p-[var(--spacing-md)]", children: /* @__PURE__ */ e(
2126
+ Wa,
2127
+ {
2128
+ history: E,
2129
+ locale: s,
2130
+ noteUnrecordedEdits: T,
2131
+ privacy: v,
2132
+ onRetry: E.onRetry ? () => {
2133
+ var I;
2134
+ F.current = !0, (I = E.onRetry) == null || I.call(E);
2135
+ } : void 0
2136
+ }
2137
+ ) })
2138
+ }
2139
+ ) : null,
2140
+ de ? /* @__PURE__ */ e(
2141
+ it,
2142
+ {
2143
+ open: $e,
2144
+ icon: /* @__PURE__ */ e(Ne, { "aria-hidden": "true" }),
2145
+ title: x(D("editDescription")),
2146
+ backLabel: Dt,
2147
+ headingLevel: 3,
2148
+ initialFocusRef: be,
2149
+ onBack: () => {
2150
+ ye || Q(!1);
2151
+ },
2152
+ "data-details-subview": "description",
2153
+ footer: /* @__PURE__ */ f(ie, { children: [
2154
+ /* @__PURE__ */ e(
2155
+ L,
2156
+ {
2157
+ intent: "secondary",
2158
+ disabled: ye,
2159
+ onClick: () => Q(!1),
2160
+ children: x(D("noteCancel"))
2161
+ }
2162
+ ),
2163
+ /* @__PURE__ */ e(
2164
+ L,
2165
+ {
2166
+ intent: "primary",
2167
+ "data-action": "save-description",
2168
+ loading: ye,
2169
+ onClick: () => void We(),
2170
+ children: x(D("descriptionSave"))
2171
+ }
2172
+ )
2173
+ ] }),
2174
+ children: /* @__PURE__ */ f("div", { className: "ds:-m-[var(--panel-subview-inset)] ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-md)]", children: [
2175
+ C ? /* @__PURE__ */ e($, { variant: "error", children: /* @__PURE__ */ e($.Description, { children: C }) }) : null,
2176
+ /* @__PURE__ */ e(
2177
+ gn,
2178
+ {
2179
+ ref: be,
2180
+ value: Re,
2181
+ minRows: 6,
2182
+ autoResize: !0,
2183
+ "aria-label": x("calendarWorkspace.editor.description"),
2184
+ onChange: (I) => ce(I.target.value)
2185
+ }
2186
+ )
2187
+ ] })
2188
+ }
2189
+ ) : null
2190
+ ] })
2191
+ }
2192
+ );
2193
+ }
2194
+ const qa = ln(function({
2195
+ state: n,
2196
+ onRetry: i,
2197
+ patientId: o,
2198
+ operator: s,
2199
+ chair: d,
2200
+ currency: p = "EUR",
2201
+ now: h,
2202
+ locale: c,
2203
+ title: r,
2204
+ privacy: l = !1,
2205
+ privacyTitle: g,
2206
+ mapsLink: w,
2207
+ notesPreview: v,
2208
+ onOpenNotes: N,
2209
+ history: a,
2210
+ onOpenHistory: m,
2211
+ noteUnrecordedEdits: k,
2212
+ readOnly: b = !1,
2213
+ onStatusChange: A,
2214
+ allowedStatuses: T,
2215
+ onDescriptionChange: S,
2216
+ onAssignPatient: y,
2217
+ onEdit: M,
2218
+ onMove: W,
2219
+ onCopy: se,
2220
+ onDelete: re,
2221
+ onJoinTelehealth: G,
2222
+ onWhatsApp: U,
2223
+ whatsappUrl: V,
2224
+ onBuyWhatsApp: X,
2225
+ createTaskUrl: J,
2226
+ onRequestSignature: Z,
2227
+ onSignOnDevice: R,
2228
+ onOpenPatient: ee,
2229
+ shortcuts: te,
2230
+ documents: Ie,
2231
+ id: he,
2232
+ className: ne,
2233
+ ...oe
2234
+ }, ze) {
2235
+ var ye, Pe;
2236
+ const { t: x, i18n: O } = B("ui"), Qe = ot(), fe = he ?? Qe, E = ot(), He = c ?? O.language, ge = !l && (r != null && r.trim()) ? r : x(D("region")), de = n.status === "ready" ? n.read : void 0, Ae = n.status === "ready" ? n.read.eventId : n.eventId, ae = _(
2237
+ void 0
2238
+ ), Te = ae.current !== void 0 && ae.current !== "ready";
2239
+ xe(() => {
2240
+ ae.current = n.status;
2241
+ }, [n.status]);
2242
+ const Q = !!i && (n.status === "error" || n.status === "refused" && n.retryable === !0), le = _(null), $e = Mt(() => mn(ze, le), [ze]), Ee = _(!1);
2243
+ typeof document < "u" && (Ee.current = ((ye = le.current) == null ? void 0 : ye.contains(document.activeElement)) ?? !1);
2244
+ const Be = de ? `ready:${de.eventId}` : n.status, ve = _(!1);
2245
+ me(() => {
2246
+ ve.current ? (n.status !== "loading" && (ve.current = !1), _e(E)) : Ee.current && _e(E);
2247
+ }, [Be, E]);
2248
+ const F = _(null);
2249
+ de || (F.current = null);
2250
+ const De = _(null), Y = _({ state: n, eventId: Ae, privacy: l, retryOffered: Q, onRetry: i });
2251
+ Y.current = { state: n, eventId: Ae, privacy: l, retryOffered: Q, onRetry: i };
2252
+ const Ce = Mt(
2253
+ () => ({
2254
+ getEventId: () => Y.current.eventId ?? null,
2255
+ getLoadStatus: () => Y.current.state.status,
2256
+ getAppointmentStatus: () => {
2257
+ var C;
2258
+ return ((C = F.current) == null ? void 0 : C.status) ?? null;
2259
+ },
2260
+ getAllowedStatuses: () => {
2261
+ var C;
2262
+ return [...((C = F.current) == null ? void 0 : C.allowed) ?? []];
2263
+ },
2264
+ getOfferedActions: () => {
2265
+ var C;
2266
+ return [...((C = F.current) == null ? void 0 : C.offered) ?? []];
2267
+ },
2268
+ isHistoryOpen: () => {
2269
+ var C;
2270
+ return ((C = F.current) == null ? void 0 : C.historyOpen) ?? !1;
2271
+ },
2272
+ isPrivacy: () => Y.current.privacy,
2273
+ openHistory: () => {
2274
+ var C;
2275
+ if (!((C = F.current) != null && C.historyAvailable))
2276
+ throw new Error("AppointmentDetailsPanel: History is not offered.");
2277
+ F.current.openHistory();
2278
+ },
2279
+ closeHistory: () => {
2280
+ var C;
2281
+ (C = F.current) == null || C.closeHistory();
2282
+ },
2283
+ setAppointmentStatus: (C) => {
2284
+ const q = F.current, be = De.current;
2285
+ if (!q || !be || q.allowed.length === 0)
2286
+ return at(
2287
+ new Error("AppointmentDetailsPanel: the status is read-only.")
2288
+ );
2289
+ if (C === q.status) return Promise.resolve();
2290
+ if (!q.allowed.includes(C))
2291
+ return at(
2292
+ new Error(`AppointmentDetailsPanel: "${C}" is not allowed.`)
2293
+ );
2294
+ const We = () => at(
2295
+ new Error("AppointmentDetailsPanel: a status save is in flight.")
2296
+ );
2297
+ if (be.getIsSaving()) return We();
2298
+ const j = be.setValue(C);
2299
+ return j === void 0 ? We() : j;
2300
+ },
2301
+ retry: () => {
2302
+ const { retryOffered: C, onRetry: q } = Y.current;
2303
+ if (!C || !q)
2304
+ throw new Error("AppointmentDetailsPanel: Retry is not offered.");
2305
+ q();
2306
+ }
2307
+ }),
2308
+ []
2309
+ );
2310
+ un(aa, Ce, fe);
2311
+ const Re = /* @__PURE__ */ e(
2312
+ Vt,
2313
+ {
2314
+ title: ge,
2315
+ headingId: E,
2316
+ icon: /* @__PURE__ */ e(bt, { "aria-hidden": "true" }),
2317
+ sticky: !0,
2318
+ divider: !0
2319
+ }
2320
+ );
2321
+ let ce;
2322
+ return n.status === "ready" ? ce = /* @__PURE__ */ e(
2323
+ Ua,
2324
+ {
2325
+ read: n.read,
2326
+ refreshing: n.refreshing === !0,
2327
+ currency: p,
2328
+ now: h ?? /* @__PURE__ */ new Date(),
2329
+ locale: He,
2330
+ shownTitle: ge,
2331
+ headingId: E,
2332
+ enter: Te,
2333
+ live: F,
2334
+ statusControl: De,
2335
+ patientId: o,
2336
+ operator: s,
2337
+ chair: d,
2338
+ privacy: l,
2339
+ privacyTitle: g,
2340
+ mapsLink: w,
2341
+ notesPreview: v,
2342
+ onOpenNotes: N,
2343
+ history: a,
2344
+ onOpenHistory: m,
2345
+ noteUnrecordedEdits: k,
2346
+ readOnly: b,
2347
+ onStatusChange: A,
2348
+ allowedStatuses: T,
2349
+ onDescriptionChange: S,
2350
+ onAssignPatient: y,
2351
+ onEdit: M,
2352
+ onMove: W,
2353
+ onCopy: se,
2354
+ onDelete: re,
2355
+ onJoinTelehealth: G,
2356
+ onWhatsApp: U,
2357
+ whatsappUrl: V,
2358
+ onBuyWhatsApp: X,
2359
+ createTaskUrl: J,
2360
+ onRequestSignature: Z,
2361
+ onSignOnDevice: R,
2362
+ onOpenPatient: ee,
2363
+ shortcuts: te,
2364
+ documents: Ie
2365
+ },
2366
+ n.read.eventId
2367
+ ) : n.status === "loading" ? ce = /* @__PURE__ */ f(ie, { children: [
2368
+ Re,
2369
+ /* @__PURE__ */ e(Ba, {})
2370
+ ] }) : ce = /* @__PURE__ */ f(ie, { children: [
2371
+ Re,
2372
+ /* @__PURE__ */ f("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-md)]", children: [
2373
+ /* @__PURE__ */ e($, { variant: n.status === "error" ? "error" : "warning", children: /* @__PURE__ */ e($.Description, { children: n.status === "error" ? ((Pe = n.message) == null ? void 0 : Pe.trim()) || x("emptyState.error.description") : n.reason }) }),
2374
+ Q ? /* @__PURE__ */ e(
2375
+ L,
2376
+ {
2377
+ intent: "outline",
2378
+ "data-action": "retry-load",
2379
+ onClick: () => {
2380
+ ve.current = !0, i == null || i();
2381
+ },
2382
+ children: x("emptyState.error.cta")
2383
+ }
2384
+ ) : null
2385
+ ] })
2386
+ ] }), /* @__PURE__ */ e(
2387
+ "div",
2388
+ {
2389
+ ref: $e,
2390
+ id: he,
2391
+ "data-component": "appointment-details-panel",
2392
+ "data-component-id": fe,
2393
+ "data-event-id": Ae,
2394
+ "data-status": n.status,
2395
+ "aria-busy": n.status === "loading" || void 0,
2396
+ className: La({ className: ne }),
2397
+ ...oe,
2398
+ children: ce
2399
+ }
2400
+ );
2401
+ });
2402
+ qa.displayName = "AppointmentDetailsPanel";
2403
+ function ps({
2404
+ eventId: t,
2405
+ load: n,
2406
+ reloadKey: i
2407
+ }) {
2408
+ const { t: o } = B("ui"), s = _("");
2409
+ s.current = o("emptyState.error.description");
2410
+ const d = _(n);
2411
+ me(() => {
2412
+ d.current = n;
2413
+ });
2414
+ const [p, h] = H(0), [c, r] = H(), l = JSON.stringify([i ?? null, p]), [g, w] = H({ eventId: t, count: 0 }), v = g.eventId === t ? g.count : g.count + 1;
2415
+ g.eventId !== t && w({ eventId: t, count: v }), xe(() => {
2416
+ if (t === null) {
2417
+ r(void 0);
2418
+ return;
2419
+ }
2420
+ const k = new AbortController(), b = (A) => {
2421
+ k.signal.aborted || r({ eventId: t, selection: v, request: l, value: A });
2422
+ };
2423
+ return Promise.resolve().then(() => d.current(t, { signal: k.signal })).then((A) => {
2424
+ var T, S;
2425
+ if (A.status !== "ready") {
2426
+ b({
2427
+ status: "refused",
2428
+ eventId: t,
2429
+ reason: A.reason,
2430
+ retryable: A.retryable
2431
+ });
2432
+ return;
2433
+ }
2434
+ if (((T = A.details) == null ? void 0 : T.eventId) !== t || !oa((S = A.details.appointment) == null ? void 0 : S.startIso))
2435
+ throw new Error(s.current);
2436
+ b({ status: "ready", read: A.details });
2437
+ }).catch((A) => {
2438
+ b({
2439
+ status: "error",
2440
+ eventId: t,
2441
+ message: dt(A, s.current)
2442
+ });
2443
+ }), () => k.abort();
2444
+ }, [t, v, l]);
2445
+ const N = cn(() => h((k) => k + 1), []);
2446
+ if (t === null) return { state: null, retry: N };
2447
+ const a = (c == null ? void 0 : c.eventId) === t && c.selection === v ? c : void 0;
2448
+ let m = { status: "loading", eventId: t };
2449
+ return (a == null ? void 0 : a.request) === l ? m = a.value : (a == null ? void 0 : a.value.status) === "ready" && (m = { status: "ready", read: a.value.read, refreshing: !0 }), { state: m, retry: N };
2450
+ }
2451
+ export {
2452
+ qa as A,
2453
+ $t as C,
2454
+ ue as D,
2455
+ ba as I,
2456
+ pt as M,
2457
+ la as R,
2458
+ aa as a,
2459
+ Fe as b,
2460
+ sa as c,
2461
+ ca as d,
2462
+ ya as e,
2463
+ Ge as f,
2464
+ va as g,
2465
+ ft as h,
2466
+ tn as i,
2467
+ ua as j,
2468
+ ma as k,
2469
+ ka as l,
2470
+ ia as m,
2471
+ oa as p,
2472
+ da as s,
2473
+ ps as u
2474
+ };
2475
+ //# sourceMappingURL=use-appointment-details-read-BrykoTOR.js.map