@alfadocs/ui-kit-debug 1.45.0 → 1.46.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 (284) hide show
  1. package/dist/_chunks/{actions-cell-renderer-BXBy9c0f.js → actions-cell-renderer-B5m9lwgC.js} +2 -2
  2. package/dist/_chunks/{actions-cell-renderer-BXBy9c0f.js.map → actions-cell-renderer-B5m9lwgC.js.map} +1 -1
  3. package/dist/_chunks/ai-credits-notice-xszqOZTC.js +90 -0
  4. package/dist/_chunks/ai-credits-notice-xszqOZTC.js.map +1 -0
  5. package/dist/_chunks/ai-credits-notice.agent-C9L7orrP.js +17 -0
  6. package/dist/_chunks/ai-credits-notice.agent-C9L7orrP.js.map +1 -0
  7. package/dist/_chunks/{ai-consent-banner-D7I2U-cz.js → ai-permission-notice-D7I2U-cz.js} +1 -1
  8. package/dist/_chunks/ai-permission-notice-D7I2U-cz.js.map +1 -0
  9. package/dist/_chunks/ai-sparkle-D23NT8Z_.js +45 -0
  10. package/dist/_chunks/ai-sparkle-D23NT8Z_.js.map +1 -0
  11. package/dist/_chunks/{anamnesis-summary-rows-DQUqwWc1.js → anamnesis-summary-rows-DI-UX5r6.js} +2 -2
  12. package/dist/_chunks/{anamnesis-summary-rows-DQUqwWc1.js.map → anamnesis-summary-rows-DI-UX5r6.js.map} +1 -1
  13. package/dist/_chunks/{appointment-card-TgR_2GKS.js → appointment-card-DluZy8Iv.js} +2 -2
  14. package/dist/_chunks/{appointment-card-TgR_2GKS.js.map → appointment-card-DluZy8Iv.js.map} +1 -1
  15. package/dist/_chunks/{appointment-peek-abiR0T9e.js → appointment-peek-BsfCpiJs.js} +3 -3
  16. package/dist/_chunks/{appointment-peek-abiR0T9e.js.map → appointment-peek-BsfCpiJs.js.map} +1 -1
  17. package/dist/_chunks/{appointment-timeline-CCnyUYKz.js → appointment-timeline-Cs5f9viN.js} +3 -3
  18. package/dist/_chunks/{appointment-timeline-CCnyUYKz.js.map → appointment-timeline-Cs5f9viN.js.map} +1 -1
  19. package/dist/_chunks/{appointment-tray-N0yEI8UF.js → appointment-tray-CLrGGnKR.js} +2 -2
  20. package/dist/_chunks/{appointment-tray-N0yEI8UF.js.map → appointment-tray-CLrGGnKR.js.map} +1 -1
  21. package/dist/_chunks/baby-Dku-Xvg9.js +23 -0
  22. package/dist/_chunks/baby-Dku-Xvg9.js.map +1 -0
  23. package/dist/_chunks/{balance-badge-cell-o6LldMUA.js → balance-badge-cell-YGrYdrvR.js} +3 -3
  24. package/dist/_chunks/{balance-badge-cell-o6LldMUA.js.map → balance-badge-cell-YGrYdrvR.js.map} +1 -1
  25. package/dist/_chunks/{booking-D43ASl8y.js → booking-B7gA9gFB.js} +279 -296
  26. package/dist/_chunks/booking-B7gA9gFB.js.map +1 -0
  27. package/dist/_chunks/button-group-CA1tmu39.js +325 -0
  28. package/dist/_chunks/button-group-CA1tmu39.js.map +1 -0
  29. package/dist/_chunks/{calendar-U6N0F99w.js → calendar-OzSeTb4V.js} +2 -2
  30. package/dist/_chunks/{calendar-U6N0F99w.js.map → calendar-OzSeTb4V.js.map} +1 -1
  31. package/dist/_chunks/{calendar-event-card-DKUnT9Be.js → calendar-event-card-B6N5h1dO.js} +57 -48
  32. package/dist/_chunks/{calendar-event-card-DKUnT9Be.js.map → calendar-event-card-B6N5h1dO.js.map} +1 -1
  33. package/dist/_chunks/{calendar-workspace-B7KvZ1_D.js → calendar-workspace-BB-BZT7W.js} +3002 -2912
  34. package/dist/_chunks/calendar-workspace-BB-BZT7W.js.map +1 -0
  35. package/dist/_chunks/{chart-PF2krCZC.js → chart-D8ucl8hH.js} +2 -2
  36. package/dist/_chunks/{chart-PF2krCZC.js.map → chart-D8ucl8hH.js.map} +1 -1
  37. package/dist/_chunks/{data-table-CcAx_I1w.js → data-table-DnKOmEVw.js} +2 -2
  38. package/dist/_chunks/{data-table-CcAx_I1w.js.map → data-table-DnKOmEVw.js.map} +1 -1
  39. package/dist/_chunks/{editable-currency-cell-renderer-Psb6XKHR.js → editable-currency-cell-renderer-OUkUv7U4.js} +2 -2
  40. package/dist/_chunks/{editable-currency-cell-renderer-Psb6XKHR.js.map → editable-currency-cell-renderer-OUkUv7U4.js.map} +1 -1
  41. package/dist/_chunks/{face-scheme-Bm6pe7R8.js → face-scheme-mIhwrQXt.js} +3 -3
  42. package/dist/_chunks/{face-scheme-Bm6pe7R8.js.map → face-scheme-mIhwrQXt.js.map} +1 -1
  43. package/dist/_chunks/{file-manager-BfLQxF5t.js → file-manager-DOcJGIx2.js} +4 -4
  44. package/dist/_chunks/{file-manager-BfLQxF5t.js.map → file-manager-DOcJGIx2.js.map} +1 -1
  45. package/dist/_chunks/{header-settings-CTe45iDy.js → header-settings-BEfx_-TF.js} +2 -2
  46. package/dist/_chunks/{header-settings-CTe45iDy.js.map → header-settings-BEfx_-TF.js.map} +1 -1
  47. package/dist/_chunks/{help-me-write-templates-GUeEn3Ff.js → help-me-write-templates-DHIwa4xR.js} +205 -199
  48. package/dist/_chunks/help-me-write-templates-DHIwa4xR.js.map +1 -0
  49. package/dist/_chunks/{hover-card-BMJBVqIf.js → hover-card-nUae8NPJ.js} +67 -62
  50. package/dist/_chunks/{hover-card-BMJBVqIf.js.map → hover-card-nUae8NPJ.js.map} +1 -1
  51. package/dist/_chunks/{icon-button-group-DkkdIygu.js → icon-button-group-DZKC6KGf.js} +181 -168
  52. package/dist/_chunks/icon-button-group-DZKC6KGf.js.map +1 -0
  53. package/dist/_chunks/kit-extensions-DuoFF1R3.js +94 -0
  54. package/dist/_chunks/kit-extensions-DuoFF1R3.js.map +1 -0
  55. package/dist/_chunks/{marketplace-app-shell-DdwPj03y.js → marketplace-app-shell-PB89Dkk_.js} +2 -2
  56. package/dist/_chunks/{marketplace-app-shell-DdwPj03y.js.map → marketplace-app-shell-PB89Dkk_.js.map} +1 -1
  57. package/dist/_chunks/{notes-panel-Dkk9QPPX.js → notes-panel-CHbDDMx8.js} +83 -73
  58. package/dist/_chunks/notes-panel-CHbDDMx8.js.map +1 -0
  59. package/dist/_chunks/{patient-details-C8ImUrVg.js → patient-details-DUj1htsH.js} +2 -2
  60. package/dist/_chunks/{patient-details-C8ImUrVg.js.map → patient-details-DUj1htsH.js.map} +1 -1
  61. package/dist/_chunks/{patient-field-row-BRSOKvme.js → patient-field-row-CO0WR7yA.js} +2 -2
  62. package/dist/_chunks/patient-field-row-CO0WR7yA.js.map +1 -0
  63. package/dist/_chunks/{patient-summary-card-BhmKB2KR.js → patient-summary-card-DNzdYjxE.js} +59 -45
  64. package/dist/_chunks/patient-summary-card-DNzdYjxE.js.map +1 -0
  65. package/dist/_chunks/rich-text-editor-BwDV2XkZ.js +4153 -0
  66. package/dist/_chunks/rich-text-editor-BwDV2XkZ.js.map +1 -0
  67. package/dist/_chunks/{tasks-panel-CpcikOeY.js → tasks-panel-DncuBPIZ.js} +2 -2
  68. package/dist/_chunks/{tasks-panel-CpcikOeY.js.map → tasks-panel-DncuBPIZ.js.map} +1 -1
  69. package/dist/_chunks/{theme-toggle-bI0pgDDv.js → theme-toggle-BP0XRGMM.js} +2 -2
  70. package/dist/_chunks/{theme-toggle-bI0pgDDv.js.map → theme-toggle-BP0XRGMM.js.map} +1 -1
  71. package/dist/_chunks/use-ai-sparkle-Cf4yVTLB.js +76 -0
  72. package/dist/_chunks/use-ai-sparkle-Cf4yVTLB.js.map +1 -0
  73. package/dist/_chunks/{workflow-status-xeaJTzD3.js → workflow-status-CuJAOuKL.js} +43 -42
  74. package/dist/_chunks/{workflow-status-xeaJTzD3.js.map → workflow-status-CuJAOuKL.js.map} +1 -1
  75. package/dist/agent-catalog.json +32 -4
  76. package/dist/agent-i18n/en.json +1 -1
  77. package/dist/components/_shared/field-value.d.ts.map +1 -1
  78. package/dist/components/ai-credits-notice/ai-credits-notice.agent.d.ts +3 -0
  79. package/dist/components/ai-credits-notice/ai-credits-notice.agent.d.ts.map +1 -0
  80. package/dist/components/ai-credits-notice/ai-credits-notice.d.ts +48 -0
  81. package/dist/components/ai-credits-notice/ai-credits-notice.d.ts.map +1 -0
  82. package/dist/components/ai-credits-notice/index.d.ts +4 -0
  83. package/dist/components/ai-credits-notice/index.d.ts.map +1 -0
  84. package/dist/components/ai-credits-notice/index.js +7 -0
  85. package/dist/components/ai-credits-notice/index.js.map +1 -0
  86. package/dist/components/{ai-consent-banner/ai-consent-banner.agent.d.ts → ai-permission-notice/ai-permission-notice.agent.d.ts} +2 -2
  87. package/dist/components/ai-permission-notice/ai-permission-notice.agent.d.ts.map +1 -0
  88. package/dist/components/{ai-consent-banner/ai-consent-banner.d.ts → ai-permission-notice/ai-permission-notice.d.ts} +1 -1
  89. package/dist/components/ai-permission-notice/ai-permission-notice.d.ts.map +1 -0
  90. package/dist/components/ai-permission-notice/index.d.ts +4 -0
  91. package/dist/components/ai-permission-notice/index.d.ts.map +1 -0
  92. package/dist/components/{ai-consent-banner → ai-permission-notice}/index.js +1 -1
  93. package/dist/components/ai-sparkle/ai-sparkle.d.ts +3 -3
  94. package/dist/components/ai-sparkle/ai-sparkle.d.ts.map +1 -1
  95. package/dist/components/ai-sparkle/index.js +1 -1
  96. package/dist/components/appointment-card/index.js +2 -2
  97. package/dist/components/appointment-peek/index.js +1 -1
  98. package/dist/components/appointment-timeline/index.js +1 -1
  99. package/dist/components/booking/index.js +1 -1
  100. package/dist/components/button-group/button-group.d.ts.map +1 -1
  101. package/dist/components/button-group/index.js +1 -1
  102. package/dist/components/calendar/index.js +1 -1
  103. package/dist/components/calendar-event-card/calendar-event-card.d.ts.map +1 -1
  104. package/dist/components/calendar-event-card/index.js +1 -1
  105. package/dist/components/chart/index.js +1 -1
  106. package/dist/components/data-table/index.js +3 -3
  107. package/dist/components/face-scheme/index.js +1 -1
  108. package/dist/components/file-manager/index.js +1 -1
  109. package/dist/components/header-settings/index.js +1 -1
  110. package/dist/components/hover-card/hover-card.d.ts +4 -0
  111. package/dist/components/hover-card/hover-card.d.ts.map +1 -1
  112. package/dist/components/hover-card/index.d.ts +1 -1
  113. package/dist/components/hover-card/index.d.ts.map +1 -1
  114. package/dist/components/hover-card/index.js +3 -2
  115. package/dist/components/icon-button-group/icon-button-group.d.ts.map +1 -1
  116. package/dist/components/icon-button-group/index.js +1 -1
  117. package/dist/components/index.d.ts +2 -1
  118. package/dist/components/index.d.ts.map +1 -1
  119. package/dist/components/notes-panel/index.js +1 -1
  120. package/dist/components/notes-panel/notes-panel.d.ts +10 -0
  121. package/dist/components/notes-panel/notes-panel.d.ts.map +1 -1
  122. package/dist/components/patient-details/index.js +1 -1
  123. package/dist/components/patient-summary-card/index.js +1 -1
  124. package/dist/components/patient-summary-card/patient-summary-card.d.ts.map +1 -1
  125. package/dist/components/patient-table/index.js +1 -1
  126. package/dist/components/rich-text-editor/editor-extensions.d.ts +54 -0
  127. package/dist/components/rich-text-editor/editor-extensions.d.ts.map +1 -0
  128. package/dist/components/rich-text-editor/editor-toolbar.d.ts +2 -1
  129. package/dist/components/rich-text-editor/editor-toolbar.d.ts.map +1 -1
  130. package/dist/components/rich-text-editor/help-me-write-overlay.d.ts +4 -0
  131. package/dist/components/rich-text-editor/help-me-write-overlay.d.ts.map +1 -1
  132. package/dist/components/rich-text-editor/index.d.ts +2 -0
  133. package/dist/components/rich-text-editor/index.d.ts.map +1 -1
  134. package/dist/components/rich-text-editor/index.js +6 -4
  135. package/dist/components/rich-text-editor/index.js.map +1 -1
  136. package/dist/components/rich-text-editor/kit-extensions.d.ts +4 -0
  137. package/dist/components/rich-text-editor/kit-extensions.d.ts.map +1 -0
  138. package/dist/components/rich-text-editor/rich-text-editor.d.ts +18 -2
  139. package/dist/components/rich-text-editor/rich-text-editor.d.ts.map +1 -1
  140. package/dist/components/tasks-panel/index.js +1 -1
  141. package/dist/components/theme-toggle/index.js +1 -1
  142. package/dist/components/workflow-status/index.js +1 -1
  143. package/dist/components/workflow-status/workflow-status.d.ts.map +1 -1
  144. package/dist/hooks/index.d.ts +1 -1
  145. package/dist/hooks/index.d.ts.map +1 -1
  146. package/dist/hooks/index.js +51 -53
  147. package/dist/hooks/use-ai-sparkle.d.ts +7 -25
  148. package/dist/hooks/use-ai-sparkle.d.ts.map +1 -1
  149. package/dist/host-compat.css +2 -2
  150. package/dist/i18n/locales/ar.d.ts +31 -0
  151. package/dist/i18n/locales/ar.d.ts.map +1 -1
  152. package/dist/i18n/locales/ar.js +33 -2
  153. package/dist/i18n/locales/ar.js.map +1 -1
  154. package/dist/i18n/locales/de.d.ts +31 -0
  155. package/dist/i18n/locales/de.d.ts.map +1 -1
  156. package/dist/i18n/locales/de.js +33 -2
  157. package/dist/i18n/locales/de.js.map +1 -1
  158. package/dist/i18n/locales/el.d.ts +31 -0
  159. package/dist/i18n/locales/el.d.ts.map +1 -1
  160. package/dist/i18n/locales/el.js +33 -2
  161. package/dist/i18n/locales/el.js.map +1 -1
  162. package/dist/i18n/locales/en.d.ts +31 -0
  163. package/dist/i18n/locales/en.d.ts.map +1 -1
  164. package/dist/i18n/locales/en.js +33 -2
  165. package/dist/i18n/locales/en.js.map +1 -1
  166. package/dist/i18n/locales/es.d.ts +31 -0
  167. package/dist/i18n/locales/es.d.ts.map +1 -1
  168. package/dist/i18n/locales/es.js +33 -2
  169. package/dist/i18n/locales/es.js.map +1 -1
  170. package/dist/i18n/locales/fr.d.ts +31 -0
  171. package/dist/i18n/locales/fr.d.ts.map +1 -1
  172. package/dist/i18n/locales/fr.js +33 -2
  173. package/dist/i18n/locales/fr.js.map +1 -1
  174. package/dist/i18n/locales/hi.d.ts +31 -0
  175. package/dist/i18n/locales/hi.d.ts.map +1 -1
  176. package/dist/i18n/locales/hi.js +33 -2
  177. package/dist/i18n/locales/hi.js.map +1 -1
  178. package/dist/i18n/locales/it.d.ts +31 -0
  179. package/dist/i18n/locales/it.d.ts.map +1 -1
  180. package/dist/i18n/locales/it.js +33 -2
  181. package/dist/i18n/locales/it.js.map +1 -1
  182. package/dist/i18n/locales/ja.d.ts +31 -0
  183. package/dist/i18n/locales/ja.d.ts.map +1 -1
  184. package/dist/i18n/locales/ja.js +33 -2
  185. package/dist/i18n/locales/ja.js.map +1 -1
  186. package/dist/i18n/locales/nl.d.ts +31 -0
  187. package/dist/i18n/locales/nl.d.ts.map +1 -1
  188. package/dist/i18n/locales/nl.js +33 -2
  189. package/dist/i18n/locales/nl.js.map +1 -1
  190. package/dist/i18n/locales/pl.d.ts +31 -0
  191. package/dist/i18n/locales/pl.d.ts.map +1 -1
  192. package/dist/i18n/locales/pl.js +33 -2
  193. package/dist/i18n/locales/pl.js.map +1 -1
  194. package/dist/i18n/locales/pt.d.ts +31 -0
  195. package/dist/i18n/locales/pt.d.ts.map +1 -1
  196. package/dist/i18n/locales/pt.js +33 -2
  197. package/dist/i18n/locales/pt.js.map +1 -1
  198. package/dist/i18n/locales/ro.d.ts +31 -0
  199. package/dist/i18n/locales/ro.d.ts.map +1 -1
  200. package/dist/i18n/locales/ro.js +33 -2
  201. package/dist/i18n/locales/ro.js.map +1 -1
  202. package/dist/i18n/locales/ru.d.ts +31 -0
  203. package/dist/i18n/locales/ru.d.ts.map +1 -1
  204. package/dist/i18n/locales/ru.js +33 -2
  205. package/dist/i18n/locales/ru.js.map +1 -1
  206. package/dist/i18n/locales/sq.d.ts +31 -0
  207. package/dist/i18n/locales/sq.d.ts.map +1 -1
  208. package/dist/i18n/locales/sq.js +33 -2
  209. package/dist/i18n/locales/sq.js.map +1 -1
  210. package/dist/i18n/locales/sv.d.ts +31 -0
  211. package/dist/i18n/locales/sv.d.ts.map +1 -1
  212. package/dist/i18n/locales/sv.js +33 -2
  213. package/dist/i18n/locales/sv.js.map +1 -1
  214. package/dist/i18n/locales/tr.d.ts +31 -0
  215. package/dist/i18n/locales/tr.d.ts.map +1 -1
  216. package/dist/i18n/locales/tr.js +33 -2
  217. package/dist/i18n/locales/tr.js.map +1 -1
  218. package/dist/i18n/locales/zh.d.ts +31 -0
  219. package/dist/i18n/locales/zh.d.ts.map +1 -1
  220. package/dist/i18n/locales/zh.js +33 -2
  221. package/dist/i18n/locales/zh.js.map +1 -1
  222. package/dist/index.js +646 -639
  223. package/dist/index.js.map +1 -1
  224. package/dist/locales/ar.json +33 -2
  225. package/dist/locales/de.json +33 -2
  226. package/dist/locales/el.json +33 -2
  227. package/dist/locales/en.json +33 -2
  228. package/dist/locales/es.json +33 -2
  229. package/dist/locales/fr.json +33 -2
  230. package/dist/locales/hi.json +33 -2
  231. package/dist/locales/it.json +33 -2
  232. package/dist/locales/ja.json +33 -2
  233. package/dist/locales/nl.json +33 -2
  234. package/dist/locales/pl.json +33 -2
  235. package/dist/locales/pt.json +33 -2
  236. package/dist/locales/ro.json +33 -2
  237. package/dist/locales/ru.json +33 -2
  238. package/dist/locales/sq.json +33 -2
  239. package/dist/locales/sv.json +33 -2
  240. package/dist/locales/tr.json +33 -2
  241. package/dist/locales/zh.json +33 -2
  242. package/dist/patterns/anamnesis/index.js +1 -1
  243. package/dist/patterns/calendar/calendar-appointment-details.d.ts.map +1 -1
  244. package/dist/patterns/calendar/calendar-appointment-details.sections.d.ts.map +1 -1
  245. package/dist/patterns/calendar/calendar-bookings-panel.d.ts.map +1 -1
  246. package/dist/patterns/calendar/calendar-workspace.d.ts +6 -4
  247. package/dist/patterns/calendar/calendar-workspace.d.ts.map +1 -1
  248. package/dist/patterns/calendar/calendar.data.d.ts +9 -0
  249. package/dist/patterns/calendar/calendar.data.d.ts.map +1 -1
  250. package/dist/patterns/calendar/calendar.journey.d.ts +1 -1
  251. package/dist/patterns/calendar/calendar.journey.d.ts.map +1 -1
  252. package/dist/patterns/calendar/calendar.sheets.d.ts +16 -5
  253. package/dist/patterns/calendar/calendar.sheets.d.ts.map +1 -1
  254. package/dist/patterns/calendar/calendar.surface.d.ts.map +1 -1
  255. package/dist/patterns/calendar/calendar.types.d.ts +3 -1
  256. package/dist/patterns/calendar/calendar.types.d.ts.map +1 -1
  257. package/dist/patterns/calendar/index.js +1 -1
  258. package/dist/patterns/help-me-write-templates/help-me-write-templates.d.ts +11 -2
  259. package/dist/patterns/help-me-write-templates/help-me-write-templates.d.ts.map +1 -1
  260. package/dist/patterns/help-me-write-templates/index.js +1 -1
  261. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  262. package/dist/tokens.css +1 -1
  263. package/package.json +14 -4
  264. package/dist/_chunks/ai-consent-banner-D7I2U-cz.js.map +0 -1
  265. package/dist/_chunks/ai-sparkle-DXeP_6a0.js +0 -52
  266. package/dist/_chunks/ai-sparkle-DXeP_6a0.js.map +0 -1
  267. package/dist/_chunks/booking-D43ASl8y.js.map +0 -1
  268. package/dist/_chunks/button-group-R32U7SyV.js +0 -307
  269. package/dist/_chunks/button-group-R32U7SyV.js.map +0 -1
  270. package/dist/_chunks/calendar-workspace-B7KvZ1_D.js.map +0 -1
  271. package/dist/_chunks/help-me-write-templates-GUeEn3Ff.js.map +0 -1
  272. package/dist/_chunks/icon-button-group-DkkdIygu.js.map +0 -1
  273. package/dist/_chunks/notes-panel-Dkk9QPPX.js.map +0 -1
  274. package/dist/_chunks/patient-field-row-BRSOKvme.js.map +0 -1
  275. package/dist/_chunks/patient-summary-card-BhmKB2KR.js.map +0 -1
  276. package/dist/_chunks/rich-text-editor-BrAvNajV.js +0 -3779
  277. package/dist/_chunks/rich-text-editor-BrAvNajV.js.map +0 -1
  278. package/dist/_chunks/use-ai-sparkle-CyQSRTCe.js +0 -103
  279. package/dist/_chunks/use-ai-sparkle-CyQSRTCe.js.map +0 -1
  280. package/dist/components/ai-consent-banner/ai-consent-banner.agent.d.ts.map +0 -1
  281. package/dist/components/ai-consent-banner/ai-consent-banner.d.ts.map +0 -1
  282. package/dist/components/ai-consent-banner/index.d.ts +0 -4
  283. package/dist/components/ai-consent-banner/index.d.ts.map +0 -1
  284. /package/dist/components/{ai-consent-banner → ai-permission-notice}/index.js.map +0 -0
@@ -1,29 +1,29 @@
1
- import { jsxs as d, jsx as n, Fragment as rt } from "react/jsx-runtime";
2
- import { forwardRef as ot, useRef as p, useState as x, useId as dt, useCallback as T, useEffect as me, useImperativeHandle as ct, useMemo as ut } from "react";
1
+ import { jsxs as d, jsx as n, Fragment as pt } from "react/jsx-runtime";
2
+ import { forwardRef as ft, useRef as p, useState as x, useId as mt, useCallback as T, useEffect as me, useImperativeHandle as gt, useMemo as ht } from "react";
3
3
  import { c as Ce } from "./index-D2ZczOXr.js";
4
- import { useTranslation as pt } from "react-i18next";
5
- import { u as ft } from "./registry-DvAUVLHh.js";
6
- import { C as mt } from "./clinical-note-card-DdsGYMmI.js";
7
- import { R as gt } from "./rich-text-editor-BrAvNajV.js";
8
- import { T as ht } from "./text-area-Bt3p7Pt0.js";
4
+ import { useTranslation as vt } from "react-i18next";
5
+ import { u as yt } from "./registry-DvAUVLHh.js";
6
+ import { C as bt } from "./clinical-note-card-DdsGYMmI.js";
7
+ import { R as Ct } from "./rich-text-editor-BwDV2XkZ.js";
8
+ import { T as Pt } from "./text-area-Bt3p7Pt0.js";
9
9
  import { A as I } from "./alert-CiQ5Pa3Q.js";
10
10
  import { B as z } from "./button-CaUe1uyd.js";
11
11
  import { I as ge } from "./icon-button-CehAeZoP.js";
12
- import { S as vt } from "./switch-OILsBLWo.js";
13
- import { T as yt } from "./tooltip-Cp-PLePW.js";
12
+ import { S as wt } from "./switch-OILsBLWo.js";
13
+ import { T as xt } from "./tooltip-Cp-PLePW.js";
14
14
  import { C as he } from "./card-DPmk26CL.js";
15
- import { C as bt, S as M } from "./skeleton-B1KTdJ4N.js";
15
+ import { C as Tt, S as M } from "./skeleton-B1KTdJ4N.js";
16
16
  import { D as v } from "./dialog-BJiLqhx6.js";
17
- import { P as Ct } from "./panel-header-D_mTdhUp.js";
18
- import { a as Pt, u as wt, R as xt } from "./use-list-reflow-Cw43nxw5.js";
19
- import { u as Tt } from "./use-theme-CAuo6EYT.js";
20
- import { N as Et } from "./notebook-pen-CO7HoM-W.js";
21
- import { P as Nt } from "./pencil-B1sKKyuT.js";
22
- import { T as Vt } from "./trash-2-uumy3fy1.js";
17
+ import { P as Et } from "./panel-header-D_mTdhUp.js";
18
+ import { a as Nt, u as Vt, R as Rt } from "./use-list-reflow-Cw43nxw5.js";
19
+ import { u as kt } from "./use-theme-CAuo6EYT.js";
20
+ import { N as St } from "./notebook-pen-CO7HoM-W.js";
21
+ import { P as _t } from "./pencil-B1sKKyuT.js";
22
+ import { T as It } from "./trash-2-uumy3fy1.js";
23
23
  function ve(i, c) {
24
24
  return typeof i == "object" && i !== null && "message" in i && typeof i.message == "string" && i.message.trim() ? i.message : c;
25
25
  }
26
- const Rt = {
26
+ const zt = {
27
27
  id: "notes-panel",
28
28
  // 'submit' backs add_note (compose + commit a note). pin / flag are toggles
29
29
  // with no dedicated capability in the closed vocabulary.
@@ -122,7 +122,7 @@ const Rt = {
122
122
  description: "Sourced from the id prop. Required to address a specific notes panel from the agent."
123
123
  }
124
124
  }
125
- }, kt = "ds:isolate ds:[&_[data-component=card]>*]:relative ds:[&_[data-component=card]>*]:z-[1]", St = Ce(
125
+ }, jt = "ds:isolate ds:[&_[data-component=card]>*]:relative ds:[&_[data-component=card]>*]:z-[1]", At = Ce(
126
126
  "ds:relative ds:flex ds:flex-col ds:rounded-[var(--radius-lg)]",
127
127
  {
128
128
  variants: {
@@ -130,7 +130,7 @@ const Rt = {
130
130
  true: "ds:focus:outline-[length:var(--focus-ring-width)] ds:focus:outline-solid ds:focus:outline-[color:var(--ring)] ds:focus:outline-offset-[length:var(--focus-ring-offset)]",
131
131
  false: ""
132
132
  },
133
- washed: { true: kt, false: "" }
133
+ washed: { true: jt, false: "" }
134
134
  },
135
135
  defaultVariants: { current: !1, washed: !1 }
136
136
  }
@@ -149,14 +149,14 @@ const Rt = {
149
149
  }
150
150
  }
151
151
  }
152
- ), _t = "ds:opacity-0", It = [
152
+ ), Lt = "ds:opacity-0", Ht = [
153
153
  "ds:transition-opacity ds:duration-[var(--animation-duration)]",
154
154
  "ds:ease-[var(--ease-out)] ds:motion-reduce:transition-none"
155
- ].join(" "), zt = [3, 2, 3];
155
+ ].join(" "), Ot = [3, 2, 3];
156
156
  function be(i) {
157
157
  return i ? /<img\b/i.test(i) ? !0 : i.replace(/<[^>]*>/g, "").replace(/&nbsp;/gi, " ").trim().length > 0 : !1;
158
158
  }
159
- const nn = ot(
159
+ const on = ft(
160
160
  function({
161
161
  id: c,
162
162
  notes: j,
@@ -188,26 +188,31 @@ const nn = ot(
188
188
  onAiApplied: Oe,
189
189
  onUploadImage: Be,
190
190
  onAiCreditsExhausted: De,
191
- composerBefore: We,
192
- composerAfter: qe,
191
+ showExtensions: We,
192
+ aiCreditsNotice: qe,
193
+ extensions: Fe,
194
+ extensionContext: Ke,
195
+ onExtensionRun: Me,
196
+ composerBefore: $e,
197
+ composerAfter: Ge,
193
198
  onTogglePin: L,
194
199
  onToggleFlag: H,
195
200
  noteActions: ee,
196
201
  onEditNote: N,
197
- editClinical: Fe = !1,
202
+ editClinical: Ye = !1,
198
203
  onDeleteNote: h,
199
204
  confirmDelete: $ = !0,
200
- title: Ke,
201
- composerPlaceholder: Me,
202
- addNoteLabel: $e,
203
- emptyState: Ge,
204
- className: Ye,
205
+ title: Je,
206
+ composerPlaceholder: Qe,
207
+ addNoteLabel: Ue,
208
+ emptyState: Xe,
209
+ className: Ze,
205
210
  "aria-label": G,
206
- ...Je
207
- }, Qe) {
208
- const { t: a, i18n: te } = pt(), b = p(null), [P, V] = x(""), [O, B] = x(E), [u, ne] = x(!1), [ae, R] = x(null), [r, Y] = x(null), ie = p(!1);
211
+ ...et
212
+ }, tt) {
213
+ const { t: a, i18n: te } = vt(), b = p(null), [P, V] = x(""), [O, B] = x(E), [u, ne] = x(!1), [ae, R] = x(null), [r, Y] = x(null), ie = p(!1);
209
214
  C === "loading" && (ie.current = !0);
210
- const Ue = ie.current ? bt : "", Xe = Ke ?? a("notesPanel.title", { defaultValue: "Notes" }), se = dt(), le = Me ?? a("notesPanel.placeholder", { defaultValue: "Add a note…" }), re = r !== null ? a("notesPanel.edit", { defaultValue: "Edit note" }) : a("notesPanel.composerLabel", { defaultValue: "New note" }), Ze = g === "rich" ? be(P) : P.trim().length > 0, et = T(() => {
215
+ const nt = ie.current ? Tt : "", at = Je ?? a("notesPanel.title", { defaultValue: "Notes" }), se = mt(), le = Qe ?? a("notesPanel.placeholder", { defaultValue: "Add a note…" }), re = r !== null ? a("notesPanel.edit", { defaultValue: "Edit note" }) : a("notesPanel.composerLabel", { defaultValue: "New note" }), it = g === "rich" ? be(P) : P.trim().length > 0, st = T(() => {
211
216
  var w;
212
217
  if (!(r !== null ? N : m) || u) return;
213
218
  const t = g === "rich", o = t ? ((w = b.current) == null ? void 0 : w.getHTML()) ?? P : P.trim();
@@ -239,7 +244,7 @@ const nn = ot(
239
244
  N,
240
245
  u,
241
246
  a
242
- ]), oe = Te && (r === null || Fe), de = T(
247
+ ]), oe = Te && (r === null || Ye), de = T(
243
248
  (e) => {
244
249
  try {
245
250
  return new Intl.DateTimeFormat(te.language, {
@@ -254,7 +259,7 @@ const nn = ot(
254
259
  }
255
260
  },
256
261
  [te.language]
257
- ), tt = T(
262
+ ), lt = T(
258
263
  (e) => {
259
264
  var o, l, s;
260
265
  if (!e.id || u) return;
@@ -271,15 +276,15 @@ const nn = ot(
271
276
  }, [ce, D]);
272
277
  const k = [...j].sort(
273
278
  (e, t) => Number(t.pinned ?? !1) - Number(e.pinned ?? !1)
274
- ), { resolvedTheme: nt } = Tt(), ue = nt.endsWith("-accessible") || void 0, { containerRef: at } = Pt({
279
+ ), { resolvedTheme: rt } = kt(), ue = rt.endsWith("-accessible") || void 0, { containerRef: ot } = Nt({
275
280
  key: k.map((e) => e.id).join(),
276
281
  reduceMotion: ue
277
- }), S = wt({ reduceMotion: ue }), [W, q] = x(null), it = T(
282
+ }), S = Vt({ reduceMotion: ue }), [W, q] = x(null), dt = T(
278
283
  (e) => {
279
284
  h && ($ ? q(e) : S.leave(e, () => h(e)));
280
285
  },
281
286
  [$, S, h]
282
- ), st = T(() => {
287
+ ), ct = T(() => {
283
288
  if (!W || !h) return;
284
289
  const e = W;
285
290
  q(null), S.leave(e, () => h(e));
@@ -301,8 +306,8 @@ const nn = ot(
301
306
  const pe = p(y);
302
307
  pe.current = y;
303
308
  const fe = p(null);
304
- ct(Qe, () => fe.current, []);
305
- const lt = ut(
309
+ gt(tt, () => fe.current, []);
310
+ const ut = ht(
306
311
  () => ({
307
312
  // Ids + flags only — never the note body or author (both PHI).
308
313
  getNotes: () => Q.current.map((e) => ({
@@ -331,7 +336,7 @@ const nn = ot(
331
336
  }),
332
337
  []
333
338
  );
334
- return ft(Rt, lt, c), /* @__PURE__ */ d(
339
+ return yt(zt, ut, c), /* @__PURE__ */ d(
335
340
  "section",
336
341
  {
337
342
  ref: fe,
@@ -339,14 +344,14 @@ const nn = ot(
339
344
  "data-component-id": c,
340
345
  "aria-labelledby": G ? void 0 : se,
341
346
  "aria-label": G,
342
- className: ["ds:flex ds:flex-col", Ye].filter(Boolean).join(" "),
343
- ...Je,
347
+ className: ["ds:flex ds:flex-col", Ze].filter(Boolean).join(" "),
348
+ ...et,
344
349
  children: [
345
350
  /* @__PURE__ */ n(
346
- Ct,
351
+ Et,
347
352
  {
348
- title: Xe,
349
- icon: /* @__PURE__ */ n(Et, { "aria-hidden": "true" }),
353
+ title: at,
354
+ icon: /* @__PURE__ */ n(St, { "aria-hidden": "true" }),
350
355
  headingId: G ? void 0 : se,
351
356
  sticky: !0,
352
357
  divider: !0
@@ -359,9 +364,9 @@ const nn = ot(
359
364
  "data-notes-panel-composer": r !== null ? "edit" : "add",
360
365
  className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
361
366
  children: [
362
- We,
367
+ $e,
363
368
  g === "rich" ? /* @__PURE__ */ n(
364
- gt,
369
+ Ct,
365
370
  {
366
371
  ref: b,
367
372
  ariaLabel: re,
@@ -387,10 +392,15 @@ const nn = ot(
387
392
  onAiApplied: Oe,
388
393
  onUploadImage: Be,
389
394
  onAiCreditsExhausted: De,
395
+ showExtensions: We,
396
+ aiCreditsNotice: qe,
397
+ extensions: Fe,
398
+ extensionContext: Ke,
399
+ onExtensionRun: Me,
390
400
  aiConsentHeadingLevel: 3
391
401
  }
392
402
  ) : /* @__PURE__ */ n(
393
- ht,
403
+ Pt,
394
404
  {
395
405
  value: P,
396
406
  readOnly: u,
@@ -414,7 +424,7 @@ const nn = ot(
414
424
  const e = u || !A, t = A ? void 0 : Ee ?? a("notesPanel.clinicalGated", {
415
425
  defaultValue: "You do not have permission to write clinical notes."
416
426
  }), o = /* @__PURE__ */ n(
417
- vt,
427
+ wt,
418
428
  {
419
429
  size: "sm",
420
430
  label: a("notesPanel.clinicalToggle", {
@@ -425,7 +435,7 @@ const nn = ot(
425
435
  disabled: e
426
436
  }
427
437
  );
428
- return e && t ? /* @__PURE__ */ n(yt, { label: t, children: /* @__PURE__ */ n("span", { tabIndex: 0, children: o }) }) : o;
438
+ return e && t ? /* @__PURE__ */ n(xt, { label: t, children: /* @__PURE__ */ n("span", { tabIndex: 0, children: o }) }) : o;
429
439
  })() : null,
430
440
  /* @__PURE__ */ d("span", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
431
441
  r !== null ? /* @__PURE__ */ n(
@@ -444,10 +454,10 @@ const nn = ot(
444
454
  {
445
455
  type: "button",
446
456
  size: "sm",
447
- onClick: et,
448
- disabled: !Ze,
457
+ onClick: st,
458
+ disabled: !it,
449
459
  loading: u,
450
- children: r !== null ? a("notesPanel.saveEdit", { defaultValue: "Save note" }) : $e ?? a("notesPanel.add", { defaultValue: "Add note" })
460
+ children: r !== null ? a("notesPanel.saveEdit", { defaultValue: "Save note" }) : Ue ?? a("notesPanel.add", { defaultValue: "Add note" })
451
461
  }
452
462
  )
453
463
  ] })
@@ -455,7 +465,7 @@ const nn = ot(
455
465
  }
456
466
  ),
457
467
  ae ? /* @__PURE__ */ n(I, { variant: "error", children: /* @__PURE__ */ n(I.Description, { children: ae }) }) : null,
458
- qe
468
+ Ge
459
469
  ]
460
470
  }
461
471
  ) : null,
@@ -471,7 +481,7 @@ const nn = ot(
471
481
  className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
472
482
  children: [
473
483
  /* @__PURE__ */ n("span", { role: "status", className: "ds:sr-only", children: a("notesPanel.loading") }),
474
- zt.map((e, t) => /* @__PURE__ */ n(he, { variant: "elevated", "aria-hidden": "true", children: /* @__PURE__ */ n(he.Body, { children: /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
484
+ Ot.map((e, t) => /* @__PURE__ */ n(he, { variant: "elevated", "aria-hidden": "true", children: /* @__PURE__ */ n(he.Body, { children: /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
475
485
  /* @__PURE__ */ d("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
476
486
  /* @__PURE__ */ n(
477
487
  M,
@@ -523,9 +533,9 @@ const nn = ot(
523
533
  k.length > 0 ? /* @__PURE__ */ n(
524
534
  "ul",
525
535
  {
526
- ref: at,
536
+ ref: ot,
527
537
  "aria-busy": C === "loading" || void 0,
528
- className: `ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-0 ${Ue}`.trim(),
538
+ className: `ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-0 ${nt}`.trim(),
529
539
  children: k.map(({ actions: e, ...t }, o) => {
530
540
  const l = y != null && t.id === y, s = t.id, w = s != null && r === s, f = s != null && S.isLeaving(s);
531
541
  return /* @__PURE__ */ d(
@@ -538,13 +548,13 @@ const nn = ot(
538
548
  "data-leaving": f ? "" : void 0,
539
549
  "data-editing": w ? "" : void 0,
540
550
  className: [
541
- St({
551
+ At({
542
552
  current: l,
543
553
  washed: l || w
544
554
  }),
545
- It,
546
- xt,
547
- f ? _t : ""
555
+ Ht,
556
+ Rt,
557
+ f ? Lt : ""
548
558
  ].filter(Boolean).join(" "),
549
559
  children: [
550
560
  l ? /* @__PURE__ */ n("span", { className: "ds:sr-only", children: a("notesPanel.current", {
@@ -567,16 +577,16 @@ const nn = ot(
567
577
  `${y}:${Z ?? ""}`
568
578
  ) : null,
569
579
  /* @__PURE__ */ n(
570
- mt,
580
+ bt,
571
581
  {
572
582
  surface: "elevated",
573
583
  truncate: !l,
574
- headerActions: /* @__PURE__ */ d(rt, { children: [
584
+ headerActions: /* @__PURE__ */ d(pt, { children: [
575
585
  ee ? ee({ ...t, actions: e }) : null,
576
586
  N && s && !t.deleted && (e == null ? void 0 : e.edit) !== !1 ? /* @__PURE__ */ n(
577
587
  ge,
578
588
  {
579
- icon: /* @__PURE__ */ n(Nt, {}),
589
+ icon: /* @__PURE__ */ n(_t, {}),
580
590
  intent: "ghost",
581
591
  size: "sm",
582
592
  "aria-label": a("notesPanel.editNamed", {
@@ -589,13 +599,13 @@ const nn = ot(
589
599
  "aria-pressed": r === s,
590
600
  disabled: u,
591
601
  "data-notes-panel-edit": "",
592
- onClick: () => r === s ? D() : tt(t)
602
+ onClick: () => r === s ? D() : lt(t)
593
603
  }
594
604
  ) : null,
595
605
  h && s && !t.deleted ? /* @__PURE__ */ n(
596
606
  ge,
597
607
  {
598
- icon: /* @__PURE__ */ n(Vt, {}),
608
+ icon: /* @__PURE__ */ n(It, {}),
599
609
  intent: "ghost",
600
610
  size: "sm",
601
611
  "aria-label": a("notesPanel.deleteNamed", {
@@ -605,7 +615,7 @@ const nn = ot(
605
615
  tooltip: a("notesPanel.delete", {
606
616
  defaultValue: "Delete note"
607
617
  }),
608
- onClick: () => it(s)
618
+ onClick: () => dt(s)
609
619
  }
610
620
  ) : null
611
621
  ] }),
@@ -620,7 +630,7 @@ const nn = ot(
620
630
  );
621
631
  })
622
632
  }
623
- ) : C !== "ready" ? null : Ge ?? /* @__PURE__ */ n("p", { className: "ds:m-0 type-body-sm ds:text-[color:var(--muted-foreground)]", children: a("notesPanel.empty", { defaultValue: "No notes yet." }) })
633
+ ) : C !== "ready" ? null : Xe ?? /* @__PURE__ */ n("p", { className: "ds:m-0 type-body-sm ds:text-[color:var(--muted-foreground)]", children: a("notesPanel.empty", { defaultValue: "No notes yet." }) })
624
634
  ] }),
625
635
  h && $ ? /* @__PURE__ */ n(
626
636
  v,
@@ -651,7 +661,7 @@ const nn = ot(
651
661
  {
652
662
  intent: "destructive",
653
663
  size: "sm",
654
- onClick: st,
664
+ onClick: ct,
655
665
  children: a("notesPanel.deleteConfirmAction", {
656
666
  defaultValue: "Delete"
657
667
  })
@@ -667,7 +677,7 @@ const nn = ot(
667
677
  }
668
678
  );
669
679
  export {
670
- nn as N,
680
+ on as N,
671
681
  ve as g
672
682
  };
673
- //# sourceMappingURL=notes-panel-Dkk9QPPX.js.map
683
+ //# sourceMappingURL=notes-panel-CHbDDMx8.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notes-panel-CHbDDMx8.js","sources":["../../src/components/_shared/get-error-message.ts","../../src/components/notes-panel/notes-panel.agent.ts","../../src/components/notes-panel/notes-panel.tsx"],"sourcesContent":["/** Read host error messages without relying on the host's JavaScript realm. */\nexport function getErrorMessage(error: unknown, fallback: string): string {\n if (\n typeof error === 'object' &&\n error !== null &&\n 'message' in error &&\n typeof error.message === 'string' &&\n error.message.trim()\n ) {\n return error.message;\n }\n return fallback;\n}\n","/* -------------------------------------------------------------------- */\n/* Agent adapter — NotesPanel. */\n/* */\n/* The Notes tool: a composer over a note timeline. The agent reads the */\n/* timeline STRUCTURE (note ids + pinned / flagged / clinical flags — */\n/* never the note body or author, both PHI), composes and commits a new */\n/* note, and toggles a note's pinned / flagged state. `add_note` carries */\n/* the `phi` safety class: a note body is patient-identifiable clinical */\n/* content, so the host gates it behind the same confirm-before-act as a */\n/* destructive write and never auto-confirms. A clinical submission also */\n/* requires the host's `practice_add_clinical_note` permission (the */\n/* handle drops it when the gate is closed). Host-owned per-note */\n/* `noteActions` (edit, delete…) sit outside this handle — an agent */\n/* reaches them through the host's own adapters. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { NotesPanelHandle } from './notes-panel';\n\nexport const notesPanelAgent: AgentAdapter<NotesPanelHandle> = {\n id: 'notes-panel',\n // 'submit' backs add_note (compose + commit a note). pin / flag are toggles\n // with no dedicated capability in the closed vocabulary.\n capabilities: ['submit'],\n state: {\n notes: {\n type: 'Array<{ id?: string; pinned: boolean; flagged: boolean; clinical: boolean }>',\n descriptionKey: 'ui.agent.notesPanel.state.notes',\n description:\n 'Timeline note ids + pinned / flagged / clinical flags. Never the note body or author (both PHI).',\n read: (handle) => handle.getNotes(),\n },\n canAddClinical: {\n type: 'boolean',\n descriptionKey: 'ui.agent.notesPanel.state.canAddClinical',\n description:\n 'Whether the current user may write clinical notes (the practice_add_clinical_note permission gate).',\n read: (handle) => handle.canAddClinical(),\n },\n currentNoteId: {\n type: 'string | null',\n descriptionKey: 'ui.agent.notesPanel.state.currentNoteId',\n description:\n 'Id of the note the host has addressed — the one marked, scrolled to and focused. Null when none is. An id only, never note content.',\n read: (handle) => handle.getCurrentNoteId(),\n },\n },\n actions: {\n add_note: {\n // Writes a clinical/admin note body — patient-identifiable content. PHI.\n safety: 'phi',\n argsType: '{ content: string; clinical: boolean }',\n argsSchema: {\n type: 'object',\n properties: {\n content: {\n type: 'string',\n description:\n 'Note body. Rich HTML for the rich composer, else plain text.',\n },\n clinical: {\n type: 'boolean',\n description:\n 'Whether the note is clinical. Requires the clinical-note permission; the submission is dropped when the gate is closed.',\n },\n },\n required: ['content', 'clinical'],\n },\n openWorld: true,\n descriptionKey: 'ui.agent.notesPanel.actions.addNote',\n description:\n 'Compose and commit a new note. A clinical note requires the clinical-note permission (read canAddClinical first).',\n examples: [\n {\n args: { content: 'Patient reported improvement.', clinical: true },\n note: 'Add a clinical note.',\n },\n ],\n invoke: (handle, args: { content: string; clinical: boolean }) => {\n return handle.addNote(args);\n },\n },\n toggle_pin: {\n // Re-orders the timeline (pinned notes lead) — reversible view write.\n safety: 'write',\n argsType: '{ id: string }',\n argsSchema: {\n type: 'object',\n properties: { id: { type: 'string' } },\n required: ['id'],\n },\n idempotent: false,\n descriptionKey: 'ui.agent.notesPanel.actions.togglePin',\n description:\n 'Toggle the pinned state of the note with the given id. Refused for a deleted note or one whose actions.pin is false.',\n invoke: (handle, args: { id: string }) => {\n handle.togglePin(args.id);\n },\n },\n toggle_flag: {\n safety: 'write',\n argsType: '{ id: string }',\n argsSchema: {\n type: 'object',\n properties: { id: { type: 'string' } },\n required: ['id'],\n },\n idempotent: false,\n descriptionKey: 'ui.agent.notesPanel.actions.toggleFlag',\n description: 'Toggle the flagged state of the note with the given id.',\n invoke: (handle, args: { id: string }) => {\n handle.toggleFlag(args.id);\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'notes-panel',\n description: 'Marks the NotesPanel region.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description:\n 'Sourced from the id prop. Required to address a specific notes panel from the agent.',\n },\n },\n};\n","import {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { cva } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { getErrorMessage } from '../_shared/get-error-message';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { notesPanelAgent } from './notes-panel.agent';\nimport { ClinicalNoteCard } from '../clinical-note-card';\nimport type { ClinicalNoteCardProps } from '../clinical-note-card';\nimport { RichTextEditor } from '../rich-text-editor';\nimport type {\n RichTextEditorHandle,\n RichTextEditorProps,\n RichTextEditorToolbar,\n RedactorFactory,\n AiConsentGate,\n} from '../rich-text-editor';\nimport { TextArea } from '../text-area';\nimport { Alert } from '../alert';\nimport { Button, IconButton } from '../button';\nimport { Switch } from '../switch';\nimport { Tooltip } from '../tooltip';\nimport { Card } from '../card/card';\nimport { CONTENT_ENTER_CLASS, Skeleton } from '../skeleton/skeleton';\nimport { Dialog } from '../dialog';\nimport { NotebookPen, Pencil, Trash2 } from 'lucide-react';\nimport { PanelHeader } from '../panel-header';\nimport { REFLOW_ROW_CLASS, useListReflow } from '../../hooks/use-list-reflow';\nimport { useExitTransition } from '../../hooks/use-exit-transition';\nimport { useTheme } from '../../hooks/use-theme';\n\n/* ------------------------------------------------------------------ */\n/* NotesPanel — the Notes tool for the Control Room rail. */\n/* */\n/* A composer over an elevated ClinicalNoteCard timeline. Drops */\n/* into a ControlRoomRail tool `panel`, the patient profile, or the */\n/* care-plan editor — anywhere notes about the open entity belong. */\n/* The composer is the kit RichTextEditor by default (degrades to a */\n/* textarea where Redactor is absent), carries a permission-gated */\n/* \"clinical note\" toggle, and forwards the editor's AI affordances. */\n/* The note attaches to whatever entity the host is showing — the */\n/* host owns the attachment; the panel only emits content + clinical. */\n/* Pinned notes lead; pin / flag are inline per-note toggles. */\n/* ------------------------------------------------------------------ */\n\n/**\n * One note in the panel — the data subset of `ClinicalNoteCard`.\n *\n * `aria-label` names the card for assistive tech. Set it whenever a row is not\n * a clinical note: the card's fallback name is \"Clinical note\", so an entry\n * that is something else (a dated event, an import) is announced as one.\n */\nexport type NotesPanelNote = Pick<\n ClinicalNoteCardProps,\n | 'id'\n | 'dateIso'\n | 'createdAtIso'\n | 'author'\n | 'clinical'\n | 'attachedTo'\n | 'content'\n | 'contentFormat'\n | 'pinned'\n | 'flagged'\n | 'aria-label'\n | 'deleted'\n | 'operatorName'\n> & {\n /** What the host lets the reader do with this note. */\n actions?: NotesPanelNoteActions;\n};\n\n/** Per-note write permissions; an absent key means allowed. The panel hides\n * the pin toggle on `pin: false` and on a deleted note. */\nexport type NotesPanelNoteActions = {\n edit?: boolean;\n delete?: boolean;\n pin?: boolean;\n};\n\n/**\n * Curated agent handle for NotesPanel. Reads the note timeline's STRUCTURE\n * (ids + pinned / flagged / clinical flags — never the note body or author,\n * both PHI) and drives the composer + per-note toggles. See\n * `notes-panel.agent.ts`.\n */\nexport interface NotesPanelHandle {\n /** Timeline snapshot — ids + flags only, never note content (PHI). */\n getNotes: () => Array<{\n id?: string;\n pinned: boolean;\n flagged: boolean;\n clinical: boolean;\n }>;\n /** Whether the composer is mounted (onAddNote is wired). */\n canAddNote: () => boolean;\n /** Whether clinical notes may be written (the permission gate). */\n canAddClinical: () => boolean;\n /** Id of the note the host has addressed, or null when none is. */\n getCurrentNoteId: () => string | null;\n /** Commit a new note with explicit content (mirrors the composer's submit). */\n addNote: (submission: NotesPanelSubmission) => void | Promise<void>;\n /** Toggle a note's pinned state (mirrors onTogglePin, with its gate). */\n togglePin: (id: string) => void;\n /** Toggle a note's flagged state (mirrors onToggleFlag). */\n toggleFlag: (id: string) => void;\n}\n\n/** Payload handed to `onAddNote` when the composer commits. */\nexport interface NotesPanelSubmission {\n /** The note body — rich HTML (`composer='rich'`) or plain text. */\n content: string;\n /** Whether the \"clinical note\" toggle was set. */\n clinical: boolean;\n}\n\nexport interface NotesPanelProps extends Omit<\n HTMLAttributes<HTMLElement>,\n 'title' | 'children'\n> {\n /**\n * Stable instance id. Surfaced on the root as `data-component-id` so an\n * agent / MCP UI bridge can address this specific notes panel.\n */\n id?: string;\n /** Notes to render, newest-first by convention. Pinned notes lead. */\n notes: NotesPanelNote[];\n /**\n * Commit a new note. Omit to hide the composer (read-only timeline). Return\n * a promise to keep the draft until the host has saved it: the draft clears\n * when it resolves, and a rejection keeps it and shows the error's message.\n */\n onAddNote?: (submission: NotesPanelSubmission) => void | Promise<void>;\n /** The host's notes read. `'loading'` and `'error'` never show the empty\n * text; notes already held still render. Default `'ready'`. */\n status?: 'ready' | 'loading' | 'error';\n /** Retry a failed read. Renders a retry button in the error state. */\n onRetry?: () => void;\n /**\n * The note the reader ASKED for, addressed by id from somewhere else in the\n * record — a marker in a chart, a row in a grid, an agent. The panel marks\n * it, scrolls it to the middle of its own scroll region and moves focus to\n * it, and renders it unclamped so the thing that was asked for is readable\n * in full without a second click.\n *\n * Opening a panel is not the same as answering a question: a rail's\n * `setActiveTool` moves no focus and announces nothing, so a control whose\n * name promises \"in the notes panel\" produces no perceivable change for a\n * keyboard or screen-reader reader unless the panel lands them on the note.\n * That is what this prop is for; without it, a host has to reach into the\n * panel's DOM to do the same job.\n *\n * Marked on three channels, never colour alone (WCAG 1.4.1): an accent\n * wash that fades in and out over the card (steady where motion is off),\n * the focus outline on the row, and `aria-current` plus a visually-hidden\n * sentence naming the mark. Nothing is left on the row once the wash ends.\n *\n * Ids that match no note are ignored. To address the SAME note twice — the\n * reader pressing the same marker again after scrolling away — bump\n * `currentNoteKey` alongside it; this prop alone is a value, not a request.\n */\n currentNoteId?: string;\n /**\n * Bump on every address to re-scroll and re-focus the note in `currentNoteId`\n * and replay its wash, even when the id has not changed.\n *\n * Addressing is a request, not a value: a reader who presses the same marker\n * a second time (having scrolled away, or having moved focus off the note) is\n * asking to be taken back, and a control whose name promises the notes panel\n * must do something perceivable every time it is pressed. Without this the\n * second press is inert — the panel is already showing that note, so nothing\n * re-runs. Hosts increment a counter in the same handler that opens the tool.\n */\n currentNoteKey?: string | number;\n\n /* ----- Composer ----- */\n /**\n * `'rich'` (default) mounts the kit `RichTextEditor` (Redactor; degrades to a\n * textarea where Redactor is absent). `'plain'` keeps a simple `TextArea` for\n * lightweight surfaces / deterministic tests.\n */\n composer?: 'rich' | 'plain';\n /** Toolbar preset for the rich composer. Defaults to `'standard'`. */\n editorToolbar?: RichTextEditorToolbar;\n /** Inject the Redactor factory for the rich composer (else `window.$R`). */\n redactor?: RedactorFactory;\n /** Consumer image-upload endpoint for the rich composer. */\n imageUploadUrl?: string;\n\n /* ----- Clinical flag (permission-gated) ----- */\n /** Show the \"clinical note\" toggle in the composer. Default `true`. */\n showClinicalToggle?: boolean;\n /**\n * Permission gate — when `false` the clinical toggle is disabled and shows\n * `clinicalGatedReason` on hover/focus. Mirrors platform's\n * `practice_add_clinical_note` permission. Default `true`.\n */\n canAddClinicalNote?: boolean;\n /** Tooltip shown when the clinical toggle is gated off. */\n clinicalGatedReason?: string;\n /** Initial state of the clinical toggle. Default `false`. */\n defaultClinical?: boolean;\n\n /* ----- AI assistance (forwarded to RichTextEditor) ----- */\n onRequestAiDraft?: RichTextEditorProps['onRequestAiDraft'];\n aiDraftFormat?: RichTextEditorProps['aiDraftFormat'];\n aiPrivacyNotice?: RichTextEditorProps['aiPrivacyNotice'];\n onDictate?: RichTextEditorProps['onDictate'];\n onProofread?: RichTextEditorProps['onProofread'];\n onAutoFormat?: RichTextEditorProps['onAutoFormat'];\n /**\n * Patient AI-consent gate for Help-me-write + both mics, forwarded\n * straight to the rich composer. See `AiConsentGate`. Omit for today's\n * ungated behaviour. Ignored by the `'plain'` composer (it offers\n * neither affordance).\n */\n aiConsent?: AiConsentGate;\n /**\n * Template variables for the rich composer's \"Insert variable\" menu and\n * `[[TOKEN]]` chip rendering. Forwarded straight to `RichTextEditor`.\n * Ignored by the `'plain'` composer.\n */\n variables?: RichTextEditorProps['variables'];\n /** Decide whether a `[[TOKEN]]` is valid. See `RichTextEditor`. */\n validateVariable?: RichTextEditorProps['validateVariable'];\n /** The invalid `[[TOKEN]]`s in the draft, reported by the rich composer. */\n onVariableValidityChange?: RichTextEditorProps['onVariableValidityChange'];\n /**\n * Bring your own Help-me-write surface (e.g. practice templates) into the\n * composer, forwarded straight to `RichTextEditor`. See\n * `RichTextEditorProps['renderHelpMeWrite']`.\n */\n renderHelpMeWrite?: RichTextEditorProps['renderHelpMeWrite'];\n /** Practice templates in the composer's AI pill. See `RichTextEditor`. */\n aiTemplates?: RichTextEditorProps['aiTemplates'];\n /** After a pill action rewrote the draft (offer Undo). See `RichTextEditor`. */\n onAiApplied?: RichTextEditorProps['onAiApplied'];\n /** Upload an image yourself and resolve its URL. See `RichTextEditor`. */\n onUploadImage?: RichTextEditorProps['onUploadImage'];\n /** An AI call ran out of credits. See `RichTextEditor`. */\n onAiCreditsExhausted?: RichTextEditorProps['onAiCreditsExhausted'];\n /** Show the editor extensions affordance. See `RichTextEditor`. */\n showExtensions?: RichTextEditorProps['showExtensions'];\n extensions?: RichTextEditorProps['extensions'];\n extensionContext?: RichTextEditorProps['extensionContext'];\n onExtensionRun?: RichTextEditorProps['onExtensionRun'];\n /**\n * Shows the AI-credits/bundles hover card on every AI action trigger in\n * the composer. See `RichTextEditor`.\n */\n aiCreditsNotice?: RichTextEditorProps['aiCreditsNotice'];\n /**\n * Rendered just above the composer — e.g. the Help-me-write templates\n * pattern's `undoNotice`. Renders in both add and edit mode, whenever the\n * composer itself is mounted.\n */\n composerBefore?: ReactNode;\n /**\n * Rendered just after the composer — e.g. the Help-me-write templates\n * pattern's `manager` dialog. Renders in both add and edit mode, whenever\n * the composer itself is mounted.\n */\n composerAfter?: ReactNode;\n\n /* ----- Per-note actions ----- */\n /** Toggle a note's pinned state — renders an inline pin button per note. */\n onTogglePin?: (id: string) => void;\n /** Toggle a note's flagged state — renders an inline flag button per note. */\n onToggleFlag?: (id: string) => void;\n /**\n * Host-owned actions for each note (edit, delete, share…), rendered by\n * the note card beside its pin and flag,\n * aligned to the inline end. The host supplies labelled controls and owns\n * what they do — the panel stays a timeline and never edits a note itself.\n */\n noteActions?: (note: NotesPanelNote) => ReactNode;\n /**\n * Save an edit to an existing note. When provided, each note the reader may\n * edit gets a pencil; it loads the note into the SAME composer that writes\n * new notes, in place, so a rich note is edited as rich text and keeps its\n * formatting. Return a promise to hold the pending state; a rejection keeps\n * the draft. Hidden on `actions.edit: false` and on a deleted note.\n */\n onEditNote?: (\n id: string,\n submission: NotesPanelSubmission,\n ) => void | Promise<void>;\n /**\n * Let an edit change a note's clinical flag. Default `false`: the \"Clinical\n * note\" toggle is hidden while editing and the submission carries the\n * note's existing flag. Most hosts save a note's content only, and a live\n * toggle that changes nothing is a lie. Set `true` only when the host\n * persists `submission.clinical` on edit.\n */\n editClinical?: boolean;\n /**\n * Request the host to delete a note. When provided, the panel holds the\n * row on screen long enough to fade it out before calling this, so the\n * removal reads as a removal rather than a vanish. Omit to let the host\n * own the timing entirely (the reflow animation still closes the gap).\n */\n onDeleteNote?: (id: string) => void;\n /**\n * Show a confirmation dialog before calling `onDeleteNote`. When `true`\n * (the default when `onDeleteNote` is provided), the built-in delete\n * button opens an alert dialog first; the exit fade only starts after\n * the user confirms. Pass `false` to delete immediately on click.\n */\n confirmDelete?: boolean;\n\n /* ----- Labels / chrome ----- */\n /** Panel heading. Defaults to the localised \"Notes\". */\n title?: string;\n /** Composer placeholder. */\n composerPlaceholder?: string;\n /** Save-button label. */\n addNoteLabel?: string;\n /** Rendered when there are no notes. */\n emptyState?: ReactNode;\n /** Accessible name for the panel region (defaults to `title`). */\n 'aria-label'?: string;\n}\n\n/* Lifts the card's content above the wash layer, so the wash tints the card\n surface only: note text and badges keep their own colours and contrast. */\nconst NOTE_CONTENT_ABOVE_WASH =\n 'ds:isolate ds:[&_[data-component=card]>*]:relative ds:[&_[data-component=card]>*]:z-[1]';\n\n/* The timeline row. The addressed row takes the keyboard focus outline; its\n visual mark is the wash layer below, so no row carries a border stripe. */\nconst noteItemVariants = cva(\n 'ds:relative ds:flex ds:flex-col ds:rounded-[var(--radius-lg)]',\n {\n variants: {\n current: {\n true: 'ds:focus:outline-[length:var(--focus-ring-width)] ds:focus:outline-solid ds:focus:outline-[color:var(--ring)] ds:focus:outline-offset-[length:var(--focus-ring-offset)]',\n false: '',\n },\n washed: { true: NOTE_CONTENT_ABOVE_WASH, false: '' },\n },\n defaultVariants: { current: false, washed: false },\n },\n);\n\n/* The accent wash on a row's card surface. `addressed` arrives, holds and\n leaves no mark; `editing` is steady for as long as the edit lasts. With\n motion off (OS setting, accessible theme) `addressed` holds steady too. */\nconst noteWashVariants = cva(\n 'ds:pointer-events-none ds:absolute ds:inset-0 ds:rounded-[var(--radius-lg)] ds:bg-[color:var(--accent)]',\n {\n variants: {\n state: {\n addressed: [\n 'ds:opacity-0',\n 'ds:animate-[note-addressed_calc(var(--animation-duration)*9)_var(--ease-in-out)]',\n 'ds:motion-reduce:animate-none ds:motion-reduce:opacity-[var(--opacity-12)]',\n 'ds:[.theme-accessible_&]:animate-none ds:[.theme-accessible_&]:opacity-[var(--opacity-12)]',\n ].join(' '),\n editing: 'ds:opacity-[var(--opacity-12)]',\n },\n },\n },\n);\n\n/* A row on its way out fades in place; the reflow hook then slides the\n rows below up to close the gap. Declared at rest so the transition has\n a value to animate from the moment the leaving class lands. */\nconst noteLeavingClass = 'ds:opacity-0';\nconst noteElevationClass = [\n 'ds:transition-opacity ds:duration-[var(--animation-duration)]',\n 'ds:ease-[var(--ease-out)] ds:motion-reduce:transition-none',\n].join(' ');\n\n/* Body lines per placeholder note. Uneven, so three cards do not read as one\n repeated stamp. */\nconst NOTE_SKELETON_LINES = [3, 2, 3] as const;\n\n/** Strip tags / entities to test whether a rich draft holds real content. */\nfunction hasRichContent(html: string): boolean {\n if (!html) return false;\n if (/<img\\b/i.test(html)) return true;\n return (\n html\n .replace(/<[^>]*>/g, '')\n .replace(/&nbsp;/gi, ' ')\n .trim().length > 0\n );\n}\n\nexport const NotesPanel = forwardRef<HTMLElement, NotesPanelProps>(\n function NotesPanel(\n {\n id,\n notes,\n onAddNote,\n status = 'ready',\n onRetry,\n currentNoteId,\n currentNoteKey,\n composer = 'rich',\n editorToolbar = 'standard',\n redactor,\n imageUploadUrl,\n showClinicalToggle = true,\n canAddClinicalNote = true,\n clinicalGatedReason,\n defaultClinical = false,\n onRequestAiDraft,\n aiDraftFormat,\n aiPrivacyNotice,\n onDictate,\n onProofread,\n onAutoFormat,\n aiConsent,\n variables,\n validateVariable,\n onVariableValidityChange,\n renderHelpMeWrite,\n aiTemplates,\n onAiApplied,\n onUploadImage,\n onAiCreditsExhausted,\n showExtensions,\n aiCreditsNotice,\n extensions,\n extensionContext,\n onExtensionRun,\n composerBefore,\n composerAfter,\n onTogglePin,\n onToggleFlag,\n noteActions,\n onEditNote,\n editClinical = false,\n onDeleteNote,\n confirmDelete = true,\n title,\n composerPlaceholder,\n addNoteLabel,\n emptyState,\n className,\n 'aria-label': ariaLabel,\n ...rest\n },\n ref,\n ) {\n const { t, i18n } = useTranslation();\n const editorRef = useRef<RichTextEditorHandle>(null);\n const [draft, setDraft] = useState('');\n const [clinical, setClinical] = useState(defaultClinical);\n const [pending, setPending] = useState(false);\n const [addError, setAddError] = useState<string | null>(null);\n // The note loaded into the composer for editing, or null when composing.\n const [editingId, setEditingId] = useState<string | null>(null);\n /* Settle in only when this content REPLACES a skeleton. Content that was\n simply there from the start must not fade: it would read as invisible\n for one animation to any test or reader that looks at once. */\n const followedLoading = useRef(false);\n if (status === 'loading') followedLoading.current = true;\n const enterClass = followedLoading.current ? CONTENT_ENTER_CLASS : '';\n\n const heading = title ?? t('notesPanel.title', { defaultValue: 'Notes' });\n const headingId = useId();\n const placeholder =\n composerPlaceholder ??\n t('notesPanel.placeholder', { defaultValue: 'Add a note…' });\n const composerLabel =\n editingId !== null\n ? t('notesPanel.edit', { defaultValue: 'Edit note' })\n : t('notesPanel.composerLabel', { defaultValue: 'New note' });\n\n // Live content check: plain reads the draft directly; rich strips the draft\n // (debounced) for the disabled state but commits from the editor handle.\n const hasContent =\n composer === 'rich' ? hasRichContent(draft) : draft.trim().length > 0;\n\n const commit = useCallback(() => {\n const save = editingId !== null ? onEditNote : onAddNote;\n if (!save || pending) return;\n const rich = composer === 'rich';\n const content = rich\n ? (editorRef.current?.getHTML() ?? draft)\n : draft.trim();\n if (rich ? !hasRichContent(content) : !content) return;\n const reset = () => {\n if (rich) editorRef.current?.clear();\n setDraft('');\n setClinical(defaultClinical);\n setEditingId(null);\n };\n setAddError(null);\n let result: void | Promise<void>;\n try {\n result =\n editingId !== null && onEditNote\n ? onEditNote(editingId, { content, clinical })\n : onAddNote?.({ content, clinical });\n } catch (error: unknown) {\n setAddError(getErrorMessage(error, t('notesPanel.addFailed')));\n return;\n }\n if (!result || typeof result.then !== 'function') return reset();\n // A failed save keeps the draft, so nothing typed is lost.\n setPending(true);\n Promise.resolve(result)\n .then(reset, (error: unknown) =>\n setAddError(getErrorMessage(error, t('notesPanel.addFailed'))),\n )\n .finally(() => setPending(false));\n }, [\n composer,\n draft,\n clinical,\n defaultClinical,\n editingId,\n onAddNote,\n onEditNote,\n pending,\n t,\n ]);\n\n const clinicalToggleShown =\n showClinicalToggle && (editingId === null || editClinical);\n\n /* Every row carries the SAME action words, so each accessible name adds\n the note's own date: otherwise a screen reader hears a list of\n identical \"Edit note\" buttons. The tooltip keeps the short words. */\n const noteStamp = useCallback(\n (note: NotesPanelNote): string => {\n try {\n return new Intl.DateTimeFormat(i18n.language, {\n day: 'numeric',\n month: 'long',\n year: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n }).format(new Date(note.dateIso));\n } catch {\n return note.dateIso;\n }\n },\n [i18n.language],\n );\n\n /* ----- Edit in place: the composer takes the note, and gives it back ----- */\n const startEdit = useCallback(\n (note: NotesPanelNote) => {\n if (!note.id || pending) return;\n const content = note.content ?? '';\n setAddError(null);\n setEditingId(note.id);\n setClinical(note.clinical ?? false);\n setDraft(content);\n if (composer === 'rich') {\n editorRef.current?.clear();\n editorRef.current?.insertAtCursor(content, { asHtml: true });\n }\n editorRef.current?.focus();\n },\n [composer, pending],\n );\n const cancelEdit = useCallback(() => {\n if (composer === 'rich') editorRef.current?.clear();\n setDraft('');\n setClinical(defaultClinical);\n setAddError(null);\n setEditingId(null);\n }, [composer, defaultClinical]);\n // The note being edited went away (deleted, or another patient's notes\n // arrived): its draft must not be saved against whatever comes next.\n const editingStillThere =\n editingId === null ||\n notes.some((note) => note.id === editingId && !note.deleted);\n useEffect(() => {\n if (!editingStillThere) cancelEdit();\n }, [editingStillThere, cancelEdit]);\n\n // Pinned notes lead; order within each group is preserved.\n const ordered = [...notes].sort(\n (a, b) => Number(b.pinned ?? false) - Number(a.pinned ?? false),\n );\n\n /* The accessible theme zeroes `--animation-duration`, so its CSS plays\n nothing — the JS must agree, or a row would sit still for the delay\n and then vanish anyway. `undefined` leaves the media query in charge. */\n const { resolvedTheme } = useTheme();\n const reduceMotion = resolvedTheme.endsWith('-accessible') || undefined;\n\n /* Closing the gap a removed row leaves: the rows below slide up rather\n than jumping, so the eye keeps its place in the list. Fires on add,\n delete, and re-order (pinning) — any change to the visible id\n sequence. */\n const { containerRef: reflowRef } = useListReflow<HTMLUListElement>({\n key: ordered.map((n) => n.id).join(),\n reduceMotion,\n });\n\n /* A note leaving the list fades out before the host drops it, so the\n removal reads as a removal rather than a vanish. The reflow hook\n then slides the rows below up to close the gap. */\n const deleteExit = useExitTransition({ reduceMotion });\n const [pendingDelete, setPendingDelete] = useState<string | null>(null);\n const handleDeleteNote = useCallback(\n (noteId: string) => {\n if (!onDeleteNote) return;\n if (confirmDelete) {\n setPendingDelete(noteId);\n } else {\n deleteExit.leave(noteId, () => onDeleteNote(noteId));\n }\n },\n [confirmDelete, deleteExit, onDeleteNote],\n );\n const confirmDeleteNote = useCallback(() => {\n if (!pendingDelete || !onDeleteNote) return;\n const noteId = pendingDelete;\n setPendingDelete(null);\n deleteExit.leave(noteId, () => onDeleteNote(noteId));\n }, [pendingDelete, onDeleteNote, deleteExit]);\n\n /* ----- The addressed note (see `currentNoteId`) ----- */\n const currentItemRef = useRef<HTMLLIElement>(null);\n useEffect(() => {\n if (!currentNoteId) return;\n // `center`, not `nearest`: nearest parks the note flush against the edge\n // of the scroll region, which is the least readable place to land.\n currentItemRef.current?.scrollIntoView({ block: 'center' });\n currentItemRef.current?.focus();\n // `currentNoteKey` is in the deps so a REPEAT address of the same note\n // re-runs — see the prop doc. Addressing is a request, not a value.\n }, [currentNoteId, currentNoteKey]);\n\n /* ----- Agent handle (structural reads + composer / toggles) ----- */\n const notesRef = useRef(notes);\n notesRef.current = notes;\n const onAddNoteRef = useRef(onAddNote);\n onAddNoteRef.current = onAddNote;\n const onTogglePinRef = useRef(onTogglePin);\n onTogglePinRef.current = onTogglePin;\n const onToggleFlagRef = useRef(onToggleFlag);\n onToggleFlagRef.current = onToggleFlag;\n const canAddClinicalRef = useRef(canAddClinicalNote);\n canAddClinicalRef.current = canAddClinicalNote;\n const currentNoteIdRef = useRef(currentNoteId);\n currentNoteIdRef.current = currentNoteId;\n\n const rootRef = useRef<HTMLElement>(null);\n useImperativeHandle(ref, () => rootRef.current as HTMLElement, []);\n\n const handle = useMemo<NotesPanelHandle>(\n () => ({\n // Ids + flags only — never the note body or author (both PHI).\n getNotes: () =>\n notesRef.current.map((n) => ({\n id: n.id,\n pinned: !!n.pinned,\n flagged: !!n.flagged,\n clinical: !!n.clinical,\n })),\n canAddNote: () => !!onAddNoteRef.current,\n canAddClinical: () => canAddClinicalRef.current,\n getCurrentNoteId: () => currentNoteIdRef.current ?? null,\n addNote: (submission) => {\n // A clinical submission requires the permission gate to be open.\n if (submission.clinical && !canAddClinicalRef.current) return;\n return onAddNoteRef.current?.(submission);\n },\n togglePin: (noteId) => {\n const note = notesRef.current.find((n) => n.id === noteId);\n if (note && (note.deleted || note.actions?.pin === false)) return;\n onTogglePinRef.current?.(noteId);\n },\n toggleFlag: (noteId) => onToggleFlagRef.current?.(noteId),\n }),\n [],\n );\n useAgentRegistration(notesPanelAgent, handle, id);\n\n return (\n <section\n ref={rootRef}\n data-component=\"notes-panel\"\n data-component-id={id}\n aria-labelledby={ariaLabel ? undefined : headingId}\n aria-label={ariaLabel}\n className={['ds:flex ds:flex-col', className].filter(Boolean).join(' ')}\n {...rest}\n >\n {/* Shared rail header — pins to the top of the panel's scroll region\n while the composer + note timeline scroll beneath it. The rail\n injects the favourite / close actions via PanelHeaderActionsProvider. */}\n <PanelHeader\n title={heading}\n icon={<NotebookPen aria-hidden=\"true\" />}\n headingId={ariaLabel ? undefined : headingId}\n sticky\n divider\n />\n\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:p-[var(--spacing-md)]\">\n {onAddNote || editingId !== null ? (\n <div\n data-notes-panel-composer={editingId !== null ? 'edit' : 'add'}\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]\"\n >\n {composerBefore}\n {composer === 'rich' ? (\n <RichTextEditor\n ref={editorRef}\n ariaLabel={composerLabel}\n placeholder={placeholder}\n toolbar={editorToolbar}\n minHeight=\"fill\"\n redactor={redactor}\n imageUploadUrl={imageUploadUrl}\n readOnly={pending}\n onChange={({ html }) => setDraft(html)}\n onRequestAiDraft={onRequestAiDraft}\n aiDraftFormat={aiDraftFormat}\n aiPrivacyNotice={aiPrivacyNotice}\n onDictate={onDictate}\n onProofread={onProofread}\n onAutoFormat={onAutoFormat}\n aiConsent={aiConsent}\n variables={variables}\n validateVariable={validateVariable}\n onVariableValidityChange={onVariableValidityChange}\n renderHelpMeWrite={renderHelpMeWrite}\n aiTemplates={aiTemplates}\n onAiApplied={onAiApplied}\n onUploadImage={onUploadImage}\n onAiCreditsExhausted={onAiCreditsExhausted}\n showExtensions={showExtensions}\n aiCreditsNotice={aiCreditsNotice}\n extensions={extensions}\n extensionContext={extensionContext}\n onExtensionRun={onExtensionRun}\n // The panel's own title is an h2 (PanelHeader below); the\n // gate's banner nests one level under it so the h2 → h3\n // sequence stays valid (axe heading-order) instead of\n // jumping straight to the banner's own h5 default.\n aiConsentHeadingLevel={3}\n />\n ) : (\n <TextArea\n value={draft}\n readOnly={pending}\n onChange={(event) => setDraft(event.target.value)}\n placeholder={placeholder}\n autoResize\n minRows={2}\n maxRows={6}\n aria-label={composerLabel}\n />\n )}\n <div\n className={[\n 'ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]',\n clinicalToggleShown ? 'ds:justify-between' : 'ds:justify-end',\n ].join(' ')}\n >\n {clinicalToggleShown\n ? (() => {\n const clinicalDisabled = pending || !canAddClinicalNote;\n const clinicalReason = canAddClinicalNote\n ? undefined\n : (clinicalGatedReason ??\n t('notesPanel.clinicalGated', {\n defaultValue:\n 'You do not have permission to write clinical notes.',\n }));\n const clinicalSwitch = (\n <Switch\n size=\"sm\"\n label={t('notesPanel.clinicalToggle', {\n defaultValue: 'Clinical note',\n })}\n checked={clinical}\n onCheckedChange={setClinical}\n disabled={clinicalDisabled}\n />\n );\n // A disabled Radix Switch renders a native `disabled`\n // button, which drops out of the tab order — Tooltip\n // alone would leave the reason unreachable by keyboard.\n // The focusable wrapping span is the kit's documented\n // workaround (see tooltip.mdx / tooltip.stories.tsx).\n return clinicalDisabled && clinicalReason ? (\n <Tooltip label={clinicalReason}>\n {/* eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex -- focusable wrapper so Tooltip works around the disabled Switch (which can't receive focus or hover events) */}\n <span tabIndex={0}>{clinicalSwitch}</span>\n </Tooltip>\n ) : (\n clinicalSwitch\n );\n })()\n : null}\n <span className=\"ds:flex ds:items-center ds:gap-[var(--spacing-xs)]\">\n {editingId !== null ? (\n <Button\n type=\"button\"\n size=\"sm\"\n intent=\"ghost\"\n onClick={cancelEdit}\n disabled={pending}\n >\n {t('notesPanel.cancelEdit', { defaultValue: 'Cancel' })}\n </Button>\n ) : null}\n <Button\n type=\"button\"\n size=\"sm\"\n onClick={commit}\n disabled={!hasContent}\n loading={pending}\n >\n {editingId !== null\n ? t('notesPanel.saveEdit', { defaultValue: 'Save note' })\n : (addNoteLabel ??\n t('notesPanel.add', { defaultValue: 'Add note' }))}\n </Button>\n </span>\n </div>\n {addError ? (\n <Alert variant=\"error\">\n <Alert.Description>{addError}</Alert.Description>\n </Alert>\n ) : null}\n {composerAfter}\n </div>\n ) : null}\n\n {status === 'loading' && ordered.length === 0 ? (\n /* Note-shaped placeholders, not a spinner: the reader sees where\n the notes will land and how many to expect. The status text is\n for assistive tech only; sighted readers get the motion. */\n <div\n data-notes-panel-loading=\"\"\n aria-busy=\"true\"\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]\"\n >\n <span role=\"status\" className=\"ds:sr-only\">\n {t('notesPanel.loading')}\n </span>\n {NOTE_SKELETON_LINES.map((lines, index) => (\n <Card key={index} variant=\"elevated\" aria-hidden=\"true\">\n <Card.Body>\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]\">\n <div className=\"ds:flex ds:items-center ds:gap-[var(--spacing-sm)]\">\n <Skeleton\n variant=\"circular\"\n size=\"sm\"\n stagger={index * 2}\n />\n <div className=\"ds:flex ds:flex-1 ds:flex-col ds:gap-[var(--spacing-xs)]\">\n <Skeleton\n variant=\"text\"\n size=\"sm\"\n stagger={index * 2}\n width=\"40%\"\n />\n <Skeleton\n variant=\"text\"\n size=\"sm\"\n stagger={index * 2}\n width=\"25%\"\n />\n </div>\n </div>\n <Skeleton\n variant=\"text\"\n size=\"sm\"\n lines={lines}\n stagger={index * 2 + 1}\n />\n </div>\n </Card.Body>\n </Card>\n ))}\n </div>\n ) : status === 'error' ? (\n <Alert variant=\"error\">\n <Alert.Description>{t('notesPanel.loadError')}</Alert.Description>\n {onRetry ? (\n <Alert.Action>\n <Button intent=\"secondary\" size=\"sm\" onClick={onRetry}>\n {t('notesPanel.retry')}\n </Button>\n </Alert.Action>\n ) : null}\n </Alert>\n ) : null}\n\n {/* A refresh keeps the notes it has: real notes never give way to\n placeholders. The list is marked busy and says so to a reader. */}\n {status === 'loading' && ordered.length > 0 ? (\n <span role=\"status\" className=\"ds:sr-only\">\n {t('notesPanel.loading')}\n </span>\n ) : null}\n {ordered.length > 0 ? (\n <ul\n ref={reflowRef}\n aria-busy={status === 'loading' || undefined}\n className={`ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-0 ${enterClass}`.trim()}\n >\n {ordered.map(({ actions, ...note }, index) => {\n const isCurrent =\n currentNoteId != null && note.id === currentNoteId;\n const noteId = note.id as string | undefined;\n const isEditing = noteId != null && editingId === noteId;\n const leaving = noteId != null && deleteExit.isLeaving(noteId);\n return (\n <li\n key={note.id ?? index}\n ref={isCurrent ? currentItemRef : undefined}\n // Focus lands on the row, not inside the card, so the\n // sentence below and `aria-current` are read out before the\n // note — and the rail's own Escape still bubbles.\n tabIndex={isCurrent ? -1 : undefined}\n aria-current={isCurrent ? 'true' : undefined}\n data-reflow-id={noteId}\n data-leaving={leaving ? '' : undefined}\n data-editing={isEditing ? '' : undefined}\n className={[\n noteItemVariants({\n current: isCurrent,\n washed: isCurrent || isEditing,\n }),\n noteElevationClass,\n REFLOW_ROW_CLASS,\n leaving ? noteLeavingClass : '',\n ]\n .filter(Boolean)\n .join(' ')}\n >\n {isCurrent ? (\n <span className=\"ds:sr-only\">\n {t('notesPanel.current', {\n defaultValue: 'Current note',\n })}\n </span>\n ) : null}\n {/* Elevated card per note; the list gap (not a separator)\n spaces them. Bodies clamp to five lines with read-more —\n except the addressed one, which is what the reader came\n for and opens in full. */}\n {/* Keyed on the address, so a repeat address of the same\n note remounts the layer and the wash plays again. Editing\n wins: a steady state must not pulse. */}\n {isEditing ? (\n <span\n aria-hidden=\"true\"\n data-notes-panel-wash=\"editing\"\n className={noteWashVariants({ state: 'editing' })}\n />\n ) : isCurrent ? (\n <span\n key={`${currentNoteId}:${currentNoteKey ?? ''}`}\n aria-hidden=\"true\"\n data-notes-panel-wash=\"addressed\"\n className={noteWashVariants({ state: 'addressed' })}\n />\n ) : null}\n <ClinicalNoteCard\n surface=\"elevated\"\n truncate={!isCurrent}\n headerActions={\n <>\n {noteActions\n ? noteActions({ ...note, actions })\n : null}\n {onEditNote &&\n noteId &&\n !note.deleted &&\n actions?.edit !== false ? (\n <IconButton\n icon={<Pencil />}\n intent=\"ghost\"\n size=\"sm\"\n aria-label={t('notesPanel.editNamed', {\n date: noteStamp(note),\n defaultValue: 'Edit note · {{date}}',\n })}\n tooltip={t('notesPanel.edit', {\n defaultValue: 'Edit note',\n })}\n aria-pressed={editingId === noteId}\n disabled={pending}\n data-notes-panel-edit=\"\"\n onClick={() =>\n editingId === noteId\n ? cancelEdit()\n : startEdit(note)\n }\n />\n ) : null}\n {onDeleteNote && noteId && !note.deleted ? (\n <IconButton\n icon={<Trash2 />}\n intent=\"ghost\"\n size=\"sm\"\n aria-label={t('notesPanel.deleteNamed', {\n date: noteStamp(note),\n defaultValue: 'Delete note · {{date}}',\n })}\n tooltip={t('notesPanel.delete', {\n defaultValue: 'Delete note',\n })}\n onClick={() => handleDeleteNote(noteId)}\n />\n ) : null}\n </>\n }\n {...note}\n onTogglePin={\n onTogglePin &&\n note.id &&\n actions?.pin !== false &&\n !note.deleted\n ? () => onTogglePin(note.id as string)\n : undefined\n }\n onToggleFlag={\n onToggleFlag && note.id\n ? () => onToggleFlag(note.id as string)\n : undefined\n }\n />\n </li>\n );\n })}\n </ul>\n ) : status !== 'ready' ? null : (\n (emptyState ?? (\n <p className=\"ds:m-0 type-body-sm ds:text-[color:var(--muted-foreground)]\">\n {t('notesPanel.empty', { defaultValue: 'No notes yet.' })}\n </p>\n ))\n )}\n </div>\n\n {onDeleteNote && confirmDelete ? (\n <Dialog\n open={pendingDelete !== null}\n onOpenChange={(next) => !next && setPendingDelete(null)}\n >\n <Dialog.Content variant=\"alert\" size=\"sm\">\n <Dialog.Header>\n <Dialog.Title>\n {t('notesPanel.deleteConfirmTitle', {\n defaultValue: 'Delete this note?',\n })}\n </Dialog.Title>\n </Dialog.Header>\n <Dialog.Body>\n <Dialog.Description>\n {t('notesPanel.deleteConfirmBody', {\n defaultValue: 'The note will be removed from the record.',\n })}\n </Dialog.Description>\n </Dialog.Body>\n <Dialog.Footer>\n <Dialog.Close asChild>\n <Button\n intent=\"secondary\"\n size=\"sm\"\n onClick={() => setPendingDelete(null)}\n >\n {t('notesPanel.deleteConfirmCancel', {\n defaultValue: 'Cancel',\n })}\n </Button>\n </Dialog.Close>\n <Button\n intent=\"destructive\"\n size=\"sm\"\n onClick={confirmDeleteNote}\n >\n {t('notesPanel.deleteConfirmAction', {\n defaultValue: 'Delete',\n })}\n </Button>\n </Dialog.Footer>\n </Dialog.Content>\n </Dialog>\n ) : null}\n </section>\n );\n },\n);\n"],"names":["getErrorMessage","error","fallback","notesPanelAgent","handle","args","NOTE_CONTENT_ABOVE_WASH","noteItemVariants","cva","noteWashVariants","noteLeavingClass","noteElevationClass","NOTE_SKELETON_LINES","hasRichContent","html","NotesPanel","forwardRef","id","notes","onAddNote","status","onRetry","currentNoteId","currentNoteKey","composer","editorToolbar","redactor","imageUploadUrl","showClinicalToggle","canAddClinicalNote","clinicalGatedReason","defaultClinical","onRequestAiDraft","aiDraftFormat","aiPrivacyNotice","onDictate","onProofread","onAutoFormat","aiConsent","variables","validateVariable","onVariableValidityChange","renderHelpMeWrite","aiTemplates","onAiApplied","onUploadImage","onAiCreditsExhausted","showExtensions","aiCreditsNotice","extensions","extensionContext","onExtensionRun","composerBefore","composerAfter","onTogglePin","onToggleFlag","noteActions","onEditNote","editClinical","onDeleteNote","confirmDelete","title","composerPlaceholder","addNoteLabel","emptyState","className","ariaLabel","rest","ref","t","i18n","useTranslation","editorRef","useRef","draft","setDraft","useState","clinical","setClinical","pending","setPending","addError","setAddError","editingId","setEditingId","followedLoading","enterClass","CONTENT_ENTER_CLASS","heading","headingId","useId","placeholder","composerLabel","hasContent","commit","useCallback","rich","content","_a","reset","result","clinicalToggleShown","noteStamp","note","startEdit","_b","_c","cancelEdit","editingStillThere","useEffect","ordered","a","b","resolvedTheme","useTheme","reduceMotion","reflowRef","useListReflow","n","deleteExit","useExitTransition","pendingDelete","setPendingDelete","handleDeleteNote","noteId","confirmDeleteNote","currentItemRef","notesRef","onAddNoteRef","onTogglePinRef","onToggleFlagRef","canAddClinicalRef","currentNoteIdRef","rootRef","useImperativeHandle","useMemo","submission","useAgentRegistration","jsxs","jsx","PanelHeader","NotebookPen","RichTextEditor","TextArea","event","clinicalDisabled","clinicalReason","clinicalSwitch","Switch","Tooltip","Button","Alert","lines","index","Card","Skeleton","actions","isCurrent","isEditing","leaving","REFLOW_ROW_CLASS","ClinicalNoteCard","Fragment","IconButton","Pencil","Trash2","Dialog","next"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AACO,SAASA,GAAgBC,GAAgBC,GAA0B;AACxE,SACE,OAAOD,KAAU,YACjBA,MAAU,QACV,aAAaA,KACb,OAAOA,EAAM,WAAY,YACzBA,EAAM,QAAQ,SAEPA,EAAM,UAERC;AACT;ACOO,MAAMC,KAAkD;AAAA,EAC7D,IAAI;AAAA;AAAA;AAAA,EAGJ,cAAc,CAAC,QAAQ;AA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AA,oBAAA;AAAA,sBACC,QAAO;AAAA,sBACP,MAAK;AAAA,sBACL,SAASzB;AAAA,sBAER,YAAE,kCAAkC;AAAA,wBACnC,cAAc;AAAA,sBAAA,CACf;AAAA,oBAAA;AAAA,kBAAA;AAAA,gBACH,EAAA,CACF;AAAA,cAAA,EAAA,CACF;AAAA,YAAA;AAAA,UAAA,IAEA;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;"}
@@ -8,7 +8,7 @@ import { C as ie, b as te, a as se } from "./collapsible-CTjxzGuF.js";
8
8
  import { D as ae } from "./description-list-BsJ_6CQE.js";
9
9
  import { P as de } from "./panel-header-D_mTdhUp.js";
10
10
  import { u as re } from "./registry-DvAUVLHh.js";
11
- import { u as ne, F as le, r as oe, P as ce } from "./patient-field-row-BRSOKvme.js";
11
+ import { u as ne, F as le, r as oe, P as ce } from "./patient-field-row-CO0WR7yA.js";
12
12
  import { C as pe } from "./clipboard-list-rSzfIYZB.js";
13
13
  const me = {
14
14
  id: "patient-details",
@@ -368,4 +368,4 @@ export {
368
368
  ue as P,
369
369
  me as p
370
370
  };
371
- //# sourceMappingURL=patient-details-C8ImUrVg.js.map
371
+ //# sourceMappingURL=patient-details-DUj1htsH.js.map