@eka-care/medassist-widget-embed 0.2.3 → 0.2.5

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.
@@ -26043,21 +26043,12 @@ var MedAssistWidget = (function(exports) {
26043
26043
  Component.displayName = toPascalCase(iconName);
26044
26044
  return Component;
26045
26045
  };
26046
- const __iconNode$h = [
26046
+ const __iconNode$j = [
26047
26047
  ["path", { d: "M5 12h14", key: "1ays0h" }],
26048
26048
  ["path", { d: "m12 5 7 7-7 7", key: "xquz4c" }]
26049
26049
  ];
26050
- const ArrowRight = createLucideIcon("arrow-right", __iconNode$h);
26051
- const __iconNode$g = [
26052
- ["path", { d: "M12 8V4H8", key: "hb8ula" }],
26053
- ["rect", { width: "16", height: "12", x: "4", y: "8", rx: "2", key: "enze0r" }],
26054
- ["path", { d: "M2 14h2", key: "vft8re" }],
26055
- ["path", { d: "M20 14h2", key: "4cs60a" }],
26056
- ["path", { d: "M15 13v2", key: "1xurst" }],
26057
- ["path", { d: "M9 13v2", key: "rq6x2g" }]
26058
- ];
26059
- const Bot = createLucideIcon("bot", __iconNode$g);
26060
- const __iconNode$f = [
26050
+ const ArrowRight = createLucideIcon("arrow-right", __iconNode$j);
26051
+ const __iconNode$i = [
26061
26052
  ["path", { d: "M10 12h4", key: "a56b0p" }],
26062
26053
  ["path", { d: "M10 8h4", key: "1sr2af" }],
26063
26054
  ["path", { d: "M14 21v-3a2 2 0 0 0-4 0v3", key: "1rgiei" }],
@@ -26070,28 +26061,28 @@ var MedAssistWidget = (function(exports) {
26070
26061
  ],
26071
26062
  ["path", { d: "M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16", key: "16ra0t" }]
26072
26063
  ];
26073
- const Building2 = createLucideIcon("building-2", __iconNode$f);
26074
- const __iconNode$e = [
26064
+ const Building2 = createLucideIcon("building-2", __iconNode$i);
26065
+ const __iconNode$h = [
26075
26066
  ["path", { d: "M8 2v4", key: "1cmpym" }],
26076
26067
  ["path", { d: "M16 2v4", key: "4m81vk" }],
26077
26068
  ["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
26078
26069
  ["path", { d: "M3 10h18", key: "8toen8" }]
26079
26070
  ];
26080
- const Calendar = createLucideIcon("calendar", __iconNode$e);
26081
- const __iconNode$d = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
26082
- const Check = createLucideIcon("check", __iconNode$d);
26083
- const __iconNode$c = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
26084
- const ChevronDown = createLucideIcon("chevron-down", __iconNode$c);
26085
- const __iconNode$b = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]];
26086
- const ChevronLeft = createLucideIcon("chevron-left", __iconNode$b);
26087
- const __iconNode$a = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
26088
- const ChevronRight = createLucideIcon("chevron-right", __iconNode$a);
26089
- const __iconNode$9 = [
26071
+ const Calendar = createLucideIcon("calendar", __iconNode$h);
26072
+ const __iconNode$g = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
26073
+ const Check = createLucideIcon("check", __iconNode$g);
26074
+ const __iconNode$f = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
26075
+ const ChevronDown = createLucideIcon("chevron-down", __iconNode$f);
26076
+ const __iconNode$e = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]];
26077
+ const ChevronLeft = createLucideIcon("chevron-left", __iconNode$e);
26078
+ const __iconNode$d = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
26079
+ const ChevronRight = createLucideIcon("chevron-right", __iconNode$d);
26080
+ const __iconNode$c = [
26090
26081
  ["path", { d: "M12 6v6l4 2", key: "mmk7yg" }],
26091
26082
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]
26092
26083
  ];
26093
- const Clock = createLucideIcon("clock", __iconNode$9);
26094
- const __iconNode$8 = [
26084
+ const Clock = createLucideIcon("clock", __iconNode$c);
26085
+ const __iconNode$b = [
26095
26086
  [
26096
26087
  "path",
26097
26088
  {
@@ -26104,8 +26095,8 @@ var MedAssistWidget = (function(exports) {
26104
26095
  ["path", { d: "M16 13H8", key: "t4e002" }],
26105
26096
  ["path", { d: "M16 17H8", key: "z1uh3a" }]
26106
26097
  ];
26107
- const FileText = createLucideIcon("file-text", __iconNode$8);
26108
- const __iconNode$7 = [
26098
+ const FileText = createLucideIcon("file-text", __iconNode$b);
26099
+ const __iconNode$a = [
26109
26100
  ["path", { d: "m5 8 6 6", key: "1wu5hv" }],
26110
26101
  ["path", { d: "m4 14 6-6 2-3", key: "1k1g8d" }],
26111
26102
  ["path", { d: "M2 5h12", key: "or177f" }],
@@ -26113,10 +26104,26 @@ var MedAssistWidget = (function(exports) {
26113
26104
  ["path", { d: "m22 22-5-10-5 10", key: "don7ne" }],
26114
26105
  ["path", { d: "M14 18h6", key: "1m8k6r" }]
26115
26106
  ];
26116
- const Languages = createLucideIcon("languages", __iconNode$7);
26117
- const __iconNode$6 = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
26118
- const LoaderCircle = createLucideIcon("loader-circle", __iconNode$6);
26119
- const __iconNode$5 = [
26107
+ const Languages = createLucideIcon("languages", __iconNode$a);
26108
+ const __iconNode$9 = [
26109
+ ["path", { d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71", key: "1cjeqo" }],
26110
+ ["path", { d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71", key: "19qd67" }]
26111
+ ];
26112
+ const Link = createLucideIcon("link", __iconNode$9);
26113
+ const __iconNode$8 = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
26114
+ const LoaderCircle = createLucideIcon("loader-circle", __iconNode$8);
26115
+ const __iconNode$7 = [
26116
+ [
26117
+ "path",
26118
+ {
26119
+ d: "M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",
26120
+ key: "1r0f0z"
26121
+ }
26122
+ ],
26123
+ ["circle", { cx: "12", cy: "10", r: "3", key: "ilqhr7" }]
26124
+ ];
26125
+ const MapPin = createLucideIcon("map-pin", __iconNode$7);
26126
+ const __iconNode$6 = [
26120
26127
  [
26121
26128
  "path",
26122
26129
  {
@@ -26127,38 +26134,52 @@ var MedAssistWidget = (function(exports) {
26127
26134
  ["path", { d: "M12 8v6", key: "1ib9pf" }],
26128
26135
  ["path", { d: "M9 11h6", key: "1fldmi" }]
26129
26136
  ];
26130
- const MessageSquarePlus = createLucideIcon("message-square-plus", __iconNode$5);
26131
- const __iconNode$4 = [
26137
+ const MessageSquarePlus = createLucideIcon("message-square-plus", __iconNode$6);
26138
+ const __iconNode$5 = [
26132
26139
  ["path", { d: "M12 19v3", key: "npa21l" }],
26133
26140
  ["path", { d: "M19 10v2a7 7 0 0 1-14 0v-2", key: "1vc78b" }],
26134
26141
  ["rect", { x: "9", y: "2", width: "6", height: "13", rx: "3", key: "s6n7sd" }]
26135
26142
  ];
26136
- const Mic = createLucideIcon("mic", __iconNode$4);
26143
+ const Mic = createLucideIcon("mic", __iconNode$5);
26144
+ const __iconNode$4 = [
26145
+ ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }]
26146
+ ];
26147
+ const Square = createLucideIcon("square", __iconNode$4);
26137
26148
  const __iconNode$3 = [
26149
+ ["path", { d: "M7 10v12", key: "1qc93n" }],
26138
26150
  [
26139
26151
  "path",
26140
26152
  {
26141
- d: "m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",
26142
- key: "1miecu"
26153
+ d: "M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",
26154
+ key: "emmmcr"
26143
26155
  }
26144
26156
  ]
26145
26157
  ];
26146
- const Paperclip = createLucideIcon("paperclip", __iconNode$3);
26158
+ const ThumbsUp = createLucideIcon("thumbs-up", __iconNode$3);
26147
26159
  const __iconNode$2 = [
26160
+ ["path", { d: "M17 14V2", key: "8ymqnk" }],
26148
26161
  [
26149
26162
  "path",
26150
26163
  {
26151
- d: "M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",
26152
- key: "1ffxy3"
26164
+ d: "M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z",
26165
+ key: "m61m77"
26153
26166
  }
26154
- ],
26155
- ["path", { d: "m21.854 2.147-10.94 10.939", key: "12cjpa" }]
26167
+ ]
26156
26168
  ];
26157
- const Send = createLucideIcon("send", __iconNode$2);
26169
+ const ThumbsDown = createLucideIcon("thumbs-down", __iconNode$2);
26158
26170
  const __iconNode$1 = [
26159
- ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }]
26171
+ [
26172
+ "path",
26173
+ {
26174
+ d: "M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z",
26175
+ key: "qn84l0"
26176
+ }
26177
+ ],
26178
+ ["path", { d: "M13 5v2", key: "dyzc3o" }],
26179
+ ["path", { d: "M13 17v2", key: "1ont0d" }],
26180
+ ["path", { d: "M13 11v2", key: "1wjjxi" }]
26160
26181
  ];
26161
- const Square = createLucideIcon("square", __iconNode$1);
26182
+ const Ticket = createLucideIcon("ticket", __iconNode$1);
26162
26183
  const __iconNode = [
26163
26184
  ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
26164
26185
  ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
@@ -26169,7 +26190,8 @@ var MedAssistWidget = (function(exports) {
26169
26190
  {
26170
26191
  ref,
26171
26192
  className: cn(
26172
- "rounded-xl border bg-card text-card-foreground shadow",
26193
+ "rounded-xl bg-card text-card-foreground shadow",
26194
+ // Border removed by default - add it explicitly if needed with border-border-subtle
26173
26195
  className
26174
26196
  ),
26175
26197
  ...props
@@ -27437,7 +27459,7 @@ var MedAssistWidget = (function(exports) {
27437
27459
  });
27438
27460
  }
27439
27461
  async feedback(sessionId, messageId, feedback, feedback_reason) {
27440
- return this.patch(`${this.basePath}/${sessionId}/${messageId}`, {
27462
+ return this.put(`${this.basePath}/${sessionId}/message/${messageId}/feedback`, {
27441
27463
  feedback,
27442
27464
  feedback_reason
27443
27465
  });
@@ -27467,7 +27489,8 @@ var MedAssistWidget = (function(exports) {
27467
27489
  MOBILE_VERIFICATION: "mobile_verification",
27468
27490
  PILL: "pills",
27469
27491
  MULTI: "multi",
27470
- DOCTOR_CARD: "doctor_card"
27492
+ DOCTOR_CARD: "doctor_card",
27493
+ PHARMACY: "pharmacy"
27471
27494
  };
27472
27495
  var SYNAPSE_TOOL_CALLBACK_NAME;
27473
27496
  (function(SYNAPSE_TOOL_CALLBACK_NAME2) {
@@ -27535,6 +27558,23 @@ var MedAssistWidget = (function(exports) {
27535
27558
  ToolCall.ToolCall = ToolCall$1;
27536
27559
  return ToolCall;
27537
27560
  }
27561
+ var Config = {};
27562
+ var hasRequiredConfig;
27563
+ function requireConfig() {
27564
+ if (hasRequiredConfig) return Config;
27565
+ hasRequiredConfig = 1;
27566
+ Object.defineProperty(Config, "__esModule", { value: true });
27567
+ Config.Config = void 0;
27568
+ const BaseResource_1 = /* @__PURE__ */ requireBaseResource();
27569
+ let Config$1 = class Config extends BaseResource_1.BaseResource {
27570
+ basePath = "/med-assist/agent-config";
27571
+ async retrieve(agentId) {
27572
+ return this.get(`${this.basePath}/${agentId}`);
27573
+ }
27574
+ };
27575
+ Config.Config = Config$1;
27576
+ return Config;
27577
+ }
27538
27578
  var hasRequiredResources;
27539
27579
  function requireResources() {
27540
27580
  if (hasRequiredResources) return resources;
@@ -27545,11 +27585,13 @@ var MedAssistWidget = (function(exports) {
27545
27585
  const Session_1 = /* @__PURE__ */ requireSession();
27546
27586
  const Error_1 = /* @__PURE__ */ require_Error$1();
27547
27587
  const ToolCall_1 = /* @__PURE__ */ requireToolCall();
27588
+ const Config_1 = /* @__PURE__ */ requireConfig();
27548
27589
  class ResourceManager {
27549
27590
  resourceConfig;
27550
27591
  httpClient;
27551
27592
  session;
27552
27593
  toolCall = null;
27594
+ config;
27553
27595
  constructor(config) {
27554
27596
  this.resourceConfig = config;
27555
27597
  this.httpClient = new HttpClient_1.HttpClient({
@@ -27561,6 +27603,7 @@ var MedAssistWidget = (function(exports) {
27561
27603
  }
27562
27604
  // authorization: config.authorization,
27563
27605
  });
27606
+ this.config = new Config_1.Config(this.httpClient);
27564
27607
  this.session = new Session_1.Session(this.httpClient);
27565
27608
  }
27566
27609
  /**
@@ -27594,6 +27637,16 @@ var MedAssistWidget = (function(exports) {
27594
27637
  throw new Error_1.APIError("Failed to start session.", 500, void 0, void 0);
27595
27638
  }
27596
27639
  }
27640
+ async getAgentConfig() {
27641
+ if (!this.config) {
27642
+ this.config = new Config_1.Config(this.httpClient);
27643
+ }
27644
+ try {
27645
+ return await this.config.retrieve(this.resourceConfig.agentId);
27646
+ } catch (error) {
27647
+ throw new Error_1.APIError("Failed to get agent config.", 500, void 0, void 0);
27648
+ }
27649
+ }
27597
27650
  /**
27598
27651
  * Validate a session if it's still active or not
27599
27652
  * GET /med-assist/session/:sessionId
@@ -28486,9 +28539,6 @@ var MedAssistWidget = (function(exports) {
28486
28539
  case types_1.SYNAPSE_REALTIME_ERROR_CODES.SESSION_EXPIRED:
28487
28540
  connection.emit(types_1.SYNAPSE_REALTIME_RESERVED_EVENTS.SESSION_EXPIRED);
28488
28541
  break;
28489
- case types_1.SYNAPSE_REALTIME_ERROR_CODES.INVALID_EVENT:
28490
- console.log("invalid event error", message);
28491
- break;
28492
28542
  default:
28493
28543
  const error = new Error_1.MessageError(message?.data?.msg || "Socket error received", {
28494
28544
  context: {
@@ -28844,6 +28894,32 @@ var MedAssistWidget = (function(exports) {
28844
28894
  throw error;
28845
28895
  }
28846
28896
  }
28897
+ /**
28898
+ * Send feedback on a message
28899
+ */
28900
+ async sendFeedback(messageId, feedback, reason) {
28901
+ if (!this.connection) {
28902
+ const error = new Error_2.ConnectionError("Connection not established. Session may not be initialized.", {
28903
+ context: { stage: "sendFeedback" },
28904
+ hint: "Call startSession() before attempting to send feedback."
28905
+ });
28906
+ this.emitError(error);
28907
+ throw error;
28908
+ }
28909
+ if (!this.sessionConfig?.session_id) {
28910
+ const error = new Error_2.SessionError("Session ID not found", {
28911
+ context: { stage: "sendFeedback" },
28912
+ hint: "Call startSession() before attempting to send feedback."
28913
+ });
28914
+ this.emitError(error);
28915
+ throw error;
28916
+ }
28917
+ switch (this.connectionType) {
28918
+ case ConnectionFactory_1.ConnectionType.SOCKET:
28919
+ this.resourceManager.sendFeedback(this.sessionConfig?.session_id, messageId, feedback, reason);
28920
+ break;
28921
+ }
28922
+ }
28847
28923
  /**
28848
28924
  * Register a listener for a specific event
28849
28925
  */
@@ -28972,9 +29048,9 @@ var MedAssistWidget = (function(exports) {
28972
29048
  // /**
28973
29049
  // * Get the agent configuration
28974
29050
  // */
28975
- // public getAgentConfig(): AgentConfig | null {
28976
- // return this.agentConfig;
28977
- // }
29051
+ async getAgentConfig() {
29052
+ return this.resourceManager.getAgentConfig();
29053
+ }
28978
29054
  isConnected() {
28979
29055
  return this.connection?.isConnected() ?? false;
28980
29056
  }
@@ -29784,6 +29860,7 @@ var MedAssistWidget = (function(exports) {
29784
29860
  function ProfileHeader({
29785
29861
  onClose,
29786
29862
  title,
29863
+ titleImg,
29787
29864
  iconUrl,
29788
29865
  startNewConversation
29789
29866
  }) {
@@ -29810,24 +29887,24 @@ var MedAssistWidget = (function(exports) {
29810
29887
  };
29811
29888
  default:
29812
29889
  return {
29813
- dotColor: "bg-gray-400",
29890
+ dotColor: "bg-text-tertiary",
29814
29891
  text: "Not Connected",
29815
- textColor: "text-gray-600"
29892
+ textColor: "text-text-secondary"
29816
29893
  };
29817
29894
  }
29818
29895
  };
29819
29896
  const statusConfig = getStatusConfig();
29820
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-lavender-100/95 backdrop-blur-md shadow-lg border-b border-lavender-200/60 px-6 py-2", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between", children: [
29897
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "px-6 py-2", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between", children: [
29821
29898
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3", children: [
29822
29899
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative flex-shrink-0", children: [
29823
- /* @__PURE__ */ jsxRuntimeExports.jsx(Avatar, { className: "w-12 h-12 bg-gradient-to-br from-lavender-400 to-lavender-500 flex-shrink-0 shadow-md ring-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(AvatarFallback, { className: "text-white font-bold text-lg bg-transparent", children: iconUrl ? /* @__PURE__ */ jsxRuntimeExports.jsx(
29900
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Avatar, { className: "w-12 h-12 bg-gradient-to-br from-primary to-primary flex-shrink-0 shadow-md ring-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(AvatarFallback, { className: "text-primary-foreground font-bold text-lg bg-transparent", children: iconUrl ? /* @__PURE__ */ jsxRuntimeExports.jsx(
29824
29901
  "img",
29825
29902
  {
29826
29903
  src: iconUrl,
29827
29904
  alt: "Bot Icon",
29828
29905
  className: "w-12 h-12 rounded-full object-cover"
29829
29906
  }
29830
- ) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-white font-bold text-lg bg-transparent", children: "MC" }) }) }),
29907
+ ) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-primary-foreground font-bold text-lg bg-transparent", children: "MC" }) }) }),
29831
29908
  /* @__PURE__ */ jsxRuntimeExports.jsx(
29832
29909
  "div",
29833
29910
  {
@@ -29840,7 +29917,7 @@ var MedAssistWidget = (function(exports) {
29840
29917
  )
29841
29918
  ] }),
29842
29919
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col", children: [
29843
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-lg font-semibold text-slate-900", children: title || "Health Assist" }),
29920
+ titleImg ? /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: titleImg, alt: "", className: "h-6 object-contain" }) : /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-lg font-semibold text-foreground", children: title || "Health Assist" }),
29844
29921
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center gap-1.5", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
29845
29922
  "span",
29846
29923
  {
@@ -29859,7 +29936,7 @@ var MedAssistWidget = (function(exports) {
29859
29936
  size: "icon",
29860
29937
  title: "Start New Chat",
29861
29938
  onClick: startNewConversation,
29862
- className: "h-8 w-8 text-slate-600 hover:text-slate-900 hover:bg-white/60 active:bg-white/80 rounded-xl transition-all duration-200",
29939
+ className: "h-8 w-8 text-foreground hover:bg-secondary rounded-xl transition-all duration-200",
29863
29940
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(MessageSquarePlus, { className: "w-8 h-8" })
29864
29941
  }
29865
29942
  ),
@@ -29871,7 +29948,7 @@ var MedAssistWidget = (function(exports) {
29871
29948
  variant: "ghost",
29872
29949
  size: "icon",
29873
29950
  title: "Close",
29874
- className: "h-8 w-8 text-slate-600 hover:text-slate-900 hover:bg-white/60 active:bg-white/80 rounded-xl transition-all duration-200",
29951
+ className: "h-8 w-8 text-foreground hover:bg-secondary rounded-xl transition-all duration-200",
29875
29952
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(X, { className: "w-8 h-8" })
29876
29953
  }
29877
29954
  )
@@ -29989,6 +30066,307 @@ var MedAssistWidget = (function(exports) {
29989
30066
  setPosition
29990
30067
  };
29991
30068
  }
30069
+ const DEFAULT_PRIMARY_HEX = "#6B5CE0";
30070
+ const DEFAULT_BACKGROUND_HEX = "#F0F0F0";
30071
+ const DEFAULT_THEME = {
30072
+ background: DEFAULT_BACKGROUND_HEX,
30073
+ // base-50 (#F0F0F0)
30074
+ backgroundImage: void 0,
30075
+ primary: DEFAULT_PRIMARY_HEX,
30076
+ textColor: "black"
30077
+ };
30078
+ const BACKGROUND_OVERLAY = "rgba(0, 0, 0, 0.4)";
30079
+ const BACKGROUND_BLUR = "24px";
30080
+ function textColorFromMode(mode) {
30081
+ if (mode === "dark") return "white";
30082
+ if (mode === "light") return "black";
30083
+ return void 0;
30084
+ }
30085
+ function mergeTheme(userTheme) {
30086
+ const primary = userTheme?.primary ?? userTheme?.primaryColor ?? DEFAULT_THEME.primary;
30087
+ const derivedTextColor = userTheme?.textColor ?? textColorFromMode(userTheme?.mode);
30088
+ return {
30089
+ background: userTheme?.background ?? DEFAULT_THEME.background,
30090
+ backgroundImage: userTheme?.backgroundImage ?? DEFAULT_THEME.backgroundImage,
30091
+ primary,
30092
+ primaryColor: primary,
30093
+ textColor: derivedTextColor ?? DEFAULT_THEME.textColor,
30094
+ secondaryColor: userTheme?.secondaryColor,
30095
+ tertiaryColor: userTheme?.tertiaryColor
30096
+ };
30097
+ }
30098
+ function hexToHSL(hex) {
30099
+ hex = hex.replace("#", "");
30100
+ const r2 = parseInt(hex.substring(0, 2), 16) / 255;
30101
+ const g = parseInt(hex.substring(2, 4), 16) / 255;
30102
+ const b = parseInt(hex.substring(4, 6), 16) / 255;
30103
+ const max = Math.max(r2, g, b);
30104
+ const min = Math.min(r2, g, b);
30105
+ let h = 0;
30106
+ let s = 0;
30107
+ const l = (max + min) / 2;
30108
+ if (max !== min) {
30109
+ const d = max - min;
30110
+ s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
30111
+ switch (max) {
30112
+ case r2:
30113
+ h = ((g - b) / d + (g < b ? 6 : 0)) / 6;
30114
+ break;
30115
+ case g:
30116
+ h = ((b - r2) / d + 2) / 6;
30117
+ break;
30118
+ case b:
30119
+ h = ((r2 - g) / d + 4) / 6;
30120
+ break;
30121
+ }
30122
+ }
30123
+ h = Math.round(h * 360);
30124
+ s = Math.round(s * 100);
30125
+ const lPercent = Math.round(l * 100);
30126
+ return `${h} ${s}% ${lPercent}%`;
30127
+ }
30128
+ function rgbToHSL(rgb) {
30129
+ const match = rgb.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);
30130
+ if (!match) throw new Error("Invalid RGB format");
30131
+ const r2 = parseInt(match[1], 10) / 255;
30132
+ const g = parseInt(match[2], 10) / 255;
30133
+ const b = parseInt(match[3], 10) / 255;
30134
+ const max = Math.max(r2, g, b);
30135
+ const min = Math.min(r2, g, b);
30136
+ let h = 0;
30137
+ let s = 0;
30138
+ const l = (max + min) / 2;
30139
+ if (max !== min) {
30140
+ const d = max - min;
30141
+ s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
30142
+ switch (max) {
30143
+ case r2:
30144
+ h = ((g - b) / d + (g < b ? 6 : 0)) / 6;
30145
+ break;
30146
+ case g:
30147
+ h = ((b - r2) / d + 2) / 6;
30148
+ break;
30149
+ case b:
30150
+ h = ((r2 - g) / d + 4) / 6;
30151
+ break;
30152
+ }
30153
+ }
30154
+ h = Math.round(h * 360);
30155
+ s = Math.round(s * 100);
30156
+ const lPercent = Math.round(l * 100);
30157
+ return `${h} ${s}% ${lPercent}%`;
30158
+ }
30159
+ function extractHSL(hsl) {
30160
+ const match = hsl.match(/hsl\((\d+),\s*(\d+)%,\s*(\d+)%\)/);
30161
+ if (!match) throw new Error("Invalid HSL format");
30162
+ return `${match[1]} ${match[2]}% ${match[3]}%`;
30163
+ }
30164
+ function normalizeColorToHSL(color2) {
30165
+ if (!color2 || typeof color2 !== "string") throw new Error("Color must be a non-empty string");
30166
+ const trimmedColor = color2.trim();
30167
+ if (trimmedColor.startsWith("#")) return hexToHSL(trimmedColor);
30168
+ if (trimmedColor.startsWith("rgb")) return rgbToHSL(trimmedColor);
30169
+ if (trimmedColor.startsWith("hsl")) return extractHSL(trimmedColor);
30170
+ if (/^\d+\s+\d+%\s+\d+%$/.test(trimmedColor)) return trimmedColor;
30171
+ throw new Error(`Unsupported color format: ${color2}`);
30172
+ }
30173
+ function getLuminance(hsl) {
30174
+ const match = hsl.match(/(\d+)\s+(\d+)%\s+(\d+)%/);
30175
+ if (!match) return 0.5;
30176
+ return parseInt(match[3], 10) / 100;
30177
+ }
30178
+ function calculateForegroundColor(backgroundColor) {
30179
+ const luminance = getLuminance(backgroundColor);
30180
+ return luminance > 0.5 ? "0 0% 9%" : "0 0% 98%";
30181
+ }
30182
+ function calculateBorderFromText(textColor) {
30183
+ const match = textColor.match(/(\d+)\s+(\d+)%\s+(\d+)%/);
30184
+ if (!match) return "0 0% 96%";
30185
+ const h = match[1];
30186
+ const s = Math.max(0, parseInt(match[2], 10) - 5);
30187
+ return `${h} ${s}% 96%`;
30188
+ }
30189
+ function generateColorScale(baseHsl) {
30190
+ const match = baseHsl.match(/(\d+)\s+(\d+)%\s+(\d+)%/);
30191
+ if (!match) {
30192
+ return {
30193
+ 50: "262 83% 98%",
30194
+ 100: "262 83% 96%",
30195
+ 200: "262 83% 92%",
30196
+ 300: "262 83% 85%",
30197
+ 400: "262 83% 75%",
30198
+ 500: "262 83% 58%",
30199
+ 600: "262 83% 50%",
30200
+ 700: "262 83% 40%",
30201
+ 800: "262 83% 30%",
30202
+ 900: "262 83% 20%"
30203
+ };
30204
+ }
30205
+ const h = parseInt(match[1], 10);
30206
+ const s = parseInt(match[2], 10);
30207
+ const l = parseInt(match[3], 10);
30208
+ return {
30209
+ 50: `${h} ${Math.max(0, s - 20)}% ${Math.min(98, l + 40)}%`,
30210
+ 100: `${h} ${Math.max(0, s - 15)}% ${Math.min(96, l + 35)}%`,
30211
+ 200: `${h} ${Math.max(0, s - 10)}% ${Math.min(92, l + 30)}%`,
30212
+ 300: `${h} ${Math.max(0, s - 5)}% ${Math.min(85, l + 20)}%`,
30213
+ 400: `${h} ${s}% ${Math.min(75, l + 10)}%`,
30214
+ 500: `${h} ${s}% ${l}%`,
30215
+ // Base color
30216
+ 600: `${h} ${Math.min(100, s + 5)}% ${Math.max(50, l - 10)}%`,
30217
+ 700: `${h} ${Math.min(100, s + 10)}% ${Math.max(40, l - 20)}%`,
30218
+ 800: `${h} ${Math.min(100, s + 15)}% ${Math.max(30, l - 30)}%`,
30219
+ 900: `${h} ${Math.min(100, s + 20)}% ${Math.max(20, l - 40)}%`
30220
+ };
30221
+ }
30222
+ function applyTheme(rootElement, theme) {
30223
+ const primaryInput = theme.primary ?? DEFAULT_PRIMARY_HEX;
30224
+ const textColor = theme.textColor ?? "black";
30225
+ const hasBackgroundImage = Boolean(theme.backgroundImage);
30226
+ const setProperty = (property, value) => {
30227
+ const el = rootElement instanceof ShadowRoot ? rootElement.host : rootElement;
30228
+ if (el instanceof HTMLElement) el.style.setProperty(property, value);
30229
+ };
30230
+ if (hasBackgroundImage) {
30231
+ setProperty("--background", "0 0% 0% / 0");
30232
+ } else {
30233
+ const bgColor = theme.background ?? DEFAULT_BACKGROUND_HEX;
30234
+ try {
30235
+ setProperty("--background", normalizeColorToHSL(bgColor));
30236
+ } catch (e) {
30237
+ console.warn("Failed to apply background color:", e);
30238
+ setProperty("--background", "0 0% 94.1%");
30239
+ }
30240
+ }
30241
+ let primaryHsl;
30242
+ try {
30243
+ primaryHsl = normalizeColorToHSL(primaryInput);
30244
+ setProperty("--primary", primaryHsl);
30245
+ setProperty("--primary-foreground", calculateForegroundColor(primaryHsl));
30246
+ setProperty("--ring", primaryHsl);
30247
+ setProperty("--border-primary", primaryHsl);
30248
+ const primaryScale = generateColorScale(primaryHsl);
30249
+ for (const [step, hslValue] of Object.entries(primaryScale)) {
30250
+ setProperty(`--primary-${step}`, hslValue);
30251
+ }
30252
+ } catch (e) {
30253
+ console.warn("Failed to apply primary color:", e);
30254
+ primaryHsl = normalizeColorToHSL(DEFAULT_PRIMARY_HEX);
30255
+ setProperty("--primary", primaryHsl);
30256
+ setProperty("--primary-foreground", calculateForegroundColor(primaryHsl));
30257
+ setProperty("--ring", primaryHsl);
30258
+ setProperty("--border-primary", primaryHsl);
30259
+ const defaultScale = generateColorScale(primaryHsl);
30260
+ for (const [step, hslValue] of Object.entries(defaultScale)) {
30261
+ setProperty(`--primary-${step}`, hslValue);
30262
+ }
30263
+ }
30264
+ if (textColor === "white") {
30265
+ setProperty("--foreground", "0 0% 100%");
30266
+ setProperty("--card-foreground", "0 0% 100%");
30267
+ setProperty("--popover-foreground", "0 0% 100%");
30268
+ setProperty("--muted-foreground", "0 0% 70%");
30269
+ } else {
30270
+ setProperty("--foreground", "0 0% 9%");
30271
+ setProperty("--card-foreground", "0 0% 9%");
30272
+ setProperty("--popover-foreground", "0 0% 9%");
30273
+ setProperty("--muted-foreground", "0 0% 30%");
30274
+ }
30275
+ const host = rootElement instanceof ShadowRoot ? rootElement.host : rootElement;
30276
+ if (host instanceof HTMLElement) {
30277
+ host.setAttribute("data-text-color", textColor);
30278
+ }
30279
+ if (hasBackgroundImage) {
30280
+ if (textColor === "white") {
30281
+ setProperty("--bot-message-bg", "rgba(0, 0, 0, 0.6)");
30282
+ } else {
30283
+ setProperty("--bot-message-bg", "rgba(255, 255, 255, 0.6)");
30284
+ }
30285
+ } else {
30286
+ if (textColor === "white") {
30287
+ setProperty("--bot-message-bg", "rgba(0, 0, 0, 0.6)");
30288
+ } else {
30289
+ setProperty("--bot-message-bg", "rgba(255, 255, 255, 0.6)");
30290
+ }
30291
+ }
30292
+ if (textColor === "white") {
30293
+ setProperty("--card", "0 0% 0% / 0.6");
30294
+ } else {
30295
+ setProperty("--card", "0 0% 100% / 0.6");
30296
+ }
30297
+ setProperty("--bot-message-border", calculateBorderFromText(textColor === "white" ? "0 0% 100%" : "0 0% 9%"));
30298
+ if (hasBackgroundImage) {
30299
+ setProperty("--popover", textColor === "white" ? "0 0% 0% / 0.5" : "0 0% 100% / 0.5");
30300
+ } else {
30301
+ if (textColor === "white") {
30302
+ setProperty("--popover", "0 0% 0%");
30303
+ } else {
30304
+ setProperty("--popover", "0 0% 100%");
30305
+ }
30306
+ }
30307
+ const popoverScale = textColor === "white" ? "white" : "black";
30308
+ for (const step of [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 1e3]) {
30309
+ setProperty(`--popover-${step}`, `var(--${popoverScale}-${step})`);
30310
+ }
30311
+ setProperty("--secondary", "0 0% 96.1%");
30312
+ setProperty("--surface-secondary", "0 0% 96.1%");
30313
+ setProperty("--secondary-foreground", textColor === "white" ? "0 0% 98%" : "0 0% 9%");
30314
+ setProperty("--muted", "0 0% 96.1%");
30315
+ setProperty("--accent", primaryInput ? normalizeColorToHSL(primaryInput) : "0 0% 96.1%");
30316
+ setProperty("--accent-foreground", primaryInput ? calculateForegroundColor(normalizeColorToHSL(primaryInput)) : "0 0% 9%");
30317
+ if (hasBackgroundImage) {
30318
+ if (textColor === "white") {
30319
+ setProperty("--surface", "0 0% 0% / 0.6");
30320
+ } else {
30321
+ setProperty("--surface", "0 0% 100% / 0.6");
30322
+ }
30323
+ } else {
30324
+ const bgColor = theme.background ?? DEFAULT_BACKGROUND_HEX;
30325
+ try {
30326
+ setProperty("--surface", normalizeColorToHSL(bgColor));
30327
+ } catch (e) {
30328
+ setProperty("--surface", "0 0% 94.1%");
30329
+ }
30330
+ }
30331
+ setProperty("--surface-tertiary", "0 0% 98%");
30332
+ setProperty("--border-subtle", "0 0% 89.8%");
30333
+ setProperty("--border-medium", "0 0% 80%");
30334
+ setProperty("--text-primary", textColor === "white" ? "0 0% 100%" : "0 0% 3.9%");
30335
+ setProperty("--text-secondary", textColor === "white" ? "0 0% 70%" : "0 0% 45.1%");
30336
+ setProperty("--text-tertiary", textColor === "white" ? "0 0% 60%" : "0 0% 63.9%");
30337
+ setProperty("--text-muted", textColor === "white" ? "0 0% 70%" : "0 0% 45.1%");
30338
+ setProperty("--border", "0 0% 89.8%");
30339
+ setProperty("--input", "0 0% 89.8%");
30340
+ if (hasBackgroundImage) {
30341
+ setProperty("--theme-background-image", `url(${theme.backgroundImage})`);
30342
+ setProperty("--theme-background-blur", BACKGROUND_BLUR);
30343
+ setProperty("--theme-background-overlay", BACKGROUND_OVERLAY);
30344
+ const host2 = rootElement instanceof ShadowRoot ? rootElement.host : rootElement;
30345
+ if (host2 instanceof HTMLElement) host2.classList.add("theme-with-background");
30346
+ } else {
30347
+ setProperty("--theme-background-image", "none");
30348
+ setProperty("--theme-background-blur", "0px");
30349
+ setProperty("--theme-background-overlay", "rgba(0, 0, 0, 0)");
30350
+ const host2 = rootElement instanceof ShadowRoot ? rootElement.host : rootElement;
30351
+ if (host2 instanceof HTMLElement) host2.classList.remove("theme-with-background");
30352
+ }
30353
+ }
30354
+ const EkaCareLogo = ({ className }) => {
30355
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { width: "42", height: "12", viewBox: "0 0 42 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", className, children: [
30356
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("g", { "clip-path": "url(#clip0_988_2228)", children: [
30357
+ /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M10.3286 7.50625C10.2316 7.32816 10.1101 7.1655 9.96865 7.02251L9.20362 6.25748L8.46797 6.99311L9.22391 7.74906C9.42548 7.95041 9.55007 8.22876 9.55007 8.53631C9.55007 8.84384 9.43437 9.10189 9.24548 9.30156L9.24486 9.30219C9.23787 9.30939 9.23089 9.31658 9.22391 9.32376C8.73595 9.82378 8.13758 10.2159 7.46836 10.4609C6.96306 10.6457 6.41714 10.7466 5.84796 10.7466C5.3655 10.7466 4.90017 10.6743 4.46193 10.5395C4.10277 10.4296 3.76225 10.2775 3.44539 10.0897C2.06021 9.26793 1.13147 7.75751 1.13147 6.03011C1.13147 4.30269 2.06021 2.79208 3.44539 1.97035C3.76331 1.78189 4.10531 1.6296 4.46575 1.51939C4.90293 1.38529 5.36719 1.31338 5.84817 1.31338C6.41588 1.31338 6.96011 1.41363 7.46414 1.59745C8.13483 1.84217 8.73447 2.23451 9.22328 2.73559C9.22983 2.74214 9.23618 2.74871 9.24254 2.75526C9.43309 2.95514 9.55007 3.22566 9.55007 3.52369C9.55007 3.8217 9.42548 4.10935 9.22391 4.31092L9.0528 4.48225L8.24059 5.29424L6.4698 3.52348C6.41166 3.46593 6.35032 3.41179 6.28601 3.36104C5.91987 3.07337 5.45793 2.90163 4.95603 2.90163C4.77794 2.90163 4.60492 2.9232 4.43929 2.96422C4.32147 2.99299 4.20747 3.03169 4.09833 3.07929C4.08987 3.08289 4.08142 3.0867 4.07318 3.09049C3.32378 3.42745 2.80197 4.18064 2.80197 5.05566C2.80197 5.10917 2.80388 5.16227 2.80789 5.21493C2.80789 5.21706 2.80811 5.21916 2.80833 5.2215C2.80917 5.2344 2.81046 5.2473 2.81171 5.2602C2.83879 5.49074 2.97987 5.68661 3.177 5.78962C3.27218 5.83931 3.38046 5.86746 3.49533 5.86746H3.49637C3.69922 5.86724 3.88176 5.77904 4.0074 5.63902C4.11696 5.51738 4.18358 5.35623 4.18358 5.17939C4.18358 5.11784 4.17554 5.05841 4.16054 5.00174C4.12181 4.85684 4.03699 4.73057 3.92277 4.64005C4.08756 4.23098 4.48795 3.94228 4.95603 3.94228C5.26356 3.94228 5.5419 4.06686 5.74347 4.26843L7.50497 6.02989L7.04747 6.48739L5.73396 7.80088C5.53323 7.99697 5.2587 8.11773 4.95603 8.11773C4.79528 8.11773 4.64234 8.08367 4.50423 8.02233C4.50338 8.02192 4.50232 8.02149 4.50128 8.02108C4.239 7.90348 4.03045 7.6875 3.92277 7.42015C4.03699 7.32941 4.12181 7.20336 4.16054 7.05827C4.17554 7.00179 4.18358 6.94214 4.18358 6.8808C4.18358 6.70397 4.11696 6.54281 4.0074 6.42099C3.88176 6.28116 3.69963 6.19296 3.4968 6.19255H3.49533C3.38046 6.19255 3.27218 6.22067 3.177 6.27039C2.97922 6.3738 2.83795 6.57052 2.81149 6.8019C2.8113 6.80488 2.81087 6.80763 2.81065 6.81036C2.8098 6.81969 2.80896 6.82877 2.80833 6.83807C2.80833 6.8406 2.80833 6.84295 2.80789 6.84527C2.80388 6.89774 2.80197 6.95081 2.80197 7.0041C2.80197 7.87915 3.32378 8.63256 4.07318 8.96948L4.09833 8.98069C4.20747 9.02828 4.32147 9.06699 4.43929 9.09576C4.60492 9.1368 4.77794 9.15838 4.95603 9.15838C5.45921 9.15838 5.922 8.98598 6.28855 8.69684C6.32346 8.66935 6.35749 8.64058 6.39071 8.61077L6.39156 8.60992L7.99165 7.00983L8.23827 6.7632L8.9739 6.02758L9.19176 5.80991L9.38275 5.61892L9.95722 5.04426C10.103 4.89851 10.228 4.73185 10.3274 4.54931C10.4936 4.24367 10.5882 3.8934 10.5882 3.52116C10.5882 3.34432 10.5668 3.17259 10.5266 3.00824C10.4359 2.63659 10.2489 2.30283 9.99338 2.03507C9.98556 2.0268 9.97776 2.01879 9.96949 2.01074C9.96843 2.00968 9.96758 2.00883 9.96674 2.00777C9.96019 2.00144 9.95384 1.99487 9.94748 1.98854C9.94601 1.98685 9.94454 1.98557 9.94307 1.98429C8.89945 0.927795 7.45039 0.272949 5.84817 0.272949C5.07066 0.272949 4.3293 0.426931 3.65269 0.70634C3.31448 0.845949 2.99256 1.01684 2.69029 1.21525C1.12448 2.24447 0.0908203 4.01651 0.0908203 6.03011C0.0908203 8.04368 1.12448 9.81576 2.69029 10.8448C2.99149 11.0425 3.31236 11.213 3.64931 11.3522C4.32677 11.6326 5.0694 11.7872 5.84817 11.7872C7.45885 11.7872 8.9151 11.1256 9.95976 10.0594L9.96464 10.0546C9.96802 10.0511 9.9714 10.0476 9.97478 10.0442C9.98133 10.0376 9.9879 10.0309 9.99423 10.0241C9.99677 10.0217 9.99911 10.0192 10.0014 10.0165C10.2531 9.7506 10.4378 9.42044 10.5281 9.05302C10.5691 8.88742 10.5907 8.7144 10.5907 8.53631C10.5907 8.16319 10.4955 7.8123 10.3286 7.50625Z", fill: "currentColor" }),
30358
+ /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M16.9927 5.24012C16.9027 5.11131 16.7871 4.99534 16.6586 4.89231C16.5301 4.78924 16.4015 4.71195 16.2602 4.64753C16.1188 4.58312 15.9775 4.5316 15.8233 4.49295C15.6691 4.45431 15.5149 4.44141 15.3607 4.44141C15.1807 4.44141 14.988 4.46718 14.7952 4.5187C14.6282 4.57024 14.4611 4.63463 14.3069 4.72482C14.0113 4.90518 13.7543 5.16282 13.5872 5.45912C13.4973 5.6137 13.433 5.78118 13.3816 5.94866C13.3303 6.12901 13.3174 6.30937 13.3174 6.48972C13.3174 6.67005 13.3431 6.85041 13.3945 7.03076C13.4459 7.19824 13.5101 7.36572 13.613 7.52031C13.7929 7.8166 14.0499 8.07424 14.3583 8.2546C14.5125 8.34479 14.6796 8.42208 14.8466 8.46072C15.0137 8.51224 15.1936 8.53801 15.3735 8.53801H15.3863C15.502 8.53801 15.6305 8.52514 15.7462 8.49937C15.8618 8.4736 15.9775 8.44782 16.0803 8.40918C16.1831 8.37053 16.2859 8.31901 16.3887 8.2546C16.4787 8.20308 16.5815 8.13866 16.6586 8.07424C16.6971 8.0356 16.7357 7.99695 16.7742 7.95831C16.8128 7.90676 16.8256 7.85524 16.8385 7.79082C16.8385 7.75218 16.8256 7.72643 16.8128 7.68776C16.7999 7.66201 16.7871 7.63624 16.7742 7.62337L16.7228 7.55895C16.71 7.54608 16.6971 7.52031 16.6843 7.49453C16.6586 7.45589 16.6329 7.41724 16.5943 7.3786C16.5686 7.33995 16.5429 7.31418 16.5044 7.28841C16.4658 7.26266 16.4273 7.24976 16.3887 7.24976H16.3759H16.363C16.3116 7.24976 16.2602 7.26266 16.2217 7.30131C16.1959 7.31418 16.1702 7.33995 16.1574 7.35282C16.106 7.39147 16.0546 7.44302 15.9903 7.48166C15.9389 7.52031 15.8747 7.55895 15.8233 7.58472C15.759 7.61047 15.6948 7.63624 15.6177 7.64911C15.5406 7.66201 15.4634 7.67489 15.3735 7.67489H15.3607C15.2321 7.67489 15.1036 7.64911 14.988 7.5976C14.8595 7.54608 14.7567 7.48166 14.6539 7.39147C14.5511 7.30131 14.4611 7.19824 14.384 7.08231C14.3455 7.01789 14.3069 6.95347 14.2812 6.88905H17.1083C17.2754 6.88905 17.3911 6.77311 17.3911 6.60566C17.4039 6.34801 17.3654 6.07747 17.3011 5.8327C17.2497 5.6266 17.134 5.42047 16.9927 5.24012ZM16.4915 6.0517H14.2812C14.3197 5.96153 14.3583 5.88424 14.4226 5.79405C14.5125 5.66524 14.6282 5.54931 14.7567 5.45912C14.8466 5.3947 14.9623 5.35605 15.0651 5.33031C15.1679 5.30453 15.2836 5.29166 15.3992 5.29166C15.5406 5.29166 15.6691 5.31741 15.7976 5.35605C15.9261 5.3947 16.0417 5.45912 16.1446 5.54931C16.2473 5.6266 16.3373 5.72966 16.4015 5.8456C16.4401 5.91001 16.4658 5.97441 16.4915 6.0517Z", fill: "currentColor" }),
30359
+ /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M20.7832 8.04849L19.2925 6.27072L20.6033 4.9052C20.6418 4.85366 20.6675 4.77637 20.6675 4.72485C20.6675 4.6862 20.6675 4.66043 20.6547 4.63466C20.6418 4.60891 20.6161 4.58314 20.5904 4.54449C20.539 4.50585 20.4876 4.49298 20.4362 4.49298H20.0122C19.9479 4.49298 19.8965 4.50585 19.8451 4.53162C19.8065 4.55737 19.7808 4.58314 19.7423 4.60891L18.5086 5.92291V3.68137C18.5086 3.64272 18.5086 3.60408 18.4829 3.56543C18.4701 3.52679 18.4444 3.48814 18.4187 3.47527C18.3673 3.42372 18.303 3.39795 18.2259 3.39795H17.9303C17.8918 3.39795 17.8532 3.39795 17.8147 3.41085C17.7761 3.42372 17.7376 3.44949 17.7119 3.47527C17.6605 3.52679 17.6348 3.5912 17.6348 3.66849V8.16446C17.6348 8.2031 17.6348 8.24175 17.6476 8.26749C17.6605 8.30614 17.6862 8.34481 17.7119 8.37056C17.7376 8.39633 17.7761 8.4221 17.8147 8.43498C17.8404 8.44785 17.8661 8.44785 17.9046 8.44785C17.9175 8.44785 17.9175 8.44785 17.9303 8.44785H18.2002C18.3673 8.44785 18.4829 8.33191 18.4829 8.16446V7.0952L18.7014 6.8762L19.8708 8.29327C19.8965 8.33191 19.9222 8.38346 19.9736 8.4092C20.025 8.43498 20.0764 8.46075 20.1278 8.46075H20.6161C20.6675 8.46075 20.7061 8.46075 20.7446 8.43498L20.7575 8.4221C20.7832 8.4092 20.8603 8.35769 20.8603 8.24175C20.8603 8.21598 20.8603 8.1902 20.8474 8.16446C20.8474 8.12578 20.8217 8.08714 20.7832 8.04849Z", fill: "currentColor" }),
30360
+ /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M24.3442 4.49264H24.0615C24.0229 4.49264 23.9844 4.49264 23.9587 4.50551C23.9201 4.51839 23.8816 4.54416 23.8559 4.56993C23.8302 4.59568 23.8045 4.63435 23.7916 4.673C23.7788 4.71164 23.7788 4.75029 23.7788 4.77603V4.78893C23.6631 4.71164 23.5474 4.63435 23.4189 4.5828C23.1748 4.47974 22.9178 4.42822 22.6608 4.42822C22.6479 4.42822 22.6479 4.42822 22.6351 4.42822C22.4551 4.42822 22.2752 4.454 22.0953 4.50551C21.9283 4.55703 21.7612 4.62145 21.607 4.71164C21.4528 4.8018 21.3114 4.90487 21.1958 5.0337C21.0673 5.16251 20.9645 5.29135 20.8745 5.44593C20.7846 5.60051 20.7075 5.76799 20.6689 5.93545C20.5661 6.29616 20.5661 6.66977 20.6689 7.01758C20.7203 7.18506 20.7846 7.35251 20.8745 7.50712C21.0544 7.80341 21.3114 8.06106 21.607 8.24141C21.7612 8.33158 21.9283 8.40887 22.0953 8.44751C22.2752 8.49906 22.4551 8.52483 22.6351 8.52483C22.6479 8.52483 22.6479 8.52483 22.6608 8.52483C22.9178 8.52483 23.1748 8.47329 23.4189 8.37022C23.5474 8.3187 23.6631 8.24141 23.7788 8.16412V8.18987C23.7788 8.22851 23.7788 8.26716 23.8045 8.30583C23.8173 8.34448 23.843 8.37022 23.8687 8.396C23.8944 8.42177 23.933 8.44751 23.9715 8.46041C24.0101 8.47329 24.0486 8.48616 24.0743 8.47329H24.3699C24.447 8.47329 24.5113 8.44751 24.5626 8.396C24.5884 8.37022 24.6141 8.33158 24.6269 8.29293C24.6398 8.25429 24.6526 8.21564 24.6398 8.18987V4.77603C24.6398 4.673 24.6012 4.60858 24.5626 4.56993C24.5241 4.53129 24.4599 4.49264 24.3442 4.49264ZM23.7916 6.46364C23.7916 6.61822 23.7659 6.7728 23.7017 6.92741C23.6374 7.06912 23.5603 7.19793 23.4447 7.31387C23.3418 7.4298 23.2133 7.51999 23.072 7.58441C22.9306 7.6488 22.7764 7.68748 22.6222 7.68748C22.468 7.68748 22.3138 7.6488 22.1853 7.58441C22.0439 7.51999 21.9283 7.4298 21.8126 7.31387C21.7098 7.19793 21.6199 7.06912 21.5685 6.92741C21.4528 6.6311 21.4528 6.30906 21.5685 6.01274C21.6327 5.87106 21.7098 5.74222 21.8126 5.62629C21.9154 5.51035 22.0439 5.43303 22.1853 5.36864C22.3266 5.30422 22.4808 5.26558 22.6222 5.26558C22.7764 5.26558 22.9306 5.30422 23.072 5.36864C23.2133 5.43303 23.3418 5.52322 23.4447 5.62629C23.5474 5.74222 23.6374 5.87106 23.7017 6.01274C23.7659 6.15445 23.7916 6.30906 23.7916 6.46364Z", fill: "currentColor" }),
30361
+ /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M29.7915 7.67488C29.7787 7.662 29.7658 7.63623 29.753 7.62336L29.6246 7.45588C29.6115 7.4301 29.5858 7.40436 29.573 7.37859C29.5474 7.32704 29.4958 7.3013 29.4317 7.27552C29.3802 7.26265 29.3289 7.26265 29.2774 7.27552C29.2389 7.2884 29.2133 7.3013 29.1746 7.32704L29.1361 7.36571C29.0848 7.40436 29.0333 7.45588 28.9689 7.49452C28.9177 7.53317 28.8533 7.57181 28.802 7.59759C28.7377 7.62336 28.6736 7.6491 28.5964 7.662C28.5192 7.67488 28.4423 7.68775 28.3523 7.68775H28.3395C28.1979 7.68775 28.0438 7.6491 27.9154 7.59759C27.7738 7.53317 27.6454 7.443 27.5426 7.33994C27.4269 7.224 27.3497 7.09517 27.2856 6.95346C27.2213 6.81175 27.1957 6.65717 27.1957 6.48969C27.1957 6.3351 27.2341 6.16765 27.2985 6.02594C27.3628 5.88423 27.4526 5.74252 27.5554 5.63946C27.6582 5.52352 27.7869 5.43333 27.9282 5.36894C28.0566 5.30452 28.2107 5.26588 28.3523 5.26588C28.4292 5.26588 28.4936 5.27875 28.5707 5.29162C28.712 5.3174 28.8533 5.38181 28.9689 5.4591C29.0205 5.49775 29.0717 5.5364 29.1233 5.58794C29.1877 5.65233 29.2646 5.69098 29.3417 5.69098C29.393 5.69098 29.4702 5.66523 29.5346 5.57504L29.753 5.29162C29.7915 5.2401 29.7915 5.17569 29.7915 5.12417C29.7915 5.08552 29.7658 5.03398 29.7402 4.99533C29.7143 4.96959 29.6886 4.94381 29.663 4.91804L29.6115 4.8794C29.5346 4.81498 29.4446 4.76346 29.3546 4.71194C29.2517 4.6604 29.1617 4.60888 29.0589 4.57023C28.9561 4.53159 28.8405 4.50581 28.7248 4.48004C28.6092 4.45427 28.4936 4.4414 28.3779 4.45427C28.1979 4.45427 28.0182 4.48004 27.8382 4.53159C27.671 4.5831 27.5041 4.64752 27.3497 4.73769C27.0416 4.91804 26.7972 5.17569 26.6047 5.47198C26.5147 5.62659 26.4375 5.79404 26.3862 5.96152C26.2834 6.32223 26.2834 6.69581 26.3862 7.04365C26.4375 7.2111 26.5018 7.37859 26.6047 7.53317C26.7844 7.82946 27.0416 8.0871 27.3497 8.26746C27.5041 8.35765 27.671 8.43494 27.8382 8.47359C28.0182 8.5251 28.1851 8.55088 28.3651 8.55088H28.3779C28.4936 8.55088 28.622 8.538 28.7377 8.51223C28.8533 8.48646 28.9689 8.46071 29.0717 8.42207C29.1746 8.38342 29.2774 8.33188 29.3802 8.26746C29.4702 8.21594 29.5602 8.15152 29.6502 8.0871C29.6887 8.06136 29.7274 8.02271 29.753 7.98407C29.7787 7.9454 29.8043 7.90675 29.8171 7.8681C29.8299 7.81659 29.8299 7.76504 29.8171 7.72639L29.7915 7.67488Z", fill: "currentColor" }),
30362
+ /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M33.6473 4.49264H33.3645C33.326 4.49264 33.2873 4.49264 33.2616 4.50551C33.2232 4.51839 33.1847 4.54416 33.1588 4.56993C33.1332 4.59568 33.1076 4.63435 33.0947 4.673C33.0819 4.71164 33.0819 4.75029 33.0819 4.77603V4.78893C32.966 4.71164 32.8504 4.63435 32.7219 4.5828C32.4778 4.47974 32.2209 4.42822 31.9509 4.42822C31.7709 4.42822 31.5912 4.454 31.4112 4.50551C31.2443 4.55703 31.0771 4.62145 30.923 4.71164C30.7686 4.8018 30.6274 4.90487 30.5117 5.0337C30.3833 5.16251 30.2805 5.29135 30.1905 5.44593C30.1005 5.60051 30.0361 5.76799 29.9848 5.93545C29.882 6.29616 29.882 6.66977 29.9848 7.01758C30.1261 7.53287 30.473 7.97087 30.923 8.24141C31.0771 8.33158 31.2443 8.40887 31.4112 8.44751C31.5912 8.49906 31.7709 8.52483 31.9509 8.52483C31.9637 8.52483 31.9637 8.52483 31.9766 8.52483C32.2337 8.52483 32.4906 8.47329 32.7347 8.37022C32.8635 8.3187 32.9791 8.24141 33.0947 8.16412V8.18987C33.0947 8.22851 33.0947 8.26716 33.1204 8.30583C33.1332 8.34448 33.1588 8.37022 33.1847 8.396C33.2104 8.42177 33.2488 8.44751 33.2873 8.46041C33.326 8.47329 33.3645 8.48616 33.3901 8.47329H33.6857C33.7629 8.47329 33.827 8.44751 33.8786 8.396C33.9042 8.37022 33.9298 8.33158 33.9429 8.29293C33.9557 8.25429 33.9686 8.21564 33.9686 8.18987V4.77603C33.9686 4.673 33.9298 4.60858 33.8914 4.56993C33.827 4.53129 33.7629 4.49264 33.6473 4.49264ZM33.1076 6.46364C33.1076 6.61822 33.0819 6.7728 33.0176 6.92741C32.9532 7.06912 32.8763 7.2108 32.7606 7.31387C32.6578 7.4298 32.5291 7.51999 32.3878 7.58441C32.2466 7.6488 32.0922 7.68748 31.9381 7.68748C31.784 7.68748 31.6296 7.6488 31.5012 7.58441C31.3599 7.51999 31.2443 7.4298 31.1284 7.31387C31.0256 7.19793 30.9358 7.06912 30.8843 6.92741C30.7686 6.6311 30.7686 6.30906 30.8843 6.01274C30.9486 5.87106 31.0256 5.74222 31.1284 5.62629C31.2312 5.51035 31.3599 5.43303 31.5012 5.36864C31.6425 5.30422 31.7968 5.26558 31.9381 5.26558C32.0922 5.26558 32.2466 5.30422 32.3878 5.36864C32.5291 5.43303 32.6578 5.52322 32.7606 5.62629C32.8635 5.74222 32.9532 5.87106 33.0176 6.01274C33.0688 6.15445 33.1076 6.30906 33.1076 6.46364Z", fill: "currentColor" }),
30363
+ /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M37.0006 5.03399C37.0006 4.99534 36.9878 4.9567 36.975 4.91805C36.9622 4.87941 36.9363 4.85363 36.9106 4.82789C36.885 4.80212 36.8594 4.77634 36.8206 4.76347C36.7437 4.71195 36.6665 4.66041 36.5765 4.60889C36.4994 4.57024 36.4225 4.5316 36.3325 4.50582C36.2425 4.48005 36.1525 4.46718 36.0625 4.45431C35.9596 4.44141 35.8568 4.44141 35.7671 4.44141C35.6512 4.44141 35.5484 4.45431 35.4458 4.49295C35.3558 4.5316 35.2786 4.57024 35.2015 4.62176C35.1886 4.63463 35.1758 4.64753 35.163 4.64753C35.1502 4.62176 35.1374 4.59599 35.1115 4.57024C35.0858 4.54447 35.0474 4.5187 35.0086 4.50582C34.9702 4.49295 34.9317 4.48005 34.9061 4.49295H34.6105C34.5717 4.49295 34.5333 4.49295 34.5076 4.5187C34.4689 4.5316 34.4433 4.55734 34.4176 4.57024C34.392 4.59599 34.3664 4.63463 34.3533 4.67331C34.3405 4.71195 34.3276 4.7506 34.3276 4.77634V8.19018C34.3276 8.35766 34.4433 8.4736 34.6105 8.4736H34.9061C34.9189 8.4736 34.9189 8.4736 34.9317 8.4736C34.9574 8.4736 34.9958 8.4736 35.0217 8.46072C35.0602 8.44782 35.0986 8.42208 35.1245 8.39631C35.1502 8.37053 35.1758 8.33189 35.1886 8.29324C35.2015 8.2546 35.2015 8.21595 35.2015 8.19018V5.93576C35.2015 5.8327 35.2143 5.74253 35.253 5.65234C35.2786 5.57505 35.3299 5.51066 35.3815 5.44624C35.4327 5.3947 35.4971 5.35605 35.5615 5.31741C35.6255 5.29166 35.7027 5.27876 35.7799 5.27876C35.8827 5.27876 35.9855 5.29166 36.0881 5.33031C36.204 5.36895 36.3068 5.42047 36.3965 5.48489L36.4353 5.51066C36.4737 5.54931 36.5253 5.56218 36.5894 5.56218C36.6278 5.56218 36.6665 5.54931 36.6922 5.52353C36.7306 5.49776 36.7565 5.47199 36.7822 5.44624L36.9622 5.16282C36.9878 5.12418 37.0006 5.08553 37.0006 5.03399Z", fill: "currentColor" }),
30364
+ /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M40.9076 5.84529C40.8436 5.62629 40.7536 5.40729 40.6123 5.22693C40.5095 5.0981 40.4066 4.98216 40.2782 4.8791C40.1495 4.77603 40.021 4.69874 39.8797 4.63435C39.7385 4.56993 39.5969 4.51839 39.4428 4.47974C39.2885 4.4411 39.1344 4.42822 38.9803 4.42822H38.9672C38.7875 4.42822 38.5946 4.454 38.4146 4.50551C38.2477 4.55703 38.0806 4.62145 37.9265 4.71164C37.7721 4.8018 37.6308 4.90487 37.5152 5.0337C37.2711 5.29135 37.0911 5.60051 37.0011 5.93545C36.9498 6.1158 36.937 6.29616 36.937 6.47651C36.937 6.65687 36.9626 6.85009 37.0139 7.01758C37.0655 7.18506 37.1296 7.35251 37.2196 7.50712C37.3096 7.6617 37.4252 7.80341 37.5408 7.91935C37.6693 8.04816 37.8108 8.15122 37.9521 8.24141C38.1062 8.33158 38.2734 8.40887 38.4406 8.44751C38.6203 8.49906 38.7875 8.52483 38.9672 8.52483C38.9672 8.52483 38.9672 8.52483 38.9803 8.52483C39.1087 8.52483 39.2244 8.51193 39.34 8.48619C39.4556 8.46041 39.5713 8.43464 39.6741 8.396C39.7769 8.35735 39.8797 8.30583 39.9826 8.24141C40.0726 8.18987 40.1623 8.12548 40.2523 8.06106C40.291 8.02241 40.3423 7.98377 40.3679 7.94512C40.4066 7.90648 40.4195 7.85493 40.4195 7.77764C40.4195 7.73899 40.4066 7.71322 40.3938 7.67458C40.381 7.6488 40.3679 7.62306 40.3551 7.61016L40.3166 7.55864C40.3038 7.54577 40.291 7.51999 40.2651 7.49422L40.1754 7.37829C40.1623 7.35251 40.1366 7.32677 40.111 7.31387C40.0854 7.28812 40.0466 7.27522 40.0082 7.26235C39.9697 7.24945 39.931 7.24945 39.9054 7.26235C39.8669 7.27522 39.841 7.28812 39.8154 7.30099C39.7897 7.31387 39.7641 7.33964 39.7513 7.35251C39.6997 7.39116 39.6485 7.4427 39.5841 7.48135C39.5328 7.51999 39.4685 7.55864 39.4172 7.58441C39.3528 7.61016 39.2885 7.63593 39.2116 7.6488C39.1344 7.6617 39.0444 7.67458 38.9672 7.67458H38.9544C38.8259 7.67458 38.6975 7.6488 38.5818 7.59729C38.4534 7.54577 38.3506 7.48135 38.2477 7.39116C38.1449 7.301 38.0549 7.19793 37.9906 7.082C37.9521 7.01758 37.9136 6.95316 37.8877 6.88877H40.7151C40.882 6.88877 40.9976 6.7728 40.9976 6.60535C41.0105 6.36058 40.972 6.10293 40.9076 5.84529ZM40.0982 6.05141H37.8877C37.9265 5.96122 37.9649 5.88393 38.0293 5.79374C38.1193 5.66493 38.2349 5.549 38.3634 5.4588C38.4534 5.39439 38.5562 5.35574 38.6718 5.33C38.7746 5.30422 38.8903 5.29135 39.0059 5.29135C39.1472 5.29135 39.2756 5.3171 39.4041 5.35574C39.5328 5.39439 39.6485 5.4588 39.7513 5.549C39.8541 5.62629 39.9438 5.72935 40.0082 5.84529C40.0338 5.9097 40.0726 5.9741 40.0982 6.05141Z", fill: "currentColor" }),
30365
+ /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M25.7828 7.50791C25.6928 7.46926 25.59 7.45639 25.4872 7.48216C25.3845 7.50791 25.2945 7.54658 25.2174 7.62387C25.1403 7.70116 25.0889 7.79133 25.076 7.89439C25.0503 8.0361 25.076 8.16494 25.1531 8.28087C25.2302 8.39681 25.3459 8.4741 25.4744 8.49987C25.5131 8.51275 25.5387 8.51274 25.5772 8.51274C25.6415 8.51274 25.7056 8.49987 25.77 8.4741C25.86 8.43545 25.95 8.37104 26.0013 8.28087C26.0528 8.19068 26.0913 8.10052 26.0913 7.99745C26.0913 7.89439 26.0656 7.79133 26.0013 7.71404C25.9628 7.61097 25.8856 7.54658 25.7828 7.50791Z", fill: "currentColor" })
30366
+ ] }),
30367
+ /* @__PURE__ */ jsxRuntimeExports.jsx("defs", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("clipPath", { id: "clip0_988_2228", children: /* @__PURE__ */ jsxRuntimeExports.jsx("rect", { width: "42", height: "12", fill: "currentColor" }) }) })
30368
+ ] });
30369
+ };
29992
30370
  const ChatComposer$2 = reactExports.lazy(() => Promise.resolve().then(() => ChatComposer$1));
29993
30371
  function WidgetContainer({
29994
30372
  isOpen,
@@ -29997,13 +30375,21 @@ var MedAssistWidget = (function(exports) {
29997
30375
  onStartNewSession,
29998
30376
  children,
29999
30377
  title,
30378
+ titleImg,
30000
30379
  sessionId,
30001
30380
  chatComposer,
30002
30381
  environment,
30003
- displayMode
30382
+ displayMode,
30383
+ theme
30004
30384
  }) {
30005
30385
  const [isMobile, setIsMobile] = reactExports.useState(false);
30006
30386
  const containerRef = reactExports.useRef(null);
30387
+ const mergedTheme = reactExports.useMemo(() => mergeTheme(theme), [theme]);
30388
+ reactExports.useEffect(() => {
30389
+ if (containerRef.current) {
30390
+ applyTheme(containerRef.current, mergedTheme);
30391
+ }
30392
+ }, [mergedTheme]);
30007
30393
  reactExports.useEffect(() => {
30008
30394
  const checkMobile = () => {
30009
30395
  const width = window?.innerWidth ?? 0;
@@ -30133,12 +30519,13 @@ var MedAssistWidget = (function(exports) {
30133
30519
  isOpen ? "opacity-100 pointer-events-auto" : "opacity-0 pointer-events-none scale-95"
30134
30520
  );
30135
30521
  const cardStyles = cn(
30136
- "w-full h-full",
30137
- isMobile ? "bg-white" : "bg-white/90 backdrop-blur-2xl",
30522
+ "w-full h-full relative",
30523
+ "bg-background",
30138
30524
  "shadow-2xl",
30139
30525
  "flex flex-col",
30140
30526
  "overflow-hidden",
30141
- "border border-white/50 ring-1 ring-white/60",
30527
+ "border-0",
30528
+ mergedTheme.backgroundImage ? "theme-with-background" : "",
30142
30529
  isMobile ? "rounded-none" : "rounded-3xl"
30143
30530
  );
30144
30531
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
@@ -30178,8 +30565,7 @@ var MedAssistWidget = (function(exports) {
30178
30565
  width: "100vw",
30179
30566
  maxHeight: "100svh",
30180
30567
  height: "100svh",
30181
- backgroundColor: "white"
30182
- // Ensure full coverage of background
30568
+ backgroundColor: mergedTheme.backgroundImage ? "transparent" : "hsl(var(--background))"
30183
30569
  }
30184
30570
  // Ensure proper font rendering
30185
30571
  // WebkitFontSmoothing: "antialiased",
@@ -30220,18 +30606,43 @@ var MedAssistWidget = (function(exports) {
30220
30606
  }
30221
30607
  }
30222
30608
  ` }),
30223
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Card, { className: cardStyles, children: [
30224
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-shrink-0 sticky top-0 z-50", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
30609
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Card, { className: cn(cardStyles, "border-0"), "data-text-color": mergedTheme.textColor, children: [
30610
+ mergedTheme.backgroundImage && /* @__PURE__ */ jsxRuntimeExports.jsx(
30611
+ "div",
30612
+ {
30613
+ className: "absolute inset-0 -z-10",
30614
+ style: {
30615
+ backgroundImage: `url(${mergedTheme.backgroundImage})`,
30616
+ backgroundSize: "cover",
30617
+ backgroundPosition: "center",
30618
+ backgroundRepeat: "no-repeat",
30619
+ // filter: `blur(3px)`,
30620
+ transform: "scale(1.1)"
30621
+ // Scale up to cover blur edges
30622
+ }
30623
+ }
30624
+ ),
30625
+ mergedTheme.backgroundImage && mergedTheme.textColor === "black" && /* @__PURE__ */ jsxRuntimeExports.jsx(
30626
+ "div",
30627
+ {
30628
+ className: "absolute inset-0 -z-10",
30629
+ style: {
30630
+ backgroundColor: "rgba(0, 0, 0, 0.4)"
30631
+ }
30632
+ }
30633
+ ),
30634
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: cn("flex-shrink-0 sticky top-0 z-50 synapse-chat-widget-header", mergedTheme.backgroundImage ? "" : "bg-popover"), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
30225
30635
  ProfileHeader,
30226
30636
  {
30227
30637
  onClose,
30228
30638
  title,
30639
+ titleImg,
30229
30640
  iconUrl,
30230
30641
  startNewConversation: onStartNewSession
30231
30642
  }
30232
30643
  ) }),
30233
30644
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1 min-h-0 overflow-hidden flex flex-col", children }),
30234
- chatComposer && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-shrink-0 sticky bottom-0 z-50", children: [
30645
+ chatComposer && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: cn("flex-shrink-0 sticky bottom-0 z-50 synapse-chat-widget-footer", mergedTheme.backgroundImage ? "" : "bg-popover"), children: [
30235
30646
  /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: null, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
30236
30647
  ChatComposer$2,
30237
30648
  {
@@ -30247,13 +30658,27 @@ var MedAssistWidget = (function(exports) {
30247
30658
  isDisabled: chatComposer.isDisabled,
30248
30659
  isMobile,
30249
30660
  placeholder: chatComposer.placeholder,
30250
- recordingStatus: chatComposer.recordingStatus
30661
+ recordingStatus: chatComposer.recordingStatus,
30662
+ theme: mergedTheme
30251
30663
  }
30252
30664
  ) }),
30253
- sessionId && environment === "development" && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "px-6 flex justify-center items-center", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-[8px] text-gray-600 font-mono opacity-50", children: [
30665
+ sessionId && environment === "development" && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "px-6 flex justify-center items-center", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-[8px] text-text-secondary font-mono opacity-50", children: [
30254
30666
  "Session ID: ",
30255
30667
  sessionId
30256
- ] }) })
30668
+ ] }) }),
30669
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "px-6 py-2 flex justify-center items-center gap-1.5 text-foreground opacity-90", children: [
30670
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
30671
+ "span",
30672
+ {
30673
+ className: "text-[10px] leading-[14px] font-medium",
30674
+ style: {
30675
+ fontFamily: "Inter, system-ui, -apple-system, sans-serif"
30676
+ },
30677
+ children: "Powered by"
30678
+ }
30679
+ ),
30680
+ /* @__PURE__ */ jsxRuntimeExports.jsx(EkaCareLogo, {})
30681
+ ] })
30257
30682
  ] })
30258
30683
  ] })
30259
30684
  ]
@@ -30332,10 +30757,37 @@ var MedAssistWidget = (function(exports) {
30332
30757
  reactExports.useEffect(() => {
30333
30758
  if (sessionId) {
30334
30759
  const messages2 = getMessagesForSession(sessionId) || [];
30335
- setMessages(messages2);
30760
+ if (messages2.length <= 0 && initialMessage?.text) {
30761
+ setMessages([{
30762
+ id: Date.now().toString(),
30763
+ content: initialMessage.text,
30764
+ role: MessageSender.ASSISTANT,
30765
+ timestamp: formatMessageTimestamp(Date.now()),
30766
+ isStored: false,
30767
+ ...initialMessage.suggestions?.length && {
30768
+ toolEscalationData: {
30769
+ tool_id: initialMessage.suggestions[0].value ?? null,
30770
+ tool_name: "elicitation",
30771
+ details: {
30772
+ component: distExports.SYNAPSE_COMPONENTS.PILL,
30773
+ input: {
30774
+ options: initialMessage.suggestions.map((suggestion) => ({
30775
+ id: suggestion.value || "",
30776
+ label: suggestion.label || "",
30777
+ value: suggestion.value || ""
30778
+ }))
30779
+ }
30780
+ },
30781
+ isResponded: false
30782
+ }
30783
+ }
30784
+ }]);
30785
+ } else {
30786
+ setMessages(messages2);
30787
+ }
30336
30788
  setInitialPrompts([]);
30337
30789
  }
30338
- }, [sessionId]);
30790
+ }, [sessionId, initialMessage]);
30339
30791
  reactExports.useEffect(() => {
30340
30792
  setIsReady(false);
30341
30793
  if (!agentId) {
@@ -30583,6 +31035,7 @@ var MedAssistWidget = (function(exports) {
30583
31035
  synapseRef.current?.on(distExports.SYNAPSE_REALTIME_EVENTS.END_OF_STREAM, () => {
30584
31036
  setIsStreaming(false);
30585
31037
  setProgressMessage(null);
31038
+ setIsWaitingForResponse(false);
30586
31039
  });
30587
31040
  synapseRef.current?.on(distExports.SYNAPSE_REALTIME_EVENTS.CONNECTED, () => {
30588
31041
  resetConnectionStates();
@@ -31039,6 +31492,16 @@ var MedAssistWidget = (function(exports) {
31039
31492
  );
31040
31493
  setInitialPrompts([{ role: "user", text: message }, { role: "assistant", text: selectedMessage.response }]);
31041
31494
  };
31495
+ const handleToggleFeedback = async (feedback, messageId, reason) => {
31496
+ if (!isConnected()) {
31497
+ return;
31498
+ }
31499
+ try {
31500
+ await synapseRef.current?.sendFeedback(messageId, feedback, reason);
31501
+ } catch (error) {
31502
+ console.log("Error sending feedback", error);
31503
+ }
31504
+ };
31042
31505
  return {
31043
31506
  sendMessage,
31044
31507
  startSession,
@@ -31052,11 +31515,11 @@ var MedAssistWidget = (function(exports) {
31052
31515
  isValidFile,
31053
31516
  handleStartNewConnection,
31054
31517
  callTool,
31055
- handleInitialTaskClick
31518
+ handleInitialTaskClick,
31519
+ handleToggleFeedback
31056
31520
  };
31057
31521
  };
31058
31522
  const ChatMessages$2 = reactExports.lazy(() => Promise.resolve().then(() => ChatMessages$1));
31059
- const EmptyChatState$2 = reactExports.lazy(() => Promise.resolve().then(() => EmptyChatState$1));
31060
31523
  const ConnectionStatusBanner = reactExports.lazy(
31061
31524
  () => Promise.resolve().then(() => ConnectionStatus$1).then((module) => ({
31062
31525
  default: module.ConnectionStatus
@@ -31086,7 +31549,7 @@ var MedAssistWidget = (function(exports) {
31086
31549
  isWaitingForResponse,
31087
31550
  isStreaming,
31088
31551
  setError,
31089
- initialMessage,
31552
+ // initialMessage,
31090
31553
  sessionId,
31091
31554
  setUserId,
31092
31555
  userId,
@@ -31104,7 +31567,8 @@ var MedAssistWidget = (function(exports) {
31104
31567
  handleStartNewConnection,
31105
31568
  isValidFile,
31106
31569
  callTool,
31107
- handleInitialTaskClick
31570
+ // handleInitialTaskClick,
31571
+ handleToggleFeedback
31108
31572
  } = useChat({
31109
31573
  environment: "production",
31110
31574
  baseUrl: config.environment === "development" && config.baseUrl ? config.baseUrl : void 0,
@@ -31144,17 +31608,24 @@ var MedAssistWidget = (function(exports) {
31144
31608
  setShowScrollButton(false);
31145
31609
  }
31146
31610
  };
31147
- reactExports.useEffect(() => {
31148
- scrollToBottom();
31149
- }, [incomingMessages, isStreaming]);
31150
31611
  const inConversation = incomingMessages.length > 0;
31612
+ const isFirstMessage = incomingMessages.length === 1;
31613
+ reactExports.useEffect(() => {
31614
+ if (isFirstMessage) {
31615
+ setTimeout(() => {
31616
+ scrollToBottom();
31617
+ }, 0);
31618
+ } else {
31619
+ scrollToBottom();
31620
+ }
31621
+ }, [incomingMessages, isStreaming, isFirstMessage]);
31151
31622
  const isConnected = connectionStatus === distExports.ConnectionStatus.CONNECTED;
31152
31623
  const isComposerDisabled = loading || !isConnected || isWaitingForResponse || isStreaming;
31153
31624
  const isConnectionDisabled = loading || !isConnected;
31154
31625
  const recordingStatusPlaceholder = reactExports.useMemo(() => {
31155
31626
  return recordingStatus === AudioRecordingStatus.IDLE ? null : recordingStatus === AudioRecordingStatus.LISTENING ? "Listening..." : recordingStatus === AudioRecordingStatus.PROCESSING ? "Processing..." : recordingStatus === AudioRecordingStatus.TRANSCRIBING ? "Transcribing..." : null;
31156
31627
  }, [recordingStatus]);
31157
- const composerPlaceholder = isConnectionDisabled ? "Connecting..." : recordingStatusPlaceholder && recordingStatus !== AudioRecordingStatus.IDLE ? recordingStatusPlaceholder : isWaitingForResponse || isStreaming ? "Please wait for the response..." : "Ask me anything…";
31628
+ const composerPlaceholder = isConnectionDisabled ? "Connecting..." : recordingStatusPlaceholder && recordingStatus !== AudioRecordingStatus.IDLE ? recordingStatusPlaceholder : isWaitingForResponse || isStreaming ? "Please wait for the response..." : "Type a reply…";
31158
31629
  const handleSendMessage = async () => {
31159
31630
  if (isComposerDisabled) {
31160
31631
  return;
@@ -31180,10 +31651,6 @@ var MedAssistWidget = (function(exports) {
31180
31651
  }, 100);
31181
31652
  }
31182
31653
  };
31183
- const handleTaskClick = async (task) => {
31184
- if (!task) return;
31185
- await handleInitialTaskClick(task);
31186
- };
31187
31654
  const handleFileChange = (files) => {
31188
31655
  if (files && files.length > 0) {
31189
31656
  const validFiles = files.filter((file) => {
@@ -31247,11 +31714,13 @@ var MedAssistWidget = (function(exports) {
31247
31714
  isOpen,
31248
31715
  onClose: config.onClose,
31249
31716
  title: config.title,
31717
+ titleImg: config.theme?.titleImg,
31250
31718
  iconUrl: config.iconUrl,
31251
31719
  onStartNewSession: () => startSession(true),
31252
31720
  sessionId,
31253
31721
  environment: config.environment,
31254
31722
  displayMode: config.displayMode ?? "widget",
31723
+ theme: config.theme,
31255
31724
  chatComposer: {
31256
31725
  value: inputValue,
31257
31726
  onChange: setInputValue,
@@ -31266,44 +31735,58 @@ var MedAssistWidget = (function(exports) {
31266
31735
  placeholder: composerPlaceholder,
31267
31736
  recordingStatus
31268
31737
  },
31269
- children: !loading && /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(WidgetContentFallback, {}), children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 flex flex-col min-h-0 overflow-hidden bg-white backdrop-blur-2xl relative", children: [
31270
- /* @__PURE__ */ jsxRuntimeExports.jsx(ScrollArea, { ref: scrollAreaRef, className: "flex-1 min-h-0", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
31271
- "div",
31738
+ children: !loading && /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(WidgetContentFallback, {}), children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: cn("flex-1 flex flex-col min-h-0 overflow-hidden relative synapse-chat-window", config.theme?.backgroundImage ? "" : "bg-surface"), children: [
31739
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
31740
+ ScrollArea,
31272
31741
  {
31742
+ ref: scrollAreaRef,
31273
31743
  className: cn(
31274
- "transition-all duration-300",
31275
- inConversation ? "p-4 space-y-3" : "p-6 space-y-6"
31744
+ "flex-1 min-h-0",
31745
+ isFirstMessage ? "[&>[data-radix-scroll-area-viewport]]:flex [&>[data-radix-scroll-area-viewport]]:flex-col [&>[data-radix-scroll-area-viewport]]:justify-end [&>[data-radix-scroll-area-viewport]]:min-h-full" : ""
31276
31746
  ),
31277
- children: [
31278
- !inConversation && initialMessage?.text ? /* @__PURE__ */ jsxRuntimeExports.jsx(
31279
- EmptyChatState$2,
31280
- {
31281
- profile: config.context?.profile,
31282
- tasks: initialMessage.suggestions,
31283
- initialPrompt: initialMessage.text,
31284
- onTaskClick: handleTaskClick,
31285
- disabled: isComposerDisabled
31286
- }
31287
- ) : /* @__PURE__ */ jsxRuntimeExports.jsx(
31288
- ChatMessages$2,
31289
- {
31290
- messages: incomingMessages,
31291
- onSendMessage: sendMessage,
31292
- iconUrl: config.iconUrl,
31293
- callTool
31294
- }
31295
- ),
31296
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: messagesEndRef })
31297
- ]
31747
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
31748
+ "div",
31749
+ {
31750
+ className: cn(
31751
+ "transition-all duration-300 min-w-0 overflow-x-hidden",
31752
+ inConversation ? "p-4 space-y-3" : "p-4 space-y-4"
31753
+ ),
31754
+ children: [
31755
+ isFirstMessage && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs text-[var(--color-muted-foreground)] text-center mb-2", children: "Just now" }),
31756
+ !isFirstMessage && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs text-[var(--color-muted-foreground)] text-center", children: (() => {
31757
+ const now = /* @__PURE__ */ new Date();
31758
+ return now.toLocaleString("en-US", {
31759
+ weekday: "long",
31760
+ // month: "short",
31761
+ // day: "numeric",
31762
+ hour: "2-digit",
31763
+ minute: "2-digit",
31764
+ hour12: true
31765
+ });
31766
+ })() }),
31767
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
31768
+ ChatMessages$2,
31769
+ {
31770
+ messages: incomingMessages,
31771
+ onSendMessage: sendMessage,
31772
+ iconUrl: config.iconUrl,
31773
+ callTool,
31774
+ onToggleFeedback: handleToggleFeedback
31775
+ }
31776
+ ),
31777
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: messagesEndRef })
31778
+ ]
31779
+ }
31780
+ )
31298
31781
  }
31299
- ) }),
31782
+ ),
31300
31783
  showScrollButton && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute bottom-[10px] left-1/2 transform -translate-x-1/2 z-10", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
31301
31784
  Button,
31302
31785
  {
31303
31786
  onClick: scrollToBottom,
31304
31787
  size: "icon",
31305
- className: "h-10 w-10 rounded-full bg-white/90 backdrop-blur-sm shadow-lg border border-lavender-200/60 hover:bg-white hover:shadow-xl transition-all duration-200",
31306
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "w-5 h-5 text-slate-700" })
31788
+ className: "h-10 w-10 rounded-full bg-surface/90 backdrop-blur-sm shadow-lg border border-border-subtle hover:bg-surface hover:shadow-xl transition-all duration-200",
31789
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "w-5 h-5 text-text-primary" })
31307
31790
  }
31308
31791
  ) }),
31309
31792
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -31324,13 +31807,13 @@ var MedAssistWidget = (function(exports) {
31324
31807
  );
31325
31808
  }
31326
31809
  function WidgetContentFallback() {
31327
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 flex flex-col min-h-0 overflow-hidden bg-white backdrop-blur-2xl animate-pulse", children: [
31810
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 flex flex-col min-h-0 overflow-hidden bg-surface backdrop-blur-2xl animate-pulse", children: [
31328
31811
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 p-6 space-y-4", children: [
31329
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-16 bg-gray-100 rounded-2xl" }),
31330
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-16 bg-gray-100 rounded-2xl" }),
31331
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-16 bg-gray-100 rounded-2xl" })
31812
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-16 bg-surface/80 rounded-2xl border border-border-subtle/50" }),
31813
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-16 bg-surface/80 rounded-2xl border border-border-subtle/50" }),
31814
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-16 bg-surface/80 rounded-2xl border border-border-subtle/50" })
31332
31815
  ] }),
31333
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-24 border-t border-gray-100 bg-gray-50" })
31816
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-24 border-t border-border-subtle bg-surface/80" })
31334
31817
  ] });
31335
31818
  }
31336
31819
  function App({ agentId, config }) {
@@ -31347,7 +31830,14 @@ var MedAssistWidget = (function(exports) {
31347
31830
  {
31348
31831
  isOpen,
31349
31832
  agentId,
31350
- config: { ...config, environment: config.environment ?? "production", onClose: handleClose, title: config.title ?? "Medi Clinic", iconUrl: config.iconUrl ?? "https://cdn.eka.care/bot-icon.svg" }
31833
+ config: {
31834
+ ...config,
31835
+ environment: config.environment ?? "production",
31836
+ onClose: handleClose,
31837
+ title: config.title ?? "Medi Clinic",
31838
+ iconUrl: config.iconUrl ?? "https://cdn.eka.care/bot-icon.svg",
31839
+ theme: config.theme
31840
+ }
31351
31841
  }
31352
31842
  );
31353
31843
  }
@@ -31395,8 +31885,8 @@ var MedAssistWidget = (function(exports) {
31395
31885
  }, [file]);
31396
31886
  const getFileTypeColor = () => {
31397
31887
  if (isImage2) return "text-green-600";
31398
- if (isPDF) return "text-gray-600";
31399
- return "text-gray-600";
31888
+ if (isPDF) return "text-text-secondary";
31889
+ return "text-text-secondary";
31400
31890
  };
31401
31891
  const formatFileSize = (bytes) => {
31402
31892
  if (bytes === 0) return "0 B";
@@ -31493,6 +31983,9 @@ var MedAssistWidget = (function(exports) {
31493
31983
  }) })
31494
31984
  ] });
31495
31985
  }
31986
+ const SendIcon = ({ className }) => {
31987
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { width: "17", height: "16", viewBox: "0 0 17 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", className, children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M1.46875 0.09375L16.3125 6.9375C16.75 7.125 17 7.53125 17 8C17 8.46875 16.75 8.875 16.3125 9.0625L1.46875 15.9062C1.3125 15.9688 1.1875 16 1.03125 16C0.46875 16 0 15.5312 0 14.9688C0 14.8125 0.03125 14.6875 0.09375 14.5625L2.34375 9.5C2.5 9.15625 2.8125 8.9375 3.15625 8.90625L8.0625 8.46875C8.3125 8.46875 8.5 8.25 8.5 8C8.5 7.75 8.3125 7.5625 8.0625 7.53125L3.15625 7.09375C2.8125 7.0625 2.5 6.84375 2.34375 6.5L0.09375 1.4375C0.03125 1.3125 0 1.1875 0 1.03125C0 0.46875 0.46875 0 1.03125 0C1.1875 0 1.3125 0.03125 1.46875 0.09375Z", fill: "currentColor" }) });
31988
+ };
31496
31989
  function ChatComposer({
31497
31990
  value,
31498
31991
  onChange,
@@ -31506,7 +31999,8 @@ var MedAssistWidget = (function(exports) {
31506
31999
  isDisabled,
31507
32000
  placeholder,
31508
32001
  isMobile,
31509
- recordingStatus
32002
+ recordingStatus,
32003
+ theme
31510
32004
  }) {
31511
32005
  const fileInputRef = reactExports.useRef(null);
31512
32006
  const textareaRef = reactExports.useRef(null);
@@ -31514,7 +32008,7 @@ var MedAssistWidget = (function(exports) {
31514
32008
  const isMicDisabled = (isDisabled || recordingStatus !== AudioRecordingStatus.IDLE) && !isRecording;
31515
32009
  const micButtonClasses = cn(
31516
32010
  "rounded-full transition-all duration-200 ",
31517
- isRecording ? "bg-gradient-to-r from-rose-400 via-lavender-500 to-indigo-500 text-white ring-2 ring-white/60 animate-pulse shadow-[0_0_20px_rgba(139,92,246,0.45)]" : isMicDisabled ? "text-lavender-300 cursor-not-allowed shadow-none" : "text-lavender-600 hover:bg-gray-100"
32011
+ isRecording ? "bg-gradient-to-r from-rose-400 via-primary to-indigo-500 text-white ring-2 ring-white/60 animate-pulse shadow-[0_0_20px_rgba(139,92,246,0.45)]" : isMicDisabled ? "text-primary/50 cursor-not-allowed shadow-none" : "text-foreground hover:bg-secondary"
31518
32012
  );
31519
32013
  const handleFileChange = (e) => {
31520
32014
  const files = Array.from(e.target.files || []);
@@ -31561,8 +32055,8 @@ var MedAssistWidget = (function(exports) {
31561
32055
  textareaRef.current?.focus();
31562
32056
  }
31563
32057
  }, [isDisabled]);
31564
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "border-t border-white/20 bg-white/70 backdrop-blur-xl px-4 py-2", children: [
31565
- hasAttachment && attachmentFiles.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mb-2 pb-2 border-b border-white/20", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
32058
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "px-2 py-2", children: [
32059
+ hasAttachment && attachmentFiles.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mb-2 pb-2 border-b border-border-subtle", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
31566
32060
  FilePreviewList,
31567
32061
  {
31568
32062
  files: attachmentFiles,
@@ -31585,94 +32079,106 @@ var MedAssistWidget = (function(exports) {
31585
32079
  "aria-label": "Attach file"
31586
32080
  }
31587
32081
  ),
31588
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
31589
- "div",
31590
- {
31591
- className: cn(
31592
- "flex items-center gap-2 bg-white/70 backdrop-blur rounded-xl px-4 py-2 shadow-md focus-within:border-lavender-100/50 focus-within:ring-2 focus-within:ring-lavender-400/50 transition-all",
31593
- isRecording || hasAttachment ? "ring-2 ring-lavender-200/40" : "ring-2 ring-lavender-300/40 backdrop-blur-xl",
31594
- isDisabled && "opacity-60"
31595
- ),
31596
- children: [
31597
- hasAttachment && attachmentFiles.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-xs text-lavender-600 mr-2", children: [
31598
- attachmentFiles.length,
31599
- " file(s)"
31600
- ] }),
31601
- /* @__PURE__ */ jsxRuntimeExports.jsx(
31602
- Textarea,
31603
- {
31604
- ref: textareaRef,
31605
- onInput: handleTextareaInput,
31606
- placeholder,
31607
- value,
31608
- onChange: (e) => onChange(e.target.value),
31609
- rows: 1,
31610
- maxLength: 1e3,
31611
- autoFocus: !isDisabled,
31612
- style: {
31613
- wordBreak: "break-word",
31614
- overflowWrap: "anywhere",
31615
- minHeight: "40px",
31616
- maxHeight: "120px",
31617
- fontSize: window.innerWidth <= 768 ? "16px" : "14px"
31618
- // Prevent iOS zoom
31619
- },
31620
- onKeyPress: handleKeyPress,
31621
- disabled: isDisabled,
31622
- title: "Enter your message",
31623
- className: "flex-1 border-0 outline-none focus-visible:ring-0 focus-visible:ring-offset-0 text-sm !placeholder:text-gray-400 bg-transparent disabled:cursor-not-allowed rounded-none break-words overflow-wrap-anywhere whitespace-pre-wrap"
31624
- }
31625
- ),
31626
- recordingStatus === AudioRecordingStatus.IDLE && /* @__PURE__ */ jsxRuntimeExports.jsx(
31627
- Button,
31628
- {
31629
- type: "button",
31630
- variant: "ghost",
31631
- size: "icon",
31632
- onClick: handleAttachmentClick,
31633
- disabled: isDisabled,
31634
- className: `rounded-full transition-all ${hasAttachment ? "bg-lavender-200/30 text-lavender-600 hover:bg-lavender-200/40" : "hover:bg-gray-100 text-lavender-600 hover:text-gray-700"}`,
31635
- title: "Attach file",
31636
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(Paperclip, { className: "w-5 h-5" })
31637
- }
32082
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 w-full", children: [
32083
+ recordingStatus === AudioRecordingStatus.IDLE && /* @__PURE__ */ jsxRuntimeExports.jsx(
32084
+ Button,
32085
+ {
32086
+ type: "button",
32087
+ variant: "ghost",
32088
+ size: "icon",
32089
+ onClick: handleAttachmentClick,
32090
+ disabled: isDisabled,
32091
+ className: cn(
32092
+ "rounded-full transition-all shrink-0",
32093
+ hasAttachment ? "bg-primary text-foreground hover:bg-primary/15" : "hover:bg-secondary text-foreground"
31638
32094
  ),
31639
- isRecording ? /* @__PURE__ */ jsxRuntimeExports.jsx(
31640
- Button,
31641
- {
31642
- type: "button",
31643
- variant: "ghost",
31644
- size: "icon",
31645
- onClick: onRecording,
31646
- className: "rounded-full bg-gradient-to-r from-red-400 to-rose-500 text-white hover:from-red-500 hover:to-rose-600 shadow-lg transition-all duration-200 hover:scale-105 active:scale-95",
31647
- title: "Stop recording",
31648
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(Square, { className: "w-4 h-4" })
31649
- }
31650
- ) : !showSendButton && /* @__PURE__ */ jsxRuntimeExports.jsx(
31651
- Button,
31652
- {
31653
- type: "button",
31654
- variant: "ghost",
31655
- size: "icon",
31656
- onClick: onRecording,
31657
- disabled: isMicDisabled,
31658
- className: micButtonClasses,
31659
- title: "Start recording",
31660
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(Mic, { className: "w-5 h-5" })
31661
- }
32095
+ title: "Attach file",
32096
+ "aria-label": "Attach file",
32097
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(Link, { className: "w-5 h-5" })
32098
+ }
32099
+ ),
32100
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
32101
+ "div",
32102
+ {
32103
+ className: cn(
32104
+ "flex items-center gap-1 rounded-full px-2 py-2 flex-1 min-w-0",
32105
+ isDisabled && "opacity-60",
32106
+ // if text color is white, use bg-black-100/10, otherwise use bg-white-100/10
32107
+ theme?.textColor === "white" ? "bg-white-100" : "bg-black-100"
31662
32108
  ),
31663
- showSendButton && !isDisabled && /* @__PURE__ */ jsxRuntimeExports.jsx(
31664
- Button,
31665
- {
31666
- type: "button",
31667
- size: "icon",
31668
- onClick: onSend,
31669
- className: "h-10 w-10 bg-gradient-to-r from-lavender-400 to-lavender-500 hover:from-lavender-500 hover:to-lavender-600 rounded-full text-white transition-all duration-200 shadow-lg hover:shadow-xl hover:scale-105 active:scale-95",
31670
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(Send, { className: "w-4 h-4" })
31671
- }
31672
- )
31673
- ]
31674
- }
31675
- )
32109
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 relative min-w-0", children: [
32110
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
32111
+ Textarea,
32112
+ {
32113
+ ref: textareaRef,
32114
+ onInput: handleTextareaInput,
32115
+ placeholder,
32116
+ value,
32117
+ onChange: (e) => onChange(e.target.value),
32118
+ rows: 1,
32119
+ maxLength: 1e3,
32120
+ autoFocus: !isDisabled && !isMobile,
32121
+ style: {
32122
+ wordBreak: "break-word",
32123
+ overflowWrap: "anywhere",
32124
+ minHeight: "40px",
32125
+ maxHeight: "120px",
32126
+ fontSize: isMobile ? "16px" : "14px",
32127
+ // Prevent iOS zoom
32128
+ lineHeight: "1.5"
32129
+ },
32130
+ onKeyPress: handleKeyPress,
32131
+ disabled: isDisabled,
32132
+ title: "Enter your message",
32133
+ "aria-label": "Enter your message",
32134
+ className: "w-full shadow-none border-0 outline-none focus-visible:ring-0 focus-visible:ring-offset-0 text-sm placeholder:text-muted-foreground bg-transparent disabled:cursor-not-allowed rounded-none break-words overflow-wrap-anywhere whitespace-pre-wrap text-foreground resize-none pr-11"
32135
+ }
32136
+ ),
32137
+ isRecording ? /* @__PURE__ */ jsxRuntimeExports.jsx(
32138
+ Button,
32139
+ {
32140
+ type: "button",
32141
+ variant: "ghost",
32142
+ size: "icon",
32143
+ onClick: onRecording,
32144
+ className: "absolute right-0.5 top-1/2 -translate-y-1/2 rounded-full bg-gradient-to-r from-red-400 to-rose-500 text-white hover:from-red-500 hover:to-rose-600 shadow-lg transition-all duration-200 hover:scale-105 active:scale-95 shrink-0",
32145
+ title: "Stop recording",
32146
+ "aria-label": "Stop recording",
32147
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(Square, { className: "w-4 h-4" })
32148
+ }
32149
+ ) : !showSendButton && /* @__PURE__ */ jsxRuntimeExports.jsx(
32150
+ Button,
32151
+ {
32152
+ type: "button",
32153
+ variant: "ghost",
32154
+ size: "icon",
32155
+ onClick: onRecording,
32156
+ disabled: isMicDisabled,
32157
+ className: cn(
32158
+ "absolute right-0.5 top-1/2 -translate-y-1/2 shrink-0",
32159
+ micButtonClasses
32160
+ ),
32161
+ title: "Start recording",
32162
+ "aria-label": "Start recording",
32163
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(Mic, { className: "w-5 h-5" })
32164
+ }
32165
+ ),
32166
+ showSendButton && !isDisabled && /* @__PURE__ */ jsxRuntimeExports.jsx(
32167
+ Button,
32168
+ {
32169
+ type: "button",
32170
+ size: "icon",
32171
+ onClick: onSend,
32172
+ className: "absolute right-0.5 top-1/2 -translate-y-1/2 h-10 w-10 bg-primary hover:bg-primary/90 rounded-full text-primary-foreground transition-all duration-200 shadow-lg hover:shadow-xl hover:scale-105 active:scale-95 shrink-0",
32173
+ title: "Send message",
32174
+ "aria-label": "Send message",
32175
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(SendIcon, { className: "w-4 h-4 text-primary-foreground" })
32176
+ }
32177
+ )
32178
+ ] })
32179
+ }
32180
+ )
32181
+ ] })
31676
32182
  ] });
31677
32183
  }
31678
32184
  const ChatComposer$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
@@ -38470,8 +38976,9 @@ var MedAssistWidget = (function(exports) {
38470
38976
  function code(state, node2) {
38471
38977
  const value = node2.value ? node2.value + "\n" : "";
38472
38978
  const properties = {};
38473
- if (node2.lang) {
38474
- properties.className = ["language-" + node2.lang];
38979
+ const language = node2.lang ? node2.lang.split(/\s+/) : [];
38980
+ if (language.length > 0) {
38981
+ properties.className = ["language-" + language[0]];
38475
38982
  }
38476
38983
  let result = {
38477
38984
  type: "element",
@@ -41323,14 +41830,14 @@ var MedAssistWidget = (function(exports) {
41323
41830
  ref: containerRef,
41324
41831
  onClick: disabled ? void 0 : onClick,
41325
41832
  className: cn(
41326
- "inline-flex items-center gap-2 rounded-full border border-lavender-200/60 bg-white/80 px-3 py-1 shadow-sm text-xs text-slate-700 hover: cursor-pointer",
41833
+ "inline-flex items-center gap-2 rounded-lg border border-primary bg-popover px-3 py-2 shadow-sm text-xs text-primary hover:bg-primary hover:text-primary-foreground cursor-pointer transition-colors",
41327
41834
  className,
41328
41835
  disabled ? "opacity-50 cursor-not-allowed" : ""
41329
41836
  ),
41330
41837
  style: { maxWidth },
41331
41838
  title: text2,
41332
41839
  children: [
41333
- icon && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-lavender-500", children: icon }),
41840
+ icon && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-primary", children: icon }),
41334
41841
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "pill-marquee-wrapper", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
41335
41842
  "span",
41336
41843
  {
@@ -41743,7 +42250,7 @@ var MedAssistWidget = (function(exports) {
41743
42250
  className,
41744
42251
  required = true,
41745
42252
  maxSelections,
41746
- error,
42253
+ // error,
41747
42254
  disabled
41748
42255
  }) {
41749
42256
  const extraOption = additionalOption ? {
@@ -41758,7 +42265,6 @@ var MedAssistWidget = (function(exports) {
41758
42265
  const handleExtraOptionChange = (checked) => {
41759
42266
  if (!extraOption) return selectedValues;
41760
42267
  if (additionalOption === "none_of_the_above") {
41761
- console.log("extraOption.value", extraOption.value);
41762
42268
  return checked ? [extraOption.value] : [];
41763
42269
  }
41764
42270
  if (additionalOption === "all_of_the_above") {
@@ -41791,40 +42297,30 @@ var MedAssistWidget = (function(exports) {
41791
42297
  if (!isValidSelection(newSelection)) {
41792
42298
  return;
41793
42299
  }
41794
- console.log("newSelection", newSelection);
41795
42300
  onSelectionChange(newSelection);
41796
42301
  };
41797
- const isValid = !required || selectedValues.length > 0;
41798
42302
  const currentNonExtraSelections = extraOption ? selectedValues.filter((value) => value !== extraOption.value).length : selectedValues.length;
41799
42303
  if (!options.length) return null;
41800
42304
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
41801
42305
  "div",
41802
42306
  {
41803
42307
  className: cn(
41804
- // Container styling matching the image and other components
41805
- "bg-gray-50",
41806
- // Light grey background like the image
41807
- "rounded-lg",
41808
- // Rounded corners
41809
- "p-4",
41810
- // Padding inside
41811
- "border border-gray-200",
41812
- // Subtle border
41813
42308
  className
41814
42309
  ),
41815
42310
  children: [
41816
42311
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-3", children: [
41817
42312
  options.map((option) => {
41818
42313
  const isDisabled = disabled || maxSelections && currentNonExtraSelections >= maxSelections && !selectedValues.includes(option.value);
42314
+ let isSelected = selectedValues.includes(option.value);
41819
42315
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-3", children: [
41820
42316
  /* @__PURE__ */ jsxRuntimeExports.jsx(
41821
42317
  Checkbox,
41822
42318
  {
41823
42319
  id: option.id,
41824
- checked: !!selectedValues.includes(option.value),
42320
+ checked: isSelected,
41825
42321
  disabled: !!isDisabled,
41826
42322
  onCheckedChange: (checked) => handleOptionChange(option.value, Boolean(checked)),
41827
- className: "mt-0.5 border border-muted-foreground"
42323
+ className: "mt-0.5 border border-muted-foreground text-primary-foreground"
41828
42324
  }
41829
42325
  ),
41830
42326
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -41833,8 +42329,8 @@ var MedAssistWidget = (function(exports) {
41833
42329
  htmlFor: option.id,
41834
42330
  className: cn(
41835
42331
  // Using the same muted color scheme as your other components
41836
- "text-sm font-medium leading-none cursor-pointer",
41837
- isDisabled ? "text-muted-foreground cursor-not-allowed" : "text-secondary-foreground"
42332
+ "text-sm font-normal leading-4 cursor-pointer",
42333
+ isDisabled ? "text-muted-foreground cursor-not-allowed" : isSelected ? "text-primary" : "text-secondary-foreground"
41838
42334
  // Dark grey like other components
41839
42335
  ),
41840
42336
  children: option.label
@@ -41843,7 +42339,7 @@ var MedAssistWidget = (function(exports) {
41843
42339
  ] }, option.id);
41844
42340
  }),
41845
42341
  extraOption && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
41846
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "border-t border-gray-300 my-3" }),
42342
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "border-t border-border-medium my-3" }),
41847
42343
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-3", children: [
41848
42344
  /* @__PURE__ */ jsxRuntimeExports.jsx(
41849
42345
  Checkbox,
@@ -41865,8 +42361,6 @@ var MedAssistWidget = (function(exports) {
41865
42361
  ] })
41866
42362
  ] })
41867
42363
  ] }),
41868
- error && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-red-500 mt-3", children: error }),
41869
- required && !isValid && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-red-500 mt-3", children: "Please select at least one option" }),
41870
42364
  maxSelections && currentNonExtraSelections >= maxSelections && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-blue-600 mt-3", children: maxSelections === 1 ? "You can select only 1 option" : `Maximum ${maxSelections} selections allowed` })
41871
42365
  ]
41872
42366
  }
@@ -42150,11 +42644,11 @@ var MedAssistWidget = (function(exports) {
42150
42644
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
42151
42645
  Card,
42152
42646
  {
42153
- className: "max-w-md rounded-xl border-lavender-200 shadow-md p-0 bg-white overflow-hidden",
42647
+ className: "max-w-md rounded-xl border-primary/20 shadow-md p-0 bg-surface overflow-hidden",
42154
42648
  "aria-label": "Appointment card",
42155
42649
  children: [
42156
- /* @__PURE__ */ jsxRuntimeExports.jsx(CardHeader, { className: "flex flex-row items-center justify-between gap-3 bg-lavender-50 rounded-t-xl p-4 border-b border-lavender-100 overflow-hidden", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3", children: [
42157
- doctorDetails.profile_pic && /* @__PURE__ */ jsxRuntimeExports.jsxs(Avatar, { className: "h-12 w-12 ring-2 ring-lavender-200", children: [
42650
+ /* @__PURE__ */ jsxRuntimeExports.jsx(CardHeader, { className: "flex flex-row items-center justify-between gap-3 bg-secondary rounded-t-xl p-4 border-b border-border-subtle overflow-hidden", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3", children: [
42651
+ doctorDetails.profile_pic && /* @__PURE__ */ jsxRuntimeExports.jsxs(Avatar, { className: "h-12 w-12 ring-2 ring-primary/20", children: [
42158
42652
  /* @__PURE__ */ jsxRuntimeExports.jsx(
42159
42653
  AvatarImage,
42160
42654
  {
@@ -42163,7 +42657,7 @@ var MedAssistWidget = (function(exports) {
42163
42657
  crossOrigin: "anonymous"
42164
42658
  }
42165
42659
  ),
42166
- /* @__PURE__ */ jsxRuntimeExports.jsx(AvatarFallback, { className: "bg-lavender-100 text-lavender-700", children: getInitials(doctorDetails.name) })
42660
+ /* @__PURE__ */ jsxRuntimeExports.jsx(AvatarFallback, { className: "bg-secondary text-primary", children: getInitials(doctorDetails.name) })
42167
42661
  ] }),
42168
42662
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-w-0", children: [
42169
42663
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-wrap items-baseline gap-2", children: [
@@ -42174,7 +42668,7 @@ var MedAssistWidget = (function(exports) {
42174
42668
  href: doctorDetails.profile_link,
42175
42669
  target: "_blank",
42176
42670
  rel: "noreferrer",
42177
- className: "text-xs font-semibold text-lavender-600 hover:text-lavender-700 hover:underline",
42671
+ className: "text-xs font-semibold text-primary hover:text-primary/90 hover:underline",
42178
42672
  children: "View profile"
42179
42673
  }
42180
42674
  ) : null
@@ -42189,26 +42683,26 @@ var MedAssistWidget = (function(exports) {
42189
42683
  ] })
42190
42684
  ] }) }),
42191
42685
  /* @__PURE__ */ jsxRuntimeExports.jsxs(CardContent, { className: "px-4 py-2", children: [
42192
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid gap-2 border-b border-lavender-100 pb-3", children: [
42193
- doctorDetails?.timings && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-start gap-2 text-sm text-slate-900", children: [
42686
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid gap-2 border-b border-border-subtle pb-3", children: [
42687
+ doctorDetails?.timings && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-start gap-2 text-sm text-text-primary", children: [
42194
42688
  /* @__PURE__ */ jsxRuntimeExports.jsx(
42195
42689
  Clock,
42196
42690
  {
42197
- className: "h-4 w-4 text-lavender-600 mt-0.5 flex-shrink-0",
42691
+ className: "h-4 w-4 text-primary mt-0.5 flex-shrink-0",
42198
42692
  "aria-hidden": true
42199
42693
  }
42200
42694
  ),
42201
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-slate-600 text-xs", children: doctorDetails?.timings })
42695
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-text-secondary text-xs", children: doctorDetails?.timings })
42202
42696
  ] }),
42203
- doctorDetails.languages ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 text-sm text-slate-900", children: [
42204
- /* @__PURE__ */ jsxRuntimeExports.jsx(Languages, { className: "h-4 w-4 text-lavender-600", "aria-hidden": true }),
42205
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-slate-600", children: doctorDetails.languages })
42697
+ doctorDetails.languages ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 text-sm text-text-primary", children: [
42698
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Languages, { className: "h-4 w-4 text-primary", "aria-hidden": true }),
42699
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-text-secondary", children: doctorDetails.languages })
42206
42700
  ] }) : null,
42207
- doctorDetails?.hospitals && doctorDetails.hospitals?.length > 1 ? selectedHospital && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 text-sm text-slate-900", children: [
42701
+ doctorDetails?.hospitals && doctorDetails.hospitals?.length > 1 ? selectedHospital && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 text-sm text-text-primary", children: [
42208
42702
  /* @__PURE__ */ jsxRuntimeExports.jsx(
42209
42703
  Building2,
42210
42704
  {
42211
- className: "h-4 w-4 text-lavender-600",
42705
+ className: "h-4 w-4 text-primary",
42212
42706
  "aria-hidden": true
42213
42707
  }
42214
42708
  ),
@@ -42222,15 +42716,15 @@ var MedAssistWidget = (function(exports) {
42222
42716
  value: selectedHospital
42223
42717
  }
42224
42718
  )
42225
- ] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 text-sm text-slate-900", children: [
42719
+ ] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 text-sm text-text-primary", children: [
42226
42720
  /* @__PURE__ */ jsxRuntimeExports.jsx(
42227
42721
  Building2,
42228
42722
  {
42229
- className: "h-4 w-4 text-lavender-600",
42723
+ className: "h-4 w-4 text-primary",
42230
42724
  "aria-hidden": true
42231
42725
  }
42232
42726
  ),
42233
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-slate-600", children: doctorDetails.hospitals?.[0].name || "" })
42727
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-text-secondary", children: doctorDetails.hospitals?.[0].name || "" })
42234
42728
  ] })
42235
42729
  ] }),
42236
42730
  availabilityForSelectedHospital.length > 0 || loadingAvailabilityDates ? /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -42242,7 +42736,7 @@ var MedAssistWidget = (function(exports) {
42242
42736
  "aria-controls": "ap-slots",
42243
42737
  onClick: () => setOpen((o) => !o),
42244
42738
  disabled: loadingAvailabilityDates,
42245
- className: "mt-3 w-full border-lavender-500 text-lavender-600 hover:bg-lavender-50 hover:border-lavender-600 disabled:opacity-50",
42739
+ className: "mt-3 w-full border-primary text-primary hover:bg-secondary hover:border-primary/80 disabled:opacity-50",
42246
42740
  children: loadingAvailabilityDates ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
42247
42741
  /* @__PURE__ */ jsxRuntimeExports.jsx(LoaderCircle, { className: "h-4 w-4 mr-2 animate-spin" }),
42248
42742
  "Loading availability..."
@@ -42257,7 +42751,7 @@ var MedAssistWidget = (function(exports) {
42257
42751
  )
42258
42752
  ] })
42259
42753
  }
42260
- ) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-3 w-full flex items-center justify-center py-3 px-4 bg-lavender-50 border border-lavender-200 rounded-lg", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm text-slate-600 font-medium", children: "No details available" }) }),
42754
+ ) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-3 w-full flex items-center justify-center py-3 px-4 bg-secondary border border-primary/20 rounded-lg", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm text-slate-600 font-medium", children: "No details available" }) }),
42261
42755
  open && availabilityForSelectedHospital.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(
42262
42756
  "div",
42263
42757
  {
@@ -42276,7 +42770,7 @@ var MedAssistWidget = (function(exports) {
42276
42770
  onClick: prevCalendar,
42277
42771
  "aria-label": "Previous 3 days",
42278
42772
  disabled: disabled || !canGoPrevious,
42279
- className: "h-8 w-8 flex-shrink-0 rounded-md border-lavender-200 bg-white text-lavender-700 hover:bg-lavender-50 hover:border-lavender-300 disabled:opacity-50",
42773
+ className: "h-8 w-8 flex-shrink-0 rounded-md border-primary/20 bg-surface text-primary hover:bg-secondary hover:border-primary/30 disabled:opacity-50",
42280
42774
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronLeft, { className: "h-4 w-4" })
42281
42775
  }
42282
42776
  ),
@@ -42293,9 +42787,9 @@ var MedAssistWidget = (function(exports) {
42293
42787
  "aria-current": isSelected ? "date" : void 0,
42294
42788
  className: cn(
42295
42789
  "flex flex-col items-center justify-center h-12 rounded-lg border-2 p-2 gap-0.5 min-w-0 transition-all",
42296
- isSelected && "border-lavender-500 ring-2 ring-lavender-200 bg-lavender-50 shadow-sm",
42297
- isDisabled && "border-slate-200 bg-slate-50 text-slate-300 cursor-not-allowed",
42298
- !isSelected && !isDisabled && "border-slate-200 bg-white hover:bg-lavender-50 hover:border-lavender-300"
42790
+ isSelected && "border-primary ring-2 ring-primary/20 bg-secondary shadow-sm",
42791
+ isDisabled && "border-border-subtle bg-surface-secondary text-text-tertiary cursor-not-allowed",
42792
+ !isSelected && !isDisabled && "border-border-subtle bg-surface hover:bg-secondary hover:border-primary/30"
42299
42793
  ),
42300
42794
  children: [
42301
42795
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -42303,9 +42797,9 @@ var MedAssistWidget = (function(exports) {
42303
42797
  {
42304
42798
  className: cn(
42305
42799
  "text-[10px] tracking-wide w-full text-center font-medium",
42306
- isSelected && "text-lavender-700",
42307
- isDisabled && "text-slate-300",
42308
- !isSelected && !isDisabled && "text-slate-600"
42800
+ isSelected && "text-primary",
42801
+ isDisabled && "text-text-tertiary",
42802
+ !isSelected && !isDisabled && "text-text-secondary"
42309
42803
  ),
42310
42804
  children: day.weekday
42311
42805
  }
@@ -42315,9 +42809,9 @@ var MedAssistWidget = (function(exports) {
42315
42809
  {
42316
42810
  className: cn(
42317
42811
  "text-xs font-bold w-full text-center",
42318
- isSelected && "text-lavender-700",
42319
- isDisabled && "text-slate-300",
42320
- !isSelected && !isDisabled && "text-slate-900"
42812
+ isSelected && "text-primary",
42813
+ isDisabled && "text-text-tertiary",
42814
+ !isSelected && !isDisabled && "text-text-primary"
42321
42815
  ),
42322
42816
  children: day.dayNum
42323
42817
  }
@@ -42336,14 +42830,14 @@ var MedAssistWidget = (function(exports) {
42336
42830
  onClick: nextCalendar,
42337
42831
  "aria-label": "Next 3 days",
42338
42832
  disabled: disabled || !canGoNext,
42339
- className: "h-8 w-8 flex-shrink-0 rounded-md border-lavender-200 bg-white text-lavender-700 hover:bg-lavender-50 hover:border-lavender-300 disabled:opacity-50",
42833
+ className: "h-8 w-8 flex-shrink-0 rounded-md border-primary/20 bg-surface text-primary hover:bg-secondary hover:border-primary/30 disabled:opacity-50",
42340
42834
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronRight, { className: "h-4 w-4" })
42341
42835
  }
42342
42836
  )
42343
42837
  ] }),
42344
42838
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "px-0.5 py-3", children: loadingAvailabilitySlots ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-center py-4", children: [
42345
- /* @__PURE__ */ jsxRuntimeExports.jsx(LoaderCircle, { className: "h-4 w-4 animate-spin text-lavender-600 mr-2" }),
42346
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm text-slate-600", children: "Loading slots..." })
42839
+ /* @__PURE__ */ jsxRuntimeExports.jsx(LoaderCircle, { className: "h-4 w-4 animate-spin text-primary mr-2" }),
42840
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm text-text-secondary", children: "Loading slots..." })
42347
42841
  ] }) : selectedDateData?.slots?.length ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-2 gap-2 max-h-48 overflow-y-auto", children: selectedDateData.slots.map((t, index2) => {
42348
42842
  const selected = selectedSlot === t;
42349
42843
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
@@ -42356,7 +42850,7 @@ var MedAssistWidget = (function(exports) {
42356
42850
  disabled,
42357
42851
  className: cn(
42358
42852
  "inline-flex h-9 items-center justify-center gap-2 rounded-lg px-3 text-xs font-semibold transition-all",
42359
- selected ? "border-lavender-600 bg-lavender-600 text-white shadow-sm hover:bg-lavender-700 hover:border-lavender-700" : "border-lavender-200 bg-white text-slate-900 hover:bg-lavender-50 hover:border-lavender-300"
42853
+ selected ? "border-primary bg-primary text-white shadow-sm hover:bg-primary/90 hover:border-primary/90" : "border-primary/20 bg-surface text-text-primary hover:bg-secondary hover:border-primary/30"
42360
42854
  ),
42361
42855
  children: [
42362
42856
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -42364,7 +42858,7 @@ var MedAssistWidget = (function(exports) {
42364
42858
  {
42365
42859
  className: cn(
42366
42860
  "h-3.5 w-3.5 flex-shrink-0",
42367
- selected ? "text-white" : "text-lavender-600"
42861
+ selected ? "text-white" : "text-primary"
42368
42862
  )
42369
42863
  }
42370
42864
  ),
@@ -42373,7 +42867,7 @@ var MedAssistWidget = (function(exports) {
42373
42867
  },
42374
42868
  t || `slot-${index2}`
42375
42869
  );
42376
- }) }) : /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "px-1 text-sm text-slate-600", children: "No slots available for this day." }) }),
42870
+ }) }) : /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "px-1 text-sm text-text-secondary", children: "No slots available for this day." }) }),
42377
42871
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "px-0.5 pb-1.5", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
42378
42872
  Button,
42379
42873
  {
@@ -42381,14 +42875,14 @@ var MedAssistWidget = (function(exports) {
42381
42875
  onClick: handleBook,
42382
42876
  disabled: !selectedSlot || disabled,
42383
42877
  "aria-disabled": !selectedSlot,
42384
- className: "w-full h-10 gap-2 bg-lavender-600 text-white hover:bg-lavender-700 disabled:opacity-60 shadow-sm font-semibold",
42878
+ className: "w-full h-10 gap-2 bg-primary text-white hover:bg-primary/90 disabled:opacity-60 shadow-sm font-semibold",
42385
42879
  children: [
42386
42880
  "Book appointment",
42387
42881
  /* @__PURE__ */ jsxRuntimeExports.jsx(ArrowRight, { className: "h-4 w-4" })
42388
42882
  ]
42389
42883
  }
42390
42884
  ) })
42391
- ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "px-1 pb-2 pt-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-slate-600", children: error ? error : "No availability provided." }) })
42885
+ ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "px-1 pb-2 pt-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-text-secondary", children: error ? error : "No availability provided." }) })
42392
42886
  }
42393
42887
  )
42394
42888
  ] })
@@ -42485,11 +42979,11 @@ var MedAssistWidget = (function(exports) {
42485
42979
  if (loading && loadedCount === 0) {
42486
42980
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center justify-center py-8", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center", children: [
42487
42981
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-[var(--color-primary)] mx-auto mb-3" }),
42488
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-500", children: "Loading doctor details..." })
42982
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-text-tertiary", children: "Loading doctor details..." })
42489
42983
  ] }) });
42490
42984
  }
42491
42985
  if (loadedCount === 0) {
42492
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center justify-center py-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-500", children: "No doctor details available." }) });
42986
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center justify-center py-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-text-tertiary", children: "No doctor details available." }) });
42493
42987
  }
42494
42988
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [
42495
42989
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-4", children: doctorAvailabilities.map(
@@ -42534,22 +43028,154 @@ var MedAssistWidget = (function(exports) {
42534
43028
  ] })
42535
43029
  ] });
42536
43030
  }
43031
+ function formatHours(open_days, open_time) {
43032
+ const parts = [open_days, open_time].filter(Boolean);
43033
+ return parts.join(" • ") || "";
43034
+ }
43035
+ function VoucherCard({
43036
+ pharmacy,
43037
+ variant = "default",
43038
+ onGetVoucher,
43039
+ className
43040
+ }) {
43041
+ const hasLink = Boolean(pharmacy.link?.trim());
43042
+ const hoursText = formatHours(pharmacy.open_days, pharmacy.open_time);
43043
+ const subtitleParts = [hoursText, pharmacy.distance_text].filter(Boolean);
43044
+ const subtitle = subtitleParts.join(" • ");
43045
+ const isCustom = variant === "custom";
43046
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
43047
+ Card,
43048
+ {
43049
+ className: cn(
43050
+ "overflow-hidden rounded-2xl shadow-sm",
43051
+ isCustom ? "border-l-4 border-l-[var(--accent-400)] bg-[var(--base-900)] text-[var(--white-1000)] border-0" : "bg-card text-card-foreground border border-border-subtle",
43052
+ className
43053
+ ),
43054
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs(CardContent, { className: cn("p-4", isCustom && "p-5"), children: [
43055
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-start justify-between gap-2 mb-2", children: [
43056
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
43057
+ "h3",
43058
+ {
43059
+ className: cn(
43060
+ "font-semibold leading-tight",
43061
+ isCustom ? "text-base text-white" : "text-foreground text-sm"
43062
+ ),
43063
+ children: pharmacy.name || "Pharmacy"
43064
+ }
43065
+ ),
43066
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
43067
+ "div",
43068
+ {
43069
+ className: cn(
43070
+ "shrink-0 rounded-lg p-1.5",
43071
+ isCustom ? "bg-[var(--accent-400)]/20 text-[var(--accent-300)]" : "bg-accent/10 text-[var(--color-primary)]"
43072
+ ),
43073
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(Building2, { className: "h-4 w-4", "aria-hidden": true })
43074
+ }
43075
+ )
43076
+ ] }),
43077
+ subtitle ? /* @__PURE__ */ jsxRuntimeExports.jsx(
43078
+ "p",
43079
+ {
43080
+ className: cn(
43081
+ "text-xs mb-3",
43082
+ isCustom ? "text-[var(--white-600)]" : "text-muted-foreground"
43083
+ ),
43084
+ children: subtitle
43085
+ }
43086
+ ) : null,
43087
+ pharmacy.offer ? /* @__PURE__ */ jsxRuntimeExports.jsx(
43088
+ "div",
43089
+ {
43090
+ className: cn(
43091
+ "inline-flex items-center rounded-full px-3 py-1 text-xs font-medium mb-4",
43092
+ isCustom ? "bg-emerald-900/80 text-emerald-300" : "bg-emerald-100 text-emerald-800 dark:bg-emerald-900/40 dark:text-emerald-300"
43093
+ ),
43094
+ children: pharmacy.offer
43095
+ }
43096
+ ) : null,
43097
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-wrap gap-2", children: [
43098
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
43099
+ Button,
43100
+ {
43101
+ type: "button",
43102
+ size: "sm",
43103
+ className: cn(
43104
+ "rounded-lg gap-1.5 font-medium",
43105
+ isCustom ? "bg-[var(--accent-400)] text-[var(--accent-1000)] hover:bg-[var(--accent-300)]" : "bg-primary text-primary-foreground hover:bg-primary/90"
43106
+ ),
43107
+ onClick: () => onGetVoucher?.(pharmacy),
43108
+ children: [
43109
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Ticket, { className: "h-4 w-4", "aria-hidden": true }),
43110
+ "Get voucher"
43111
+ ]
43112
+ }
43113
+ ),
43114
+ hasLink && /* @__PURE__ */ jsxRuntimeExports.jsxs(
43115
+ Button,
43116
+ {
43117
+ type: "button",
43118
+ variant: "outline",
43119
+ size: "sm",
43120
+ className: cn(
43121
+ "rounded-lg gap-1.5",
43122
+ isCustom ? "border-[var(--white-300)] text-[var(--white-900)] hover:bg-[var(--white-100)]" : "border-border bg-background text-foreground hover:bg-accent"
43123
+ ),
43124
+ onClick: () => pharmacy.link && window.open(pharmacy.link, "_blank", "noopener,noreferrer"),
43125
+ children: [
43126
+ /* @__PURE__ */ jsxRuntimeExports.jsx(MapPin, { className: "h-4 w-4", "aria-hidden": true }),
43127
+ "View on maps"
43128
+ ]
43129
+ }
43130
+ )
43131
+ ] })
43132
+ ] })
43133
+ }
43134
+ );
43135
+ }
43136
+ function VoucherCardList({
43137
+ pharmacies,
43138
+ variant = "default",
43139
+ onGetVoucher,
43140
+ className
43141
+ }) {
43142
+ if (!pharmacies?.length) {
43143
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-muted-foreground py-2", children: "No pharmacies available." });
43144
+ }
43145
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: className ?? "space-y-4", children: pharmacies.map((pharmacy, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
43146
+ VoucherCard,
43147
+ {
43148
+ pharmacy,
43149
+ variant,
43150
+ onGetVoucher
43151
+ },
43152
+ pharmacy.id ?? index2
43153
+ )) });
43154
+ }
42537
43155
  function ChatMessage({
42538
43156
  role,
42539
43157
  content: content2,
42540
- timestamp,
42541
- iconUrl,
43158
+ // timestamp,
42542
43159
  files,
42543
43160
  isLastMessage,
42544
43161
  progressMessage,
42545
43162
  toolEscalationData,
42546
43163
  toolCallStatus,
42547
43164
  callTool,
42548
- onSendMessage
43165
+ onSendMessage,
43166
+ onToggleFeedback
42549
43167
  }) {
42550
43168
  const isUser = role === "user";
42551
43169
  const [selectedValues, setSelectedValues] = reactExports.useState([]);
43170
+ const [userFeedback, setUserFeedback] = reactExports.useState(distExports.USER_FEEDBACK.NONE);
42552
43171
  const { isStreaming } = useMedAssistStore();
43172
+ const [hasBackgroundImage, setHasBackgroundImage] = reactExports.useState(false);
43173
+ reactExports.useEffect(() => {
43174
+ const container = document.querySelector(".synapse-chat-widget-container");
43175
+ if (container) {
43176
+ setHasBackgroundImage(container.classList.contains("theme-with-background"));
43177
+ }
43178
+ }, []);
42553
43179
  const handlePillClick = async (choice) => {
42554
43180
  const messageId = Date.now().toString();
42555
43181
  await onSendMessage({
@@ -42564,6 +43190,10 @@ var MedAssistWidget = (function(exports) {
42564
43190
  toolCalled: true
42565
43191
  });
42566
43192
  };
43193
+ const handleToggleFeedback = (feedback) => {
43194
+ setUserFeedback(feedback);
43195
+ onToggleFeedback(feedback);
43196
+ };
42567
43197
  const handleMultiSelectChange = (values) => {
42568
43198
  setSelectedValues(values);
42569
43199
  console.log("Multi-select changed:", values);
@@ -42615,101 +43245,145 @@ var MedAssistWidget = (function(exports) {
42615
43245
  });
42616
43246
  }
42617
43247
  };
42618
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: cn("flex", isUser ? "justify-end" : "justify-start"), children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
42619
- "div",
42620
- {
42621
- className: cn(
42622
- "flex gap-3",
42623
- isUser ? "flex-row-reverse" : "flex-row",
42624
- toolEscalationData?.details?.component === distExports.SYNAPSE_COMPONENTS.MULTI ? "max-w-md" : isUser ? "max-w-[60%]" : "max-w-xs"
42625
- ),
42626
- children: [
42627
- !isUser && /* @__PURE__ */ jsxRuntimeExports.jsx(Avatar, { className: "w-8 h-8 bg-gradient-to-br from-lavender-400 to-lavender-500 text-white text-xs font-bold flex-shrink-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(AvatarFallback, { className: "bg-transparent text-white text-xs font-bold", children: iconUrl ? /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: iconUrl, alt: "Bot Icon", className: "w-full h-full" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Bot, { className: "w-full h-full" }) }) }),
42628
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
42629
- Card,
43248
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
43249
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: cn("flex", isUser ? "justify-end" : "justify-start"), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
43250
+ "div",
43251
+ {
43252
+ className: cn(
43253
+ "flex gap-3",
43254
+ isUser ? "flex-row-reverse" : "flex-row",
43255
+ toolEscalationData?.details?.component === distExports.SYNAPSE_COMPONENTS.MULTI ? "max-w-md" : isUser ? "max-w-[60%]" : "max-w-xs"
43256
+ ),
43257
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col", children: [
43258
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
43259
+ Card,
43260
+ {
43261
+ className: cn(
43262
+ "px-4 py-2 rounded-lg shadow-none break-words overflow-wrap-anywhere whitespace-pre-wrap",
43263
+ isUser ? "bg-primary text-primary-foreground shadow-sm" : cn(
43264
+ "text-foreground shadow-sm bg-botMessage blur-xs"
43265
+ ),
43266
+ toolEscalationData && "w-full"
43267
+ ),
43268
+ children: [
43269
+ toolCallStatus && !isUser && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs text-muted-foreground mb-2 pb-2 border-b border-border-subtle", children: toolCallStatus }),
43270
+ !toolCallStatus && progressMessage && !isUser && isLastMessage && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm font-medium text-muted-foreground pb-2", children: progressMessage }),
43271
+ content2 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-sm markdown-content mb-3", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Markdown, { children: `${content2} ${!isUser && isStreaming && isLastMessage ? "..." : ""}` }) }),
43272
+ files && files.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(FilePreviewList, { files, isPreview: false, className: "" }) }),
43273
+ progressMessage && !isUser && isLastMessage && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm font-medium text-muted-foreground", children: progressMessage })
43274
+ ]
43275
+ }
43276
+ ),
43277
+ !isUser && !isStreaming && isLastMessage && userFeedback === distExports.USER_FEEDBACK.NONE && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-1 self-start mt-1", children: [
43278
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
43279
+ Button,
43280
+ {
43281
+ variant: "ghost",
43282
+ size: "sm",
43283
+ className: "h-6 w-6 p-0 hover:bg-muted text-muted-foreground",
43284
+ onClick: () => handleToggleFeedback(distExports.USER_FEEDBACK.LIKE),
43285
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(ThumbsUp, { className: "h-3 w-3" })
43286
+ }
43287
+ ),
43288
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
43289
+ Button,
43290
+ {
43291
+ variant: "ghost",
43292
+ size: "sm",
43293
+ className: "h-6 w-6 p-0 hover:bg-muted text-muted-foreground",
43294
+ onClick: () => handleToggleFeedback(distExports.USER_FEEDBACK.DISLIKE),
43295
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(ThumbsDown, { className: "h-3 w-3" })
43296
+ }
43297
+ )
43298
+ ] }),
43299
+ !isUser && !isStreaming && isLastMessage && userFeedback === distExports.USER_FEEDBACK.LIKE && /* @__PURE__ */ jsxRuntimeExports.jsx(
43300
+ Button,
43301
+ {
43302
+ variant: "ghost",
43303
+ size: "sm",
43304
+ className: "h-6 w-6 p-0 self-start mt-1 hover:bg-muted text-primary",
43305
+ disabled: true,
43306
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(ThumbsUp, { className: "h-3 w-3" })
43307
+ }
43308
+ ),
43309
+ !isUser && !isStreaming && isLastMessage && userFeedback === distExports.USER_FEEDBACK.DISLIKE && /* @__PURE__ */ jsxRuntimeExports.jsx(
43310
+ Button,
43311
+ {
43312
+ variant: "ghost",
43313
+ size: "sm",
43314
+ className: "h-6 w-6 p-0 self-start mt-1 hover:bg-muted text-primary",
43315
+ disabled: true,
43316
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(ThumbsDown, { className: "h-3 w-3" })
43317
+ }
43318
+ )
43319
+ ] })
43320
+ }
43321
+ ) }),
43322
+ !toolEscalationData?.isResponded && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-end", children: [
43323
+ toolEscalationData?.details?.component === distExports.SYNAPSE_COMPONENTS.PILL && toolEscalationData?.details?.input?.options && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-wrap gap-2 mt-3", children: toolEscalationData.details?.input?.options.map(
43324
+ (choice, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
43325
+ Pills,
43326
+ {
43327
+ disabled: toolEscalationData?.isResponded,
43328
+ text: choice?.label || "",
43329
+ onClick: () => handlePillClick(choice?.value || ""),
43330
+ className: "cursor-pointer"
43331
+ },
43332
+ index2
43333
+ )
43334
+ ) }),
43335
+ toolEscalationData?.details?.component === distExports.SYNAPSE_COMPONENTS.MULTI && toolEscalationData?.details?.input?.options && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-3 space-y-3 break-words overflow-wrap-anywhere whitespace-pre-wrap bg-popover border border-primary/40 rounded-xl p-4", children: [
43336
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-xs font-medium text-muted-foreground mb-2", children: "Select multiple options:" }),
43337
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
43338
+ MultiSelectGroup,
43339
+ {
43340
+ options: getMultiSelectOptions(),
43341
+ selectedValues,
43342
+ onSelectionChange: handleMultiSelectChange,
43343
+ additionalOption: getAdditionalOption(),
43344
+ disabled: toolEscalationData?.isResponded
43345
+ }
43346
+ ),
43347
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
43348
+ Button,
42630
43349
  {
43350
+ onClick: handleConfirm,
43351
+ disabled: selectedValues.length === 0 || toolEscalationData?.isResponded,
42631
43352
  className: cn(
42632
- "px-4 py-2 rounded-2xl shadow-none break-words overflow-wrap-anywhere whitespace-pre-wrap",
42633
- isUser ? "bg-lavender-100/95 backdrop-blur-md text-slate-900 rounded-br-none border border-lavender-200/60" : "bg-white/80 backdrop-blur-md text-slate-800 shadow-sm rounded-bl-none border border-lavender-200/40",
42634
- toolEscalationData && "w-full"
43353
+ "w-full rounded-lg px-4 py-2 text-sm font-medium transition-all",
43354
+ "bg-primary hover:bg-primary/90 text-primary-foreground",
43355
+ "disabled:opacity-50 disabled:cursor-not-allowed disabled:bg-surface-secondary disabled:text-text-tertiary",
43356
+ "shadow-sm hover:shadow-md active:scale-[0.98] "
42635
43357
  ),
42636
- children: [
42637
- toolCallStatus && !isUser && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs text-slate-500 mb-2 pb-2 border-b border-slate-200", children: toolCallStatus }),
42638
- !toolCallStatus && progressMessage && !isUser && isLastMessage && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm font-medium text-slate-500 pb-2", children: progressMessage }),
42639
- content2 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-sm markdown-content mb-3", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Markdown, { children: `${content2} ${!isUser && isStreaming && isLastMessage ? "..." : ""}` }) }),
42640
- files && files.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(FilePreviewList, { files, isPreview: false, className: "" }) }),
42641
- toolEscalationData?.details?.component === distExports.SYNAPSE_COMPONENTS.PILL && toolEscalationData?.details?.input?.options && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-wrap gap-2 mt-3", children: toolEscalationData.details?.input?.options.map(
42642
- (choice, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
42643
- Pills,
42644
- {
42645
- disabled: toolEscalationData?.isResponded,
42646
- text: choice?.label || "",
42647
- onClick: () => handlePillClick(choice?.value || ""),
42648
- className: "cursor-pointer hover:bg-lavender-100/80 transition-colors"
42649
- },
42650
- index2
42651
- )
42652
- ) }),
42653
- toolEscalationData?.details?.component === distExports.SYNAPSE_COMPONENTS.MULTI && toolEscalationData?.details?.input?.options && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-3 space-y-3 break-words overflow-wrap-anywhere whitespace-pre-wrap", children: [
42654
- /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-sm font-medium text-gray-700 mb-2", children: "Select multiple options:" }),
42655
- /* @__PURE__ */ jsxRuntimeExports.jsx(
42656
- MultiSelectGroup,
42657
- {
42658
- options: getMultiSelectOptions(),
42659
- selectedValues,
42660
- onSelectionChange: handleMultiSelectChange,
42661
- additionalOption: getAdditionalOption(),
42662
- disabled: toolEscalationData?.isResponded
42663
- }
42664
- ),
42665
- /* @__PURE__ */ jsxRuntimeExports.jsx(
42666
- Button,
42667
- {
42668
- onClick: handleConfirm,
42669
- disabled: selectedValues.length === 0 || toolEscalationData?.isResponded,
42670
- className: cn(
42671
- "w-full rounded-lg px-4 py-2 text-sm font-medium transition-all",
42672
- "bg-blue-100 hover:bg-blue-200 text-blue-600 border border-blue-200",
42673
- "disabled:opacity-50 disabled:cursor-not-allowed disabled:bg-gray-100 disabled:text-gray-400 disabled:border-gray-200",
42674
- "shadow-sm hover:shadow-md active:scale-[0.98] "
42675
- ),
42676
- children: "Confirm"
42677
- }
42678
- )
42679
- ] }),
42680
- toolEscalationData?.details?.component === distExports.SYNAPSE_COMPONENTS.DOCTOR_CARD && toolEscalationData?.details?.input?.doctors && callTool ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-3", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
42681
- DoctorCardList,
42682
- {
42683
- doctorAvailabilities: toolEscalationData?.details?.input?.doctors,
42684
- doctorDetails: toolEscalationData?.details?.input?.doctor_details,
42685
- callTool,
42686
- callbacks: toolEscalationData?.details?._meta?.callbacks,
42687
- onBook: handleBook,
42688
- disabled: toolEscalationData?.isResponded
42689
- }
42690
- ) }) : null,
42691
- progressMessage && !isUser && isLastMessage && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm font-medium text-teal-600", children: progressMessage }),
42692
- timestamp && /* @__PURE__ */ jsxRuntimeExports.jsx(
42693
- "p",
42694
- {
42695
- className: cn(
42696
- "text-xs mt-2 text-right",
42697
- isUser ? "text-slate-500" : "text-slate-500"
42698
- ),
42699
- children: timestamp
42700
- }
42701
- )
42702
- ]
43358
+ children: "Confirm"
42703
43359
  }
42704
43360
  )
42705
- ]
42706
- }
42707
- ) });
43361
+ ] }),
43362
+ toolEscalationData?.details?.component === distExports.SYNAPSE_COMPONENTS.DOCTOR_CARD && toolEscalationData?.details?.input?.doctors && callTool ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-3", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
43363
+ DoctorCardList,
43364
+ {
43365
+ doctorAvailabilities: toolEscalationData?.details?.input?.doctors,
43366
+ doctorDetails: toolEscalationData?.details?.input?.doctor_details,
43367
+ callTool,
43368
+ callbacks: toolEscalationData?.details?._meta?.callbacks,
43369
+ onBook: handleBook,
43370
+ disabled: toolEscalationData?.isResponded
43371
+ }
43372
+ ) }) : null,
43373
+ toolEscalationData?.details?.component === distExports.SYNAPSE_COMPONENTS.PHARMACY && toolEscalationData?.details?.input?.pharmacies && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-3", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
43374
+ VoucherCardList,
43375
+ {
43376
+ pharmacies: toolEscalationData.details.input.pharmacies,
43377
+ variant: hasBackgroundImage ? "custom" : "default"
43378
+ }
43379
+ ) })
43380
+ ] })
43381
+ ] });
42708
43382
  }
42709
43383
  function ChatMessages({
42710
43384
  messages,
42711
43385
  onSendMessage,
42712
- iconUrl,
43386
+ onToggleFeedback,
42713
43387
  callTool
42714
43388
  }) {
42715
43389
  const isWaitingForResponse = useMedAssistStore(
@@ -42720,7 +43394,7 @@ var MedAssistWidget = (function(exports) {
42720
43394
  (messages && messages.length > 0 || progressMessage) && /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: messages.map((message, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
42721
43395
  "div",
42722
43396
  {
42723
- className: "animate-slideUp scroll-mt-[80px]",
43397
+ className: "animate-slideUp scroll-mt-[80px] min-w-0 overflow-hidden",
42724
43398
  id: index2 === messages.length - 1 ? "last-message" : void 0,
42725
43399
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
42726
43400
  ChatMessage,
@@ -42728,101 +43402,43 @@ var MedAssistWidget = (function(exports) {
42728
43402
  role: message.role,
42729
43403
  content: message.content,
42730
43404
  files: message.files || [],
42731
- iconUrl,
42732
43405
  toolEscalationData: message.toolEscalationData,
42733
43406
  timestamp: message.timestamp,
42734
43407
  onSendMessage,
42735
43408
  isLastMessage: index2 === messages.length - 1,
42736
43409
  progressMessage,
42737
43410
  toolCallStatus: message.toolCallStatus,
42738
- callTool
43411
+ callTool,
43412
+ onToggleFeedback: (feedback) => onToggleFeedback(feedback, message.id)
42739
43413
  }
42740
43414
  )
42741
43415
  },
42742
43416
  message.id
42743
43417
  )) }),
42744
- isWaitingForResponse && /* @__PURE__ */ jsxRuntimeExports.jsx(TypingIndicator, { iconUrl })
43418
+ isWaitingForResponse && /* @__PURE__ */ jsxRuntimeExports.jsx(TypingIndicator, {})
42745
43419
  ] });
42746
43420
  }
42747
- function TypingIndicator({ iconUrl }) {
42748
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "animate-slideUp", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex justify-start", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-3", children: [
42749
- /* @__PURE__ */ jsxRuntimeExports.jsx(Avatar, { className: "w-8 h-8 bg-gradient-to-br from-lavender-400 to-lavender-500 text-white text-xs font-bold flex-shrink-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(AvatarFallback, { className: "bg-transparent text-white text-xs font-bold", children: iconUrl ? /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: iconUrl, alt: "Bot Icon", className: "w-4 h-4", loading: "lazy" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Bot, { className: "w-4 h-4" }) }) }),
42750
- /* @__PURE__ */ jsxRuntimeExports.jsx(Card, { className: "px-4 py-2 rounded-2xl shadow-none bg-white/80 backdrop-blur-md text-slate-800 shadow-sm rounded-bl-none border border-lavender-200/40", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
42751
- "div",
42752
- {
42753
- className: "flex items-center gap-1.5",
42754
- "aria-label": "Bot is typing",
42755
- children: [0, 1, 2].map((index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
42756
- "span",
42757
- {
42758
- className: "w-2 h-2 rounded-full bg-slate-400 animate-pulse",
42759
- style: { animationDelay: `${index2 * 150}ms` }
42760
- },
42761
- index2
42762
- ))
42763
- }
42764
- ) })
42765
- ] }) }) });
43421
+ function TypingIndicator() {
43422
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "animate-slideUp", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex justify-start", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex gap-3", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Card, { className: "px-4 py-2 rounded-lg shadow-none bg-botMessage backdrop-blur-sm text-text-primary shadow-sm", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
43423
+ "div",
43424
+ {
43425
+ className: "flex items-center gap-1.5",
43426
+ "aria-label": "Bot is typing",
43427
+ children: [0, 1, 2].map((index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
43428
+ "span",
43429
+ {
43430
+ className: "w-2 h-2 rounded-full bg-foreground animate-pulse",
43431
+ style: { animationDelay: `${index2 * 150}ms` }
43432
+ },
43433
+ index2
43434
+ ))
43435
+ }
43436
+ ) }) }) }) });
42766
43437
  }
42767
43438
  const ChatMessages$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
42768
43439
  __proto__: null,
42769
43440
  default: ChatMessages
42770
43441
  }, Symbol.toStringTag, { value: "Module" }));
42771
- function TaskCards({
42772
- onTaskClick,
42773
- disabled,
42774
- tasks
42775
- }) {
42776
- if (!tasks?.length) {
42777
- return null;
42778
- }
42779
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-2 gap-3", children: tasks.map((task) => {
42780
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
42781
- Button,
42782
- {
42783
- type: "button",
42784
- variant: "ghost",
42785
- disabled,
42786
- onClick: () => onTaskClick(task.value || ""),
42787
- className: "h-auto w-full flex flex-col items-start bg-white shadow-lg ring-1 ring-lavender-100 backdrop-blur-sm rounded-2xl p-4 hover:bg-white/95 hover:border-lavender-300 hover:shadow-lg transition-all text-left group",
42788
- children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-start justify-between gap-3", children: /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-semibold text-sm text-slate-900 text-wrap group-hover:text-lavender-600 transition-colors", children: task.label || "" }) })
42789
- },
42790
- task.value
42791
- );
42792
- }) });
42793
- }
42794
- function EmptyChatState({
42795
- initialPrompt,
42796
- tasks,
42797
- onTaskClick,
42798
- disabled,
42799
- profile
42800
- }) {
42801
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
42802
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center space-y-3 animate-fadeIn", children: [
42803
- profile?.name && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-center gap-2", children: [
42804
- /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-base font-medium bg-gradient-to-r from-lavender-500 via-lavender-400 to-lavender-500 bg-clip-text text-transparent tracking-wide", children: [
42805
- "Hello, ",
42806
- profile.name.split(" ")[0]
42807
- ] }),
42808
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-lavender-400 text-lg", children: "👋" })
42809
- ] }),
42810
- /* @__PURE__ */ jsxRuntimeExports.jsx("h1", { className: "text-xl-minus font-semibold text-slate-900", children: initialPrompt ? initialPrompt : "How can I assist you today?" })
42811
- ] }),
42812
- /* @__PURE__ */ jsxRuntimeExports.jsx(
42813
- TaskCards,
42814
- {
42815
- onTaskClick,
42816
- disabled,
42817
- tasks
42818
- }
42819
- )
42820
- ] });
42821
- }
42822
- const EmptyChatState$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
42823
- __proto__: null,
42824
- default: EmptyChatState
42825
- }, Symbol.toStringTag, { value: "Module" }));
42826
43442
  function ConnectionStatus({
42827
43443
  className = "",
42828
43444
  onRetry,
@@ -42855,8 +43471,8 @@ var MedAssistWidget = (function(exports) {
42855
43471
  children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3", children: [
42856
43472
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-4 h-4 bg-[#F7B500] rounded-full flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-white text-sm font-bold", children: "!" }) }),
42857
43473
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1", children: [
42858
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-slate-700 font-semibold text-sm", children: error?.title ?? "Something went wrong" }),
42859
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-[#666666] text-xs mt-1", children: "Start a new session." })
43474
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-text-primary font-semibold text-sm", children: error?.title ?? "Something went wrong" }),
43475
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-text-secondary text-xs mt-1", children: "Start a new session." })
42860
43476
  ] }),
42861
43477
  /* @__PURE__ */ jsxRuntimeExports.jsxs(
42862
43478
  "button",
@@ -42865,7 +43481,7 @@ var MedAssistWidget = (function(exports) {
42865
43481
  clearError();
42866
43482
  onStartNewSession?.();
42867
43483
  },
42868
- className: "p-2 bg-[#3B71F7] text-white text-xs font-semibold rounded-lg hover:bg-[#2E5CD9] transition-colors flex items-center gap-2 flex-shrink-0",
43484
+ className: "p-2 bg-primary text-primary-foreground text-xs font-semibold rounded-lg hover:bg-primary/90 transition-colors flex items-center gap-2 flex-shrink-0",
42869
43485
  children: [
42870
43486
  /* @__PURE__ */ jsxRuntimeExports.jsx(
42871
43487
  "svg",
@@ -42899,14 +43515,14 @@ var MedAssistWidget = (function(exports) {
42899
43515
  "div",
42900
43516
  {
42901
43517
  className: cn(
42902
- "mx-4 mb-3 p-2 bg-[#FFFBEB] border border-[#FEE39B] rounded-lg",
43518
+ "mx-4 mb-3 p-2 bg-surface border border-[#F7B500] rounded-lg",
42903
43519
  className
42904
43520
  ),
42905
43521
  children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3", children: [
42906
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-5 h-5 bg-[#F7B500] rounded-full flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-white text-sm font-bold", children: "!" }) }),
43522
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-5 h-5 bg-[#F7B500] rounded-full flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-primary-foreground text-sm font-bold", children: "!" }) }),
42907
43523
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1", children: [
42908
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-slate-700 font-semibold text-sm", children: error?.title }),
42909
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-slate-500 text-xs mt-1", children: error?.description ?? "Please check your connection and try again" })
43524
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-text-primary font-semibold text-sm", children: error?.title }),
43525
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-text-secondary text-xs mt-1", children: error?.description ?? "Please check your connection and try again" })
42910
43526
  ] }),
42911
43527
  /* @__PURE__ */ jsxRuntimeExports.jsxs(
42912
43528
  "button",
@@ -42915,7 +43531,7 @@ var MedAssistWidget = (function(exports) {
42915
43531
  clearError();
42916
43532
  onRetry?.();
42917
43533
  },
42918
- className: "px-4 py-2 bg-lavender-600 text-white text-sm font-semibold rounded-lg hover:bg-lavender-700 transition-colors flex items-center gap-2 flex-shrink-0",
43534
+ className: "px-4 py-2 bg-primary text-white text-sm font-semibold rounded-lg hover:bg-primary/90 transition-colors flex items-center gap-2 flex-shrink-0",
42919
43535
  children: [
42920
43536
  /* @__PURE__ */ jsxRuntimeExports.jsx(
42921
43537
  "svg",
@@ -42954,16 +43570,16 @@ var MedAssistWidget = (function(exports) {
42954
43570
  "div",
42955
43571
  {
42956
43572
  className: cn(
42957
- "mx-4 mb-3 p-2 bg-[#FFFBEB] border border-[#FDD835] rounded-lg transition-opacity duration-500",
43573
+ "mx-4 mb-3 p-2 bg-surface border border-border-subtle rounded-lg transition-opacity duration-500",
42958
43574
  className
42959
43575
  ),
42960
43576
  children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3", children: [
42961
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-5 h-5 bg-[#FDD835] rounded-full flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-white text-sm font-bold", children: "!" }) }),
43577
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-5 h-5 bg-primary rounded-full flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-primary-foreground text-sm font-bold", children: "!" }) }),
42962
43578
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1", children: [
42963
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-slate-700 font-semibold text-sm", children: !isOnline ? "No internet connection" : error?.title || "Connecting..." }),
42964
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-slate-500 text-xs mt-1", children: !isOnline ? "Please check your internet connection" : error?.description ?? "Please wait while we try to connect" })
43579
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-text-primary font-semibold text-sm", children: !isOnline ? "No internet connection" : error?.title || "Connecting..." }),
43580
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-text-secondary text-xs mt-1", children: !isOnline ? "Please check your internet connection" : error?.description ?? "Please wait while we try to connect" })
42965
43581
  ] }),
42966
- !isConnected && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-shrink-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-6 h-6 border-2 border-[#FDD835] border-t-transparent rounded-full animate-spin" }) })
43582
+ !isConnected && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-shrink-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-6 h-6 border-2 border-primary border-t-transparent rounded-full animate-spin" }) })
42967
43583
  ] })
42968
43584
  }
42969
43585
  );