@eka-care/medassist-widget 0.1.107-dev.0 → 0.1.107-dev.2
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-DH9Bk806.js → medassist-widget-DoctorCard-H-PKOqlH.js}
RENAMED
|
@@ -1,92 +1,92 @@
|
|
|
1
|
-
import { c as k, d as
|
|
1
|
+
import { c as k, d as f, A as P, y as L, u as e, i as u, C as Y, T as A, q, _ as de, j as he, k as me, l as pe, m as fe, n as ue, o as xe, S as U, p as ge, I as be, r as ye, B as w, s as ve, t as we, v as ke, a as W } from "./medassist-widget.js";
|
|
2
2
|
import { C as Ne } from "./medassist-widget-check-BaHLRs-2.js";
|
|
3
|
-
import { M as
|
|
3
|
+
import { M as Z } from "./medassist-widget-map-pin-Bx-5lPdC.js";
|
|
4
4
|
import { C as Ce, a as _e } from "./medassist-widget-chevron-right-CKYbGWbY.js";
|
|
5
|
-
const
|
|
5
|
+
const Se = [
|
|
6
6
|
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
7
7
|
["path", { d: "m12 5 7 7-7 7", key: "xquz4c" }]
|
|
8
|
-
],
|
|
9
|
-
const
|
|
8
|
+
], D = k("arrow-right", Se);
|
|
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
|
-
], Me = k("calendar-x-2",
|
|
17
|
-
const
|
|
16
|
+
], Me = k("calendar-x-2", $e);
|
|
17
|
+
const Ae = [
|
|
18
18
|
["path", { d: "M12 6v6l4 2", key: "mmk7yg" }],
|
|
19
19
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]
|
|
20
|
-
],
|
|
21
|
-
const
|
|
20
|
+
], Le = k("clock", Ae);
|
|
21
|
+
const Be = [
|
|
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
|
+
], Te = k("ellipsis", Be);
|
|
26
|
+
const Ee = [
|
|
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
|
+
], He = k("external-link", Ee);
|
|
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
|
-
],
|
|
38
|
+
], je = k("languages", Ie);
|
|
39
39
|
const Oe = [
|
|
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
|
|
42
|
+
], ze = k("search", Oe);
|
|
43
|
+
function Ve({
|
|
44
44
|
value: l,
|
|
45
|
-
onValueChange:
|
|
45
|
+
onValueChange: r,
|
|
46
46
|
placeholder: m = "Select an option",
|
|
47
47
|
className: p,
|
|
48
|
-
triggerClassName:
|
|
49
|
-
contentClassName:
|
|
48
|
+
triggerClassName: B,
|
|
49
|
+
contentClassName: $,
|
|
50
50
|
disabled: c = !1,
|
|
51
51
|
options: N = [],
|
|
52
|
-
size:
|
|
53
|
-
icon:
|
|
52
|
+
size: R = "default",
|
|
53
|
+
icon: T
|
|
54
54
|
}) {
|
|
55
|
-
const [
|
|
56
|
-
|
|
57
|
-
const o = (
|
|
58
|
-
|
|
55
|
+
const [x, C] = f(!1), i = P(null), g = P(null), d = N.find((o) => o.value === l);
|
|
56
|
+
L(() => {
|
|
57
|
+
const o = (y) => {
|
|
58
|
+
x && y.key === "Escape" && (C(!1), g.current?.focus());
|
|
59
59
|
};
|
|
60
60
|
return document.addEventListener("keydown", o), () => {
|
|
61
61
|
document.removeEventListener("keydown", o);
|
|
62
62
|
};
|
|
63
|
-
}, [
|
|
63
|
+
}, [x]);
|
|
64
64
|
const _ = (o) => {
|
|
65
|
-
|
|
66
|
-
},
|
|
67
|
-
c || C(!
|
|
65
|
+
r?.(o), C(!1), g.current?.focus();
|
|
66
|
+
}, b = () => {
|
|
67
|
+
c || C(!x);
|
|
68
68
|
};
|
|
69
|
-
return /* @__PURE__ */ e("div", { className:
|
|
69
|
+
return /* @__PURE__ */ e("div", { className: u("relative w-full", p), children: [
|
|
70
70
|
/* @__PURE__ */ e(
|
|
71
71
|
"button",
|
|
72
72
|
{
|
|
73
|
-
ref:
|
|
73
|
+
ref: g,
|
|
74
74
|
type: "button",
|
|
75
|
-
onClick:
|
|
75
|
+
onClick: b,
|
|
76
76
|
disabled: c,
|
|
77
|
-
className:
|
|
77
|
+
className: u(
|
|
78
78
|
'border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*="text-"])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-full items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 overflow-hidden',
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
R === "default" ? "min-h-9" : "min-h-8",
|
|
80
|
+
B
|
|
81
81
|
),
|
|
82
|
-
"aria-expanded":
|
|
82
|
+
"aria-expanded": x,
|
|
83
83
|
"aria-haspopup": "listbox",
|
|
84
84
|
children: [
|
|
85
|
-
|
|
85
|
+
T,
|
|
86
86
|
/* @__PURE__ */ e(
|
|
87
87
|
"span",
|
|
88
88
|
{
|
|
89
|
-
className:
|
|
89
|
+
className: u(
|
|
90
90
|
"flex-1 text-left min-w-0 overflow-hidden break-words line-clamp-2",
|
|
91
91
|
!d && "text-muted-foreground"
|
|
92
92
|
),
|
|
@@ -94,49 +94,49 @@ function Te({
|
|
|
94
94
|
}
|
|
95
95
|
),
|
|
96
96
|
/* @__PURE__ */ e(
|
|
97
|
-
|
|
97
|
+
Y,
|
|
98
98
|
{
|
|
99
|
-
className:
|
|
99
|
+
className: u(
|
|
100
100
|
"size-4 opacity-50 pointer-events-none shrink-0 transition-transform duration-200",
|
|
101
|
-
|
|
101
|
+
x && "rotate-180"
|
|
102
102
|
)
|
|
103
103
|
}
|
|
104
104
|
)
|
|
105
105
|
]
|
|
106
106
|
}
|
|
107
107
|
),
|
|
108
|
-
|
|
108
|
+
x && /* @__PURE__ */ e(
|
|
109
109
|
"div",
|
|
110
110
|
{
|
|
111
|
-
ref:
|
|
112
|
-
className:
|
|
111
|
+
ref: i,
|
|
112
|
+
className: u(
|
|
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
|
+
$
|
|
115
115
|
),
|
|
116
116
|
role: "listbox",
|
|
117
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
|
|
118
|
+
const y = o.value === l;
|
|
119
119
|
return /* @__PURE__ */ e(
|
|
120
120
|
"div",
|
|
121
121
|
{
|
|
122
122
|
onClick: () => _(o.value),
|
|
123
|
-
className:
|
|
123
|
+
className: u(
|
|
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",
|
|
126
126
|
"focus-visible:bg-accent focus-visible:text-accent-foreground",
|
|
127
127
|
"active:bg-accent/80",
|
|
128
|
-
|
|
128
|
+
y && "bg-accent/50 text-foreground",
|
|
129
129
|
c && "pointer-events-none opacity-50 cursor-not-allowed"
|
|
130
130
|
),
|
|
131
131
|
role: "option",
|
|
132
|
-
"aria-selected":
|
|
132
|
+
"aria-selected": y,
|
|
133
133
|
tabIndex: c ? -1 : 0,
|
|
134
|
-
onKeyDown: (
|
|
135
|
-
(
|
|
134
|
+
onKeyDown: (S) => {
|
|
135
|
+
(S.key === "Enter" || S.key === " ") && (S.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
|
-
|
|
139
|
+
y && /* @__PURE__ */ e("span", { className: "absolute right-3 flex size-4 items-center justify-center shrink-0 pointer-events-none", children: /* @__PURE__ */ e(Ne, { className: "size-4 text-foreground" }) })
|
|
140
140
|
]
|
|
141
141
|
},
|
|
142
142
|
o.value
|
|
@@ -146,133 +146,132 @@ function Te({
|
|
|
146
146
|
)
|
|
147
147
|
] });
|
|
148
148
|
}
|
|
149
|
-
function
|
|
149
|
+
function ee({ date: l }) {
|
|
150
150
|
return /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center gap-3 pt-5 pb-4", children: [
|
|
151
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(Me, { className: "h-7 w-7 text-text-secondary", "aria-hidden": !0 }) }),
|
|
152
152
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium text-text-secondary text-center", children: `No slots available ${l && `on ${ke(l)}` || ""}` })
|
|
153
153
|
] });
|
|
154
154
|
}
|
|
155
|
-
function Ke({ doctor: l, doctorDetails:
|
|
156
|
-
const
|
|
157
|
-
if (
|
|
158
|
-
return
|
|
159
|
-
}, [
|
|
160
|
-
|
|
161
|
-
N(
|
|
162
|
-
}, [
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
const n = l.availability ?? [], re = q(async () => {
|
|
167
|
-
if (!B && (J(!0), !n.length && m && a)) {
|
|
168
|
-
Q(!0);
|
|
155
|
+
function Ke({ doctor: l, doctorDetails: r, onSelect: m, disabled: p, isActive: B = !0 }) {
|
|
156
|
+
const $ = A(() => {
|
|
157
|
+
if (r?.hospitals?.[0]?.hospital_id)
|
|
158
|
+
return r?.hospitals?.[0]?.hospital_id;
|
|
159
|
+
}, [r?.hospitals]), [c, N] = f($), [R, T] = f(!1), [x, C] = f(!1), [i, g] = f(null), [d, _] = f(null), [b, o] = f(0), [y, S] = f(!1), [E, G] = f(!1), [M, X] = f(!1), [H, J] = f(!1), [F, te] = f(!1), K = P(!1), I = P(null);
|
|
160
|
+
L(() => {
|
|
161
|
+
N($);
|
|
162
|
+
}, [$]);
|
|
163
|
+
const n = l.availability ?? [], ae = q(async () => {
|
|
164
|
+
if (!M && (G(!0), !n.length && m && r)) {
|
|
165
|
+
X(!0);
|
|
169
166
|
try {
|
|
170
167
|
await m({ ...l, hospital_id: c });
|
|
171
168
|
} finally {
|
|
172
|
-
|
|
169
|
+
X(!1);
|
|
173
170
|
}
|
|
174
171
|
}
|
|
175
|
-
}, [
|
|
172
|
+
}, [E, M, m, r, n.length, c]), re = q(
|
|
176
173
|
(t) => {
|
|
177
|
-
|
|
174
|
+
r && (N(t), g(null), _(null), o(0), K.current = !1, m?.({ ...l, hospital_id: t }));
|
|
178
175
|
},
|
|
179
|
-
[l, m,
|
|
176
|
+
[l, m, r]
|
|
180
177
|
);
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
}, [
|
|
184
|
-
if (!
|
|
185
|
-
|
|
186
|
-
const t = l.preferred_date || n[0]
|
|
187
|
-
|
|
188
|
-
}, [n,
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
const r = Math.max(0, n.length - 3);
|
|
193
|
-
o(Math.min(t, r)), K(null);
|
|
194
|
-
}, [n, v]);
|
|
195
|
-
const E = A(
|
|
196
|
-
() => n.find((t) => t.date === s)?.slots ?? [],
|
|
197
|
-
[n, s]
|
|
178
|
+
L(() => {
|
|
179
|
+
B || G(!1);
|
|
180
|
+
}, [B]), L(() => {
|
|
181
|
+
if (!E || !n.length || K.current) return;
|
|
182
|
+
K.current = !0;
|
|
183
|
+
const t = n.find((s) => s.date === l.preferred_date) || n[0], a = t.date;
|
|
184
|
+
a && (g(a), t.slots?.length || m?.({ ...l, hospital_id: c, preferred_date: a }));
|
|
185
|
+
}, [n, E, l.preferred_date]);
|
|
186
|
+
const j = A(
|
|
187
|
+
() => n.find((t) => t.date === i)?.slots ?? [],
|
|
188
|
+
[n, i]
|
|
198
189
|
);
|
|
199
190
|
de(() => {
|
|
200
|
-
const t =
|
|
201
|
-
t && (t.scrollTop = 0,
|
|
202
|
-
}, [
|
|
203
|
-
const
|
|
204
|
-
const t =
|
|
205
|
-
t &&
|
|
206
|
-
}, []),
|
|
207
|
-
|
|
208
|
-
},
|
|
191
|
+
const t = I.current;
|
|
192
|
+
t && (t.scrollTop = 0, J(t.scrollHeight > t.clientHeight + 2));
|
|
193
|
+
}, [i, j.length]);
|
|
194
|
+
const ne = q(() => {
|
|
195
|
+
const t = I.current;
|
|
196
|
+
t && J(t.scrollTop + t.clientHeight < t.scrollHeight - 4);
|
|
197
|
+
}, []), ie = () => {
|
|
198
|
+
I.current?.scrollBy({ top: 120, behavior: "smooth" });
|
|
199
|
+
}, le = A(() => {
|
|
209
200
|
if (!n.length) return [];
|
|
210
|
-
const t = Math.min(
|
|
211
|
-
return n.slice(
|
|
212
|
-
if (
|
|
213
|
-
return { ...
|
|
201
|
+
const t = Math.min(b + 3, n.length);
|
|
202
|
+
return n.slice(b, t).map((a) => {
|
|
203
|
+
if (a.date)
|
|
204
|
+
return { ...a, ...he(a.date) };
|
|
214
205
|
});
|
|
215
|
-
}, [n,
|
|
206
|
+
}, [n, b]), se = b > 0;
|
|
207
|
+
L(() => {
|
|
208
|
+
if (!i || n.length === 0) return;
|
|
209
|
+
const t = n.findIndex((a) => a.date === i);
|
|
210
|
+
t < 0 || o((a) => t >= a && t < a + 3 ? a : Math.min(t, Math.max(0, n.length - 3)));
|
|
211
|
+
}, [i, n]);
|
|
212
|
+
const O = q(
|
|
216
213
|
async (t) => {
|
|
217
|
-
|
|
218
|
-
const
|
|
219
|
-
if (!(
|
|
220
|
-
|
|
214
|
+
g(t), _(null), S(!1);
|
|
215
|
+
const a = n.find((s) => s.date === t);
|
|
216
|
+
if (!(a?.slots?.length || Array.isArray(a?.slots) && a?.slots.length === 0)) {
|
|
217
|
+
T(!0);
|
|
221
218
|
try {
|
|
222
219
|
await m?.({ ...l, hospital_id: c, preferred_date: t });
|
|
223
220
|
} catch {
|
|
224
221
|
} finally {
|
|
225
|
-
|
|
222
|
+
T(!1);
|
|
226
223
|
}
|
|
227
224
|
}
|
|
228
225
|
},
|
|
229
226
|
[l, c, m, n]
|
|
230
|
-
),
|
|
231
|
-
if (!
|
|
227
|
+
), h = A(() => n.find((a) => a.date === i)?.cta ?? l.cta, [n, i, l.cta]), z = A(() => p || x || !h?.text && !i, [p, h, i, x]), Q = async () => {
|
|
228
|
+
if (!x)
|
|
232
229
|
try {
|
|
233
230
|
C(!0);
|
|
234
|
-
|
|
231
|
+
let t;
|
|
232
|
+
g((ce) => (t = l?.preferred_date ?? ce, t));
|
|
233
|
+
const a = h?.text, s = !!a, v = h?.action ? h.action === W.SYNAPSE_CTA_ACTIONS.TOOL_CALL : !s, V = i && d ? ` on ${t} at ${d}.` : "";
|
|
235
234
|
await m?.(
|
|
236
|
-
{ ...l, hospital_id: c, preferred_date:
|
|
237
|
-
`${
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
)
|
|
235
|
+
{ ...l, hospital_id: c, preferred_date: t ?? void 0, preferred_slot_time: d ?? void 0 },
|
|
236
|
+
`${a || `I want to book an appointment with Dr. ${r?.name}`}${V}`,
|
|
237
|
+
h?.tool_result,
|
|
238
|
+
v
|
|
239
|
+
);
|
|
241
240
|
} catch {
|
|
242
241
|
} finally {
|
|
243
242
|
C(!1);
|
|
244
243
|
}
|
|
245
|
-
},
|
|
246
|
-
if (
|
|
247
|
-
const t =
|
|
248
|
-
if (!
|
|
249
|
-
|
|
250
|
-
const
|
|
244
|
+
}, oe = () => {
|
|
245
|
+
if (y) return;
|
|
246
|
+
const t = h?.text, a = !!t;
|
|
247
|
+
if (!a && !i) return;
|
|
248
|
+
S(!0);
|
|
249
|
+
const s = h?.action ? h.action === W.SYNAPSE_CTA_ACTIONS.TOOL_CALL : !a, v = i && d ? ` on ${i} at ${d}.` : "";
|
|
251
250
|
m?.(
|
|
252
|
-
{ ...l, hospital_id: c, preferred_date:
|
|
253
|
-
`${t || `I want to book an appointment with Dr. ${
|
|
254
|
-
|
|
255
|
-
|
|
251
|
+
{ ...l, hospital_id: c, preferred_date: i ?? void 0, preferred_slot_time: d ?? void 0 },
|
|
252
|
+
`${t || `I want to book an appointment with Dr. ${r?.name}`}${v}`,
|
|
253
|
+
h?.tool_result,
|
|
254
|
+
s
|
|
256
255
|
);
|
|
257
256
|
};
|
|
258
|
-
return
|
|
257
|
+
return r ? /* @__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
258
|
/* @__PURE__ */ e(me, { 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
259
|
/* @__PURE__ */ e(pe, { className: "h-12 w-12 ring-2 ring-primary/20 flex-shrink-0", children: [
|
|
261
|
-
|
|
262
|
-
/* @__PURE__ */ e(ue, { className: "bg-secondary text-primary", children: xe(
|
|
260
|
+
r.profile_pic && /* @__PURE__ */ e(fe, { src: r.profile_pic, alt: `${r.name} profile photo`, crossOrigin: "anonymous" }),
|
|
261
|
+
/* @__PURE__ */ e(ue, { className: "bg-secondary text-primary", children: xe(r.name) })
|
|
263
262
|
] }),
|
|
264
263
|
/* @__PURE__ */ e("div", { className: "min-w-0", children: [
|
|
265
264
|
/* @__PURE__ */ e("h3", { className: "font-bold text-slate-900 leading-tight", style: { fontSize: "0.95rem" }, children: [
|
|
266
|
-
/* @__PURE__ */ e("span", { children:
|
|
267
|
-
|
|
265
|
+
/* @__PURE__ */ e("span", { children: r.name }),
|
|
266
|
+
r.profile_link && /* @__PURE__ */ e(
|
|
268
267
|
"a",
|
|
269
268
|
{
|
|
270
|
-
href:
|
|
269
|
+
href: r.profile_link,
|
|
271
270
|
target: "_blank",
|
|
272
271
|
rel: "noreferrer",
|
|
273
272
|
"aria-label": "View profile",
|
|
274
273
|
className: "inline-block align-middle ml-2 text-primary hover:text-primary/70 transition-colors",
|
|
275
|
-
children: /* @__PURE__ */ e(
|
|
274
|
+
children: /* @__PURE__ */ e(He, { className: "h-3.5 w-3.5 inline", "aria-hidden": !0 })
|
|
276
275
|
}
|
|
277
276
|
)
|
|
278
277
|
] }),
|
|
@@ -280,12 +279,12 @@ function Ke({ doctor: l, doctorDetails: a, onSelect: m, disabled: p, isActive: H
|
|
|
280
279
|
"p",
|
|
281
280
|
{
|
|
282
281
|
className: "mt-0.5 text-xs text-slate-600 line-clamp-1 hover:line-clamp-none hover:whitespace-normal cursor-help",
|
|
283
|
-
title: `${
|
|
282
|
+
title: `${r.specialty}${r.experience ? ` • ${r.experience}` : ""}`,
|
|
284
283
|
children: [
|
|
285
|
-
|
|
286
|
-
|
|
284
|
+
r.specialty,
|
|
285
|
+
r.experience && /* @__PURE__ */ e(U, { children: [
|
|
287
286
|
" • ",
|
|
288
|
-
|
|
287
|
+
r.experience
|
|
289
288
|
] })
|
|
290
289
|
]
|
|
291
290
|
}
|
|
@@ -294,59 +293,59 @@ function Ke({ doctor: l, doctorDetails: a, onSelect: m, disabled: p, isActive: H
|
|
|
294
293
|
] }),
|
|
295
294
|
/* @__PURE__ */ e(ge, { className: "px-3 py-2", children: [
|
|
296
295
|
/* @__PURE__ */ e("div", { className: "grid gap-1 pb-2 border-b border-border-subtle", children: [
|
|
297
|
-
|
|
298
|
-
/* @__PURE__ */ e(
|
|
299
|
-
/* @__PURE__ */ e("span", { className: "text-text-secondary text-xs line-clamp-1 min-w-0", children:
|
|
296
|
+
r.timings && /* @__PURE__ */ e("div", { className: "flex items-start gap-2 min-w-0", children: [
|
|
297
|
+
/* @__PURE__ */ e(Le, { className: "h-3.5 w-3.5 text-primary mt-0.5 flex-shrink-0", "aria-hidden": !0 }),
|
|
298
|
+
/* @__PURE__ */ e("span", { className: "text-text-secondary text-xs line-clamp-1 min-w-0", children: r.timings })
|
|
300
299
|
] }),
|
|
301
|
-
|
|
302
|
-
/* @__PURE__ */ e(
|
|
303
|
-
/* @__PURE__ */ e("span", { className: "text-text-secondary text-xs line-clamp-1 min-w-0", children:
|
|
300
|
+
r.languages && /* @__PURE__ */ e("div", { className: "flex items-center gap-2 min-w-0", children: [
|
|
301
|
+
/* @__PURE__ */ e(je, { className: "h-3.5 w-3.5 text-primary flex-shrink-0", "aria-hidden": !0 }),
|
|
302
|
+
/* @__PURE__ */ e("span", { className: "text-text-secondary text-xs line-clamp-1 min-w-0", children: r.languages })
|
|
304
303
|
] }),
|
|
305
|
-
|
|
306
|
-
|
|
304
|
+
r.hospitals?.length > 1 && c ? /* @__PURE__ */ e(
|
|
305
|
+
Ve,
|
|
307
306
|
{
|
|
308
|
-
options:
|
|
307
|
+
options: r.hospitals.map((t) => ({ value: t.hospital_id, label: t.name || "" })),
|
|
309
308
|
placeholder: "Select Hospital",
|
|
310
309
|
disabled: p,
|
|
311
|
-
onValueChange:
|
|
310
|
+
onValueChange: re,
|
|
312
311
|
value: c,
|
|
313
312
|
triggerClassName: "h-8 text-xs px-3 rounded-lg border-border text-primary font-medium",
|
|
314
|
-
icon: /* @__PURE__ */ e(
|
|
313
|
+
icon: /* @__PURE__ */ e(Z, { className: "h-3.5 w-3.5 text-primary flex-shrink-0", "aria-hidden": !0 })
|
|
315
314
|
}
|
|
316
315
|
) : /* @__PURE__ */ e("div", { className: "flex items-center gap-1.5 min-w-0", children: [
|
|
317
|
-
/* @__PURE__ */ e(
|
|
318
|
-
/* @__PURE__ */ e("span", { className: "text-text-secondary text-xs line-clamp-1 min-w-0", children:
|
|
316
|
+
/* @__PURE__ */ e(Z, { className: "h-3.5 w-3.5 text-primary flex-shrink-0", "aria-hidden": !0 }),
|
|
317
|
+
/* @__PURE__ */ e("span", { className: "text-text-secondary text-xs line-clamp-1 min-w-0", children: r.hospitals?.[0]?.name || "" })
|
|
319
318
|
] }),
|
|
320
|
-
|
|
319
|
+
r.info && /* @__PURE__ */ e("div", { className: "flex items-start gap-2 min-w-0", children: [
|
|
321
320
|
/* @__PURE__ */ e(be, { className: "h-3.5 w-3.5 text-primary flex-shrink-0", "aria-hidden": !0 }),
|
|
322
321
|
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: [
|
|
323
322
|
/* @__PURE__ */ e(
|
|
324
323
|
"div",
|
|
325
324
|
{
|
|
326
|
-
className:
|
|
325
|
+
className: u(
|
|
327
326
|
"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
|
-
!
|
|
327
|
+
!F && "line-clamp-1"
|
|
329
328
|
),
|
|
330
|
-
children: /* @__PURE__ */ e(ye, { children:
|
|
329
|
+
children: /* @__PURE__ */ e(ye, { children: r.info })
|
|
331
330
|
}
|
|
332
331
|
),
|
|
333
332
|
/* @__PURE__ */ e(
|
|
334
333
|
"button",
|
|
335
334
|
{
|
|
336
335
|
type: "button",
|
|
337
|
-
onClick: () =>
|
|
338
|
-
"aria-expanded":
|
|
336
|
+
onClick: () => te((t) => !t),
|
|
337
|
+
"aria-expanded": F,
|
|
339
338
|
className: "mt-0.5 flex items-center gap-1 text-[11px] font-semibold text-primary hover:text-primary/80 transition-colors",
|
|
340
339
|
children: [
|
|
341
|
-
/* @__PURE__ */ e(
|
|
342
|
-
|
|
340
|
+
/* @__PURE__ */ e(Te, { className: "h-3.5 w-3.5", "aria-hidden": !0 }),
|
|
341
|
+
F ? "View less" : "View more"
|
|
343
342
|
]
|
|
344
343
|
}
|
|
345
344
|
)
|
|
346
345
|
] })
|
|
347
346
|
] })
|
|
348
347
|
] }),
|
|
349
|
-
|
|
348
|
+
E ? M ? /* @__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
349
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: [
|
|
351
350
|
/* @__PURE__ */ e(
|
|
352
351
|
w,
|
|
@@ -355,20 +354,20 @@ function Ke({ doctor: l, doctorDetails: a, onSelect: m, disabled: p, isActive: H
|
|
|
355
354
|
variant: "outline",
|
|
356
355
|
size: "icon",
|
|
357
356
|
onClick: () => {
|
|
358
|
-
const t = Math.max(0,
|
|
357
|
+
const t = Math.max(0, b - 3);
|
|
359
358
|
o(t);
|
|
360
|
-
const
|
|
361
|
-
|
|
359
|
+
const a = n[t]?.date;
|
|
360
|
+
a && O(a);
|
|
362
361
|
},
|
|
363
|
-
disabled: p || !
|
|
362
|
+
disabled: p || !se,
|
|
364
363
|
"aria-label": "Previous 3 days",
|
|
365
364
|
className: "h-12 w-6 flex-shrink-0 rounded-lg border-border bg-surface text-primary hover:bg-black-100 dark:hover:bg-white-100 hover:text-primary disabled:opacity-50",
|
|
366
365
|
children: /* @__PURE__ */ e(Ce, { className: "h-4 w-4" })
|
|
367
366
|
}
|
|
368
367
|
),
|
|
369
|
-
/* @__PURE__ */ e("div", { className: "flex-1 grid grid-cols-3 gap-1 min-w-0", children:
|
|
368
|
+
/* @__PURE__ */ e("div", { className: "flex-1 grid grid-cols-3 gap-1 min-w-0", children: le.map((t, a) => {
|
|
370
369
|
if (!t || !t.date) return null;
|
|
371
|
-
const
|
|
370
|
+
const s = i === t.date, v = (t?.slots || []).length > 0;
|
|
372
371
|
return /* @__PURE__ */ e(
|
|
373
372
|
w,
|
|
374
373
|
{
|
|
@@ -376,18 +375,18 @@ function Ke({ doctor: l, doctorDetails: a, onSelect: m, disabled: p, isActive: H
|
|
|
376
375
|
variant: "outline",
|
|
377
376
|
onClick: () => t.date && O(t.date),
|
|
378
377
|
disabled: p,
|
|
379
|
-
"aria-current":
|
|
380
|
-
className:
|
|
378
|
+
"aria-current": s ? "date" : void 0,
|
|
379
|
+
className: u(
|
|
381
380
|
"flex flex-col items-center justify-center h-12 rounded-lg border-2 p-0 gap-0 min-w-0 transition-all leading-tight",
|
|
382
|
-
|
|
381
|
+
s ? "border-primary border-2 ring-2 ring-primary/20 bg-primary/[20%] shadow-sm" : v ? "border-border bg-elicitationBg hover:bg-black-100 dark:hover:bg-white-100" : "border-border bg-elicitationBg opacity-60 hover:bg-black-100 dark:hover:bg-white-100"
|
|
383
382
|
),
|
|
384
383
|
children: [
|
|
385
384
|
/* @__PURE__ */ e(
|
|
386
385
|
"span",
|
|
387
386
|
{
|
|
388
|
-
className:
|
|
387
|
+
className: u(
|
|
389
388
|
"text-[10px] tracking-wide w-full text-center",
|
|
390
|
-
|
|
389
|
+
s ? "font-semibold text-text-primary" : "text-black-700"
|
|
391
390
|
),
|
|
392
391
|
children: t.weekday
|
|
393
392
|
}
|
|
@@ -395,9 +394,9 @@ function Ke({ doctor: l, doctorDetails: a, onSelect: m, disabled: p, isActive: H
|
|
|
395
394
|
/* @__PURE__ */ e(
|
|
396
395
|
"span",
|
|
397
396
|
{
|
|
398
|
-
className:
|
|
397
|
+
className: u(
|
|
399
398
|
"text-xs w-full text-center",
|
|
400
|
-
|
|
399
|
+
s ? "font-bold text-text-primary" : "font-semibold text-black-700"
|
|
401
400
|
),
|
|
402
401
|
children: [
|
|
403
402
|
t.dayNum,
|
|
@@ -408,7 +407,7 @@ function Ke({ doctor: l, doctorDetails: a, onSelect: m, disabled: p, isActive: H
|
|
|
408
407
|
)
|
|
409
408
|
]
|
|
410
409
|
},
|
|
411
|
-
`${t.date}-${
|
|
410
|
+
`${t.date}-${a}`
|
|
412
411
|
);
|
|
413
412
|
}) }),
|
|
414
413
|
/* @__PURE__ */ e(
|
|
@@ -418,18 +417,18 @@ function Ke({ doctor: l, doctorDetails: a, onSelect: m, disabled: p, isActive: H
|
|
|
418
417
|
variant: "outline",
|
|
419
418
|
size: "icon",
|
|
420
419
|
onClick: () => {
|
|
421
|
-
if (
|
|
422
|
-
const
|
|
423
|
-
if (
|
|
424
|
-
const
|
|
425
|
-
|
|
420
|
+
if (b + 3 >= n.length) {
|
|
421
|
+
const s = n[n.length - 1]?.date, v = i && (!s || i > s) ? i : s;
|
|
422
|
+
if (v) {
|
|
423
|
+
const V = ve(v, 1);
|
|
424
|
+
g(V), O(V);
|
|
426
425
|
}
|
|
427
426
|
return;
|
|
428
427
|
}
|
|
429
|
-
const t = Math.min(Math.max(0, n.length - 3),
|
|
428
|
+
const t = Math.min(Math.max(0, n.length - 3), b + 3);
|
|
430
429
|
o(t);
|
|
431
|
-
const
|
|
432
|
-
|
|
430
|
+
const a = n[t]?.date;
|
|
431
|
+
a && O(a);
|
|
433
432
|
},
|
|
434
433
|
disabled: p,
|
|
435
434
|
"aria-label": "Next 3 days",
|
|
@@ -438,89 +437,89 @@ function Ke({ doctor: l, doctorDetails: a, onSelect: m, disabled: p, isActive: H
|
|
|
438
437
|
}
|
|
439
438
|
)
|
|
440
439
|
] }),
|
|
441
|
-
|
|
440
|
+
i && /* @__PURE__ */ e("div", { className: "mt-2", children: j.length > 0 ? /* @__PURE__ */ e("div", { className: "relative", children: [
|
|
442
441
|
/* @__PURE__ */ e(
|
|
443
442
|
"div",
|
|
444
443
|
{
|
|
445
|
-
ref:
|
|
446
|
-
onScroll:
|
|
444
|
+
ref: I,
|
|
445
|
+
onScroll: ne,
|
|
447
446
|
className: "grid grid-cols-3 gap-2 overflow-y-auto overscroll-contain",
|
|
448
447
|
style: { maxHeight: "108px" },
|
|
449
|
-
children:
|
|
448
|
+
children: j.map((t, a) => {
|
|
450
449
|
if (!t) return null;
|
|
451
|
-
const
|
|
450
|
+
const s = d === t;
|
|
452
451
|
return /* @__PURE__ */ e(
|
|
453
452
|
w,
|
|
454
453
|
{
|
|
455
454
|
type: "button",
|
|
456
455
|
variant: "outline",
|
|
457
456
|
onClick: () => _(t),
|
|
458
|
-
"aria-pressed":
|
|
457
|
+
"aria-pressed": s,
|
|
459
458
|
disabled: p,
|
|
460
|
-
className:
|
|
459
|
+
className: u(
|
|
461
460
|
"h-9 rounded-lg px-2 text-xs transition-all",
|
|
462
|
-
|
|
461
|
+
s ? "border-primary bg-primary/20 text-primary shadow-sm font-bold" : "border-border bg-elicitationBg text-text-primary font-medium hover:bg-black-100 hover:text-black dark:hover:bg-white-100 hover:text-black"
|
|
463
462
|
),
|
|
464
463
|
children: /* @__PURE__ */ e("span", { children: t })
|
|
465
464
|
},
|
|
466
|
-
t || `slot-${
|
|
465
|
+
t || `slot-${a}`
|
|
467
466
|
);
|
|
468
467
|
})
|
|
469
468
|
}
|
|
470
469
|
),
|
|
471
|
-
|
|
470
|
+
H && /* @__PURE__ */ e("div", { className: "absolute bottom-0 left-0 right-0 h-12 bg-gradient-to-t from-elicitationBg via-elicitationBg to-transparent pointer-events-none flex items-end justify-center pb-1", children: /* @__PURE__ */ e(
|
|
472
471
|
"button",
|
|
473
472
|
{
|
|
474
473
|
type: "button",
|
|
475
|
-
onClick:
|
|
474
|
+
onClick: ie,
|
|
476
475
|
className: "pointer-events-auto flex items-center gap-1 text-xs font-semibold text-primary hover:text-primary/80 transition-colors",
|
|
477
476
|
children: [
|
|
478
|
-
/* @__PURE__ */ e(
|
|
477
|
+
/* @__PURE__ */ e(Y, { className: "h-3.5 w-3.5", "aria-hidden": !0 }),
|
|
479
478
|
"More slots"
|
|
480
479
|
]
|
|
481
480
|
}
|
|
482
481
|
) })
|
|
483
|
-
] }) :
|
|
484
|
-
|
|
482
|
+
] }) : R ? /* @__PURE__ */ e("p", { className: "text-sm text-text-secondary px-1", children: "Fetching slots..." }) : /* @__PURE__ */ e(ee, { date: i }) }),
|
|
483
|
+
j?.length ? /* @__PURE__ */ e(
|
|
485
484
|
w,
|
|
486
485
|
{
|
|
487
486
|
type: "button",
|
|
488
|
-
onClick:
|
|
489
|
-
disabled:
|
|
490
|
-
"aria-disabled":
|
|
491
|
-
className: `w-full h-10 gap-2 bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-60 shadow-sm font-semibold ${
|
|
487
|
+
onClick: oe,
|
|
488
|
+
disabled: y || p || !d,
|
|
489
|
+
"aria-disabled": y || p || !d,
|
|
490
|
+
className: `w-full h-10 gap-2 bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-60 shadow-sm font-semibold ${H ? "" : " mt-2"}`,
|
|
492
491
|
children: [
|
|
493
|
-
|
|
494
|
-
/* @__PURE__ */ e(
|
|
492
|
+
h?.title || "Book appointment",
|
|
493
|
+
/* @__PURE__ */ e(D, { className: "h-4 w-4", "aria-hidden": !0 })
|
|
495
494
|
]
|
|
496
495
|
}
|
|
497
496
|
) : /* @__PURE__ */ e(
|
|
498
497
|
w,
|
|
499
498
|
{
|
|
500
499
|
type: "button",
|
|
501
|
-
onClick:
|
|
502
|
-
disabled:
|
|
503
|
-
"aria-disabled":
|
|
504
|
-
className: `w-full h-10 gap-2 bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-60 shadow-sm font-semibold ${
|
|
500
|
+
onClick: Q,
|
|
501
|
+
disabled: z,
|
|
502
|
+
"aria-disabled": z,
|
|
503
|
+
className: `w-full h-10 gap-2 bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-60 shadow-sm font-semibold ${H ? "" : " mt-2"}`,
|
|
505
504
|
children: [
|
|
506
|
-
|
|
507
|
-
/* @__PURE__ */ e(
|
|
505
|
+
h?.title || "Book appointment",
|
|
506
|
+
/* @__PURE__ */ e(D, { className: "h-4 w-4", "aria-hidden": !0 })
|
|
508
507
|
]
|
|
509
508
|
}
|
|
510
509
|
)
|
|
511
|
-
] }) : /* @__PURE__ */ e(
|
|
512
|
-
/* @__PURE__ */ e(
|
|
510
|
+
] }) : /* @__PURE__ */ e(U, { children: [
|
|
511
|
+
/* @__PURE__ */ e(ee, { date: i }),
|
|
513
512
|
/* @__PURE__ */ e(
|
|
514
513
|
w,
|
|
515
514
|
{
|
|
516
515
|
type: "button",
|
|
517
|
-
onClick:
|
|
518
|
-
disabled:
|
|
519
|
-
"aria-disabled":
|
|
520
|
-
className: `w-full h-10 gap-2 bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-60 shadow-sm font-semibold ${
|
|
516
|
+
onClick: Q,
|
|
517
|
+
disabled: z,
|
|
518
|
+
"aria-disabled": z,
|
|
519
|
+
className: `w-full h-10 gap-2 bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-60 shadow-sm font-semibold ${H ? "" : " mt-2"}`,
|
|
521
520
|
children: [
|
|
522
|
-
|
|
523
|
-
/* @__PURE__ */ e(
|
|
521
|
+
h?.title || "Book appointment",
|
|
522
|
+
/* @__PURE__ */ e(ze, { className: "h-4 w-4", "aria-hidden": !0 })
|
|
524
523
|
]
|
|
525
524
|
}
|
|
526
525
|
)
|
|
@@ -529,12 +528,12 @@ function Ke({ doctor: l, doctorDetails: a, onSelect: m, disabled: p, isActive: H
|
|
|
529
528
|
{
|
|
530
529
|
type: "button",
|
|
531
530
|
variant: "outline",
|
|
532
|
-
onClick:
|
|
533
|
-
disabled: p ||
|
|
531
|
+
onClick: ae,
|
|
532
|
+
disabled: p || M,
|
|
534
533
|
className: "w-full h-8 gap-1 text-xs border-primary/40 text-primary hover:bg-primary/10 disabled:opacity-60 font-medium rounded-lg",
|
|
535
534
|
children: [
|
|
536
|
-
|
|
537
|
-
/* @__PURE__ */ e(
|
|
535
|
+
M ? "Loading..." : "Show available slots",
|
|
536
|
+
/* @__PURE__ */ e(Y, { className: "h-3.5 w-3.5", "aria-hidden": !0 })
|
|
538
537
|
]
|
|
539
538
|
}
|
|
540
539
|
) })
|