@eka-care/medassist-widget 0.1.80 → 0.1.82

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.
Files changed (26) hide show
  1. package/README.md +2 -2
  2. package/dist/medassist-widget-CardList-C0T8GBYh.js +223 -0
  3. package/dist/medassist-widget-ChatComposer-CRm0Bvmo.js +1234 -0
  4. package/dist/medassist-widget-ChatMessages-CwUlThlh.js +7424 -0
  5. package/dist/medassist-widget-ConnectionStatus-BubGbavD.js +84 -0
  6. package/dist/medassist-widget-DispToastHost-D2_0EipW.js +69 -0
  7. package/dist/medassist-widget-DoctorCard-CX9O7oju.js +443 -0
  8. package/dist/medassist-widget-FilePreview-Dof_VuUv.js +121 -0
  9. package/dist/medassist-widget-FocusCarousel-DOkY3kxw.js +90 -0
  10. package/dist/medassist-widget-MediaCard-3gFJ8G9l.js +85 -0
  11. package/dist/medassist-widget-MultiSelect-DMYNXiAC.js +414 -0
  12. package/dist/medassist-widget-ProfileHeader-tjRd6R11.js +142 -0
  13. package/dist/medassist-widget-VoiceAgentScreen-BfWNcUZp.js +421 -0
  14. package/dist/medassist-widget-_commonjsHelpers-CqEciG1_.js +31 -0
  15. package/dist/medassist-widget-avatar-CIkxqi_7.js +233 -0
  16. package/dist/medassist-widget-check-CBkqbFAl.js +5 -0
  17. package/dist/medassist-widget-chevron-right-DXVez3hJ.js +7 -0
  18. package/dist/medassist-widget-html2canvas.esm-CphxV6YW.js +4835 -0
  19. package/dist/medassist-widget-main-CvBx4wsw.js +10068 -0
  20. package/dist/medassist-widget-map-pin-QqnPVlgB.js +14 -0
  21. package/dist/medassist-widget-message-square-plus-D5bJkQm2.js +15 -0
  22. package/dist/medassist-widget-mic-uIy1yldF.js +9 -0
  23. package/dist/medassist-widget-x-DptkIHzh.js +8 -0
  24. package/dist/medassist-widget.css +1 -1
  25. package/dist/medassist-widget.js +4 -106
  26. package/package.json +12 -6
@@ -0,0 +1,414 @@
1
+ import { A as x, y as E, q as X, d as _, R as j, l as O, T as Y, D as y, m as J, u as l, n as S, o as Q, S as D, p as T, r as M, b as N } from "./medassist-widget-main-CvBx4wsw.js";
2
+ import { C as Z } from "./medassist-widget-check-CBkqbFAl.js";
3
+ var V = j[" useInsertionEffect ".trim().toString()] || O;
4
+ function ee({
5
+ prop: e,
6
+ defaultProp: r,
7
+ onChange: c = () => {
8
+ },
9
+ caller: a
10
+ }) {
11
+ const [s, o, i] = re({
12
+ defaultProp: r,
13
+ onChange: c
14
+ }), d = e !== void 0, t = d ? e : s;
15
+ {
16
+ const b = x(e !== void 0);
17
+ E(() => {
18
+ const h = b.current;
19
+ if (h !== d) {
20
+ const p = h ? "controlled" : "uncontrolled", k = d ? "controlled" : "uncontrolled";
21
+ }
22
+ b.current = d;
23
+ }, [d, a]);
24
+ }
25
+ const v = X(
26
+ (b) => {
27
+ if (d) {
28
+ const h = te(b) ? b(e) : b;
29
+ h !== e && i.current?.(h);
30
+ } else
31
+ o(b);
32
+ },
33
+ [d, e, o, i]
34
+ );
35
+ return [t, v];
36
+ }
37
+ function re({
38
+ defaultProp: e,
39
+ onChange: r
40
+ }) {
41
+ const [c, a] = _(e), s = x(c), o = x(r);
42
+ return V(() => {
43
+ o.current = r;
44
+ }, [r]), E(() => {
45
+ s.current !== c && (o.current?.(c), s.current = c);
46
+ }, [c, s]), [c, a, o];
47
+ }
48
+ function te(e) {
49
+ return typeof e == "function";
50
+ }
51
+ function ne(e) {
52
+ const r = x({ value: e, previous: e });
53
+ return Y(() => (r.current.value !== e && (r.current.previous = r.current.value, r.current.value = e), r.current.previous), [e]);
54
+ }
55
+ function oe(e) {
56
+ const [r, c] = _(void 0);
57
+ return O(() => {
58
+ if (e) {
59
+ c({ width: e.offsetWidth, height: e.offsetHeight });
60
+ const a = new ResizeObserver((s) => {
61
+ if (!Array.isArray(s) || !s.length)
62
+ return;
63
+ const o = s[0];
64
+ let i, d;
65
+ if ("borderBoxSize" in o) {
66
+ const t = o.borderBoxSize, v = Array.isArray(t) ? t[0] : t;
67
+ i = v.inlineSize, d = v.blockSize;
68
+ } else
69
+ i = e.offsetWidth, d = e.offsetHeight;
70
+ c({ width: i, height: d });
71
+ });
72
+ return a.observe(e, { box: "border-box" }), () => a.unobserve(e);
73
+ } else
74
+ c(void 0);
75
+ }, [e]), r;
76
+ }
77
+ var w = "Checkbox", [ce] = J(w), [se, z] = ce(w);
78
+ function ie(e) {
79
+ const {
80
+ __scopeCheckbox: r,
81
+ checked: c,
82
+ children: a,
83
+ defaultChecked: s,
84
+ disabled: o,
85
+ form: i,
86
+ name: d,
87
+ onCheckedChange: t,
88
+ required: v,
89
+ value: b = "on",
90
+ // @ts-expect-error
91
+ internal_do_not_use_render: h
92
+ } = e, [p, k] = ee({
93
+ prop: c,
94
+ defaultProp: s ?? !1,
95
+ onChange: t,
96
+ caller: w
97
+ }), [C, n] = _(null), [m, u] = _(null), f = x(!1), I = C ? !!i || !!C.closest("form") : (
98
+ // We set this to true by default so that events bubble to forms without JS (SSR)
99
+ !0
100
+ ), P = {
101
+ checked: p,
102
+ disabled: o,
103
+ setChecked: k,
104
+ control: C,
105
+ setControl: n,
106
+ name: d,
107
+ form: i,
108
+ value: b,
109
+ hasConsumerStoppedPropagationRef: f,
110
+ required: v,
111
+ defaultChecked: g(s) ? !1 : s,
112
+ isFormControl: I,
113
+ bubbleInput: m,
114
+ setBubbleInput: u
115
+ };
116
+ return /* @__PURE__ */ l(
117
+ se,
118
+ {
119
+ scope: r,
120
+ ...P,
121
+ children: ae(h) ? h(P) : a
122
+ }
123
+ );
124
+ }
125
+ var $ = "CheckboxTrigger", q = y(
126
+ ({ __scopeCheckbox: e, onKeyDown: r, onClick: c, ...a }, s) => {
127
+ const {
128
+ control: o,
129
+ value: i,
130
+ disabled: d,
131
+ checked: t,
132
+ required: v,
133
+ setControl: b,
134
+ setChecked: h,
135
+ hasConsumerStoppedPropagationRef: p,
136
+ isFormControl: k,
137
+ bubbleInput: C
138
+ } = z($, e), n = T(s, b), m = x(t);
139
+ return E(() => {
140
+ const u = o?.form;
141
+ if (u) {
142
+ const f = () => h(m.current);
143
+ return u.addEventListener("reset", f), () => u.removeEventListener("reset", f);
144
+ }
145
+ }, [o, h]), /* @__PURE__ */ l(
146
+ S.button,
147
+ {
148
+ type: "button",
149
+ role: "checkbox",
150
+ "aria-checked": g(t) ? "mixed" : t,
151
+ "aria-required": v,
152
+ "data-state": G(t),
153
+ "data-disabled": d ? "" : void 0,
154
+ disabled: d,
155
+ value: i,
156
+ ...a,
157
+ ref: n,
158
+ onKeyDown: M(r, (u) => {
159
+ u.key === "Enter" && u.preventDefault();
160
+ }),
161
+ onClick: M(c, (u) => {
162
+ h((f) => g(f) ? !0 : !f), C && k && (p.current = u.isPropagationStopped(), p.current || u.stopPropagation());
163
+ })
164
+ }
165
+ );
166
+ }
167
+ );
168
+ q.displayName = $;
169
+ var A = y(
170
+ (e, r) => {
171
+ const {
172
+ __scopeCheckbox: c,
173
+ name: a,
174
+ checked: s,
175
+ defaultChecked: o,
176
+ required: i,
177
+ disabled: d,
178
+ value: t,
179
+ onCheckedChange: v,
180
+ form: b,
181
+ ...h
182
+ } = e;
183
+ return /* @__PURE__ */ l(
184
+ ie,
185
+ {
186
+ __scopeCheckbox: c,
187
+ checked: s,
188
+ defaultChecked: o,
189
+ disabled: d,
190
+ required: i,
191
+ onCheckedChange: v,
192
+ name: a,
193
+ form: b,
194
+ value: t,
195
+ internal_do_not_use_render: ({ isFormControl: p }) => /* @__PURE__ */ l(D, { children: [
196
+ /* @__PURE__ */ l(
197
+ q,
198
+ {
199
+ ...h,
200
+ ref: r,
201
+ __scopeCheckbox: c
202
+ }
203
+ ),
204
+ p && /* @__PURE__ */ l(
205
+ U,
206
+ {
207
+ __scopeCheckbox: c
208
+ }
209
+ )
210
+ ] })
211
+ }
212
+ );
213
+ }
214
+ );
215
+ A.displayName = w;
216
+ var F = "CheckboxIndicator", H = y(
217
+ (e, r) => {
218
+ const { __scopeCheckbox: c, forceMount: a, ...s } = e, o = z(F, c);
219
+ return /* @__PURE__ */ l(
220
+ Q,
221
+ {
222
+ present: a || g(o.checked) || o.checked === !0,
223
+ children: /* @__PURE__ */ l(
224
+ S.span,
225
+ {
226
+ "data-state": G(o.checked),
227
+ "data-disabled": o.disabled ? "" : void 0,
228
+ ...s,
229
+ ref: r,
230
+ style: { pointerEvents: "none", ...e.style }
231
+ }
232
+ )
233
+ }
234
+ );
235
+ }
236
+ );
237
+ H.displayName = F;
238
+ var L = "CheckboxBubbleInput", U = y(
239
+ ({ __scopeCheckbox: e, ...r }, c) => {
240
+ const {
241
+ control: a,
242
+ hasConsumerStoppedPropagationRef: s,
243
+ checked: o,
244
+ defaultChecked: i,
245
+ required: d,
246
+ disabled: t,
247
+ name: v,
248
+ value: b,
249
+ form: h,
250
+ bubbleInput: p,
251
+ setBubbleInput: k
252
+ } = z(L, e), C = T(c, k), n = ne(o), m = oe(a);
253
+ E(() => {
254
+ const f = p;
255
+ if (!f) return;
256
+ const I = window.HTMLInputElement.prototype, B = Object.getOwnPropertyDescriptor(
257
+ I,
258
+ "checked"
259
+ ).set, K = !s.current;
260
+ if (n !== o && B) {
261
+ const W = new Event("click", { bubbles: K });
262
+ f.indeterminate = g(o), B.call(f, g(o) ? !1 : o), f.dispatchEvent(W);
263
+ }
264
+ }, [p, n, o, s]);
265
+ const u = x(g(o) ? !1 : o);
266
+ return /* @__PURE__ */ l(
267
+ S.input,
268
+ {
269
+ type: "checkbox",
270
+ "aria-hidden": !0,
271
+ defaultChecked: i ?? u.current,
272
+ required: d,
273
+ disabled: t,
274
+ name: v,
275
+ value: b,
276
+ form: h,
277
+ ...r,
278
+ tabIndex: -1,
279
+ ref: C,
280
+ style: {
281
+ ...r.style,
282
+ ...m,
283
+ position: "absolute",
284
+ pointerEvents: "none",
285
+ opacity: 0,
286
+ margin: 0,
287
+ // We transform because the input is absolutely positioned but we have
288
+ // rendered it **after** the button. This pulls it back to sit on top
289
+ // of the button.
290
+ transform: "translateX(-100%)"
291
+ }
292
+ }
293
+ );
294
+ }
295
+ );
296
+ U.displayName = L;
297
+ function ae(e) {
298
+ return typeof e == "function";
299
+ }
300
+ function g(e) {
301
+ return e === "indeterminate";
302
+ }
303
+ function G(e) {
304
+ return g(e) ? "indeterminate" : e ? "checked" : "unchecked";
305
+ }
306
+ const R = y(({ className: e, ...r }, c) => /* @__PURE__ */ l(
307
+ A,
308
+ {
309
+ ref: c,
310
+ className: N(
311
+ "grid place-content-center peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
312
+ e
313
+ ),
314
+ ...r,
315
+ children: /* @__PURE__ */ l(
316
+ H,
317
+ {
318
+ className: N("grid place-content-center text-current"),
319
+ children: /* @__PURE__ */ l(Z, { className: "h-4 w-4" })
320
+ }
321
+ )
322
+ }
323
+ ));
324
+ R.displayName = A.displayName;
325
+ function ue({
326
+ options: e,
327
+ selectedValues: r,
328
+ onSelectionChange: c,
329
+ additionalOption: a,
330
+ className: s,
331
+ required: o = !0,
332
+ maxSelections: i,
333
+ // error,
334
+ disabled: d
335
+ }) {
336
+ const t = a ? {
337
+ id: `extra-${a}`,
338
+ label: a === "all_of_the_above" ? "All of the above" : "None of the above",
339
+ value: a === "all_of_the_above" ? "All of the above" : "None of the above"
340
+ } : null, v = (n) => t ? n.filter((m) => m !== t.value) : n, b = (n) => t ? a === "none_of_the_above" ? n ? [t.value] : [] : a === "all_of_the_above" ? n ? [...e.map((m) => m.value), t.value] : v(r) : n ? [...r, t.value] : v(r) : r, h = (n, m) => {
341
+ const u = t ? v(r) : r;
342
+ return m ? i && u.length >= i ? null : [...u, n] : u.filter((f) => f !== n);
343
+ }, p = (n) => !(o && n.length === 0 && r.length === 1), k = (n, m) => {
344
+ const f = t && n === t.value ? b(m) : h(n, m);
345
+ f !== null && p(f) && c(f);
346
+ }, C = t ? r.filter((n) => n !== t.value).length : r.length;
347
+ return e.length ? /* @__PURE__ */ l(
348
+ "div",
349
+ {
350
+ className: N(
351
+ s
352
+ ),
353
+ children: [
354
+ /* @__PURE__ */ l("div", { className: "space-y-3", children: [
355
+ e.map((n) => {
356
+ const m = d || i && C >= i && !r.includes(n.value);
357
+ let u = r.includes(n.value);
358
+ return /* @__PURE__ */ l("div", { className: "flex items-center space-x-3", children: [
359
+ /* @__PURE__ */ l(
360
+ R,
361
+ {
362
+ id: n.id,
363
+ checked: u,
364
+ disabled: !!m,
365
+ onCheckedChange: (f) => k(n.value, !!f),
366
+ className: "mt-0.5 border border-muted-foreground text-primary-foreground"
367
+ }
368
+ ),
369
+ /* @__PURE__ */ l(
370
+ "label",
371
+ {
372
+ htmlFor: n.id,
373
+ className: N(
374
+ // Using the same muted color scheme as your other components
375
+ "text-sm font-normal leading-4 cursor-pointer",
376
+ m ? "text-muted-foreground cursor-not-allowed" : u ? "text-primary" : "text-secondary-foreground"
377
+ // Dark grey like other components
378
+ ),
379
+ children: n.label
380
+ }
381
+ )
382
+ ] }, n.id);
383
+ }),
384
+ t && /* @__PURE__ */ l(D, { children: [
385
+ /* @__PURE__ */ l("div", { className: "border-t border-border-medium my-3" }),
386
+ /* @__PURE__ */ l("div", { className: "flex items-center space-x-3", children: [
387
+ /* @__PURE__ */ l(
388
+ R,
389
+ {
390
+ id: t.id,
391
+ checked: r.includes(t.value),
392
+ onCheckedChange: (n) => k(t.value, n),
393
+ className: "mt-0.5 border border-muted-foreground"
394
+ }
395
+ ),
396
+ /* @__PURE__ */ l(
397
+ "label",
398
+ {
399
+ htmlFor: t.id,
400
+ className: "text-sm font-medium leading-none cursor-pointer text-secondary-foreground",
401
+ children: t.label
402
+ }
403
+ )
404
+ ] })
405
+ ] })
406
+ ] }),
407
+ i && C >= i && /* @__PURE__ */ l("p", { className: "text-sm text-blue-600 mt-3", children: i === 1 ? "You can select only 1 option" : `Maximum ${i} selections allowed` })
408
+ ]
409
+ }
410
+ ) : null;
411
+ }
412
+ export {
413
+ ue as MultiSelectGroup
414
+ };
@@ -0,0 +1,142 @@
1
+ import { c as g, i as z, j, e as u, d as O, A as D, T as H, q as I, y as _, a as o, u as e, b as a, B as m } from "./medassist-widget-main-CvBx4wsw.js";
2
+ import { A, a as q } from "./medassist-widget-avatar-CIkxqi_7.js";
3
+ import { M as B } from "./medassist-widget-message-square-plus-D5bJkQm2.js";
4
+ import { X as F } from "./medassist-widget-x-DptkIHzh.js";
5
+ const G = [
6
+ ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
7
+ ["path", { d: "m21 3-7 7", key: "1l2asr" }],
8
+ ["path", { d: "m3 21 7-7", key: "tjx5ai" }],
9
+ ["path", { d: "M9 21H3v-6", key: "wtvkvv" }]
10
+ ], P = g("maximize-2", G);
11
+ const R = [
12
+ ["path", { d: "m14 10 7-7", key: "oa77jy" }],
13
+ ["path", { d: "M20 10h-6V4", key: "mjg0md" }],
14
+ ["path", { d: "m3 21 7-7", key: "tjx5ai" }],
15
+ ["path", { d: "M4 14h6v6", key: "rmj7iw" }]
16
+ ], L = g("minimize-2", R);
17
+ function Y({
18
+ onClose: C,
19
+ showCloseButton: b = !0,
20
+ title: y,
21
+ titleImg: h,
22
+ tagline: v,
23
+ iconUrl: f,
24
+ startNewConversation: p,
25
+ voiceAgentState: t = "idle",
26
+ headerTinted: w = !1,
27
+ onToggleDisplayMode: k
28
+ }) {
29
+ const M = z(), x = j() && !M, l = u((n) => n.displayMode) === "full", E = u((n) => n.initialDisplayMode) === "full", s = (l ? !1 : w) ? "text-primary-foreground" : "text-foreground", i = u((n) => n.connectionStatus), [c, d] = O(!1), r = D(null), T = H(() => t === "connected" || t === "connecting" || t === "listening" || t === "speaking" || t === "thinking", [t]), S = I(() => {
30
+ c || (d(!0), r.current && clearTimeout(r.current), r.current = setTimeout(() => {
31
+ r.current = null, d(!1);
32
+ }, 6e3), p());
33
+ }, [c, p]);
34
+ _(() => {
35
+ i === o.ConnectionStatus.CONNECTED && (d(!1), r.current && clearTimeout(r.current));
36
+ }, [i]);
37
+ const N = (() => {
38
+ switch (i) {
39
+ case o.ConnectionStatus.CONNECTED:
40
+ return {
41
+ dotColor: "bg-green-500",
42
+ text: v || "Online",
43
+ textColor: "text-green-600"
44
+ };
45
+ case o.ConnectionStatus.CONNECTING:
46
+ return {
47
+ dotColor: "bg-amber-500",
48
+ text: "Connecting",
49
+ textColor: "text-amber-600"
50
+ };
51
+ case o.ConnectionStatus.NOT_CONNECTED:
52
+ return {
53
+ dotColor: "bg-red-500",
54
+ text: "Not Connected",
55
+ textColor: "text-red-600"
56
+ };
57
+ default:
58
+ return {
59
+ dotColor: "bg-text-tertiary",
60
+ text: "Not Connected",
61
+ textColor: "text-text-secondary"
62
+ };
63
+ }
64
+ })();
65
+ return /* @__PURE__ */ e("div", { className: "px-6 py-3", children: /* @__PURE__ */ e("div", { className: "flex items-center justify-between", children: [
66
+ /* @__PURE__ */ e("div", { className: "flex items-center gap-3", children: [
67
+ /* @__PURE__ */ e("div", { className: "relative flex-shrink-0", children: [
68
+ /* @__PURE__ */ e(A, { className: "w-12 h-12 bg-gradient-to-br from-primary to-primary flex-shrink-0 shadow-md ring-0", children: /* @__PURE__ */ e(q, { className: "text-primary-foreground font-bold text-lg bg-transparent", children: f ? /* @__PURE__ */ e(
69
+ "img",
70
+ {
71
+ src: f,
72
+ alt: "Bot Icon",
73
+ className: "w-12 h-12 rounded-full object-cover"
74
+ }
75
+ ) : /* @__PURE__ */ e("span", { className: "text-primary-foreground font-bold text-lg bg-transparent", children: "MC" }) }) }),
76
+ /* @__PURE__ */ e(
77
+ "div",
78
+ {
79
+ className: a(
80
+ "absolute bottom-0 right-0 w-3.5 h-3.5 rounded-full border-2 border-white shadow-sm",
81
+ N.dotColor,
82
+ i === o.ConnectionStatus.CONNECTING && "animate-pulse"
83
+ )
84
+ }
85
+ )
86
+ ] }),
87
+ /* @__PURE__ */ e("div", { className: "flex flex-col", children: [
88
+ h ? /* @__PURE__ */ e("img", { src: h, alt: "", className: "h-6 object-contain" }) : /* @__PURE__ */ e("p", { className: a("text-lg font-semibold synapse-header-title", s), children: y || "Health Assist" }),
89
+ /* @__PURE__ */ e("div", { className: "flex items-center gap-1.5", children: /* @__PURE__ */ e(
90
+ "span",
91
+ {
92
+ className: "text-xs font-medium",
93
+ style: { color: "var(--header-tagline)" },
94
+ children: N.text
95
+ }
96
+ ) })
97
+ ] })
98
+ ] }),
99
+ /* @__PURE__ */ e("div", { className: a("flex items-center", !x && "gap-2"), children: [
100
+ !T && /* @__PURE__ */ e(
101
+ m,
102
+ {
103
+ type: "button",
104
+ variant: "ghost",
105
+ size: "icon",
106
+ title: "Start New Chat",
107
+ onClick: S,
108
+ disabled: c,
109
+ className: a("h-8 w-8 p-1.5 hover:bg-primary hover:text-primary-foreground rounded-full transition-all duration-200 disabled:opacity-60 disabled:pointer-events-none", s),
110
+ children: /* @__PURE__ */ e(B, { className: "w-5 h-5" })
111
+ }
112
+ ),
113
+ x && /* @__PURE__ */ e(
114
+ m,
115
+ {
116
+ onClick: k,
117
+ type: "button",
118
+ variant: "ghost",
119
+ size: "icon",
120
+ title: l ? "Exit fullscreen" : "Enter fullscreen",
121
+ className: a("h-8 w-8 hover:bg-primary hover:text-primary-foreground rounded-full transition-all duration-200", s),
122
+ children: l ? /* @__PURE__ */ e(L, { className: "w-8 h-8" }) : /* @__PURE__ */ e(P, { className: "w-8 h-8" })
123
+ }
124
+ ),
125
+ (b || !E) && /* @__PURE__ */ e(
126
+ m,
127
+ {
128
+ onClick: C,
129
+ type: "button",
130
+ variant: "ghost",
131
+ size: "icon",
132
+ title: "Close",
133
+ className: a("h-8 w-8 hover:bg-primary hover:text-primary-foreground rounded-full transition-all duration-200", s),
134
+ children: /* @__PURE__ */ e(F, { className: "w-8 h-8" })
135
+ }
136
+ )
137
+ ] })
138
+ ] }) });
139
+ }
140
+ export {
141
+ Y as default
142
+ };