@alfadocs/ui-kit 1.136.0 → 1.138.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/{appointment-card-BT1cMZIX.js → appointment-card-CaxFXtSn.js} +196 -184
- package/dist/_chunks/appointment-details-panel.history-DrIMDQYf.js +314 -0
- package/dist/_chunks/appointment-details-panel.identity-C20Y9xNC.js +223 -0
- package/dist/_chunks/{appointment-timeline-Dy4YQJ17.js → appointment-timeline-BEwgbYyG.js} +113 -110
- package/dist/_chunks/{appointment-tray-B3gSHL1j.js → appointment-tray-DPpeR9JT.js} +8 -8
- package/dist/_chunks/calendar-appointment-editor-dialog-SxSkOTnO.js +5519 -0
- package/dist/_chunks/calendar-editor-discard-host-DjUhoFr2.js +1336 -0
- package/dist/_chunks/calendar-editor-guard-9fShhNIA.js +31 -0
- package/dist/_chunks/calendar-waiting-list-panel-331vzAdl.js +981 -0
- package/dist/_chunks/calendar-workspace.model-B8yPwuBv.js +1557 -0
- package/dist/_chunks/calendar.sheets-aodjllWd.js +4585 -0
- package/dist/_chunks/color-picker-CC8ZfntU.js +582 -0
- package/dist/_chunks/{document-preview-DWlejd8A.js → document-preview-CirR3C_m.js} +2 -2
- package/dist/_chunks/{fiscal-code-input-BBvU7sAo.js → fiscal-code-input-DZlpaMGg.js} +2 -2
- package/dist/_chunks/{iban-input-DuTwKok5.js → iban-input-CdSLRzQN.js} +2 -2
- package/dist/_chunks/list-todo-KWvUhmT_.js +33 -0
- package/dist/_chunks/{notes-panel-BvjAo4RQ.js → notes-panel-DsEKNtsw.js} +2 -2
- package/dist/_chunks/palettes-CKVXYTzo.js +172 -0
- package/dist/_chunks/{patient-account-settings-Bmfeclpd.js → patient-account-settings-Cs9y-pVA.js} +3 -3
- package/dist/_chunks/{patient-check-in-resume-CYZ-SvsF.js → patient-check-in-resume-4qi_klQV.js} +5 -5
- package/dist/_chunks/{patient-details-9eh9cNy7.js → patient-details-Dv7EiTCo.js} +2 -2
- package/dist/_chunks/{patient-field-row-B782eT0C.js → patient-field-row-DuHWGlLz.js} +2 -2
- package/dist/_chunks/patient-picker-BZJuOgMw.js +173 -0
- package/dist/_chunks/{patient-summary-card-K9zaMl1O.js → patient-summary-card-D-cDzOim.js} +2 -2
- package/dist/_chunks/{portal-details-DCIiGkHA.js → portal-details-BGc_FLQk.js} +3 -3
- package/dist/_chunks/{portal-documents-DVKj6Sco.js → portal-documents-BSI1U5lI.js} +3 -3
- package/dist/_chunks/{portal-parts-Br8wuala.js → portal-parts-C99CreYO.js} +2 -2
- package/dist/_chunks/{privacy-mask-C19dJFMk.js → privacy-mask-C2ZLKrMh.js} +5 -5
- package/dist/_chunks/{rich-text-editor-DjHL1b3E.js → rich-text-editor-C48omVjq.js} +2 -2
- package/dist/_chunks/task-editor-wKbFbGqW.js +1093 -0
- package/dist/_chunks/use-appointment-details-read-jGkJalX8.js +1966 -0
- package/dist/agent-catalog.json +2 -2
- package/dist/appointment-editor-panel/index.js +100 -0
- package/dist/booking-tools-data/index.js +82 -0
- package/dist/browser-support.js +1 -1
- package/dist/calendar-action-buttons/index.js +178 -0
- package/dist/components/appointment-card/appointment-card.d.ts +5 -2
- package/dist/components/appointment-card/index.js +2 -2
- package/dist/components/appointment-details-panel/index.js +6 -5
- package/dist/components/appointment-timeline/appointment-timeline.d.ts +6 -0
- package/dist/components/appointment-timeline/index.js +1 -1
- package/dist/components/color-picker/index.js +5 -4
- package/dist/components/document-preview/index.js +1 -1
- package/dist/components/fiscal-code-input/index.js +1 -1
- package/dist/components/iban-input/index.js +1 -1
- package/dist/components/notes-panel/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/rich-text-editor/index.js +1 -1
- package/dist/components/task-editor/index.js +1 -1
- package/dist/core.css +1 -1
- package/dist/find-free-slots-panel/index.js +58 -0
- package/dist/host-legacy.css +16 -0
- package/dist/i18n/locales/ar.d.ts +0 -1
- package/dist/i18n/locales/ar.js +0 -1
- package/dist/i18n/locales/de.d.ts +0 -1
- package/dist/i18n/locales/de.js +0 -1
- package/dist/i18n/locales/el.d.ts +0 -1
- package/dist/i18n/locales/el.js +0 -1
- package/dist/i18n/locales/en.d.ts +0 -1
- package/dist/i18n/locales/en.js +0 -1
- package/dist/i18n/locales/es.d.ts +0 -1
- package/dist/i18n/locales/es.js +0 -1
- package/dist/i18n/locales/fr.d.ts +0 -1
- package/dist/i18n/locales/fr.js +0 -1
- package/dist/i18n/locales/hi.d.ts +0 -1
- package/dist/i18n/locales/hi.js +0 -1
- package/dist/i18n/locales/it.d.ts +0 -1
- package/dist/i18n/locales/it.js +0 -1
- package/dist/i18n/locales/ja.d.ts +0 -1
- package/dist/i18n/locales/ja.js +0 -1
- package/dist/i18n/locales/nl.d.ts +0 -1
- package/dist/i18n/locales/nl.js +0 -1
- package/dist/i18n/locales/pl.d.ts +0 -1
- package/dist/i18n/locales/pl.js +0 -1
- package/dist/i18n/locales/pt.d.ts +0 -1
- package/dist/i18n/locales/pt.js +0 -1
- package/dist/i18n/locales/ro.d.ts +0 -1
- package/dist/i18n/locales/ro.js +0 -1
- package/dist/i18n/locales/ru.d.ts +0 -1
- package/dist/i18n/locales/ru.js +0 -1
- package/dist/i18n/locales/sq.d.ts +0 -1
- package/dist/i18n/locales/sq.js +0 -1
- package/dist/i18n/locales/sv.d.ts +0 -1
- package/dist/i18n/locales/sv.js +0 -1
- package/dist/i18n/locales/tr.d.ts +0 -1
- package/dist/i18n/locales/tr.js +0 -1
- package/dist/i18n/locales/zh.d.ts +0 -1
- package/dist/i18n/locales/zh.js +0 -1
- package/dist/index.js +1328 -1322
- package/dist/locales/ar.json +0 -1
- package/dist/locales/de.json +0 -1
- package/dist/locales/el.json +0 -1
- package/dist/locales/en.json +0 -1
- package/dist/locales/es.json +0 -1
- package/dist/locales/fr.json +0 -1
- package/dist/locales/hi.json +0 -1
- package/dist/locales/it.json +0 -1
- package/dist/locales/ja.json +0 -1
- package/dist/locales/nl.json +0 -1
- package/dist/locales/pl.json +0 -1
- package/dist/locales/pt.json +0 -1
- package/dist/locales/ro.json +0 -1
- package/dist/locales/ru.json +0 -1
- package/dist/locales/sq.json +0 -1
- package/dist/locales/sv.json +0 -1
- package/dist/locales/tr.json +0 -1
- package/dist/locales/zh.json +0 -1
- package/dist/online-bookings-panel/index.js +69 -0
- package/dist/patterns/calendar/booking-tools/appointment-editor-panel.d.ts +46 -0
- package/dist/patterns/calendar/booking-tools/booking-tools-data.d.ts +48 -0
- package/dist/patterns/calendar/booking-tools/calendar-action-buttons.d.ts +55 -0
- package/dist/patterns/calendar/booking-tools/find-free-slots-panel.d.ts +35 -0
- package/dist/patterns/calendar/booking-tools/online-bookings-panel.d.ts +61 -0
- package/dist/patterns/calendar/booking-tools/waiting-list-panel.d.ts +58 -0
- package/dist/patterns/calendar/calendar-editor-discard-host.d.ts +20 -0
- package/dist/patterns/calendar/calendar-print-sheet.d.ts +16 -0
- package/dist/patterns/calendar/calendar-workspace.model.d.ts +7 -0
- package/dist/patterns/calendar/calendar.model.d.ts +9 -0
- package/dist/patterns/calendar/calendar.sheets.d.ts +59 -17
- package/dist/patterns/calendar/index.js +24 -20
- 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 +158 -0
- package/package.json +27 -2
- package/dist/_chunks/calendar-appointment-editor-dialog-CB4cQOtc.js +0 -13773
- package/dist/_chunks/color-picker-AcaWuKah.js +0 -745
- package/dist/_chunks/task-editor-BfXSn6U1.js +0 -1257
- package/dist/_chunks/use-appointment-details-read-7J0j1FP7.js +0 -2476
|
@@ -0,0 +1,1336 @@
|
|
|
1
|
+
import { jsxs as h, jsx as t, Fragment as se } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as z, useState as E, useEffect as P, useId as Q, useSyncExternalStore as Ee, useCallback as Ae } from "react";
|
|
3
|
+
import { useTranslation as G } from "react-i18next";
|
|
4
|
+
import { A as R } from "./alert-C4WKViaS.js";
|
|
5
|
+
import { B as $ } from "./button-DohK_Ak_.js";
|
|
6
|
+
import { S as oe } from "./skeleton-tTWJpvAq.js";
|
|
7
|
+
import { R as Le, l as de, n as ee } from "./calendar-workspace.model-B8yPwuBv.js";
|
|
8
|
+
import { c as $e } from "./calendar-editor-guard-9fShhNIA.js";
|
|
9
|
+
import { D as A } from "./dialog-CVTxyR0v.js";
|
|
10
|
+
import { P as Ie } from "./panel-header-CbtlTe85.js";
|
|
11
|
+
import { C as Oe } from "./checkbox-group-EfinQS1h.js";
|
|
12
|
+
import { F as Me } from "./form-field-CyHfOVKF.js";
|
|
13
|
+
import { S as U } from "./section-card-CYfeQ6EQ.js";
|
|
14
|
+
import { L as me } from "./link-CeV7FoI6.js";
|
|
15
|
+
import { S as Fe } from "./select-CIXKyUMw.js";
|
|
16
|
+
import { S as q } from "./sheet-BdhYeQQT.js";
|
|
17
|
+
import { S as ne } from "./switch-DO6uC4HJ.js";
|
|
18
|
+
import { S as Re, a as We, E as ze } from "./calendar-event-card-BJifpYZQ.js";
|
|
19
|
+
import { T as _e } from "./text-area-COMVJ1yE.js";
|
|
20
|
+
import { T as Ke } from "./token-insert-menu-BLtfMTJd.js";
|
|
21
|
+
import { g as ge } from "./get-error-message-DbFUzuja.js";
|
|
22
|
+
import { A as He } from "./avatar-Dp5apm1d.js";
|
|
23
|
+
import { C as Pe } from "./copy-field-BaYEDJ9f.js";
|
|
24
|
+
import { R as he } from "./rotate-ccw-BBQnIVTr.js";
|
|
25
|
+
import { S as Be } from "./sliders-horizontal-D-F97cnE.js";
|
|
26
|
+
function je(e, s) {
|
|
27
|
+
return e == null || e.occurrence instanceof Date && Number.isFinite(e.occurrence.getTime()) && e.occurrence.getFullYear() === s.date.getFullYear() && e.occurrence.getMonth() === s.date.getMonth() && e.occurrence.getDate() === s.date.getDate() && e.occurrence.getHours() === s.time.hours && e.occurrence.getMinutes() === s.time.minutes && Array.isArray(e.scopes) && e.scopes.length > 0 && e.scopes.every((i) => Le.includes(i));
|
|
28
|
+
}
|
|
29
|
+
const Ue = ["25%", "33%", "20%", "40%", "25%"];
|
|
30
|
+
function St({
|
|
31
|
+
eventId: e,
|
|
32
|
+
load: s,
|
|
33
|
+
onCancel: i,
|
|
34
|
+
children: a
|
|
35
|
+
}) {
|
|
36
|
+
const { t: c } = G("ui"), m = z("");
|
|
37
|
+
m.current = c("emptyState.error.description");
|
|
38
|
+
const [r, d] = E(), [g, x] = E(0);
|
|
39
|
+
if (P(() => {
|
|
40
|
+
if (!e || !s) return;
|
|
41
|
+
const b = new AbortController();
|
|
42
|
+
return d(void 0), Promise.resolve().then(() => s(e, { signal: b.signal })).then((y) => {
|
|
43
|
+
var W, n;
|
|
44
|
+
if (!b.signal.aborted) {
|
|
45
|
+
if (y.status === "ready") {
|
|
46
|
+
const v = y.prefill;
|
|
47
|
+
if (v.editEventId !== e || !(v.date instanceof Date) || !Number.isFinite(v.date.getTime()) || !Number.isFinite(v.durationMin) || v.durationMin < 0 || v.durationMin === 0 && !v.allDay || !Number.isInteger((W = v.time) == null ? void 0 : W.hours) || v.time.hours < 0 || v.time.hours > 23 || !Number.isInteger((n = v.time) == null ? void 0 : n.minutes) || v.time.minutes < 0 || v.time.minutes > 59 || !je(y.series, v))
|
|
48
|
+
throw new Error(m.current);
|
|
49
|
+
}
|
|
50
|
+
d({ eventId: e, source: s, value: y });
|
|
51
|
+
}
|
|
52
|
+
}).catch((y) => {
|
|
53
|
+
b.signal.aborted || d({
|
|
54
|
+
eventId: e,
|
|
55
|
+
source: s,
|
|
56
|
+
value: {
|
|
57
|
+
status: "error",
|
|
58
|
+
reason: y instanceof Error && y.message.trim() ? y.message : m.current
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}), () => b.abort();
|
|
62
|
+
}, [e, s, g]), !e || !s) return a();
|
|
63
|
+
const S = (r == null ? void 0 : r.eventId) === e && r.source === s ? r.value : void 0;
|
|
64
|
+
return (S == null ? void 0 : S.status) === "ready" ? a(S) : /* @__PURE__ */ h(
|
|
65
|
+
"div",
|
|
66
|
+
{
|
|
67
|
+
"data-component": "calendar-editor-hydration",
|
|
68
|
+
"data-event-id": e,
|
|
69
|
+
"data-status": (S == null ? void 0 : S.status) ?? "loading",
|
|
70
|
+
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-md)]",
|
|
71
|
+
children: [
|
|
72
|
+
S ? /* @__PURE__ */ t(R, { variant: S.status === "error" ? "error" : "warning", children: /* @__PURE__ */ t(R.Description, { children: S.reason }) }) : (
|
|
73
|
+
/* A form-shaped placeholder: a label over a field, five times, so the
|
|
74
|
+
editor's fields have somewhere to land. */
|
|
75
|
+
/* @__PURE__ */ h(
|
|
76
|
+
"div",
|
|
77
|
+
{
|
|
78
|
+
"aria-busy": "true",
|
|
79
|
+
"data-editor-loading": "",
|
|
80
|
+
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
|
|
81
|
+
children: [
|
|
82
|
+
/* @__PURE__ */ t("span", { role: "status", className: "ds:sr-only", children: c("common.loading") }),
|
|
83
|
+
Ue.map((b, y) => /* @__PURE__ */ h(
|
|
84
|
+
"div",
|
|
85
|
+
{
|
|
86
|
+
"aria-hidden": "true",
|
|
87
|
+
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]",
|
|
88
|
+
children: [
|
|
89
|
+
/* @__PURE__ */ t(
|
|
90
|
+
oe,
|
|
91
|
+
{
|
|
92
|
+
variant: "text",
|
|
93
|
+
size: "sm",
|
|
94
|
+
stagger: y,
|
|
95
|
+
width: b
|
|
96
|
+
}
|
|
97
|
+
),
|
|
98
|
+
/* @__PURE__ */ t(
|
|
99
|
+
oe,
|
|
100
|
+
{
|
|
101
|
+
variant: "rounded",
|
|
102
|
+
stagger: y,
|
|
103
|
+
height: "calc(var(--spacing-xl) + var(--spacing-sm))"
|
|
104
|
+
}
|
|
105
|
+
)
|
|
106
|
+
]
|
|
107
|
+
},
|
|
108
|
+
y
|
|
109
|
+
))
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
)
|
|
113
|
+
),
|
|
114
|
+
i ? /* @__PURE__ */ t($, { intent: "outline", onClick: i, children: c("calendarWorkspace.editor.cancel") }) : null,
|
|
115
|
+
S && (S.status === "error" || S.retryable) ? /* @__PURE__ */ t(
|
|
116
|
+
$,
|
|
117
|
+
{
|
|
118
|
+
intent: "outline",
|
|
119
|
+
onClick: () => x((b) => b + 1),
|
|
120
|
+
children: c("emptyState.error.cta")
|
|
121
|
+
}
|
|
122
|
+
) : null
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
function wt(e, s, i) {
|
|
128
|
+
const a = s.prefill, c = new Date(a.date);
|
|
129
|
+
return c.setHours(a.time.hours, a.time.minutes, 0, 0), {
|
|
130
|
+
...e,
|
|
131
|
+
chairId: a.chairId,
|
|
132
|
+
operatorId: a.operatorId,
|
|
133
|
+
description: a.care,
|
|
134
|
+
cares: a.cares,
|
|
135
|
+
careLink: a.careLink,
|
|
136
|
+
event: {
|
|
137
|
+
...e.event,
|
|
138
|
+
title: i,
|
|
139
|
+
patientId: a.patientId,
|
|
140
|
+
start: c,
|
|
141
|
+
end: new Date(c.getTime() + a.durationMin * 6e4),
|
|
142
|
+
allDay: a.allDay,
|
|
143
|
+
status: a.status,
|
|
144
|
+
backgroundColor: a.colorHex || void 0,
|
|
145
|
+
isTelehealth: a.isTelehealth,
|
|
146
|
+
hasUnassignedPatient: !a.patientId
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
function ue({ action: e }) {
|
|
151
|
+
return /* @__PURE__ */ t(R.Action, { children: /* @__PURE__ */ t(
|
|
152
|
+
$,
|
|
153
|
+
{
|
|
154
|
+
type: "button",
|
|
155
|
+
size: "sm",
|
|
156
|
+
intent: "outline",
|
|
157
|
+
onClick: e.onAction,
|
|
158
|
+
children: e.label
|
|
159
|
+
}
|
|
160
|
+
) });
|
|
161
|
+
}
|
|
162
|
+
function xt({
|
|
163
|
+
prompts: e,
|
|
164
|
+
restoreFocus: s
|
|
165
|
+
}) {
|
|
166
|
+
var m;
|
|
167
|
+
const { t: i } = G("ui"), a = (m = e == null ? void 0 : e.banner) != null && m.text ? e.banner : void 0, c = e == null ? void 0 : e.firstAppointment;
|
|
168
|
+
return !a && !c ? null : /* @__PURE__ */ h(se, { children: [
|
|
169
|
+
a ? /* @__PURE__ */ h(
|
|
170
|
+
R,
|
|
171
|
+
{
|
|
172
|
+
variant: a.tone ?? "info",
|
|
173
|
+
announce: "off",
|
|
174
|
+
"data-component": "calendar-host-banner",
|
|
175
|
+
dismissible: a.onDismiss !== void 0,
|
|
176
|
+
onOpenChange: (r) => {
|
|
177
|
+
var d;
|
|
178
|
+
r || (s == null || s(), (d = a.onDismiss) == null || d.call(a));
|
|
179
|
+
},
|
|
180
|
+
children: [
|
|
181
|
+
/* @__PURE__ */ t(R.Description, { children: a.text }),
|
|
182
|
+
a.action ? /* @__PURE__ */ t(ue, { action: a.action }) : null
|
|
183
|
+
]
|
|
184
|
+
}
|
|
185
|
+
) : null,
|
|
186
|
+
c ? /* @__PURE__ */ h(
|
|
187
|
+
R,
|
|
188
|
+
{
|
|
189
|
+
variant: "info",
|
|
190
|
+
announce: "off",
|
|
191
|
+
"data-component": "calendar-first-appointment",
|
|
192
|
+
children: [
|
|
193
|
+
/* @__PURE__ */ t(R.Title, { as: "p", children: i("calendarWorkspace.prompts.firstAppointmentTitle") }),
|
|
194
|
+
/* @__PURE__ */ t(R.Description, { children: i("calendarWorkspace.prompts.firstAppointment") }),
|
|
195
|
+
c.action ? /* @__PURE__ */ t(ue, { action: c.action }) : null
|
|
196
|
+
]
|
|
197
|
+
}
|
|
198
|
+
) : null
|
|
199
|
+
] });
|
|
200
|
+
}
|
|
201
|
+
function Ge(e) {
|
|
202
|
+
return e && /^https:\/\//i.test(e.trim()) ? e.trim() : void 0;
|
|
203
|
+
}
|
|
204
|
+
function Ye({
|
|
205
|
+
icalLinks: e,
|
|
206
|
+
idPrefix: s,
|
|
207
|
+
onBusyChange: i
|
|
208
|
+
}) {
|
|
209
|
+
const { t: a } = G("ui"), c = (u) => `calendarWorkspace.${u}`, [m, r] = E(), [d, g] = E(), [x, S] = E({}), [b, y] = E({}), [W, n] = E(""), v = z(/* @__PURE__ */ new Map()), l = z(void 0), N = z(i);
|
|
210
|
+
N.current = i;
|
|
211
|
+
const _ = (u) => e.onRevoke !== void 0 && u.canRevoke !== !1, O = e.feeds.some(_), B = (u) => {
|
|
212
|
+
const C = x[u.id];
|
|
213
|
+
return C && C.from === u.url ? C.url : u.url;
|
|
214
|
+
}, I = async (u) => {
|
|
215
|
+
var D;
|
|
216
|
+
const C = e.onRevoke;
|
|
217
|
+
if (d !== void 0 || !C) return;
|
|
218
|
+
const f = u.url;
|
|
219
|
+
r(void 0), g(u.id), n(""), y(({ [u.id]: p, ...k }) => k), i == null || i(!0);
|
|
220
|
+
try {
|
|
221
|
+
const p = await C(u.id);
|
|
222
|
+
S((k) => ({ ...k, [u.id]: { from: f, url: p.url } })), n(a(c("settings.icalRevoked"), { name: u.label }));
|
|
223
|
+
} catch (p) {
|
|
224
|
+
y((k) => ({
|
|
225
|
+
...k,
|
|
226
|
+
[u.id]: ge(p, a(c("settings.icalFailed")))
|
|
227
|
+
}));
|
|
228
|
+
} finally {
|
|
229
|
+
g(void 0), (D = N.current) == null || D.call(N, !1);
|
|
230
|
+
}
|
|
231
|
+
};
|
|
232
|
+
return /* @__PURE__ */ h(
|
|
233
|
+
U,
|
|
234
|
+
{
|
|
235
|
+
variant: "outlined",
|
|
236
|
+
headingLevel: 4,
|
|
237
|
+
title: a(c("settings.icalTitle")),
|
|
238
|
+
children: [
|
|
239
|
+
/* @__PURE__ */ t("p", { className: "ds:m-0 type-body-sm", children: a(c("settings.icalHint")) }),
|
|
240
|
+
/* @__PURE__ */ t("p", { role: "status", "aria-live": "polite", className: "ds:sr-only", children: W }),
|
|
241
|
+
/* @__PURE__ */ t("ul", { className: "ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-md)] ds:p-0", children: e.feeds.map((u) => {
|
|
242
|
+
const C = d === u.id, f = `${s}-ical-${u.id}`;
|
|
243
|
+
return /* @__PURE__ */ h(
|
|
244
|
+
"li",
|
|
245
|
+
{
|
|
246
|
+
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]",
|
|
247
|
+
children: [
|
|
248
|
+
/* @__PURE__ */ h("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
249
|
+
/* @__PURE__ */ t(
|
|
250
|
+
He,
|
|
251
|
+
{
|
|
252
|
+
name: u.label,
|
|
253
|
+
src: u.avatarSrc,
|
|
254
|
+
size: "sm",
|
|
255
|
+
className: "ds:shrink-0",
|
|
256
|
+
"aria-hidden": "true",
|
|
257
|
+
role: "presentation",
|
|
258
|
+
"aria-label": void 0
|
|
259
|
+
}
|
|
260
|
+
),
|
|
261
|
+
/* @__PURE__ */ t("span", { className: "type-label ds:text-foreground", children: u.label })
|
|
262
|
+
] }),
|
|
263
|
+
/* @__PURE__ */ t(
|
|
264
|
+
Pe,
|
|
265
|
+
{
|
|
266
|
+
id: `${f}-link`,
|
|
267
|
+
dir: "ltr",
|
|
268
|
+
size: "sm",
|
|
269
|
+
value: B(u),
|
|
270
|
+
ariaLabel: a(c("settings.icalLinkLabel"), {
|
|
271
|
+
name: u.label
|
|
272
|
+
}),
|
|
273
|
+
disabled: C
|
|
274
|
+
}
|
|
275
|
+
),
|
|
276
|
+
b[u.id] ? /* @__PURE__ */ t(R, { variant: "error", children: /* @__PURE__ */ t(R.Description, { children: b[u.id] }) }) : null,
|
|
277
|
+
_(u) ? /* @__PURE__ */ h("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
278
|
+
/* @__PURE__ */ t(
|
|
279
|
+
$,
|
|
280
|
+
{
|
|
281
|
+
ref: (D) => {
|
|
282
|
+
D ? v.current.set(u.id, D) : v.current.delete(u.id);
|
|
283
|
+
},
|
|
284
|
+
id: `${f}-revoke`,
|
|
285
|
+
type: "button",
|
|
286
|
+
intent: "outline",
|
|
287
|
+
size: "sm",
|
|
288
|
+
loading: C,
|
|
289
|
+
"aria-describedby": `${f}-note`,
|
|
290
|
+
"aria-label": a(c("settings.icalRevokeFor"), {
|
|
291
|
+
name: u.label
|
|
292
|
+
}),
|
|
293
|
+
onClick: () => {
|
|
294
|
+
l.current = u.id, r(u);
|
|
295
|
+
},
|
|
296
|
+
children: a(c("settings.icalRevoke"))
|
|
297
|
+
}
|
|
298
|
+
),
|
|
299
|
+
/* @__PURE__ */ t("span", { id: `${f}-note`, className: "type-meta", children: a(c("settings.icalImmediate")) })
|
|
300
|
+
] }) : null
|
|
301
|
+
]
|
|
302
|
+
},
|
|
303
|
+
u.id
|
|
304
|
+
);
|
|
305
|
+
}) }),
|
|
306
|
+
O ? /* @__PURE__ */ t(
|
|
307
|
+
A,
|
|
308
|
+
{
|
|
309
|
+
open: m !== void 0,
|
|
310
|
+
onOpenChange: (u) => {
|
|
311
|
+
u || r(void 0);
|
|
312
|
+
},
|
|
313
|
+
children: /* @__PURE__ */ h(
|
|
314
|
+
A.Content,
|
|
315
|
+
{
|
|
316
|
+
size: "sm",
|
|
317
|
+
variant: "alert",
|
|
318
|
+
onCloseAutoFocus: (u) => {
|
|
319
|
+
const C = l.current ? v.current.get(l.current) : void 0;
|
|
320
|
+
C && (u.preventDefault(), C.focus());
|
|
321
|
+
},
|
|
322
|
+
children: [
|
|
323
|
+
/* @__PURE__ */ h(A.Header, { children: [
|
|
324
|
+
/* @__PURE__ */ t(A.Title, { children: a(c("settings.icalConfirmTitle"), { name: m == null ? void 0 : m.label }) }),
|
|
325
|
+
/* @__PURE__ */ t(A.Description, { children: a(c("settings.icalConfirmBody"), { name: m == null ? void 0 : m.label }) })
|
|
326
|
+
] }),
|
|
327
|
+
/* @__PURE__ */ h(A.Footer, { children: [
|
|
328
|
+
/* @__PURE__ */ t(
|
|
329
|
+
$,
|
|
330
|
+
{
|
|
331
|
+
type: "button",
|
|
332
|
+
intent: "secondary",
|
|
333
|
+
onClick: () => r(void 0),
|
|
334
|
+
children: a("common.cancel")
|
|
335
|
+
}
|
|
336
|
+
),
|
|
337
|
+
/* @__PURE__ */ t(
|
|
338
|
+
$,
|
|
339
|
+
{
|
|
340
|
+
type: "button",
|
|
341
|
+
intent: "destructive",
|
|
342
|
+
onClick: () => m && void I(m),
|
|
343
|
+
children: a(c("settings.icalRevoke"))
|
|
344
|
+
}
|
|
345
|
+
)
|
|
346
|
+
] })
|
|
347
|
+
]
|
|
348
|
+
}
|
|
349
|
+
)
|
|
350
|
+
}
|
|
351
|
+
) : null
|
|
352
|
+
]
|
|
353
|
+
}
|
|
354
|
+
);
|
|
355
|
+
}
|
|
356
|
+
const fe = [
|
|
357
|
+
{ setting: "openOnHolidays", labelKey: "settings.practiceOpenOnHolidays" },
|
|
358
|
+
{
|
|
359
|
+
setting: "careAllocationFilter",
|
|
360
|
+
labelKey: "settings.practiceCareAllocation"
|
|
361
|
+
}
|
|
362
|
+
], ve = [
|
|
363
|
+
{ channel: "reminderSms", labelKey: "settings.practiceReminderSms" },
|
|
364
|
+
{ channel: "reminderEmail", labelKey: "settings.practiceReminderEmail" },
|
|
365
|
+
{
|
|
366
|
+
channel: "confirmationSms",
|
|
367
|
+
labelKey: "settings.practiceConfirmationSms"
|
|
368
|
+
},
|
|
369
|
+
{ channel: "moved", labelKey: "settings.practiceMoved" }
|
|
370
|
+
], be = [
|
|
371
|
+
{ channel: "onCancel", labelKey: "settings.practiceOperatorOnCancel" },
|
|
372
|
+
{ channel: "onChange", labelKey: "settings.practiceOperatorOnChange" },
|
|
373
|
+
{
|
|
374
|
+
channel: "onUserChange",
|
|
375
|
+
labelKey: "settings.practiceOperatorOnUserChange"
|
|
376
|
+
}
|
|
377
|
+
];
|
|
378
|
+
function X(e, s) {
|
|
379
|
+
return s.filter(({ channel: i }) => (e == null ? void 0 : e[i]) !== void 0);
|
|
380
|
+
}
|
|
381
|
+
function ye(e) {
|
|
382
|
+
const s = fe.map(
|
|
383
|
+
({ setting: i }) => i
|
|
384
|
+
).filter((i) => e[i] !== void 0);
|
|
385
|
+
return X(e.patientNotices, ve).length && s.push("patientNotices"), X(e.operatorNotices, be).length && s.push("operatorNotices"), e.whatsappMessage !== void 0 && s.push("whatsappMessage"), s;
|
|
386
|
+
}
|
|
387
|
+
function te(e) {
|
|
388
|
+
return JSON.stringify(
|
|
389
|
+
e,
|
|
390
|
+
(s, i) => i && typeof i == "object" && !Array.isArray(i) ? Object.fromEntries(
|
|
391
|
+
Object.entries(i).sort(([a], [c]) => a < c ? -1 : 1)
|
|
392
|
+
) : i
|
|
393
|
+
);
|
|
394
|
+
}
|
|
395
|
+
function pe(e, s, i, a) {
|
|
396
|
+
const c = { ...e };
|
|
397
|
+
for (const m of a)
|
|
398
|
+
if (m === "patientNotices" || m === "operatorNotices") {
|
|
399
|
+
const r = { ...i[m] }, d = { ...s[m] }, g = { ...e[m] };
|
|
400
|
+
for (const [x, S] of Object.entries(r))
|
|
401
|
+
S !== d[x] && (g[x] = S);
|
|
402
|
+
Object.assign(c, { [m]: g });
|
|
403
|
+
} else if (m === "whatsappMessage") {
|
|
404
|
+
const r = i.whatsappMessage;
|
|
405
|
+
r && (c.whatsappMessage = e.whatsappMessage ? { ...e.whatsappMessage, value: r.value } : r);
|
|
406
|
+
} else
|
|
407
|
+
Object.assign(c, { [m]: i[m] });
|
|
408
|
+
return c;
|
|
409
|
+
}
|
|
410
|
+
function Ne(e) {
|
|
411
|
+
var s;
|
|
412
|
+
return (((s = e.icalLinks) == null ? void 0 : s.feeds.length) ?? 0) > 0;
|
|
413
|
+
}
|
|
414
|
+
function ie(e) {
|
|
415
|
+
return e ? e.hoursSummary !== void 0 || ye(e.value).length > 0 || Ne(e) : !1;
|
|
416
|
+
}
|
|
417
|
+
function qe({
|
|
418
|
+
seam: e,
|
|
419
|
+
idPrefix: s,
|
|
420
|
+
onBusyChange: i,
|
|
421
|
+
onDirtyChange: a,
|
|
422
|
+
onHoursOpened: c,
|
|
423
|
+
onSettingChanged: m
|
|
424
|
+
}) {
|
|
425
|
+
const { t: r } = G("ui"), d = (o) => `calendarWorkspace.${o}`, { hoursSummary: g } = e, x = ye(e.value), S = fe.filter(
|
|
426
|
+
({ setting: o }) => x.includes(o)
|
|
427
|
+
), b = Q(), [y, W] = E(e.value), [n, v] = E(e.value), [l, N] = E(!1), [_, O] = E(), [B, I] = E(!1), u = x.filter(
|
|
428
|
+
(o) => te(n[o]) !== te(y[o])
|
|
429
|
+
), C = u.length > 0, f = n.whatsappMessage, D = (f == null ? void 0 : f.maxLength) !== void 0 && [...f.value].length > f.maxLength, p = z(null), k = te(e.value), [M, K] = E(k);
|
|
430
|
+
!l && k !== M && (K(k), W(e.value), v(pe(e.value, y, n, u)));
|
|
431
|
+
const T = z(i), F = z(a), H = z({ save: !1, revoke: !1 }), Z = (o, w) => {
|
|
432
|
+
H.current[o] = w, i == null || i(H.current.save || H.current.revoke);
|
|
433
|
+
};
|
|
434
|
+
P(() => {
|
|
435
|
+
T.current = i, F.current = a;
|
|
436
|
+
}), P(() => {
|
|
437
|
+
var o;
|
|
438
|
+
(o = F.current) == null || o.call(F, C);
|
|
439
|
+
}, [C]), P(
|
|
440
|
+
() => () => {
|
|
441
|
+
var o, w;
|
|
442
|
+
(o = T.current) == null || o.call(T, !1), (w = F.current) == null || w.call(F, !1);
|
|
443
|
+
},
|
|
444
|
+
[]
|
|
445
|
+
);
|
|
446
|
+
const ke = async () => {
|
|
447
|
+
if (!C || l || D) return;
|
|
448
|
+
const o = u, w = pe(y, y, n, o);
|
|
449
|
+
N(!0), O(void 0), I(!1), Z("save", !0);
|
|
450
|
+
try {
|
|
451
|
+
await e.onSave(w, o), W(w), v(w), I(!0);
|
|
452
|
+
for (const L of o) m == null || m(L);
|
|
453
|
+
} catch (L) {
|
|
454
|
+
v(y), O(ge(L, r(d("settings.practiceSaveFailed"))));
|
|
455
|
+
} finally {
|
|
456
|
+
N(!1), Z("save", !1);
|
|
457
|
+
}
|
|
458
|
+
}, Se = (o, w, L) => {
|
|
459
|
+
O(void 0), I(!1), v((j) => ({ ...j, [o]: { ...j[o], [w]: L } }));
|
|
460
|
+
}, re = (o) => {
|
|
461
|
+
O(void 0), I(!1), v(
|
|
462
|
+
(w) => w.whatsappMessage ? { ...w, whatsappMessage: { ...w.whatsappMessage, value: o } } : w
|
|
463
|
+
);
|
|
464
|
+
}, we = (o) => {
|
|
465
|
+
var J;
|
|
466
|
+
const w = ((J = n.whatsappMessage) == null ? void 0 : J.value) ?? "", L = p.current, j = (L == null ? void 0 : L.selectionStart) ?? w.length, Y = (L == null ? void 0 : L.selectionEnd) ?? w.length;
|
|
467
|
+
re(`${w.slice(0, j)}${o}${w.slice(Y)}`);
|
|
468
|
+
}, xe = () => {
|
|
469
|
+
!C || l || (v(y), O(void 0), I(!1));
|
|
470
|
+
};
|
|
471
|
+
let V = null;
|
|
472
|
+
g != null && g.onOpen ? V = /* @__PURE__ */ t(
|
|
473
|
+
$,
|
|
474
|
+
{
|
|
475
|
+
intent: "link",
|
|
476
|
+
onClick: () => {
|
|
477
|
+
var o;
|
|
478
|
+
c == null || c(), (o = g.onOpen) == null || o.call(g);
|
|
479
|
+
},
|
|
480
|
+
children: r(d("settings.practiceHoursLink"))
|
|
481
|
+
}
|
|
482
|
+
) : g != null && g.href && (V = /* @__PURE__ */ t(me, { href: g.href, external: !0, onClick: c, children: r(d("settings.practiceHoursLink")) }));
|
|
483
|
+
const De = x.filter(
|
|
484
|
+
(o) => o === "patientNotices" || o === "operatorNotices" || o === "whatsappMessage"
|
|
485
|
+
), le = ({
|
|
486
|
+
group: o,
|
|
487
|
+
titleKey: w,
|
|
488
|
+
hintKey: L,
|
|
489
|
+
items: j
|
|
490
|
+
}) => /* @__PURE__ */ h(
|
|
491
|
+
"div",
|
|
492
|
+
{
|
|
493
|
+
role: "group",
|
|
494
|
+
"aria-labelledby": `${b}-${o}`,
|
|
495
|
+
"aria-describedby": `${b}-${o}-hint`,
|
|
496
|
+
className: "ds:flex ds:flex-col",
|
|
497
|
+
children: [
|
|
498
|
+
/* @__PURE__ */ t(
|
|
499
|
+
"h5",
|
|
500
|
+
{
|
|
501
|
+
id: `${b}-${o}`,
|
|
502
|
+
className: "ds:m-0 type-label ds:text-foreground",
|
|
503
|
+
children: r(d(w))
|
|
504
|
+
}
|
|
505
|
+
),
|
|
506
|
+
/* @__PURE__ */ t("p", { id: `${b}-${o}-hint`, className: "ds:m-0 type-body-sm", children: r(d(L)) }),
|
|
507
|
+
j.map(({ channel: Y, labelKey: J }) => {
|
|
508
|
+
var ce;
|
|
509
|
+
return /* @__PURE__ */ t(
|
|
510
|
+
"div",
|
|
511
|
+
{
|
|
512
|
+
className: "ds:flex ds:min-h-[var(--min-target-size)] ds:items-center",
|
|
513
|
+
children: /* @__PURE__ */ t(
|
|
514
|
+
ne,
|
|
515
|
+
{
|
|
516
|
+
id: `${s}-${o}-${Y}`,
|
|
517
|
+
label: r(d(J)),
|
|
518
|
+
labelSide: "start",
|
|
519
|
+
className: "ds:ms-auto",
|
|
520
|
+
checked: ((ce = n[o]) == null ? void 0 : ce[Y]) === !0,
|
|
521
|
+
onCheckedChange: (Te) => Se(o, Y, Te)
|
|
522
|
+
}
|
|
523
|
+
)
|
|
524
|
+
},
|
|
525
|
+
Y
|
|
526
|
+
);
|
|
527
|
+
})
|
|
528
|
+
]
|
|
529
|
+
}
|
|
530
|
+
);
|
|
531
|
+
return /* @__PURE__ */ h(
|
|
532
|
+
"section",
|
|
533
|
+
{
|
|
534
|
+
"aria-labelledby": `${s}-practice-title`,
|
|
535
|
+
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
|
|
536
|
+
children: [
|
|
537
|
+
/* @__PURE__ */ t("h3", { id: `${s}-practice-title`, className: "ds:m-0 type-title-card", children: r(d("settings.practice")) }),
|
|
538
|
+
/* @__PURE__ */ t("p", { className: "ds:m-0 type-body-sm", children: r(d("settings.practiceHint")) }),
|
|
539
|
+
/* @__PURE__ */ t("p", { role: "status", className: "ds:sr-only", children: B ? r(d("settings.practiceSaved")) : "" }),
|
|
540
|
+
_ ? /* @__PURE__ */ t(R, { variant: "error", children: /* @__PURE__ */ t(R.Description, { children: _ }) }) : null,
|
|
541
|
+
g ? /* @__PURE__ */ h(
|
|
542
|
+
U,
|
|
543
|
+
{
|
|
544
|
+
variant: "outlined",
|
|
545
|
+
headingLevel: 4,
|
|
546
|
+
title: r(d("settings.practiceHours")),
|
|
547
|
+
children: [
|
|
548
|
+
/* @__PURE__ */ t("p", { className: "ds:m-0 type-body-sm", children: g.text }),
|
|
549
|
+
V ? /* @__PURE__ */ t("div", { className: "ds:flex ds:min-h-[var(--min-target-size)] ds:items-center", children: V }) : null
|
|
550
|
+
]
|
|
551
|
+
}
|
|
552
|
+
) : null,
|
|
553
|
+
S.length > 0 ? /* @__PURE__ */ t(
|
|
554
|
+
U,
|
|
555
|
+
{
|
|
556
|
+
variant: "outlined",
|
|
557
|
+
headingLevel: 4,
|
|
558
|
+
title: r(d("settings.practiceRules")),
|
|
559
|
+
children: S.map(({ setting: o, labelKey: w }) => /* @__PURE__ */ t(
|
|
560
|
+
"div",
|
|
561
|
+
{
|
|
562
|
+
className: "ds:flex ds:min-h-[var(--min-target-size)] ds:items-center",
|
|
563
|
+
children: /* @__PURE__ */ t(
|
|
564
|
+
ne,
|
|
565
|
+
{
|
|
566
|
+
id: `${s}-${o}`,
|
|
567
|
+
label: r(d(w)),
|
|
568
|
+
labelSide: "start",
|
|
569
|
+
className: "ds:ms-auto",
|
|
570
|
+
checked: n[o] === !0,
|
|
571
|
+
onCheckedChange: (L) => {
|
|
572
|
+
O(void 0), I(!1), v((j) => ({ ...j, [o]: L }));
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
)
|
|
576
|
+
},
|
|
577
|
+
o
|
|
578
|
+
))
|
|
579
|
+
}
|
|
580
|
+
) : null,
|
|
581
|
+
De.length > 0 ? /* @__PURE__ */ h(
|
|
582
|
+
U,
|
|
583
|
+
{
|
|
584
|
+
variant: "outlined",
|
|
585
|
+
headingLevel: 4,
|
|
586
|
+
title: r(d("settings.practiceNotices")),
|
|
587
|
+
children: [
|
|
588
|
+
x.includes("patientNotices") ? le({
|
|
589
|
+
group: "patientNotices",
|
|
590
|
+
titleKey: "settings.practicePatientNotices",
|
|
591
|
+
hintKey: "settings.practicePatientNoticesHint",
|
|
592
|
+
items: X(
|
|
593
|
+
n.patientNotices,
|
|
594
|
+
ve
|
|
595
|
+
)
|
|
596
|
+
}) : null,
|
|
597
|
+
x.includes("operatorNotices") ? le({
|
|
598
|
+
group: "operatorNotices",
|
|
599
|
+
titleKey: "settings.practiceOperatorNotices",
|
|
600
|
+
hintKey: "settings.practiceOperatorNoticesHint",
|
|
601
|
+
items: X(
|
|
602
|
+
n.operatorNotices,
|
|
603
|
+
be
|
|
604
|
+
)
|
|
605
|
+
}) : null,
|
|
606
|
+
f ? /* @__PURE__ */ h("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
607
|
+
/* @__PURE__ */ t(
|
|
608
|
+
"h5",
|
|
609
|
+
{
|
|
610
|
+
id: `${b}-whatsapp`,
|
|
611
|
+
className: "ds:m-0 type-label ds:text-foreground",
|
|
612
|
+
children: r(d("settings.practiceWhatsapp"))
|
|
613
|
+
}
|
|
614
|
+
),
|
|
615
|
+
/* @__PURE__ */ t(
|
|
616
|
+
"p",
|
|
617
|
+
{
|
|
618
|
+
id: `${b}-whatsapp-hint`,
|
|
619
|
+
className: "ds:m-0 type-body-sm",
|
|
620
|
+
children: r(d("settings.practiceWhatsappHint"))
|
|
621
|
+
}
|
|
622
|
+
),
|
|
623
|
+
/* @__PURE__ */ t(
|
|
624
|
+
_e,
|
|
625
|
+
{
|
|
626
|
+
ref: p,
|
|
627
|
+
id: `${s}-whatsappMessage`,
|
|
628
|
+
"aria-labelledby": `${b}-whatsapp`,
|
|
629
|
+
"aria-describedby": `${b}-whatsapp-hint ${b}-whatsapp-count`,
|
|
630
|
+
"aria-invalid": D || void 0,
|
|
631
|
+
tone: D ? "error" : "default",
|
|
632
|
+
autoResize: !0,
|
|
633
|
+
minRows: 3,
|
|
634
|
+
maxRows: 8,
|
|
635
|
+
value: f.value,
|
|
636
|
+
onChange: (o) => re(o.target.value)
|
|
637
|
+
}
|
|
638
|
+
),
|
|
639
|
+
/* @__PURE__ */ h("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
|
|
640
|
+
f.variables && f.variables.length > 0 ? /* @__PURE__ */ t(
|
|
641
|
+
Ke,
|
|
642
|
+
{
|
|
643
|
+
id: `${s}-whatsappMessage-placeholders`,
|
|
644
|
+
triggerLabel: r(d("settings.practiceWhatsappInsert")),
|
|
645
|
+
tokens: f.variables.map((o) => ({
|
|
646
|
+
value: o,
|
|
647
|
+
label: o
|
|
648
|
+
})),
|
|
649
|
+
onInsert: we
|
|
650
|
+
}
|
|
651
|
+
) : /* @__PURE__ */ t("span", {}),
|
|
652
|
+
f.maxLength !== void 0 ? /* @__PURE__ */ t(
|
|
653
|
+
"span",
|
|
654
|
+
{
|
|
655
|
+
id: `${b}-whatsapp-count`,
|
|
656
|
+
className: `type-meta ds:tabular-nums ${D ? "ds:text-destructive" : "ds:text-muted-foreground"}`,
|
|
657
|
+
children: r(d("settings.practiceWhatsappCount"), {
|
|
658
|
+
used: [...f.value].length,
|
|
659
|
+
max: f.maxLength
|
|
660
|
+
})
|
|
661
|
+
}
|
|
662
|
+
) : null
|
|
663
|
+
] }),
|
|
664
|
+
D ? /* @__PURE__ */ t(
|
|
665
|
+
"p",
|
|
666
|
+
{
|
|
667
|
+
role: "alert",
|
|
668
|
+
className: "ds:m-0 type-body-sm ds:text-destructive",
|
|
669
|
+
children: r(d("settings.practiceWhatsappTooLong"), {
|
|
670
|
+
max: f.maxLength
|
|
671
|
+
})
|
|
672
|
+
}
|
|
673
|
+
) : null
|
|
674
|
+
] }) : null
|
|
675
|
+
]
|
|
676
|
+
}
|
|
677
|
+
) : null,
|
|
678
|
+
e.icalLinks && Ne(e) ? /* @__PURE__ */ t(
|
|
679
|
+
Ye,
|
|
680
|
+
{
|
|
681
|
+
icalLinks: e.icalLinks,
|
|
682
|
+
idPrefix: s,
|
|
683
|
+
onBusyChange: (o) => Z("revoke", o)
|
|
684
|
+
}
|
|
685
|
+
) : null,
|
|
686
|
+
x.length > 0 ? /* @__PURE__ */ h(
|
|
687
|
+
"div",
|
|
688
|
+
{
|
|
689
|
+
"data-practice-footer": "",
|
|
690
|
+
className: "ds:sticky ds:bottom-0 ds:z-10 ds:flex ds:flex-wrap ds:justify-end ds:gap-[var(--spacing-sm)] ds:border-t ds:border-[color:var(--border)] ds:bg-[var(--popover)] ds:py-[var(--spacing-sm)]",
|
|
691
|
+
children: [
|
|
692
|
+
/* @__PURE__ */ t(
|
|
693
|
+
$,
|
|
694
|
+
{
|
|
695
|
+
intent: "outline",
|
|
696
|
+
"aria-disabled": !C || l || void 0,
|
|
697
|
+
onClick: xe,
|
|
698
|
+
children: r(d("settings.practiceDiscard"))
|
|
699
|
+
}
|
|
700
|
+
),
|
|
701
|
+
/* @__PURE__ */ t(
|
|
702
|
+
$,
|
|
703
|
+
{
|
|
704
|
+
intent: "primary",
|
|
705
|
+
loading: l,
|
|
706
|
+
"aria-disabled": !C || D || void 0,
|
|
707
|
+
onClick: () => void ke(),
|
|
708
|
+
children: r("common.save")
|
|
709
|
+
}
|
|
710
|
+
)
|
|
711
|
+
]
|
|
712
|
+
}
|
|
713
|
+
) : null
|
|
714
|
+
]
|
|
715
|
+
}
|
|
716
|
+
);
|
|
717
|
+
}
|
|
718
|
+
const ae = "calendar-display-settings", Ve = [10, 15, 20, 30, 45, 60];
|
|
719
|
+
function Ce({
|
|
720
|
+
display: e,
|
|
721
|
+
onChange: s,
|
|
722
|
+
hiddenDays: i,
|
|
723
|
+
onHiddenDaysChange: a,
|
|
724
|
+
practiceHours: c,
|
|
725
|
+
isMonth: m = !1,
|
|
726
|
+
hasOperatorGroups: r = !1,
|
|
727
|
+
academyHref: d,
|
|
728
|
+
practiceSettings: g,
|
|
729
|
+
onPracticeSettingChanged: x,
|
|
730
|
+
onHoursOpened: S,
|
|
731
|
+
onPracticeBusyChange: b,
|
|
732
|
+
onPracticeDirtyChange: y,
|
|
733
|
+
monthNoteId: W
|
|
734
|
+
}) {
|
|
735
|
+
const { t: n, i18n: v } = G("ui"), l = (p) => `calendarWorkspace.${p}`, N = (p) => `calendarWorkspace.inc1.${p}`, _ = Q(), O = W ?? _, B = Q(), I = Ge(d), u = (p) => `${ae}-${p}`, C = [
|
|
736
|
+
.../* @__PURE__ */ new Set([...Ve, e.defaultDurationMin])
|
|
737
|
+
].filter(
|
|
738
|
+
(p) => p >= de.min && p <= de.max
|
|
739
|
+
).sort((p, k) => p - k).map((p) => ({
|
|
740
|
+
value: String(p),
|
|
741
|
+
label: n(N("settings.durationOption"), { minutes: p })
|
|
742
|
+
})), f = (p, k, M, K, T = (H) => H, F) => /* @__PURE__ */ t(Me, { label: k, description: F, children: /* @__PURE__ */ t(
|
|
743
|
+
Fe,
|
|
744
|
+
{
|
|
745
|
+
id: u(p),
|
|
746
|
+
options: M,
|
|
747
|
+
value: K,
|
|
748
|
+
onValueChange: (H) => {
|
|
749
|
+
H !== "" && H !== K && s(p, {
|
|
750
|
+
[p]: T(H)
|
|
751
|
+
});
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
) }), D = (p, k, M) => /* @__PURE__ */ t("div", { className: "ds:flex ds:min-h-[var(--min-target-size)] ds:items-center", children: /* @__PURE__ */ t(
|
|
755
|
+
ne,
|
|
756
|
+
{
|
|
757
|
+
id: u(p),
|
|
758
|
+
label: k,
|
|
759
|
+
labelSide: "start",
|
|
760
|
+
className: "ds:ms-auto",
|
|
761
|
+
checked: M,
|
|
762
|
+
onCheckedChange: (K) => s(p, {
|
|
763
|
+
[p]: K
|
|
764
|
+
})
|
|
765
|
+
}
|
|
766
|
+
) });
|
|
767
|
+
return /* @__PURE__ */ h(se, { children: [
|
|
768
|
+
/* @__PURE__ */ h(
|
|
769
|
+
"section",
|
|
770
|
+
{
|
|
771
|
+
"aria-labelledby": B,
|
|
772
|
+
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
|
|
773
|
+
children: [
|
|
774
|
+
/* @__PURE__ */ t("h3", { id: B, className: "ds:m-0 type-title-card", children: n(l("settings.myCalendar")) }),
|
|
775
|
+
m ? /* @__PURE__ */ t("p", { id: O, className: "ds:m-0 type-body-sm", children: n(l("settings.monthNote")) }) : null,
|
|
776
|
+
/* @__PURE__ */ h(
|
|
777
|
+
U,
|
|
778
|
+
{
|
|
779
|
+
variant: "outlined",
|
|
780
|
+
headingLevel: 4,
|
|
781
|
+
title: n(l("settings.sectionView")),
|
|
782
|
+
children: [
|
|
783
|
+
f(
|
|
784
|
+
"orientation",
|
|
785
|
+
n(l("settings.orientation")),
|
|
786
|
+
[
|
|
787
|
+
{
|
|
788
|
+
value: "vertical",
|
|
789
|
+
label: n(l("settings.orientationColumns"))
|
|
790
|
+
},
|
|
791
|
+
{
|
|
792
|
+
value: "horizontal",
|
|
793
|
+
label: n(l("settings.orientationTimeline"))
|
|
794
|
+
}
|
|
795
|
+
],
|
|
796
|
+
e.orientation
|
|
797
|
+
),
|
|
798
|
+
f(
|
|
799
|
+
"slotDensity",
|
|
800
|
+
n("calendar.card.slotDensity"),
|
|
801
|
+
[
|
|
802
|
+
{ value: "compact", label: n("calendar.card.compact") },
|
|
803
|
+
{
|
|
804
|
+
value: "comfortable",
|
|
805
|
+
label: n("calendar.card.comfortable")
|
|
806
|
+
}
|
|
807
|
+
],
|
|
808
|
+
e.slotDensity ?? "compact"
|
|
809
|
+
),
|
|
810
|
+
f(
|
|
811
|
+
"window",
|
|
812
|
+
n(l("settings.window")),
|
|
813
|
+
[
|
|
814
|
+
{
|
|
815
|
+
value: "working",
|
|
816
|
+
label: n(N("settings.windowPractice"), {
|
|
817
|
+
from: c.from,
|
|
818
|
+
to: c.to
|
|
819
|
+
})
|
|
820
|
+
},
|
|
821
|
+
{
|
|
822
|
+
value: "extended",
|
|
823
|
+
label: n(l("settings.windowExtended"))
|
|
824
|
+
},
|
|
825
|
+
{ value: "full", label: n(l("settings.windowFull")) }
|
|
826
|
+
],
|
|
827
|
+
e.window
|
|
828
|
+
),
|
|
829
|
+
f(
|
|
830
|
+
"slotDuration",
|
|
831
|
+
n(l("settings.slotDuration")),
|
|
832
|
+
[
|
|
833
|
+
{ value: "00:10", label: n(l("settings.slot10")) },
|
|
834
|
+
{ value: "00:15", label: n(l("settings.slot15")) },
|
|
835
|
+
{ value: "00:20", label: n(l("settings.slot20")) },
|
|
836
|
+
{ value: "00:30", label: n(l("settings.slot30")) },
|
|
837
|
+
{ value: "01:00", label: n(l("settings.slot60")) }
|
|
838
|
+
],
|
|
839
|
+
e.slotDuration
|
|
840
|
+
),
|
|
841
|
+
D("zebraRows", n(l("settings.zebra")), e.zebraRows),
|
|
842
|
+
/* @__PURE__ */ t(
|
|
843
|
+
Oe,
|
|
844
|
+
{
|
|
845
|
+
id: u("daysShown"),
|
|
846
|
+
label: n(l("settings.daysShown")),
|
|
847
|
+
orientation: "horizontal",
|
|
848
|
+
min: 1,
|
|
849
|
+
value: ee.filter(
|
|
850
|
+
(p) => !i.includes(p)
|
|
851
|
+
).map(String),
|
|
852
|
+
options: ee.map((p) => ({
|
|
853
|
+
value: String(p),
|
|
854
|
+
/* 4 January 2026 is a Sunday: offset by the day number. */
|
|
855
|
+
label: new Intl.DateTimeFormat(v.language, {
|
|
856
|
+
weekday: "long"
|
|
857
|
+
}).format(new Date(2026, 0, 4 + p))
|
|
858
|
+
})),
|
|
859
|
+
onChange: (p) => {
|
|
860
|
+
p.length !== 0 && a(
|
|
861
|
+
ee.filter(
|
|
862
|
+
(k) => !p.includes(String(k))
|
|
863
|
+
).sort((k, M) => k - M)
|
|
864
|
+
);
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
)
|
|
868
|
+
]
|
|
869
|
+
}
|
|
870
|
+
),
|
|
871
|
+
/* @__PURE__ */ h(
|
|
872
|
+
U,
|
|
873
|
+
{
|
|
874
|
+
variant: "outlined",
|
|
875
|
+
headingLevel: 4,
|
|
876
|
+
title: n(l("settings.sectionCards")),
|
|
877
|
+
children: [
|
|
878
|
+
f(
|
|
879
|
+
"eventColorStyle",
|
|
880
|
+
n("calendar.card.eventColorStyle"),
|
|
881
|
+
[
|
|
882
|
+
{ value: "tinted", label: n("calendar.card.tinted") },
|
|
883
|
+
{ value: "solid", label: n("calendar.card.solid") }
|
|
884
|
+
],
|
|
885
|
+
e.eventColorStyle ?? "tinted"
|
|
886
|
+
),
|
|
887
|
+
f(
|
|
888
|
+
"colorAssociation",
|
|
889
|
+
n(l("settings.colorBy")),
|
|
890
|
+
[
|
|
891
|
+
{
|
|
892
|
+
value: "appointment",
|
|
893
|
+
label: n(l("settings.colorByAppointment"))
|
|
894
|
+
},
|
|
895
|
+
{ value: "care", label: n(l("settings.colorByCare")) },
|
|
896
|
+
{
|
|
897
|
+
value: "operator",
|
|
898
|
+
label: n(l("settings.colorByOperator"))
|
|
899
|
+
},
|
|
900
|
+
{ value: "chair", label: n(l("settings.colorByChair")) },
|
|
901
|
+
{
|
|
902
|
+
value: "status",
|
|
903
|
+
label: n(l("settings.colorByStatus"))
|
|
904
|
+
}
|
|
905
|
+
],
|
|
906
|
+
e.colorAssociation,
|
|
907
|
+
void 0,
|
|
908
|
+
e.colorAssociation === "status" ? `${n(l("settings.colorByNote"))} ${n(l("settings.colorByStatusNote"))}` : n(l("settings.colorByNote"))
|
|
909
|
+
),
|
|
910
|
+
D(
|
|
911
|
+
"showCancelled",
|
|
912
|
+
n(l("settings.showCancelled")),
|
|
913
|
+
e.showCancelled
|
|
914
|
+
),
|
|
915
|
+
f(
|
|
916
|
+
"careDescription",
|
|
917
|
+
n(l("settings.careDescription")),
|
|
918
|
+
[
|
|
919
|
+
{ value: "off", label: n(l("settings.careOff")) },
|
|
920
|
+
{ value: "name", label: n(l("settings.careName")) },
|
|
921
|
+
{ value: "code", label: n(l("settings.careCode")) },
|
|
922
|
+
{
|
|
923
|
+
value: "nameCode",
|
|
924
|
+
label: n(l("settings.careNameCode"))
|
|
925
|
+
}
|
|
926
|
+
],
|
|
927
|
+
e.careDescription
|
|
928
|
+
),
|
|
929
|
+
D("showTime", n(l("settings.showTime")), e.showTime),
|
|
930
|
+
D(
|
|
931
|
+
"showCardContext",
|
|
932
|
+
n("calendar.card.showContext"),
|
|
933
|
+
e.showCardContext ?? !1
|
|
934
|
+
)
|
|
935
|
+
]
|
|
936
|
+
}
|
|
937
|
+
),
|
|
938
|
+
/* @__PURE__ */ t(
|
|
939
|
+
U,
|
|
940
|
+
{
|
|
941
|
+
variant: "outlined",
|
|
942
|
+
headingLevel: 4,
|
|
943
|
+
title: n("calendar.card.legend"),
|
|
944
|
+
children: /* @__PURE__ */ h("ul", { className: "ds:m-0 ds:list-none ds:p-0 ds:space-y-[var(--spacing-xs)]", children: [
|
|
945
|
+
Object.entries(Re).map(([p, k]) => /* @__PURE__ */ h(
|
|
946
|
+
"li",
|
|
947
|
+
{
|
|
948
|
+
className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)] type-body-sm",
|
|
949
|
+
children: [
|
|
950
|
+
/* @__PURE__ */ t(k, { "aria-hidden": "true", className: "ds:size-4 ds:shrink-0" }),
|
|
951
|
+
n(We[p])
|
|
952
|
+
]
|
|
953
|
+
},
|
|
954
|
+
p
|
|
955
|
+
)),
|
|
956
|
+
ze.map(({ field: p, Icon: k, labelKey: M }) => /* @__PURE__ */ h(
|
|
957
|
+
"li",
|
|
958
|
+
{
|
|
959
|
+
className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)] type-body-sm",
|
|
960
|
+
children: [
|
|
961
|
+
/* @__PURE__ */ t(k, { "aria-hidden": "true", className: "ds:size-4 ds:shrink-0" }),
|
|
962
|
+
n(M)
|
|
963
|
+
]
|
|
964
|
+
},
|
|
965
|
+
p
|
|
966
|
+
)),
|
|
967
|
+
/* @__PURE__ */ t("li", { className: "type-body-sm", children: n("calendar.card.moreLegend") })
|
|
968
|
+
] })
|
|
969
|
+
}
|
|
970
|
+
),
|
|
971
|
+
/* @__PURE__ */ h(
|
|
972
|
+
U,
|
|
973
|
+
{
|
|
974
|
+
variant: "outlined",
|
|
975
|
+
headingLevel: 4,
|
|
976
|
+
title: n(l("settings.sectionNames")),
|
|
977
|
+
children: [
|
|
978
|
+
f(
|
|
979
|
+
"operatorNameDisplay",
|
|
980
|
+
n(N("settings.operatorNames")),
|
|
981
|
+
[
|
|
982
|
+
{ value: "full", label: n(N("settings.operatorFull")) },
|
|
983
|
+
{
|
|
984
|
+
value: "initials",
|
|
985
|
+
label: n(N("settings.operatorInitials"))
|
|
986
|
+
}
|
|
987
|
+
],
|
|
988
|
+
e.operatorNameDisplay
|
|
989
|
+
),
|
|
990
|
+
r ? f(
|
|
991
|
+
"operatorListMode",
|
|
992
|
+
n(N("settings.operatorList")),
|
|
993
|
+
[
|
|
994
|
+
{
|
|
995
|
+
value: "grouped",
|
|
996
|
+
label: n(N("settings.operatorListGrouped"))
|
|
997
|
+
},
|
|
998
|
+
{
|
|
999
|
+
value: "flat",
|
|
1000
|
+
label: n(N("settings.operatorListFlat"))
|
|
1001
|
+
}
|
|
1002
|
+
],
|
|
1003
|
+
e.operatorListMode ?? "grouped"
|
|
1004
|
+
) : null,
|
|
1005
|
+
f(
|
|
1006
|
+
"chairNameDisplay",
|
|
1007
|
+
n(N("settings.chairNames")),
|
|
1008
|
+
[
|
|
1009
|
+
{ value: "full", label: n(N("settings.chairFull")) },
|
|
1010
|
+
{ value: "short", label: n(N("settings.chairShort")) }
|
|
1011
|
+
],
|
|
1012
|
+
e.chairNameDisplay
|
|
1013
|
+
),
|
|
1014
|
+
f(
|
|
1015
|
+
"defaultDurationMin",
|
|
1016
|
+
n(N("settings.defaultDuration")),
|
|
1017
|
+
C,
|
|
1018
|
+
String(e.defaultDurationMin),
|
|
1019
|
+
Number
|
|
1020
|
+
),
|
|
1021
|
+
D("mapsLink", n(N("settings.mapsLink")), e.mapsLink)
|
|
1022
|
+
]
|
|
1023
|
+
}
|
|
1024
|
+
)
|
|
1025
|
+
]
|
|
1026
|
+
}
|
|
1027
|
+
),
|
|
1028
|
+
ie(g) ? /* @__PURE__ */ t(
|
|
1029
|
+
qe,
|
|
1030
|
+
{
|
|
1031
|
+
seam: g,
|
|
1032
|
+
idPrefix: ae,
|
|
1033
|
+
onBusyChange: b,
|
|
1034
|
+
onDirtyChange: y,
|
|
1035
|
+
onHoursOpened: S,
|
|
1036
|
+
onSettingChanged: x
|
|
1037
|
+
}
|
|
1038
|
+
) : null,
|
|
1039
|
+
I ? /* @__PURE__ */ t("p", { className: "ds:m-0 ds:mt-[var(--spacing-md)] type-body-sm", children: /* @__PURE__ */ t(me, { href: I, external: !0, children: n(l("settings.academyTutorial")) }) }) : null
|
|
1040
|
+
] });
|
|
1041
|
+
}
|
|
1042
|
+
function Dt({
|
|
1043
|
+
open: e,
|
|
1044
|
+
onOpenChange: s,
|
|
1045
|
+
display: i,
|
|
1046
|
+
onChange: a,
|
|
1047
|
+
hiddenDays: c,
|
|
1048
|
+
onHiddenDaysChange: m,
|
|
1049
|
+
onReset: r,
|
|
1050
|
+
practiceHours: d,
|
|
1051
|
+
isMonth: g = !1,
|
|
1052
|
+
hasOperatorGroups: x = !1,
|
|
1053
|
+
academyHref: S,
|
|
1054
|
+
returnFocusRef: b,
|
|
1055
|
+
practiceSettings: y,
|
|
1056
|
+
onPracticeSettingChanged: W,
|
|
1057
|
+
onHoursOpened: n,
|
|
1058
|
+
closeRequestRef: v
|
|
1059
|
+
}) {
|
|
1060
|
+
const { t: l } = G("ui"), N = (T) => `calendarWorkspace.${T}`, [_, O] = E(!1), [B, I] = E(!1), [u, C] = E(!1), f = ie(y), D = _ && f, p = B && f, k = (T) => {
|
|
1061
|
+
if (!(!T && D)) {
|
|
1062
|
+
if (!T && p) {
|
|
1063
|
+
C(!0);
|
|
1064
|
+
return;
|
|
1065
|
+
}
|
|
1066
|
+
s(T);
|
|
1067
|
+
}
|
|
1068
|
+
}, M = z(() => {
|
|
1069
|
+
});
|
|
1070
|
+
M.current = () => k(!1), P(() => {
|
|
1071
|
+
if (v)
|
|
1072
|
+
return v.current = () => M.current(), () => {
|
|
1073
|
+
v.current = null;
|
|
1074
|
+
};
|
|
1075
|
+
}, [v]);
|
|
1076
|
+
const K = Q();
|
|
1077
|
+
return /* @__PURE__ */ h(se, { children: [
|
|
1078
|
+
/* @__PURE__ */ t(
|
|
1079
|
+
q,
|
|
1080
|
+
{
|
|
1081
|
+
id: ae,
|
|
1082
|
+
open: e,
|
|
1083
|
+
onOpenChange: k,
|
|
1084
|
+
modal: !1,
|
|
1085
|
+
children: /* @__PURE__ */ h(
|
|
1086
|
+
q.Content,
|
|
1087
|
+
{
|
|
1088
|
+
side: "end",
|
|
1089
|
+
size: "md",
|
|
1090
|
+
"aria-describedby": g ? K : void 0,
|
|
1091
|
+
onInteractOutside: (T) => T.preventDefault(),
|
|
1092
|
+
onCloseAutoFocus: (T) => {
|
|
1093
|
+
var F;
|
|
1094
|
+
T.preventDefault(), (F = b == null ? void 0 : b.current) == null || F.focus();
|
|
1095
|
+
},
|
|
1096
|
+
children: [
|
|
1097
|
+
/* @__PURE__ */ t(q.Header, { children: /* @__PURE__ */ t(q.Title, { children: l(N("settings.title")) }) }),
|
|
1098
|
+
/* @__PURE__ */ t(q.Body, { children: /* @__PURE__ */ t(
|
|
1099
|
+
Ce,
|
|
1100
|
+
{
|
|
1101
|
+
display: i,
|
|
1102
|
+
onChange: a,
|
|
1103
|
+
hiddenDays: c,
|
|
1104
|
+
onHiddenDaysChange: m,
|
|
1105
|
+
practiceHours: d,
|
|
1106
|
+
isMonth: g,
|
|
1107
|
+
hasOperatorGroups: x,
|
|
1108
|
+
academyHref: S,
|
|
1109
|
+
practiceSettings: y,
|
|
1110
|
+
onPracticeSettingChanged: W,
|
|
1111
|
+
onHoursOpened: n,
|
|
1112
|
+
onPracticeBusyChange: O,
|
|
1113
|
+
onPracticeDirtyChange: I,
|
|
1114
|
+
monthNoteId: K
|
|
1115
|
+
}
|
|
1116
|
+
) }),
|
|
1117
|
+
/* @__PURE__ */ t(q.Footer, { children: /* @__PURE__ */ t(
|
|
1118
|
+
$,
|
|
1119
|
+
{
|
|
1120
|
+
type: "button",
|
|
1121
|
+
intent: "outline",
|
|
1122
|
+
startIcon: /* @__PURE__ */ t(he, { "aria-hidden": !0 }),
|
|
1123
|
+
onClick: r,
|
|
1124
|
+
children: l("common.resetToDefaults")
|
|
1125
|
+
}
|
|
1126
|
+
) })
|
|
1127
|
+
]
|
|
1128
|
+
}
|
|
1129
|
+
)
|
|
1130
|
+
}
|
|
1131
|
+
),
|
|
1132
|
+
/* @__PURE__ */ t(
|
|
1133
|
+
A,
|
|
1134
|
+
{
|
|
1135
|
+
open: e && u,
|
|
1136
|
+
onOpenChange: (T) => {
|
|
1137
|
+
T || C(!1);
|
|
1138
|
+
},
|
|
1139
|
+
children: /* @__PURE__ */ h(A.Content, { size: "sm", variant: "alert", children: [
|
|
1140
|
+
/* @__PURE__ */ h(A.Header, { children: [
|
|
1141
|
+
/* @__PURE__ */ t(A.Title, { children: l(N("settings.practiceDiscardTitle")) }),
|
|
1142
|
+
/* @__PURE__ */ t(A.Description, { children: l(N("settings.practiceDiscardBody")) })
|
|
1143
|
+
] }),
|
|
1144
|
+
/* @__PURE__ */ h(A.Footer, { children: [
|
|
1145
|
+
/* @__PURE__ */ t(
|
|
1146
|
+
$,
|
|
1147
|
+
{
|
|
1148
|
+
type: "button",
|
|
1149
|
+
intent: "secondary",
|
|
1150
|
+
onClick: () => C(!1),
|
|
1151
|
+
children: l(N("settings.practiceKeepEditing"))
|
|
1152
|
+
}
|
|
1153
|
+
),
|
|
1154
|
+
/* @__PURE__ */ t(
|
|
1155
|
+
$,
|
|
1156
|
+
{
|
|
1157
|
+
type: "button",
|
|
1158
|
+
intent: "destructive",
|
|
1159
|
+
onClick: () => {
|
|
1160
|
+
C(!1), s(!1);
|
|
1161
|
+
},
|
|
1162
|
+
children: l(N("settings.practiceDiscard"))
|
|
1163
|
+
}
|
|
1164
|
+
)
|
|
1165
|
+
] })
|
|
1166
|
+
] })
|
|
1167
|
+
}
|
|
1168
|
+
)
|
|
1169
|
+
] });
|
|
1170
|
+
}
|
|
1171
|
+
function Tt() {
|
|
1172
|
+
let e = null;
|
|
1173
|
+
const s = /* @__PURE__ */ new Set();
|
|
1174
|
+
return {
|
|
1175
|
+
publish: (i) => {
|
|
1176
|
+
e = i, s.forEach((a) => a());
|
|
1177
|
+
},
|
|
1178
|
+
subscribe: (i) => (s.add(i), () => s.delete(i)),
|
|
1179
|
+
getSnapshot: () => e,
|
|
1180
|
+
guard: { dirty: !1, busy: !1, holdFocus: null },
|
|
1181
|
+
buttonRef: { current: null }
|
|
1182
|
+
};
|
|
1183
|
+
}
|
|
1184
|
+
function Et({
|
|
1185
|
+
bridge: e
|
|
1186
|
+
}) {
|
|
1187
|
+
const s = Ee(
|
|
1188
|
+
e.subscribe,
|
|
1189
|
+
e.getSnapshot,
|
|
1190
|
+
e.getSnapshot
|
|
1191
|
+
);
|
|
1192
|
+
return s ? /* @__PURE__ */ t(Je, { ...s, bridge: e }) : null;
|
|
1193
|
+
}
|
|
1194
|
+
function Je({
|
|
1195
|
+
bridge: e,
|
|
1196
|
+
onReset: s,
|
|
1197
|
+
...i
|
|
1198
|
+
}) {
|
|
1199
|
+
const { t: a } = G("ui"), c = z(null), m = ie(i.practiceSettings), { guard: r } = e;
|
|
1200
|
+
return P(() => {
|
|
1201
|
+
const d = requestAnimationFrame(() => {
|
|
1202
|
+
const g = c.current;
|
|
1203
|
+
g && !g.contains(document.activeElement) && g.focus({ preventScroll: !0 });
|
|
1204
|
+
});
|
|
1205
|
+
return () => cancelAnimationFrame(d);
|
|
1206
|
+
}, []), P(() => (r.holdFocus = () => {
|
|
1207
|
+
requestAnimationFrame(
|
|
1208
|
+
() => requestAnimationFrame(() => {
|
|
1209
|
+
var x;
|
|
1210
|
+
const d = c.current;
|
|
1211
|
+
(x = (d == null ? void 0 : d.querySelector('[aria-busy="true"]')) ?? d) == null || x.focus({ preventScroll: !0 });
|
|
1212
|
+
})
|
|
1213
|
+
);
|
|
1214
|
+
}, () => {
|
|
1215
|
+
r.holdFocus = null;
|
|
1216
|
+
}), [r]), P(() => {
|
|
1217
|
+
m || (r.dirty = !1, r.busy = !1);
|
|
1218
|
+
}, [m, r]), P(
|
|
1219
|
+
() => () => {
|
|
1220
|
+
r.dirty = !1, r.busy = !1;
|
|
1221
|
+
},
|
|
1222
|
+
[r]
|
|
1223
|
+
), /* @__PURE__ */ h(
|
|
1224
|
+
"div",
|
|
1225
|
+
{
|
|
1226
|
+
ref: c,
|
|
1227
|
+
tabIndex: -1,
|
|
1228
|
+
"data-component": "calendar-settings-panel",
|
|
1229
|
+
className: "ds:flex ds:flex-col ds:focus-visible:outline-none",
|
|
1230
|
+
children: [
|
|
1231
|
+
/* @__PURE__ */ t(
|
|
1232
|
+
Ie,
|
|
1233
|
+
{
|
|
1234
|
+
title: a("calendarWorkspace.settings.title"),
|
|
1235
|
+
icon: /* @__PURE__ */ t(Be, { "aria-hidden": "true" }),
|
|
1236
|
+
sticky: !0,
|
|
1237
|
+
divider: !0
|
|
1238
|
+
}
|
|
1239
|
+
),
|
|
1240
|
+
/* @__PURE__ */ h("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-lg)] ds:p-[var(--spacing-md)]", children: [
|
|
1241
|
+
/* @__PURE__ */ t(
|
|
1242
|
+
Ce,
|
|
1243
|
+
{
|
|
1244
|
+
...i,
|
|
1245
|
+
onPracticeBusyChange: (d) => {
|
|
1246
|
+
r.busy = d;
|
|
1247
|
+
},
|
|
1248
|
+
onPracticeDirtyChange: (d) => {
|
|
1249
|
+
r.dirty = d;
|
|
1250
|
+
}
|
|
1251
|
+
}
|
|
1252
|
+
),
|
|
1253
|
+
/* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
|
|
1254
|
+
$,
|
|
1255
|
+
{
|
|
1256
|
+
type: "button",
|
|
1257
|
+
intent: "outline",
|
|
1258
|
+
startIcon: /* @__PURE__ */ t(he, { "aria-hidden": !0 }),
|
|
1259
|
+
onClick: s,
|
|
1260
|
+
children: a("common.resetToDefaults")
|
|
1261
|
+
}
|
|
1262
|
+
) })
|
|
1263
|
+
] })
|
|
1264
|
+
]
|
|
1265
|
+
}
|
|
1266
|
+
);
|
|
1267
|
+
}
|
|
1268
|
+
function Qe({
|
|
1269
|
+
onKeep: e,
|
|
1270
|
+
onDiscard: s,
|
|
1271
|
+
scope: i = "settings"
|
|
1272
|
+
}) {
|
|
1273
|
+
const { t: a } = G("ui");
|
|
1274
|
+
return /* @__PURE__ */ t(
|
|
1275
|
+
A,
|
|
1276
|
+
{
|
|
1277
|
+
open: !0,
|
|
1278
|
+
onOpenChange: (c) => {
|
|
1279
|
+
c || e();
|
|
1280
|
+
},
|
|
1281
|
+
children: /* @__PURE__ */ h(A.Content, { size: "sm", variant: "alert", children: [
|
|
1282
|
+
/* @__PURE__ */ h(A.Header, { children: [
|
|
1283
|
+
/* @__PURE__ */ t(A.Title, { children: a("calendarWorkspace.settings.practiceDiscardTitle") }),
|
|
1284
|
+
/* @__PURE__ */ t(A.Description, { children: a(i === "editor" ? "calendarWorkspace.editor.discardBody" : "calendarWorkspace.settings.practiceDiscardBody") })
|
|
1285
|
+
] }),
|
|
1286
|
+
/* @__PURE__ */ h(A.Footer, { children: [
|
|
1287
|
+
/* @__PURE__ */ t($, { type: "button", intent: "secondary", onClick: e, children: a("calendarWorkspace.settings.practiceKeepEditing") }),
|
|
1288
|
+
/* @__PURE__ */ t($, { type: "button", intent: "destructive", onClick: s, children: a("calendarWorkspace.settings.practiceDiscard") })
|
|
1289
|
+
] })
|
|
1290
|
+
] })
|
|
1291
|
+
}
|
|
1292
|
+
);
|
|
1293
|
+
}
|
|
1294
|
+
function At(e) {
|
|
1295
|
+
const [s] = E($e), i = e ?? s, [a, c] = E(null), m = z(null);
|
|
1296
|
+
i.ask = (g) => {
|
|
1297
|
+
if (!i.dirty) {
|
|
1298
|
+
g();
|
|
1299
|
+
return;
|
|
1300
|
+
}
|
|
1301
|
+
m.current = document.activeElement instanceof HTMLElement ? document.activeElement : null, c({ proceed: g });
|
|
1302
|
+
};
|
|
1303
|
+
const r = Ae(
|
|
1304
|
+
(g) => i.ask(g),
|
|
1305
|
+
[i]
|
|
1306
|
+
);
|
|
1307
|
+
return { guard: i, requestClose: r, discardDialog: a ? /* @__PURE__ */ t(
|
|
1308
|
+
Qe,
|
|
1309
|
+
{
|
|
1310
|
+
scope: "editor",
|
|
1311
|
+
onKeep: () => {
|
|
1312
|
+
c(null), requestAnimationFrame(() => {
|
|
1313
|
+
var g;
|
|
1314
|
+
(g = m.current) != null && g.isConnected && m.current.focus();
|
|
1315
|
+
});
|
|
1316
|
+
},
|
|
1317
|
+
onDiscard: () => {
|
|
1318
|
+
const { proceed: g } = a;
|
|
1319
|
+
c(null), i.dirty = !1, g();
|
|
1320
|
+
}
|
|
1321
|
+
}
|
|
1322
|
+
) : null };
|
|
1323
|
+
}
|
|
1324
|
+
export {
|
|
1325
|
+
ae as C,
|
|
1326
|
+
Dt as a,
|
|
1327
|
+
Ce as b,
|
|
1328
|
+
St as c,
|
|
1329
|
+
xt as d,
|
|
1330
|
+
Tt as e,
|
|
1331
|
+
Qe as f,
|
|
1332
|
+
Et as g,
|
|
1333
|
+
wt as r,
|
|
1334
|
+
At as u
|
|
1335
|
+
};
|
|
1336
|
+
//# sourceMappingURL=calendar-editor-discard-host-DjUhoFr2.js.map
|