@burtson-labs/bandit-engine 2.0.61 → 2.0.63

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.
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  management_default
3
- } from "../chunk-SKMJ43NN.mjs";
4
- import "../chunk-SRCCNBHF.mjs";
3
+ } from "../chunk-5NSOHUCR.mjs";
4
+ import "../chunk-E4Q7BHBQ.mjs";
5
5
  import "../chunk-VTC6AIWY.mjs";
6
6
  import "../chunk-6QTTNYF2.mjs";
7
- import "../chunk-PY7A3J5T.mjs";
8
- import "../chunk-5WQMMCZQ.mjs";
7
+ import "../chunk-UQ4VQSWS.mjs";
8
+ import "../chunk-NCMSNXB2.mjs";
9
9
  import "../chunk-EUBVBTB3.mjs";
10
10
  import "../chunk-IPMTNREZ.mjs";
11
11
  import "../chunk-H3BYFEIE.mjs";
@@ -11509,7 +11509,6 @@ var import_rehype_raw = __toESM(require("rehype-raw"));
11509
11509
  var import_rehype_sanitize2 = __toESM(require("rehype-sanitize"));
11510
11510
  init_debugLogger();
11511
11511
  var import_material8 = require("@mui/material");
11512
- init_modelStore();
11513
11512
 
11514
11513
  // src/modals/chat-modal/ai-response-action-bar.tsx
11515
11514
  var import_react13 = require("react");
@@ -12409,99 +12408,9 @@ var AiResponseActionsBar = ({ text }) => {
12409
12408
  };
12410
12409
  var ai_response_action_bar_default = AiResponseActionsBar;
12411
12410
 
12412
- // src/services/branding/brandingService.ts
12413
- init_indexedDBService();
12414
- init_debugLogger();
12415
- var BrandingService = class {
12416
- DB_NAME = "banditConfig";
12417
- DB_VERSION = 1;
12418
- STORE_NAME = "config";
12419
- STORE_CONFIGS = [{ name: "config", keyPath: "id" }];
12420
- async getBranding() {
12421
- try {
12422
- const data = await indexedDBService_default.get(
12423
- this.DB_NAME,
12424
- this.DB_VERSION,
12425
- this.STORE_NAME,
12426
- "main",
12427
- this.STORE_CONFIGS
12428
- );
12429
- if (data?.branding && (data.branding.logoBase64 || data.branding.hasTransparentLogo !== void 0 || data.branding.brandingText)) {
12430
- return {
12431
- logoBase64: data.branding.logoBase64,
12432
- hasTransparentLogo: data.branding.hasTransparentLogo,
12433
- brandingText: data.branding.brandingText
12434
- };
12435
- }
12436
- return null;
12437
- } catch (error) {
12438
- throw error;
12439
- }
12440
- }
12441
- async setBrandingFromConfig(config) {
12442
- try {
12443
- const existing = await indexedDBService_default.get(
12444
- this.DB_NAME,
12445
- this.DB_VERSION,
12446
- this.STORE_NAME,
12447
- "main",
12448
- this.STORE_CONFIGS
12449
- ) || { id: "main" };
12450
- if (existing.branding?.userSaved) {
12451
- debugLogger.debug("\u{1F6E1}\uFE0F BrandingService: User branding detected, blocking CDN config override");
12452
- return;
12453
- }
12454
- const hasUserBranding = existing.branding && (existing.branding.logoBase64 || existing.branding.brandingText || existing.branding.theme || existing.branding.hasTransparentLogo !== void 0);
12455
- if (hasUserBranding) {
12456
- debugLogger.debug("\u{1F6E1}\uFE0F BrandingService: Detected user branding data, blocking CDN config override");
12457
- return;
12458
- }
12459
- debugLogger.debug("\u{1F527} BrandingService: No user branding detected, applying CDN config");
12460
- const branding = config.branding || {};
12461
- const updated = {
12462
- ...existing,
12463
- branding: {
12464
- ...existing.branding,
12465
- ...branding
12466
- }
12467
- };
12468
- await indexedDBService_default.put(
12469
- this.DB_NAME,
12470
- this.DB_VERSION,
12471
- this.STORE_NAME,
12472
- updated,
12473
- this.STORE_CONFIGS
12474
- );
12475
- } catch (error) {
12476
- throw error;
12477
- }
12478
- }
12479
- };
12480
- var brandingService = new BrandingService();
12481
- var brandingService_default = brandingService;
12482
-
12483
12411
  // src/modals/chat-modal/ai-response-text-field.tsx
12484
12412
  var import_jsx_runtime9 = require("react/jsx-runtime");
12485
12413
  var brainIcon = "https://cdn.burtson.ai/images/brain-icon.png";
12486
- var avatarFilenames = {
12487
- "Bandit-Core": "core-avatar.png",
12488
- "Bandit-Muse": "muse-avatar.png",
12489
- "Bandit-Logic": "logic-avatar.png",
12490
- "Bandit-D1VA": "d1va-avatar.png",
12491
- "Bandit-Exec": "exec-avatar.png",
12492
- "default": "bandit-head.png"
12493
- };
12494
- var banditHead2 = `https://cdn.burtson.ai/images/bandit-head.png`;
12495
- var resolveAvatar = (selectedModel) => {
12496
- const model = useModelStore.getState().availableModels.find(
12497
- (m) => m.name === selectedModel
12498
- );
12499
- if (model?.avatarBase64) {
12500
- return model.avatarBase64;
12501
- }
12502
- const avatarFilename = avatarFilenames[selectedModel] || avatarFilenames["default"];
12503
- return `https://cdn.burtson.ai/avatars/${avatarFilename}`;
12504
- };
12505
12414
  var normalizeTables = (markdown2) => {
12506
12415
  const lines = markdown2.split("\n");
12507
12416
  const output = [];
@@ -12847,15 +12756,6 @@ var AIResponseTextField = ({
12847
12756
  const timeout3 = setTimeout(() => setShowMemoryUpdated(false), 3e3);
12848
12757
  return () => clearTimeout(timeout3);
12849
12758
  }, [memoryUpdated]);
12850
- const selectedModel = useModelStore((state) => state.selectedModel);
12851
- const [userAvatar, setUserAvatar] = (0, import_react14.useState)(banditHead2);
12852
- (0, import_react14.useEffect)(() => {
12853
- const fetchBranding = async () => {
12854
- const branding = await brandingService_default.getBranding();
12855
- setUserAvatar(branding?.logoBase64 || banditHead2);
12856
- };
12857
- fetchBranding();
12858
- }, []);
12859
12759
  const theme = (0, import_styles2.useTheme)();
12860
12760
  const chatResponse = theme.palette.chat?.response;
12861
12761
  const sanitizeMarkdown = (raw) => {
@@ -13224,283 +13124,108 @@ ${sourcesMarkdownList.join("\n")}`;
13224
13124
  alignSelf: "stretch",
13225
13125
  display: "flex",
13226
13126
  flexDirection: "column",
13227
- bgcolor: chatResponse.containerBackground,
13228
- color: chatResponse.aiText || "#fff",
13229
- p: isMobile ? 1 : 2,
13230
- borderRadius: "4px",
13231
- userSelect: "text",
13232
- border: "1px solid " + (chatResponse.aiBorder || "#ccc"),
13233
- boxShadow: "0 0 6px rgba(0,0,0,0.3)"
13127
+ color: chatResponse.aiText || theme.palette.text.primary,
13128
+ px: isMobile ? 0.5 : 2,
13129
+ py: 1,
13130
+ userSelect: "text"
13234
13131
  },
13235
13132
  children: [
13236
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
13237
- import_material8.Box,
13238
- {
13239
- sx: {
13240
- display: "flex",
13241
- flexDirection: "column",
13242
- alignItems: {
13243
- xs: "flex-start",
13244
- sm: "flex-end"
13133
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material8.Box, { sx: { display: "flex", justifyContent: "flex-end", mb: 2.5 }, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_material8.Box, { sx: { maxWidth: { xs: "100%", sm: "85%" }, minWidth: 0 }, children: [
13134
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
13135
+ import_material8.Box,
13136
+ {
13137
+ sx: {
13138
+ bgcolor: chatResponse.userBubble || (0, import_styles2.alpha)(theme.palette.common.white, 0.07),
13139
+ borderRadius: "18px",
13140
+ px: 2,
13141
+ py: 1.25,
13142
+ wordBreak: "break-word",
13143
+ whiteSpace: "pre-wrap",
13144
+ overflowWrap: "break-word"
13245
13145
  },
13246
- gap: 2,
13247
- mb: 2,
13248
- justifyContent: "flex-end"
13249
- },
13250
- children: [
13251
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
13252
- import_material8.Box,
13146
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
13147
+ import_material8.Typography,
13253
13148
  {
13254
13149
  sx: {
13255
- display: "flex",
13256
- flexDirection: "column",
13257
- alignItems: "center"
13150
+ color: theme.palette.text.primary,
13151
+ lineHeight: 1.5,
13152
+ wordBreak: "break-word",
13153
+ whiteSpace: "pre-wrap"
13258
13154
  },
13259
- children: [
13260
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
13261
- import_material8.Avatar,
13262
- {
13263
- alt: "You",
13264
- src: userAvatar,
13265
- sx: {
13266
- display: { xs: "none", sm: "flex" },
13267
- width: { sm: 72 },
13268
- height: { sm: 72 },
13269
- bgcolor: chatResponse.userAvatarBackground || (theme.palette.mode === "dark" ? "transparent" : "#eee"),
13270
- color: "#fff",
13271
- fontWeight: "bold",
13272
- fontSize: { sm: "1.1rem" },
13273
- border: "2px solid #a78bfa",
13274
- boxShadow: "0 0 8px rgba(167, 139, 250, 0.3)",
13275
- transform: "scaleX(1)"
13276
- }
13277
- }
13278
- ),
13279
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
13280
- import_material8.Typography,
13281
- {
13282
- variant: "caption",
13283
- sx: { color: chatResponse.modelLabel || "#888", mt: 1, fontStyle: "italic" },
13284
- children: "You said"
13285
- }
13286
- )
13287
- ]
13155
+ children: question
13288
13156
  }
13289
- ),
13290
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_material8.Box, { sx: { flex: 1 }, children: [
13291
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
13292
- import_material8.Box,
13293
- {
13294
- sx: {
13295
- display: "inline-block",
13296
- textAlign: "left",
13297
- bgcolor: chatResponse.userBubble || "#1f1f1f",
13298
- borderRadius: "4px",
13299
- px: isMobile ? 1 : 2,
13300
- py: 1.5,
13301
- width: isMobile ? "100%" : "fit-content",
13302
- maxWidth: "100%",
13303
- border: "1px solid " + (chatResponse.aiBorder || "#444"),
13304
- wordBreak: "break-word",
13305
- whiteSpace: "pre-wrap",
13306
- overflowWrap: "break-word",
13307
- mt: { xs: 0.5, sm: 0.25 }
13308
- },
13309
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
13310
- import_material8.Typography,
13311
- {
13312
- sx: {
13313
- color: chatResponse.userText || "#6C9AC5",
13314
- fontStyle: "italic",
13315
- wordBreak: "break-word",
13316
- whiteSpace: "pre-wrap"
13317
- },
13318
- children: question
13319
- }
13320
- )
13321
- }
13322
- ),
13323
- images && images.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material8.Box, { sx: { display: "flex", gap: 1, mt: 1, flexWrap: "wrap" }, children: images.map((img, i) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
13324
- import_material8.Avatar,
13325
- {
13326
- src: img,
13327
- variant: "rounded",
13328
- onClick: () => setOpenImage(img),
13329
- sx: {
13330
- width: 64,
13331
- height: 64,
13332
- borderRadius: 2,
13333
- cursor: "pointer",
13334
- "&:hover": { boxShadow: `0 0 0 2px ${theme.palette.primary.main}` }
13335
- }
13336
- },
13337
- i
13338
- )) })
13339
- ] })
13340
- ]
13341
- }
13342
- ),
13343
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material8.Box, { sx: { borderBottom: `1px solid ${theme.palette.divider}`, my: 2 } }),
13344
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
13345
- import_material8.Box,
13346
- {
13347
- sx: {
13348
- display: "flex",
13349
- flexDirection: "column",
13350
- alignItems: {
13351
- xs: "center",
13352
- sm: "flex-start"
13353
- },
13354
- gap: 2,
13355
- mb: 2
13157
+ )
13158
+ }
13159
+ ),
13160
+ images && images.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material8.Box, { sx: { display: "flex", gap: 1, mt: 1, flexWrap: "wrap", justifyContent: "flex-end" }, children: images.map((img, i) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
13161
+ import_material8.Avatar,
13162
+ {
13163
+ src: img,
13164
+ variant: "rounded",
13165
+ onClick: () => setOpenImage(img),
13166
+ sx: {
13167
+ width: 64,
13168
+ height: 64,
13169
+ borderRadius: 2,
13170
+ cursor: "pointer",
13171
+ "&:hover": { boxShadow: `0 0 0 2px ${theme.palette.primary.main}` }
13172
+ }
13356
13173
  },
13357
- children: [
13358
- typeof response === "string" && response.trim() !== "" && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
13359
- import_material8.Box,
13360
- {
13361
- sx: {
13362
- display: "flex",
13363
- flexDirection: "column",
13364
- alignItems: "center",
13365
- mr: 2,
13366
- position: "relative"
13367
- },
13368
- children: [
13369
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
13370
- import_material8.Avatar,
13371
- {
13372
- src: resolveAvatar(selectedModel),
13373
- alt: selectedModel,
13374
- sx: {
13375
- display: { xs: "none", sm: "flex" },
13376
- width: 72,
13377
- height: 72,
13378
- border: "1px solid #888",
13379
- boxShadow: "0 0 6px rgba(136, 136, 136, 0.4)",
13380
- filter: "brightness(1.6)"
13381
- }
13382
- }
13383
- ),
13384
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material8.Box, { sx: { display: { xs: "none", sm: "block" } }, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
13385
- import_material8.Typography,
13386
- {
13387
- variant: "caption",
13388
- sx: { color: chatResponse.modelLabel || "#888", mt: 1, fontStyle: "italic" },
13389
- children: [
13390
- selectedModel,
13391
- " says"
13392
- ]
13393
- }
13394
- ) })
13395
- ]
13396
- }
13397
- ),
13398
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
13399
- import_material8.Box,
13400
- {
13401
- sx: {
13402
- display: { xs: "flex", sm: "none" },
13403
- justifyContent: "right",
13404
- width: "100%",
13405
- mt: -1,
13406
- mb: 1
13407
- },
13408
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
13409
- import_material8.Typography,
13410
- {
13411
- variant: "caption",
13412
- sx: { fontStyle: "italic", color: chatResponse.modelLabel || "#888" },
13413
- children: [
13414
- selectedModel,
13415
- " says"
13416
- ]
13417
- }
13418
- )
13419
- }
13420
- ),
13421
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_material8.Box, { sx: { position: "relative", width: "100%" }, children: [
13422
- cancelled && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
13423
- import_material8.Box,
13424
- {
13425
- sx: {
13426
- position: "absolute",
13427
- top: -24,
13428
- left: 0,
13429
- display: "flex",
13430
- alignItems: "center",
13431
- gap: 1,
13432
- pl: 1,
13433
- zIndex: 1
13434
- },
13435
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material8.Typography, { variant: "caption", sx: { fontStyle: "italic", opacity: 0.85 }, children: "Cancelled by you" })
13436
- }
13437
- ),
13438
- showMemoryUpdated && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
13439
- import_material8.Box,
13440
- {
13441
- sx: {
13442
- position: "absolute",
13443
- top: -24,
13444
- right: 0,
13445
- display: "flex",
13446
- alignItems: "center",
13447
- gap: 1,
13448
- pr: 1,
13449
- animation: "fadeOut 0.3s ease-in 2.7s forwards",
13450
- zIndex: 1
13451
- },
13452
- children: [
13453
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
13454
- "img",
13455
- {
13456
- src: brainIcon,
13457
- alt: "Memory",
13458
- style: { width: 18, height: 18 }
13459
- }
13460
- ),
13461
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
13462
- import_material8.Typography,
13463
- {
13464
- variant: "caption",
13465
- sx: { color: chatResponse.memoryText || "#2e7d32", fontStyle: "italic" },
13466
- children: "Bandit added to memory"
13467
- }
13468
- )
13469
- ]
13470
- }
13471
- ),
13174
+ i
13175
+ )) })
13176
+ ] }) }),
13177
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_material8.Box, { sx: { position: "relative", width: "100%", maxWidth: { xs: "100%", sm: "768px" } }, children: [
13178
+ cancelled && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
13179
+ import_material8.Box,
13180
+ {
13181
+ sx: {
13182
+ position: "absolute",
13183
+ top: -22,
13184
+ left: 0,
13185
+ display: "flex",
13186
+ alignItems: "center",
13187
+ gap: 1,
13188
+ zIndex: 1
13189
+ },
13190
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material8.Typography, { variant: "caption", sx: { fontStyle: "italic", opacity: 0.85 }, children: "Cancelled by you" })
13191
+ }
13192
+ ),
13193
+ showMemoryUpdated && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
13194
+ import_material8.Box,
13195
+ {
13196
+ sx: {
13197
+ position: "absolute",
13198
+ top: -22,
13199
+ right: 0,
13200
+ display: "flex",
13201
+ alignItems: "center",
13202
+ gap: 1,
13203
+ animation: "fadeOut 0.3s ease-in 2.7s forwards",
13204
+ zIndex: 1
13205
+ },
13206
+ children: [
13207
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("img", { src: brainIcon, alt: "Memory", style: { width: 16, height: 16 } }),
13472
13208
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
13473
- import_material8.Box,
13209
+ import_material8.Typography,
13474
13210
  {
13475
- sx: {
13476
- bgcolor: chatResponse.aiBubble ?? "#2f2f2f",
13477
- borderRadius: "4px",
13478
- px: isMobile ? 1 : 1.5,
13479
- // Reduced padding on mobile
13480
- py: 1.25,
13481
- width: "100%",
13482
- maxWidth: isMobile ? "100%" : "768px",
13483
- // Full width on mobile
13484
- border: "1px solid " + (chatResponse.aiBorder || "#ccc"),
13485
- wordBreak: "break-word",
13486
- alignSelf: "flex-start",
13487
- mt: { xs: 0.5, sm: 0.25 }
13488
- },
13489
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material8.Box, { sx: { width: "100%", maxWidth: "100%" }, children: typeof response === "string" ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
13490
- import_react_markdown.default,
13491
- {
13492
- remarkPlugins: [import_remark_gfm.default],
13493
- rehypePlugins: [import_rehype_raw.default, [import_rehype_sanitize2.default, markdownSanitizeSchema]],
13494
- components,
13495
- children: enrichedMarkdown ?? sanitizeMarkdown(response)
13496
- }
13497
- ) : import_react14.default.isValidElement(response) ? response : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material8.Typography, { color: "error", children: "\u26A0\uFE0F Invalid AI response" }) })
13211
+ variant: "caption",
13212
+ sx: { color: chatResponse.memoryText || "#2e7d32", fontStyle: "italic" },
13213
+ children: "Bandit added to memory"
13498
13214
  }
13499
13215
  )
13500
- ] })
13501
- ]
13502
- }
13503
- ),
13216
+ ]
13217
+ }
13218
+ ),
13219
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material8.Box, { sx: { width: "100%", maxWidth: "100%" }, children: typeof response === "string" ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
13220
+ import_react_markdown.default,
13221
+ {
13222
+ remarkPlugins: [import_remark_gfm.default],
13223
+ rehypePlugins: [import_rehype_raw.default, [import_rehype_sanitize2.default, markdownSanitizeSchema]],
13224
+ components,
13225
+ children: enrichedMarkdown ?? sanitizeMarkdown(response)
13226
+ }
13227
+ ) : import_react14.default.isValidElement(response) ? response : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material8.Typography, { color: "error", children: "\u26A0\uFE0F Invalid AI response" }) })
13228
+ ] }),
13504
13229
  !!(responseText || typeof response === "string" && response) && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ai_response_action_bar_default, { text: responseText || response }),
13505
13230
  displaySourceFiles && displaySourceFiles.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material8.Box, { sx: { mt: 1.5, display: "flex", gap: 2, flexWrap: "wrap", justifyContent: "flex-start" }, children: displaySourceFiles.map((doc, idx) => {
13506
13231
  debugLogger.debug("Rendering DocumentCard in AI response", {
@@ -18169,6 +17894,79 @@ var useNotificationService = () => {
18169
17894
 
18170
17895
  // src/modals/chat-modal/chat-modal.tsx
18171
17896
  init_aiProviderStore();
17897
+
17898
+ // src/services/branding/brandingService.ts
17899
+ init_indexedDBService();
17900
+ init_debugLogger();
17901
+ var BrandingService = class {
17902
+ DB_NAME = "banditConfig";
17903
+ DB_VERSION = 1;
17904
+ STORE_NAME = "config";
17905
+ STORE_CONFIGS = [{ name: "config", keyPath: "id" }];
17906
+ async getBranding() {
17907
+ try {
17908
+ const data = await indexedDBService_default.get(
17909
+ this.DB_NAME,
17910
+ this.DB_VERSION,
17911
+ this.STORE_NAME,
17912
+ "main",
17913
+ this.STORE_CONFIGS
17914
+ );
17915
+ if (data?.branding && (data.branding.logoBase64 || data.branding.hasTransparentLogo !== void 0 || data.branding.brandingText)) {
17916
+ return {
17917
+ logoBase64: data.branding.logoBase64,
17918
+ hasTransparentLogo: data.branding.hasTransparentLogo,
17919
+ brandingText: data.branding.brandingText
17920
+ };
17921
+ }
17922
+ return null;
17923
+ } catch (error) {
17924
+ throw error;
17925
+ }
17926
+ }
17927
+ async setBrandingFromConfig(config) {
17928
+ try {
17929
+ const existing = await indexedDBService_default.get(
17930
+ this.DB_NAME,
17931
+ this.DB_VERSION,
17932
+ this.STORE_NAME,
17933
+ "main",
17934
+ this.STORE_CONFIGS
17935
+ ) || { id: "main" };
17936
+ if (existing.branding?.userSaved) {
17937
+ debugLogger.debug("\u{1F6E1}\uFE0F BrandingService: User branding detected, blocking CDN config override");
17938
+ return;
17939
+ }
17940
+ const hasUserBranding = existing.branding && (existing.branding.logoBase64 || existing.branding.brandingText || existing.branding.theme || existing.branding.hasTransparentLogo !== void 0);
17941
+ if (hasUserBranding) {
17942
+ debugLogger.debug("\u{1F6E1}\uFE0F BrandingService: Detected user branding data, blocking CDN config override");
17943
+ return;
17944
+ }
17945
+ debugLogger.debug("\u{1F527} BrandingService: No user branding detected, applying CDN config");
17946
+ const branding = config.branding || {};
17947
+ const updated = {
17948
+ ...existing,
17949
+ branding: {
17950
+ ...existing.branding,
17951
+ ...branding
17952
+ }
17953
+ };
17954
+ await indexedDBService_default.put(
17955
+ this.DB_NAME,
17956
+ this.DB_VERSION,
17957
+ this.STORE_NAME,
17958
+ updated,
17959
+ this.STORE_CONFIGS
17960
+ );
17961
+ } catch (error) {
17962
+ throw error;
17963
+ }
17964
+ }
17965
+ };
17966
+ var brandingService = new BrandingService();
17967
+ var brandingService_default = brandingService;
17968
+
17969
+ // src/modals/chat-modal/chat-modal.tsx
18172
17970
  init_debugLogger();
18173
17971
 
18174
17972
  // src/theme/banditTheme.ts
@@ -20540,7 +20338,7 @@ var FULL_SCREEN_THRESHOLD = 100;
20540
20338
  var MIN_WINDOWED_HEIGHT = 400;
20541
20339
  var MAX_WINDOWED_HEIGHT = 600;
20542
20340
  var CDN_BASE = "https://cdn.burtson.ai/";
20543
- var banditHead3 = `${CDN_BASE}/images/bandit-head.png`;
20341
+ var banditHead2 = `${CDN_BASE}/images/bandit-head.png`;
20544
20342
  var modelAvatars = {
20545
20343
  "Bandit-Core": `${CDN_BASE}/avatars/core-avatar.png`,
20546
20344
  "Bandit-Muse": `${CDN_BASE}/avatars/muse-avatar.png`,
@@ -20630,7 +20428,7 @@ var ChatModal = ({
20630
20428
  const provider = useAIProviderStore((state) => state.provider);
20631
20429
  const notificationService2 = useNotificationService();
20632
20430
  const currentModel = availableModels.find((m) => m.name === selectedModel);
20633
- const currentAvatar = currentModel?.avatarBase64 || modelAvatars[selectedModel] || banditHead3;
20431
+ const currentAvatar = currentModel?.avatarBase64 || modelAvatars[selectedModel] || banditHead2;
20634
20432
  const removeImage = (index) => {
20635
20433
  setPastedImages((prev) => prev.filter((_, i) => i !== index));
20636
20434
  };
@@ -20950,7 +20748,7 @@ var ChatModal = ({
20950
20748
  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
20951
20749
  import_material17.Avatar,
20952
20750
  {
20953
- src: model.avatarBase64 || modelAvatars[model.name] || banditHead3,
20751
+ src: model.avatarBase64 || modelAvatars[model.name] || banditHead2,
20954
20752
  alt: model.name,
20955
20753
  sx: {
20956
20754
  width: 28,