@burtson-labs/bandit-engine 2.0.162 → 2.0.163

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (211) hide show
  1. package/README.md +7 -22
  2. package/dist/aiProviderStore-PEGSX4PK.mjs +9 -0
  3. package/dist/chat-MRDQ2WRJ.mjs +16 -0
  4. package/dist/chat-provider.js.map +1 -1
  5. package/dist/chat-provider.mjs +7 -7
  6. package/dist/{chunk-ZNK3ELTZ.mjs → chunk-5KBTOCQZ.mjs} +4 -4
  7. package/dist/chunk-5KBTOCQZ.mjs.map +1 -0
  8. package/dist/{chunk-Q6LXVYTC.mjs → chunk-CQJGUYRW.mjs} +2 -2
  9. package/dist/chunk-CQJGUYRW.mjs.map +1 -0
  10. package/dist/{chunk-3ACT5BTW.mjs → chunk-F32P7Q5O.mjs} +122 -232
  11. package/dist/chunk-F32P7Q5O.mjs.map +1 -0
  12. package/dist/{chunk-RUXYVMW2.mjs → chunk-HSGQXL4N.mjs} +11 -11
  13. package/dist/chunk-HSGQXL4N.mjs.map +1 -0
  14. package/dist/{chunk-47MOBOP3.mjs → chunk-IZX2J65Q.mjs} +2 -2
  15. package/dist/chunk-IZX2J65Q.mjs.map +1 -0
  16. package/dist/{chunk-ODGVCSKV.mjs → chunk-J6SWNO7Z.mjs} +6 -27
  17. package/dist/chunk-J6SWNO7Z.mjs.map +1 -0
  18. package/dist/{chunk-G5POQT2R.mjs → chunk-O6P37PFR.mjs} +4 -4
  19. package/dist/chunk-O6P37PFR.mjs.map +1 -0
  20. package/dist/{chunk-KCI46M23.mjs → chunk-OCVZVBQQ.mjs} +1 -1
  21. package/dist/chunk-OCVZVBQQ.mjs.map +1 -0
  22. package/dist/{chunk-IXIM7BNO.mjs → chunk-P4C5IRM5.mjs} +1 -1
  23. package/dist/chunk-P4C5IRM5.mjs.map +1 -0
  24. package/dist/{chunk-WQEBTH2R.mjs → chunk-TY5VL3SG.mjs} +3 -3
  25. package/dist/chunk-TY5VL3SG.mjs.map +1 -0
  26. package/dist/{chunk-YHSYHU5P.mjs → chunk-URZSIL7X.mjs} +7 -7
  27. package/dist/chunk-URZSIL7X.mjs.map +1 -0
  28. package/dist/{chunk-OGMXL7BF.mjs → chunk-VBHI4TJC.mjs} +6 -6
  29. package/dist/chunk-VBHI4TJC.mjs.map +1 -0
  30. package/dist/{chunk-R6HMLYKQ.mjs → chunk-WLNZL6SP.mjs} +5 -16
  31. package/dist/chunk-WLNZL6SP.mjs.map +1 -0
  32. package/dist/index.d.mts +6 -0
  33. package/dist/index.d.ts +6 -0
  34. package/dist/index.js +574 -728
  35. package/dist/index.js.map +1 -1
  36. package/dist/index.mjs +15 -31
  37. package/dist/index.mjs.map +1 -1
  38. package/dist/management/management.js +214 -352
  39. package/dist/management/management.js.map +1 -1
  40. package/dist/management/management.mjs +10 -10
  41. package/dist/{memoryUtils-33TZKHSQ.mjs → memoryUtils-2FVXDSS6.mjs} +1 -1
  42. package/dist/memoryUtils-2FVXDSS6.mjs.map +1 -0
  43. package/dist/modals/chat-modal/chat-modal.js.map +1 -1
  44. package/dist/modals/chat-modal/chat-modal.mjs +6 -6
  45. package/dist/modelStore-7XYYDCNC.mjs +9 -0
  46. package/dist/shared/custom-element.js.map +1 -1
  47. package/dist/shared/custom-element.mjs +1 -1
  48. package/docs/05_contributing.md +1 -1
  49. package/docs/api_reference/assets/navigation.js +1 -1
  50. package/docs/api_reference/assets/search.js +1 -1
  51. package/docs/api_reference/classes/DebugLogger.html +11 -11
  52. package/docs/api_reference/classes/FeatureFlagService.html +13 -13
  53. package/docs/api_reference/classes/NotificationService.html +10 -10
  54. package/docs/api_reference/classes/StreamingTTSClient.html +9 -9
  55. package/docs/api_reference/classes/VectorDatabaseService.html +24 -24
  56. package/docs/api_reference/classes/VectorMigrationService.html +8 -8
  57. package/docs/api_reference/classes/VoiceService.html +2 -2
  58. package/docs/api_reference/enums/TTSState.html +2 -2
  59. package/docs/api_reference/functions/Chat.html +1 -1
  60. package/docs/api_reference/functions/ChatModal.html +1 -1
  61. package/docs/api_reference/functions/ChatProvider.html +1 -1
  62. package/docs/api_reference/functions/FeatureFlagProvider.html +1 -1
  63. package/docs/api_reference/functions/FeedbackButton.html +1 -1
  64. package/docs/api_reference/functions/FeedbackModal.html +1 -1
  65. package/docs/api_reference/functions/InterestsEditor.html +5 -0
  66. package/docs/api_reference/functions/Management.html +1 -1
  67. package/docs/api_reference/functions/NotificationProvider.html +1 -1
  68. package/docs/api_reference/functions/SubscriptionExpiredGuard.html +1 -1
  69. package/docs/api_reference/functions/SubscriptionExpiredModal.html +1 -1
  70. package/docs/api_reference/functions/defineCustomElement.html +1 -1
  71. package/docs/api_reference/functions/getCriticalConfig.html +2 -1
  72. package/docs/api_reference/functions/getFeatureMatrix.html +1 -1
  73. package/docs/api_reference/functions/getStreamingTTSClient.html +1 -1
  74. package/docs/api_reference/functions/getSystemConstants.html +2 -1
  75. package/docs/api_reference/functions/getTTSState.html +1 -1
  76. package/docs/api_reference/functions/handleHttpError.html +1 -1
  77. package/docs/api_reference/functions/handleSubscriptionUpgrade.html +1 -1
  78. package/docs/api_reference/functions/handleValidationError.html +1 -1
  79. package/docs/api_reference/functions/initializeCoreSystem.html +2 -1
  80. package/docs/api_reference/functions/isWorkspaceAdminRole.html +6 -0
  81. package/docs/api_reference/functions/pauseTTS.html +1 -1
  82. package/docs/api_reference/functions/previewTierUpgrade.html +1 -1
  83. package/docs/api_reference/functions/resolveManagementSections.html +2 -0
  84. package/docs/api_reference/functions/resumeTTS.html +1 -1
  85. package/docs/api_reference/functions/showInfoNotification.html +1 -1
  86. package/docs/api_reference/functions/showSuccessNotification.html +1 -1
  87. package/docs/api_reference/functions/speakWithStreaming.html +1 -1
  88. package/docs/api_reference/functions/stopTTS.html +1 -1
  89. package/docs/api_reference/functions/syncSubscriptionWithAPI.html +1 -1
  90. package/docs/api_reference/functions/updateSubscriptionTier.html +1 -1
  91. package/docs/api_reference/functions/useFeatureFlag.html +1 -1
  92. package/docs/api_reference/functions/useFeatureVisibility.html +1 -1
  93. package/docs/api_reference/functions/useFeatures.html +1 -1
  94. package/docs/api_reference/functions/useGatewayHealth.html +1 -1
  95. package/docs/api_reference/functions/useGatewayMemory.html +1 -1
  96. package/docs/api_reference/functions/useGatewayModels.html +1 -1
  97. package/docs/api_reference/functions/useGlobalTTS.html +1 -1
  98. package/docs/api_reference/functions/useManagementAccess.html +2 -0
  99. package/docs/api_reference/functions/useNotification.html +1 -1
  100. package/docs/api_reference/functions/useNotificationService.html +1 -1
  101. package/docs/api_reference/functions/useTTS.html +1 -1
  102. package/docs/api_reference/functions/useVectorStore.html +1 -1
  103. package/docs/api_reference/functions/useVoiceStore.html +2 -2
  104. package/docs/api_reference/functions/useVoices.html +1 -1
  105. package/docs/api_reference/functions/validateEnvironment.html +2 -1
  106. package/docs/api_reference/functions/validateSystemIntegrity.html +2 -1
  107. package/docs/api_reference/index.html +219 -155
  108. package/docs/api_reference/interfaces/AIChatRequest.html +2 -2
  109. package/docs/api_reference/interfaces/AIChatResponse.html +2 -2
  110. package/docs/api_reference/interfaces/AIGenerateRequest.html +2 -2
  111. package/docs/api_reference/interfaces/AIGenerateResponse.html +2 -2
  112. package/docs/api_reference/interfaces/AIMessage.html +2 -2
  113. package/docs/api_reference/interfaces/AIModel.html +2 -2
  114. package/docs/api_reference/interfaces/AIProviderConfig.html +5 -2
  115. package/docs/api_reference/interfaces/ChatConfig.html +3 -3
  116. package/docs/api_reference/interfaces/ChatModalProps.html +3 -3
  117. package/docs/api_reference/interfaces/CreateMemoryOptions.html +2 -2
  118. package/docs/api_reference/interfaces/FeatureEvaluation.html +7 -7
  119. package/docs/api_reference/interfaces/FeatureFlagConfig.html +9 -9
  120. package/docs/api_reference/interfaces/FeatureFlagContextValue.html +8 -8
  121. package/docs/api_reference/interfaces/FeatureFlagProviderProps.html +2 -2
  122. package/docs/api_reference/interfaces/FeedbackButtonProps.html +10 -10
  123. package/docs/api_reference/interfaces/FeedbackCategories.html +2 -2
  124. package/docs/api_reference/interfaces/FeedbackModalProps.html +2 -2
  125. package/docs/api_reference/interfaces/FeedbackPriorities.html +2 -2
  126. package/docs/api_reference/interfaces/FeedbackRequest.html +2 -2
  127. package/docs/api_reference/interfaces/FeedbackResponse.html +2 -2
  128. package/docs/api_reference/interfaces/FileUploadResult.html +2 -2
  129. package/docs/api_reference/interfaces/GatewayChatRequest.html +3 -2
  130. package/docs/api_reference/interfaces/GatewayChatResponse.html +2 -2
  131. package/docs/api_reference/interfaces/GatewayContract.html +2 -2
  132. package/docs/api_reference/interfaces/GatewayGenerateRequest.html +2 -2
  133. package/docs/api_reference/interfaces/GatewayGenerateResponse.html +2 -2
  134. package/docs/api_reference/interfaces/GatewayHealthResponse.html +2 -2
  135. package/docs/api_reference/interfaces/GatewayMemoryRecord.html +2 -2
  136. package/docs/api_reference/interfaces/GatewayMemoryResponse.html +2 -2
  137. package/docs/api_reference/interfaces/GatewayMessage.html +2 -2
  138. package/docs/api_reference/interfaces/GatewayMessageContent.html +2 -2
  139. package/docs/api_reference/interfaces/GatewayModel.html +2 -2
  140. package/docs/api_reference/interfaces/GatewayModelsResponse.html +2 -2
  141. package/docs/api_reference/interfaces/ManagementAccess.html +5 -0
  142. package/docs/api_reference/interfaces/ManagementAccessInput.html +5 -0
  143. package/docs/api_reference/interfaces/ManagementLink.html +7 -0
  144. package/docs/api_reference/interfaces/ManagementProps.html +22 -0
  145. package/docs/api_reference/interfaces/ManagementSectionDef.html +10 -0
  146. package/docs/api_reference/interfaces/MemorySearchFilters.html +2 -2
  147. package/docs/api_reference/interfaces/MigrationProgress.html +2 -2
  148. package/docs/api_reference/interfaces/MigrationStatus.html +2 -2
  149. package/docs/api_reference/interfaces/NotificationConfig.html +2 -2
  150. package/docs/api_reference/interfaces/NotificationContextType.html +2 -2
  151. package/docs/api_reference/interfaces/NotificationProviderProps.html +2 -2
  152. package/docs/api_reference/interfaces/PackageSettings.html +11 -2
  153. package/docs/api_reference/interfaces/SearchOptions.html +2 -2
  154. package/docs/api_reference/interfaces/SearchResult.html +2 -2
  155. package/docs/api_reference/interfaces/SubscriptionExpiredGuardProps.html +2 -2
  156. package/docs/api_reference/interfaces/SubscriptionExpiredModalProps.html +2 -2
  157. package/docs/api_reference/interfaces/TTSOptions.html +2 -2
  158. package/docs/api_reference/interfaces/TTSProgress.html +2 -2
  159. package/docs/api_reference/interfaces/TrialUsage.html +2 -2
  160. package/docs/api_reference/interfaces/UploadRequest.html +3 -3
  161. package/docs/api_reference/interfaces/UseTTSReturn.html +2 -2
  162. package/docs/api_reference/interfaces/VectorDocument.html +2 -2
  163. package/docs/api_reference/interfaces/VectorMemory.html +2 -2
  164. package/docs/api_reference/interfaces/VectorMemoryMetadata.html +2 -2
  165. package/docs/api_reference/interfaces/VectorStoreStatus.html +2 -2
  166. package/docs/api_reference/interfaces/VoiceModelsResponse.html +2 -2
  167. package/docs/api_reference/interfaces/VoiceState.html +2 -2
  168. package/docs/api_reference/media/PROTECTION-NOTICE.md +6 -55
  169. package/docs/api_reference/media/README.md +20 -1
  170. package/docs/api_reference/modules.html +18 -6
  171. package/docs/api_reference/types/FeatureKey.html +1 -1
  172. package/docs/api_reference/types/FeatureMatrix.html +1 -1
  173. package/docs/api_reference/types/GatewayQueryOptions.html +1 -1
  174. package/docs/api_reference/types/LogContext.html +1 -1
  175. package/docs/api_reference/types/ManagementRequest.html +1 -0
  176. package/docs/api_reference/types/ManagementSectionId.html +2 -0
  177. package/docs/api_reference/types/SubscriptionTier.html +1 -1
  178. package/docs/api_reference/variables/DEFAULT_TIER_FEATURES.html +1 -1
  179. package/docs/api_reference/variables/FeatureFlagContext.html +1 -1
  180. package/docs/api_reference/variables/MANAGEMENT_SECTIONS.html +1 -0
  181. package/docs/api_reference/variables/OSS_DEFAULT_FEATURES.html +1 -1
  182. package/docs/api_reference/variables/SYSTEM_FLAGS.html +2 -1
  183. package/docs/api_reference/variables/authenticationService.html +1 -1
  184. package/docs/api_reference/variables/debugLogger-1.html +1 -1
  185. package/docs/api_reference/variables/featureFlagService-1.html +1 -1
  186. package/docs/api_reference/variables/notificationService-1.html +1 -1
  187. package/docs/api_reference/variables/vectorDatabaseService-1.html +1 -1
  188. package/docs/api_reference/variables/vectorMigrationService-1.html +1 -1
  189. package/docs/api_reference/variables/voiceService-1.html +1 -1
  190. package/package.json +1 -1
  191. package/dist/aiProviderStore-JOB2H4LP.mjs +0 -9
  192. package/dist/chat-LB6UEEEW.mjs +0 -16
  193. package/dist/chunk-3ACT5BTW.mjs.map +0 -1
  194. package/dist/chunk-47MOBOP3.mjs.map +0 -1
  195. package/dist/chunk-G5POQT2R.mjs.map +0 -1
  196. package/dist/chunk-IXIM7BNO.mjs.map +0 -1
  197. package/dist/chunk-KCI46M23.mjs.map +0 -1
  198. package/dist/chunk-ODGVCSKV.mjs.map +0 -1
  199. package/dist/chunk-OGMXL7BF.mjs.map +0 -1
  200. package/dist/chunk-Q6LXVYTC.mjs.map +0 -1
  201. package/dist/chunk-R6HMLYKQ.mjs.map +0 -1
  202. package/dist/chunk-RUXYVMW2.mjs.map +0 -1
  203. package/dist/chunk-WQEBTH2R.mjs.map +0 -1
  204. package/dist/chunk-YHSYHU5P.mjs.map +0 -1
  205. package/dist/chunk-ZNK3ELTZ.mjs.map +0 -1
  206. package/dist/memoryUtils-33TZKHSQ.mjs.map +0 -1
  207. package/dist/modelStore-FGUGOWTL.mjs +0 -9
  208. package/docs/api_reference/media/PROTECTION-README.md +0 -39
  209. /package/dist/{aiProviderStore-JOB2H4LP.mjs.map → aiProviderStore-PEGSX4PK.mjs.map} +0 -0
  210. /package/dist/{chat-LB6UEEEW.mjs.map → chat-MRDQ2WRJ.mjs.map} +0 -0
  211. /package/dist/{modelStore-FGUGOWTL.mjs.map → modelStore-7XYYDCNC.mjs.map} +0 -0
package/dist/index.js CHANGED
@@ -6905,13 +6905,12 @@ var init_aiProviderStore = __esm({
6905
6905
  });
6906
6906
 
6907
6907
  // src/util.ts
6908
- var toTitleCase, randomRange, generateSeed, fetchAndConvertToBase64, detectTransparency, banditHead, modelAvatars, resolveAvatar;
6908
+ var toTitleCase, generateSeed, fetchAndConvertToBase64, detectTransparency, banditHead, modelAvatars, resolveAvatar;
6909
6909
  var init_util = __esm({
6910
6910
  "src/util.ts"() {
6911
6911
  "use strict";
6912
6912
  init_debugLogger();
6913
6913
  toTitleCase = (str) => str.toLowerCase().split(" ").map((w) => w.charAt(0).toUpperCase() + w.slice(1)).join(" ");
6914
- randomRange = (min, max) => Math.floor(Math.random() * (max - min + 1)) + min;
6915
6914
  generateSeed = () => Math.floor(Math.random() * 1e4);
6916
6915
  fetchAndConvertToBase64 = async (src) => {
6917
6916
  const response = await fetch(src);
@@ -6971,30 +6970,12 @@ var init_util = __esm({
6971
6970
  });
6972
6971
 
6973
6972
  // src/prompts/getStableQuestionPrompt.ts
6974
- var TOPICS, getRandomTopicOfInterest, pickDistinctRandomTopics, getStableQuestionPrompt;
6973
+ var TOPICS, getStableQuestionPrompt;
6975
6974
  var init_getStableQuestionPrompt = __esm({
6976
6975
  "src/prompts/getStableQuestionPrompt.ts"() {
6977
6976
  "use strict";
6978
6977
  init_util();
6979
6978
  TOPICS = ["everyday life", "finance", "sports", "travel", "technology", "politics", "health", "food", "entertainment", "education", "science", "history", "art", "music", "literature", "philosophy", "psychology", "sociology", "environmental issues", "current events"];
6980
- getRandomTopicOfInterest = () => {
6981
- const minIndex = 0;
6982
- const maxIndex = TOPICS.length - 1;
6983
- const randomIndex = randomRange(minIndex, maxIndex);
6984
- const randomTopic = TOPICS[randomIndex];
6985
- return randomTopic;
6986
- };
6987
- pickDistinctRandomTopics = (count) => {
6988
- const pool = [...TOPICS];
6989
- const picked = [];
6990
- const n = Math.min(Math.max(count, 0), pool.length);
6991
- for (let i = 0; i < n; i++) {
6992
- const idx = randomRange(0, pool.length - 1);
6993
- picked.push(pool[idx]);
6994
- pool.splice(idx, 1);
6995
- }
6996
- return picked;
6997
- };
6998
6979
  getStableQuestionPrompt = (args) => {
6999
6980
  const { limit, topicOfInterest, modelSystemPrompt, interests, knowledgeTopics, webSearchAvailable } = args;
7000
6981
  if (limit < 1 || limit > 10) {
@@ -11477,16 +11458,6 @@ function appBarTokens(theme) {
11477
11458
  menuText: s.control.foreground
11478
11459
  };
11479
11460
  }
11480
- function suggestionTokens(theme) {
11481
- const s = chatTokens(theme);
11482
- return {
11483
- background: s.surface.subtle,
11484
- text: s.conversation.assistant.foreground,
11485
- border: s.conversation.border,
11486
- hoverBackground: s.surface.interactive,
11487
- hoverBorder: theme.palette.divider
11488
- };
11489
- }
11490
11461
  function responseTokens(theme) {
11491
11462
  const s = chatTokens(theme);
11492
11463
  return {
@@ -27957,203 +27928,84 @@ Respond with just the title and nothing else.
27957
27928
  });
27958
27929
 
27959
27930
  // src/chat/query-suggestion-picker.tsx
27960
- var import_react50, import_material31, import_styles21, import_react_markdown3, import_remark_gfm3, import_rehype_raw3, import_jsx_runtime32, markdownComponents, QuerySuggestionPicker;
27931
+ function QuerySuggestionPicker({ onSend, onSelect }) {
27932
+ const [ideas, setIdeas] = (0, import_react50.useState)([]);
27933
+ const [generating, setGenerating] = (0, import_react50.useState)(false);
27934
+ const [message, setMessage] = (0, import_react50.useState)("");
27935
+ const mounted = (0, import_react50.useRef)(false);
27936
+ const generatingRef = (0, import_react50.useRef)(false);
27937
+ (0, import_react50.useEffect)(() => {
27938
+ mounted.current = true;
27939
+ return () => {
27940
+ mounted.current = false;
27941
+ };
27942
+ }, []);
27943
+ const select = (prompt) => {
27944
+ if (onSelect) onSelect(prompt);
27945
+ else void Promise.resolve(onSend(prompt, [])).catch(() => {
27946
+ });
27947
+ };
27948
+ const generateIdeas = async () => {
27949
+ if (generatingRef.current) return;
27950
+ generatingRef.current = true;
27951
+ setGenerating(true);
27952
+ setMessage("");
27953
+ try {
27954
+ const prefs = usePreferencesStore.getState().preferences;
27955
+ const interests = (prefs.interests ?? []).filter((value) => value?.trim());
27956
+ const prompts = await generateConversationStarters({
27957
+ limit: 3,
27958
+ topicOfInterest: interests.join(", ") || "practical writing, learning, and decisions",
27959
+ interests,
27960
+ modelSystemPrompt: useModelStore.getState().getCurrentModel()?.systemPrompt,
27961
+ knowledgeTopics: prefs.useKnowledgeForStarters ? useKnowledgeStore.getState().docs.map((doc) => doc.name).filter(Boolean).slice(0, 12) : void 0,
27962
+ webSearchAvailable: useMCPToolsStore.getState().getEnabledTools().some((tool) => tool.name === "web_search")
27963
+ });
27964
+ if (!mounted.current) return;
27965
+ const next = prompts.filter((prompt) => typeof prompt === "string" && prompt.trim()).slice(0, 3);
27966
+ setIdeas(next);
27967
+ setMessage(next.length ? "New ideas are ready. Choose one to get started." : "Ideas are unavailable right now. You can still use a starter or write your own.");
27968
+ } catch {
27969
+ if (mounted.current) setMessage("Ideas are unavailable right now. You can still use a starter or write your own.");
27970
+ } finally {
27971
+ generatingRef.current = false;
27972
+ if (mounted.current) setGenerating(false);
27973
+ }
27974
+ };
27975
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_material31.Box, { component: "section", "aria-label": "Start with a task", sx: { width: "100%", px: { xs: 2, sm: 3 } }, children: [
27976
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_material31.Box, { sx: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 1, mb: 1.5 }, children: [
27977
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material31.Typography, { variant: "body2", sx: { fontWeight: 600 }, children: "What would move your work forward?" }),
27978
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material31.Button, { size: "small", startIcon: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react51.Refresh, { size: 14 }), disabled: generating, onClick: () => void generateIdeas(), sx: { flexShrink: 0 }, children: generating ? "Finding ideas\u2026" : "Suggest ideas" })
27979
+ ] }),
27980
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material31.Box, { sx: { display: "grid", gridTemplateColumns: { xs: "1fr", sm: "repeat(3, minmax(0, 1fr))" }, gap: 1 }, children: (ideas.length ? ideas.map((prompt) => ({ title: prompt, detail: "", icon: import_react51.ArrowRight, prompt })) : STARTERS).map(({ title, detail, icon: Icon, prompt }) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_material31.Button, { variant: "outlined", onClick: () => select(prompt), sx: { display: "flex", alignItems: "flex-start", justifyContent: "flex-start", gap: 1.2, textAlign: "left", textTransform: "none", p: { xs: 1.5, sm: 2 }, height: "100%", color: "text.primary", borderColor: "divider" }, children: [
27981
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material31.Box, { component: "span", sx: { display: "flex", color: "primary.main", mt: 0.25 }, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Icon, { size: 18 }) }),
27982
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_material31.Box, { component: "span", children: [
27983
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material31.Typography, { component: "span", variant: "body2", sx: { display: "block", fontWeight: 550, lineHeight: 1.45 }, children: title }),
27984
+ detail && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material31.Typography, { component: "span", variant: "caption", sx: { display: "block", color: "text.secondary", mt: 0.5, lineHeight: 1.5 }, children: detail })
27985
+ ] })
27986
+ ] }, title)) }),
27987
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material31.Typography, { variant: "caption", sx: { display: "block", color: "text.secondary", mt: 1.25 }, children: onSelect ? "Choose a starting point, then make it your own before sending." : "Choose a starting point or write your own message." }),
27988
+ message && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material31.Typography, { role: "status", variant: "caption", sx: { display: "block", color: "text.secondary", mt: 1 }, children: message })
27989
+ ] });
27990
+ }
27991
+ var import_react50, import_material31, import_react51, import_jsx_runtime32, STARTERS;
27961
27992
  var init_query_suggestion_picker = __esm({
27962
27993
  "src/chat/query-suggestion-picker.tsx"() {
27963
27994
  "use strict";
27964
27995
  import_react50 = require("react");
27965
27996
  import_material31 = require("@mui/material");
27966
- import_styles21 = require("@mui/material/styles");
27967
- import_react_markdown3 = __toESM(require("react-markdown"));
27968
- import_remark_gfm3 = __toESM(require("remark-gfm"));
27969
- import_rehype_raw3 = __toESM(require("rehype-raw"));
27997
+ import_react51 = require("@burtson-labs/icons/react");
27970
27998
  init_prompts();
27971
- init_getStableQuestionPrompt();
27972
27999
  init_modelStore();
27973
28000
  init_preferencesStore();
27974
28001
  init_knowledgeStore();
27975
28002
  init_mcpToolsStore();
27976
- init_chat_tokens();
27977
28003
  import_jsx_runtime32 = require("react/jsx-runtime");
27978
- markdownComponents = {
27979
- p: ({ node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { ...props }),
27980
- mark: ({ node, children, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("mark", { ...props, children }),
27981
- code: ({ node, children, ...props }) => {
27982
- const { inline, ...rest } = props;
27983
- return inline ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("code", { ...rest, children }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("code", { ...rest, children });
27984
- }
27985
- };
27986
- QuerySuggestionPicker = ({
27987
- onSend,
27988
- inputHeight
27989
- }) => {
27990
- const hasGenerated = (0, import_react50.useRef)(false);
27991
- const [hasSentPrompt, setHasSentPrompt] = (0, import_react50.useState)(false);
27992
- const [examplePrompts, setExamplePrompts] = (0, import_react50.useState)([]);
27993
- const [visiblePrompts, setVisiblePrompts] = (0, import_react50.useState)([]);
27994
- const scrollRef = (0, import_react50.useRef)(null);
27995
- const theme = (0, import_styles21.useTheme)();
27996
- const isMobile = (0, import_material31.useMediaQuery)((theme2) => theme2.breakpoints.down("sm"));
27997
- const { background, text, border, hoverBackground, hoverBorder } = suggestionTokens(theme);
27998
- const { getCurrentModel, isLoading } = useModelStore();
27999
- (0, import_react50.useEffect)(() => {
28000
- if (hasGenerated.current || isLoading) return;
28001
- hasGenerated.current = true;
28002
- const currentModel = getCurrentModel();
28003
- const prefs = usePreferencesStore.getState().preferences;
28004
- const interests = (prefs.interests ?? []).filter((i) => i && i.trim());
28005
- const randomTopics = pickDistinctRandomTopics(interests.length ? 3 : 5);
28006
- const topicOfInterest = Array.from(/* @__PURE__ */ new Set([...interests, ...randomTopics])).join(", ") || getRandomTopicOfInterest();
28007
- const webSearchAvailable = useMCPToolsStore.getState().getEnabledTools().some((t) => t.name === "web_search");
28008
- const knowledgeTopics = prefs.useKnowledgeForStarters ? useKnowledgeStore.getState().docs.map((d) => d.name).filter((n) => n && n.trim()).slice(0, 12) : void 0;
28009
- const args = {
28010
- limit: 9,
28011
- topicOfInterest,
28012
- modelSystemPrompt: currentModel?.systemPrompt,
28013
- interests,
28014
- knowledgeTopics,
28015
- webSearchAvailable
28016
- };
28017
- generateConversationStarters(args).then((prompts) => {
28018
- if (prompts.length > 0) {
28019
- setExamplePrompts(prompts);
28020
- setVisiblePrompts(prompts.slice(0, 3));
28021
- } else {
28022
- setExamplePrompts([]);
28023
- setVisiblePrompts([]);
28024
- hasGenerated.current = false;
28025
- }
28026
- }).catch((error) => {
28027
- setExamplePrompts([]);
28028
- setVisiblePrompts([]);
28029
- hasGenerated.current = false;
28030
- });
28031
- }, [getCurrentModel, isLoading]);
28032
- (0, import_react50.useEffect)(() => {
28033
- if (!isLoading) {
28034
- hasGenerated.current = false;
28035
- }
28036
- }, [isLoading]);
28037
- (0, import_react50.useEffect)(() => {
28038
- if (hasSentPrompt || examplePrompts.length === 0) return;
28039
- const interval = setInterval(() => {
28040
- setExamplePrompts((prev) => {
28041
- if (prev.length < 3) return prev;
28042
- const shuffled = [...prev].sort(() => 0.5 - Math.random());
28043
- setVisiblePrompts((current) => [shuffled[0], current[1], current[2]]);
28044
- setTimeout(() => {
28045
- setVisiblePrompts((current) => [shuffled[0], shuffled[1], current[2]]);
28046
- }, 400);
28047
- setTimeout(() => {
28048
- setVisiblePrompts(shuffled.slice(0, 3));
28049
- }, 800);
28050
- return shuffled;
28051
- });
28052
- }, 12e3);
28053
- return () => clearInterval(interval);
28054
- }, [hasSentPrompt, examplePrompts.length]);
28055
- const displayPrompts = isMobile ? visiblePrompts.slice(0, Math.min(visiblePrompts.length, 6)) : visiblePrompts;
28056
- return displayPrompts.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_jsx_runtime32.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
28057
- import_material31.Box,
28058
- {
28059
- ref: scrollRef,
28060
- sx: {
28061
- zIndex: 1200,
28062
- width: "100%",
28063
- display: "flex",
28064
- flexDirection: "row",
28065
- gap: isMobile ? 0.8 : 1,
28066
- px: isMobile ? 1.5 : 2,
28067
- overflowX: isMobile ? "auto" : "visible",
28068
- scrollSnapType: isMobile ? "x mandatory" : "none",
28069
- WebkitOverflowScrolling: "touch",
28070
- pb: isMobile ? 0.4 : 0,
28071
- "&::-webkit-scrollbar": { display: "none" }
28072
- },
28073
- children: displayPrompts.map((prompt, i) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
28074
- import_material31.Box,
28075
- {
28076
- component: "button",
28077
- type: "button",
28078
- sx: {
28079
- appearance: "none",
28080
- font: "inherit",
28081
- textAlign: "inherit",
28082
- "&:focus-visible": { outline: `2px solid ${theme.palette.primary.main}`, outlineOffset: 2 },
28083
- px: isMobile ? 1.4 : 2,
28084
- py: isMobile ? 1.2 : 2,
28085
- flex: isMobile ? "0 0 85%" : 1,
28086
- minWidth: isMobile ? "85%" : "auto",
28087
- display: "flex",
28088
- alignItems: "flex-start",
28089
- gap: isMobile ? 0.9 : 1,
28090
- backgroundColor: background,
28091
- borderRadius: 2,
28092
- fontSize: isMobile ? "0.875rem" : "0.9rem",
28093
- color: text,
28094
- userSelect: "none",
28095
- cursor: "pointer",
28096
- border: `1px solid ${border || (0, import_styles21.alpha)(text, 0.12)}`,
28097
- boxShadow: theme.palette.mode === "dark" ? "0 4px 18px rgba(0,0,0,0.25)" : "0 6px 20px rgba(15,23,42,0.12)",
28098
- scrollSnapAlign: isMobile ? "start" : "none",
28099
- transition: "transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease",
28100
- "&:hover": {
28101
- backgroundColor: hoverBackground,
28102
- borderColor: hoverBorder,
28103
- transform: "translateY(-2px)",
28104
- boxShadow: theme.palette.mode === "dark" ? "0 6px 22px rgba(0,0,0,0.28)" : "0 8px 24px rgba(15,23,42,0.14)"
28105
- },
28106
- "&:active": {
28107
- transform: "translateY(0) scale(0.98)"
28108
- }
28109
- },
28110
- onClick: () => {
28111
- void Promise.resolve(onSend(prompt, [])).catch(() => {
28112
- });
28113
- setHasSentPrompt(true);
28114
- },
28115
- children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
28116
- import_material31.Box,
28117
- {
28118
- sx: {
28119
- flex: 1,
28120
- lineHeight: 1.4,
28121
- fontWeight: isMobile ? 500 : 400,
28122
- textAlign: isMobile ? "left" : "center",
28123
- ...isMobile && { hyphens: "auto", wordBreak: "break-word" },
28124
- "& code": {
28125
- borderRadius: 4,
28126
- fontSize: "0.92em",
28127
- fontFamily: "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace",
28128
- backgroundColor: theme.palette.mode === "dark" ? (0, import_styles21.alpha)(theme.palette.common.white, 0.06) : (0, import_styles21.alpha)(theme.palette.text.primary, 0.06),
28129
- border: `1px solid ${(0, import_styles21.alpha)(theme.palette.text.primary, 0.15)}`,
28130
- padding: "0.15em 0.35em"
28131
- },
28132
- "& mark": {
28133
- display: "inline-block",
28134
- backgroundColor: theme.palette.mode === "dark" ? (0, import_styles21.alpha)(theme.palette.common.white, 0.06) : (0, import_styles21.alpha)(theme.palette.text.primary, 0.12),
28135
- color: theme.palette.mode === "dark" ? theme.palette.common.white : theme.palette.text.primary,
28136
- borderRadius: 4,
28137
- padding: "0.1em 0.25em"
28138
- }
28139
- },
28140
- children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
28141
- import_react_markdown3.default,
28142
- {
28143
- remarkPlugins: [import_remark_gfm3.default],
28144
- rehypePlugins: [import_rehype_raw3.default],
28145
- components: markdownComponents,
28146
- children: prompt
28147
- }
28148
- )
28149
- }
28150
- )
28151
- },
28152
- `${i}-${prompt}`
28153
- ))
28154
- }
28155
- ) });
28156
- };
28004
+ STARTERS = [
28005
+ { title: "Make sense of something", detail: "Find the important parts and the open questions.", icon: import_react51.FileText, prompt: "Help me understand the material I share next. Summarize the key points, distinguish facts from assumptions, and call out what is missing." },
28006
+ { title: "Think through a decision", detail: "Compare options against what matters to you.", icon: import_react51.ListChecks, prompt: "Help me work through a decision. Ask me for the options, constraints, and what matters most, then compare the tradeoffs." },
28007
+ { title: "Create a useful first draft", detail: "Turn a rough idea into something you can use.", icon: import_react51.PenLine, prompt: "Help me turn an idea into a useful first draft. Ask me what I am making, who it is for, and what a good result looks like." }
28008
+ ];
28157
28009
  }
28158
28010
  });
28159
28011
 
@@ -28425,12 +28277,12 @@ function burtsonThemeOptions(modeOrConfig = "dark") {
28425
28277
  }
28426
28278
  };
28427
28279
  }
28428
- var import_styles22, px;
28280
+ var import_styles21, px;
28429
28281
  var init_mui = __esm({
28430
28282
  "../../node_modules/@burtson-labs/ui/dist/mui/index.js"() {
28431
28283
  "use strict";
28432
28284
  init_tokens();
28433
- import_styles22 = require("@mui/material/styles");
28285
+ import_styles21 = require("@mui/material/styles");
28434
28286
  px = (rem) => Math.round(parseFloat(rem) * 16);
28435
28287
  }
28436
28288
  });
@@ -28698,7 +28550,7 @@ function createBanditTheme(config = {}, ...overrides) {
28698
28550
  semantics,
28699
28551
  cssVars
28700
28552
  };
28701
- return (0, import_styles23.createTheme)(
28553
+ return (0, import_styles22.createTheme)(
28702
28554
  base,
28703
28555
  {
28704
28556
  palette: {
@@ -28736,11 +28588,11 @@ function createBanditTheme(config = {}, ...overrides) {
28736
28588
  ...overrides
28737
28589
  );
28738
28590
  }
28739
- var import_styles23;
28591
+ var import_styles22;
28740
28592
  var init_createBanditTheme = __esm({
28741
28593
  "../bandit-themes/src/createBanditTheme.ts"() {
28742
28594
  "use strict";
28743
- import_styles23 = require("@mui/material/styles");
28595
+ import_styles22 = require("@mui/material/styles");
28744
28596
  init_mui();
28745
28597
  init_tokens();
28746
28598
  init_semantic();
@@ -28757,9 +28609,9 @@ function BanditThemeProvider({
28757
28609
  style,
28758
28610
  children
28759
28611
  }) {
28760
- const resolved = React26.useMemo(() => theme ?? createBanditTheme(config), [theme, config]);
28612
+ const resolved = React25.useMemo(() => theme ?? createBanditTheme(config), [theme, config]);
28761
28613
  const { cssVars, mode } = resolved.bandit;
28762
- React26.useLayoutEffect(() => {
28614
+ React25.useLayoutEffect(() => {
28763
28615
  if (scope !== "document" || typeof document === "undefined") return;
28764
28616
  const root = document.documentElement;
28765
28617
  const previous = /* @__PURE__ */ new Map();
@@ -28784,7 +28636,7 @@ function BanditThemeProvider({
28784
28636
  };
28785
28637
  }, [scope, cssVars, mode]);
28786
28638
  if (scope === "element") {
28787
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_styles24.ThemeProvider, { theme: resolved, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
28639
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_styles23.ThemeProvider, { theme: resolved, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
28788
28640
  "div",
28789
28641
  {
28790
28642
  className: [mode === "dark" ? "dark" : "light", className].filter(Boolean).join(" "),
@@ -28794,14 +28646,14 @@ function BanditThemeProvider({
28794
28646
  }
28795
28647
  ) });
28796
28648
  }
28797
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_styles24.ThemeProvider, { theme: resolved, children });
28649
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_styles23.ThemeProvider, { theme: resolved, children });
28798
28650
  }
28799
- var import_styles24, React26, import_jsx_runtime33;
28651
+ var import_styles23, React25, import_jsx_runtime33;
28800
28652
  var init_provider = __esm({
28801
28653
  "../bandit-themes/src/provider.tsx"() {
28802
28654
  "use strict";
28803
- import_styles24 = require("@mui/material/styles");
28804
- React26 = __toESM(require("react"));
28655
+ import_styles23 = require("@mui/material/styles");
28656
+ React25 = __toESM(require("react"));
28805
28657
  init_createBanditTheme();
28806
28658
  import_jsx_runtime33 = require("react/jsx-runtime");
28807
28659
  }
@@ -28938,7 +28790,7 @@ function TenantPreview({
28938
28790
  title = "Preview",
28939
28791
  renderBody
28940
28792
  }) {
28941
- const pageMode = (0, import_styles25.useTheme)().palette.mode;
28793
+ const pageMode = (0, import_styles24.useTheme)().palette.mode;
28942
28794
  const shown = modes ?? (pageMode === "light" ? ["light", "dark"] : ["dark", "light"]);
28943
28795
  return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_Stack.default, { spacing: 1.5, role: "group", "aria-label": "Branding preview", children: [
28944
28796
  title !== null && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_Typography.default, { component: "h3", variant: "subtitle2", sx: { fontWeight: 600 }, children: title }),
@@ -28978,7 +28830,7 @@ function PreviewPane({
28978
28830
  density,
28979
28831
  renderBody
28980
28832
  }) {
28981
- const theme = React27.useMemo(
28833
+ const theme = React26.useMemo(
28982
28834
  () => createBanditTheme({
28983
28835
  mode,
28984
28836
  skin,
@@ -29029,7 +28881,7 @@ function PreviewPane({
29029
28881
  }
29030
28882
  ) });
29031
28883
  }
29032
- var import_Avatar, import_Box, import_Button, import_Paper, import_Stack, import_Typography, import_styles25, React27, import_jsx_runtime34;
28884
+ var import_Avatar, import_Box, import_Button, import_Paper, import_Stack, import_Typography, import_styles24, React26, import_jsx_runtime34;
29033
28885
  var init_TenantPreview = __esm({
29034
28886
  "../bandit-themes/src/TenantPreview.tsx"() {
29035
28887
  "use strict";
@@ -29039,8 +28891,8 @@ var init_TenantPreview = __esm({
29039
28891
  import_Paper = __toESM(require("@mui/material/Paper"));
29040
28892
  import_Stack = __toESM(require("@mui/material/Stack"));
29041
28893
  import_Typography = __toESM(require("@mui/material/Typography"));
29042
- import_styles25 = require("@mui/material/styles");
29043
- React27 = __toESM(require("react"));
28894
+ import_styles24 = require("@mui/material/styles");
28895
+ React26 = __toESM(require("react"));
29044
28896
  init_createBanditTheme();
29045
28897
  init_provider();
29046
28898
  import_jsx_runtime34 = require("react/jsx-runtime");
@@ -29153,14 +29005,14 @@ var init_UnderReview = __esm({
29153
29005
  });
29154
29006
 
29155
29007
  // src/components/feedback/FeedbackPulse.tsx
29156
- var import_react51, import_material33, import_styles26, import_react52, import_jsx_runtime36, STORAGE_KEY3, COOLDOWN_DAYS, MIN_SESSION_MS, MIN_MESSAGES_SENT, CHECK_INTERVAL_MS, readLastInteraction, recordInteraction, FeedbackPulse, FeedbackPulse_default;
29008
+ var import_react52, import_material33, import_styles25, import_react53, import_jsx_runtime36, STORAGE_KEY3, COOLDOWN_DAYS, MIN_SESSION_MS, MIN_MESSAGES_SENT, CHECK_INTERVAL_MS, readLastInteraction, recordInteraction, FeedbackPulse, FeedbackPulse_default;
29157
29009
  var init_FeedbackPulse = __esm({
29158
29010
  "src/components/feedback/FeedbackPulse.tsx"() {
29159
29011
  "use strict";
29160
- import_react51 = require("react");
29012
+ import_react52 = require("react");
29161
29013
  import_material33 = require("@mui/material");
29162
- import_styles26 = require("@mui/material/styles");
29163
- import_react52 = require("@burtson-labs/icons/react");
29014
+ import_styles25 = require("@mui/material/styles");
29015
+ import_react53 = require("@burtson-labs/icons/react");
29164
29016
  init_conversationStore();
29165
29017
  init_FeedbackModal();
29166
29018
  init_debugLogger();
@@ -29185,22 +29037,22 @@ var init_FeedbackPulse = __esm({
29185
29037
  debugLogger.info("FeedbackPulse: interaction recorded", { outcome });
29186
29038
  };
29187
29039
  FeedbackPulse = ({ isMobile, feedbackEmail }) => {
29188
- const theme = (0, import_styles26.useTheme)();
29189
- const [visible, setVisible] = (0, import_react51.useState)(false);
29190
- const [thanked, setThanked] = (0, import_react51.useState)(false);
29191
- const [modalOpen, setModalOpen] = (0, import_react51.useState)(false);
29192
- const mountedAtRef = (0, import_react51.useRef)(Date.now());
29193
- const baselineMessagesRef = (0, import_react51.useRef)(null);
29040
+ const theme = (0, import_styles25.useTheme)();
29041
+ const [visible, setVisible] = (0, import_react52.useState)(false);
29042
+ const [thanked, setThanked] = (0, import_react52.useState)(false);
29043
+ const [modalOpen, setModalOpen] = (0, import_react52.useState)(false);
29044
+ const mountedAtRef = (0, import_react52.useRef)(Date.now());
29045
+ const baselineMessagesRef = (0, import_react52.useRef)(null);
29194
29046
  const totalMessages = useConversationStore(
29195
29047
  (s) => s.conversations.reduce((n, c) => n + c.history.length, 0)
29196
29048
  );
29197
29049
  const hydrated = useConversationStore((s) => s._hasHydrated);
29198
- (0, import_react51.useEffect)(() => {
29050
+ (0, import_react52.useEffect)(() => {
29199
29051
  if (hydrated && baselineMessagesRef.current === null) {
29200
29052
  baselineMessagesRef.current = totalMessages;
29201
29053
  }
29202
29054
  }, [hydrated, totalMessages]);
29203
- (0, import_react51.useEffect)(() => {
29055
+ (0, import_react52.useEffect)(() => {
29204
29056
  const cooldownMs = COOLDOWN_DAYS * 24 * 60 * 60 * 1e3;
29205
29057
  const forced = typeof window !== "undefined" && new URLSearchParams(window.location.search).has("feedbackPulse");
29206
29058
  const check = () => {
@@ -29259,7 +29111,7 @@ var init_FeedbackPulse = __esm({
29259
29111
  color: theme.palette.text.secondary,
29260
29112
  transition: "background-color 0.15s ease, transform 0.1s ease",
29261
29113
  "&:hover": {
29262
- bgcolor: (0, import_styles26.alpha)(theme.palette.text.primary, 0.06),
29114
+ bgcolor: (0, import_styles25.alpha)(theme.palette.text.primary, 0.06),
29263
29115
  color: theme.palette.text.primary
29264
29116
  },
29265
29117
  "&:active": { transform: "scale(0.96)" }
@@ -29288,17 +29140,17 @@ var init_FeedbackPulse = __esm({
29288
29140
  borderRadius: 3,
29289
29141
  border: `1px solid ${theme.palette.divider}`,
29290
29142
  bgcolor: theme.palette.background.paper,
29291
- boxShadow: `0 12px 40px ${(0, import_styles26.alpha)(theme.palette.common.black, theme.palette.mode === "dark" ? 0.5 : 0.18)}`
29143
+ boxShadow: `0 12px 40px ${(0, import_styles25.alpha)(theme.palette.common.black, theme.palette.mode === "dark" ? 0.5 : 0.18)}`
29292
29144
  },
29293
29145
  children: thanked ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_material33.Typography, { sx: { textAlign: "center", py: 1.5, fontWeight: 600 }, children: "Thanks for the feedback!" }) : /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
29294
29146
  /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_material33.Box, { sx: { display: "flex", alignItems: "center", mb: 0.5 }, children: [
29295
29147
  /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_material33.Typography, { variant: "body2", sx: { fontWeight: 600, flex: 1 }, children: "How's Bandit doing?" }),
29296
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_material33.IconButton, { size: "small", onClick: dismiss, "aria-label": "Dismiss feedback prompt", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react52.X, { size: 16 }) })
29148
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_material33.IconButton, { size: "small", onClick: dismiss, "aria-label": "Dismiss feedback prompt", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react53.X, { size: 16 }) })
29297
29149
  ] }),
29298
29150
  /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_material33.Box, { sx: { display: "flex", justifyContent: "space-evenly" }, children: [
29299
- choice(/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react52.Smile, { size: 22, color: theme.palette.success.main }), "Good", "good"),
29300
- choice(/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react52.Meh, { size: 22, color: theme.palette.warning.main }), "Fine", "fine"),
29301
- choice(/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react52.Frown, { size: 22, color: theme.palette.error.main }), "Bad", "bad")
29151
+ choice(/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react53.Smile, { size: 22, color: theme.palette.success.main }), "Good", "good"),
29152
+ choice(/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react53.Meh, { size: 22, color: theme.palette.warning.main }), "Fine", "fine"),
29153
+ choice(/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react53.Frown, { size: 22, color: theme.palette.error.main }), "Bad", "bad")
29302
29154
  ] })
29303
29155
  ] })
29304
29156
  }
@@ -29318,16 +29170,16 @@ var init_FeedbackPulse = __esm({
29318
29170
  });
29319
29171
 
29320
29172
  // src/hooks/useNotificationService.ts
29321
- var import_react53, useNotificationService;
29173
+ var import_react54, useNotificationService;
29322
29174
  var init_useNotificationService = __esm({
29323
29175
  "src/hooks/useNotificationService.ts"() {
29324
29176
  "use strict";
29325
- import_react53 = require("react");
29177
+ import_react54 = require("react");
29326
29178
  init_NotificationProvider();
29327
29179
  init_notificationService();
29328
29180
  useNotificationService = () => {
29329
29181
  const notificationContext = useNotification();
29330
- (0, import_react53.useEffect)(() => {
29182
+ (0, import_react54.useEffect)(() => {
29331
29183
  notificationService.setContext(notificationContext);
29332
29184
  }, [notificationContext]);
29333
29185
  return {
@@ -29434,11 +29286,11 @@ var init_ConnectionStatus = __esm({
29434
29286
  });
29435
29287
 
29436
29288
  // src/hooks/useVoiceMode.ts
29437
- var import_react54, RMS_BASELINE, RMS_NORMALIZER, computeRms, pickSupportedMimeType, useVoiceMode;
29289
+ var import_react55, RMS_BASELINE, RMS_NORMALIZER, computeRms, pickSupportedMimeType, useVoiceMode;
29438
29290
  var init_useVoiceMode = __esm({
29439
29291
  "src/hooks/useVoiceMode.ts"() {
29440
29292
  "use strict";
29441
- import_react54 = require("react");
29293
+ import_react55 = require("react");
29442
29294
  init_stt_client();
29443
29295
  init_debugLogger();
29444
29296
  init_voiceModeStore();
@@ -29471,11 +29323,11 @@ var init_useVoiceMode = __esm({
29471
29323
  const setError = useVoiceModeStore((state) => state.setError);
29472
29324
  const resetTransientState = useVoiceModeStore((state) => state.resetTransientState);
29473
29325
  const setLastTranscript = useVoiceModeStore((state) => state.setLastTranscript);
29474
- const configRef = (0, import_react54.useRef)(config);
29475
- (0, import_react54.useEffect)(() => {
29326
+ const configRef = (0, import_react55.useRef)(config);
29327
+ (0, import_react55.useEffect)(() => {
29476
29328
  configRef.current = config;
29477
29329
  }, [config]);
29478
- (0, import_react54.useEffect)(() => {
29330
+ (0, import_react55.useEffect)(() => {
29479
29331
  if (!enabled) {
29480
29332
  return () => void 0;
29481
29333
  }
@@ -29736,15 +29588,15 @@ var chat_exports = {};
29736
29588
  __export(chat_exports, {
29737
29589
  default: () => chat_default
29738
29590
  });
29739
- var import_react55, import_material35, import_styles27, import_react_router_dom5, import_react56, import_jsx_runtime38, ChatContent, Chat, chat_default;
29591
+ var import_react56, import_material35, import_styles26, import_react_router_dom5, import_react57, import_jsx_runtime38, ChatContent, Chat, chat_default;
29740
29592
  var init_chat2 = __esm({
29741
29593
  "src/chat/chat.tsx"() {
29742
29594
  "use strict";
29743
- import_react55 = require("react");
29595
+ import_react56 = require("react");
29744
29596
  init_custom_logo();
29745
29597
  init_indexedDBService();
29746
29598
  import_material35 = require("@mui/material");
29747
- import_styles27 = require("@mui/material/styles");
29599
+ import_styles26 = require("@mui/material/styles");
29748
29600
  init_chat_tokens();
29749
29601
  init_chat_skeleton();
29750
29602
  init_aiQueryStore();
@@ -29786,7 +29638,7 @@ var init_chat2 = __esm({
29786
29638
  init_FeatureFlagContext();
29787
29639
  init_knowledgeStore();
29788
29640
  init_icons();
29789
- import_react56 = require("@burtson-labs/icons/react");
29641
+ import_react57 = require("@burtson-labs/icons/react");
29790
29642
  import_jsx_runtime38 = require("react/jsx-runtime");
29791
29643
  ChatContent = () => {
29792
29644
  const packageSettings = usePackageSettingsStore((state) => state.settings);
@@ -29796,8 +29648,8 @@ var init_chat2 = __esm({
29796
29648
  const ossMode = isOSSMode() || !packageSettings?.featureFlags?.subscriptionType;
29797
29649
  const playgroundBypassAccess = packageSettings?.playgroundBypassAuth || typeof window !== "undefined" && window.location.pathname.includes("/playground");
29798
29650
  const notificationService2 = useNotificationService();
29799
- const [selectedTheme, setSelectedTheme] = (0, import_react55.useState)(null);
29800
- const [themeLoading, setThemeLoading] = (0, import_react55.useState)(true);
29651
+ const [selectedTheme, setSelectedTheme] = (0, import_react56.useState)(null);
29652
+ const [themeLoading, setThemeLoading] = (0, import_react56.useState)(true);
29801
29653
  const token = authenticationService.getToken();
29802
29654
  const claims = token ? authenticationService.parseJwtClaims(token) : null;
29803
29655
  const baseTheme = registry_default[selectedTheme ?? "bandit-dark"] || banditDarkTheme;
@@ -29824,12 +29676,12 @@ var init_chat2 = __esm({
29824
29676
  } = useVoiceStore();
29825
29677
  const isVoiceModeEnabled = useVoiceModeStore((state) => state.enabled);
29826
29678
  const canvasOpen = useCanvasStore((state) => state.open);
29827
- const previousVoiceModeEnabledRef = (0, import_react55.useRef)(isVoiceModeEnabled);
29828
- const historyRef = (0, import_react55.useRef)(history);
29829
- (0, import_react55.useEffect)(() => {
29679
+ const previousVoiceModeEnabledRef = (0, import_react56.useRef)(isVoiceModeEnabled);
29680
+ const historyRef = (0, import_react56.useRef)(history);
29681
+ (0, import_react56.useEffect)(() => {
29830
29682
  historyRef.current = history;
29831
29683
  }, [history]);
29832
- (0, import_react55.useEffect)(() => {
29684
+ (0, import_react56.useEffect)(() => {
29833
29685
  if (!hydrated) return;
29834
29686
  const params = new URLSearchParams(window.location.search);
29835
29687
  const title = params.get("title") || "";
@@ -29845,7 +29697,7 @@ var init_chat2 = __esm({
29845
29697
  stop: ttsStop,
29846
29698
  isAvailable: isTTSAvailable
29847
29699
  } = useTTS();
29848
- (0, import_react55.useEffect)(() => {
29700
+ (0, import_react56.useEffect)(() => {
29849
29701
  const timer = setTimeout(() => {
29850
29702
  const isAuthenticated = authenticationService.isAuthenticated();
29851
29703
  if (!initialized || availableVoices.length === 0) {
@@ -29859,7 +29711,7 @@ var init_chat2 = __esm({
29859
29711
  }, 500);
29860
29712
  return () => clearTimeout(timer);
29861
29713
  }, [initialized, availableVoices.length, loadVoicesFromAPI, token]);
29862
- (0, import_react55.useEffect)(() => {
29714
+ (0, import_react56.useEffect)(() => {
29863
29715
  const isAuthenticated = authenticationService.isAuthenticated();
29864
29716
  if (packageSettings?.gatewayApiUrl && availableVoices.length === 0 && !initialized) {
29865
29717
  if (token && isAuthenticated) {
@@ -29871,22 +29723,22 @@ var init_chat2 = __esm({
29871
29723
  }
29872
29724
  }, [packageSettings?.gatewayApiUrl, availableVoices.length, initialized, loadVoicesFromAPI, token]);
29873
29725
  const provider = useAIProviderStore((state) => state.provider);
29874
- const inputRef = (0, import_react55.useRef)(null);
29875
- const [pastedImages, setPastedImages] = (0, import_react55.useState)([]);
29876
- const inputContainerRef = (0, import_react55.useRef)(null);
29877
- const [inputHeight, setInputHeight] = (0, import_react55.useState)(80);
29878
- const [isSubmitting, setIsSubmitting] = (0, import_react55.useState)(false);
29879
- const [pendingMessage, setPendingMessage] = (0, import_react55.useState)(null);
29726
+ const inputRef = (0, import_react56.useRef)(null);
29727
+ const [pastedImages, setPastedImages] = (0, import_react56.useState)([]);
29728
+ const inputContainerRef = (0, import_react56.useRef)(null);
29729
+ const [inputHeight, setInputHeight] = (0, import_react56.useState)(80);
29730
+ const [isSubmitting, setIsSubmitting] = (0, import_react56.useState)(false);
29731
+ const [pendingMessage, setPendingMessage] = (0, import_react56.useState)(null);
29880
29732
  const { conversations, currentId, _hasHydrated, hydrate, toggleIncognito } = useConversationStore();
29881
29733
  const isTemporaryChat = Boolean(conversations.find((c) => c.id === currentId)?.incognito);
29882
- const [isMobile, setIsMobile] = (0, import_react55.useState)(false);
29883
- const [drawerOpen, setDrawerOpen] = (0, import_react55.useState)(false);
29884
- const [mobileConversationsOpen, setMobileConversationsOpen] = (0, import_react55.useState)(false);
29885
- const cardSwipeStartXRef = (0, import_react55.useRef)(null);
29886
- const dragStartRef = (0, import_react55.useRef)(null);
29887
- const [drawerDragX, setDrawerDragX] = (0, import_react55.useState)(null);
29888
- const [drawerSettling, setDrawerSettling] = (0, import_react55.useState)(false);
29889
- const [drawerSwap, setDrawerSwap] = (0, import_react55.useState)(false);
29734
+ const [isMobile, setIsMobile] = (0, import_react56.useState)(false);
29735
+ const [drawerOpen, setDrawerOpen] = (0, import_react56.useState)(false);
29736
+ const [mobileConversationsOpen, setMobileConversationsOpen] = (0, import_react56.useState)(false);
29737
+ const cardSwipeStartXRef = (0, import_react56.useRef)(null);
29738
+ const dragStartRef = (0, import_react56.useRef)(null);
29739
+ const [drawerDragX, setDrawerDragX] = (0, import_react56.useState)(null);
29740
+ const [drawerSettling, setDrawerSettling] = (0, import_react56.useState)(false);
29741
+ const [drawerSwap, setDrawerSwap] = (0, import_react56.useState)(false);
29890
29742
  const drawerOpenOffset = () => (typeof window === "undefined" ? 360 : Math.min(window.innerWidth - 56, 360)) - 12;
29891
29743
  const drawerDragStart = (e) => {
29892
29744
  const t = e.touches[0];
@@ -29946,7 +29798,7 @@ var init_chat2 = __esm({
29946
29798
  translate: `${drawerDragX}px 0`,
29947
29799
  transition: drawerSettling ? "translate 0.22s cubic-bezier(0.2, 0.8, 0.2, 1)" : "none"
29948
29800
  } : void 0;
29949
- (0, import_react55.useEffect)(() => {
29801
+ (0, import_react56.useEffect)(() => {
29950
29802
  if (typeof document === "undefined") return;
29951
29803
  const meta = document.querySelector('meta[name="theme-color"]');
29952
29804
  if (!meta) return;
@@ -29964,36 +29816,36 @@ var init_chat2 = __esm({
29964
29816
  const chatContainerEl = chatContainerRef.current;
29965
29817
  const scrollTargetEl = scrollTargetRef.current;
29966
29818
  const { isSlowConnection, connectionQuality, trackRequestStart, trackRequestEnd } = useNetworkStatus();
29967
- const [showScrollToBottom, setShowScrollToBottom] = (0, import_react55.useState)(false);
29968
- const [streamBuffer, setStreamBuffer] = (0, import_react55.useState)("");
29969
- const [responseStarted, setResponseStarted] = (0, import_react55.useState)(false);
29970
- const [isStreaming, setIsStreaming] = (0, import_react55.useState)(false);
29971
- const [isThinking, setIsThinking] = (0, import_react55.useState)(false);
29819
+ const [showScrollToBottom, setShowScrollToBottom] = (0, import_react56.useState)(false);
29820
+ const [streamBuffer, setStreamBuffer] = (0, import_react56.useState)("");
29821
+ const [responseStarted, setResponseStarted] = (0, import_react56.useState)(false);
29822
+ const [isStreaming, setIsStreaming] = (0, import_react56.useState)(false);
29823
+ const [isThinking, setIsThinking] = (0, import_react56.useState)(false);
29972
29824
  const initialLogoState = history.length === 0;
29973
- const [logoVisible, setLogoVisible] = (0, import_react55.useState)(initialLogoState);
29974
- const [logoShouldRender, setLogoShouldRender] = (0, import_react55.useState)(initialLogoState);
29975
- const streamingGraceUntilRef = (0, import_react55.useRef)(0);
29825
+ const [logoVisible, setLogoVisible] = (0, import_react56.useState)(initialLogoState);
29826
+ const [logoShouldRender, setLogoShouldRender] = (0, import_react56.useState)(initialLogoState);
29827
+ const streamingGraceUntilRef = (0, import_react56.useRef)(0);
29976
29828
  const GRACE_MS = 450;
29977
29829
  const GRACE_OFFSET_DESKTOP = 28;
29978
29830
  const GRACE_OFFSET_MOBILE = 20;
29979
- const followStreamRef = (0, import_react55.useRef)(true);
29980
- const lastSpokenResponseRef = (0, import_react55.useRef)(null);
29981
- const previousConversationIdRef = (0, import_react55.useRef)(null);
29982
- const logoFadeTimeoutRef = (0, import_react55.useRef)(null);
29983
- const [branding, setBranding] = (0, import_react55.useState)(null);
29984
- const [brandingLoading, setBrandingLoading] = (0, import_react55.useState)(true);
29985
- const isBrandingLoadInProgressRef = (0, import_react55.useRef)(false);
29831
+ const followStreamRef = (0, import_react56.useRef)(true);
29832
+ const lastSpokenResponseRef = (0, import_react56.useRef)(null);
29833
+ const previousConversationIdRef = (0, import_react56.useRef)(null);
29834
+ const logoFadeTimeoutRef = (0, import_react56.useRef)(null);
29835
+ const [branding, setBranding] = (0, import_react56.useState)(null);
29836
+ const [brandingLoading, setBrandingLoading] = (0, import_react56.useState)(true);
29837
+ const isBrandingLoadInProgressRef = (0, import_react56.useRef)(false);
29986
29838
  const logoOnly = history.length === 0 && !brandingLoading;
29987
29839
  const knowledgeDocs = useKnowledgeStore((s) => s.docs);
29988
29840
  const knowledgeLoaded = useKnowledgeStore((s) => s.isLoaded);
29989
- const [knowledgeNudgeDismissed, setKnowledgeNudgeDismissed] = (0, import_react55.useState)(() => {
29841
+ const [knowledgeNudgeDismissed, setKnowledgeNudgeDismissed] = (0, import_react56.useState)(() => {
29990
29842
  try {
29991
29843
  return localStorage.getItem("bandit.knowledgeNudge.dismissed") === "true";
29992
29844
  } catch {
29993
29845
  return false;
29994
29846
  }
29995
29847
  });
29996
- const dismissKnowledgeNudge = (0, import_react55.useCallback)(() => {
29848
+ const dismissKnowledgeNudge = (0, import_react56.useCallback)(() => {
29997
29849
  setKnowledgeNudgeDismissed(true);
29998
29850
  try {
29999
29851
  localStorage.setItem("bandit.knowledgeNudge.dismissed", "true");
@@ -30007,7 +29859,7 @@ var init_chat2 = __esm({
30007
29859
  window.location.assign(to);
30008
29860
  }
30009
29861
  };
30010
- (0, import_react55.useEffect)(() => {
29862
+ (0, import_react56.useEffect)(() => {
30011
29863
  const isEmptyConversation = (history?.length ?? 0) === 0;
30012
29864
  const isSending = Boolean(pendingMessage);
30013
29865
  const shouldShowLogo = isEmptyConversation && !isSending;
@@ -30037,7 +29889,7 @@ var init_chat2 = __esm({
30037
29889
  }, 500);
30038
29890
  }
30039
29891
  }, [history, pendingMessage]);
30040
- (0, import_react55.useEffect)(() => {
29892
+ (0, import_react56.useEffect)(() => {
30041
29893
  if (!brandingLoading && !themeLoading) {
30042
29894
  return;
30043
29895
  }
@@ -30053,18 +29905,18 @@ var init_chat2 = __esm({
30053
29905
  }, 2500);
30054
29906
  return () => window.clearTimeout(timeoutId);
30055
29907
  }, [brandingLoading, themeLoading, selectedTheme]);
30056
- (0, import_react55.useEffect)(() => () => {
29908
+ (0, import_react56.useEffect)(() => () => {
30057
29909
  if (logoFadeTimeoutRef.current) {
30058
29910
  window.clearTimeout(logoFadeTimeoutRef.current);
30059
29911
  logoFadeTimeoutRef.current = null;
30060
29912
  }
30061
29913
  }, []);
30062
- (0, import_react55.useEffect)(() => {
29914
+ (0, import_react56.useEffect)(() => {
30063
29915
  if (isStreaming && streamBuffer.trim() === "") {
30064
29916
  streamingGraceUntilRef.current = Date.now() + GRACE_MS;
30065
29917
  }
30066
29918
  }, [isStreaming, streamBuffer]);
30067
- (0, import_react55.useEffect)(() => {
29919
+ (0, import_react56.useEffect)(() => {
30068
29920
  if (!isStreaming) return;
30069
29921
  const container = chatContainerRef.current;
30070
29922
  if (!container) return;
@@ -30075,13 +29927,13 @@ var init_chat2 = __esm({
30075
29927
  container.scrollTo({ top: targetTop, behavior: "smooth" });
30076
29928
  }
30077
29929
  }, [streamBuffer, isStreaming, isMobile, chatContainerRef]);
30078
- (0, import_react55.useEffect)(() => {
29930
+ (0, import_react56.useEffect)(() => {
30079
29931
  if (!_hasHydrated) {
30080
29932
  debugLogger.info("Chat component triggering conversation store hydration");
30081
29933
  hydrate();
30082
29934
  }
30083
29935
  }, [_hasHydrated, hydrate]);
30084
- (0, import_react55.useEffect)(() => {
29936
+ (0, import_react56.useEffect)(() => {
30085
29937
  const loadBrandingAndTheme = async () => {
30086
29938
  if (isBrandingLoadInProgressRef.current) {
30087
29939
  debugLogger.warn("Branding loading already in progress, skipping");
@@ -30270,7 +30122,7 @@ var init_chat2 = __esm({
30270
30122
  window.removeEventListener("bandit-theme-changed", handleThemeChange);
30271
30123
  };
30272
30124
  }, []);
30273
- (0, import_react55.useEffect)(() => {
30125
+ (0, import_react56.useEffect)(() => {
30274
30126
  if (!chatContainerEl) return;
30275
30127
  const blurInputOnTouchScroll = () => {
30276
30128
  if (document.activeElement === inputRef.current) inputRef.current?.blur();
@@ -30278,13 +30130,13 @@ var init_chat2 = __esm({
30278
30130
  chatContainerEl.addEventListener("touchmove", blurInputOnTouchScroll, { passive: true });
30279
30131
  return () => chatContainerEl.removeEventListener("touchmove", blurInputOnTouchScroll);
30280
30132
  }, [chatContainerEl]);
30281
- (0, import_react55.useEffect)(() => {
30133
+ (0, import_react56.useEffect)(() => {
30282
30134
  const handleResize = () => setIsMobile(window.innerWidth <= 768);
30283
30135
  handleResize();
30284
30136
  window.addEventListener("resize", handleResize);
30285
30137
  return () => window.removeEventListener("resize", handleResize);
30286
30138
  }, []);
30287
- (0, import_react55.useEffect)(() => {
30139
+ (0, import_react56.useEffect)(() => {
30288
30140
  const setViewportHeight = () => {
30289
30141
  document.documentElement.style.setProperty(
30290
30142
  "--vh",
@@ -30295,7 +30147,7 @@ var init_chat2 = __esm({
30295
30147
  window.addEventListener("resize", setViewportHeight);
30296
30148
  return () => window.removeEventListener("resize", setViewportHeight);
30297
30149
  }, []);
30298
- (0, import_react55.useEffect)(() => {
30150
+ (0, import_react56.useEffect)(() => {
30299
30151
  if (!chatContainerEl) return;
30300
30152
  let rafId = null;
30301
30153
  const update = () => {
@@ -30314,7 +30166,7 @@ var init_chat2 = __esm({
30314
30166
  chatContainerEl.removeEventListener(SCROLL_STATE_CHANGED_EVENT, update);
30315
30167
  };
30316
30168
  }, [chatContainerEl, getScrollState]);
30317
- (0, import_react55.useEffect)(() => {
30169
+ (0, import_react56.useEffect)(() => {
30318
30170
  if (!chatContainerEl) return;
30319
30171
  let observer = null;
30320
30172
  let rafId = null;
@@ -30349,7 +30201,7 @@ var init_chat2 = __esm({
30349
30201
  if (observer) observer.disconnect();
30350
30202
  };
30351
30203
  }, [chatContainerEl, scrollTargetEl, scrollTargetRef, getScrollState, inputHeight, history.length]);
30352
- (0, import_react55.useEffect)(() => {
30204
+ (0, import_react56.useEffect)(() => {
30353
30205
  const isTransitioning = isStreaming || streamBuffer.trim() === "";
30354
30206
  const delay = isTransitioning ? 400 : 100;
30355
30207
  const timer = setTimeout(() => {
@@ -30358,7 +30210,7 @@ var init_chat2 = __esm({
30358
30210
  }, delay);
30359
30211
  return () => clearTimeout(timer);
30360
30212
  }, [history, streamBuffer, getScrollState, isStreaming]);
30361
- (0, import_react55.useLayoutEffect)(() => {
30213
+ (0, import_react56.useLayoutEffect)(() => {
30362
30214
  const scrollState = getScrollState();
30363
30215
  const now = Date.now();
30364
30216
  if (isStreaming && scrollState.shouldAutoScroll && followStreamRef.current) {
@@ -30392,7 +30244,7 @@ var init_chat2 = __esm({
30392
30244
  return () => clearTimeout(scrollTimer);
30393
30245
  }
30394
30246
  }, [history, isStreaming, scrollToBottom, getScrollState, isMobile, chatContainerRef]);
30395
- (0, import_react55.useEffect)(() => {
30247
+ (0, import_react56.useEffect)(() => {
30396
30248
  const observer = new ResizeObserver(() => {
30397
30249
  if (inputContainerRef.current)
30398
30250
  setInputHeight(inputContainerRef.current.offsetHeight);
@@ -30403,7 +30255,7 @@ var init_chat2 = __esm({
30403
30255
  }
30404
30256
  return () => observer.disconnect();
30405
30257
  }, []);
30406
- (0, import_react55.useEffect)(() => {
30258
+ (0, import_react56.useEffect)(() => {
30407
30259
  if (!hydrated || !_hasHydrated) return;
30408
30260
  if (currentId === null) {
30409
30261
  useAIQueryStore.setState({ history: [] });
@@ -30452,7 +30304,7 @@ var init_chat2 = __esm({
30452
30304
  setResponse,
30453
30305
  setComponentStatus
30454
30306
  ]);
30455
- (0, import_react55.useEffect)(() => {
30307
+ (0, import_react56.useEffect)(() => {
30456
30308
  debugLogger.info("Chat component conversation state", {
30457
30309
  hasHydrated: _hasHydrated,
30458
30310
  conversationCount: conversations.length,
@@ -30461,7 +30313,7 @@ var init_chat2 = __esm({
30461
30313
  storeState: "main-chat"
30462
30314
  });
30463
30315
  }, [_hasHydrated, conversations, currentId]);
30464
- (0, import_react55.useEffect)(() => {
30316
+ (0, import_react56.useEffect)(() => {
30465
30317
  if (!_hasHydrated || !chatContainerEl) return;
30466
30318
  let rafId = null;
30467
30319
  const sync = () => {
@@ -30475,8 +30327,8 @@ var init_chat2 = __esm({
30475
30327
  if (rafId) cancelAnimationFrame(rafId);
30476
30328
  };
30477
30329
  }, [_hasHydrated, chatContainerEl, getScrollState, history.length]);
30478
- const sendAckRef = (0, import_react55.useRef)(null);
30479
- const settleSendAck = (0, import_react55.useCallback)((outcome) => {
30330
+ const sendAckRef = (0, import_react56.useRef)(null);
30331
+ const settleSendAck = (0, import_react56.useCallback)((outcome) => {
30480
30332
  const ack = sendAckRef.current;
30481
30333
  if (!ack) return;
30482
30334
  sendAckRef.current = null;
@@ -30505,7 +30357,7 @@ var init_chat2 = __esm({
30505
30357
  notificationService2?.handleHttpError(error);
30506
30358
  }
30507
30359
  });
30508
- const handleStop = (0, import_react55.useCallback)(() => {
30360
+ const handleStop = (0, import_react56.useCallback)(() => {
30509
30361
  try {
30510
30362
  aiProvider.cancel();
30511
30363
  } catch (error) {
@@ -30514,7 +30366,7 @@ var init_chat2 = __esm({
30514
30366
  });
30515
30367
  }
30516
30368
  }, [aiProvider]);
30517
- const handleVoiceInterrupt = (0, import_react55.useCallback)(() => {
30369
+ const handleVoiceInterrupt = (0, import_react56.useCallback)(() => {
30518
30370
  try {
30519
30371
  ttsStop();
30520
30372
  } catch (error) {
@@ -30533,7 +30385,7 @@ var init_chat2 = __esm({
30533
30385
  handleStop();
30534
30386
  }
30535
30387
  }, [ttsStop, isStreaming, handleStop]);
30536
- const handleSend = (0, import_react55.useCallback)(
30388
+ const handleSend = (0, import_react56.useCallback)(
30537
30389
  (question, images, displayQuestion) => {
30538
30390
  sendAckRef.current?.resolve();
30539
30391
  const acknowledged = new Promise((resolve, reject) => {
@@ -30670,7 +30522,7 @@ var init_chat2 = __esm({
30670
30522
  trackRequestStart
30671
30523
  ]
30672
30524
  );
30673
- const handleVoiceTranscription = (0, import_react55.useCallback)(
30525
+ const handleVoiceTranscription = (0, import_react56.useCallback)(
30674
30526
  (text) => {
30675
30527
  const cleaned = text.trim();
30676
30528
  if (!cleaned) {
@@ -30688,7 +30540,7 @@ var init_chat2 = __esm({
30688
30540
  onInterrupt: handleVoiceInterrupt,
30689
30541
  onError: (message) => notificationService2?.showError?.(message)
30690
30542
  });
30691
- (0, import_react55.useEffect)(() => {
30543
+ (0, import_react56.useEffect)(() => {
30692
30544
  const previouslyEnabled = previousVoiceModeEnabledRef.current;
30693
30545
  previousVoiceModeEnabledRef.current = isVoiceModeEnabled;
30694
30546
  if (!previouslyEnabled && isVoiceModeEnabled) {
@@ -30713,7 +30565,7 @@ var init_chat2 = __esm({
30713
30565
  }
30714
30566
  }
30715
30567
  }, [isVoiceModeEnabled, ttsStop]);
30716
- (0, import_react55.useEffect)(() => {
30568
+ (0, import_react56.useEffect)(() => {
30717
30569
  if (!isVoiceModeEnabled || !isStreaming) {
30718
30570
  return;
30719
30571
  }
@@ -30733,7 +30585,7 @@ var init_chat2 = __esm({
30733
30585
  }
30734
30586
  lastSpokenResponseRef.current = null;
30735
30587
  }, [isStreaming, isVoiceModeEnabled, ttsStop]);
30736
- (0, import_react55.useEffect)(() => {
30588
+ (0, import_react56.useEffect)(() => {
30737
30589
  if (!isVoiceModeEnabled) {
30738
30590
  lastSpokenResponseRef.current = null;
30739
30591
  return;
@@ -30774,13 +30626,13 @@ var init_chat2 = __esm({
30774
30626
  cancelled = true;
30775
30627
  };
30776
30628
  }, [history, isStreaming, isVoiceModeEnabled, isTTSAvailable, ttsSpeak]);
30777
- const handleModelChange = (0, import_react55.useCallback)(
30629
+ const handleModelChange = (0, import_react56.useCallback)(
30778
30630
  (modelId) => {
30779
30631
  setSelectedModel(modelId);
30780
30632
  },
30781
30633
  [setSelectedModel]
30782
30634
  );
30783
- const handleVoiceChange = (0, import_react55.useCallback)(async (voiceId) => {
30635
+ const handleVoiceChange = (0, import_react56.useCallback)(async (voiceId) => {
30784
30636
  ttsStop();
30785
30637
  stopTTS();
30786
30638
  setSelectedVoice(voiceId);
@@ -30954,7 +30806,7 @@ var init_chat2 = __esm({
30954
30806
  whiteSpace: "nowrap"
30955
30807
  }),
30956
30808
  children: [
30957
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react56.Ghost, { size: 14, "aria-hidden": true }),
30809
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react57.Ghost, { size: 14, "aria-hidden": true }),
30958
30810
  "Temporary chat",
30959
30811
  /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
30960
30812
  import_material35.Box,
@@ -30984,7 +30836,7 @@ var init_chat2 = __esm({
30984
30836
  "@media (pointer: coarse)": { "&::after": { content: '""', position: "absolute", inset: -11 } },
30985
30837
  "&:hover": {
30986
30838
  opacity: 1,
30987
- bgcolor: (0, import_styles27.alpha)(theme.palette.getContrastText(theme.palette.text.primary), 0.16)
30839
+ bgcolor: (0, import_styles26.alpha)(theme.palette.getContrastText(theme.palette.text.primary), 0.16)
30988
30840
  }
30989
30841
  }),
30990
30842
  children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_x.X, { fontSize: "inherit", "aria-hidden": true })
@@ -31170,7 +31022,17 @@ var init_chat2 = __esm({
31170
31022
  },
31171
31023
  children: [
31172
31024
  /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_material35.Box, { sx: { flex: "1 1 auto" } }),
31173
- history.length === 0 && componentStatus !== "Loading" && !pendingMessage && preferences.chatSuggestionsEnabled && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_material35.Box, { sx: { marginBottom: "20px" }, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(QuerySuggestionPicker, { onSend: handleSend, inputHeight }) }),
31025
+ history.length === 0 && componentStatus !== "Loading" && !pendingMessage && preferences.chatSuggestionsEnabled && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_material35.Box, { sx: { marginBottom: "20px", width: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
31026
+ QuerySuggestionPicker,
31027
+ {
31028
+ onSend: handleSend,
31029
+ onSelect: (prompt) => {
31030
+ setInputValue(prompt);
31031
+ inputRef.current?.focus();
31032
+ },
31033
+ inputHeight
31034
+ }
31035
+ ) }),
31174
31036
  /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(rate_limit_prompt_default, {}),
31175
31037
  /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ask_user_card_default, {}),
31176
31038
  /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
@@ -31766,7 +31628,7 @@ var chat_provider_default = ChatProvider;
31766
31628
  init_chat2();
31767
31629
 
31768
31630
  // src/management/management.tsx
31769
- var import_react84 = require("react");
31631
+ var import_react85 = require("react");
31770
31632
  var import_useMediaQuery2 = __toESM(require("@mui/material/useMediaQuery"));
31771
31633
  init_useKnowledgeStore();
31772
31634
  init_indexedDBService();
@@ -31774,22 +31636,22 @@ var import_material60 = require("@mui/material");
31774
31636
  var import_react_router_dom7 = require("react-router-dom");
31775
31637
 
31776
31638
  // src/modals/chat-modal/chat-modal.tsx
31777
- var import_react65 = require("react");
31639
+ var import_react66 = require("react");
31778
31640
  var import_material43 = require("@mui/material");
31779
31641
  var import_react_router_dom6 = require("react-router-dom");
31780
31642
 
31781
31643
  // src/modals/chat-modal/draggable-box.tsx
31782
- var import_react57 = __toESM(require("react"));
31644
+ var import_react58 = __toESM(require("react"));
31783
31645
  var import_material36 = require("@mui/material");
31784
31646
  var import_jsx_runtime39 = require("react/jsx-runtime");
31785
31647
  var SCROLLABLE_THRESHOLD = 200;
31786
- var DraggableBox = import_react57.default.forwardRef(
31648
+ var DraggableBox = import_react58.default.forwardRef(
31787
31649
  ({ children, fullScreen, position, setPosition, onDrag, onScrollThresholdExceeded }, ref) => {
31788
31650
  const theme = (0, import_material36.useTheme)();
31789
- const [transitionProps, setTransitionProps] = (0, import_react57.useState)("all");
31790
- const [isDragging, setIsDragging] = (0, import_react57.useState)(false);
31791
- const [isHovering, setIsHovering] = (0, import_react57.useState)(false);
31792
- (0, import_react57.useEffect)(() => {
31651
+ const [transitionProps, setTransitionProps] = (0, import_react58.useState)("all");
31652
+ const [isDragging, setIsDragging] = (0, import_react58.useState)(false);
31653
+ const [isHovering, setIsHovering] = (0, import_react58.useState)(false);
31654
+ (0, import_react58.useEffect)(() => {
31793
31655
  if (ref && typeof ref !== "function" && ref.current && !fullScreen) {
31794
31656
  const modal = ref.current;
31795
31657
  const contentHeight = modal.scrollHeight;
@@ -31865,7 +31727,7 @@ var DraggableBox = import_react57.default.forwardRef(
31865
31727
  var draggable_box_default = DraggableBox;
31866
31728
 
31867
31729
  // src/modals/chat-modal/modal-header.tsx
31868
- var import_react58 = require("react");
31730
+ var import_react59 = require("react");
31869
31731
  var import_material37 = require("@mui/material");
31870
31732
  init_icons();
31871
31733
  var import_jsx_runtime40 = require("react/jsx-runtime");
@@ -31885,7 +31747,7 @@ var ModalHeader = ({
31885
31747
  const theme = (0, import_material37.useTheme)();
31886
31748
  const isMobile = (0, import_material37.useMediaQuery)((theme2) => theme2.breakpoints.down("sm"));
31887
31749
  const displayLogo = logo && logo !== banditaiLogo ? logo : banditHead3;
31888
- const [isHovering, setIsHovering] = (0, import_react58.useState)(false);
31750
+ const [isHovering, setIsHovering] = (0, import_react59.useState)(false);
31889
31751
  const buttonStyles = {
31890
31752
  transition: "all 0.15s ease-out",
31891
31753
  borderRadius: "8px",
@@ -32083,7 +31945,7 @@ var ModalHeader = ({
32083
31945
  var modal_header_default = ModalHeader;
32084
31946
 
32085
31947
  // src/modals/chat-modal/query-input.tsx
32086
- var import_react59 = require("react");
31948
+ var import_react60 = require("react");
32087
31949
  var import_material38 = require("@mui/material");
32088
31950
  init_icons();
32089
31951
  var import_jsx_runtime41 = require("react/jsx-runtime");
@@ -32101,7 +31963,7 @@ var QueryInput = ({
32101
31963
  // Destructure endAdornment
32102
31964
  }) => {
32103
31965
  const theme = (0, import_material38.useTheme)();
32104
- const inputRef = (0, import_react59.useRef)(null);
31966
+ const inputRef = (0, import_react60.useRef)(null);
32105
31967
  const handleSend = (e, payload) => {
32106
31968
  onSend(e, payload);
32107
31969
  };
@@ -32168,7 +32030,7 @@ init_ai_response_text_field();
32168
32030
  init_indexedDBService();
32169
32031
 
32170
32032
  // src/modals/chat-modal/chat-drawer.tsx
32171
- var import_react60 = __toESM(require("react"));
32033
+ var import_react61 = __toESM(require("react"));
32172
32034
  var import_material39 = require("@mui/material");
32173
32035
  init_aiQueryStore();
32174
32036
  init_conversationStore();
@@ -32204,23 +32066,23 @@ var AIQueriesDrawer = ({ drawerOpen, onClose, onClearComplete, onNavigateToMain
32204
32066
  const { settings: packageSettings } = usePackageSettingsStore();
32205
32067
  const provider = useAIProviderStore((state) => state.provider);
32206
32068
  const { selectedModel, availableModels } = useModelStore();
32207
- const [searchTerm, setSearchTerm] = (0, import_react60.useState)("");
32208
- const [expandedItems, setExpandedItems] = (0, import_react60.useState)(/* @__PURE__ */ new Set());
32209
- const [expandedConversations, setExpandedConversations] = (0, import_react60.useState)(/* @__PURE__ */ new Set());
32210
- const [confirmClearOpen, setConfirmClearOpen] = (0, import_react60.useState)(false);
32211
- const [infoDialogOpen, setInfoDialogOpen] = (0, import_react60.useState)(false);
32212
- const [memoryModalOpen, setMemoryModalOpen] = (0, import_react60.useState)(false);
32213
- const [contextMode, setContextMode] = (0, import_react60.useState)("local");
32214
- const [expandedSections, setExpandedSections] = (0, import_react60.useState)(/* @__PURE__ */ new Set(["history", "voice"]));
32215
- const [audioSub, setAudioSub] = (0, import_react60.useState)(new import_rxjs22.Subscription());
32216
- const [isContextSwitching, setIsContextSwitching] = (0, import_react60.useState)(false);
32217
- const [isDrawerLoading, setIsDrawerLoading] = (0, import_react60.useState)(false);
32218
- (0, import_react60.useEffect)(() => {
32069
+ const [searchTerm, setSearchTerm] = (0, import_react61.useState)("");
32070
+ const [expandedItems, setExpandedItems] = (0, import_react61.useState)(/* @__PURE__ */ new Set());
32071
+ const [expandedConversations, setExpandedConversations] = (0, import_react61.useState)(/* @__PURE__ */ new Set());
32072
+ const [confirmClearOpen, setConfirmClearOpen] = (0, import_react61.useState)(false);
32073
+ const [infoDialogOpen, setInfoDialogOpen] = (0, import_react61.useState)(false);
32074
+ const [memoryModalOpen, setMemoryModalOpen] = (0, import_react61.useState)(false);
32075
+ const [contextMode, setContextMode] = (0, import_react61.useState)("local");
32076
+ const [expandedSections, setExpandedSections] = (0, import_react61.useState)(/* @__PURE__ */ new Set(["history", "voice"]));
32077
+ const [audioSub, setAudioSub] = (0, import_react61.useState)(new import_rxjs22.Subscription());
32078
+ const [isContextSwitching, setIsContextSwitching] = (0, import_react61.useState)(false);
32079
+ const [isDrawerLoading, setIsDrawerLoading] = (0, import_react61.useState)(false);
32080
+ (0, import_react61.useEffect)(() => {
32219
32081
  if (drawerOpen && !_hasHydrated) {
32220
32082
  hydrate();
32221
32083
  }
32222
32084
  }, [drawerOpen, _hasHydrated, hydrate]);
32223
- (0, import_react60.useEffect)(() => {
32085
+ (0, import_react61.useEffect)(() => {
32224
32086
  if (!drawerOpen) {
32225
32087
  setIsDrawerLoading(false);
32226
32088
  const cleanupTimer = setTimeout(() => {
@@ -32231,7 +32093,7 @@ var AIQueriesDrawer = ({ drawerOpen, onClose, onClearComplete, onNavigateToMain
32231
32093
  return () => clearTimeout(cleanupTimer);
32232
32094
  }
32233
32095
  }, [drawerOpen]);
32234
- (0, import_react60.useEffect)(() => {
32096
+ (0, import_react61.useEffect)(() => {
32235
32097
  return () => {
32236
32098
  audioSub.unsubscribe();
32237
32099
  };
@@ -32278,7 +32140,7 @@ var AIQueriesDrawer = ({ drawerOpen, onClose, onClearComplete, onNavigateToMain
32278
32140
  const currentConversation = conversations.find((c) => c.id === currentId);
32279
32141
  const isInitialLoading = !_hasHydrated && contextMode === "main";
32280
32142
  const isContentLoading = isContextSwitching || isInitialLoading;
32281
- (0, import_react60.useEffect)(() => {
32143
+ (0, import_react61.useEffect)(() => {
32282
32144
  if (drawerOpen) {
32283
32145
  const debugTimer = setTimeout(() => {
32284
32146
  debugLogger.debug("Chat drawer loading states", {
@@ -32293,7 +32155,7 @@ var AIQueriesDrawer = ({ drawerOpen, onClose, onClearComplete, onNavigateToMain
32293
32155
  return () => clearTimeout(debugTimer);
32294
32156
  }
32295
32157
  }, [drawerOpen, _hasHydrated, isDrawerLoading, isContentLoading, contextMode]);
32296
- (0, import_react60.useEffect)(() => {
32158
+ (0, import_react61.useEffect)(() => {
32297
32159
  debugLogger.debug("Chat drawer voice availability check", {
32298
32160
  isServiceAvailable,
32299
32161
  ttsEnabled: preferences.ttsEnabled,
@@ -32304,14 +32166,14 @@ var AIQueriesDrawer = ({ drawerOpen, onClose, onClearComplete, onNavigateToMain
32304
32166
  storeState: "modal-chat-drawer-voice"
32305
32167
  });
32306
32168
  }, [isServiceAvailable, preferences.ttsEnabled, packageSettings?.gatewayApiUrl, isVoiceAvailable, availableVoices.length, selectedVoice]);
32307
- const activeHistory = (0, import_react60.useMemo)(() => {
32169
+ const activeHistory = (0, import_react61.useMemo)(() => {
32308
32170
  if (contextMode === "local") {
32309
32171
  return history;
32310
32172
  }
32311
32173
  return currentConversation?.history ?? [];
32312
32174
  }, [contextMode, history, currentConversation]);
32313
32175
  const effectiveContextMode = contextMode === "main" && (!currentConversation || currentConversation.history.length === 0) ? "local" : contextMode;
32314
- (0, import_react60.useEffect)(() => {
32176
+ (0, import_react61.useEffect)(() => {
32315
32177
  debugLogger.debug("Chat drawer context state", {
32316
32178
  contextMode,
32317
32179
  effectiveContextMode,
@@ -32324,13 +32186,13 @@ var AIQueriesDrawer = ({ drawerOpen, onClose, onClearComplete, onNavigateToMain
32324
32186
  storeState: "modal-chat-drawer"
32325
32187
  });
32326
32188
  }, [contextMode, effectiveContextMode, conversations.length, currentId, currentConversation, history.length, _hasHydrated]);
32327
- const filteredHistory = (0, import_react60.useMemo)(() => {
32189
+ const filteredHistory = (0, import_react61.useMemo)(() => {
32328
32190
  const filtered = activeHistory.filter(
32329
32191
  (entry) => entry.question.toLowerCase().includes(searchTerm.toLowerCase()) || entry.answer.toLowerCase().includes(searchTerm.toLowerCase())
32330
32192
  );
32331
32193
  return filtered.slice(-20);
32332
32194
  }, [activeHistory, searchTerm]);
32333
- const filteredConversations = (0, import_react60.useMemo)(() => {
32195
+ const filteredConversations = (0, import_react61.useMemo)(() => {
32334
32196
  const filtered = conversations.filter(
32335
32197
  (conversation) => conversation.name.toLowerCase().includes(searchTerm.toLowerCase()) || conversation.history.some(
32336
32198
  (entry) => entry.question.toLowerCase().includes(searchTerm.toLowerCase()) || entry.answer.toLowerCase().includes(searchTerm.toLowerCase())
@@ -33216,7 +33078,7 @@ var AIQueriesDrawer = ({ drawerOpen, onClose, onClearComplete, onNavigateToMain
33216
33078
  }
33217
33079
  ) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material39.List, { sx: { p: 0 }, children: [...filteredHistory].reverse().map((entry, index) => {
33218
33080
  const isExpanded = expandedItems.has(index);
33219
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_react60.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
33081
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_react61.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
33220
33082
  import_material39.ListItem,
33221
33083
  {
33222
33084
  sx: {
@@ -33693,9 +33555,9 @@ var GenericLoader = ({
33693
33555
  var generic_loader_default = GenericLoader;
33694
33556
 
33695
33557
  // src/components/feedback/FeedbackButton.tsx
33696
- var import_react61 = require("react");
33558
+ var import_react62 = require("react");
33697
33559
  var import_material41 = require("@mui/material");
33698
- var import_react62 = require("@burtson-labs/icons/react");
33560
+ var import_react63 = require("@burtson-labs/icons/react");
33699
33561
 
33700
33562
  // src/components/feedback/index.tsx
33701
33563
  init_FeedbackModal();
@@ -33714,7 +33576,7 @@ var FeedbackButton = ({
33714
33576
  absolute = false
33715
33577
  }) => {
33716
33578
  const theme = (0, import_material41.useTheme)();
33717
- const [open, setOpen] = (0, import_react61.useState)(false);
33579
+ const [open, setOpen] = (0, import_react62.useState)(false);
33718
33580
  const handleOpen = () => setOpen(true);
33719
33581
  const handleClose = () => setOpen(false);
33720
33582
  if (inline) {
@@ -33723,7 +33585,7 @@ var FeedbackButton = ({
33723
33585
  import_material41.Button,
33724
33586
  {
33725
33587
  variant: "outlined",
33726
- startIcon: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react62.MessageCircle, {}),
33588
+ startIcon: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react63.MessageCircle, {}),
33727
33589
  onClick: handleOpen,
33728
33590
  className,
33729
33591
  size,
@@ -33752,7 +33614,7 @@ var FeedbackButton = ({
33752
33614
  transform: "translateY(-1px)"
33753
33615
  }
33754
33616
  },
33755
- children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react62.MessageCircle, {})
33617
+ children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react63.MessageCircle, {})
33756
33618
  }
33757
33619
  ) }),
33758
33620
  /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
@@ -33811,7 +33673,7 @@ var FeedbackButton = ({
33811
33673
  }
33812
33674
  }
33813
33675
  },
33814
- children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react62.MessageCircle, {})
33676
+ children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react63.MessageCircle, {})
33815
33677
  }
33816
33678
  )
33817
33679
  }
@@ -33828,7 +33690,7 @@ var FeedbackButton = ({
33828
33690
  };
33829
33691
 
33830
33692
  // src/hooks/useAiChat.ts
33831
- var import_react63 = require("react");
33693
+ var import_react64 = require("react");
33832
33694
  var import_material42 = require("@mui/material");
33833
33695
  init_aiQueryStore();
33834
33696
  init_aiProviderStore();
@@ -33840,10 +33702,10 @@ var useAIChat = () => {
33840
33702
  const provider = useAIProviderStore((state) => state.provider);
33841
33703
  const SYSTEM_PROMPT = useModelStore((state) => state.systemPrompt);
33842
33704
  const OLLAMA_MODEL = usePackageSettingsStore((state) => state.settings?.defaultModel || "");
33843
- const [fullScreen, setFullScreen] = (0, import_react63.useState)(isMobile);
33844
- const [drawerOpen, setDrawerOpen] = (0, import_react63.useState)(false);
33845
- const [showSettings, setShowSettings] = (0, import_react63.useState)(false);
33846
- const [, setAutoFullscreenTriggered] = (0, import_react63.useState)(false);
33705
+ const [fullScreen, setFullScreen] = (0, import_react64.useState)(isMobile);
33706
+ const [drawerOpen, setDrawerOpen] = (0, import_react64.useState)(false);
33707
+ const [showSettings, setShowSettings] = (0, import_react64.useState)(false);
33708
+ const [, setAutoFullscreenTriggered] = (0, import_react64.useState)(false);
33847
33709
  const {
33848
33710
  apiKey,
33849
33711
  inputValue,
@@ -33931,7 +33793,7 @@ var useAIChat = () => {
33931
33793
  }
33932
33794
  sendWithAIProvider();
33933
33795
  };
33934
- (0, import_react63.useEffect)(() => {
33796
+ (0, import_react64.useEffect)(() => {
33935
33797
  setFullScreen(isMobile);
33936
33798
  }, [isMobile]);
33937
33799
  return {
@@ -33947,12 +33809,12 @@ var useAIChat = () => {
33947
33809
  var useAiChat_default = useAIChat;
33948
33810
 
33949
33811
  // src/hooks/useDraggable.ts
33950
- var import_react64 = require("react");
33812
+ var import_react65 = require("react");
33951
33813
  var useDraggable = () => {
33952
- const modalRef = (0, import_react64.useRef)(null);
33953
- const [dragging, setDragging] = (0, import_react64.useState)(false);
33954
- const [offset, setOffset] = (0, import_react64.useState)({ x: 0, y: 0 });
33955
- const [position, setPosition] = (0, import_react64.useState)({ x: 0, y: 0 });
33814
+ const modalRef = (0, import_react65.useRef)(null);
33815
+ const [dragging, setDragging] = (0, import_react65.useState)(false);
33816
+ const [offset, setOffset] = (0, import_react65.useState)({ x: 0, y: 0 });
33817
+ const [position, setPosition] = (0, import_react65.useState)({ x: 0, y: 0 });
33956
33818
  const handleHeaderMouseDown = (e) => {
33957
33819
  const rect = modalRef.current?.getBoundingClientRect();
33958
33820
  if (rect) {
@@ -33960,7 +33822,7 @@ var useDraggable = () => {
33960
33822
  setDragging(true);
33961
33823
  }
33962
33824
  };
33963
- const handleHeaderMouseMove = (0, import_react64.useCallback)(
33825
+ const handleHeaderMouseMove = (0, import_react65.useCallback)(
33964
33826
  (e) => {
33965
33827
  if (dragging) {
33966
33828
  setPosition({ x: e.clientX - offset.x, y: e.clientY - offset.y });
@@ -33971,7 +33833,7 @@ var useDraggable = () => {
33971
33833
  const handleHeaderMouseUp = () => {
33972
33834
  setDragging(false);
33973
33835
  };
33974
- (0, import_react64.useEffect)(() => {
33836
+ (0, import_react65.useEffect)(() => {
33975
33837
  if (dragging) {
33976
33838
  document.addEventListener("mousemove", handleHeaderMouseMove);
33977
33839
  document.addEventListener("mouseup", handleHeaderMouseUp);
@@ -34021,7 +33883,7 @@ var modelAvatars3 = {
34021
33883
  "Bandit-Exec": `${CDN_BASE2}/avatars/exec-avatar.png`
34022
33884
  };
34023
33885
  var useOptionalNavigate = () => {
34024
- const hasLoggedRef = (0, import_react65.useRef)(false);
33886
+ const hasLoggedRef = (0, import_react66.useRef)(false);
34025
33887
  try {
34026
33888
  return (0, import_react_router_dom6.useNavigate)();
34027
33889
  } catch (error) {
@@ -34070,17 +33932,17 @@ var ChatModal = ({
34070
33932
  handleSend
34071
33933
  } = useAiChat_default();
34072
33934
  const { modalRef, position, setPosition, handleDrag, handleHeaderMouseDown } = useDraggable_default();
34073
- const [pastedImages, setPastedImages] = (0, import_react65.useState)([]);
34074
- const [responseStarted, setResponseStarted] = (0, import_react65.useState)(false);
34075
- const [modalLogo, setModalLogo] = (0, import_react65.useState)("https://cdn.burtson.ai/logos/bandit-ai-logo.png");
34076
- const [modelAnchorEl, setModelAnchorEl] = (0, import_react65.useState)(null);
34077
- const [voiceAnchorEl, setVoiceAnchorEl] = (0, import_react65.useState)(null);
34078
- const [audioSub, setAudioSub] = (0, import_react65.useState)(new import_rxjs23.Subscription());
34079
- const [selectedTheme, setSelectedTheme] = (0, import_react65.useState)(null);
34080
- const [themeLoading, setThemeLoading] = (0, import_react65.useState)(true);
34081
- const [autoFullscreenTriggered, setAutoFullscreenTriggered] = (0, import_react65.useState)(false);
34082
- const [userHasDragged, setUserHasDragged] = (0, import_react65.useState)(false);
34083
- const [manualFullscreenToggleTime, setManualFullscreenToggleTime] = (0, import_react65.useState)(0);
33935
+ const [pastedImages, setPastedImages] = (0, import_react66.useState)([]);
33936
+ const [responseStarted, setResponseStarted] = (0, import_react66.useState)(false);
33937
+ const [modalLogo, setModalLogo] = (0, import_react66.useState)("https://cdn.burtson.ai/logos/bandit-ai-logo.png");
33938
+ const [modelAnchorEl, setModelAnchorEl] = (0, import_react66.useState)(null);
33939
+ const [voiceAnchorEl, setVoiceAnchorEl] = (0, import_react66.useState)(null);
33940
+ const [audioSub, setAudioSub] = (0, import_react66.useState)(new import_rxjs23.Subscription());
33941
+ const [selectedTheme, setSelectedTheme] = (0, import_react66.useState)(null);
33942
+ const [themeLoading, setThemeLoading] = (0, import_react66.useState)(true);
33943
+ const [autoFullscreenTriggered, setAutoFullscreenTriggered] = (0, import_react66.useState)(false);
33944
+ const [userHasDragged, setUserHasDragged] = (0, import_react66.useState)(false);
33945
+ const [manualFullscreenToggleTime, setManualFullscreenToggleTime] = (0, import_react66.useState)(0);
34084
33946
  const handleExitFullscreen = () => {
34085
33947
  setPosition({
34086
33948
  x: Math.max(0, window.innerWidth / 2 - 300),
@@ -34126,7 +33988,7 @@ var ChatModal = ({
34126
33988
  const toTitleCase2 = (str) => {
34127
33989
  return str.replace(/\w\S*/g, (txt) => txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase());
34128
33990
  };
34129
- (0, import_react65.useEffect)(() => {
33991
+ (0, import_react66.useEffect)(() => {
34130
33992
  if (!SYSTEM_PROMPT) {
34131
33993
  const defaultModel = availableModels.length > 0 ? availableModels[0] : null;
34132
33994
  if (defaultModel) {
@@ -34134,12 +33996,12 @@ var ChatModal = ({
34134
33996
  }
34135
33997
  }
34136
33998
  }, [SYSTEM_PROMPT, availableModels, setSelectedModel]);
34137
- (0, import_react65.useEffect)(() => {
33999
+ (0, import_react66.useEffect)(() => {
34138
34000
  return () => {
34139
34001
  audioSub.unsubscribe();
34140
34002
  };
34141
34003
  }, [audioSub]);
34142
- (0, import_react65.useEffect)(() => {
34004
+ (0, import_react66.useEffect)(() => {
34143
34005
  if (open) {
34144
34006
  setPosition({
34145
34007
  x: Math.max(0, window.innerWidth / 2 - 300),
@@ -34151,7 +34013,7 @@ var ChatModal = ({
34151
34013
  getOptimalLogo().then(setModalLogo);
34152
34014
  }
34153
34015
  }, [open, setPosition]);
34154
- (0, import_react65.useEffect)(() => {
34016
+ (0, import_react66.useEffect)(() => {
34155
34017
  if (!open) return;
34156
34018
  const fetchTheme = async () => {
34157
34019
  try {
@@ -34185,7 +34047,7 @@ var ChatModal = ({
34185
34047
  window.removeEventListener("bandit-theme-changed", handleThemeChange);
34186
34048
  };
34187
34049
  }, [open]);
34188
- (0, import_react65.useLayoutEffect)(() => {
34050
+ (0, import_react66.useLayoutEffect)(() => {
34189
34051
  const timeSinceManualToggle = Date.now() - manualFullscreenToggleTime;
34190
34052
  const manualToggleRecentlyUsed = timeSinceManualToggle < 5e3;
34191
34053
  if (modalRef.current && response && !fullScreen && !autoFullscreenTriggered && !manualToggleRecentlyUsed) {
@@ -34210,7 +34072,7 @@ var ChatModal = ({
34210
34072
  setFullScreen,
34211
34073
  setAutoFullscreenTriggered
34212
34074
  ]);
34213
- (0, import_react65.useEffect)(() => {
34075
+ (0, import_react66.useEffect)(() => {
34214
34076
  const handlePaste = (e) => {
34215
34077
  const items = e.clipboardData?.items;
34216
34078
  if (items) {
@@ -34235,7 +34097,7 @@ var ChatModal = ({
34235
34097
  document.removeEventListener("paste", handlePaste);
34236
34098
  };
34237
34099
  }, []);
34238
- (0, import_react65.useEffect)(() => {
34100
+ (0, import_react66.useEffect)(() => {
34239
34101
  if (response && !responseStarted) {
34240
34102
  setResponseStarted(true);
34241
34103
  }
@@ -34655,13 +34517,13 @@ var ChatModal = ({
34655
34517
  var chat_modal_default = ChatModal;
34656
34518
 
34657
34519
  // src/management/components/PersonalitiesTab.tsx
34658
- var import_react67 = require("react");
34520
+ var import_react68 = require("react");
34659
34521
  var import_material46 = require("@mui/material");
34660
34522
  var import_useMediaQuery = __toESM(require("@mui/material/useMediaQuery"));
34661
- var import_styles29 = require("@mui/material/styles");
34523
+ var import_styles28 = require("@mui/material/styles");
34662
34524
 
34663
34525
  // src/components/AvatarCropper.tsx
34664
- var import_react66 = require("react");
34526
+ var import_react67 = require("react");
34665
34527
  var import_material44 = require("@mui/material");
34666
34528
  init_icons();
34667
34529
  var import_jsx_runtime46 = require("react/jsx-runtime");
@@ -34671,22 +34533,22 @@ var AvatarCropper = ({
34671
34533
  onCrop,
34672
34534
  imageFile
34673
34535
  }) => {
34674
- const canvasRef = (0, import_react66.useRef)(null);
34675
- const imageRef = (0, import_react66.useRef)(null);
34676
- const [imageSrc, setImageSrc] = (0, import_react66.useState)("");
34677
- const [cropSettings, setCropSettings] = (0, import_react66.useState)({
34536
+ const canvasRef = (0, import_react67.useRef)(null);
34537
+ const imageRef = (0, import_react67.useRef)(null);
34538
+ const [imageSrc, setImageSrc] = (0, import_react67.useState)("");
34539
+ const [cropSettings, setCropSettings] = (0, import_react67.useState)({
34678
34540
  x: 0,
34679
34541
  y: 0,
34680
34542
  scale: 1,
34681
34543
  rotation: 0
34682
34544
  });
34683
- const [isDragging, setIsDragging] = (0, import_react66.useState)(false);
34684
- const [dragStart, setDragStart] = (0, import_react66.useState)({ x: 0, y: 0 });
34685
- const [imageLoaded, setImageLoaded] = (0, import_react66.useState)(false);
34686
- const [imageNaturalSize, setImageNaturalSize] = (0, import_react66.useState)({ width: 0, height: 0 });
34545
+ const [isDragging, setIsDragging] = (0, import_react67.useState)(false);
34546
+ const [dragStart, setDragStart] = (0, import_react67.useState)({ x: 0, y: 0 });
34547
+ const [imageLoaded, setImageLoaded] = (0, import_react67.useState)(false);
34548
+ const [imageNaturalSize, setImageNaturalSize] = (0, import_react67.useState)({ width: 0, height: 0 });
34687
34549
  const CROP_SIZE = 400;
34688
34550
  const OUTPUT_SIZE = 512;
34689
- (0, import_react66.useEffect)(() => {
34551
+ (0, import_react67.useEffect)(() => {
34690
34552
  if (imageFile && open) {
34691
34553
  const reader = new FileReader();
34692
34554
  reader.onload = (e) => {
@@ -34698,7 +34560,7 @@ var AvatarCropper = ({
34698
34560
  reader.readAsDataURL(imageFile);
34699
34561
  }
34700
34562
  }, [imageFile, open]);
34701
- const handleImageLoad = (0, import_react66.useCallback)(() => {
34563
+ const handleImageLoad = (0, import_react67.useCallback)(() => {
34702
34564
  if (imageRef.current) {
34703
34565
  const { naturalWidth, naturalHeight } = imageRef.current;
34704
34566
  setImageNaturalSize({ width: naturalWidth, height: naturalHeight });
@@ -34715,7 +34577,7 @@ var AvatarCropper = ({
34715
34577
  setImageLoaded(true);
34716
34578
  }
34717
34579
  }, []);
34718
- const drawCropPreview = (0, import_react66.useCallback)(() => {
34580
+ const drawCropPreview = (0, import_react67.useCallback)(() => {
34719
34581
  const canvas = canvasRef.current;
34720
34582
  const image = imageRef.current;
34721
34583
  if (!canvas || !image || !imageLoaded) return;
@@ -34738,14 +34600,14 @@ var AvatarCropper = ({
34738
34600
  ctx.fill();
34739
34601
  ctx.restore();
34740
34602
  }, [cropSettings, imageLoaded]);
34741
- (0, import_react66.useEffect)(() => {
34603
+ (0, import_react67.useEffect)(() => {
34742
34604
  drawCropPreview();
34743
34605
  }, [drawCropPreview]);
34744
- const handleMouseDown = (0, import_react66.useCallback)((e) => {
34606
+ const handleMouseDown = (0, import_react67.useCallback)((e) => {
34745
34607
  setIsDragging(true);
34746
34608
  setDragStart({ x: e.clientX, y: e.clientY });
34747
34609
  }, []);
34748
- const handleMouseMove = (0, import_react66.useCallback)((e) => {
34610
+ const handleMouseMove = (0, import_react67.useCallback)((e) => {
34749
34611
  if (!isDragging) return;
34750
34612
  const deltaX = e.clientX - dragStart.x;
34751
34613
  const deltaY = e.clientY - dragStart.y;
@@ -34756,16 +34618,16 @@ var AvatarCropper = ({
34756
34618
  }));
34757
34619
  setDragStart({ x: e.clientX, y: e.clientY });
34758
34620
  }, [isDragging, dragStart]);
34759
- const handleMouseUp = (0, import_react66.useCallback)(() => {
34621
+ const handleMouseUp = (0, import_react67.useCallback)(() => {
34760
34622
  setIsDragging(false);
34761
34623
  }, []);
34762
- const handleClose = (0, import_react66.useCallback)(() => {
34624
+ const handleClose = (0, import_react67.useCallback)(() => {
34763
34625
  setImageSrc("");
34764
34626
  setImageLoaded(false);
34765
34627
  setCropSettings({ x: 0, y: 0, scale: 1, rotation: 0 });
34766
34628
  onClose();
34767
34629
  }, [onClose]);
34768
- const handleCrop = (0, import_react66.useCallback)(() => {
34630
+ const handleCrop = (0, import_react67.useCallback)(() => {
34769
34631
  const canvas = document.createElement("canvas");
34770
34632
  const ctx = canvas.getContext("2d");
34771
34633
  const image = imageRef.current;
@@ -34792,7 +34654,7 @@ var AvatarCropper = ({
34792
34654
  onCrop(croppedDataUrl);
34793
34655
  handleClose();
34794
34656
  }, [cropSettings, onCrop, handleClose]);
34795
- const handleScaleChange = (0, import_react66.useCallback)((value) => {
34657
+ const handleScaleChange = (0, import_react67.useCallback)((value) => {
34796
34658
  const minScale2 = Math.max(
34797
34659
  CROP_SIZE / imageNaturalSize.width,
34798
34660
  CROP_SIZE / imageNaturalSize.height
@@ -34802,7 +34664,7 @@ var AvatarCropper = ({
34802
34664
  scale: Math.max(value, minScale2)
34803
34665
  }));
34804
34666
  }, [imageNaturalSize]);
34805
- const handleRotation = (0, import_react66.useCallback)((direction) => {
34667
+ const handleRotation = (0, import_react67.useCallback)((direction) => {
34806
34668
  setCropSettings((prev) => ({
34807
34669
  ...prev,
34808
34670
  rotation: prev.rotation + (direction === "left" ? -90 : 90)
@@ -35023,7 +34885,7 @@ init_icons();
35023
34885
 
35024
34886
  // src/management/shell/parts.tsx
35025
34887
  var import_material45 = require("@mui/material");
35026
- var import_styles28 = require("@mui/material/styles");
34888
+ var import_styles27 = require("@mui/material/styles");
35027
34889
  var import_jsx_runtime47 = require("react/jsx-runtime");
35028
34890
  function ManagementPageHeader({
35029
34891
  title,
@@ -35217,7 +35079,7 @@ function ManagementEmptyState({
35217
35079
  placeItems: "center",
35218
35080
  borderRadius: "50%",
35219
35081
  color: "primary.main",
35220
- bgcolor: (0, import_styles28.alpha)(theme.palette.primary.main, 0.1),
35082
+ bgcolor: (0, import_styles27.alpha)(theme.palette.primary.main, 0.1),
35221
35083
  "& svg": { width: 22, height: 22 }
35222
35084
  }),
35223
35085
  children: icon
@@ -35260,15 +35122,15 @@ var PersonalitiesTab = ({
35260
35122
  showSnackbar,
35261
35123
  createRequest
35262
35124
  }) => {
35263
- const theme = (0, import_styles29.useTheme)();
35125
+ const theme = (0, import_styles28.useTheme)();
35264
35126
  const isMobile = (0, import_useMediaQuery.default)(theme.breakpoints.down("sm"));
35265
- const [personalityTabIndex, setPersonalityTabIndex] = (0, import_react67.useState)(0);
35266
- const [restoreDialogOpen, setRestoreDialogOpen] = (0, import_react67.useState)(false);
35267
- const [deleteDialogOpen, setDeleteDialogOpen] = (0, import_react67.useState)(false);
35268
- const [personalityToDelete, setPersonalityToDelete] = (0, import_react67.useState)(null);
35269
- const [clickedChips, setClickedChips] = (0, import_react67.useState)(/* @__PURE__ */ new Set());
35270
- const [cropperOpen, setCropperOpen] = (0, import_react67.useState)(false);
35271
- const [selectedImageFile, setSelectedImageFile] = (0, import_react67.useState)(null);
35127
+ const [personalityTabIndex, setPersonalityTabIndex] = (0, import_react68.useState)(0);
35128
+ const [restoreDialogOpen, setRestoreDialogOpen] = (0, import_react68.useState)(false);
35129
+ const [deleteDialogOpen, setDeleteDialogOpen] = (0, import_react68.useState)(false);
35130
+ const [personalityToDelete, setPersonalityToDelete] = (0, import_react68.useState)(null);
35131
+ const [clickedChips, setClickedChips] = (0, import_react68.useState)(/* @__PURE__ */ new Set());
35132
+ const [cropperOpen, setCropperOpen] = (0, import_react68.useState)(false);
35133
+ const [selectedImageFile, setSelectedImageFile] = (0, import_react68.useState)(null);
35272
35134
  const startNewPersonality = () => {
35273
35135
  setLocalSelectedModel({
35274
35136
  name: "",
@@ -35280,9 +35142,9 @@ var PersonalitiesTab = ({
35280
35142
  setPresetAvatar(null);
35281
35143
  setPersonalityTabIndex(1);
35282
35144
  };
35283
- const startNewPersonalityRef = (0, import_react67.useRef)(startNewPersonality);
35145
+ const startNewPersonalityRef = (0, import_react68.useRef)(startNewPersonality);
35284
35146
  startNewPersonalityRef.current = startNewPersonality;
35285
- (0, import_react67.useEffect)(() => {
35147
+ (0, import_react68.useEffect)(() => {
35286
35148
  if (createRequest) startNewPersonalityRef.current();
35287
35149
  }, [createRequest]);
35288
35150
  const promptTemplates = [
@@ -36161,7 +36023,7 @@ var PersonalitiesTab = ({
36161
36023
  var PersonalitiesTab_default = PersonalitiesTab;
36162
36024
 
36163
36025
  // src/management/components/PreferencesTab.tsx
36164
- var import_react69 = require("react");
36026
+ var import_react70 = require("react");
36165
36027
  init_memory_modal();
36166
36028
  var import_material47 = require("@mui/material");
36167
36029
  init_preferencesStore();
@@ -36172,7 +36034,7 @@ init_useFeatures();
36172
36034
  init_conversationSyncStore();
36173
36035
 
36174
36036
  // src/hooks/useGatewayQueries.ts
36175
- var import_react68 = require("react");
36037
+ var import_react69 = require("react");
36176
36038
  var import_rxjs24 = require("rxjs");
36177
36039
  var import_react_query2 = require("@tanstack/react-query");
36178
36040
  init_packageSettingsStore();
@@ -36182,7 +36044,7 @@ var useGatewayClient = () => {
36182
36044
  const settings = usePackageSettingsStore((state) => state.settings);
36183
36045
  const gatewayUrl = settings?.gatewayApiUrl;
36184
36046
  const feedbackEmail = settings?.feedbackEmail;
36185
- const service = (0, import_react68.useMemo)(() => {
36047
+ const service = (0, import_react69.useMemo)(() => {
36186
36048
  if (!gatewayUrl) {
36187
36049
  return null;
36188
36050
  }
@@ -36253,16 +36115,16 @@ var PreferencesTab = ({
36253
36115
  }) => {
36254
36116
  const theme = (0, import_material47.useTheme)();
36255
36117
  const isMobile = (0, import_material47.useMediaQuery)(theme.breakpoints.down("sm"));
36256
- const [homeUrlStatus, setHomeUrlStatus] = (0, import_react69.useState)("idle");
36257
- const [homeUrlError, setHomeUrlError] = (0, import_react69.useState)("");
36258
- const [localHomeUrl, setLocalHomeUrl] = (0, import_react69.useState)(preferences.homeUrl || "");
36259
- const [importStatus, setImportStatus] = (0, import_react69.useState)("idle");
36260
- const [syncToggleLoading, setSyncToggleLoading] = (0, import_react69.useState)(false);
36261
- const [manualSyncLoading, setManualSyncLoading] = (0, import_react69.useState)(false);
36262
- const [advancedVectorToggleLoading, setAdvancedVectorToggleLoading] = (0, import_react69.useState)(false);
36263
- const [memoryModalOpen, setMemoryModalOpen] = (0, import_react69.useState)(false);
36264
- const timeoutRef = (0, import_react69.useRef)(null);
36265
- const fileInputRef = (0, import_react69.useRef)(null);
36118
+ const [homeUrlStatus, setHomeUrlStatus] = (0, import_react70.useState)("idle");
36119
+ const [homeUrlError, setHomeUrlError] = (0, import_react70.useState)("");
36120
+ const [localHomeUrl, setLocalHomeUrl] = (0, import_react70.useState)(preferences.homeUrl || "");
36121
+ const [importStatus, setImportStatus] = (0, import_react70.useState)("idle");
36122
+ const [syncToggleLoading, setSyncToggleLoading] = (0, import_react70.useState)(false);
36123
+ const [manualSyncLoading, setManualSyncLoading] = (0, import_react70.useState)(false);
36124
+ const [advancedVectorToggleLoading, setAdvancedVectorToggleLoading] = (0, import_react70.useState)(false);
36125
+ const [memoryModalOpen, setMemoryModalOpen] = (0, import_react70.useState)(false);
36126
+ const timeoutRef = (0, import_react70.useRef)(null);
36127
+ const fileInputRef = (0, import_react70.useRef)(null);
36266
36128
  const { exportPreferences, importPreferences, resetToDefaults } = usePreferencesStore();
36267
36129
  const {
36268
36130
  isServiceAvailable: isTTSSTTAvailable,
@@ -36374,7 +36236,7 @@ var PreferencesTab = ({
36374
36236
  if (!gatewayHealth) return "warning";
36375
36237
  return gatewayHealth.status?.toLowerCase() === "healthy" ? "success" : "error";
36376
36238
  })();
36377
- const handleGatewayStatusRefresh = (0, import_react69.useCallback)(() => {
36239
+ const handleGatewayStatusRefresh = (0, import_react70.useCallback)(() => {
36378
36240
  if (!gatewayConfigured) {
36379
36241
  return;
36380
36242
  }
@@ -36436,7 +36298,7 @@ var PreferencesTab = ({
36436
36298
  }
36437
36299
  return packageSettings?.homeUrl || "";
36438
36300
  };
36439
- (0, import_react69.useEffect)(() => {
36301
+ (0, import_react70.useEffect)(() => {
36440
36302
  setLocalHomeUrl(preferences.homeUrl || "");
36441
36303
  }, [preferences.homeUrl]);
36442
36304
  const validateAndSaveHomeUrl = async (url) => {
@@ -36483,7 +36345,7 @@ var PreferencesTab = ({
36483
36345
  validateAndSaveHomeUrl(value);
36484
36346
  }, 1500);
36485
36347
  };
36486
- (0, import_react69.useEffect)(() => {
36348
+ (0, import_react70.useEffect)(() => {
36487
36349
  return () => {
36488
36350
  if (timeoutRef.current) {
36489
36351
  clearTimeout(timeoutRef.current);
@@ -37094,8 +36956,8 @@ var PreferencesTab = ({
37094
36956
  ] }) });
37095
36957
  };
37096
36958
  var ViewportDiagnostics = () => {
37097
- const [metrics, setMetrics] = (0, import_react69.useState)({});
37098
- (0, import_react69.useEffect)(() => {
36959
+ const [metrics, setMetrics] = (0, import_react70.useState)({});
36960
+ (0, import_react70.useEffect)(() => {
37099
36961
  const read = () => {
37100
36962
  const probe = document.createElement("div");
37101
36963
  probe.style.cssText = "position:fixed;top:0;bottom:0;padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px);visibility:hidden;pointer-events:none;";
@@ -37129,12 +36991,12 @@ var ViewportDiagnostics = () => {
37129
36991
  var PreferencesTab_default = PreferencesTab;
37130
36992
 
37131
36993
  // src/management/components/BrandingTab.tsx
37132
- var import_react71 = require("react");
36994
+ var import_react72 = require("react");
37133
36995
  var import_material49 = require("@mui/material");
37134
36996
  init_src();
37135
36997
 
37136
36998
  // src/components/LogoCropper.tsx
37137
- var import_react70 = require("react");
36999
+ var import_react71 = require("react");
37138
37000
  var import_material48 = require("@mui/material");
37139
37001
  init_icons();
37140
37002
  var import_jsx_runtime50 = require("react/jsx-runtime");
@@ -37149,25 +37011,25 @@ var LogoCropper = ({
37149
37011
  onCrop,
37150
37012
  imageFile
37151
37013
  }) => {
37152
- const canvasRef = (0, import_react70.useRef)(null);
37153
- const previewCanvasRef = (0, import_react70.useRef)(null);
37154
- const imageRef = (0, import_react70.useRef)(null);
37155
- const [imageSrc, setImageSrc] = (0, import_react70.useState)("");
37156
- const [cropSettings, setCropSettings] = (0, import_react70.useState)({
37014
+ const canvasRef = (0, import_react71.useRef)(null);
37015
+ const previewCanvasRef = (0, import_react71.useRef)(null);
37016
+ const imageRef = (0, import_react71.useRef)(null);
37017
+ const [imageSrc, setImageSrc] = (0, import_react71.useState)("");
37018
+ const [cropSettings, setCropSettings] = (0, import_react71.useState)({
37157
37019
  x: 0,
37158
37020
  y: 0,
37159
37021
  scale: 1,
37160
37022
  rotation: 0
37161
37023
  });
37162
- const [isDragging, setIsDragging] = (0, import_react70.useState)(false);
37163
- const [dragStart, setDragStart] = (0, import_react70.useState)({ x: 0, y: 0 });
37164
- const [imageLoaded, setImageLoaded] = (0, import_react70.useState)(false);
37165
- const [imageNaturalSize, setImageNaturalSize] = (0, import_react70.useState)({ width: 0, height: 0 });
37166
- const [aspectRatio, setAspectRatio] = (0, import_react70.useState)("square");
37167
- const [cropArea, setCropArea] = (0, import_react70.useState)({ width: 400, height: 400 });
37024
+ const [isDragging, setIsDragging] = (0, import_react71.useState)(false);
37025
+ const [dragStart, setDragStart] = (0, import_react71.useState)({ x: 0, y: 0 });
37026
+ const [imageLoaded, setImageLoaded] = (0, import_react71.useState)(false);
37027
+ const [imageNaturalSize, setImageNaturalSize] = (0, import_react71.useState)({ width: 0, height: 0 });
37028
+ const [aspectRatio, setAspectRatio] = (0, import_react71.useState)("square");
37029
+ const [cropArea, setCropArea] = (0, import_react71.useState)({ width: 400, height: 400 });
37168
37030
  const CANVAS_SIZE = 500;
37169
- const [outputSize, setOutputSize] = (0, import_react70.useState)("large");
37170
- const getCropDimensions = (0, import_react70.useCallback)(() => {
37031
+ const [outputSize, setOutputSize] = (0, import_react71.useState)("large");
37032
+ const getCropDimensions = (0, import_react71.useCallback)(() => {
37171
37033
  const maxSize = 380;
37172
37034
  switch (aspectRatio) {
37173
37035
  case "square":
@@ -37182,7 +37044,7 @@ var LogoCropper = ({
37182
37044
  return cropArea;
37183
37045
  }
37184
37046
  }, [aspectRatio, cropArea]);
37185
- (0, import_react70.useEffect)(() => {
37047
+ (0, import_react71.useEffect)(() => {
37186
37048
  if (imageFile && open) {
37187
37049
  const reader = new FileReader();
37188
37050
  reader.onload = (e) => {
@@ -37194,7 +37056,7 @@ var LogoCropper = ({
37194
37056
  reader.readAsDataURL(imageFile);
37195
37057
  }
37196
37058
  }, [imageFile, open]);
37197
- const handleImageLoad = (0, import_react70.useCallback)(() => {
37059
+ const handleImageLoad = (0, import_react71.useCallback)(() => {
37198
37060
  if (imageRef.current) {
37199
37061
  const { naturalWidth, naturalHeight } = imageRef.current;
37200
37062
  setImageNaturalSize({ width: naturalWidth, height: naturalHeight });
@@ -37212,7 +37074,7 @@ var LogoCropper = ({
37212
37074
  setImageLoaded(true);
37213
37075
  }
37214
37076
  }, [getCropDimensions]);
37215
- (0, import_react70.useEffect)(() => {
37077
+ (0, import_react71.useEffect)(() => {
37216
37078
  if (imageLoaded) {
37217
37079
  const cropDims = getCropDimensions();
37218
37080
  setCropArea(cropDims);
@@ -37226,7 +37088,7 @@ var LogoCropper = ({
37226
37088
  }));
37227
37089
  }
37228
37090
  }, [aspectRatio, imageLoaded, imageNaturalSize, getCropDimensions]);
37229
- const updatePreview = (0, import_react70.useCallback)((cropX, cropY, cropDims) => {
37091
+ const updatePreview = (0, import_react71.useCallback)((cropX, cropY, cropDims) => {
37230
37092
  const previewCanvas = previewCanvasRef.current;
37231
37093
  const mainCanvas = canvasRef.current;
37232
37094
  if (!previewCanvas || !mainCanvas) return;
@@ -37255,7 +37117,7 @@ var LogoCropper = ({
37255
37117
  previewCtx.lineWidth = 2;
37256
37118
  previewCtx.strokeRect(offsetX, offsetY, scaledWidth, scaledHeight);
37257
37119
  }, []);
37258
- const drawCropPreview = (0, import_react70.useCallback)(() => {
37120
+ const drawCropPreview = (0, import_react71.useCallback)(() => {
37259
37121
  const canvas = canvasRef.current;
37260
37122
  const image = imageRef.current;
37261
37123
  if (!canvas || !image || !imageLoaded) return;
@@ -37301,14 +37163,14 @@ var LogoCropper = ({
37301
37163
  ctx.fillRect(cropX + cropDims.width - 1, cropY + cropDims.height - cornerSize + 1, 3, cornerSize);
37302
37164
  updatePreview(cropX, cropY, cropDims);
37303
37165
  }, [cropSettings, imageLoaded, getCropDimensions, updatePreview]);
37304
- (0, import_react70.useEffect)(() => {
37166
+ (0, import_react71.useEffect)(() => {
37305
37167
  drawCropPreview();
37306
37168
  }, [drawCropPreview]);
37307
- const handleMouseDown = (0, import_react70.useCallback)((e) => {
37169
+ const handleMouseDown = (0, import_react71.useCallback)((e) => {
37308
37170
  setIsDragging(true);
37309
37171
  setDragStart({ x: e.clientX, y: e.clientY });
37310
37172
  }, []);
37311
- const handleMouseMove = (0, import_react70.useCallback)((e) => {
37173
+ const handleMouseMove = (0, import_react71.useCallback)((e) => {
37312
37174
  if (!isDragging) return;
37313
37175
  const deltaX = e.clientX - dragStart.x;
37314
37176
  const deltaY = e.clientY - dragStart.y;
@@ -37319,17 +37181,17 @@ var LogoCropper = ({
37319
37181
  }));
37320
37182
  setDragStart({ x: e.clientX, y: e.clientY });
37321
37183
  }, [isDragging, dragStart]);
37322
- const handleMouseUp = (0, import_react70.useCallback)(() => {
37184
+ const handleMouseUp = (0, import_react71.useCallback)(() => {
37323
37185
  setIsDragging(false);
37324
37186
  }, []);
37325
- const handleClose = (0, import_react70.useCallback)(() => {
37187
+ const handleClose = (0, import_react71.useCallback)(() => {
37326
37188
  setImageSrc("");
37327
37189
  setImageLoaded(false);
37328
37190
  setCropSettings({ x: 0, y: 0, scale: 1, rotation: 0 });
37329
37191
  setAspectRatio("square");
37330
37192
  onClose();
37331
37193
  }, [onClose]);
37332
- const handleCrop = (0, import_react70.useCallback)(() => {
37194
+ const handleCrop = (0, import_react71.useCallback)(() => {
37333
37195
  const image = imageRef.current;
37334
37196
  if (!image) return;
37335
37197
  const cropDims = getCropDimensions();
@@ -37382,7 +37244,7 @@ var LogoCropper = ({
37382
37244
  setAspectRatio("square");
37383
37245
  onClose();
37384
37246
  }, [cropSettings, onCrop, getCropDimensions, outputSize, onClose]);
37385
- const handleScaleChange = (0, import_react70.useCallback)((value) => {
37247
+ const handleScaleChange = (0, import_react71.useCallback)((value) => {
37386
37248
  const cropDims = getCropDimensions();
37387
37249
  const minScale2 = Math.max(
37388
37250
  cropDims.width / imageNaturalSize.width,
@@ -37393,7 +37255,7 @@ var LogoCropper = ({
37393
37255
  scale: Math.max(value, minScale2)
37394
37256
  }));
37395
37257
  }, [imageNaturalSize, getCropDimensions]);
37396
- const handleRotation = (0, import_react70.useCallback)((direction) => {
37258
+ const handleRotation = (0, import_react71.useCallback)((direction) => {
37397
37259
  setCropSettings((prev) => ({
37398
37260
  ...prev,
37399
37261
  rotation: prev.rotation + (direction === "left" ? -90 : 90)
@@ -37679,20 +37541,20 @@ var BrandingTab = ({
37679
37541
  setLogoFile,
37680
37542
  setLogoBase64
37681
37543
  }) => {
37682
- const [dragOver, setDragOver] = (0, import_react71.useState)(false);
37683
- const [snackbarMessage, setSnackbarMessage] = (0, import_react71.useState)("");
37684
- const [showSnackbar, setShowSnackbar] = (0, import_react71.useState)(false);
37685
- const [snackbarSeverity, setSnackbarSeverity] = (0, import_react71.useState)("success");
37686
- const [cropperOpen, setCropperOpen] = (0, import_react71.useState)(false);
37687
- const [selectedImageFile, setSelectedImageFile] = (0, import_react71.useState)(null);
37688
- const fileInputRef = (0, import_react71.useRef)(null);
37689
- const importInputRef = (0, import_react71.useRef)(null);
37544
+ const [dragOver, setDragOver] = (0, import_react72.useState)(false);
37545
+ const [snackbarMessage, setSnackbarMessage] = (0, import_react72.useState)("");
37546
+ const [showSnackbar, setShowSnackbar] = (0, import_react72.useState)(false);
37547
+ const [snackbarSeverity, setSnackbarSeverity] = (0, import_react72.useState)("success");
37548
+ const [cropperOpen, setCropperOpen] = (0, import_react72.useState)(false);
37549
+ const [selectedImageFile, setSelectedImageFile] = (0, import_react72.useState)(null);
37550
+ const fileInputRef = (0, import_react72.useRef)(null);
37551
+ const importInputRef = (0, import_react72.useRef)(null);
37690
37552
  const pageMode = (0, import_material49.useTheme)().palette.mode;
37691
37553
  const choice = parseBrandingTheme(theme);
37692
37554
  const setChoice = (next) => setTheme(brandingThemeKey(next));
37693
37555
  const currentAccent = choice.accent ?? skins[choice.skin].accent[choice.mode];
37694
- const [accentDraft, setAccentDraft] = (0, import_react71.useState)(currentAccent);
37695
- (0, import_react71.useEffect)(() => setAccentDraft(currentAccent), [currentAccent]);
37556
+ const [accentDraft, setAccentDraft] = (0, import_react72.useState)(currentAccent);
37557
+ (0, import_react72.useEffect)(() => setAccentDraft(currentAccent), [currentAccent]);
37696
37558
  const draftValid = isTenantAccent(accentDraft);
37697
37559
  const applyCustomAccent = (value) => {
37698
37560
  setAccentDraft(value);
@@ -38062,14 +37924,14 @@ var WelcomePreview = ({
38062
37924
  var BrandingTab_default = BrandingTab;
38063
37925
 
38064
37926
  // src/management/components/KnowledgeHubTab.tsx
38065
- var import_react77 = require("react");
37927
+ var import_react78 = require("react");
38066
37928
  var import_material53 = require("@mui/material");
38067
37929
 
38068
37930
  // src/management/components/KnowledgeTab.tsx
38069
- var import_react75 = require("react");
37931
+ var import_react76 = require("react");
38070
37932
  var import_uuid6 = require("uuid");
38071
37933
  var import_material51 = require("@mui/material");
38072
- var import_styles30 = require("@mui/material/styles");
37934
+ var import_styles29 = require("@mui/material/styles");
38073
37935
  init_knowledge_file_modal();
38074
37936
  init_DocumentCard();
38075
37937
  init_useVectorStore();
@@ -38077,9 +37939,9 @@ init_authenticationStore();
38077
37939
  init_useFeatures();
38078
37940
 
38079
37941
  // src/components/shared/ProcessingOverlay.tsx
38080
- var import_react72 = require("react");
37942
+ var import_react73 = require("react");
38081
37943
  var import_material50 = require("@mui/material");
38082
- var import_react73 = require("@burtson-labs/icons/react");
37944
+ var import_react74 = require("@burtson-labs/icons/react");
38083
37945
  var import_jsx_runtime52 = require("react/jsx-runtime");
38084
37946
  var ninjaFloat = import_material50.keyframes`
38085
37947
  0%, 100% { transform: translateY(0px) rotate(0deg); }
@@ -38104,28 +37966,28 @@ var defaultSteps = [
38104
37966
  id: "upload",
38105
37967
  title: "Uploading to Cloud",
38106
37968
  description: "Our digital ninjas are securely transferring your file...",
38107
- icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react73.Upload, {}),
37969
+ icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react74.Upload, {}),
38108
37970
  duration: 5
38109
37971
  },
38110
37972
  {
38111
37973
  id: "analyze",
38112
37974
  title: "AI Analysis",
38113
37975
  description: "Advanced AI robots are reading and understanding your content...",
38114
- icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react73.Agent, {}),
37976
+ icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react74.Agent, {}),
38115
37977
  duration: 15
38116
37978
  },
38117
37979
  {
38118
37980
  id: "embed",
38119
37981
  title: "Making It Searchable",
38120
37982
  description: "We turn the content into a private, searchable index...",
38121
- icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react73.Cpu, {}),
37983
+ icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react74.Cpu, {}),
38122
37984
  duration: 10
38123
37985
  },
38124
37986
  {
38125
37987
  id: "optimize",
38126
37988
  title: "Optimizing Search",
38127
37989
  description: "Organizing everything for quick, reliable answers...",
38128
- icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react73.Sparkles, {}),
37990
+ icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react74.Sparkles, {}),
38129
37991
  duration: 8
38130
37992
  }
38131
37993
  ];
@@ -38150,17 +38012,17 @@ var ProcessingOverlay = ({
38150
38012
  customMessages
38151
38013
  }) => {
38152
38014
  const theme = (0, import_material50.useTheme)();
38153
- const [messageIndex, setMessageIndex] = (0, import_react72.useState)(0);
38154
- const [sparkles, setSparkles] = (0, import_react72.useState)([]);
38015
+ const [messageIndex, setMessageIndex] = (0, import_react73.useState)(0);
38016
+ const [sparkles, setSparkles] = (0, import_react73.useState)([]);
38155
38017
  const messages = customMessages || cleverMessages;
38156
- (0, import_react72.useEffect)(() => {
38018
+ (0, import_react73.useEffect)(() => {
38157
38019
  if (!open) return;
38158
38020
  const interval = setInterval(() => {
38159
38021
  setMessageIndex((prev) => (prev + 1) % messages.length);
38160
38022
  }, 3e3);
38161
38023
  return () => clearInterval(interval);
38162
38024
  }, [open, messages.length]);
38163
- (0, import_react72.useEffect)(() => {
38025
+ (0, import_react73.useEffect)(() => {
38164
38026
  if (!open) return;
38165
38027
  const generateSparkles = () => {
38166
38028
  const newSparkles = Array.from({ length: 5 }, (_, i) => ({
@@ -38271,7 +38133,7 @@ var ProcessingOverlay = ({
38271
38133
  animation: `${pulse} 3s ease-in-out infinite`,
38272
38134
  color: theme.palette.secondary.main
38273
38135
  },
38274
- children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react73.Agent, {})
38136
+ children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react74.Agent, {})
38275
38137
  }
38276
38138
  ),
38277
38139
  /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
@@ -38285,7 +38147,7 @@ var ProcessingOverlay = ({
38285
38147
  color: theme.palette.primary.main,
38286
38148
  animationDelay: "1s"
38287
38149
  },
38288
- children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react73.Zap, {})
38150
+ children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react74.Zap, {})
38289
38151
  }
38290
38152
  )
38291
38153
  ] }),
@@ -38372,16 +38234,16 @@ var ProcessingOverlay = ({
38372
38234
  var ProcessingOverlay_default = ProcessingOverlay;
38373
38235
 
38374
38236
  // src/hooks/useProcessingOverlay.ts
38375
- var import_react74 = require("react");
38237
+ var import_react75 = require("react");
38376
38238
  var useProcessingOverlay = () => {
38377
- const [processingState, setProcessingState] = (0, import_react74.useState)({
38239
+ const [processingState, setProcessingState] = (0, import_react75.useState)({
38378
38240
  isVisible: false,
38379
38241
  step: "upload",
38380
38242
  progress: 0,
38381
38243
  title: "Processing...",
38382
38244
  customMessages: void 0
38383
38245
  });
38384
- const showProcessing = (0, import_react74.useCallback)((title = "Processing...", messages) => {
38246
+ const showProcessing = (0, import_react75.useCallback)((title = "Processing...", messages) => {
38385
38247
  setProcessingState({
38386
38248
  isVisible: true,
38387
38249
  step: "upload",
@@ -38390,13 +38252,13 @@ var useProcessingOverlay = () => {
38390
38252
  customMessages: messages
38391
38253
  });
38392
38254
  }, []);
38393
- const hideProcessing = (0, import_react74.useCallback)(() => {
38255
+ const hideProcessing = (0, import_react75.useCallback)(() => {
38394
38256
  setProcessingState((prev) => ({
38395
38257
  ...prev,
38396
38258
  isVisible: false
38397
38259
  }));
38398
38260
  }, []);
38399
- const updateProgress = (0, import_react74.useCallback)((step, progress) => {
38261
+ const updateProgress = (0, import_react75.useCallback)((step, progress) => {
38400
38262
  setProcessingState((prev) => ({
38401
38263
  ...prev,
38402
38264
  step,
@@ -38510,27 +38372,27 @@ var KnowledgeTab = ({
38510
38372
  } = useVectorStore();
38511
38373
  const { showProcessing, hideProcessing, updateProgress, processingState } = useProcessingOverlay();
38512
38374
  const shouldUseVector = (features.isAdmin() || features.hasAdvancedSearch() || features.hasAdvancedMemories()) && isAdvancedVectorFeaturesEnabled && isVectorEnabled;
38513
- const [clearDocsDialogOpen, setClearDocsDialogOpen] = (0, import_react75.useState)(false);
38514
- const [selectedDoc, setSelectedDoc] = (0, import_react75.useState)(null);
38515
- const [vectorDocuments, setVectorDocuments] = (0, import_react75.useState)([]);
38516
- const [loadingVectorDocs, setLoadingVectorDocs] = (0, import_react75.useState)(false);
38517
- const [vectorLoadError, setVectorLoadError] = (0, import_react75.useState)(null);
38518
- const [searchQuery, setSearchQuery] = (0, import_react75.useState)("");
38519
- const [selectedCategory, setSelectedCategory] = (0, import_react75.useState)("all");
38520
- const [contentSourceFilter, setContentSourceFilter] = (0, import_react75.useState)("all");
38521
- const [viewMode, setViewMode] = (0, import_react75.useState)("grid");
38522
- const [sortBy, setSortBy] = (0, import_react75.useState)("date");
38523
- const [sortOrder, setSortOrder] = (0, import_react75.useState)("desc");
38524
- const [selectedDocuments, setSelectedDocuments] = (0, import_react75.useState)([]);
38525
- const [uploadStatuses, setUploadStatuses] = (0, import_react75.useState)([]);
38526
- const [snackbarMessage, setSnackbarMessage] = (0, import_react75.useState)("");
38527
- const [showSnackbar, setShowSnackbar] = (0, import_react75.useState)(false);
38528
- const [snackbarSeverity, setSnackbarSeverity] = (0, import_react75.useState)("success");
38529
- const [deletingDocuments, setDeletingDocuments] = (0, import_react75.useState)(/* @__PURE__ */ new Set());
38375
+ const [clearDocsDialogOpen, setClearDocsDialogOpen] = (0, import_react76.useState)(false);
38376
+ const [selectedDoc, setSelectedDoc] = (0, import_react76.useState)(null);
38377
+ const [vectorDocuments, setVectorDocuments] = (0, import_react76.useState)([]);
38378
+ const [loadingVectorDocs, setLoadingVectorDocs] = (0, import_react76.useState)(false);
38379
+ const [vectorLoadError, setVectorLoadError] = (0, import_react76.useState)(null);
38380
+ const [searchQuery, setSearchQuery] = (0, import_react76.useState)("");
38381
+ const [selectedCategory, setSelectedCategory] = (0, import_react76.useState)("all");
38382
+ const [contentSourceFilter, setContentSourceFilter] = (0, import_react76.useState)("all");
38383
+ const [viewMode, setViewMode] = (0, import_react76.useState)("grid");
38384
+ const [sortBy, setSortBy] = (0, import_react76.useState)("date");
38385
+ const [sortOrder, setSortOrder] = (0, import_react76.useState)("desc");
38386
+ const [selectedDocuments, setSelectedDocuments] = (0, import_react76.useState)([]);
38387
+ const [uploadStatuses, setUploadStatuses] = (0, import_react76.useState)([]);
38388
+ const [snackbarMessage, setSnackbarMessage] = (0, import_react76.useState)("");
38389
+ const [showSnackbar, setShowSnackbar] = (0, import_react76.useState)(false);
38390
+ const [snackbarSeverity, setSnackbarSeverity] = (0, import_react76.useState)("success");
38391
+ const [deletingDocuments, setDeletingDocuments] = (0, import_react76.useState)(/* @__PURE__ */ new Set());
38530
38392
  const hasTeam = !!(authStore.user?.teamSid || authStore.user?.teamId);
38531
- const [shareWithTeam, setShareWithTeam] = (0, import_react75.useState)(false);
38532
- const [dragActive, setDragActive] = (0, import_react75.useState)(false);
38533
- const mapVectorDocsToKnowledgeDocs = (0, import_react75.useCallback)((vectorDocs) => {
38393
+ const [shareWithTeam, setShareWithTeam] = (0, import_react76.useState)(false);
38394
+ const [dragActive, setDragActive] = (0, import_react76.useState)(false);
38395
+ const mapVectorDocsToKnowledgeDocs = (0, import_react76.useCallback)((vectorDocs) => {
38534
38396
  return vectorDocs.map((doc) => {
38535
38397
  const primaryId = doc.id ?? doc.fileId ?? doc._id;
38536
38398
  const docId = typeof primaryId === "string" ? primaryId : primaryId ? JSON.stringify(primaryId) : (0, import_uuid6.v4)();
@@ -38558,7 +38420,7 @@ var KnowledgeTab = ({
38558
38420
  };
38559
38421
  });
38560
38422
  }, []);
38561
- const loadVectorDocuments = (0, import_react75.useCallback)(async () => {
38423
+ const loadVectorDocuments = (0, import_react76.useCallback)(async () => {
38562
38424
  if (!shouldUseVector) {
38563
38425
  return;
38564
38426
  }
@@ -38575,12 +38437,12 @@ var KnowledgeTab = ({
38575
38437
  setLoadingVectorDocs(false);
38576
38438
  }
38577
38439
  }, [shouldUseVector, getUserDocuments, mapVectorDocsToKnowledgeDocs]);
38578
- (0, import_react75.useEffect)(() => {
38440
+ (0, import_react76.useEffect)(() => {
38579
38441
  if (shouldUseVector) {
38580
38442
  loadVectorDocuments();
38581
38443
  }
38582
38444
  }, [shouldUseVector, loadVectorDocuments]);
38583
- const filteredAndSortedDocuments = (0, import_react75.useMemo)(() => {
38445
+ const filteredAndSortedDocuments = (0, import_react76.useMemo)(() => {
38584
38446
  const sourceDocuments2 = shouldUseVector ? vectorDocuments : documents;
38585
38447
  let filtered = sourceDocuments2;
38586
38448
  if (searchQuery) {
@@ -38630,12 +38492,12 @@ var KnowledgeTab = ({
38630
38492
  });
38631
38493
  return filtered;
38632
38494
  }, [documents, vectorDocuments, shouldUseVector, searchQuery, selectedCategory, contentSourceFilter, sortBy, sortOrder]);
38633
- const categories = (0, import_react75.useMemo)(() => {
38495
+ const categories = (0, import_react76.useMemo)(() => {
38634
38496
  const sourceDocuments2 = shouldUseVector ? vectorDocuments : documents;
38635
38497
  const cats = new Set(sourceDocuments2.map((doc) => getFileTypeInfo3(doc.name).category));
38636
38498
  return Array.from(cats).sort();
38637
38499
  }, [documents, vectorDocuments, shouldUseVector]);
38638
- const statistics = (0, import_react75.useMemo)(() => {
38500
+ const statistics = (0, import_react76.useMemo)(() => {
38639
38501
  const sourceDocuments2 = shouldUseVector ? vectorDocuments : documents;
38640
38502
  const totalSize = sourceDocuments2.reduce((sum, doc) => {
38641
38503
  if (shouldUseVector && doc.size) {
@@ -39138,7 +39000,7 @@ var KnowledgeTab = ({
39138
39000
  borderRadius: 1,
39139
39001
  border: "1px dashed",
39140
39002
  borderColor: dragActive ? "primary.main" : "divider",
39141
- bgcolor: dragActive ? (0, import_styles30.alpha)(muiTheme.palette.primary.main, 0.06) : "transparent",
39003
+ bgcolor: dragActive ? (0, import_styles29.alpha)(muiTheme.palette.primary.main, 0.06) : "transparent",
39142
39004
  transition: "border-color 0.15s ease, background-color 0.15s ease",
39143
39005
  "&:hover, &:focus-visible": { borderColor: "primary.main", outline: "none" }
39144
39006
  },
@@ -39359,7 +39221,7 @@ var KnowledgeTab = ({
39359
39221
  border: 1,
39360
39222
  borderRadius: 1,
39361
39223
  borderColor: isSelected ? "primary.main" : "divider",
39362
- bgcolor: isSelected ? (0, import_styles30.alpha)(muiTheme.palette.primary.main, 0.08) : muiTheme.palette.bandit?.surface.raised ?? "background.paper",
39224
+ bgcolor: isSelected ? (0, import_styles29.alpha)(muiTheme.palette.primary.main, 0.08) : muiTheme.palette.bandit?.surface.raised ?? "background.paper",
39363
39225
  transition: "border-color 0.15s ease, opacity 0.3s ease, transform 0.3s ease",
39364
39226
  "&:hover": { borderColor: "primary.main" },
39365
39227
  opacity: isDeleting ? 0.3 : 1,
@@ -39516,7 +39378,7 @@ var KnowledgeTab = ({
39516
39378
  var KnowledgeTab_default = KnowledgeTab;
39517
39379
 
39518
39380
  // src/management/components/SeedPacksTab.tsx
39519
- var import_react76 = require("react");
39381
+ var import_react77 = require("react");
39520
39382
  var import_material52 = require("@mui/material");
39521
39383
  init_packageSettingsStore();
39522
39384
  init_authenticationStore();
@@ -40004,47 +39866,47 @@ var SeedPacksTab = () => {
40004
39866
  const seedPackAdminRoles = /* @__PURE__ */ new Set(["admin", "super-user", "team_admin", "team_owner"]);
40005
39867
  const userRoles = authStore.user?.roles ?? [];
40006
39868
  const canManage = userRoles.some((role) => seedPackAdminRoles.has(role));
40007
- const [seedPacks, setSeedPacks] = (0, import_react76.useState)([]);
40008
- const [selectedSid, setSelectedSid] = (0, import_react76.useState)(null);
40009
- const [selectedSeedPack, setSelectedSeedPack] = (0, import_react76.useState)(null);
40010
- const [draft, setDraft] = (0, import_react76.useState)({
39869
+ const [seedPacks, setSeedPacks] = (0, import_react77.useState)([]);
39870
+ const [selectedSid, setSelectedSid] = (0, import_react77.useState)(null);
39871
+ const [selectedSeedPack, setSelectedSeedPack] = (0, import_react77.useState)(null);
39872
+ const [draft, setDraft] = (0, import_react77.useState)({
40011
39873
  name: "",
40012
39874
  description: "",
40013
39875
  content: ""
40014
39876
  });
40015
- const [tagsInput, setTagsInput] = (0, import_react76.useState)("");
40016
- const [importedFiles, setImportedFiles] = (0, import_react76.useState)([]);
40017
- const [createImportedFiles, setCreateImportedFiles] = (0, import_react76.useState)([]);
40018
- const [previewFile, setPreviewFile] = (0, import_react76.useState)(null);
40019
- const fileInputRef = (0, import_react76.useRef)(null);
40020
- const wikiFolderInputRef = (0, import_react76.useRef)(null);
40021
- const createFileInputRef = (0, import_react76.useRef)(null);
40022
- const createWikiFolderInputRef = (0, import_react76.useRef)(null);
40023
- const [isLoadingList, setIsLoadingList] = (0, import_react76.useState)(false);
40024
- const [hasLoadedList, setHasLoadedList] = (0, import_react76.useState)(false);
40025
- const [listError, setListError] = (0, import_react76.useState)(null);
40026
- const [isLoadingDetail, setIsLoadingDetail] = (0, import_react76.useState)(false);
40027
- const [isSaving, setIsSaving] = (0, import_react76.useState)(false);
40028
- const [isPublishing, setIsPublishing] = (0, import_react76.useState)(false);
40029
- const [isArchiving, setIsArchiving] = (0, import_react76.useState)(false);
40030
- const [isDeleting, setIsDeleting] = (0, import_react76.useState)(false);
40031
- const [isCreating, setIsCreating] = (0, import_react76.useState)(false);
40032
- const [createDialogOpen, setCreateDialogOpen] = (0, import_react76.useState)(false);
40033
- const [publishDialogOpen, setPublishDialogOpen] = (0, import_react76.useState)(false);
40034
- const [archiveDialogOpen, setArchiveDialogOpen] = (0, import_react76.useState)(false);
40035
- const [deleteDialogOpen, setDeleteDialogOpen] = (0, import_react76.useState)(false);
40036
- const [newPackName, setNewPackName] = (0, import_react76.useState)("");
40037
- const [newPackDescription, setNewPackDescription] = (0, import_react76.useState)("");
40038
- const [newPackTags, setNewPackTags] = (0, import_react76.useState)("");
40039
- const [snackbarOpen, setSnackbarOpen] = (0, import_react76.useState)(false);
40040
- const [snackbarMessage, setSnackbarMessage] = (0, import_react76.useState)("");
40041
- const [snackbarSeverity, setSnackbarSeverity] = (0, import_react76.useState)("success");
40042
- const parsedTags = (0, import_react76.useMemo)(() => parseTags(tagsInput), [tagsInput]);
40043
- const normalizedSelectedTags = (0, import_react76.useMemo)(
39877
+ const [tagsInput, setTagsInput] = (0, import_react77.useState)("");
39878
+ const [importedFiles, setImportedFiles] = (0, import_react77.useState)([]);
39879
+ const [createImportedFiles, setCreateImportedFiles] = (0, import_react77.useState)([]);
39880
+ const [previewFile, setPreviewFile] = (0, import_react77.useState)(null);
39881
+ const fileInputRef = (0, import_react77.useRef)(null);
39882
+ const wikiFolderInputRef = (0, import_react77.useRef)(null);
39883
+ const createFileInputRef = (0, import_react77.useRef)(null);
39884
+ const createWikiFolderInputRef = (0, import_react77.useRef)(null);
39885
+ const [isLoadingList, setIsLoadingList] = (0, import_react77.useState)(false);
39886
+ const [hasLoadedList, setHasLoadedList] = (0, import_react77.useState)(false);
39887
+ const [listError, setListError] = (0, import_react77.useState)(null);
39888
+ const [isLoadingDetail, setIsLoadingDetail] = (0, import_react77.useState)(false);
39889
+ const [isSaving, setIsSaving] = (0, import_react77.useState)(false);
39890
+ const [isPublishing, setIsPublishing] = (0, import_react77.useState)(false);
39891
+ const [isArchiving, setIsArchiving] = (0, import_react77.useState)(false);
39892
+ const [isDeleting, setIsDeleting] = (0, import_react77.useState)(false);
39893
+ const [isCreating, setIsCreating] = (0, import_react77.useState)(false);
39894
+ const [createDialogOpen, setCreateDialogOpen] = (0, import_react77.useState)(false);
39895
+ const [publishDialogOpen, setPublishDialogOpen] = (0, import_react77.useState)(false);
39896
+ const [archiveDialogOpen, setArchiveDialogOpen] = (0, import_react77.useState)(false);
39897
+ const [deleteDialogOpen, setDeleteDialogOpen] = (0, import_react77.useState)(false);
39898
+ const [newPackName, setNewPackName] = (0, import_react77.useState)("");
39899
+ const [newPackDescription, setNewPackDescription] = (0, import_react77.useState)("");
39900
+ const [newPackTags, setNewPackTags] = (0, import_react77.useState)("");
39901
+ const [snackbarOpen, setSnackbarOpen] = (0, import_react77.useState)(false);
39902
+ const [snackbarMessage, setSnackbarMessage] = (0, import_react77.useState)("");
39903
+ const [snackbarSeverity, setSnackbarSeverity] = (0, import_react77.useState)("success");
39904
+ const parsedTags = (0, import_react77.useMemo)(() => parseTags(tagsInput), [tagsInput]);
39905
+ const normalizedSelectedTags = (0, import_react77.useMemo)(
40044
39906
  () => normalizeTags(selectedSeedPack?.tags),
40045
39907
  [selectedSeedPack?.tags]
40046
39908
  );
40047
- const isDirty = (0, import_react76.useMemo)(() => {
39909
+ const isDirty = (0, import_react77.useMemo)(() => {
40048
39910
  if (!selectedSeedPack) {
40049
39911
  return false;
40050
39912
  }
@@ -40055,17 +39917,17 @@ var SeedPacksTab = () => {
40055
39917
  return nameChanged || descriptionChanged || contentChanged || tagsChanged;
40056
39918
  }, [draft, parsedTags, normalizedSelectedTags, selectedSeedPack]);
40057
39919
  const isReadOnly = !canManage || selectedSeedPack?.status === "archived";
40058
- const sortedSeedPacks = (0, import_react76.useMemo)(() => {
39920
+ const sortedSeedPacks = (0, import_react77.useMemo)(() => {
40059
39921
  return [...seedPacks].sort((a, b) => getSeedPackTimestamp(b) - getSeedPackTimestamp(a));
40060
39922
  }, [seedPacks]);
40061
39923
  const scopeLabel = isTeamScope ? "Team scope" : "Personal scope";
40062
39924
  const scopeDescription = isTeamScope ? "Applies to all members of your team." : "Applies only to your account.";
40063
- const showSnackbar = (0, import_react76.useCallback)((message, severity) => {
39925
+ const showSnackbar = (0, import_react77.useCallback)((message, severity) => {
40064
39926
  setSnackbarMessage(message);
40065
39927
  setSnackbarSeverity(severity);
40066
39928
  setSnackbarOpen(true);
40067
39929
  }, []);
40068
- const hydrateDraft = (0, import_react76.useCallback)((pack) => {
39930
+ const hydrateDraft = (0, import_react77.useCallback)((pack) => {
40069
39931
  setDraft({
40070
39932
  name: pack.name ?? "",
40071
39933
  description: pack.description ?? "",
@@ -40075,14 +39937,14 @@ var SeedPacksTab = () => {
40075
39937
  setImportedFiles([]);
40076
39938
  setPreviewFile(null);
40077
39939
  }, []);
40078
- const resetCreateDialog = (0, import_react76.useCallback)(() => {
39940
+ const resetCreateDialog = (0, import_react77.useCallback)(() => {
40079
39941
  setCreateDialogOpen(false);
40080
39942
  setNewPackName("");
40081
39943
  setNewPackDescription("");
40082
39944
  setNewPackTags("");
40083
39945
  setCreateImportedFiles([]);
40084
39946
  }, []);
40085
- const refreshSeedPacks = (0, import_react76.useCallback)(
39947
+ const refreshSeedPacks = (0, import_react77.useCallback)(
40086
39948
  async (nextSelectedSid) => {
40087
39949
  if (!gatewayConfigured) {
40088
39950
  return;
@@ -40109,7 +39971,7 @@ var SeedPacksTab = () => {
40109
39971
  },
40110
39972
  [gatewayConfigured, selectedSid]
40111
39973
  );
40112
- const loadSeedPackDetail = (0, import_react76.useCallback)(
39974
+ const loadSeedPackDetail = (0, import_react77.useCallback)(
40113
39975
  async (sid) => {
40114
39976
  if (!gatewayConfigured) {
40115
39977
  return;
@@ -40131,15 +39993,15 @@ var SeedPacksTab = () => {
40131
39993
  },
40132
39994
  [gatewayConfigured, hydrateDraft, showSnackbar]
40133
39995
  );
40134
- (0, import_react76.useEffect)(() => {
39996
+ (0, import_react77.useEffect)(() => {
40135
39997
  void refreshSeedPacks();
40136
39998
  }, [refreshSeedPacks, authStore.token]);
40137
- (0, import_react76.useEffect)(() => {
39999
+ (0, import_react77.useEffect)(() => {
40138
40000
  if (selectedSid) {
40139
40001
  void loadSeedPackDetail(selectedSid);
40140
40002
  }
40141
40003
  }, [selectedSid, loadSeedPackDetail]);
40142
- (0, import_react76.useEffect)(() => {
40004
+ (0, import_react77.useEffect)(() => {
40143
40005
  const setDirectoryUploadAttributes = (input) => {
40144
40006
  if (!input) {
40145
40007
  return;
@@ -40155,7 +40017,7 @@ var SeedPacksTab = () => {
40155
40017
  setSelectedSeedPack(pack);
40156
40018
  hydrateDraft(pack);
40157
40019
  };
40158
- const handleImportFiles = (0, import_react76.useCallback)(
40020
+ const handleImportFiles = (0, import_react77.useCallback)(
40159
40021
  async (files, source = "local") => {
40160
40022
  if (!files || files.length === 0) {
40161
40023
  return;
@@ -40198,24 +40060,24 @@ ${combined}` : combined;
40198
40060
  },
40199
40061
  [importedFiles, showSnackbar]
40200
40062
  );
40201
- const handleFileInputChange = (0, import_react76.useCallback)(
40063
+ const handleFileInputChange = (0, import_react77.useCallback)(
40202
40064
  async (event) => {
40203
40065
  await handleImportFiles(event.target.files, "local");
40204
40066
  event.target.value = "";
40205
40067
  },
40206
40068
  [handleImportFiles]
40207
40069
  );
40208
- const handleWikiFolderInputChange = (0, import_react76.useCallback)(
40070
+ const handleWikiFolderInputChange = (0, import_react77.useCallback)(
40209
40071
  async (event) => {
40210
40072
  await handleImportFiles(event.target.files, "azure-wiki");
40211
40073
  event.target.value = "";
40212
40074
  },
40213
40075
  [handleImportFiles]
40214
40076
  );
40215
- const handleRemoveImportedFile = (0, import_react76.useCallback)((id) => {
40077
+ const handleRemoveImportedFile = (0, import_react77.useCallback)((id) => {
40216
40078
  setImportedFiles((prev) => prev.filter((file) => file.id !== id));
40217
40079
  }, []);
40218
- const handleCreateImportFiles = (0, import_react76.useCallback)(
40080
+ const handleCreateImportFiles = (0, import_react77.useCallback)(
40219
40081
  async (files, source = "local") => {
40220
40082
  if (!files || files.length === 0) {
40221
40083
  return;
@@ -40236,24 +40098,24 @@ ${combined}` : combined;
40236
40098
  },
40237
40099
  [showSnackbar]
40238
40100
  );
40239
- const handleCreateFileInputChange = (0, import_react76.useCallback)(
40101
+ const handleCreateFileInputChange = (0, import_react77.useCallback)(
40240
40102
  async (event) => {
40241
40103
  await handleCreateImportFiles(event.target.files, "local");
40242
40104
  event.target.value = "";
40243
40105
  },
40244
40106
  [handleCreateImportFiles]
40245
40107
  );
40246
- const handleCreateWikiFolderInputChange = (0, import_react76.useCallback)(
40108
+ const handleCreateWikiFolderInputChange = (0, import_react77.useCallback)(
40247
40109
  async (event) => {
40248
40110
  await handleCreateImportFiles(event.target.files, "azure-wiki");
40249
40111
  event.target.value = "";
40250
40112
  },
40251
40113
  [handleCreateImportFiles]
40252
40114
  );
40253
- const handleRemoveCreateImportedFile = (0, import_react76.useCallback)((id) => {
40115
+ const handleRemoveCreateImportedFile = (0, import_react77.useCallback)((id) => {
40254
40116
  setCreateImportedFiles((prev) => prev.filter((file) => file.id !== id));
40255
40117
  }, []);
40256
- const buildDraftPayload2 = (0, import_react76.useCallback)(() => {
40118
+ const buildDraftPayload2 = (0, import_react77.useCallback)(() => {
40257
40119
  const name = draft.name.trim();
40258
40120
  if (!name) {
40259
40121
  showSnackbar("Seed pack name is required.", "error");
@@ -40267,7 +40129,7 @@ ${combined}` : combined;
40267
40129
  contentType: "markdown"
40268
40130
  };
40269
40131
  }, [draft, parsedTags, showSnackbar]);
40270
- const saveDraft = (0, import_react76.useCallback)(async () => {
40132
+ const saveDraft = (0, import_react77.useCallback)(async () => {
40271
40133
  if (!selectedSeedPack) {
40272
40134
  return null;
40273
40135
  }
@@ -40982,9 +40844,9 @@ var KnowledgeHubTab = (props) => {
40982
40844
  const theme = (0, import_material53.useTheme)();
40983
40845
  const isMobile = (0, import_material53.useMediaQuery)(theme.breakpoints.down("sm"));
40984
40846
  const { seedPacksEnabled = false } = props;
40985
- const [tabIndex, setTabIndex] = (0, import_react77.useState)(0);
40847
+ const [tabIndex, setTabIndex] = (0, import_react78.useState)(0);
40986
40848
  const effectiveTabIndex = seedPacksEnabled ? tabIndex : 0;
40987
- (0, import_react77.useEffect)(() => {
40849
+ (0, import_react78.useEffect)(() => {
40988
40850
  if (!seedPacksEnabled && tabIndex !== 0) {
40989
40851
  setTabIndex(0);
40990
40852
  }
@@ -41027,7 +40889,7 @@ var KnowledgeHubTab = (props) => {
41027
40889
  var KnowledgeHubTab_default = KnowledgeHubTab;
41028
40890
 
41029
40891
  // src/management/components/StorageTab.tsx
41030
- var import_react78 = require("react");
40892
+ var import_react79 = require("react");
41031
40893
  var import_material54 = require("@mui/material");
41032
40894
  init_debugLogger();
41033
40895
  init_indexedDBService();
@@ -41325,21 +41187,21 @@ var clearEntireDatabase = async (dbName) => {
41325
41187
  };
41326
41188
  var StorageTab = ({ currentTheme }) => {
41327
41189
  const theme = (0, import_material54.useTheme)();
41328
- const [storageQuota, setStorageQuota] = (0, import_react78.useState)({
41190
+ const [storageQuota, setStorageQuota] = (0, import_react79.useState)({
41329
41191
  used: 0,
41330
41192
  quota: 0,
41331
41193
  available: 0,
41332
41194
  browserQuotaEstimate: 0
41333
41195
  });
41334
- const [storageCategories, setStorageCategories] = (0, import_react78.useState)([]);
41335
- const [loading, setLoading] = (0, import_react78.useState)(true);
41336
- const [loadError, setLoadError] = (0, import_react78.useState)(null);
41337
- const [clearAllDialogOpen, setClearAllDialogOpen] = (0, import_react78.useState)(false);
41338
- const [clearCategoryDialog, setClearCategoryDialog] = (0, import_react78.useState)(null);
41339
- const [clearing, setClearing] = (0, import_react78.useState)(false);
41340
- const [snackbarMessage, setSnackbarMessage] = (0, import_react78.useState)("");
41341
- const [showSnackbar, setShowSnackbar] = (0, import_react78.useState)(false);
41342
- const [snackbarSeverity, setSnackbarSeverity] = (0, import_react78.useState)("success");
41196
+ const [storageCategories, setStorageCategories] = (0, import_react79.useState)([]);
41197
+ const [loading, setLoading] = (0, import_react79.useState)(true);
41198
+ const [loadError, setLoadError] = (0, import_react79.useState)(null);
41199
+ const [clearAllDialogOpen, setClearAllDialogOpen] = (0, import_react79.useState)(false);
41200
+ const [clearCategoryDialog, setClearCategoryDialog] = (0, import_react79.useState)(null);
41201
+ const [clearing, setClearing] = (0, import_react79.useState)(false);
41202
+ const [snackbarMessage, setSnackbarMessage] = (0, import_react79.useState)("");
41203
+ const [showSnackbar, setShowSnackbar] = (0, import_react79.useState)(false);
41204
+ const [snackbarSeverity, setSnackbarSeverity] = (0, import_react79.useState)("success");
41343
41205
  const { syncEnabled, isAdvancedVectorFeaturesEnabled } = useConversationSyncStore((state) => ({
41344
41206
  syncEnabled: state.syncEnabled,
41345
41207
  isAdvancedVectorFeaturesEnabled: state.isAdvancedVectorFeaturesEnabled
@@ -41390,18 +41252,18 @@ var StorageTab = ({ currentTheme }) => {
41390
41252
  setLoading(false);
41391
41253
  }
41392
41254
  };
41393
- (0, import_react78.useEffect)(() => {
41255
+ (0, import_react79.useEffect)(() => {
41394
41256
  loadStorageData();
41395
41257
  }, []);
41396
- const totalUsed = (0, import_react78.useMemo)(() => {
41258
+ const totalUsed = (0, import_react79.useMemo)(() => {
41397
41259
  return storageCategories.reduce((sum, cat) => sum + cat.size, 0);
41398
41260
  }, [storageCategories]);
41399
- const usagePercentage = (0, import_react78.useMemo)(() => {
41261
+ const usagePercentage = (0, import_react79.useMemo)(() => {
41400
41262
  if (storageQuota.quota === 0) return 0;
41401
41263
  const percentage = Math.min(storageQuota.used / storageQuota.quota * 100, 100);
41402
41264
  return percentage > 0 && percentage < 0.1 ? 0.1 : percentage;
41403
41265
  }, [storageQuota]);
41404
- const clearableCategories = (0, import_react78.useMemo)(() => {
41266
+ const clearableCategories = (0, import_react79.useMemo)(() => {
41405
41267
  return storageCategories.filter((cat) => cat.canClear);
41406
41268
  }, [storageCategories]);
41407
41269
  const handleClearCategory = async (category) => {
@@ -41994,7 +41856,7 @@ var StorageTab = ({ currentTheme }) => {
41994
41856
  var StorageTab_default = StorageTab;
41995
41857
 
41996
41858
  // src/management/components/ProviderTab.tsx
41997
- var import_react79 = require("react");
41859
+ var import_react80 = require("react");
41998
41860
  var import_material55 = require("@mui/material");
41999
41861
  init_icons();
42000
41862
  init_aiProviderStore();
@@ -42007,7 +41869,7 @@ var import_jsx_runtime57 = require("react/jsx-runtime");
42007
41869
  var ProviderTab = () => {
42008
41870
  const { provider: currentProvider, config: currentProviderConfig } = useAIProviderStore();
42009
41871
  const { settings: packageSettings } = usePackageSettingsStore();
42010
- const getSuggestedModel = (0, import_react79.useCallback)((type) => {
41872
+ const getSuggestedModel = (0, import_react80.useCallback)((type) => {
42011
41873
  const configuredDefault = packageSettings?.defaultModel?.trim();
42012
41874
  if (configuredDefault) {
42013
41875
  return configuredDefault;
@@ -42023,7 +41885,7 @@ var ProviderTab = () => {
42023
41885
  return "";
42024
41886
  }
42025
41887
  }, [packageSettings?.defaultModel]);
42026
- const applyDefaultModel = (0, import_react79.useCallback)((config) => {
41888
+ const applyDefaultModel = (0, import_react80.useCallback)((config) => {
42027
41889
  const normalized = { ...config };
42028
41890
  const trimmed = typeof normalized.defaultModel === "string" ? normalized.defaultModel.trim() : void 0;
42029
41891
  const requiresModel = normalized.type === "openai" /* OPENAI */ || normalized.type === "xai" /* XAI */ || normalized.type === "bandit" /* BANDIT */;
@@ -42043,7 +41905,7 @@ var ProviderTab = () => {
42043
41905
  }
42044
41906
  return normalized;
42045
41907
  }, [getSuggestedModel]);
42046
- const sanitizeConfigForSave = (0, import_react79.useCallback)((config) => {
41908
+ const sanitizeConfigForSave = (0, import_react80.useCallback)((config) => {
42047
41909
  const sanitized = { ...config };
42048
41910
  if (typeof sanitized.defaultModel === "string") {
42049
41911
  const trimmed = sanitized.defaultModel.trim();
@@ -42055,22 +41917,22 @@ var ProviderTab = () => {
42055
41917
  }
42056
41918
  return sanitized;
42057
41919
  }, []);
42058
- const [providerConfig, setProviderConfig] = (0, import_react79.useState)({
41920
+ const [providerConfig, setProviderConfig] = (0, import_react80.useState)({
42059
41921
  type: "gateway",
42060
41922
  gatewayUrl: packageSettings?.gatewayApiUrl || "",
42061
41923
  provider: "bandit"
42062
41924
  });
42063
- const [saveResult, setSaveResult] = (0, import_react79.useState)({ state: "idle" });
42064
- const [testResult, setTestResult] = (0, import_react79.useState)({ state: "idle" });
42065
- const providerTypeRef = (0, import_react79.useRef)(null);
42066
- const formRef = (0, import_react79.useRef)(null);
41925
+ const [saveResult, setSaveResult] = (0, import_react80.useState)({ state: "idle" });
41926
+ const [testResult, setTestResult] = (0, import_react80.useState)({ state: "idle" });
41927
+ const providerTypeRef = (0, import_react80.useRef)(null);
41928
+ const formRef = (0, import_react80.useRef)(null);
42067
41929
  const revealProviderForm = () => {
42068
41930
  formRef.current?.scrollIntoView({ behavior: "smooth", block: "start" });
42069
41931
  providerTypeRef.current?.focus();
42070
41932
  };
42071
- const [snackbarMessage, setSnackbarMessage] = (0, import_react79.useState)("");
42072
- const [showSnackbar, setShowSnackbar] = (0, import_react79.useState)(false);
42073
- const [snackbarSeverity, setSnackbarSeverity] = (0, import_react79.useState)("success");
41933
+ const [snackbarMessage, setSnackbarMessage] = (0, import_react80.useState)("");
41934
+ const [showSnackbar, setShowSnackbar] = (0, import_react80.useState)(false);
41935
+ const [snackbarSeverity, setSnackbarSeverity] = (0, import_react80.useState)("success");
42074
41936
  const saveProviderConfigToDB = async (config) => {
42075
41937
  try {
42076
41938
  const { tokenFactory: _tokenFactory, ...persistableConfig } = config;
@@ -42111,7 +41973,7 @@ var ProviderTab = () => {
42111
41973
  }
42112
41974
  return null;
42113
41975
  };
42114
- const convertAnthropicConfig = (0, import_react79.useCallback)((config) => {
41976
+ const convertAnthropicConfig = (0, import_react80.useCallback)((config) => {
42115
41977
  if (!config) return null;
42116
41978
  if (config.type !== "anthropic" /* ANTHROPIC */) {
42117
41979
  return config;
@@ -42127,7 +41989,7 @@ var ProviderTab = () => {
42127
41989
  };
42128
41990
  return converted;
42129
41991
  }, [packageSettings?.gatewayApiUrl]);
42130
- (0, import_react79.useEffect)(() => {
41992
+ (0, import_react80.useEffect)(() => {
42131
41993
  const initializeProviderConfig = async () => {
42132
41994
  const savedConfig = await loadProviderConfigFromDB();
42133
41995
  if (savedConfig) {
@@ -42603,7 +42465,7 @@ var ProviderTab = () => {
42603
42465
  };
42604
42466
 
42605
42467
  // src/management/components/MCPToolsTabV2.tsx
42606
- var import_react81 = require("react");
42468
+ var import_react82 = require("react");
42607
42469
  var import_material57 = require("@mui/material");
42608
42470
 
42609
42471
  // src/services/mcp/mcpControllerService.ts
@@ -42680,7 +42542,7 @@ async function fetchMcpHealth() {
42680
42542
  }
42681
42543
 
42682
42544
  // src/management/components/McpServersSection.tsx
42683
- var import_react80 = require("react");
42545
+ var import_react81 = require("react");
42684
42546
  var import_material56 = require("@mui/material");
42685
42547
  init_icons();
42686
42548
  init_mcpServersService();
@@ -42751,18 +42613,18 @@ var CATALOG = [
42751
42613
  ];
42752
42614
  var errorDetail = (e) => e instanceof Error && e.message ? e.message : void 0;
42753
42615
  var McpServersSection = () => {
42754
- const [servers, setServers] = (0, import_react80.useState)([]);
42755
- const [loading, setLoading] = (0, import_react80.useState)(false);
42756
- const [error, setError] = (0, import_react80.useState)(null);
42757
- const [loadError, setLoadError] = (0, import_react80.useState)(null);
42758
- const [form, setForm] = (0, import_react80.useState)(emptyForm);
42759
- const [activeEntry, setActiveEntry] = (0, import_react80.useState)(null);
42760
- const [adding, setAdding] = (0, import_react80.useState)(false);
42761
- const [showForm, setShowForm] = (0, import_react80.useState)(false);
42762
- const [tools, setTools] = (0, import_react80.useState)({});
42616
+ const [servers, setServers] = (0, import_react81.useState)([]);
42617
+ const [loading, setLoading] = (0, import_react81.useState)(false);
42618
+ const [error, setError] = (0, import_react81.useState)(null);
42619
+ const [loadError, setLoadError] = (0, import_react81.useState)(null);
42620
+ const [form, setForm] = (0, import_react81.useState)(emptyForm);
42621
+ const [activeEntry, setActiveEntry] = (0, import_react81.useState)(null);
42622
+ const [adding, setAdding] = (0, import_react81.useState)(false);
42623
+ const [showForm, setShowForm] = (0, import_react81.useState)(false);
42624
+ const [tools, setTools] = (0, import_react81.useState)({});
42763
42625
  const reloadChatTools = useMCPToolsStore((s) => s.loadMcpServerTools);
42764
- const formRef = (0, import_react80.useRef)(null);
42765
- const refresh = (0, import_react80.useCallback)(async () => {
42626
+ const formRef = (0, import_react81.useRef)(null);
42627
+ const refresh = (0, import_react81.useCallback)(async () => {
42766
42628
  setLoading(true);
42767
42629
  setLoadError(null);
42768
42630
  try {
@@ -42776,7 +42638,7 @@ var McpServersSection = () => {
42776
42638
  setLoading(false);
42777
42639
  }
42778
42640
  }, []);
42779
- (0, import_react80.useEffect)(() => {
42641
+ (0, import_react81.useEffect)(() => {
42780
42642
  refresh();
42781
42643
  }, [refresh]);
42782
42644
  const connectedKeys = new Set(servers.map((s) => s.url.replace(/\/+$/, "")));
@@ -43149,10 +43011,10 @@ var import_jsx_runtime59 = require("react/jsx-runtime");
43149
43011
  var MCPToolsTabV2 = () => {
43150
43012
  const { settings } = usePackageSettingsStore();
43151
43013
  const { tools: localTools, loadTools, toggleTool, syncControllerTools, isLoaded, saveState, lastSavedAt, saveTools } = useMCPToolsStore();
43152
- const [loading, setLoading] = (0, import_react81.useState)(true);
43153
- const [error, setError] = (0, import_react81.useState)(null);
43154
- const [tools, setTools] = (0, import_react81.useState)([]);
43155
- const [health, setHealth] = (0, import_react81.useState)(null);
43014
+ const [loading, setLoading] = (0, import_react82.useState)(true);
43015
+ const [error, setError] = (0, import_react82.useState)(null);
43016
+ const [tools, setTools] = (0, import_react82.useState)([]);
43017
+ const [health, setHealth] = (0, import_react82.useState)(null);
43156
43018
  const gatewayConfigured = !!settings?.gatewayApiUrl;
43157
43019
  const refresh = async () => {
43158
43020
  setLoading(true);
@@ -43177,7 +43039,7 @@ var MCPToolsTabV2 = () => {
43177
43039
  setLoading(false);
43178
43040
  }
43179
43041
  };
43180
- (0, import_react81.useEffect)(() => {
43042
+ (0, import_react82.useEffect)(() => {
43181
43043
  if (isLoaded) {
43182
43044
  refresh();
43183
43045
  } else {
@@ -43186,7 +43048,7 @@ var MCPToolsTabV2 = () => {
43186
43048
  });
43187
43049
  }
43188
43050
  }, [isLoaded]);
43189
- const localEnabledMap = (0, import_react81.useMemo)(() => {
43051
+ const localEnabledMap = (0, import_react82.useMemo)(() => {
43190
43052
  const map23 = /* @__PURE__ */ new Map();
43191
43053
  const sortedTools = [...localTools].sort((a, b) => {
43192
43054
  if (a.isBuiltIn && !b.isBuiltIn) return -1;
@@ -43341,9 +43203,9 @@ init_useNotificationService();
43341
43203
  init_icons();
43342
43204
 
43343
43205
  // src/management/shell/ManagementShell.tsx
43344
- var import_react82 = __toESM(require("react"));
43206
+ var import_react83 = __toESM(require("react"));
43345
43207
  var import_material58 = require("@mui/material");
43346
- var import_styles31 = require("@mui/material/styles");
43208
+ var import_styles30 = require("@mui/material/styles");
43347
43209
  init_icons();
43348
43210
  var import_jsx_runtime60 = require("react/jsx-runtime");
43349
43211
  var RAIL_WIDTH = 248;
@@ -43366,17 +43228,17 @@ var railItemSx = (theme, selected) => ({
43366
43228
  py: 0.375,
43367
43229
  mb: 0.25,
43368
43230
  color: selected ? theme.palette.text.primary : theme.palette.text.secondary,
43369
- bgcolor: selected ? (0, import_styles31.alpha)(theme.palette.primary.main, theme.palette.mode === "dark" ? 0.16 : 0.1) : "transparent",
43231
+ bgcolor: selected ? (0, import_styles30.alpha)(theme.palette.primary.main, theme.palette.mode === "dark" ? 0.16 : 0.1) : "transparent",
43370
43232
  boxShadow: selected ? `inset 2px 0 0 ${theme.palette.primary.main}` : "none",
43371
43233
  transition: theme.transitions.create(["background-color", "color"], {
43372
43234
  duration: theme.transitions.duration.shortest
43373
43235
  }),
43374
43236
  "&:hover": {
43375
- bgcolor: selected ? (0, import_styles31.alpha)(theme.palette.primary.main, theme.palette.mode === "dark" ? 0.2 : 0.14) : theme.palette.bandit?.surface.interactiveHover ?? theme.palette.action.hover,
43237
+ bgcolor: selected ? (0, import_styles30.alpha)(theme.palette.primary.main, theme.palette.mode === "dark" ? 0.2 : 0.14) : theme.palette.bandit?.surface.interactiveHover ?? theme.palette.action.hover,
43376
43238
  color: theme.palette.text.primary
43377
43239
  },
43378
43240
  "&.Mui-selected, &.Mui-selected:hover": {
43379
- bgcolor: (0, import_styles31.alpha)(theme.palette.primary.main, theme.palette.mode === "dark" ? 0.18 : 0.12)
43241
+ bgcolor: (0, import_styles30.alpha)(theme.palette.primary.main, theme.palette.mode === "dark" ? 0.18 : 0.12)
43380
43242
  },
43381
43243
  "& .MuiListItemIcon-root": {
43382
43244
  minWidth: 28,
@@ -43546,7 +43408,7 @@ function Navigation({
43546
43408
  }
43547
43409
  function ManagementShell(props) {
43548
43410
  const { isMobile, children, sections, active: active2, onBackToChat, onBackHover, onOpenCommandPalette } = props;
43549
- const [sheetOpen, setSheetOpen] = import_react82.default.useState(false);
43411
+ const [sheetOpen, setSheetOpen] = import_react83.default.useState(false);
43550
43412
  const current = sections.find((s) => s.id === active2);
43551
43413
  if (isMobile) {
43552
43414
  return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_material58.Box, { sx: { display: "flex", flexDirection: "column", height: "100dvh", bgcolor: "background.default" }, children: [
@@ -43617,7 +43479,7 @@ function ManagementShell(props) {
43617
43479
  borderRadius: 2,
43618
43480
  mx: "auto",
43619
43481
  mt: 1,
43620
- bgcolor: (0, import_styles31.alpha)(theme.palette.text.primary, 0.2)
43482
+ bgcolor: (0, import_styles30.alpha)(theme.palette.text.primary, 0.2)
43621
43483
  })
43622
43484
  }
43623
43485
  ),
@@ -43656,7 +43518,7 @@ function ManagementShell(props) {
43656
43518
 
43657
43519
  // src/management/shell/ManagementOverview.tsx
43658
43520
  var import_material59 = require("@mui/material");
43659
- var import_styles32 = require("@mui/material/styles");
43521
+ var import_styles31 = require("@mui/material/styles");
43660
43522
  var import_jsx_runtime61 = require("react/jsx-runtime");
43661
43523
  var PROVIDER_LABELS = {
43662
43524
  ollama: "Ollama",
@@ -43692,7 +43554,7 @@ function Tile({
43692
43554
  transition: theme.transitions.create(["border-color", "background-color"], {
43693
43555
  duration: theme.transitions.duration.shortest
43694
43556
  }),
43695
- "&:hover": { borderColor: (0, import_styles32.alpha)(theme.palette.primary.main, 0.5) },
43557
+ "&:hover": { borderColor: (0, import_styles31.alpha)(theme.palette.primary.main, 0.5) },
43696
43558
  "&:focus-visible": { outline: `2px solid ${theme.palette.primary.main}`, outlineOffset: 2 }
43697
43559
  }),
43698
43560
  children: [
@@ -43809,7 +43671,7 @@ function ManagementOverview({
43809
43671
  }
43810
43672
 
43811
43673
  // src/management/shell/sections.ts
43812
- var import_react83 = require("react");
43674
+ var import_react84 = require("react");
43813
43675
  init_useFeatures();
43814
43676
  init_authenticationService();
43815
43677
  var MANAGEMENT_SECTIONS = [
@@ -43900,7 +43762,7 @@ function useManagementAccess() {
43900
43762
  const limited = hasLimitedAdminDashboard();
43901
43763
  const full = hasAdminDashboard();
43902
43764
  const advanced = hasAdvancedSearch();
43903
- return (0, import_react83.useMemo)(() => {
43765
+ return (0, import_react84.useMemo)(() => {
43904
43766
  const roles = (token ? authenticationService.parseJwtClaims(token)?.roles : void 0) ?? [];
43905
43767
  return {
43906
43768
  sections: resolveManagementSections({
@@ -43978,16 +43840,16 @@ var Management = ({
43978
43840
  hasTransparentLogo,
43979
43841
  setHasTransparentLogo
43980
43842
  } = useModelStore();
43981
- const [modalOpen, setModalOpen] = (0, import_react84.useState)(false);
43843
+ const [modalOpen, setModalOpen] = (0, import_react85.useState)(false);
43982
43844
  const banditHead5 = "https://cdn.burtson.ai/images/bandit-head.png";
43983
- const [fabLogo, setFabLogo] = (0, import_react84.useState)(banditHead5);
43984
- const [logoFile, setLogoFile] = (0, import_react84.useState)(null);
43985
- const [logoBase64, setLogoBase64] = (0, import_react84.useState)(null);
43986
- const [brandingText, setBrandingText] = (0, import_react84.useState)("");
43987
- const [headerMode, setHeaderMode] = (0, import_react84.useState)("logo");
43988
- const [theme, setTheme] = (0, import_react84.useState)("bandit-dark");
43989
- const [customAvatarBase64, setCustomAvatarBase64] = (0, import_react84.useState)(null);
43990
- const [presetAvatar, setPresetAvatar] = (0, import_react84.useState)(null);
43845
+ const [fabLogo, setFabLogo] = (0, import_react85.useState)(banditHead5);
43846
+ const [logoFile, setLogoFile] = (0, import_react85.useState)(null);
43847
+ const [logoBase64, setLogoBase64] = (0, import_react85.useState)(null);
43848
+ const [brandingText, setBrandingText] = (0, import_react85.useState)("");
43849
+ const [headerMode, setHeaderMode] = (0, import_react85.useState)("logo");
43850
+ const [theme, setTheme] = (0, import_react85.useState)("bandit-dark");
43851
+ const [customAvatarBase64, setCustomAvatarBase64] = (0, import_react85.useState)(null);
43852
+ const [presetAvatar, setPresetAvatar] = (0, import_react85.useState)(null);
43991
43853
  const showSnackbarMessage = (message, severity = "success") => {
43992
43854
  if (severity === "success") {
43993
43855
  notificationService2?.showSuccess(message);
@@ -43995,15 +43857,15 @@ var Management = ({
43995
43857
  notificationService2?.showError(message);
43996
43858
  }
43997
43859
  };
43998
- const [brandingLoaded, setBrandingLoaded] = (0, import_react84.useState)(false);
43999
- const [isLoadingBranding, setIsLoadingBranding] = (0, import_react84.useState)(false);
43860
+ const [brandingLoaded, setBrandingLoaded] = (0, import_react85.useState)(false);
43861
+ const [isLoadingBranding, setIsLoadingBranding] = (0, import_react85.useState)(false);
44000
43862
  const { initModels } = useModelStore();
44001
43863
  const { settings: packageSettings } = usePackageSettingsStore();
44002
43864
  const authToken = useAuthenticationStore((state) => state.token);
44003
43865
  const { preferences, updatePreference } = usePreferencesStore();
44004
43866
  const { provider: currentProvider, config: currentProviderConfig } = useAIProviderStore();
44005
- const [seedPacksEnabled, setSeedPacksEnabled] = (0, import_react84.useState)(false);
44006
- const [localSelectedModel, setLocalSelectedModel] = (0, import_react84.useState)({
43867
+ const [seedPacksEnabled, setSeedPacksEnabled] = (0, import_react85.useState)(false);
43868
+ const [localSelectedModel, setLocalSelectedModel] = (0, import_react85.useState)({
44007
43869
  name: "",
44008
43870
  tagline: "",
44009
43871
  systemPrompt: "",
@@ -44016,7 +43878,7 @@ var Management = ({
44016
43878
  loadDocuments,
44017
43879
  clearAllDocuments
44018
43880
  } = useKnowledgeStore2();
44019
- (0, import_react84.useEffect)(() => {
43881
+ (0, import_react85.useEffect)(() => {
44020
43882
  if (selectedModel) {
44021
43883
  const selected = availableModels.find((m) => m.name === selectedModel);
44022
43884
  if (selected) {
@@ -44040,7 +43902,7 @@ var Management = ({
44040
43902
  }
44041
43903
  }
44042
43904
  }, [selectedModel, availableModels]);
44043
- const loadBrandingConfig = (0, import_react84.useCallback)(async () => {
43905
+ const loadBrandingConfig = (0, import_react85.useCallback)(async () => {
44044
43906
  if (isLoadingBranding || brandingLoaded) {
44045
43907
  debugLogger.warn("Branding loading already in progress or completed, skipping");
44046
43908
  return;
@@ -44157,15 +44019,15 @@ var Management = ({
44157
44019
  setTagline,
44158
44020
  setTheme
44159
44021
  ]);
44160
- (0, import_react84.useEffect)(() => {
44022
+ (0, import_react85.useEffect)(() => {
44161
44023
  void loadBrandingConfig();
44162
44024
  }, [loadBrandingConfig]);
44163
44025
  const handleOpenModal = () => setModalOpen(true);
44164
44026
  const handleCloseModal = () => setModalOpen(false);
44165
- (0, import_react84.useEffect)(() => {
44027
+ (0, import_react85.useEffect)(() => {
44166
44028
  getOptimalFabLogo().then(setFabLogo);
44167
44029
  }, []);
44168
- (0, import_react84.useEffect)(() => {
44030
+ (0, import_react85.useEffect)(() => {
44169
44031
  if (logoBase64) {
44170
44032
  setFabLogo(logoBase64);
44171
44033
  } else {
@@ -44623,7 +44485,7 @@ var Management = ({
44623
44485
  reader.readAsText(file);
44624
44486
  }
44625
44487
  };
44626
- (0, import_react84.useEffect)(() => {
44488
+ (0, import_react85.useEffect)(() => {
44627
44489
  if (localSelectedModel.selectedModel && !availableModels.some((m) => m.name === localSelectedModel.selectedModel)) {
44628
44490
  setLocalSelectedModel((prev) => ({
44629
44491
  ...prev,
@@ -44631,10 +44493,10 @@ var Management = ({
44631
44493
  }));
44632
44494
  }
44633
44495
  }, [availableModels, localSelectedModel.selectedModel]);
44634
- (0, import_react84.useEffect)(() => {
44496
+ (0, import_react85.useEffect)(() => {
44635
44497
  loadDocuments();
44636
44498
  }, [loadDocuments]);
44637
- (0, import_react84.useEffect)(() => {
44499
+ (0, import_react85.useEffect)(() => {
44638
44500
  const gatewayApiUrl = packageSettings?.gatewayApiUrl;
44639
44501
  if (!gatewayApiUrl || gatewayApiUrl.toLowerCase().startsWith("playground://")) {
44640
44502
  setSeedPacksEnabled(false);
@@ -44677,20 +44539,20 @@ var Management = ({
44677
44539
  isActive = false;
44678
44540
  };
44679
44541
  }, [packageSettings?.gatewayApiUrl, authToken]);
44680
- const currentTheme = (0, import_react84.useMemo)(() => createBrandingTheme(theme, { density: "compact" }), [theme]);
44681
- (0, import_react84.useEffect)(() => {
44542
+ const currentTheme = (0, import_react85.useMemo)(() => createBrandingTheme(theme, { density: "compact" }), [theme]);
44543
+ (0, import_react85.useEffect)(() => {
44682
44544
  onThemeChange?.(currentTheme);
44683
44545
  }, [currentTheme, onThemeChange]);
44684
44546
  const access = useManagementAccess();
44685
- const sections = (0, import_react84.useMemo)(
44547
+ const sections = (0, import_react85.useMemo)(
44686
44548
  () => sectionOverride ? MANAGEMENT_SECTIONS.filter((s) => sectionOverride.includes(s.id)) : access.sections,
44687
44549
  [sectionOverride, access.sections]
44688
44550
  );
44689
44551
  const defaultSection = sections.some((s) => s.id === "overview") ? "overview" : sections.some((s) => s.id === "preferences") ? "preferences" : sections[0]?.id ?? "preferences";
44690
- const [ownSection, setOwnSection] = (0, import_react84.useState)(null);
44552
+ const [ownSection, setOwnSection] = (0, import_react85.useState)(null);
44691
44553
  const requested = controlledSection ?? ownSection ?? defaultSection;
44692
44554
  const active2 = sections.some((s) => s.id === requested) ? requested : defaultSection;
44693
- const selectSection = (0, import_react84.useCallback)(
44555
+ const selectSection = (0, import_react85.useCallback)(
44694
44556
  (id) => {
44695
44557
  setOwnSection(id);
44696
44558
  onSectionChange?.(id);
@@ -44698,9 +44560,9 @@ var Management = ({
44698
44560
  [onSectionChange]
44699
44561
  );
44700
44562
  const activeDef = sectionById(active2);
44701
- const [createPersonalityRequest, setCreatePersonalityRequest] = (0, import_react84.useState)(0);
44702
- const [pendingUpload, setPendingUpload] = (0, import_react84.useState)(0);
44703
- (0, import_react84.useEffect)(() => {
44563
+ const [createPersonalityRequest, setCreatePersonalityRequest] = (0, import_react85.useState)(0);
44564
+ const [pendingUpload, setPendingUpload] = (0, import_react85.useState)(0);
44565
+ (0, import_react85.useEffect)(() => {
44704
44566
  if (!request) return;
44705
44567
  if (request.action === "create-personality") {
44706
44568
  selectSection("personalities");
@@ -44710,10 +44572,10 @@ var Management = ({
44710
44572
  setPendingUpload(request.id);
44711
44573
  }
44712
44574
  }, [request?.id]);
44713
- (0, import_react84.useEffect)(() => {
44575
+ (0, import_react85.useEffect)(() => {
44714
44576
  if (createPersonalityRequest && active2 === "personalities" && brandingLoaded) setCreatePersonalityRequest(0);
44715
44577
  }, [createPersonalityRequest, active2, brandingLoaded]);
44716
- (0, import_react84.useEffect)(() => {
44578
+ (0, import_react85.useEffect)(() => {
44717
44579
  if (!pendingUpload || active2 !== "knowledge" || !brandingLoaded) return;
44718
44580
  const frame = requestAnimationFrame(() => {
44719
44581
  document.getElementById("file-upload")?.click();
@@ -44725,9 +44587,9 @@ var Management = ({
44725
44587
  const prefSavedAt = usePreferencesStore((state) => state.lastSavedAt);
44726
44588
  const retryPreferences = usePreferencesStore((state) => state.savePreferences);
44727
44589
  const brandingValue = JSON.stringify({ logoBase64, brandingText, headerMode, theme });
44728
- const [brandingBaseline, setBrandingBaseline] = (0, import_react84.useState)(null);
44729
- const [brandingSave, setBrandingSave] = (0, import_react84.useState)("idle");
44730
- (0, import_react84.useEffect)(() => {
44590
+ const [brandingBaseline, setBrandingBaseline] = (0, import_react85.useState)(null);
44591
+ const [brandingSave, setBrandingSave] = (0, import_react85.useState)("idle");
44592
+ (0, import_react85.useEffect)(() => {
44731
44593
  if (brandingLoaded && brandingBaseline === null) setBrandingBaseline(brandingValue);
44732
44594
  }, [brandingLoaded, brandingBaseline, brandingValue]);
44733
44595
  const brandingDirty = brandingBaseline !== null && brandingBaseline !== brandingValue;
@@ -44752,7 +44614,7 @@ var Management = ({
44752
44614
  (m) => m.name === (localSelectedModel.selectedModel || localSelectedModel.name)
44753
44615
  );
44754
44616
  const personalityDirty = savedPersonality ? norm(localSelectedModel.name) !== norm(savedPersonality.name) || norm(localSelectedModel.tagline) !== norm(savedPersonality.tagline) || norm(localSelectedModel.systemPrompt) !== norm(savedPersonality.systemPrompt) : Boolean(norm(localSelectedModel.name) || norm(localSelectedModel.tagline) || norm(localSelectedModel.systemPrompt));
44755
- const [personalitySaving, setPersonalitySaving] = (0, import_react84.useState)(false);
44617
+ const [personalitySaving, setPersonalitySaving] = (0, import_react85.useState)(false);
44756
44618
  const savePersonalityFromBar = async () => {
44757
44619
  setPersonalitySaving(true);
44758
44620
  try {
@@ -44964,7 +44826,7 @@ var Management = ({
44964
44826
  var management_default = Management;
44965
44827
 
44966
44828
  // src/management/components/InterestsEditor.tsx
44967
- var import_react85 = require("react");
44829
+ var import_react86 = require("react");
44968
44830
  var import_material61 = require("@mui/material");
44969
44831
  init_preferencesStore();
44970
44832
  init_getStableQuestionPrompt();
@@ -44977,7 +44839,7 @@ var InterestsEditor = ({
44977
44839
  const updatePreference = usePreferencesStore((s) => s.updatePreference);
44978
44840
  const loadPreferences = usePreferencesStore((s) => s.loadPreferences);
44979
44841
  const isLoaded = usePreferencesStore((s) => s.isLoaded);
44980
- (0, import_react85.useEffect)(() => {
44842
+ (0, import_react86.useEffect)(() => {
44981
44843
  if (!isLoaded) {
44982
44844
  void loadPreferences();
44983
44845
  }
@@ -45009,7 +44871,7 @@ var InterestsEditor = ({
45009
44871
  var InterestsEditor_default = InterestsEditor;
45010
44872
 
45011
44873
  // src/shared/custom-element.ts
45012
- var import_react86 = __toESM(require("react"));
44874
+ var import_react87 = __toESM(require("react"));
45013
44875
  var import_client = __toESM(require("react-dom/client"));
45014
44876
  function defineCustomElement(name, Component) {
45015
44877
  if (customElements.get(name)) return;
@@ -45037,7 +44899,7 @@ function defineCustomElement(name, Component) {
45037
44899
  if (!this.root) {
45038
44900
  this.root = import_client.default.createRoot(this.mountPoint);
45039
44901
  }
45040
- this.root.render(import_react86.default.createElement(Component, props));
44902
+ this.root.render(import_react87.default.createElement(Component, props));
45041
44903
  }
45042
44904
  }
45043
44905
  customElements.define(name, ReactElement);
@@ -45246,7 +45108,7 @@ var getFeatureMatrix = () => featureFlagService.generateFeatureMatrix();
45246
45108
  init_featureFlags();
45247
45109
 
45248
45110
  // src/hooks/useVoices.ts
45249
- var import_react87 = require("react");
45111
+ var import_react88 = require("react");
45250
45112
  init_voiceStore();
45251
45113
  init_packageSettingsStore();
45252
45114
  init_authenticationStore();
@@ -45266,7 +45128,7 @@ var useVoices = () => {
45266
45128
  } = useVoiceStore();
45267
45129
  const gatewayApiUrl = usePackageSettingsStore((state) => state.settings?.gatewayApiUrl);
45268
45130
  const { token } = useAuthenticationStore();
45269
- (0, import_react87.useEffect)(() => {
45131
+ (0, import_react88.useEffect)(() => {
45270
45132
  const isAuthenticated = authenticationService.isAuthenticated();
45271
45133
  if (gatewayApiUrl && token && isAuthenticated && !isServiceAvailable) {
45272
45134
  debugLogger.debug("Gateway API URL and JWT token available, loading voice models...");
@@ -45303,7 +45165,7 @@ init_streaming_tts();
45303
45165
  // src/modals/SubscriptionExpiredModal.tsx
45304
45166
  init_storeBuild();
45305
45167
  var import_material62 = require("@mui/material");
45306
- var import_react88 = require("@burtson-labs/icons/react");
45168
+ var import_react89 = require("@burtson-labs/icons/react");
45307
45169
  var import_jsx_runtime64 = require("react/jsx-runtime");
45308
45170
  var SubscriptionExpiredModal = ({
45309
45171
  open,
@@ -45342,7 +45204,7 @@ var SubscriptionExpiredModal = ({
45342
45204
  },
45343
45205
  children: [
45344
45206
  /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.DialogTitle, { sx: { textAlign: "center", pb: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_material62.Box, { sx: { display: "flex", alignItems: "center", justifyContent: "center", gap: 1, mb: 1 }, children: [
45345
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_react88.AlertTriangle, { size: 32, color: "warning" }),
45207
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_react89.AlertTriangle, { size: 32, color: "warning" }),
45346
45208
  /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.Typography, { variant: "h5", component: "span", fontWeight: "bold", children: "Subscription Expired" })
45347
45209
  ] }) }),
45348
45210
  /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.DialogContent, { sx: { pt: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_material62.Stack, { spacing: 2, children: [
@@ -45370,7 +45232,7 @@ var SubscriptionExpiredModal = ({
45370
45232
  {
45371
45233
  onClick: handleNavigateHome,
45372
45234
  variant: "outlined",
45373
- startIcon: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_react88.Home, {}),
45235
+ startIcon: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_react89.Home, {}),
45374
45236
  size: "large",
45375
45237
  sx: { minWidth: 140 },
45376
45238
  children: "Go Home"
@@ -45381,7 +45243,7 @@ var SubscriptionExpiredModal = ({
45381
45243
  {
45382
45244
  onClick: handleManageSubscription,
45383
45245
  variant: "contained",
45384
- startIcon: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_react88.CreditCard, {}),
45246
+ startIcon: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_react89.CreditCard, {}),
45385
45247
  size: "large",
45386
45248
  color: "primary",
45387
45249
  sx: { minWidth: 140 },
@@ -45395,7 +45257,7 @@ var SubscriptionExpiredModal = ({
45395
45257
  };
45396
45258
 
45397
45259
  // src/guards/SubscriptionExpiredGuard.tsx
45398
- var import_react89 = require("react");
45260
+ var import_react90 = require("react");
45399
45261
  init_useFeatures();
45400
45262
  var import_jsx_runtime65 = require("react/jsx-runtime");
45401
45263
  var SubscriptionExpiredGuard = ({
@@ -45406,9 +45268,9 @@ var SubscriptionExpiredGuard = ({
45406
45268
  allowContinue = false
45407
45269
  }) => {
45408
45270
  const { isExpiredTier, getFullEvaluation } = useFeatures();
45409
- const [showModal, setShowModal] = (0, import_react89.useState)(false);
45410
- const [userDismissed, setUserDismissed] = (0, import_react89.useState)(false);
45411
- (0, import_react89.useEffect)(() => {
45271
+ const [showModal, setShowModal] = (0, import_react90.useState)(false);
45272
+ const [userDismissed, setUserDismissed] = (0, import_react90.useState)(false);
45273
+ (0, import_react90.useEffect)(() => {
45412
45274
  if (isExpiredTier() && !userDismissed) {
45413
45275
  setShowModal(true);
45414
45276
  } else {
@@ -45563,26 +45425,11 @@ var showInfoNotification = (message, context) => {
45563
45425
  };
45564
45426
 
45565
45427
  // src/core/license-validator.ts
45566
- var getNodeEnvironment = () => {
45567
- const globalProcess = globalThis.process;
45568
- return globalProcess?.env?.NODE_ENV;
45569
- };
45570
45428
  function validateSystemIntegrity() {
45571
- const licenseMarkers = [
45572
- "BL-CORE-2025",
45573
- "BANDIT-ENGINE-LICENSED",
45574
- "BURTSON-VALIDATED-SYSTEM"
45575
- ];
45576
- if (getNodeEnvironment() !== "production") {
45577
- console.debug("System integrity check passed - Licensed to Burtson Labs");
45578
- }
45579
- return licenseMarkers.length > 0;
45429
+ return true;
45580
45430
  }
45581
45431
  var CORE_SYSTEM_TOKEN = "BL-SYSTEM-1751692562421";
45582
45432
  function initializeCoreSystem() {
45583
- if (!validateSystemIntegrity()) {
45584
- throw new Error("System integrity check failed - Contact legal@burtson.ai");
45585
- }
45586
45433
  return CORE_SYSTEM_TOKEN;
45587
45434
  }
45588
45435
 
@@ -45608,8 +45455,7 @@ function getSystemConstants() {
45608
45455
 
45609
45456
  // src/utils/critical-helpers.ts
45610
45457
  function validateEnvironment() {
45611
- const requiredKeys = ["BL-2025", "BURTSON-LABS", "LICENSED-SOFTWARE"];
45612
- return requiredKeys.every((key) => key.includes("BL") || key.includes("BURTSON"));
45458
+ return false;
45613
45459
  }
45614
45460
  function getCriticalConfig() {
45615
45461
  return {