@iota-uz/sdk 0.4.9 → 0.4.10

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.
@@ -59,23 +59,25 @@ var init_IotaContext = __esm({
59
59
  IotaContext = React.createContext(null);
60
60
  }
61
61
  });
62
-
63
- // ui/src/bichat/hooks/useTranslation.ts
64
62
  function useTranslation() {
65
63
  const { locale } = useIotaContext();
66
- const t = (key2, params) => {
67
- let text = locale.translations[key2] || key2;
68
- if (params) {
69
- Object.keys(params).forEach((paramKey) => {
70
- const value = params[paramKey];
71
- text = text.replace(new RegExp(`{{${paramKey}}}`, "g"), String(value));
72
- });
73
- }
74
- return text;
75
- };
64
+ const { translations, language } = locale;
65
+ const t = React.useCallback(
66
+ (key2, params) => {
67
+ let text = translations[key2] || key2;
68
+ if (params) {
69
+ Object.keys(params).forEach((paramKey) => {
70
+ const value = params[paramKey];
71
+ text = text.replace(new RegExp(`{{${paramKey}}}`, "g"), String(value));
72
+ });
73
+ }
74
+ return text;
75
+ },
76
+ [translations]
77
+ );
76
78
  return {
77
79
  t,
78
- locale: locale.language
80
+ locale: language
79
81
  };
80
82
  }
81
83
  var init_useTranslation = __esm({
@@ -95,7 +97,7 @@ function ChartCard({ chartData }) {
95
97
  title,
96
98
  ": "
97
99
  ] }),
98
- t("Chart.NoData")
100
+ t("BiChat.Chart.NoData")
99
101
  ] }) });
100
102
  }
101
103
  const apexSeries = chartType === "pie" || chartType === "donut" ? series[0]?.data ?? [] : series.map((s) => ({ name: s.name, data: s.data }));
@@ -171,10 +173,10 @@ function ChartCard({ chartData }) {
171
173
  onClick: handleExportPNG,
172
174
  disabled: isExporting,
173
175
  className: "inline-flex items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-xs font-medium text-gray-400 opacity-0 transition-all duration-150 hover:bg-gray-100 hover:text-gray-600 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 group-hover/chart:opacity-100 disabled:opacity-50 dark:text-gray-500 dark:hover:bg-gray-700 dark:hover:text-gray-300",
174
- title: t("Chart.Download"),
175
- children: isExporting ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-500 dark:text-gray-400", children: t("Chart.Exporting") }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
176
+ title: t("BiChat.Chart.Download"),
177
+ children: isExporting ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-500 dark:text-gray-400", children: t("BiChat.Chart.Exporting") }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
176
178
  /* @__PURE__ */ jsxRuntime.jsx(react.DownloadSimple, { className: "h-3.5 w-3.5", weight: "bold" }),
177
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: t("Chart.DownloadPNG") })
179
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: t("BiChat.Chart.DownloadPNG") })
178
180
  ] })
179
181
  }
180
182
  ) })
@@ -1506,8 +1508,8 @@ function useBranding() {
1506
1508
  appName: customBranding.appName || "BiChat",
1507
1509
  logoUrl: customBranding.logoUrl,
1508
1510
  welcome: {
1509
- title: customBranding.welcome?.title || t("Welcome.Title"),
1510
- description: customBranding.welcome?.description || t("Welcome.Description"),
1511
+ title: customBranding.welcome?.title || t("BiChat.Welcome.Title"),
1512
+ description: customBranding.welcome?.description || t("BiChat.Welcome.Description"),
1511
1513
  examplePrompts
1512
1514
  },
1513
1515
  theme: customBranding.theme
@@ -1523,7 +1525,7 @@ function ChatHeader({ session, onBack, readOnly, logoSlot, actionsSlot }) {
1523
1525
  {
1524
1526
  onClick: onBack,
1525
1527
  className: "cursor-pointer p-2 hover:bg-gray-100 dark:hover:bg-gray-700 active:bg-gray-200 dark:active:bg-gray-600 rounded-lg transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50",
1526
- "aria-label": t("Chat.GoBack"),
1528
+ "aria-label": t("BiChat.Chat.GoBack"),
1527
1529
  children: /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" }) })
1528
1530
  }
1529
1531
  ) : null;
@@ -1533,7 +1535,7 @@ function ChatHeader({ session, onBack, readOnly, logoSlot, actionsSlot }) {
1533
1535
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
1534
1536
  BackButton,
1535
1537
  Logo,
1536
- /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-lg font-semibold text-[var(--bichat-text)]", children: t("Chat.NewChat") })
1538
+ /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-lg font-semibold text-[var(--bichat-text)]", children: t("BiChat.Chat.NewChat") })
1537
1539
  ] }),
1538
1540
  actionsSlot && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2", children: actionsSlot })
1539
1541
  ] }) });
@@ -1549,14 +1551,14 @@ function ChatHeader({ session, onBack, readOnly, logoSlot, actionsSlot }) {
1549
1551
  className: "w-4 h-4 text-[var(--bichat-primary)]",
1550
1552
  fill: "currentColor",
1551
1553
  viewBox: "0 0 20 20",
1552
- "aria-label": t("Chat.Pinned"),
1554
+ "aria-label": t("BiChat.Chat.Pinned"),
1553
1555
  children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M10 2a1 1 0 011 1v1.323l3.954 1.582 1.599-.8a1 1 0 01.894 1.79l-1.233.616 1.738 5.42a1 1 0 01-.285 1.05A3.989 3.989 0 0115 15a3.989 3.989 0 01-2.667-1.019 1 1 0 01-.285-1.05l1.715-5.349L11 6.477V16h2a1 1 0 110 2H7a1 1 0 110-2h2V6.477L6.237 7.582l1.715 5.349a1 1 0 01-.285 1.05A3.989 3.989 0 015 15a3.989 3.989 0 01-2.667-1.019 1 1 0 01-.285-1.05l1.738-5.42-1.233-.617a1 1 0 01.894-1.788l1.599.799L9 4.323V3a1 1 0 011-1z" })
1554
1556
  }
1555
1557
  )
1556
1558
  ] }),
1557
1559
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
1558
- readOnly && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "px-2 py-1 text-xs bg-amber-100 dark:bg-amber-900/30 text-amber-800 dark:text-amber-200 rounded", children: t("Chat.ReadOnly") }),
1559
- session.status === "archived" && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "px-2 py-1 text-xs bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded", children: t("Chat.Archived") }),
1560
+ readOnly && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "px-2 py-1 text-xs bg-amber-100 dark:bg-amber-900/30 text-amber-800 dark:text-amber-200 rounded", children: t("BiChat.Chat.ReadOnly") }),
1561
+ session.status === "archived" && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "px-2 py-1 text-xs bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded", children: t("BiChat.Chat.Archived") }),
1560
1562
  actionsSlot
1561
1563
  ] })
1562
1564
  ] }) });
@@ -1973,6 +1975,7 @@ function AttachmentGrid({
1973
1975
  var MemoizedAttachmentGrid = React__default.default.memo(AttachmentGrid);
1974
1976
  MemoizedAttachmentGrid.displayName = "AttachmentGrid";
1975
1977
  var AttachmentGrid_default = MemoizedAttachmentGrid;
1978
+ init_useTranslation();
1976
1979
  function ImageModal({
1977
1980
  isOpen,
1978
1981
  onClose,
@@ -1981,6 +1984,7 @@ function ImageModal({
1981
1984
  currentIndex = 0,
1982
1985
  onNavigate
1983
1986
  }) {
1987
+ const { t } = useTranslation();
1984
1988
  const [isImageLoaded, setIsImageLoaded] = React.useState(false);
1985
1989
  const [imageError, setImageError] = React.useState(false);
1986
1990
  const [retryKey, setRetryKey] = React.useState(0);
@@ -2033,7 +2037,7 @@ function ImageModal({
2033
2037
  {
2034
2038
  onClick: onClose,
2035
2039
  className: "cursor-pointer flex items-center justify-center w-8 h-8 rounded-md bg-gray-100 hover:bg-gray-200 dark:bg-gray-800 dark:hover:bg-gray-700 text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-400",
2036
- "aria-label": "Close modal",
2040
+ "aria-label": t("BiChat.Image.Close"),
2037
2041
  type: "button",
2038
2042
  children: /* @__PURE__ */ jsxRuntime.jsx(react.X, { size: 18, weight: "bold" })
2039
2043
  }
@@ -2049,11 +2053,11 @@ function ImageModal({
2049
2053
  children: [
2050
2054
  !isImageLoaded && !imageError && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 flex items-center justify-center pointer-events-none", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-3", children: [
2051
2055
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-8 h-8 border-2 border-gray-300 dark:border-gray-700 border-t-gray-500 dark:border-t-gray-400 rounded-full animate-spin" }),
2052
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-gray-400 dark:text-gray-500", children: "Loading" })
2056
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-gray-400 dark:text-gray-500", children: t("BiChat.Loading") })
2053
2057
  ] }) }),
2054
2058
  imageError && /* @__PURE__ */ jsxRuntime.jsxs("div", { role: "alert", className: "flex flex-col items-center justify-center text-center max-w-xs", children: [
2055
2059
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center w-16 h-16 rounded-2xl bg-gray-100 dark:bg-gray-800 border border-gray-200 dark:border-gray-700 mb-5", children: /* @__PURE__ */ jsxRuntime.jsx(react.ImageBroken, { size: 28, className: "text-gray-400 dark:text-gray-500", weight: "duotone" }) }),
2056
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: "Failed to load image" }),
2060
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: t("BiChat.Image.FailedToLoad") }),
2057
2061
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-gray-400 dark:text-gray-500 mb-5 truncate max-w-full", children: attachment.filename }),
2058
2062
  /* @__PURE__ */ jsxRuntime.jsxs(
2059
2063
  "button",
@@ -2061,10 +2065,10 @@ function ImageModal({
2061
2065
  type: "button",
2062
2066
  onClick: handleRetry,
2063
2067
  className: "cursor-pointer inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-200 bg-white dark:bg-gray-800 hover:bg-gray-50 dark:hover:bg-gray-700 border border-gray-200 dark:border-gray-700 rounded-lg transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-400",
2064
- "aria-label": "Retry loading image",
2068
+ "aria-label": t("BiChat.Image.Retry"),
2065
2069
  children: [
2066
2070
  /* @__PURE__ */ jsxRuntime.jsx(react.ArrowClockwise, { size: 16, weight: "bold" }),
2067
- "Retry"
2071
+ t("BiChat.Retry.Label")
2068
2072
  ]
2069
2073
  }
2070
2074
  )
@@ -2098,7 +2102,7 @@ function ImageModal({
2098
2102
  "transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-400",
2099
2103
  canNavigatePrev && isImageLoaded && !imageError ? "cursor-pointer bg-white/90 hover:bg-white dark:bg-gray-800/90 dark:hover:bg-gray-700 text-gray-700 hover:text-gray-900 dark:text-gray-300 dark:hover:text-white shadow-sm" : "bg-white/40 dark:bg-gray-800/40 text-gray-300 dark:text-gray-700 cursor-not-allowed"
2100
2104
  ].join(" "),
2101
- "aria-label": "Previous image",
2105
+ "aria-label": t("BiChat.Image.Previous"),
2102
2106
  type: "button",
2103
2107
  children: /* @__PURE__ */ jsxRuntime.jsx(react.CaretLeft, { size: 20, weight: "bold" })
2104
2108
  }
@@ -2114,7 +2118,7 @@ function ImageModal({
2114
2118
  "transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-400",
2115
2119
  canNavigateNext && isImageLoaded && !imageError ? "cursor-pointer bg-white/90 hover:bg-white dark:bg-gray-800/90 dark:hover:bg-gray-700 text-gray-700 hover:text-gray-900 dark:text-gray-300 dark:hover:text-white shadow-sm" : "bg-white/40 dark:bg-gray-800/40 text-gray-300 dark:text-gray-700 cursor-not-allowed"
2116
2120
  ].join(" "),
2117
- "aria-label": "Next image",
2121
+ "aria-label": t("BiChat.Image.Next"),
2118
2122
  type: "button",
2119
2123
  children: /* @__PURE__ */ jsxRuntime.jsx(react.CaretRight, { size: 20, weight: "bold" })
2120
2124
  }
@@ -2361,7 +2365,7 @@ function UserMessage({
2361
2365
  onClick: handleCopyClick,
2362
2366
  className: `cursor-pointer ${classes.actionButton} ${isCopied ? "text-green-600 dark:text-green-400" : ""}`,
2363
2367
  "aria-label": "Copy message",
2364
- title: isCopied ? t("Message.Copied") : t("Message.Copy"),
2368
+ title: isCopied ? t("BiChat.Message.Copied") : t("BiChat.Message.Copy"),
2365
2369
  children: isCopied ? /* @__PURE__ */ jsxRuntime.jsx(react.Check, { size: 14, weight: "bold" }) : /* @__PURE__ */ jsxRuntime.jsx(react.Copy, { size: 14, weight: "regular" })
2366
2370
  }
2367
2371
  ),
@@ -2603,8 +2607,10 @@ function DownloadCard({ artifact }) {
2603
2607
  }
2604
2608
  );
2605
2609
  }
2610
+ init_useTranslation();
2606
2611
  function InlineQuestionForm({ pendingQuestion }) {
2607
2612
  const { handleSubmitQuestionAnswers, handleRejectPendingQuestion, loading } = useChatMessaging();
2613
+ const { t } = useTranslation();
2608
2614
  const [currentStep, setCurrentStep] = React.useState(0);
2609
2615
  const [answers, setAnswers] = React.useState({});
2610
2616
  const [otherTexts, setOtherTexts] = React.useState({});
@@ -2707,11 +2713,11 @@ function InlineQuestionForm({ pendingQuestion }) {
2707
2713
  const options = currentQuestion.options || [];
2708
2714
  const isOtherSelected = currentAnswer?.customText !== void 0;
2709
2715
  const canProceed = isCurrentAnswerValid();
2710
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "animate-slide-up rounded-2xl border border-primary-200 dark:border-primary-800/50 bg-gradient-to-b from-primary-50/80 to-white dark:from-primary-950/30 dark:to-gray-900/80 shadow-sm overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: handleSubmit, children: [
2716
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "animate-slide-up rounded-2xl border border-gray-200 dark:border-gray-700/50 bg-gradient-to-b from-primary-50/80 to-white dark:from-primary-950/30 dark:to-gray-900/80 shadow-sm overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: handleSubmit, children: [
2711
2717
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2.5 px-4 pt-4 pb-3", children: [
2712
2718
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center w-7 h-7 rounded-lg bg-primary-100 dark:bg-primary-900/40", children: /* @__PURE__ */ jsxRuntime.jsx(react.ChatCircleDots, { className: "w-4 h-4 text-primary-600 dark:text-primary-400", weight: "fill" }) }),
2713
2719
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
2714
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-semibold uppercase tracking-wide text-primary-600 dark:text-primary-400", children: "Input needed" }),
2720
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-semibold uppercase tracking-wide text-primary-600 dark:text-primary-400", children: t("BiChat.InlineQuestion.InputNeeded") }),
2715
2721
  totalSteps > 1 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[11px] tabular-nums text-gray-400 dark:text-gray-500", children: [
2716
2722
  currentStep + 1,
2717
2723
  "/",
@@ -2725,7 +2731,7 @@ function InlineQuestionForm({ pendingQuestion }) {
2725
2731
  onClick: handleRejectPendingQuestion,
2726
2732
  disabled: loading,
2727
2733
  className: "cursor-pointer p-1 rounded-md text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors disabled:opacity-40",
2728
- "aria-label": "Dismiss",
2734
+ "aria-label": t("BiChat.InlineQuestion.Dismiss"),
2729
2735
  children: /* @__PURE__ */ jsxRuntime.jsx(react.X, { size: 16, weight: "bold" })
2730
2736
  }
2731
2737
  )
@@ -2747,7 +2753,7 @@ function InlineQuestionForm({ pendingQuestion }) {
2747
2753
  }) }),
2748
2754
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-4 pb-3", children: [
2749
2755
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[15px] leading-relaxed text-gray-800 dark:text-gray-200", children: currentQuestion.text }),
2750
- isMultiSelect && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-xs text-gray-400 dark:text-gray-500", children: "Select all that apply" })
2756
+ isMultiSelect && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-xs text-gray-400 dark:text-gray-500", children: t("BiChat.InlineQuestion.SelectAllThatApply") })
2751
2757
  ] }),
2752
2758
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-4 pb-2 space-y-1.5", children: [
2753
2759
  options.map((option) => {
@@ -2826,18 +2832,17 @@ function InlineQuestionForm({ pendingQuestion }) {
2826
2832
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: [
2827
2833
  "text-sm transition-colors duration-150",
2828
2834
  isOtherSelected ? "text-gray-900 dark:text-gray-100 font-medium" : "text-gray-700 dark:text-gray-300"
2829
- ].join(" "), children: "Other" })
2835
+ ].join(" "), children: t("BiChat.InlineQuestion.OtherOption") })
2830
2836
  ]
2831
2837
  }
2832
2838
  ),
2833
- isOtherSelected && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pl-8 pr-1 pb-1 animate-slide-up", children: /* @__PURE__ */ jsxRuntime.jsx(
2839
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pl-8 pr-1 pb-1", children: /* @__PURE__ */ jsxRuntime.jsx(
2834
2840
  "input",
2835
2841
  {
2836
2842
  type: "text",
2837
2843
  value: currentOtherText,
2838
2844
  onChange: (e) => handleOtherTextChange(e.target.value),
2839
- placeholder: "Type your answer...",
2840
- autoFocus: true,
2845
+ placeholder: t("BiChat.InlineQuestion.TypeYourAnswer"),
2841
2846
  className: "w-full px-3 py-2 text-sm border border-gray-200 dark:border-gray-700 rounded-lg bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 placeholder:text-gray-400 dark:placeholder:text-gray-500 focus:outline-none focus:ring-2 focus:ring-primary-500/40 focus:border-primary-400 dark:focus:border-primary-600 transition-shadow"
2842
2847
  }
2843
2848
  ) })
@@ -2851,7 +2856,7 @@ function InlineQuestionForm({ pendingQuestion }) {
2851
2856
  className: "cursor-pointer flex items-center gap-1 px-2.5 py-1.5 text-sm text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors",
2852
2857
  children: [
2853
2858
  /* @__PURE__ */ jsxRuntime.jsx(react.ArrowLeft, { size: 14, weight: "bold" }),
2854
- "Back"
2859
+ t("BiChat.InlineQuestion.Back")
2855
2860
  ]
2856
2861
  }
2857
2862
  ) }),
@@ -2866,10 +2871,10 @@ function InlineQuestionForm({ pendingQuestion }) {
2866
2871
  canProceed ? "cursor-pointer bg-primary-600 hover:bg-primary-700 active:bg-primary-800 text-white shadow-sm hover:shadow" : "bg-gray-100 dark:bg-gray-800 text-gray-400 dark:text-gray-600 cursor-not-allowed"
2867
2872
  ].join(" "),
2868
2873
  children: isLastStep ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2869
- "Submit",
2874
+ t("BiChat.Submit"),
2870
2875
  /* @__PURE__ */ jsxRuntime.jsx(react.PaperPlaneTilt, { size: 14, weight: "fill" })
2871
2876
  ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2872
- "Next",
2877
+ t("BiChat.InlineQuestion.Next"),
2873
2878
  /* @__PURE__ */ jsxRuntime.jsx(react.ArrowRight, { size: 14, weight: "bold" })
2874
2879
  ] })
2875
2880
  }
@@ -3038,13 +3043,13 @@ function ToolCard({ tool }) {
3038
3043
  children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-hidden min-h-0", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-3 pb-3 pt-1 space-y-2", children: [
3039
3044
  tool.arguments && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-lg bg-[#1a1b26] dark:bg-gray-950 overflow-hidden ring-1 ring-gray-800/10 dark:ring-white/5", children: [
3040
3045
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between px-3 py-1.5 bg-[#1e1f2e] dark:bg-gray-900/80 border-b border-white/5", children: [
3041
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] uppercase tracking-wider font-medium text-gray-500", children: t("Slash.DebugArguments") }),
3046
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] uppercase tracking-wider font-medium text-gray-500", children: t("BiChat.Slash.DebugArguments") }),
3042
3047
  /* @__PURE__ */ jsxRuntime.jsx(
3043
3048
  CopyPill,
3044
3049
  {
3045
3050
  text: tool.arguments,
3046
- label: t("Slash.DebugCopyTrace"),
3047
- copiedLabel: t("Slash.DebugCopied")
3051
+ label: t("BiChat.Slash.DebugCopyTrace"),
3052
+ copiedLabel: t("BiChat.Slash.DebugCopied")
3048
3053
  }
3049
3054
  )
3050
3055
  ] }),
@@ -3052,20 +3057,20 @@ function ToolCard({ tool }) {
3052
3057
  ] }),
3053
3058
  tool.result && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-lg bg-[#1a1b26] dark:bg-gray-950 overflow-hidden ring-1 ring-gray-800/10 dark:ring-white/5", children: [
3054
3059
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between px-3 py-1.5 bg-[#1e1f2e] dark:bg-gray-900/80 border-b border-white/5", children: [
3055
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] uppercase tracking-wider font-medium text-gray-500", children: t("Slash.DebugResult") }),
3060
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] uppercase tracking-wider font-medium text-gray-500", children: t("BiChat.Slash.DebugResult") }),
3056
3061
  /* @__PURE__ */ jsxRuntime.jsx(
3057
3062
  CopyPill,
3058
3063
  {
3059
3064
  text: tool.result,
3060
- label: t("Slash.DebugCopyTrace"),
3061
- copiedLabel: t("Slash.DebugCopied")
3065
+ label: t("BiChat.Slash.DebugCopyTrace"),
3066
+ copiedLabel: t("BiChat.Slash.DebugCopied")
3062
3067
  }
3063
3068
  )
3064
3069
  ] }),
3065
3070
  /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "p-3 text-[11px] font-mono text-gray-300 overflow-x-auto max-h-60 overflow-y-auto whitespace-pre-wrap break-all leading-relaxed", children: tool.result })
3066
3071
  ] }),
3067
3072
  tool.error && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-lg bg-red-950/80 dark:bg-red-950/40 overflow-hidden ring-1 ring-red-800/20", children: [
3068
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 py-1.5 border-b border-red-800/20", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] uppercase tracking-wider font-medium text-red-400", children: t("Slash.DebugError") }) }),
3073
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 py-1.5 border-b border-red-800/20", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] uppercase tracking-wider font-medium text-red-400", children: t("BiChat.Slash.DebugError") }) }),
3069
3074
  /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "p-3 text-[11px] font-mono text-red-300 overflow-x-auto whitespace-pre-wrap break-all leading-relaxed", children: tool.error })
3070
3075
  ] })
3071
3076
  ] }) })
@@ -3085,7 +3090,7 @@ function DebugPanel({ trace }) {
3085
3090
  metrics.push({
3086
3091
  icon: /* @__PURE__ */ jsxRuntime.jsx(react.Timer, { size: 14, weight: "duotone", className: "text-amber-600 dark:text-amber-400" }),
3087
3092
  value: formatGenerationDuration(trace.generationMs),
3088
- label: t("Slash.DebugGeneration"),
3093
+ label: t("BiChat.Slash.DebugGeneration"),
3089
3094
  accentBorder: "border-l-amber-400 dark:border-l-amber-500",
3090
3095
  accentBg: "bg-amber-50 dark:bg-amber-950/30"
3091
3096
  });
@@ -3094,7 +3099,7 @@ function DebugPanel({ trace }) {
3094
3099
  metrics.push({
3095
3100
  icon: /* @__PURE__ */ jsxRuntime.jsx(react.Lightning, { size: 14, weight: "fill", className: "text-orange-500 dark:text-orange-400" }),
3096
3101
  value: `${tokensPerSecond.toFixed(1)}/s`,
3097
- label: t("Slash.DebugTokensPerSecond"),
3102
+ label: t("BiChat.Slash.DebugTokensPerSecond"),
3098
3103
  accentBorder: "border-l-orange-400 dark:border-l-orange-500",
3099
3104
  accentBg: "bg-orange-50 dark:bg-orange-950/30"
3100
3105
  });
@@ -3104,21 +3109,21 @@ function DebugPanel({ trace }) {
3104
3109
  {
3105
3110
  icon: /* @__PURE__ */ jsxRuntime.jsx(react.Stack, { size: 14, weight: "duotone", className: "text-violet-600 dark:text-violet-400" }),
3106
3111
  value: trace.usage.totalTokens.toLocaleString(),
3107
- label: t("Slash.DebugTotalTokens"),
3112
+ label: t("BiChat.Slash.DebugTotalTokens"),
3108
3113
  accentBorder: "border-l-violet-400 dark:border-l-violet-500",
3109
3114
  accentBg: "bg-violet-50 dark:bg-violet-950/30"
3110
3115
  },
3111
3116
  {
3112
3117
  icon: /* @__PURE__ */ jsxRuntime.jsx(react.ArrowUp, { size: 14, weight: "bold", className: "text-blue-600 dark:text-blue-400" }),
3113
3118
  value: trace.usage.promptTokens.toLocaleString(),
3114
- label: t("Slash.DebugPromptTokens"),
3119
+ label: t("BiChat.Slash.DebugPromptTokens"),
3115
3120
  accentBorder: "border-l-blue-400 dark:border-l-blue-500",
3116
3121
  accentBg: "bg-blue-50 dark:bg-blue-950/30"
3117
3122
  },
3118
3123
  {
3119
3124
  icon: /* @__PURE__ */ jsxRuntime.jsx(react.ArrowDown, { size: 14, weight: "bold", className: "text-indigo-600 dark:text-indigo-400" }),
3120
3125
  value: trace.usage.completionTokens.toLocaleString(),
3121
- label: t("Slash.DebugCompletionTokens"),
3126
+ label: t("BiChat.Slash.DebugCompletionTokens"),
3122
3127
  accentBorder: "border-l-indigo-400 dark:border-l-indigo-500",
3123
3128
  accentBg: "bg-indigo-50 dark:bg-indigo-950/30"
3124
3129
  }
@@ -3127,7 +3132,7 @@ function DebugPanel({ trace }) {
3127
3132
  metrics.push({
3128
3133
  icon: /* @__PURE__ */ jsxRuntime.jsx(react.Database, { size: 14, weight: "duotone", className: "text-pink-600 dark:text-pink-400" }),
3129
3134
  value: trace.usage.cachedTokens.toLocaleString(),
3130
- label: t("Slash.DebugCachedTokens"),
3135
+ label: t("BiChat.Slash.DebugCachedTokens"),
3131
3136
  accentBorder: "border-l-pink-400 dark:border-l-pink-500",
3132
3137
  accentBg: "bg-pink-50 dark:bg-pink-950/30"
3133
3138
  });
@@ -3138,14 +3143,14 @@ function DebugPanel({ trace }) {
3138
3143
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mb-4", children: [
3139
3144
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2.5", children: [
3140
3145
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center w-6 h-6 rounded-lg bg-gray-100 dark:bg-gray-800", children: /* @__PURE__ */ jsxRuntime.jsx(react.Bug, { size: 14, weight: "duotone", className: "text-gray-500 dark:text-gray-400" }) }),
3141
- /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-[11px] uppercase tracking-widest font-semibold text-gray-400 dark:text-gray-500", children: t("Slash.DebugPanelTitle") })
3146
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-[11px] uppercase tracking-widest font-semibold text-gray-400 dark:text-gray-500", children: t("BiChat.Slash.DebugPanelTitle") })
3142
3147
  ] }),
3143
3148
  hasData && trace && /* @__PURE__ */ jsxRuntime.jsx(
3144
3149
  CopyPill,
3145
3150
  {
3146
3151
  text: JSON.stringify(trace, null, 2),
3147
- label: t("Slash.DebugCopyTrace"),
3148
- copiedLabel: t("Slash.DebugCopied")
3152
+ label: t("BiChat.Slash.DebugCopyTrace"),
3153
+ copiedLabel: t("BiChat.Slash.DebugCopied")
3149
3154
  }
3150
3155
  )
3151
3156
  ] }),
@@ -3154,12 +3159,12 @@ function DebugPanel({ trace }) {
3154
3159
  trace.tools.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
3155
3160
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 mb-2.5", children: [
3156
3161
  /* @__PURE__ */ jsxRuntime.jsx(react.Wrench, { size: 13, weight: "duotone", className: "text-gray-400 dark:text-gray-500" }),
3157
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[11px] font-medium text-gray-500 dark:text-gray-400", children: t("Slash.DebugToolCalls") }),
3162
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[11px] font-medium text-gray-500 dark:text-gray-400", children: t("BiChat.Slash.DebugToolCalls") }),
3158
3163
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "px-1.5 py-0.5 rounded-full bg-gray-100 dark:bg-gray-800 text-[10px] font-mono font-medium text-gray-500 dark:text-gray-400 tabular-nums", children: trace.tools.length })
3159
3164
  ] }),
3160
3165
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-1.5", children: trace.tools.map((tool, idx) => /* @__PURE__ */ jsxRuntime.jsx(ToolCard, { tool }, `${tool.callId || tool.name}-${idx}`)) })
3161
3166
  ] })
3162
- ] }) : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-gray-400 dark:text-gray-500 italic", children: t("Slash.DebugUnavailable") })
3167
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-gray-400 dark:text-gray-500 italic", children: t("BiChat.Slash.DebugUnavailable") })
3163
3168
  ] });
3164
3169
  }
3165
3170
 
@@ -3365,7 +3370,7 @@ function AssistantMessage({
3365
3370
  )
3366
3371
  }
3367
3372
  ),
3368
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: t("Assistant.Explanation") })
3373
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: t("BiChat.Assistant.Explanation") })
3369
3374
  ]
3370
3375
  }
3371
3376
  ),
@@ -3391,7 +3396,7 @@ function AssistantMessage({
3391
3396
  onClick: handleCopyClick,
3392
3397
  className: `cursor-pointer ${classes.actionButton} ${isCopied ? "text-green-600 dark:text-green-400" : ""}`,
3393
3398
  "aria-label": "Copy message",
3394
- title: isCopied ? t("Message.Copied") : t("Message.Copy"),
3399
+ title: isCopied ? t("BiChat.Message.Copied") : t("BiChat.Message.Copy"),
3395
3400
  children: isCopied ? /* @__PURE__ */ jsxRuntime.jsx(react.Check, { size: 14, weight: "bold" }) : /* @__PURE__ */ jsxRuntime.jsx(react.Copy, { size: 14, weight: "regular" })
3396
3401
  }
3397
3402
  ),
@@ -3485,7 +3490,7 @@ function SystemMessage({
3485
3490
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 px-4 pt-3 pb-2", children: [
3486
3491
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5 text-gray-400 dark:text-gray-500", children: [
3487
3492
  /* @__PURE__ */ jsxRuntime.jsx(react.ClockCounterClockwise, { size: 13, weight: "bold" }),
3488
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[11px] font-semibold uppercase tracking-wider", children: t("System.ConversationSummary") })
3493
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[11px] font-semibold uppercase tracking-wider", children: t("BiChat.System.ConversationSummary") })
3489
3494
  ] }),
3490
3495
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1" }),
3491
3496
  !hideActions && !hideTimestamp && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[11px] text-gray-400 dark:text-gray-500 tabular-nums", children: timestamp }),
@@ -3499,7 +3504,7 @@ function SystemMessage({
3499
3504
  ${isCopied ? "text-green-600 dark:text-green-400" : "text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-300 hover:bg-gray-200/50 dark:hover:bg-gray-700/40"}
3500
3505
  `,
3501
3506
  "aria-label": "Copy message",
3502
- title: isCopied ? t("Message.Copied") : t("Message.Copy"),
3507
+ title: isCopied ? t("BiChat.Message.Copied") : t("BiChat.Message.Copy"),
3503
3508
  children: isCopied ? /* @__PURE__ */ jsxRuntime.jsx(react.Check, { size: 13, weight: "bold" }) : /* @__PURE__ */ jsxRuntime.jsx(react.Copy, { size: 13, weight: "regular" })
3504
3509
  }
3505
3510
  )
@@ -3517,7 +3522,7 @@ function SystemMessage({
3517
3522
  {
3518
3523
  fallback: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 text-sm text-gray-400 dark:text-gray-500 py-2", children: [
3519
3524
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-3.5 h-3.5 border-[1.5px] border-gray-300 dark:border-gray-600 border-t-transparent rounded-full animate-spin" }),
3520
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs", children: t("System.LoadingSummary") })
3525
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs", children: t("BiChat.System.LoadingSummary") })
3521
3526
  ] }),
3522
3527
  children: /* @__PURE__ */ jsxRuntime.jsx(MarkdownRenderer3, { content, sendDisabled: true })
3523
3528
  }
@@ -3534,7 +3539,7 @@ function SystemMessage({
3534
3539
  "aria-expanded": isExpanded,
3535
3540
  className: "cursor-pointer group/toggle inline-flex items-center gap-1 px-3 py-1 rounded-full text-[11px] font-medium text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 hover:bg-gray-200/60 dark:hover:bg-gray-700/50 transition-colors duration-150",
3536
3541
  children: [
3537
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: isExpanded ? t("System.ShowLess") : t("System.ShowMore") }),
3542
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: isExpanded ? t("BiChat.System.ShowLess") : t("BiChat.System.ShowMore") }),
3538
3543
  /* @__PURE__ */ jsxRuntime.jsx(
3539
3544
  react.CaretDown,
3540
3545
  {
@@ -3898,13 +3903,16 @@ var errorMessageVariants = {
3898
3903
  }
3899
3904
  }
3900
3905
  };
3901
- var DEFAULT_VERBS = [
3902
- "Thinking",
3903
- "Processing",
3904
- "Analyzing",
3905
- "Synthesizing",
3906
- "Computing",
3907
- "Working on it"
3906
+
3907
+ // ui/src/bichat/components/TypingIndicator.tsx
3908
+ init_useTranslation();
3909
+ var THINKING_KEYS = [
3910
+ "BiChat.Thinking.Thinking",
3911
+ "BiChat.Thinking.Processing",
3912
+ "BiChat.Thinking.Analyzing",
3913
+ "BiChat.Thinking.Synthesizing",
3914
+ "BiChat.Thinking.Computing",
3915
+ "BiChat.Thinking.WorkingOnIt"
3908
3916
  ];
3909
3917
  var prefersReducedMotion2 = () => {
3910
3918
  if (typeof window === "undefined") return false;
@@ -3918,10 +3926,15 @@ var getRandomVerb = (verbs, current) => {
3918
3926
  return available[Math.floor(Math.random() * available.length)];
3919
3927
  };
3920
3928
  function TypingIndicator({
3921
- verbs = DEFAULT_VERBS,
3929
+ verbs: verbsProp,
3922
3930
  rotationInterval = 3e3,
3923
3931
  className = ""
3924
3932
  }) {
3933
+ const { t } = useTranslation();
3934
+ const verbs = React.useMemo(() => {
3935
+ if (verbsProp) return verbsProp;
3936
+ return THINKING_KEYS.map((key2) => t(key2));
3937
+ }, [verbsProp, t]);
3925
3938
  const [verb, setVerb] = React.useState(() => verbs[Math.floor(Math.random() * verbs.length)]);
3926
3939
  React.useEffect(() => {
3927
3940
  if (prefersReducedMotion2()) return;
@@ -4106,8 +4119,8 @@ function MessageList({ renderUserTurn, renderAssistantTurn, thinkingVerbs, readO
4106
4119
  isCompacting && /* @__PURE__ */ jsxRuntime.jsx(
4107
4120
  CompactionDoodle_default,
4108
4121
  {
4109
- title: t("Slash.CompactingTitle"),
4110
- subtitle: t("Slash.CompactingSubtitle")
4122
+ title: t("BiChat.Slash.CompactingTitle"),
4123
+ subtitle: t("BiChat.Slash.CompactingSubtitle")
4111
4124
  }
4112
4125
  ),
4113
4126
  fetching && turns.length === 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", "aria-hidden": "true", children: [
@@ -4208,7 +4221,7 @@ var MessageInput = React.forwardRef(
4208
4221
  const [dropSuccess, setDropSuccess] = React.useState(false);
4209
4222
  const [pendingFileCount, setPendingFileCount] = React.useState(0);
4210
4223
  const [viewingImageIndex, setViewingImageIndex] = React.useState(null);
4211
- const placeholder = placeholderOverride || t("Input.Placeholder");
4224
+ const placeholder = placeholderOverride || t("BiChat.Input.Placeholder");
4212
4225
  const textareaRef = React.useRef(null);
4213
4226
  const fileInputRef = React.useRef(null);
4214
4227
  const containerRef = React.useRef(null);
@@ -4219,9 +4232,9 @@ var MessageInput = React.forwardRef(
4219
4232
  const commandQuery = message.trimStart().slice(1).split(/\s+/)[0]?.toLowerCase() || "";
4220
4233
  const slashCommands = React.useMemo(
4221
4234
  () => [
4222
- { name: "/clear", description: t("Slash.ClearDescription") },
4223
- { name: "/debug", description: t("Slash.DebugDescription") },
4224
- { name: "/compact", description: t("Slash.CompactDescription") }
4235
+ { name: "/clear", description: t("BiChat.Slash.ClearDescription") },
4236
+ { name: "/debug", description: t("BiChat.Slash.DebugDescription") },
4237
+ { name: "/compact", description: t("BiChat.Slash.CompactDescription") }
4225
4238
  ],
4226
4239
  [t]
4227
4240
  );
@@ -4511,12 +4524,12 @@ var MessageInput = React.forwardRef(
4511
4524
  onClearCommandError?.();
4512
4525
  },
4513
4526
  className: "cursor-pointer ml-2 p-1 hover:bg-red-100 dark:hover:bg-red-800 rounded transition-colors",
4514
- "aria-label": t("Input.DismissError"),
4527
+ "aria-label": t("BiChat.Input.DismissError"),
4515
4528
  children: /* @__PURE__ */ jsxRuntime.jsx(react.X, { size: 14 })
4516
4529
  }
4517
4530
  )
4518
4531
  ] }),
4519
- messageQueue.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-3 text-xs text-gray-500 dark:text-gray-400", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "px-2.5 py-1 bg-primary-50 dark:bg-primary-900/30 text-primary-600 dark:text-primary-400 rounded font-medium", children: t("Input.MessagesQueued", { count: messageQueue.length }) }) }),
4532
+ messageQueue.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-3 text-xs text-gray-500 dark:text-gray-400", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "px-2.5 py-1 bg-primary-50 dark:bg-primary-900/30 text-primary-600 dark:text-primary-400 rounded font-medium", children: t("BiChat.Input.MessagesQueued", { count: messageQueue.length }) }) }),
4520
4533
  debugMode && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-3 space-y-2 text-xs", children: [
4521
4534
  /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex items-center gap-1.5 px-2.5 py-1 bg-amber-100 dark:bg-amber-900/40 text-amber-700 dark:text-amber-300 rounded-full font-medium text-[11px]", children: [
4522
4535
  /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "relative flex h-1.5 w-1.5", "aria-hidden": "true", children: [
@@ -4524,49 +4537,49 @@ var MessageInput = React.forwardRef(
4524
4537
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "relative inline-flex rounded-full h-1.5 w-1.5 bg-amber-500" })
4525
4538
  ] }),
4526
4539
  /* @__PURE__ */ jsxRuntime.jsx(react.Bug, { size: 12 }),
4527
- t("Slash.DebugBadge")
4540
+ t("BiChat.Slash.DebugBadge")
4528
4541
  ] }),
4529
4542
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-xl border border-gray-200/60 dark:border-gray-700/40 bg-gray-50/50 dark:bg-gray-800/30 p-3 space-y-3", children: [
4530
4543
  hasUsage ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-3 gap-1.5", children: [
4531
4544
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-1 py-2 rounded-lg bg-white dark:bg-gray-800/60 border border-gray-100 dark:border-gray-700/30", children: [
4532
4545
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1 text-[10px] text-gray-400 dark:text-gray-500", children: [
4533
4546
  /* @__PURE__ */ jsxRuntime.jsx(react.ArrowUp, { size: 10, weight: "bold", className: "text-blue-500 dark:text-blue-400" }),
4534
- t("Slash.DebugPromptTokens")
4547
+ t("BiChat.Slash.DebugPromptTokens")
4535
4548
  ] }),
4536
4549
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-mono font-semibold text-xs text-gray-900 dark:text-gray-100 tabular-nums", children: formatTokens(sessionPromptTokens) })
4537
4550
  ] }),
4538
4551
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-1 py-2 rounded-lg bg-white dark:bg-gray-800/60 border border-gray-100 dark:border-gray-700/30", children: [
4539
4552
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1 text-[10px] text-gray-400 dark:text-gray-500", children: [
4540
4553
  /* @__PURE__ */ jsxRuntime.jsx(react.ArrowDown, { size: 10, weight: "bold", className: "text-indigo-500 dark:text-indigo-400" }),
4541
- t("Slash.DebugCompletionTokens")
4554
+ t("BiChat.Slash.DebugCompletionTokens")
4542
4555
  ] }),
4543
4556
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-mono font-semibold text-xs text-gray-900 dark:text-gray-100 tabular-nums", children: formatTokens(sessionCompletionTokens) })
4544
4557
  ] }),
4545
4558
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-1 py-2 rounded-lg bg-white dark:bg-gray-800/60 border border-gray-100 dark:border-gray-700/30", children: [
4546
4559
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1 text-[10px] text-gray-400 dark:text-gray-500", children: [
4547
4560
  /* @__PURE__ */ jsxRuntime.jsx(react.Stack, { size: 10, weight: "bold", className: "text-violet-500 dark:text-violet-400" }),
4548
- t("Slash.DebugTotalTokens")
4561
+ t("BiChat.Slash.DebugTotalTokens")
4549
4562
  ] }),
4550
4563
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-mono font-semibold text-xs text-gray-900 dark:text-gray-100 tabular-nums", children: formatTokens(sessionTotalTokens) })
4551
4564
  ] })
4552
- ] }) : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[11px] text-gray-400 dark:text-gray-500 text-center py-1", children: t("Slash.DebugSessionUsageUnavailable") }),
4565
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[11px] text-gray-400 dark:text-gray-500 text-center py-1", children: t("BiChat.Slash.DebugSessionUsageUnavailable") }),
4553
4566
  debugLimits && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-3 gap-1.5", children: [
4554
4567
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1 py-2 px-2 rounded-lg bg-white dark:bg-gray-800/60 border border-gray-100 dark:border-gray-700/30", children: [
4555
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-gray-400 dark:text-gray-500", children: t("Slash.DebugPolicyMaxContextWindow") }),
4568
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-gray-400 dark:text-gray-500", children: t("BiChat.Slash.DebugPolicyMaxContextWindow") }),
4556
4569
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-mono font-semibold text-xs text-gray-900 dark:text-gray-100 tabular-nums", children: formatTokens(policyMaxTokens) })
4557
4570
  ] }),
4558
4571
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1 py-2 px-2 rounded-lg bg-white dark:bg-gray-800/60 border border-gray-100 dark:border-gray-700/30", children: [
4559
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-gray-400 dark:text-gray-500", children: t("Slash.DebugModelMaxContextWindow") }),
4572
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-gray-400 dark:text-gray-500", children: t("BiChat.Slash.DebugModelMaxContextWindow") }),
4560
4573
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-mono font-semibold text-xs text-gray-900 dark:text-gray-100 tabular-nums", children: formatTokens(modelMaxTokens) })
4561
4574
  ] }),
4562
4575
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1 py-2 px-2 rounded-lg bg-white dark:bg-gray-800/60 border border-gray-100 dark:border-gray-700/30", children: [
4563
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-gray-400 dark:text-gray-500", children: t("Slash.DebugEffectiveContextWindow") }),
4576
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-gray-400 dark:text-gray-500", children: t("BiChat.Slash.DebugEffectiveContextWindow") }),
4564
4577
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-mono font-semibold text-xs text-gray-900 dark:text-gray-100 tabular-nums", children: formatTokens(effectiveMaxTokens) })
4565
4578
  ] })
4566
4579
  ] }),
4567
4580
  effectiveMaxTokens > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
4568
4581
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
4569
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-gray-400 dark:text-gray-500", children: t("Slash.DebugContextUsage") }),
4582
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-gray-400 dark:text-gray-500", children: t("BiChat.Slash.DebugContextUsage") }),
4570
4583
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
4571
4584
  /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "font-mono text-[10px] text-gray-400 dark:text-gray-500 tabular-nums", children: [
4572
4585
  formatTokens(latestPromptTokens),
@@ -4616,9 +4629,9 @@ var MessageInput = React.forwardRef(
4616
4629
  children: [
4617
4630
  isDragging && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 z-10 bg-primary-50/95 dark:bg-primary-900/90 border-2 border-dashed border-primary-400 rounded-2xl flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-2", children: [
4618
4631
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-10 h-10 rounded-full bg-primary-100 dark:bg-primary-800 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(react.Paperclip, { size: 20, className: "text-primary-600 dark:text-primary-400" }) }),
4619
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-primary-700 dark:text-primary-300 font-medium", children: t("Input.DropFiles") })
4632
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-primary-700 dark:text-primary-300 font-medium", children: t("BiChat.Input.DropFiles") })
4620
4633
  ] }) }),
4621
- dropSuccess && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 z-10 bg-green-50/95 dark:bg-green-900/90 border-2 border-green-400 rounded-2xl flex items-center justify-center animate-pulse pointer-events-none", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-green-700 dark:text-green-300 font-medium", children: t("Input.FilesAdded") }) }),
4634
+ dropSuccess && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 z-10 bg-green-50/95 dark:bg-green-900/90 border-2 border-green-400 rounded-2xl flex items-center justify-center animate-pulse pointer-events-none", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-green-700 dark:text-green-300 font-medium", children: t("BiChat.Input.FilesAdded") }) }),
4622
4635
  /* @__PURE__ */ jsxRuntime.jsxs(
4623
4636
  "div",
4624
4637
  {
@@ -4631,8 +4644,8 @@ var MessageInput = React.forwardRef(
4631
4644
  onClick: () => fileInputRef.current?.click(),
4632
4645
  disabled: loading || disabled || attachments.length >= maxFiles,
4633
4646
  className: "cursor-pointer flex-shrink-0 self-center p-2 text-gray-500 dark:text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors disabled:opacity-40 disabled:cursor-not-allowed",
4634
- "aria-label": t("Input.AttachFiles"),
4635
- title: t("Input.AttachFiles"),
4647
+ "aria-label": t("BiChat.Input.AttachFiles"),
4648
+ title: t("BiChat.Input.AttachFiles"),
4636
4649
  children: /* @__PURE__ */ jsxRuntime.jsx(react.Paperclip, { size: 20 })
4637
4650
  }
4638
4651
  ),
@@ -4645,7 +4658,7 @@ var MessageInput = React.forwardRef(
4645
4658
  multiple: true,
4646
4659
  onChange: handleFileInputChange,
4647
4660
  className: "hidden",
4648
- "aria-label": t("Input.FileInput")
4661
+ "aria-label": t("BiChat.Input.FileInput")
4649
4662
  }
4650
4663
  ),
4651
4664
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 self-stretch flex items-center", children: /* @__PURE__ */ jsxRuntime.jsx(
@@ -4675,7 +4688,7 @@ var MessageInput = React.forwardRef(
4675
4688
  rows: 1,
4676
4689
  disabled: loading || disabled,
4677
4690
  "aria-busy": loading,
4678
- "aria-label": t("Input.MessageInput")
4691
+ "aria-label": t("BiChat.Input.MessageInput")
4679
4692
  }
4680
4693
  ) }),
4681
4694
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -4684,15 +4697,15 @@ var MessageInput = React.forwardRef(
4684
4697
  type: "submit",
4685
4698
  disabled: !canSubmit,
4686
4699
  className: "cursor-pointer flex-shrink-0 self-center p-2 rounded-lg bg-primary-600 hover:bg-primary-700 active:bg-primary-800 active:scale-95 text-white shadow-sm transition-all disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-primary-600",
4687
- "aria-label": loading ? t("Input.Processing") : t("Input.SendMessage"),
4700
+ "aria-label": loading ? t("BiChat.Input.Processing") : t("BiChat.Input.SendMessage"),
4688
4701
  children: loading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-[18px] h-[18px] border-2 border-white/60 border-t-transparent rounded-full animate-spin" }) : /* @__PURE__ */ jsxRuntime.jsx(react.PaperPlaneRight, { size: 18, weight: "fill" })
4689
4702
  }
4690
4703
  )
4691
4704
  ]
4692
4705
  }
4693
4706
  ),
4694
- isFocused && !message && !loading && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "hidden sm:block absolute -bottom-5 left-14 text-[10px] text-gray-400 dark:text-gray-500 select-none animate-fade-in", children: t("Input.ShiftEnterHint") }),
4695
- isCommandListVisible && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute left-0 right-0 bottom-full mb-1.5 z-20 overflow-hidden rounded-lg border border-gray-200/70 bg-white/98 shadow-md backdrop-blur-xl dark:border-gray-700/70 dark:bg-gray-900/98 dark:shadow-black/20", children: filteredCommands.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("ul", { role: "listbox", "aria-label": t("Slash.CommandsList"), className: "py-1 px-1", children: filteredCommands.map((command, index) => {
4707
+ isFocused && !message && !loading && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "hidden sm:block absolute -bottom-5 left-14 text-[10px] text-gray-400 dark:text-gray-500 select-none animate-fade-in", children: t("BiChat.Input.ShiftEnterHint") }),
4708
+ isCommandListVisible && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute left-0 right-0 bottom-full mb-1.5 z-20 overflow-hidden rounded-lg border border-gray-200/70 bg-white/98 shadow-md backdrop-blur-xl dark:border-gray-700/70 dark:bg-gray-900/98 dark:shadow-black/20", children: filteredCommands.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("ul", { role: "listbox", "aria-label": t("BiChat.Slash.CommandsList"), className: "py-1 px-1", children: filteredCommands.map((command, index) => {
4696
4709
  const isActive = index === activeCommandIndex;
4697
4710
  return /* @__PURE__ */ jsxRuntime.jsxs(
4698
4711
  "li",
@@ -4718,7 +4731,7 @@ var MessageInput = React.forwardRef(
4718
4731
  },
4719
4732
  command.name
4720
4733
  );
4721
- }) }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 py-2.5 text-center", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[11px] text-gray-400 dark:text-gray-500", children: t("Slash.NoMatches") }) }) })
4734
+ }) }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 py-2.5 text-center", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[11px] text-gray-400 dark:text-gray-500", children: t("BiChat.Slash.NoMatches") }) }) })
4722
4735
  ]
4723
4736
  }
4724
4737
  ),
@@ -4742,37 +4755,25 @@ MessageInput.displayName = "MessageInput";
4742
4755
 
4743
4756
  // ui/src/bichat/components/WelcomeContent.tsx
4744
4757
  init_useTranslation();
4745
- var EXAMPLE_PROMPTS = [
4746
- {
4747
- category: "Data Analysis",
4748
- icon: react.ChartBar,
4749
- text: "Show me sales trends for the last quarter"
4750
- },
4751
- {
4752
- category: "Reports",
4753
- icon: react.FileText,
4754
- text: "Generate a summary of customer feedback"
4755
- },
4756
- {
4757
- category: "Insights",
4758
- icon: react.Lightbulb,
4759
- text: "What are the top performing products?"
4760
- }
4758
+ var PROMPT_DEFS = [
4759
+ { categoryKey: "Welcome.Prompt1Category", textKey: "Welcome.Prompt1Text", icon: react.ChartBar, defaultCategory: "OSAGO Portfolio", defaultText: "What is the total amount of accrued OSAGO premiums for the reporting period?" },
4760
+ { categoryKey: "Welcome.Prompt2Category", textKey: "Welcome.Prompt2Text", icon: react.FileText, defaultCategory: "Regional Analysis", defaultText: "Show me the top 5 regions by collected insurance premiums" },
4761
+ { categoryKey: "Welcome.Prompt3Category", textKey: "Welcome.Prompt3Text", icon: react.Lightbulb, defaultCategory: "Loss Analysis", defaultText: "Calculate the loss ratio across the entire OSAGO portfolio" }
4761
4762
  ];
4762
- var CATEGORY_STYLES = {
4763
- "Data Analysis": {
4763
+ var PROMPT_STYLES = [
4764
+ {
4764
4765
  badge: "bg-sky-50 text-sky-600 ring-sky-600/10 dark:bg-sky-400/10 dark:text-sky-400 dark:ring-sky-400/20",
4765
4766
  icon: "text-sky-500 dark:text-sky-400"
4766
4767
  },
4767
- Reports: {
4768
+ {
4768
4769
  badge: "bg-teal-50 text-teal-600 ring-teal-600/10 dark:bg-teal-400/10 dark:text-teal-400 dark:ring-teal-400/20",
4769
4770
  icon: "text-teal-500 dark:text-teal-400"
4770
4771
  },
4771
- Insights: {
4772
+ {
4772
4773
  badge: "bg-amber-50 text-amber-600 ring-amber-600/10 dark:bg-amber-400/10 dark:text-amber-400 dark:ring-amber-400/20",
4773
4774
  icon: "text-amber-500 dark:text-amber-400"
4774
4775
  }
4775
- };
4776
+ ];
4776
4777
  var containerVariants = {
4777
4778
  hidden: { opacity: 0 },
4778
4779
  visible: {
@@ -4814,6 +4815,10 @@ var reducedItemVariants = {
4814
4815
  }
4815
4816
  }
4816
4817
  };
4818
+ function tOr(t, key2, defaultValue) {
4819
+ const v = t(key2);
4820
+ return v !== key2 ? v : defaultValue;
4821
+ }
4817
4822
  function WelcomeContent({
4818
4823
  onPromptSelect,
4819
4824
  title,
@@ -4822,8 +4827,13 @@ function WelcomeContent({
4822
4827
  }) {
4823
4828
  const { t } = useTranslation();
4824
4829
  const shouldReduceMotion = framerMotion.useReducedMotion();
4825
- const resolvedTitle = title || t("Welcome.Title");
4826
- const resolvedDescription = description || t("Welcome.Description");
4830
+ const resolvedTitle = title || "";
4831
+ const resolvedDescription = description || "";
4832
+ const prompts = PROMPT_DEFS.map((def) => ({
4833
+ category: tOr(t, def.categoryKey, def.defaultCategory),
4834
+ text: tOr(t, def.textKey, def.defaultText),
4835
+ icon: def.icon
4836
+ }));
4827
4837
  const handlePromptClick = (prompt) => {
4828
4838
  if (onPromptSelect && !disabled) {
4829
4839
  onPromptSelect(prompt);
@@ -4839,15 +4849,7 @@ function WelcomeContent({
4839
4849
  initial: "hidden",
4840
4850
  animate: "visible",
4841
4851
  children: [
4842
- /* @__PURE__ */ jsxRuntime.jsx(
4843
- "div",
4844
- {
4845
- className: "pointer-events-none absolute inset-x-0 -top-8 flex justify-center overflow-hidden h-56",
4846
- "aria-hidden": true,
4847
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-[420px] h-[260px] -mt-16 rounded-full bg-primary-300/[0.08] blur-[80px] dark:bg-primary-400/[0.05]" })
4848
- }
4849
- ),
4850
- /* @__PURE__ */ jsxRuntime.jsx(
4852
+ resolvedTitle && /* @__PURE__ */ jsxRuntime.jsx(
4851
4853
  framerMotion.motion.h1,
4852
4854
  {
4853
4855
  className: "relative text-2xl sm:text-3xl font-semibold text-gray-900 dark:text-white mb-4",
@@ -4855,7 +4857,7 @@ function WelcomeContent({
4855
4857
  children: resolvedTitle
4856
4858
  }
4857
4859
  ),
4858
- /* @__PURE__ */ jsxRuntime.jsx(
4860
+ resolvedDescription && /* @__PURE__ */ jsxRuntime.jsx(
4859
4861
  framerMotion.motion.p,
4860
4862
  {
4861
4863
  className: "text-base text-gray-500 dark:text-gray-400 mb-10 max-w-2xl mx-auto leading-relaxed",
@@ -4866,11 +4868,11 @@ function WelcomeContent({
4866
4868
  /* @__PURE__ */ jsxRuntime.jsxs(framerMotion.motion.div, { variants: activeItemVariants, children: [
4867
4869
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-4 mb-5", children: [
4868
4870
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-px flex-1 bg-gradient-to-r from-transparent to-gray-200 dark:to-gray-700/70" }),
4869
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[11px] font-semibold uppercase tracking-[0.12em] text-gray-400 dark:text-gray-500 select-none", children: t("Welcome.QuickStart") }),
4871
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[11px] font-semibold uppercase tracking-[0.12em] text-gray-400 dark:text-gray-500 select-none", children: t("BiChat.Welcome.QuickStart") }),
4870
4872
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-px flex-1 bg-gradient-to-l from-transparent to-gray-200 dark:to-gray-700/70" })
4871
4873
  ] }),
4872
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-3", children: EXAMPLE_PROMPTS.map((prompt, index) => {
4873
- const style = CATEGORY_STYLES[prompt.category];
4874
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-3", children: prompts.map((prompt, index) => {
4875
+ const style = PROMPT_STYLES[index];
4874
4876
  return /* @__PURE__ */ jsxRuntime.jsxs(
4875
4877
  framerMotion.motion.button,
4876
4878
  {
@@ -5000,8 +5002,8 @@ function SessionArtifactList({
5000
5002
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-full flex-col items-center justify-center gap-3 px-4 py-12 text-center", children: [
5001
5003
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-12 w-12 items-center justify-center rounded-xl bg-gray-100 dark:bg-gray-800", children: /* @__PURE__ */ jsxRuntime.jsx(react.Package, { className: "h-6 w-6 text-gray-400 dark:text-gray-500", weight: "duotone" }) }),
5002
5004
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
5003
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium text-gray-500 dark:text-gray-400", children: t("Artifacts.Empty") }),
5004
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-0.5 text-xs text-gray-400 dark:text-gray-500", children: t("Artifacts.EmptySubtitle") })
5005
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium text-gray-500 dark:text-gray-400", children: t("BiChat.Artifacts.Empty") }),
5006
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-0.5 text-xs text-gray-400 dark:text-gray-500", children: t("BiChat.Artifacts.EmptySubtitle") })
5005
5007
  ] })
5006
5008
  ] });
5007
5009
  }
@@ -5113,7 +5115,7 @@ function ArtifactActions({ url }) {
5113
5115
  className: "inline-flex items-center gap-2 rounded-lg border border-gray-200 px-3 py-1.5 text-xs font-medium text-gray-700 transition-colors hover:bg-gray-50 dark:border-gray-700 dark:text-gray-200 dark:hover:bg-gray-800",
5114
5116
  children: [
5115
5117
  /* @__PURE__ */ jsxRuntime.jsx(react.ArrowSquareOut, { className: "h-3.5 w-3.5", weight: "bold" }),
5116
- t("Artifacts.OpenInNewTab")
5118
+ t("BiChat.Artifacts.OpenInNewTab")
5117
5119
  ]
5118
5120
  }
5119
5121
  ),
@@ -5127,7 +5129,7 @@ function ArtifactActions({ url }) {
5127
5129
  className: "inline-flex items-center gap-2 rounded-lg bg-primary-600 px-3 py-1.5 text-xs font-medium text-white shadow-sm transition-colors hover:bg-primary-700",
5128
5130
  children: [
5129
5131
  /* @__PURE__ */ jsxRuntime.jsx(react.DownloadSimple, { className: "h-3.5 w-3.5", weight: "bold" }),
5130
- t("Artifacts.Download")
5132
+ t("BiChat.Artifacts.Download")
5131
5133
  ]
5132
5134
  }
5133
5135
  )
@@ -5142,7 +5144,7 @@ function TextArtifactPreview({ artifact }) {
5142
5144
  React.useEffect(() => {
5143
5145
  if (!artifact.url) {
5144
5146
  setLoading(false);
5145
- setError(t("Artifacts.TextPreviewFailed"));
5147
+ setError(t("BiChat.Artifacts.TextPreviewFailed"));
5146
5148
  return;
5147
5149
  }
5148
5150
  const controller = new AbortController();
@@ -5165,7 +5167,7 @@ function TextArtifactPreview({ artifact }) {
5165
5167
  if (err instanceof Error && err.name === "AbortError") {
5166
5168
  return;
5167
5169
  }
5168
- setError(t("Artifacts.TextPreviewFailed"));
5170
+ setError(t("BiChat.Artifacts.TextPreviewFailed"));
5169
5171
  }).finally(() => {
5170
5172
  setLoading(false);
5171
5173
  });
@@ -5176,15 +5178,15 @@ function TextArtifactPreview({ artifact }) {
5176
5178
  if (loading) {
5177
5179
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-h-[320px] items-center justify-center rounded-xl border border-gray-200 bg-gray-50 text-sm text-gray-500 dark:border-gray-700/60 dark:bg-gray-800/30 dark:text-gray-400", children: [
5178
5180
  /* @__PURE__ */ jsxRuntime.jsx(react.SpinnerGap, { className: "mr-2 h-4 w-4 animate-spin" }),
5179
- t("Artifacts.PreviewLoading")
5181
+ t("BiChat.Artifacts.PreviewLoading")
5180
5182
  ] });
5181
5183
  }
5182
5184
  if (error) {
5183
5185
  return /* @__PURE__ */ jsxRuntime.jsx(WarningBox, { message: error });
5184
5186
  }
5185
5187
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
5186
- /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "max-h-[70vh] overflow-auto rounded-xl border border-gray-200 bg-gray-50 p-3 text-xs leading-relaxed text-gray-800 dark:border-gray-700/60 dark:bg-gray-900 dark:text-gray-100", children: content || t("Artifacts.PreviewUnavailable") }),
5187
- truncated && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: t("Artifacts.TextPreviewTruncated") })
5188
+ /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "max-h-[70vh] overflow-auto rounded-xl border border-gray-200 bg-gray-50 p-3 text-xs leading-relaxed text-gray-800 dark:border-gray-700/60 dark:bg-gray-900 dark:text-gray-100", children: content || t("BiChat.Artifacts.PreviewUnavailable") }),
5189
+ truncated && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: t("BiChat.Artifacts.TextPreviewTruncated") })
5188
5190
  ] });
5189
5191
  }
5190
5192
  function SessionArtifactPreview({ artifact }) {
@@ -5200,11 +5202,11 @@ function SessionArtifactPreview({ artifact }) {
5200
5202
  if (chartData) {
5201
5203
  return /* @__PURE__ */ jsxRuntime.jsx(ChartCard, { chartData });
5202
5204
  }
5203
- return /* @__PURE__ */ jsxRuntime.jsx(WarningBox, { message: t("Artifacts.ChartUnavailable") });
5205
+ return /* @__PURE__ */ jsxRuntime.jsx(WarningBox, { message: t("BiChat.Artifacts.ChartUnavailable") });
5204
5206
  }
5205
5207
  if (isImageArtifact2(artifact)) {
5206
5208
  if (!artifact.url) {
5207
- return /* @__PURE__ */ jsxRuntime.jsx(WarningBox, { message: t("Artifacts.ImageUnavailable") });
5209
+ return /* @__PURE__ */ jsxRuntime.jsx(WarningBox, { message: t("BiChat.Artifacts.ImageUnavailable") });
5208
5210
  }
5209
5211
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
5210
5212
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-hidden rounded-xl border border-gray-200/80 bg-gray-50/50 dark:border-gray-700/60 dark:bg-gray-800/30", children: /* @__PURE__ */ jsxRuntime.jsx(
@@ -5221,7 +5223,7 @@ function SessionArtifactPreview({ artifact }) {
5221
5223
  }
5222
5224
  if (isPDFArtifact(artifact)) {
5223
5225
  if (!artifact.url) {
5224
- return /* @__PURE__ */ jsxRuntime.jsx(WarningBox, { message: t("Artifacts.DownloadUnavailable") });
5226
+ return /* @__PURE__ */ jsxRuntime.jsx(WarningBox, { message: t("BiChat.Artifacts.DownloadUnavailable") });
5225
5227
  }
5226
5228
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
5227
5229
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-hidden rounded-xl border border-gray-200/80 bg-gray-50 dark:border-gray-700/60 dark:bg-gray-900", children: /* @__PURE__ */ jsxRuntime.jsx(
@@ -5237,7 +5239,7 @@ function SessionArtifactPreview({ artifact }) {
5237
5239
  }
5238
5240
  if (isOfficeDocumentArtifact(artifact)) {
5239
5241
  if (!artifact.url) {
5240
- return /* @__PURE__ */ jsxRuntime.jsx(WarningBox, { message: t("Artifacts.DownloadUnavailable") });
5242
+ return /* @__PURE__ */ jsxRuntime.jsx(WarningBox, { message: t("BiChat.Artifacts.DownloadUnavailable") });
5241
5243
  }
5242
5244
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
5243
5245
  officeViewerURL ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-hidden rounded-xl border border-gray-200/80 bg-gray-50 dark:border-gray-700/60 dark:bg-gray-900", children: /* @__PURE__ */ jsxRuntime.jsx(
@@ -5247,7 +5249,7 @@ function SessionArtifactPreview({ artifact }) {
5247
5249
  title: artifact.name,
5248
5250
  className: "h-[72vh] w-full"
5249
5251
  }
5250
- ) }) : /* @__PURE__ */ jsxRuntime.jsx(WarningBox, { message: t("Artifacts.OfficePreviewUnavailable") }),
5252
+ ) }) : /* @__PURE__ */ jsxRuntime.jsx(WarningBox, { message: t("BiChat.Artifacts.OfficePreviewUnavailable") }),
5251
5253
  /* @__PURE__ */ jsxRuntime.jsx(ArtifactActions, { url: artifact.url })
5252
5254
  ] });
5253
5255
  }
@@ -5261,13 +5263,13 @@ function SessionArtifactPreview({ artifact }) {
5261
5263
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
5262
5264
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-h-[240px] flex-col items-center justify-center rounded-xl border border-gray-200/80 bg-gray-50/60 p-6 text-center dark:border-gray-700/60 dark:bg-gray-900", children: [
5263
5265
  /* @__PURE__ */ jsxRuntime.jsx(react.FileText, { className: "h-8 w-8 text-gray-400 dark:text-gray-500", weight: "duotone" }),
5264
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-3 text-sm font-medium text-gray-800 dark:text-gray-100", children: t("Artifacts.PreviewUnavailable") }),
5265
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-xs text-gray-500 dark:text-gray-400", children: t("Artifacts.PreviewNotSupported") })
5266
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-3 text-sm font-medium text-gray-800 dark:text-gray-100", children: t("BiChat.Artifacts.PreviewUnavailable") }),
5267
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-xs text-gray-500 dark:text-gray-400", children: t("BiChat.Artifacts.PreviewNotSupported") })
5266
5268
  ] }),
5267
5269
  /* @__PURE__ */ jsxRuntime.jsx(ArtifactActions, { url: artifact.url })
5268
5270
  ] });
5269
5271
  }
5270
- return /* @__PURE__ */ jsxRuntime.jsx(WarningBox, { message: t("Artifacts.DownloadUnavailable") });
5272
+ return /* @__PURE__ */ jsxRuntime.jsx(WarningBox, { message: t("BiChat.Artifacts.DownloadUnavailable") });
5271
5273
  }
5272
5274
  function SessionArtifactPreviewModal({
5273
5275
  isOpen,
@@ -5313,7 +5315,7 @@ function SessionArtifactPreviewModal({
5313
5315
  await onRename(artifact, nextName);
5314
5316
  setIsEditingName(false);
5315
5317
  } catch (err) {
5316
- setError(err instanceof Error ? err.message : t("Artifacts.RenameFailed"));
5318
+ setError(err instanceof Error ? err.message : t("BiChat.Artifacts.RenameFailed"));
5317
5319
  } finally {
5318
5320
  setSubmittingRename(false);
5319
5321
  }
@@ -5322,7 +5324,7 @@ function SessionArtifactPreviewModal({
5322
5324
  if (!artifact || !onDelete) {
5323
5325
  return;
5324
5326
  }
5325
- if (!window.confirm(t("Artifacts.DeleteConfirm"))) {
5327
+ if (!window.confirm(t("BiChat.Artifacts.DeleteConfirm"))) {
5326
5328
  return;
5327
5329
  }
5328
5330
  setSubmittingDelete(true);
@@ -5331,7 +5333,7 @@ function SessionArtifactPreviewModal({
5331
5333
  await onDelete(artifact);
5332
5334
  onClose();
5333
5335
  } catch (err) {
5334
- setError(err instanceof Error ? err.message : t("Artifacts.DeleteFailed"));
5336
+ setError(err instanceof Error ? err.message : t("BiChat.Artifacts.DeleteFailed"));
5335
5337
  } finally {
5336
5338
  setSubmittingDelete(false);
5337
5339
  }
@@ -5362,7 +5364,7 @@ function SessionArtifactPreviewModal({
5362
5364
  }
5363
5365
  },
5364
5366
  className: "w-full rounded-lg border border-gray-300 px-3 py-1.5 text-sm text-gray-900 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100",
5365
- "aria-label": t("Artifacts.Rename"),
5367
+ "aria-label": t("BiChat.Artifacts.Rename"),
5366
5368
  autoFocus: true
5367
5369
  }
5368
5370
  ),
@@ -5377,7 +5379,7 @@ function SessionArtifactPreviewModal({
5377
5379
  className: "cursor-pointer inline-flex items-center gap-1 rounded-lg bg-primary-600 px-2.5 py-1.5 text-xs font-medium text-white transition-colors hover:bg-primary-700 disabled:cursor-not-allowed disabled:opacity-60",
5378
5380
  children: [
5379
5381
  /* @__PURE__ */ jsxRuntime.jsx(react.FloppyDisk, { className: "h-3.5 w-3.5", weight: "bold" }),
5380
- t("Message.Save")
5382
+ t("BiChat.Message.Save")
5381
5383
  ]
5382
5384
  }
5383
5385
  ),
@@ -5391,7 +5393,7 @@ function SessionArtifactPreviewModal({
5391
5393
  },
5392
5394
  disabled: submittingRename,
5393
5395
  className: "cursor-pointer rounded-lg border border-gray-200 px-2.5 py-1.5 text-xs font-medium text-gray-700 transition-colors hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-60 dark:border-gray-700 dark:text-gray-200 dark:hover:bg-gray-800",
5394
- children: t("Message.Cancel")
5396
+ children: t("BiChat.Message.Cancel")
5395
5397
  }
5396
5398
  )
5397
5399
  ] }) : /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "truncate text-base font-semibold text-gray-900 dark:text-gray-100", children: artifact.name }),
@@ -5407,8 +5409,8 @@ function SessionArtifactPreviewModal({
5407
5409
  setIsEditingName(true);
5408
5410
  },
5409
5411
  className: "cursor-pointer rounded-lg border border-gray-200 p-2 text-gray-600 transition-colors hover:bg-gray-50 hover:text-gray-900 dark:border-gray-700 dark:text-gray-300 dark:hover:bg-gray-800 dark:hover:text-gray-100",
5410
- "aria-label": t("Artifacts.Rename"),
5411
- title: t("Artifacts.Rename"),
5412
+ "aria-label": t("BiChat.Artifacts.Rename"),
5413
+ title: t("BiChat.Artifacts.Rename"),
5412
5414
  children: /* @__PURE__ */ jsxRuntime.jsx(react.PencilSimple, { className: "h-4 w-4", weight: "regular" })
5413
5415
  }
5414
5416
  ),
@@ -5421,8 +5423,8 @@ function SessionArtifactPreviewModal({
5421
5423
  },
5422
5424
  disabled: submittingDelete,
5423
5425
  className: "cursor-pointer rounded-lg border border-red-200 p-2 text-red-600 transition-colors hover:bg-red-50 hover:text-red-700 disabled:cursor-not-allowed disabled:opacity-60 dark:border-red-900/60 dark:text-red-400 dark:hover:bg-red-950/30 dark:hover:text-red-300",
5424
- "aria-label": t("Artifacts.Delete"),
5425
- title: t("Artifacts.Delete"),
5426
+ "aria-label": t("BiChat.Artifacts.Delete"),
5427
+ title: t("BiChat.Artifacts.Delete"),
5426
5428
  children: /* @__PURE__ */ jsxRuntime.jsx(react.Trash, { className: "h-4 w-4", weight: "regular" })
5427
5429
  }
5428
5430
  ),
@@ -5432,8 +5434,8 @@ function SessionArtifactPreviewModal({
5432
5434
  type: "button",
5433
5435
  onClick: handleClose,
5434
5436
  className: "cursor-pointer rounded-lg border border-gray-200 p-2 text-gray-600 transition-colors hover:bg-gray-50 hover:text-gray-900 dark:border-gray-700 dark:text-gray-300 dark:hover:bg-gray-800 dark:hover:text-gray-100",
5435
- "aria-label": t("Common.Close"),
5436
- title: t("Common.Close"),
5437
+ "aria-label": t("BiChat.Common.Close"),
5438
+ title: t("BiChat.Common.Close"),
5437
5439
  children: /* @__PURE__ */ jsxRuntime.jsx(react.X, { className: "h-4 w-4", weight: "bold" })
5438
5440
  }
5439
5441
  )
@@ -5537,7 +5539,7 @@ function SessionArtifactsPanel({
5537
5539
  if (requestID !== requestSeq.current) {
5538
5540
  return;
5539
5541
  }
5540
- setError(err instanceof Error ? err.message : tRef.current("Artifacts.FailedToLoad"));
5542
+ setError(err instanceof Error ? err.message : tRef.current("BiChat.Artifacts.FailedToLoad"));
5541
5543
  } finally {
5542
5544
  if (requestID === requestSeq.current) {
5543
5545
  setFetching(false);
@@ -5652,7 +5654,7 @@ function SessionArtifactsPanel({
5652
5654
  }
5653
5655
  setError(null);
5654
5656
  } catch (err) {
5655
- setError(err instanceof Error ? err.message : tRef.current("Artifacts.FailedToLoad"));
5657
+ setError(err instanceof Error ? err.message : tRef.current("BiChat.Artifacts.FailedToLoad"));
5656
5658
  }
5657
5659
  }, [canDropFiles, dataSource, fetchArtifacts, hasDragFiles, sessionId, setDropSuccessState]);
5658
5660
  const canRenameArtifacts = typeof dataSource.renameSessionArtifact === "function";
@@ -5701,7 +5703,7 @@ function SessionArtifactsPanel({
5701
5703
  isDragging ? "bg-primary-50/40 dark:bg-primary-950/20" : "",
5702
5704
  className
5703
5705
  ].join(" "),
5704
- "aria-label": t("Artifacts.Title"),
5706
+ "aria-label": t("BiChat.Artifacts.Title"),
5705
5707
  onDragEnter: handleDragEnter,
5706
5708
  onDragOver: handleDragOver,
5707
5709
  onDragLeave: handleDragLeave,
@@ -5716,18 +5718,18 @@ function SessionArtifactsPanel({
5716
5718
  ].join(" "),
5717
5719
  children: [
5718
5720
  /* @__PURE__ */ jsxRuntime.jsx(react.Paperclip, { className: "h-5 w-5", weight: "bold" }),
5719
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium", children: dropSuccess ? t("Input.FilesAdded") : t("Input.DropFiles") })
5721
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium", children: dropSuccess ? t("BiChat.Input.FilesAdded") : t("BiChat.Input.DropFiles") })
5720
5722
  ]
5721
5723
  }
5722
5724
  ) }),
5723
5725
  /* @__PURE__ */ jsxRuntime.jsx("header", { className: "flex items-center justify-between border-b border-gray-200 px-3 py-2 dark:border-gray-700/80", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ jsxRuntime.jsxs("h2", { className: "truncate text-sm font-semibold text-gray-900 dark:text-gray-100", children: [
5724
- t("Artifacts.Title"),
5726
+ t("BiChat.Artifacts.Title"),
5725
5727
  " (",
5726
5728
  artifacts.length,
5727
5729
  ")"
5728
5730
  ] }) }) }),
5729
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-h-0 flex-1 overflow-y-auto px-3 py-3", children: fetching ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-full items-center justify-center text-sm text-gray-500 dark:text-gray-400", children: t("Artifacts.Loading") }) : error ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3 rounded-lg border border-red-200 bg-red-50 p-3 dark:border-red-900/70 dark:bg-red-950/30", children: [
5730
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium text-red-800 dark:text-red-300", children: t("Artifacts.FailedToLoad") }),
5731
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-h-0 flex-1 overflow-y-auto px-3 py-3", children: fetching ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-full items-center justify-center text-sm text-gray-500 dark:text-gray-400", children: t("BiChat.Artifacts.Loading") }) : error ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3 rounded-lg border border-red-200 bg-red-50 p-3 dark:border-red-900/70 dark:bg-red-950/30", children: [
5732
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium text-red-800 dark:text-red-300", children: t("BiChat.Artifacts.FailedToLoad") }),
5731
5733
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-red-700 dark:text-red-400", children: error }),
5732
5734
  /* @__PURE__ */ jsxRuntime.jsx(
5733
5735
  "button",
@@ -5737,10 +5739,10 @@ function SessionArtifactsPanel({
5737
5739
  void fetchArtifacts({ reset: true, manual: true });
5738
5740
  },
5739
5741
  className: "cursor-pointer rounded-md border border-red-300 px-2 py-1 text-xs font-medium text-red-700 hover:bg-red-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-red-400/50 dark:border-red-800 dark:text-red-300 dark:hover:bg-red-900/40",
5740
- children: t("Alert.Retry")
5742
+ children: t("BiChat.Alert.Retry")
5741
5743
  }
5742
5744
  )
5743
- ] }) : !canFetchArtifacts ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-lg border border-amber-200 bg-amber-50 p-3 text-sm text-amber-800 dark:border-amber-900/70 dark:bg-amber-950/30 dark:text-amber-200", children: t("Artifacts.Unsupported") }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
5745
+ ] }) : !canFetchArtifacts ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-lg border border-amber-200 bg-amber-50 p-3 text-sm text-amber-800 dark:border-amber-900/70 dark:bg-amber-950/30 dark:text-amber-200", children: t("BiChat.Artifacts.Unsupported") }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
5744
5746
  /* @__PURE__ */ jsxRuntime.jsx(
5745
5747
  SessionArtifactList,
5746
5748
  {
@@ -5758,7 +5760,7 @@ function SessionArtifactsPanel({
5758
5760
  },
5759
5761
  disabled: loadingMore || refreshing || fetching,
5760
5762
  className: "cursor-pointer rounded-md border border-gray-200 px-3 py-1.5 text-xs font-medium text-gray-700 transition-colors hover:bg-gray-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 disabled:cursor-not-allowed disabled:opacity-50 dark:border-gray-700 dark:text-gray-200 dark:hover:bg-gray-800",
5761
- children: loadingMore ? t("Artifacts.LoadingMore") : t("Artifacts.LoadMore")
5763
+ children: loadingMore ? t("BiChat.Artifacts.LoadingMore") : t("BiChat.Artifacts.LoadMore")
5762
5764
  }
5763
5765
  ) })
5764
5766
  ] }) }),
@@ -5883,11 +5885,11 @@ function ChatSessionCore({
5883
5885
  };
5884
5886
  }, [isResizingArtifactsPanel, artifactsPanelStorageKey]);
5885
5887
  if (fetching) {
5886
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500 dark:text-gray-400", children: t("Input.Processing") }) });
5888
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500 dark:text-gray-400", children: t("BiChat.Input.Processing") }) });
5887
5889
  }
5888
5890
  if (error) {
5889
5891
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-red-500 dark:text-red-400", children: [
5890
- t("Error.Generic"),
5892
+ t("BiChat.Error.Generic"),
5891
5893
  ": ",
5892
5894
  error
5893
5895
  ] }) });
@@ -5923,11 +5925,11 @@ function ChatSessionCore({
5923
5925
  "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50",
5924
5926
  artifactsPanelExpanded ? "bg-primary-50 text-primary-700 hover:bg-primary-100 dark:bg-primary-950/30 dark:text-primary-300 dark:hover:bg-primary-900/40" : "text-gray-500 hover:bg-gray-100 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-gray-200"
5925
5927
  ].join(" "),
5926
- "aria-label": artifactsPanelExpanded ? t("Artifacts.ToggleHide") : t("Artifacts.ToggleShow"),
5927
- title: artifactsPanelExpanded ? t("Artifacts.ToggleHide") : t("Artifacts.ToggleShow"),
5928
+ "aria-label": artifactsPanelExpanded ? t("BiChat.Artifacts.ToggleHide") : t("BiChat.Artifacts.ToggleShow"),
5929
+ title: artifactsPanelExpanded ? t("BiChat.Artifacts.ToggleHide") : t("BiChat.Artifacts.ToggleShow"),
5928
5930
  children: [
5929
5931
  /* @__PURE__ */ jsxRuntime.jsx(react.Sidebar, { className: "h-4 w-4", weight: artifactsPanelExpanded ? "duotone" : "regular" }),
5930
- t("Artifacts.Title")
5932
+ t("BiChat.Artifacts.Title")
5931
5933
  ]
5932
5934
  }
5933
5935
  ),
@@ -5975,7 +5977,7 @@ function ChatSessionCore({
5975
5977
  formClassName: "mx-auto"
5976
5978
  }
5977
5979
  ),
5978
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-4 pb-1 text-center text-xs text-gray-500 dark:text-gray-400", children: t("Welcome.Disclaimer") })
5980
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-4 pb-1 text-center text-xs text-gray-500 dark:text-gray-400", children: t("BiChat.Welcome.Disclaimer") })
5979
5981
  ] }) }) }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
5980
5982
  /* @__PURE__ */ jsxRuntime.jsx(
5981
5983
  MessageList,
@@ -6025,7 +6027,7 @@ function ChatSessionCore({
6025
6027
  "div",
6026
6028
  {
6027
6029
  role: "separator",
6028
- "aria-label": t("Artifacts.Resize"),
6030
+ "aria-label": t("BiChat.Artifacts.Resize"),
6029
6031
  onMouseDown: handleArtifactsResizeStart,
6030
6032
  className: "relative flex shrink-0 cursor-col-resize touch-none items-center justify-center w-2 transition-colors lg:flex group/resize after:absolute after:inset-y-0 after:left-0 after:w-0.5 after:bg-gray-300 dark:after:bg-gray-600 after:transition-colors group-hover/resize:after:bg-primary-400 dark:group-hover/resize:after:bg-primary-500",
6031
6033
  children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute h-10 w-1.5 cursor-col-resize rounded-full bg-gray-400 transition-colors group-hover/resize:bg-primary-400 dark:bg-gray-500 dark:group-hover/resize:bg-primary-500" })
@@ -6066,7 +6068,7 @@ function ChatSessionCore({
6066
6068
  animate: { opacity: 1 },
6067
6069
  exit: { opacity: 0 },
6068
6070
  onClick: handleToggleArtifactsPanel,
6069
- "aria-label": t("Common.Close")
6071
+ "aria-label": t("BiChat.Common.Close")
6070
6072
  }
6071
6073
  ),
6072
6074
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -6180,6 +6182,9 @@ function EmptyState({
6180
6182
  }
6181
6183
  var MemoizedEmptyState = React.memo(EmptyState);
6182
6184
  MemoizedEmptyState.displayName = "EmptyState";
6185
+
6186
+ // ui/src/bichat/components/EditableText.tsx
6187
+ init_useTranslation();
6183
6188
  var sizeClasses2 = {
6184
6189
  sm: "text-sm",
6185
6190
  md: "text-base",
@@ -6196,6 +6201,7 @@ var EditableText = React.forwardRef(
6196
6201
  inputClassName = "",
6197
6202
  size = "sm"
6198
6203
  }, ref) => {
6204
+ const { t } = useTranslation();
6199
6205
  const [isEditing, setIsEditing] = React.useState(false);
6200
6206
  const [editValue, setEditValue] = React.useState(value);
6201
6207
  const inputRef = React.useRef(null);
@@ -6271,7 +6277,7 @@ var EditableText = React.forwardRef(
6271
6277
  maxLength,
6272
6278
  placeholder,
6273
6279
  className: `flex-1 px-2 py-1 ${sizeClass} bg-white dark:bg-gray-700 border border-primary-500 dark:border-primary-600 rounded-lg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 dark:focus-visible:ring-primary-600/30 text-gray-900 dark:text-white ${inputClassName}`,
6274
- "aria-label": "Edit text. Press Enter to save, Escape to cancel"
6280
+ "aria-label": t("BiChat.EditableText.AriaLabel")
6275
6281
  }
6276
6282
  )
6277
6283
  }
@@ -6283,7 +6289,7 @@ var EditableText = React.forwardRef(
6283
6289
  {
6284
6290
  onDoubleClick: handleDoubleClick,
6285
6291
  className: `${sizeClass} font-medium truncate flex-1 cursor-pointer select-none hover:text-primary-600 dark:hover:text-primary-400 transition-colors ${className}`,
6286
- title: "Double-click to edit",
6292
+ title: t("BiChat.EditableText.DoubleClickToEdit"),
6287
6293
  role: "button",
6288
6294
  tabIndex: 0,
6289
6295
  onKeyDown: (e) => {
@@ -6302,6 +6308,9 @@ var EditableText = React.forwardRef(
6302
6308
  );
6303
6309
  EditableText.displayName = "EditableText";
6304
6310
  var MemoizedEditableText = React.memo(EditableText);
6311
+
6312
+ // ui/src/bichat/components/SearchInput.tsx
6313
+ init_useTranslation();
6305
6314
  var sizeClasses3 = {
6306
6315
  sm: {
6307
6316
  container: "py-1.5 pl-8 pr-8 text-xs",
@@ -6331,6 +6340,7 @@ function SearchInput({
6331
6340
  disabled = false,
6332
6341
  ariaLabel = "Search"
6333
6342
  }) {
6343
+ const { t } = useTranslation();
6334
6344
  const inputRef = React.useRef(null);
6335
6345
  const sizes = sizeClasses3[size];
6336
6346
  React.useEffect(() => {
@@ -6385,8 +6395,8 @@ function SearchInput({
6385
6395
  type: "button",
6386
6396
  onClick: handleClear,
6387
6397
  className: `cursor-pointer absolute inset-y-0 right-2 flex items-center ${sizes.clearBtn} rounded-lg hover:bg-gray-200 dark:hover:bg-gray-700 transition-all duration-200 text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-300`,
6388
- "aria-label": "Clear search",
6389
- title: "Clear search",
6398
+ "aria-label": t("BiChat.Search.Clear"),
6399
+ title: t("BiChat.Search.Clear"),
6390
6400
  children: /* @__PURE__ */ jsxRuntime.jsx(react.X, { size: sizes.icon - 2, weight: "bold" })
6391
6401
  }
6392
6402
  )
@@ -6921,12 +6931,16 @@ function useLongPress(options) {
6921
6931
  isPressed
6922
6932
  };
6923
6933
  }
6934
+
6935
+ // ui/src/bichat/components/TouchContextMenu.tsx
6936
+ init_useTranslation();
6924
6937
  var TouchContextMenu = ({
6925
6938
  items,
6926
6939
  isOpen,
6927
6940
  onClose,
6928
6941
  anchorRect
6929
6942
  }) => {
6943
+ const { t } = useTranslation();
6930
6944
  const [focusedIndex, setFocusedIndex] = React.useState(-1);
6931
6945
  const menuRef = React.useRef(null);
6932
6946
  const itemRefs = React.useRef([]);
@@ -7010,7 +7024,7 @@ var TouchContextMenu = ({
7010
7024
  {
7011
7025
  ref: menuRef,
7012
7026
  role: "menu",
7013
- "aria-label": "Context menu",
7027
+ "aria-label": t("BiChat.ContextMenu"),
7014
7028
  initial: { opacity: 0, scale: 0.95 },
7015
7029
  animate: { opacity: 1, scale: 1 },
7016
7030
  exit: { opacity: 0, scale: 0.95 },
@@ -7078,8 +7092,8 @@ var SessionItem = React.memo(
7078
7092
  React.useEffect(() => {
7079
7093
  setIsTouch("ontouchend" in document);
7080
7094
  }, []);
7081
- const isTitleGenerating = !session.title || session.title === t("Chat.NewChat");
7082
- const displayTitle = isTitleGenerating ? t("Common.Generating") : session.title ?? t("Common.Untitled");
7095
+ const isTitleGenerating = !session.title || session.title === t("BiChat.Chat.NewChat");
7096
+ const displayTitle = isTitleGenerating ? t("BiChat.Common.Generating") : session.title ?? t("BiChat.Common.Untitled");
7083
7097
  const { handlers: longPressHandlers } = useLongPress({
7084
7098
  delay: 500,
7085
7099
  onLongPress: (e) => {
@@ -7108,45 +7122,45 @@ var SessionItem = React.memo(
7108
7122
  const contextMenuItems = mode === "archived" ? [
7109
7123
  ...onRestore ? [{
7110
7124
  id: "restore",
7111
- label: t("Archived.RestoreButton"),
7125
+ label: t("BiChat.Archived.RestoreButton"),
7112
7126
  icon: /* @__PURE__ */ jsxRuntime.jsx(react.ArrowUUpLeft, { size: 20 }),
7113
7127
  onClick: () => onRestore()
7114
7128
  }] : [],
7115
7129
  ...onRename ? [{
7116
7130
  id: "rename",
7117
- label: t("Sidebar.RenameChat"),
7131
+ label: t("BiChat.Sidebar.RenameChat"),
7118
7132
  icon: /* @__PURE__ */ jsxRuntime.jsx(react.PencilSimple, { size: 20 }),
7119
7133
  onClick: () => editableTitleRef.current?.startEditing()
7120
7134
  }] : []
7121
7135
  ] : [
7122
7136
  ...onPin ? [{
7123
7137
  id: "pin",
7124
- label: session.pinned ? t("Sidebar.UnpinChat") : t("Sidebar.PinChat"),
7138
+ label: session.pinned ? t("BiChat.Sidebar.UnpinChat") : t("BiChat.Sidebar.PinChat"),
7125
7139
  icon: session.pinned ? /* @__PURE__ */ jsxRuntime.jsx(react.Check, { size: 20 }) : /* @__PURE__ */ jsxRuntime.jsx(react.Bookmark, { size: 20 }),
7126
7140
  onClick: () => onPin()
7127
7141
  }] : [],
7128
7142
  ...onRename ? [{
7129
7143
  id: "rename",
7130
- label: t("Sidebar.RenameChat"),
7144
+ label: t("BiChat.Sidebar.RenameChat"),
7131
7145
  icon: /* @__PURE__ */ jsxRuntime.jsx(react.PencilSimple, { size: 20 }),
7132
7146
  onClick: () => editableTitleRef.current?.startEditing()
7133
7147
  }] : [],
7134
7148
  ...onRegenerateTitle ? [{
7135
7149
  id: "regenerate",
7136
- label: t("Sidebar.RegenerateTitle"),
7150
+ label: t("BiChat.Sidebar.RegenerateTitle"),
7137
7151
  icon: /* @__PURE__ */ jsxRuntime.jsx(react.ArrowsClockwise, { size: 20 }),
7138
7152
  onClick: () => onRegenerateTitle()
7139
7153
  }] : [],
7140
7154
  ...onArchive ? [{
7141
7155
  id: "archive",
7142
- label: t("Sidebar.ArchiveChat"),
7156
+ label: t("BiChat.Sidebar.ArchiveChat"),
7143
7157
  icon: /* @__PURE__ */ jsxRuntime.jsx(react.Archive, { size: 20 }),
7144
7158
  onClick: () => onArchive(),
7145
7159
  variant: "danger"
7146
7160
  }] : [],
7147
7161
  ...onDelete ? [{
7148
7162
  id: "delete",
7149
- label: t("Sidebar.DeleteChat"),
7163
+ label: t("BiChat.Sidebar.DeleteChat"),
7150
7164
  icon: /* @__PURE__ */ jsxRuntime.jsx(react.Trash, { size: 20 }),
7151
7165
  onClick: () => onDelete(),
7152
7166
  variant: "danger"
@@ -7163,11 +7177,18 @@ var SessionItem = React.memo(
7163
7177
  whileHover: "hover",
7164
7178
  exit: "exit",
7165
7179
  children: /* @__PURE__ */ jsxRuntime.jsx(
7166
- "button",
7180
+ "div",
7167
7181
  {
7168
- type: "button",
7182
+ role: "button",
7183
+ tabIndex: 0,
7169
7184
  ref: itemRef,
7170
7185
  onClick: () => onSelect(session.id),
7186
+ onKeyDown: (e) => {
7187
+ if (e.key === "Enter" || e.key === " ") {
7188
+ e.preventDefault();
7189
+ onSelect(session.id);
7190
+ }
7191
+ },
7171
7192
  className: `block w-full text-left px-3 py-2 rounded-lg transition-smooth group relative touch-tap cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${isActive ? "bg-primary-50/50 dark:bg-primary-900/30 text-primary-700 dark:text-primary-400 border-l-4 border-primary-400 dark:border-primary-600" : "text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 border-l-4 border-transparent"} ${className}`,
7172
7193
  "aria-current": isActive ? "page" : void 0,
7173
7194
  "data-session-item": true,
@@ -7192,7 +7213,7 @@ var SessionItem = React.memo(
7192
7213
  e.stopPropagation();
7193
7214
  },
7194
7215
  className: "opacity-0 group-hover:opacity-100 p-1.5 rounded hover:bg-gray-200 dark:hover:bg-gray-700 transition-smooth flex-shrink-0 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50",
7195
- "aria-label": t("Sidebar.ChatOptions"),
7216
+ "aria-label": t("BiChat.Sidebar.ChatOptions"),
7196
7217
  "data-testid": `${testIdPrefix}-session-options-${session.id}`,
7197
7218
  children: /* @__PURE__ */ jsxRuntime.jsx(react.DotsThree, { size: 16, className: "w-4 h-4", weight: "bold" })
7198
7219
  }
@@ -7212,11 +7233,11 @@ var SessionItem = React.memo(
7212
7233
  onPin();
7213
7234
  },
7214
7235
  className: `cursor-pointer flex w-full items-center gap-2 rounded-lg px-3 py-2 text-sm font-medium text-gray-700 dark:text-gray-200 transition-smooth ${focus ? "bg-gray-100 dark:bg-gray-800/70 ring-1 ring-gray-200/80 dark:ring-gray-700/80" : "hover:bg-gray-50 dark:hover:bg-gray-800"}`,
7215
- "aria-label": session.pinned ? t("Sidebar.UnpinChat") : t("Sidebar.PinChat"),
7236
+ "aria-label": session.pinned ? t("BiChat.Sidebar.UnpinChat") : t("BiChat.Sidebar.PinChat"),
7216
7237
  "data-testid": `${testIdPrefix}-session-pin-${session.id}`,
7217
7238
  children: [
7218
7239
  session.pinned ? /* @__PURE__ */ jsxRuntime.jsx(react.Check, { size: 16, className: "w-4 h-4" }) : /* @__PURE__ */ jsxRuntime.jsx(react.Bookmark, { size: 16, className: "w-4 h-4" }),
7219
- session.pinned ? t("Sidebar.UnpinChat") : t("Sidebar.PinChat")
7240
+ session.pinned ? t("BiChat.Sidebar.UnpinChat") : t("BiChat.Sidebar.PinChat")
7220
7241
  ]
7221
7242
  }
7222
7243
  ) }),
@@ -7230,11 +7251,11 @@ var SessionItem = React.memo(
7230
7251
  close();
7231
7252
  },
7232
7253
  className: `cursor-pointer flex w-full items-center gap-2 rounded-lg px-3 py-2 text-sm font-medium text-gray-700 dark:text-gray-200 transition-smooth ${focus ? "bg-gray-100 dark:bg-gray-800/70 ring-1 ring-gray-200/80 dark:ring-gray-700/80" : "hover:bg-gray-50 dark:hover:bg-gray-800"}`,
7233
- "aria-label": t("Sidebar.RenameChat"),
7254
+ "aria-label": t("BiChat.Sidebar.RenameChat"),
7234
7255
  "data-testid": `${testIdPrefix}-session-rename-${session.id}`,
7235
7256
  children: [
7236
7257
  /* @__PURE__ */ jsxRuntime.jsx(react.PencilSimple, { size: 16, className: "w-4 h-4" }),
7237
- t("Sidebar.RenameChat")
7258
+ t("BiChat.Sidebar.RenameChat")
7238
7259
  ]
7239
7260
  }
7240
7261
  ) }),
@@ -7248,11 +7269,11 @@ var SessionItem = React.memo(
7248
7269
  close();
7249
7270
  },
7250
7271
  className: `cursor-pointer flex w-full items-center gap-2 rounded-lg px-3 py-2 text-sm font-medium text-gray-700 dark:text-gray-200 transition-smooth ${focus ? "bg-gray-100 dark:bg-gray-800/70 ring-1 ring-gray-200/80 dark:ring-gray-700/80" : "hover:bg-gray-50 dark:hover:bg-gray-800"}`,
7251
- "aria-label": t("Sidebar.RegenerateTitle"),
7272
+ "aria-label": t("BiChat.Sidebar.RegenerateTitle"),
7252
7273
  "data-testid": `${testIdPrefix}-session-regenerate-${session.id}`,
7253
7274
  children: [
7254
7275
  /* @__PURE__ */ jsxRuntime.jsx(react.ArrowsClockwise, { size: 16, className: "w-4 h-4" }),
7255
- t("Sidebar.RegenerateTitle")
7276
+ t("BiChat.Sidebar.RegenerateTitle")
7256
7277
  ]
7257
7278
  }
7258
7279
  ) }),
@@ -7265,11 +7286,11 @@ var SessionItem = React.memo(
7265
7286
  onRestore();
7266
7287
  },
7267
7288
  className: `cursor-pointer flex w-full items-center gap-2 rounded-lg px-3 py-2 text-sm font-medium transition-smooth ${focus ? "text-green-700 dark:text-green-300 bg-green-50 dark:bg-green-900/20 ring-1 ring-green-200/70 dark:ring-green-500/30" : "text-green-700 dark:text-green-300 hover:bg-green-50/70 dark:hover:bg-green-900/10"}`,
7268
- "aria-label": t("Archived.RestoreButton"),
7289
+ "aria-label": t("BiChat.Archived.RestoreButton"),
7269
7290
  "data-testid": `${testIdPrefix}-session-restore-${session.id}`,
7270
7291
  children: [
7271
7292
  /* @__PURE__ */ jsxRuntime.jsx(react.ArrowUUpLeft, { size: 16, className: "w-4 h-4" }),
7272
- t("Archived.RestoreButton")
7293
+ t("BiChat.Archived.RestoreButton")
7273
7294
  ]
7274
7295
  }
7275
7296
  ) }),
@@ -7282,11 +7303,11 @@ var SessionItem = React.memo(
7282
7303
  onArchive();
7283
7304
  },
7284
7305
  className: `cursor-pointer flex w-full items-center gap-2 rounded-lg px-3 py-2 text-sm font-medium transition-smooth ${focus ? "text-amber-600 dark:text-amber-400 bg-amber-50 dark:bg-amber-900/20 ring-1 ring-amber-200/70 dark:ring-amber-500/30" : "text-amber-600 dark:text-amber-400 hover:bg-amber-50/70 dark:hover:bg-amber-900/10"}`,
7285
- "aria-label": t("Sidebar.ArchiveChat"),
7306
+ "aria-label": t("BiChat.Sidebar.ArchiveChat"),
7286
7307
  "data-testid": `${testIdPrefix}-session-archive-${session.id}`,
7287
7308
  children: [
7288
7309
  /* @__PURE__ */ jsxRuntime.jsx(react.Archive, { size: 16, className: "w-4 h-4" }),
7289
- t("Sidebar.ArchiveChat")
7310
+ t("BiChat.Sidebar.ArchiveChat")
7290
7311
  ]
7291
7312
  }
7292
7313
  ) }),
@@ -7299,11 +7320,11 @@ var SessionItem = React.memo(
7299
7320
  onDelete();
7300
7321
  },
7301
7322
  className: `cursor-pointer flex w-full items-center gap-2 rounded-lg px-3 py-2 text-sm font-medium transition-smooth ${focus ? "text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20 ring-1 ring-red-200/70 dark:ring-red-500/30" : "text-red-600 dark:text-red-400 hover:bg-red-50/70 dark:hover:bg-red-900/10"}`,
7302
- "aria-label": t("Sidebar.DeleteChat"),
7323
+ "aria-label": t("BiChat.Sidebar.DeleteChat"),
7303
7324
  "data-testid": `${testIdPrefix}-session-delete-${session.id}`,
7304
7325
  children: [
7305
7326
  /* @__PURE__ */ jsxRuntime.jsx(react.Trash, { size: 16, className: "w-4 h-4" }),
7306
- t("Sidebar.DeleteChat")
7327
+ t("BiChat.Sidebar.DeleteChat")
7307
7328
  ]
7308
7329
  }
7309
7330
  ) })
@@ -7379,7 +7400,7 @@ function TabBar({ tabs, activeTab, onTabChange }) {
7379
7400
  "div",
7380
7401
  {
7381
7402
  ref: tablistRef,
7382
- className: "flex gap-1 px-4 pt-4 pb-2 border-b border-gray-200 dark:border-gray-700",
7403
+ className: "flex justify-center gap-1 px-4 pt-4 pb-2 border-b border-gray-200 dark:border-gray-700",
7383
7404
  role: "tablist",
7384
7405
  onKeyDown: handleKeyDown,
7385
7406
  children: tabs.map((tab) => /* @__PURE__ */ jsxRuntime.jsx(
@@ -7444,7 +7465,7 @@ function UserFilter({ users, selectedUser, onUserChange, loading }) {
7444
7465
  disabled:opacity-50 disabled:cursor-not-allowed
7445
7466
  flex items-center justify-between gap-2
7446
7467
  `,
7447
- "aria-label": t("allChats.allUsers"),
7468
+ "aria-label": t("BiChat.AllChats.AllUsers"),
7448
7469
  children: [
7449
7470
  selectedUser ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 min-w-0 flex-1", children: [
7450
7471
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -7461,7 +7482,7 @@ function UserFilter({ users, selectedUser, onUserChange, loading }) {
7461
7482
  " ",
7462
7483
  selectedUser.lastName
7463
7484
  ] })
7464
- ] }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-500 dark:text-gray-400", children: loading ? t("allChats.loadingUsers") : t("allChats.allUsers") }),
7485
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-500 dark:text-gray-400", children: loading ? t("BiChat.AllChats.LoadingUsers") : t("BiChat.AllChats.AllUsers") }),
7465
7486
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1 flex-shrink-0", children: [
7466
7487
  selectedUser && /* @__PURE__ */ jsxRuntime.jsx(
7467
7488
  "button",
@@ -7472,7 +7493,7 @@ function UserFilter({ users, selectedUser, onUserChange, loading }) {
7472
7493
  onUserChange(null);
7473
7494
  },
7474
7495
  className: "cursor-pointer p-1 rounded hover:bg-gray-200 dark:hover:bg-gray-600 transition-smooth",
7475
- "aria-label": t("Common.Clear"),
7496
+ "aria-label": t("BiChat.Common.Clear"),
7476
7497
  children: /* @__PURE__ */ jsxRuntime.jsx(react.X, { size: 14, className: "w-3.5 h-3.5 text-gray-600 dark:text-gray-400" })
7477
7498
  }
7478
7499
  ),
@@ -7503,7 +7524,7 @@ function UserFilter({ users, selectedUser, onUserChange, loading }) {
7503
7524
  ${focus ? "bg-gray-100 dark:bg-gray-700" : "hover:bg-gray-50 dark:hover:bg-gray-750"}
7504
7525
  ${!selectedUser ? "text-primary-700 dark:text-primary-400 font-medium" : "text-gray-900 dark:text-gray-100"}
7505
7526
  `,
7506
- children: t("allChats.allUsers")
7527
+ children: t("BiChat.AllChats.AllUsers")
7507
7528
  }
7508
7529
  ) }),
7509
7530
  users.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-gray-200 dark:border-gray-700 my-1" }),
@@ -7536,7 +7557,7 @@ function UserFilter({ users, selectedUser, onUserChange, loading }) {
7536
7557
  ]
7537
7558
  }
7538
7559
  ) }, user.id)),
7539
- users.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 py-6 text-center", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: t("allChats.noUsersFound") }) })
7560
+ users.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 py-6 text-center", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-gray-700 dark:text-gray-300", children: t("BiChat.AllChats.NoUsersFound") }) })
7540
7561
  ]
7541
7562
  }
7542
7563
  )
@@ -7601,7 +7622,7 @@ function AllChatsList({ dataSource, onSessionSelect, activeSessionId }) {
7601
7622
  }
7602
7623
  }).catch(() => {
7603
7624
  if (!cancelled) {
7604
- setError(t("allChats.failedToLoad"));
7625
+ setError(t("BiChat.AllChats.FailedToLoad"));
7605
7626
  setFetching(false);
7606
7627
  }
7607
7628
  });
@@ -7667,12 +7688,12 @@ function AllChatsList({ dataSource, onSessionSelect, activeSessionId }) {
7667
7688
  ),
7668
7689
  /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-sm text-gray-700 dark:text-gray-300 flex items-center gap-1.5", children: [
7669
7690
  /* @__PURE__ */ jsxRuntime.jsx(react.Archive, { size: 16, className: "w-4 h-4" }),
7670
- t("allChats.includeArchived")
7691
+ t("BiChat.AllChats.IncludeArchived")
7671
7692
  ] })
7672
7693
  ] }),
7673
- totalCount > 0 && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: totalCount === 1 ? t("allChats.chatFound", { count: totalCount }) : t("allChats.chatsFound", { count: totalCount }) })
7694
+ totalCount > 0 && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: totalCount === 1 ? t("BiChat.AllChats.ChatFound", { count: totalCount }) : t("BiChat.AllChats.ChatsFound", { count: totalCount }) })
7674
7695
  ] }),
7675
- /* @__PURE__ */ jsxRuntime.jsxs("nav", { className: "flex-1 overflow-y-auto px-2 pb-4 hide-scrollbar", "aria-label": t("allChats.organizationChats"), children: [
7696
+ /* @__PURE__ */ jsxRuntime.jsxs("nav", { className: "flex-1 overflow-y-auto px-2 pb-4 hide-scrollbar", "aria-label": t("BiChat.AllChats.OrganizationChats"), children: [
7676
7697
  fetching && chats.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(SessionSkeleton, { count: 5 }) : /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: chats.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(
7677
7698
  framerMotion.motion.div,
7678
7699
  {
@@ -7681,7 +7702,7 @@ function AllChatsList({ dataSource, onSessionSelect, activeSessionId }) {
7681
7702
  initial: "hidden",
7682
7703
  animate: "visible",
7683
7704
  role: "list",
7684
- "aria-label": t("allChats.organizationChatSessions"),
7705
+ "aria-label": t("BiChat.AllChats.OrganizationChatSessions"),
7685
7706
  children: [
7686
7707
  chats.map((chat) => /* @__PURE__ */ jsxRuntime.jsx(
7687
7708
  framerMotion.motion.div,
@@ -7717,7 +7738,7 @@ function AllChatsList({ dataSource, onSessionSelect, activeSessionId }) {
7717
7738
  }
7718
7739
  ),
7719
7740
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-w-0", children: [
7720
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium truncate", children: chat.title || t("Common.Untitled") }),
7741
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium truncate", children: chat.title || t("BiChat.Common.Untitled") }),
7721
7742
  /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs text-gray-500 dark:text-gray-400 truncate", children: [
7722
7743
  chat.owner.firstName,
7723
7744
  " ",
@@ -7725,7 +7746,7 @@ function AllChatsList({ dataSource, onSessionSelect, activeSessionId }) {
7725
7746
  ] }),
7726
7747
  chat.status === "archived" && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex items-center gap-1 mt-1 px-2 py-0.5 bg-gray-100 dark:bg-gray-800 text-gray-600 dark:text-gray-400 rounded-full text-xs", children: [
7727
7748
  /* @__PURE__ */ jsxRuntime.jsx(react.Archive, { size: 12, className: "w-3 h-3" }),
7728
- t("Chat.Archived")
7749
+ t("BiChat.Chat.Archived")
7729
7750
  ] })
7730
7751
  ] })
7731
7752
  ] })
@@ -7739,7 +7760,7 @@ function AllChatsList({ dataSource, onSessionSelect, activeSessionId }) {
7739
7760
  {
7740
7761
  onClick: handleLoadMore,
7741
7762
  className: "text-sm text-primary-600 dark:text-primary-400 hover:underline",
7742
- children: t("allChats.loadMore")
7763
+ children: t("BiChat.AllChats.LoadMore")
7743
7764
  }
7744
7765
  ) })
7745
7766
  ]
@@ -7747,8 +7768,8 @@ function AllChatsList({ dataSource, onSessionSelect, activeSessionId }) {
7747
7768
  ) : /* @__PURE__ */ jsxRuntime.jsx(
7748
7769
  MemoizedEmptyState,
7749
7770
  {
7750
- title: t("allChats.noChatsFound"),
7751
- description: selectedUser ? t("allChats.noChatsFromUser", { firstName: selectedUser.firstName, lastName: selectedUser.lastName }) : includeArchived ? t("allChats.noChatsInOrg") : t("allChats.noActiveChatsInOrg")
7771
+ title: t("BiChat.AllChats.NoChatsFound"),
7772
+ description: selectedUser ? t("BiChat.AllChats.NoChatsFromUser", { firstName: selectedUser.firstName, lastName: selectedUser.lastName }) : includeArchived ? t("BiChat.AllChats.NoChatsInOrg") : t("BiChat.AllChats.NoActiveChatsInOrg")
7752
7773
  }
7753
7774
  ) }),
7754
7775
  error && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mx-2 mt-4 p-3 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-red-600 dark:text-red-400", children: error }) })
@@ -7792,11 +7813,11 @@ function groupSessionsByDate(sessions, t) {
7792
7813
  const today = dateFns.startOfDay(now);
7793
7814
  const translate = t || ((key2) => key2);
7794
7815
  const dateLabels = {
7795
- "Today": translate("DateGroup.Today"),
7796
- "Yesterday": translate("DateGroup.Yesterday"),
7797
- "Last 7 Days": translate("DateGroup.Last7Days"),
7798
- "Last 30 Days": translate("DateGroup.Last30Days"),
7799
- "Older": translate("DateGroup.Older")
7816
+ "Today": translate("BiChat.DateGroup.Today"),
7817
+ "Yesterday": translate("BiChat.DateGroup.Yesterday"),
7818
+ "Last 7 Days": translate("BiChat.DateGroup.Last7Days"),
7819
+ "Last 30 Days": translate("BiChat.DateGroup.Last30Days"),
7820
+ "Older": translate("BiChat.DateGroup.Older")
7800
7821
  };
7801
7822
  const groupMap = /* @__PURE__ */ new Map([
7802
7823
  ["Today", []],
@@ -7860,9 +7881,9 @@ function Sidebar2({
7860
7881
  const [showConfirm, setShowConfirm] = React.useState(false);
7861
7882
  const [sessionToArchive, setSessionToArchive] = React.useState(null);
7862
7883
  const tabs = React.useMemo(() => {
7863
- const items = [{ id: "my-chats", label: t("Sidebar.MyChats") }];
7884
+ const items = [{ id: "my-chats", label: t("BiChat.Sidebar.MyChats") }];
7864
7885
  if (showAllChatsTab) {
7865
- items.push({ id: "all-chats", label: t("Sidebar.AllChats") });
7886
+ items.push({ id: "all-chats", label: t("BiChat.Sidebar.AllChats") });
7866
7887
  }
7867
7888
  return items;
7868
7889
  }, [showAllChatsTab, t]);
@@ -7874,7 +7895,7 @@ function Sidebar2({
7874
7895
  setSessions(result.sessions);
7875
7896
  } catch (err) {
7876
7897
  console.error("Failed to load sessions:", err);
7877
- setError(t("Sidebar.FailedToLoadSessions"));
7898
+ setError(t("BiChat.Sidebar.FailedToLoadSessions"));
7878
7899
  } finally {
7879
7900
  setLoading(false);
7880
7901
  }
@@ -7883,7 +7904,7 @@ function Sidebar2({
7883
7904
  fetchSessions();
7884
7905
  }, [fetchSessions, refreshKey]);
7885
7906
  const hasPlaceholderTitles = React.useMemo(() => {
7886
- const newChatLabel = t("Chat.NewChat");
7907
+ const newChatLabel = t("BiChat.Chat.NewChat");
7887
7908
  return Array.isArray(sessions) && sessions.some((s) => s && (!s.title || s.title === newChatLabel));
7888
7909
  }, [sessions, t]);
7889
7910
  React.useEffect(() => {
@@ -7919,7 +7940,7 @@ function Sidebar2({
7919
7940
  }
7920
7941
  } catch (err) {
7921
7942
  console.error("Failed to archive session:", err);
7922
- toast.error(t("Sidebar.FailedToArchiveChat"));
7943
+ toast.error(t("BiChat.Sidebar.FailedToArchiveChat"));
7923
7944
  } finally {
7924
7945
  setShowConfirm(false);
7925
7946
  setSessionToArchive(null);
@@ -7935,27 +7956,27 @@ function Sidebar2({
7935
7956
  setRefreshKey((k) => k + 1);
7936
7957
  } catch (err) {
7937
7958
  console.error("Failed to toggle pin:", err);
7938
- toast.error(t("Sidebar.FailedToTogglePin"));
7959
+ toast.error(t("BiChat.Sidebar.FailedToTogglePin"));
7939
7960
  }
7940
7961
  };
7941
7962
  const handleRenameSession = async (sessionId, newTitle) => {
7942
7963
  try {
7943
7964
  await dataSource.renameSession(sessionId, newTitle);
7944
- toast.success(t("Sidebar.ChatRenamedSuccessfully"));
7965
+ toast.success(t("BiChat.Sidebar.ChatRenamedSuccessfully"));
7945
7966
  setRefreshKey((k) => k + 1);
7946
7967
  } catch (err) {
7947
7968
  console.error("Failed to update session title:", err);
7948
- toast.error(t("Sidebar.FailedToRenameChat"));
7969
+ toast.error(t("BiChat.Sidebar.FailedToRenameChat"));
7949
7970
  }
7950
7971
  };
7951
7972
  const handleRegenerateTitle = async (sessionId) => {
7952
7973
  try {
7953
7974
  await dataSource.regenerateSessionTitle(sessionId);
7954
- toast.success(t("Sidebar.TitleRegenerated"));
7975
+ toast.success(t("BiChat.Sidebar.TitleRegenerated"));
7955
7976
  setRefreshKey((k) => k + 1);
7956
7977
  } catch (err) {
7957
7978
  console.error("Failed to regenerate title:", err);
7958
- toast.error(t("Sidebar.FailedToRegenerateTitle"));
7979
+ toast.error(t("BiChat.Sidebar.FailedToRegenerateTitle"));
7959
7980
  }
7960
7981
  };
7961
7982
  const filteredSessions = React.useMemo(() => {
@@ -8020,17 +8041,17 @@ function Sidebar2({
8020
8041
  {
8021
8042
  className: `w-64 bg-surface-300 dark:bg-gray-900 border-r border-gray-200 dark:border-gray-700 h-full min-h-0 flex flex-col overflow-hidden ${className}`,
8022
8043
  role: "navigation",
8023
- "aria-label": t("Sidebar.ChatSessions"),
8044
+ "aria-label": t("BiChat.Sidebar.ChatSessions"),
8024
8045
  children: [
8025
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-4 border-b border-gray-200 dark:border-gray-700 flex items-center justify-between", children: [
8046
+ (headerSlot || onClose) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-4 border-b border-gray-200 dark:border-gray-700 flex items-center justify-between", children: [
8026
8047
  headerSlot,
8027
8048
  onClose && /* @__PURE__ */ jsxRuntime.jsx(
8028
8049
  framerMotion.motion.button,
8029
8050
  {
8030
8051
  onClick: onClose,
8031
8052
  className: "cursor-pointer p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-800 transition-smooth text-gray-600 dark:text-gray-400",
8032
- title: t("Sidebar.CloseSidebar"),
8033
- "aria-label": t("Sidebar.CloseSidebar"),
8053
+ title: t("BiChat.Sidebar.CloseSidebar"),
8054
+ "aria-label": t("BiChat.Sidebar.CloseSidebar"),
8034
8055
  whileHover: "hover",
8035
8056
  whileTap: "tap",
8036
8057
  variants: buttonVariants,
@@ -8054,12 +8075,12 @@ function Sidebar2({
8054
8075
  activeSessionId
8055
8076
  }
8056
8077
  ) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
8057
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-3", children: /* @__PURE__ */ jsxRuntime.jsx(
8078
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-3 px-4", children: /* @__PURE__ */ jsxRuntime.jsx(
8058
8079
  SearchInput_default,
8059
8080
  {
8060
8081
  value: searchQuery,
8061
8082
  onChange: setSearchQuery,
8062
- placeholder: t("Sidebar.SearchChats")
8083
+ placeholder: t("BiChat.Sidebar.SearchChats")
8063
8084
  }
8064
8085
  ) }),
8065
8086
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4", children: /* @__PURE__ */ jsxRuntime.jsx(
@@ -8068,13 +8089,13 @@ function Sidebar2({
8068
8089
  onClick: onNewChat,
8069
8090
  disabled: creating || loading,
8070
8091
  className: "cursor-pointer w-full px-4 py-3 bg-primary-600 dark:bg-primary-700 text-white rounded-lg hover:bg-primary-700 dark:hover:bg-primary-800 transition-smooth font-medium disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center",
8071
- title: t("Chat.NewChat"),
8072
- "aria-label": t("Sidebar.CreateNewChat"),
8092
+ title: t("BiChat.Chat.NewChat"),
8093
+ "aria-label": t("BiChat.Sidebar.CreateNewChat"),
8073
8094
  whileHover: shouldReduceMotion ? {} : { scale: 1.02 },
8074
8095
  whileTap: shouldReduceMotion ? {} : { scale: 0.95 },
8075
8096
  children: creating ? /* @__PURE__ */ jsxRuntime.jsx(LoadingSpinner_default, { variant: "spinner", size: "sm" }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
8076
8097
  /* @__PURE__ */ jsxRuntime.jsx(react.Plus, { size: 20, className: "w-5 h-5" }),
8077
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-2", children: t("Chat.NewChat") })
8098
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-2", children: t("BiChat.Chat.NewChat") })
8078
8099
  ] })
8079
8100
  }
8080
8101
  ) }),
@@ -8083,10 +8104,10 @@ function Sidebar2({
8083
8104
  {
8084
8105
  onClick: onArchivedView,
8085
8106
  className: "cursor-pointer flex items-center gap-2 px-3 py-2 rounded-lg text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 transition-smooth text-sm font-medium w-full",
8086
- title: t("Sidebar.ArchivedChats"),
8107
+ title: t("BiChat.Sidebar.ArchivedChats"),
8087
8108
  children: [
8088
8109
  /* @__PURE__ */ jsxRuntime.jsx(react.Archive, { size: 18, className: "w-4.5 h-4.5" }),
8089
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: t("Sidebar.ArchivedChats") })
8110
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: t("BiChat.Sidebar.ArchivedChats") })
8090
8111
  ]
8091
8112
  }
8092
8113
  ) }),
@@ -8095,7 +8116,7 @@ function Sidebar2({
8095
8116
  {
8096
8117
  ref: sessionListRef,
8097
8118
  className: "flex-1 overflow-y-auto px-2 pb-4 hide-scrollbar",
8098
- "aria-label": "Chat history",
8119
+ "aria-label": t("BiChat.Sidebar.ChatHistory"),
8099
8120
  onKeyDown: handleSessionListKeyDown,
8100
8121
  children: [
8101
8122
  loading && sessions.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(SessionSkeleton, { count: 5 }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
@@ -8103,7 +8124,7 @@ function Sidebar2({
8103
8124
  /* @__PURE__ */ jsxRuntime.jsx(
8104
8125
  DateGroupHeader,
8105
8126
  {
8106
- groupName: t("Common.Pinned"),
8127
+ groupName: t("BiChat.Common.Pinned"),
8107
8128
  count: pinnedSessions.length
8108
8129
  }
8109
8130
  ),
@@ -8115,7 +8136,7 @@ function Sidebar2({
8115
8136
  initial: "hidden",
8116
8137
  animate: "visible",
8117
8138
  role: "list",
8118
- "aria-label": t("Sidebar.PinnedChats"),
8139
+ "aria-label": t("BiChat.Sidebar.PinnedChats"),
8119
8140
  children: pinnedSessions.map((session) => /* @__PURE__ */ jsxRuntime.jsx(
8120
8141
  SessionItem_default,
8121
8142
  {
@@ -8169,14 +8190,14 @@ function Sidebar2({
8169
8190
  filteredSessions.length === 0 && !loading && /* @__PURE__ */ jsxRuntime.jsx(
8170
8191
  MemoizedEmptyState,
8171
8192
  {
8172
- title: searchQuery ? t("Sidebar.NoChatsFound", { query: searchQuery }) : t("Sidebar.NoChatsYet"),
8173
- description: searchQuery ? void 0 : t("Sidebar.CreateOneToGetStarted"),
8193
+ title: searchQuery ? t("BiChat.Sidebar.NoChatsFound", { query: searchQuery }) : t("BiChat.Sidebar.NoChatsYet"),
8194
+ description: searchQuery ? void 0 : t("BiChat.Sidebar.CreateOneToGetStarted"),
8174
8195
  action: searchQuery ? /* @__PURE__ */ jsxRuntime.jsx(
8175
8196
  "button",
8176
8197
  {
8177
8198
  onClick: () => setSearchQuery(""),
8178
8199
  className: "cursor-pointer text-sm text-primary-600 dark:text-primary-400 hover:underline",
8179
- children: t("Common.Clear")
8200
+ children: t("BiChat.Common.Clear")
8180
8201
  }
8181
8202
  ) : void 0
8182
8203
  }
@@ -8195,11 +8216,11 @@ function Sidebar2({
8195
8216
  ConfirmModal_default,
8196
8217
  {
8197
8218
  isOpen: showConfirm,
8198
- title: t("Sidebar.ArchiveChatSession"),
8199
- message: t("Sidebar.ArchiveChatMessage"),
8200
- confirmText: t("Sidebar.ArchiveButton"),
8201
- cancelText: t("Common.Cancel"),
8202
- isDanger: false,
8219
+ title: t("BiChat.Sidebar.ArchiveChatSession"),
8220
+ message: t("BiChat.Sidebar.ArchiveChatMessage"),
8221
+ confirmText: t("BiChat.Sidebar.ArchiveButton"),
8222
+ cancelText: t("BiChat.Common.Cancel"),
8223
+ isDanger: true,
8203
8224
  onConfirm: confirmArchive,
8204
8225
  onCancel: () => {
8205
8226
  setShowConfirm(false);
@@ -8255,10 +8276,10 @@ function ArchivedChatList({
8255
8276
  try {
8256
8277
  await dataSource.unarchiveSession(sessionToRestore);
8257
8278
  setRefreshKey((k) => k + 1);
8258
- toast.success(t("Archived.ChatRestoredSuccessfully"));
8279
+ toast.success(t("BiChat.Archived.ChatRestoredSuccessfully"));
8259
8280
  } catch (err) {
8260
8281
  console.error("Failed to restore session:", err);
8261
- toast.error(t("Archived.FailedToRestoreChat"));
8282
+ toast.error(t("BiChat.Archived.FailedToRestoreChat"));
8262
8283
  } finally {
8263
8284
  setShowConfirm(false);
8264
8285
  setSessionToRestore(null);
@@ -8267,11 +8288,11 @@ function ArchivedChatList({
8267
8288
  const handleRenameSession = async (sessionId, newTitle) => {
8268
8289
  try {
8269
8290
  await dataSource.renameSession(sessionId, newTitle);
8270
- toast.success(t("Sidebar.ChatRenamedSuccessfully"));
8291
+ toast.success(t("BiChat.Sidebar.ChatRenamedSuccessfully"));
8271
8292
  setRefreshKey((k) => k + 1);
8272
8293
  } catch (err) {
8273
8294
  console.error("Failed to update session title:", err);
8274
- toast.error(t("Sidebar.FailedToRenameChat"));
8295
+ toast.error(t("BiChat.Sidebar.FailedToRenameChat"));
8275
8296
  }
8276
8297
  };
8277
8298
  const filteredSessions = React.useMemo(() => {
@@ -8299,10 +8320,10 @@ function ArchivedChatList({
8299
8320
  {
8300
8321
  onClick: onBack,
8301
8322
  className: "inline-flex items-center gap-2 px-3 py-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors text-gray-600 dark:text-gray-400",
8302
- "aria-label": t("Archived.BackToChats"),
8323
+ "aria-label": t("BiChat.Archived.BackToChats"),
8303
8324
  children: [
8304
8325
  /* @__PURE__ */ jsxRuntime.jsx(react.ArrowLeft, { size: 20, className: "w-5 h-5" }),
8305
- t("Common.Back")
8326
+ t("BiChat.Common.Back")
8306
8327
  ]
8307
8328
  }
8308
8329
  ) }),
@@ -8314,14 +8335,14 @@ function ArchivedChatList({
8314
8335
  className: "w-6 h-6 text-gray-600 dark:text-gray-400"
8315
8336
  }
8316
8337
  ),
8317
- /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: t("Archived.Title") })
8338
+ /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: t("BiChat.Archived.Title") })
8318
8339
  ] }),
8319
8340
  /* @__PURE__ */ jsxRuntime.jsx(
8320
8341
  SearchInput_default,
8321
8342
  {
8322
8343
  value: searchQuery,
8323
8344
  onChange: setSearchQuery,
8324
- placeholder: t("Archived.SearchArchivedChats")
8345
+ placeholder: t("BiChat.Archived.SearchArchivedChats")
8325
8346
  }
8326
8347
  )
8327
8348
  ] }),
@@ -8335,8 +8356,8 @@ function ArchivedChatList({
8335
8356
  className: "text-gray-400 dark:text-gray-500"
8336
8357
  }
8337
8358
  ),
8338
- title: t("Archived.NoArchivedChats"),
8339
- description: t("Archived.NoArchivedChatsDescription")
8359
+ title: t("BiChat.Archived.NoArchivedChats"),
8360
+ description: t("BiChat.Archived.NoArchivedChatsDescription")
8340
8361
  }
8341
8362
  ) }) : isEmptyAfterSearch ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center h-full px-6", children: /* @__PURE__ */ jsxRuntime.jsx(
8342
8363
  MemoizedEmptyState,
@@ -8348,8 +8369,8 @@ function ArchivedChatList({
8348
8369
  className: "text-gray-400 dark:text-gray-500"
8349
8370
  }
8350
8371
  ),
8351
- title: t("Archived.NoResults"),
8352
- description: t("Archived.NoResultsDescription", {
8372
+ title: t("BiChat.Archived.NoResults"),
8373
+ description: t("BiChat.Archived.NoResultsDescription", {
8353
8374
  query: searchQuery
8354
8375
  })
8355
8376
  }
@@ -8387,10 +8408,10 @@ function ArchivedChatList({
8387
8408
  ConfirmModal_default,
8388
8409
  {
8389
8410
  isOpen: showConfirm,
8390
- title: t("Archived.RestoreChat"),
8391
- message: t("Archived.RestoreChatMessage"),
8392
- confirmText: t("Archived.RestoreButton"),
8393
- cancelText: t("Common.Cancel"),
8411
+ title: t("BiChat.Archived.RestoreChat"),
8412
+ message: t("BiChat.Archived.RestoreChatMessage"),
8413
+ confirmText: t("BiChat.Archived.RestoreButton"),
8414
+ cancelText: t("BiChat.Common.Cancel"),
8394
8415
  isDanger: false,
8395
8416
  onConfirm: confirmRestore,
8396
8417
  onCancel: () => {
@@ -8476,7 +8497,7 @@ function Alert({
8476
8497
  {
8477
8498
  onClick: onRetry,
8478
8499
  className: `mt-2 text-xs px-3 py-1.5 rounded ${styles.retryButton} transition-colors font-medium`,
8479
- children: t("Chat.Retry")
8500
+ children: t("BiChat.Chat.Retry")
8480
8501
  }
8481
8502
  )
8482
8503
  ] })
@@ -8486,7 +8507,7 @@ function Alert({
8486
8507
  {
8487
8508
  onClick: onDismiss,
8488
8509
  className: `${styles.button} transition-colors flex-shrink-0`,
8489
- "aria-label": t("Chat.DismissNotification"),
8510
+ "aria-label": t("BiChat.Chat.DismissNotification"),
8490
8511
  children: /* @__PURE__ */ jsxRuntime.jsx(react.X, { size: 20, className: "w-5 h-5" })
8491
8512
  }
8492
8513
  )
@@ -8495,12 +8516,14 @@ function Alert({
8495
8516
  ) });
8496
8517
  }
8497
8518
  var Alert_default = React.memo(Alert);
8519
+ init_useTranslation();
8498
8520
  function ArchiveBanner({
8499
8521
  show = true,
8500
8522
  onRestore,
8501
8523
  restoring = false,
8502
8524
  onRestoreComplete
8503
8525
  }) {
8526
+ const { t } = useTranslation();
8504
8527
  const [error, setError] = React.useState(null);
8505
8528
  const handleRestore = async () => {
8506
8529
  try {
@@ -8512,7 +8535,7 @@ function ArchiveBanner({
8512
8535
  onRestoreComplete();
8513
8536
  }
8514
8537
  } catch (err) {
8515
- const message = err instanceof Error ? err.message : "Failed to restore session";
8538
+ const message = err instanceof Error ? err.message : t("BiChat.Archive.RestoreFailed");
8516
8539
  setError(message);
8517
8540
  }
8518
8541
  };
@@ -8526,11 +8549,11 @@ function ArchiveBanner({
8526
8549
  exit: "exit",
8527
8550
  className: "border-t border border-blue-200 bg-blue-50 dark:bg-blue-900/20 px-4 py-3",
8528
8551
  role: "region",
8529
- "aria-label": "Archive banner",
8552
+ "aria-label": t("BiChat.Archive.Banner"),
8530
8553
  children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full flex items-start justify-between px-4", children: [
8531
8554
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3 flex-1", children: [
8532
8555
  /* @__PURE__ */ jsxRuntime.jsx(react.Archive, { size: 20, className: "w-5 h-5 text-blue-600 dark:text-blue-400 flex-shrink-0 mt-0.5" }),
8533
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-blue-700 dark:text-blue-400", children: "This chat session has been archived" }) })
8556
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-blue-700 dark:text-blue-400", children: t("BiChat.Archive.Archived") }) })
8534
8557
  ] }),
8535
8558
  /* @__PURE__ */ jsxRuntime.jsx(
8536
8559
  "button",
@@ -8538,11 +8561,11 @@ function ArchiveBanner({
8538
8561
  onClick: handleRestore,
8539
8562
  disabled: restoring,
8540
8563
  className: "ml-2 flex-shrink-0 px-3 py-1.5 text-xs font-medium bg-blue-600 dark:bg-blue-700 hover:bg-blue-700 dark:hover:bg-blue-800 text-white rounded transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",
8541
- "aria-label": "Restore session",
8564
+ "aria-label": t("BiChat.Archive.Restore"),
8542
8565
  children: restoring ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
8543
8566
  /* @__PURE__ */ jsxRuntime.jsx(react.Spinner, { size: 16, className: "w-4 h-4 animate-spin" }),
8544
- "Restoring..."
8545
- ] }) : "Restore"
8567
+ t("BiChat.Archive.Restoring")
8568
+ ] }) : t("BiChat.Archive.Restore")
8546
8569
  }
8547
8570
  )
8548
8571
  ] })
@@ -8553,7 +8576,7 @@ function ArchiveBanner({
8553
8576
  {
8554
8577
  variant: "error",
8555
8578
  message: error,
8556
- title: "Restore Failed",
8579
+ title: t("BiChat.Archive.RestoreFailed"),
8557
8580
  onDismiss: () => setError(null),
8558
8581
  dismissible: true
8559
8582
  }
@@ -8593,17 +8616,17 @@ var RetryActionArea = React.memo(function RetryActionArea2({
8593
8616
  weight: "fill"
8594
8617
  }
8595
8618
  ),
8596
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-gray-700 dark:text-gray-300", children: t("Retry.Description") })
8619
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-gray-700 dark:text-gray-300", children: t("BiChat.Retry.Subtitle") })
8597
8620
  ] }),
8598
8621
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsxRuntime.jsxs(
8599
8622
  "button",
8600
8623
  {
8601
8624
  onClick: onRetry,
8602
8625
  className: "cursor-pointer inline-flex items-center gap-1.5 px-4 py-2 text-sm font-medium text-white bg-primary-600 hover:bg-primary-700 dark:bg-primary-700 dark:hover:bg-primary-600 rounded-lg transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-gray-800",
8603
- "aria-label": t("Retry.Title"),
8626
+ "aria-label": t("BiChat.Retry.Title"),
8604
8627
  children: [
8605
8628
  /* @__PURE__ */ jsxRuntime.jsx(react.ArrowClockwise, { size: 16, className: "w-4 h-4" }),
8606
- t("Retry.Button")
8629
+ t("BiChat.Retry.Button")
8607
8630
  ]
8608
8631
  }
8609
8632
  ) })
@@ -8641,7 +8664,7 @@ function StreamError({
8641
8664
  }
8642
8665
  ),
8643
8666
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-w-0", children: [
8644
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium text-red-800 dark:text-red-200", children: t("Error.Generic") }),
8667
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium text-red-800 dark:text-red-200", children: t("BiChat.Error.Generic") }),
8645
8668
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-red-600 dark:text-red-300 break-words", children: error })
8646
8669
  ] }),
8647
8670
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 flex-shrink-0", children: [
@@ -8653,7 +8676,7 @@ function StreamError({
8653
8676
  type: "button",
8654
8677
  children: [
8655
8678
  /* @__PURE__ */ jsxRuntime.jsx(react.ArrowClockwise, { className: "w-4 h-4" }),
8656
- t("streamError.retry")
8679
+ t("BiChat.StreamError.Retry")
8657
8680
  ]
8658
8681
  }
8659
8682
  ),
@@ -8665,7 +8688,7 @@ function StreamError({
8665
8688
  type: "button",
8666
8689
  children: [
8667
8690
  /* @__PURE__ */ jsxRuntime.jsx(react.ArrowsCounterClockwise, { className: "w-4 h-4" }),
8668
- t("streamError.regenerate")
8691
+ t("BiChat.StreamError.Regenerate")
8669
8692
  ]
8670
8693
  }
8671
8694
  )
@@ -8674,6 +8697,7 @@ function StreamError({
8674
8697
  }
8675
8698
  );
8676
8699
  }
8700
+ init_useTranslation();
8677
8701
  function MessageActions({
8678
8702
  message,
8679
8703
  onCopy,
@@ -8683,14 +8707,15 @@ function MessageActions({
8683
8707
  const [copying, setCopying] = React.useState(false);
8684
8708
  const [regenerating, setRegenerating] = React.useState(false);
8685
8709
  const toast = useToast();
8710
+ const { t } = useTranslation();
8686
8711
  const isUser = message.role === "user" /* User */;
8687
8712
  const handleCopy = async () => {
8688
8713
  setCopying(true);
8689
8714
  try {
8690
8715
  await onCopy(message.content);
8691
- toast.success("Copied to clipboard");
8716
+ toast.success(t("BiChat.Message.CopiedToClipboard"));
8692
8717
  } catch {
8693
- toast.error("Failed to copy message");
8718
+ toast.error(t("BiChat.Message.FailedToCopy"));
8694
8719
  } finally {
8695
8720
  setCopying(false);
8696
8721
  }
@@ -8710,9 +8735,9 @@ function MessageActions({
8710
8735
  {
8711
8736
  onClick: handleCopy,
8712
8737
  disabled: copying,
8713
- title: copying ? "Copying..." : "Copy message (Cmd/Ctrl+C on selection)",
8738
+ title: copying ? t("BiChat.Message.Copying") : t("BiChat.Message.CopyMessage"),
8714
8739
  className: "cursor-pointer text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 hover:text-gray-700 dark:hover:text-gray-300 rounded-md transition-colors disabled:opacity-50 p-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50",
8715
- "aria-label": copying ? "Copying message" : "Copy message",
8740
+ "aria-label": copying ? t("BiChat.Message.Copying") : t("BiChat.Message.CopyMessage"),
8716
8741
  children: copying ? /* @__PURE__ */ jsxRuntime.jsx(LoadingSpinner_default, { variant: "spinner", size: "sm" }) : /* @__PURE__ */ jsxRuntime.jsx(react.Copy, { size: 16, className: "w-4 h-4" })
8717
8742
  }
8718
8743
  ),
@@ -8721,9 +8746,9 @@ function MessageActions({
8721
8746
  {
8722
8747
  onClick: handleRegenerate,
8723
8748
  disabled: regenerating,
8724
- title: regenerating ? "Regenerating..." : "Regenerate response",
8749
+ title: regenerating ? t("BiChat.Message.Regenerating") : t("BiChat.Message.Regenerate"),
8725
8750
  className: "cursor-pointer text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 hover:text-gray-700 dark:hover:text-gray-300 rounded-md transition-colors disabled:opacity-50 p-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50",
8726
- "aria-label": regenerating ? "Regenerating response" : "Regenerate response",
8751
+ "aria-label": regenerating ? t("BiChat.Message.Regenerating") : t("BiChat.Message.Regenerate"),
8727
8752
  children: regenerating ? /* @__PURE__ */ jsxRuntime.jsx(LoadingSpinner_default, { variant: "spinner", size: "sm" }) : /* @__PURE__ */ jsxRuntime.jsx(react.ArrowClockwise, { size: 16, className: "w-4 h-4" })
8728
8753
  }
8729
8754
  ),
@@ -8731,16 +8756,18 @@ function MessageActions({
8731
8756
  "button",
8732
8757
  {
8733
8758
  onClick: () => onEdit(message),
8734
- title: "Edit message",
8759
+ title: t("BiChat.Message.EditMessage"),
8735
8760
  className: "cursor-pointer text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 hover:text-gray-700 dark:hover:text-gray-300 rounded-md transition-colors p-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50",
8736
- "aria-label": "Edit message",
8761
+ "aria-label": t("BiChat.Message.EditMessage"),
8737
8762
  children: /* @__PURE__ */ jsxRuntime.jsx(react.PencilSimple, { size: 16, className: "w-4 h-4" })
8738
8763
  }
8739
8764
  )
8740
8765
  ] });
8741
8766
  }
8742
8767
  React.memo(MessageActions);
8768
+ init_useTranslation();
8743
8769
  var AttachmentPreview = React.memo(({ attachment, onRemove, onClick, readonly = false }) => {
8770
+ const { t } = useTranslation();
8744
8771
  const [isImageLoaded, setIsImageLoaded] = React.useState(false);
8745
8772
  const [imageError, setImageError] = React.useState(false);
8746
8773
  const previewUrl = attachment.preview || createDataUrl(attachment.base64Data, attachment.mimeType);
@@ -8772,7 +8799,7 @@ var AttachmentPreview = React.memo(({ attachment, onRemove, onClick, readonly =
8772
8799
  children: [
8773
8800
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative mb-2 overflow-hidden rounded-md bg-gray-100 dark:bg-gray-700 aspect-square", children: [
8774
8801
  !isImageLoaded && !imageError && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 animate-pulse bg-gray-200 dark:bg-gray-600" }),
8775
- imageError && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-gray-100 dark:bg-gray-700", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-gray-500 dark:text-gray-400", children: "Preview unavailable" }) }),
8802
+ imageError && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-gray-100 dark:bg-gray-700", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-gray-500 dark:text-gray-400", children: t("BiChat.Attachment.PreviewUnavailable") }) }),
8776
8803
  /* @__PURE__ */ jsxRuntime.jsx(
8777
8804
  "img",
8778
8805
  {
@@ -8808,7 +8835,7 @@ var AttachmentPreview = React.memo(({ attachment, onRemove, onClick, readonly =
8808
8835
  },
8809
8836
  className: "absolute top-1 right-1 flex items-center justify-center bg-red-500 hover:bg-red-600 dark:bg-red-600 dark:hover:bg-red-700 text-white rounded-full transition-all duration-200 shadow-sm hover:shadow-md active:scale-90 w-6 h-6",
8810
8837
  "aria-label": `Remove ${attachment.filename}`,
8811
- title: "Remove attachment",
8838
+ title: t("BiChat.Attachment.Remove"),
8812
8839
  children: /* @__PURE__ */ jsxRuntime.jsx(react.X, { size: 14, className: "w-3.5 h-3.5", weight: "bold" })
8813
8840
  }
8814
8841
  )
@@ -8837,7 +8864,7 @@ var AttachmentUpload = React.memo(
8837
8864
  setIsLoading(true);
8838
8865
  try {
8839
8866
  if (files.length > maxAttachments) {
8840
- toast.error(t("Error.MaxFiles", { max: maxAttachments, selected: files.length }));
8867
+ toast.error(t("BiChat.Error.MaxFiles", { max: maxAttachments, selected: files.length }));
8841
8868
  setIsLoading(false);
8842
8869
  return;
8843
8870
  }
@@ -8877,10 +8904,10 @@ var AttachmentUpload = React.memo(
8877
8904
  }
8878
8905
  if (attachments.length > 0) {
8879
8906
  onAttachmentsSelected(attachments);
8880
- const message = attachments.length === 1 ? t("Attachment.FileAdded", { size: formatFileSize(attachments[0].sizeBytes) }) : t("Attachment.FileAdded", { size: `${attachments.length} files` });
8907
+ const message = attachments.length === 1 ? t("BiChat.Attachment.FileAdded", { size: formatFileSize(attachments[0].sizeBytes) }) : t("BiChat.Attachment.FileAdded", { size: `${attachments.length} files` });
8881
8908
  toast.success(message);
8882
8909
  } else if (errors.length > 0) {
8883
- toast.error(t("Attachment.InvalidFile"));
8910
+ toast.error(t("BiChat.Attachment.InvalidFile"));
8884
8911
  }
8885
8912
  } finally {
8886
8913
  setIsLoading(false);
@@ -8903,7 +8930,7 @@ var AttachmentUpload = React.memo(
8903
8930
  onChange: handleFileSelect,
8904
8931
  disabled: isDisabled,
8905
8932
  className: "sr-only",
8906
- "aria-label": t("Attachment.SelectFiles")
8933
+ "aria-label": t("BiChat.Attachment.SelectFiles")
8907
8934
  }
8908
8935
  ),
8909
8936
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -8913,7 +8940,7 @@ var AttachmentUpload = React.memo(
8913
8940
  onClick: handleClick,
8914
8941
  disabled: isDisabled,
8915
8942
  className: "\n flex items-center justify-center\n w-8 h-8\n text-gray-600 dark:text-gray-400\n hover:text-gray-800 dark:hover:text-gray-200\n hover:bg-gray-100 dark:hover:bg-gray-700\n disabled:text-gray-400 dark:disabled:text-gray-600\n disabled:opacity-50 disabled:cursor-not-allowed\n rounded-lg\n transition-all\n duration-200\n active:scale-95\n focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50\n ",
8916
- "aria-label": t("Attachment.SelectFiles"),
8943
+ "aria-label": t("BiChat.Attachment.SelectFiles"),
8917
8944
  "aria-busy": isLoading,
8918
8945
  children: isLoading ? /* @__PURE__ */ jsxRuntime.jsx(react.CircleNotch, { size: 20, className: "w-5 h-5 animate-spin", weight: "fill" }) : /* @__PURE__ */ jsxRuntime.jsx(react.Paperclip, { size: 20, className: "w-5 h-5", weight: "fill" })
8919
8946
  }
@@ -8960,7 +8987,7 @@ function SkipLink() {
8960
8987
  {
8961
8988
  href: "#main-content",
8962
8989
  className: "sr-only focus-visible:not-sr-only focus-visible:absolute focus-visible:top-4 focus-visible:left-4 focus-visible:z-50 focus-visible:bg-primary-600 focus-visible:text-white focus-visible:px-4 focus-visible:py-2 focus-visible:rounded-lg focus-visible:shadow-lg",
8963
- children: t("skipLink.label")
8990
+ children: t("BiChat.SkipLink.Label")
8964
8991
  }
8965
8992
  );
8966
8993
  }
@@ -9001,7 +9028,7 @@ function QuestionStep({
9001
9028
  };
9002
9029
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
9003
9030
  /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mb-2", children: question.text }) }),
9004
- isMultiSelect && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-gray-500 dark:text-gray-500 italic", children: t("Question.SelectMulti") }),
9031
+ isMultiSelect && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-gray-500 dark:text-gray-500 italic", children: t("BiChat.Question.SelectMulti") }),
9005
9032
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-1 gap-3 sm:grid-cols-2", children: (question.options || []).map((option) => {
9006
9033
  const isSelected = selectedOptions.includes(option.label);
9007
9034
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -9041,7 +9068,7 @@ function QuestionStep({
9041
9068
  }) }),
9042
9069
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
9043
9070
  /* @__PURE__ */ jsxRuntime.jsxs("label", { htmlFor: "other-input", className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2", children: [
9044
- t("Question.SpecifyOther"),
9071
+ t("BiChat.Question.SpecifyOther"),
9045
9072
  ":"
9046
9073
  ] }),
9047
9074
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -9050,7 +9077,7 @@ function QuestionStep({
9050
9077
  id: "other-input",
9051
9078
  value: otherText,
9052
9079
  onChange: (e) => handleOtherTextChange(e.target.value),
9053
- placeholder: t("Question.Other"),
9080
+ placeholder: t("BiChat.Question.OtherOption"),
9054
9081
  rows: 3,
9055
9082
  className: "w-full px-4 py-3 border-2 border-gray-200 dark:border-gray-700 rounded-lg\n bg-white dark:bg-gray-800 text-gray-900 dark:text-white\n placeholder-gray-400 dark:placeholder-gray-500\n focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500\n resize-none"
9056
9083
  }
@@ -9068,8 +9095,8 @@ function ConfirmationStep({
9068
9095
  const { t } = useTranslation();
9069
9096
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
9070
9097
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
9071
- /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white", children: t("questionForm.reviewTitle") }),
9072
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: t("questionForm.reviewDescription") })
9098
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white", children: t("BiChat.QuestionForm.ReviewTitle") }),
9099
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: t("BiChat.QuestionForm.ReviewDescription") })
9073
9100
  ] }),
9074
9101
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-4", children: questions.map((question) => {
9075
9102
  const answerData = answers[question.id] || { options: [] };
@@ -9093,12 +9120,12 @@ function ConfirmationStep({
9093
9120
  )),
9094
9121
  customText && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex items-center px-3 py-1 rounded-lg text-sm font-medium border border-amber-500 bg-amber-500/10 text-amber-600 dark:border-amber-400 dark:bg-amber-400/10 dark:text-amber-400", children: [
9095
9122
  /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "font-semibold mr-1", children: [
9096
- t("Question.Other"),
9123
+ t("BiChat.Question.OtherOption"),
9097
9124
  ":"
9098
9125
  ] }),
9099
9126
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "italic", children: customText })
9100
9127
  ] })
9101
- ] }) : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-gray-400 dark:text-gray-500 italic", children: t("questionForm.skip") })
9128
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-gray-400 dark:text-gray-500 italic", children: t("BiChat.QuestionForm.Skip") })
9102
9129
  ]
9103
9130
  },
9104
9131
  question.id
@@ -9115,12 +9142,12 @@ function isQuestionAnswered(data) {
9115
9142
  function validateAnswers(questions, answers, t) {
9116
9143
  const allAnswered = questions.every((q) => isQuestionAnswered(answers[q.id]));
9117
9144
  if (!allAnswered) {
9118
- return t ? t("Error.AllQuestionsRequired") : "Please answer all questions before submitting";
9145
+ return t ? t("BiChat.Error.AllQuestionsRequired") : "Please answer all questions before submitting";
9119
9146
  }
9120
9147
  for (const q of questions) {
9121
9148
  const data = answers[q.id];
9122
9149
  if (data && (data.options?.length ?? 0) === 0 && data.customText === "") {
9123
- return t ? t("Error.CustomTextRequired", { question: q.text }) : `Please enter custom text for question: ${q.text}`;
9150
+ return t ? t("BiChat.Error.CustomTextRequired", { question: q.text }) : `Please enter custom text for question: ${q.text}`;
9124
9151
  }
9125
9152
  }
9126
9153
  return null;
@@ -9173,24 +9200,24 @@ function QuestionForm({
9173
9200
  try {
9174
9201
  await onSubmit(answers);
9175
9202
  } catch (err) {
9176
- const errorMessage = err instanceof Error ? err.message : t("Error.Generic");
9203
+ const errorMessage = err instanceof Error ? err.message : t("BiChat.Error.Generic");
9177
9204
  setError(errorMessage);
9178
9205
  setIsSubmitting(false);
9179
9206
  }
9180
9207
  };
9181
9208
  const totalSteps = questions.length + 1;
9182
- const progressText = isConfirmationStep ? t("questionForm.step", { current: totalSteps, total: totalSteps }) : t("questionForm.step", { current: currentStep + 1, total: totalSteps });
9209
+ const progressText = isConfirmationStep ? t("BiChat.QuestionForm.Step", { current: totalSteps, total: totalSteps }) : t("BiChat.QuestionForm.Step", { current: currentStep + 1, total: totalSteps });
9183
9210
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-50 p-4", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white dark:bg-gray-800 rounded-lg shadow-xl max-w-2xl w-full max-h-[90vh] overflow-y-auto", children: [
9184
9211
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-b border-gray-200 dark:border-gray-700 p-6", children: [
9185
9212
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mb-4", children: [
9186
- /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: t("questionForm.title") }),
9213
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: t("BiChat.QuestionForm.Title") }),
9187
9214
  /* @__PURE__ */ jsxRuntime.jsx(
9188
9215
  "button",
9189
9216
  {
9190
9217
  onClick: onCancel,
9191
9218
  disabled: isSubmitting,
9192
9219
  className: "cursor-pointer text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 disabled:opacity-50",
9193
- "aria-label": t("Common.Close"),
9220
+ "aria-label": t("BiChat.Common.Close"),
9194
9221
  children: /* @__PURE__ */ jsxRuntime.jsx(react.X, { className: "w-6 h-6" })
9195
9222
  }
9196
9223
  )
@@ -9224,7 +9251,7 @@ function QuestionForm({
9224
9251
  onClick: handleBack,
9225
9252
  disabled: isSubmitting,
9226
9253
  className: "cursor-pointer px-6 py-2 text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-600 disabled:opacity-50 font-medium transition-colors",
9227
- children: t("questionForm.back")
9254
+ children: t("BiChat.QuestionForm.Back")
9228
9255
  }
9229
9256
  ),
9230
9257
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1" }),
@@ -9235,7 +9262,7 @@ function QuestionForm({
9235
9262
  onClick: onCancel,
9236
9263
  disabled: isSubmitting,
9237
9264
  className: "cursor-pointer px-6 py-2 text-gray-700 dark:text-gray-300 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 disabled:opacity-50 font-medium transition-colors",
9238
- children: t("Message.Cancel")
9265
+ children: t("BiChat.Message.Cancel")
9239
9266
  }
9240
9267
  ),
9241
9268
  /* @__PURE__ */ jsxRuntime.jsxs(
@@ -9246,7 +9273,7 @@ function QuestionForm({
9246
9273
  className: "cursor-pointer px-6 py-2 bg-primary-600 hover:bg-primary-700 disabled:opacity-50 text-white rounded-lg font-medium transition-colors flex items-center gap-2",
9247
9274
  children: [
9248
9275
  isSubmitting && /* @__PURE__ */ jsxRuntime.jsx(MemoizedLoadingSpinner, { size: "sm" }),
9249
- isSubmitting ? t("questionForm.submitting") : t("questionForm.confirm")
9276
+ isSubmitting ? t("BiChat.QuestionForm.Submitting") : t("BiChat.QuestionForm.Confirm")
9250
9277
  ]
9251
9278
  }
9252
9279
  )
@@ -9258,7 +9285,7 @@ function QuestionForm({
9258
9285
  onClick: handleNext,
9259
9286
  disabled: !currentQuestionAnswered || isSubmitting,
9260
9287
  className: "cursor-pointer px-6 py-2 bg-primary-600 hover:bg-primary-700 disabled:opacity-50 text-white rounded-lg font-medium transition-colors",
9261
- children: t("questionForm.next")
9288
+ children: t("BiChat.QuestionForm.Next")
9262
9289
  }
9263
9290
  )
9264
9291
  )
@@ -10731,12 +10758,63 @@ function toDownloadArtifact(artifact) {
10731
10758
  description: artifact.description
10732
10759
  };
10733
10760
  }
10761
+ function extractChartDataFromToolCalls(toolCalls) {
10762
+ if (!toolCalls) return void 0;
10763
+ for (const tc of toolCalls) {
10764
+ if (tc.name === "draw_chart" && tc.result) {
10765
+ const parsed = parseChartDataFromJsonString(tc.result);
10766
+ if (parsed) return parsed;
10767
+ }
10768
+ }
10769
+ return void 0;
10770
+ }
10771
+ var EXPORT_TOOL_NAMES = {
10772
+ export_query_to_excel: "excel",
10773
+ export_data_to_excel: "excel",
10774
+ export_to_pdf: "pdf"
10775
+ };
10776
+ function extractDownloadArtifactsFromToolCalls(toolCalls) {
10777
+ if (!toolCalls) return [];
10778
+ const artifacts = [];
10779
+ for (const tc of toolCalls) {
10780
+ const type = EXPORT_TOOL_NAMES[tc.name];
10781
+ if (!type || !tc.result) continue;
10782
+ let parsed;
10783
+ try {
10784
+ parsed = JSON.parse(tc.result);
10785
+ } catch {
10786
+ continue;
10787
+ }
10788
+ if (!isRecord(parsed) || typeof parsed.url !== "string" || !parsed.url) continue;
10789
+ const filename = typeof parsed.filename === "string" && parsed.filename ? parsed.filename : parsed.url.split("/").pop() || "download";
10790
+ const sizeKB = typeof parsed.file_size_kb === "number" ? parsed.file_size_kb : void 0;
10791
+ const sizeBytes = typeof parsed.size === "number" ? parsed.size : sizeKB != null ? sizeKB * 1024 : void 0;
10792
+ artifacts.push({
10793
+ type,
10794
+ filename,
10795
+ url: parsed.url,
10796
+ sizeReadable: sizeBytes != null ? formatSizeReadable(sizeBytes) : void 0,
10797
+ rowCount: parseRowCount(parsed),
10798
+ description: typeof parsed.description === "string" ? parsed.description : void 0
10799
+ });
10800
+ }
10801
+ return artifacts;
10802
+ }
10734
10803
  function normalizeAssistantTurn(turn) {
10804
+ const existingArtifacts = turn.artifacts || [];
10805
+ const fromToolCalls = extractDownloadArtifactsFromToolCalls(turn.toolCalls);
10806
+ const merged = [...existingArtifacts];
10807
+ for (const a of fromToolCalls) {
10808
+ if (!merged.some((e) => e.url === a.url && e.filename === a.filename)) {
10809
+ merged.push(a);
10810
+ }
10811
+ }
10735
10812
  return {
10736
10813
  ...turn,
10737
10814
  role: turn.role || "assistant" /* Assistant */,
10815
+ chartData: turn.chartData || extractChartDataFromToolCalls(turn.toolCalls),
10738
10816
  citations: turn.citations || [],
10739
- artifacts: turn.artifacts || [],
10817
+ artifacts: merged,
10740
10818
  codeOutputs: turn.codeOutputs || []
10741
10819
  };
10742
10820
  }