@alfadocs/ui-kit 1.149.0 → 1.150.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.
- package/dist/_chunks/{ai-summary-panel-Cdsve-XN.js → ai-summary-panel-D-RNe-_n.js} +3 -3
- package/dist/_chunks/{anamnesis-summary-rows-QCv6zW-J.js → anamnesis-summary-rows-CE-i9j-s.js} +2 -2
- package/dist/_chunks/{appointment-card-HOZrABrQ.js → appointment-card-BPZggqck.js} +2 -2
- package/dist/_chunks/{appointment-details-panel.history-BxNqcA-r.js → appointment-details-panel.history-BO31ZFQp.js} +2 -2
- package/dist/_chunks/{appointment-details-panel.identity--_j07UG1.js → appointment-details-panel.identity-C9kWtC6m.js} +90 -78
- package/dist/_chunks/appointment-peek-CGJ6kUvM.js +213 -0
- package/dist/_chunks/{appointment-timeline-CuZW-CGT.js → appointment-timeline-ynFqcw0S.js} +3 -3
- package/dist/_chunks/{appointment-tray-CFCxukwq.js → appointment-tray-Dx5VDREk.js} +2 -2
- package/dist/_chunks/{balance-badge-cell-BPz9bQAB.js → balance-badge-cell-DiyJQcmA.js} +2 -2
- package/dist/_chunks/{calendar-appointment-editor-dialog-Dx9_KIWA.js → calendar-appointment-editor-dialog-BfoEpFVx.js} +360 -356
- package/dist/_chunks/{calendar-editor-discard-host-DWS_kM-a.js → calendar-editor-discard-host-DO506cJu.js} +4 -4
- package/dist/_chunks/{calendar-waiting-list-panel-BKBHfBpn.js → calendar-waiting-list-panel-CyMTv2y3.js} +7 -7
- package/dist/_chunks/{calendar-workspace.model-4zmA3BFE.js → calendar-workspace.model-X3aXbDTo.js} +2 -2
- package/dist/_chunks/{calendar.sheets-lgAqJB34.js → calendar.sheets-C8x8kPb4.js} +10 -10
- package/dist/_chunks/{calls-panel-BTTfHnPD.js → calls-panel-Bpemmnpd.js} +4 -4
- package/dist/_chunks/{care-plan-card-2U2LuIJD.js → care-plan-card-DJXNWjKB.js} +3 -3
- package/dist/_chunks/{care-plan-entry-card-CUAlQv1c.js → care-plan-entry-card-W5QvNv8m.js} +2 -2
- package/dist/_chunks/{communications-panel-DDzUyoHi.js → communications-panel-Cd0TBEhL.js} +2 -2
- package/dist/_chunks/{control-room-rail-BQvaYowi.js → control-room-rail-4W1MFY-g.js} +3 -3
- package/dist/_chunks/{document-preview-oSuJsJ3k.js → document-preview-Zws6CHhK.js} +3 -3
- package/dist/_chunks/{editable-description-BsSjLnSx.js → editable-description-B2F54K4T.js} +34 -33
- package/dist/_chunks/{entity-summary-CZmGcWi2.js → entity-summary-BNnTP1F6.js} +62 -50
- package/dist/_chunks/feature-preview-switch-PKeLaFry.js +75 -0
- package/dist/_chunks/{file-manager-Cp3Z4VvM.js → file-manager-DzOCQBAO.js} +163 -178
- package/dist/_chunks/folder-CH9PJHou.js +36 -0
- package/dist/_chunks/{help-me-write-templates-DlA54nu5.js → help-me-write-templates-B_wMJ82X.js} +2 -2
- package/dist/_chunks/message-square-warning-DsGGfd0K.js +22 -0
- package/dist/_chunks/{notes-panel-Cw06dLDm.js → notes-panel-BguRX8VC.js} +374 -341
- package/dist/_chunks/{optical-prescription-DZvauMiM.js → optical-prescription-BzGnlIjq.js} +2 -2
- package/dist/_chunks/{panel-header-CbtlTe85.js → panel-header-DTc5OFUg.js} +78 -66
- package/dist/_chunks/{panel-subview-DjBwNV16.js → panel-subview-Om_yZvFG.js} +2 -2
- package/dist/_chunks/{patient-account-settings-Do0QbDJe.js → patient-account-settings-YKnBzmwE.js} +3 -3
- package/dist/_chunks/{patient-check-in-resume-Bxy1_Pfo.js → patient-check-in-resume-DERfQbp5.js} +5 -5
- package/dist/_chunks/{patient-details-Cj3dp9GB.js → patient-details-BUD0UbmT.js} +3 -3
- package/dist/_chunks/{patient-field-row-DDjsUsc_.js → patient-field-row-DytaHdGw.js} +201 -200
- package/dist/_chunks/{patient-summary-card-roM9Esfb.js → patient-summary-card-7Werxl48.js} +126 -139
- package/dist/_chunks/{payment-request-card-C9VglWsV.js → payment-request-card-BF3rakTQ.js} +2 -2
- package/dist/_chunks/{portal-details-CKF4yFHs.js → portal-details-C1QQGPQf.js} +3 -3
- package/dist/_chunks/{portal-documents-DvpAwmSI.js → portal-documents-CzEuCaqv.js} +3 -3
- package/dist/_chunks/{portal-parts-Cvu4PfIY.js → portal-parts-BMW4t57s.js} +2 -2
- package/dist/_chunks/{privacy-mask-zVh0ntm0.js → privacy-mask-CrjD5PYW.js} +2 -2
- package/dist/_chunks/{radiograph-panel.agent-BUZPsuSP.js → radiograph-panel.agent-Kl1M0dtT.js} +3 -3
- package/dist/_chunks/{registry-connection-panel-ACOsXu3F.js → registry-connection-panel-kdKbGQE6.js} +3 -3
- package/dist/_chunks/{reserved.agent-DjvapRF1.js → reserved.agent-CW0frsMv.js} +2 -2
- package/dist/_chunks/{reviews-panel-Cw5ygAxs.js → reviews-panel-54AFY6uy.js} +2 -2
- package/dist/_chunks/{rich-text-editor-eGdYDPK2.js → rich-text-editor-DCQEpaIv.js} +1398 -1280
- package/dist/_chunks/{task-editor-4zFL10oM.js → task-editor-CIHQQRtP.js} +219 -210
- package/dist/_chunks/{tasks-panel-BDPQPOP6.js → tasks-panel-Bc_odkQN.js} +2 -2
- package/dist/_chunks/text-area-DbxGkpzE.js +269 -0
- package/dist/_chunks/{tool-rail-DjPEiBa2.js → tool-rail-CJBtqzMs.js} +337 -320
- package/dist/_chunks/{transaction-chip-CkYd-3ky.js → transaction-chip-6jToArJn.js} +45 -43
- package/dist/_chunks/{transcript-panel-Wr8e4Zgi.js → transcript-panel-Dc0fK4WO.js} +2 -2
- package/dist/_chunks/{treatment-receipt-BZzwvsnY.js → treatment-receipt-B6m47Jie.js} +44 -46
- package/dist/_chunks/{use-appointment-details-read-Bl1DHXQ2.js → use-appointment-details-read-HVHbR0Zl.js} +769 -745
- package/dist/agent-catalog.json +15 -1
- package/dist/appointment-editor-panel/index.js +4 -4
- package/dist/booking-tools-data/index.js +1 -1
- package/dist/browser-support.js +1 -1
- package/dist/calendar-action-buttons/index.js +1 -1
- package/dist/components/_shared/appointment-format.d.ts +4 -0
- package/dist/components/_shared/patient-field-row.d.ts +5 -1
- package/dist/components/ai-summary-panel/index.js +1 -1
- package/dist/components/appointment-card/index.js +2 -2
- package/dist/components/appointment-details-panel/appointment-details-panel.d.ts +5 -2
- package/dist/components/appointment-details-panel/appointment-details-panel.sections.d.ts +3 -1
- package/dist/components/appointment-details-panel/appointment-details-panel.types.d.ts +3 -0
- package/dist/components/appointment-details-panel/index.js +2 -2
- package/dist/components/appointment-peek/appointment-peek.d.ts +45 -1
- package/dist/components/appointment-peek/index.js +1 -1
- package/dist/components/appointment-timeline/index.js +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/calls-panel/index.js +1 -1
- package/dist/components/care-plan-card/index.js +1 -1
- package/dist/components/care-plan-entry-card/index.js +1 -1
- package/dist/components/communications-panel/index.js +1 -1
- package/dist/components/control-room-rail/index.js +1 -1
- package/dist/components/document-preview/index.js +1 -1
- package/dist/components/editable-description/editable-description.d.ts +7 -0
- package/dist/components/editable-description/index.js +1 -1
- package/dist/components/entity-summary/index.js +1 -1
- package/dist/components/feature-preview-switch/feature-preview-switch.d.ts +55 -0
- package/dist/components/feature-preview-switch/index.d.ts +2 -0
- package/dist/components/feature-preview-switch/index.js +5 -0
- package/dist/components/file-manager/index.js +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/notes-panel/notes-panel.d.ts +20 -0
- package/dist/components/optical-prescription/index.js +1 -1
- package/dist/components/panel-header/index.js +1 -1
- package/dist/components/panel-header/panel-header.d.ts +8 -0
- package/dist/components/panel-subview/index.js +1 -1
- package/dist/components/patient-details/index.js +1 -1
- package/dist/components/patient-summary-card/index.js +1 -1
- package/dist/components/patient-summary-card/patient-summary-card.d.ts +9 -0
- package/dist/components/patient-table/index.js +1 -1
- package/dist/components/payment-card/index.js +1 -1
- package/dist/components/radiograph-panel/index.js +1 -1
- package/dist/components/registry-connection-panel/index.js +1 -1
- package/dist/components/reviews-panel/index.js +1 -1
- package/dist/components/rich-text-editor/editor-toolbar.d.ts +4 -1
- package/dist/components/rich-text-editor/index.js +1 -1
- package/dist/components/task-editor/index.js +1 -1
- package/dist/components/tasks-panel/index.js +1 -1
- package/dist/components/text-area/index.js +1 -1
- package/dist/components/text-area/text-area.d.ts +15 -0
- package/dist/components/tool-rail/index.js +1 -1
- package/dist/components/tool-rail/tool-rail.d.ts +12 -1
- package/dist/components/transaction-chip/index.js +1 -1
- package/dist/components/transaction-chip/transaction-chip.d.ts +7 -0
- package/dist/components/transcript-panel/index.js +1 -1
- package/dist/components/treatment-receipt/index.js +1 -1
- package/dist/core.css +1 -1
- package/dist/find-free-slots-panel/index.js +1 -1
- package/dist/host-legacy.css +51 -4
- package/dist/i18n/locales/ar.d.ts +9 -0
- package/dist/i18n/locales/ar.js +8 -2
- package/dist/i18n/locales/de.d.ts +9 -0
- package/dist/i18n/locales/de.js +8 -2
- package/dist/i18n/locales/el.d.ts +9 -0
- package/dist/i18n/locales/el.js +10 -1
- package/dist/i18n/locales/en.d.ts +9 -0
- package/dist/i18n/locales/en.js +11 -2
- package/dist/i18n/locales/es.d.ts +9 -0
- package/dist/i18n/locales/es.js +10 -1
- package/dist/i18n/locales/fr.d.ts +9 -0
- package/dist/i18n/locales/fr.js +10 -1
- package/dist/i18n/locales/hi.d.ts +9 -0
- package/dist/i18n/locales/hi.js +8 -2
- package/dist/i18n/locales/it.d.ts +19 -10
- package/dist/i18n/locales/it.js +20 -11
- package/dist/i18n/locales/ja.d.ts +9 -0
- package/dist/i18n/locales/ja.js +8 -2
- package/dist/i18n/locales/nl.d.ts +9 -0
- package/dist/i18n/locales/nl.js +8 -2
- package/dist/i18n/locales/pl.d.ts +9 -0
- package/dist/i18n/locales/pl.js +10 -1
- package/dist/i18n/locales/pt.d.ts +9 -0
- package/dist/i18n/locales/pt.js +10 -1
- package/dist/i18n/locales/ro.d.ts +9 -0
- package/dist/i18n/locales/ro.js +10 -1
- package/dist/i18n/locales/ru.d.ts +9 -0
- package/dist/i18n/locales/ru.js +8 -2
- package/dist/i18n/locales/sq.d.ts +9 -0
- package/dist/i18n/locales/sq.js +10 -1
- package/dist/i18n/locales/sv.d.ts +9 -0
- package/dist/i18n/locales/sv.js +8 -2
- package/dist/i18n/locales/tr.d.ts +9 -0
- package/dist/i18n/locales/tr.js +8 -2
- package/dist/i18n/locales/zh.d.ts +9 -0
- package/dist/i18n/locales/zh.js +8 -2
- package/dist/index.js +775 -773
- package/dist/locales/ar.json +10 -1
- package/dist/locales/de.json +10 -1
- package/dist/locales/el.json +10 -1
- package/dist/locales/en.json +11 -2
- package/dist/locales/es.json +10 -1
- package/dist/locales/fr.json +10 -1
- package/dist/locales/hi.json +10 -1
- package/dist/locales/it.json +20 -11
- package/dist/locales/ja.json +10 -1
- package/dist/locales/nl.json +10 -1
- package/dist/locales/pl.json +10 -1
- package/dist/locales/pt.json +10 -1
- package/dist/locales/ro.json +10 -1
- package/dist/locales/ru.json +10 -1
- package/dist/locales/sq.json +10 -1
- package/dist/locales/sv.json +10 -1
- package/dist/locales/tr.json +10 -1
- package/dist/locales/zh.json +10 -1
- package/dist/online-bookings-panel/index.js +2 -2
- package/dist/patterns/anamnesis/index.js +1 -1
- package/dist/patterns/calendar/index.js +4 -4
- package/dist/patterns/help-me-write-templates/index.js +1 -1
- package/dist/patterns/patient-account-settings/index.js +1 -1
- package/dist/patterns/patient-check-in/index.js +1 -1
- package/dist/patterns/patient-portal/index.js +2 -2
- package/dist/tokens.css +1 -1
- package/dist/waiting-list-panel/index.js +3 -3
- package/package.json +5 -1
- package/dist/_chunks/appointment-peek-B3raO90X.js +0 -123
- package/dist/_chunks/contact-round-DiSvB3LP.js +0 -18
- package/dist/_chunks/folder-BghC8_S2.js +0 -20
- package/dist/_chunks/text-area-COMVJ1yE.js +0 -258
|
@@ -1,30 +1,31 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { c as
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import { g as
|
|
6
|
-
import { useSaveOutcomeUnknownMessage as
|
|
7
|
-
import { h as
|
|
8
|
-
import { u as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
1
|
+
import { jsxs as y, jsx as a, Fragment as $n } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as Bn, useRef as u, useState as T, useId as Pt, useEffect as S, useCallback as W, useMemo as xt, useImperativeHandle as Kn } from "react";
|
|
3
|
+
import { c as jt } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as Un } from "react-i18next";
|
|
5
|
+
import { g as Tt } from "./get-error-message-DbFUzuja.js";
|
|
6
|
+
import { useSaveOutcomeUnknownMessage as In, isSaveOutcomeUnknownError as He } from "../save-outcome/index.js";
|
|
7
|
+
import { h as Vt } from "./handled-rejection-C-6Dq0As.js";
|
|
8
|
+
import { u as Yn } from "./registry-DvAUVLHh.js";
|
|
9
|
+
import { A as Gn } from "./avatar-Dp5apm1d.js";
|
|
10
|
+
import { C as Jn } from "./clinical-note-card-D-9xmRpf.js";
|
|
11
|
+
import { R as Qn } from "./rich-text-editor-DCQEpaIv.js";
|
|
12
|
+
import { T as Xn } from "./text-area-DbxGkpzE.js";
|
|
12
13
|
import { A } from "./alert-C4WKViaS.js";
|
|
13
14
|
import { B as re } from "./button-Dp4j9ygh.js";
|
|
14
|
-
import { I as
|
|
15
|
-
import { S as
|
|
16
|
-
import { T as
|
|
17
|
-
import { C as
|
|
18
|
-
import { C as
|
|
15
|
+
import { I as St } from "./icon-button-u9VMQn3x.js";
|
|
16
|
+
import { S as Zn } from "./switch-DO6uC4HJ.js";
|
|
17
|
+
import { T as er } from "./tooltip-uEBdD1-5.js";
|
|
18
|
+
import { C as Ct } from "./card-n6W6LW-N.js";
|
|
19
|
+
import { C as tr, S as be } from "./skeleton-tTWJpvAq.js";
|
|
19
20
|
import { D as L } from "./dialog-239Geb7Z.js";
|
|
20
|
-
import { P as
|
|
21
|
-
import { a as
|
|
22
|
-
import { u as
|
|
23
|
-
import { u as
|
|
24
|
-
import { N as
|
|
25
|
-
import { P as
|
|
26
|
-
import { T as
|
|
27
|
-
const
|
|
21
|
+
import { P as nr } from "./panel-header-DTc5OFUg.js";
|
|
22
|
+
import { a as rr, u as sr, R as ar } from "./use-list-reflow-C7O4Uqnl.js";
|
|
23
|
+
import { u as ir } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
|
|
24
|
+
import { u as lr } from "./use-resolved-theme-B0f1_oyq.js";
|
|
25
|
+
import { N as or } from "./notebook-pen-CO7HoM-W.js";
|
|
26
|
+
import { P as dr } from "./pencil-B1sKKyuT.js";
|
|
27
|
+
import { T as cr } from "./trash-2-uumy3fy1.js";
|
|
28
|
+
const ur = {
|
|
28
29
|
id: "notes-panel",
|
|
29
30
|
// 'submit' backs add_note (compose + commit a note). pin / flag are toggles
|
|
30
31
|
// with no dedicated capability in the closed vocabulary.
|
|
@@ -139,7 +140,7 @@ const ar = {
|
|
|
139
140
|
description: "Stable note id on each rendered note row. Row controls carry data-note-action: edit, delete, pin or flag."
|
|
140
141
|
}
|
|
141
142
|
}
|
|
142
|
-
},
|
|
143
|
+
}, fr = "ds:isolate ds:[&_[data-component=card]>*]:relative ds:[&_[data-component=card]>*]:z-[1]", gr = jt(
|
|
143
144
|
"ds:relative ds:flex ds:flex-col ds:rounded-[var(--radius-lg)]",
|
|
144
145
|
{
|
|
145
146
|
variants: {
|
|
@@ -147,11 +148,11 @@ const ar = {
|
|
|
147
148
|
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)]",
|
|
148
149
|
false: ""
|
|
149
150
|
},
|
|
150
|
-
washed: { true:
|
|
151
|
+
washed: { true: fr, false: "" }
|
|
151
152
|
},
|
|
152
153
|
defaultVariants: { current: !1, washed: !1 }
|
|
153
154
|
}
|
|
154
|
-
),
|
|
155
|
+
), Et = jt(
|
|
155
156
|
"ds:pointer-events-none ds:absolute ds:inset-0 ds:rounded-[var(--radius-lg)] ds:bg-[color:var(--accent)]",
|
|
156
157
|
{
|
|
157
158
|
variants: {
|
|
@@ -167,39 +168,39 @@ const ar = {
|
|
|
167
168
|
}
|
|
168
169
|
}
|
|
169
170
|
}
|
|
170
|
-
),
|
|
171
|
+
), Lt = [
|
|
171
172
|
"ds:rounded-[var(--radius-lg)] ds:outline-none",
|
|
172
173
|
"ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
|
|
173
174
|
"ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]"
|
|
174
|
-
].join(" "),
|
|
175
|
+
].join(" "), hr = ["ds:flex ds:flex-col", Lt].join(" "), pr = "ds:opacity-0", mr = [
|
|
175
176
|
"ds:transition-opacity ds:duration-[var(--animation-duration)]",
|
|
176
177
|
"ds:ease-[var(--ease-out)] ds:motion-reduce:transition-none"
|
|
177
|
-
].join(" "),
|
|
178
|
-
function
|
|
178
|
+
].join(" "), vr = [3, 2, 3];
|
|
179
|
+
function Rt(o) {
|
|
179
180
|
return o ? /<img\b/i.test(o) ? !0 : o.replace(/<[^>]*>/g, "").replace(/ /gi, " ").trim().length > 0 : !1;
|
|
180
181
|
}
|
|
181
|
-
function
|
|
182
|
-
const v = o == null ? void 0 : o.toggle(f,
|
|
183
|
-
return w === void 0 ? v == null ? void 0 : v.result :
|
|
182
|
+
function kt(o, f, b) {
|
|
183
|
+
const v = o == null ? void 0 : o.toggle(f, b), w = v ? v.refusal : "the panel is not mounted";
|
|
184
|
+
return w === void 0 ? v == null ? void 0 : v.result : Vt(new Error(`NotesPanel: ${b} refused (${w}).`));
|
|
184
185
|
}
|
|
185
|
-
const
|
|
186
|
-
function
|
|
186
|
+
const Nt = /* @__PURE__ */ new Map(), At = /* @__PURE__ */ new Set();
|
|
187
|
+
function Pe(o) {
|
|
187
188
|
return o.map(
|
|
188
189
|
(f) => `${f.id ?? ""}:${f.pinned ? 1 : 0}${f.flagged ? 1 : 0}${f.deleted ? 1 : 0}`
|
|
189
190
|
).join("|");
|
|
190
191
|
}
|
|
191
|
-
function
|
|
192
|
+
function Ft(o) {
|
|
192
193
|
return typeof (o == null ? void 0 : o.then) == "function";
|
|
193
194
|
}
|
|
194
|
-
function
|
|
195
|
-
const v = o.indexOf(
|
|
195
|
+
function Ot(o, f, b) {
|
|
196
|
+
const v = o.indexOf(b);
|
|
196
197
|
if (v >= 0) return v;
|
|
197
|
-
const w = f.indexOf(
|
|
198
|
+
const w = f.indexOf(b);
|
|
198
199
|
if (w < 0) return -1;
|
|
199
200
|
const se = new Set(o);
|
|
200
201
|
return f.slice(0, w).filter((C) => se.has(C)).length;
|
|
201
202
|
}
|
|
202
|
-
function
|
|
203
|
+
function wr(o) {
|
|
203
204
|
if (o.hasAttribute("tabindex")) {
|
|
204
205
|
o.focus();
|
|
205
206
|
return;
|
|
@@ -207,132 +208,135 @@ function fr(o) {
|
|
|
207
208
|
const f = () => o.removeAttribute("tabindex");
|
|
208
209
|
o.setAttribute("tabindex", "-1"), o.focus(), document.activeElement === o ? o.addEventListener("blur", f, { once: !0 }) : f();
|
|
209
210
|
}
|
|
210
|
-
const
|
|
211
|
+
const Ur = Bn(
|
|
211
212
|
function({
|
|
212
213
|
id: f,
|
|
213
|
-
notes:
|
|
214
|
+
notes: b,
|
|
214
215
|
onAddNote: v,
|
|
215
216
|
status: w = "ready",
|
|
216
217
|
onRetry: se,
|
|
217
218
|
currentNoteId: C,
|
|
218
|
-
currentNoteKey:
|
|
219
|
+
currentNoteKey: We,
|
|
219
220
|
composer: F = "rich",
|
|
220
|
-
editorToolbar:
|
|
221
|
-
redactor:
|
|
222
|
-
imageUploadUrl:
|
|
223
|
-
|
|
221
|
+
editorToolbar: qt = "standard",
|
|
222
|
+
redactor: Dt,
|
|
223
|
+
imageUploadUrl: _t,
|
|
224
|
+
editorPlugins: Mt,
|
|
225
|
+
showClinicalToggle: zt = !0,
|
|
224
226
|
canAddClinicalNote: ae = !0,
|
|
225
|
-
clinicalGatedReason:
|
|
227
|
+
clinicalGatedReason: Ht,
|
|
226
228
|
defaultClinical: $ = !1,
|
|
227
|
-
onRequestAiDraft:
|
|
228
|
-
aiDraftFormat:
|
|
229
|
-
aiPrivacyNotice:
|
|
230
|
-
onDictate:
|
|
231
|
-
onProofread:
|
|
232
|
-
onAutoFormat:
|
|
233
|
-
aiConsent:
|
|
234
|
-
variables:
|
|
235
|
-
validateVariable:
|
|
236
|
-
onVariableValidityChange:
|
|
237
|
-
renderHelpMeWrite:
|
|
238
|
-
aiTemplates:
|
|
239
|
-
onAiApplied:
|
|
240
|
-
onUploadImage:
|
|
241
|
-
onAiCreditsExhausted:
|
|
242
|
-
showExtensions:
|
|
243
|
-
aiCreditsNotice:
|
|
244
|
-
extensions:
|
|
245
|
-
extensionContext:
|
|
246
|
-
onExtensionRun:
|
|
247
|
-
composerBefore:
|
|
248
|
-
composerAfter:
|
|
249
|
-
onTogglePin:
|
|
250
|
-
onToggleFlag:
|
|
251
|
-
noteActions:
|
|
229
|
+
onRequestAiDraft: Wt,
|
|
230
|
+
aiDraftFormat: $t,
|
|
231
|
+
aiPrivacyNotice: Bt,
|
|
232
|
+
onDictate: Kt,
|
|
233
|
+
onProofread: Ut,
|
|
234
|
+
onAutoFormat: It,
|
|
235
|
+
aiConsent: Yt,
|
|
236
|
+
variables: Gt,
|
|
237
|
+
validateVariable: Jt,
|
|
238
|
+
onVariableValidityChange: Qt,
|
|
239
|
+
renderHelpMeWrite: Xt,
|
|
240
|
+
aiTemplates: Zt,
|
|
241
|
+
onAiApplied: en,
|
|
242
|
+
onUploadImage: tn,
|
|
243
|
+
onAiCreditsExhausted: nn,
|
|
244
|
+
showExtensions: rn,
|
|
245
|
+
aiCreditsNotice: sn,
|
|
246
|
+
extensions: an,
|
|
247
|
+
extensionContext: ln,
|
|
248
|
+
onExtensionRun: on,
|
|
249
|
+
composerBefore: dn,
|
|
250
|
+
composerAfter: cn,
|
|
251
|
+
onTogglePin: $e,
|
|
252
|
+
onToggleFlag: Be,
|
|
253
|
+
noteActions: Ke,
|
|
252
254
|
onEditNote: B,
|
|
253
|
-
editClinical:
|
|
255
|
+
editClinical: un = !1,
|
|
254
256
|
onDeleteNote: K,
|
|
255
|
-
onWriteError:
|
|
256
|
-
confirmDelete:
|
|
257
|
-
title:
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
const
|
|
269
|
-
|
|
270
|
-
const
|
|
271
|
-
|
|
272
|
-
const
|
|
257
|
+
onWriteError: Ue,
|
|
258
|
+
confirmDelete: Ie = !0,
|
|
259
|
+
title: fn,
|
|
260
|
+
patientName: xe,
|
|
261
|
+
patientAvatarSrc: gn,
|
|
262
|
+
composerPlaceholder: hn,
|
|
263
|
+
addNoteLabel: pn,
|
|
264
|
+
emptyState: mn,
|
|
265
|
+
className: vn,
|
|
266
|
+
"aria-label": Te,
|
|
267
|
+
...wn
|
|
268
|
+
}, yn) {
|
|
269
|
+
var bt;
|
|
270
|
+
const { t: l, i18n: Ye } = Un("ui"), Se = In(), q = u(null), [_, U] = T(""), [ie, le] = T($), [P, Ge] = T(!1), [I, oe] = T(null), [g, Ce] = T(null), Je = u(g);
|
|
271
|
+
Je.current = g;
|
|
272
|
+
const Qe = u(!1);
|
|
273
|
+
w === "loading" && (Qe.current = !0);
|
|
274
|
+
const bn = Qe.current ? tr : "", Pn = fn ?? l("notesPanel.title", { defaultValue: "Notes" }), Xe = Pt(), Ze = Pt(), de = (xe == null ? void 0 : xe.trim()) || void 0, et = hn ?? l("notesPanel.placeholder", { defaultValue: "Add a note…" }), tt = g !== null ? l("notesPanel.edit", { defaultValue: "Edit note" }) : l("notesPanel.composerLabel", { defaultValue: "New note" }), xn = F === "rich" ? Rt(_) : _.trim().length > 0, E = u(b);
|
|
275
|
+
E.current = b;
|
|
276
|
+
const [Y, Tn] = T(Nt), R = u(Nt), [Sn, Cn] = T(At), G = u(At), O = u(!0);
|
|
273
277
|
S(() => (O.current = !0, () => {
|
|
274
278
|
O.current = !1;
|
|
275
279
|
}), []);
|
|
276
|
-
const j = u(null), D = u(
|
|
277
|
-
D.current =
|
|
278
|
-
const
|
|
280
|
+
const j = u(null), D = u(Ue);
|
|
281
|
+
D.current = Ue;
|
|
282
|
+
const Ee = W(() => {
|
|
279
283
|
const e = j.current;
|
|
280
284
|
return !O.current || !e || e.closest('[hidden],[inert],[aria-hidden="true"]') ? !1 : typeof e.checkVisibility == "function" ? e.checkVisibility() : !0;
|
|
281
|
-
}, []), J = u([]), [
|
|
285
|
+
}, []), J = u([]), [En, Rn] = T(0), Re = W((e) => {
|
|
282
286
|
if (!O.current) {
|
|
283
287
|
e(!1);
|
|
284
288
|
return;
|
|
285
289
|
}
|
|
286
|
-
J.current.push(e),
|
|
290
|
+
J.current.push(e), Rn((t) => t + 1);
|
|
287
291
|
}, []);
|
|
288
292
|
S(() => {
|
|
289
293
|
const e = J.current;
|
|
290
294
|
J.current = [], e.forEach((t) => t(!0));
|
|
291
|
-
}, [
|
|
295
|
+
}, [En]), S(
|
|
292
296
|
() => () => {
|
|
293
297
|
const e = J.current;
|
|
294
298
|
J.current = [], e.forEach((t) => t(!1));
|
|
295
299
|
},
|
|
296
300
|
[]
|
|
297
301
|
);
|
|
298
|
-
const
|
|
302
|
+
const nt = (e) => {
|
|
299
303
|
const t = new Map(R.current);
|
|
300
|
-
e(t), R.current = t,
|
|
301
|
-
},
|
|
304
|
+
e(t), R.current = t, Tn(t);
|
|
305
|
+
}, ke = (e) => {
|
|
302
306
|
const t = new Set(G.current);
|
|
303
|
-
e(t), G.current = t,
|
|
304
|
-
},
|
|
307
|
+
e(t), G.current = t, Cn(t);
|
|
308
|
+
}, ce = (e, t) => {
|
|
305
309
|
var n;
|
|
306
310
|
return (n = R.current.get(e)) == null ? void 0 : n[t];
|
|
307
|
-
}, Q = (e, t, n) =>
|
|
311
|
+
}, Q = (e, t, n) => nt((i) => {
|
|
308
312
|
const s = { ...i.get(e) };
|
|
309
313
|
n ? s[t] = n : delete s[t], Object.keys(s).length > 0 ? i.set(e, s) : i.delete(e);
|
|
310
|
-
}),
|
|
314
|
+
}), rt = (e) => {
|
|
311
315
|
var t;
|
|
312
316
|
return e != null && !!((t = R.current.get(e)) != null && t.delete);
|
|
313
|
-
},
|
|
317
|
+
}, kn = W(() => {
|
|
314
318
|
var h;
|
|
315
319
|
if (!(g !== null ? B : v) || P) return;
|
|
316
320
|
const t = F === "rich", n = t ? ((h = q.current) == null ? void 0 : h.getHTML()) ?? _ : _.trim();
|
|
317
|
-
if (t ? !
|
|
321
|
+
if (t ? !Rt(n) : !n) return;
|
|
318
322
|
const i = () => {
|
|
319
323
|
var c;
|
|
320
|
-
t && ((c = q.current) == null || c.clear()), U(""), le($),
|
|
324
|
+
t && ((c = q.current) == null || c.clear()), U(""), le($), Ce(null);
|
|
321
325
|
};
|
|
322
326
|
oe(null);
|
|
323
|
-
const s = g, r = (c) =>
|
|
327
|
+
const s = g, r = (c) => Re((m) => {
|
|
324
328
|
var k;
|
|
325
|
-
const x = m && (s === null ||
|
|
329
|
+
const x = m && (s === null || Je.current === s && E.current.some((ne) => ne.id === s && !ne.deleted));
|
|
326
330
|
x && oe(
|
|
327
|
-
|
|
328
|
-
text:
|
|
331
|
+
He(c) ? { text: Se, unknown: !0 } : {
|
|
332
|
+
text: Tt(c, l("notesPanel.addFailed")),
|
|
329
333
|
unknown: !1
|
|
330
334
|
}
|
|
331
335
|
), (k = D.current) == null || k.call(D, {
|
|
332
336
|
kind: s !== null ? "edit" : "add",
|
|
333
337
|
noteId: s ?? void 0,
|
|
334
338
|
error: c,
|
|
335
|
-
shown: x &&
|
|
339
|
+
shown: x && Ee()
|
|
336
340
|
});
|
|
337
341
|
});
|
|
338
342
|
let d;
|
|
@@ -343,24 +347,24 @@ const Mr = _n(
|
|
|
343
347
|
return;
|
|
344
348
|
}
|
|
345
349
|
if (!d || typeof d.then != "function") return i();
|
|
346
|
-
|
|
350
|
+
Ge(!0), Promise.resolve(d).then(i, r).finally(() => Ge(!1));
|
|
347
351
|
}, [
|
|
348
352
|
F,
|
|
349
353
|
_,
|
|
350
354
|
ie,
|
|
351
355
|
$,
|
|
352
356
|
g,
|
|
353
|
-
|
|
357
|
+
Re,
|
|
354
358
|
v,
|
|
355
359
|
B,
|
|
356
|
-
|
|
360
|
+
Ee,
|
|
357
361
|
P,
|
|
358
|
-
|
|
362
|
+
Se,
|
|
359
363
|
l
|
|
360
|
-
]),
|
|
364
|
+
]), st = zt && (g === null || un), Nn = g !== null && !!((bt = Y.get(g)) != null && bt.delete), ue = W(
|
|
361
365
|
(e) => {
|
|
362
366
|
try {
|
|
363
|
-
return new Intl.DateTimeFormat(
|
|
367
|
+
return new Intl.DateTimeFormat(Ye.language, {
|
|
364
368
|
day: "numeric",
|
|
365
369
|
month: "long",
|
|
366
370
|
year: "numeric",
|
|
@@ -371,57 +375,57 @@ const Mr = _n(
|
|
|
371
375
|
return e.dateIso;
|
|
372
376
|
}
|
|
373
377
|
},
|
|
374
|
-
[
|
|
375
|
-
),
|
|
378
|
+
[Ye.language]
|
|
379
|
+
), An = W(
|
|
376
380
|
(e) => {
|
|
377
381
|
var n, i, s, r;
|
|
378
382
|
if (!e.id || P || (n = R.current.get(e.id)) != null && n.delete) return;
|
|
379
383
|
const t = e.content ?? "";
|
|
380
|
-
oe(null),
|
|
384
|
+
oe(null), Ce(e.id), le(e.clinical ?? !1), U(t), F === "rich" && ((i = q.current) == null || i.clear(), (s = q.current) == null || s.insertAtCursor(t, { asHtml: !0 })), (r = q.current) == null || r.focus();
|
|
381
385
|
},
|
|
382
386
|
[F, P]
|
|
383
|
-
),
|
|
387
|
+
), fe = W(() => {
|
|
384
388
|
var e;
|
|
385
|
-
F === "rich" && ((e = q.current) == null || e.clear()), U(""), le($), oe(null),
|
|
386
|
-
}, [F, $]),
|
|
389
|
+
F === "rich" && ((e = q.current) == null || e.clear()), U(""), le($), oe(null), Ce(null);
|
|
390
|
+
}, [F, $]), at = g === null || b.some((e) => e.id === g && !e.deleted);
|
|
387
391
|
S(() => {
|
|
388
|
-
|
|
389
|
-
}, [
|
|
390
|
-
const
|
|
392
|
+
at || fe();
|
|
393
|
+
}, [at, fe]);
|
|
394
|
+
const Ne = (e) => {
|
|
391
395
|
var t, n;
|
|
392
396
|
return (e.id ? (n = (t = Y.get(e.id)) == null ? void 0 : t.pin) == null ? void 0 : n.next : void 0) ?? !!e.pinned;
|
|
393
|
-
},
|
|
397
|
+
}, Fn = (e) => {
|
|
394
398
|
var t, n;
|
|
395
399
|
return (e.id ? (n = (t = Y.get(e.id)) == null ? void 0 : t.flag) == null ? void 0 : n.next : void 0) ?? !!e.flagged;
|
|
396
|
-
}, M =
|
|
397
|
-
z.current =
|
|
400
|
+
}, M = b.filter((e) => !e.id || !Sn.has(e.id)).sort((e, t) => Number(Ne(t)) - Number(Ne(e))), it = M.flatMap((e) => e.id ? [e.id] : []), z = u([]);
|
|
401
|
+
z.current = it.filter(
|
|
398
402
|
(e) => {
|
|
399
403
|
var t;
|
|
400
404
|
return !((t = Y.get(e)) != null && t.delete);
|
|
401
405
|
}
|
|
402
406
|
);
|
|
403
|
-
const
|
|
404
|
-
|
|
405
|
-
const { isAccessible:
|
|
407
|
+
const Ae = u([]);
|
|
408
|
+
Ae.current = it;
|
|
409
|
+
const { isAccessible: On } = lr(j), lt = On || void 0, { containerRef: jn } = rr({
|
|
406
410
|
key: M.map((e) => e.id).join(),
|
|
407
|
-
reduceMotion:
|
|
408
|
-
}),
|
|
409
|
-
|
|
410
|
-
},
|
|
411
|
-
const s =
|
|
412
|
-
|
|
411
|
+
reduceMotion: lt
|
|
412
|
+
}), ge = sr({ reduceMotion: lt }), [p, he] = T(null), ot = u(0), Fe = u(0), dt = () => {
|
|
413
|
+
Fe.current += 1, he(null);
|
|
414
|
+
}, pe = (e, t, n, i = !0) => {
|
|
415
|
+
const s = Fe.current;
|
|
416
|
+
Re((r) => {
|
|
413
417
|
var h;
|
|
414
|
-
const d = r && i && s ===
|
|
415
|
-
d && (
|
|
418
|
+
const d = r && i && s === Fe.current && Ee() && E.current.some((c) => c.id === t) && (e === "delete" || !rt(t) && !G.current.has(t));
|
|
419
|
+
d && (ot.current += 1, he({
|
|
416
420
|
kind: e,
|
|
417
421
|
noteId: t,
|
|
418
|
-
message:
|
|
419
|
-
unknown:
|
|
420
|
-
seq:
|
|
422
|
+
message: Tt(n, ""),
|
|
423
|
+
unknown: He(n),
|
|
424
|
+
seq: ot.current
|
|
421
425
|
})), (h = D.current) == null || h.call(D, { kind: e, noteId: t, error: n, shown: d });
|
|
422
426
|
});
|
|
423
|
-
},
|
|
424
|
-
const t =
|
|
427
|
+
}, Vn = (e) => {
|
|
428
|
+
const t = b.find((i) => i.id === e.noteId), n = t != null && t.dateIso ? ue(t) : "";
|
|
425
429
|
if (n)
|
|
426
430
|
switch (e.kind) {
|
|
427
431
|
case "delete":
|
|
@@ -447,23 +451,23 @@ const Mr = _n(
|
|
|
447
451
|
default:
|
|
448
452
|
return l("notesPanel.unflagFailed");
|
|
449
453
|
}
|
|
450
|
-
},
|
|
451
|
-
p &&
|
|
452
|
-
p && !
|
|
453
|
-
}, [p,
|
|
454
|
-
const [
|
|
455
|
-
|
|
456
|
-
() =>
|
|
454
|
+
}, me = p !== null && b.some((e) => e.id === p.noteId), ct = u(null);
|
|
455
|
+
p && me && (ct.current = p), S(() => {
|
|
456
|
+
p && !me && he(null);
|
|
457
|
+
}, [p, me]);
|
|
458
|
+
const [Oe, ut] = T({ text: "", seq: 0 }), je = u(void 0), ft = (e) => {
|
|
459
|
+
ut((t) => ({ text: e, seq: t.seq + 1 })), window.clearTimeout(je.current), je.current = window.setTimeout(
|
|
460
|
+
() => ut((t) => ({ ...t, text: "" })),
|
|
457
461
|
1e3
|
|
458
462
|
);
|
|
459
463
|
};
|
|
460
|
-
S(() => () => window.clearTimeout(
|
|
461
|
-
const
|
|
464
|
+
S(() => () => window.clearTimeout(je.current), []);
|
|
465
|
+
const gt = () => ft(l("notesPanel.deleted")), ve = u(0), ht = u(w);
|
|
462
466
|
S(() => {
|
|
463
|
-
|
|
467
|
+
ht.current === "loading" && w === "ready" && (ve.current += 1), ht.current = w;
|
|
464
468
|
}, [w]);
|
|
465
|
-
const
|
|
466
|
-
const e = E.current, t =
|
|
469
|
+
const pt = () => {
|
|
470
|
+
const e = E.current, t = Pe(e), n = new Map(e.map((r) => [r.id, r])), i = [];
|
|
467
471
|
if (R.current.forEach((r, d) => {
|
|
468
472
|
const h = n.get(d);
|
|
469
473
|
Object.keys(r).forEach((c) => {
|
|
@@ -474,30 +478,30 @@ const Mr = _n(
|
|
|
474
478
|
return;
|
|
475
479
|
}
|
|
476
480
|
if (!m.settled) return;
|
|
477
|
-
const x = c === "delete" ? h.deleted === !0 : (c === "pin" ? !!h.pinned : !!h.flagged) === m.next, k =
|
|
481
|
+
const x = c === "delete" ? h.deleted === !0 : (c === "pin" ? !!h.pinned : !!h.flagged) === m.next, k = ve.current > m.edgeAtSettle || c !== "delete" && t !== m.sigAtSettle;
|
|
478
482
|
(x || k) && i.push([d, c]);
|
|
479
483
|
});
|
|
480
484
|
}), i.length === 0) return;
|
|
481
|
-
|
|
485
|
+
nt(
|
|
482
486
|
(r) => i.forEach(([d, h]) => {
|
|
483
487
|
const c = { ...r.get(d) };
|
|
484
488
|
delete c[h], Object.keys(c).length > 0 ? r.set(d, c) : r.delete(d);
|
|
485
489
|
})
|
|
486
490
|
);
|
|
487
491
|
const s = i.filter(([, r]) => r === "delete").map(([r]) => r);
|
|
488
|
-
s.some((r) => G.current.has(r)) &&
|
|
489
|
-
},
|
|
492
|
+
s.some((r) => G.current.has(r)) && ke((r) => s.forEach((d) => r.delete(d))), s.forEach((r) => ge.cancel(r));
|
|
493
|
+
}, Ve = (e, t, n) => ce(e, t) !== n ? !1 : (Q(e, t, {
|
|
490
494
|
...n,
|
|
491
495
|
settled: !0,
|
|
492
|
-
edgeAtSettle:
|
|
493
|
-
sigAtSettle:
|
|
494
|
-
}),
|
|
496
|
+
edgeAtSettle: ve.current,
|
|
497
|
+
sigAtSettle: Pe(E.current)
|
|
498
|
+
}), pt(), !0), mt = (e, t, n) => ce(e, t) !== n ? !1 : (Q(e, t, void 0), t !== "delete" || (G.current.has(e) && ke((i) => i.delete(e)), ge.cancel(e)), !0), Ln = xt(() => Pe(b), [b]);
|
|
495
499
|
S(() => {
|
|
496
|
-
|
|
497
|
-
}, [
|
|
498
|
-
const
|
|
500
|
+
pt();
|
|
501
|
+
}, [Ln, w]);
|
|
502
|
+
const Le = (e, t) => {
|
|
499
503
|
var k, ne;
|
|
500
|
-
const n = t === "pin" ?
|
|
504
|
+
const n = t === "pin" ? $e : Be, i = (N) => ({
|
|
501
505
|
started: !1,
|
|
502
506
|
refusal: N
|
|
503
507
|
});
|
|
@@ -515,14 +519,14 @@ const Mr = _n(
|
|
|
515
519
|
if (r != null && r[t])
|
|
516
520
|
return i(`a ${t} write for this note is still pending`);
|
|
517
521
|
const d = !(t === "pin" ? s.pinned : s.flagged), h = t === "pin" ? d ? "pin" : "unpin" : d ? "flag" : "unflag";
|
|
518
|
-
|
|
522
|
+
dt();
|
|
519
523
|
let c;
|
|
520
524
|
try {
|
|
521
525
|
c = n(e, d);
|
|
522
526
|
} catch (N) {
|
|
523
|
-
return
|
|
527
|
+
return pe(h, e, N), { started: !1, result: Vt(N) };
|
|
524
528
|
}
|
|
525
|
-
if (!
|
|
529
|
+
if (!Ft(c)) return { started: !0, result: c };
|
|
526
530
|
const m = {
|
|
527
531
|
next: d,
|
|
528
532
|
settled: !1,
|
|
@@ -533,95 +537,95 @@ const Mr = _n(
|
|
|
533
537
|
const x = Promise.resolve(c);
|
|
534
538
|
return x.then(
|
|
535
539
|
() => {
|
|
536
|
-
O.current &&
|
|
540
|
+
O.current && Ve(e, t, m);
|
|
537
541
|
},
|
|
538
542
|
(N) => {
|
|
539
|
-
const
|
|
540
|
-
|
|
543
|
+
const Wn = O.current && (He(N) ? Ve(e, t, m) : mt(e, t, m));
|
|
544
|
+
pe(h, e, N, Wn);
|
|
541
545
|
}
|
|
542
546
|
), { started: !0, result: x };
|
|
543
|
-
},
|
|
547
|
+
}, vt = (e) => {
|
|
544
548
|
var i;
|
|
545
549
|
if (!K) return !1;
|
|
546
550
|
const t = E.current.find((s) => s.id === e);
|
|
547
|
-
if (!t || t.deleted || ((i = t.actions) == null ? void 0 : i.delete) === !1 ||
|
|
548
|
-
|
|
551
|
+
if (!t || t.deleted || ((i = t.actions) == null ? void 0 : i.delete) === !1 || ce(e, "delete")) return !1;
|
|
552
|
+
dt();
|
|
549
553
|
let n;
|
|
550
554
|
try {
|
|
551
555
|
n = K(e);
|
|
552
556
|
} catch (s) {
|
|
553
|
-
return
|
|
557
|
+
return pe("delete", e, s), !1;
|
|
554
558
|
}
|
|
555
|
-
if (
|
|
559
|
+
if (Ft(n)) {
|
|
556
560
|
const s = {
|
|
557
561
|
settled: !1,
|
|
558
562
|
edgeAtSettle: 0,
|
|
559
563
|
sigAtSettle: ""
|
|
560
564
|
};
|
|
561
|
-
Q(e, "delete", s), t.keptOnDelete &&
|
|
562
|
-
t.dateIso ? l("notesPanel.deletingNamed", { date:
|
|
565
|
+
Q(e, "delete", s), t.keptOnDelete && ft(
|
|
566
|
+
t.dateIso ? l("notesPanel.deletingNamed", { date: ue(t) }) : l("notesPanel.deleting")
|
|
563
567
|
), Promise.resolve(n).then(
|
|
564
568
|
() => {
|
|
565
|
-
O.current && (
|
|
569
|
+
O.current && (gt(), Ve(e, "delete", s));
|
|
566
570
|
},
|
|
567
571
|
(r) => {
|
|
568
|
-
const d = O.current &&
|
|
569
|
-
|
|
572
|
+
const d = O.current && mt(e, "delete", s);
|
|
573
|
+
pe("delete", e, r, d);
|
|
570
574
|
}
|
|
571
575
|
);
|
|
572
576
|
} else
|
|
573
577
|
Q(e, "delete", {
|
|
574
578
|
settled: !0,
|
|
575
|
-
edgeAtSettle:
|
|
576
|
-
sigAtSettle:
|
|
577
|
-
}),
|
|
578
|
-
return t.keptOnDelete ||
|
|
579
|
-
|
|
579
|
+
edgeAtSettle: ve.current,
|
|
580
|
+
sigAtSettle: Pe(E.current)
|
|
581
|
+
}), gt();
|
|
582
|
+
return t.keptOnDelete || ge.leave(e, () => {
|
|
583
|
+
ce(e, "delete") && ke((s) => s.add(e));
|
|
580
584
|
}), !0;
|
|
581
|
-
}, [X, Z] = T(null),
|
|
582
|
-
if (!(!K ||
|
|
583
|
-
if (!
|
|
584
|
-
|
|
585
|
+
}, [X, Z] = T(null), we = u(null), qn = (e) => {
|
|
586
|
+
if (!(!K || rt(e)) && !(P && g === e)) {
|
|
587
|
+
if (!Ie) {
|
|
588
|
+
vt(e);
|
|
585
589
|
return;
|
|
586
590
|
}
|
|
587
|
-
|
|
591
|
+
we.current = { noteId: e, index: -1, started: !1 }, Z(e);
|
|
588
592
|
}
|
|
589
|
-
},
|
|
593
|
+
}, Dn = () => {
|
|
590
594
|
const e = X;
|
|
591
595
|
if (!e) return;
|
|
592
596
|
const t = z.current.indexOf(e);
|
|
593
|
-
|
|
594
|
-
},
|
|
597
|
+
vt(e) && (we.current = { noteId: e, index: t, started: !0 }), Z(null);
|
|
598
|
+
}, qe = X !== null && b.some((e) => e.id === X && !e.deleted);
|
|
595
599
|
S(() => {
|
|
596
|
-
X !== null && !
|
|
597
|
-
}, [X,
|
|
600
|
+
X !== null && !qe && Z(null);
|
|
601
|
+
}, [X, qe]), Kn(yn, () => j.current, []);
|
|
598
602
|
const V = (e, t) => {
|
|
599
603
|
var n;
|
|
600
604
|
return e ? ((n = j.current) == null ? void 0 : n.querySelector(
|
|
601
605
|
`[data-note-id="${CSS.escape(e)}"] ${t ? `[data-note-action="${CSS.escape(t)}"]` : "[data-note-action]"}`
|
|
602
606
|
)) ?? null : null;
|
|
603
|
-
},
|
|
607
|
+
}, ye = (e, t) => {
|
|
604
608
|
const n = z.current;
|
|
605
609
|
return V(n[e], t) ?? V(n[e - 1], t) ?? V(n[e], null) ?? V(n[e - 1], null);
|
|
606
|
-
},
|
|
610
|
+
}, _n = () => {
|
|
607
611
|
const e = j.current, t = (e == null ? void 0 : e.querySelector("[data-notes-panel-empty]")) ?? e;
|
|
608
|
-
t &&
|
|
612
|
+
t && wr(t);
|
|
609
613
|
}, ee = (e) => {
|
|
610
|
-
e ? e.focus() :
|
|
611
|
-
},
|
|
612
|
-
const t =
|
|
613
|
-
if (
|
|
614
|
+
e ? e.focus() : _n();
|
|
615
|
+
}, Mn = (e) => {
|
|
616
|
+
const t = we.current;
|
|
617
|
+
if (we.current = null, !t || e.defaultPrevented) return;
|
|
614
618
|
e.preventDefault();
|
|
615
619
|
const n = V(t.noteId, "delete");
|
|
616
620
|
ee(
|
|
617
|
-
t.started ?
|
|
621
|
+
t.started ? ye(t.index, "delete") ?? n : n
|
|
618
622
|
);
|
|
619
|
-
},
|
|
623
|
+
}, De = u(null), wt = (e) => {
|
|
620
624
|
const t = e.kind === "delete" ? "delete" : e.kind.endsWith("pin") ? "pin" : "flag", n = z.current.indexOf(e.noteId);
|
|
621
|
-
return V(e.noteId, t) ?? V(e.noteId, null) ?? (n >= 0 ?
|
|
622
|
-
},
|
|
625
|
+
return V(e.noteId, t) ?? V(e.noteId, null) ?? (n >= 0 ? ye(n, t) : null);
|
|
626
|
+
}, zn = (e) => {
|
|
623
627
|
var t;
|
|
624
|
-
(t =
|
|
628
|
+
(t = De.current) != null && t.contains(document.activeElement) && ee(wt(e)), he(null);
|
|
625
629
|
}, H = u(null);
|
|
626
630
|
S(() => {
|
|
627
631
|
const e = j.current;
|
|
@@ -635,7 +639,7 @@ const Mr = _n(
|
|
|
635
639
|
el: s,
|
|
636
640
|
noteId: r,
|
|
637
641
|
action: ((h = s.closest("[data-note-action]")) == null ? void 0 : h.dataset.noteAction) ?? null,
|
|
638
|
-
index: r ?
|
|
642
|
+
index: r ? Ot(z.current, Ae.current, r) : -1,
|
|
639
643
|
inWriteError: !!s.closest("[data-notes-panel-write-error]")
|
|
640
644
|
};
|
|
641
645
|
}, n = (i) => {
|
|
@@ -653,14 +657,14 @@ const Mr = _n(
|
|
|
653
657
|
return e.addEventListener("focusin", t), e.addEventListener("focusout", n), () => {
|
|
654
658
|
e.removeEventListener("focusin", t), e.removeEventListener("focusout", n);
|
|
655
659
|
};
|
|
656
|
-
}, []),
|
|
660
|
+
}, []), ir(() => {
|
|
657
661
|
var i;
|
|
658
662
|
const e = H.current;
|
|
659
663
|
if (!e || !j.current) return;
|
|
660
664
|
if (e.el.isConnected) {
|
|
661
|
-
const s = e.noteId ?
|
|
665
|
+
const s = e.noteId ? Ot(
|
|
662
666
|
z.current,
|
|
663
|
-
|
|
667
|
+
Ae.current,
|
|
664
668
|
e.noteId
|
|
665
669
|
) : -1;
|
|
666
670
|
s >= 0 && (e.index = s);
|
|
@@ -672,30 +676,30 @@ const Mr = _n(
|
|
|
672
676
|
const n = e.action ? V(e.noteId, e.action) : null;
|
|
673
677
|
if (n) n.focus();
|
|
674
678
|
else if (e.noteId)
|
|
675
|
-
ee(
|
|
679
|
+
ee(ye(e.index, e.action));
|
|
676
680
|
else if (e.el.hasAttribute("data-notes-panel-empty"))
|
|
677
|
-
ee(
|
|
681
|
+
ee(ye(0, "delete"));
|
|
678
682
|
else if (e.inWriteError) {
|
|
679
|
-
const s = (i =
|
|
683
|
+
const s = (i = De.current) == null ? void 0 : i.querySelector(
|
|
680
684
|
"[data-alert-dismiss]"
|
|
681
|
-
), r =
|
|
682
|
-
s ? s.focus() : ee(r ?
|
|
685
|
+
), r = ct.current;
|
|
686
|
+
s ? s.focus() : ee(r ? wt(r) : null);
|
|
683
687
|
}
|
|
684
688
|
});
|
|
685
|
-
const
|
|
689
|
+
const _e = u(null);
|
|
686
690
|
S(() => {
|
|
687
691
|
var e, t;
|
|
688
|
-
C && ((e =
|
|
689
|
-
}, [C,
|
|
692
|
+
C && ((e = _e.current) == null || e.scrollIntoView({ block: "center" }), (t = _e.current) == null || t.focus());
|
|
693
|
+
}, [C, We]);
|
|
690
694
|
const te = u(v);
|
|
691
695
|
te.current = v;
|
|
692
|
-
const
|
|
693
|
-
|
|
694
|
-
const
|
|
695
|
-
|
|
696
|
-
const
|
|
697
|
-
|
|
698
|
-
const
|
|
696
|
+
const Me = u(ae);
|
|
697
|
+
Me.current = ae;
|
|
698
|
+
const yt = u(C);
|
|
699
|
+
yt.current = C;
|
|
700
|
+
const ze = u(null);
|
|
701
|
+
ze.current = { toggle: Le };
|
|
702
|
+
const Hn = xt(
|
|
699
703
|
() => ({
|
|
700
704
|
// Ids + flags only — never the note body or author (both PHI).
|
|
701
705
|
getNotes: () => E.current.filter((e) => {
|
|
@@ -713,107 +717,136 @@ const Mr = _n(
|
|
|
713
717
|
};
|
|
714
718
|
}),
|
|
715
719
|
canAddNote: () => !!te.current,
|
|
716
|
-
canAddClinical: () =>
|
|
717
|
-
getCurrentNoteId: () =>
|
|
720
|
+
canAddClinical: () => Me.current,
|
|
721
|
+
getCurrentNoteId: () => yt.current ?? null,
|
|
718
722
|
addNote: (e) => {
|
|
719
723
|
var t;
|
|
720
|
-
if (!(e.clinical && !
|
|
724
|
+
if (!(e.clinical && !Me.current))
|
|
721
725
|
return (t = te.current) == null ? void 0 : t.call(te, e);
|
|
722
726
|
},
|
|
723
|
-
togglePin: (e) =>
|
|
724
|
-
toggleFlag: (e) =>
|
|
727
|
+
togglePin: (e) => kt(ze.current, e, "pin"),
|
|
728
|
+
toggleFlag: (e) => kt(ze.current, e, "flag")
|
|
725
729
|
}),
|
|
726
730
|
[]
|
|
727
731
|
);
|
|
728
|
-
return
|
|
732
|
+
return Yn(ur, Hn, f), /* @__PURE__ */ y(
|
|
729
733
|
"section",
|
|
730
734
|
{
|
|
731
735
|
ref: j,
|
|
732
736
|
"data-component": "notes-panel",
|
|
733
737
|
"data-component-id": f,
|
|
734
|
-
"aria-labelledby":
|
|
735
|
-
"aria-label":
|
|
736
|
-
|
|
737
|
-
|
|
738
|
+
"aria-labelledby": Te ? void 0 : Xe,
|
|
739
|
+
"aria-label": Te,
|
|
740
|
+
"aria-describedby": de ? Ze : void 0,
|
|
741
|
+
className: [hr, vn].filter(Boolean).join(" "),
|
|
742
|
+
...wn,
|
|
738
743
|
children: [
|
|
739
744
|
/* @__PURE__ */ a(
|
|
740
|
-
|
|
745
|
+
nr,
|
|
741
746
|
{
|
|
742
|
-
title:
|
|
743
|
-
icon: /* @__PURE__ */ a(
|
|
744
|
-
headingId:
|
|
747
|
+
title: Pn,
|
|
748
|
+
icon: /* @__PURE__ */ a(or, { "aria-hidden": "true" }),
|
|
749
|
+
headingId: Te ? void 0 : Xe,
|
|
750
|
+
subtitle: de ? (
|
|
751
|
+
/* The kit's one way to show a person: avatar, then name. The
|
|
752
|
+
name is the text; the avatar repeats it, so it is hidden
|
|
753
|
+
from assistive technology. */
|
|
754
|
+
/* @__PURE__ */ y("span", { className: "ds:inline-flex ds:max-w-full ds:items-center ds:gap-[var(--spacing-xs)]", children: [
|
|
755
|
+
/* @__PURE__ */ a(
|
|
756
|
+
Gn,
|
|
757
|
+
{
|
|
758
|
+
size: "xs",
|
|
759
|
+
name: de,
|
|
760
|
+
src: gn,
|
|
761
|
+
"aria-hidden": "true",
|
|
762
|
+
className: "ds:shrink-0"
|
|
763
|
+
}
|
|
764
|
+
),
|
|
765
|
+
/* @__PURE__ */ a(
|
|
766
|
+
"span",
|
|
767
|
+
{
|
|
768
|
+
"data-slot": "patient-name",
|
|
769
|
+
dir: "auto",
|
|
770
|
+
className: "ds:min-w-0 ds:[overflow-wrap:anywhere]",
|
|
771
|
+
children: de
|
|
772
|
+
}
|
|
773
|
+
)
|
|
774
|
+
] })
|
|
775
|
+
) : void 0,
|
|
776
|
+
subtitleId: Ze,
|
|
745
777
|
sticky: !0,
|
|
746
778
|
divider: !0
|
|
747
779
|
}
|
|
748
780
|
),
|
|
749
|
-
/* @__PURE__ */
|
|
750
|
-
v || g !== null ? /* @__PURE__ */
|
|
781
|
+
/* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:p-[var(--spacing-md)]", children: [
|
|
782
|
+
v || g !== null ? /* @__PURE__ */ y(
|
|
751
783
|
"div",
|
|
752
784
|
{
|
|
753
785
|
"data-notes-panel-composer": g !== null ? "edit" : "add",
|
|
754
786
|
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
|
|
755
787
|
children: [
|
|
756
|
-
|
|
788
|
+
dn,
|
|
757
789
|
F === "rich" ? /* @__PURE__ */ a(
|
|
758
|
-
|
|
790
|
+
Qn,
|
|
759
791
|
{
|
|
760
792
|
ref: q,
|
|
761
|
-
ariaLabel:
|
|
762
|
-
placeholder:
|
|
763
|
-
toolbar:
|
|
793
|
+
ariaLabel: tt,
|
|
794
|
+
placeholder: et,
|
|
795
|
+
toolbar: qt,
|
|
764
796
|
minHeight: "fill",
|
|
765
|
-
redactor:
|
|
766
|
-
imageUploadUrl:
|
|
797
|
+
redactor: Dt,
|
|
798
|
+
imageUploadUrl: _t,
|
|
799
|
+
plugins: Mt,
|
|
767
800
|
readOnly: P,
|
|
768
801
|
onChange: ({ html: e }) => U(e),
|
|
769
|
-
onRequestAiDraft:
|
|
770
|
-
aiDraftFormat:
|
|
771
|
-
aiPrivacyNotice:
|
|
772
|
-
onDictate:
|
|
773
|
-
onProofread:
|
|
774
|
-
onAutoFormat:
|
|
775
|
-
aiConsent:
|
|
776
|
-
variables:
|
|
777
|
-
validateVariable:
|
|
778
|
-
onVariableValidityChange:
|
|
779
|
-
renderHelpMeWrite:
|
|
780
|
-
aiTemplates:
|
|
781
|
-
onAiApplied:
|
|
782
|
-
onUploadImage:
|
|
783
|
-
onAiCreditsExhausted:
|
|
784
|
-
showExtensions:
|
|
785
|
-
aiCreditsNotice:
|
|
786
|
-
extensions:
|
|
787
|
-
extensionContext:
|
|
788
|
-
onExtensionRun:
|
|
802
|
+
onRequestAiDraft: Wt,
|
|
803
|
+
aiDraftFormat: $t,
|
|
804
|
+
aiPrivacyNotice: Bt,
|
|
805
|
+
onDictate: Kt,
|
|
806
|
+
onProofread: Ut,
|
|
807
|
+
onAutoFormat: It,
|
|
808
|
+
aiConsent: Yt,
|
|
809
|
+
variables: Gt,
|
|
810
|
+
validateVariable: Jt,
|
|
811
|
+
onVariableValidityChange: Qt,
|
|
812
|
+
renderHelpMeWrite: Xt,
|
|
813
|
+
aiTemplates: Zt,
|
|
814
|
+
onAiApplied: en,
|
|
815
|
+
onUploadImage: tn,
|
|
816
|
+
onAiCreditsExhausted: nn,
|
|
817
|
+
showExtensions: rn,
|
|
818
|
+
aiCreditsNotice: sn,
|
|
819
|
+
extensions: an,
|
|
820
|
+
extensionContext: ln,
|
|
821
|
+
onExtensionRun: on,
|
|
789
822
|
aiConsentHeadingLevel: 3
|
|
790
823
|
}
|
|
791
824
|
) : /* @__PURE__ */ a(
|
|
792
|
-
|
|
825
|
+
Xn,
|
|
793
826
|
{
|
|
794
827
|
value: _,
|
|
795
828
|
readOnly: P,
|
|
796
829
|
onChange: (e) => U(e.target.value),
|
|
797
|
-
placeholder:
|
|
830
|
+
placeholder: et,
|
|
798
831
|
autoResize: !0,
|
|
799
832
|
minRows: 2,
|
|
800
833
|
maxRows: 6,
|
|
801
|
-
"aria-label":
|
|
834
|
+
"aria-label": tt
|
|
802
835
|
}
|
|
803
836
|
),
|
|
804
|
-
/* @__PURE__ */
|
|
837
|
+
/* @__PURE__ */ y(
|
|
805
838
|
"div",
|
|
806
839
|
{
|
|
807
840
|
className: [
|
|
808
841
|
"ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]",
|
|
809
|
-
|
|
842
|
+
st ? "ds:justify-between" : "ds:justify-end"
|
|
810
843
|
].join(" "),
|
|
811
844
|
children: [
|
|
812
|
-
|
|
813
|
-
const e = P || !ae, t = ae ? void 0 :
|
|
845
|
+
st ? (() => {
|
|
846
|
+
const e = P || !ae, t = ae ? void 0 : Ht ?? l("notesPanel.clinicalGated", {
|
|
814
847
|
defaultValue: "You do not have permission to write clinical notes."
|
|
815
848
|
}), n = /* @__PURE__ */ a(
|
|
816
|
-
|
|
849
|
+
Zn,
|
|
817
850
|
{
|
|
818
851
|
size: "sm",
|
|
819
852
|
label: l("notesPanel.clinicalToggle", {
|
|
@@ -824,16 +857,16 @@ const Mr = _n(
|
|
|
824
857
|
disabled: e
|
|
825
858
|
}
|
|
826
859
|
);
|
|
827
|
-
return e && t ? /* @__PURE__ */ a(
|
|
860
|
+
return e && t ? /* @__PURE__ */ a(er, { label: t, children: /* @__PURE__ */ a("span", { tabIndex: 0, children: n }) }) : n;
|
|
828
861
|
})() : null,
|
|
829
|
-
/* @__PURE__ */
|
|
862
|
+
/* @__PURE__ */ y("span", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
|
|
830
863
|
g !== null ? /* @__PURE__ */ a(
|
|
831
864
|
re,
|
|
832
865
|
{
|
|
833
866
|
type: "button",
|
|
834
867
|
size: "sm",
|
|
835
868
|
intent: "ghost",
|
|
836
|
-
onClick:
|
|
869
|
+
onClick: fe,
|
|
837
870
|
disabled: P,
|
|
838
871
|
children: l("notesPanel.cancelEdit", { defaultValue: "Cancel" })
|
|
839
872
|
}
|
|
@@ -843,10 +876,10 @@ const Mr = _n(
|
|
|
843
876
|
{
|
|
844
877
|
type: "button",
|
|
845
878
|
size: "sm",
|
|
846
|
-
onClick:
|
|
847
|
-
disabled: !
|
|
879
|
+
onClick: kn,
|
|
880
|
+
disabled: !xn || Nn,
|
|
848
881
|
loading: P,
|
|
849
|
-
children: g !== null ? l("notesPanel.saveEdit", { defaultValue: "Save note" }) :
|
|
882
|
+
children: g !== null ? l("notesPanel.saveEdit", { defaultValue: "Save note" }) : pn ?? l("notesPanel.add", { defaultValue: "Add note" })
|
|
850
883
|
}
|
|
851
884
|
)
|
|
852
885
|
] })
|
|
@@ -863,7 +896,7 @@ const Mr = _n(
|
|
|
863
896
|
children: /* @__PURE__ */ a(A.Description, { children: I.text })
|
|
864
897
|
}
|
|
865
898
|
) : null,
|
|
866
|
-
|
|
899
|
+
cn
|
|
867
900
|
]
|
|
868
901
|
}
|
|
869
902
|
) : null,
|
|
@@ -871,7 +904,7 @@ const Mr = _n(
|
|
|
871
904
|
/* Note-shaped placeholders, not a spinner: the reader sees where
|
|
872
905
|
the notes will land and how many to expect. The status text is
|
|
873
906
|
for assistive tech only; sighted readers get the motion. */
|
|
874
|
-
/* @__PURE__ */
|
|
907
|
+
/* @__PURE__ */ y(
|
|
875
908
|
"div",
|
|
876
909
|
{
|
|
877
910
|
"data-notes-panel-loading": "",
|
|
@@ -879,19 +912,19 @@ const Mr = _n(
|
|
|
879
912
|
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
|
|
880
913
|
children: [
|
|
881
914
|
/* @__PURE__ */ a("span", { role: "status", className: "ds:sr-only", children: l("notesPanel.loading") }),
|
|
882
|
-
|
|
883
|
-
/* @__PURE__ */
|
|
915
|
+
vr.map((e, t) => /* @__PURE__ */ a(Ct, { variant: "elevated", "aria-hidden": "true", children: /* @__PURE__ */ a(Ct.Body, { children: /* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
|
|
916
|
+
/* @__PURE__ */ y("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
884
917
|
/* @__PURE__ */ a(
|
|
885
|
-
|
|
918
|
+
be,
|
|
886
919
|
{
|
|
887
920
|
variant: "circular",
|
|
888
921
|
size: "sm",
|
|
889
922
|
stagger: t * 2
|
|
890
923
|
}
|
|
891
924
|
),
|
|
892
|
-
/* @__PURE__ */
|
|
925
|
+
/* @__PURE__ */ y("div", { className: "ds:flex ds:flex-1 ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
893
926
|
/* @__PURE__ */ a(
|
|
894
|
-
|
|
927
|
+
be,
|
|
895
928
|
{
|
|
896
929
|
variant: "text",
|
|
897
930
|
size: "sm",
|
|
@@ -900,7 +933,7 @@ const Mr = _n(
|
|
|
900
933
|
}
|
|
901
934
|
),
|
|
902
935
|
/* @__PURE__ */ a(
|
|
903
|
-
|
|
936
|
+
be,
|
|
904
937
|
{
|
|
905
938
|
variant: "text",
|
|
906
939
|
size: "sm",
|
|
@@ -911,7 +944,7 @@ const Mr = _n(
|
|
|
911
944
|
] })
|
|
912
945
|
] }),
|
|
913
946
|
/* @__PURE__ */ a(
|
|
914
|
-
|
|
947
|
+
be,
|
|
915
948
|
{
|
|
916
949
|
variant: "text",
|
|
917
950
|
size: "sm",
|
|
@@ -923,24 +956,24 @@ const Mr = _n(
|
|
|
923
956
|
]
|
|
924
957
|
}
|
|
925
958
|
)
|
|
926
|
-
) : w === "error" ? /* @__PURE__ */
|
|
959
|
+
) : w === "error" ? /* @__PURE__ */ y(A, { variant: "error", children: [
|
|
927
960
|
/* @__PURE__ */ a(A.Description, { children: l("notesPanel.loadError") }),
|
|
928
961
|
se ? /* @__PURE__ */ a(A.Action, { children: /* @__PURE__ */ a(re, { intent: "secondary", size: "sm", onClick: se, children: l("notesPanel.retry") }) }) : null
|
|
929
962
|
] }) : null,
|
|
930
|
-
p &&
|
|
963
|
+
p && me ? /* @__PURE__ */ y(
|
|
931
964
|
A,
|
|
932
965
|
{
|
|
933
|
-
ref:
|
|
966
|
+
ref: De,
|
|
934
967
|
variant: p.unknown ? "warning" : "error",
|
|
935
968
|
announce: p.unknown ? "assertive" : void 0,
|
|
936
969
|
dismissible: !0,
|
|
937
970
|
onOpenChange: (e) => {
|
|
938
|
-
e ||
|
|
971
|
+
e || zn(p);
|
|
939
972
|
},
|
|
940
973
|
"data-notes-panel-write-error": p.kind,
|
|
941
974
|
"data-outcome": p.unknown ? "unknown" : void 0,
|
|
942
975
|
children: [
|
|
943
|
-
p.unknown ? /* @__PURE__ */ a(A.Description, { children:
|
|
976
|
+
p.unknown ? /* @__PURE__ */ a(A.Description, { children: Se }) : /* @__PURE__ */ a(A.Title, { as: "p", children: Vn(p) }),
|
|
944
977
|
!p.unknown && p.message ? /* @__PURE__ */ a(A.Description, { children: p.message }) : null
|
|
945
978
|
]
|
|
946
979
|
},
|
|
@@ -953,22 +986,22 @@ const Mr = _n(
|
|
|
953
986
|
"aria-atomic": "true",
|
|
954
987
|
"data-notes-panel-announcer": "",
|
|
955
988
|
className: "ds:sr-only",
|
|
956
|
-
children:
|
|
989
|
+
children: Oe.text ? /* @__PURE__ */ a("span", { children: Oe.text }, Oe.seq) : null
|
|
957
990
|
}
|
|
958
991
|
),
|
|
959
992
|
w === "loading" && M.length > 0 ? /* @__PURE__ */ a("span", { role: "status", className: "ds:sr-only", children: l("notesPanel.loading") }) : null,
|
|
960
993
|
M.length > 0 ? /* @__PURE__ */ a(
|
|
961
994
|
"ul",
|
|
962
995
|
{
|
|
963
|
-
ref:
|
|
996
|
+
ref: jn,
|
|
964
997
|
"aria-busy": w === "loading" || void 0,
|
|
965
|
-
className: `ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-0 ${
|
|
998
|
+
className: `ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-0 ${bn}`.trim(),
|
|
966
999
|
children: M.map(({ actions: e, keptOnDelete: t, ...n }, i) => {
|
|
967
|
-
const s = C != null && n.id === C, r = n.id, d = r != null && g === r, h = r != null &&
|
|
968
|
-
return /* @__PURE__ */
|
|
1000
|
+
const s = C != null && n.id === C, r = n.id, d = r != null && g === r, h = r != null && ge.isLeaving(r), c = r ? Y.get(r) : void 0, m = !!(c != null && c.delete), x = m && !!t, k = P && d;
|
|
1001
|
+
return /* @__PURE__ */ y(
|
|
969
1002
|
"li",
|
|
970
1003
|
{
|
|
971
|
-
ref: s ?
|
|
1004
|
+
ref: s ? _e : void 0,
|
|
972
1005
|
"data-note-id": r,
|
|
973
1006
|
tabIndex: s ? -1 : void 0,
|
|
974
1007
|
"aria-current": s ? "true" : void 0,
|
|
@@ -977,13 +1010,13 @@ const Mr = _n(
|
|
|
977
1010
|
"data-editing": d ? "" : void 0,
|
|
978
1011
|
"aria-busy": x || void 0,
|
|
979
1012
|
className: [
|
|
980
|
-
|
|
1013
|
+
gr({
|
|
981
1014
|
current: s,
|
|
982
1015
|
washed: s || d
|
|
983
1016
|
}),
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
h ?
|
|
1017
|
+
mr,
|
|
1018
|
+
ar,
|
|
1019
|
+
h ? pr : ""
|
|
987
1020
|
].filter(Boolean).join(" "),
|
|
988
1021
|
children: [
|
|
989
1022
|
s ? /* @__PURE__ */ a("span", { className: "ds:sr-only", children: l("notesPanel.current", {
|
|
@@ -995,35 +1028,35 @@ const Mr = _n(
|
|
|
995
1028
|
{
|
|
996
1029
|
"aria-hidden": "true",
|
|
997
1030
|
"data-notes-panel-wash": "editing",
|
|
998
|
-
className:
|
|
1031
|
+
className: Et({ state: "editing" })
|
|
999
1032
|
}
|
|
1000
1033
|
) : s ? /* @__PURE__ */ a(
|
|
1001
1034
|
"span",
|
|
1002
1035
|
{
|
|
1003
1036
|
"aria-hidden": "true",
|
|
1004
1037
|
"data-notes-panel-wash": "addressed",
|
|
1005
|
-
className:
|
|
1038
|
+
className: Et({ state: "addressed" })
|
|
1006
1039
|
},
|
|
1007
|
-
`${C}:${
|
|
1040
|
+
`${C}:${We ?? ""}`
|
|
1008
1041
|
) : null,
|
|
1009
1042
|
/* @__PURE__ */ a(
|
|
1010
|
-
|
|
1043
|
+
Jn,
|
|
1011
1044
|
{
|
|
1012
1045
|
surface: "elevated",
|
|
1013
1046
|
truncate: !s,
|
|
1014
|
-
headerActions: /* @__PURE__ */
|
|
1015
|
-
|
|
1047
|
+
headerActions: /* @__PURE__ */ y($n, { children: [
|
|
1048
|
+
Ke ? Ke(
|
|
1016
1049
|
{ ...n, actions: e, keptOnDelete: t },
|
|
1017
1050
|
{ deleting: m }
|
|
1018
1051
|
) : null,
|
|
1019
1052
|
B && r && !n.deleted && (e == null ? void 0 : e.edit) !== !1 ? /* @__PURE__ */ a(
|
|
1020
|
-
|
|
1053
|
+
St,
|
|
1021
1054
|
{
|
|
1022
|
-
icon: /* @__PURE__ */ a(
|
|
1055
|
+
icon: /* @__PURE__ */ a(dr, {}),
|
|
1023
1056
|
intent: "ghost",
|
|
1024
1057
|
size: "sm",
|
|
1025
1058
|
"aria-label": l("notesPanel.editNamed", {
|
|
1026
|
-
date:
|
|
1059
|
+
date: ue(n),
|
|
1027
1060
|
defaultValue: "Edit note · {{date}}"
|
|
1028
1061
|
}),
|
|
1029
1062
|
tooltip: l("notesPanel.edit", {
|
|
@@ -1033,17 +1066,17 @@ const Mr = _n(
|
|
|
1033
1066
|
disabled: P || m,
|
|
1034
1067
|
"data-notes-panel-edit": "",
|
|
1035
1068
|
"data-note-action": "edit",
|
|
1036
|
-
onClick: () => g === r ?
|
|
1069
|
+
onClick: () => g === r ? fe() : An(n)
|
|
1037
1070
|
}
|
|
1038
1071
|
) : null,
|
|
1039
1072
|
K && r && !n.deleted && (e == null ? void 0 : e.delete) !== !1 ? /* @__PURE__ */ a(
|
|
1040
|
-
|
|
1073
|
+
St,
|
|
1041
1074
|
{
|
|
1042
|
-
icon: /* @__PURE__ */ a(
|
|
1075
|
+
icon: /* @__PURE__ */ a(cr, {}),
|
|
1043
1076
|
intent: "ghost",
|
|
1044
1077
|
size: "sm",
|
|
1045
1078
|
"aria-label": l("notesPanel.deleteNamed", {
|
|
1046
|
-
date:
|
|
1079
|
+
date: ue(n),
|
|
1047
1080
|
defaultValue: "Delete note · {{date}}"
|
|
1048
1081
|
}),
|
|
1049
1082
|
tooltip: l("notesPanel.delete", {
|
|
@@ -1052,17 +1085,17 @@ const Mr = _n(
|
|
|
1052
1085
|
"data-note-action": "delete",
|
|
1053
1086
|
"aria-disabled": x || k || void 0,
|
|
1054
1087
|
"aria-busy": x || void 0,
|
|
1055
|
-
onClick: () =>
|
|
1088
|
+
onClick: () => qn(r)
|
|
1056
1089
|
}
|
|
1057
1090
|
) : null
|
|
1058
1091
|
] }),
|
|
1059
1092
|
...n,
|
|
1060
|
-
pinned:
|
|
1061
|
-
flagged:
|
|
1093
|
+
pinned: Ne(n),
|
|
1094
|
+
flagged: Fn(n),
|
|
1062
1095
|
pinPending: !!(c != null && c.pin) || m,
|
|
1063
1096
|
flagPending: !!(c != null && c.flag) || m,
|
|
1064
|
-
onTogglePin:
|
|
1065
|
-
onToggleFlag:
|
|
1097
|
+
onTogglePin: $e && r && (e == null ? void 0 : e.pin) !== !1 && !n.deleted ? () => Le(r, "pin") : void 0,
|
|
1098
|
+
onToggleFlag: Be && r && (e == null ? void 0 : e.flag) !== !1 && !n.deleted ? () => Le(r, "flag") : void 0
|
|
1066
1099
|
}
|
|
1067
1100
|
)
|
|
1068
1101
|
]
|
|
@@ -1073,21 +1106,21 @@ const Mr = _n(
|
|
|
1073
1106
|
}
|
|
1074
1107
|
) : w !== "ready" ? null : (
|
|
1075
1108
|
/* Where focus lands, from script, when the last note leaves. */
|
|
1076
|
-
/* @__PURE__ */ a("div", { "data-notes-panel-empty": "", className:
|
|
1109
|
+
/* @__PURE__ */ a("div", { "data-notes-panel-empty": "", className: Lt, children: mn ?? /* @__PURE__ */ a("p", { className: "ds:m-0 type-body-sm ds:text-[color:var(--muted-foreground)]", children: l("notesPanel.empty", { defaultValue: "No notes yet." }) }) })
|
|
1077
1110
|
)
|
|
1078
1111
|
] }),
|
|
1079
|
-
K &&
|
|
1112
|
+
K && Ie ? /* @__PURE__ */ a(
|
|
1080
1113
|
L,
|
|
1081
1114
|
{
|
|
1082
1115
|
scope: "container",
|
|
1083
|
-
open:
|
|
1116
|
+
open: qe,
|
|
1084
1117
|
onOpenChange: (e) => !e && Z(null),
|
|
1085
|
-
children: /* @__PURE__ */
|
|
1118
|
+
children: /* @__PURE__ */ y(
|
|
1086
1119
|
L.Content,
|
|
1087
1120
|
{
|
|
1088
1121
|
variant: "alert",
|
|
1089
1122
|
size: "sm",
|
|
1090
|
-
onCloseAutoFocus:
|
|
1123
|
+
onCloseAutoFocus: Mn,
|
|
1091
1124
|
children: [
|
|
1092
1125
|
/* @__PURE__ */ a(L.Header, { children: /* @__PURE__ */ a(L.Title, { children: l("notesPanel.deleteConfirmTitle", {
|
|
1093
1126
|
defaultValue: "Delete this note?"
|
|
@@ -1095,7 +1128,7 @@ const Mr = _n(
|
|
|
1095
1128
|
/* @__PURE__ */ a(L.Body, { children: /* @__PURE__ */ a(L.Description, { children: l("notesPanel.deleteConfirmBody", {
|
|
1096
1129
|
defaultValue: "The note will be removed from the record."
|
|
1097
1130
|
}) }) }),
|
|
1098
|
-
/* @__PURE__ */
|
|
1131
|
+
/* @__PURE__ */ y(L.Footer, { children: [
|
|
1099
1132
|
/* @__PURE__ */ a(L.Close, { asChild: !0, children: /* @__PURE__ */ a(
|
|
1100
1133
|
re,
|
|
1101
1134
|
{
|
|
@@ -1112,7 +1145,7 @@ const Mr = _n(
|
|
|
1112
1145
|
{
|
|
1113
1146
|
intent: "destructive",
|
|
1114
1147
|
size: "sm",
|
|
1115
|
-
onClick:
|
|
1148
|
+
onClick: Dn,
|
|
1116
1149
|
children: l("notesPanel.deleteConfirmAction", {
|
|
1117
1150
|
defaultValue: "Delete"
|
|
1118
1151
|
})
|
|
@@ -1130,6 +1163,6 @@ const Mr = _n(
|
|
|
1130
1163
|
}
|
|
1131
1164
|
);
|
|
1132
1165
|
export {
|
|
1133
|
-
|
|
1166
|
+
Ur as N
|
|
1134
1167
|
};
|
|
1135
|
-
//# sourceMappingURL=notes-panel-
|
|
1168
|
+
//# sourceMappingURL=notes-panel-BguRX8VC.js.map
|