@alfadocs/ui-kit-debug 1.36.1 → 1.37.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 (230) hide show
  1. package/dist/_chunks/appointment-peek-5S4O1VQP.js +115 -0
  2. package/dist/_chunks/appointment-peek-5S4O1VQP.js.map +1 -0
  3. package/dist/_chunks/appointment-peek.agent-C539tNFM.js +17 -0
  4. package/dist/_chunks/appointment-peek.agent-C539tNFM.js.map +1 -0
  5. package/dist/_chunks/building-2-D33bLCWL.js +24 -0
  6. package/dist/_chunks/building-2-D33bLCWL.js.map +1 -0
  7. package/dist/_chunks/calendar-workspace-BqKBj26r.js +9715 -0
  8. package/dist/_chunks/calendar-workspace-BqKBj26r.js.map +1 -0
  9. package/dist/_chunks/{control-room-rail-Ds45_g4f.js → control-room-rail-DQoHdE1U.js} +2 -2
  10. package/dist/_chunks/{control-room-rail-Ds45_g4f.js.map → control-room-rail-DQoHdE1U.js.map} +1 -1
  11. package/dist/_chunks/editable-description-BOfAeY3T.js +112 -0
  12. package/dist/_chunks/editable-description-BOfAeY3T.js.map +1 -0
  13. package/dist/_chunks/editable-description.agent-Bm_LBV2j.js +21 -0
  14. package/dist/_chunks/editable-description.agent-Bm_LBV2j.js.map +1 -0
  15. package/dist/_chunks/{money.agent-Dw55UxUA.js → money-BY-HmKhZ.js} +33 -47
  16. package/dist/_chunks/money-BY-HmKhZ.js.map +1 -0
  17. package/dist/_chunks/money.agent-BjJ6gOkx.js +17 -0
  18. package/dist/_chunks/money.agent-BjJ6gOkx.js.map +1 -0
  19. package/dist/_chunks/notes-panel-4y5JioWN.js +556 -0
  20. package/dist/_chunks/notes-panel-4y5JioWN.js.map +1 -0
  21. package/dist/_chunks/panel-subview-BNXN8OEL.js +160 -0
  22. package/dist/_chunks/panel-subview-BNXN8OEL.js.map +1 -0
  23. package/dist/_chunks/panel-subview.agent-BIBvE-IW.js +17 -0
  24. package/dist/_chunks/panel-subview.agent-BIBvE-IW.js.map +1 -0
  25. package/dist/_chunks/{patient-details-f7SSXkTJ.js → patient-details-2cIaL-Zb.js} +2 -2
  26. package/dist/_chunks/{patient-details-f7SSXkTJ.js.map → patient-details-2cIaL-Zb.js.map} +1 -1
  27. package/dist/_chunks/{patient-field-row-BQZoP4m2.js → patient-field-row-IHb2VFc2.js} +193 -172
  28. package/dist/_chunks/patient-field-row-IHb2VFc2.js.map +1 -0
  29. package/dist/_chunks/{patient-summary-card-Bz7KdUin.js → patient-summary-card-BzmJH9a-.js} +2 -2
  30. package/dist/_chunks/{patient-summary-card-Bz7KdUin.js.map → patient-summary-card-BzmJH9a-.js.map} +1 -1
  31. package/dist/_chunks/{section-card.agent-W18CHEgX.js → section-card-XR2bW1Ie.js} +20 -34
  32. package/dist/_chunks/{section-card.agent-W18CHEgX.js.map → section-card-XR2bW1Ie.js.map} +1 -1
  33. package/dist/_chunks/section-card.agent-Bz1BhM_j.js +17 -0
  34. package/dist/_chunks/section-card.agent-Bz1BhM_j.js.map +1 -0
  35. package/dist/_chunks/smartphone-DaPcFw-X.js +32 -0
  36. package/dist/_chunks/smartphone-DaPcFw-X.js.map +1 -0
  37. package/dist/_chunks/{task-card-BalrLkSz.js → task-card-qTKD1fIT.js} +39 -57
  38. package/dist/_chunks/task-card-qTKD1fIT.js.map +1 -0
  39. package/dist/_chunks/{task-tray-wl9eti6J.js → task-tray-CQ8UAR2j.js} +2 -2
  40. package/dist/_chunks/{task-tray-wl9eti6J.js.map → task-tray-CQ8UAR2j.js.map} +1 -1
  41. package/dist/_chunks/{tasks-panel-BDNB7hsZ.js → tasks-panel-CBGMtQ_f.js} +2 -2
  42. package/dist/_chunks/{tasks-panel-BDNB7hsZ.js.map → tasks-panel-CBGMtQ_f.js.map} +1 -1
  43. package/dist/_chunks/{tool-rail-Bq5eiFMG.js → tool-rail-BP8sjxCw.js} +310 -231
  44. package/dist/_chunks/tool-rail-BP8sjxCw.js.map +1 -0
  45. package/dist/_chunks/treatment-receipt-D4kOLXOk.js +94 -0
  46. package/dist/_chunks/treatment-receipt-D4kOLXOk.js.map +1 -0
  47. package/dist/_chunks/treatment-receipt.agent-bpFm2RPH.js +21 -0
  48. package/dist/_chunks/treatment-receipt.agent-bpFm2RPH.js.map +1 -0
  49. package/dist/_chunks/use-presence-transition-cDwWUXV-.js +58 -0
  50. package/dist/_chunks/use-presence-transition-cDwWUXV-.js.map +1 -0
  51. package/dist/_chunks/{workflow-map-D-LEni11.js → workflow-map-CXdsxvUj.js} +140 -156
  52. package/dist/_chunks/workflow-map-CXdsxvUj.js.map +1 -0
  53. package/dist/agent-catalog.json +65 -1
  54. package/dist/components/appointment-peek/appointment-peek.agent.d.ts +3 -0
  55. package/dist/components/appointment-peek/appointment-peek.agent.d.ts.map +1 -0
  56. package/dist/components/appointment-peek/appointment-peek.d.ts +45 -0
  57. package/dist/components/appointment-peek/appointment-peek.d.ts.map +1 -0
  58. package/dist/components/appointment-peek/index.d.ts +4 -0
  59. package/dist/components/appointment-peek/index.d.ts.map +1 -0
  60. package/dist/components/appointment-peek/index.js +7 -0
  61. package/dist/components/appointment-peek/index.js.map +1 -0
  62. package/dist/components/control-room-rail/index.js +1 -1
  63. package/dist/components/editable-description/editable-description.agent.d.ts +3 -0
  64. package/dist/components/editable-description/editable-description.agent.d.ts.map +1 -0
  65. package/dist/components/editable-description/editable-description.d.ts +20 -0
  66. package/dist/components/editable-description/editable-description.d.ts.map +1 -0
  67. package/dist/components/editable-description/index.d.ts +4 -0
  68. package/dist/components/editable-description/index.d.ts.map +1 -0
  69. package/dist/components/editable-description/index.js +7 -0
  70. package/dist/components/editable-description/index.js.map +1 -0
  71. package/dist/components/index.d.ts +4 -0
  72. package/dist/components/index.d.ts.map +1 -1
  73. package/dist/components/money/index.js +2 -1
  74. package/dist/components/money/index.js.map +1 -1
  75. package/dist/components/notes-panel/index.js +1 -1
  76. package/dist/components/notes-panel/notes-panel.d.ts +16 -0
  77. package/dist/components/notes-panel/notes-panel.d.ts.map +1 -1
  78. package/dist/components/panel-subview/index.d.ts +4 -0
  79. package/dist/components/panel-subview/index.d.ts.map +1 -0
  80. package/dist/components/panel-subview/index.js +7 -0
  81. package/dist/components/panel-subview/index.js.map +1 -0
  82. package/dist/components/panel-subview/panel-subview.agent.d.ts +3 -0
  83. package/dist/components/panel-subview/panel-subview.agent.d.ts.map +1 -0
  84. package/dist/components/panel-subview/panel-subview.d.ts +32 -0
  85. package/dist/components/panel-subview/panel-subview.d.ts.map +1 -0
  86. package/dist/components/patient-details/index.js +1 -1
  87. package/dist/components/patient-summary-card/index.js +1 -1
  88. package/dist/components/section-card/index.js +4 -3
  89. package/dist/components/section-card/index.js.map +1 -1
  90. package/dist/components/task-card/index.js +1 -1
  91. package/dist/components/task-tray/index.js +1 -1
  92. package/dist/components/tasks-panel/index.js +1 -1
  93. package/dist/components/tool-rail/index.js +1 -1
  94. package/dist/components/tool-rail/tool-rail.d.ts.map +1 -1
  95. package/dist/components/treatment-receipt/index.d.ts +4 -0
  96. package/dist/components/treatment-receipt/index.d.ts.map +1 -0
  97. package/dist/components/treatment-receipt/index.js +7 -0
  98. package/dist/components/treatment-receipt/index.js.map +1 -0
  99. package/dist/components/treatment-receipt/treatment-receipt.agent.d.ts +3 -0
  100. package/dist/components/treatment-receipt/treatment-receipt.agent.d.ts.map +1 -0
  101. package/dist/components/treatment-receipt/treatment-receipt.d.ts +30 -0
  102. package/dist/components/treatment-receipt/treatment-receipt.d.ts.map +1 -0
  103. package/dist/components/workflow/index.js +1 -1
  104. package/dist/hooks/index.d.ts +1 -0
  105. package/dist/hooks/index.d.ts.map +1 -1
  106. package/dist/hooks/index.js +9 -7
  107. package/dist/hooks/index.js.map +1 -1
  108. package/dist/hooks/use-presence-transition.d.ts +40 -0
  109. package/dist/hooks/use-presence-transition.d.ts.map +1 -0
  110. package/dist/host-compat.css +7 -1
  111. package/dist/i18n/locales/ar.d.ts +29 -5
  112. package/dist/i18n/locales/ar.d.ts.map +1 -1
  113. package/dist/i18n/locales/ar.js +29 -5
  114. package/dist/i18n/locales/ar.js.map +1 -1
  115. package/dist/i18n/locales/de.d.ts +29 -5
  116. package/dist/i18n/locales/de.d.ts.map +1 -1
  117. package/dist/i18n/locales/de.js +29 -5
  118. package/dist/i18n/locales/de.js.map +1 -1
  119. package/dist/i18n/locales/el.d.ts +29 -5
  120. package/dist/i18n/locales/el.d.ts.map +1 -1
  121. package/dist/i18n/locales/el.js +29 -5
  122. package/dist/i18n/locales/el.js.map +1 -1
  123. package/dist/i18n/locales/en.d.ts +29 -5
  124. package/dist/i18n/locales/en.d.ts.map +1 -1
  125. package/dist/i18n/locales/en.js +29 -5
  126. package/dist/i18n/locales/en.js.map +1 -1
  127. package/dist/i18n/locales/es.d.ts +29 -5
  128. package/dist/i18n/locales/es.d.ts.map +1 -1
  129. package/dist/i18n/locales/es.js +29 -5
  130. package/dist/i18n/locales/es.js.map +1 -1
  131. package/dist/i18n/locales/fr.d.ts +29 -5
  132. package/dist/i18n/locales/fr.d.ts.map +1 -1
  133. package/dist/i18n/locales/fr.js +29 -5
  134. package/dist/i18n/locales/fr.js.map +1 -1
  135. package/dist/i18n/locales/hi.d.ts +29 -5
  136. package/dist/i18n/locales/hi.d.ts.map +1 -1
  137. package/dist/i18n/locales/hi.js +29 -5
  138. package/dist/i18n/locales/hi.js.map +1 -1
  139. package/dist/i18n/locales/it.d.ts +29 -5
  140. package/dist/i18n/locales/it.d.ts.map +1 -1
  141. package/dist/i18n/locales/it.js +29 -5
  142. package/dist/i18n/locales/it.js.map +1 -1
  143. package/dist/i18n/locales/ja.d.ts +29 -5
  144. package/dist/i18n/locales/ja.d.ts.map +1 -1
  145. package/dist/i18n/locales/ja.js +29 -5
  146. package/dist/i18n/locales/ja.js.map +1 -1
  147. package/dist/i18n/locales/nl.d.ts +29 -5
  148. package/dist/i18n/locales/nl.d.ts.map +1 -1
  149. package/dist/i18n/locales/nl.js +29 -5
  150. package/dist/i18n/locales/nl.js.map +1 -1
  151. package/dist/i18n/locales/pl.d.ts +29 -5
  152. package/dist/i18n/locales/pl.d.ts.map +1 -1
  153. package/dist/i18n/locales/pl.js +29 -5
  154. package/dist/i18n/locales/pl.js.map +1 -1
  155. package/dist/i18n/locales/pt.d.ts +29 -5
  156. package/dist/i18n/locales/pt.d.ts.map +1 -1
  157. package/dist/i18n/locales/pt.js +29 -5
  158. package/dist/i18n/locales/pt.js.map +1 -1
  159. package/dist/i18n/locales/ro.d.ts +29 -5
  160. package/dist/i18n/locales/ro.d.ts.map +1 -1
  161. package/dist/i18n/locales/ro.js +29 -5
  162. package/dist/i18n/locales/ro.js.map +1 -1
  163. package/dist/i18n/locales/ru.d.ts +29 -5
  164. package/dist/i18n/locales/ru.d.ts.map +1 -1
  165. package/dist/i18n/locales/ru.js +29 -5
  166. package/dist/i18n/locales/ru.js.map +1 -1
  167. package/dist/i18n/locales/sq.d.ts +29 -5
  168. package/dist/i18n/locales/sq.d.ts.map +1 -1
  169. package/dist/i18n/locales/sq.js +29 -5
  170. package/dist/i18n/locales/sq.js.map +1 -1
  171. package/dist/i18n/locales/sv.d.ts +29 -5
  172. package/dist/i18n/locales/sv.d.ts.map +1 -1
  173. package/dist/i18n/locales/sv.js +29 -5
  174. package/dist/i18n/locales/sv.js.map +1 -1
  175. package/dist/i18n/locales/tr.d.ts +29 -5
  176. package/dist/i18n/locales/tr.d.ts.map +1 -1
  177. package/dist/i18n/locales/tr.js +29 -5
  178. package/dist/i18n/locales/tr.js.map +1 -1
  179. package/dist/i18n/locales/zh.d.ts +29 -5
  180. package/dist/i18n/locales/zh.d.ts.map +1 -1
  181. package/dist/i18n/locales/zh.js +29 -5
  182. package/dist/i18n/locales/zh.js.map +1 -1
  183. package/dist/index.js +958 -940
  184. package/dist/index.js.map +1 -1
  185. package/dist/locales/ar.json +29 -5
  186. package/dist/locales/de.json +29 -5
  187. package/dist/locales/el.json +29 -5
  188. package/dist/locales/en.json +29 -5
  189. package/dist/locales/es.json +29 -5
  190. package/dist/locales/fr.json +29 -5
  191. package/dist/locales/hi.json +29 -5
  192. package/dist/locales/it.json +29 -5
  193. package/dist/locales/ja.json +29 -5
  194. package/dist/locales/nl.json +29 -5
  195. package/dist/locales/pl.json +29 -5
  196. package/dist/locales/pt.json +29 -5
  197. package/dist/locales/ro.json +29 -5
  198. package/dist/locales/ru.json +29 -5
  199. package/dist/locales/sq.json +29 -5
  200. package/dist/locales/sv.json +29 -5
  201. package/dist/locales/tr.json +29 -5
  202. package/dist/locales/zh.json +29 -5
  203. package/dist/patterns/calendar/calendar-appointment-details.d.ts +15 -6
  204. package/dist/patterns/calendar/calendar-appointment-details.d.ts.map +1 -1
  205. package/dist/patterns/calendar/calendar-appointment-details.sections.d.ts +23 -23
  206. package/dist/patterns/calendar/calendar-appointment-details.sections.d.ts.map +1 -1
  207. package/dist/patterns/calendar/calendar-info-hover.d.ts +18 -0
  208. package/dist/patterns/calendar/calendar-info-hover.d.ts.map +1 -0
  209. package/dist/patterns/calendar/calendar-workspace.d.ts.map +1 -1
  210. package/dist/patterns/calendar/calendar.journey.d.ts +10 -0
  211. package/dist/patterns/calendar/calendar.journey.d.ts.map +1 -1
  212. package/dist/patterns/calendar/calendar.sheets.d.ts +2 -2
  213. package/dist/patterns/calendar/calendar.sheets.d.ts.map +1 -1
  214. package/dist/patterns/calendar/calendar.surface.d.ts.map +1 -1
  215. package/dist/patterns/calendar/index.js +1 -1
  216. package/dist/tokens.css +1 -1
  217. package/package.json +17 -1
  218. package/dist/_chunks/calendar-workspace-BYwQK7fz.js +0 -9478
  219. package/dist/_chunks/calendar-workspace-BYwQK7fz.js.map +0 -1
  220. package/dist/_chunks/hourglass-BEAzW1wE.js +0 -26
  221. package/dist/_chunks/hourglass-BEAzW1wE.js.map +0 -1
  222. package/dist/_chunks/money.agent-Dw55UxUA.js.map +0 -1
  223. package/dist/_chunks/notes-panel-Co8D3uDd.js +0 -469
  224. package/dist/_chunks/notes-panel-Co8D3uDd.js.map +0 -1
  225. package/dist/_chunks/patient-field-row-BQZoP4m2.js.map +0 -1
  226. package/dist/_chunks/smartphone-C0rFF2if.js +0 -15
  227. package/dist/_chunks/smartphone-C0rFF2if.js.map +0 -1
  228. package/dist/_chunks/task-card-BalrLkSz.js.map +0 -1
  229. package/dist/_chunks/tool-rail-Bq5eiFMG.js.map +0 -1
  230. package/dist/_chunks/workflow-map-D-LEni11.js.map +0 -1
@@ -0,0 +1,556 @@
1
+ import { jsxs as d, jsx as n, Fragment as We } from "react/jsx-runtime";
2
+ import { forwardRef as Oe, useRef as f, useState as C, useId as Ge, useCallback as x, useEffect as ue, useImperativeHandle as Ye, useMemo as Je } from "react";
3
+ import { c as Qe } from "./index-D2ZczOXr.js";
4
+ import { useTranslation as Ue } from "react-i18next";
5
+ import { u as Xe } from "./registry-DvAUVLHh.js";
6
+ import { C as Ze } from "./clinical-note-card-DdsGYMmI.js";
7
+ import { R as $e } from "./rich-text-editor-BTXlorm5.js";
8
+ import { T as et } from "./text-area-Bt3p7Pt0.js";
9
+ import { A as j } from "./alert-CiQ5Pa3Q.js";
10
+ import { B as S } from "./button-nJaPh_HC.js";
11
+ import { I as fe } from "./icon-button-8xqRnkdG.js";
12
+ import { C as tt } from "./checkbox-CZkipDn7.js";
13
+ import { S as nt } from "./spinner-hbwuKwMf.js";
14
+ import { D as h } from "./dialog-BJiLqhx6.js";
15
+ import { P as it } from "./panel-header-D_mTdhUp.js";
16
+ import { a as at, u as rt, R as lt } from "./use-list-reflow-Cw43nxw5.js";
17
+ import { u as st } from "./use-theme-CAuo6EYT.js";
18
+ import { N as ot } from "./notebook-pen-CO7HoM-W.js";
19
+ import { P as dt } from "./pencil-B1sKKyuT.js";
20
+ import { T as ct } from "./trash-2-uumy3fy1.js";
21
+ function pe(a, c) {
22
+ return typeof a == "object" && a !== null && "message" in a && typeof a.message == "string" && a.message.trim() ? a.message : c;
23
+ }
24
+ const ut = {
25
+ id: "notes-panel",
26
+ // 'submit' backs add_note (compose + commit a note). pin / flag are toggles
27
+ // with no dedicated capability in the closed vocabulary.
28
+ capabilities: ["submit"],
29
+ state: {
30
+ notes: {
31
+ type: "Array<{ id?: string; pinned: boolean; flagged: boolean; clinical: boolean }>",
32
+ descriptionKey: "ui.agent.notesPanel.state.notes",
33
+ description: "Timeline note ids + pinned / flagged / clinical flags. Never the note body or author (both PHI).",
34
+ read: (a) => a.getNotes()
35
+ },
36
+ canAddClinical: {
37
+ type: "boolean",
38
+ descriptionKey: "ui.agent.notesPanel.state.canAddClinical",
39
+ description: "Whether the current user may write clinical notes (the practice_add_clinical_note permission gate).",
40
+ read: (a) => a.canAddClinical()
41
+ },
42
+ currentNoteId: {
43
+ type: "string | null",
44
+ descriptionKey: "ui.agent.notesPanel.state.currentNoteId",
45
+ description: "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.",
46
+ read: (a) => a.getCurrentNoteId()
47
+ }
48
+ },
49
+ actions: {
50
+ add_note: {
51
+ // Writes a clinical/admin note body — patient-identifiable content. PHI.
52
+ safety: "phi",
53
+ argsType: "{ content: string; clinical: boolean }",
54
+ argsSchema: {
55
+ type: "object",
56
+ properties: {
57
+ content: {
58
+ type: "string",
59
+ description: "Note body. Rich HTML for the rich composer, else plain text."
60
+ },
61
+ clinical: {
62
+ type: "boolean",
63
+ description: "Whether the note is clinical. Requires the clinical-note permission; the submission is dropped when the gate is closed."
64
+ }
65
+ },
66
+ required: ["content", "clinical"]
67
+ },
68
+ openWorld: !0,
69
+ descriptionKey: "ui.agent.notesPanel.actions.addNote",
70
+ description: "Compose and commit a new note. A clinical note requires the clinical-note permission (read canAddClinical first).",
71
+ examples: [
72
+ {
73
+ args: { content: "Patient reported improvement.", clinical: !0 },
74
+ note: "Add a clinical note."
75
+ }
76
+ ],
77
+ invoke: (a, c) => a.addNote(c)
78
+ },
79
+ toggle_pin: {
80
+ // Re-orders the timeline (pinned notes lead) — reversible view write.
81
+ safety: "write",
82
+ argsType: "{ id: string }",
83
+ argsSchema: {
84
+ type: "object",
85
+ properties: { id: { type: "string" } },
86
+ required: ["id"]
87
+ },
88
+ idempotent: !1,
89
+ descriptionKey: "ui.agent.notesPanel.actions.togglePin",
90
+ description: "Toggle the pinned state of the note with the given id. Refused for a deleted note or one whose actions.pin is false.",
91
+ invoke: (a, c) => {
92
+ a.togglePin(c.id);
93
+ }
94
+ },
95
+ toggle_flag: {
96
+ safety: "write",
97
+ argsType: "{ id: string }",
98
+ argsSchema: {
99
+ type: "object",
100
+ properties: { id: { type: "string" } },
101
+ required: ["id"]
102
+ },
103
+ idempotent: !1,
104
+ descriptionKey: "ui.agent.notesPanel.actions.toggleFlag",
105
+ description: "Toggle the flagged state of the note with the given id.",
106
+ invoke: (a, c) => {
107
+ a.toggleFlag(c.id);
108
+ }
109
+ }
110
+ },
111
+ domHooks: {
112
+ root: {
113
+ attr: "data-component",
114
+ value: "notes-panel",
115
+ description: "Marks the NotesPanel region."
116
+ },
117
+ instanceId: {
118
+ attr: "data-component-id",
119
+ sourceProp: "id",
120
+ description: "Sourced from the id prop. Required to address a specific notes panel from the agent."
121
+ }
122
+ }
123
+ }, ft = Qe(
124
+ "ds:flex ds:flex-col ds:rounded-[var(--radius-md)] ds:border-s-2 ds:ps-[var(--spacing-sm)]",
125
+ {
126
+ variants: {
127
+ current: {
128
+ true: "ds:border-[color:var(--info)] ds:bg-[color:var(--info)]/10 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)]",
129
+ false: "ds:border-transparent"
130
+ }
131
+ },
132
+ defaultVariants: { current: !1 }
133
+ }
134
+ ), pt = "ds:opacity-0", mt = [
135
+ "ds:transition-opacity ds:duration-[var(--animation-duration)]",
136
+ "ds:ease-[var(--ease-out)] ds:motion-reduce:transition-none"
137
+ ].join(" ");
138
+ function me(a) {
139
+ return a ? /<img\b/i.test(a) ? !0 : a.replace(/<[^>]*>/g, "").replace(/&nbsp;/gi, " ").trim().length > 0 : !1;
140
+ }
141
+ const Ht = Oe(
142
+ function({
143
+ id: c,
144
+ notes: z,
145
+ onAddNote: p,
146
+ status: M = "ready",
147
+ onRetry: X,
148
+ currentNoteId: y,
149
+ currentNoteKey: ge,
150
+ composer: m = "rich",
151
+ editorToolbar: he = "standard",
152
+ redactor: ve,
153
+ imageUploadUrl: ye,
154
+ showClinicalToggle: be = !0,
155
+ canAddClinicalNote: N = !0,
156
+ clinicalGatedReason: Pe,
157
+ defaultClinical: w = !1,
158
+ onRequestAiDraft: Ce,
159
+ aiDraftFormat: xe,
160
+ aiPrivacyNotice: we,
161
+ onDictate: Re,
162
+ onProofread: Ve,
163
+ onAutoFormat: ke,
164
+ onTogglePin: A,
165
+ onToggleFlag: H,
166
+ noteActions: Z,
167
+ onEditNote: R,
168
+ editClinical: Te = !1,
169
+ onDeleteNote: g,
170
+ confirmDelete: W = !0,
171
+ title: Ie,
172
+ composerPlaceholder: Ee,
173
+ addNoteLabel: je,
174
+ emptyState: Se,
175
+ className: ze,
176
+ "aria-label": O,
177
+ ...Ne
178
+ }, Ae) {
179
+ const { t: i, i18n: $ } = Ue(), v = f(null), [b, V] = C(""), [L, _] = C(w), [u, ee] = C(!1), [te, k] = C(null), [l, G] = C(null), He = Ie ?? i("notesPanel.title", { defaultValue: "Notes" }), ne = Ge(), ie = Ee ?? i("notesPanel.placeholder", { defaultValue: "Add a note…" }), ae = l !== null ? i("notesPanel.edit", { defaultValue: "Edit note" }) : i("notesPanel.composerLabel", { defaultValue: "New note" }), Le = m === "rich" ? me(b) : b.trim().length > 0, _e = x(() => {
180
+ var E;
181
+ if (!(l !== null ? R : p) || u) return;
182
+ const t = m === "rich", o = t ? ((E = v.current) == null ? void 0 : E.getHTML()) ?? b : b.trim();
183
+ if (t ? !me(o) : !o) return;
184
+ const s = () => {
185
+ var P;
186
+ t && ((P = v.current) == null || P.clear()), V(""), _(w), G(null);
187
+ };
188
+ k(null);
189
+ let r;
190
+ try {
191
+ r = l !== null && R ? R(l, { content: o, clinical: L }) : p == null ? void 0 : p({ content: o, clinical: L });
192
+ } catch (P) {
193
+ k(pe(P, i("notesPanel.addFailed")));
194
+ return;
195
+ }
196
+ if (!r || typeof r.then != "function") return s();
197
+ ee(!0), Promise.resolve(r).then(
198
+ s,
199
+ (P) => k(pe(P, i("notesPanel.addFailed")))
200
+ ).finally(() => ee(!1));
201
+ }, [
202
+ m,
203
+ b,
204
+ L,
205
+ w,
206
+ l,
207
+ p,
208
+ R,
209
+ u,
210
+ i
211
+ ]), re = be && (l === null || Te), le = x(
212
+ (e) => {
213
+ try {
214
+ return new Intl.DateTimeFormat($.language, {
215
+ day: "numeric",
216
+ month: "long",
217
+ year: "numeric",
218
+ hour: "2-digit",
219
+ minute: "2-digit"
220
+ }).format(new Date(e.dateIso));
221
+ } catch {
222
+ return e.dateIso;
223
+ }
224
+ },
225
+ [$.language]
226
+ ), Be = x(
227
+ (e) => {
228
+ var o, s, r;
229
+ if (!e.id || u) return;
230
+ const t = e.content ?? "";
231
+ k(null), G(e.id), _(e.clinical ?? !1), V(t), m === "rich" && ((o = v.current) == null || o.clear(), (s = v.current) == null || s.insertAtCursor(t, { asHtml: !0 })), (r = v.current) == null || r.focus();
232
+ },
233
+ [m, u]
234
+ ), B = x(() => {
235
+ var e;
236
+ m === "rich" && ((e = v.current) == null || e.clear()), V(""), _(w), k(null), G(null);
237
+ }, [m, w]), se = l === null || z.some((e) => e.id === l && !e.deleted);
238
+ ue(() => {
239
+ se || B();
240
+ }, [se, B]);
241
+ const Y = [...z].sort(
242
+ (e, t) => Number(t.pinned ?? !1) - Number(e.pinned ?? !1)
243
+ ), { resolvedTheme: De } = st(), oe = De.endsWith("-accessible") || void 0, { containerRef: qe } = at({
244
+ key: Y.map((e) => e.id).join(),
245
+ reduceMotion: oe
246
+ }), T = rt({ reduceMotion: oe }), [D, q] = C(null), Fe = x(
247
+ (e) => {
248
+ g && (W ? q(e) : T.leave(e, () => g(e)));
249
+ },
250
+ [W, T, g]
251
+ ), Ke = x(() => {
252
+ if (!D || !g) return;
253
+ const e = D;
254
+ q(null), T.leave(e, () => g(e));
255
+ }, [D, g, T]), J = f(null);
256
+ ue(() => {
257
+ var e, t;
258
+ y && ((e = J.current) == null || e.scrollIntoView({ block: "center" }), (t = J.current) == null || t.focus());
259
+ }, [y, ge]);
260
+ const Q = f(z);
261
+ Q.current = z;
262
+ const I = f(p);
263
+ I.current = p;
264
+ const F = f(A);
265
+ F.current = A;
266
+ const K = f(H);
267
+ K.current = H;
268
+ const U = f(N);
269
+ U.current = N;
270
+ const de = f(y);
271
+ de.current = y;
272
+ const ce = f(null);
273
+ Ye(Ae, () => ce.current, []);
274
+ const Me = Je(
275
+ () => ({
276
+ // Ids + flags only — never the note body or author (both PHI).
277
+ getNotes: () => Q.current.map((e) => ({
278
+ id: e.id,
279
+ pinned: !!e.pinned,
280
+ flagged: !!e.flagged,
281
+ clinical: !!e.clinical
282
+ })),
283
+ canAddNote: () => !!I.current,
284
+ canAddClinical: () => U.current,
285
+ getCurrentNoteId: () => de.current ?? null,
286
+ addNote: (e) => {
287
+ var t;
288
+ if (!(e.clinical && !U.current))
289
+ return (t = I.current) == null ? void 0 : t.call(I, e);
290
+ },
291
+ togglePin: (e) => {
292
+ var o, s;
293
+ const t = Q.current.find((r) => r.id === e);
294
+ t && (t.deleted || ((o = t.actions) == null ? void 0 : o.pin) === !1) || (s = F.current) == null || s.call(F, e);
295
+ },
296
+ toggleFlag: (e) => {
297
+ var t;
298
+ return (t = K.current) == null ? void 0 : t.call(K, e);
299
+ }
300
+ }),
301
+ []
302
+ );
303
+ return Xe(ut, Me, c), /* @__PURE__ */ d(
304
+ "section",
305
+ {
306
+ ref: ce,
307
+ "data-component": "notes-panel",
308
+ "data-component-id": c,
309
+ "aria-labelledby": O ? void 0 : ne,
310
+ "aria-label": O,
311
+ className: ["ds:flex ds:flex-col", ze].filter(Boolean).join(" "),
312
+ ...Ne,
313
+ children: [
314
+ /* @__PURE__ */ n(
315
+ it,
316
+ {
317
+ title: He,
318
+ icon: /* @__PURE__ */ n(ot, { "aria-hidden": "true" }),
319
+ headingId: O ? void 0 : ne,
320
+ sticky: !0,
321
+ divider: !0
322
+ }
323
+ ),
324
+ /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:p-[var(--spacing-md)]", children: [
325
+ p || l !== null ? /* @__PURE__ */ d(
326
+ "div",
327
+ {
328
+ "data-notes-panel-composer": l !== null ? "edit" : "add",
329
+ className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
330
+ children: [
331
+ m === "rich" ? /* @__PURE__ */ n(
332
+ $e,
333
+ {
334
+ ref: v,
335
+ ariaLabel: ae,
336
+ placeholder: ie,
337
+ toolbar: he,
338
+ minHeight: "fill",
339
+ redactor: ve,
340
+ imageUploadUrl: ye,
341
+ readOnly: u,
342
+ onChange: ({ html: e }) => V(e),
343
+ onRequestAiDraft: Ce,
344
+ aiDraftFormat: xe,
345
+ aiPrivacyNotice: we,
346
+ onDictate: Re,
347
+ onProofread: Ve,
348
+ onAutoFormat: ke
349
+ }
350
+ ) : /* @__PURE__ */ n(
351
+ et,
352
+ {
353
+ value: b,
354
+ readOnly: u,
355
+ onChange: (e) => V(e.target.value),
356
+ placeholder: ie,
357
+ autoResize: !0,
358
+ minRows: 2,
359
+ maxRows: 6,
360
+ "aria-label": ae
361
+ }
362
+ ),
363
+ /* @__PURE__ */ d(
364
+ "div",
365
+ {
366
+ className: [
367
+ "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]",
368
+ re ? "ds:justify-between" : "ds:justify-end"
369
+ ].join(" "),
370
+ children: [
371
+ re ? /* @__PURE__ */ n(
372
+ tt,
373
+ {
374
+ size: "sm",
375
+ label: i("notesPanel.clinicalToggle", {
376
+ defaultValue: "Clinical note"
377
+ }),
378
+ checked: L,
379
+ onCheckedChange: (e) => _(e === !0),
380
+ disabled: u || !N,
381
+ disabledReason: N ? void 0 : Pe ?? i("notesPanel.clinicalGated", {
382
+ defaultValue: "You do not have permission to write clinical notes."
383
+ })
384
+ }
385
+ ) : null,
386
+ /* @__PURE__ */ d("span", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
387
+ l !== null ? /* @__PURE__ */ n(
388
+ S,
389
+ {
390
+ type: "button",
391
+ size: "sm",
392
+ intent: "ghost",
393
+ onClick: B,
394
+ disabled: u,
395
+ children: i("notesPanel.cancelEdit", { defaultValue: "Cancel" })
396
+ }
397
+ ) : null,
398
+ /* @__PURE__ */ n(
399
+ S,
400
+ {
401
+ type: "button",
402
+ size: "sm",
403
+ onClick: _e,
404
+ disabled: !Le,
405
+ loading: u,
406
+ children: l !== null ? i("notesPanel.saveEdit", { defaultValue: "Save note" }) : je ?? i("notesPanel.add", { defaultValue: "Add note" })
407
+ }
408
+ )
409
+ ] })
410
+ ]
411
+ }
412
+ ),
413
+ te ? /* @__PURE__ */ n(j, { variant: "error", children: /* @__PURE__ */ n(j.Description, { children: te }) }) : null
414
+ ]
415
+ }
416
+ ) : null,
417
+ M === "loading" ? /* @__PURE__ */ d("p", { className: "ds:m-0 ds:flex ds:items-center ds:gap-[var(--spacing-xs)] type-body-sm ds:text-[color:var(--muted-foreground)]", children: [
418
+ /* @__PURE__ */ n(nt, { size: "sm", label: i("notesPanel.loading") }),
419
+ /* @__PURE__ */ n("span", { "aria-hidden": "true", children: i("notesPanel.loading") })
420
+ ] }) : M === "error" ? /* @__PURE__ */ d(j, { variant: "error", children: [
421
+ /* @__PURE__ */ n(j.Description, { children: i("notesPanel.loadError") }),
422
+ X ? /* @__PURE__ */ n(j.Action, { children: /* @__PURE__ */ n(S, { intent: "secondary", size: "sm", onClick: X, children: i("notesPanel.retry") }) }) : null
423
+ ] }) : null,
424
+ Y.length > 0 ? /* @__PURE__ */ n(
425
+ "ul",
426
+ {
427
+ ref: qe,
428
+ className: "ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-0",
429
+ children: Y.map(({ actions: e, ...t }, o) => {
430
+ const s = y != null && t.id === y, r = t.id, E = r != null && T.isLeaving(r);
431
+ return /* @__PURE__ */ d(
432
+ "li",
433
+ {
434
+ ref: s ? J : void 0,
435
+ tabIndex: s ? -1 : void 0,
436
+ "aria-current": s ? "true" : void 0,
437
+ "data-reflow-id": r,
438
+ "data-leaving": E ? "" : void 0,
439
+ "data-editing": l === r ? "" : void 0,
440
+ className: [
441
+ ft({
442
+ current: s || l === r
443
+ }),
444
+ mt,
445
+ lt,
446
+ E ? pt : ""
447
+ ].filter(Boolean).join(" "),
448
+ children: [
449
+ s ? /* @__PURE__ */ n("span", { className: "ds:sr-only", children: i("notesPanel.current", {
450
+ defaultValue: "Current note"
451
+ }) }) : null,
452
+ /* @__PURE__ */ n(
453
+ Ze,
454
+ {
455
+ surface: "elevated",
456
+ truncate: !s,
457
+ headerActions: /* @__PURE__ */ d(We, { children: [
458
+ Z ? Z({ ...t, actions: e }) : null,
459
+ R && r && !t.deleted && (e == null ? void 0 : e.edit) !== !1 ? /* @__PURE__ */ n(
460
+ fe,
461
+ {
462
+ icon: /* @__PURE__ */ n(dt, {}),
463
+ intent: "ghost",
464
+ size: "sm",
465
+ "aria-label": i("notesPanel.editNamed", {
466
+ date: le(t),
467
+ defaultValue: "Edit note · {{date}}"
468
+ }),
469
+ tooltip: i("notesPanel.edit", {
470
+ defaultValue: "Edit note"
471
+ }),
472
+ "aria-pressed": l === r,
473
+ disabled: u,
474
+ "data-notes-panel-edit": "",
475
+ onClick: () => l === r ? B() : Be(t)
476
+ }
477
+ ) : null,
478
+ g && r && !t.deleted ? /* @__PURE__ */ n(
479
+ fe,
480
+ {
481
+ icon: /* @__PURE__ */ n(ct, {}),
482
+ intent: "ghost",
483
+ size: "sm",
484
+ "aria-label": i("notesPanel.deleteNamed", {
485
+ date: le(t),
486
+ defaultValue: "Delete note · {{date}}"
487
+ }),
488
+ tooltip: i("notesPanel.delete", {
489
+ defaultValue: "Delete note"
490
+ }),
491
+ onClick: () => Fe(r)
492
+ }
493
+ ) : null
494
+ ] }),
495
+ ...t,
496
+ onTogglePin: A && t.id && (e == null ? void 0 : e.pin) !== !1 && !t.deleted ? () => A(t.id) : void 0,
497
+ onToggleFlag: H && t.id ? () => H(t.id) : void 0
498
+ }
499
+ )
500
+ ]
501
+ },
502
+ t.id ?? o
503
+ );
504
+ })
505
+ }
506
+ ) : M !== "ready" ? null : Se ?? /* @__PURE__ */ n("p", { className: "ds:m-0 type-body-sm ds:text-[color:var(--muted-foreground)]", children: i("notesPanel.empty", { defaultValue: "No notes yet." }) })
507
+ ] }),
508
+ g && W ? /* @__PURE__ */ n(
509
+ h,
510
+ {
511
+ open: D !== null,
512
+ onOpenChange: (e) => !e && q(null),
513
+ children: /* @__PURE__ */ d(h.Content, { variant: "alert", size: "sm", children: [
514
+ /* @__PURE__ */ n(h.Header, { children: /* @__PURE__ */ n(h.Title, { children: i("notesPanel.deleteConfirmTitle", {
515
+ defaultValue: "Delete this note?"
516
+ }) }) }),
517
+ /* @__PURE__ */ n(h.Body, { children: /* @__PURE__ */ n(h.Description, { children: i("notesPanel.deleteConfirmBody", {
518
+ defaultValue: "The note will be removed from the record."
519
+ }) }) }),
520
+ /* @__PURE__ */ d(h.Footer, { children: [
521
+ /* @__PURE__ */ n(h.Close, { asChild: !0, children: /* @__PURE__ */ n(
522
+ S,
523
+ {
524
+ intent: "secondary",
525
+ size: "sm",
526
+ onClick: () => q(null),
527
+ children: i("notesPanel.deleteConfirmCancel", {
528
+ defaultValue: "Cancel"
529
+ })
530
+ }
531
+ ) }),
532
+ /* @__PURE__ */ n(
533
+ S,
534
+ {
535
+ intent: "destructive",
536
+ size: "sm",
537
+ onClick: Ke,
538
+ children: i("notesPanel.deleteConfirmAction", {
539
+ defaultValue: "Delete"
540
+ })
541
+ }
542
+ )
543
+ ] })
544
+ ] })
545
+ }
546
+ ) : null
547
+ ]
548
+ }
549
+ );
550
+ }
551
+ );
552
+ export {
553
+ Ht as N,
554
+ pe as g
555
+ };
556
+ //# sourceMappingURL=notes-panel-4y5JioWN.js.map