@kite-copilot/chat-panel 0.2.34 → 0.2.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -71,6 +71,7 @@ var import_client = require("react-dom/client");
71
71
 
72
72
  // src/ChatPanel.tsx
73
73
  var React4 = __toESM(require("react"), 1);
74
+ var import_supabase_js = require("@supabase/supabase-js");
74
75
 
75
76
  // src/lib/utils.ts
76
77
  var import_clsx = require("clsx");
@@ -938,8 +939,36 @@ function DataRenderer({ type, data }) {
938
939
  }
939
940
  }
940
941
 
941
- // src/ChatPanel.tsx
942
+ // src/components/TypingIndicator.tsx
942
943
  var import_jsx_runtime9 = require("react/jsx-runtime");
944
+ function TypingIndicator({ className = "" }) {
945
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: `flex items-center gap-1 px-4 py-3 ${className}`, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center gap-1", children: [
946
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
947
+ "span",
948
+ {
949
+ className: "w-2 h-2 bg-gray-400 rounded-full animate-bounce",
950
+ style: { animationDelay: "0ms", animationDuration: "600ms" }
951
+ }
952
+ ),
953
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
954
+ "span",
955
+ {
956
+ className: "w-2 h-2 bg-gray-400 rounded-full animate-bounce",
957
+ style: { animationDelay: "150ms", animationDuration: "600ms" }
958
+ }
959
+ ),
960
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
961
+ "span",
962
+ {
963
+ className: "w-2 h-2 bg-gray-400 rounded-full animate-bounce",
964
+ style: { animationDelay: "300ms", animationDuration: "600ms" }
965
+ }
966
+ )
967
+ ] }) });
968
+ }
969
+
970
+ // src/ChatPanel.tsx
971
+ var import_jsx_runtime10 = require("react/jsx-runtime");
943
972
  var DEFAULT_AGENT_URL = "http://localhost:5002";
944
973
  var PANEL_WIDTH = 340;
945
974
  function unescapeJsonString(str) {
@@ -961,7 +990,7 @@ function renderMarkdown(text) {
961
990
  const codeMatch = remaining.match(/^`([^`]+)`/);
962
991
  if (codeMatch) {
963
992
  parts.push(
964
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
993
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
965
994
  "code",
966
995
  {
967
996
  className: "bg-gray-100 px-1 py-0.5 rounded text-xs font-mono",
@@ -975,20 +1004,20 @@ function renderMarkdown(text) {
975
1004
  }
976
1005
  const boldMatch = remaining.match(/^\*\*([^*]+)\*\*/);
977
1006
  if (boldMatch) {
978
- parts.push(/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("strong", { children: boldMatch[1] }, keyIndex++));
1007
+ parts.push(/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: boldMatch[1] }, keyIndex++));
979
1008
  remaining = remaining.slice(boldMatch[0].length);
980
1009
  continue;
981
1010
  }
982
1011
  const italicMatch = remaining.match(/^\*([^*]+)\*/);
983
1012
  if (italicMatch) {
984
- parts.push(/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("em", { children: italicMatch[1] }, keyIndex++));
1013
+ parts.push(/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("em", { children: italicMatch[1] }, keyIndex++));
985
1014
  remaining = remaining.slice(italicMatch[0].length);
986
1015
  continue;
987
1016
  }
988
1017
  const linkMatch = remaining.match(/^\[([^\]]+)\]\(([^)]+)\)/);
989
1018
  if (linkMatch) {
990
1019
  parts.push(
991
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1020
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
992
1021
  "a",
993
1022
  {
994
1023
  href: linkMatch[2],
@@ -1008,7 +1037,7 @@ function renderMarkdown(text) {
1008
1037
  const url = urlMatch[1];
1009
1038
  const href = url.startsWith("www.") ? `https://${url}` : url;
1010
1039
  parts.push(
1011
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1040
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1012
1041
  "a",
1013
1042
  {
1014
1043
  href,
@@ -1027,7 +1056,7 @@ function renderMarkdown(text) {
1027
1056
  if (emailMatch) {
1028
1057
  const email = emailMatch[1];
1029
1058
  parts.push(
1030
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1059
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1031
1060
  "a",
1032
1061
  {
1033
1062
  href: `mailto:${email}`,
@@ -1052,17 +1081,17 @@ function renderMarkdown(text) {
1052
1081
  remaining = remaining.slice(nextSpecial);
1053
1082
  }
1054
1083
  }
1055
- return parts.length === 1 ? parts[0] : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_jsx_runtime9.Fragment, { children: parts });
1084
+ return parts.length === 1 ? parts[0] : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children: parts });
1056
1085
  };
1057
1086
  const flushList = () => {
1058
1087
  if (currentList) {
1059
1088
  const ListTag = currentList.type === "ul" ? "ul" : "ol";
1060
1089
  elements.push(
1061
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1090
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1062
1091
  ListTag,
1063
1092
  {
1064
1093
  className: `${currentList.type === "ul" ? "list-disc" : "list-decimal"} ml-4 my-1`,
1065
- children: currentList.items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("li", { className: "ml-2", children: item }, i))
1094
+ children: currentList.items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("li", { className: "ml-2", children: item }, i))
1066
1095
  },
1067
1096
  elements.length
1068
1097
  )
@@ -1075,11 +1104,11 @@ function renderMarkdown(text) {
1075
1104
  if (line.startsWith("```")) {
1076
1105
  if (inCodeBlock) {
1077
1106
  elements.push(
1078
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1107
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1079
1108
  "pre",
1080
1109
  {
1081
1110
  className: "bg-gray-100 rounded p-2 my-1 overflow-x-auto",
1082
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("code", { className: "text-xs font-mono", children: codeContent.join("\n") })
1111
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("code", { className: "text-xs font-mono", children: codeContent.join("\n") })
1083
1112
  },
1084
1113
  elements.length
1085
1114
  )
@@ -1105,7 +1134,7 @@ function renderMarkdown(text) {
1105
1134
  const content = processInlineFormatting(headerMatch[2]);
1106
1135
  const className = level === 1 ? "text-lg font-bold my-1" : level === 2 ? "text-base font-bold my-1" : "text-sm font-semibold my-1";
1107
1136
  elements.push(
1108
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className, children: content }, elements.length)
1137
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className, children: content }, elements.length)
1109
1138
  );
1110
1139
  continue;
1111
1140
  }
@@ -1129,23 +1158,23 @@ function renderMarkdown(text) {
1129
1158
  }
1130
1159
  if (line.trim() === "") {
1131
1160
  flushList();
1132
- elements.push(/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "h-2" }, elements.length));
1161
+ elements.push(/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "h-2" }, elements.length));
1133
1162
  continue;
1134
1163
  }
1135
1164
  if (line.match(/^[-*_]{3,}$/)) {
1136
1165
  flushList();
1137
1166
  elements.push(
1138
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("hr", { className: "my-2 border-gray-200" }, elements.length)
1167
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("hr", { className: "my-2 border-gray-200" }, elements.length)
1139
1168
  );
1140
1169
  continue;
1141
1170
  }
1142
1171
  flushList();
1143
1172
  elements.push(
1144
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { children: processInlineFormatting(line) }, elements.length)
1173
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { children: processInlineFormatting(line) }, elements.length)
1145
1174
  );
1146
1175
  }
1147
1176
  flushList();
1148
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_jsx_runtime9.Fragment, { children: elements });
1177
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children: elements });
1149
1178
  }
1150
1179
  var defaultStartingQuestions = [
1151
1180
  {
@@ -1372,13 +1401,19 @@ function ChatPanel({
1372
1401
  orgId,
1373
1402
  userName,
1374
1403
  userEmail,
1375
- userOrganization
1404
+ userOrganization,
1405
+ supabaseUrl,
1406
+ supabaseAnonKey
1376
1407
  } = {}) {
1377
1408
  const [messages, setMessages] = React4.useState(initialMessages);
1378
1409
  const [input, setInput] = React4.useState("");
1379
1410
  const [sessionId, setSessionId] = React4.useState(() => crypto.randomUUID());
1380
1411
  const [isEscalated, setIsEscalated] = React4.useState(false);
1381
1412
  const escalationWsRef = React4.useRef(null);
1413
+ const [agentIsTyping, setAgentIsTyping] = React4.useState(false);
1414
+ const supabaseRef = React4.useRef(null);
1415
+ const typingChannelRef = React4.useRef(null);
1416
+ const typingTimeoutRef = React4.useRef(null);
1382
1417
  const resetSession = React4.useCallback(() => {
1383
1418
  setSessionId(crypto.randomUUID());
1384
1419
  setIsEscalated(false);
@@ -1386,7 +1421,106 @@ function ChatPanel({
1386
1421
  escalationWsRef.current.close();
1387
1422
  escalationWsRef.current = null;
1388
1423
  }
1424
+ setAgentIsTyping(false);
1425
+ if (typingChannelRef.current) {
1426
+ typingChannelRef.current.unsubscribe();
1427
+ typingChannelRef.current = null;
1428
+ }
1389
1429
  }, []);
1430
+ React4.useEffect(() => {
1431
+ if (supabaseUrl && supabaseAnonKey && !supabaseRef.current) {
1432
+ supabaseRef.current = (0, import_supabase_js.createClient)(supabaseUrl, supabaseAnonKey);
1433
+ }
1434
+ }, [supabaseUrl, supabaseAnonKey]);
1435
+ React4.useEffect(() => {
1436
+ if (!isEscalated || !sessionId || !supabaseRef.current) {
1437
+ return;
1438
+ }
1439
+ const channelName = `typing:${sessionId}`;
1440
+ const channel = supabaseRef.current.channel(channelName);
1441
+ channel.on("broadcast", { event: "typing" }, (payload) => {
1442
+ const { sender, isTyping } = payload.payload;
1443
+ if (sender === "agent") {
1444
+ setAgentIsTyping(isTyping);
1445
+ if (isTyping) {
1446
+ if (typingTimeoutRef.current) {
1447
+ window.clearTimeout(typingTimeoutRef.current);
1448
+ }
1449
+ typingTimeoutRef.current = window.setTimeout(() => {
1450
+ setAgentIsTyping(false);
1451
+ }, 5e3);
1452
+ }
1453
+ }
1454
+ }).subscribe();
1455
+ typingChannelRef.current = channel;
1456
+ return () => {
1457
+ channel.unsubscribe();
1458
+ typingChannelRef.current = null;
1459
+ if (typingTimeoutRef.current) {
1460
+ window.clearTimeout(typingTimeoutRef.current);
1461
+ }
1462
+ };
1463
+ }, [isEscalated, sessionId]);
1464
+ const heartbeatIntervalRef = React4.useRef(null);
1465
+ const updateCustomerStatus = React4.useCallback(async (status) => {
1466
+ if (!supabaseRef.current || !sessionId) return;
1467
+ try {
1468
+ await supabaseRef.current.from("escalations").update({
1469
+ customer_status: status,
1470
+ customer_last_seen: (/* @__PURE__ */ new Date()).toISOString()
1471
+ }).eq("session_id", sessionId);
1472
+ } catch (err) {
1473
+ console.error("[KiteChat] Failed to update customer status:", err);
1474
+ }
1475
+ }, [sessionId]);
1476
+ React4.useEffect(() => {
1477
+ if (!isEscalated || !sessionId || !supabaseRef.current) {
1478
+ return;
1479
+ }
1480
+ const currentSessionId = sessionId;
1481
+ const supabase = supabaseRef.current;
1482
+ updateCustomerStatus("active");
1483
+ heartbeatIntervalRef.current = window.setInterval(() => {
1484
+ updateCustomerStatus("active");
1485
+ }, 6e4);
1486
+ return () => {
1487
+ supabase.from("escalations").update({
1488
+ customer_status: "disconnected",
1489
+ customer_last_seen: (/* @__PURE__ */ new Date()).toISOString()
1490
+ }).eq("session_id", currentSessionId).then(
1491
+ () => {
1492
+ console.log("[KiteChat] Marked customer as disconnected");
1493
+ },
1494
+ (err) => {
1495
+ console.error("[KiteChat] Failed to mark disconnected:", err);
1496
+ }
1497
+ );
1498
+ if (heartbeatIntervalRef.current) {
1499
+ window.clearInterval(heartbeatIntervalRef.current);
1500
+ heartbeatIntervalRef.current = null;
1501
+ }
1502
+ };
1503
+ }, [isEscalated, sessionId, updateCustomerStatus]);
1504
+ const sendTypingIndicator = React4.useCallback((isTyping) => {
1505
+ if (!typingChannelRef.current || !isEscalated) return;
1506
+ typingChannelRef.current.send({
1507
+ type: "broadcast",
1508
+ event: "typing",
1509
+ payload: { sender: "user", isTyping }
1510
+ });
1511
+ }, [isEscalated]);
1512
+ const userTypingTimeoutRef = React4.useRef(null);
1513
+ const handleTypingStart = React4.useCallback(() => {
1514
+ if (!isEscalated || !supabaseRef.current) return;
1515
+ sendTypingIndicator(true);
1516
+ updateCustomerStatus("active");
1517
+ if (userTypingTimeoutRef.current) {
1518
+ window.clearTimeout(userTypingTimeoutRef.current);
1519
+ }
1520
+ userTypingTimeoutRef.current = window.setTimeout(() => {
1521
+ sendTypingIndicator(false);
1522
+ }, 1500);
1523
+ }, [isEscalated, sendTypingIndicator, updateCustomerStatus]);
1390
1524
  const streamIntervals = React4.useRef({});
1391
1525
  const isEmpty = messages.length === 0;
1392
1526
  const [phase, setPhase] = React4.useState("idle");
@@ -1661,12 +1795,13 @@ function ChatPanel({
1661
1795
  type: "user_message",
1662
1796
  content
1663
1797
  }));
1798
+ updateCustomerStatus("active");
1664
1799
  return true;
1665
1800
  } catch (err) {
1666
1801
  console.error("[KiteChat] Failed to send escalated message:", err);
1667
1802
  return false;
1668
1803
  }
1669
- }, []);
1804
+ }, [updateCustomerStatus]);
1670
1805
  React4.useEffect(() => {
1671
1806
  return () => {
1672
1807
  if (escalationWsRef.current) {
@@ -1797,6 +1932,11 @@ function ChatPanel({
1797
1932
  };
1798
1933
  setMessages((prev) => [...prev, userMessage]);
1799
1934
  sendEscalatedMessage(trimmed);
1935
+ sendTypingIndicator(false);
1936
+ if (userTypingTimeoutRef.current) {
1937
+ window.clearTimeout(userTypingTimeoutRef.current);
1938
+ userTypingTimeoutRef.current = null;
1939
+ }
1800
1940
  setInput("");
1801
1941
  return;
1802
1942
  }
@@ -2815,8 +2955,8 @@ ${userText}`
2815
2955
  }
2816
2956
  }
2817
2957
  if (!isOpen) {
2818
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "fixed bottom-6 left-1/2 -translate-x-1/2 z-50", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: `flex items-center gap-3 rounded-2xl bg-white border border-gray-200 shadow-lg px-4 py-2 hover:shadow-xl transition-all duration-300 ease-out focus-within:border-gray-700 ${searchExpanded ? "w-[480px]" : "w-[320px]"}`, children: !searchExpanded ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center gap-3 w-full", children: [
2819
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
2958
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "fixed bottom-6 left-1/2 -translate-x-1/2 z-50", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: `flex items-center gap-3 rounded-2xl bg-white border border-gray-200 shadow-lg px-4 py-2 hover:shadow-xl transition-all duration-300 ease-out focus-within:border-gray-700 ${searchExpanded ? "w-[480px]" : "w-[320px]"}`, children: !searchExpanded ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-3 w-full", children: [
2959
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
2820
2960
  "button",
2821
2961
  {
2822
2962
  onClick: () => {
@@ -2825,23 +2965,23 @@ ${userText}`
2825
2965
  },
2826
2966
  className: "flex items-center gap-3 flex-1 group",
2827
2967
  children: [
2828
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-sm text-gray-500 flex-1 text-left", children: "Ask a question..." }),
2829
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-xs text-gray-400 font-medium", children: "\u2318I" })
2968
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-sm text-gray-500 flex-1 text-left", children: "Ask a question..." }),
2969
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-xs text-gray-400 font-medium", children: "\u2318I" })
2830
2970
  ]
2831
2971
  }
2832
2972
  ),
2833
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2973
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2834
2974
  "button",
2835
2975
  {
2836
2976
  onClick: () => {
2837
2977
  onOpen?.();
2838
2978
  },
2839
2979
  className: "h-7 w-7 rounded-lg bg-gray-100 hover:bg-gray-200 flex items-center justify-center transition-colors",
2840
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.Sparkles, { className: "h-3.5 w-3.5 text-black", fill: "currentColor" })
2980
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Sparkles, { className: "h-3.5 w-3.5 text-black", fill: "currentColor" })
2841
2981
  }
2842
2982
  )
2843
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
2844
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2983
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
2984
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2845
2985
  "input",
2846
2986
  {
2847
2987
  ref: searchInputRef,
@@ -2869,9 +3009,9 @@ ${userText}`
2869
3009
  className: "flex-1 text-sm text-gray-700 outline-none bg-transparent"
2870
3010
  }
2871
3011
  ),
2872
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center gap-2", children: [
2873
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-xs text-gray-400 font-medium", children: "\u21B5 Enter" }),
2874
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3012
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-2", children: [
3013
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-xs text-gray-400 font-medium", children: "\u21B5 Enter" }),
3014
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2875
3015
  "button",
2876
3016
  {
2877
3017
  onClick: () => {
@@ -2883,25 +3023,25 @@ ${userText}`
2883
3023
  setSearchExpanded(false);
2884
3024
  },
2885
3025
  className: "h-7 w-7 rounded-lg bg-gray-100 hover:bg-gray-200 flex items-center justify-center transition-colors cursor-pointer",
2886
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.Sparkles, { className: "h-3.5 w-3.5 text-black", fill: "currentColor" })
3026
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Sparkles, { className: "h-3.5 w-3.5 text-black", fill: "currentColor" })
2887
3027
  }
2888
3028
  )
2889
3029
  ] })
2890
3030
  ] }) }) });
2891
3031
  }
2892
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
3032
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
2893
3033
  "section",
2894
3034
  {
2895
3035
  className: `fixed top-0 right-0 z-40 flex flex-col bg-white border-l border-gray-200 h-full overflow-hidden transition-transform duration-300 ${isOpen ? "translate-x-0" : "translate-x-full"}`,
2896
3036
  style: { width: `${PANEL_WIDTH}px` },
2897
3037
  children: [
2898
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center justify-between px-4 py-3 border-b border-gray-100 bg-gradient-to-r from-gray-50 to-white shrink-0", children: [
2899
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center gap-2.5", children: [
2900
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.Sparkles, { className: "h-3.5 w-3.5 text-black", fill: "currentColor" }),
2901
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("h3", { className: "text-sm font-semibold text-gray-800", children: "Copilot" })
3038
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center justify-between px-4 py-3 border-b border-gray-100 bg-gradient-to-r from-gray-50 to-white shrink-0", children: [
3039
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-2.5", children: [
3040
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Sparkles, { className: "h-3.5 w-3.5 text-black", fill: "currentColor" }),
3041
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h3", { className: "text-sm font-semibold text-gray-800", children: "Copilot" })
2902
3042
  ] }),
2903
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center gap-1", children: [
2904
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3043
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-1", children: [
3044
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2905
3045
  Button,
2906
3046
  {
2907
3047
  variant: "ghost",
@@ -2916,29 +3056,29 @@ ${userText}`
2916
3056
  activeGuideRef.current = void 0;
2917
3057
  setGuideComplete(false);
2918
3058
  },
2919
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.SquarePen, { className: "h-3 w-3" })
3059
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.SquarePen, { className: "h-3 w-3" })
2920
3060
  }
2921
3061
  ),
2922
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3062
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2923
3063
  Button,
2924
3064
  {
2925
3065
  variant: "ghost",
2926
3066
  size: "sm",
2927
3067
  className: "h-7 w-7 p-0 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-full",
2928
3068
  onClick: () => onClose?.(),
2929
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.Minus, { className: "h-3.5 w-3.5" })
3069
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Minus, { className: "h-3.5 w-3.5" })
2930
3070
  }
2931
3071
  )
2932
3072
  ] })
2933
3073
  ] }),
2934
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3074
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2935
3075
  "div",
2936
3076
  {
2937
3077
  className: isEmpty ? "grid flex-1 place-items-center transition-all duration-300" : "flex flex-1 flex-col transition-all duration-300 min-h-0 overflow-hidden",
2938
- children: isEmpty ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "w-full overflow-y-auto px-4", children: [
2939
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "py-3 transition-all duration-300", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("h2", { className: "text-center text-2xl font-semibold text-gray-900", children: panelView === "folder" ? folders.find((f) => f.id === currentFolderId)?.title || "" : "How can I help?" }) }),
2940
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "pb-4 px-4", children: [
2941
- panelView === "landing" && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_jsx_runtime9.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "flex flex-col gap-1", children: loadingQuestions ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "flex items-center justify-center py-4", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.Loader2, { className: "h-4 w-4 animate-spin text-gray-400" }) }) : startingQuestions.map((question, index) => {
3078
+ children: isEmpty ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "w-full overflow-y-auto px-4", children: [
3079
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "py-3 transition-all duration-300", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h2", { className: "text-center text-2xl font-semibold text-gray-900", children: panelView === "folder" ? folders.find((f) => f.id === currentFolderId)?.title || "" : "How can I help?" }) }),
3080
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "pb-4 px-4", children: [
3081
+ panelView === "landing" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "flex flex-col gap-1", children: loadingQuestions ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "flex items-center justify-center py-4", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Loader2, { className: "h-4 w-4 animate-spin text-gray-400" }) }) : startingQuestions.map((question, index) => {
2942
3082
  const iconColors = [
2943
3083
  "bg-blue-400",
2944
3084
  "bg-green-400",
@@ -2946,7 +3086,7 @@ ${userText}`
2946
3086
  "bg-orange-400",
2947
3087
  "bg-pink-400"
2948
3088
  ];
2949
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
3089
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
2950
3090
  Button,
2951
3091
  {
2952
3092
  type: "button",
@@ -2955,7 +3095,7 @@ ${userText}`
2955
3095
  className: "w-full justify-start rounded-lg px-3 py-1.5 text-xs text-gray-700 hover:bg-gray-100 h-auto",
2956
3096
  onClick: () => sendTopic(question.prompt),
2957
3097
  children: [
2958
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3098
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2959
3099
  "span",
2960
3100
  {
2961
3101
  className: `mr-2 inline-block h-1.5 w-1.5 rounded-full ${iconColors[index % iconColors.length]}`
@@ -2967,9 +3107,9 @@ ${userText}`
2967
3107
  question.id
2968
3108
  );
2969
3109
  }) }) }),
2970
- panelView === "folder" && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
2971
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "mb-3 flex items-center gap-2", children: [
2972
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3110
+ panelView === "folder" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
3111
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "mb-3 flex items-center gap-2", children: [
3112
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2973
3113
  Button,
2974
3114
  {
2975
3115
  type: "button",
@@ -2978,12 +3118,12 @@ ${userText}`
2978
3118
  className: "h-7 w-7 rounded-full hover:bg-gray-100",
2979
3119
  onClick: closeFolder,
2980
3120
  "aria-label": "Back to suggestions",
2981
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.ArrowLeft, { className: "h-4 w-4 text-gray-500" })
3121
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.ArrowLeft, { className: "h-4 w-4 text-gray-500" })
2982
3122
  }
2983
3123
  ),
2984
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-xs font-medium uppercase tracking-wide text-gray-400", children: "Topics" })
3124
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-xs font-medium uppercase tracking-wide text-gray-400", children: "Topics" })
2985
3125
  ] }),
2986
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "flex flex-col gap-1.5", children: folders.find((f) => f.id === currentFolderId)?.topics.map((topic) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3126
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "flex flex-col gap-1.5", children: folders.find((f) => f.id === currentFolderId)?.topics.map((topic) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2987
3127
  Button,
2988
3128
  {
2989
3129
  type: "button",
@@ -2997,7 +3137,7 @@ ${userText}`
2997
3137
  )) })
2998
3138
  ] })
2999
3139
  ] })
3000
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_jsx_runtime9.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "flex-1 min-h-0 overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ScrollArea, { ref: messagesContainerRef, className: "h-full", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex flex-col gap-2 px-4 py-3", children: [
3140
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "flex-1 min-h-0 overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ScrollArea, { ref: messagesContainerRef, className: "h-full", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex flex-col gap-2 px-4 py-3", children: [
3001
3141
  messages.map((message, index) => {
3002
3142
  const isUser = message.role === "user";
3003
3143
  const previousRole = index > 0 ? messages[index - 1].role : void 0;
@@ -3017,17 +3157,20 @@ ${userText}`
3017
3157
  return null;
3018
3158
  }
3019
3159
  if (isUser) {
3020
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: `flex justify-end ${isRoleChange ? "mt-3" : ""}`, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "max-w-[260px] rounded-2xl rounded-br-md bg-gray-900 px-3.5 py-2.5 text-sm text-white shadow-sm", children: message.content }) }, message.id);
3160
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: `flex justify-end ${isRoleChange ? "mt-3" : ""}`, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "max-w-[260px] rounded-2xl rounded-br-md bg-gray-900 px-3.5 py-2.5 text-sm text-white shadow-sm", children: message.content }) }, message.id);
3021
3161
  }
3022
3162
  if (message.role === "agent") {
3023
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: `flex justify-start ${isRoleChange ? "mt-3" : ""}`, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "max-w-[260px] rounded-2xl rounded-bl-md bg-blue-500 px-3.5 py-2.5 text-sm text-white shadow-sm", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "whitespace-pre-wrap leading-relaxed", children: renderMarkdown(message.content || "") }) }) }, message.id);
3163
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: `flex flex-col items-start ${isRoleChange ? "mt-3" : ""}`, children: [
3164
+ isRoleChange && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-xs text-gray-500 mb-1 ml-1", children: "Agent" }),
3165
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "max-w-[260px] rounded-2xl rounded-bl-md bg-white border border-gray-200 px-3.5 py-2.5 text-sm text-gray-800 shadow-sm", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "whitespace-pre-wrap leading-relaxed", children: renderMarkdown(message.content || "") }) })
3166
+ ] }, message.id);
3024
3167
  }
3025
3168
  if (message.kind === "searchSummary") {
3026
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3169
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3027
3170
  "div",
3028
3171
  {
3029
3172
  className: `${isRoleChange ? "mt-3" : ""}`,
3030
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3173
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3031
3174
  AssistantSearchSummary,
3032
3175
  {
3033
3176
  title: message.title ?? "Search results",
@@ -3039,27 +3182,27 @@ ${userText}`
3039
3182
  );
3040
3183
  }
3041
3184
  if (message.kind === "guideComplete") {
3042
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3185
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3043
3186
  "div",
3044
3187
  {
3045
3188
  ref: isCurrentGuideStep ? currentStepRef : null,
3046
3189
  className: `${isRoleChange ? "mt-3" : ""}`,
3047
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center gap-2 rounded-xl bg-green-50 border border-green-200 px-3 py-2.5 text-sm leading-6", children: [
3048
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.CheckCircle2, { className: "h-5 w-5 text-green-600 flex-shrink-0" }),
3049
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "font-medium text-green-800", children: message.content })
3190
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-2 rounded-xl bg-green-50 border border-green-200 px-3 py-2.5 text-sm leading-6", children: [
3191
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.CheckCircle2, { className: "h-5 w-5 text-green-600 flex-shrink-0" }),
3192
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "font-medium text-green-800", children: message.content })
3050
3193
  ] })
3051
3194
  },
3052
3195
  message.id
3053
3196
  );
3054
3197
  }
3055
3198
  if (message.kind === "navigationAction") {
3056
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
3199
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
3057
3200
  "div",
3058
3201
  {
3059
3202
  className: `${isRoleChange ? "mt-3" : ""}`,
3060
3203
  children: [
3061
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "whitespace-pre-wrap text-sm leading-6 mb-2 text-gray-700", children: message.content || "" }),
3062
- message.navigationTarget && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "mt-2", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
3204
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "whitespace-pre-wrap text-sm leading-6 mb-2 text-gray-700", children: message.content || "" }),
3205
+ message.navigationTarget && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "mt-2", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
3063
3206
  Button,
3064
3207
  {
3065
3208
  type: "button",
@@ -3070,10 +3213,10 @@ ${userText}`
3070
3213
  message.navigationTarget
3071
3214
  ),
3072
3215
  children: [
3073
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { children: "Confirm" }),
3074
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "flex items-center gap-0.5 text-gray-400", children: [
3075
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.Command, { className: "h-3 w-3" }),
3076
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.CornerDownLeft, { className: "h-3 w-3" })
3216
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "Confirm" }),
3217
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-0.5 text-gray-400", children: [
3218
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Command, { className: "h-3 w-3" }),
3219
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.CornerDownLeft, { className: "h-3 w-3" })
3077
3220
  ] })
3078
3221
  ]
3079
3222
  }
@@ -3131,26 +3274,26 @@ ${userText}`
3131
3274
  } else {
3132
3275
  successContent = "Action completed successfully.";
3133
3276
  }
3134
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3277
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3135
3278
  "div",
3136
3279
  {
3137
3280
  className: `${isRoleChange ? "mt-3" : ""}`,
3138
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "whitespace-pre-wrap text-sm leading-6 text-gray-700", children: successContent })
3281
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "whitespace-pre-wrap text-sm leading-6 text-gray-700", children: successContent })
3139
3282
  },
3140
3283
  message.id
3141
3284
  );
3142
3285
  }
3143
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
3286
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
3144
3287
  "div",
3145
3288
  {
3146
3289
  className: `min-w-0 ${isRoleChange ? "mt-3" : ""}`,
3147
3290
  children: [
3148
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "whitespace-pre-wrap text-sm leading-6 mb-3 text-gray-700", children: message.content || "" }),
3149
- actionType === "updateCompanyInfo" && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "space-y-2 bg-gray-50 rounded-lg p-2 border border-gray-200 overflow-hidden", children: [
3150
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "grid grid-cols-2 gap-2", children: [
3151
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3152
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Company Name" }),
3153
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3291
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "whitespace-pre-wrap text-sm leading-6 mb-3 text-gray-700", children: message.content || "" }),
3292
+ actionType === "updateCompanyInfo" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-2 bg-gray-50 rounded-lg p-2 border border-gray-200 overflow-hidden", children: [
3293
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "grid grid-cols-2 gap-2", children: [
3294
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3295
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Company Name" }),
3296
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3154
3297
  Input,
3155
3298
  {
3156
3299
  placeholder: "Acme Corporation",
@@ -3163,9 +3306,9 @@ ${userText}`
3163
3306
  }
3164
3307
  )
3165
3308
  ] }),
3166
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3167
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Email" }),
3168
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3309
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3310
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Email" }),
3311
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3169
3312
  Input,
3170
3313
  {
3171
3314
  type: "email",
@@ -3180,9 +3323,9 @@ ${userText}`
3180
3323
  )
3181
3324
  ] })
3182
3325
  ] }),
3183
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3184
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Address" }),
3185
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3326
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3327
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Address" }),
3328
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3186
3329
  Input,
3187
3330
  {
3188
3331
  placeholder: "123 Main St, San Francisco, CA",
@@ -3195,10 +3338,10 @@ ${userText}`
3195
3338
  }
3196
3339
  )
3197
3340
  ] }),
3198
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "grid grid-cols-2 gap-2", children: [
3199
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3200
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Phone" }),
3201
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3341
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "grid grid-cols-2 gap-2", children: [
3342
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3343
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Phone" }),
3344
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3202
3345
  Input,
3203
3346
  {
3204
3347
  type: "tel",
@@ -3212,9 +3355,9 @@ ${userText}`
3212
3355
  }
3213
3356
  )
3214
3357
  ] }),
3215
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3216
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Website" }),
3217
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3358
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3359
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Website" }),
3360
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3218
3361
  Input,
3219
3362
  {
3220
3363
  type: "url",
@@ -3230,9 +3373,9 @@ ${userText}`
3230
3373
  ] })
3231
3374
  ] })
3232
3375
  ] }),
3233
- actionType === "addApiKey" && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3234
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "API Key Name" }),
3235
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3376
+ actionType === "addApiKey" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3377
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "API Key Name" }),
3378
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3236
3379
  Input,
3237
3380
  {
3238
3381
  placeholder: "Production Key",
@@ -3245,11 +3388,11 @@ ${userText}`
3245
3388
  }
3246
3389
  )
3247
3390
  ] }) }),
3248
- actionType === "addCustomer" && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "space-y-2 bg-gray-50 rounded-lg p-2 border border-gray-200 overflow-hidden", children: [
3249
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "grid grid-cols-2 gap-2", children: [
3250
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3251
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Company Name" }),
3252
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3391
+ actionType === "addCustomer" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-2 bg-gray-50 rounded-lg p-2 border border-gray-200 overflow-hidden", children: [
3392
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "grid grid-cols-2 gap-2", children: [
3393
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3394
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Company Name" }),
3395
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3253
3396
  Input,
3254
3397
  {
3255
3398
  placeholder: "Acme Corporation",
@@ -3262,9 +3405,9 @@ ${userText}`
3262
3405
  }
3263
3406
  )
3264
3407
  ] }),
3265
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3266
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Email" }),
3267
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3408
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3409
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Email" }),
3410
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3268
3411
  Input,
3269
3412
  {
3270
3413
  type: "email",
@@ -3279,9 +3422,9 @@ ${userText}`
3279
3422
  )
3280
3423
  ] })
3281
3424
  ] }),
3282
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3283
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Location" }),
3284
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3425
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3426
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Location" }),
3427
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3285
3428
  Input,
3286
3429
  {
3287
3430
  placeholder: "San Francisco, CA",
@@ -3294,9 +3437,9 @@ ${userText}`
3294
3437
  }
3295
3438
  )
3296
3439
  ] }),
3297
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3298
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Subscription Tier" }),
3299
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
3440
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3441
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Subscription Tier" }),
3442
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
3300
3443
  "select",
3301
3444
  {
3302
3445
  value: formData.subscription || "Starter",
@@ -3306,19 +3449,19 @@ ${userText}`
3306
3449
  }),
3307
3450
  className: "h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",
3308
3451
  children: [
3309
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "Starter", children: "Starter" }),
3310
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "Professional", children: "Professional" }),
3311
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "Enterprise", children: "Enterprise" })
3452
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Starter", children: "Starter" }),
3453
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Professional", children: "Professional" }),
3454
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Enterprise", children: "Enterprise" })
3312
3455
  ]
3313
3456
  }
3314
3457
  )
3315
3458
  ] })
3316
3459
  ] }),
3317
- (actionType === "enable2FA" || actionType === "disable2FA") && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-xs text-black", children: actionType === "enable2FA" ? "This will enable two-factor authentication for your account. You'll need to set up an authenticator app." : "This will disable two-factor authentication for your account. Your account will be less secure." }) }),
3318
- actionType === "changePassword" && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
3319
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3320
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Current Password" }),
3321
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3460
+ (actionType === "enable2FA" || actionType === "disable2FA") && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "text-xs text-black", children: actionType === "enable2FA" ? "This will enable two-factor authentication for your account. You'll need to set up an authenticator app." : "This will disable two-factor authentication for your account. Your account will be less secure." }) }),
3461
+ actionType === "changePassword" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
3462
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3463
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Current Password" }),
3464
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3322
3465
  Input,
3323
3466
  {
3324
3467
  type: "password",
@@ -3331,9 +3474,9 @@ ${userText}`
3331
3474
  }
3332
3475
  )
3333
3476
  ] }),
3334
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3335
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "New Password" }),
3336
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3477
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3478
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "New Password" }),
3479
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3337
3480
  Input,
3338
3481
  {
3339
3482
  type: "password",
@@ -3346,9 +3489,9 @@ ${userText}`
3346
3489
  }
3347
3490
  )
3348
3491
  ] }),
3349
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3350
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Confirm New Password" }),
3351
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3492
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3493
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Confirm New Password" }),
3494
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3352
3495
  Input,
3353
3496
  {
3354
3497
  type: "password",
@@ -3362,10 +3505,10 @@ ${userText}`
3362
3505
  )
3363
3506
  ] })
3364
3507
  ] }),
3365
- actionType === "toggleNotification" && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
3366
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3367
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Notification Type" }),
3368
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
3508
+ actionType === "toggleNotification" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
3509
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3510
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Notification Type" }),
3511
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
3369
3512
  "select",
3370
3513
  {
3371
3514
  value: formData.notificationType || "paymentReceived",
@@ -3375,17 +3518,17 @@ ${userText}`
3375
3518
  }),
3376
3519
  className: "h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",
3377
3520
  children: [
3378
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "paymentReceived", children: "Payment Received" }),
3379
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "paymentFailed", children: "Payment Failed" }),
3380
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "invoicePaid", children: "Invoice Paid" }),
3381
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "monthlySummary", children: "Monthly Summary" }),
3382
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "productUpdates", children: "Product Updates" })
3521
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "paymentReceived", children: "Payment Received" }),
3522
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "paymentFailed", children: "Payment Failed" }),
3523
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "invoicePaid", children: "Invoice Paid" }),
3524
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "monthlySummary", children: "Monthly Summary" }),
3525
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "productUpdates", children: "Product Updates" })
3383
3526
  ]
3384
3527
  }
3385
3528
  )
3386
3529
  ] }),
3387
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center gap-2", children: [
3388
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3530
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-2", children: [
3531
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3389
3532
  "input",
3390
3533
  {
3391
3534
  type: "checkbox",
@@ -3397,12 +3540,12 @@ ${userText}`
3397
3540
  className: "h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"
3398
3541
  }
3399
3542
  ),
3400
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs text-black", children: "Enable this notification" })
3543
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs text-black", children: "Enable this notification" })
3401
3544
  ] })
3402
3545
  ] }),
3403
- (actionType === "connectIntegration" || actionType === "disconnectIntegration") && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3404
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Integration" }),
3405
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
3546
+ (actionType === "connectIntegration" || actionType === "disconnectIntegration") && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3547
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Integration" }),
3548
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
3406
3549
  "select",
3407
3550
  {
3408
3551
  value: formData.integrationName || "Slack",
@@ -3412,17 +3555,17 @@ ${userText}`
3412
3555
  }),
3413
3556
  className: "h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",
3414
3557
  children: [
3415
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "Slack", children: "Slack" }),
3416
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "Zapier", children: "Zapier" }),
3417
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "Webhook", children: "Webhook" })
3558
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Slack", children: "Slack" }),
3559
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Zapier", children: "Zapier" }),
3560
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Webhook", children: "Webhook" })
3418
3561
  ]
3419
3562
  }
3420
3563
  )
3421
3564
  ] }) }),
3422
- actionType === "addPaymentMethod" && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
3423
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3424
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Card Number" }),
3425
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3565
+ actionType === "addPaymentMethod" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
3566
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3567
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Card Number" }),
3568
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3426
3569
  Input,
3427
3570
  {
3428
3571
  placeholder: "1234 5678 9012 3456",
@@ -3435,9 +3578,9 @@ ${userText}`
3435
3578
  }
3436
3579
  )
3437
3580
  ] }),
3438
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3439
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Expiry Date" }),
3440
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3581
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3582
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Expiry Date" }),
3583
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3441
3584
  Input,
3442
3585
  {
3443
3586
  placeholder: "MM/YY",
@@ -3451,11 +3594,11 @@ ${userText}`
3451
3594
  )
3452
3595
  ] })
3453
3596
  ] }),
3454
- actionType === "removePaymentMethod" && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-xs text-black", children: "This will remove the default payment method from your account." }) }),
3455
- actionType === "refundPayment" && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
3456
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3457
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Transaction ID or Customer Name" }),
3458
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3597
+ actionType === "removePaymentMethod" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "text-xs text-black", children: "This will remove the default payment method from your account." }) }),
3598
+ actionType === "refundPayment" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
3599
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3600
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Transaction ID or Customer Name" }),
3601
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3459
3602
  Input,
3460
3603
  {
3461
3604
  placeholder: "e.g., txn_1234 or Acme Corp",
@@ -3480,9 +3623,9 @@ ${userText}`
3480
3623
  }
3481
3624
  )
3482
3625
  ] }),
3483
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3484
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Amount (optional)" }),
3485
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3626
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3627
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Amount (optional)" }),
3628
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3486
3629
  Input,
3487
3630
  {
3488
3631
  placeholder: "$0.00",
@@ -3495,9 +3638,9 @@ ${userText}`
3495
3638
  }
3496
3639
  )
3497
3640
  ] }),
3498
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3499
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Reason (optional)" }),
3500
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3641
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3642
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Reason (optional)" }),
3643
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3501
3644
  Input,
3502
3645
  {
3503
3646
  placeholder: "e.g., Customer request",
@@ -3511,10 +3654,10 @@ ${userText}`
3511
3654
  )
3512
3655
  ] })
3513
3656
  ] }),
3514
- actionType === "deleteApiKey" && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
3515
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3516
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "API Key Name or ID" }),
3517
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3657
+ actionType === "deleteApiKey" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
3658
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3659
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "API Key Name or ID" }),
3660
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3518
3661
  Input,
3519
3662
  {
3520
3663
  placeholder: "Production Key",
@@ -3528,12 +3671,12 @@ ${userText}`
3528
3671
  }
3529
3672
  )
3530
3673
  ] }),
3531
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-xs text-red-600", children: "Warning: This action cannot be undone. The API key will be permanently deleted." })
3674
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "text-xs text-red-600", children: "Warning: This action cannot be undone. The API key will be permanently deleted." })
3532
3675
  ] }),
3533
- actionType === "addWebhook" && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
3534
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3535
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Webhook URL" }),
3536
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3676
+ actionType === "addWebhook" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
3677
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3678
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Webhook URL" }),
3679
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3537
3680
  Input,
3538
3681
  {
3539
3682
  type: "url",
@@ -3547,9 +3690,9 @@ ${userText}`
3547
3690
  }
3548
3691
  )
3549
3692
  ] }),
3550
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3551
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Name (optional)" }),
3552
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3693
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3694
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Name (optional)" }),
3695
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3553
3696
  Input,
3554
3697
  {
3555
3698
  placeholder: "Production Webhook",
@@ -3563,9 +3706,9 @@ ${userText}`
3563
3706
  )
3564
3707
  ] })
3565
3708
  ] }),
3566
- actionType === "updateCurrency" && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3567
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Currency" }),
3568
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
3709
+ actionType === "updateCurrency" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3710
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Currency" }),
3711
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
3569
3712
  "select",
3570
3713
  {
3571
3714
  value: formData.currency || "USD",
@@ -3575,17 +3718,17 @@ ${userText}`
3575
3718
  }),
3576
3719
  className: "h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",
3577
3720
  children: [
3578
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "USD", children: "USD ($)" }),
3579
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "EUR", children: "EUR (\u20AC)" }),
3580
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "GBP", children: "GBP (\xA3)" }),
3581
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "JPY", children: "JPY (\xA5)" })
3721
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "USD", children: "USD ($)" }),
3722
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "EUR", children: "EUR (\u20AC)" }),
3723
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "GBP", children: "GBP (\xA3)" }),
3724
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "JPY", children: "JPY (\xA5)" })
3582
3725
  ]
3583
3726
  }
3584
3727
  )
3585
3728
  ] }) }),
3586
- actionType === "updateTimezone" && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3587
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Timezone" }),
3588
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
3729
+ actionType === "updateTimezone" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3730
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Timezone" }),
3731
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
3589
3732
  "select",
3590
3733
  {
3591
3734
  value: formData.timezone || "America/Los_Angeles",
@@ -3595,18 +3738,18 @@ ${userText}`
3595
3738
  }),
3596
3739
  className: "h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",
3597
3740
  children: [
3598
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "America/Los_Angeles", children: "Pacific Time (PT)" }),
3599
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "America/New_York", children: "Eastern Time (ET)" }),
3600
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "Europe/London", children: "GMT" }),
3601
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "Asia/Tokyo", children: "JST" })
3741
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "America/Los_Angeles", children: "Pacific Time (PT)" }),
3742
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "America/New_York", children: "Eastern Time (ET)" }),
3743
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Europe/London", children: "GMT" }),
3744
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Asia/Tokyo", children: "JST" })
3602
3745
  ]
3603
3746
  }
3604
3747
  )
3605
3748
  ] }) }),
3606
- actionType === "revokeSession" && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
3607
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3608
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Device/Session" }),
3609
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3749
+ actionType === "revokeSession" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
3750
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3751
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Device/Session" }),
3752
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3610
3753
  Input,
3611
3754
  {
3612
3755
  placeholder: "MacBook Pro",
@@ -3619,12 +3762,12 @@ ${userText}`
3619
3762
  }
3620
3763
  )
3621
3764
  ] }),
3622
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-xs text-black", children: "This will sign out the device and invalidate its session." })
3765
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "text-xs text-black", children: "This will sign out the device and invalidate its session." })
3623
3766
  ] }),
3624
- actionType === "createSubscription" && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
3625
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3626
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Customer Email" }),
3627
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3767
+ actionType === "createSubscription" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
3768
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3769
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Customer Email" }),
3770
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3628
3771
  Input,
3629
3772
  {
3630
3773
  type: "email",
@@ -3638,9 +3781,9 @@ ${userText}`
3638
3781
  }
3639
3782
  )
3640
3783
  ] }),
3641
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3642
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Plan" }),
3643
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
3784
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3785
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Plan" }),
3786
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
3644
3787
  "select",
3645
3788
  {
3646
3789
  value: formData.plan || "Starter",
@@ -3650,16 +3793,16 @@ ${userText}`
3650
3793
  }),
3651
3794
  className: "h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",
3652
3795
  children: [
3653
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "Starter", children: "Starter ($29/mo)" }),
3654
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "Professional", children: "Professional ($99/mo)" }),
3655
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "Enterprise", children: "Enterprise ($299/mo)" })
3796
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Starter", children: "Starter ($29/mo)" }),
3797
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Professional", children: "Professional ($99/mo)" }),
3798
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Enterprise", children: "Enterprise ($299/mo)" })
3656
3799
  ]
3657
3800
  }
3658
3801
  )
3659
3802
  ] }),
3660
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3661
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Billing Cycle" }),
3662
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
3803
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3804
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Billing Cycle" }),
3805
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
3663
3806
  "select",
3664
3807
  {
3665
3808
  value: formData.billingCycle || "monthly",
@@ -3669,18 +3812,18 @@ ${userText}`
3669
3812
  }),
3670
3813
  className: "h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",
3671
3814
  children: [
3672
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "monthly", children: "Monthly" }),
3673
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "yearly", children: "Yearly (Save 15%)" })
3815
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "monthly", children: "Monthly" }),
3816
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "yearly", children: "Yearly (Save 15%)" })
3674
3817
  ]
3675
3818
  }
3676
3819
  )
3677
3820
  ] })
3678
3821
  ] }),
3679
- actionType === "exportCertificate" && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
3680
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-xs text-black", children: "This will export your certificate of incorporation document." }),
3681
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3682
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Format" }),
3683
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
3822
+ actionType === "exportCertificate" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
3823
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "text-xs text-black", children: "This will export your certificate of incorporation document." }),
3824
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3825
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Format" }),
3826
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
3684
3827
  "select",
3685
3828
  {
3686
3829
  value: formData.format || "pdf",
@@ -3690,17 +3833,17 @@ ${userText}`
3690
3833
  }),
3691
3834
  className: "h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",
3692
3835
  children: [
3693
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "pdf", children: "PDF" }),
3694
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "json", children: "JSON" })
3836
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "pdf", children: "PDF" }),
3837
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "json", children: "JSON" })
3695
3838
  ]
3696
3839
  }
3697
3840
  )
3698
3841
  ] })
3699
3842
  ] }),
3700
- (actionType === "toggleBlockRule" || actionType === "enableBlockRule" || actionType === "disableBlockRule") && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
3701
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3702
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Block Rule" }),
3703
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
3843
+ (actionType === "toggleBlockRule" || actionType === "enableBlockRule" || actionType === "disableBlockRule") && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
3844
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3845
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Block Rule" }),
3846
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
3704
3847
  "select",
3705
3848
  {
3706
3849
  value: formData.ruleId || "rule_1",
@@ -3710,17 +3853,17 @@ ${userText}`
3710
3853
  }),
3711
3854
  className: "h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",
3712
3855
  children: [
3713
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "rule_1", children: "Block if risk level = 'highest'" }),
3714
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "rule_2", children: "Block if matches Stripe block lists" }),
3715
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "rule_3", children: "Block if CVC verification fails" }),
3716
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "rule_4", children: "Block if Postal code verification fails" })
3856
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "rule_1", children: "Block if risk level = 'highest'" }),
3857
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "rule_2", children: "Block if matches Stripe block lists" }),
3858
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "rule_3", children: "Block if CVC verification fails" }),
3859
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "rule_4", children: "Block if Postal code verification fails" })
3717
3860
  ]
3718
3861
  }
3719
3862
  )
3720
3863
  ] }),
3721
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-xs text-black", children: actionType === "enableBlockRule" ? "This will enable the selected block rule to actively block matching payments." : actionType === "disableBlockRule" ? "This will disable the selected block rule. Matching payments will no longer be blocked." : "This will toggle the selected block rule's state." })
3864
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "text-xs text-black", children: actionType === "enableBlockRule" ? "This will enable the selected block rule to actively block matching payments." : actionType === "disableBlockRule" ? "This will disable the selected block rule. Matching payments will no longer be blocked." : "This will toggle the selected block rule's state." })
3722
3865
  ] }),
3723
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "mt-3", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
3866
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "mt-3", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
3724
3867
  Button,
3725
3868
  {
3726
3869
  type: "button",
@@ -3729,10 +3872,10 @@ ${userText}`
3729
3872
  className: "h-8 rounded-xl px-3 text-xs gap-1.5 bg-gray-100 hover:bg-gray-200 border border-gray-200",
3730
3873
  onClick: handleActionSubmit,
3731
3874
  children: [
3732
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { children: "Confirm" }),
3733
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "flex items-center gap-0.5 text-gray-400", children: [
3734
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.Command, { className: "h-3 w-3" }),
3735
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.CornerDownLeft, { className: "h-3 w-3" })
3875
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "Confirm" }),
3876
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-0.5 text-gray-400", children: [
3877
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Command, { className: "h-3 w-3" }),
3878
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.CornerDownLeft, { className: "h-3 w-3" })
3736
3879
  ] })
3737
3880
  ]
3738
3881
  }
@@ -3743,25 +3886,25 @@ ${userText}`
3743
3886
  );
3744
3887
  }
3745
3888
  if (message.kind === "bulkPreview" && message.csvData) {
3746
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
3889
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
3747
3890
  "div",
3748
3891
  {
3749
3892
  className: `${isRoleChange ? "mt-3" : ""}`,
3750
3893
  children: [
3751
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "whitespace-pre-wrap text-sm leading-6 mb-3 text-gray-700", children: message.content || "" }),
3752
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "bg-gray-50 rounded-lg border border-gray-200 overflow-hidden", children: [
3753
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "bg-gray-100 px-3 py-2 border-b border-gray-200 flex items-center gap-2", children: [
3754
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.FileSpreadsheet, { className: "h-4 w-4 text-gray-600" }),
3755
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-xs font-medium text-gray-700", children: message.csvData.fileName }),
3756
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "text-xs text-gray-500", children: [
3894
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "whitespace-pre-wrap text-sm leading-6 mb-3 text-gray-700", children: message.content || "" }),
3895
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "bg-gray-50 rounded-lg border border-gray-200 overflow-hidden", children: [
3896
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "bg-gray-100 px-3 py-2 border-b border-gray-200 flex items-center gap-2", children: [
3897
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.FileSpreadsheet, { className: "h-4 w-4 text-gray-600" }),
3898
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-xs font-medium text-gray-700", children: message.csvData.fileName }),
3899
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "text-xs text-gray-500", children: [
3757
3900
  "\u2022 ",
3758
3901
  message.csvData.rowCount,
3759
3902
  " rows"
3760
3903
  ] })
3761
3904
  ] }),
3762
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "px-3 py-2 border-b border-gray-100", children: [
3763
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "text-[10px] uppercase tracking-wider text-gray-500 mb-1", children: "Columns" }),
3764
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "flex flex-wrap gap-1", children: message.csvData.columns.map((col, i) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3905
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "px-3 py-2 border-b border-gray-100", children: [
3906
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "text-[10px] uppercase tracking-wider text-gray-500 mb-1", children: "Columns" }),
3907
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "flex flex-wrap gap-1", children: message.csvData.columns.map((col, i) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3765
3908
  "span",
3766
3909
  {
3767
3910
  className: "text-xs bg-blue-100 text-blue-700 px-1.5 py-0.5 rounded",
@@ -3770,23 +3913,23 @@ ${userText}`
3770
3913
  i
3771
3914
  )) })
3772
3915
  ] }),
3773
- message.csvData.sampleRows.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "px-3 py-2", children: [
3774
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "text-[10px] uppercase tracking-wider text-gray-500 mb-1", children: "Sample Data" }),
3775
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "space-y-1", children: message.csvData.sampleRows.slice(0, 3).map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
3916
+ message.csvData.sampleRows.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "px-3 py-2", children: [
3917
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "text-[10px] uppercase tracking-wider text-gray-500 mb-1", children: "Sample Data" }),
3918
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "space-y-1", children: message.csvData.sampleRows.slice(0, 3).map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
3776
3919
  "div",
3777
3920
  {
3778
3921
  className: "text-xs text-gray-600 bg-white rounded px-2 py-1 border border-gray-100",
3779
3922
  children: [
3780
- Object.entries(row).slice(0, 3).map(([key, val], j) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { children: [
3923
+ Object.entries(row).slice(0, 3).map(([key, val], j) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
3781
3924
  j > 0 && " \u2022 ",
3782
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "text-gray-400", children: [
3925
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "text-gray-400", children: [
3783
3926
  key,
3784
3927
  ":"
3785
3928
  ] }),
3786
3929
  " ",
3787
3930
  val
3788
3931
  ] }, key)),
3789
- Object.keys(row).length > 3 && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "text-gray-400", children: [
3932
+ Object.keys(row).length > 3 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "text-gray-400", children: [
3790
3933
  " ",
3791
3934
  "..."
3792
3935
  ] })
@@ -3795,14 +3938,14 @@ ${userText}`
3795
3938
  i
3796
3939
  )) })
3797
3940
  ] }),
3798
- message.suggestedAction && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "px-3 py-2 bg-blue-50 border-t border-blue-100", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "text-xs text-blue-700", children: [
3941
+ message.suggestedAction && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "px-3 py-2 bg-blue-50 border-t border-blue-100", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "text-xs text-blue-700", children: [
3799
3942
  "Suggested action:",
3800
3943
  " ",
3801
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("strong", { children: message.suggestedAction.replace(/_/g, " ") })
3944
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: message.suggestedAction.replace(/_/g, " ") })
3802
3945
  ] }) })
3803
3946
  ] }),
3804
- message.bulkSessionId && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "mt-3 flex items-center gap-2", children: [
3805
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
3947
+ message.bulkSessionId && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "mt-3 flex items-center gap-2", children: [
3948
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
3806
3949
  Button,
3807
3950
  {
3808
3951
  type: "button",
@@ -3811,19 +3954,19 @@ ${userText}`
3811
3954
  className: "h-8 rounded-xl px-3 text-xs gap-1.5 bg-gray-100 hover:bg-gray-200 border border-gray-200",
3812
3955
  onClick: () => message.bulkSessionId && confirmBulkOperation(message.bulkSessionId),
3813
3956
  children: [
3814
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { children: [
3957
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
3815
3958
  "Process ",
3816
3959
  message.csvData.rowCount,
3817
3960
  " rows"
3818
3961
  ] }),
3819
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "flex items-center gap-0.5 text-gray-400", children: [
3820
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.Command, { className: "h-3 w-3" }),
3821
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.CornerDownLeft, { className: "h-3 w-3" })
3962
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-0.5 text-gray-400", children: [
3963
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Command, { className: "h-3 w-3" }),
3964
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.CornerDownLeft, { className: "h-3 w-3" })
3822
3965
  ] })
3823
3966
  ]
3824
3967
  }
3825
3968
  ),
3826
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3969
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3827
3970
  Button,
3828
3971
  {
3829
3972
  type: "button",
@@ -3843,35 +3986,35 @@ ${userText}`
3843
3986
  if (message.kind === "bulkProgress" && message.bulkProgress) {
3844
3987
  const { processed, total, successes, failures } = message.bulkProgress;
3845
3988
  const percentage = Math.round(processed / total * 100);
3846
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3989
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3847
3990
  "div",
3848
3991
  {
3849
3992
  className: `${isRoleChange ? "mt-3" : ""}`,
3850
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "bg-gray-50 rounded-lg border border-gray-200 p-3", children: [
3851
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center gap-2 mb-2", children: [
3852
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.Loader2, { className: "h-4 w-4 animate-spin text-blue-600" }),
3853
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "text-sm font-medium text-gray-700", children: [
3993
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "bg-gray-50 rounded-lg border border-gray-200 p-3", children: [
3994
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-2 mb-2", children: [
3995
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Loader2, { className: "h-4 w-4 animate-spin text-blue-600" }),
3996
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "text-sm font-medium text-gray-700", children: [
3854
3997
  "Processing... ",
3855
3998
  processed,
3856
3999
  " of ",
3857
4000
  total
3858
4001
  ] })
3859
4002
  ] }),
3860
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "h-2 bg-gray-200 rounded-full overflow-hidden mb-2", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
4003
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "h-2 bg-gray-200 rounded-full overflow-hidden mb-2", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3861
4004
  "div",
3862
4005
  {
3863
4006
  className: "h-full bg-blue-600 transition-all duration-300",
3864
4007
  style: { width: `${percentage}%` }
3865
4008
  }
3866
4009
  ) }),
3867
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center gap-3 text-xs text-gray-600", children: [
3868
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "flex items-center gap-1", children: [
3869
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.CheckCircle2, { className: "h-3 w-3 text-green-600" }),
4010
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-3 text-xs text-gray-600", children: [
4011
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-1", children: [
4012
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.CheckCircle2, { className: "h-3 w-3 text-green-600" }),
3870
4013
  successes,
3871
4014
  " successful"
3872
4015
  ] }),
3873
- failures > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "flex items-center gap-1 text-red-600", children: [
3874
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.X, { className: "h-3 w-3" }),
4016
+ failures > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-1 text-red-600", children: [
4017
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.X, { className: "h-3 w-3" }),
3875
4018
  failures,
3876
4019
  " failed"
3877
4020
  ] })
@@ -3885,41 +4028,41 @@ ${userText}`
3885
4028
  const { total, successes, failures, navigationPage } = message.bulkSummary;
3886
4029
  const hasFailures = failures.length > 0;
3887
4030
  const pageLabel = navigationPage?.page === "customers" ? "Customers" : navigationPage?.page === "dashboard" ? "Dashboard" : navigationPage?.page === "settings" ? "Settings" : "Results";
3888
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
4031
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3889
4032
  "div",
3890
4033
  {
3891
4034
  className: `${isRoleChange ? "mt-3" : ""}`,
3892
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
4035
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
3893
4036
  "div",
3894
4037
  {
3895
4038
  className: `rounded-lg border p-3 ${hasFailures ? "bg-amber-50 border-amber-200" : "bg-green-50 border-green-200"}`,
3896
4039
  children: [
3897
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center gap-2 mb-2", children: [
3898
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
4040
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-2 mb-2", children: [
4041
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3899
4042
  import_lucide_react4.CheckCircle2,
3900
4043
  {
3901
4044
  className: `h-5 w-5 ${hasFailures ? "text-amber-600" : "text-green-600"}`
3902
4045
  }
3903
4046
  ),
3904
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-sm font-medium text-gray-800", children: "Bulk operation complete" })
4047
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-sm font-medium text-gray-800", children: "Bulk operation complete" })
3905
4048
  ] }),
3906
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "text-sm text-gray-600 mb-2", children: message.content || `Processed ${total} rows: ${successes} successful${hasFailures ? `, ${failures.length} failed` : ""}.` }),
3907
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center gap-4 text-xs", children: [
3908
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "flex items-center gap-1 text-green-700", children: [
3909
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.CheckCircle2, { className: "h-3 w-3" }),
4049
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "text-sm text-gray-600 mb-2", children: message.content || `Processed ${total} rows: ${successes} successful${hasFailures ? `, ${failures.length} failed` : ""}.` }),
4050
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-4 text-xs", children: [
4051
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-1 text-green-700", children: [
4052
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.CheckCircle2, { className: "h-3 w-3" }),
3910
4053
  successes,
3911
4054
  " successful"
3912
4055
  ] }),
3913
- hasFailures && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "flex items-center gap-1 text-red-600", children: [
3914
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.X, { className: "h-3 w-3" }),
4056
+ hasFailures && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-1 text-red-600", children: [
4057
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.X, { className: "h-3 w-3" }),
3915
4058
  failures.length,
3916
4059
  " failed"
3917
4060
  ] })
3918
4061
  ] }),
3919
- hasFailures && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "mt-3 pt-2 border-t border-amber-200", children: [
3920
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "text-[10px] uppercase tracking-wider text-amber-700 mb-1", children: "Failed Rows" }),
3921
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "space-y-1 max-h-32 overflow-y-auto", children: [
3922
- failures.slice(0, 5).map((failure, i) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
4062
+ hasFailures && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "mt-3 pt-2 border-t border-amber-200", children: [
4063
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "text-[10px] uppercase tracking-wider text-amber-700 mb-1", children: "Failed Rows" }),
4064
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-1 max-h-32 overflow-y-auto", children: [
4065
+ failures.slice(0, 5).map((failure, i) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
3923
4066
  "div",
3924
4067
  {
3925
4068
  className: "text-xs text-red-700 bg-red-50 rounded px-2 py-1",
@@ -3933,14 +4076,14 @@ ${userText}`
3933
4076
  },
3934
4077
  i
3935
4078
  )),
3936
- failures.length > 5 && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "text-xs text-amber-600", children: [
4079
+ failures.length > 5 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "text-xs text-amber-600", children: [
3937
4080
  "...and ",
3938
4081
  failures.length - 5,
3939
4082
  " more"
3940
4083
  ] })
3941
4084
  ] })
3942
4085
  ] }),
3943
- navigationPage && successes > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "mt-3 pt-2 border-t border-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
4086
+ navigationPage && successes > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "mt-3 pt-2 border-t border-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
3944
4087
  "button",
3945
4088
  {
3946
4089
  type: "button",
@@ -3973,12 +4116,12 @@ ${userText}`
3973
4116
  },
3974
4117
  className: "flex items-center gap-2 text-xs text-gray-500 hover:text-gray-700 transition-colors group cursor-pointer",
3975
4118
  children: [
3976
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "flex items-center gap-1 px-1.5 py-0.5 bg-gray-100 rounded text-[10px] font-medium text-gray-600 group-hover:bg-gray-200", children: [
3977
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.Command, { className: "h-2.5 w-2.5" }),
3978
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { children: "+" }),
3979
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.CornerDownLeft, { className: "h-2.5 w-2.5" })
4119
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-1 px-1.5 py-0.5 bg-gray-100 rounded text-[10px] font-medium text-gray-600 group-hover:bg-gray-200", children: [
4120
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Command, { className: "h-2.5 w-2.5" }),
4121
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "+" }),
4122
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.CornerDownLeft, { className: "h-2.5 w-2.5" })
3980
4123
  ] }),
3981
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { children: [
4124
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
3982
4125
  "View ",
3983
4126
  pageLabel
3984
4127
  ] })
@@ -3992,19 +4135,19 @@ ${userText}`
3992
4135
  message.id
3993
4136
  );
3994
4137
  }
3995
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(React4.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
4138
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(React4.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
3996
4139
  "div",
3997
4140
  {
3998
4141
  ref: isCurrentGuideStep ? currentStepRef : null,
3999
4142
  className: `${isRoleChange ? "mt-3" : ""}`,
4000
4143
  children: [
4001
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "text-sm leading-6 text-gray-700", children: (() => {
4144
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "text-sm leading-6 text-gray-700", children: (() => {
4002
4145
  const text = message.content || "";
4003
4146
  if (message.kind === "guideStep") {
4004
4147
  const m = text.match(/^(Step\s+\d+:)([\s\S]*)/);
4005
4148
  if (m) {
4006
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
4007
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("strong", { children: m[1] }),
4149
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
4150
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: m[1] }),
4008
4151
  m[2]
4009
4152
  ] });
4010
4153
  }
@@ -4012,16 +4155,16 @@ ${userText}`
4012
4155
  if (message.role === "assistant" && text) {
4013
4156
  return renderMarkdown(text);
4014
4157
  }
4015
- return text || /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "opacity-70", children: "Thinking\u2026" });
4158
+ return text || /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "opacity-70", children: "Thinking\u2026" });
4016
4159
  })() }),
4017
- message.role === "assistant" && message.structuredData && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "mt-3", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
4160
+ message.role === "assistant" && message.structuredData && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "mt-3", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
4018
4161
  DataRenderer,
4019
4162
  {
4020
4163
  type: message.structuredData.type,
4021
4164
  data: message.structuredData.data
4022
4165
  }
4023
4166
  ) }),
4024
- message.role === "assistant" && message.followups && message.followups.length > 0 && !message.followupSelected && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "mt-3 flex flex-wrap gap-1.5", children: message.followups.map((followup) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
4167
+ message.role === "assistant" && message.followups && message.followups.length > 0 && !message.followupSelected && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "mt-3 flex flex-wrap gap-1.5", children: message.followups.map((followup) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
4025
4168
  "button",
4026
4169
  {
4027
4170
  type: "button",
@@ -4035,8 +4178,8 @@ ${userText}`
4035
4178
  }
4036
4179
  ) }, message.id);
4037
4180
  }),
4038
- (activeGuide || guideComplete) && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "mt-3 flex items-center gap-2", children: [
4039
- activeGuide && activeGuide.stepIndex > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
4181
+ (activeGuide || guideComplete) && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "mt-3 flex items-center gap-2", children: [
4182
+ activeGuide && activeGuide.stepIndex > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
4040
4183
  Button,
4041
4184
  {
4042
4185
  type: "button",
@@ -4044,10 +4187,10 @@ ${userText}`
4044
4187
  variant: "secondary",
4045
4188
  className: "h-7 w-7 rounded-full p-0 bg-gray-100 hover:bg-gray-200 border border-gray-200",
4046
4189
  onClick: goBackGuide,
4047
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.ArrowLeft, { className: "h-3.5 w-3.5 text-gray-600" })
4190
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.ArrowLeft, { className: "h-3.5 w-3.5 text-gray-600" })
4048
4191
  }
4049
4192
  ),
4050
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
4193
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
4051
4194
  Button,
4052
4195
  {
4053
4196
  type: "button",
@@ -4056,31 +4199,32 @@ ${userText}`
4056
4199
  className: "h-8 rounded-xl px-3 text-xs gap-1.5 bg-gray-100 hover:bg-gray-200 border border-gray-200",
4057
4200
  onClick: guideComplete ? handleBack : advanceGuide,
4058
4201
  children: [
4059
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { children: guideComplete ? "Done" : "Next" }),
4060
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "flex items-center gap-0.5 text-gray-400", children: [
4061
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.Command, { className: "h-3 w-3" }),
4062
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.CornerDownLeft, { className: "h-3 w-3" })
4202
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: guideComplete ? "Done" : "Next" }),
4203
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-0.5 text-gray-400", children: [
4204
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Command, { className: "h-3 w-3" }),
4205
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.CornerDownLeft, { className: "h-3 w-3" })
4063
4206
  ] })
4064
4207
  ]
4065
4208
  }
4066
4209
  )
4067
4210
  ] }),
4068
- (phase === "thinking" || phase === "searching" || phase === "executing" || phase === "responding") && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: `${lastRole === "user" ? "mt-3" : ""}`, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
4211
+ (phase === "thinking" || phase === "searching" || phase === "executing" || phase === "responding") && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: `${lastRole === "user" ? "mt-3" : ""}`, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
4069
4212
  AssistantActivity,
4070
4213
  {
4071
4214
  phase,
4072
4215
  progressSteps
4073
4216
  }
4074
4217
  ) }),
4075
- !activeGuide && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { ref: messagesEndRef })
4218
+ isEscalated && agentIsTyping && phase === "idle" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "mt-2", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TypingIndicator, {}) }),
4219
+ !activeGuide && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { ref: messagesEndRef })
4076
4220
  ] }) }) }) })
4077
4221
  }
4078
4222
  ),
4079
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "px-4 py-3 border-t border-gray-100 bg-gray-50/50 shrink-0", children: [
4080
- pendingFile && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "mb-2 flex items-center gap-2 rounded-xl bg-blue-50 border border-blue-200 px-3 py-2", children: [
4081
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.FileSpreadsheet, { className: "h-4 w-4 text-blue-600" }),
4082
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-xs text-blue-700 flex-1 truncate", children: pendingFile.name }),
4083
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
4223
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "px-4 py-3 border-t border-gray-100 bg-gray-50/50 shrink-0", children: [
4224
+ pendingFile && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "mb-2 flex items-center gap-2 rounded-xl bg-blue-50 border border-blue-200 px-3 py-2", children: [
4225
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.FileSpreadsheet, { className: "h-4 w-4 text-blue-600" }),
4226
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-xs text-blue-700 flex-1 truncate", children: pendingFile.name }),
4227
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
4084
4228
  "button",
4085
4229
  {
4086
4230
  type: "button",
@@ -4089,12 +4233,12 @@ ${userText}`
4089
4233
  if (fileInputRef.current) fileInputRef.current.value = "";
4090
4234
  },
4091
4235
  className: "text-blue-600 hover:text-blue-800",
4092
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.X, { className: "h-4 w-4" })
4236
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.X, { className: "h-4 w-4" })
4093
4237
  }
4094
4238
  )
4095
4239
  ] }),
4096
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("form", { onSubmit: handleSubmit, className: "w-full", children: [
4097
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
4240
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("form", { onSubmit: handleSubmit, className: "w-full", children: [
4241
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
4098
4242
  "input",
4099
4243
  {
4100
4244
  ref: fileInputRef,
@@ -4109,8 +4253,8 @@ ${userText}`
4109
4253
  }
4110
4254
  }
4111
4255
  ),
4112
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex w-full items-start gap-2 rounded-xl border border-gray-200 bg-white px-3 py-2 shadow-sm", children: [
4113
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
4256
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex w-full items-start gap-2 rounded-xl border border-gray-200 bg-white px-3 py-2 shadow-sm", children: [
4257
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
4114
4258
  Button,
4115
4259
  {
4116
4260
  type: "button",
@@ -4119,15 +4263,20 @@ ${userText}`
4119
4263
  onClick: () => fileInputRef.current?.click(),
4120
4264
  className: "h-5 w-5 rounded-full text-gray-400 hover:text-gray-600 hover:bg-gray-100",
4121
4265
  title: "Upload CSV for bulk operations",
4122
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.Paperclip, { className: "h-2.5 w-2.5" })
4266
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Paperclip, { className: "h-2.5 w-2.5" })
4123
4267
  }
4124
4268
  ),
4125
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
4269
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
4126
4270
  "textarea",
4127
4271
  {
4128
4272
  placeholder: pendingFile ? "Describe what to do with this CSV..." : "Ask anything...",
4129
4273
  value: input,
4130
- onChange: (e) => setInput(e.target.value),
4274
+ onChange: (e) => {
4275
+ setInput(e.target.value);
4276
+ if (e.target.value.length > 0) {
4277
+ handleTypingStart();
4278
+ }
4279
+ },
4131
4280
  rows: 1,
4132
4281
  className: "flex-1 border-0 bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0 text-sm placeholder:text-gray-400 resize-none overflow-hidden outline-none",
4133
4282
  style: { minHeight: "20px", maxHeight: "120px" },
@@ -4178,20 +4327,20 @@ ${userText}`
4178
4327
  }
4179
4328
  }
4180
4329
  ),
4181
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
4330
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
4182
4331
  Button,
4183
4332
  {
4184
4333
  type: "submit",
4185
4334
  size: "icon",
4186
4335
  disabled: !input.trim() && !pendingFile,
4187
4336
  className: "h-6 w-6 rounded-full bg-gray-900 hover:bg-gray-800 disabled:bg-gray-300",
4188
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.ArrowUp, { className: "h-2.5 w-2.5" })
4337
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.ArrowUp, { className: "h-2.5 w-2.5" })
4189
4338
  }
4190
4339
  )
4191
4340
  ] })
4192
4341
  ] })
4193
4342
  ] }),
4194
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
4343
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
4195
4344
  GuideCursor,
4196
4345
  {
4197
4346
  x: cursorState.x,
@@ -4209,7 +4358,7 @@ function PanelToggle({
4209
4358
  onClick,
4210
4359
  className = ""
4211
4360
  }) {
4212
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
4361
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
4213
4362
  "button",
4214
4363
  {
4215
4364
  type: "button",
@@ -4220,7 +4369,7 @@ function PanelToggle({
4220
4369
  right: isOpen ? `${PANEL_WIDTH}px` : "0px",
4221
4370
  transform: "translateY(-50%)"
4222
4371
  },
4223
- children: isOpen ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.ChevronRight, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.ChevronLeft, { className: "h-4 w-4" })
4372
+ children: isOpen ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.ChevronRight, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.ChevronLeft, { className: "h-4 w-4" })
4224
4373
  }
4225
4374
  );
4226
4375
  }
@@ -4238,7 +4387,9 @@ function ChatPanelWithToggle({
4238
4387
  orgId,
4239
4388
  userName,
4240
4389
  userEmail,
4241
- userOrganization
4390
+ userOrganization,
4391
+ supabaseUrl,
4392
+ supabaseAnonKey
4242
4393
  }) {
4243
4394
  const [internalIsOpen, setInternalIsOpen] = React4.useState(defaultOpen);
4244
4395
  const isOpen = controlledIsOpen !== void 0 ? controlledIsOpen : internalIsOpen;
@@ -4258,7 +4409,7 @@ function ChatPanelWithToggle({
4258
4409
  document.body.style.transition = originalTransition;
4259
4410
  };
4260
4411
  }, [isOpen]);
4261
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
4412
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
4262
4413
  ChatPanel,
4263
4414
  {
4264
4415
  isOpen,
@@ -4274,25 +4425,27 @@ function ChatPanelWithToggle({
4274
4425
  orgId,
4275
4426
  userName,
4276
4427
  userEmail,
4277
- userOrganization
4428
+ userOrganization,
4429
+ supabaseUrl,
4430
+ supabaseAnonKey
4278
4431
  }
4279
4432
  );
4280
4433
  }
4281
4434
  function HelpButton({ onClick, className = "" }) {
4282
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
4435
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
4283
4436
  "button",
4284
4437
  {
4285
4438
  type: "button",
4286
4439
  onClick,
4287
4440
  className: `flex items-center justify-center w-6 h-16 bg-gray-100 hover:bg-gray-200 border border-gray-200 border-r-0 rounded-l-lg text-gray-600 hover:text-gray-800 transition-all duration-200 shadow-sm ${className}`,
4288
4441
  "aria-label": "Open help",
4289
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.ChevronLeft, { className: "h-4 w-4" })
4442
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.ChevronLeft, { className: "h-4 w-4" })
4290
4443
  }
4291
4444
  );
4292
4445
  }
4293
4446
 
4294
4447
  // src/createKiteChat.tsx
4295
- var import_jsx_runtime10 = require("react/jsx-runtime");
4448
+ var import_jsx_runtime11 = require("react/jsx-runtime");
4296
4449
  function KiteChatWrapper({
4297
4450
  initialConfig,
4298
4451
  onConfigUpdate,
@@ -4329,7 +4482,7 @@ function KiteChatWrapper({
4329
4482
  container.classList.toggle("dark", prefersDark);
4330
4483
  }
4331
4484
  }, [config.theme]);
4332
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
4485
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
4333
4486
  ChatPanelWithToggle,
4334
4487
  {
4335
4488
  isOpen,
@@ -4344,7 +4497,9 @@ function KiteChatWrapper({
4344
4497
  orgId: config.orgId,
4345
4498
  userName: config.userName,
4346
4499
  userEmail: config.userEmail,
4347
- userOrganization: config.userOrganization
4500
+ userOrganization: config.userOrganization,
4501
+ supabaseUrl: config.supabaseUrl,
4502
+ supabaseAnonKey: config.supabaseAnonKey
4348
4503
  }
4349
4504
  );
4350
4505
  }
@@ -4374,7 +4529,7 @@ function createKiteChat(config) {
4374
4529
  }
4375
4530
  root = (0, import_client.createRoot)(containerElement);
4376
4531
  root.render(
4377
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
4532
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
4378
4533
  KiteChatWrapper,
4379
4534
  {
4380
4535
  initialConfig: currentConfig,