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