@eka-care/medassist-widget 0.1.103-dev.0 → 0.1.103
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/{medassist-widget-DoctorCard-DPTTWCx3.js → medassist-widget-DoctorCard-mWAGl3MK.js}
RENAMED
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
import { C as
|
|
3
|
-
import { M as
|
|
4
|
-
import { C as
|
|
5
|
-
const
|
|
1
|
+
import { c as k, d as m, A as R, y as S, u as e, i as f, C as X, T as A, q, _ as de, j as me, k as he, l as pe, m as fe, n as ue, o as xe, S as Z, p as ge, I as ye, r as be, B as w, s as ve, t as we } from "./medassist-widget.js";
|
|
2
|
+
import { C as ke } from "./medassist-widget-check-BaHLRs-2.js";
|
|
3
|
+
import { M as D } from "./medassist-widget-map-pin-Bx-5lPdC.js";
|
|
4
|
+
import { C as Ne, a as Ce } from "./medassist-widget-chevron-right-CKYbGWbY.js";
|
|
5
|
+
const _e = [
|
|
6
6
|
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
7
7
|
["path", { d: "m12 5 7 7-7 7", key: "xquz4c" }]
|
|
8
|
-
],
|
|
9
|
-
const
|
|
8
|
+
], ee = k("arrow-right", _e);
|
|
9
|
+
const $e = [
|
|
10
10
|
["path", { d: "M8 2v4", key: "1cmpym" }],
|
|
11
11
|
["path", { d: "M16 2v4", key: "4m81vk" }],
|
|
12
12
|
["path", { d: "M21 13V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h8", key: "3spt84" }],
|
|
13
13
|
["path", { d: "M3 10h18", key: "8toen8" }],
|
|
14
14
|
["path", { d: "m17 22 5-5", key: "1k6ppv" }],
|
|
15
15
|
["path", { d: "m17 17 5 5", key: "p7ous7" }]
|
|
16
|
-
],
|
|
17
|
-
const
|
|
16
|
+
], Se = k("calendar-x-2", $e);
|
|
17
|
+
const Me = [
|
|
18
18
|
["path", { d: "M12 6v6l4 2", key: "mmk7yg" }],
|
|
19
19
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]
|
|
20
|
-
],
|
|
21
|
-
const
|
|
20
|
+
], Be = k("clock", Me);
|
|
21
|
+
const Ae = [
|
|
22
22
|
["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
|
|
23
23
|
["circle", { cx: "19", cy: "12", r: "1", key: "1wjl8i" }],
|
|
24
24
|
["circle", { cx: "5", cy: "12", r: "1", key: "1pcz8c" }]
|
|
25
|
-
],
|
|
26
|
-
const
|
|
25
|
+
], He = k("ellipsis", Ae);
|
|
26
|
+
const je = [
|
|
27
27
|
["path", { d: "M15 3h6v6", key: "1q9fwt" }],
|
|
28
28
|
["path", { d: "M10 14 21 3", key: "gplh6r" }],
|
|
29
29
|
["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
|
|
30
|
-
],
|
|
31
|
-
const
|
|
30
|
+
], Le = k("external-link", je);
|
|
31
|
+
const Ie = [
|
|
32
32
|
["path", { d: "m5 8 6 6", key: "1wu5hv" }],
|
|
33
33
|
["path", { d: "m4 14 6-6 2-3", key: "1k1g8d" }],
|
|
34
34
|
["path", { d: "M2 5h12", key: "or177f" }],
|
|
35
35
|
["path", { d: "M7 2h1", key: "1t2jsx" }],
|
|
36
36
|
["path", { d: "m22 22-5-10-5 10", key: "don7ne" }],
|
|
37
37
|
["path", { d: "M14 18h6", key: "1m8k6r" }]
|
|
38
|
-
],
|
|
39
|
-
const
|
|
38
|
+
], ze = k("languages", Ie);
|
|
39
|
+
const Ee = [
|
|
40
40
|
["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
|
|
41
41
|
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
|
|
42
|
-
],
|
|
43
|
-
function
|
|
44
|
-
value:
|
|
42
|
+
], Oe = k("search", Ee);
|
|
43
|
+
function Ve({
|
|
44
|
+
value: s,
|
|
45
45
|
onValueChange: a,
|
|
46
46
|
placeholder: h = "Select an option",
|
|
47
47
|
className: p,
|
|
48
48
|
triggerClassName: H,
|
|
49
|
-
contentClassName:
|
|
49
|
+
contentClassName: M,
|
|
50
50
|
disabled: c = !1,
|
|
51
|
-
options:
|
|
51
|
+
options: N = [],
|
|
52
52
|
size: F = "default",
|
|
53
53
|
icon: j
|
|
54
54
|
}) {
|
|
55
|
-
const [u,
|
|
56
|
-
|
|
55
|
+
const [u, C] = m(!1), l = R(null), b = R(null), d = N.find((o) => o.value === s);
|
|
56
|
+
S(() => {
|
|
57
57
|
const o = (g) => {
|
|
58
|
-
u && g.key === "Escape" && (
|
|
58
|
+
u && g.key === "Escape" && (C(!1), b.current?.focus());
|
|
59
59
|
};
|
|
60
60
|
return document.addEventListener("keydown", o), () => {
|
|
61
61
|
document.removeEventListener("keydown", o);
|
|
62
62
|
};
|
|
63
63
|
}, [u]);
|
|
64
|
-
const
|
|
65
|
-
a?.(o),
|
|
64
|
+
const _ = (o) => {
|
|
65
|
+
a?.(o), C(!1), b.current?.focus();
|
|
66
66
|
}, x = () => {
|
|
67
|
-
c ||
|
|
67
|
+
c || C(!u);
|
|
68
68
|
};
|
|
69
69
|
return /* @__PURE__ */ e("div", { className: f("relative w-full", p), children: [
|
|
70
70
|
/* @__PURE__ */ e(
|
|
@@ -111,15 +111,15 @@ function Oe({
|
|
|
111
111
|
ref: l,
|
|
112
112
|
className: f(
|
|
113
113
|
"bg-surface text-foreground animate-in fade-in-0 zoom-in-95 slide-in-from-top-2 relative z-50 max-h-[136px] min-w-[8rem] w-full overflow-x-hidden overflow-y-auto overscroll-contain rounded-md shadow-md mt-1",
|
|
114
|
-
|
|
114
|
+
M
|
|
115
115
|
),
|
|
116
116
|
role: "listbox",
|
|
117
|
-
children: /* @__PURE__ */ e("div", { className: "p-1", children:
|
|
118
|
-
const g = o.value ===
|
|
117
|
+
children: /* @__PURE__ */ e("div", { className: "p-1", children: N.length === 0 ? /* @__PURE__ */ e("div", { className: "px-3 py-2 text-sm text-muted-foreground text-center", children: "No options available" }) : N.map((o) => {
|
|
118
|
+
const g = o.value === s;
|
|
119
119
|
return /* @__PURE__ */ e(
|
|
120
120
|
"div",
|
|
121
121
|
{
|
|
122
|
-
onClick: () =>
|
|
122
|
+
onClick: () => _(o.value),
|
|
123
123
|
className: f(
|
|
124
124
|
"relative flex w-full cursor-pointer items-center gap-1 rounded-sm py-2.5 px-3 text-sm outline-none select-none transition-colors duration-150",
|
|
125
125
|
"hover:bg-accent hover:text-accent-foreground",
|
|
@@ -131,12 +131,12 @@ function Oe({
|
|
|
131
131
|
role: "option",
|
|
132
132
|
"aria-selected": g,
|
|
133
133
|
tabIndex: c ? -1 : 0,
|
|
134
|
-
onKeyDown: (
|
|
135
|
-
(
|
|
134
|
+
onKeyDown: ($) => {
|
|
135
|
+
($.key === "Enter" || $.key === " ") && ($.preventDefault(), c || _(o.value));
|
|
136
136
|
},
|
|
137
137
|
children: [
|
|
138
138
|
/* @__PURE__ */ e("span", { className: "flex-1 text-left min-w-0 break-words line-clamp-2", children: o.label }),
|
|
139
|
-
g && /* @__PURE__ */ e("span", { className: "absolute right-3 flex size-4 items-center justify-center shrink-0 pointer-events-none", children: /* @__PURE__ */ e(
|
|
139
|
+
g && /* @__PURE__ */ e("span", { className: "absolute right-3 flex size-4 items-center justify-center shrink-0 pointer-events-none", children: /* @__PURE__ */ e(ke, { className: "size-4 text-foreground" }) })
|
|
140
140
|
]
|
|
141
141
|
},
|
|
142
142
|
o.value
|
|
@@ -146,120 +146,120 @@ function Oe({
|
|
|
146
146
|
)
|
|
147
147
|
] });
|
|
148
148
|
}
|
|
149
|
-
function
|
|
149
|
+
function te({ date: s }) {
|
|
150
150
|
return /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center gap-3 pt-5 pb-4", children: [
|
|
151
|
-
/* @__PURE__ */ e("div", { className: "flex h-16 w-16 items-center justify-center rounded-full bg-black-100 dark:bg-white-100", children: /* @__PURE__ */ e(
|
|
152
|
-
/* @__PURE__ */ e("p", { className: "text-sm font-medium text-text-secondary text-center", children: `No slots available ${
|
|
151
|
+
/* @__PURE__ */ e("div", { className: "flex h-16 w-16 items-center justify-center rounded-full bg-black-100 dark:bg-white-100", children: /* @__PURE__ */ e(Se, { className: "h-7 w-7 text-text-secondary", "aria-hidden": !0 }) }),
|
|
152
|
+
/* @__PURE__ */ e("p", { className: "text-sm font-medium text-text-secondary text-center", children: `No slots available ${s && `on ${s}` || ""}` })
|
|
153
153
|
] });
|
|
154
154
|
}
|
|
155
|
-
function
|
|
156
|
-
const
|
|
155
|
+
function Pe({ doctor: s, doctorDetails: a, onSelect: h, disabled: p, isActive: H = !0 }) {
|
|
156
|
+
const M = A(() => {
|
|
157
157
|
if (a?.hospitals?.[0]?.hospital_id)
|
|
158
158
|
return a?.hospitals?.[0]?.hospital_id;
|
|
159
|
-
}, [a?.hospitals]), [c,
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
}, [
|
|
163
|
-
const t =
|
|
159
|
+
}, [a?.hospitals]), [c, N] = m(M), [F, j] = m(!1), [u, C] = m(!1), [l, b] = m(null), [d, _] = m(null), [x, o] = m(0), [g, $] = m(!1), [L, J] = m(!1), [B, Q] = m(!1), [I, U] = m(!1), [P, ae] = m(!1), [v, K] = m(null), G = R(!1), z = R(null);
|
|
160
|
+
S(() => {
|
|
161
|
+
N(M);
|
|
162
|
+
}, [M]), S(() => {
|
|
163
|
+
const t = s?.preferred_date;
|
|
164
164
|
t && b(t);
|
|
165
|
-
}, [
|
|
166
|
-
const n =
|
|
167
|
-
if (!
|
|
165
|
+
}, [s]);
|
|
166
|
+
const n = s.availability ?? [], re = q(async () => {
|
|
167
|
+
if (!B && (J(!0), !n.length && h && a)) {
|
|
168
168
|
Q(!0);
|
|
169
169
|
try {
|
|
170
|
-
await h({ ...
|
|
170
|
+
await h({ ...s, hospital_id: c });
|
|
171
171
|
} finally {
|
|
172
172
|
Q(!1);
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
|
-
}, [L,
|
|
175
|
+
}, [L, B, h, a, n.length, c]), ne = q(
|
|
176
176
|
(t) => {
|
|
177
|
-
a && (
|
|
177
|
+
a && (N(t), b(null), _(null), o(0), G.current = !1, h?.({ ...s, hospital_id: t }));
|
|
178
178
|
},
|
|
179
|
-
[
|
|
179
|
+
[s, h, a]
|
|
180
180
|
);
|
|
181
|
-
|
|
181
|
+
S(() => {
|
|
182
182
|
H || J(!1);
|
|
183
|
-
}, [H]),
|
|
183
|
+
}, [H]), S(() => {
|
|
184
184
|
if (!L || !n.length || G.current) return;
|
|
185
185
|
G.current = !0;
|
|
186
|
-
const t =
|
|
187
|
-
t && (b((
|
|
188
|
-
}, [n, L]),
|
|
189
|
-
if (!
|
|
190
|
-
const t = n.findIndex((
|
|
186
|
+
const t = s.preferred_date || n[0]?.date;
|
|
187
|
+
t && (b((i) => i ?? t), n.find((i) => i.date === t)?.slots?.length || h?.({ ...s, hospital_id: c, preferred_date: t }));
|
|
188
|
+
}, [n, L]), S(() => {
|
|
189
|
+
if (!v) return;
|
|
190
|
+
const t = n.findIndex((i) => i.date === v);
|
|
191
191
|
if (t === -1) return;
|
|
192
192
|
const r = Math.max(0, n.length - 3);
|
|
193
193
|
o(Math.min(t, r)), K(null);
|
|
194
|
-
}, [n,
|
|
194
|
+
}, [n, v]);
|
|
195
195
|
const E = A(
|
|
196
196
|
() => n.find((t) => t.date === l)?.slots ?? [],
|
|
197
197
|
[n, l]
|
|
198
198
|
);
|
|
199
|
-
|
|
199
|
+
de(() => {
|
|
200
200
|
const t = z.current;
|
|
201
201
|
t && (t.scrollTop = 0, U(t.scrollHeight > t.clientHeight + 2));
|
|
202
202
|
}, [l, E.length]);
|
|
203
|
-
const
|
|
203
|
+
const ie = q(() => {
|
|
204
204
|
const t = z.current;
|
|
205
205
|
t && U(t.scrollTop + t.clientHeight < t.scrollHeight - 4);
|
|
206
|
-
}, []),
|
|
206
|
+
}, []), se = () => {
|
|
207
207
|
z.current?.scrollBy({ top: 120, behavior: "smooth" });
|
|
208
|
-
},
|
|
208
|
+
}, le = A(() => {
|
|
209
209
|
if (!n.length) return [];
|
|
210
210
|
const t = Math.min(x + 3, n.length);
|
|
211
211
|
return n.slice(x, t).map((r) => {
|
|
212
212
|
if (r.date)
|
|
213
|
-
return { ...r, ...
|
|
213
|
+
return { ...r, ...me(r.date) };
|
|
214
214
|
});
|
|
215
|
-
}, [n, x]),
|
|
215
|
+
}, [n, x]), oe = x > 0, O = q(
|
|
216
216
|
async (t) => {
|
|
217
|
-
b(t),
|
|
218
|
-
const r = n.find((
|
|
217
|
+
b(t), _(null), $(!1);
|
|
218
|
+
const r = n.find((i) => i.date === t);
|
|
219
219
|
if (!(r?.slots?.length || Array.isArray(r?.slots) && r?.slots.length === 0)) {
|
|
220
220
|
j(!0);
|
|
221
221
|
try {
|
|
222
|
-
await h?.({ ...
|
|
222
|
+
await h?.({ ...s, hospital_id: c, preferred_date: t });
|
|
223
223
|
} catch {
|
|
224
224
|
} finally {
|
|
225
225
|
j(!1);
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
228
|
},
|
|
229
|
-
[
|
|
230
|
-
), y = A(() => n.find((r) => r.date === l)?.cta ??
|
|
229
|
+
[s, c, h, n]
|
|
230
|
+
), y = A(() => n.find((r) => r.date === l)?.cta ?? s.cta, [n, l, s.cta]), V = A(() => p || u || !y?.text && !l, [p, y, l, u]), W = async () => {
|
|
231
231
|
if (!u)
|
|
232
232
|
try {
|
|
233
|
-
|
|
234
|
-
const t = y?.text, r = !!t,
|
|
233
|
+
C(!0);
|
|
234
|
+
const t = y?.text, r = !!t, i = l && d ? ` on ${l} at ${d}.` : "";
|
|
235
235
|
await h?.(
|
|
236
|
-
{ ...
|
|
237
|
-
`${t || `I want to book an appointment with Dr. ${a?.name}`}${
|
|
236
|
+
{ ...s, hospital_id: c, preferred_date: l ?? void 0, preferred_slot_time: d ?? void 0 },
|
|
237
|
+
`${t || `I want to book an appointment with Dr. ${a?.name}`}${i}`,
|
|
238
238
|
y?.tool_result,
|
|
239
239
|
!r
|
|
240
240
|
), K(l);
|
|
241
241
|
} catch {
|
|
242
242
|
} finally {
|
|
243
|
-
|
|
243
|
+
C(!1);
|
|
244
244
|
}
|
|
245
|
-
},
|
|
245
|
+
}, ce = () => {
|
|
246
246
|
if (g) return;
|
|
247
247
|
const t = y?.text, r = !!t;
|
|
248
248
|
if (!r && !l) return;
|
|
249
|
-
|
|
250
|
-
const
|
|
249
|
+
$(!0);
|
|
250
|
+
const i = l && d ? ` on ${l} at ${d}.` : "";
|
|
251
251
|
h?.(
|
|
252
|
-
{ ...
|
|
253
|
-
`${t || `I want to book an appointment with Dr. ${a?.name}`}${
|
|
252
|
+
{ ...s, hospital_id: c, preferred_date: l ?? void 0, preferred_slot_time: d ?? void 0 },
|
|
253
|
+
`${t || `I want to book an appointment with Dr. ${a?.name}`}${i}`,
|
|
254
254
|
y?.tool_result,
|
|
255
255
|
!r
|
|
256
256
|
);
|
|
257
257
|
};
|
|
258
|
-
return a ? /* @__PURE__ */ e(
|
|
259
|
-
/* @__PURE__ */ e(
|
|
260
|
-
/* @__PURE__ */ e(
|
|
261
|
-
a.profile_pic && /* @__PURE__ */ e(
|
|
262
|
-
/* @__PURE__ */ e(
|
|
258
|
+
return a ? /* @__PURE__ */ e(we, { className: "max-w-md h-full rounded-xl border border-black-200 dark:border-white-200 shadow-none p-0 bg-elicitationBg overflow-hidden", children: [
|
|
259
|
+
/* @__PURE__ */ e(he, { className: "flex flex-row items-center gap-3 bg-primary/[20%] rounded-t-xl p-2 border-b border-border-subtle overflow-hidden", children: [
|
|
260
|
+
/* @__PURE__ */ e(pe, { className: "h-12 w-12 ring-2 ring-primary/20 flex-shrink-0", children: [
|
|
261
|
+
a.profile_pic && /* @__PURE__ */ e(fe, { src: a.profile_pic, alt: `${a.name} profile photo`, crossOrigin: "anonymous" }),
|
|
262
|
+
/* @__PURE__ */ e(ue, { className: "bg-secondary text-primary", children: xe(a.name) })
|
|
263
263
|
] }),
|
|
264
264
|
/* @__PURE__ */ e("div", { className: "min-w-0", children: [
|
|
265
265
|
/* @__PURE__ */ e("h3", { className: "font-bold text-slate-900 leading-tight", style: { fontSize: "0.95rem" }, children: [
|
|
@@ -272,7 +272,7 @@ function Fe({ doctor: i, doctorDetails: a, onSelect: h, disabled: p, isActive: H
|
|
|
272
272
|
rel: "noreferrer",
|
|
273
273
|
"aria-label": "View profile",
|
|
274
274
|
className: "inline-block align-middle ml-2 text-primary hover:text-primary/70 transition-colors",
|
|
275
|
-
children: /* @__PURE__ */ e(
|
|
275
|
+
children: /* @__PURE__ */ e(Le, { className: "h-3.5 w-3.5 inline", "aria-hidden": !0 })
|
|
276
276
|
}
|
|
277
277
|
)
|
|
278
278
|
] }),
|
|
@@ -283,7 +283,7 @@ function Fe({ doctor: i, doctorDetails: a, onSelect: h, disabled: p, isActive: H
|
|
|
283
283
|
title: `${a.specialty}${a.experience ? ` • ${a.experience}` : ""}`,
|
|
284
284
|
children: [
|
|
285
285
|
a.specialty,
|
|
286
|
-
a.experience && /* @__PURE__ */ e(
|
|
286
|
+
a.experience && /* @__PURE__ */ e(Z, { children: [
|
|
287
287
|
" • ",
|
|
288
288
|
a.experience
|
|
289
289
|
] })
|
|
@@ -292,33 +292,33 @@ function Fe({ doctor: i, doctorDetails: a, onSelect: h, disabled: p, isActive: H
|
|
|
292
292
|
)
|
|
293
293
|
] })
|
|
294
294
|
] }),
|
|
295
|
-
/* @__PURE__ */ e(
|
|
295
|
+
/* @__PURE__ */ e(ge, { className: "px-3 py-2", children: [
|
|
296
296
|
/* @__PURE__ */ e("div", { className: "grid gap-1 pb-2 border-b border-border-subtle", children: [
|
|
297
297
|
a.timings && /* @__PURE__ */ e("div", { className: "flex items-start gap-2 min-w-0", children: [
|
|
298
|
-
/* @__PURE__ */ e(
|
|
298
|
+
/* @__PURE__ */ e(Be, { className: "h-3.5 w-3.5 text-primary mt-0.5 flex-shrink-0", "aria-hidden": !0 }),
|
|
299
299
|
/* @__PURE__ */ e("span", { className: "text-text-secondary text-xs line-clamp-1 min-w-0", children: a.timings })
|
|
300
300
|
] }),
|
|
301
301
|
a.languages && /* @__PURE__ */ e("div", { className: "flex items-center gap-2 min-w-0", children: [
|
|
302
|
-
/* @__PURE__ */ e(
|
|
302
|
+
/* @__PURE__ */ e(ze, { className: "h-3.5 w-3.5 text-primary flex-shrink-0", "aria-hidden": !0 }),
|
|
303
303
|
/* @__PURE__ */ e("span", { className: "text-text-secondary text-xs line-clamp-1 min-w-0", children: a.languages })
|
|
304
304
|
] }),
|
|
305
305
|
a.hospitals?.length > 1 && c ? /* @__PURE__ */ e(
|
|
306
|
-
|
|
306
|
+
Ve,
|
|
307
307
|
{
|
|
308
308
|
options: a.hospitals.map((t) => ({ value: t.hospital_id, label: t.name || "" })),
|
|
309
309
|
placeholder: "Select Hospital",
|
|
310
310
|
disabled: p,
|
|
311
|
-
onValueChange:
|
|
311
|
+
onValueChange: ne,
|
|
312
312
|
value: c,
|
|
313
313
|
triggerClassName: "h-8 text-xs px-3 rounded-lg border-border text-primary font-medium",
|
|
314
|
-
icon: /* @__PURE__ */ e(
|
|
314
|
+
icon: /* @__PURE__ */ e(D, { className: "h-3.5 w-3.5 text-primary flex-shrink-0", "aria-hidden": !0 })
|
|
315
315
|
}
|
|
316
316
|
) : /* @__PURE__ */ e("div", { className: "flex items-center gap-1.5 min-w-0", children: [
|
|
317
|
-
/* @__PURE__ */ e(
|
|
317
|
+
/* @__PURE__ */ e(D, { className: "h-3.5 w-3.5 text-primary flex-shrink-0", "aria-hidden": !0 }),
|
|
318
318
|
/* @__PURE__ */ e("span", { className: "text-text-secondary text-xs line-clamp-1 min-w-0", children: a.hospitals?.[0]?.name || "" })
|
|
319
319
|
] }),
|
|
320
320
|
a.info && /* @__PURE__ */ e("div", { className: "flex items-start gap-2 min-w-0", children: [
|
|
321
|
-
/* @__PURE__ */ e(
|
|
321
|
+
/* @__PURE__ */ e(ye, { className: "h-3.5 w-3.5 text-primary flex-shrink-0", "aria-hidden": !0 }),
|
|
322
322
|
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: [
|
|
323
323
|
/* @__PURE__ */ e(
|
|
324
324
|
"div",
|
|
@@ -327,18 +327,18 @@ function Fe({ doctor: i, doctorDetails: a, onSelect: h, disabled: p, isActive: H
|
|
|
327
327
|
"text-text-secondary text-xs leading-snug prose prose-sm max-w-none prose-strong:font-semibold prose-p:my-0 break-words overflow-hidden",
|
|
328
328
|
!P && "line-clamp-1"
|
|
329
329
|
),
|
|
330
|
-
children: /* @__PURE__ */ e(
|
|
330
|
+
children: /* @__PURE__ */ e(be, { children: a.info })
|
|
331
331
|
}
|
|
332
332
|
),
|
|
333
333
|
/* @__PURE__ */ e(
|
|
334
334
|
"button",
|
|
335
335
|
{
|
|
336
336
|
type: "button",
|
|
337
|
-
onClick: () =>
|
|
337
|
+
onClick: () => ae((t) => !t),
|
|
338
338
|
"aria-expanded": P,
|
|
339
339
|
className: "mt-0.5 flex items-center gap-1 text-[11px] font-semibold text-primary hover:text-primary/80 transition-colors",
|
|
340
340
|
children: [
|
|
341
|
-
/* @__PURE__ */ e(
|
|
341
|
+
/* @__PURE__ */ e(He, { className: "h-3.5 w-3.5", "aria-hidden": !0 }),
|
|
342
342
|
P ? "View less" : "View more"
|
|
343
343
|
]
|
|
344
344
|
}
|
|
@@ -346,10 +346,10 @@ function Fe({ doctor: i, doctorDetails: a, onSelect: h, disabled: p, isActive: H
|
|
|
346
346
|
] })
|
|
347
347
|
] })
|
|
348
348
|
] }),
|
|
349
|
-
L ?
|
|
349
|
+
L ? B ? /* @__PURE__ */ e("p", { className: "pt-3 text-sm text-text-secondary text-center", children: "Loading..." }) : n.length > 0 ? /* @__PURE__ */ e("div", { className: "pt-3", children: [
|
|
350
350
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: [
|
|
351
351
|
/* @__PURE__ */ e(
|
|
352
|
-
|
|
352
|
+
w,
|
|
353
353
|
{
|
|
354
354
|
type: "button",
|
|
355
355
|
variant: "outline",
|
|
@@ -360,26 +360,26 @@ function Fe({ doctor: i, doctorDetails: a, onSelect: h, disabled: p, isActive: H
|
|
|
360
360
|
const r = n[t]?.date;
|
|
361
361
|
r && O(r);
|
|
362
362
|
},
|
|
363
|
-
disabled: p || !
|
|
363
|
+
disabled: p || !oe,
|
|
364
364
|
"aria-label": "Previous 3 days",
|
|
365
365
|
className: "h-8 w-8 flex-shrink-0 rounded-md border-primary/20 bg-surface text-primary hover:bg-surface-secondary disabled:opacity-50",
|
|
366
|
-
children: /* @__PURE__ */ e(
|
|
366
|
+
children: /* @__PURE__ */ e(Ne, { className: "h-4 w-4" })
|
|
367
367
|
}
|
|
368
368
|
),
|
|
369
|
-
/* @__PURE__ */ e("div", { className: "flex-1 grid grid-cols-3 gap-1 min-w-0", children:
|
|
369
|
+
/* @__PURE__ */ e("div", { className: "flex-1 grid grid-cols-3 gap-1 min-w-0", children: le.map((t, r) => {
|
|
370
370
|
if (!t || !t.date) return null;
|
|
371
|
-
const
|
|
371
|
+
const i = l === t.date, T = (t?.slots || []).length > 0;
|
|
372
372
|
return /* @__PURE__ */ e(
|
|
373
|
-
|
|
373
|
+
w,
|
|
374
374
|
{
|
|
375
375
|
type: "button",
|
|
376
376
|
variant: "outline",
|
|
377
377
|
onClick: () => t.date && O(t.date),
|
|
378
378
|
disabled: p,
|
|
379
|
-
"aria-current":
|
|
379
|
+
"aria-current": i ? "date" : void 0,
|
|
380
380
|
className: f(
|
|
381
381
|
"flex flex-col items-center justify-center h-12 rounded-lg border-2 p-2 gap-0.5 min-w-0 transition-all",
|
|
382
|
-
|
|
382
|
+
i ? "border-primary border-2 ring-2 ring-primary/20 bg-primary/[20%] shadow-sm hover:text-accent-foreground" : T ? "border-primary/30 bg-elicitationBg hover:bg-primary/10 hover:text-accent-foreground hover:border-primary/40" : "border-border bg-elicitationBg opacity-60 hover:bg-primary/10 hover:text-accent-foreground hover:border-primary/30"
|
|
383
383
|
),
|
|
384
384
|
children: [
|
|
385
385
|
/* @__PURE__ */ e("span", { className: f("text-[10px] tracking-wide w-full text-center font-medium"), children: t.weekday }),
|
|
@@ -390,17 +390,17 @@ function Fe({ doctor: i, doctorDetails: a, onSelect: h, disabled: p, isActive: H
|
|
|
390
390
|
);
|
|
391
391
|
}) }),
|
|
392
392
|
/* @__PURE__ */ e(
|
|
393
|
-
|
|
393
|
+
w,
|
|
394
394
|
{
|
|
395
395
|
type: "button",
|
|
396
396
|
variant: "outline",
|
|
397
397
|
size: "icon",
|
|
398
398
|
onClick: () => {
|
|
399
399
|
if (x + 3 >= n.length) {
|
|
400
|
-
const
|
|
401
|
-
if (
|
|
402
|
-
const
|
|
403
|
-
K(
|
|
400
|
+
const i = n[n.length - 1]?.date, T = v && (!i || v > i) ? v : i;
|
|
401
|
+
if (T) {
|
|
402
|
+
const Y = ve(T, 1);
|
|
403
|
+
K(Y), O(Y);
|
|
404
404
|
}
|
|
405
405
|
return;
|
|
406
406
|
}
|
|
@@ -412,7 +412,7 @@ function Fe({ doctor: i, doctorDetails: a, onSelect: h, disabled: p, isActive: H
|
|
|
412
412
|
disabled: p,
|
|
413
413
|
"aria-label": "Next 3 days",
|
|
414
414
|
className: "h-8 w-8 flex-shrink-0 rounded-md border-primary/20 bg-surface text-primary hover:bg-surface-secondary disabled:opacity-50",
|
|
415
|
-
children: /* @__PURE__ */ e(
|
|
415
|
+
children: /* @__PURE__ */ e(Ce, { className: "h-4 w-4" })
|
|
416
416
|
}
|
|
417
417
|
)
|
|
418
418
|
] }),
|
|
@@ -421,23 +421,23 @@ function Fe({ doctor: i, doctorDetails: a, onSelect: h, disabled: p, isActive: H
|
|
|
421
421
|
"div",
|
|
422
422
|
{
|
|
423
423
|
ref: z,
|
|
424
|
-
onScroll:
|
|
424
|
+
onScroll: ie,
|
|
425
425
|
className: "grid grid-cols-3 gap-2 overflow-y-auto overscroll-contain",
|
|
426
426
|
style: { maxHeight: "108px" },
|
|
427
427
|
children: E.map((t, r) => {
|
|
428
428
|
if (!t) return null;
|
|
429
|
-
const
|
|
429
|
+
const i = d === t;
|
|
430
430
|
return /* @__PURE__ */ e(
|
|
431
|
-
|
|
431
|
+
w,
|
|
432
432
|
{
|
|
433
433
|
type: "button",
|
|
434
434
|
variant: "outline",
|
|
435
|
-
onClick: () =>
|
|
436
|
-
"aria-pressed":
|
|
435
|
+
onClick: () => _(t),
|
|
436
|
+
"aria-pressed": i,
|
|
437
437
|
disabled: p,
|
|
438
438
|
className: f(
|
|
439
439
|
"h-9 rounded-lg px-2 text-xs font-medium transition-all",
|
|
440
|
-
|
|
440
|
+
i ? "border-primary bg-primary/20 text-primary shadow-sm hover:bg-primary/10" : "border-border bg-elicitationBg text-text-primary hover:bg-primary/10 hover:border-primary/30"
|
|
441
441
|
),
|
|
442
442
|
children: /* @__PURE__ */ e("span", { children: t })
|
|
443
443
|
},
|
|
@@ -450,7 +450,7 @@ function Fe({ doctor: i, doctorDetails: a, onSelect: h, disabled: p, isActive: H
|
|
|
450
450
|
"button",
|
|
451
451
|
{
|
|
452
452
|
type: "button",
|
|
453
|
-
onClick:
|
|
453
|
+
onClick: se,
|
|
454
454
|
className: "pointer-events-auto flex items-center gap-1 text-xs font-semibold text-primary hover:text-primary/80 transition-colors",
|
|
455
455
|
children: [
|
|
456
456
|
/* @__PURE__ */ e(X, { className: "h-3.5 w-3.5", "aria-hidden": !0 }),
|
|
@@ -458,22 +458,22 @@ function Fe({ doctor: i, doctorDetails: a, onSelect: h, disabled: p, isActive: H
|
|
|
458
458
|
]
|
|
459
459
|
}
|
|
460
460
|
) })
|
|
461
|
-
] }) : F ? /* @__PURE__ */ e("p", { className: "text-sm text-text-secondary px-1", children: "Fetching slots..." }) : /* @__PURE__ */ e(
|
|
461
|
+
] }) : F ? /* @__PURE__ */ e("p", { className: "text-sm text-text-secondary px-1", children: "Fetching slots..." }) : /* @__PURE__ */ e(te, { date: v }) }),
|
|
462
462
|
E?.length ? /* @__PURE__ */ e(
|
|
463
|
-
|
|
463
|
+
w,
|
|
464
464
|
{
|
|
465
465
|
type: "button",
|
|
466
|
-
onClick:
|
|
466
|
+
onClick: ce,
|
|
467
467
|
disabled: g || p || !d,
|
|
468
468
|
"aria-disabled": g || p || !d,
|
|
469
469
|
className: `w-full h-10 gap-2 bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-60 shadow-sm font-semibold ${I ? "" : " mt-2"}`,
|
|
470
470
|
children: [
|
|
471
471
|
y?.title || "Book appointment",
|
|
472
|
-
/* @__PURE__ */ e(
|
|
472
|
+
/* @__PURE__ */ e(ee, { className: "h-4 w-4", "aria-hidden": !0 })
|
|
473
473
|
]
|
|
474
474
|
}
|
|
475
475
|
) : /* @__PURE__ */ e(
|
|
476
|
-
|
|
476
|
+
w,
|
|
477
477
|
{
|
|
478
478
|
type: "button",
|
|
479
479
|
onClick: W,
|
|
@@ -482,14 +482,14 @@ function Fe({ doctor: i, doctorDetails: a, onSelect: h, disabled: p, isActive: H
|
|
|
482
482
|
className: `w-full h-10 gap-2 bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-60 shadow-sm font-semibold ${I ? "" : " mt-2"}`,
|
|
483
483
|
children: [
|
|
484
484
|
y?.title || "Book appointment",
|
|
485
|
-
/* @__PURE__ */ e(
|
|
485
|
+
/* @__PURE__ */ e(ee, { className: "h-4 w-4", "aria-hidden": !0 })
|
|
486
486
|
]
|
|
487
487
|
}
|
|
488
488
|
)
|
|
489
|
-
] }) : /* @__PURE__ */ e(
|
|
490
|
-
/* @__PURE__ */ e(
|
|
489
|
+
] }) : /* @__PURE__ */ e(Z, { children: [
|
|
490
|
+
/* @__PURE__ */ e(te, { date: v }),
|
|
491
491
|
/* @__PURE__ */ e(
|
|
492
|
-
|
|
492
|
+
w,
|
|
493
493
|
{
|
|
494
494
|
type: "button",
|
|
495
495
|
onClick: W,
|
|
@@ -498,20 +498,20 @@ function Fe({ doctor: i, doctorDetails: a, onSelect: h, disabled: p, isActive: H
|
|
|
498
498
|
className: `w-full h-10 gap-2 bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-60 shadow-sm font-semibold ${I ? "" : " mt-2"}`,
|
|
499
499
|
children: [
|
|
500
500
|
y?.title || "Book appointment",
|
|
501
|
-
/* @__PURE__ */ e(
|
|
501
|
+
/* @__PURE__ */ e(Oe, { className: "h-4 w-4", "aria-hidden": !0 })
|
|
502
502
|
]
|
|
503
503
|
}
|
|
504
504
|
)
|
|
505
505
|
] }) : /* @__PURE__ */ e("div", { className: "pt-3", children: /* @__PURE__ */ e(
|
|
506
|
-
|
|
506
|
+
w,
|
|
507
507
|
{
|
|
508
508
|
type: "button",
|
|
509
509
|
variant: "outline",
|
|
510
|
-
onClick:
|
|
511
|
-
disabled: p ||
|
|
510
|
+
onClick: re,
|
|
511
|
+
disabled: p || B,
|
|
512
512
|
className: "w-full h-8 gap-1.5 text-xs border-primary/40 text-primary hover:bg-primary/10 disabled:opacity-60 font-medium rounded-lg",
|
|
513
513
|
children: [
|
|
514
|
-
|
|
514
|
+
B ? "Loading..." : "Show available slots",
|
|
515
515
|
/* @__PURE__ */ e(X, { className: "h-3.5 w-3.5", "aria-hidden": !0 })
|
|
516
516
|
]
|
|
517
517
|
}
|
|
@@ -520,5 +520,5 @@ function Fe({ doctor: i, doctorDetails: a, onSelect: h, disabled: p, isActive: H
|
|
|
520
520
|
] }) : null;
|
|
521
521
|
}
|
|
522
522
|
export {
|
|
523
|
-
|
|
523
|
+
Pe as DoctorCard
|
|
524
524
|
};
|
package/dist/medassist-widget.js
CHANGED
|
@@ -12182,7 +12182,7 @@ const sm = $e(
|
|
|
12182
12182
|
), am = $e(
|
|
12183
12183
|
() => import("./medassist-widget-FocusCarousel-BsLIZftX.js").then((e) => ({ default: e.FocusCarousel }))
|
|
12184
12184
|
), lm = $e(
|
|
12185
|
-
() => import("./medassist-widget-DoctorCard-
|
|
12185
|
+
() => import("./medassist-widget-DoctorCard-mWAGl3MK.js").then((e) => ({ default: e.DoctorCard }))
|
|
12186
12186
|
), cm = $e(
|
|
12187
12187
|
() => import("./medassist-widget-CardList-ERXsOZEA.js").then((e) => ({ default: e.CardList }))
|
|
12188
12188
|
), dm = $e(
|