@alfadocs/ui-kit 0.69.0 → 0.70.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 (261) hide show
  1. package/dist/_chunks/{agenda-card-BxSFkqgY.js → agenda-card-BQ-IKAru.js} +2 -2
  2. package/dist/_chunks/{agenda-tray-g0kg7HwB.js → agenda-tray-CGXRk58j.js} +2 -2
  3. package/dist/_chunks/{ai-consent-banner-CXlsNX1c.js → ai-consent-banner-Be-h9mRI.js} +3 -3
  4. package/dist/_chunks/ai-tools-rail-B5NEghsp.js +511 -0
  5. package/dist/_chunks/{alert-_mUKLmwA.js → alert-CHYZ96tR.js} +150 -96
  6. package/dist/_chunks/{anamnesis-card-DRmE24OQ.js → anamnesis-card-DvYCa16e.js} +2 -2
  7. package/dist/_chunks/anatomy-scheme-CJB6dI6p.js +2445 -0
  8. package/dist/_chunks/annotation-marker-qt5R9WZX.js +120 -0
  9. package/dist/_chunks/{antenatal-schedule-timeline-35ebkcZT.js → antenatal-schedule-timeline-CwXrQRm1.js} +2 -2
  10. package/dist/_chunks/appointment-card-C06aZqA7.js +310 -0
  11. package/dist/_chunks/appointment-timeline-BJM0S_Fg.js +386 -0
  12. package/dist/_chunks/appointment-tray-DRRw5ROi.js +193 -0
  13. package/dist/_chunks/{audio-recorder-DYXXnGug.js → audio-recorder-Cpdk5qpQ.js} +2 -2
  14. package/dist/_chunks/{badge-CqGsX32l.js → badge-DCOqV9mI.js} +32 -27
  15. package/dist/_chunks/{bishop-score-PJI3AXzA.js → bishop-score-DnYWtZa_.js} +2 -2
  16. package/dist/_chunks/{bmi-calculator-BZtIJ53x.js → bmi-calculator-zjeY4E7J.js} +2 -2
  17. package/dist/_chunks/{booking-C3VqFReX.js → booking-DUBI0oqt.js} +4 -4
  18. package/dist/_chunks/{care-plan-card-CvFGXa2z.js → care-plan-card-C5sTfY9G.js} +5 -5
  19. package/dist/_chunks/{care-plan-entry-card-C3E_gClk.js → care-plan-entry-card-CXnxGCWA.js} +5 -5
  20. package/dist/_chunks/care-plan-header-BUwqDTtz.js +206 -0
  21. package/dist/_chunks/clinical-note-card-BUvNMNGL.js +436 -0
  22. package/dist/_chunks/{contact-profile-card-Dramqa9C.js → contact-profile-card-DDPwRFiP.js} +2 -2
  23. package/dist/_chunks/control-room-rail-Y8ryLYsP.js +229 -0
  24. package/dist/_chunks/{cycle-calculator-DmRGJNaT.js → cycle-calculator-CCmPwcBl.js} +2 -2
  25. package/dist/_chunks/{dependent-selector-CG_FOHya.js → dependent-selector-DUV4thxX.js} +2 -2
  26. package/dist/_chunks/{document-scanner-CTubA0-N.js → document-scanner-C_AxLooF.js} +3 -3
  27. package/dist/_chunks/{due-date-calculator-BTmsIQqD.js → due-date-calculator-Brdj-euS.js} +3 -3
  28. package/dist/_chunks/editable-currency-cell-renderer-C9twtALM.js +328 -0
  29. package/dist/_chunks/email-input-DJ7EXklP.js +397 -0
  30. package/dist/_chunks/{entity-card-COhmqHly.js → entity-card-9_62gY7l.js} +38 -20
  31. package/dist/_chunks/entity-summary-BxRjFh_4.js +138 -0
  32. package/dist/_chunks/{fetal-weight-CRz7KE2D.js → fetal-weight-DNCkyeVo.js} +2 -2
  33. package/dist/_chunks/field-value-NXYczdpO.js +415 -0
  34. package/dist/_chunks/{file-upload-5ScQd4fE.js → file-upload-DwZcAK8D.js} +2 -1
  35. package/dist/_chunks/{freemium-paywall-DZ2mBS3w.js → freemium-paywall-WYlNO7yT.js} +2 -2
  36. package/dist/_chunks/{gestational-age-calculator-BleUdhbI.js → gestational-age-calculator-CF2ISaYQ.js} +3 -3
  37. package/dist/_chunks/hash-CysBBS_N.js +17 -0
  38. package/dist/_chunks/{hcg-doubling-CnjDXX6U.js → hcg-doubling-C7bmuaU3.js} +2 -2
  39. package/dist/_chunks/{actions-cell-renderer-DrcaxB0w.js → link-cell-renderer-CTXqtXV-.js} +715 -592
  40. package/dist/_chunks/lock-CKOIn0IK.js +15 -0
  41. package/dist/_chunks/{marketplace-app-shell-6T9W4Knl.js → marketplace-app-shell-Skhfp6vK.js} +3 -3
  42. package/dist/_chunks/notes-panel-ay8_lPrA.js +158 -0
  43. package/dist/_chunks/{notification-card-BiESdm8q.js → notification-card-D2jiKSJJ.js} +27 -23
  44. package/dist/_chunks/{notification-tray-Btb9oQeZ.js → notification-tray-AEun6DN2.js} +2 -2
  45. package/dist/_chunks/{operator-hero-CP2Nhupm.js → operator-hero-CR0Rqh4-.js} +3 -3
  46. package/dist/_chunks/patient-details-Dlhqb5ig.js +675 -0
  47. package/dist/_chunks/{patient-search-CBC_ySF6.js → patient-search-Be6cLrHR.js} +2 -2
  48. package/dist/_chunks/patient-summary-card-WySCMwwA.js +437 -0
  49. package/dist/_chunks/patient-table-CHxf3Oqk.js +1110 -0
  50. package/dist/_chunks/{payment-form-DvjwYVIT.js → payment-form-CxqIXqw7.js} +2 -2
  51. package/dist/_chunks/{payment-request-card-DioWKBUq.js → payment-request-card-BcZJwu9z.js} +125 -136
  52. package/dist/_chunks/{pdf-viewer-D6BPfW2D.js → pdf-viewer-QfebdLOd.js} +192 -214
  53. package/dist/_chunks/{periodontal-chart-card-BuDEMbHE.js → periodontal-chart-card-hRRJY1NN.js} +2 -2
  54. package/dist/_chunks/{practice-results-KrTHqZua.js → practice-results-C6qDfxos.js} +3 -3
  55. package/dist/_chunks/{pregnancy-dating-DORUAOHB.js → pregnancy-dating-CRVWswD-.js} +3 -3
  56. package/dist/_chunks/{pregnancy-weight-gain-DVz4rr7-.js → pregnancy-weight-gain-BUNpTsH-.js} +2 -2
  57. package/dist/_chunks/radiograph-panel.agent-CAX-C3g3.js +558 -0
  58. package/dist/_chunks/{rich-text-editor-BsV7zUdg.js → rich-text-editor-DlCqPixb.js} +410 -394
  59. package/dist/_chunks/{sign-document-B4DeRhTe.js → sign-document-By6hMOra.js} +2 -2
  60. package/dist/_chunks/{stepper-accordion-Dki6r9ZE.js → stepper-accordion-DC-H-8v4.js} +38 -48
  61. package/dist/_chunks/tab-bar-Bv9nGNdO.js +262 -0
  62. package/dist/_chunks/tooth-scheme-BhQoPNBD.js +2131 -0
  63. package/dist/_chunks/{transaction-chip-DK84XCBU.js → transaction-chip-CscoQbxF.js} +88 -61
  64. package/dist/_chunks/use-clamp-overflow-DQE2kwZ9.js +20 -0
  65. package/dist/_chunks/use-overflow-collapse-BIOzKbni.js +32 -0
  66. package/dist/_chunks/use-persistent-state-nZwZAnE9.js +24 -0
  67. package/dist/_chunks/{warning-stack-BsgaEbL8.js → warning-stack--sTrrBDA.js} +86 -101
  68. package/dist/_chunks/{workflow-map-Bdam9pGp.js → workflow-map-Dy8mLCqF.js} +3 -3
  69. package/dist/_chunks/zoom-out-CgVtf2Wx.js +29 -0
  70. package/dist/agent/index.js +5 -4
  71. package/dist/agent/types.d.ts +19 -2
  72. package/dist/agent-catalog.json +1253 -86
  73. package/dist/agent-i18n/en.json +108 -6
  74. package/dist/components/_shared/entity-card/entity-card.d.ts +6 -0
  75. package/dist/components/_shared/entity-card/index.d.ts +1 -1
  76. package/dist/components/_shared/field-value.d.ts +21 -0
  77. package/dist/components/_shared/field-visibility-cog.d.ts +20 -0
  78. package/dist/components/_shared/field-visibility.d.ts +36 -0
  79. package/dist/components/_shared/patient-fields.d.ts +119 -0
  80. package/dist/components/agenda-card/index.js +1 -1
  81. package/dist/components/agenda-tray/index.js +1 -1
  82. package/dist/components/ai-consent-banner/index.js +1 -1
  83. package/dist/components/ai-tools-rail/ai-tools-rail.d.ts +75 -0
  84. package/dist/components/ai-tools-rail/index.js +1 -1
  85. package/dist/components/alert/alert.d.ts +5 -0
  86. package/dist/components/alert/index.js +1 -1
  87. package/dist/components/anamnesis-card/index.js +1 -1
  88. package/dist/components/anatomy-scheme/anatomy-face-paths.d.ts +15 -0
  89. package/dist/components/anatomy-scheme/anatomy-muscle-paths.d.ts +20 -0
  90. package/dist/components/anatomy-scheme/anatomy-scheme-data.d.ts +121 -0
  91. package/dist/components/anatomy-scheme/anatomy-scheme.agent.d.ts +6 -0
  92. package/dist/components/anatomy-scheme/anatomy-scheme.d.ts +69 -0
  93. package/dist/components/anatomy-scheme/index.d.ts +6 -0
  94. package/dist/components/anatomy-scheme/index.js +17 -0
  95. package/dist/components/annotation-marker/annotation-marker.d.ts +33 -0
  96. package/dist/components/annotation-marker/index.d.ts +3 -0
  97. package/dist/components/annotation-marker/index.js +7 -0
  98. package/dist/components/appointment-card/appointment-card.d.ts +25 -1
  99. package/dist/components/appointment-card/index.js +6 -5
  100. package/dist/components/appointment-timeline/appointment-timeline.agent.d.ts +4 -0
  101. package/dist/components/appointment-timeline/appointment-timeline.d.ts +66 -0
  102. package/dist/components/appointment-timeline/index.d.ts +4 -0
  103. package/dist/components/appointment-timeline/index.js +6 -0
  104. package/dist/components/audio-recorder/index.js +1 -1
  105. package/dist/components/badge/badge.d.ts +6 -2
  106. package/dist/components/badge/index.js +1 -1
  107. package/dist/components/bishop-score/index.js +1 -1
  108. package/dist/components/bmi-calculator/index.js +1 -1
  109. package/dist/components/booking/index.js +1 -1
  110. package/dist/components/care-plan-card/index.js +1 -1
  111. package/dist/components/care-plan-entry-card/index.js +1 -1
  112. package/dist/components/care-plan-header/care-plan-header.agent.d.ts +4 -0
  113. package/dist/components/care-plan-header/care-plan-header.d.ts +100 -0
  114. package/dist/components/care-plan-header/index.d.ts +4 -0
  115. package/dist/components/care-plan-header/index.js +6 -0
  116. package/dist/components/clinical-note-card/clinical-note-card.d.ts +21 -1
  117. package/dist/components/clinical-note-card/index.js +1 -1
  118. package/dist/components/contact-profile-card/index.js +1 -1
  119. package/dist/components/control-room-rail/control-room-context.d.ts +53 -0
  120. package/dist/components/control-room-rail/control-room-rail.d.ts +35 -0
  121. package/dist/components/control-room-rail/index.d.ts +5 -0
  122. package/dist/components/control-room-rail/index.js +9 -0
  123. package/dist/components/cycle-calculator/index.js +1 -1
  124. package/dist/components/data-table/cell-renderers/actions-cell-renderer.d.ts +18 -0
  125. package/dist/components/data-table/index.d.ts +1 -1
  126. package/dist/components/data-table/index.js +32 -31
  127. package/dist/components/dependent-selector/index.js +1 -1
  128. package/dist/components/document-scanner/index.js +1 -1
  129. package/dist/components/due-date-calculator/index.js +2 -2
  130. package/dist/components/email-input/index.js +1 -1
  131. package/dist/components/entity-summary/entity-summary.d.ts +43 -0
  132. package/dist/components/entity-summary/index.d.ts +3 -0
  133. package/dist/components/entity-summary/index.js +5 -0
  134. package/dist/components/fetal-weight/index.js +1 -1
  135. package/dist/components/file-upload/index.js +1 -1
  136. package/dist/components/freemium-paywall/index.js +1 -1
  137. package/dist/components/gestational-age-calculator/index.js +1 -1
  138. package/dist/components/hcg-doubling/index.js +1 -1
  139. package/dist/components/index.d.ts +9 -0
  140. package/dist/components/notes-panel/index.d.ts +3 -0
  141. package/dist/components/notes-panel/index.js +5 -0
  142. package/dist/components/notes-panel/notes-panel.d.ts +64 -0
  143. package/dist/components/notification-card/index.js +1 -1
  144. package/dist/components/notification-tray/index.js +1 -1
  145. package/dist/components/operator-hero/index.js +1 -1
  146. package/dist/components/patient-details/index.d.ts +5 -0
  147. package/dist/components/patient-details/index.js +6 -0
  148. package/dist/components/patient-details/patient-details.agent.d.ts +4 -0
  149. package/dist/components/patient-details/patient-details.d.ts +96 -0
  150. package/dist/components/patient-search/index.js +1 -1
  151. package/dist/components/patient-summary-card/index.js +1 -1
  152. package/dist/components/patient-summary-card/patient-summary-card.d.ts +40 -1
  153. package/dist/components/patient-table/columns.d.ts +69 -40
  154. package/dist/components/patient-table/index.d.ts +2 -6
  155. package/dist/components/patient-table/index.js +8 -9
  156. package/dist/components/patient-table/patient-table.d.ts +38 -4
  157. package/dist/components/patient-table/types.d.ts +52 -2
  158. package/dist/components/patient-table/use-responsive-columns.d.ts +8 -6
  159. package/dist/components/payment-card/index.js +1 -1
  160. package/dist/components/payment-form/index.js +1 -1
  161. package/dist/components/pdf-viewer/index.js +1 -1
  162. package/dist/components/periodontal-chart-card/index.js +1 -1
  163. package/dist/components/practice-results/index.js +1 -1
  164. package/dist/components/pregnancy-dating/index.js +1 -1
  165. package/dist/components/pregnancy-weight-gain/index.js +1 -1
  166. package/dist/components/radiograph-panel/index.d.ts +4 -0
  167. package/dist/components/radiograph-panel/index.js +7 -0
  168. package/dist/components/radiograph-panel/radiograph-panel.agent.d.ts +13 -0
  169. package/dist/components/radiograph-panel/radiograph-panel.d.ts +36 -0
  170. package/dist/components/rich-text-editor/index.js +1 -1
  171. package/dist/components/sidebar/index.js +1 -1
  172. package/dist/components/sign-document/index.js +1 -1
  173. package/dist/components/stepper-accordion/index.js +1 -1
  174. package/dist/components/tab-bar/index.js +1 -1
  175. package/dist/components/tab-bar/tab-bar.d.ts +18 -1
  176. package/dist/components/tooth-scheme/index.d.ts +2 -2
  177. package/dist/components/tooth-scheme/index.js +30 -23
  178. package/dist/components/tooth-scheme/tooth-data.d.ts +112 -1
  179. package/dist/components/tooth-scheme/tooth-scheme.agent.d.ts +2 -2
  180. package/dist/components/tooth-scheme/tooth-scheme.d.ts +75 -11
  181. package/dist/components/transaction-chip/index.js +1 -1
  182. package/dist/components/transaction-chip/transaction-chip.d.ts +2 -2
  183. package/dist/components/warning-stack/index.js +1 -1
  184. package/dist/components/warning-stack/warning-stack.d.ts +10 -7
  185. package/dist/components/workflow/index.js +1 -1
  186. package/dist/hooks/index.d.ts +1 -0
  187. package/dist/hooks/index.js +24 -22
  188. package/dist/hooks/use-clamp-overflow.d.ts +19 -0
  189. package/dist/hooks/use-overflow-collapse.d.ts +46 -0
  190. package/dist/hooks/use-persistent-state.d.ts +7 -1
  191. package/dist/hooks/use-scroll-overflow.d.ts +36 -0
  192. package/dist/i18n/locales/ar.d.ts +308 -24
  193. package/dist/i18n/locales/ar.js +322 -27
  194. package/dist/i18n/locales/de.d.ts +308 -24
  195. package/dist/i18n/locales/de.js +322 -27
  196. package/dist/i18n/locales/el.d.ts +308 -24
  197. package/dist/i18n/locales/el.js +322 -27
  198. package/dist/i18n/locales/en.d.ts +309 -32
  199. package/dist/i18n/locales/en.js +323 -35
  200. package/dist/i18n/locales/es.d.ts +308 -24
  201. package/dist/i18n/locales/es.js +322 -27
  202. package/dist/i18n/locales/fr.d.ts +308 -24
  203. package/dist/i18n/locales/fr.js +322 -27
  204. package/dist/i18n/locales/hi.d.ts +308 -24
  205. package/dist/i18n/locales/hi.js +322 -27
  206. package/dist/i18n/locales/it.d.ts +308 -24
  207. package/dist/i18n/locales/it.js +322 -27
  208. package/dist/i18n/locales/ja.d.ts +308 -24
  209. package/dist/i18n/locales/ja.js +322 -27
  210. package/dist/i18n/locales/nl.d.ts +308 -24
  211. package/dist/i18n/locales/nl.js +322 -27
  212. package/dist/i18n/locales/pl.d.ts +308 -24
  213. package/dist/i18n/locales/pl.js +322 -27
  214. package/dist/i18n/locales/pt.d.ts +308 -24
  215. package/dist/i18n/locales/pt.js +322 -27
  216. package/dist/i18n/locales/ro.d.ts +308 -24
  217. package/dist/i18n/locales/ro.js +322 -27
  218. package/dist/i18n/locales/ru.d.ts +308 -24
  219. package/dist/i18n/locales/ru.js +322 -27
  220. package/dist/i18n/locales/sq.d.ts +308 -24
  221. package/dist/i18n/locales/sq.js +322 -27
  222. package/dist/i18n/locales/sv.d.ts +308 -24
  223. package/dist/i18n/locales/sv.js +322 -27
  224. package/dist/i18n/locales/tr.d.ts +308 -24
  225. package/dist/i18n/locales/tr.js +322 -27
  226. package/dist/i18n/locales/zh.d.ts +308 -24
  227. package/dist/i18n/locales/zh.js +322 -27
  228. package/dist/index.js +672 -623
  229. package/dist/locales/ar.json +311 -27
  230. package/dist/locales/de.json +311 -27
  231. package/dist/locales/el.json +311 -27
  232. package/dist/locales/en.json +311 -27
  233. package/dist/locales/es.json +311 -27
  234. package/dist/locales/fr.json +311 -27
  235. package/dist/locales/hi.json +311 -27
  236. package/dist/locales/it.json +311 -27
  237. package/dist/locales/ja.json +311 -27
  238. package/dist/locales/nl.json +311 -27
  239. package/dist/locales/pl.json +311 -27
  240. package/dist/locales/pt.json +311 -27
  241. package/dist/locales/ro.json +311 -27
  242. package/dist/locales/ru.json +311 -27
  243. package/dist/locales/sq.json +311 -27
  244. package/dist/locales/sv.json +311 -27
  245. package/dist/locales/tr.json +311 -27
  246. package/dist/locales/zh.json +311 -27
  247. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  248. package/dist/tokens.css +1 -1
  249. package/package.json +37 -1
  250. package/dist/_chunks/ai-tools-rail-BA_sqy1A.js +0 -373
  251. package/dist/_chunks/appointment-tray-CZtvtaH-.js +0 -431
  252. package/dist/_chunks/clinical-note-card-DqQYf_D4.js +0 -333
  253. package/dist/_chunks/editable-currency-cell-renderer-kgqp_mIw.js +0 -448
  254. package/dist/_chunks/email-input-B_Y55f5G.js +0 -396
  255. package/dist/_chunks/patient-summary-card-B836_fDB.js +0 -435
  256. package/dist/_chunks/patient-table-CDuosVru.js +0 -889
  257. package/dist/_chunks/tab-bar-B1ovILzh.js +0 -105
  258. package/dist/_chunks/tooth-scheme-yBr53cvv.js +0 -1330
  259. package/dist/_chunks/use-persistent-state-i23OWy6G.js +0 -24
  260. package/dist/components/patient-table/cell-renderers/contact-cell.d.ts +0 -45
  261. package/dist/components/patient-table/cell-renderers/patient-identity-cell.d.ts +0 -26
@@ -0,0 +1,1110 @@
1
+ import { jsxs as O, jsx as g } from "react/jsx-runtime";
2
+ import { createElement as x, useRef as k, useEffect as ee, useCallback as z, forwardRef as he, useState as te, useImperativeHandle as pe, useMemo as Y } from "react";
3
+ import { useTranslation as $ } from "react-i18next";
4
+ import { I as be, h as p, g as b, L as ge, c as L, b as _, d as U, N as H, e as F, S as R, T as ne, a as K, C as Ce, l as ve, k as Ne, U as we, f as Te, A as Fe, m as ae, D as P, n as Re } from "./link-cell-renderer-CTXqtXV-.js";
5
+ import { S as Ie } from "./select-DMLG44F5.js";
6
+ import { u as ye } from "./registry-DvAUVLHh.js";
7
+ import { B as ie } from "./badge-DCOqV9mI.js";
8
+ import { c as Pe } from "./index-D2ZczOXr.js";
9
+ import { T as We } from "./timestamp-BV2lC-wV.js";
10
+ import { C as Se } from "./calendar-clock-CYkcqdwl.js";
11
+ import { E as Ae } from "./eye-LHlSU38h.js";
12
+ import { P as Be } from "./pencil-CfQX-0Qc.js";
13
+ import { M as De } from "./mail-C8irm52s.js";
14
+ import { c as Ve } from "./createLucideIcon-CrFbzy84.js";
15
+ import { U as xe } from "./users-MBVtUzwd.js";
16
+ import { T as Ee } from "./trash-2-rPAKaRgB.js";
17
+ /**
18
+ * @license lucide-react v1.8.0 - ISC
19
+ *
20
+ * This source code is licensed under the ISC license.
21
+ * See the LICENSE file in the root directory of this source tree.
22
+ */
23
+ const Oe = [
24
+ [
25
+ "path",
26
+ {
27
+ d: "M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",
28
+ key: "18887p"
29
+ }
30
+ ]
31
+ ], ke = Ve("message-square", Oe), Ge = 5e4;
32
+ function Me(e) {
33
+ return e === 0 ? { variant: "success", statusKey: "settled" } : e <= Ge ? { variant: "warning", statusKey: "pending" } : { variant: "error", statusKey: "overdue" };
34
+ }
35
+ function Le(e) {
36
+ if (e == null || e === "") return null;
37
+ const i = typeof e == "number" ? e : Number(e);
38
+ return Number.isFinite(i) ? i : null;
39
+ }
40
+ function _e(e) {
41
+ const { value: i, currency: d = "EUR", options: s } = e, { t: a, i18n: r } = $("ui"), c = Le(i);
42
+ if (c === null) return null;
43
+ const h = r.language || "en", m = new Intl.NumberFormat(h, {
44
+ style: "currency",
45
+ currency: d,
46
+ ...s
47
+ }).format(c / 100), { variant: u, statusKey: C } = Me(c), l = a(`patientTable.balance.status.${C}`);
48
+ return /* @__PURE__ */ O(ie, { variant: u, withDot: !0, size: "sm", className: "ds:tabular-nums", children: [
49
+ /* @__PURE__ */ g("span", { children: m }),
50
+ /* @__PURE__ */ g("span", { className: "ds:sr-only", children: l })
51
+ ] });
52
+ }
53
+ const Ue = {
54
+ accepted: "success",
55
+ estimate: "info",
56
+ none: "neutral"
57
+ };
58
+ function He(e) {
59
+ return e === "accepted" || e === "estimate" || e === "none";
60
+ }
61
+ function ze(e) {
62
+ const { t: i } = $("ui"), { data: d, value: s, size: a = "sm" } = e, r = (d == null ? void 0 : d.carePlanStatus) ?? s;
63
+ if (!He(r)) return null;
64
+ const c = Ue[r];
65
+ return /* @__PURE__ */ g(ie, { variant: c, withDot: !0, size: a, children: i(`patientTable.carePlanStatus.${r}`) });
66
+ }
67
+ const J = Pe(
68
+ "ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)] ds:whitespace-nowrap",
69
+ {
70
+ variants: {
71
+ tone: {
72
+ default: "",
73
+ // Imminent visit: warning foreground token + medium weight. Fully
74
+ // token-bound — no literal colour, no AG Grid cellStyle.
75
+ soon: "ds:text-[color:var(--warning-foreground)] ds:font-medium",
76
+ // Absent appointment: muted empty state.
77
+ empty: "ds:text-[color:var(--muted-foreground)]"
78
+ }
79
+ },
80
+ defaultVariants: { tone: "default" }
81
+ }
82
+ ), $e = 1440 * 60 * 1e3, je = 7;
83
+ function Ke(e) {
84
+ if (e == null || e === "") return null;
85
+ const i = e instanceof Date ? e.getTime() : typeof e == "number" ? e : new Date(String(e)).getTime();
86
+ return Number.isNaN(i) ? null : i;
87
+ }
88
+ function Ye(e, i) {
89
+ if (i <= 0) return "default";
90
+ const d = e - Date.now();
91
+ return d < 0 ? "default" : d <= i * $e ? "soon" : "default";
92
+ }
93
+ function qe(e) {
94
+ const { t: i } = $("ui"), { data: d, value: s, soonWithinDays: a = je } = e, r = Ke((d == null ? void 0 : d.nextAppointment) ?? s);
95
+ if (r === null)
96
+ return /* @__PURE__ */ g("span", { className: J({ tone: "empty" }), children: i("patientTable.nextAppointment.none") });
97
+ const c = Ye(r, a);
98
+ return /* @__PURE__ */ O("span", { className: J({ tone: c }), children: [
99
+ c === "soon" ? /* @__PURE__ */ g(Se, { "aria-hidden": "true", className: "ds:size-3.5 ds:shrink-0" }) : null,
100
+ /* @__PURE__ */ g(We, { value: r, format: "relative", shape: "bare" })
101
+ ] });
102
+ }
103
+ function q(e) {
104
+ return e.responsiveTier;
105
+ }
106
+ const Qe = 6;
107
+ function Xe(e, i) {
108
+ const d = (a) => (r) => {
109
+ i == null || i(a, r);
110
+ }, s = (a, r) => ({
111
+ icon: a.icon,
112
+ label: a.label,
113
+ variant: a.variant,
114
+ onClick: d(a),
115
+ ...r
116
+ });
117
+ return [
118
+ s(
119
+ {
120
+ id: "show",
121
+ label: e("patientTable.actions.show"),
122
+ icon: x(Ae, { "aria-hidden": "true" })
123
+ },
124
+ {}
125
+ ),
126
+ s(
127
+ {
128
+ id: "edit",
129
+ label: e("patientTable.actions.edit"),
130
+ icon: x(Be, { "aria-hidden": "true" })
131
+ },
132
+ {}
133
+ ),
134
+ s(
135
+ {
136
+ id: "sendEmailReminder",
137
+ label: e("patientTable.actions.sendEmailReminder"),
138
+ icon: x(De, { "aria-hidden": "true" })
139
+ },
140
+ // Hidden when the patient has email contact disabled (spec).
141
+ { hidden: (a) => !a.emailEnabled }
142
+ ),
143
+ s(
144
+ {
145
+ id: "sendSmsReminder",
146
+ label: e("patientTable.actions.sendSmsReminder"),
147
+ icon: x(ke, { "aria-hidden": "true" })
148
+ },
149
+ // Hidden when no phone number is SMS-enabled (spec).
150
+ {
151
+ hidden: (a) => !(a.phoneNumbers ?? []).some((r) => r.smsEnabled)
152
+ }
153
+ ),
154
+ s(
155
+ {
156
+ id: "reassign",
157
+ label: e("patientTable.actions.reassign"),
158
+ icon: x(xe, { "aria-hidden": "true" })
159
+ },
160
+ {}
161
+ ),
162
+ s(
163
+ {
164
+ id: "delete",
165
+ label: e("patientTable.actions.delete"),
166
+ icon: x(Ee, { "aria-hidden": "true" }),
167
+ variant: "destructive"
168
+ },
169
+ // Disabled (with a reason) for archived patients — the row model's
170
+ // closest "cannot delete" signal. Surfaced as the inline tooltip.
171
+ {
172
+ disabled: (a) => !!a.isArchived,
173
+ disabledReason: e("patientTable.actions.deleteLocked")
174
+ }
175
+ )
176
+ ];
177
+ }
178
+ const Je = () => !1, B = "✓", W = "—";
179
+ function Ze(e) {
180
+ if (!e) return null;
181
+ const i = new Date(e), d = i.getTime();
182
+ if (Number.isNaN(d)) return null;
183
+ const s = /* @__PURE__ */ new Date();
184
+ let a = s.getFullYear() - i.getFullYear();
185
+ const r = s.getMonth() - i.getMonth();
186
+ return (r < 0 || r === 0 && s.getDate() < i.getDate()) && (a -= 1), a >= 0 ? a : null;
187
+ }
188
+ function et(e) {
189
+ return e.map((i) => {
190
+ const s = {
191
+ colId: `custom:${i.fieldName}`,
192
+ headerName: i.label,
193
+ hide: !0
194
+ // No tier — custom fields are opt-in via ColumnToggle only.
195
+ };
196
+ return i.type === "checkbox" ? {
197
+ ...s,
198
+ valueGetter: (a) => {
199
+ var r, c;
200
+ return ((c = (r = a.data) == null ? void 0 : r.customFields) == null ? void 0 : c[i.fieldName]) === !0;
201
+ },
202
+ valueFormatter: (a) => a.value === !0 ? B : W,
203
+ filter: R,
204
+ floatingFilterComponent: F,
205
+ filterParams: {
206
+ options: [
207
+ { value: !0, label: B },
208
+ { value: !1, label: W }
209
+ ]
210
+ },
211
+ minWidth: 110,
212
+ width: 130
213
+ } : i.type === "dropdown" ? {
214
+ ...s,
215
+ // TagListCellRenderer expects an array; wrap the single value.
216
+ valueGetter: (a) => {
217
+ var c, h;
218
+ const r = (h = (c = a.data) == null ? void 0 : c.customFields) == null ? void 0 : h[i.fieldName];
219
+ return typeof r == "string" && r ? [r] : [];
220
+ },
221
+ cellRenderer: ne,
222
+ filterValueGetter: (a) => {
223
+ var c, h;
224
+ const r = (h = (c = a.data) == null ? void 0 : c.customFields) == null ? void 0 : h[i.fieldName];
225
+ return typeof r == "string" ? r : "";
226
+ },
227
+ filter: R,
228
+ floatingFilterComponent: F,
229
+ filterParams: {
230
+ options: (i.options ?? []).map((a) => ({
231
+ value: a,
232
+ label: a
233
+ }))
234
+ },
235
+ sortable: !1,
236
+ minWidth: 130,
237
+ width: 160
238
+ } : {
239
+ ...s,
240
+ valueGetter: (a) => {
241
+ var c, h;
242
+ const r = (h = (c = a.data) == null ? void 0 : c.customFields) == null ? void 0 : h[i.fieldName];
243
+ return typeof r == "string" ? r : "";
244
+ },
245
+ filter: b,
246
+ floatingFilterComponent: p,
247
+ minWidth: 140,
248
+ width: 170
249
+ };
250
+ });
251
+ }
252
+ function tt(e, i = {}) {
253
+ const {
254
+ hideDetails: d = !1,
255
+ getActionsCompact: s = Je,
256
+ onRowAction: a,
257
+ identityHref: r,
258
+ customFields: c = []
259
+ } = i, h = Xe(e, a), m = {
260
+ m: e("patientTable.gender.m"),
261
+ f: e("patientTable.gender.f"),
262
+ x: e("patientTable.gender.x")
263
+ }, u = {
264
+ yes: e("patientTable.consent.yes"),
265
+ no: e("patientTable.consent.no"),
266
+ notSpecified: e("patientTable.consent.notSpecified")
267
+ }, C = {
268
+ [u.yes]: "success",
269
+ [u.no]: "error",
270
+ [u.notSpecified]: "neutral"
271
+ }, l = (t) => e(`patientTable.column.${t}`);
272
+ return [
273
+ /* ── Avatar (P0, pinned-start) ─────────────────────────────────── */
274
+ {
275
+ colId: "avatar",
276
+ // sr-only header — the photo column needs no visible label, but AG Grid
277
+ // and AT still want a name. `headerName` reads "Photo"; the visible header
278
+ // TEXT is clipped via the kit's `sr-only-th` convention (clips only
279
+ // `.ag-header-cell-text`, keeping the header-cell box in the grid chrome
280
+ // and the name in the a11y tree — see ag-grid-theme.css).
281
+ headerName: l("avatar"),
282
+ headerClass: "sr-only-th",
283
+ pinned: "left",
284
+ cellRenderer: be,
285
+ cellRendererParams: {
286
+ srcField: "avatarUrl",
287
+ fallbackField: "lastName",
288
+ size: "sm",
289
+ shape: "circle"
290
+ },
291
+ sortable: !1,
292
+ filter: !1,
293
+ resizable: !1,
294
+ // Hug the 32px (size="sm") avatar + cell padding — a tight fixed column,
295
+ // not a wide empty one. width === minWidth === maxWidth pins it to size so
296
+ // the pinned group can't stretch it (pinned columns never flex).
297
+ width: 52,
298
+ minWidth: 52,
299
+ maxWidth: 52
300
+ // Anchor — never auto-hidden (no tier).
301
+ },
302
+ /* ── First name (P0, pinned-start) — plain text ────────────────── */
303
+ {
304
+ colId: "firstName",
305
+ headerName: l("firstName"),
306
+ pinned: "left",
307
+ field: "firstName",
308
+ filter: b,
309
+ floatingFilterComponent: p,
310
+ // Size to content: width === minWidth so the pinned column sits tight with
311
+ // no dead space before the next pinned column (pinned columns can't flex).
312
+ width: 140,
313
+ minWidth: 120
314
+ // Anchor — never auto-hidden (no tier).
315
+ },
316
+ /* ── Last name (P0, pinned-start) — the patient-detail link ────── */
317
+ {
318
+ colId: "lastName",
319
+ headerName: l("lastName"),
320
+ pinned: "left",
321
+ field: "lastName",
322
+ cellRenderer: ge,
323
+ cellRendererParams: {
324
+ href: r,
325
+ // When no detail href is supplied the cell renders a button; route its
326
+ // click through the same `show` row action.
327
+ onClick: a ? (t) => a(
328
+ { id: "show", label: e("patientTable.actions.show") },
329
+ t
330
+ ) : void 0
331
+ },
332
+ filter: b,
333
+ floatingFilterComponent: p,
334
+ // Size to content: a modest pinned width with no stretched default, so the
335
+ // avatar + first + last group ends tight against the scrollable columns.
336
+ width: 150,
337
+ minWidth: 130
338
+ // Anchor — never auto-hidden (no tier).
339
+ },
340
+ /* ── Phone (P1) ────────────────────────────────────────────────── */
341
+ {
342
+ colId: "phone",
343
+ headerName: l("phone"),
344
+ responsiveTier: "P1",
345
+ // The primary phone number string (prefix + number).
346
+ valueGetter: (t) => {
347
+ var n, o, f;
348
+ return ((f = (o = (n = t.data) == null ? void 0 : n.phoneNumbers) == null ? void 0 : o[0]) == null ? void 0 : f.number) ?? "";
349
+ },
350
+ filter: b,
351
+ floatingFilterComponent: p,
352
+ minWidth: 160,
353
+ width: 180
354
+ },
355
+ /* ── Next appointment (P1) ─────────────────────────────────────── */
356
+ {
357
+ colId: "nextAppointment",
358
+ headerName: l("nextAppointment"),
359
+ responsiveTier: "P1",
360
+ field: "nextAppointment",
361
+ cellRenderer: qe,
362
+ filter: _,
363
+ floatingFilterComponent: L,
364
+ minWidth: 160,
365
+ width: 180
366
+ },
367
+ /* ── Unpaid balance (P1) ───────────────────────────────────────── */
368
+ {
369
+ colId: "unpaidBalance",
370
+ headerName: l("unpaidBalance"),
371
+ responsiveTier: "P1",
372
+ field: "unpaidAmount",
373
+ type: "numericColumn",
374
+ cellRenderer: _e,
375
+ filter: H,
376
+ floatingFilterComponent: U,
377
+ // Money is integer cents; the inRange filter compares cents directly.
378
+ filterParams: { defaultOperator: "inRange", min: 0 },
379
+ minWidth: 150,
380
+ width: 170
381
+ },
382
+ /* ── Email (P2) — hidden when masking ──────────────────────────── */
383
+ {
384
+ colId: "email",
385
+ headerName: l("email"),
386
+ responsiveTier: "P2",
387
+ field: "email",
388
+ // Emit `hide` ONLY when masking (never a literal `hide: false`). A static
389
+ // `hide: false` is re-applied by AG Grid on every `columnDefs` reconcile,
390
+ // clobbering a runtime hide from the ViewSwitcher / responsive hook.
391
+ hide: d || void 0,
392
+ filter: b,
393
+ floatingFilterComponent: p,
394
+ minWidth: 200,
395
+ width: 240
396
+ },
397
+ /* ── Care-plan status (P2) ─────────────────────────────────────── */
398
+ {
399
+ colId: "carePlanStatus",
400
+ headerName: l("carePlanStatus"),
401
+ responsiveTier: "P2",
402
+ field: "carePlanStatus",
403
+ cellRenderer: ze,
404
+ filter: R,
405
+ floatingFilterComponent: F,
406
+ filterParams: {
407
+ options: [
408
+ {
409
+ value: "accepted",
410
+ label: e("patientTable.carePlanStatus.accepted")
411
+ },
412
+ {
413
+ value: "estimate",
414
+ label: e("patientTable.carePlanStatus.estimate")
415
+ },
416
+ { value: "none", label: e("patientTable.carePlanStatus.none") }
417
+ ]
418
+ },
419
+ sortable: !1,
420
+ minWidth: 130,
421
+ width: 150
422
+ },
423
+ /* ── Fiscal code (P3, text) ────────────────────────────────────── */
424
+ {
425
+ colId: "fiscalCode",
426
+ headerName: l("fiscalCode"),
427
+ responsiveTier: "P3",
428
+ field: "italianFiscalCode",
429
+ filter: b,
430
+ floatingFilterComponent: p,
431
+ minWidth: 160,
432
+ width: 180
433
+ },
434
+ /* ── Age (P3, derived numeric) ─────────────────────────────────── */
435
+ {
436
+ colId: "age",
437
+ headerName: l("age"),
438
+ responsiveTier: "P3",
439
+ // Left-aligned like the text columns — `numericColumn` (which right-aligns
440
+ // header + cell) is for ledger figures, not a 2-digit age. Sort stays
441
+ // numeric because the valueGetter returns a number.
442
+ valueGetter: (t) => {
443
+ var n;
444
+ return Ze((n = t.data) == null ? void 0 : n.dateOfBirth) ?? void 0;
445
+ },
446
+ filter: H,
447
+ floatingFilterComponent: U,
448
+ minWidth: 90,
449
+ width: 110
450
+ },
451
+ /* ── Gender (P3) ───────────────────────────────────────────────── */
452
+ {
453
+ colId: "gender",
454
+ headerName: l("gender"),
455
+ responsiveTier: "P3",
456
+ // Map the raw code to a localised label for both cell + set filter.
457
+ valueGetter: (t) => {
458
+ var n;
459
+ return (n = t.data) != null && n.gender ? m[t.data.gender] : W;
460
+ },
461
+ filter: R,
462
+ floatingFilterComponent: F,
463
+ filterParams: {
464
+ options: [
465
+ { value: m.m, label: m.m },
466
+ { value: m.f, label: m.f },
467
+ { value: m.x, label: m.x }
468
+ ]
469
+ },
470
+ minWidth: 110,
471
+ width: 130
472
+ },
473
+ /* ── Source (P3) ───────────────────────────────────────────────── */
474
+ {
475
+ colId: "source",
476
+ headerName: l("source"),
477
+ responsiveTier: "P3",
478
+ // TagListCellRenderer expects an array; wrap the resolved source string.
479
+ valueGetter: (t) => {
480
+ var o, f;
481
+ const n = ((o = t.data) == null ? void 0 : o.source) ?? ((f = t.data) == null ? void 0 : f.customSource);
482
+ return n ? [n] : [];
483
+ },
484
+ cellRenderer: ne,
485
+ filterValueGetter: (t) => {
486
+ var n, o;
487
+ return ((n = t.data) == null ? void 0 : n.source) ?? ((o = t.data) == null ? void 0 : o.customSource) ?? "";
488
+ },
489
+ filter: R,
490
+ floatingFilterComponent: F,
491
+ sortable: !1,
492
+ minWidth: 120,
493
+ width: 150
494
+ },
495
+ /* ── Grouped: Identity — hidden by default ─────────────────────── */
496
+ {
497
+ colId: "dateOfBirth",
498
+ headerName: l("dateOfBirth"),
499
+ hide: !0,
500
+ field: "dateOfBirth",
501
+ cellRenderer: K,
502
+ cellRendererParams: { format: "date" },
503
+ filter: _,
504
+ floatingFilterComponent: L,
505
+ minWidth: 140,
506
+ width: 160
507
+ },
508
+ {
509
+ colId: "placeOfBirth",
510
+ headerName: l("placeOfBirth"),
511
+ hide: !0,
512
+ field: "placeOfBirth",
513
+ filter: b,
514
+ floatingFilterComponent: p,
515
+ minWidth: 140,
516
+ width: 160
517
+ },
518
+ {
519
+ colId: "countryOfBirth",
520
+ headerName: l("countryOfBirth"),
521
+ hide: !0,
522
+ field: "countryOfBirth",
523
+ filter: b,
524
+ floatingFilterComponent: p,
525
+ minWidth: 130,
526
+ width: 150
527
+ },
528
+ /* ── Grouped: Contact — hidden by default ──────────────────────── */
529
+ {
530
+ colId: "smsReminders",
531
+ headerName: l("smsReminders"),
532
+ hide: !0,
533
+ valueGetter: (t) => {
534
+ var n;
535
+ return !!((n = t.data) != null && n.smsReminderEligible);
536
+ },
537
+ valueFormatter: (t) => t.value === !0 ? B : W,
538
+ filter: R,
539
+ floatingFilterComponent: F,
540
+ filterParams: {
541
+ options: [
542
+ { value: !0, label: B },
543
+ { value: !1, label: W }
544
+ ]
545
+ },
546
+ minWidth: 120,
547
+ width: 140
548
+ },
549
+ {
550
+ colId: "emailReminders",
551
+ headerName: l("emailReminders"),
552
+ hide: !0,
553
+ valueGetter: (t) => {
554
+ var n;
555
+ return !!((n = t.data) != null && n.emailReminderEligible);
556
+ },
557
+ valueFormatter: (t) => t.value === !0 ? B : W,
558
+ filter: R,
559
+ floatingFilterComponent: F,
560
+ filterParams: {
561
+ options: [
562
+ { value: !0, label: B },
563
+ { value: !1, label: W }
564
+ ]
565
+ },
566
+ minWidth: 120,
567
+ width: 140
568
+ },
569
+ {
570
+ colId: "pec",
571
+ headerName: l("pec"),
572
+ hide: !0,
573
+ field: "pecAddress",
574
+ filter: b,
575
+ floatingFilterComponent: p,
576
+ minWidth: 200,
577
+ width: 240
578
+ },
579
+ /* ── Grouped: Appointments — hidden by default ─────────────────── */
580
+ {
581
+ colId: "lastVisit",
582
+ headerName: l("lastVisit"),
583
+ hide: !0,
584
+ field: "lastAppointment",
585
+ cellRenderer: K,
586
+ cellRendererParams: { format: "relative" },
587
+ filter: _,
588
+ floatingFilterComponent: L,
589
+ minWidth: 140,
590
+ width: 160
591
+ },
592
+ /* ── Grouped: Financial — hidden by default ────────────────────── */
593
+ {
594
+ colId: "billableAmount",
595
+ headerName: l("billableAmount"),
596
+ hide: !0,
597
+ type: "numericColumn",
598
+ cellRenderer: Ce,
599
+ // Cents → major unit at the render boundary. No `field` — the valueGetter
600
+ // takes precedence over `field` in AG Grid for both cell + sort, so a
601
+ // `field: 'billableAmount'` would be dead (and misleadingly imply the raw
602
+ // cents drive the renderer).
603
+ valueGetter: (t) => t.data ? t.data.billableAmount / 100 : void 0,
604
+ filter: H,
605
+ floatingFilterComponent: U,
606
+ minWidth: 140,
607
+ width: 160
608
+ },
609
+ {
610
+ colId: "discount",
611
+ headerName: l("discount"),
612
+ hide: !0,
613
+ field: "defaultDiscount",
614
+ type: "numericColumn",
615
+ valueFormatter: (t) => t.value == null ? "" : `${t.value}%`,
616
+ filter: H,
617
+ floatingFilterComponent: U,
618
+ minWidth: 110,
619
+ width: 130
620
+ },
621
+ /* ── Grouped: Clinical — hidden by default ─────────────────────── */
622
+ {
623
+ colId: "diagnosis",
624
+ headerName: l("diagnosis"),
625
+ hide: !0,
626
+ field: "diagnosis",
627
+ filter: b,
628
+ floatingFilterComponent: p,
629
+ minWidth: 180,
630
+ width: 220
631
+ },
632
+ {
633
+ colId: "insurance",
634
+ headerName: l("insurance"),
635
+ hide: !0,
636
+ field: "defaultInsurance",
637
+ filter: R,
638
+ floatingFilterComponent: F,
639
+ minWidth: 140,
640
+ width: 160
641
+ },
642
+ {
643
+ colId: "assignedTo",
644
+ headerName: l("assignedTo"),
645
+ hide: !0,
646
+ cellRenderer: we,
647
+ valueGetter: (t) => {
648
+ var n;
649
+ return (n = t.data) != null && n.personalAssistant ? { name: t.data.personalAssistant } : null;
650
+ },
651
+ comparator: (t, n) => ((t == null ? void 0 : t.name) ?? "").localeCompare((n == null ? void 0 : n.name) ?? ""),
652
+ filterValueGetter: (t) => {
653
+ var n;
654
+ return ((n = t.data) == null ? void 0 : n.personalAssistant) ?? "";
655
+ },
656
+ filter: Ne,
657
+ floatingFilterComponent: ve,
658
+ minWidth: 160,
659
+ width: 180
660
+ },
661
+ {
662
+ colId: "job",
663
+ headerName: l("job"),
664
+ hide: !0,
665
+ field: "job",
666
+ filter: b,
667
+ floatingFilterComponent: p,
668
+ minWidth: 140,
669
+ width: 160
670
+ },
671
+ /* ── Grouped: Admin — hidden by default ────────────────────────── */
672
+ {
673
+ colId: "marketingConsent",
674
+ headerName: l("marketingConsent"),
675
+ hide: !0,
676
+ cellRenderer: Te,
677
+ cellRendererParams: {
678
+ variantMap: C
679
+ },
680
+ valueGetter: (t) => {
681
+ var n;
682
+ switch ((n = t.data) == null ? void 0 : n.marketingConsent) {
683
+ case 1:
684
+ return u.yes;
685
+ case 0:
686
+ return u.no;
687
+ default:
688
+ return u.notSpecified;
689
+ }
690
+ },
691
+ filter: R,
692
+ floatingFilterComponent: F,
693
+ filterParams: {
694
+ options: [
695
+ { value: u.yes, label: u.yes },
696
+ { value: u.no, label: u.no },
697
+ {
698
+ value: u.notSpecified,
699
+ label: u.notSpecified
700
+ }
701
+ ]
702
+ },
703
+ sortable: !1,
704
+ minWidth: 150,
705
+ width: 170
706
+ },
707
+ {
708
+ colId: "patientNumber",
709
+ headerName: l("patientNumber"),
710
+ hide: !0,
711
+ // `YYYY/N` yearly numbering.
712
+ valueGetter: (t) => {
713
+ var f, v;
714
+ const n = (f = t.data) == null ? void 0 : f.yearlyNumberingYear, o = (v = t.data) == null ? void 0 : v.yearlyNumberingNumber;
715
+ return n != null && o != null ? `${n}/${o}` : "";
716
+ },
717
+ filter: b,
718
+ floatingFilterComponent: p,
719
+ minWidth: 120,
720
+ width: 140
721
+ },
722
+ {
723
+ colId: "portal",
724
+ headerName: l("portal"),
725
+ hide: !0,
726
+ valueGetter: (t) => {
727
+ var n;
728
+ return !!((n = t.data) != null && n.mydentista);
729
+ },
730
+ valueFormatter: (t) => t.value === !0 ? B : W,
731
+ filter: R,
732
+ floatingFilterComponent: F,
733
+ filterParams: {
734
+ options: [
735
+ { value: !0, label: B },
736
+ { value: !1, label: W }
737
+ ]
738
+ },
739
+ minWidth: 110,
740
+ width: 130
741
+ },
742
+ {
743
+ colId: "createdAt",
744
+ headerName: l("createdAt"),
745
+ hide: !0,
746
+ field: "createdAt",
747
+ cellRenderer: K,
748
+ cellRendererParams: { format: "date" },
749
+ filter: _,
750
+ floatingFilterComponent: L,
751
+ minWidth: 140,
752
+ width: 160
753
+ },
754
+ /* ── Grouped: Address — hidden by default ──────────────────────── */
755
+ {
756
+ colId: "city",
757
+ headerName: l("city"),
758
+ hide: !0,
759
+ field: "city",
760
+ filter: b,
761
+ floatingFilterComponent: p,
762
+ minWidth: 120,
763
+ width: 150
764
+ },
765
+ {
766
+ colId: "province",
767
+ headerName: l("province"),
768
+ hide: !0,
769
+ field: "province",
770
+ filter: b,
771
+ floatingFilterComponent: p,
772
+ minWidth: 100,
773
+ width: 120
774
+ },
775
+ {
776
+ colId: "postcode",
777
+ headerName: l("postcode"),
778
+ hide: !0,
779
+ field: "postcode",
780
+ filter: b,
781
+ floatingFilterComponent: p,
782
+ minWidth: 110,
783
+ width: 130
784
+ },
785
+ {
786
+ colId: "country",
787
+ headerName: l("country"),
788
+ hide: !0,
789
+ field: "countryCode",
790
+ filter: b,
791
+ floatingFilterComponent: p,
792
+ minWidth: 110,
793
+ width: 130
794
+ },
795
+ {
796
+ colId: "street",
797
+ headerName: l("street"),
798
+ hide: !0,
799
+ field: "street",
800
+ filter: b,
801
+ floatingFilterComponent: p,
802
+ minWidth: 180,
803
+ width: 220
804
+ },
805
+ /* ── Custom fields (per-practice, dynamic) — appended, hidden ──── */
806
+ ...et(c),
807
+ /* ── Actions (P0, pinned-end) ──────────────────────────────────── */
808
+ {
809
+ colId: "actions",
810
+ headerName: l("actions"),
811
+ // Pinned to the inline-end edge so actions stay reachable while the field
812
+ // columns scroll. AG Grid `pinned` is physical — the grid's `enableRtl`
813
+ // flips this to the start edge under RTL.
814
+ pinned: "right",
815
+ // Header + action group left-aligned (justify-start), consistent with every
816
+ // other column — no right-aligned header (the actions still sit at the
817
+ // pinned inline-end edge, the group just starts at the cell's leading edge).
818
+ cellClass: "ds:justify-start",
819
+ cellRenderer: Fe,
820
+ cellRendererParams: {
821
+ actions: h,
822
+ intent: "ghost",
823
+ group: !0,
824
+ label: e("patientTable.actions.group"),
825
+ collapsed: s
826
+ },
827
+ sortable: !1,
828
+ filter: !1,
829
+ resizable: !1,
830
+ // The renderer collapses to a single overflow trigger via
831
+ // `getActionsCompact`; the expanded width is DERIVED from the action count
832
+ // so a row showing every action can't clip — 88px collapsed → fits-all.
833
+ width: ae(h.length),
834
+ minWidth: 88
835
+ // Anchor — never auto-hidden (no tier).
836
+ }
837
+ ];
838
+ }
839
+ const nt = [
840
+ { minWidth: 0, tier: "P0" },
841
+ { minWidth: 640, tier: "P1" },
842
+ { minWidth: 900, tier: "P2" },
843
+ { minWidth: 1200, tier: "P3" }
844
+ ];
845
+ function Z(e, i) {
846
+ const d = /* @__PURE__ */ new Set();
847
+ for (const s of i)
848
+ e >= s.minWidth && d.add(s.tier);
849
+ return d.add("P0"), d;
850
+ }
851
+ function at(e, i) {
852
+ const {
853
+ containerRef: d,
854
+ enabled: s = !0,
855
+ breakpoints: a = nt
856
+ } = i, r = k(/* @__PURE__ */ new Set()), c = k(!1);
857
+ return ee(() => {
858
+ const m = d.current;
859
+ if (!s || !m) return;
860
+ const u = () => {
861
+ var o;
862
+ return (o = e.current) == null ? void 0 : o.getRawApi();
863
+ }, C = (o) => {
864
+ if (c.current || o.source === "api") return;
865
+ const f = o.columns ?? (o.column ? [o.column] : []);
866
+ for (const v of f)
867
+ r.current.add(v.getColId());
868
+ };
869
+ let l = !1;
870
+ const w = (o) => {
871
+ if (l) return;
872
+ l = !0;
873
+ const f = o.getColumns(), v = m.getBoundingClientRect().width, D = Z(v, a);
874
+ if (f)
875
+ for (const T of f) {
876
+ const I = q(T.getColDef());
877
+ I && !T.isVisible() && D.has(I) && r.current.add(T.getColId());
878
+ }
879
+ o.addEventListener("columnVisible", C);
880
+ }, t = () => {
881
+ const o = u();
882
+ if (!o) return;
883
+ w(o);
884
+ const f = o.getColumns();
885
+ if (!f) return;
886
+ const v = m.getBoundingClientRect().width, D = Z(v, a), T = [], I = [];
887
+ for (const S of f) {
888
+ const V = S.getColId();
889
+ if (r.current.has(V)) continue;
890
+ const A = q(S.getColDef());
891
+ if (!A) continue;
892
+ const E = D.has(A);
893
+ E && !S.isVisible() ? T.push(S) : !E && S.isVisible() && I.push(S);
894
+ }
895
+ if (!(T.length === 0 && I.length === 0)) {
896
+ c.current = !0;
897
+ try {
898
+ T.length > 0 && o.setColumnsVisible(T, !0), I.length > 0 && o.setColumnsVisible(I, !1);
899
+ } finally {
900
+ c.current = !1;
901
+ }
902
+ }
903
+ }, n = new ResizeObserver(() => t());
904
+ return n.observe(m), t(), () => {
905
+ var o;
906
+ n.disconnect(), (o = u()) == null || o.removeEventListener("columnVisible", C);
907
+ };
908
+ }, [d, s, a, e]), { lockColumns: z((m) => {
909
+ for (const u of m) r.current.add(u);
910
+ }, []) };
911
+ }
912
+ function it(e) {
913
+ var i;
914
+ return (i = e.data) != null && i.isArchived ? "data-table-row-archived" : void 0;
915
+ }
916
+ function lt(e) {
917
+ return e.data.id;
918
+ }
919
+ function rt({
920
+ views: e,
921
+ handleRef: i,
922
+ lockColumns: d,
923
+ label: s
924
+ }) {
925
+ const [a, r] = te(""), c = Y(
926
+ () => e.map((u) => ({ value: u.id, label: u.label })),
927
+ [e]
928
+ ), h = z(
929
+ (u) => {
930
+ const C = e.find((t) => t.id === u), l = i.current;
931
+ if (!C || !l) return;
932
+ const w = l.getRawApi();
933
+ if (w) {
934
+ const t = new Set(C.columns), n = [], o = [];
935
+ for (const f of w.getColumns() ?? []) {
936
+ if (q(f.getColDef()) === void 0) continue;
937
+ const v = f.getColId();
938
+ t.has(v) ? n.push(v) : o.push(v);
939
+ }
940
+ d([...n, ...o]), n.length > 0 && w.setColumnsVisible(n, !0), o.length > 0 && w.setColumnsVisible(o, !1);
941
+ }
942
+ l.setFilter(C.filterModel), l.setSort(C.sortModel), w == null || w.onFilterChanged();
943
+ },
944
+ [e, i, d]
945
+ ), m = z(
946
+ (u) => {
947
+ r(u), u && h(u);
948
+ },
949
+ [h]
950
+ );
951
+ return (
952
+ // Width-constraining wrapper (same pattern as the toolbar's QuickSearch) so
953
+ // the Select's intrinsic `w-full` trigger sizes to a compact, legible width
954
+ // instead of absorbing the whole FilterBar row.
955
+ /* @__PURE__ */ g("div", { className: "ds:w-[12rem] ds:max-w-full ds:min-w-0 ds:shrink-0", children: /* @__PURE__ */ g(
956
+ Ie,
957
+ {
958
+ options: c,
959
+ value: a,
960
+ onValueChange: m,
961
+ size: "sm",
962
+ "aria-label": s
963
+ }
964
+ ) })
965
+ );
966
+ }
967
+ const ot = he(
968
+ function({
969
+ rowData: i,
970
+ columns: d,
971
+ gridId: s,
972
+ density: a,
973
+ actionsCompact: r,
974
+ heightClass: c,
975
+ responsive: h = !0,
976
+ views: m,
977
+ onRowAction: u,
978
+ bulkActions: C,
979
+ loading: l = !1,
980
+ toolbar: w,
981
+ hideQuickSearch: t = !1,
982
+ pagination: n = !0,
983
+ paginationPageSizeSelector: o,
984
+ hideDetails: f = !1,
985
+ identityHref: v,
986
+ customFields: D,
987
+ "aria-label": T,
988
+ className: I
989
+ }, S) {
990
+ const { t: V } = $("ui"), A = k(null), E = k(null), [G, le] = te(null);
991
+ pe(
992
+ S,
993
+ () => G ?? A.current,
994
+ [G]
995
+ );
996
+ const { lockColumns: re } = at(A, {
997
+ containerRef: E,
998
+ enabled: h
999
+ }), M = r ?? a === "compact", Q = k(M), X = z(() => Q.current, []);
1000
+ ee(() => {
1001
+ var y;
1002
+ Q.current = M;
1003
+ const N = (y = A.current) == null ? void 0 : y.getRawApi();
1004
+ N && (N.setColumnWidths([
1005
+ {
1006
+ key: "actions",
1007
+ newWidth: M ? 88 : ae(Qe)
1008
+ }
1009
+ ]), N.refreshCells({ force: !0 }));
1010
+ }, [M, G]);
1011
+ const oe = Y(
1012
+ () => d ?? tt(V, {
1013
+ hideDetails: f,
1014
+ onRowAction: u,
1015
+ identityHref: v,
1016
+ customFields: D,
1017
+ getActionsCompact: X
1018
+ }),
1019
+ [
1020
+ d,
1021
+ V,
1022
+ f,
1023
+ u,
1024
+ v,
1025
+ D,
1026
+ X
1027
+ ]
1028
+ ), se = ((m == null ? void 0 : m.length) ?? 0) > 0, de = /* @__PURE__ */ O(P.Toolbar, { children: [
1029
+ /* @__PURE__ */ O(P.Toolbar.FilterBar, { children: [
1030
+ se && m ? /* @__PURE__ */ g(
1031
+ rt,
1032
+ {
1033
+ views: m,
1034
+ handleRef: A,
1035
+ lockColumns: re,
1036
+ label: V("patientTable.views.label")
1037
+ }
1038
+ ) : null,
1039
+ t ? null : /* @__PURE__ */ g(P.Toolbar.QuickSearch, {}),
1040
+ /* @__PURE__ */ g(P.Toolbar.FilterChips, {})
1041
+ ] }),
1042
+ /* @__PURE__ */ O(P.Toolbar.Actions, { children: [
1043
+ C == null ? void 0 : C.map((N) => /* @__PURE__ */ g(
1044
+ P.Toolbar.BulkAction,
1045
+ {
1046
+ label: N.label,
1047
+ icon: N.icon,
1048
+ variant: N.variant,
1049
+ onClick: (y) => {
1050
+ const fe = (y == null ? void 0 : y.getSelectedNodes().map((j) => j.id).filter((j) => j != null)) ?? [];
1051
+ N.onSelect(fe);
1052
+ }
1053
+ },
1054
+ N.id
1055
+ )),
1056
+ /* @__PURE__ */ g(P.Toolbar.ColumnToggle, {}),
1057
+ /* @__PURE__ */ g(P.Toolbar.ExportMenu, {})
1058
+ ] })
1059
+ ] }), ce = w ?? de, ue = l ? void 0 : i, me = Y(() => ({ getRowId: lt }), []);
1060
+ return ye(
1061
+ Re,
1062
+ G,
1063
+ s
1064
+ ), /* @__PURE__ */ g(
1065
+ "div",
1066
+ {
1067
+ ref: E,
1068
+ role: "region",
1069
+ "aria-label": T ?? V("patientTable.regionLabel"),
1070
+ "data-component": "patient-table",
1071
+ "data-component-id": s,
1072
+ className: "ds:flex ds:w-full ds:min-h-0 ds:flex-1 ds:flex-col",
1073
+ children: /* @__PURE__ */ g(
1074
+ P,
1075
+ {
1076
+ ref: (N) => {
1077
+ A.current = N, le(
1078
+ (y) => y === N ? y : N
1079
+ );
1080
+ },
1081
+ gridId: s,
1082
+ columnDefs: oe,
1083
+ rowData: ue,
1084
+ rowSelection: "multiple",
1085
+ pagination: n,
1086
+ ...c !== void 0 ? { heightClass: c } : {},
1087
+ ...o !== void 0 ? { paginationPageSizeSelector: o } : {},
1088
+ density: a,
1089
+ getRowClass: it,
1090
+ gridOptions: me,
1091
+ className: I,
1092
+ children: ce
1093
+ }
1094
+ )
1095
+ }
1096
+ );
1097
+ }
1098
+ );
1099
+ ot.displayName = "PatientTable";
1100
+ export {
1101
+ _e as B,
1102
+ ze as C,
1103
+ qe as N,
1104
+ Qe as P,
1105
+ ot as a,
1106
+ tt as b,
1107
+ q as g,
1108
+ at as u
1109
+ };
1110
+ //# sourceMappingURL=patient-table-CHxf3Oqk.js.map