@flamingo-stack/openframe-frontend-core 0.0.609 → 0.0.610-2115.5924.1

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 (153) hide show
  1. package/dist/chat-protocol/card-marker.d.ts +31 -0
  2. package/dist/chat-protocol/card-marker.d.ts.map +1 -0
  3. package/dist/chat-protocol/events.d.ts +21 -2
  4. package/dist/chat-protocol/events.d.ts.map +1 -1
  5. package/dist/chat-protocol/index.cjs +211 -9
  6. package/dist/chat-protocol/index.cjs.map +1 -1
  7. package/dist/chat-protocol/index.js +211 -9
  8. package/dist/chat-protocol/index.js.map +1 -1
  9. package/dist/chat-protocol/nats-decoder.d.ts.map +1 -1
  10. package/dist/chat-protocol/source-metadata.d.ts +56 -0
  11. package/dist/chat-protocol/source-metadata.d.ts.map +1 -0
  12. package/dist/{chunk-LA2W5L6K.js → chunk-25YIHMZ6.js} +2 -2
  13. package/dist/{chunk-6MLRFM3T.js → chunk-2QBXG74C.js} +5 -5
  14. package/dist/{chunk-3N4FXBVJ.cjs → chunk-2YMDDD5V.cjs} +3 -3
  15. package/dist/{chunk-3N4FXBVJ.cjs.map → chunk-2YMDDD5V.cjs.map} +1 -1
  16. package/dist/{chunk-JOCVQZGT.js → chunk-37CAZTLP.js} +5 -5
  17. package/dist/{chunk-D3DTC7SZ.cjs → chunk-C4KQ2XPK.cjs} +15 -15
  18. package/dist/{chunk-D3DTC7SZ.cjs.map → chunk-C4KQ2XPK.cjs.map} +1 -1
  19. package/dist/{chunk-CZTOSG7Q.cjs → chunk-EANAFFAD.cjs} +22 -22
  20. package/dist/{chunk-CZTOSG7Q.cjs.map → chunk-EANAFFAD.cjs.map} +1 -1
  21. package/dist/{chunk-BSMPCPOZ.js → chunk-F2C2U7CP.js} +590 -299
  22. package/dist/chunk-F2C2U7CP.js.map +1 -0
  23. package/dist/{chunk-O2M4T34Q.cjs → chunk-FASOANK7.cjs} +4 -4
  24. package/dist/{chunk-O2M4T34Q.cjs.map → chunk-FASOANK7.cjs.map} +1 -1
  25. package/dist/{chunk-JKM5FH63.js → chunk-FS3CTGIR.js} +3 -3
  26. package/dist/{chunk-45XXK2VU.cjs → chunk-GFAHCXIL.cjs} +10 -10
  27. package/dist/{chunk-45XXK2VU.cjs.map → chunk-GFAHCXIL.cjs.map} +1 -1
  28. package/dist/{chunk-SEW25Y2W.cjs → chunk-GNLV326I.cjs} +10 -10
  29. package/dist/{chunk-SEW25Y2W.cjs.map → chunk-GNLV326I.cjs.map} +1 -1
  30. package/dist/{chunk-DKNXAJMP.cjs → chunk-HKJ3WKGW.cjs} +159 -159
  31. package/dist/{chunk-DKNXAJMP.cjs.map → chunk-HKJ3WKGW.cjs.map} +1 -1
  32. package/dist/{chunk-HGVW7OHI.js → chunk-HQSCJYCF.js} +2 -2
  33. package/dist/{chunk-QX4ANESW.js → chunk-HZS4TV34.js} +6 -6
  34. package/dist/{chunk-B3UXNGVM.js → chunk-IBMHEOBV.js} +3 -3
  35. package/dist/{chunk-BUXGWBTF.js → chunk-MGXSJI23.js} +2 -2
  36. package/dist/{chunk-B7LYKBCD.js → chunk-O6PO5BHE.js} +5 -5
  37. package/dist/{chunk-C7CTEUU7.js → chunk-OIKZDXNW.js} +2 -2
  38. package/dist/{chunk-TJ3GFULR.js → chunk-OJZW3GE2.js} +3 -3
  39. package/dist/{chunk-L2JWC5VS.cjs → chunk-OVVKVIMH.cjs} +43 -43
  40. package/dist/{chunk-L2JWC5VS.cjs.map → chunk-OVVKVIMH.cjs.map} +1 -1
  41. package/dist/{chunk-VCYRJY7J.js → chunk-Q2CNCBMK.js} +4 -4
  42. package/dist/{chunk-NJUSDREV.cjs → chunk-Q3APHZK5.cjs} +22 -22
  43. package/dist/{chunk-NJUSDREV.cjs.map → chunk-Q3APHZK5.cjs.map} +1 -1
  44. package/dist/{chunk-TCEALWE3.cjs → chunk-QE2Z6WME.cjs} +33 -33
  45. package/dist/{chunk-TCEALWE3.cjs.map → chunk-QE2Z6WME.cjs.map} +1 -1
  46. package/dist/{chunk-OTYV6SDN.js → chunk-R2UDEMKK.js} +3 -3
  47. package/dist/{chunk-JR7I2AGL.js → chunk-ROOIHDLS.js} +3 -3
  48. package/dist/{chunk-3XNMDLGB.cjs → chunk-THCB7NHV.cjs} +9 -9
  49. package/dist/{chunk-3XNMDLGB.cjs.map → chunk-THCB7NHV.cjs.map} +1 -1
  50. package/dist/{chunk-GMOBT5NP.cjs → chunk-THCSSPXU.cjs} +70 -70
  51. package/dist/{chunk-GMOBT5NP.cjs.map → chunk-THCSSPXU.cjs.map} +1 -1
  52. package/dist/{chunk-FYG7QNAO.cjs → chunk-UFFVMZDL.cjs} +5 -5
  53. package/dist/{chunk-FYG7QNAO.cjs.map → chunk-UFFVMZDL.cjs.map} +1 -1
  54. package/dist/{chunk-MVBRMQGU.js → chunk-V6TINNLD.js} +2 -2
  55. package/dist/{chunk-ZRLFBLME.cjs → chunk-WJQOYSR3.cjs} +3 -3
  56. package/dist/{chunk-ZRLFBLME.cjs.map → chunk-WJQOYSR3.cjs.map} +1 -1
  57. package/dist/{chunk-XNDTYTVT.cjs → chunk-YXTAV2E3.cjs} +974 -683
  58. package/dist/chunk-YXTAV2E3.cjs.map +1 -0
  59. package/dist/{chunk-RZM6FPOT.cjs → chunk-ZDLCWNM6.cjs} +25 -25
  60. package/dist/{chunk-RZM6FPOT.cjs.map → chunk-ZDLCWNM6.cjs.map} +1 -1
  61. package/dist/components/case-studies/index.cjs +9 -9
  62. package/dist/components/case-studies/index.js +3 -3
  63. package/dist/components/chat/chat-message-enhanced.d.ts.map +1 -1
  64. package/dist/components/chat/chat-message-list.d.ts.map +1 -1
  65. package/dist/components/chat/embeddable-chat.d.ts.map +1 -1
  66. package/dist/components/chat/hooks/use-sse-chat-adapter.d.ts +5 -28
  67. package/dist/components/chat/hooks/use-sse-chat-adapter.d.ts.map +1 -1
  68. package/dist/components/chat/index.cjs +2 -2
  69. package/dist/components/chat/index.js +1 -1
  70. package/dist/components/chat/remark-card-links.d.ts +5 -4
  71. package/dist/components/chat/remark-card-links.d.ts.map +1 -1
  72. package/dist/components/chat/stream/chat-stream-reducer.d.ts.map +1 -1
  73. package/dist/components/chat/tool-execution-display.d.ts.map +1 -1
  74. package/dist/components/chat/types/component.types.d.ts +27 -0
  75. package/dist/components/chat/types/component.types.d.ts.map +1 -1
  76. package/dist/components/chat/types/message.types.d.ts +81 -1
  77. package/dist/components/chat/types/message.types.d.ts.map +1 -1
  78. package/dist/components/chat/types/unified-chat-state.types.d.ts +12 -3
  79. package/dist/components/chat/types/unified-chat-state.types.d.ts.map +1 -1
  80. package/dist/components/chat/utils/cited-sources.d.ts +24 -0
  81. package/dist/components/chat/utils/cited-sources.d.ts.map +1 -0
  82. package/dist/components/chat/utils/host-message.d.ts +41 -0
  83. package/dist/components/chat/utils/host-message.d.ts.map +1 -0
  84. package/dist/components/chat/utils/process-historical-messages.d.ts.map +1 -1
  85. package/dist/components/contact/index.cjs +4 -4
  86. package/dist/components/contact/index.js +3 -3
  87. package/dist/components/docs/index.cjs +7 -7
  88. package/dist/components/docs/index.js +6 -6
  89. package/dist/components/embeds/index.cjs +4 -4
  90. package/dist/components/embeds/index.js +3 -3
  91. package/dist/components/faq/index.cjs +4 -4
  92. package/dist/components/faq/index.js +3 -3
  93. package/dist/components/features/index.cjs +3 -3
  94. package/dist/components/features/index.js +2 -2
  95. package/dist/components/help-center-pages/index.cjs +23 -23
  96. package/dist/components/help-center-pages/index.js +14 -14
  97. package/dist/components/index.cjs +38 -38
  98. package/dist/components/index.js +13 -13
  99. package/dist/components/meeting-scheduler/index.cjs +24 -24
  100. package/dist/components/meeting-scheduler/index.js +2 -2
  101. package/dist/components/navigation/index.cjs +6 -6
  102. package/dist/components/navigation/index.js +5 -5
  103. package/dist/components/onboarding-guides/index.cjs +6 -6
  104. package/dist/components/onboarding-guides/index.js +5 -5
  105. package/dist/components/tickets/index.cjs +7 -7
  106. package/dist/components/tickets/index.js +6 -6
  107. package/dist/components/ui/index.cjs +3 -3
  108. package/dist/components/ui/index.js +2 -2
  109. package/dist/index.cjs +7 -7
  110. package/dist/index.js +6 -6
  111. package/dist/utils/index.cjs.map +1 -1
  112. package/dist/utils/index.js.map +1 -1
  113. package/package.json +1 -1
  114. package/src/chat-protocol/__tests__/card-marker.test.ts +63 -0
  115. package/src/chat-protocol/__tests__/source-metadata.test.ts +243 -0
  116. package/src/chat-protocol/card-marker.ts +40 -0
  117. package/src/chat-protocol/events.ts +22 -1
  118. package/src/chat-protocol/nats-decoder.ts +12 -0
  119. package/src/chat-protocol/source-metadata.ts +336 -0
  120. package/src/components/chat/__tests__/tool-execution-display.test.tsx +70 -0
  121. package/src/components/chat/chat-message-enhanced.tsx +37 -12
  122. package/src/components/chat/chat-message-list.tsx +14 -1
  123. package/src/components/chat/embeddable-chat.tsx +47 -87
  124. package/src/components/chat/hooks/use-sse-chat-adapter.ts +5 -28
  125. package/src/components/chat/remark-card-links.ts +14 -12
  126. package/src/components/chat/stream/chat-stream-reducer.ts +48 -3
  127. package/src/components/chat/tool-execution-display.tsx +18 -4
  128. package/src/components/chat/types/component.types.ts +27 -0
  129. package/src/components/chat/types/message.types.ts +83 -0
  130. package/src/components/chat/types/unified-chat-state.types.ts +12 -3
  131. package/src/components/chat/utils/__tests__/cited-sources.test.ts +80 -0
  132. package/src/components/chat/utils/__tests__/host-message.test.ts +92 -0
  133. package/src/components/chat/utils/__tests__/process-historical-messages-sources.test.ts +138 -0
  134. package/src/components/chat/utils/cited-sources.ts +61 -0
  135. package/src/components/chat/utils/host-message.ts +87 -0
  136. package/src/components/chat/utils/process-historical-messages.ts +25 -0
  137. package/dist/chunk-BSMPCPOZ.js.map +0 -1
  138. package/dist/chunk-XNDTYTVT.cjs.map +0 -1
  139. /package/dist/{chunk-LA2W5L6K.js.map → chunk-25YIHMZ6.js.map} +0 -0
  140. /package/dist/{chunk-6MLRFM3T.js.map → chunk-2QBXG74C.js.map} +0 -0
  141. /package/dist/{chunk-JOCVQZGT.js.map → chunk-37CAZTLP.js.map} +0 -0
  142. /package/dist/{chunk-JKM5FH63.js.map → chunk-FS3CTGIR.js.map} +0 -0
  143. /package/dist/{chunk-HGVW7OHI.js.map → chunk-HQSCJYCF.js.map} +0 -0
  144. /package/dist/{chunk-QX4ANESW.js.map → chunk-HZS4TV34.js.map} +0 -0
  145. /package/dist/{chunk-B3UXNGVM.js.map → chunk-IBMHEOBV.js.map} +0 -0
  146. /package/dist/{chunk-BUXGWBTF.js.map → chunk-MGXSJI23.js.map} +0 -0
  147. /package/dist/{chunk-B7LYKBCD.js.map → chunk-O6PO5BHE.js.map} +0 -0
  148. /package/dist/{chunk-C7CTEUU7.js.map → chunk-OIKZDXNW.js.map} +0 -0
  149. /package/dist/{chunk-TJ3GFULR.js.map → chunk-OJZW3GE2.js.map} +0 -0
  150. /package/dist/{chunk-VCYRJY7J.js.map → chunk-Q2CNCBMK.js.map} +0 -0
  151. /package/dist/{chunk-OTYV6SDN.js.map → chunk-R2UDEMKK.js.map} +0 -0
  152. /package/dist/{chunk-JR7I2AGL.js.map → chunk-ROOIHDLS.js.map} +0 -0
  153. /package/dist/{chunk-MVBRMQGU.js.map → chunk-V6TINNLD.js.map} +0 -0
@@ -247,16 +247,16 @@ var _classvarianceauthority = require('class-variance-authority');
247
247
  var _react3 = require('@floating-ui/react');
248
248
 
249
249
  var _jsxruntime = require('react/jsx-runtime');
250
- function parseColoredText(text) {
251
- if (typeof text !== "string") return text;
250
+ function parseColoredText(text2) {
251
+ if (typeof text2 !== "string") return text2;
252
252
  const parts = [];
253
253
  let lastIndex = 0;
254
254
  const colorRegex = /\[([A-Z]+)\](.*?)\[\/\1\]/g;
255
255
  let match;
256
256
  let keyIndex = 0;
257
- while ((match = colorRegex.exec(text)) !== null) {
257
+ while ((match = colorRegex.exec(text2)) !== null) {
258
258
  if (match.index > lastIndex) {
259
- const beforeText = text.slice(lastIndex, match.index);
259
+ const beforeText = text2.slice(lastIndex, match.index);
260
260
  parts.push(/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: beforeText }, `text-${keyIndex++}`));
261
261
  }
262
262
  const color = match[1].toLowerCase();
@@ -267,11 +267,11 @@ function parseColoredText(text) {
267
267
  );
268
268
  lastIndex = match.index + match[0].length;
269
269
  }
270
- if (lastIndex < text.length) {
271
- const remainingText = text.slice(lastIndex);
270
+ if (lastIndex < text2.length) {
271
+ const remainingText = text2.slice(lastIndex);
272
272
  parts.push(/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: remainingText }, `text-${keyIndex++}`));
273
273
  }
274
- return parts.length > 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: parts }) : text;
274
+ return parts.length > 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: parts }) : text2;
275
275
  }
276
276
  function FloatingTooltip({
277
277
  content,
@@ -1163,6 +1163,15 @@ var MESSAGE_TYPE = {
1163
1163
  TEXT: "TEXT",
1164
1164
  THINKING: "THINKING",
1165
1165
  ASK: "ASK",
1166
+ /** Per-answer source metadata (documents, videos, entity cards).
1167
+ *
1168
+ * TWO names for ONE payload, on purpose. `SOURCES` is the contract the
1169
+ * backend is moving to; `GUIDE` is the envelope it ships in today, reused
1170
+ * from Guide Mode v2 so a released frontend keeps working during the v2→v3
1171
+ * rollout. Both decode through the same path, so dropping `GUIDE` later is a
1172
+ * deletion here and nothing else. */
1173
+ GUIDE: "GUIDE",
1174
+ SOURCES: "SOURCES",
1166
1175
  EXECUTING_TOOL: "EXECUTING_TOOL",
1167
1176
  EXECUTED_TOOL: "EXECUTED_TOOL",
1168
1177
  APPROVAL_REQUEST: "APPROVAL_REQUEST",
@@ -1301,16 +1310,16 @@ function buildHeadingIdMap(content, sectionIds) {
1301
1310
  let sectionOrdinal = 0;
1302
1311
  let headingOrdinal = 0;
1303
1312
  for (const { line, level, text: rawText } of _chunkYXWGSDK4cjs.scanHeadings.call(void 0, content)) {
1304
- const text = stripInlineMarkdown(rawText).trim();
1313
+ const text2 = stripInlineMarkdown(rawText).trim();
1305
1314
  headingOrdinal++;
1306
1315
  if (level <= EXTRACTOR_MAX_LEVEL) sectionOrdinal++;
1307
1316
  let assigned;
1308
1317
  if (sectionIds && level <= EXTRACTOR_MAX_LEVEL) {
1309
1318
  for (const variation of [
1310
- text,
1311
- text.toLowerCase(),
1312
- _chunkYXWGSDK4cjs.stripHeadingEmojis.call(void 0, text),
1313
- _chunkYXWGSDK4cjs.stripHeadingEmojis.call(void 0, text).toLowerCase()
1319
+ text2,
1320
+ text2.toLowerCase(),
1321
+ _chunkYXWGSDK4cjs.stripHeadingEmojis.call(void 0, text2),
1322
+ _chunkYXWGSDK4cjs.stripHeadingEmojis.call(void 0, text2).toLowerCase()
1314
1323
  ]) {
1315
1324
  const id = sectionIdMap.get(variation);
1316
1325
  if (id) {
@@ -1320,7 +1329,7 @@ function buildHeadingIdMap(content, sectionIds) {
1320
1329
  }
1321
1330
  }
1322
1331
  if (assigned === void 0) {
1323
- const baseId = _chunkYXWGSDK4cjs.slugifyHeadingText.call(void 0, text);
1332
+ const baseId = _chunkYXWGSDK4cjs.slugifyHeadingText.call(void 0, text2);
1324
1333
  assigned = dedupe(
1325
1334
  baseId || (level <= EXTRACTOR_MAX_LEVEL ? `section-${sectionOrdinal}` : `heading-${headingOrdinal}`)
1326
1335
  );
@@ -2311,8 +2320,8 @@ function findInlineCodeRanges(source) {
2311
2320
  }
2312
2321
  return ranges;
2313
2322
  }
2314
- function foldAsciiCase(text) {
2315
- return text.replace(/[A-Z]/g, (c) => String.fromCharCode(c.charCodeAt(0) + 32));
2323
+ function foldAsciiCase(text2) {
2324
+ return text2.replace(/[A-Z]/g, (c) => String.fromCharCode(c.charCodeAt(0) + 32));
2316
2325
  }
2317
2326
  function blankRanges(masked, ranges) {
2318
2327
  if (ranges.length === 0) return masked;
@@ -2554,13 +2563,13 @@ function footnoteLabelEnd(c, open) {
2554
2563
  }
2555
2564
  function blankUnreferencedFootnotes(masked, lines, folded) {
2556
2565
  if (masked.indexOf("[^") === -1) return masked;
2557
- const text = (line) => stripCr(masked.slice(line.contentStart, line.contentStart + line.content.length));
2566
+ const text2 = (line) => stripCr(masked.slice(line.contentStart, line.contentStart + line.content.length));
2558
2567
  const refMask = footnoteReferenceMask(masked, folded);
2559
2568
  const refText = (line) => stripCr(refMask.slice(line.contentStart, line.contentStart + line.content.length));
2560
2569
  const referenced = /* @__PURE__ */ new Set();
2561
2570
  const defAt = [];
2562
2571
  for (const line of lines) {
2563
- const c = text(line);
2572
+ const c = text2(line);
2564
2573
  let isDef = null;
2565
2574
  if (c.indexOf("[^") !== -1) {
2566
2575
  const open = FOOTNOTE_DEF_OPEN_RE.exec(c);
@@ -2589,13 +2598,13 @@ function blankUnreferencedFootnotes(masked, lines, folded) {
2589
2598
  for (let i = 0; i < lines.length; i++) {
2590
2599
  const at = defAt[i];
2591
2600
  if (at === null) continue;
2592
- const head = text(lines[i]);
2601
+ const head = text2(lines[i]);
2593
2602
  const end = footnoteLabelEnd(head, at);
2594
2603
  if (referenced.has(normalizeFootnoteLabel(head.slice(at + 2, end)))) continue;
2595
2604
  let j = i;
2596
2605
  let sawBlank = false;
2597
2606
  for (let k = i + 1; k < lines.length; k++) {
2598
- const c = text(lines[k]);
2607
+ const c = text2(lines[k]);
2599
2608
  if (_chunkYXWGSDK4cjs.isBlankLine.call(void 0, c)) {
2600
2609
  sawBlank = true;
2601
2610
  continue;
@@ -2778,9 +2787,9 @@ function spliceWindows(masked, edits) {
2778
2787
  if (edits.length === 0) return masked;
2779
2788
  const parts = [];
2780
2789
  let cursor = 0;
2781
- for (const [from, to, text] of edits) {
2790
+ for (const [from, to, text2] of edits) {
2782
2791
  if (from > cursor) parts.push(masked.slice(cursor, from));
2783
- parts.push(text);
2792
+ parts.push(text2);
2784
2793
  cursor = to;
2785
2794
  }
2786
2795
  parts.push(masked.slice(cursor));
@@ -2884,8 +2893,8 @@ function blankListItemCode(masked, lines, depth = 0) {
2884
2893
  flush();
2885
2894
  return spliceWindows(masked, edits);
2886
2895
  }
2887
- function buildCloserHaystack(text) {
2888
- const folded = foldAsciiCase(text);
2896
+ function buildCloserHaystack(text2) {
2897
+ const folded = foldAsciiCase(text2);
2889
2898
  const lines = toMaskLines(folded);
2890
2899
  let masked = blankRanges(folded, findInlineCodeRanges(folded));
2891
2900
  masked = blankFencedRegions(masked, lines);
@@ -3072,8 +3081,8 @@ function htmlBlockStartKind(line, inParagraph) {
3072
3081
  if (!inParagraph && HTML_BLOCK_START_7.test(line)) return 7;
3073
3082
  return null;
3074
3083
  }
3075
- function computeHtmlBlockRanges(text) {
3076
- if (text.indexOf("<") === -1) return [];
3084
+ function computeHtmlBlockRanges(text2) {
3085
+ if (text2.indexOf("<") === -1) return [];
3077
3086
  const ranges = [];
3078
3087
  const fences = _chunkYXWGSDK4cjs.createFenceTracker.call(void 0, );
3079
3088
  let kind = null;
@@ -3083,7 +3092,7 @@ function computeHtmlBlockRanges(text) {
3083
3092
  let offset2 = 0;
3084
3093
  let listContentCol = 0;
3085
3094
  let openPrefixLen = 0;
3086
- for (const line of text.split("\n")) {
3095
+ for (const line of text2.split("\n")) {
3087
3096
  const lineStart = offset2;
3088
3097
  const lineEnd = offset2 + line.length;
3089
3098
  offset2 = lineEnd + 1;
@@ -3145,21 +3154,21 @@ function escapeLeftoverTagStarts(gap, lowerSource, gapOffset) {
3145
3154
  (m, slash, tag, at) => isMaskedBlank(lowerSource, gapOffset + at, gapOffset + at + m.length) ? m : `&lt;${slash}${tag}`
3146
3155
  );
3147
3156
  }
3148
- function escapeUnknownHtmlTags(text, allowedTags = SAFE_HTML_TAGS) {
3149
- if (!text || text.indexOf("<") === -1) return text;
3150
- const lowerSource = buildCloserHaystack(text);
3157
+ function escapeUnknownHtmlTags(text2, allowedTags = SAFE_HTML_TAGS) {
3158
+ if (!text2 || text2.indexOf("<") === -1) return text2;
3159
+ const lowerSource = buildCloserHaystack(text2);
3151
3160
  let htmlBlocks = null;
3152
3161
  const spanInsideHtmlBlock = (from, to) => {
3153
- _nullishCoalesce(htmlBlocks, () => ( (htmlBlocks = computeHtmlBlockRanges(text))));
3162
+ _nullishCoalesce(htmlBlocks, () => ( (htmlBlocks = computeHtmlBlockRanges(text2))));
3154
3163
  return htmlBlocks.some((r) => r.start < to && r.end > from);
3155
3164
  };
3156
3165
  const parts = [];
3157
3166
  let cursor = 0;
3158
3167
  PROTECTED_SPAN_RE.lastIndex = 0;
3159
3168
  let span;
3160
- while ((span = PROTECTED_SPAN_RE.exec(text)) !== null) {
3169
+ while ((span = PROTECTED_SPAN_RE.exec(text2)) !== null) {
3161
3170
  if (span.index > cursor) {
3162
- parts.push(escapeOutsideFences(text.slice(cursor, span.index), allowedTags, lowerSource, cursor));
3171
+ parts.push(escapeOutsideFences(text2.slice(cursor, span.index), allowedTags, lowerSource, cursor));
3163
3172
  }
3164
3173
  const isFence = span[1] !== void 0;
3165
3174
  const spanEnd = span.index + span[0].length;
@@ -3168,8 +3177,8 @@ function escapeUnknownHtmlTags(text, allowedTags = SAFE_HTML_TAGS) {
3168
3177
  );
3169
3178
  cursor = span.index + span[0].length;
3170
3179
  }
3171
- if (cursor < text.length) {
3172
- parts.push(escapeOutsideFences(text.slice(cursor), allowedTags, lowerSource, cursor));
3180
+ if (cursor < text2.length) {
3181
+ parts.push(escapeOutsideFences(text2.slice(cursor), allowedTags, lowerSource, cursor));
3173
3182
  }
3174
3183
  return parts.join("");
3175
3184
  }
@@ -3352,12 +3361,12 @@ function splitStreamingBlocks(content) {
3352
3361
  }
3353
3362
  let cursorLine = 1;
3354
3363
  return units.map((unitLines, idx) => {
3355
- const text = unitLines.join("\n");
3364
+ const text2 = unitLines.join("\n");
3356
3365
  const isTail = idx === units.length - 1;
3357
3366
  const startLine = cursorLine;
3358
3367
  cursorLine += unitLines.length;
3359
3368
  return {
3360
- text,
3369
+ text: text2,
3361
3370
  index: idx,
3362
3371
  startLine,
3363
3372
  // Units carrying UNBALANCED raw HTML are never cached: an open
@@ -3367,7 +3376,7 @@ function splitStreamingBlocks(content) {
3367
3376
  // opens AND closes within the unit (`<div>x</div>`) leaves the
3368
3377
  // scanner's depth unchanged, so it stays memoizable — correctly: its
3369
3378
  // parse cannot be invalidated by later tokens.
3370
- memoizable: !isTail && !unitTouchedHtml[idx] && !NON_MEMOIZABLE_RE.test(text)
3379
+ memoizable: !isTail && !unitTouchedHtml[idx] && !NON_MEMOIZABLE_RE.test(text2)
3371
3380
  };
3372
3381
  });
3373
3382
  }
@@ -3456,7 +3465,7 @@ function resolveTextSizeConfig(config) {
3456
3465
 
3457
3466
  var NO_BROKEN_LINKS = [];
3458
3467
  var StreamingBlockRenderer = _react.memo.call(void 0, function StreamingBlockRendererImpl({
3459
- text,
3468
+ text: text2,
3460
3469
  remarkPlugins,
3461
3470
  rehypePlugins,
3462
3471
  components
@@ -3468,7 +3477,7 @@ var StreamingBlockRenderer = _react.memo.call(void 0, function StreamingBlockRen
3468
3477
  rehypePlugins,
3469
3478
  urlTransform: cardAwareUrlTransform,
3470
3479
  components,
3471
- children: text
3480
+ children: text2
3472
3481
  }
3473
3482
  );
3474
3483
  });
@@ -3616,7 +3625,7 @@ var thoughtMdClasses = [
3616
3625
  "[&_.code-block-container_>div:last-child]:!p-3"
3617
3626
  ].join(" ");
3618
3627
  var ThinkingDisplay = _react.forwardRef.call(void 0,
3619
- ({ className, text, isStreaming = false, ...props }, ref) => {
3628
+ ({ className, text: text2, isStreaming = false, ...props }, ref) => {
3620
3629
  const [expanded, setExpanded] = _react.useState.call(void 0, false);
3621
3630
  const { innerRef, isOverflowing, containerStyle } = useCollapsible({
3622
3631
  expanded,
@@ -3650,7 +3659,7 @@ var ThinkingDisplay = _react.forwardRef.call(void 0,
3650
3659
  ] }),
3651
3660
  isStreaming && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.DotsLoaderIcon, { size: 16, className: "text-ods-text-secondary" })
3652
3661
  ] }),
3653
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "min-w-0 flex-1", style: containerStyle, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { ref: innerRef, className: _chunk23V5BSHDcjs.cn.call(void 0, "text-sm leading-snug text-ods-text-secondary", thoughtMdClasses), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, SimpleMarkdownRenderer, { content: text, textSize: "compact" }) }) }),
3662
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "min-w-0 flex-1", style: containerStyle, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { ref: innerRef, className: _chunk23V5BSHDcjs.cn.call(void 0, "text-sm leading-snug text-ods-text-secondary", thoughtMdClasses), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, SimpleMarkdownRenderer, { content: text2, textSize: "compact" }) }) }),
3654
3663
  canToggle && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex h-[19px] shrink-0 items-center", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ExpandChevron, { expanded }) })
3655
3664
  ]
3656
3665
  }
@@ -3663,15 +3672,15 @@ ThinkingDisplay.displayName = "ThinkingDisplay";
3663
3672
 
3664
3673
 
3665
3674
  var LOCKED_HINT = "This question was already answered";
3666
- var AskDisplay = _react.forwardRef.call(void 0, ({ className, cards, onSelect, ...props }, ref) => {
3675
+ var AskDisplay = _react.forwardRef.call(void 0, ({ className, cards: cards2, onSelect, ...props }, ref) => {
3667
3676
  const [index, setIndex] = _react.useState.call(void 0, 0);
3668
3677
  const lockedHintId = _react.useId.call(void 0, );
3669
3678
  _react.useEffect.call(void 0, () => {
3670
- setIndex((current) => current < cards.length ? current : Math.max(0, cards.length - 1));
3671
- }, [cards.length]);
3672
- const active = cards[Math.min(index, cards.length - 1)];
3679
+ setIndex((current) => current < cards2.length ? current : Math.max(0, cards2.length - 1));
3680
+ }, [cards2.length]);
3681
+ const active = cards2[Math.min(index, cards2.length - 1)];
3673
3682
  if (!active) return null;
3674
- const showPager = cards.length > 1;
3683
+ const showPager = cards2.length > 1;
3675
3684
  const isInteractive = !!onSelect;
3676
3685
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
3677
3686
  "div",
@@ -3703,15 +3712,15 @@ var AskDisplay = _react.forwardRef.call(void 0, ({ className, cards, onSelect, .
3703
3712
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "whitespace-nowrap text-ods-text-secondary text-h6", children: [
3704
3713
  index + 1,
3705
3714
  " of ",
3706
- cards.length
3715
+ cards2.length
3707
3716
  ] }),
3708
3717
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
3709
3718
  "button",
3710
3719
  {
3711
3720
  type: "button",
3712
3721
  "aria-label": "Next question",
3713
- disabled: index === cards.length - 1,
3714
- onClick: () => setIndex((current) => Math.min(cards.length - 1, current + 1)),
3722
+ disabled: index === cards2.length - 1,
3723
+ onClick: () => setIndex((current) => Math.min(cards2.length - 1, current + 1)),
3715
3724
  className: "text-ods-text-secondary transition-colors hover:text-ods-text-primary disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:text-ods-text-secondary",
3716
3725
  children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.Chevron02RightIcon, { size: 16 })
3717
3726
  }
@@ -5778,12 +5787,12 @@ function placeCaretAtOffset(el, offset2) {
5778
5787
  sel.removeAllRanges();
5779
5788
  sel.addRange(range);
5780
5789
  }
5781
- function insertTextAtCaret(text) {
5790
+ function insertTextAtCaret(text2) {
5782
5791
  const sel = typeof window !== "undefined" ? window.getSelection() : null;
5783
5792
  if (!sel || sel.rangeCount === 0) return;
5784
5793
  const range = sel.getRangeAt(0);
5785
5794
  range.deleteContents();
5786
- const tn = document.createTextNode(text);
5795
+ const tn = document.createTextNode(text2);
5787
5796
  range.insertNode(tn);
5788
5797
  range.setStartAfter(tn);
5789
5798
  range.collapse(true);
@@ -5985,9 +5994,9 @@ var ChatInput = _react.forwardRef.call(void 0, (allProps, ref) => {
5985
5994
  const handlePaste = _react.useCallback.call(void 0,
5986
5995
  (e) => {
5987
5996
  e.preventDefault();
5988
- const text = e.clipboardData.getData("text/plain");
5989
- if (!text) return;
5990
- insertTextAtCaret(text);
5997
+ const text2 = e.clipboardData.getData("text/plain");
5998
+ if (!text2) return;
5999
+ insertTextAtCaret(text2);
5991
6000
  syncFromDom();
5992
6001
  },
5993
6002
  [syncFromDom]
@@ -6244,6 +6253,14 @@ ChatInput.displayName = "ChatInput";
6244
6253
  // src/components/chat/chat-message-enhanced.tsx
6245
6254
 
6246
6255
 
6256
+ // src/chat-protocol/card-marker.ts
6257
+ var CARD_TYPE = "[a-zA-Z0-9_-]+";
6258
+ var CARD_ID = "[^\\]\\r\\n)]+";
6259
+ var CARD_REFERENCE = new RegExp(`^\\[card://(${CARD_TYPE}):(${CARD_ID})\\]$`);
6260
+ function createCardMarkerScanner() {
6261
+ return new RegExp(`\\[card://(${CARD_TYPE}):(${CARD_ID})[\\])]`, "g");
6262
+ }
6263
+
6247
6264
  // src/utils/date-utils.ts
6248
6265
  function formatTicketRelativeTime(iso) {
6249
6266
  const now = /* @__PURE__ */ new Date();
@@ -6797,21 +6814,21 @@ function BlockCard(_props) {
6797
6814
 
6798
6815
  // src/components/chat/remark-card-links.ts
6799
6816
  var _unistutilvisit = require('unist-util-visit');
6800
- var CARD_REGEX = /\[card:\/\/([a-zA-Z0-9_-]+):([a-zA-Z0-9_-]+)[\])]/g;
6817
+ var CARD_REGEX = createCardMarkerScanner();
6801
6818
  var remarkCardLinks = () => {
6802
6819
  return (tree) => {
6803
6820
  _unistutilvisit.visit.call(void 0, tree, "text", (node, index, parent) => {
6804
6821
  if (!parent || typeof index !== "number") return void 0;
6805
- const text = node.value;
6806
- if (!text || !text.includes("[card://")) return void 0;
6822
+ const text2 = node.value;
6823
+ if (!text2 || !text2.includes("[card://")) return void 0;
6807
6824
  const parts = [];
6808
6825
  let lastIndex = 0;
6809
6826
  CARD_REGEX.lastIndex = 0;
6810
6827
  let match;
6811
- while ((match = CARD_REGEX.exec(text)) !== null) {
6828
+ while ((match = CARD_REGEX.exec(text2)) !== null) {
6812
6829
  const matchStart = match.index;
6813
6830
  if (matchStart > lastIndex) {
6814
- parts.push({ type: "text", value: text.slice(lastIndex, matchStart) });
6831
+ parts.push({ type: "text", value: text2.slice(lastIndex, matchStart) });
6815
6832
  }
6816
6833
  const cardType = match[1];
6817
6834
  const cardId = match[2];
@@ -6826,8 +6843,8 @@ var remarkCardLinks = () => {
6826
6843
  lastIndex = matchStart + match[0].length;
6827
6844
  }
6828
6845
  if (lastIndex === 0) return void 0;
6829
- if (lastIndex < text.length) {
6830
- parts.push({ type: "text", value: text.slice(lastIndex) });
6846
+ if (lastIndex < text2.length) {
6847
+ parts.push({ type: "text", value: text2.slice(lastIndex) });
6831
6848
  }
6832
6849
  parent.children.splice(index, 1, ...parts);
6833
6850
  return [_unistutilvisit.SKIP, index + parts.length];
@@ -6842,19 +6859,19 @@ var remarkMentionChips = () => {
6842
6859
  return (tree) => {
6843
6860
  _unistutilvisit.visit.call(void 0, tree, "text", (node, index, parent) => {
6844
6861
  if (!parent || typeof index !== "number") return void 0;
6845
- const text = node.value;
6846
- if (!text || !text.includes("@")) return void 0;
6862
+ const text2 = node.value;
6863
+ if (!text2 || !text2.includes("@")) return void 0;
6847
6864
  const parts = [];
6848
6865
  let lastIndex = 0;
6849
6866
  MENTION_REGEX.lastIndex = 0;
6850
6867
  let match;
6851
- while ((match = MENTION_REGEX.exec(text)) !== null) {
6868
+ while ((match = MENTION_REGEX.exec(text2)) !== null) {
6852
6869
  const lead = match[1];
6853
6870
  const marker = match[2];
6854
6871
  const id = match[3];
6855
6872
  const tokenStart = match.index + lead.length;
6856
6873
  if (tokenStart > lastIndex) {
6857
- parts.push({ type: "text", value: text.slice(lastIndex, tokenStart) });
6874
+ parts.push({ type: "text", value: text2.slice(lastIndex, tokenStart) });
6858
6875
  }
6859
6876
  parts.push({
6860
6877
  type: "link",
@@ -6866,8 +6883,8 @@ var remarkMentionChips = () => {
6866
6883
  lastIndex = match.index + match[0].length;
6867
6884
  }
6868
6885
  if (lastIndex === 0) return void 0;
6869
- if (lastIndex < text.length) {
6870
- parts.push({ type: "text", value: text.slice(lastIndex) });
6886
+ if (lastIndex < text2.length) {
6887
+ parts.push({ type: "text", value: text2.slice(lastIndex) });
6871
6888
  }
6872
6889
  parent.children.splice(index, 1, ...parts);
6873
6890
  return [_unistutilvisit.SKIP, index + parts.length];
@@ -6919,6 +6936,8 @@ var ToolExecutionDisplay = _react.forwardRef.call(void 0,
6919
6936
  return [...commandEntries, ...otherEntries];
6920
6937
  }, [message.parameters, variant]);
6921
6938
  const hasResult = isExecuted && typeof message.result === "string" && message.result.length > 0;
6939
+ const isConciseRemoteRead = !message.integratedToolType && !!previewText && argEntries.length === 0 && !hasResult;
6940
+ const isStaticRow = isClientView || isConciseRemoteRead;
6922
6941
  const hasBody = argEntries.length > 0 || hasResult || isExecuting;
6923
6942
  const renderStatusIcon = () => {
6924
6943
  if (isExecuting) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.DotsLoaderIcon, { size: 16, className: "text-ods-text-secondary" });
@@ -6939,7 +6958,7 @@ var ToolExecutionDisplay = _react.forwardRef.call(void 0,
6939
6958
  }
6940
6959
  ),
6941
6960
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex h-5 w-5 shrink-0 items-center justify-center", children: renderStatusIcon() }),
6942
- !isClientView && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex h-5 w-5 shrink-0 items-center justify-center", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ExpandChevron, { expanded }) })
6961
+ !isStaticRow && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex h-5 w-5 shrink-0 items-center justify-center", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ExpandChevron, { expanded }) })
6943
6962
  ] });
6944
6963
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
6945
6964
  "div",
@@ -6952,9 +6971,10 @@ var ToolExecutionDisplay = _react.forwardRef.call(void 0,
6952
6971
  className
6953
6972
  ),
6954
6973
  ...props,
6955
- children: isClientView ? (
6956
- // Client (Fae end-user): static, non-expandable row — no chevron, no
6957
- // body. Just the explanation + status; command/args/result are hidden.
6974
+ children: isStaticRow ? (
6975
+ // Static, non-expandable row — no chevron, no body. Two cases reach
6976
+ // here: the Fae end-user view (command/args/result are admin-only
6977
+ // detail) and a remote read-only tool (there IS no detail).
6958
6978
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex w-full items-start gap-[var(--spacing-system-xs)] p-[var(--spacing-system-s)] text-left", children: headerContent })
6959
6979
  ) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
6960
6980
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -6999,7 +7019,7 @@ ToolExecutionDisplay.displayName = "ToolExecutionDisplay";
6999
7019
  // src/components/chat/chat-message-enhanced.tsx
7000
7020
 
7001
7021
  var MENTION_MARKER_REGEX = /(^|[^\w@])@[a-zA-Z]+:([A-Za-z0-9_.+/=-]*[A-Za-z0-9_+/=])/g;
7002
- var CARD_MARKER_REGEX = /\[card:\/\/([a-zA-Z0-9_-]+):([a-zA-Z0-9_-]+)[\])]/g;
7022
+ var CARD_MARKER_REGEX = createCardMarkerScanner();
7003
7023
  function formatMessageTimestamp(timestamp) {
7004
7024
  const time = formatTime(timestamp);
7005
7025
  return isToday(timestamp) ? time : `${formatDate(timestamp)} ${time}`;
@@ -7046,6 +7066,7 @@ var ChatMessageEnhanced = _react.forwardRef.call(void 0,
7046
7066
  renderContextItem,
7047
7067
  renderMention,
7048
7068
  renderEntityCard,
7069
+ refs,
7049
7070
  onAskSelect,
7050
7071
  NavLinkAnchor,
7051
7072
  ...props
@@ -7080,6 +7101,11 @@ var ChatMessageEnhanced = _react.forwardRef.call(void 0,
7080
7101
  const renderedCardNodeCache = _react.useRef.call(void 0,
7081
7102
  /* @__PURE__ */ new Map()
7082
7103
  );
7104
+ const refByKey = _react.useMemo.call(void 0, () => {
7105
+ const byKey = /* @__PURE__ */ new Map();
7106
+ for (const described of _nullishCoalesce(refs, () => ( []))) byKey.set(`${described.type}:${described.id}`, described);
7107
+ return byKey;
7108
+ }, [refs]);
7083
7109
  const renderingPlan = _react.useMemo.call(void 0, () => {
7084
7110
  if (!hasMarkerSupport) return null;
7085
7111
  const render = renderEntityCard;
@@ -7091,32 +7117,33 @@ var ChatMessageEnhanced = _react.forwardRef.call(void 0,
7091
7117
  const emittedBlockKeys = /* @__PURE__ */ new Set();
7092
7118
  segments.forEach((segment, segIdx) => {
7093
7119
  if (segment.type !== "text") return;
7094
- const text = segment.text;
7120
+ const text2 = segment.text;
7095
7121
  const parts = [];
7096
7122
  let cursor = 0;
7097
7123
  CARD_MARKER_REGEX.lastIndex = 0;
7098
7124
  let match;
7099
- while ((match = CARD_MARKER_REGEX.exec(text)) !== null) {
7125
+ while ((match = CARD_MARKER_REGEX.exec(text2)) !== null) {
7100
7126
  const cardType = match[1];
7101
7127
  const cardId = match[2];
7102
7128
  const key = `${cardType}:${cardId}`;
7103
7129
  usedKeys.add(key);
7130
+ const describedRef = refByKey.get(key);
7104
7131
  let entry = cache.get(key);
7105
- if (!entry || entry.render !== render) {
7106
- const refForRender = {
7132
+ if (!entry || entry.render !== render || entry.ref !== describedRef) {
7133
+ const refForRender = _nullishCoalesce(describedRef, () => ( {
7107
7134
  type: cardType,
7108
7135
  id: cardId,
7109
7136
  title: cardId,
7110
7137
  url: null
7111
- };
7112
- entry = { render, node: render(refForRender) };
7138
+ }));
7139
+ entry = { render, ref: describedRef, node: render(refForRender) };
7113
7140
  cache.set(key, entry);
7114
7141
  }
7115
7142
  const rendered = entry.node;
7116
7143
  if (_react2.default.isValidElement(rendered) && rendered.type === BlockCard) {
7117
7144
  const cardProps = rendered.props;
7118
7145
  const markerEnd = match.index + match[0].length;
7119
- parts.push({ kind: "text", text: text.slice(cursor, markerEnd) });
7146
+ parts.push({ kind: "text", text: text2.slice(cursor, markerEnd) });
7120
7147
  if (!emittedBlockKeys.has(key)) {
7121
7148
  emittedBlockKeys.add(key);
7122
7149
  parts.push({ kind: "block", key, node: cardProps.children });
@@ -7127,7 +7154,7 @@ var ChatMessageEnhanced = _react.forwardRef.call(void 0,
7127
7154
  cardProps.inline != null ? cardProps.inline : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "font-medium text-ods-text-primary", children: cardId })
7128
7155
  );
7129
7156
  } else if (rendered != null) {
7130
- parts.push({ kind: "text", text: text.slice(cursor, match.index) });
7157
+ parts.push({ kind: "text", text: text2.slice(cursor, match.index) });
7131
7158
  if (!emittedBlockKeys.has(key)) {
7132
7159
  emittedBlockKeys.add(key);
7133
7160
  parts.push({ kind: "block", key, node: rendered });
@@ -7135,15 +7162,15 @@ var ChatMessageEnhanced = _react.forwardRef.call(void 0,
7135
7162
  cursor = match.index + match[0].length;
7136
7163
  }
7137
7164
  }
7138
- if (cursor < text.length) {
7139
- parts.push({ kind: "text", text: text.slice(cursor) });
7165
+ if (cursor < text2.length) {
7166
+ parts.push({ kind: "text", text: text2.slice(cursor) });
7140
7167
  }
7141
7168
  if (parts.some((p) => p.kind === "block")) {
7142
7169
  partsBySegment.set(segIdx, parts);
7143
7170
  }
7144
7171
  });
7145
7172
  return { inlineByKey, partsBySegment, usedKeys };
7146
- }, [hasMarkerSupport, renderEntityCard, segments]);
7173
+ }, [hasMarkerSupport, renderEntityCard, refByKey, segments]);
7147
7174
  _react.useEffect.call(void 0, () => {
7148
7175
  const cache = renderedCardNodeCache.current;
7149
7176
  const usedKeys = _optionalChain([renderingPlan, 'optionalAccess', _115 => _115.usedKeys]);
@@ -7192,13 +7219,13 @@ var ChatMessageEnhanced = _react.forwardRef.call(void 0,
7192
7219
  }
7193
7220
  };
7194
7221
  }, [hasMarkerSupport, hasMentionSupport, renderMention, NavLinkAnchor]);
7195
- const renderSegmentBody = (segIndex, text, isStreaming) => {
7222
+ const renderSegmentBody = (segIndex, text2, isStreaming) => {
7196
7223
  const parts = _optionalChain([renderingPlan, 'optionalAccess', _121 => _121.partsBySegment, 'access', _122 => _122.get, 'call', _123 => _123(segIndex)]);
7197
7224
  if (!parts || parts.length === 0) {
7198
7225
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
7199
7226
  SimpleMarkdownRenderer,
7200
7227
  {
7201
- content: text,
7228
+ content: text2,
7202
7229
  textSize: "compact",
7203
7230
  additionalRemarkPlugins: cardRemarkPlugins,
7204
7231
  componentOverrides: cardComponentOverrides,
@@ -7370,7 +7397,9 @@ var MemoizedChatMessageEnhanced = _react.memo.call(void 0, ChatMessageEnhanced,
7370
7397
  // message (it's set once on the optimistic send and never mutated).
7371
7398
  prevProps.contextItems === nextProps.contextItems && prevProps.resolveContextIcon === nextProps.resolveContextIcon && prevProps.renderContextItem === nextProps.renderContextItem && // Host keeps this stable (module const / useCallback), so reference
7372
7399
  // equality holds across streaming chunks.
7373
- prevProps.renderMention === nextProps.renderMention && prevProps.renderEntityCard === nextProps.renderEntityCard && // Same stability contract as the renderers above: hosts pass a `useCallback`
7400
+ prevProps.renderMention === nextProps.renderMention && prevProps.renderEntityCard === nextProps.renderEntityCard && // Reference equality: the reducer sets this once per answer and the host
7401
+ // forwards the same array instance, so it holds across streaming chunks.
7402
+ prevProps.refs === nextProps.refs && // Same stability contract as the renderers above: hosts pass a `useCallback`
7374
7403
  // (EmbeddableChat passes its memoized `handleSend`), so this holds across
7375
7404
  // streaming chunks instead of re-rendering every ask card per chunk.
7376
7405
  prevProps.onAskSelect === nextProps.onAskSelect && prevProps.NavLinkAnchor === nextProps.NavLinkAnchor;
@@ -7467,11 +7496,11 @@ var BLINK_KEYFRAMES = `
7467
7496
  `;
7468
7497
  function CyclingPhrase({ words, className, charMs = 60, holdMs = 4500 }) {
7469
7498
  const [wordIndex, setWordIndex] = _react.useState.call(void 0, 0);
7470
- const [text, setText] = _react.useState.call(void 0, "");
7499
+ const [text2, setText] = _react.useState.call(void 0, "");
7471
7500
  const [cursor, setCursor] = _react.useState.call(void 0, 0);
7472
7501
  const target = _nullishCoalesce(words[wordIndex], () => ( ""));
7473
- const holding = words.length > 0 && cursor >= Math.max(text.length, target.length);
7474
- const shownText = holding ? target : text;
7502
+ const holding = words.length > 0 && cursor >= Math.max(text2.length, target.length);
7503
+ const shownText = holding ? target : text2;
7475
7504
  const placeholder = _react.useMemo.call(void 0,
7476
7505
  () => words.reduce((longest, w) => w.length > longest.length ? w : longest, ""),
7477
7506
  [words]
@@ -7497,7 +7526,7 @@ function CyclingPhrase({ words, className, charMs = 60, holdMs = 4500 }) {
7497
7526
  setCursor((c) => c + 1);
7498
7527
  }, charMs);
7499
7528
  return () => clearTimeout(timeoutId);
7500
- }, [wordIndex, cursor, text, holding, target, words, charMs, holdMs]);
7529
+ }, [wordIndex, cursor, text2, holding, target, words, charMs, holdMs]);
7501
7530
  if (words.length === 0) return null;
7502
7531
  const before = shownText.slice(0, cursor);
7503
7532
  const after = shownText.slice(cursor);
@@ -7581,6 +7610,7 @@ var ChatMessageList = _react.forwardRef.call(void 0,
7581
7610
  resolveContextIcon,
7582
7611
  renderContextItem,
7583
7612
  renderMention,
7613
+ renderAfterMessage,
7584
7614
  onAskSelect,
7585
7615
  NavLinkAnchor,
7586
7616
  ...props
@@ -7938,7 +7968,8 @@ var ChatMessageList = _react.forwardRef.call(void 0,
7938
7968
  if (message.hidden) return null;
7939
7969
  const isEmptyPendingTurn = index === messages.length - 1 && isTyping && message.role === "assistant" && !hasNonEmptyContent(message.content) && (!Array.isArray(message.content) || message.content.every((s) => s.type === "text"));
7940
7970
  if (isEmptyPendingTurn) return null;
7941
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
7971
+ const ownedContent = _optionalChain([renderAfterMessage, 'optionalCall', _144 => _144(message, index)]);
7972
+ const row = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
7942
7973
  MemoizedChatMessageEnhanced,
7943
7974
  {
7944
7975
  ref: getRegisterMessageEl(message.id),
@@ -7958,11 +7989,17 @@ var ChatMessageList = _react.forwardRef.call(void 0,
7958
7989
  renderContextItem,
7959
7990
  renderMention,
7960
7991
  renderEntityCard,
7992
+ refs: message.refs,
7961
7993
  onAskSelect: index > lastUserMessageIndex ? onAskSelect : void 0,
7962
7994
  NavLinkAnchor
7963
7995
  },
7964
7996
  message.id
7965
7997
  );
7998
+ if (!ownedContent) return row;
7999
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full min-w-0 flex-col", children: [
8000
+ row,
8001
+ ownedContent
8002
+ ] }, message.id);
7966
8003
  })
7967
8004
  ]
7968
8005
  }
@@ -8111,7 +8148,7 @@ function EntityIcon({
8111
8148
  size: size2 = 20,
8112
8149
  className
8113
8150
  }) {
8114
- if (_optionalChain([icon, 'optionalAccess', _144 => _144.url])) {
8151
+ if (_optionalChain([icon, 'optionalAccess', _145 => _145.url])) {
8115
8152
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
8116
8153
  _chunkWLSFBRT5cjs.next_image_default,
8117
8154
  {
@@ -8125,7 +8162,7 @@ function EntityIcon({
8125
8162
  }
8126
8163
  );
8127
8164
  }
8128
- if (_optionalChain([icon, 'optionalAccess', _145 => _145.name]) && BRAND_MARK_NAMES.has(icon.name)) {
8165
+ if (_optionalChain([icon, 'optionalAccess', _146 => _146.name]) && BRAND_MARK_NAMES.has(icon.name)) {
8129
8166
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
8130
8167
  "span",
8131
8168
  {
@@ -8135,8 +8172,8 @@ function EntityIcon({
8135
8172
  }
8136
8173
  );
8137
8174
  }
8138
- const Glyph = resolveIcon(_nullishCoalesce(_optionalChain([icon, 'optionalAccess', _146 => _146.name]), () => ( void 0)));
8139
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Glyph, { size: size2, className, ..._nullishCoalesce(_optionalChain([icon, 'optionalAccess', _147 => _147.props]), () => ( {})) });
8175
+ const Glyph = resolveIcon(_nullishCoalesce(_optionalChain([icon, 'optionalAccess', _147 => _147.name]), () => ( void 0)));
8176
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Glyph, { size: size2, className, ..._nullishCoalesce(_optionalChain([icon, 'optionalAccess', _148 => _148.props]), () => ( {})) });
8140
8177
  }
8141
8178
 
8142
8179
  // src/components/chat/quick-action-chip.tsx
@@ -8146,7 +8183,7 @@ function getAgentAccent(slug) {
8146
8183
  return slug === "fae" || slug === "mingo" ? AGENT_ACCENTS[slug] : void 0;
8147
8184
  }
8148
8185
  function accentFromIdentityIcon(icon) {
8149
- const color = _optionalChain([icon, 'optionalAccess', _148 => _148.props, 'optionalAccess', _149 => _149.color]);
8186
+ const color = _optionalChain([icon, 'optionalAccess', _149 => _149.props, 'optionalAccess', _150 => _150.color]);
8150
8187
  return typeof color === "string" && color.length > 0 ? color : void 0;
8151
8188
  }
8152
8189
  var ACCENT_CLASS = {
@@ -8228,7 +8265,7 @@ function QuickActionChipButton({
8228
8265
  className
8229
8266
  }) {
8230
8267
  const themedIcon = theme && isQuickActionIconSpec(icon) && !icon.accent ? { ...icon, accent: theme.accent } : icon;
8231
- const resolvedLozenge = lozenge === true ? _optionalChain([theme, 'optionalAccess', _150 => _150.lozenge]) : lozenge === false ? void 0 : lozenge;
8268
+ const resolvedLozenge = lozenge === true ? _optionalChain([theme, 'optionalAccess', _151 => _151.lozenge]) : lozenge === false ? void 0 : lozenge;
8232
8269
  const resolvedIcon = renderQuickActionIcon(themedIcon);
8233
8270
  const resolvedLabel = composeChipLabel(label, resolvedLozenge);
8234
8271
  const tagVariant = selected ? selectedAccent === "cyan" ? "selectedCyan" : "selected" : variant;
@@ -8440,7 +8477,7 @@ function MarqueeWall({
8440
8477
  if (!container || !copy) return;
8441
8478
  const size2 = axis === "y" ? copy.offsetHeight : copy.offsetWidth;
8442
8479
  copySizeRef.current = size2;
8443
- const clone = _optionalChain([trackRef, 'access', _151 => _151.current, 'optionalAccess', _152 => _152.querySelector, 'call', _153 => _153('[data-marquee-copy="clone"]')]);
8480
+ const clone = _optionalChain([trackRef, 'access', _152 => _152.current, 'optionalAccess', _153 => _153.querySelector, 'call', _154 => _154('[data-marquee-copy="clone"]')]);
8444
8481
  wrapSizeRef.current = clone ? axis === "y" ? clone.offsetTop - copy.offsetTop : clone.offsetLeft - copy.offsetLeft : size2 + (typeof copyGap === "number" ? copyGap : 0);
8445
8482
  const avail = axis === "y" ? container.clientHeight : container.clientWidth;
8446
8483
  setOverflows(size2 > avail + 1);
@@ -8461,7 +8498,7 @@ function MarqueeWall({
8461
8498
  _react.useEffect.call(void 0, () => {
8462
8499
  const el = containerRef.current;
8463
8500
  if (!el || typeof IntersectionObserver === "undefined") return void 0;
8464
- const io = new IntersectionObserver((entries) => setNearViewport(_nullishCoalesce(_optionalChain([entries, 'access', _154 => _154[0], 'optionalAccess', _155 => _155.isIntersecting]), () => ( true))), {
8501
+ const io = new IntersectionObserver((entries) => setNearViewport(_nullishCoalesce(_optionalChain([entries, 'access', _155 => _155[0], 'optionalAccess', _156 => _156.isIntersecting]), () => ( true))), {
8465
8502
  rootMargin: _chunkYXWGSDK4cjs.NEAR_VIEWPORT_ROOT_MARGIN
8466
8503
  });
8467
8504
  io.observe(el);
@@ -8572,7 +8609,7 @@ function MarqueeWall({
8572
8609
  if (Math.abs(delta) > 3 && !dragMovedRef.current) {
8573
8610
  dragMovedRef.current = true;
8574
8611
  try {
8575
- _optionalChain([containerRef, 'access', _156 => _156.current, 'optionalAccess', _157 => _157.setPointerCapture, 'call', _158 => _158(e.pointerId)]);
8612
+ _optionalChain([containerRef, 'access', _157 => _157.current, 'optionalAccess', _158 => _158.setPointerCapture, 'call', _159 => _159(e.pointerId)]);
8576
8613
  } catch (e7) {
8577
8614
  }
8578
8615
  }
@@ -8589,7 +8626,7 @@ function MarqueeWall({
8589
8626
  dragSuppressUntilRef.current = performance.now() + DRAG_RESUME_MS;
8590
8627
  if (dragMovedRef.current) {
8591
8628
  try {
8592
- _optionalChain([containerRef, 'access', _159 => _159.current, 'optionalAccess', _160 => _160.releasePointerCapture, 'call', _161 => _161(e.pointerId)]);
8629
+ _optionalChain([containerRef, 'access', _160 => _160.current, 'optionalAccess', _161 => _161.releasePointerCapture, 'call', _162 => _162(e.pointerId)]);
8593
8630
  } catch (e8) {
8594
8631
  }
8595
8632
  }
@@ -9025,7 +9062,7 @@ var ChatTicketItem = _react.forwardRef.call(void 0,
9025
9062
  {
9026
9063
  ref,
9027
9064
  type: "button",
9028
- onClick: () => _optionalChain([onClick, 'optionalCall', _162 => _162(ticket.id)]),
9065
+ onClick: () => _optionalChain([onClick, 'optionalCall', _163 => _163(ticket.id)]),
9029
9066
  className: _chunk23V5BSHDcjs.cn.call(void 0,
9030
9067
  "flex h-20 w-full items-center gap-4 px-4",
9031
9068
  "border-b border-ods-border bg-ods-card",
@@ -9256,7 +9293,7 @@ function MingoChatHistoryRow({
9256
9293
  const unread = _nullishCoalesce(dialog.unreadMessagesCount, () => ( 0));
9257
9294
  const hasMenu = !!onRequestRename || !!onRequestArchive || !!onRequestCopyLink;
9258
9295
  const owner = dialog.owner;
9259
- const hasAvatar = !!(_optionalChain([owner, 'optionalAccess', _163 => _163.name]) || _optionalChain([owner, 'optionalAccess', _164 => _164.avatarUrl]));
9296
+ const hasAvatar = !!(_optionalChain([owner, 'optionalAccess', _164 => _164.name]) || _optionalChain([owner, 'optionalAccess', _165 => _165.avatarUrl]));
9260
9297
  const [menuOpen, setMenuOpen] = _react.useState.call(void 0, false);
9261
9298
  const menuItems = [
9262
9299
  onRequestCopyLink && {
@@ -9292,11 +9329,11 @@ function MingoChatHistoryRow({
9292
9329
  {
9293
9330
  role: "button",
9294
9331
  tabIndex: 0,
9295
- onClick: () => _optionalChain([onSelect, 'optionalCall', _165 => _165(dialog.id)]),
9332
+ onClick: () => _optionalChain([onSelect, 'optionalCall', _166 => _166(dialog.id)]),
9296
9333
  onKeyDown: (e) => {
9297
9334
  if (e.key === "Enter" || e.key === " ") {
9298
9335
  e.preventDefault();
9299
- _optionalChain([onSelect, 'optionalCall', _166 => _166(dialog.id)]);
9336
+ _optionalChain([onSelect, 'optionalCall', _167 => _167(dialog.id)]);
9300
9337
  }
9301
9338
  },
9302
9339
  className: "flex min-w-0 flex-1 cursor-pointer items-center gap-[var(--spacing-system-xsf)] p-[var(--spacing-system-s)] focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ods-accent",
@@ -9363,8 +9400,8 @@ function MingoChatHistoryRow({
9363
9400
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
9364
9401
  "span",
9365
9402
  {
9366
- onClick: () => _optionalChain([onSelect, 'optionalCall', _167 => _167(dialog.id)]),
9367
- title: _optionalChain([owner, 'optionalAccess', _168 => _168.name]) || void 0,
9403
+ onClick: () => _optionalChain([onSelect, 'optionalCall', _168 => _168(dialog.id)]),
9404
+ title: _optionalChain([owner, 'optionalAccess', _169 => _169.name]) || void 0,
9368
9405
  className: _chunk23V5BSHDcjs.cn.call(void 0,
9369
9406
  "absolute inset-0 flex cursor-pointer items-center justify-center transition-opacity",
9370
9407
  hasMenu && (menuOpen ? "pointer-events-none opacity-0" : "md:group-hover/row:pointer-events-none md:group-hover/row:opacity-0 md:peer-[:focus-within]/menu:pointer-events-none md:peer-[:focus-within]/menu:opacity-0")
@@ -9374,9 +9411,9 @@ function MingoChatHistoryRow({
9374
9411
  {
9375
9412
  variant: "round",
9376
9413
  sizePx: 24,
9377
- src: _optionalChain([owner, 'optionalAccess', _169 => _169.avatarUrl]) || void 0,
9378
- alt: _optionalChain([owner, 'optionalAccess', _170 => _170.name]) || void 0,
9379
- fallback: _optionalChain([owner, 'optionalAccess', _171 => _171.name]) || void 0,
9414
+ src: _optionalChain([owner, 'optionalAccess', _170 => _170.avatarUrl]) || void 0,
9415
+ alt: _optionalChain([owner, 'optionalAccess', _171 => _171.name]) || void 0,
9416
+ fallback: _optionalChain([owner, 'optionalAccess', _172 => _172.name]) || void 0,
9380
9417
  initialsClassName: "text-[10px] text-ods-text-secondary"
9381
9418
  }
9382
9419
  )
@@ -9427,7 +9464,7 @@ function MingoChatHistory({
9427
9464
  className
9428
9465
  }) {
9429
9466
  const groups = _react.useMemo.call(void 0, () => groupDialogs(dialogs), [dialogs]);
9430
- const noSearchResults = groups.length === 0 && !!_optionalChain([searchQuery, 'optionalAccess', _172 => _172.trim, 'call', _173 => _173()]);
9467
+ const noSearchResults = groups.length === 0 && !!_optionalChain([searchQuery, 'optionalAccess', _173 => _173.trim, 'call', _174 => _174()]);
9431
9468
  const { scrollRef, fadeTop, fadeBottom, update: updateFade } = useScrollFade();
9432
9469
  const sentinelRef = _react.useRef.call(void 0, null);
9433
9470
  const onLoadMoreRef = _react.useRef.call(void 0, onLoadMore);
@@ -9444,7 +9481,7 @@ function MingoChatHistory({
9444
9481
  const io = new IntersectionObserver(
9445
9482
  ([entry]) => {
9446
9483
  if (entry.isIntersecting && !isLoadingMoreRef.current) {
9447
- _optionalChain([onLoadMoreRef, 'access', _174 => _174.current, 'optionalCall', _175 => _175()]);
9484
+ _optionalChain([onLoadMoreRef, 'access', _175 => _175.current, 'optionalCall', _176 => _176()]);
9448
9485
  }
9449
9486
  },
9450
9487
  { root, rootMargin: "120px", threshold: 0.1 }
@@ -9628,8 +9665,8 @@ function MingoWelcome({
9628
9665
  icon: action.icon,
9629
9666
  variant: action.variant,
9630
9667
  onSelect: action.onClick,
9631
- onHoverStart: () => _optionalChain([onQuickActionHover, 'optionalCall', _176 => _176(action)]),
9632
- onHoverEnd: () => _optionalChain([onQuickActionHoverEnd, 'optionalCall', _177 => _177()])
9668
+ onHoverStart: () => _optionalChain([onQuickActionHover, 'optionalCall', _177 => _177(action)]),
9669
+ onHoverEnd: () => _optionalChain([onQuickActionHoverEnd, 'optionalCall', _178 => _178()])
9633
9670
  })),
9634
9671
  agentSlug,
9635
9672
  rows: 4,
@@ -9682,9 +9719,9 @@ function GuideWelcome({
9682
9719
  props: action.iconProps,
9683
9720
  accent: _nullishCoalesce(_nullishCoalesce(action.accent, () => ( accentFromIdentityIcon(icon))), () => ( "cyan"))
9684
9721
  },
9685
- onSelect: () => _optionalChain([onQuickAction, 'optionalCall', _178 => _178(action)]),
9686
- onHoverStart: () => _optionalChain([onQuickActionHover, 'optionalCall', _179 => _179(action)]),
9687
- onHoverEnd: () => _optionalChain([onQuickActionHoverEnd, 'optionalCall', _180 => _180()])
9722
+ onSelect: () => _optionalChain([onQuickAction, 'optionalCall', _179 => _179(action)]),
9723
+ onHoverStart: () => _optionalChain([onQuickActionHover, 'optionalCall', _180 => _180(action)]),
9724
+ onHoverEnd: () => _optionalChain([onQuickActionHoverEnd, 'optionalCall', _181 => _181()])
9688
9725
  })),
9689
9726
  [quickActions, icon, onQuickAction, onQuickActionHover, onQuickActionHoverEnd]
9690
9727
  );
@@ -9860,7 +9897,7 @@ function MingoHistoryRail({
9860
9897
  onRetry,
9861
9898
  className
9862
9899
  }) {
9863
- const hasSearch = !!_optionalChain([searchQuery, 'optionalAccess', _181 => _181.trim, 'call', _182 => _182()]);
9900
+ const hasSearch = !!_optionalChain([searchQuery, 'optionalAccess', _182 => _182.trim, 'call', _183 => _183()]);
9864
9901
  const hasList = dialogs.length > 0 || hasSearch;
9865
9902
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
9866
9903
  "div",
@@ -9986,7 +10023,7 @@ var Modal = _react.forwardRef.call(void 0,
9986
10023
  document.removeEventListener("focusin", containFocus);
9987
10024
  const idx = modalStack.lastIndexOf(stackId);
9988
10025
  if (idx !== -1) modalStack.splice(idx, 1);
9989
- _optionalChain([restoreFocusRef, 'access', _183 => _183.current, 'optionalAccess', _184 => _184.focus, 'optionalCall', _185 => _185()]);
10026
+ _optionalChain([restoreFocusRef, 'access', _184 => _184.current, 'optionalAccess', _185 => _185.focus, 'optionalCall', _186 => _186()]);
9990
10027
  };
9991
10028
  }, [isOpen]);
9992
10029
  _react.useEffect.call(void 0, () => {
@@ -10236,7 +10273,7 @@ function ChatDialogModals({
10236
10273
  RenameChatModal,
10237
10274
  {
10238
10275
  isOpen: renameTarget != null,
10239
- initialName: _nullishCoalesce(_optionalChain([renameTarget, 'optionalAccess', _186 => _186.title]), () => ( "")),
10276
+ initialName: _nullishCoalesce(_optionalChain([renameTarget, 'optionalAccess', _187 => _187.title]), () => ( "")),
10240
10277
  onClose: () => setRenameTarget(null),
10241
10278
  onSave: onConfirmRename
10242
10279
  }
@@ -10308,7 +10345,7 @@ function ChatHeaderSearchField({
10308
10345
  const finishCollapse = _react.useCallback.call(void 0, () => {
10309
10346
  if (collapsedRef.current) return;
10310
10347
  collapsedRef.current = true;
10311
- _optionalChain([onCollapse, 'optionalCall', _187 => _187()]);
10348
+ _optionalChain([onCollapse, 'optionalCall', _188 => _188()]);
10312
10349
  }, [onCollapse]);
10313
10350
  const beginCollapse = _react.useCallback.call(void 0, () => {
10314
10351
  setExiting(true);
@@ -10557,8 +10594,8 @@ var ANTHROPIC_SUPPORTED_IMAGE_MIME = ["image/jpeg", "image/png", "image/webp", "
10557
10594
  function buildChatAttachmentViewUrl(viewUrlPrefix, storagePath, viewToken) {
10558
10595
  return `${viewUrlPrefix}${storagePath}?${CHAT_ATTACHMENT_VIEW_TOKEN_QUERY_PARAM}=${encodeURIComponent(viewToken)}`;
10559
10596
  }
10560
- function escapeMarkdownInline(text) {
10561
- return text.replace(/[[\]()\\\n\r<>"]/g, (ch) => {
10597
+ function escapeMarkdownInline(text2) {
10598
+ return text2.replace(/[[\]()\\\n\r<>"]/g, (ch) => {
10562
10599
  switch (ch) {
10563
10600
  case "\n":
10564
10601
  return " ";
@@ -10587,10 +10624,10 @@ var CHAT_ATTACHMENT_MARKDOWN_PATTERN = new RegExp(
10587
10624
  `^\\s*!?\\[[^\\]]*\\]\\(${CHAT_ATTACHMENT_VIEW_URL_PREFIX_REGEX_ESCAPED}[^)]+\\)\\s*$`,
10588
10625
  "gm"
10589
10626
  );
10590
- function stripChatAttachmentMarkdown(text) {
10627
+ function stripChatAttachmentMarkdown(text2) {
10591
10628
  const storagePaths = [];
10592
10629
  const pathExtract = new RegExp(`\\(${CHAT_ATTACHMENT_VIEW_URL_PREFIX_REGEX_ESCAPED}([^?)]+)`);
10593
- const stripped = text.replace(CHAT_ATTACHMENT_MARKDOWN_PATTERN, (match) => {
10630
+ const stripped = text2.replace(CHAT_ATTACHMENT_MARKDOWN_PATTERN, (match) => {
10594
10631
  const m = match.match(pathExtract);
10595
10632
  if (m && m[1]) storagePaths.push(m[1]);
10596
10633
  return "";
@@ -10630,7 +10667,7 @@ function ChatAttachmentAddButton({
10630
10667
  const canAddMore = slotsAvailable > 0 && !disabled;
10631
10668
  const handlePick = () => {
10632
10669
  if (!canAddMore) return;
10633
- _optionalChain([fileInputRef, 'access', _188 => _188.current, 'optionalAccess', _189 => _189.click, 'call', _190 => _190()]);
10670
+ _optionalChain([fileInputRef, 'access', _189 => _189.current, 'optionalAccess', _190 => _190.click, 'call', _191 => _191()]);
10634
10671
  };
10635
10672
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
10636
10673
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -10793,7 +10830,7 @@ function ChatContextMemoryBar({
10793
10830
  _react.useEffect.call(void 0, () => {
10794
10831
  if (!open) return void 0;
10795
10832
  const onOutside = (e) => {
10796
- if (_optionalChain([rootRef, 'access', _191 => _191.current, 'optionalAccess', _192 => _192.contains, 'call', _193 => _193(e.target)])) return;
10833
+ if (_optionalChain([rootRef, 'access', _192 => _192.current, 'optionalAccess', _193 => _193.contains, 'call', _194 => _194(e.target)])) return;
10797
10834
  setOpen(false);
10798
10835
  };
10799
10836
  document.addEventListener("mousedown", onOutside, true);
@@ -11092,7 +11129,7 @@ function ChatComposer({
11092
11129
  const contextEnabled = !!contextPicker && !archived;
11093
11130
  const selected = _nullishCoalesce(selectedContextItems, () => ( []));
11094
11131
  const memory = _nullishCoalesce(contextMemoryItems, () => ( []));
11095
- const entityTypes = _optionalChain([contextPicker, 'optionalAccess', _194 => _194.entityTypes]);
11132
+ const entityTypes = _optionalChain([contextPicker, 'optionalAccess', _195 => _195.entityTypes]);
11096
11133
  const iconByType = _react.useMemo.call(void 0, () => {
11097
11134
  const map = /* @__PURE__ */ new Map();
11098
11135
  for (const t of _nullishCoalesce(entityTypes, () => ( []))) map.set(t.type, t.icon);
@@ -11119,7 +11156,7 @@ function ChatComposer({
11119
11156
  startIcon: contextEnabled ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
11120
11157
  ChatComposerPlusMenu,
11121
11158
  {
11122
- onToggle: () => contextPickerOpen ? _optionalChain([onCloseContextPicker, 'optionalCall', _195 => _195()]) : _optionalChain([onOpenContextPicker, 'optionalCall', _196 => _196()]),
11159
+ onToggle: () => contextPickerOpen ? _optionalChain([onCloseContextPicker, 'optionalCall', _196 => _196()]) : _optionalChain([onOpenContextPicker, 'optionalCall', _197 => _197()]),
11123
11160
  open: contextPickerOpen,
11124
11161
  disabled: attachmentsDisabled,
11125
11162
  dropdown: contextPicker ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -11128,8 +11165,8 @@ function ChatComposer({
11128
11165
  open: contextPickerOpen,
11129
11166
  config: contextPicker,
11130
11167
  selectedItems: selected,
11131
- onToggleItem: (item) => _optionalChain([onToggleContextItem, 'optionalCall', _197 => _197(item)]),
11132
- onClose: () => _optionalChain([onCloseContextPicker, 'optionalCall', _198 => _198()]),
11168
+ onToggleItem: (item) => _optionalChain([onToggleContextItem, 'optionalCall', _198 => _198(item)]),
11169
+ onClose: () => _optionalChain([onCloseContextPicker, 'optionalCall', _199 => _199()]),
11133
11170
  mentionQuery
11134
11171
  }
11135
11172
  ) : void 0
@@ -11320,8 +11357,8 @@ ChatSidebarSkeleton.displayName = "ChatSidebarSkeleton";
11320
11357
  var DialogListItem = _react.forwardRef.call(void 0,
11321
11358
  ({ className, dialog, isActive, onDialogSelect, onClick, ...props }, ref) => {
11322
11359
  const handleClick = (e) => {
11323
- _optionalChain([onDialogSelect, 'optionalCall', _199 => _199(dialog.id)]);
11324
- _optionalChain([onClick, 'optionalCall', _200 => _200(e)]);
11360
+ _optionalChain([onDialogSelect, 'optionalCall', _200 => _200(dialog.id)]);
11361
+ _optionalChain([onClick, 'optionalCall', _201 => _201(e)]);
11325
11362
  };
11326
11363
  const formatTimestamp = (timestamp) => {
11327
11364
  if (!timestamp) return "";
@@ -11400,7 +11437,7 @@ var ChatSidebar = _react.forwardRef.call(void 0,
11400
11437
  (entries) => {
11401
11438
  const [entry] = entries;
11402
11439
  if (entry.isIntersecting && !isFetchingRef.current) {
11403
- _optionalChain([onLoadMoreRef, 'access', _201 => _201.current, 'optionalCall', _202 => _202()]);
11440
+ _optionalChain([onLoadMoreRef, 'access', _202 => _202.current, 'optionalCall', _203 => _203()]);
11404
11441
  }
11405
11442
  },
11406
11443
  { root: scrollContainer, rootMargin: "100px", threshold: 0.1 }
@@ -11528,7 +11565,7 @@ function isForeignOriginHref(href) {
11528
11565
  function runNavigation(runtime, href, path, targetPlatform, fallbackNavigate) {
11529
11566
  const isNewTab = runtime ? _chunkUQEOAPAIcjs.computeIsNewTab.call(void 0, runtime, href, _nullishCoalesce(targetPlatform, () => ( null))) : false;
11530
11567
  if (isNewTab) {
11531
- if (_optionalChain([runtime, 'optionalAccess', _203 => _203.navigation, 'access', _204 => _204.openExternal])) runtime.navigation.openExternal(href);
11568
+ if (_optionalChain([runtime, 'optionalAccess', _204 => _204.navigation, 'access', _205 => _205.openExternal])) runtime.navigation.openExternal(href);
11532
11569
  else window.open(href, "_blank", NEW_TAB_FEATURES);
11533
11570
  return;
11534
11571
  }
@@ -11536,7 +11573,7 @@ function runNavigation(runtime, href, path, targetPlatform, fallbackNavigate) {
11536
11573
  if (target.includes("#") && _chunkYXWGSDK4cjs.navigateSamePageHash.call(void 0, target, { headerOffset: _chunkYXWGSDK4cjs.STICKY_HEADER_OFFSET_PX })) {
11537
11574
  return;
11538
11575
  }
11539
- const handled = _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _205 => _205.navigation, 'access', _206 => _206.navigate, 'optionalCall', _207 => _207({ href, path, targetPlatform })]), () => ( false));
11576
+ const handled = _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _206 => _206.navigation, 'access', _207 => _207.navigate, 'optionalCall', _208 => _208({ href, path, targetPlatform })]), () => ( false));
11540
11577
  if (!handled) {
11541
11578
  if (fallbackNavigate) fallbackNavigate(target);
11542
11579
  else window.location.assign(target);
@@ -11595,7 +11632,7 @@ function NavLinkAnchorViaRuntime({
11595
11632
  targetPlatform,
11596
11633
  fallbackNavigate: router.push
11597
11634
  });
11598
- if (handled && !isNewTab && _optionalChain([panel, 'optionalAccess', _208 => _208.closeChat])) panel.closeChat();
11635
+ if (handled && !isNewTab && _optionalChain([panel, 'optionalAccess', _209 => _209.closeChat])) panel.closeChat();
11599
11636
  };
11600
11637
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "a", { href: resolvedHref, ..._chunkUQEOAPAIcjs.newTabAnchorAttrs.call(void 0, isNewTab), onClick, className, children });
11601
11638
  }
@@ -11661,11 +11698,11 @@ var DEFAULT_CAPTIONS_PATH = "/api/captions";
11661
11698
  function getCaptionsUrl(entityType, entityId, srtContent, options) {
11662
11699
  if (!srtContent) return void 0;
11663
11700
  const hash = `${srtContent.length}-${srtContent.slice(0, 8).replace(/\s/g, "")}`;
11664
- const variant = _optionalChain([options, 'optionalAccess', _209 => _209.variant]) ? `&variant=${options.variant}` : "";
11701
+ const variant = _optionalChain([options, 'optionalAccess', _210 => _210.variant]) ? `&variant=${options.variant}` : "";
11665
11702
  return `${DEFAULT_CAPTIONS_PATH}/${entityType}/${entityId}?v=${hash}${variant}`;
11666
11703
  }
11667
11704
  function resolveCaptionsBase(endpoints) {
11668
- return _optionalChain([endpoints, 'optionalAccess', _210 => _210.captionsUrlPrefix]) || DEFAULT_CAPTIONS_PATH;
11705
+ return _optionalChain([endpoints, 'optionalAccess', _211 => _211.captionsUrlPrefix]) || DEFAULT_CAPTIONS_PATH;
11669
11706
  }
11670
11707
  function rebaseCaptionsUrl(endpoints, url) {
11671
11708
  if (!url || !url.startsWith(`${DEFAULT_CAPTIONS_PATH}/`)) return url;
@@ -11775,7 +11812,7 @@ TabsContent.displayName = TabsPrimitive.Content.displayName;
11775
11812
  // src/components/features/use-captions.ts
11776
11813
 
11777
11814
  function useCaptions() {
11778
- const endpoints = _nullishCoalesce(_optionalChain([_chunkUPKZU6QUcjs.useChatRuntime.call(void 0, ), 'optionalAccess', _211 => _211.endpoints]), () => ( null));
11815
+ const endpoints = _nullishCoalesce(_optionalChain([_chunkUPKZU6QUcjs.useChatRuntime.call(void 0, ), 'optionalAccess', _212 => _212.endpoints]), () => ( null));
11779
11816
  return _react.useMemo.call(void 0,
11780
11817
  () => ({
11781
11818
  forEntity: (entityType, entity) => getEntityCaptionUrls(endpoints, entityType, entity),
@@ -11804,11 +11841,11 @@ function fetchPriorityProp(priority) {
11804
11841
  var ENTER_FULLSCREEN_REQUEST = "mediaenterfullscreenrequest";
11805
11842
  function isIosAppShell() {
11806
11843
  const capacitor = globalThis.Capacitor;
11807
- return _optionalChain([capacitor, 'optionalAccess', _212 => _212.isNativePlatform, 'optionalCall', _213 => _213()]) === true && _optionalChain([capacitor, 'access', _214 => _214.getPlatform, 'optionalCall', _215 => _215()]) === "ios";
11844
+ return _optionalChain([capacitor, 'optionalAccess', _213 => _213.isNativePlatform, 'optionalCall', _214 => _214()]) === true && _optionalChain([capacitor, 'access', _215 => _215.getPlatform, 'optionalCall', _216 => _216()]) === "ios";
11808
11845
  }
11809
11846
  function nativeVideoElement(player) {
11810
11847
  const media = player.media;
11811
- const element = _nullishCoalesce(_optionalChain([media, 'optionalAccess', _216 => _216.nativeEl]), () => ( media));
11848
+ const element = _nullishCoalesce(_optionalChain([media, 'optionalAccess', _217 => _217.nativeEl]), () => ( media));
11812
11849
  return element instanceof HTMLVideoElement ? element : null;
11813
11850
  }
11814
11851
  function useIosNativeVideoFullscreen(playerRef) {
@@ -11818,7 +11855,7 @@ function useIosNativeVideoFullscreen(playerRef) {
11818
11855
  if (!(player instanceof EventTarget)) return void 0;
11819
11856
  const takeOver = (event) => {
11820
11857
  const video = nativeVideoElement(player);
11821
- if (!_optionalChain([video, 'optionalAccess', _217 => _217.webkitSupportsFullscreen]) || typeof video.webkitEnterFullscreen !== "function") return;
11858
+ if (!_optionalChain([video, 'optionalAccess', _218 => _218.webkitSupportsFullscreen]) || typeof video.webkitEnterFullscreen !== "function") return;
11822
11859
  event.stopImmediatePropagation();
11823
11860
  video.webkitEnterFullscreen();
11824
11861
  };
@@ -11852,11 +11889,11 @@ function toMuxPreviewUrl(url, maxResolution = "720p") {
11852
11889
  function saveDataEnabled() {
11853
11890
  if (typeof navigator === "undefined") return false;
11854
11891
  const conn = navigator.connection;
11855
- return _optionalChain([conn, 'optionalAccess', _218 => _218.saveData]) === true;
11892
+ return _optionalChain([conn, 'optionalAccess', _219 => _219.saveData]) === true;
11856
11893
  }
11857
11894
  function useVideoOriginPreconnect({ supabaseStorageOrigin } = {}) {
11858
11895
  const runtime = _chunkUPKZU6QUcjs.useChatRuntime.call(void 0, );
11859
- const resolvedOrigin = _nullishCoalesce(supabaseStorageOrigin, () => ( _optionalChain([runtime, 'optionalAccess', _219 => _219.endpoints, 'access', _220 => _220.supabaseStorageOrigin])));
11896
+ const resolvedOrigin = _nullishCoalesce(supabaseStorageOrigin, () => ( _optionalChain([runtime, 'optionalAccess', _220 => _220.endpoints, 'access', _221 => _221.supabaseStorageOrigin])));
11860
11897
  try {
11861
11898
  _reactdom2.default.preconnect(MUX_STREAM_ORIGIN, { crossOrigin: "anonymous" });
11862
11899
  _reactdom2.default.preconnect(MUX_IMAGE_ORIGIN, { crossOrigin: "anonymous" });
@@ -11875,7 +11912,7 @@ function useVideoWarmup({
11875
11912
  nearMargin = "1000px"
11876
11913
  } = {}) {
11877
11914
  const runtime = _chunkUPKZU6QUcjs.useChatRuntime.call(void 0, );
11878
- const resolvedOrigin = _nullishCoalesce(supabaseStorageOrigin, () => ( _optionalChain([runtime, 'optionalAccess', _221 => _221.endpoints, 'access', _222 => _222.supabaseStorageOrigin])));
11915
+ const resolvedOrigin = _nullishCoalesce(supabaseStorageOrigin, () => ( _optionalChain([runtime, 'optionalAccess', _222 => _222.endpoints, 'access', _223 => _223.supabaseStorageOrigin])));
11879
11916
  useVideoOriginPreconnect({ supabaseStorageOrigin: resolvedOrigin });
11880
11917
  const { ref, isNear } = _chunkYXWGSDK4cjs.useNearViewport.call(void 0, nearMargin);
11881
11918
  _react.useEffect.call(void 0, () => {
@@ -11977,7 +12014,7 @@ if (typeof document !== "undefined") {
11977
12014
  }
11978
12015
  if (typeof window !== "undefined") {
11979
12016
  const w = window;
11980
- if (!_optionalChain([w, 'access', _223 => _223.chrome, 'optionalAccess', _224 => _224.cast])) {
12017
+ if (!_optionalChain([w, 'access', _224 => _224.chrome, 'optionalAccess', _225 => _225.cast])) {
11981
12018
  w.chrome = { ..._nullishCoalesce(w.chrome, () => ( {})), cast: { isAvailable: false } };
11982
12019
  }
11983
12020
  }
@@ -12233,7 +12270,7 @@ function FilePlayer({
12233
12270
  const clearPerfListener = _react.useCallback.call(void 0, () => {
12234
12271
  if (perfListenerRef.current) {
12235
12272
  try {
12236
- _optionalChain([hoverPlayerRef, 'access', _225 => _225.current, 'optionalAccess', _226 => _226.removeEventListener, 'optionalCall', _227 => _227("playing", perfListenerRef.current)]);
12273
+ _optionalChain([hoverPlayerRef, 'access', _226 => _226.current, 'optionalAccess', _227 => _227.removeEventListener, 'optionalCall', _228 => _228("playing", perfListenerRef.current)]);
12237
12274
  } catch (e21) {
12238
12275
  }
12239
12276
  perfListenerRef.current = null;
@@ -12268,7 +12305,7 @@ function FilePlayer({
12268
12305
  };
12269
12306
  perfListenerRef.current = onPlaying;
12270
12307
  try {
12271
- _optionalChain([el, 'access', _228 => _228.addEventListener, 'optionalCall', _229 => _229("playing", onPlaying)]);
12308
+ _optionalChain([el, 'access', _229 => _229.addEventListener, 'optionalCall', _230 => _230("playing", onPlaying)]);
12272
12309
  } catch (e22) {
12273
12310
  }
12274
12311
  }
@@ -12276,12 +12313,12 @@ function FilePlayer({
12276
12313
  el.volume = 0.5;
12277
12314
  if (userHasInteracted) {
12278
12315
  el.muted = mutedIntentRef.current;
12279
- _optionalChain([el, 'access', _230 => _230.play, 'optionalCall', _231 => _231(), 'optionalAccess', _232 => _232.catch, 'optionalCall', _233 => _233((err) => {
12280
- const name = _optionalChain([err, 'optionalAccess', _234 => _234.name]);
12316
+ _optionalChain([el, 'access', _231 => _231.play, 'optionalCall', _232 => _232(), 'optionalAccess', _233 => _233.catch, 'optionalCall', _234 => _234((err) => {
12317
+ const name = _optionalChain([err, 'optionalAccess', _235 => _235.name]);
12281
12318
  if (name === "NotAllowedError" && hoverActiveRef.current && generation === hoverGenerationRef.current) {
12282
12319
  try {
12283
12320
  el.muted = true;
12284
- _optionalChain([el, 'access', _235 => _235.play, 'optionalCall', _236 => _236(), 'optionalAccess', _237 => _237.catch, 'optionalCall', _238 => _238(() => {
12321
+ _optionalChain([el, 'access', _236 => _236.play, 'optionalCall', _237 => _237(), 'optionalAccess', _238 => _238.catch, 'optionalCall', _239 => _239(() => {
12285
12322
  if (hoverActiveRef.current && generation === hoverGenerationRef.current) {
12286
12323
  setMutedFallbackBlocked(true);
12287
12324
  }
@@ -12293,7 +12330,7 @@ function FilePlayer({
12293
12330
  })]);
12294
12331
  } else {
12295
12332
  el.muted = true;
12296
- _optionalChain([el, 'access', _239 => _239.play, 'optionalCall', _240 => _240(), 'optionalAccess', _241 => _241.catch, 'optionalCall', _242 => _242(() => {
12333
+ _optionalChain([el, 'access', _240 => _240.play, 'optionalCall', _241 => _241(), 'optionalAccess', _242 => _242.catch, 'optionalCall', _243 => _243(() => {
12297
12334
  if (hoverActiveRef.current && generation === hoverGenerationRef.current) {
12298
12335
  setMutedFallbackBlocked(true);
12299
12336
  }
@@ -12323,7 +12360,7 @@ function FilePlayer({
12323
12360
  clearActivationWaiter();
12324
12361
  clearPerfListener();
12325
12362
  try {
12326
- _optionalChain([hoverPlayerRef, 'access', _243 => _243.current, 'optionalAccess', _244 => _244.pause, 'optionalCall', _245 => _245()]);
12363
+ _optionalChain([hoverPlayerRef, 'access', _244 => _244.current, 'optionalAccess', _245 => _245.pause, 'optionalCall', _246 => _246()]);
12327
12364
  } catch (e26) {
12328
12365
  }
12329
12366
  }, [clearActivationWaiter, clearPerfListener]);
@@ -12335,7 +12372,7 @@ function FilePlayer({
12335
12372
  if (el) {
12336
12373
  el.muted = false;
12337
12374
  el.volume = 0.5;
12338
- _optionalChain([el, 'access', _246 => _246.play, 'optionalCall', _247 => _247(), 'optionalAccess', _248 => _248.catch, 'optionalCall', _249 => _249(() => {
12375
+ _optionalChain([el, 'access', _247 => _247.play, 'optionalCall', _248 => _248(), 'optionalAccess', _249 => _249.catch, 'optionalCall', _250 => _250(() => {
12339
12376
  })]);
12340
12377
  }
12341
12378
  } catch (e27) {
@@ -12355,7 +12392,7 @@ function FilePlayer({
12355
12392
  onMutedFallbackChangeRef.current = onMutedFallbackChange;
12356
12393
  });
12357
12394
  _react.useEffect.call(void 0, () => {
12358
- _optionalChain([onMutedFallbackChangeRef, 'access', _250 => _250.current, 'optionalCall', _251 => _251({
12395
+ _optionalChain([onMutedFallbackChangeRef, 'access', _251 => _251.current, 'optionalCall', _252 => _252({
12359
12396
  muted: hoverMutedFallback,
12360
12397
  blocked: hoverMutedFallback && mutedFallbackBlocked
12361
12398
  })]);
@@ -12374,7 +12411,7 @@ function FilePlayer({
12374
12411
  if (autoPlay) {
12375
12412
  const reportBlocked = () => setMutedFallbackBlocked(true);
12376
12413
  try {
12377
- _optionalChain([mutedEl, 'access', _252 => _252.play, 'optionalCall', _253 => _253(), 'optionalAccess', _254 => _254.catch, 'optionalCall', _255 => _255(reportBlocked)]);
12414
+ _optionalChain([mutedEl, 'access', _253 => _253.play, 'optionalCall', _254 => _254(), 'optionalAccess', _255 => _255.catch, 'optionalCall', _256 => _256(reportBlocked)]);
12378
12415
  } catch (e29) {
12379
12416
  reportBlocked();
12380
12417
  }
@@ -12388,12 +12425,12 @@ function FilePlayer({
12388
12425
  try {
12389
12426
  el.muted = false;
12390
12427
  el.volume = typeof el.volume === "number" ? el.volume : 1;
12391
- _optionalChain([el, 'access', _256 => _256.play, 'optionalCall', _257 => _257(), 'optionalAccess', _258 => _258.catch, 'optionalCall', _259 => _259((err) => {
12392
- const name = _optionalChain([err, 'optionalAccess', _260 => _260.name]);
12428
+ _optionalChain([el, 'access', _257 => _257.play, 'optionalCall', _258 => _258(), 'optionalAccess', _259 => _259.catch, 'optionalCall', _260 => _260((err) => {
12429
+ const name = _optionalChain([err, 'optionalAccess', _261 => _261.name]);
12393
12430
  if (name !== "NotAllowedError") return;
12394
12431
  try {
12395
12432
  el.muted = true;
12396
- _optionalChain([el, 'access', _261 => _261.play, 'optionalCall', _262 => _262(), 'optionalAccess', _263 => _263.catch, 'optionalCall', _264 => _264(() => {
12433
+ _optionalChain([el, 'access', _262 => _262.play, 'optionalCall', _263 => _263(), 'optionalAccess', _264 => _264.catch, 'optionalCall', _265 => _265(() => {
12397
12434
  setMutedFallbackBlocked(true);
12398
12435
  setHoverMutedFallback(true);
12399
12436
  })]);
@@ -12409,7 +12446,7 @@ function FilePlayer({
12409
12446
  }, [autoPlayUnmuted, startMuted, autoPlay]);
12410
12447
  _react.useEffect.call(void 0, () => {
12411
12448
  const el = hoverPlayerRef.current;
12412
- if (!_optionalChain([el, 'optionalAccess', _265 => _265.addEventListener])) return void 0;
12449
+ if (!_optionalChain([el, 'optionalAccess', _266 => _266.addEventListener])) return void 0;
12413
12450
  const onVolumeChange = () => {
12414
12451
  if (el.muted === false) {
12415
12452
  setMutedFallbackBlocked(false);
@@ -12422,14 +12459,14 @@ function FilePlayer({
12422
12459
  }
12423
12460
  return () => {
12424
12461
  try {
12425
- _optionalChain([el, 'access', _266 => _266.removeEventListener, 'optionalCall', _267 => _267("volumechange", onVolumeChange)]);
12462
+ _optionalChain([el, 'access', _267 => _267.removeEventListener, 'optionalCall', _268 => _268("volumechange", onVolumeChange)]);
12426
12463
  } catch (e33) {
12427
12464
  }
12428
12465
  };
12429
12466
  }, []);
12430
12467
  _react.useEffect.call(void 0, () => {
12431
12468
  const el = hoverPlayerRef.current;
12432
- if (!_optionalChain([el, 'optionalAccess', _268 => _268.addEventListener])) return void 0;
12469
+ if (!_optionalChain([el, 'optionalAccess', _269 => _269.addEventListener])) return void 0;
12433
12470
  const onPlaying = () => setMutedFallbackBlocked(false);
12434
12471
  try {
12435
12472
  el.addEventListener("playing", onPlaying);
@@ -12437,7 +12474,7 @@ function FilePlayer({
12437
12474
  }
12438
12475
  return () => {
12439
12476
  try {
12440
- _optionalChain([el, 'access', _269 => _269.removeEventListener, 'optionalCall', _270 => _270("playing", onPlaying)]);
12477
+ _optionalChain([el, 'access', _270 => _270.removeEventListener, 'optionalCall', _271 => _271("playing", onPlaying)]);
12441
12478
  } catch (e35) {
12442
12479
  }
12443
12480
  };
@@ -12448,15 +12485,15 @@ function FilePlayer({
12448
12485
  });
12449
12486
  _react.useEffect.call(void 0, () => {
12450
12487
  const el = hoverPlayerRef.current;
12451
- if (!_optionalChain([el, 'optionalAccess', _271 => _271.addEventListener])) return void 0;
12452
- const handler = () => _optionalChain([onEndedRef, 'access', _272 => _272.current, 'optionalCall', _273 => _273()]);
12488
+ if (!_optionalChain([el, 'optionalAccess', _272 => _272.addEventListener])) return void 0;
12489
+ const handler = () => _optionalChain([onEndedRef, 'access', _273 => _273.current, 'optionalCall', _274 => _274()]);
12453
12490
  try {
12454
12491
  el.addEventListener("ended", handler);
12455
12492
  } catch (e36) {
12456
12493
  }
12457
12494
  return () => {
12458
12495
  try {
12459
- _optionalChain([el, 'access', _274 => _274.removeEventListener, 'optionalCall', _275 => _275("ended", handler)]);
12496
+ _optionalChain([el, 'access', _275 => _275.removeEventListener, 'optionalCall', _276 => _276("ended", handler)]);
12460
12497
  } catch (e37) {
12461
12498
  }
12462
12499
  };
@@ -12465,19 +12502,19 @@ function FilePlayer({
12465
12502
  _react.useImperativeHandle.call(void 0,
12466
12503
  playerHandleRef,
12467
12504
  () => ({
12468
- getCurrentTime: () => _nullishCoalesce(_optionalChain([hoverPlayerRef, 'access', _276 => _276.current, 'optionalAccess', _277 => _277.currentTime]), () => ( 0)),
12505
+ getCurrentTime: () => _nullishCoalesce(_optionalChain([hoverPlayerRef, 'access', _277 => _277.current, 'optionalAccess', _278 => _278.currentTime]), () => ( 0)),
12469
12506
  getDuration: () => {
12470
- const d = _optionalChain([hoverPlayerRef, 'access', _278 => _278.current, 'optionalAccess', _279 => _279.duration]);
12507
+ const d = _optionalChain([hoverPlayerRef, 'access', _279 => _279.current, 'optionalAccess', _280 => _280.duration]);
12471
12508
  return typeof d === "number" && isFinite(d) ? d : 0;
12472
12509
  },
12473
- getPaused: () => _nullishCoalesce(_optionalChain([hoverPlayerRef, 'access', _280 => _280.current, 'optionalAccess', _281 => _281.paused]), () => ( true)),
12474
- getMuted: () => _nullishCoalesce(_optionalChain([hoverPlayerRef, 'access', _282 => _282.current, 'optionalAccess', _283 => _283.muted]), () => ( false)),
12510
+ getPaused: () => _nullishCoalesce(_optionalChain([hoverPlayerRef, 'access', _281 => _281.current, 'optionalAccess', _282 => _282.paused]), () => ( true)),
12511
+ getMuted: () => _nullishCoalesce(_optionalChain([hoverPlayerRef, 'access', _283 => _283.current, 'optionalAccess', _284 => _284.muted]), () => ( false)),
12475
12512
  play: async () => {
12476
- await _optionalChain([hoverPlayerRef, 'access', _284 => _284.current, 'optionalAccess', _285 => _285.play, 'optionalCall', _286 => _286()]);
12513
+ await _optionalChain([hoverPlayerRef, 'access', _285 => _285.current, 'optionalAccess', _286 => _286.play, 'optionalCall', _287 => _287()]);
12477
12514
  },
12478
12515
  pause: () => {
12479
12516
  try {
12480
- _optionalChain([hoverPlayerRef, 'access', _287 => _287.current, 'optionalAccess', _288 => _288.pause, 'optionalCall', _289 => _289()]);
12517
+ _optionalChain([hoverPlayerRef, 'access', _288 => _288.current, 'optionalAccess', _289 => _289.pause, 'optionalCall', _290 => _290()]);
12481
12518
  } catch (e38) {
12482
12519
  }
12483
12520
  },
@@ -12544,10 +12581,10 @@ function FilePlayer({
12544
12581
  if (!el) return;
12545
12582
  const resumeAt = typeof el.currentTime === "number" ? el.currentTime : 0;
12546
12583
  try {
12547
- _optionalChain([el, 'access', _290 => _290.load, 'optionalCall', _291 => _291()]);
12584
+ _optionalChain([el, 'access', _291 => _291.load, 'optionalCall', _292 => _292()]);
12548
12585
  if (resumeAt > 0 && el.addEventListener && el.removeEventListener) {
12549
12586
  const seekBack = () => {
12550
- _optionalChain([el, 'access', _292 => _292.removeEventListener, 'optionalCall', _293 => _293("loadedmetadata", seekBack)]);
12587
+ _optionalChain([el, 'access', _293 => _293.removeEventListener, 'optionalCall', _294 => _294("loadedmetadata", seekBack)]);
12551
12588
  try {
12552
12589
  el.currentTime = resumeAt;
12553
12590
  } catch (e40) {
@@ -12555,7 +12592,7 @@ function FilePlayer({
12555
12592
  };
12556
12593
  el.addEventListener("loadedmetadata", seekBack);
12557
12594
  }
12558
- _optionalChain([el, 'access', _294 => _294.play, 'optionalCall', _295 => _295(), 'optionalAccess', _296 => _296.catch, 'optionalCall', _297 => _297(() => {
12595
+ _optionalChain([el, 'access', _295 => _295.play, 'optionalCall', _296 => _296(), 'optionalAccess', _297 => _297.catch, 'optionalCall', _298 => _298(() => {
12559
12596
  })]);
12560
12597
  } catch (e41) {
12561
12598
  }
@@ -12714,7 +12751,7 @@ function YouTubeFacadeInner({
12714
12751
  const iframe = iframeRef.current;
12715
12752
  if (!iframe) return void 0;
12716
12753
  function subscribe2() {
12717
- _optionalChain([iframe, 'optionalAccess', _298 => _298.contentWindow, 'optionalAccess', _299 => _299.postMessage, 'call', _300 => _300('{"event":"listening"}', YT_NOCOOKIE_ORIGIN)]);
12754
+ _optionalChain([iframe, 'optionalAccess', _299 => _299.contentWindow, 'optionalAccess', _300 => _300.postMessage, 'call', _301 => _301('{"event":"listening"}', YT_NOCOOKIE_ORIGIN)]);
12718
12755
  }
12719
12756
  iframe.addEventListener("load", subscribe2);
12720
12757
  subscribe2();
@@ -12735,13 +12772,13 @@ function YouTubeFacadeInner({
12735
12772
  return;
12736
12773
  }
12737
12774
  if (payload.event !== "infoDelivery") return;
12738
- const state = _optionalChain([payload, 'access', _301 => _301.info, 'optionalAccess', _302 => _302.playerState]);
12775
+ const state = _optionalChain([payload, 'access', _302 => _302.info, 'optionalAccess', _303 => _303.playerState]);
12739
12776
  if (typeof state !== "number") return;
12740
12777
  if (state === YT_STATE_PLAYING) {
12741
12778
  if (blurTimer !== null) return;
12742
12779
  blurTimer = setTimeout(() => {
12743
12780
  blurTimer = null;
12744
- _optionalChain([iframeRef, 'access', _303 => _303.current, 'optionalAccess', _304 => _304.blur, 'call', _305 => _305()]);
12781
+ _optionalChain([iframeRef, 'access', _304 => _304.current, 'optionalAccess', _305 => _305.blur, 'call', _306 => _306()]);
12745
12782
  }, YT_PLAYING_BLUR_DELAY_MS);
12746
12783
  return;
12747
12784
  }
@@ -12762,7 +12799,7 @@ function YouTubeFacadeInner({
12762
12799
  prevSuspendedRef.current = Boolean(suspended);
12763
12800
  if (!activated) return;
12764
12801
  if (suspended && !wasSuspended) {
12765
- _optionalChain([iframeRef, 'access', _306 => _306.current, 'optionalAccess', _307 => _307.contentWindow, 'optionalAccess', _308 => _308.postMessage, 'call', _309 => _309(
12802
+ _optionalChain([iframeRef, 'access', _307 => _307.current, 'optionalAccess', _308 => _308.contentWindow, 'optionalAccess', _309 => _309.postMessage, 'call', _310 => _310(
12766
12803
  '{"event":"command","func":"pauseVideo","args":[]}',
12767
12804
  YT_NOCOOKIE_ORIGIN
12768
12805
  )]);
@@ -13016,7 +13053,7 @@ function CardsStrip(props) {
13016
13053
  _react.useEffect.call(void 0, () => {
13017
13054
  const el = wrapperRef.current;
13018
13055
  if (!el || typeof IntersectionObserver === "undefined") return void 0;
13019
- const io = new IntersectionObserver((entries) => setNearViewport(_nullishCoalesce(_optionalChain([entries, 'access', _310 => _310[0], 'optionalAccess', _311 => _311.isIntersecting]), () => ( true))), {
13056
+ const io = new IntersectionObserver((entries) => setNearViewport(_nullishCoalesce(_optionalChain([entries, 'access', _311 => _311[0], 'optionalAccess', _312 => _312.isIntersecting]), () => ( true))), {
13020
13057
  rootMargin: "200px"
13021
13058
  });
13022
13059
  io.observe(el);
@@ -13038,9 +13075,9 @@ function CardsStrip(props) {
13038
13075
  const p = hoverPointerRef.current;
13039
13076
  if (!p.inside) return;
13040
13077
  const el = typeof document !== "undefined" ? document.elementFromPoint(p.x, p.y) : null;
13041
- const cardEl = _optionalChain([el, 'optionalAccess', _312 => _312.closest, 'optionalCall', _313 => _313("[data-strip-card-key]")]);
13042
- const scoped = cardEl && _optionalChain([scrollerRef, 'access', _314 => _314.current, 'optionalAccess', _315 => _315.contains, 'call', _316 => _316(cardEl)]) ? cardEl : null;
13043
- const key = _nullishCoalesce(_optionalChain([scoped, 'optionalAccess', _317 => _317.getAttribute, 'call', _318 => _318("data-strip-card-key")]), () => ( null));
13078
+ const cardEl = _optionalChain([el, 'optionalAccess', _313 => _313.closest, 'optionalCall', _314 => _314("[data-strip-card-key]")]);
13079
+ const scoped = cardEl && _optionalChain([scrollerRef, 'access', _315 => _315.current, 'optionalAccess', _316 => _316.contains, 'call', _317 => _317(cardEl)]) ? cardEl : null;
13080
+ const key = _nullishCoalesce(_optionalChain([scoped, 'optionalAccess', _318 => _318.getAttribute, 'call', _319 => _319("data-strip-card-key")]), () => ( null));
13044
13081
  const current = activeKeyRef.current;
13045
13082
  if (key === current) return;
13046
13083
  if (current !== null) deactivate(current);
@@ -13078,7 +13115,7 @@ function CardsStrip(props) {
13078
13115
  }, [syncHoverToPointer]);
13079
13116
  const seamBuffer = _react.useCallback.call(void 0, () => {
13080
13117
  const half = singleCopyWidthRef.current;
13081
- const viewport = _nullishCoalesce(_optionalChain([scrollerRef, 'access', _319 => _319.current, 'optionalAccess', _320 => _320.clientWidth]), () => ( 0));
13118
+ const viewport = _nullishCoalesce(_optionalChain([scrollerRef, 'access', _320 => _320.current, 'optionalAccess', _321 => _321.clientWidth]), () => ( 0));
13082
13119
  return Math.max(0, Math.min(200, half / 4, half - viewport - TRACK_GAP_PX - 1));
13083
13120
  }, []);
13084
13121
  const { posRef: marqueePosRef, glideBy } = _chunkYXWGSDK4cjs.useMarqueeEngine.call(void 0, {
@@ -13094,7 +13131,7 @@ function CardsStrip(props) {
13094
13131
  const scroller = scrollerRef.current;
13095
13132
  if (scroller) scroller.scrollLeft = pos;
13096
13133
  },
13097
- readBack: () => _nullishCoalesce(_optionalChain([scrollerRef, 'access', _321 => _321.current, 'optionalAccess', _322 => _322.scrollLeft]), () => ( 0)),
13134
+ readBack: () => _nullishCoalesce(_optionalChain([scrollerRef, 'access', _322 => _322.current, 'optionalAccess', _323 => _323.scrollLeft]), () => ( 0)),
13098
13135
  onAfterFrame: syncHoverIfScrolled
13099
13136
  });
13100
13137
  const [mountedIdx, setMountedIdx] = _react.useState.call(void 0, () => /* @__PURE__ */ new Set());
@@ -13142,11 +13179,11 @@ function CardsStrip(props) {
13142
13179
  fn = (el) => {
13143
13180
  if (!el) return void 0;
13144
13181
  cardElIdxRef.current.set(el, idx);
13145
- _optionalChain([cardObserverRef, 'access', _323 => _323.current, 'optionalAccess', _324 => _324.observe, 'call', _325 => _325(el)]);
13182
+ _optionalChain([cardObserverRef, 'access', _324 => _324.current, 'optionalAccess', _325 => _325.observe, 'call', _326 => _326(el)]);
13146
13183
  return () => {
13147
13184
  cardElIdxRef.current.delete(el);
13148
13185
  cardElNearRef.current.delete(el);
13149
- _optionalChain([cardObserverRef, 'access', _326 => _326.current, 'optionalAccess', _327 => _327.unobserve, 'call', _328 => _328(el)]);
13186
+ _optionalChain([cardObserverRef, 'access', _327 => _327.current, 'optionalAccess', _328 => _328.unobserve, 'call', _329 => _329(el)]);
13150
13187
  };
13151
13188
  };
13152
13189
  cardRefFns.set(idx, fn);
@@ -13165,7 +13202,7 @@ function CardsStrip(props) {
13165
13202
  const track = trackRef.current;
13166
13203
  if (!scroller || !track) return;
13167
13204
  const firstCard = track.firstElementChild;
13168
- const step = (_nullishCoalesce(_optionalChain([firstCard, 'optionalAccess', _329 => _329.offsetWidth]), () => ( 320))) + TRACK_GAP_PX;
13205
+ const step = (_nullishCoalesce(_optionalChain([firstCard, 'optionalAccess', _330 => _330.offsetWidth]), () => ( 320))) + TRACK_GAP_PX;
13169
13206
  chevronSuppressUntilRef.current = performance.now() + CHEVRON_SUPPRESS_MS;
13170
13207
  if (marqueeActiveRef.current) {
13171
13208
  glideBy(dir * step);
@@ -13222,7 +13259,7 @@ function CardsStrip(props) {
13222
13259
  {
13223
13260
  ref: (node) => {
13224
13261
  wrapperRef.current = node;
13225
- _optionalChain([rootRef, 'optionalCall', _330 => _330(node)]);
13262
+ _optionalChain([rootRef, 'optionalCall', _331 => _331(node)]);
13226
13263
  },
13227
13264
  className: _chunk23V5BSHDcjs.cn.call(void 0, "flex w-full min-w-0 flex-col gap-6", className),
13228
13265
  children: [
@@ -13334,7 +13371,7 @@ function VideoHoverPreviewSurface({
13334
13371
  if (gateControlled) return void 0;
13335
13372
  const el = rootElRef.current;
13336
13373
  if (!el || typeof IntersectionObserver === "undefined") return void 0;
13337
- const io = new IntersectionObserver((entries) => setIsNear(_nullishCoalesce(_optionalChain([entries, 'access', _331 => _331[0], 'optionalAccess', _332 => _332.isIntersecting]), () => ( false))), {
13374
+ const io = new IntersectionObserver((entries) => setIsNear(_nullishCoalesce(_optionalChain([entries, 'access', _332 => _332[0], 'optionalAccess', _333 => _333.isIntersecting]), () => ( false))), {
13338
13375
  rootMargin: _chunkYXWGSDK4cjs.NEAR_VIEWPORT_ROOT_MARGIN
13339
13376
  });
13340
13377
  io.observe(el);
@@ -13479,7 +13516,7 @@ function VideoBitesStrip({
13479
13516
  const filtered = filterPublished ? bites.filter((b) => b.published) : [...bites];
13480
13517
  return filtered.sort(sortComparator);
13481
13518
  }, [bites, filterPublished, sortComparator]);
13482
- const warmup = useVideoWarmup({ videoUrl: _optionalChain([items, 'access', _333 => _333[0], 'optionalAccess', _334 => _334.url]) || null });
13519
+ const warmup = useVideoWarmup({ videoUrl: _optionalChain([items, 'access', _334 => _334[0], 'optionalAccess', _335 => _335.url]) || null });
13483
13520
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
13484
13521
  CardsStrip,
13485
13522
  {
@@ -13546,8 +13583,8 @@ function VideoBiteCard({
13546
13583
  const controlled = active !== void 0;
13547
13584
  const [selfActive, setSelfActive] = _react.useState.call(void 0, false);
13548
13585
  const isActive = controlled ? !!active : selfActive;
13549
- const activate = () => controlled ? _optionalChain([onActivate, 'optionalCall', _335 => _335(key)]) : setSelfActive(true);
13550
- const deactivate = () => controlled ? _optionalChain([onDeactivate, 'optionalCall', _336 => _336(key)]) : setSelfActive(false);
13586
+ const activate = () => controlled ? _optionalChain([onActivate, 'optionalCall', _336 => _336(key)]) : setSelfActive(true);
13587
+ const deactivate = () => controlled ? _optionalChain([onDeactivate, 'optionalCall', _337 => _337(key)]) : setSelfActive(false);
13551
13588
  const titleInputRef = _react.useRef.call(void 0, null);
13552
13589
  _chunkYXWGSDK4cjs.useIsomorphicLayoutEffect.call(void 0, () => {
13553
13590
  const el = titleInputRef.current;
@@ -13557,7 +13594,7 @@ function VideoBiteCard({
13557
13594
  });
13558
13595
  const navigate = () => {
13559
13596
  if (bite.onNavigate) bite.onNavigate();
13560
- else _optionalChain([onBiteNavigate, 'optionalCall', _337 => _337(bite, index)]);
13597
+ else _optionalChain([onBiteNavigate, 'optionalCall', _338 => _338(bite, index)]);
13561
13598
  };
13562
13599
  const handlePointerEnter = () => {
13563
13600
  if (!isTouch) activate();
@@ -13582,9 +13619,9 @@ function VideoBiteCard({
13582
13619
  placeholder: "Title (optional)",
13583
13620
  "aria-label": "Bite title",
13584
13621
  rows: 1,
13585
- onChange: (e) => _optionalChain([onTitleChange, 'optionalCall', _338 => _338(e.target.value)]),
13622
+ onChange: (e) => _optionalChain([onTitleChange, 'optionalCall', _339 => _339(e.target.value)]),
13586
13623
  ref: titleInputRef,
13587
- onBlur: (e) => _optionalChain([onTitleCommit, 'optionalCall', _339 => _339(e.target.value)]),
13624
+ onBlur: (e) => _optionalChain([onTitleCommit, 'optionalCall', _340 => _340(e.target.value)]),
13588
13625
  onClick: (e) => e.stopPropagation(),
13589
13626
  className: _chunk23V5BSHDcjs.cn.call(void 0,
13590
13627
  titleClass,
@@ -13661,7 +13698,7 @@ function VideoBiteCard({
13661
13698
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
13662
13699
  "div",
13663
13700
  {
13664
- ref: (node) => _optionalChain([rootRef, 'optionalCall', _340 => _340(node)]),
13701
+ ref: (node) => _optionalChain([rootRef, 'optionalCall', _341 => _341(node)]),
13665
13702
  "aria-hidden": isClone || void 0,
13666
13703
  "data-strip-card-key": key,
13667
13704
  className: _chunk23V5BSHDcjs.cn.call(void 0,
@@ -13716,8 +13753,8 @@ function EntityVideoSection({
13716
13753
  const hasHighlight = !!highlightVideoUrl;
13717
13754
  const hasVideo = hasFullVideo || hasHighlight;
13718
13755
  const derivedCaptions = captionsEntity ? captions.forEntityId(captionsEntity.type, captionsEntity.id) : null;
13719
- const captionsUrl = _nullishCoalesce(captionsUrlProp, () => ( _optionalChain([derivedCaptions, 'optionalAccess', _341 => _341.captionsUrl])));
13720
- const highlightCaptionsUrl = _nullishCoalesce(highlightCaptionsUrlProp, () => ( _optionalChain([derivedCaptions, 'optionalAccess', _342 => _342.highlightCaptionsUrl])));
13756
+ const captionsUrl = _nullishCoalesce(captionsUrlProp, () => ( _optionalChain([derivedCaptions, 'optionalAccess', _342 => _342.captionsUrl])));
13757
+ const highlightCaptionsUrl = _nullishCoalesce(highlightCaptionsUrlProp, () => ( _optionalChain([derivedCaptions, 'optionalAccess', _343 => _343.highlightCaptionsUrl])));
13721
13758
  if (!hasVideo && !videoSummary && (!videoBites || videoBites.length === 0)) {
13722
13759
  return null;
13723
13760
  }
@@ -14236,7 +14273,7 @@ function DataRoomDocCard({ item, className, badgeText, anchorProps }) {
14236
14273
  ] }) : null,
14237
14274
  item.preview ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "flex min-w-0", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "line-clamp-2 whitespace-pre-wrap break-words text-ods-text-secondary text-h6", children: item.preview }) }) : null
14238
14275
  ] }),
14239
- _optionalChain([anchorProps, 'optionalAccess', _343 => _343.href]) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "flex h-5 shrink-0 items-center self-start text-ods-text-secondary", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ExternalLink, { className: "h-3.5 w-3.5" }) }) : null
14276
+ _optionalChain([anchorProps, 'optionalAccess', _344 => _344.href]) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "flex h-5 shrink-0 items-center self-start text-ods-text-secondary", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ExternalLink, { className: "h-3.5 w-3.5" }) }) : null
14240
14277
  ] });
14241
14278
  if (!anchorProps) {
14242
14279
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: `${_chunkUQEOAPAIcjs.COMPACT_CARD_OUTER_STATIC} ${_nullishCoalesce(className, () => ( ""))}`, "aria-label": "No link available", children: body });
@@ -14264,7 +14301,7 @@ function DataRoomDocCardSkeleton({ className }) {
14264
14301
 
14265
14302
 
14266
14303
  function CampaignCardAdmin({ campaign, className, anchorProps }) {
14267
- const goalsCount = _optionalChain([campaign, 'access', _344 => _344.goals, 'optionalAccess', _345 => _345.length]) || 0;
14304
+ const goalsCount = _optionalChain([campaign, 'access', _345 => _345.goals, 'optionalAccess', _346 => _346.length]) || 0;
14268
14305
  const innerChildren = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
14269
14306
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: _chunkUQEOAPAIcjs.COMPACT_CARD_ICON_SLOT, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Megaphone, { className: "h-5 w-5" }) }),
14270
14307
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: _chunkUQEOAPAIcjs.COMPACT_CARD_TEXT_COL, children: [
@@ -14558,7 +14595,7 @@ function pickFetchedCardHref({
14558
14595
  itemHref,
14559
14596
  allowComposed
14560
14597
  }) {
14561
- if (_optionalChain([composed, 'optionalAccess', _346 => _346.hostOverride])) {
14598
+ if (_optionalChain([composed, 'optionalAccess', _347 => _347.hostOverride])) {
14562
14599
  return { source: "hostOverride", href: composed.href, targetPlatform: composed.targetPlatform };
14563
14600
  }
14564
14601
  if (itemHref) return { source: "item", href: itemHref };
@@ -14774,7 +14811,7 @@ function resolveSourceRowCTA(row, ctx = {}) {
14774
14811
  if (row.path && shouldFallbackToPathNav(row) && !row.externalUrl) {
14775
14812
  const safePath = sanitizePath(row.path);
14776
14813
  if (safePath) {
14777
- const docTarget = row.documentType ? _optionalChain([ctx, 'access', _347 => _347.docPlatformTargets, 'optionalAccess', _348 => _348[row.documentType]]) : void 0;
14814
+ const docTarget = row.documentType ? _optionalChain([ctx, 'access', _348 => _348.docPlatformTargets, 'optionalAccess', _349 => _349[row.documentType]]) : void 0;
14778
14815
  if (docTarget) {
14779
14816
  const seg = docTarget.basePath.split("/").filter(Boolean).join("/");
14780
14817
  const base = `${_chunk23V5BSHDcjs.getBaseUrl.call(void 0, docTarget.platform)}${seg ? `/${seg}` : ""}/`;
@@ -14917,8 +14954,8 @@ function cardMenuGroups(href, discuss, openDetails, externalLink) {
14917
14954
  if (href) {
14918
14955
  items.push({
14919
14956
  id: "open-details",
14920
- label: _nullishCoalesce(_optionalChain([openDetails, 'optionalAccess', _349 => _349.label]), () => ( "Open Details")),
14921
- icon: _nullishCoalesce(_optionalChain([openDetails, 'optionalAccess', _350 => _350.icon]), () => ( /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.EyeIcon, { size: 20 }))),
14957
+ label: _nullishCoalesce(_optionalChain([openDetails, 'optionalAccess', _350 => _350.label]), () => ( "Open Details")),
14958
+ icon: _nullishCoalesce(_optionalChain([openDetails, 'optionalAccess', _351 => _351.icon]), () => ( /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.EyeIcon, { size: 20 }))),
14922
14959
  // Main row → open the entity (same tab, soft Link nav).
14923
14960
  href,
14924
14961
  // Trailing 40px ↗ side-button → open in a new tab.
@@ -14978,18 +15015,18 @@ function itemVideoMetadata(item) {
14978
15015
  for (const v of vals) if (typeof v === "string" && v.length > 0) return v;
14979
15016
  return void 0;
14980
15017
  };
14981
- const m = _nullishCoalesce(_optionalChain([item, 'optionalAccess', _351 => _351.metadata]), () => ( {}));
15018
+ const m = _nullishCoalesce(_optionalChain([item, 'optionalAccess', _352 => _352.metadata]), () => ( {}));
14982
15019
  const out = {};
14983
- const videoUrl = pick(m.videoUrl, _optionalChain([item, 'optionalAccess', _352 => _352.custom_video_url]), _optionalChain([item, 'optionalAccess', _353 => _353.main_video_url]));
14984
- const youtubeUrl = pick(m.youtubeUrl, _optionalChain([item, 'optionalAccess', _354 => _354.youtube_url]), _optionalChain([item, 'optionalAccess', _355 => _355.testimonial_video_url]));
14985
- const highlightVideoUrl = pick(m.highlightVideoUrl, _optionalChain([item, 'optionalAccess', _356 => _356.highlight_video_url]));
15020
+ const videoUrl = pick(m.videoUrl, _optionalChain([item, 'optionalAccess', _353 => _353.custom_video_url]), _optionalChain([item, 'optionalAccess', _354 => _354.main_video_url]));
15021
+ const youtubeUrl = pick(m.youtubeUrl, _optionalChain([item, 'optionalAccess', _355 => _355.youtube_url]), _optionalChain([item, 'optionalAccess', _356 => _356.testimonial_video_url]));
15022
+ const highlightVideoUrl = pick(m.highlightVideoUrl, _optionalChain([item, 'optionalAccess', _357 => _357.highlight_video_url]));
14986
15023
  const videoPoster = pick(
14987
15024
  m.videoPoster,
14988
- _optionalChain([item, 'optionalAccess', _357 => _357.main_video_thumbnail]),
14989
- _optionalChain([item, 'optionalAccess', _358 => _358.highlight_video_thumbnail]),
14990
- _optionalChain([item, 'optionalAccess', _359 => _359.featured_image])
15025
+ _optionalChain([item, 'optionalAccess', _358 => _358.main_video_thumbnail]),
15026
+ _optionalChain([item, 'optionalAccess', _359 => _359.highlight_video_thumbnail]),
15027
+ _optionalChain([item, 'optionalAccess', _360 => _360.featured_image])
14991
15028
  );
14992
- const highlightVideoPoster = pick(m.highlightVideoPoster, _optionalChain([item, 'optionalAccess', _360 => _360.highlight_video_thumbnail]));
15029
+ const highlightVideoPoster = pick(m.highlightVideoPoster, _optionalChain([item, 'optionalAccess', _361 => _361.highlight_video_thumbnail]));
14993
15030
  if (videoUrl) out.videoUrl = videoUrl;
14994
15031
  if (youtubeUrl) out.youtubeUrl = youtubeUrl;
14995
15032
  if (highlightVideoUrl) out.highlightVideoUrl = highlightVideoUrl;
@@ -15019,15 +15056,15 @@ function fetchedItemDisplayRef(item, chatRef) {
15019
15056
  }
15020
15057
  function fetchedFaqDisplayRef(item, chatRef) {
15021
15058
  const it = item;
15022
- const answer = typeof _optionalChain([it, 'optionalAccess', _361 => _361.answer]) === "string" && it.answer.trim().length > 0 ? it.answer.trim() : null;
15059
+ const answer = typeof _optionalChain([it, 'optionalAccess', _362 => _362.answer]) === "string" && it.answer.trim().length > 0 ? it.answer.trim() : null;
15023
15060
  return {
15024
15061
  type: "faq",
15025
15062
  id: chatRef.id,
15026
15063
  sourceRepo: chatRef.sourceRepo,
15027
- title: typeof _optionalChain([it, 'optionalAccess', _362 => _362.question]) === "string" && it.question ? it.question : chatRef.id,
15064
+ title: typeof _optionalChain([it, 'optionalAccess', _363 => _363.question]) === "string" && it.question ? it.question : chatRef.id,
15028
15065
  url: _nullishCoalesce(chatRef.url, () => ( null)),
15029
15066
  ...answer ? { preview: answer.length > 400 ? `${answer.slice(0, 397)}\u2026` : answer } : {},
15030
- metadata: typeof _optionalChain([it, 'optionalAccess', _363 => _363.section]) === "string" && it.section ? { section: it.section } : {}
15067
+ metadata: typeof _optionalChain([it, 'optionalAccess', _364 => _364.section]) === "string" && it.section ? { section: it.section } : {}
15031
15068
  };
15032
15069
  }
15033
15070
  function HubspotTicketChatCard({
@@ -15035,8 +15072,8 @@ function HubspotTicketChatCard({
15035
15072
  isNewTab,
15036
15073
  discuss
15037
15074
  }) {
15038
- const status = typeof _optionalChain([chatRef, 'access', _364 => _364.metadata, 'optionalAccess', _365 => _365.status]) === "string" ? chatRef.metadata.status : void 0;
15039
- const statusLabel = typeof _optionalChain([chatRef, 'access', _366 => _366.metadata, 'optionalAccess', _367 => _367.statusLabel]) === "string" ? chatRef.metadata.statusLabel : void 0;
15075
+ const status = typeof _optionalChain([chatRef, 'access', _365 => _365.metadata, 'optionalAccess', _366 => _366.status]) === "string" ? chatRef.metadata.status : void 0;
15076
+ const statusLabel = typeof _optionalChain([chatRef, 'access', _367 => _367.metadata, 'optionalAccess', _368 => _368.statusLabel]) === "string" ? chatRef.metadata.statusLabel : void 0;
15040
15077
  const statusText = _nullishCoalesce(statusLabel, () => ( formatStatusToken(status)));
15041
15078
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
15042
15079
  MingoInfoCard,
@@ -15059,7 +15096,7 @@ function FaqChatCard({
15059
15096
  isNewTab,
15060
15097
  discuss
15061
15098
  }) {
15062
- const section = typeof _optionalChain([chatRef, 'access', _368 => _368.metadata, 'optionalAccess', _369 => _369.section]) === "string" ? chatRef.metadata.section.trim() : void 0;
15099
+ const section = typeof _optionalChain([chatRef, 'access', _369 => _369.metadata, 'optionalAccess', _370 => _370.section]) === "string" ? chatRef.metadata.section.trim() : void 0;
15063
15100
  const statusLabel = section && section.length > 0 ? section : "FAQ";
15064
15101
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
15065
15102
  MingoInfoCard,
@@ -15079,7 +15116,7 @@ function SlackChatCard({
15079
15116
  isNewTab,
15080
15117
  discuss
15081
15118
  }) {
15082
- const channelName = typeof _optionalChain([chatRef, 'access', _370 => _370.metadata, 'optionalAccess', _371 => _371.channelName]) === "string" ? chatRef.metadata.channelName.trim() : void 0;
15119
+ const channelName = typeof _optionalChain([chatRef, 'access', _371 => _371.metadata, 'optionalAccess', _372 => _372.channelName]) === "string" ? chatRef.metadata.channelName.trim() : void 0;
15083
15120
  const channelPretty = channelName ? channelName.startsWith("#") ? channelName : `#${channelName}` : void 0;
15084
15121
  const title = channelPretty ? `${chatRef.title} \xB7 ${channelPretty}` : chatRef.title;
15085
15122
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -15137,7 +15174,7 @@ function GenericFinancialChatCard({
15137
15174
  isNewTab,
15138
15175
  discuss
15139
15176
  }) {
15140
- const subtitle = typeof _optionalChain([chatRef, 'access', _372 => _372.metadata, 'optionalAccess', _373 => _373.subtitle]) === "string" ? chatRef.metadata.subtitle : void 0;
15177
+ const subtitle = typeof _optionalChain([chatRef, 'access', _373 => _373.metadata, 'optionalAccess', _374 => _374.subtitle]) === "string" ? chatRef.metadata.subtitle : void 0;
15141
15178
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
15142
15179
  MingoInfoCard,
15143
15180
  {
@@ -15206,12 +15243,12 @@ function ProductReleaseChatCard({
15206
15243
  discuss
15207
15244
  }) {
15208
15245
  const releaseProps = buildProps(item);
15209
- const status = _optionalChain([item, 'optionalAccess', _374 => _374.version]) ? { label: String(item.version), variant: "grey" } : { label: "Release", variant: "grey" };
15246
+ const status = _optionalChain([item, 'optionalAccess', _375 => _375.version]) ? { label: String(item.version), variant: "grey" } : { label: "Release", variant: "grey" };
15210
15247
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
15211
15248
  EntityMingoCard,
15212
15249
  {
15213
- title: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _375 => _375.title]), () => ( "")),
15214
- description: _optionalChain([item, 'optionalAccess', _376 => _376.summary]) || releaseProps.formattedDate || void 0,
15250
+ title: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _376 => _376.title]), () => ( "")),
15251
+ description: _optionalChain([item, 'optionalAccess', _377 => _377.summary]) || releaseProps.formattedDate || void 0,
15215
15252
  cover: releaseProps.coverImage || void 0,
15216
15253
  fallbackIcon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.Rocket02Icon, { size: 24 }),
15217
15254
  status,
@@ -15228,17 +15265,17 @@ function CampaignChatCard({
15228
15265
  isNewTab,
15229
15266
  discuss
15230
15267
  }) {
15231
- const goalsCount = Array.isArray(_optionalChain([item, 'optionalAccess', _377 => _377.goals])) ? item.goals.length : 0;
15268
+ const goalsCount = Array.isArray(_optionalChain([item, 'optionalAccess', _378 => _378.goals])) ? item.goals.length : 0;
15232
15269
  const meta = [
15233
- _optionalChain([item, 'optionalAccess', _378 => _378.start_date]) ? _chunkUQEOAPAIcjs.formatDateShort.call(void 0, item.start_date) : null,
15270
+ _optionalChain([item, 'optionalAccess', _379 => _379.start_date]) ? _chunkUQEOAPAIcjs.formatDateShort.call(void 0, item.start_date) : null,
15234
15271
  goalsCount > 0 ? `${goalsCount} goal${goalsCount !== 1 ? "s" : ""}` : null,
15235
15272
  "Marketing campaign"
15236
15273
  ].filter(Boolean).join(" \xB7 ");
15237
15274
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
15238
15275
  EntityMingoCard,
15239
15276
  {
15240
- title: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _379 => _379.name]), () => ( "")),
15241
- description: meta || _optionalChain([item, 'optionalAccess', _380 => _380.description]) || void 0,
15277
+ title: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _380 => _380.name]), () => ( "")),
15278
+ description: meta || _optionalChain([item, 'optionalAccess', _381 => _381.description]) || void 0,
15242
15279
  fallbackIcon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.Megaphone01Icon, { size: 24 }),
15243
15280
  chatRef,
15244
15281
  isNewTab,
@@ -15293,14 +15330,14 @@ function BlogChatCard({
15293
15330
  hasEmbeddedVideo,
15294
15331
  discuss
15295
15332
  }) {
15296
- const category = Array.isArray(_optionalChain([item, 'optionalAccess', _381 => _381.categories])) ? _nullishCoalesce(_optionalChain([item, 'access', _382 => _382.categories, 'access', _383 => _383.find, 'call', _384 => _384((c) => _optionalChain([c, 'optionalAccess', _385 => _385.name])), 'optionalAccess', _386 => _386.name]), () => ( void 0)) : void 0;
15333
+ const category = Array.isArray(_optionalChain([item, 'optionalAccess', _382 => _382.categories])) ? _nullishCoalesce(_optionalChain([item, 'access', _383 => _383.categories, 'access', _384 => _384.find, 'call', _385 => _385((c) => _optionalChain([c, 'optionalAccess', _386 => _386.name])), 'optionalAccess', _387 => _387.name]), () => ( void 0)) : void 0;
15297
15334
  const status = hasEmbeddedVideo ? { label: "Video", variant: "primary" } : category ? { label: category, variant: "grey" } : void 0;
15298
15335
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
15299
15336
  EntityMingoCard,
15300
15337
  {
15301
- title: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _387 => _387.title]), () => ( "")),
15302
- description: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _388 => _388.summary]), () => ( void 0)),
15303
- cover: entityCover(_optionalChain([item, 'optionalAccess', _389 => _389.featured_image]), ogPlaceholder),
15338
+ title: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _388 => _388.title]), () => ( "")),
15339
+ description: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _389 => _389.summary]), () => ( void 0)),
15340
+ cover: entityCover(_optionalChain([item, 'optionalAccess', _390 => _390.featured_image]), ogPlaceholder),
15304
15341
  fallbackIcon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.NewspaperIcon, { size: 24 }),
15305
15342
  status,
15306
15343
  chatRef,
@@ -15317,13 +15354,13 @@ function CaseStudyChatCard({
15317
15354
  ogPlaceholder,
15318
15355
  discuss
15319
15356
  }) {
15320
- const meta = [_optionalChain([item, 'optionalAccess', _390 => _390.msp, 'optionalAccess', _391 => _391.name]), _optionalChain([item, 'optionalAccess', _392 => _392.user, 'optionalAccess', _393 => _393.full_name])].filter(Boolean).join(" \xB7 ");
15357
+ const meta = [_optionalChain([item, 'optionalAccess', _391 => _391.msp, 'optionalAccess', _392 => _392.name]), _optionalChain([item, 'optionalAccess', _393 => _393.user, 'optionalAccess', _394 => _394.full_name])].filter(Boolean).join(" \xB7 ");
15321
15358
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
15322
15359
  EntityMingoCard,
15323
15360
  {
15324
- title: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _394 => _394.title]), () => ( "")),
15325
- description: _optionalChain([item, 'optionalAccess', _395 => _395.summary]) || meta || void 0,
15326
- cover: entityCover(_optionalChain([item, 'optionalAccess', _396 => _396.featured_image]), ogPlaceholder),
15361
+ title: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _395 => _395.title]), () => ( "")),
15362
+ description: _optionalChain([item, 'optionalAccess', _396 => _396.summary]) || meta || void 0,
15363
+ cover: entityCover(_optionalChain([item, 'optionalAccess', _397 => _397.featured_image]), ogPlaceholder),
15327
15364
  fallbackIcon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.TrophyIcon, { size: 24 }),
15328
15365
  status: { label: "Case study", variant: "grey" },
15329
15366
  chatRef,
@@ -15340,13 +15377,13 @@ function CustomerInterviewChatCard({
15340
15377
  ogPlaceholder,
15341
15378
  discuss
15342
15379
  }) {
15343
- const meta = [_optionalChain([item, 'optionalAccess', _397 => _397.user, 'optionalAccess', _398 => _398.full_name]), _optionalChain([item, 'optionalAccess', _399 => _399.msp, 'optionalAccess', _400 => _400.name])].filter(Boolean).join(" \xB7 ");
15380
+ const meta = [_optionalChain([item, 'optionalAccess', _398 => _398.user, 'optionalAccess', _399 => _399.full_name]), _optionalChain([item, 'optionalAccess', _400 => _400.msp, 'optionalAccess', _401 => _401.name])].filter(Boolean).join(" \xB7 ");
15344
15381
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
15345
15382
  EntityMingoCard,
15346
15383
  {
15347
- title: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _401 => _401.title]), () => ( "")),
15348
- description: _optionalChain([item, 'optionalAccess', _402 => _402.video_summary]) || meta || void 0,
15349
- cover: entityCover(_optionalChain([item, 'optionalAccess', _403 => _403.featured_image]), ogPlaceholder),
15384
+ title: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _402 => _402.title]), () => ( "")),
15385
+ description: _optionalChain([item, 'optionalAccess', _403 => _403.video_summary]) || meta || void 0,
15386
+ cover: entityCover(_optionalChain([item, 'optionalAccess', _404 => _404.featured_image]), ogPlaceholder),
15350
15387
  fallbackIcon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.MicrophoneIcon, { size: 24 }),
15351
15388
  status: { label: "Interview", variant: "grey" },
15352
15389
  chatRef,
@@ -15363,13 +15400,13 @@ function InvestorUpdateChatCard({
15363
15400
  ogPlaceholder,
15364
15401
  discuss
15365
15402
  }) {
15366
- const title = _optionalChain([item, 'optionalAccess', _404 => _404.title]) || `Update #${_nullishCoalesce(_optionalChain([item, 'optionalAccess', _405 => _405.update_number]), () => ( "?"))}`;
15403
+ const title = _optionalChain([item, 'optionalAccess', _405 => _405.title]) || `Update #${_nullishCoalesce(_optionalChain([item, 'optionalAccess', _406 => _406.update_number]), () => ( "?"))}`;
15367
15404
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
15368
15405
  EntityMingoCard,
15369
15406
  {
15370
15407
  title,
15371
- description: _optionalChain([item, 'optionalAccess', _406 => _406.strategic_update]) || _optionalChain([item, 'optionalAccess', _407 => _407.content]) || _chunkUQEOAPAIcjs.formatInvestorUpdatePeriod.call(void 0, _nullishCoalesce(_optionalChain([item, 'optionalAccess', _408 => _408.period_start]), () => ( null)), _nullishCoalesce(_optionalChain([item, 'optionalAccess', _409 => _409.period_end]), () => ( null))) || void 0,
15372
- cover: entityCover(_optionalChain([item, 'optionalAccess', _410 => _410.featured_image]), ogPlaceholder),
15408
+ description: _optionalChain([item, 'optionalAccess', _407 => _407.strategic_update]) || _optionalChain([item, 'optionalAccess', _408 => _408.content]) || _chunkUQEOAPAIcjs.formatInvestorUpdatePeriod.call(void 0, _nullishCoalesce(_optionalChain([item, 'optionalAccess', _409 => _409.period_start]), () => ( null)), _nullishCoalesce(_optionalChain([item, 'optionalAccess', _410 => _410.period_end]), () => ( null))) || void 0,
15409
+ cover: entityCover(_optionalChain([item, 'optionalAccess', _411 => _411.featured_image]), ogPlaceholder),
15373
15410
  fallbackIcon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.PresentationLineIcon, { size: 24 }),
15374
15411
  status: { label: "Investor update", variant: "grey" },
15375
15412
  chatRef,
@@ -15386,12 +15423,12 @@ function OnboardingGuideChatCard({
15386
15423
  ogPlaceholder,
15387
15424
  discuss
15388
15425
  }) {
15389
- const cover = _nullishCoalesce(_nullishCoalesce(entityCover(_optionalChain([item, 'optionalAccess', _411 => _411.featured_image])), () => ( entityCover(_optionalChain([item, 'optionalAccess', _412 => _412.main_video_thumbnail])))), () => ( entityCover(_optionalChain([item, 'optionalAccess', _413 => _413.og_image_url]), ogPlaceholder)));
15426
+ const cover = _nullishCoalesce(_nullishCoalesce(entityCover(_optionalChain([item, 'optionalAccess', _412 => _412.featured_image])), () => ( entityCover(_optionalChain([item, 'optionalAccess', _413 => _413.main_video_thumbnail])))), () => ( entityCover(_optionalChain([item, 'optionalAccess', _414 => _414.og_image_url]), ogPlaceholder)));
15390
15427
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
15391
15428
  EntityMingoCard,
15392
15429
  {
15393
- title: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _414 => _414.title]), () => ( "")),
15394
- description: _nullishCoalesce(_nullishCoalesce(_optionalChain([item, 'optionalAccess', _415 => _415.summary]), () => ( _optionalChain([item, 'optionalAccess', _416 => _416.description]))), () => ( void 0)),
15430
+ title: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _415 => _415.title]), () => ( "")),
15431
+ description: _nullishCoalesce(_nullishCoalesce(_optionalChain([item, 'optionalAccess', _416 => _416.summary]), () => ( _optionalChain([item, 'optionalAccess', _417 => _417.description]))), () => ( void 0)),
15395
15432
  cover,
15396
15433
  fallbackIcon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.CompassIcon, { size: 24 }),
15397
15434
  status: { label: "Guide", variant: "grey" },
@@ -15412,25 +15449,25 @@ function ProgramChatCard({
15412
15449
  discuss
15413
15450
  }) {
15414
15451
  const icon = configKey === "webinar" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.PresentationBarIcon, { size: 24 }) : configKey === "event" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.CalendarIcon, { size: 24 }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.MicrophoneIcon, { size: 24 });
15415
- const isScheduled = _optionalChain([item, 'optionalAccess', _417 => _417.status]) === "scheduled";
15452
+ const isScheduled = _optionalChain([item, 'optionalAccess', _418 => _418.status]) === "scheduled";
15416
15453
  let typeMeta;
15417
- if (configKey === "podcast" && typeof _optionalChain([item, 'optionalAccess', _418 => _418.duration_seconds]) === "number" && item.duration_seconds > 0 && !isScheduled) {
15454
+ if (configKey === "podcast" && typeof _optionalChain([item, 'optionalAccess', _419 => _419.duration_seconds]) === "number" && item.duration_seconds > 0 && !isScheduled) {
15418
15455
  typeMeta = _chunkUQEOAPAIcjs.formatDurationCompact.call(void 0, item.duration_seconds);
15419
- } else if (configKey === "event" && typeof _optionalChain([item, 'optionalAccess', _419 => _419.location_name]) === "string" && item.location_name.trim().length > 0) {
15456
+ } else if (configKey === "event" && typeof _optionalChain([item, 'optionalAccess', _420 => _420.location_name]) === "string" && item.location_name.trim().length > 0) {
15420
15457
  typeMeta = item.location_name;
15421
- } else if (configKey === "webinar" && _optionalChain([item, 'optionalAccess', _420 => _420.start_at])) {
15458
+ } else if (configKey === "webinar" && _optionalChain([item, 'optionalAccess', _421 => _421.start_at])) {
15422
15459
  const time = _chunkUQEOAPAIcjs.formatTimeWithTimezone.call(void 0, item.start_at, _nullishCoalesce(item.timezone, () => ( null)));
15423
15460
  const dur = _chunkUQEOAPAIcjs.formatDurationFromRange.call(void 0, item.start_at, item.end_at);
15424
15461
  typeMeta = dur ? `${time} \xB7 ${dur}` : time;
15425
15462
  }
15426
- const itemDate = _chunkUQEOAPAIcjs.formatDateUTC.call(void 0, _nullishCoalesce(_optionalChain([item, 'optionalAccess', _421 => _421.date]), () => ( null)), { fallback: "", timezone: "local" });
15463
+ const itemDate = _chunkUQEOAPAIcjs.formatDateUTC.call(void 0, _nullishCoalesce(_optionalChain([item, 'optionalAccess', _422 => _422.date]), () => ( null)), { fallback: "", timezone: "local" });
15427
15464
  const meta = [itemDate, typeMeta].filter(Boolean).join(" \xB7 ");
15428
15465
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
15429
15466
  EntityMingoCard,
15430
15467
  {
15431
- title: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _422 => _422.title]), () => ( "")),
15432
- description: meta || _optionalChain([item, 'optionalAccess', _423 => _423.description]) || void 0,
15433
- cover: entityCover(_optionalChain([item, 'optionalAccess', _424 => _424.cover_url]), ogPlaceholder),
15468
+ title: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _423 => _423.title]), () => ( "")),
15469
+ description: meta || _optionalChain([item, 'optionalAccess', _424 => _424.description]) || void 0,
15470
+ cover: entityCover(_optionalChain([item, 'optionalAccess', _425 => _425.cover_url]), ogPlaceholder),
15434
15471
  fallbackIcon: icon,
15435
15472
  status: { label, variant: "grey" },
15436
15473
  chatRef,
@@ -15447,10 +15484,10 @@ function RoadmapChatCard({
15447
15484
  cardType,
15448
15485
  discuss
15449
15486
  }) {
15450
- const logoUrl = typeof _optionalChain([item, 'optionalAccess', _425 => _425.icon]) === "string" && item.icon.startsWith("http") ? item.icon : void 0;
15451
- const useTypeIcon = cardType === "internal_task" || !logoUrl && _optionalChain([item, 'optionalAccess', _426 => _426.customItemId]) != null;
15487
+ const logoUrl = typeof _optionalChain([item, 'optionalAccess', _426 => _426.icon]) === "string" && item.icon.startsWith("http") ? item.icon : void 0;
15488
+ const useTypeIcon = cardType === "internal_task" || !logoUrl && _optionalChain([item, 'optionalAccess', _427 => _427.customItemId]) != null;
15452
15489
  const defaultIcon = cardType === "delivery_item" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.TruckFastIcon, { size: 24 }) : cardType === "internal_task" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.CheckSquareIcon, { size: 24 }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSQM4PDRcjs.MapIcon, { size: 24 });
15453
- const icon = useTypeIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUQEOAPAIcjs.TaskTypeIcon, { customItemId: _optionalChain([item, 'optionalAccess', _427 => _427.customItemId]), className: "size-6" }) : logoUrl ? (
15490
+ const icon = useTypeIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUQEOAPAIcjs.TaskTypeIcon, { customItemId: _optionalChain([item, 'optionalAccess', _428 => _428.customItemId]), className: "size-6" }) : logoUrl ? (
15454
15491
  // Contained (not full-bleed) so the integration logo keeps its aspect
15455
15492
  // ratio inside the bordered icon box — matches RoadmapCard.
15456
15493
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWLSFBRT5cjs.next_image_default, { src: logoUrl, alt: "", className: "size-6 object-contain", width: 24, height: 24, unoptimized: true })
@@ -15461,10 +15498,10 @@ function RoadmapChatCard({
15461
15498
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
15462
15499
  EntityMingoCard,
15463
15500
  {
15464
- title: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _428 => _428.title]), () => ( "")),
15465
- description: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _429 => _429.description]), () => ( void 0)),
15501
+ title: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _429 => _429.title]), () => ( "")),
15502
+ description: _nullishCoalesce(_optionalChain([item, 'optionalAccess', _430 => _430.description]), () => ( void 0)),
15466
15503
  fallbackIcon: icon,
15467
- status: statusPill(_optionalChain([item, 'optionalAccess', _430 => _430.status])),
15504
+ status: statusPill(_optionalChain([item, 'optionalAccess', _431 => _431.status])),
15468
15505
  chatRef,
15469
15506
  isNewTab,
15470
15507
  discuss,
@@ -15480,7 +15517,7 @@ function refHydratedEntry(docType, label, renderRef) {
15480
15517
  bareInline: true,
15481
15518
  contentRefType: docType,
15482
15519
  noComposedHref: true,
15483
- fallbackHref: (item) => _nullishCoalesce(_optionalChain([item, 'optionalAccess', _431 => _431.url]), () => ( null)),
15520
+ fallbackHref: (item) => _nullishCoalesce(_optionalChain([item, 'optionalAccess', _432 => _432.url]), () => ( null)),
15484
15521
  skeleton: () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, MingoInfoCardSkeleton, {}),
15485
15522
  render: (item, chatRef, opts) => renderRef(fetchedItemDisplayRef(item, chatRef), opts)
15486
15523
  };
@@ -15531,9 +15568,9 @@ function refGlyphRegistryEntries() {
15531
15568
  }
15532
15569
  function fetchedEmployeeEntryDisplayRef(item, chatRef) {
15533
15570
  const it = item;
15534
- const title = typeof _optionalChain([it, 'optionalAccess', _432 => _432.title]) === "string" && it.title.trim().length > 0 ? it.title.trim() : chatRef.title;
15535
- const author = typeof _optionalChain([it, 'optionalAccess', _433 => _433.author, 'optionalAccess', _434 => _434.full_name]) === "string" ? it.author.full_name.trim() : "";
15536
- const summary = typeof _optionalChain([it, 'optionalAccess', _435 => _435.summary]) === "string" ? it.summary.trim() : "";
15571
+ const title = typeof _optionalChain([it, 'optionalAccess', _433 => _433.title]) === "string" && it.title.trim().length > 0 ? it.title.trim() : chatRef.title;
15572
+ const author = typeof _optionalChain([it, 'optionalAccess', _434 => _434.author, 'optionalAccess', _435 => _435.full_name]) === "string" ? it.author.full_name.trim() : "";
15573
+ const summary = typeof _optionalChain([it, 'optionalAccess', _436 => _436.summary]) === "string" ? it.summary.trim() : "";
15537
15574
  const preview = [author, summary].filter((x) => x.length > 0).join(" \xB7 ");
15538
15575
  return { ...chatRef, title, preview: preview.length > 0 ? preview : chatRef.preview };
15539
15576
  }
@@ -15584,7 +15621,7 @@ function programRegistryEntries() {
15584
15621
  discuss: opts.discuss,
15585
15622
  configKey: cfg.configKey,
15586
15623
  label: cfg.configKey.charAt(0).toUpperCase() + cfg.configKey.slice(1),
15587
- ogPlaceholder: _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _436 => _436.extras, 'optionalAccess', _437 => _437.buildOgPlaceholderUrl, 'optionalCall', _438 => _438(_nullishCoalesce(_optionalChain([item, 'optionalAccess', _439 => _439.title]), () => ( "")))]), () => ( null))
15624
+ ogPlaceholder: _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _437 => _437.extras, 'optionalAccess', _438 => _438.buildOgPlaceholderUrl, 'optionalCall', _439 => _439(_nullishCoalesce(_optionalChain([item, 'optionalAccess', _440 => _440.title]), () => ( "")))]), () => ( null))
15588
15625
  }
15589
15626
  )
15590
15627
  }));
@@ -15605,7 +15642,7 @@ var ROADMAP_CARD_CONFIGS = {
15605
15642
  // The card's destination IS the ClickUp deep link, derived from the
15606
15643
  // task id post-fetch (the refs frame used to carry it).
15607
15644
  noComposedHref: true,
15608
- fallbackHref: (item) => _optionalChain([item, 'optionalAccess', _440 => _440.id]) != null ? clickupTaskUrl(String(item.id)) : null
15645
+ fallbackHref: (item) => _optionalChain([item, 'optionalAccess', _441 => _441.id]) != null ? clickupTaskUrl(String(item.id)) : null
15609
15646
  }
15610
15647
  };
15611
15648
  function roadmapRegistryEntries() {
@@ -15647,8 +15684,8 @@ var CHAT_CARD_REGISTRY = {
15647
15684
  DeletedDataCard,
15648
15685
  {
15649
15686
  title: chatRef.title && chatRef.title !== chatRef.id ? chatRef.title : null,
15650
- entityLabel: _nullishCoalesce(_optionalChain([chatRef, 'access', _441 => _441.metadata, 'optionalAccess', _442 => _442.entity_label]), () => ( null)),
15651
- recoveryNote: _nullishCoalesce(_optionalChain([chatRef, 'access', _443 => _443.metadata, 'optionalAccess', _444 => _444.recovery_note]), () => ( null))
15687
+ entityLabel: _nullishCoalesce(_optionalChain([chatRef, 'access', _442 => _442.metadata, 'optionalAccess', _443 => _443.entity_label]), () => ( null)),
15688
+ recoveryNote: _nullishCoalesce(_optionalChain([chatRef, 'access', _444 => _444.metadata, 'optionalAccess', _445 => _445.recovery_note]), () => ( null))
15652
15689
  }
15653
15690
  )
15654
15691
  },
@@ -15665,7 +15702,7 @@ var CHAT_CARD_REGISTRY = {
15665
15702
  bareInline: true,
15666
15703
  contentRefType: "faq",
15667
15704
  noComposedHref: true,
15668
- fallbackHref: (item) => _optionalChain([item, 'optionalAccess', _445 => _445.id]) != null ? `/faqs#${faqItemAnchor(item.id)}` : null,
15705
+ fallbackHref: (item) => _optionalChain([item, 'optionalAccess', _446 => _446.id]) != null ? `/faqs#${faqItemAnchor(item.id)}` : null,
15669
15706
  skeleton: () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, MingoInfoCardSkeleton, {}),
15670
15707
  render: (item, chatRef, opts) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, FaqChatCard, { chatRef: fetchedFaqDisplayRef(item, chatRef), isNewTab: opts.isNewTab, discuss: opts.discuss })
15671
15708
  },
@@ -15699,8 +15736,8 @@ var CHAT_CARD_REGISTRY = {
15699
15736
  chatRef,
15700
15737
  isNewTab: opts.isNewTab,
15701
15738
  discuss: opts.discuss,
15702
- ogPlaceholder: _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _446 => _446.extras, 'optionalAccess', _447 => _447.buildOgPlaceholderUrl, 'optionalCall', _448 => _448(_nullishCoalesce(_optionalChain([item, 'optionalAccess', _449 => _449.title]), () => ( "")))]), () => ( null)),
15703
- hasEmbeddedVideo: _optionalChain([chatRef, 'access', _450 => _450.metadata, 'optionalAccess', _451 => _451.hasEmbeddedVideo]) === true
15739
+ ogPlaceholder: _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _447 => _447.extras, 'optionalAccess', _448 => _448.buildOgPlaceholderUrl, 'optionalCall', _449 => _449(_nullishCoalesce(_optionalChain([item, 'optionalAccess', _450 => _450.title]), () => ( "")))]), () => ( null)),
15740
+ hasEmbeddedVideo: _optionalChain([chatRef, 'access', _451 => _451.metadata, 'optionalAccess', _452 => _452.hasEmbeddedVideo]) === true
15704
15741
  }
15705
15742
  )
15706
15743
  },
@@ -15716,7 +15753,7 @@ var CHAT_CARD_REGISTRY = {
15716
15753
  chatRef,
15717
15754
  isNewTab: opts.isNewTab,
15718
15755
  discuss: opts.discuss,
15719
- ogPlaceholder: _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _452 => _452.extras, 'optionalAccess', _453 => _453.buildOgPlaceholderUrl, 'optionalCall', _454 => _454(_nullishCoalesce(_optionalChain([item, 'optionalAccess', _455 => _455.title]), () => ( "")))]), () => ( null))
15756
+ ogPlaceholder: _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _453 => _453.extras, 'optionalAccess', _454 => _454.buildOgPlaceholderUrl, 'optionalCall', _455 => _455(_nullishCoalesce(_optionalChain([item, 'optionalAccess', _456 => _456.title]), () => ( "")))]), () => ( null))
15720
15757
  }
15721
15758
  )
15722
15759
  },
@@ -15732,7 +15769,7 @@ var CHAT_CARD_REGISTRY = {
15732
15769
  chatRef,
15733
15770
  isNewTab: opts.isNewTab,
15734
15771
  discuss: opts.discuss,
15735
- ogPlaceholder: _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _456 => _456.extras, 'optionalAccess', _457 => _457.buildOgPlaceholderUrl, 'optionalCall', _458 => _458(_nullishCoalesce(_optionalChain([item, 'optionalAccess', _459 => _459.title]), () => ( "")))]), () => ( null))
15772
+ ogPlaceholder: _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _457 => _457.extras, 'optionalAccess', _458 => _458.buildOgPlaceholderUrl, 'optionalCall', _459 => _459(_nullishCoalesce(_optionalChain([item, 'optionalAccess', _460 => _460.title]), () => ( "")))]), () => ( null))
15736
15773
  }
15737
15774
  )
15738
15775
  },
@@ -15742,7 +15779,7 @@ var CHAT_CARD_REGISTRY = {
15742
15779
  bareInline: true,
15743
15780
  skeleton: () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUQEOAPAIcjs.ProductReleaseCardSkeleton, { size: "sm" }),
15744
15781
  render: (item, chatRef, opts) => {
15745
- const builder = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _460 => _460.extras, 'optionalAccess', _461 => _461.buildProductReleaseCardProps]), () => ( _chunkUQEOAPAIcjs.defaultBuildProductReleaseCardProps));
15782
+ const builder = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _461 => _461.extras, 'optionalAccess', _462 => _462.buildProductReleaseCardProps]), () => ( _chunkUQEOAPAIcjs.defaultBuildProductReleaseCardProps));
15746
15783
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
15747
15784
  ProductReleaseChatCard,
15748
15785
  {
@@ -15768,7 +15805,7 @@ var CHAT_CARD_REGISTRY = {
15768
15805
  chatRef,
15769
15806
  isNewTab: opts.isNewTab,
15770
15807
  discuss: opts.discuss,
15771
- ogPlaceholder: _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _462 => _462.extras, 'optionalAccess', _463 => _463.buildOgPlaceholderUrl, 'optionalCall', _464 => _464(_nullishCoalesce(_optionalChain([item, 'optionalAccess', _465 => _465.title]), () => ( "")))]), () => ( null))
15808
+ ogPlaceholder: _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _463 => _463.extras, 'optionalAccess', _464 => _464.buildOgPlaceholderUrl, 'optionalCall', _465 => _465(_nullishCoalesce(_optionalChain([item, 'optionalAccess', _466 => _466.title]), () => ( "")))]), () => ( null))
15772
15809
  }
15773
15810
  )
15774
15811
  },
@@ -15786,7 +15823,7 @@ var CHAT_CARD_REGISTRY = {
15786
15823
  chatRef,
15787
15824
  isNewTab: opts.isNewTab,
15788
15825
  discuss: opts.discuss,
15789
- ogPlaceholder: _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _466 => _466.extras, 'optionalAccess', _467 => _467.buildOgPlaceholderUrl, 'optionalCall', _468 => _468(_nullishCoalesce(_optionalChain([item, 'optionalAccess', _469 => _469.title]), () => ( "")))]), () => ( null))
15826
+ ogPlaceholder: _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _467 => _467.extras, 'optionalAccess', _468 => _468.buildOgPlaceholderUrl, 'optionalCall', _469 => _469(_nullishCoalesce(_optionalChain([item, 'optionalAccess', _470 => _470.title]), () => ( "")))]), () => ( null))
15790
15827
  }
15791
15828
  )
15792
15829
  },
@@ -15797,7 +15834,7 @@ var CHAT_CARD_REGISTRY = {
15797
15834
  skeleton: () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CampaignCardAdminSkeleton, {}),
15798
15835
  // No public viewer — synthesize the hub-internal admin URL post-fetch
15799
15836
  // so the wrapper + isNewTab computation see the actual destination.
15800
- fallbackHref: (item) => _optionalChain([item, 'optionalAccess', _470 => _470.id]) ? `/admin/campaigns/${encodeURIComponent(String(item.id))}` : null,
15837
+ fallbackHref: (item) => _optionalChain([item, 'optionalAccess', _471 => _471.id]) ? `/admin/campaigns/${encodeURIComponent(String(item.id))}` : null,
15801
15838
  render: (item, chatRef, opts) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CampaignChatCard, { item, chatRef, isNewTab: opts.isNewTab, discuss: opts.discuss })
15802
15839
  },
15803
15840
  ...roadmapRegistryEntries()
@@ -15816,13 +15853,13 @@ function ChatCardNavWrap({
15816
15853
  if (!href) return;
15817
15854
  const targetEl = e.target;
15818
15855
  const host = e.currentTarget;
15819
- if (!_optionalChain([host, 'optionalAccess', _471 => _471.contains, 'call', _472 => _472(targetEl)])) return;
15820
- if (_optionalChain([targetEl, 'optionalAccess', _473 => _473.closest, 'optionalCall', _474 => _474("button")])) return;
15821
- if (!_optionalChain([targetEl, 'optionalAccess', _475 => _475.closest, 'optionalCall', _476 => _476("a")])) return;
15856
+ if (!_optionalChain([host, 'optionalAccess', _472 => _472.contains, 'call', _473 => _473(targetEl)])) return;
15857
+ if (_optionalChain([targetEl, 'optionalAccess', _474 => _474.closest, 'optionalCall', _475 => _475("button")])) return;
15858
+ if (!_optionalChain([targetEl, 'optionalAccess', _476 => _476.closest, 'optionalCall', _477 => _477("a")])) return;
15822
15859
  const handled = executeNavigation({ event: e, runtime, href, path, targetPlatform, fallbackNavigate: router.push });
15823
15860
  if (!handled) return;
15824
15861
  e.stopPropagation();
15825
- if (!isNewTab && _optionalChain([panel, 'optionalAccess', _477 => _477.closeChat])) panel.closeChat();
15862
+ if (!isNewTab && _optionalChain([panel, 'optionalAccess', _478 => _478.closeChat])) panel.closeChat();
15826
15863
  };
15827
15864
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "contents", onClickCapture, children });
15828
15865
  }
@@ -15844,7 +15881,7 @@ function ChatCardLoader({
15844
15881
  title: chatRef.title,
15845
15882
  externalUrl: chatRef.url,
15846
15883
  targetPlatform: chatRef.targetPlatform,
15847
- path: typeof _optionalChain([chatRef, 'access', _478 => _478.metadata, 'optionalAccess', _479 => _479.path]) === "string" ? chatRef.metadata.path : null
15884
+ path: typeof _optionalChain([chatRef, 'access', _479 => _479.metadata, 'optionalAccess', _480 => _480.path]) === "string" ? chatRef.metadata.path : null
15848
15885
  },
15849
15886
  sourceRowCtxFromRuntime(runtime, { baseRoute, chipBasePlatform })
15850
15887
  );
@@ -15858,11 +15895,11 @@ function ChatCardLoader({
15858
15895
  const entry = CHAT_CARD_REGISTRY[resolvedChatRef.type];
15859
15896
  const fetchEntry = entry && entry.contentRefType ? entry : null;
15860
15897
  const { item, isLoading, isError, isFetched } = useChatCardItem(
15861
- _nullishCoalesce(_optionalChain([fetchEntry, 'optionalAccess', _480 => _480.contentRefType]), () => ( "")),
15898
+ _nullishCoalesce(_optionalChain([fetchEntry, 'optionalAccess', _481 => _481.contentRefType]), () => ( "")),
15862
15899
  fetchEntry ? resolvedChatRef.id : ""
15863
15900
  );
15864
15901
  if (!entry) return null;
15865
- const composedHref = _optionalChain([fetchEntry, 'optionalAccess', _481 => _481.contentRefType]) && !resolvedChatRef.url && item ? resolveFetchedCardHref({
15902
+ const composedHref = _optionalChain([fetchEntry, 'optionalAccess', _482 => _482.contentRefType]) && !resolvedChatRef.url && item ? resolveFetchedCardHref({
15866
15903
  contentRefType: fetchEntry.contentRefType,
15867
15904
  id: resolvedChatRef.id,
15868
15905
  item,
@@ -15870,7 +15907,7 @@ function ChatCardLoader({
15870
15907
  }) : null;
15871
15908
  const hrefChoice = fetchEntry && !resolvedChatRef.url && item ? pickFetchedCardHref({
15872
15909
  composed: composedHref,
15873
- itemHref: _nullishCoalesce(_optionalChain([fetchEntry, 'access', _482 => _482.fallbackHref, 'optionalCall', _483 => _483(item)]), () => ( null)),
15910
+ itemHref: _nullishCoalesce(_optionalChain([fetchEntry, 'access', _483 => _483.fallbackHref, 'optionalCall', _484 => _484(item)]), () => ( null)),
15874
15911
  allowComposed: !fetchEntry.noComposedHref
15875
15912
  }) : null;
15876
15913
  const hrefResolvedChatRef = hrefChoice ? {
@@ -15904,7 +15941,7 @@ function ChatCardLoader({
15904
15941
  isNewTab,
15905
15942
  discuss
15906
15943
  };
15907
- const path = typeof _optionalChain([finalChatRef, 'access', _484 => _484.metadata, 'optionalAccess', _485 => _485.path]) === "string" ? finalChatRef.metadata.path : null;
15944
+ const path = typeof _optionalChain([finalChatRef, 'access', _485 => _485.metadata, 'optionalAccess', _486 => _486.path]) === "string" ? finalChatRef.metadata.path : null;
15908
15945
  const navWrap = (children) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
15909
15946
  ChatCardNavWrap,
15910
15947
  {
@@ -15928,7 +15965,7 @@ function ChatCardLoader({
15928
15965
  if (!fetchEntry) {
15929
15966
  return finish(entry.render(void 0, finalChatRef, renderOpts));
15930
15967
  }
15931
- if (isLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: _nullishCoalesce(_optionalChain([fetchEntry, 'access', _486 => _486.skeleton, 'optionalCall', _487 => _487()]), () => ( null)) });
15968
+ if (isLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: _nullishCoalesce(_optionalChain([fetchEntry, 'access', _487 => _487.skeleton, 'optionalCall', _488 => _488()]), () => ( null)) });
15932
15969
  if (!item) {
15933
15970
  if (isError) {
15934
15971
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CardLoadFailure, { label: entry.label, id: finalChatRef.id, detail: "Failed to load" });
@@ -16065,11 +16102,11 @@ function makeSeqKey(messageType, chunkType, sequenceId) {
16065
16102
  function makeBatchDedupKey(item) {
16066
16103
  const seq = _nullishCoalesce(item.chunk.sequenceId, () => ( "na"));
16067
16104
  const type = typeof item.chunk.type === "string" ? item.chunk.type : "na";
16068
- const text = typeof item.chunk.text === "string" ? item.chunk.text : "";
16105
+ const text2 = typeof item.chunk.text === "string" ? item.chunk.text : "";
16069
16106
  const integratedToolType = typeof item.chunk.integratedToolType === "string" ? item.chunk.integratedToolType : "";
16070
16107
  const toolFunction = typeof item.chunk.toolFunction === "string" ? item.chunk.toolFunction : "";
16071
16108
  const approvalRequestId = typeof item.chunk.approvalRequestId === "string" ? item.chunk.approvalRequestId : typeof item.chunk.approval_request_id === "string" ? item.chunk.approval_request_id : "";
16072
- return `${item.messageType}:${seq}:${type}:${text}:${integratedToolType}:${toolFunction}:${approvalRequestId}`;
16109
+ return `${item.messageType}:${seq}:${type}:${text2}:${integratedToolType}:${toolFunction}:${approvalRequestId}`;
16073
16110
  }
16074
16111
  function getChatTypeMessageType(chatType) {
16075
16112
  return chatType === CHAT_TYPE.ADMIN ? "admin-message" : "message";
@@ -16291,7 +16328,7 @@ function useChunkCatchup({
16291
16328
  if (catchupRun.current === run) {
16292
16329
  if (currentDialogId !== dialogIdRef.current) {
16293
16330
  catchupRun.current = null;
16294
- if (_optionalChain([pendingCatchupRef, 'access', _488 => _488.current, 'optionalAccess', _489 => _489.dialogId]) === currentDialogId) {
16331
+ if (_optionalChain([pendingCatchupRef, 'access', _489 => _489.current, 'optionalAccess', _490 => _490.dialogId]) === currentDialogId) {
16295
16332
  pendingCatchupRef.current = null;
16296
16333
  }
16297
16334
  } else {
@@ -16302,7 +16339,7 @@ function useChunkCatchup({
16302
16339
  if (pending.dialogId === currentDialogId) {
16303
16340
  rearmForQueuedCatchup();
16304
16341
  try {
16305
- await _optionalChain([catchUpChunksRef, 'access', _490 => _490.current, 'optionalCall', _491 => _491(pending.fromSequenceId)]);
16342
+ await _optionalChain([catchUpChunksRef, 'access', _491 => _491.current, 'optionalCall', _492 => _492(pending.fromSequenceId)]);
16306
16343
  } catch (rerunError) {
16307
16344
  console.error("Queued catch-up re-run failed:", rerunError);
16308
16345
  }
@@ -16369,7 +16406,7 @@ function useChunkCatchup({
16369
16406
 
16370
16407
  var EMPTY_FRAME = { messages: [], phase: "idle", typing: false, delayMs: 0 };
16371
16408
  function prefersReducedMotion() {
16372
- return typeof window !== "undefined" && _optionalChain([window, 'access', _492 => _492.matchMedia, 'optionalCall', _493 => _493("(prefers-reduced-motion: reduce)"), 'access', _494 => _494.matches]) === true;
16409
+ return typeof window !== "undefined" && _optionalChain([window, 'access', _493 => _493.matchMedia, 'optionalCall', _494 => _494("(prefers-reduced-motion: reduce)"), 'access', _495 => _495.matches]) === true;
16373
16410
  }
16374
16411
  function useScriptedStream(frames, resetKey, enabled = true) {
16375
16412
  const [index, setIndex] = _react.useState.call(void 0, 0);
@@ -16380,7 +16417,7 @@ function useScriptedStream(frames, resetKey, enabled = true) {
16380
16417
  setIndex(0);
16381
16418
  }
16382
16419
  _react.useEffect.call(void 0, () => {
16383
- const mq = _optionalChain([window, 'access', _495 => _495.matchMedia, 'optionalCall', _496 => _496("(prefers-reduced-motion: reduce)")]);
16420
+ const mq = _optionalChain([window, 'access', _496 => _496.matchMedia, 'optionalCall', _497 => _497("(prefers-reduced-motion: reduce)")]);
16384
16421
  const sync = () => setReducedMotion(mq ? mq.matches : prefersReducedMotion());
16385
16422
  sync();
16386
16423
  if (!mq) return void 0;
@@ -16523,7 +16560,7 @@ function useJetStreamDialogSubscription({
16523
16560
  const lifecycle = _chunkI5JVSFNVcjs.startConnectionLifecycle.call(void 0, {
16524
16561
  conn: sharedConn,
16525
16562
  wsUrl,
16526
- onBeforeReconnect: () => _optionalChain([onBeforeReconnectRef, 'access', _497 => _497.current, 'optionalCall', _498 => _498()]),
16563
+ onBeforeReconnect: () => _optionalChain([onBeforeReconnectRef, 'access', _498 => _498.current, 'optionalCall', _499 => _499()]),
16527
16564
  backoff: reconnectionBackoffRef.current,
16528
16565
  getFreshUrl: () => getNatsWsUrlRef.current(),
16529
16566
  // JetStream emits 'error' for protocol-level failures (e.g. -ERR Permissions
@@ -16538,7 +16575,7 @@ function useJetStreamDialogSubscription({
16538
16575
  setReconnectionCount((c) => c + 1);
16539
16576
  }
16540
16577
  hadConnectionBeforeRef.current = true;
16541
- _optionalChain([onConnectRef, 'access', _499 => _499.current, 'optionalCall', _500 => _500()]);
16578
+ _optionalChain([onConnectRef, 'access', _500 => _500.current, 'optionalCall', _501 => _501()]);
16542
16579
  }
16543
16580
  if (status === "error") {
16544
16581
  console.warn("[JetStream] NATS protocol error:", evt.data);
@@ -16548,7 +16585,7 @@ function useJetStreamDialogSubscription({
16548
16585
  setIsConnected(false);
16549
16586
  setIsSubscribed(false);
16550
16587
  tearDownSubscription();
16551
- _optionalChain([onDisconnectRef, 'access', _501 => _501.current, 'optionalCall', _502 => _502()]);
16588
+ _optionalChain([onDisconnectRef, 'access', _502 => _502.current, 'optionalCall', _503 => _503()]);
16552
16589
  }
16553
16590
  }
16554
16591
  });
@@ -16674,7 +16711,7 @@ function useJetStreamDialogSubscription({
16674
16711
  }
16675
16712
  subscriptionRef.current = handle;
16676
16713
  setIsSubscribed(true);
16677
- _optionalChain([onSubscribedRef, 'access', _503 => _503.current, 'optionalCall', _504 => _504()]);
16714
+ _optionalChain([onSubscribedRef, 'access', _504 => _504.current, 'optionalCall', _505 => _505()]);
16678
16715
  } catch (e50) {
16679
16716
  if (!cancelled) {
16680
16717
  setIsSubscribed(false);
@@ -16790,20 +16827,20 @@ function useNatsDialogSubscription({
16790
16827
  const tearDownSubscriptions = () => {
16791
16828
  subscriptionRefs.current.forEach((sub) => {
16792
16829
  try {
16793
- _optionalChain([sub, 'optionalAccess', _505 => _505.unsubscribe, 'call', _506 => _506()]);
16830
+ _optionalChain([sub, 'optionalAccess', _506 => _506.unsubscribe, 'call', _507 => _507()]);
16794
16831
  } catch (e52) {
16795
16832
  }
16796
16833
  });
16797
16834
  subscriptionRefs.current.clear();
16798
16835
  lastSubscribedDialogIdRef.current = null;
16799
- _optionalChain([abortControllerRef, 'access', _507 => _507.current, 'optionalAccess', _508 => _508.abort, 'call', _509 => _509()]);
16836
+ _optionalChain([abortControllerRef, 'access', _508 => _508.current, 'optionalAccess', _509 => _509.abort, 'call', _510 => _510()]);
16800
16837
  abortControllerRef.current = null;
16801
16838
  };
16802
16839
  const isDisconnectStatus = (status) => status === "closed" || status === "disconnected";
16803
16840
  const lifecycle = _chunkI5JVSFNVcjs.startConnectionLifecycle.call(void 0, {
16804
16841
  conn: sharedConn,
16805
16842
  wsUrl,
16806
- onBeforeReconnect: () => _optionalChain([onBeforeReconnectRef, 'access', _510 => _510.current, 'optionalCall', _511 => _511()]),
16843
+ onBeforeReconnect: () => _optionalChain([onBeforeReconnectRef, 'access', _511 => _511.current, 'optionalCall', _512 => _512()]),
16807
16844
  backoff: reconnectionBackoffRef.current,
16808
16845
  getFreshUrl: () => getNatsWsUrlRef.current(),
16809
16846
  shouldRetryOn: isDisconnectStatus,
@@ -16814,7 +16851,7 @@ function useNatsDialogSubscription({
16814
16851
  setReconnectionCount((c) => c + 1);
16815
16852
  }
16816
16853
  hadConnectionBeforeRef.current = true;
16817
- _optionalChain([onConnectRef, 'access', _512 => _512.current, 'optionalCall', _513 => _513()]);
16854
+ _optionalChain([onConnectRef, 'access', _513 => _513.current, 'optionalCall', _514 => _514()]);
16818
16855
  }
16819
16856
  if (status === "error") {
16820
16857
  console.warn("[NATS] protocol error:", evt.data);
@@ -16824,7 +16861,7 @@ function useNatsDialogSubscription({
16824
16861
  setIsConnected(false);
16825
16862
  setIsSubscribed(false);
16826
16863
  tearDownSubscriptions();
16827
- _optionalChain([onDisconnectRef, 'access', _514 => _514.current, 'optionalCall', _515 => _515()]);
16864
+ _optionalChain([onDisconnectRef, 'access', _515 => _515.current, 'optionalCall', _516 => _516()]);
16828
16865
  }
16829
16866
  }
16830
16867
  });
@@ -16855,13 +16892,13 @@ function useNatsDialogSubscription({
16855
16892
  setIsSubscribed(false);
16856
16893
  subscriptionRefs.current.forEach((sub) => {
16857
16894
  try {
16858
- _optionalChain([sub, 'optionalAccess', _516 => _516.unsubscribe, 'call', _517 => _517()]);
16895
+ _optionalChain([sub, 'optionalAccess', _517 => _517.unsubscribe, 'call', _518 => _518()]);
16859
16896
  } catch (e53) {
16860
16897
  }
16861
16898
  });
16862
16899
  subscriptionRefs.current.clear();
16863
16900
  lastSubscribedDialogIdRef.current = null;
16864
- _optionalChain([abortControllerRef, 'access', _518 => _518.current, 'optionalAccess', _519 => _519.abort, 'call', _520 => _520()]);
16901
+ _optionalChain([abortControllerRef, 'access', _519 => _519.current, 'optionalAccess', _520 => _520.abort, 'call', _521 => _521()]);
16865
16902
  abortControllerRef.current = null;
16866
16903
  }
16867
16904
  return void 0;
@@ -16873,12 +16910,12 @@ function useNatsDialogSubscription({
16873
16910
  if (subscriptionRefs.current.size > 0) {
16874
16911
  subscriptionRefs.current.forEach((sub) => {
16875
16912
  try {
16876
- _optionalChain([sub, 'optionalAccess', _521 => _521.unsubscribe, 'call', _522 => _522()]);
16913
+ _optionalChain([sub, 'optionalAccess', _522 => _522.unsubscribe, 'call', _523 => _523()]);
16877
16914
  } catch (e54) {
16878
16915
  }
16879
16916
  });
16880
16917
  subscriptionRefs.current.clear();
16881
- _optionalChain([abortControllerRef, 'access', _523 => _523.current, 'optionalAccess', _524 => _524.abort, 'call', _525 => _525()]);
16918
+ _optionalChain([abortControllerRef, 'access', _524 => _524.current, 'optionalAccess', _525 => _525.abort, 'call', _526 => _526()]);
16882
16919
  }
16883
16920
  abortControllerRef.current = new AbortController();
16884
16921
  const abort = abortControllerRef.current;
@@ -16908,7 +16945,7 @@ function useNatsDialogSubscription({
16908
16945
  });
16909
16946
  lastSubscribedDialogIdRef.current = dialogId;
16910
16947
  setIsSubscribed(true);
16911
- _optionalChain([onSubscribedRef, 'access', _526 => _526.current, 'optionalCall', _527 => _527()]);
16948
+ _optionalChain([onSubscribedRef, 'access', _527 => _527.current, 'optionalCall', _528 => _528()]);
16912
16949
  };
16913
16950
  if (isConnectedRef.current) {
16914
16951
  createSubscriptions();
@@ -16919,7 +16956,7 @@ function useNatsDialogSubscription({
16919
16956
  abort.abort();
16920
16957
  subscriptions.forEach((sub) => {
16921
16958
  try {
16922
- _optionalChain([sub, 'optionalAccess', _528 => _528.unsubscribe, 'call', _529 => _529()]);
16959
+ _optionalChain([sub, 'optionalAccess', _529 => _529.unsubscribe, 'call', _530 => _530()]);
16923
16960
  } catch (e56) {
16924
16961
  }
16925
16962
  });
@@ -16958,7 +16995,7 @@ function useNatsDialogSubscription({
16958
16995
  });
16959
16996
  lastSubscribedDialogIdRef.current = currentDialogId;
16960
16997
  setIsSubscribed(true);
16961
- _optionalChain([onSubscribedRef, 'access', _530 => _530.current, 'optionalCall', _531 => _531()]);
16998
+ _optionalChain([onSubscribedRef, 'access', _531 => _531.current, 'optionalCall', _532 => _532()]);
16962
16999
  } else if (subscriptionRefs.current.size > 0) {
16963
17000
  setIsSubscribed(true);
16964
17001
  }
@@ -16966,10 +17003,10 @@ function useNatsDialogSubscription({
16966
17003
  return { isConnected, isSubscribed, reconnectionCount };
16967
17004
  }
16968
17005
  function buildNatsWsUrl(apiBaseUrl, options) {
16969
- const path = _optionalChain([options, 'optionalAccess', _532 => _532.source]) === "dashboard" ? "/ws/nats-api" : "/ws/nats";
17006
+ const path = _optionalChain([options, 'optionalAccess', _533 => _533.source]) === "dashboard" ? "/ws/nats-api" : "/ws/nats";
16970
17007
  const u = new URL(path, apiBaseUrl);
16971
17008
  u.protocol = u.protocol === "https:" ? "wss:" : "ws:";
16972
- if (_optionalChain([options, 'optionalAccess', _533 => _533.includeAuthParam]) && _optionalChain([options, 'optionalAccess', _534 => _534.token])) {
17009
+ if (_optionalChain([options, 'optionalAccess', _534 => _534.includeAuthParam]) && _optionalChain([options, 'optionalAccess', _535 => _535.token])) {
16973
17010
  u.searchParams.set("authorization", options.token);
16974
17011
  }
16975
17012
  return u.toString();
@@ -16987,7 +17024,7 @@ async function fetchSlashCommands(prefix, signal, commandsUrl) {
16987
17024
  const data = await res.json();
16988
17025
  return _nullishCoalesce(data.commands, () => ( []));
16989
17026
  } catch (err) {
16990
- if (_optionalChain([err, 'optionalAccess', _535 => _535.name]) === "AbortError") throw err;
17027
+ if (_optionalChain([err, 'optionalAccess', _536 => _536.name]) === "AbortError") throw err;
16991
17028
  console.warn("[chat] slash-commands fetch failed, showing none:", err);
16992
17029
  return [];
16993
17030
  }
@@ -16995,8 +17032,8 @@ async function fetchSlashCommands(prefix, signal, commandsUrl) {
16995
17032
  var NO_COMMANDS = [];
16996
17033
  function useSlashCommands(prefix, commandsUrl) {
16997
17034
  const [answered, setAnswered] = _react.useState.call(void 0, null);
16998
- const commands = prefix != null && _optionalChain([answered, 'optionalAccess', _536 => _536.prefix]) === prefix ? answered.commands : NO_COMMANDS;
16999
- const loading = prefix != null && _optionalChain([answered, 'optionalAccess', _537 => _537.prefix]) !== prefix;
17035
+ const commands = prefix != null && _optionalChain([answered, 'optionalAccess', _537 => _537.prefix]) === prefix ? answered.commands : NO_COMMANDS;
17036
+ const loading = prefix != null && _optionalChain([answered, 'optionalAccess', _538 => _538.prefix]) !== prefix;
17000
17037
  _react.useEffect.call(void 0, () => {
17001
17038
  if (prefix == null) return void 0;
17002
17039
  let cancelled = false;
@@ -17006,7 +17043,7 @@ function useSlashCommands(prefix, commandsUrl) {
17006
17043
  const next = await fetchSlashCommands(prefix, ctrl.signal, commandsUrl);
17007
17044
  if (!cancelled) setAnswered({ prefix, commands: next });
17008
17045
  } catch (err) {
17009
- if (!cancelled && _optionalChain([err, 'optionalAccess', _538 => _538.name]) !== "AbortError") {
17046
+ if (!cancelled && _optionalChain([err, 'optionalAccess', _539 => _539.name]) !== "AbortError") {
17010
17047
  console.warn("[use-slash-commands] fetch failed:", err);
17011
17048
  setAnswered({ prefix, commands: NO_COMMANDS });
17012
17049
  }
@@ -17029,7 +17066,7 @@ function useSlashCommandRegistry(commandsUrl, options) {
17029
17066
  const query = _reactquery.useQuery.call(void 0, {
17030
17067
  queryKey: ["chat-slash-commands", commandsUrl],
17031
17068
  queryFn: ({ signal }) => fetchSlashCommands("", signal, commandsUrl),
17032
- enabled: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _539 => _539.enabled]), () => ( true)),
17069
+ enabled: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _540 => _540.enabled]), () => ( true)),
17033
17070
  staleTime: Infinity,
17034
17071
  gcTime: Infinity,
17035
17072
  // The commands registry is non-critical chrome — a failure degrades to an
@@ -17068,21 +17105,21 @@ async function fetchEmptyStateConfig(signal, emptyStateUrl) {
17068
17105
  }
17069
17106
  const data = await res.json();
17070
17107
  return {
17071
- name: _nullishCoalesce(_optionalChain([data, 'optionalAccess', _540 => _540.name]), () => ( null)),
17072
- icon: _nullishCoalesce(_optionalChain([data, 'optionalAccess', _541 => _541.icon]), () => ( null)),
17073
- greeting: _nullishCoalesce(_optionalChain([data, 'optionalAccess', _542 => _542.greeting]), () => ( null)),
17074
- enabledRagTableIds: _nullishCoalesce(_optionalChain([data, 'optionalAccess', _543 => _543.enabledRagTableIds]), () => ( [])),
17075
- quickActions: _nullishCoalesce(_optionalChain([data, 'optionalAccess', _544 => _544.quickActions]), () => ( [])),
17076
- suggestedQueries: _nullishCoalesce(_optionalChain([data, 'optionalAccess', _545 => _545.suggestedQueries]), () => ( []))
17108
+ name: _nullishCoalesce(_optionalChain([data, 'optionalAccess', _541 => _541.name]), () => ( null)),
17109
+ icon: _nullishCoalesce(_optionalChain([data, 'optionalAccess', _542 => _542.icon]), () => ( null)),
17110
+ greeting: _nullishCoalesce(_optionalChain([data, 'optionalAccess', _543 => _543.greeting]), () => ( null)),
17111
+ enabledRagTableIds: _nullishCoalesce(_optionalChain([data, 'optionalAccess', _544 => _544.enabledRagTableIds]), () => ( [])),
17112
+ quickActions: _nullishCoalesce(_optionalChain([data, 'optionalAccess', _545 => _545.quickActions]), () => ( [])),
17113
+ suggestedQueries: _nullishCoalesce(_optionalChain([data, 'optionalAccess', _546 => _546.suggestedQueries]), () => ( []))
17077
17114
  };
17078
17115
  } catch (err) {
17079
- if (_optionalChain([err, 'optionalAccess', _546 => _546.name]) === "AbortError") throw err;
17116
+ if (_optionalChain([err, 'optionalAccess', _547 => _547.name]) === "AbortError") throw err;
17080
17117
  console.warn("[chat] empty-state config fetch failed, using neutral defaults:", err);
17081
17118
  return EMPTY_STATE_FALLBACK;
17082
17119
  }
17083
17120
  }
17084
17121
  function useEmptyStateConfig(emptyStateUrl, options) {
17085
- const enabled = (_nullishCoalesce(_optionalChain([options, 'optionalAccess', _547 => _547.enabled]), () => ( true))) && !!emptyStateUrl;
17122
+ const enabled = (_nullishCoalesce(_optionalChain([options, 'optionalAccess', _548 => _548.enabled]), () => ( true))) && !!emptyStateUrl;
17086
17123
  const query = _reactquery.useQuery.call(void 0, {
17087
17124
  queryKey: ["chat-empty-state", emptyStateUrl],
17088
17125
  queryFn: ({ signal }) => fetchEmptyStateConfig(signal, emptyStateUrl),
@@ -17111,7 +17148,7 @@ var CHAT_ATTACHMENT_MAX_SIZE_BYTES = 25 * 1024 * 1024;
17111
17148
  var STORAGE_CACHE_CONTROL_IMMUTABLE = "public, max-age=31536000, immutable";
17112
17149
  function uploadWithProgress(url, file, token, onProgress, signal) {
17113
17150
  return new Promise((resolve, reject) => {
17114
- if (_optionalChain([signal, 'optionalAccess', _548 => _548.aborted])) {
17151
+ if (_optionalChain([signal, 'optionalAccess', _549 => _549.aborted])) {
17115
17152
  reject(new Error("Upload cancelled"));
17116
17153
  return;
17117
17154
  }
@@ -17153,7 +17190,7 @@ function uploadWithProgress(url, file, token, onProgress, signal) {
17153
17190
  const handleSignalAbort = () => {
17154
17191
  xhr.abort();
17155
17192
  };
17156
- _optionalChain([signal, 'optionalAccess', _549 => _549.addEventListener, 'call', _550 => _550("abort", handleSignalAbort, { once: true, signal: listeners.signal })]);
17193
+ _optionalChain([signal, 'optionalAccess', _550 => _550.addEventListener, 'call', _551 => _551("abort", handleSignalAbort, { once: true, signal: listeners.signal })]);
17157
17194
  xhr.upload.addEventListener("progress", handleProgress, { signal: listeners.signal });
17158
17195
  xhr.addEventListener("load", handleLoad, { signal: listeners.signal });
17159
17196
  xhr.addEventListener("error", handleError, { signal: listeners.signal });
@@ -17197,10 +17234,10 @@ function useChatAttachments() {
17197
17234
  try {
17198
17235
  sniffed = await _filetype.fileTypeFromBlob.call(void 0, att.file);
17199
17236
  } catch (err) {
17200
- if (_optionalChain([ctrl, 'optionalAccess', _551 => _551.signal, 'access', _552 => _552.aborted])) return;
17237
+ if (_optionalChain([ctrl, 'optionalAccess', _552 => _552.signal, 'access', _553 => _553.aborted])) return;
17201
17238
  throw new Error(`Could not read file content: ${err instanceof Error ? err.message : String(err)}`);
17202
17239
  }
17203
- if (_optionalChain([ctrl, 'optionalAccess', _553 => _553.signal, 'access', _554 => _554.aborted])) return;
17240
+ if (_optionalChain([ctrl, 'optionalAccess', _554 => _554.signal, 'access', _555 => _555.aborted])) return;
17204
17241
  if (!sniffed) {
17205
17242
  throw new Error("Unrecognized file format");
17206
17243
  }
@@ -17214,7 +17251,7 @@ function useChatAttachments() {
17214
17251
  const urlResp = await _chunkEHAYNUOLcjs.embedAuthedFetch.call(void 0, uploadUrlEndpoint, {
17215
17252
  method: "POST",
17216
17253
  headers: { "Content-Type": "application/json" },
17217
- signal: _optionalChain([ctrl, 'optionalAccess', _555 => _555.signal]),
17254
+ signal: _optionalChain([ctrl, 'optionalAccess', _556 => _556.signal]),
17218
17255
  body: JSON.stringify({
17219
17256
  fileName: att.file.name,
17220
17257
  // Pass the SNIFFED MIME (not `file.type`, which can be a
@@ -17243,9 +17280,9 @@ function useChatAttachments() {
17243
17280
  (pct) => {
17244
17281
  updateOne(att.id, { progress: pct });
17245
17282
  },
17246
- _optionalChain([ctrl, 'optionalAccess', _556 => _556.signal])
17283
+ _optionalChain([ctrl, 'optionalAccess', _557 => _557.signal])
17247
17284
  );
17248
- if (_optionalChain([ctrl, 'optionalAccess', _557 => _557.signal, 'access', _558 => _558.aborted])) return;
17285
+ if (_optionalChain([ctrl, 'optionalAccess', _558 => _558.signal, 'access', _559 => _559.aborted])) return;
17249
17286
  updateOne(att.id, {
17250
17287
  status: "ready",
17251
17288
  progress: 100,
@@ -17253,7 +17290,7 @@ function useChatAttachments() {
17253
17290
  viewToken: mintData.viewToken
17254
17291
  });
17255
17292
  } catch (err) {
17256
- if (_optionalChain([ctrl, 'optionalAccess', _559 => _559.signal, 'access', _560 => _560.aborted])) return;
17293
+ if (_optionalChain([ctrl, 'optionalAccess', _560 => _560.signal, 'access', _561 => _561.aborted])) return;
17257
17294
  const message = err instanceof Error ? err.message : String(err);
17258
17295
  updateOne(att.id, { status: "error", progress: 0, errorMessage: message });
17259
17296
  } finally {
@@ -17402,11 +17439,11 @@ var ANON_DEFAULTS = {
17402
17439
  function useResolveChatIdentity(enabled) {
17403
17440
  const runtime = _chunkUPKZU6QUcjs.useRequiredChatRuntime.call(void 0, );
17404
17441
  const url = runtime.endpoints.identityUrl;
17405
- const proxyEmail = _nullishCoalesce(_optionalChain([_chunkEHAYNUOLcjs.getEmbedProxyAuth.call(void 0, ), 'optionalAccess', _561 => _561.email]), () => ( null));
17442
+ const proxyEmail = _nullishCoalesce(_optionalChain([_chunkEHAYNUOLcjs.getEmbedProxyAuth.call(void 0, ), 'optionalAccess', _562 => _562.email]), () => ( null));
17406
17443
  const requestKey = enabled ? `${url}\0${_nullishCoalesce(proxyEmail, () => ( ""))}` : null;
17407
17444
  const [resolved, setResolved] = _react.useState.call(void 0, null);
17408
- const data = _optionalChain([resolved, 'optionalAccess', _562 => _562.key]) === requestKey ? resolved.data : ANON_DEFAULTS;
17409
- const isLoading = requestKey !== null && _optionalChain([resolved, 'optionalAccess', _563 => _563.key]) !== requestKey;
17445
+ const data = _optionalChain([resolved, 'optionalAccess', _563 => _563.key]) === requestKey ? resolved.data : ANON_DEFAULTS;
17446
+ const isLoading = requestKey !== null && _optionalChain([resolved, 'optionalAccess', _564 => _564.key]) !== requestKey;
17410
17447
  _react.useEffect.call(void 0, () => {
17411
17448
  if (requestKey === null) return void 0;
17412
17449
  let cancelled = false;
@@ -17553,7 +17590,7 @@ function useChat({
17553
17590
  onMessagesChangeRef.current = onMessagesChange;
17554
17591
  });
17555
17592
  _react.useEffect.call(void 0, () => {
17556
- _optionalChain([onMessagesChangeRef, 'access', _564 => _564.current, 'optionalCall', _565 => _565(messages)]);
17593
+ _optionalChain([onMessagesChangeRef, 'access', _565 => _565.current, 'optionalCall', _566 => _566(messages)]);
17557
17594
  }, [messages]);
17558
17595
  const {
17559
17596
  streamMessage,
@@ -17583,14 +17620,14 @@ function useChat({
17583
17620
  });
17584
17621
  }, []);
17585
17622
  const sendMessage = _react.useCallback.call(void 0,
17586
- async (text, extra, options) => {
17623
+ async (text2, extra, options) => {
17587
17624
  const userMessage = {
17588
17625
  id: `user-${Date.now()}`,
17589
17626
  role: "user",
17590
17627
  name: "You",
17591
- content: text,
17628
+ content: text2,
17592
17629
  timestamp: /* @__PURE__ */ new Date(),
17593
- ..._optionalChain([options, 'optionalAccess', _566 => _566.hidden]) ? { hidden: true } : {}
17630
+ ..._optionalChain([options, 'optionalAccess', _567 => _567.hidden]) ? { hidden: true } : {}
17594
17631
  };
17595
17632
  addMessage(userMessage);
17596
17633
  setIsTyping(true);
@@ -17607,7 +17644,7 @@ function useChat({
17607
17644
  try {
17608
17645
  let receivedFirstTextChunk = false;
17609
17646
  let currentTextSegment = "";
17610
- for await (const rawSegment of streamMessage(text, extra)) {
17647
+ for await (const rawSegment of streamMessage(text2, extra)) {
17611
17648
  const segment = asStreamFrame(rawSegment);
17612
17649
  if (!receivedFirstTextChunk && segment.type === "text") {
17613
17650
  setIsTyping(false);
@@ -17804,7 +17841,7 @@ function buildConfirmToolBody(request) {
17804
17841
  async function readServerErrorMessage(response) {
17805
17842
  try {
17806
17843
  const body = await response.json();
17807
- if (typeof _optionalChain([body, 'optionalAccess', _567 => _567.error]) === "string" && body.error.length > 0) return body.error;
17844
+ if (typeof _optionalChain([body, 'optionalAccess', _568 => _568.error]) === "string" && body.error.length > 0) return body.error;
17808
17845
  } catch (e58) {
17809
17846
  }
17810
17847
  return null;
@@ -17816,8 +17853,8 @@ var END_OF_LEADING = "";
17816
17853
  var TRAILER_SENTINEL = "";
17817
17854
 
17818
17855
  // src/chat-protocol/leading-frames.ts
17819
- function escapeThinkingTags(text) {
17820
- return text.replace(/</g, "&lt;");
17856
+ function escapeThinkingTags(text2) {
17857
+ return text2.replace(/</g, "&lt;");
17821
17858
  }
17822
17859
  function frameStr(value) {
17823
17860
  return typeof value === "string" ? value : void 0;
@@ -17928,11 +17965,11 @@ function isFrameObject(value) {
17928
17965
  }
17929
17966
  function frameTelemetry(value) {
17930
17967
  if (!isFrameObject(value)) return void 0;
17931
- const { cards, chips, sentences, answerLen } = value;
17932
- if (typeof cards !== "number" || typeof chips !== "number" || typeof sentences !== "number" || typeof answerLen !== "number") {
17968
+ const { cards: cards2, chips, sentences, answerLen } = value;
17969
+ if (typeof cards2 !== "number" || typeof chips !== "number" || typeof sentences !== "number" || typeof answerLen !== "number") {
17933
17970
  return void 0;
17934
17971
  }
17935
- return { cards, chips, sentences, answerLen };
17972
+ return { cards: cards2, chips, sentences, answerLen };
17936
17973
  }
17937
17974
  function createSseFrameDecoder() {
17938
17975
  const textDecoder = new TextDecoder();
@@ -18073,6 +18110,207 @@ function errorDetailsMessage(details) {
18073
18110
  }
18074
18111
  var CHAT_OWNER_ADMIN = "ADMIN";
18075
18112
 
18113
+ // src/chat-protocol/wire-narrow.ts
18114
+ function isRecord(value) {
18115
+ return typeof value === "object" && value !== null;
18116
+ }
18117
+ function unwrapEnvelope(payload) {
18118
+ return isRecord(payload) && "data" in payload ? payload.data : payload;
18119
+ }
18120
+
18121
+ // src/chat-protocol/source-metadata.ts
18122
+ var YOUTUBE_ID = /^[A-Za-z0-9_-]{11}$/;
18123
+ var VIDEO_URL_KEYS = ["videoUrl", "highlightVideoUrl", "videoPoster", "highlightVideoPoster"];
18124
+ function text(value) {
18125
+ if (typeof value !== "string") return void 0;
18126
+ const trimmed = value.trim();
18127
+ return trimmed || void 0;
18128
+ }
18129
+ function nullableText(value) {
18130
+ return value === null ? null : text(value);
18131
+ }
18132
+ function httpsUrl(value) {
18133
+ const candidate = text(value);
18134
+ if (!candidate) return void 0;
18135
+ try {
18136
+ return new URL(candidate).protocol === "https:" ? candidate : void 0;
18137
+ } catch (e62) {
18138
+ return void 0;
18139
+ }
18140
+ }
18141
+ function youtubeVideoId(value) {
18142
+ const candidate = text(value);
18143
+ if (!candidate) return void 0;
18144
+ if (YOUTUBE_ID.test(candidate)) return candidate;
18145
+ const url = httpsUrl(candidate);
18146
+ if (!url) return void 0;
18147
+ const parsed = new URL(url);
18148
+ const hostname = parsed.hostname.toLowerCase();
18149
+ const isYoutubeHost = hostname === "youtu.be" || hostname === "youtube.com" || hostname.endsWith(".youtube.com");
18150
+ if (!isYoutubeHost) return void 0;
18151
+ const fromPath = hostname === "youtu.be" ? parsed.pathname.split("/").filter(Boolean)[0] : _optionalChain([/^\/(?:embed|v|shorts)\/([A-Za-z0-9_-]{11})(?:\/|$)/, 'access', _569 => _569.exec, 'call', _570 => _570(parsed.pathname), 'optionalAccess', _571 => _571[1]]);
18152
+ const id = _nullishCoalesce(_nullishCoalesce(fromPath, () => ( parsed.searchParams.get("v"))), () => ( void 0));
18153
+ return id && YOUTUBE_ID.test(id) ? id : void 0;
18154
+ }
18155
+ function sourceItems(value) {
18156
+ if (!Array.isArray(value)) return void 0;
18157
+ const items = value.filter(isRecord).flatMap((item) => {
18158
+ const id = text(item.id);
18159
+ const documentType = text(item.documentType);
18160
+ const name = text(item.name);
18161
+ if (!id || !documentType || !name) return [];
18162
+ const externalUrl = httpsUrl(item.externalUrl);
18163
+ const targetPlatform = nullableText(item.targetPlatform);
18164
+ const path = nullableText(item.path);
18165
+ return [
18166
+ {
18167
+ id,
18168
+ documentType,
18169
+ name,
18170
+ ...externalUrl ? { externalUrl } : {},
18171
+ ...targetPlatform !== void 0 ? { targetPlatform } : {},
18172
+ ...path !== void 0 ? { path } : {}
18173
+ }
18174
+ ];
18175
+ });
18176
+ return items.length > 0 ? items : void 0;
18177
+ }
18178
+ function sources(value) {
18179
+ if (!Array.isArray(value)) return [];
18180
+ const claimed = /* @__PURE__ */ new Set();
18181
+ const decoded = [];
18182
+ for (const candidate of value) {
18183
+ if (!isRecord(candidate)) continue;
18184
+ const index = candidate.index;
18185
+ const name = text(candidate.name);
18186
+ const isUsableIndex = typeof index === "number" && Number.isInteger(index) && index > 0 && !claimed.has(index);
18187
+ if (!isUsableIndex || !name) continue;
18188
+ claimed.add(index);
18189
+ const path = text(candidate.path);
18190
+ const documentType = text(candidate.documentType);
18191
+ const externalUrl = httpsUrl(candidate.externalUrl);
18192
+ const targetPlatform = nullableText(candidate.targetPlatform);
18193
+ const id = text(candidate.id);
18194
+ const sourceRepo = text(candidate.sourceRepo);
18195
+ const label = text(candidate.label);
18196
+ const items = sourceItems(candidate.items);
18197
+ decoded.push({
18198
+ index,
18199
+ name,
18200
+ // Both are typed non-optional on `ChatSource` and predate this decoder;
18201
+ // '' is the established "no value" for them across the SSE path.
18202
+ path: _nullishCoalesce(path, () => ( "")),
18203
+ documentType: _nullishCoalesce(documentType, () => ( "")),
18204
+ ...externalUrl ? { externalUrl } : {},
18205
+ ...targetPlatform !== void 0 ? { targetPlatform } : {},
18206
+ ...id ? { id } : {},
18207
+ ...sourceRepo ? { sourceRepo } : {},
18208
+ ...label ? { label } : {},
18209
+ ...items ? { items } : {}
18210
+ });
18211
+ }
18212
+ return decoded;
18213
+ }
18214
+ function videoMetadata(value, url) {
18215
+ const metadata = {};
18216
+ if (isRecord(value)) {
18217
+ for (const key of VIDEO_URL_KEYS) {
18218
+ const validated = httpsUrl(value[key]);
18219
+ if (validated) metadata[key] = validated;
18220
+ }
18221
+ const declaredId = youtubeVideoId(value.youtubeUrl);
18222
+ if (declaredId) metadata.youtubeUrl = declaredId;
18223
+ }
18224
+ if (url) {
18225
+ const idFromUrl = youtubeVideoId(url);
18226
+ if (idFromUrl) {
18227
+ metadata.youtubeUrl = idFromUrl;
18228
+ delete metadata.videoUrl;
18229
+ } else {
18230
+ metadata.videoUrl = url;
18231
+ delete metadata.youtubeUrl;
18232
+ }
18233
+ }
18234
+ return metadata;
18235
+ }
18236
+ function videos(value) {
18237
+ if (!Array.isArray(value)) return [];
18238
+ return value.filter(isRecord).flatMap((video) => {
18239
+ const match = typeof video.ref === "string" ? CARD_REFERENCE.exec(video.ref) : null;
18240
+ if (!match || match[1] !== "video") return [];
18241
+ const id = match[2];
18242
+ const url = _nullishCoalesce(httpsUrl(video.url), () => ( null));
18243
+ const sourceRepo = text(video.sourceRepo);
18244
+ const metadata = videoMetadata(video.metadata, url);
18245
+ return [
18246
+ {
18247
+ type: "video",
18248
+ id,
18249
+ title: _nullishCoalesce(text(video.title), () => ( id)),
18250
+ url,
18251
+ ...sourceRepo ? { sourceRepo } : {},
18252
+ ...Object.keys(metadata).length > 0 ? { metadata } : {}
18253
+ }
18254
+ ];
18255
+ });
18256
+ }
18257
+ function cards(value, decodedSources) {
18258
+ if (!Array.isArray(value)) return [];
18259
+ return value.filter(isRecord).flatMap((card) => {
18260
+ const match = typeof card.ref === "string" ? CARD_REFERENCE.exec(card.ref) : null;
18261
+ if (!match || match[1] === "video") return [];
18262
+ const type = text(card.entityType);
18263
+ const id = text(card.entityId);
18264
+ if (!type || !id || type !== match[1] || id !== match[2]) return [];
18265
+ const source = decodedSources.find((candidate) => candidate.id === id && candidate.documentType === type);
18266
+ return [
18267
+ {
18268
+ type,
18269
+ id,
18270
+ title: _nullishCoalesce(_optionalChain([source, 'optionalAccess', _572 => _572.name]), () => ( id)),
18271
+ url: _nullishCoalesce(_optionalChain([source, 'optionalAccess', _573 => _573.externalUrl]), () => ( null)),
18272
+ ..._optionalChain([source, 'optionalAccess', _574 => _574.sourceRepo]) ? { sourceRepo: source.sourceRepo } : {},
18273
+ ..._optionalChain([source, 'optionalAccess', _575 => _575.targetPlatform]) !== void 0 ? { targetPlatform: source.targetPlatform } : {},
18274
+ ..._optionalChain([source, 'optionalAccess', _576 => _576.path]) ? { metadata: { path: source.path } } : {}
18275
+ }
18276
+ ];
18277
+ });
18278
+ }
18279
+ function deduplicateRefs(refs) {
18280
+ const byIdentity = /* @__PURE__ */ new Map();
18281
+ for (const ref of refs) {
18282
+ const identity = `${ref.type}:${ref.id}`;
18283
+ if (!byIdentity.has(identity)) byIdentity.set(identity, ref);
18284
+ }
18285
+ return [...byIdentity.values()];
18286
+ }
18287
+ function sourceMetadataEvent(payload) {
18288
+ if (!isRecord(payload)) return null;
18289
+ const decodedSources = sources(payload.sources);
18290
+ const refs = deduplicateRefs([...videos(payload.videos), ...cards(payload.cards, decodedSources)]);
18291
+ if (decodedSources.length === 0 && refs.length === 0) return null;
18292
+ return {
18293
+ type: "sources",
18294
+ ...decodedSources.length > 0 ? { sources: decodedSources } : {},
18295
+ ...refs.length > 0 ? { refs } : {}
18296
+ };
18297
+ }
18298
+ function mergeSourceMetadata(previous, event) {
18299
+ const byIndex = /* @__PURE__ */ new Map();
18300
+ for (const source of [..._nullishCoalesce(_optionalChain([previous, 'optionalAccess', _577 => _577.sources]), () => ( [])), ..._nullishCoalesce(event.sources, () => ( []))]) {
18301
+ if (!byIndex.has(source.index)) byIndex.set(source.index, source);
18302
+ }
18303
+ const byIdentity = /* @__PURE__ */ new Map();
18304
+ for (const ref of [..._nullishCoalesce(_optionalChain([previous, 'optionalAccess', _578 => _578.refs]), () => ( [])), ..._nullishCoalesce(event.refs, () => ( []))]) {
18305
+ const identity = `${ref.type}:${ref.id}`;
18306
+ if (!byIdentity.has(identity)) byIdentity.set(identity, ref);
18307
+ }
18308
+ return {
18309
+ ...byIndex.size > 0 ? { sources: [...byIndex.values()] } : {},
18310
+ ...byIdentity.size > 0 ? { refs: [...byIdentity.values()] } : {}
18311
+ };
18312
+ }
18313
+
18076
18314
  // src/components/chat/utils/approval-display.ts
18077
18315
  function approvalDisplaysInline(approvalType, displayApprovalTypes) {
18078
18316
  return !displayApprovalTypes || displayApprovalTypes.includes(approvalType);
@@ -18149,9 +18387,9 @@ function appendToTrailingAssistant(prev, segments) {
18149
18387
  for (const seg of segments) {
18150
18388
  const tail = merged[merged.length - 1];
18151
18389
  const key = upsertKey(seg);
18152
- if (seg.type === "text" && _optionalChain([tail, 'optionalAccess', _568 => _568.type]) === "text") {
18390
+ if (seg.type === "text" && _optionalChain([tail, 'optionalAccess', _579 => _579.type]) === "text") {
18153
18391
  merged[merged.length - 1] = { type: "text", text: tail.text + seg.text };
18154
- } else if (seg.type === "thinking" && _optionalChain([tail, 'optionalAccess', _569 => _569.type]) === "thinking") {
18392
+ } else if (seg.type === "thinking" && _optionalChain([tail, 'optionalAccess', _580 => _580.type]) === "thinking") {
18155
18393
  merged[merged.length - 1] = { type: "thinking", text: tail.text + seg.text };
18156
18394
  } else if (key) {
18157
18395
  let idx = merged.findIndex((m) => upsertKey(m) === key);
@@ -18192,7 +18430,7 @@ function applyApprovalStatusToSegment(s, requestId, status, resolvedByName) {
18192
18430
  }
18193
18431
  if (s.type !== "approval_batch") return s;
18194
18432
  const isAnchor = s.data.approvalRequestId === requestId;
18195
- const hasRow = _optionalChain([s, 'access', _570 => _570.data, 'access', _571 => _571.toolCalls, 'optionalAccess', _572 => _572.some, 'call', _573 => _573((c) => c.toolExecutionRequestId === requestId)]);
18433
+ const hasRow = _optionalChain([s, 'access', _581 => _581.data, 'access', _582 => _582.toolCalls, 'optionalAccess', _583 => _583.some, 'call', _584 => _584((c) => c.toolExecutionRequestId === requestId)]);
18196
18434
  if (!isAnchor && !hasRow) return s;
18197
18435
  const nextResolvedBy = _nullishCoalesce(resolvedByName, () => ( s.resolvedByName));
18198
18436
  const nextExecutions = hasRow ? {
@@ -18214,8 +18452,8 @@ function applyApprovalStatusToSegment(s, requestId, status, resolvedByName) {
18214
18452
  };
18215
18453
  }
18216
18454
  function nextBatchExecution(prevExec, toolData) {
18217
- if (toolData.type === "EXECUTING_TOOL" && _optionalChain([prevExec, 'optionalAccess', _574 => _574.status]) === "done") return null;
18218
- return toolData.type === "EXECUTED_TOOL" ? { status: "done", result: toolData.result, success: toolData.success } : { status: "executing", result: _optionalChain([prevExec, 'optionalAccess', _575 => _575.result]), success: _optionalChain([prevExec, 'optionalAccess', _576 => _576.success]) };
18455
+ if (toolData.type === "EXECUTING_TOOL" && _optionalChain([prevExec, 'optionalAccess', _585 => _585.status]) === "done") return null;
18456
+ return toolData.type === "EXECUTED_TOOL" ? { status: "done", result: toolData.result, success: toolData.success } : { status: "executing", result: _optionalChain([prevExec, 'optionalAccess', _586 => _586.result]), success: _optionalChain([prevExec, 'optionalAccess', _587 => _587.success]) };
18219
18457
  }
18220
18458
  function withBatchExecution(seg, execId, state) {
18221
18459
  return {
@@ -18232,11 +18470,11 @@ function projectBatchStatusToMessages(prev, anchorId, status) {
18232
18470
  }
18233
18471
  function projectBatchRowFailureToMessages(prev, rowRequestId) {
18234
18472
  return mapSegments(prev, (s) => {
18235
- if (s.type !== "approval_batch" || !_optionalChain([s, 'access', _577 => _577.data, 'access', _578 => _578.toolCalls, 'optionalAccess', _579 => _579.some, 'call', _580 => _580((c) => c.toolExecutionRequestId === rowRequestId)])) {
18473
+ if (s.type !== "approval_batch" || !_optionalChain([s, 'access', _588 => _588.data, 'access', _589 => _589.toolCalls, 'optionalAccess', _590 => _590.some, 'call', _591 => _591((c) => c.toolExecutionRequestId === rowRequestId)])) {
18236
18474
  return s;
18237
18475
  }
18238
- const existing = _optionalChain([s, 'access', _581 => _581.data, 'access', _582 => _582.executions, 'optionalAccess', _583 => _583[rowRequestId]]);
18239
- if (_optionalChain([existing, 'optionalAccess', _584 => _584.status]) === "done") return s;
18476
+ const existing = _optionalChain([s, 'access', _592 => _592.data, 'access', _593 => _593.executions, 'optionalAccess', _594 => _594[rowRequestId]]);
18477
+ if (_optionalChain([existing, 'optionalAccess', _595 => _595.status]) === "done") return s;
18240
18478
  return withBatchExecution(s, rowRequestId, { status: "done", success: false });
18241
18479
  });
18242
18480
  }
@@ -18272,7 +18510,7 @@ function mergeToolExecutionIfPresent(prev, segment) {
18272
18510
  for (let j = message.segments.length - 1; j >= 0; j--) {
18273
18511
  const seg = message.segments[j];
18274
18512
  if (execId && seg.type === "approval_batch" && seg.data.toolCalls.some((c) => c.toolExecutionRequestId === execId)) {
18275
- const prevExec = _optionalChain([seg, 'access', _585 => _585.data, 'access', _586 => _586.executions, 'optionalAccess', _587 => _587[execId]]);
18513
+ const prevExec = _optionalChain([seg, 'access', _596 => _596.data, 'access', _597 => _597.executions, 'optionalAccess', _598 => _598[execId]]);
18276
18514
  const nextExec = nextBatchExecution(prevExec, toolData);
18277
18515
  if (nextExec === null) return prev;
18278
18516
  if (sameExecutionState(prevExec, nextExec)) return prev;
@@ -18374,12 +18612,12 @@ var MessageSegmentAccumulator = class {
18374
18612
  * Append text to the current message
18375
18613
  * If the last segment is text, append to it; otherwise create a new text segment
18376
18614
  */
18377
- appendText(text) {
18615
+ appendText(text2) {
18378
18616
  const lastSegment = this.segments[this.segments.length - 1];
18379
18617
  if (lastSegment && lastSegment.type === "text") {
18380
- this.segments[this.segments.length - 1] = { type: "text", text: lastSegment.text + text };
18618
+ this.segments[this.segments.length - 1] = { type: "text", text: lastSegment.text + text2 };
18381
18619
  } else {
18382
- this.segments.push({ type: "text", text });
18620
+ this.segments.push({ type: "text", text: text2 });
18383
18621
  }
18384
18622
  return this.getSegments();
18385
18623
  }
@@ -18387,12 +18625,12 @@ var MessageSegmentAccumulator = class {
18387
18625
  * Append thinking text to the current message.
18388
18626
  * If the last segment is thinking, append to it; otherwise start a new thinking segment.
18389
18627
  */
18390
- appendThinking(text) {
18628
+ appendThinking(text2) {
18391
18629
  const lastSegment = this.segments[this.segments.length - 1];
18392
18630
  if (lastSegment && lastSegment.type === "thinking") {
18393
- this.segments[this.segments.length - 1] = { type: "thinking", text: lastSegment.text + text };
18631
+ this.segments[this.segments.length - 1] = { type: "thinking", text: lastSegment.text + text2 };
18394
18632
  } else {
18395
- this.segments.push({ type: "thinking", text });
18633
+ this.segments.push({ type: "thinking", text: text2 });
18396
18634
  }
18397
18635
  return this.getSegments();
18398
18636
  }
@@ -18445,9 +18683,9 @@ var MessageSegmentAccumulator = class {
18445
18683
  type: "tool_execution",
18446
18684
  data: {
18447
18685
  ...toolData,
18448
- toolTitle: _nullishCoalesce(_nullishCoalesce(toolData.toolTitle, () => ( _optionalChain([existingExecuting, 'optionalAccess', _588 => _588.data, 'access', _589 => _589.toolTitle]))), () => ( _optionalChain([executingTool, 'optionalAccess', _590 => _590.toolTitle]))),
18449
- toolExplanation: _nullishCoalesce(_nullishCoalesce(toolData.toolExplanation, () => ( _optionalChain([existingExecuting, 'optionalAccess', _591 => _591.data, 'access', _592 => _592.toolExplanation]))), () => ( _optionalChain([executingTool, 'optionalAccess', _593 => _593.toolExplanation]))),
18450
- parameters: toolData.parameters || _optionalChain([executingTool, 'optionalAccess', _594 => _594.parameters])
18686
+ toolTitle: _nullishCoalesce(_nullishCoalesce(toolData.toolTitle, () => ( _optionalChain([existingExecuting, 'optionalAccess', _599 => _599.data, 'access', _600 => _600.toolTitle]))), () => ( _optionalChain([executingTool, 'optionalAccess', _601 => _601.toolTitle]))),
18687
+ toolExplanation: _nullishCoalesce(_nullishCoalesce(toolData.toolExplanation, () => ( _optionalChain([existingExecuting, 'optionalAccess', _602 => _602.data, 'access', _603 => _603.toolExplanation]))), () => ( _optionalChain([executingTool, 'optionalAccess', _604 => _604.toolExplanation]))),
18688
+ parameters: toolData.parameters || _optionalChain([executingTool, 'optionalAccess', _605 => _605.parameters])
18451
18689
  }
18452
18690
  };
18453
18691
  if (existingIndex !== -1) {
@@ -18471,7 +18709,7 @@ var MessageSegmentAccumulator = class {
18471
18709
  if (seg.type !== "approval_batch") return seg;
18472
18710
  const hasCall = seg.data.toolCalls.some((c) => c.toolExecutionRequestId === execId);
18473
18711
  if (!hasCall) return seg;
18474
- const prev = _optionalChain([seg, 'access', _595 => _595.data, 'access', _596 => _596.executions, 'optionalAccess', _597 => _597[execId]]);
18712
+ const prev = _optionalChain([seg, 'access', _606 => _606.data, 'access', _607 => _607.executions, 'optionalAccess', _608 => _608[execId]]);
18475
18713
  const next = nextBatchExecution(prev, toolData);
18476
18714
  matched = true;
18477
18715
  if (next === null) return seg;
@@ -18605,8 +18843,8 @@ var MessageSegmentAccumulator = class {
18605
18843
  requestId,
18606
18844
  {
18607
18845
  ...pendingApproval,
18608
- command: _optionalChain([pendingApproval, 'optionalAccess', _598 => _598.command]) || "",
18609
- approvalType: _optionalChain([pendingApproval, 'optionalAccess', _599 => _599.approvalType]) || approvalType
18846
+ command: _optionalChain([pendingApproval, 'optionalAccess', _609 => _609.command]) || "",
18847
+ approvalType: _optionalChain([pendingApproval, 'optionalAccess', _610 => _610.approvalType]) || approvalType
18610
18848
  },
18611
18849
  status
18612
18850
  );
@@ -18622,7 +18860,7 @@ var MessageSegmentAccumulator = class {
18622
18860
  * `[existing..., new...]` back through `replaySegments`, which would
18623
18861
  * otherwise yield two cards for one offer.
18624
18862
  */
18625
- addEscalationOffer(offerId, text, origin, status = "pending", resolvedByName) {
18863
+ addEscalationOffer(offerId, text2, origin, status = "pending", resolvedByName) {
18626
18864
  const existingIndex = this.segments.findIndex(
18627
18865
  (s) => s.type === "escalation_offer" && s.data.offerId === offerId
18628
18866
  );
@@ -18631,9 +18869,9 @@ var MessageSegmentAccumulator = class {
18631
18869
  type: "escalation_offer",
18632
18870
  // The resolved chunk carries no text/origin — a redelivered offer must
18633
18871
  // not blank the card the PENDING chunk already painted.
18634
- data: { offerId, text: text || _optionalChain([existing, 'optionalAccess', _600 => _600.data, 'access', _601 => _601.text]) || "", origin: _nullishCoalesce(origin, () => ( _optionalChain([existing, 'optionalAccess', _602 => _602.data, 'access', _603 => _603.origin]))) },
18872
+ data: { offerId, text: text2 || _optionalChain([existing, 'optionalAccess', _611 => _611.data, 'access', _612 => _612.text]) || "", origin: _nullishCoalesce(origin, () => ( _optionalChain([existing, 'optionalAccess', _613 => _613.data, 'access', _614 => _614.origin]))) },
18635
18873
  status,
18636
- resolvedByName: _nullishCoalesce(resolvedByName, () => ( _optionalChain([existing, 'optionalAccess', _604 => _604.resolvedByName]))),
18874
+ resolvedByName: _nullishCoalesce(resolvedByName, () => ( _optionalChain([existing, 'optionalAccess', _615 => _615.resolvedByName]))),
18637
18875
  onApprove: this.callbacks.onEscalationApprove,
18638
18876
  onReject: this.callbacks.onEscalationReject
18639
18877
  };
@@ -18922,12 +19160,12 @@ function createChatStreamReducer(options = {}) {
18922
19160
  let lastAppliedSeq = Number.NEGATIVE_INFINITY;
18923
19161
  let pendingEchoTexts = [];
18924
19162
  let turnStartedAt = 0;
18925
- function consumeOwnEcho(text, authorMatched = false) {
19163
+ function consumeOwnEcho(text2, authorMatched = false) {
18926
19164
  if (pendingEchoTexts.length === 0) return false;
18927
19165
  const now = Date.now();
18928
19166
  pendingEchoTexts = pendingEchoTexts.filter((e) => now - e.at < OWN_ECHO_AUTHOR_TTL_MS);
18929
19167
  const ttl = authorMatched ? OWN_ECHO_AUTHOR_TTL_MS : OWN_ECHO_TTL_MS;
18930
- const idx = pendingEchoTexts.findIndex((e) => e.text === text && now - e.at < ttl);
19168
+ const idx = pendingEchoTexts.findIndex((e) => e.text === text2 && now - e.at < ttl);
18931
19169
  if (idx === -1) return false;
18932
19170
  pendingEchoTexts.splice(idx, 1);
18933
19171
  return true;
@@ -18958,7 +19196,7 @@ function createChatStreamReducer(options = {}) {
18958
19196
  let stateCache = null;
18959
19197
  function invalidate() {
18960
19198
  stateCache = null;
18961
- _optionalChain([onChange, 'optionalCall', _605 => _605()]);
19199
+ _optionalChain([onChange, 'optionalCall', _616 => _616()]);
18962
19200
  }
18963
19201
  function getState() {
18964
19202
  if (!stateCache) {
@@ -18974,7 +19212,7 @@ function createChatStreamReducer(options = {}) {
18974
19212
  return stateCache;
18975
19213
  }
18976
19214
  function emit(name, ...args) {
18977
- _optionalChain([onEffect, 'optionalCall', _606 => _606({ name, args })]);
19215
+ _optionalChain([onEffect, 'optionalCall', _617 => _617({ name, args })]);
18978
19216
  }
18979
19217
  function setMessagesInternal(next) {
18980
19218
  if (next !== messages) {
@@ -19004,17 +19242,29 @@ function createChatStreamReducer(options = {}) {
19004
19242
  if (typeof last.streamSeq === "number" && last.streamSeq >= seq) return next;
19005
19243
  return [...next.slice(0, -1), { ...last, streamSeq: seq }];
19006
19244
  }
19245
+ let turnSourceMetadata = null;
19246
+ function stampTrailingAssistantSourceMetadata(next) {
19247
+ const metadata = turnSourceMetadata;
19248
+ if (!metadata) return next;
19249
+ const last = next[next.length - 1];
19250
+ if (!last || last.role !== "assistant") return next;
19251
+ if (last.sources === metadata.sources && last.refs === metadata.refs) return next;
19252
+ return [...next.slice(0, -1), { ...last, ...metadata }];
19253
+ }
19254
+ function commitTrailingAssistant(next, seq) {
19255
+ return stampTrailingAssistantSourceMetadata(stampTrailingAssistantSeq(next, seq));
19256
+ }
19007
19257
  function applySegmentsToState(segments, meta) {
19008
- const seq = _optionalChain([meta, 'optionalAccess', _607 => _607.streamSeq]);
19009
- if (_optionalChain([meta, 'optionalAccess', _608 => _608.append]) && meta.isCompacting) {
19010
- setMessagesInternal(stampTrailingAssistantSeq(upsertTrailingCompaction(messages, segments), seq));
19258
+ const seq = _optionalChain([meta, 'optionalAccess', _618 => _618.streamSeq]);
19259
+ if (_optionalChain([meta, 'optionalAccess', _619 => _619.append]) && meta.isCompacting) {
19260
+ setMessagesInternal(commitTrailingAssistant(upsertTrailingCompaction(messages, segments), seq));
19011
19261
  return;
19012
19262
  }
19013
- if (_optionalChain([meta, 'optionalAccess', _609 => _609.append])) {
19014
- setMessagesInternal(stampTrailingAssistantSeq(appendToTrailingAssistant(messages, segments), seq));
19263
+ if (_optionalChain([meta, 'optionalAccess', _620 => _620.append])) {
19264
+ setMessagesInternal(commitTrailingAssistant(appendToTrailingAssistant(messages, segments), seq));
19015
19265
  return;
19016
19266
  }
19017
- setMessagesInternal(stampTrailingAssistantSeq(updateTrailingAssistant(messages, segments), seq));
19267
+ setMessagesInternal(commitTrailingAssistant(updateTrailingAssistant(messages, segments), seq));
19018
19268
  }
19019
19269
  function applyStreamStartToState() {
19020
19270
  setPhaseInternal("streaming");
@@ -19022,13 +19272,13 @@ function createChatStreamReducer(options = {}) {
19022
19272
  adoptTrailingAssistant = false;
19023
19273
  const last = messages[messages.length - 1];
19024
19274
  if (!last || last.role !== "assistant" || adoptTail) return;
19025
- const hasContent = (_nullishCoalesce(_optionalChain([last, 'access', _610 => _610.segments, 'optionalAccess', _611 => _611.length]), () => ( 0))) > 0 || last.content !== "";
19275
+ const hasContent = (_nullishCoalesce(_optionalChain([last, 'access', _621 => _621.segments, 'optionalAccess', _622 => _622.length]), () => ( 0))) > 0 || last.content !== "";
19026
19276
  if (!hasContent) return;
19027
19277
  setMessagesInternal([...messages, { id: nextId("assistant"), role: "assistant", content: "", segments: [] }]);
19028
19278
  }
19029
19279
  function applyUserMessageToState(ev) {
19030
- const text = ev.text;
19031
- if (!text) return;
19280
+ const text2 = ev.text;
19281
+ if (!text2) return;
19032
19282
  const seq = ev.seq;
19033
19283
  const adminEchoAllowed = ev.ownerType !== CHAT_OWNER_ADMIN || options.ownEchoIncludesAdmin === true;
19034
19284
  const selfUserId = resolveSelfUserId();
@@ -19036,11 +19286,11 @@ function createChatStreamReducer(options = {}) {
19036
19286
  if (selfUserId !== void 0 && !authorDeclared) warnIdLessAuthor();
19037
19287
  const authorMatched = selfUserId !== void 0 && authorDeclared && ev.userId === selfUserId;
19038
19288
  const authorEchoAllowed = selfUserId === void 0 || !authorDeclared || authorMatched;
19039
- if (adminEchoAllowed && authorEchoAllowed && consumeOwnEcho(text, authorMatched)) return;
19289
+ if (adminEchoAllowed && authorEchoAllowed && consumeOwnEcho(text2, authorMatched)) return;
19040
19290
  const authorType = ev.ownerType === CHAT_OWNER_ADMIN ? "admin" : "user";
19041
19291
  if (typeof seq !== "number" && hasRecentMessage(
19042
19292
  messages,
19043
- (m) => m.role === "user" && (_nullishCoalesce(m.authorType, () => ( "user"))) === authorType && m.content === text,
19293
+ (m) => m.role === "user" && (_nullishCoalesce(m.authorType, () => ( "user"))) === authorType && m.content === text2,
19044
19294
  CONTENT_DEDUP_WINDOW
19045
19295
  )) {
19046
19296
  return;
@@ -19050,7 +19300,7 @@ function createChatStreamReducer(options = {}) {
19050
19300
  {
19051
19301
  id: nextId("user"),
19052
19302
  role: "user",
19053
- content: text,
19303
+ content: text2,
19054
19304
  // Coverage signal for the history merge — see `streamSeq` on
19055
19305
  // `UnifiedChatMessage`. For `user-` rows it is also what tells a
19056
19306
  // REPLAYED echo (history already has its row) apart from a genuine new
@@ -19063,12 +19313,12 @@ function createChatStreamReducer(options = {}) {
19063
19313
  ]);
19064
19314
  }
19065
19315
  function applyDirectMessageToState(ev) {
19066
- const text = ev.text;
19067
- if (!text) return;
19316
+ const text2 = ev.text;
19317
+ if (!text2) return;
19068
19318
  const seq = ev.seq;
19069
19319
  if (typeof seq !== "number" && hasRecentMessage(
19070
19320
  messages,
19071
- (m) => m.role === "user" && m.authorType === "admin" && m.content === text,
19321
+ (m) => m.role === "user" && m.authorType === "admin" && m.content === text2,
19072
19322
  CONTENT_DEDUP_WINDOW
19073
19323
  )) {
19074
19324
  return;
@@ -19078,7 +19328,7 @@ function createChatStreamReducer(options = {}) {
19078
19328
  {
19079
19329
  id: `direct-${Date.now()}-${Math.random().toString(36).slice(2, 7)}`,
19080
19330
  role: "user",
19081
- content: text,
19331
+ content: text2,
19082
19332
  ...typeof seq === "number" ? { streamSeq: seq } : {},
19083
19333
  name: _nullishCoalesce(ev.displayName, () => ( "Admin")),
19084
19334
  authorType: "admin"
@@ -19086,10 +19336,10 @@ function createChatStreamReducer(options = {}) {
19086
19336
  ]);
19087
19337
  }
19088
19338
  function applySystemMessageToState(ev) {
19089
- const text = ev.text;
19090
- if (!text) return;
19339
+ const text2 = ev.text;
19340
+ if (!text2) return;
19091
19341
  const seq = ev.seq;
19092
- if (typeof seq !== "number" && hasRecentMessage(messages, (m) => m.authorType === "system" && m.name === text, SYSTEM_DEDUP_WINDOW)) {
19342
+ if (typeof seq !== "number" && hasRecentMessage(messages, (m) => m.authorType === "system" && m.name === text2, SYSTEM_DEDUP_WINDOW)) {
19093
19343
  return;
19094
19344
  }
19095
19345
  setMessagesInternal([
@@ -19099,7 +19349,7 @@ function createChatStreamReducer(options = {}) {
19099
19349
  role: "user",
19100
19350
  content: "",
19101
19351
  ...typeof seq === "number" ? { streamSeq: seq } : {},
19102
- name: text,
19352
+ name: text2,
19103
19353
  authorType: "system"
19104
19354
  }
19105
19355
  ]);
@@ -19137,6 +19387,7 @@ function createChatStreamReducer(options = {}) {
19137
19387
  isInStream = true;
19138
19388
  hasEverStreamed = true;
19139
19389
  turnStartedAt = Date.now();
19390
+ turnSourceMetadata = null;
19140
19391
  emit("onStreamStart");
19141
19392
  applyStreamStartToState();
19142
19393
  accumulator.resetSegments();
@@ -19150,6 +19401,14 @@ function createChatStreamReducer(options = {}) {
19150
19401
  accumulator.resetSegments();
19151
19402
  break;
19152
19403
  }
19404
+ // Per-answer source metadata. Applied to the trailing assistant bubble
19405
+ // immediately when there is one, and held for the next write when the
19406
+ // chunk beat the answer text to the reducer.
19407
+ case "sources": {
19408
+ turnSourceMetadata = mergeSourceMetadata(turnSourceMetadata, event);
19409
+ setMessagesInternal(stampTrailingAssistantSourceMetadata(messages));
19410
+ break;
19411
+ }
19153
19412
  case "metadata": {
19154
19413
  emit("onMetadata", {
19155
19414
  action: "metadata",
@@ -19232,13 +19491,13 @@ function createChatStreamReducer(options = {}) {
19232
19491
  const summary = required ? getCommandText(required) : `Batch of ${toolCalls.length} tool calls`;
19233
19492
  pendingEscalated.set(requestId, {
19234
19493
  command: summary,
19235
- explanation: _optionalChain([required, 'optionalAccess', _612 => _612.toolExplanation]),
19494
+ explanation: _optionalChain([required, 'optionalAccess', _623 => _623.toolExplanation]),
19236
19495
  approvalType,
19237
19496
  toolCalls
19238
19497
  });
19239
19498
  emit("onEscalatedApproval", requestId, {
19240
19499
  command: summary,
19241
- explanation: _optionalChain([required, 'optionalAccess', _613 => _613.toolExplanation]),
19500
+ explanation: _optionalChain([required, 'optionalAccess', _624 => _624.toolExplanation]),
19242
19501
  approvalType
19243
19502
  });
19244
19503
  break;
@@ -19471,20 +19730,20 @@ function createChatStreamReducer(options = {}) {
19471
19730
  break;
19472
19731
  }
19473
19732
  }
19474
- function sseWriteTrailingText(text) {
19733
+ function sseWriteTrailingText(text2) {
19475
19734
  const last = messages[messages.length - 1];
19476
19735
  if (!last || last.role !== "assistant") return;
19477
19736
  const segments = [..._nullishCoalesce(last.segments, () => ( []))];
19478
19737
  const tail = segments[segments.length - 1];
19479
19738
  if (tail && tail.type === "text") {
19480
- segments[segments.length - 1] = { type: "text", text };
19739
+ segments[segments.length - 1] = { type: "text", text: text2 };
19481
19740
  } else {
19482
- segments.push({ type: "text", text });
19741
+ segments.push({ type: "text", text: text2 });
19483
19742
  }
19484
19743
  setMessagesInternal([...messages.slice(0, -1), { ...last, segments }]);
19485
19744
  }
19486
- function sseAppendText(text) {
19487
- sseCurrentText += text;
19745
+ function sseAppendText(text2) {
19746
+ sseCurrentText += text2;
19488
19747
  sseWriteTrailingText(sseCurrentText);
19489
19748
  }
19490
19749
  function sseAppendThinking(escapedDelta) {
@@ -19622,7 +19881,7 @@ function createChatStreamReducer(options = {}) {
19622
19881
  const resolveBatch = (status, confirm) => async () => {
19623
19882
  setMessagesInternal(projectBatchStatusToMessages(messages, anchorId, status));
19624
19883
  for (const id of ids) {
19625
- const ok = await _optionalChain([confirm, 'optionalCall', _614 => _614(id)]);
19884
+ const ok = await _optionalChain([confirm, 'optionalCall', _625 => _625(id)]);
19626
19885
  if (ok === false) {
19627
19886
  setMessagesInternal(projectBatchRowFailureToMessages(messages, id));
19628
19887
  }
@@ -19758,8 +20017,8 @@ function createChatStreamReducer(options = {}) {
19758
20017
  }
19759
20018
  }
19760
20019
  }
19761
- hasEverStreamed = hasEverStreamed || (_nullishCoalesce(_optionalChain([extras, 'optionalAccess', _615 => _615.resumed]), () => ( messages.length > 0)));
19762
- if (_optionalChain([extras, 'optionalAccess', _616 => _616.agentBusy])) agentBusyState();
20020
+ hasEverStreamed = hasEverStreamed || (_nullishCoalesce(_optionalChain([extras, 'optionalAccess', _626 => _626.resumed]), () => ( messages.length > 0)));
20021
+ if (_optionalChain([extras, 'optionalAccess', _627 => _627.agentBusy])) agentBusyState();
19763
20022
  invalidate();
19764
20023
  }
19765
20024
  return {
@@ -19777,19 +20036,19 @@ function createChatStreamReducer(options = {}) {
19777
20036
  messages = [...older, ...messages];
19778
20037
  invalidate();
19779
20038
  },
19780
- pushOptimisticSend(text, hidden = false) {
19781
- pendingEchoTexts.push({ text, at: Date.now() });
20039
+ pushOptimisticSend(text2, hidden = false) {
20040
+ pendingEchoTexts.push({ text: text2, at: Date.now() });
19782
20041
  if (pendingEchoTexts.length > MAX_PENDING_ECHOES) pendingEchoTexts.shift();
19783
20042
  messages = [
19784
20043
  ...messages,
19785
20044
  // An EMPTY-text send is out-of-band metadata (an approval decision),
19786
20045
  // not something the user said — see `beginSseSend` for the full
19787
20046
  // rationale. Never materialize a row for it.
19788
- ...text.length > 0 ? [
20047
+ ...text2.length > 0 ? [
19789
20048
  {
19790
20049
  id: nextId("user"),
19791
20050
  role: "user",
19792
- content: text,
20051
+ content: text2,
19793
20052
  ...hidden ? { hidden: true } : {}
19794
20053
  }
19795
20054
  ] : [],
@@ -19805,7 +20064,7 @@ function createChatStreamReducer(options = {}) {
19805
20064
  invalidate();
19806
20065
  },
19807
20066
  resetForDialogSwitch,
19808
- beginSseSend({ text, hidden, userName = "You", assistantName, assistantAvatar }) {
20067
+ beginSseSend({ text: text2, hidden, userName = "You", assistantName, assistantAvatar }) {
19809
20068
  const now = Date.now();
19810
20069
  messages = [
19811
20070
  ...messages,
@@ -19817,12 +20076,12 @@ function createChatStreamReducer(options = {}) {
19817
20076
  // label with no body). So we never mint it. Hidden sends that DO carry
19818
20077
  // text (e.g. an auto-continuation directive) still become real state:
19819
20078
  // the LLM must see them, `Message.hidden` keeps them off screen.
19820
- ...text.length > 0 ? [
20079
+ ...text2.length > 0 ? [
19821
20080
  {
19822
20081
  id: `user-${now}`,
19823
20082
  role: "user",
19824
20083
  name: userName,
19825
- content: text,
20084
+ content: text2,
19826
20085
  timestamp: new Date(now),
19827
20086
  ...hidden ? { hidden: true } : {}
19828
20087
  }
@@ -19844,7 +20103,7 @@ function createChatStreamReducer(options = {}) {
19844
20103
  },
19845
20104
  endSseTurn() {
19846
20105
  const last = messages[messages.length - 1];
19847
- if (last && last.role === "assistant" && (_nullishCoalesce(_optionalChain([last, 'access', _617 => _617.segments, 'optionalAccess', _618 => _618.length]), () => ( 0))) === 0 && last.content === "") {
20106
+ if (last && last.role === "assistant" && (_nullishCoalesce(_optionalChain([last, 'access', _628 => _628.segments, 'optionalAccess', _629 => _629.length]), () => ( 0))) === 0 && last.content === "") {
19848
20107
  messages = messages.slice(0, -1);
19849
20108
  }
19850
20109
  sseCurrentText = "";
@@ -19865,8 +20124,8 @@ function createChatStreamReducer(options = {}) {
19865
20124
  streamingPhase = "idle";
19866
20125
  invalidate();
19867
20126
  },
19868
- seedSseMaps({ sources, sendCount: seedSendCount }) {
19869
- if (sources) for (const [k, v] of sources) sourcesMap.set(k, v);
20127
+ seedSseMaps({ sources: sources2, sendCount: seedSendCount }) {
20128
+ if (sources2) for (const [k, v] of sources2) sourcesMap.set(k, v);
19870
20129
  if (typeof seedSendCount === "number") sendCount = seedSendCount;
19871
20130
  invalidate();
19872
20131
  },
@@ -19997,10 +20256,10 @@ function createChatDialogStore(options = {}) {
19997
20256
  if (onEvict) {
19998
20257
  const sep = key.indexOf(KEY_SEP);
19999
20258
  onEvict(key.slice(0, sep), key.slice(sep + 1), {
20000
- messages: _nullishCoalesce(_optionalChain([dropped, 'optionalAccess', _619 => _619.state, 'access', _620 => _620.messages]), () => ( EMPTY_STATE.messages)),
20001
- approvalStatuses: _nullishCoalesce(_optionalChain([dropped, 'optionalAccess', _621 => _621.state, 'access', _622 => _622.approvalStatuses]), () => ( EMPTY_STATE.approvalStatuses)),
20002
- lastAppliedSeq: _nullishCoalesce(_optionalChain([dropped, 'optionalAccess', _623 => _623.getLastAppliedSeq, 'call', _624 => _624()]), () => ( Number.NEGATIVE_INFINITY)),
20003
- pendingEchoes: _nullishCoalesce(_optionalChain([dropped, 'optionalAccess', _625 => _625.getPendingEchoes, 'call', _626 => _626()]), () => ( EMPTY_PENDING_ECHOES))
20259
+ messages: _nullishCoalesce(_optionalChain([dropped, 'optionalAccess', _630 => _630.state, 'access', _631 => _631.messages]), () => ( EMPTY_STATE.messages)),
20260
+ approvalStatuses: _nullishCoalesce(_optionalChain([dropped, 'optionalAccess', _632 => _632.state, 'access', _633 => _633.approvalStatuses]), () => ( EMPTY_STATE.approvalStatuses)),
20261
+ lastAppliedSeq: _nullishCoalesce(_optionalChain([dropped, 'optionalAccess', _634 => _634.getLastAppliedSeq, 'call', _635 => _635()]), () => ( Number.NEGATIVE_INFINITY)),
20262
+ pendingEchoes: _nullishCoalesce(_optionalChain([dropped, 'optionalAccess', _636 => _636.getPendingEchoes, 'call', _637 => _637()]), () => ( EMPTY_PENDING_ECHOES))
20004
20263
  });
20005
20264
  }
20006
20265
  }
@@ -20010,12 +20269,12 @@ function createChatDialogStore(options = {}) {
20010
20269
  const key = keyOf(dialogId, side);
20011
20270
  let reducer = reducers.get(key);
20012
20271
  if (!reducer) {
20013
- const base = _nullishCoalesce(_optionalChain([(_nullishCoalesce(createOptions, () => ( defaultCreateOptions))), 'optionalCall', _627 => _627(dialogId, side)]), () => ( {}));
20272
+ const base = _nullishCoalesce(_optionalChain([(_nullishCoalesce(createOptions, () => ( defaultCreateOptions))), 'optionalCall', _638 => _638(dialogId, side)]), () => ( {}));
20014
20273
  const userOnChange = base.onChange;
20015
20274
  reducer = createChatStreamReducer({
20016
20275
  ...base,
20017
20276
  onChange: () => {
20018
- _optionalChain([userOnChange, 'optionalCall', _628 => _628()]);
20277
+ _optionalChain([userOnChange, 'optionalCall', _639 => _639()]);
20019
20278
  notify();
20020
20279
  }
20021
20280
  });
@@ -20060,7 +20319,7 @@ function createChatDialogStore(options = {}) {
20060
20319
  };
20061
20320
  }
20062
20321
  function getSnapshot2(dialogId, side = DEFAULT_DIALOG_SIDE) {
20063
- return _nullishCoalesce(_optionalChain([reducers, 'access', _629 => _629.get, 'call', _630 => _630(keyOf(dialogId, side)), 'optionalAccess', _631 => _631.state]), () => ( EMPTY_STATE));
20322
+ return _nullishCoalesce(_optionalChain([reducers, 'access', _640 => _640.get, 'call', _641 => _641(keyOf(dialogId, side)), 'optionalAccess', _642 => _642.state]), () => ( EMPTY_STATE));
20064
20323
  }
20065
20324
  function getServerSnapshot2() {
20066
20325
  return EMPTY_STATE;
@@ -20152,7 +20411,7 @@ function createDeltaBatcher({
20152
20411
  pending = [];
20153
20412
  const key = pendingKey;
20154
20413
  for (const delta of batch) applyOne(delta, key);
20155
- _optionalChain([onFlushed, 'optionalCall', _632 => _632(batch.length)]);
20414
+ _optionalChain([onFlushed, 'optionalCall', _643 => _643(batch.length)]);
20156
20415
  }
20157
20416
  function schedule() {
20158
20417
  if (raf !== null || timer !== null) return;
@@ -20176,7 +20435,7 @@ function createDeltaBatcher({
20176
20435
  }
20177
20436
  if (!isDeltaEvent(event)) return false;
20178
20437
  const tail = pending[pending.length - 1];
20179
- const seqAdvances = _optionalChain([tail, 'optionalAccess', _633 => _633.seq]) == null ? event.seq == null : event.seq != null && event.seq > tail.seq;
20438
+ const seqAdvances = _optionalChain([tail, 'optionalAccess', _644 => _644.seq]) == null ? event.seq == null : event.seq != null && event.seq > tail.seq;
20180
20439
  if (tail && seqAdvances && tail.type === event.type && (tail.type !== "text-delta" || tail.leading === event.leading)) {
20181
20440
  pending[pending.length - 1] = {
20182
20441
  ...tail,
@@ -20207,7 +20466,7 @@ function useChatStreamReducer({
20207
20466
  side = DEFAULT_DIALOG_SIDE,
20208
20467
  createReducerOptions
20209
20468
  }) {
20210
- const reducer = store.getReducer(dialogId, side, () => _nullishCoalesce(_optionalChain([createReducerOptions, 'optionalCall', _634 => _634()]), () => ( {})));
20469
+ const reducer = store.getReducer(dialogId, side, () => _nullishCoalesce(_optionalChain([createReducerOptions, 'optionalCall', _645 => _645()]), () => ( {})));
20211
20470
  const getSnapshot2 = _react.useCallback.call(void 0, () => store.getSnapshot(dialogId, side), [store, dialogId, side]);
20212
20471
  const getServerSnapshot2 = _react.useCallback.call(void 0, () => store.getServerSnapshot(), [store]);
20213
20472
  const subscribe2 = _react.useCallback.call(void 0, (listener) => store.subscribe(listener), [store]);
@@ -20246,7 +20505,7 @@ var STORAGE_KEY = "conversation";
20246
20505
  var namespaceFor = (source) => {
20247
20506
  const base = `mingo-chat-${source}`;
20248
20507
  const auth = _chunkEHAYNUOLcjs.getEmbedProxyAuth.call(void 0, );
20249
- return _optionalChain([auth, 'optionalAccess', _635 => _635.email]) ? `${base}-u-${encodeURIComponent(auth.email.toLowerCase())}` : base;
20508
+ return _optionalChain([auth, 'optionalAccess', _646 => _646.email]) ? `${base}-u-${encodeURIComponent(auth.email.toLowerCase())}` : base;
20250
20509
  };
20251
20510
  function createChatConversationStorage(source) {
20252
20511
  return _chunkEHAYNUOLcjs.createLocalStorageAdapter.call(void 0, {
@@ -20274,18 +20533,10 @@ function pruneStaleChatConversationStorage(source) {
20274
20533
  for (const k of toRemove) {
20275
20534
  window.localStorage.removeItem(k);
20276
20535
  }
20277
- } catch (e62) {
20536
+ } catch (e63) {
20278
20537
  }
20279
20538
  }
20280
20539
 
20281
- // src/chat-protocol/wire-narrow.ts
20282
- function isRecord(value) {
20283
- return typeof value === "object" && value !== null;
20284
- }
20285
- function unwrapEnvelope(payload) {
20286
- return isRecord(payload) && "data" in payload ? payload.data : payload;
20287
- }
20288
-
20289
20540
  // src/components/chat/utils/chat-conversations-api.ts
20290
20541
  function toDialogItem(row) {
20291
20542
  if (!isRecord(row)) return null;
@@ -20366,7 +20617,7 @@ function formatSingularLookupInvocation(cmdId, value) {
20366
20617
  return safe ? `/${cmdId} "${safe}"` : `/${cmdId}`;
20367
20618
  }
20368
20619
  function extractEntityIdFilter(override, expectedTableId) {
20369
- const f = _optionalChain([override, 'optionalAccess', _636 => _636.entityIdFilter]);
20620
+ const f = _optionalChain([override, 'optionalAccess', _647 => _647.entityIdFilter]);
20370
20621
  if (!f) return null;
20371
20622
  const tableId = typeof f.tableId === "string" ? f.tableId : "";
20372
20623
  const id = typeof f.id === "string" ? f.id : "";
@@ -20405,7 +20656,7 @@ var AUTO_CONTINUATION_DIRECTIVE_PREFIX = "[internal-auto-continuation]";
20405
20656
  function buildAutoContinuationDirective(toolName, opts = {}) {
20406
20657
  const ticketRef = opts.ticketId ? ` (ticket #${opts.ticketId})` : "";
20407
20658
  const ticketHash = opts.ticketId ? ` #${opts.ticketId}` : "";
20408
- const isClose = toolName === "update_ticket" && _optionalChain([opts, 'access', _637 => _637.status, 'optionalAccess', _638 => _638.toUpperCase, 'call', _639 => _639()]) === "CLOSED";
20659
+ const isClose = toolName === "update_ticket" && _optionalChain([opts, 'access', _648 => _648.status, 'optionalAccess', _649 => _649.toUpperCase, 'call', _650 => _650()]) === "CLOSED";
20409
20660
  if (toolName === "create_ticket") {
20410
20661
  return `${AUTO_CONTINUATION_DIRECTIVE_PREFIX} The user just approved create_ticket${ticketRef}. Per ticket-protocol \xA71a, ask 2-4 SHORT, issue-specific diagnostic follow-up questions tailored to the symptom they reported in their original message. When they answer, propose an update_ticket with content_addendum carrying a clean Q&A digest. Do NOT call any tool in this turn \u2014 just write the questions as prose.`;
20411
20662
  }
@@ -20455,7 +20706,7 @@ function useChatHistoryHydration({
20455
20706
  if (cancelled) return;
20456
20707
  if (rows.length === 0) {
20457
20708
  const found = isRecord(body) ? body.found : void 0;
20458
- if (found === false) _optionalChain([onOrphanedConversation, 'optionalCall', _640 => _640(conversationId)]);
20709
+ if (found === false) _optionalChain([onOrphanedConversation, 'optionalCall', _651 => _651(conversationId)]);
20459
20710
  return;
20460
20711
  }
20461
20712
  const hydrated = [];
@@ -20484,7 +20735,7 @@ function useChatHistoryHydration({
20484
20735
  sendCountRef.current = userTurns;
20485
20736
  hydrateMessages(hydrated, Array.from(sourcesSeed.entries()));
20486
20737
  bumpMetaTick();
20487
- } catch (e63) {
20738
+ } catch (e64) {
20488
20739
  if (isCurrentRun() && hydratedKeyRef.current === key) hydratedKeyRef.current = null;
20489
20740
  } finally {
20490
20741
  completed = true;
@@ -20599,7 +20850,7 @@ function useManagedDialogList({
20599
20850
  try {
20600
20851
  await deleteDialogCallback(id);
20601
20852
  removeLocal(id);
20602
- _optionalChain([onDialogRemovedRef, 'access', _641 => _641.current, 'optionalCall', _642 => _642(id, "deleted")]);
20853
+ _optionalChain([onDialogRemovedRef, 'access', _652 => _652.current, 'optionalCall', _653 => _653(id, "deleted")]);
20603
20854
  } catch (err) {
20604
20855
  console.error(`${logTag} deleteDialog failed:`, err);
20605
20856
  throw err;
@@ -20610,7 +20861,7 @@ function useManagedDialogList({
20610
20861
  const renameDialog = _react.useCallback.call(void 0,
20611
20862
  async (id, title) => {
20612
20863
  if (!renameDialogCallback) return;
20613
- const previous = _optionalChain([dialogsRef, 'access', _643 => _643.current, 'access', _644 => _644.find, 'call', _645 => _645((d) => d.id === id), 'optionalAccess', _646 => _646.title]);
20864
+ const previous = _optionalChain([dialogsRef, 'access', _654 => _654.current, 'access', _655 => _655.find, 'call', _656 => _656((d) => d.id === id), 'optionalAccess', _657 => _657.title]);
20614
20865
  setDialogs((prev) => prev.map((d) => d.id === id ? { ...d, title } : d));
20615
20866
  try {
20616
20867
  await renameDialogCallback(id, title);
@@ -20629,7 +20880,7 @@ function useManagedDialogList({
20629
20880
  try {
20630
20881
  await archiveDialogCallback(id);
20631
20882
  removeLocal(id);
20632
- _optionalChain([onDialogRemovedRef, 'access', _647 => _647.current, 'optionalCall', _648 => _648(id, "archived")]);
20883
+ _optionalChain([onDialogRemovedRef, 'access', _658 => _658.current, 'optionalCall', _659 => _659(id, "archived")]);
20633
20884
  } catch (err) {
20634
20885
  console.error(`${logTag} archiveDialog failed:`, err);
20635
20886
  throw err;
@@ -20721,7 +20972,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
20721
20972
  const { active = true } = runtimeOptions;
20722
20973
  const runtime = _chunkUPKZU6QUcjs.useRequiredChatRuntime.call(void 0, );
20723
20974
  const source = runtime.source || DEFAULT_CHAT_SOURCE;
20724
- const tableIdForDocumentType = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _649 => _649.tableIdForDocumentType]), () => ( defaultTableIdForDocumentType));
20975
+ const tableIdForDocumentType = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _660 => _660.tableIdForDocumentType]), () => ( defaultTableIdForDocumentType));
20725
20976
  const sendMessageRef = _react.useRef.call(void 0,
20726
20977
  () => Promise.resolve(true)
20727
20978
  );
@@ -20757,7 +21008,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
20757
21008
  if (!restoredConversationRef.current) {
20758
21009
  restoredConversationRef.current = true;
20759
21010
  pruneStaleChatConversationStorage(source);
20760
- conversationIdRef.current = _nullishCoalesce(_optionalChain([conversationStorage, 'access', _650 => _650.load, 'call', _651 => _651(), 'optionalAccess', _652 => _652.conversationId]), () => ( null));
21011
+ conversationIdRef.current = _nullishCoalesce(_optionalChain([conversationStorage, 'access', _661 => _661.load, 'call', _662 => _662(), 'optionalAccess', _663 => _663.conversationId]), () => ( null));
20761
21012
  }
20762
21013
  const [conversationId, setConversationId] = _react.useState.call(void 0, () => conversationIdRef.current);
20763
21014
  const commitConversationId = _react.useCallback.call(void 0,
@@ -20848,7 +21099,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
20848
21099
  const abortControllerRef = _react.useRef.call(void 0, null);
20849
21100
  const switchConversation = _react.useCallback.call(void 0,
20850
21101
  (id) => {
20851
- _optionalChain([abortControllerRef, 'access', _653 => _653.current, 'optionalAccess', _654 => _654.abort, 'call', _655 => _655()]);
21102
+ _optionalChain([abortControllerRef, 'access', _664 => _664.current, 'optionalAccess', _665 => _665.abort, 'call', _666 => _666()]);
20852
21103
  flushDeltas();
20853
21104
  mutate((r) => r.reset());
20854
21105
  hydrationSendCountRef.current = 0;
@@ -20885,8 +21136,8 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
20885
21136
  } = useManagedDialogList({
20886
21137
  autoLoad: active,
20887
21138
  fetchDialogs: fetchActiveDialogs,
20888
- renameDialog: _optionalChain([conversationsApi, 'optionalAccess', _656 => _656.renameDialog]),
20889
- archiveDialog: _optionalChain([conversationsApi, 'optionalAccess', _657 => _657.archiveDialog]),
21139
+ renameDialog: _optionalChain([conversationsApi, 'optionalAccess', _667 => _667.renameDialog]),
21140
+ archiveDialog: _optionalChain([conversationsApi, 'optionalAccess', _668 => _668.archiveDialog]),
20890
21141
  pageSize: 20,
20891
21142
  search: conversationsApi ? dialogSearch : void 0,
20892
21143
  logTag: "[useSseChatAdapter]",
@@ -20920,7 +21171,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
20920
21171
  const sendMessage = _react.useCallback.call(void 0,
20921
21172
  // Resolves `true` on a clean turn, `false` when the request failed
20922
21173
  // (surfaced to batch approve-all loops via the card callbacks).
20923
- async (text, sendOptions) => {
21174
+ async (text2, sendOptions) => {
20924
21175
  const { hidden, attachments, commandOverride, approvalAction } = _nullishCoalesce(sendOptions, () => ( {}));
20925
21176
  const echoedConversationId = conversationIdRef.current;
20926
21177
  const targetPath = approvalAction ? endpointsRef.current.approvalToolUrl : endpointsRef.current.chatStreamUrl;
@@ -20931,12 +21182,12 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
20931
21182
  // established conversation (the proposal turn captured the id).
20932
21183
  buildConfirmToolBody({ ...approvalAction, conversationId: echoedConversationId })
20933
21184
  ) : {
20934
- messages: [{ role: "user", content: text }],
21185
+ messages: [{ role: "user", content: text2 }],
20935
21186
  ...commandOverride ? { commandOverride } : {},
20936
21187
  ...attachments && attachments.length > 0 ? { pendingAttachments: attachments } : {},
20937
21188
  ...echoedConversationId ? { conversationId: echoedConversationId } : {}
20938
21189
  };
20939
- mutate((r) => r.beginSseSend({ text, hidden, userName: "You", assistantName: "Mingo AI" }));
21190
+ mutate((r) => r.beginSseSend({ text: text2, hidden, userName: "You", assistantName: "Mingo AI" }));
20940
21191
  const ctrl = new AbortController();
20941
21192
  abortControllerRef.current = ctrl;
20942
21193
  let mintedThisTurn = false;
@@ -20950,7 +21201,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
20950
21201
  const serverMessage = await readServerErrorMessage(response);
20951
21202
  throw new Error(_nullishCoalesce(serverMessage, () => ( `Chat request failed: ${response.status}`)));
20952
21203
  }
20953
- const reader = _optionalChain([response, 'access', _658 => _658.body, 'optionalAccess', _659 => _659.getReader, 'call', _660 => _660()]);
21204
+ const reader = _optionalChain([response, 'access', _669 => _669.body, 'optionalAccess', _670 => _670.getReader, 'call', _671 => _671()]);
20954
21205
  if (!reader) throw new Error("No response body");
20955
21206
  const frameDecoder = createSseFrameDecoder();
20956
21207
  let finished = false;
@@ -20979,7 +21230,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
20979
21230
  }
20980
21231
  return true;
20981
21232
  } catch (err) {
20982
- if (_optionalChain([err, 'optionalAccess', _661 => _661.name]) === "AbortError" || ctrl.signal.aborted) {
21233
+ if (_optionalChain([err, 'optionalAccess', _672 => _672.name]) === "AbortError" || ctrl.signal.aborted) {
20983
21234
  return true;
20984
21235
  }
20985
21236
  flushDeltas();
@@ -21015,7 +21266,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
21015
21266
  );
21016
21267
  sendMessageRef.current = sendMessage;
21017
21268
  const stopMessage = _react.useCallback.call(void 0, () => {
21018
- _optionalChain([abortControllerRef, 'access', _662 => _662.current, 'optionalAccess', _663 => _663.abort, 'call', _664 => _664()]);
21269
+ _optionalChain([abortControllerRef, 'access', _673 => _673.current, 'optionalAccess', _674 => _674.abort, 'call', _675 => _675()]);
21019
21270
  flushDeltas();
21020
21271
  mutate((r) => r.setPhase("idle"));
21021
21272
  }, [mutate, flushDeltas]);
@@ -21051,23 +21302,23 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
21051
21302
  let sendIdx = -1;
21052
21303
  return state.messages.map((m) => {
21053
21304
  const segments = m.segments;
21054
- const content = typeof m.content === "string" && !segments ? m.content : _nullishCoalesce(_optionalChain([segments, 'optionalAccess', _665 => _665.filter, 'call', _666 => _666((s) => s.type === "text"), 'access', _667 => _667.map, 'call', _668 => _668((s) => s.text), 'access', _669 => _669.join, 'call', _670 => _670("")]), () => ( ""));
21055
- let sources;
21305
+ const content = typeof m.content === "string" && !segments ? m.content : _nullishCoalesce(_optionalChain([segments, 'optionalAccess', _676 => _676.filter, 'call', _677 => _677((s) => s.type === "text"), 'access', _678 => _678.map, 'call', _679 => _679((s) => s.text), 'access', _680 => _680.join, 'call', _681 => _681("")]), () => ( ""));
21306
+ let sources2;
21056
21307
  let scrollAnchor;
21057
21308
  if (m.role === "user" && !m.hidden) {
21058
21309
  sendIdx++;
21059
21310
  }
21060
21311
  if (m.role === "assistant") {
21061
21312
  const lookupIdx = sendIdx >= 0 ? sendIdx : 0;
21062
- sources = sourcesMap.get(lookupIdx);
21063
- scrollAnchor = _nullishCoalesce(_optionalChain([meta, 'access', _671 => _671.get, 'call', _672 => _672(lookupIdx), 'optionalAccess', _673 => _673.scrollAnchor]), () => ( void 0));
21313
+ sources2 = sourcesMap.get(lookupIdx);
21314
+ scrollAnchor = _nullishCoalesce(_optionalChain([meta, 'access', _682 => _682.get, 'call', _683 => _683(lookupIdx), 'optionalAccess', _684 => _684.scrollAnchor]), () => ( void 0));
21064
21315
  }
21065
21316
  return {
21066
21317
  id: m.id,
21067
21318
  role: m.role,
21068
21319
  content,
21069
21320
  ...segments ? { segments } : {},
21070
- ...sources ? { sources } : {},
21321
+ ...sources2 ? { sources: sources2 } : {},
21071
21322
  ...scrollAnchor ? { scrollAnchor } : {},
21072
21323
  ...m.hidden ? { hidden: true } : {}
21073
21324
  };
@@ -21087,11 +21338,11 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
21087
21338
  );
21088
21339
  return;
21089
21340
  }
21090
- const refSlug = typeof _optionalChain([reference, 'access', _674 => _674.metadata, 'optionalAccess', _675 => _675.slug]) === "string" && reference.metadata.slug.length > 0 ? reference.metadata.slug : "";
21341
+ const refSlug = typeof _optionalChain([reference, 'access', _685 => _685.metadata, 'optionalAccess', _686 => _686.slug]) === "string" && reference.metadata.slug.length > 0 ? reference.metadata.slug : "";
21091
21342
  const queryValue = refSlug || sanitizeTitleForChat(reference.title) || reference.id;
21092
21343
  const escaped = queryValue.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
21093
- const text = `/${cmdId} display "${escaped}"`;
21094
- void sendMessage(text);
21344
+ const text2 = `/${cmdId} display "${escaped}"`;
21345
+ void sendMessage(text2);
21095
21346
  },
21096
21347
  [sendMessage, source, cmdIdByTableId, tableIdForDocumentType]
21097
21348
  );
@@ -21133,18 +21384,18 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
21133
21384
  /** True while the mount-time rebuild from the server transcript runs. */
21134
21385
  isHydratingHistory,
21135
21386
  /** Provider key for the lib's `<ModelDisplay>` icon. */
21136
- currentProvider: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess', _676 => _676.provider]), () => ( null)),
21137
- currentModelLabel: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess', _677 => _677.modelLabel]), () => ( null)),
21138
- currentContextWindowMaxTokens: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess', _678 => _678.contextWindowMaxTokens]), () => ( null)),
21387
+ currentProvider: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess', _687 => _687.provider]), () => ( null)),
21388
+ currentModelLabel: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess', _688 => _688.modelLabel]), () => ( null)),
21389
+ currentContextWindowMaxTokens: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess', _689 => _689.contextWindowMaxTokens]), () => ( null)),
21139
21390
  /** Input tokens (known after server's message_start frame; null until). */
21140
- currentInputTokens: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess', _679 => _679.inputTokens]), () => ( null)),
21391
+ currentInputTokens: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess', _690 => _690.inputTokens]), () => ( null)),
21141
21392
  /** Output tokens (known only after server's trailing usage frame). */
21142
- currentOutputTokens: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess', _680 => _680.outputTokens]), () => ( null)),
21393
+ currentOutputTokens: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess', _691 => _691.outputTokens]), () => ( null)),
21143
21394
  /** Cache hit % (read / total-input × 100). null during streaming. */
21144
- currentCacheHitRatePct: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess', _681 => _681.cacheHitRatePct]), () => ( null)),
21395
+ currentCacheHitRatePct: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess', _692 => _692.cacheHitRatePct]), () => ( null)),
21145
21396
  /** Cross-call usage breakdown (Haiku rewriter/classifier/summarizer
21146
21397
  * token counts). null until the trailing usage frame lands. */
21147
- currentUsageBreakdown: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess', _682 => _682.breakdown]), () => ( null)),
21398
+ currentUsageBreakdown: _nullishCoalesce(_optionalChain([latestMeta, 'optionalAccess', _693 => _693.breakdown]), () => ( null)),
21148
21399
  // ─── Dialog management ───────────────────────────────────────────────
21149
21400
  // With `chatConversationsUrl` the server transcript store IS the dialog
21150
21401
  // list (shared `useManagedDialogList`); selecting a row re-hydrates through
@@ -21245,6 +21496,16 @@ function decodeNatsChunk(chunk) {
21245
21496
  return { type: "thinking-delta", text: data.text, ...seq };
21246
21497
  }
21247
21498
  return null;
21499
+ // Two chunk names, one payload and one decoder. `SOURCES` is the contract
21500
+ // the backend is moving to; `GUIDE` is the v2 envelope it ships in during
21501
+ // the rollout (see `MESSAGE_TYPE.GUIDE`). The chunk arrives BEFORE or
21502
+ // between the answer's text deltas, so the reducer — not this decoder —
21503
+ // owns attaching it to the right turn.
21504
+ case MESSAGE_TYPE.GUIDE:
21505
+ case MESSAGE_TYPE.SOURCES: {
21506
+ const event = sourceMetadataEvent(data.payload);
21507
+ return event ? { ...event, ...seq } : null;
21508
+ }
21248
21509
  // An ask card is only an ask card with something to pick: a question and at
21249
21510
  // least one option. Anything less is dropped rather than rendered as an
21250
21511
  // empty card the user can't answer — the backend already falls back to a
@@ -21389,7 +21650,7 @@ function decodeNatsChunk(chunk) {
21389
21650
  userId: typeof data.userId === "string" ? data.userId : void 0,
21390
21651
  // Wire shape carries no label; fall back to the id (parity with
21391
21652
  // the history path in `process-historical-messages.ts`).
21392
- contextItems: Array.isArray(data.contextItems) ? data.contextItems.filter((it) => typeof _optionalChain([it, 'optionalAccess', _683 => _683.type]) === "string" && typeof _optionalChain([it, 'optionalAccess', _684 => _684.id]) === "string").map((it) => ({
21653
+ contextItems: Array.isArray(data.contextItems) ? data.contextItems.filter((it) => typeof _optionalChain([it, 'optionalAccess', _694 => _694.type]) === "string" && typeof _optionalChain([it, 'optionalAccess', _695 => _695.id]) === "string").map((it) => ({
21393
21654
  type: it.type,
21394
21655
  id: it.id,
21395
21656
  label: it.id
@@ -21480,7 +21741,7 @@ function extractIncompleteMessageState(lastMessage) {
21480
21741
  }
21481
21742
  break;
21482
21743
  case "approval_batch": {
21483
- const allDone = !!segment.data.executions && segment.data.toolCalls.every((c) => _optionalChain([segment, 'access', _685 => _685.data, 'access', _686 => _686.executions, 'optionalAccess', _687 => _687[c.toolExecutionRequestId], 'optionalAccess', _688 => _688.status]) === "done");
21744
+ const allDone = !!segment.data.executions && segment.data.toolCalls.every((c) => _optionalChain([segment, 'access', _696 => _696.data, 'access', _697 => _697.executions, 'optionalAccess', _698 => _698[c.toolExecutionRequestId], 'optionalAccess', _699 => _699.status]) === "done");
21484
21745
  if (segment.status !== "rejected" && !allDone) {
21485
21746
  hasIncompleteState = true;
21486
21747
  }
@@ -21542,11 +21803,11 @@ function extractIncompleteMessageState(lastMessage) {
21542
21803
  function extractIncompleteTailState(messages) {
21543
21804
  if (!messages || messages.length === 0) return void 0;
21544
21805
  let start = messages.length;
21545
- while (start > 0 && _optionalChain([messages, 'access', _689 => _689[start - 1], 'optionalAccess', _690 => _690.role]) === "assistant") start -= 1;
21806
+ while (start > 0 && _optionalChain([messages, 'access', _700 => _700[start - 1], 'optionalAccess', _701 => _701.role]) === "assistant") start -= 1;
21546
21807
  if (start === messages.length) return void 0;
21547
21808
  const segments = [];
21548
21809
  for (let i = start; i < messages.length; i += 1) {
21549
- const content = _optionalChain([messages, 'access', _691 => _691[i], 'optionalAccess', _692 => _692.content]);
21810
+ const content = _optionalChain([messages, 'access', _702 => _702[i], 'optionalAccess', _703 => _703.content]);
21550
21811
  if (Array.isArray(content)) segments.push(...content);
21551
21812
  }
21552
21813
  if (segments.length === 0) return void 0;
@@ -21559,15 +21820,15 @@ function extractIncompleteTailState(messages) {
21559
21820
 
21560
21821
  // src/components/chat/utils/process-historical-messages.ts
21561
21822
  function getOwnerDisplayName(owner) {
21562
- if (_optionalChain([owner, 'optionalAccess', _693 => _693.type]) === OWNER_TYPE.ADMIN && owner.user) {
21823
+ if (_optionalChain([owner, 'optionalAccess', _704 => _704.type]) === OWNER_TYPE.ADMIN && owner.user) {
21563
21824
  const { firstName, lastName } = owner.user;
21564
21825
  const name = [firstName, lastName].filter(Boolean).join(" ");
21565
21826
  if (name) return name;
21566
21827
  }
21567
- return _optionalChain([owner, 'optionalAccess', _694 => _694.type]) === OWNER_TYPE.ADMIN ? "Admin" : "You";
21828
+ return _optionalChain([owner, 'optionalAccess', _705 => _705.type]) === OWNER_TYPE.ADMIN ? "Admin" : "You";
21568
21829
  }
21569
21830
  function getOwnerAvatar(owner) {
21570
- return _nullishCoalesce(_optionalChain([owner, 'optionalAccess', _695 => _695.user, 'optionalAccess', _696 => _696.image, 'optionalAccess', _697 => _697.imageUrl]), () => ( void 0));
21831
+ return _nullishCoalesce(_optionalChain([owner, 'optionalAccess', _706 => _706.user, 'optionalAccess', _707 => _707.image, 'optionalAccess', _708 => _708.imageUrl]), () => ( void 0));
21571
21832
  }
21572
21833
  function pushStandaloneMessages(processedMessages, msg, messageDataArray) {
21573
21834
  messageDataArray.forEach((data) => {
@@ -21596,6 +21857,12 @@ function decodeHistoricalMessageData(data) {
21596
21857
  return { type: "thinking-delta", text: data.text };
21597
21858
  }
21598
21859
  return null;
21860
+ // Persisted source metadata, through the SAME decoder the live chunk uses
21861
+ // (`sourceMetadataEvent`). That shared parse is the whole reason a reloaded
21862
+ // answer renders identically to the one the reader watched arrive.
21863
+ case MESSAGE_TYPE.GUIDE:
21864
+ case MESSAGE_TYPE.SOURCES:
21865
+ return "payload" in data ? sourceMetadataEvent(data.payload) : null;
21599
21866
  // Same completeness gate as the live decoder (`decodeNatsChunk`): a
21600
21867
  // persisted row without a question or without options is not a card the
21601
21868
  // user can answer, so it replays as nothing rather than as empty chrome.
@@ -21751,7 +22018,7 @@ function applyHistoryEvent(event, accumulator, approvalStatuses, options, escala
21751
22018
  event.offerId,
21752
22019
  event.text,
21753
22020
  event.origin,
21754
- _nullishCoalesce(_optionalChain([escalationOfferStates, 'optionalAccess', _698 => _698[event.offerId]]), () => ( "pending"))
22021
+ _nullishCoalesce(_optionalChain([escalationOfferStates, 'optionalAccess', _709 => _709[event.offerId]]), () => ( "pending"))
21755
22022
  );
21756
22023
  break;
21757
22024
  case "ticket-escalated":
@@ -21785,7 +22052,7 @@ function applyHistoryEvent(event, accumulator, approvalStatuses, options, escala
21785
22052
  );
21786
22053
  break;
21787
22054
  case "escalation-offer-resolved":
21788
- _optionalChain([offerResolutions, 'optionalAccess', _699 => _699.set, 'call', _700 => _700(event.offerId, {
22055
+ _optionalChain([offerResolutions, 'optionalAccess', _710 => _710.set, 'call', _711 => _711(event.offerId, {
21789
22056
  status: event.status,
21790
22057
  resolvedByName: event.resolvedByName
21791
22058
  })]);
@@ -21849,7 +22116,7 @@ function applyHistoryEvent(event, accumulator, approvalStatuses, options, escala
21849
22116
  }
21850
22117
  }
21851
22118
  } else {
21852
- _optionalChain([escalatedApprovals, 'optionalAccess', _701 => _701.set, 'call', _702 => _702(event.requestId, {
22119
+ _optionalChain([escalatedApprovals, 'optionalAccess', _712 => _712.set, 'call', _713 => _713(event.requestId, {
21853
22120
  command: event.command || "",
21854
22121
  explanation: event.explanation,
21855
22122
  approvalType,
@@ -21864,8 +22131,8 @@ function applyHistoryEvent(event, accumulator, approvalStatuses, options, escala
21864
22131
  const existingStatus = approvalStatuses[requestId];
21865
22132
  const status = existingStatus || event.status;
21866
22133
  const resolvedByName = event.resolvedByName;
21867
- const escalatedData = _optionalChain([escalatedApprovals, 'optionalAccess', _703 => _703.get, 'call', _704 => _704(requestId)]);
21868
- if (_optionalChain([escalatedData, 'optionalAccess', _705 => _705.toolCalls]) && escalatedData.toolCalls.length > 0) {
22134
+ const escalatedData = _optionalChain([escalatedApprovals, 'optionalAccess', _714 => _714.get, 'call', _715 => _715(requestId)]);
22135
+ if (_optionalChain([escalatedData, 'optionalAccess', _716 => _716.toolCalls]) && escalatedData.toolCalls.length > 0) {
21869
22136
  if (batchApprovalsEnabled) {
21870
22137
  accumulator.addApprovalBatch(
21871
22138
  requestId,
@@ -21887,7 +22154,7 @@ function applyHistoryEvent(event, accumulator, approvalStatuses, options, escala
21887
22154
  );
21888
22155
  }
21889
22156
  }
21890
- _optionalChain([escalatedApprovals, 'optionalAccess', _706 => _706.delete, 'call', _707 => _707(requestId)]);
22157
+ _optionalChain([escalatedApprovals, 'optionalAccess', _717 => _717.delete, 'call', _718 => _718(requestId)]);
21891
22158
  break;
21892
22159
  }
21893
22160
  if (escalatedData) {
@@ -21896,7 +22163,7 @@ function applyHistoryEvent(event, accumulator, approvalStatuses, options, escala
21896
22163
  explanation: escalatedData.explanation,
21897
22164
  approvalType: escalatedData.approvalType
21898
22165
  });
21899
- _optionalChain([escalatedApprovals, 'optionalAccess', _708 => _708.delete, 'call', _709 => _709(requestId)]);
22166
+ _optionalChain([escalatedApprovals, 'optionalAccess', _719 => _719.delete, 'call', _720 => _720(requestId)]);
21900
22167
  }
21901
22168
  const before = accumulator.getSegments();
21902
22169
  const after = accumulator.updateApprovalStatus(requestId, status, resolvedByName);
@@ -21955,6 +22222,7 @@ function processHistoricalMessages(messages, options = {}) {
21955
22222
  let currentAssistantTimestamp = null;
21956
22223
  let lastAssistantId = null;
21957
22224
  let currentAssistantStreamSeq;
22225
+ let currentAssistantSourceMetadata = null;
21958
22226
  const flushAssistantMessage = () => {
21959
22227
  const idToUse = lastAssistantId || currentAssistantId;
21960
22228
  if (idToUse && accumulator.hasContent()) {
@@ -21967,7 +22235,8 @@ function processHistoricalMessages(messages, options = {}) {
21967
22235
  authorType: assistantType,
21968
22236
  timestamp: currentAssistantTimestamp || /* @__PURE__ */ new Date(),
21969
22237
  avatar: assistantAvatar,
21970
- ...currentAssistantStreamSeq !== void 0 ? { streamSeq: currentAssistantStreamSeq } : {}
22238
+ ...currentAssistantStreamSeq !== void 0 ? { streamSeq: currentAssistantStreamSeq } : {},
22239
+ ..._nullishCoalesce(currentAssistantSourceMetadata, () => ( {}))
21971
22240
  });
21972
22241
  accumulator.resetSegments();
21973
22242
  }
@@ -21975,6 +22244,7 @@ function processHistoricalMessages(messages, options = {}) {
21975
22244
  currentAssistantTimestamp = null;
21976
22245
  lastAssistantId = null;
21977
22246
  currentAssistantStreamSeq = void 0;
22247
+ currentAssistantSourceMetadata = null;
21978
22248
  };
21979
22249
  messages.forEach((msg, index) => {
21980
22250
  if (chatTypeFilter && msg.chatType !== chatTypeFilter) return;
@@ -21985,14 +22255,14 @@ function processHistoricalMessages(messages, options = {}) {
21985
22255
  pushStandaloneMessages(processedMessages, msg, messageDataArray);
21986
22256
  return;
21987
22257
  }
21988
- const isUserMessage = _optionalChain([msg, 'access', _710 => _710.owner, 'optionalAccess', _711 => _711.type]) === OWNER_TYPE.CLIENT || _optionalChain([msg, 'access', _712 => _712.owner, 'optionalAccess', _713 => _713.type]) === OWNER_TYPE.ADMIN;
22258
+ const isUserMessage = _optionalChain([msg, 'access', _721 => _721.owner, 'optionalAccess', _722 => _722.type]) === OWNER_TYPE.CLIENT || _optionalChain([msg, 'access', _723 => _723.owner, 'optionalAccess', _724 => _724.type]) === OWNER_TYPE.ADMIN;
21989
22259
  if (isUserMessage) {
21990
22260
  flushAssistantMessage();
21991
- const userAuthorType = _optionalChain([msg, 'access', _714 => _714.owner, 'optionalAccess', _715 => _715.type]) === OWNER_TYPE.ADMIN ? "admin" : "user";
22261
+ const userAuthorType = _optionalChain([msg, 'access', _725 => _725.owner, 'optionalAccess', _726 => _726.type]) === OWNER_TYPE.ADMIN ? "admin" : "user";
21992
22262
  messageDataArray.forEach((data) => {
21993
22263
  if (data.type === MESSAGE_TYPE.TEXT && "text" in data && data.text) {
21994
22264
  const rawContext = data.contextItems;
21995
- const contextItems = Array.isArray(rawContext) ? rawContext.filter((c) => typeof _optionalChain([c, 'optionalAccess', _716 => _716.type]) === "string" && typeof _optionalChain([c, 'optionalAccess', _717 => _717.id]) === "string").map((c) => ({ type: c.type, id: c.id, label: c.id })) : void 0;
22265
+ const contextItems = Array.isArray(rawContext) ? rawContext.filter((c) => typeof _optionalChain([c, 'optionalAccess', _727 => _727.type]) === "string" && typeof _optionalChain([c, 'optionalAccess', _728 => _728.id]) === "string").map((c) => ({ type: c.type, id: c.id, label: c.id })) : void 0;
21996
22266
  processedMessages.push({
21997
22267
  id: msg.id,
21998
22268
  role: "user",
@@ -22018,6 +22288,10 @@ function processHistoricalMessages(messages, options = {}) {
22018
22288
  messageDataArray.forEach((data) => {
22019
22289
  const event = decodeHistoricalMessageData(data);
22020
22290
  if (!event) return;
22291
+ if (event.type === "sources") {
22292
+ currentAssistantSourceMetadata = mergeSourceMetadata(currentAssistantSourceMetadata, event);
22293
+ return;
22294
+ }
22021
22295
  applyHistoryEvent(
22022
22296
  event,
22023
22297
  accumulator,
@@ -22035,7 +22309,7 @@ function processHistoricalMessages(messages, options = {}) {
22035
22309
  });
22036
22310
  const nextMsg = messages[index + 1];
22037
22311
  const isLastMessage = index === messages.length - 1;
22038
- const nextIsFromUser = nextMsg && (_optionalChain([nextMsg, 'access', _718 => _718.owner, 'optionalAccess', _719 => _719.type]) === OWNER_TYPE.CLIENT || _optionalChain([nextMsg, 'access', _720 => _720.owner, 'optionalAccess', _721 => _721.type]) === OWNER_TYPE.ADMIN);
22312
+ const nextIsFromUser = nextMsg && (_optionalChain([nextMsg, 'access', _729 => _729.owner, 'optionalAccess', _730 => _730.type]) === OWNER_TYPE.CLIENT || _optionalChain([nextMsg, 'access', _731 => _731.owner, 'optionalAccess', _732 => _732.type]) === OWNER_TYPE.ADMIN);
22039
22313
  if (isLastMessage || nextIsFromUser) {
22040
22314
  flushAssistantMessage();
22041
22315
  }
@@ -22417,10 +22691,10 @@ function useNatsChatAdapter(config, options = {}) {
22417
22691
  });
22418
22692
  const connectionState = !active || !dialogId ? "connected" : connectedForDialog === dialogId ? "connected" : "connecting";
22419
22693
  const sendMessage = _react.useCallback.call(void 0,
22420
- async (text, sendOptions) => {
22421
- const hidden = _nullishCoalesce(_optionalChain([sendOptions, 'optionalAccess', _722 => _722.hidden]), () => ( false));
22422
- mutate((r) => r.pushOptimisticSend(text, hidden));
22423
- await publishUserMessage(text, { hidden, dialogId });
22694
+ async (text2, sendOptions) => {
22695
+ const hidden = _nullishCoalesce(_optionalChain([sendOptions, 'optionalAccess', _733 => _733.hidden]), () => ( false));
22696
+ mutate((r) => r.pushOptimisticSend(text2, hidden));
22697
+ await publishUserMessage(text2, { hidden, dialogId });
22424
22698
  },
22425
22699
  [mutate, publishUserMessage, dialogId]
22426
22700
  );
@@ -22511,11 +22785,11 @@ function useNatsChatAdapter(config, options = {}) {
22511
22785
  // Tokens: live `token_usage` frame / dialog snapshot (`dialogTokenUsage`).
22512
22786
  // contextWindow uses the dialog's `contextSize` (the "X / Y" denominator,
22513
22787
  // matching the /mingo page). cacheHitRate/breakdown are SSE-only → null.
22514
- currentProvider: _nullishCoalesce(_nullishCoalesce(_optionalChain([liveModel, 'optionalAccess', _723 => _723.provider]), () => ( modelProvider)), () => ( null)),
22515
- currentModelLabel: _nullishCoalesce(_nullishCoalesce(_optionalChain([liveModel, 'optionalAccess', _724 => _724.modelLabel]), () => ( modelLabel)), () => ( null)),
22516
- currentContextWindowMaxTokens: _nullishCoalesce(_nullishCoalesce(_optionalChain([dialogTokenUsage, 'optionalAccess', _725 => _725.contextSize]), () => ( _optionalChain([liveModel, 'optionalAccess', _726 => _726.contextWindowMaxTokens]))), () => ( null)),
22517
- currentInputTokens: _nullishCoalesce(_optionalChain([dialogTokenUsage, 'optionalAccess', _727 => _727.inputTokensSize]), () => ( null)),
22518
- currentOutputTokens: _nullishCoalesce(_optionalChain([dialogTokenUsage, 'optionalAccess', _728 => _728.outputTokensSize]), () => ( null)),
22788
+ currentProvider: _nullishCoalesce(_nullishCoalesce(_optionalChain([liveModel, 'optionalAccess', _734 => _734.provider]), () => ( modelProvider)), () => ( null)),
22789
+ currentModelLabel: _nullishCoalesce(_nullishCoalesce(_optionalChain([liveModel, 'optionalAccess', _735 => _735.modelLabel]), () => ( modelLabel)), () => ( null)),
22790
+ currentContextWindowMaxTokens: _nullishCoalesce(_nullishCoalesce(_optionalChain([dialogTokenUsage, 'optionalAccess', _736 => _736.contextSize]), () => ( _optionalChain([liveModel, 'optionalAccess', _737 => _737.contextWindowMaxTokens]))), () => ( null)),
22791
+ currentInputTokens: _nullishCoalesce(_optionalChain([dialogTokenUsage, 'optionalAccess', _738 => _738.inputTokensSize]), () => ( null)),
22792
+ currentOutputTokens: _nullishCoalesce(_optionalChain([dialogTokenUsage, 'optionalAccess', _739 => _739.outputTokensSize]), () => ( null)),
22519
22793
  currentCacheHitRatePct: null,
22520
22794
  currentUsageBreakdown: null,
22521
22795
  // Dialog management
@@ -22629,7 +22903,7 @@ function useUnifiedChat(options) {
22629
22903
  const stopMessage = _react.useCallback.call(void 0, () => activeStateRef.current.stopMessage(), []);
22630
22904
  const clearMessages = _react.useCallback.call(void 0, () => activeStateRef.current.clearMessages(), []);
22631
22905
  const sendMessage = _react.useCallback.call(void 0,
22632
- (text, opts) => activeStateRef.current.sendMessage(text, opts),
22906
+ (text2, opts) => activeStateRef.current.sendMessage(text2, opts),
22633
22907
  []
22634
22908
  );
22635
22909
  const discussRef = _react.useCallback.call(void 0,
@@ -22637,7 +22911,7 @@ function useUnifiedChat(options) {
22637
22911
  []
22638
22912
  );
22639
22913
  const displayRefForward = _react.useCallback.call(void 0,
22640
- (ref) => _optionalChain([activeStateRef, 'access', _729 => _729.current, 'access', _730 => _730.displayRef, 'optionalCall', _731 => _731(ref)]),
22914
+ (ref) => _optionalChain([activeStateRef, 'access', _740 => _740.current, 'access', _741 => _741.displayRef, 'optionalCall', _742 => _742(ref)]),
22641
22915
  []
22642
22916
  );
22643
22917
  const displayRef = activeState.displayRef ? displayRefForward : void 0;
@@ -22647,7 +22921,7 @@ function useUnifiedChat(options) {
22647
22921
  const renameDialog = _react.useCallback.call(void 0, (id, title) => activeStateRef.current.renameDialog(id, title), []);
22648
22922
  const archiveDialog = _react.useCallback.call(void 0, (id) => activeStateRef.current.archiveDialog(id), []);
22649
22923
  const loadMoreDialogs = _react.useCallback.call(void 0, () => activeStateRef.current.loadMoreDialogs(), []);
22650
- const setDialogScope = _react.useCallback.call(void 0, (scope) => _optionalChain([activeStateRef, 'access', _732 => _732.current, 'access', _733 => _733.setDialogScope, 'optionalCall', _734 => _734(scope)]), []);
22924
+ const setDialogScope = _react.useCallback.call(void 0, (scope) => _optionalChain([activeStateRef, 'access', _743 => _743.current, 'access', _744 => _744.setDialogScope, 'optionalCall', _745 => _745(scope)]), []);
22651
22925
  const reloadDialogs = _react.useCallback.call(void 0, () => activeStateRef.current.reloadDialogs(), []);
22652
22926
  const loadMoreMessages = _react.useCallback.call(void 0, () => activeStateRef.current.loadMoreMessages(), []);
22653
22927
  const approveRequest = _react.useCallback.call(void 0, (requestId) => activeStateRef.current.approveRequest(requestId), []);
@@ -22755,19 +23029,19 @@ function turnRequestKeys(content) {
22755
23029
  if (!Array.isArray(content)) return keys;
22756
23030
  for (const seg of content) {
22757
23031
  if (seg.type === "tool_execution") {
22758
- const id = _optionalChain([seg, 'access', _735 => _735.data, 'optionalAccess', _736 => _736.toolExecutionRequestId]);
23032
+ const id = _optionalChain([seg, 'access', _746 => _746.data, 'optionalAccess', _747 => _747.toolExecutionRequestId]);
22759
23033
  if (id) keys.add(id);
22760
23034
  } else if (seg.type === "approval_request") {
22761
- const id = _optionalChain([seg, 'access', _737 => _737.data, 'optionalAccess', _738 => _738.requestId]);
23035
+ const id = _optionalChain([seg, 'access', _748 => _748.data, 'optionalAccess', _749 => _749.requestId]);
22762
23036
  if (id) keys.add(id);
22763
23037
  } else if (seg.type === "escalation_offer") {
22764
- const id = _optionalChain([seg, 'access', _739 => _739.data, 'optionalAccess', _740 => _740.offerId]);
23038
+ const id = _optionalChain([seg, 'access', _750 => _750.data, 'optionalAccess', _751 => _751.offerId]);
22765
23039
  if (id) keys.add(id);
22766
23040
  } else if (seg.type === "approval_batch") {
22767
23041
  const data = seg.data;
22768
- if (_optionalChain([data, 'optionalAccess', _741 => _741.approvalRequestId])) keys.add(data.approvalRequestId);
22769
- for (const call of _nullishCoalesce(_optionalChain([data, 'optionalAccess', _742 => _742.toolCalls]), () => ( []))) {
22770
- if (_optionalChain([call, 'optionalAccess', _743 => _743.toolExecutionRequestId])) keys.add(call.toolExecutionRequestId);
23042
+ if (_optionalChain([data, 'optionalAccess', _752 => _752.approvalRequestId])) keys.add(data.approvalRequestId);
23043
+ for (const call of _nullishCoalesce(_optionalChain([data, 'optionalAccess', _753 => _753.toolCalls]), () => ( []))) {
23044
+ if (_optionalChain([call, 'optionalAccess', _754 => _754.toolExecutionRequestId])) keys.add(call.toolExecutionRequestId);
22771
23045
  }
22772
23046
  }
22773
23047
  }
@@ -22788,27 +23062,27 @@ function collectTwinSignals(rows) {
22788
23062
  for (const row of rows) {
22789
23063
  for (const key of turnRequestKeys(row.content)) signals.requestKeys.add(key);
22790
23064
  if (row.role === "assistant") {
22791
- const text2 = assistantAnswerText(row.content);
22792
- if (text2 !== "") signals.assistantTexts.set(text2, (_nullishCoalesce(signals.assistantTexts.get(text2), () => ( 0))) + 1);
23065
+ const text3 = assistantAnswerText(row.content);
23066
+ if (text3 !== "") signals.assistantTexts.set(text3, (_nullishCoalesce(signals.assistantTexts.get(text3), () => ( 0))) + 1);
22793
23067
  continue;
22794
23068
  }
22795
- const text = userText(row);
22796
- if (text !== "") signals.userContents.set(text, (_nullishCoalesce(signals.userContents.get(text), () => ( 0))) + 1);
23069
+ const text2 = userText(row);
23070
+ if (text2 !== "") signals.userContents.set(text2, (_nullishCoalesce(signals.userContents.get(text2), () => ( 0))) + 1);
22797
23071
  }
22798
23072
  return signals;
22799
23073
  }
22800
23074
  function twinVerdict(signals, m) {
22801
23075
  if (m.role !== "assistant") {
22802
- const text2 = userText(m);
22803
- if (text2 === "") return "unknown";
22804
- return signals.userContents.has(text2) ? "twin" : "distinct";
23076
+ const text3 = userText(m);
23077
+ if (text3 === "") return "unknown";
23078
+ return signals.userContents.has(text3) ? "twin" : "distinct";
22805
23079
  }
22806
23080
  const keys = turnRequestKeys(m.content);
22807
23081
  if (keys.size > 0) return sharesRequestKey(keys, signals.requestKeys) ? "twin" : "distinct";
22808
- const text = assistantAnswerText(m.content);
22809
- if (text === "") return "unknown";
23082
+ const text2 = assistantAnswerText(m.content);
23083
+ if (text2 === "") return "unknown";
22810
23084
  for (const other of signals.assistantTexts.keys()) {
22811
- if (other.startsWith(text) || text.startsWith(other)) return "twin";
23085
+ if (other.startsWith(text2) || text2.startsWith(other)) return "twin";
22812
23086
  }
22813
23087
  return "distinct";
22814
23088
  }
@@ -22851,18 +23125,18 @@ function mergeHistoryWithRealtime(input) {
22851
23125
  }
22852
23126
  }
22853
23127
  const trailing = processedHistory[processedHistory.length - 1];
22854
- const historyTrailingAssistant = _optionalChain([trailing, 'optionalAccess', _744 => _744.role]) === "assistant" ? trailing : null;
22855
- const historyBatchId = historyTrailingAssistant && Array.isArray(historyTrailingAssistant.content) ? _nullishCoalesce(_optionalChain([historyTrailingAssistant, 'access', _745 => _745.content, 'access', _746 => _746.find, 'call', _747 => _747((s) => s.type === "approval_batch"), 'optionalAccess', _748 => _748.data, 'optionalAccess', _749 => _749.approvalRequestId]), () => ( null)) : null;
23128
+ const historyTrailingAssistant = _optionalChain([trailing, 'optionalAccess', _755 => _755.role]) === "assistant" ? trailing : null;
23129
+ const historyBatchId = historyTrailingAssistant && Array.isArray(historyTrailingAssistant.content) ? _nullishCoalesce(_optionalChain([historyTrailingAssistant, 'access', _756 => _756.content, 'access', _757 => _757.find, 'call', _758 => _758((s) => s.type === "approval_batch"), 'optionalAccess', _759 => _759.data, 'optionalAccess', _760 => _760.approvalRequestId]), () => ( null)) : null;
22856
23130
  let processedToUse = processedHistory;
22857
23131
  const pinnedSyntheticIds = /* @__PURE__ */ new Set();
22858
23132
  const droppedSyntheticIds = /* @__PURE__ */ new Set();
22859
23133
  if (historyBatchId) {
22860
23134
  const batchTwins = existingMessages.filter(
22861
- (m) => m.role === "assistant" && Array.isArray(m.content) && m.content.some((s) => s.type === "approval_batch" && _optionalChain([s, 'access', _750 => _750.data, 'optionalAccess', _751 => _751.approvalRequestId]) === historyBatchId)
23135
+ (m) => m.role === "assistant" && Array.isArray(m.content) && m.content.some((s) => s.type === "approval_batch" && _optionalChain([s, 'access', _761 => _761.data, 'optionalAccess', _762 => _762.approvalRequestId]) === historyBatchId)
22862
23136
  );
22863
23137
  const existingWithSameBatch = _nullishCoalesce(batchTwins.find((m) => m.id === streamingMessageId), () => ( batchTwins[batchTwins.length - 1]));
22864
23138
  if (existingWithSameBatch && Array.isArray(existingWithSameBatch.content)) {
22865
- const histSize = Array.isArray(_optionalChain([historyTrailingAssistant, 'optionalAccess', _752 => _752.content])) ? historyTrailingAssistant.content.length : 0;
23139
+ const histSize = Array.isArray(_optionalChain([historyTrailingAssistant, 'optionalAccess', _763 => _763.content])) ? historyTrailingAssistant.content.length : 0;
22866
23140
  const realtimeSize = existingWithSameBatch.content.length;
22867
23141
  if (existingWithSameBatch.id === streamingMessageId || realtimeSize > histSize) {
22868
23142
  processedToUse = processedHistory.slice(0, -1);
@@ -22895,9 +23169,9 @@ function mergeHistoryWithRealtime(input) {
22895
23169
  const trailingAssistantText = lastProcessed && lastProcessed.role === "assistant" ? assistantAnswerText(lastProcessed.content) : "";
22896
23170
  const windowSignals = collectTwinSignals(processedToUse);
22897
23171
  const seenUserSyntheticByContent = /* @__PURE__ */ new Map();
22898
- const isInWindow = (m) => processedIds.has(m.id) || (_nullishCoalesce(_optionalChain([rawHistoryIds, 'optionalAccess', _753 => _753.has, 'call', _754 => _754(m.id)]), () => ( false)));
23172
+ const isInWindow = (m) => processedIds.has(m.id) || (_nullishCoalesce(_optionalChain([rawHistoryIds, 'optionalAccess', _764 => _764.has, 'call', _765 => _765(m.id)]), () => ( false)));
22899
23173
  const firstWindowIndex = existingMessages.findIndex(isInWindow);
22900
- const isPersistedOlder = (m) => !isClientMintedId(m.id) && (_nullishCoalesce(_optionalChain([m, 'access', _755 => _755.timestamp, 'optionalAccess', _756 => _756.getTime, 'call', _757 => _757()]), () => ( 0))) <= historyFetchedAt;
23174
+ const isPersistedOlder = (m) => !isClientMintedId(m.id) && (_nullishCoalesce(_optionalChain([m, 'access', _766 => _766.timestamp, 'optionalAccess', _767 => _767.getTime, 'call', _768 => _768()]), () => ( 0))) <= historyFetchedAt;
22901
23175
  let lastOlderPersistedIndex = -1;
22902
23176
  if (firstWindowIndex < 0) {
22903
23177
  for (const [index, m] of existingMessages.entries()) {
@@ -22915,7 +23189,7 @@ function mergeHistoryWithRealtime(input) {
22915
23189
  } else if (pm.role === "assistant") {
22916
23190
  windowHasUnstampedAssistant = true;
22917
23191
  }
22918
- const time = _optionalChain([pm, 'access', _758 => _758.timestamp, 'optionalAccess', _759 => _759.getTime, 'call', _760 => _760()]);
23192
+ const time = _optionalChain([pm, 'access', _769 => _769.timestamp, 'optionalAccess', _770 => _770.getTime, 'call', _771 => _771()]);
22919
23193
  if (typeof time === "number" && time < windowMinTime) windowMinTime = time;
22920
23194
  }
22921
23195
  const threadHasClientMintedRow = existingMessages.some((m) => isClientMintedId(m.id));
@@ -22933,14 +23207,14 @@ function mergeHistoryWithRealtime(input) {
22933
23207
  const verdict = twinVerdict(windowSignals, m);
22934
23208
  return verdict === "unknown" ? !seqCanMislead(m) : verdict === "distinct";
22935
23209
  }
22936
- const time = _optionalChain([m, 'access', _761 => _761.timestamp, 'optionalAccess', _762 => _762.getTime, 'call', _763 => _763()]);
23210
+ const time = _optionalChain([m, 'access', _772 => _772.timestamp, 'optionalAccess', _773 => _773.getTime, 'call', _774 => _774()]);
22937
23211
  if (typeof time !== "number" || time > historyFetchedAt) return false;
22938
23212
  if (!Number.isFinite(windowMinTime) || time >= windowMinTime) return false;
22939
23213
  return twinVerdict(windowSignals, m) === "distinct";
22940
23214
  };
22941
23215
  const keepRealtime = (m) => {
22942
23216
  if (m.role === "user" && isOptimisticId(m.id) && typeof m.content === "string") {
22943
- const canBeInSnapshot = (_nullishCoalesce(_optionalChain([m, 'access', _764 => _764.timestamp, 'optionalAccess', _765 => _765.getTime, 'call', _766 => _766()]), () => ( 0))) <= historyFetchedAt;
23217
+ const canBeInSnapshot = (_nullishCoalesce(_optionalChain([m, 'access', _775 => _775.timestamp, 'optionalAccess', _776 => _776.getTime, 'call', _777 => _777()]), () => ( 0))) <= historyFetchedAt;
22944
23218
  return !(canBeInSnapshot && windowSignals.userContents.has(m.content));
22945
23219
  }
22946
23220
  if (isSyntheticRealtimeId(m.id) && m.id !== streamingMessageId) {
@@ -22964,7 +23238,7 @@ function mergeHistoryWithRealtime(input) {
22964
23238
  } else if (typeof m.streamSeq === "number") {
22965
23239
  covered = historyMaxStreamSeq > 0 && historyMaxStreamSeq >= m.streamSeq;
22966
23240
  } else {
22967
- covered = historyCoversRealtime !== null ? historyCoversRealtime : (_nullishCoalesce(_optionalChain([m, 'access', _767 => _767.timestamp, 'optionalAccess', _768 => _768.getTime, 'call', _769 => _769()]), () => ( 0))) <= historyFetchedAt;
23241
+ covered = historyCoversRealtime !== null ? historyCoversRealtime : (_nullishCoalesce(_optionalChain([m, 'access', _778 => _778.timestamp, 'optionalAccess', _779 => _779.getTime, 'call', _780 => _780()]), () => ( 0))) <= historyFetchedAt;
22968
23242
  }
22969
23243
  if (covered) return false;
22970
23244
  }
@@ -23001,10 +23275,10 @@ function computeHistoryPrepend(processedHistory, existingMessages) {
23001
23275
  for (let i = newEnd - 1; i >= 0; i--) {
23002
23276
  const pm = processedHistory[i];
23003
23277
  if (pm.role === "user") {
23004
- const text = userText(pm);
23005
- const left = text === "" ? 0 : _nullishCoalesce(userTwinsLeft.get(text), () => ( 0));
23278
+ const text2 = userText(pm);
23279
+ const left = text2 === "" ? 0 : _nullishCoalesce(userTwinsLeft.get(text2), () => ( 0));
23006
23280
  if (left === 0) continue;
23007
- userTwinsLeft.set(text, left - 1);
23281
+ userTwinsLeft.set(text2, left - 1);
23008
23282
  twinIndices.add(i);
23009
23283
  } else if (pm.role === "assistant") {
23010
23284
  const keys = turnRequestKeys(pm.content);
@@ -23012,10 +23286,10 @@ function computeHistoryPrepend(processedHistory, existingMessages) {
23012
23286
  if (sharesRequestKey(keys, liveSignals.requestKeys)) twinIndices.add(i);
23013
23287
  continue;
23014
23288
  }
23015
- const text = assistantAnswerText(pm.content);
23016
- if (text === "") continue;
23289
+ const text2 = assistantAnswerText(pm.content);
23290
+ if (text2 === "") continue;
23017
23291
  for (const [liveText, left] of assistantTwinsLeft) {
23018
- if (left === 0 || !text.startsWith(liveText)) continue;
23292
+ if (left === 0 || !text2.startsWith(liveText)) continue;
23019
23293
  assistantTwinsLeft.set(liveText, left - 1);
23020
23294
  twinIndices.add(i);
23021
23295
  break;
@@ -23073,14 +23347,14 @@ function normalizeHistoricalMessageData(md) {
23073
23347
  function isHistoricalUserTurn(m) {
23074
23348
  return !!m.owner;
23075
23349
  }
23076
- var isTextSegment = (d) => _optionalChain([d, 'optionalAccess', _770 => _770.type]) === "TEXT" && typeof d.text === "string";
23350
+ var isTextSegment = (d) => _optionalChain([d, 'optionalAccess', _781 => _781.type]) === "TEXT" && typeof d.text === "string";
23077
23351
  var THINK_MS = 550;
23078
23352
  var TOKEN_MS = 55;
23079
23353
  var USER_MS = 480;
23080
23354
  var SEGMENT_MS = 340;
23081
23355
  var POST_MS = 240;
23082
- function tokenize(text) {
23083
- return _nullishCoalesce(text.match(/\s*\S+\s*/g), () => ( (text ? [text] : [])));
23356
+ function tokenize(text2) {
23357
+ return _nullishCoalesce(text2.match(/\s*\S+\s*/g), () => ( (text2 ? [text2] : [])));
23084
23358
  }
23085
23359
  function buildStreamFrames(messages) {
23086
23360
  const frames = [];
@@ -23254,7 +23528,7 @@ function useResizableSize({ enabled, isHorizontal, minSize, maxSize, defaultSize
23254
23528
  const parsed = parseFloat(raw);
23255
23529
  if (!Number.isFinite(parsed)) return clampToViewport(defaultSize);
23256
23530
  return clampToViewport(parsed);
23257
- } catch (e64) {
23531
+ } catch (e65) {
23258
23532
  return clampToViewport(defaultSize);
23259
23533
  }
23260
23534
  }, [enabled, storageKey, defaultSize, clampToViewport]);
@@ -23264,7 +23538,7 @@ function useResizableSize({ enabled, isHorizontal, minSize, maxSize, defaultSize
23264
23538
  if (!enabled || !storageKey || typeof window === "undefined") return;
23265
23539
  try {
23266
23540
  window.localStorage.setItem(storageKey, String(Math.round(size2)));
23267
- } catch (e65) {
23541
+ } catch (e66) {
23268
23542
  }
23269
23543
  }, [enabled, size2, storageKey]);
23270
23544
  _react.useEffect.call(void 0, () => {
@@ -23298,7 +23572,7 @@ function DrawerResizeHandle({ side, size: size2, minSize, maxSize, onSize, ariaL
23298
23572
  startRef.current = null;
23299
23573
  try {
23300
23574
  e.currentTarget.releasePointerCapture(e.pointerId);
23301
- } catch (e66) {
23575
+ } catch (e67) {
23302
23576
  }
23303
23577
  document.body.style.cursor = "";
23304
23578
  document.body.style.userSelect = "";
@@ -23693,7 +23967,7 @@ function useChatDialogManager({
23693
23967
  const handleConfirmRestore = _react.useCallback.call(void 0, async () => {
23694
23968
  if (restoreTarget) {
23695
23969
  try {
23696
- await _optionalChain([unarchiveDialog, 'optionalCall', _771 => _771(restoreTarget.id)]);
23970
+ await _optionalChain([unarchiveDialog, 'optionalCall', _782 => _782(restoreTarget.id)]);
23697
23971
  } catch (err) {
23698
23972
  console.error("[useChatDialogManager] unarchive failed:", err);
23699
23973
  return;
@@ -23758,6 +24032,70 @@ function useChatDialogManager({
23758
24032
  };
23759
24033
  }
23760
24034
 
24035
+ // src/components/chat/utils/cited-sources.ts
24036
+ var FALLBACK_TOP_RETRIEVED = 3;
24037
+ var CITATION = /\[(\d+)\]/g;
24038
+ var CODE = /```[\s\S]*?```|~~~[\s\S]*?~~~|`[^`\n]*`/g;
24039
+ function withoutCode(content) {
24040
+ return content.replace(CODE, (block) => " ".repeat(block.length));
24041
+ }
24042
+ function splitCitedSources(sources2, content) {
24043
+ if (!sources2 || sources2.length === 0) return { cited: [], uncited: [] };
24044
+ const firstMentionAt = /* @__PURE__ */ new Map();
24045
+ for (const match of withoutCode(content).matchAll(CITATION)) {
24046
+ const index = Number.parseInt(match[1], 10);
24047
+ if (!firstMentionAt.has(index)) firstMentionAt.set(index, firstMentionAt.size);
24048
+ }
24049
+ const cited = sources2.filter((source) => firstMentionAt.has(source.index)).sort((a, b) => (_nullishCoalesce(firstMentionAt.get(a.index), () => ( 0))) - (_nullishCoalesce(firstMentionAt.get(b.index), () => ( 0))));
24050
+ const uncited = sources2.filter((source) => !firstMentionAt.has(source.index));
24051
+ return { cited, uncited };
24052
+ }
24053
+
24054
+ // src/components/chat/utils/host-message.ts
24055
+ function mapHostMessage(m, options) {
24056
+ const { userName, userAvatar, timestampCache } = options;
24057
+ let timestamp;
24058
+ if (m.timestamp != null) {
24059
+ timestamp = new Date(m.timestamp);
24060
+ } else {
24061
+ const cached = timestampCache.get(m.id);
24062
+ timestamp = _nullishCoalesce(cached, () => ( /* @__PURE__ */ new Date()));
24063
+ if (!cached) timestampCache.set(m.id, timestamp);
24064
+ }
24065
+ return {
24066
+ id: m.id,
24067
+ role: m.role,
24068
+ // Host-supplied per-message name/avatar win (e.g. the signed-in user's
24069
+ // full name + photo on a `user` bubble); fall back to the role default
24070
+ // when the host doesn't provide them.
24071
+ name: _nullishCoalesce(m.name, () => ( (m.role === "assistant" ? "Mingo" : _nullishCoalesce(userName, () => ( "You"))))),
24072
+ avatar: _nullishCoalesce(m.avatar, () => ( (m.role === "user" ? _nullishCoalesce(userAvatar, () => ( null)) : null))),
24073
+ // Forward the host's authorType so user bubbles get the same accent
24074
+ // name color as the standalone /mingo page (user → 'admin').
24075
+ ...m.authorType ? { authorType: m.authorType } : {},
24076
+ content: m.segments && m.segments.length > 0 ? m.segments : m.content,
24077
+ timestamp,
24078
+ assistantType: m.role === "assistant" ? "mingo" : void 0,
24079
+ // `hidden` is load-bearing, NOT cosmetic: it carries synthetic rows
24080
+ // (e.g. an auto-continuation directive) that the LLM must see but the
24081
+ // reader must not. See the module note above.
24082
+ ...m.hidden ? { hidden: true } : {},
24083
+ ...m.scrollAnchor ? { scrollAnchor: m.scrollAnchor } : {},
24084
+ // Forward attached context items so the user bubble renders its chips.
24085
+ ...m.contextItems && m.contextItems.length > 0 ? { contextItems: m.contextItems } : {},
24086
+ // Per-answer source metadata: the citation strip under the answer, and the
24087
+ // descriptions the `[card://…]` markers in its body expand into.
24088
+ ...m.sources && m.sources.length > 0 ? { sources: m.sources } : {},
24089
+ ...m.refs && m.refs.length > 0 ? { refs: m.refs } : {}
24090
+ };
24091
+ }
24092
+ function pruneTimestampCache(timestampCache, liveIds) {
24093
+ if (timestampCache.size <= liveIds.size) return;
24094
+ for (const id of timestampCache.keys()) {
24095
+ if (!liveIds.has(id)) timestampCache.delete(id);
24096
+ }
24097
+ }
24098
+
23761
24099
  // src/components/chat/embeddable-chat.tsx
23762
24100
 
23763
24101
  var HISTORY_RAIL_WIDTH = 320;
@@ -23780,7 +24118,6 @@ var mentionTokenOf = (key, markerByType) => {
23780
24118
  const id = ci === -1 ? "" : key.slice(ci + 1);
23781
24119
  return `${_nullishCoalesce(markerByType.get(type), () => ( type.toLowerCase()))}:${id}`;
23782
24120
  };
23783
- var FALLBACK_TOP_RETRIEVED = 3;
23784
24121
  var RAIL_COLLAPSED_STORAGE_KEY = "mingo-chat-history-collapsed";
23785
24122
  var NO_CONTEXT_ITEMS = [];
23786
24123
  var RAIL_ANIM_MS = 320;
@@ -23844,13 +24181,13 @@ function dispatchSlashCommandAction(actionId, cmdId, ref) {
23844
24181
  input.setValue(`/${cmdId} `);
23845
24182
  return;
23846
24183
  case "find": {
23847
- const text = `/${cmdId} ""`;
23848
- input.setValueAndCursor(text, text.length - 1);
24184
+ const text2 = `/${cmdId} ""`;
24185
+ input.setValueAndCursor(text2, text2.length - 1);
23849
24186
  return;
23850
24187
  }
23851
24188
  case "display": {
23852
- const text = `/${cmdId} display ""`;
23853
- input.setValueAndCursor(text, text.length - 1);
24189
+ const text2 = `/${cmdId} display ""`;
24190
+ input.setValueAndCursor(text2, text2.length - 1);
23854
24191
  return;
23855
24192
  }
23856
24193
  }
@@ -24176,7 +24513,7 @@ function EmbeddableChatInner({
24176
24513
  }),
24177
24514
  [commandsUrl]
24178
24515
  );
24179
- const headerUserName = _optionalChain([identityUser, 'optionalAccess', _772 => _772.name, 'optionalAccess', _773 => _773.trim, 'call', _774 => _774()]) || [_optionalChain([identityUser, 'optionalAccess', _775 => _775.firstName]), _optionalChain([identityUser, 'optionalAccess', _776 => _776.lastName])].filter(Boolean).join(" ").trim() || _optionalChain([userDisplayName, 'optionalAccess', _777 => _777.trim, 'call', _778 => _778()]) || void 0;
24516
+ const headerUserName = _optionalChain([identityUser, 'optionalAccess', _783 => _783.name, 'optionalAccess', _784 => _784.trim, 'call', _785 => _785()]) || [_optionalChain([identityUser, 'optionalAccess', _786 => _786.firstName]), _optionalChain([identityUser, 'optionalAccess', _787 => _787.lastName])].filter(Boolean).join(" ").trim() || _optionalChain([userDisplayName, 'optionalAccess', _788 => _788.trim, 'call', _789 => _789()]) || void 0;
24180
24517
  const effectiveModes = _react.useMemo.call(void 0, () => {
24181
24518
  if (modes) return modes;
24182
24519
  const guideOptions = tableIdForDocumentType ? { tableIdForDocumentType } : {};
@@ -24191,7 +24528,7 @@ function EmbeddableChatInner({
24191
24528
  if (controlledActiveMode === void 0) {
24192
24529
  setUncontrolledActiveMode(next);
24193
24530
  }
24194
- _optionalChain([onActiveModeChange, 'optionalCall', _779 => _779(next)]);
24531
+ _optionalChain([onActiveModeChange, 'optionalCall', _790 => _790(next)]);
24195
24532
  },
24196
24533
  [controlledActiveMode, onActiveModeChange]
24197
24534
  );
@@ -24218,7 +24555,7 @@ function EmbeddableChatInner({
24218
24555
  );
24219
24556
  const effectiveAssistantName = emptyStateConfig.name;
24220
24557
  const effectiveAssistantIcon = emptyStateConfig.icon;
24221
- const headerAssistantName = _nullishCoalesce(effectiveAssistantName, () => ( (typeof _optionalChain([guideWelcome, 'optionalAccess', _780 => _780.title]) === "string" ? guideWelcome.title : null)));
24558
+ const headerAssistantName = _nullishCoalesce(effectiveAssistantName, () => ( (typeof _optionalChain([guideWelcome, 'optionalAccess', _791 => _791.title]) === "string" ? guideWelcome.title : null)));
24222
24559
  const {
24223
24560
  messages: rawMessages,
24224
24561
  isLoading: chatLoading,
@@ -24261,8 +24598,8 @@ function EmbeddableChatInner({
24261
24598
  const mingoCaps = _react.useMemo.call(void 0,
24262
24599
  () => ({
24263
24600
  ...dialogCapabilities,
24264
- canRename: _nullishCoalesce(_optionalChain([dialogCapabilities, 'optionalAccess', _781 => _781.canRename]), () => ( false)),
24265
- canArchive: _nullishCoalesce(_optionalChain([dialogCapabilities, 'optionalAccess', _782 => _782.canArchive]), () => ( false))
24601
+ canRename: _nullishCoalesce(_optionalChain([dialogCapabilities, 'optionalAccess', _792 => _792.canRename]), () => ( false)),
24602
+ canArchive: _nullishCoalesce(_optionalChain([dialogCapabilities, 'optionalAccess', _793 => _793.canArchive]), () => ( false))
24266
24603
  }),
24267
24604
  [dialogCapabilities]
24268
24605
  );
@@ -24277,7 +24614,7 @@ function EmbeddableChatInner({
24277
24614
  void sendMessage(guidePendingPrompt).catch((err) => {
24278
24615
  console.error("[EmbeddableChat] guide launcher prompt failed:", err);
24279
24616
  });
24280
- _optionalChain([onGuidePromptConsumed, 'optionalCall', _783 => _783()]);
24617
+ _optionalChain([onGuidePromptConsumed, 'optionalCall', _794 => _794()]);
24281
24618
  }, [guidePendingPrompt, activeMode, sendMessage, onGuidePromptConsumed]);
24282
24619
  const {
24283
24620
  attachments: stagedAttachments,
@@ -24288,7 +24625,7 @@ function EmbeddableChatInner({
24288
24625
  clear: clearAttachments
24289
24626
  } = useChatAttachments();
24290
24627
  const { panelRef: galleryPanelRef, modal: galleryModal } = useChatAttachmentImageGallery();
24291
- const contextMaxItems = _nullishCoalesce(_optionalChain([contextPicker, 'optionalAccess', _784 => _784.maxItems]), () => ( 10));
24628
+ const contextMaxItems = _nullishCoalesce(_optionalChain([contextPicker, 'optionalAccess', _795 => _795.maxItems]), () => ( 10));
24292
24629
  const contextPickerForMode = activeMode === "mingo" ? contextPicker : void 0;
24293
24630
  const [contextItems, setContextItems] = _react.useState.call(void 0, NO_CONTEXT_ITEMS);
24294
24631
  const [contextPickerOpen, setContextPickerOpen] = _react.useState.call(void 0, false);
@@ -24309,10 +24646,10 @@ function EmbeddableChatInner({
24309
24646
  }, [activeDialogId, activeMode]);
24310
24647
  const mentionMarkerByType = _react.useMemo.call(void 0, () => {
24311
24648
  const m = /* @__PURE__ */ new Map();
24312
- for (const t of _nullishCoalesce(_optionalChain([contextPicker, 'optionalAccess', _785 => _785.entityTypes]), () => ( []))) if (t.marker) m.set(t.type, t.marker);
24649
+ for (const t of _nullishCoalesce(_optionalChain([contextPicker, 'optionalAccess', _796 => _796.entityTypes]), () => ( []))) if (t.marker) m.set(t.type, t.marker);
24313
24650
  return m;
24314
- }, [_optionalChain([contextPicker, 'optionalAccess', _786 => _786.entityTypes])]);
24315
- const contextEntityTypes = _optionalChain([contextPicker, 'optionalAccess', _787 => _787.entityTypes]);
24651
+ }, [_optionalChain([contextPicker, 'optionalAccess', _797 => _797.entityTypes])]);
24652
+ const contextEntityTypes = _optionalChain([contextPicker, 'optionalAccess', _798 => _798.entityTypes]);
24316
24653
  const resolveContextIcon = _react.useMemo.call(void 0, () => {
24317
24654
  const byType = /* @__PURE__ */ new Map();
24318
24655
  for (const t of _nullishCoalesce(contextEntityTypes, () => ( []))) byType.set(t.type, t.icon);
@@ -24324,7 +24661,7 @@ function EmbeddableChatInner({
24324
24661
  if (mentionActiveRef.current) {
24325
24662
  if (contextItems.some((p) => `${p.type}:${p.id}` === key)) return;
24326
24663
  if (contextItems.length >= contextMaxItems) return;
24327
- _optionalChain([chatInputRef, 'access', _788 => _788.current, 'optionalAccess', _789 => _789.commitMention, 'call', _790 => _790(mentionTokenOf(key, mentionMarkerByType), {
24664
+ _optionalChain([chatInputRef, 'access', _799 => _799.current, 'optionalAccess', _800 => _800.commitMention, 'call', _801 => _801(mentionTokenOf(key, mentionMarkerByType), {
24328
24665
  label: item.label,
24329
24666
  icon: resolveContextIcon(item)
24330
24667
  })]);
@@ -24347,9 +24684,9 @@ function EmbeddableChatInner({
24347
24684
  setContextItems((prev) => prev.filter((p) => `${p.type}:${p.id}` !== key));
24348
24685
  if (mentionKeysRef.current.has(key)) {
24349
24686
  mentionKeysRef.current.delete(key);
24350
- const cur = _nullishCoalesce(_optionalChain([chatInputRef, 'access', _791 => _791.current, 'optionalAccess', _792 => _792.getValue, 'call', _793 => _793()]), () => ( ""));
24687
+ const cur = _nullishCoalesce(_optionalChain([chatInputRef, 'access', _802 => _802.current, 'optionalAccess', _803 => _803.getValue, 'call', _804 => _804()]), () => ( ""));
24351
24688
  const next = cur.replace(`@${mentionTokenOf(key, mentionMarkerByType)}`, "").replace(/\s{2,}/g, " ").trimStart();
24352
- _optionalChain([chatInputRef, 'access', _794 => _794.current, 'optionalAccess', _795 => _795.setValue, 'call', _796 => _796(next)]);
24689
+ _optionalChain([chatInputRef, 'access', _805 => _805.current, 'optionalAccess', _806 => _806.setValue, 'call', _807 => _807(next)]);
24353
24690
  }
24354
24691
  },
24355
24692
  [mentionMarkerByType]
@@ -24371,7 +24708,7 @@ function EmbeddableChatInner({
24371
24708
  }, []);
24372
24709
  const closeContextPicker = _react.useCallback.call(void 0, () => {
24373
24710
  if (mentionActiveRef.current) {
24374
- _optionalChain([chatInputRef, 'access', _797 => _797.current, 'optionalAccess', _798 => _798.removeMentionTrigger, 'call', _799 => _799()]);
24711
+ _optionalChain([chatInputRef, 'access', _808 => _808.current, 'optionalAccess', _809 => _809.removeMentionTrigger, 'call', _810 => _810()]);
24375
24712
  }
24376
24713
  setContextPickerOpen(false);
24377
24714
  setMentionQuery(null);
@@ -24405,59 +24742,20 @@ function EmbeddableChatInner({
24405
24742
  [effectiveAssistantIcon]
24406
24743
  );
24407
24744
  const [timestampCache] = _react.useState.call(void 0, () => /* @__PURE__ */ new Map());
24408
- const guideUserName = activeMode === "guide" ? [_optionalChain([identityUser, 'optionalAccess', _800 => _800.firstName]), _optionalChain([identityUser, 'optionalAccess', _801 => _801.lastName])].filter(Boolean).join(" ").trim() || _optionalChain([identityUser, 'optionalAccess', _802 => _802.name, 'optionalAccess', _803 => _803.trim, 'call', _804 => _804()]) || void 0 : void 0;
24409
- const guideUserAvatar = activeMode === "guide" ? _optionalChain([identityUser, 'optionalAccess', _805 => _805.avatarUrl, 'optionalAccess', _806 => _806.trim, 'call', _807 => _807()]) || void 0 : void 0;
24745
+ const guideUserName = activeMode === "guide" ? [_optionalChain([identityUser, 'optionalAccess', _811 => _811.firstName]), _optionalChain([identityUser, 'optionalAccess', _812 => _812.lastName])].filter(Boolean).join(" ").trim() || _optionalChain([identityUser, 'optionalAccess', _813 => _813.name, 'optionalAccess', _814 => _814.trim, 'call', _815 => _815()]) || void 0 : void 0;
24746
+ const guideUserAvatar = activeMode === "guide" ? _optionalChain([identityUser, 'optionalAccess', _816 => _816.avatarUrl, 'optionalAccess', _817 => _817.trim, 'call', _818 => _818()]) || void 0 : void 0;
24410
24747
  const messages = _react.useMemo.call(void 0, () => {
24411
- const cache = timestampCache;
24412
- const seenIds = /* @__PURE__ */ new Set();
24413
- const mapped = rawMessages.map((m) => {
24414
- seenIds.add(m.id);
24415
- let timestamp;
24416
- if (m.timestamp != null) {
24417
- timestamp = new Date(m.timestamp);
24418
- } else {
24419
- const cached = cache.get(m.id);
24420
- timestamp = _nullishCoalesce(cached, () => ( /* @__PURE__ */ new Date()));
24421
- if (!cached) cache.set(m.id, timestamp);
24422
- }
24423
- return {
24424
- id: m.id,
24425
- role: m.role,
24426
- // Host-supplied per-message name/avatar win (e.g. the signed-in user's
24427
- // full name + photo on a `user` bubble); fall back to the role default
24428
- // when the host doesn't provide them.
24429
- name: _nullishCoalesce(m.name, () => ( (m.role === "assistant" ? "Mingo" : _nullishCoalesce(guideUserName, () => ( "You"))))),
24430
- avatar: _nullishCoalesce(m.avatar, () => ( (m.role === "user" ? _nullishCoalesce(guideUserAvatar, () => ( null)) : null))),
24431
- // Forward the host's authorType so user bubbles get the same accent
24432
- // name color as the standalone /mingo page (user → 'admin').
24433
- ...m.authorType ? { authorType: m.authorType } : {},
24434
- content: m.segments && m.segments.length > 0 ? m.segments : m.content,
24435
- timestamp,
24436
- assistantType: m.role === "assistant" ? "mingo" : void 0,
24437
- // `hidden` is load-bearing, NOT cosmetic: it carries synthetic rows
24438
- // (e.g. an auto-continuation directive) that the LLM must see but the
24439
- // reader must not. Dropping it here made the raw directive text render
24440
- // as an ordinary bubble. This field-by-field rebuild has to forward it
24441
- // explicitly — see `Message.hidden` and `chat-message-list`'s skip.
24442
- ...m.hidden ? { hidden: true } : {},
24443
- ...m.scrollAnchor ? { scrollAnchor: m.scrollAnchor } : {},
24444
- // Forward attached context items so the user bubble renders its chips.
24445
- ...m.contextItems && m.contextItems.length > 0 ? { contextItems: m.contextItems } : {}
24446
- };
24447
- });
24448
- if (cache.size > seenIds.size) {
24449
- for (const id of cache.keys()) {
24450
- if (!seenIds.has(id)) cache.delete(id);
24451
- }
24452
- }
24748
+ const options = { userName: guideUserName, userAvatar: guideUserAvatar, timestampCache };
24749
+ const mapped = rawMessages.map((m) => mapHostMessage(m, options));
24750
+ pruneTimestampCache(timestampCache, new Set(rawMessages.map((m) => m.id)));
24453
24751
  return mapped;
24454
24752
  }, [rawMessages, guideUserName, guideUserAvatar, timestampCache]);
24455
24753
  const handleSend = _react.useCallback.call(void 0,
24456
- (text) => {
24457
- let augmentedText = text;
24754
+ (text2) => {
24755
+ let augmentedText = text2;
24458
24756
  if (readyAttachments.length > 0) {
24459
24757
  const markdown = readyAttachments.map((att) => formatChatAttachmentMarkdownForBubble(att, viewUrlPrefix)).join("");
24460
- augmentedText = `${text}${markdown}`;
24758
+ augmentedText = `${text2}${markdown}`;
24461
24759
  }
24462
24760
  void sendMessage(augmentedText, {
24463
24761
  ...readyAttachments.length > 0 ? { attachments: readyAttachments } : {},
@@ -24593,28 +24891,33 @@ function EmbeddableChatInner({
24593
24891
  });
24594
24892
  return out;
24595
24893
  }, [commandsById, enabledSet]);
24596
- const lastAssistantMsg = [...rawMessages].reverse().find((m) => m.role === "assistant");
24597
- const lastSources = _react.useMemo.call(void 0, () => {
24598
- if (chatLoading) return void 0;
24599
- const sources = _optionalChain([lastAssistantMsg, 'optionalAccess', _808 => _808.sources]);
24600
- if (!sources || sources.length === 0) return void 0;
24601
- const content = _optionalChain([lastAssistantMsg, 'optionalAccess', _809 => _809.content]) || "";
24602
- const citationOrder = [...content.matchAll(/\[(\d+)\]/g)].map((m) => parseInt(m[1], 10));
24603
- const seenOrder = /* @__PURE__ */ new Map();
24604
- citationOrder.forEach((idx) => {
24605
- if (!seenOrder.has(idx)) seenOrder.set(idx, seenOrder.size);
24606
- });
24607
- const cited = sources.filter((s) => seenOrder.has(s.index)).sort((a, b) => (_nullishCoalesce(seenOrder.get(a.index), () => ( 0))) - (_nullishCoalesce(seenOrder.get(b.index), () => ( 0))));
24608
- const uncited = sources.filter((s) => !seenOrder.has(s.index));
24609
- return { cited, uncited };
24610
- }, [lastAssistantMsg, chatLoading]);
24894
+ const renderMessageSources = _react.useCallback.call(void 0,
24895
+ (message, index) => {
24896
+ if (message.role !== "assistant") return null;
24897
+ if (chatLoading && index === messages.length - 1) return null;
24898
+ const { cited, uncited } = splitCitedSources(message.sources, flattenAssistantContent(message.content));
24899
+ if (cited.length === 0 && uncited.length === 0) return null;
24900
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "pb-2", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
24901
+ SourceChips,
24902
+ {
24903
+ cited,
24904
+ uncited,
24905
+ baseRoute: resolvedBaseRoute,
24906
+ chipBasePlatform,
24907
+ onClose: handleNavigationClose,
24908
+ onDiscuss: discussRef
24909
+ }
24910
+ ) });
24911
+ },
24912
+ [chatLoading, messages.length, resolvedBaseRoute, chipBasePlatform, handleNavigationClose, discussRef]
24913
+ );
24611
24914
  const [portalHost, setPortalHost] = _react.useState.call(void 0, null);
24612
24915
  const [panelBoundary, setPanelBoundary] = _react.useState.call(void 0, null);
24613
24916
  const [panelWidth, setPanelWidth] = _react.useState.call(void 0, 0);
24614
24917
  _react.useEffect.call(void 0, () => {
24615
24918
  if (!panelBoundary || typeof ResizeObserver === "undefined") return void 0;
24616
24919
  const ro = new ResizeObserver((entries) => {
24617
- const w = _optionalChain([entries, 'access', _810 => _810[0], 'optionalAccess', _811 => _811.contentRect, 'optionalAccess', _812 => _812.width]);
24920
+ const w = _optionalChain([entries, 'access', _819 => _819[0], 'optionalAccess', _820 => _820.contentRect, 'optionalAccess', _821 => _821.width]);
24618
24921
  if (typeof w === "number") setPanelWidth(w);
24619
24922
  });
24620
24923
  ro.observe(panelBoundary);
@@ -24631,7 +24934,7 @@ function EmbeddableChatInner({
24631
24934
  setRailStorageRead(true);
24632
24935
  try {
24633
24936
  if (window.localStorage.getItem(RAIL_COLLAPSED_STORAGE_KEY) === "1") setRailCollapsed(true);
24634
- } catch (e67) {
24937
+ } catch (e68) {
24635
24938
  }
24636
24939
  }
24637
24940
  const toggleRailCollapsed = _react.useCallback.call(void 0, () => {
@@ -24639,7 +24942,7 @@ function EmbeddableChatInner({
24639
24942
  const next = !prev;
24640
24943
  try {
24641
24944
  window.localStorage.setItem(RAIL_COLLAPSED_STORAGE_KEY, next ? "1" : "0");
24642
- } catch (e68) {
24945
+ } catch (e69) {
24643
24946
  }
24644
24947
  return next;
24645
24948
  });
@@ -24658,17 +24961,17 @@ function EmbeddableChatInner({
24658
24961
  const stackedListView = isMingoMode && !hasConversation && !archiveOpen && !wideMingo && !composeOpen && !emptyListSkipped;
24659
24962
  const headerShowBack = hasConversation || guideCanReturnToMingo;
24660
24963
  const freshConversationTitle = isGuideEmpty ? _nullishCoalesce(headerAssistantName, () => ( "Mingo Guide")) : "New Chat";
24661
- const headerTitle = hasConversation ? _optionalChain([activeDialog, 'optionalAccess', _813 => _813.title]) || freshConversationTitle : isGuideEmpty ? freshConversationTitle : "Current Chats";
24964
+ const headerTitle = hasConversation ? _optionalChain([activeDialog, 'optionalAccess', _822 => _822.title]) || freshConversationTitle : isGuideEmpty ? freshConversationTitle : "Current Chats";
24662
24965
  const headerBackAriaLabel = hasConversation ? isViewingArchived ? "Back to archive" : "Back" : "Back to Mingo";
24663
24966
  const headerOnBack = hasConversation ? handleBack : () => handleActiveModeChange("mingo");
24664
24967
  const headerOnRestore = isViewingArchived && unarchiveDialog && activeDialog ? () => setRestoreTarget(activeDialog) : void 0;
24665
24968
  const headerOnRename = activeDialogId && activeDialog && mingoCaps.canRename ? () => setRenameTarget(activeDialog) : void 0;
24666
24969
  const headerOnArchive = activeDialogId && activeDialog && mingoCaps.canArchive ? () => setArchiveTarget(activeDialog) : void 0;
24667
- const headerOnCopyLink = activeDialogId && activeDialog && mingoCaps.onCopyLink ? () => _optionalChain([mingoCaps, 'access', _814 => _814.onCopyLink, 'optionalCall', _815 => _815(activeDialog)]) : void 0;
24970
+ const headerOnCopyLink = activeDialogId && activeDialog && mingoCaps.onCopyLink ? () => _optionalChain([mingoCaps, 'access', _823 => _823.onCopyLink, 'optionalCall', _824 => _824(activeDialog)]) : void 0;
24668
24971
  const headerOnOpenArchive = fetchArchivedDialogs ? openArchive : void 0;
24669
- const headerOwner = hasConversation ? _optionalChain([activeDialog, 'optionalAccess', _816 => _816.owner]) : void 0;
24670
- const headerPersonName = _optionalChain([headerOwner, 'optionalAccess', _817 => _817.name, 'optionalAccess', _818 => _818.trim, 'call', _819 => _819()]) || headerUserName;
24671
- const headerPersonAvatarUrl = headerOwner ? _optionalChain([headerOwner, 'access', _820 => _820.avatarUrl, 'optionalAccess', _821 => _821.trim, 'call', _822 => _822()]) || void 0 : _optionalChain([identityUser, 'optionalAccess', _823 => _823.avatarUrl, 'optionalAccess', _824 => _824.trim, 'call', _825 => _825()]) || _optionalChain([userAvatarUrl, 'optionalAccess', _826 => _826.trim, 'call', _827 => _827()]) || void 0;
24972
+ const headerOwner = hasConversation ? _optionalChain([activeDialog, 'optionalAccess', _825 => _825.owner]) : void 0;
24973
+ const headerPersonName = _optionalChain([headerOwner, 'optionalAccess', _826 => _826.name, 'optionalAccess', _827 => _827.trim, 'call', _828 => _828()]) || headerUserName;
24974
+ const headerPersonAvatarUrl = headerOwner ? _optionalChain([headerOwner, 'access', _829 => _829.avatarUrl, 'optionalAccess', _830 => _830.trim, 'call', _831 => _831()]) || void 0 : _optionalChain([identityUser, 'optionalAccess', _832 => _832.avatarUrl, 'optionalAccess', _833 => _833.trim, 'call', _834 => _834()]) || _optionalChain([userAvatarUrl, 'optionalAccess', _835 => _835.trim, 'call', _836 => _836()]) || void 0;
24672
24975
  const headerAvatar = headerPersonName || headerPersonAvatarUrl ? { name: headerPersonName, avatarUrl: headerPersonAvatarUrl } : void 0;
24673
24976
  const handleNewChat = _react.useCallback.call(void 0, () => {
24674
24977
  resetToNewChat();
@@ -24923,56 +25226,44 @@ function EmbeddableChatInner({
24923
25226
  "div",
24924
25227
  {
24925
25228
  className: "flex min-h-0 flex-1 flex-col duration-200 animate-in fade-in-0",
24926
- children: hasConversation ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex min-h-0 flex-1 flex-col", children: [
24927
- messagesInitialLoading ? (
24928
- // Match the real list's `fullWidth` layout so swapping
24929
- // skeleton → bubbles doesn't shift the column. The panel
24930
- // wrapper above already pads (`p-[var(--spacing-system-m)]`),
24931
- // so the skeleton sits flush (no inner px/pb).
24932
- //
24933
- // In `previewMode` the chat lives in a fixed-height host box
24934
- // (e.g. the Mingo hero demo). The default bottom-anchored
24935
- // skeleton overflows a short panel and grows its OWN
24936
- // scrollbar — ugly. `fill` top-anchors + clips overflow so
24937
- // it reads as "the whole panel is loading" and never scrolls.
24938
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ChatMessageListSkeleton, { fullWidth: true, fill: previewMode, className: "flex-1" })
24939
- ) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
24940
- ChatMessageList,
24941
- {
24942
- messages,
24943
- isTyping: chatLoading,
24944
- pendingApprovals,
24945
- autoScroll: !previewMode,
24946
- pinBottom: previewMode,
24947
- overscrollContain: !previewMode,
24948
- assistantType: "mingo",
24949
- assistantIcon: mingoAssistantIcon,
24950
- renderEntityCard,
24951
- resolveContextIcon,
24952
- renderContextItem,
24953
- renderMention,
24954
- onAskSelect: chatLoading || previewMode ? void 0 : handleAskSelect,
24955
- NavLinkAnchor: NavLinkAnchorViaRuntime,
24956
- className: previewMode ? "pointer-events-auto flex-1" : "flex-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
24957
- contentClassName: "max-w-none pb-0",
24958
- fullWidth: true,
24959
- hasNextPage: hasMoreMessages,
24960
- isFetchingNextPage: isMessagesLoading,
24961
- onLoadMore: loadMoreMessages
24962
- }
24963
- ),
24964
- lastSources && (lastSources.cited.length > 0 || lastSources.uncited.length > 0) && !chatLoading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex-shrink-0 pb-2", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
24965
- SourceChips,
24966
- {
24967
- cited: lastSources.cited,
24968
- uncited: lastSources.uncited,
24969
- baseRoute: resolvedBaseRoute,
24970
- chipBasePlatform,
24971
- onClose: handleNavigationClose,
24972
- onDiscuss: discussRef
24973
- }
24974
- ) })
24975
- ] }) : activeMode === "mingo" ? (
25229
+ children: hasConversation ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex min-h-0 flex-1 flex-col", children: messagesInitialLoading ? (
25230
+ // Match the real list's `fullWidth` layout so swapping
25231
+ // skeleton → bubbles doesn't shift the column. The panel
25232
+ // wrapper above already pads (`p-[var(--spacing-system-m)]`),
25233
+ // so the skeleton sits flush (no inner px/pb).
25234
+ //
25235
+ // In `previewMode` the chat lives in a fixed-height host box
25236
+ // (e.g. the Mingo hero demo). The default bottom-anchored
25237
+ // skeleton overflows a short panel and grows its OWN
25238
+ // scrollbar — ugly. `fill` top-anchors + clips overflow so
25239
+ // it reads as "the whole panel is loading" and never scrolls.
25240
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ChatMessageListSkeleton, { fullWidth: true, fill: previewMode, className: "flex-1" })
25241
+ ) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
25242
+ ChatMessageList,
25243
+ {
25244
+ messages,
25245
+ isTyping: chatLoading,
25246
+ pendingApprovals,
25247
+ autoScroll: !previewMode,
25248
+ pinBottom: previewMode,
25249
+ overscrollContain: !previewMode,
25250
+ assistantType: "mingo",
25251
+ assistantIcon: mingoAssistantIcon,
25252
+ renderEntityCard,
25253
+ resolveContextIcon,
25254
+ renderContextItem,
25255
+ renderMention,
25256
+ renderAfterMessage: renderMessageSources,
25257
+ onAskSelect: chatLoading || previewMode ? void 0 : handleAskSelect,
25258
+ NavLinkAnchor: NavLinkAnchorViaRuntime,
25259
+ className: previewMode ? "pointer-events-auto flex-1" : "flex-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
25260
+ contentClassName: "max-w-none pb-0",
25261
+ fullWidth: true,
25262
+ hasNextPage: hasMoreMessages,
25263
+ isFetchingNextPage: isMessagesLoading,
25264
+ onLoadMore: loadMoreMessages
25265
+ }
25266
+ ) }) : activeMode === "mingo" ? (
24976
25267
  /* Figma node 7532:222444 — default (Mingo-mode) empty state:
24977
25268
  centred greeting + capability grid + Guide-chat promo +
24978
25269
  quick-action chips. Guide mode keeps the slash-command
@@ -24998,9 +25289,9 @@ function EmbeddableChatInner({
24998
25289
  subtitle: _nullishCoalesce(effectiveGreeting, () => ( void 0)),
24999
25290
  subtitleLoading: emptyStateLoading,
25000
25291
  ...guideWelcome,
25001
- title: _nullishCoalesce(effectiveAssistantName, () => ( _optionalChain([guideWelcome, 'optionalAccess', _828 => _828.title]))),
25002
- icon: _nullishCoalesce(effectiveAssistantIcon, () => ( _optionalChain([guideWelcome, 'optionalAccess', _829 => _829.icon]))),
25003
- quickActions: agentConfigUrl && guideSuggestedActions.length > 0 ? guideSuggestedActions : _nullishCoalesce(_optionalChain([guideWelcome, 'optionalAccess', _830 => _830.quickActions]), () => ( guideSuggestedActions)),
25292
+ title: _nullishCoalesce(effectiveAssistantName, () => ( _optionalChain([guideWelcome, 'optionalAccess', _837 => _837.title]))),
25293
+ icon: _nullishCoalesce(effectiveAssistantIcon, () => ( _optionalChain([guideWelcome, 'optionalAccess', _838 => _838.icon]))),
25294
+ quickActions: agentConfigUrl && guideSuggestedActions.length > 0 ? guideSuggestedActions : _nullishCoalesce(_optionalChain([guideWelcome, 'optionalAccess', _839 => _839.quickActions]), () => ( guideSuggestedActions)),
25004
25295
  onQuickAction: (action) => {
25005
25296
  setQuickActionPreview(null);
25006
25297
  handleSend(_nullishCoalesce(action.prompt, () => ( action.label)));
@@ -25074,8 +25365,8 @@ function EmbeddableChatInner({
25074
25365
  selectedContextItems: contextItems,
25075
25366
  onToggleContextItem: toggleContextItem,
25076
25367
  onRemoveContextItem: removeContextItem,
25077
- contextMemoryItems: _optionalChain([contextMemory, 'optionalAccess', _831 => _831.items]),
25078
- onRemoveContextMemoryItem: _optionalChain([contextMemory, 'optionalAccess', _832 => _832.onRemove]),
25368
+ contextMemoryItems: _optionalChain([contextMemory, 'optionalAccess', _840 => _840.items]),
25369
+ onRemoveContextMemoryItem: _optionalChain([contextMemory, 'optionalAccess', _841 => _841.onRemove]),
25079
25370
  contextPickerOpen,
25080
25371
  onOpenContextPicker: openContextPicker,
25081
25372
  onCloseContextPicker: closeContextPicker,
@@ -25541,4 +25832,4 @@ function EmbeddableChatInner({
25541
25832
 
25542
25833
 
25543
25834
  exports.FloatingTooltip = FloatingTooltip; exports.tagVariants = tagVariants; exports.Tag = Tag; exports.formatTicketRelativeTime = formatTicketRelativeTime; exports.formatTicketFullTimestamp = formatTicketFullTimestamp; exports.formatRelativeTime = formatRelativeTime; exports.formatAbsoluteDate = formatAbsoluteDate; exports.formatDateTime = formatDateTime; exports.getDetailedTimeDifference = getDetailedTimeDifference; exports.isToday = isToday; exports.isWithinMinutes = isWithinMinutes; exports.createUTCTimestamp = createUTCTimestamp; exports.DESIGN_PALETTE = DESIGN_PALETTE; exports.getContrastRatio = getContrastRatio; exports.pickReadableTextColor = pickReadableTextColor; exports.extractDominantColor = extractDominantColor; exports.getBestContrastColor = getBestContrastColor; exports.analyzeImageColor = analyzeImageColor; exports.extractImageEdgeColorAsync = extractImageEdgeColorAsync; exports.getCurrentPlatform = getCurrentPlatform; exports.switchPlatformTheme = switchPlatformTheme; exports.getSemanticColor = getSemanticColor; exports.getPlatformConfig = getPlatformConfig; exports.usePlatformColors = usePlatformColors; exports.getReadableTextColor = getReadableTextColor; exports.HEX_PATTERN = HEX_PATTERN; exports.hexToRgb = hexToRgb2; exports.rgbToHex = rgbToHex; exports.deriveHoverColor = deriveHoverColor; exports.deriveActiveColor = deriveActiveColor; exports.rgbToHsl = rgbToHsl; exports.hslToRgb = hslToRgb; exports.ActionsMenu = ActionsMenu; exports.ActionsMenuDropdown = ActionsMenuDropdown; exports.ColorSwatch = ColorSwatch; exports.TooltipProvider = TooltipProvider; exports.Tooltip = Tooltip; exports.TooltipTrigger = TooltipTrigger; exports.TooltipContent = TooltipContent; exports.resolveTicketStatus = resolveTicketStatus; exports.getTicketStatusConfig = getTicketStatusConfig; exports.getTicketStatusTag = getTicketStatusTag; exports.kindToCanonicalStatus = kindToCanonicalStatus; exports.usesCanonicalStatusStyle = usesCanonicalStatusStyle; exports.resolveStatusTagProps = resolveStatusTagProps; exports.TicketStatusTag = TicketStatusTag; exports.useScrollFade = useScrollFade; exports.ScrollFadeOverlay = ScrollFadeOverlay; exports.ScrollShadow = ScrollShadow; exports.Modal = Modal; exports.ModalContent = ModalContent; exports.ModalTwoColumn = ModalTwoColumn; exports.ModalHeader = ModalHeader; exports.ModalTitle = ModalTitle; exports.ModalFooter = ModalFooter; exports.OVERLAY_BACKDROP_CLASS = OVERLAY_BACKDROP_CLASS; exports.Drawer = Drawer; exports.DrawerTrigger = DrawerTrigger; exports.DrawerClose = DrawerClose; exports.DrawerPortal = DrawerPortal; exports.DrawerOverlay = DrawerOverlay; exports.DrawerContent = DrawerContent; exports.DrawerHeader = DrawerHeader; exports.DrawerTitle = DrawerTitle; exports.DrawerDescription = DrawerDescription; exports.DrawerBody = DrawerBody; exports.DrawerFooter = DrawerFooter; exports.Tabs = Tabs; exports.TabsList = TabsList; exports.TabsTrigger = TabsTrigger; exports.TabsContent = TabsContent; exports.stripInlineMarkdown = stripInlineMarkdown; exports.markdownToPlainText = markdownToPlainText; exports.buildHeadingIdMap = buildHeadingIdMap; exports.useHeadingIdMap = useHeadingIdMap; exports.extractText = extractText; exports.useIsHydrated = useIsHydrated; exports.MermaidDiagram = MermaidDiagram; exports.hasRenderableSrc = hasRenderableSrc; exports.buildStandardLeafRenderers = buildStandardLeafRenderers; exports.SAFE_HTML_TAGS = SAFE_HTML_TAGS; exports.SVG_TAGS = SVG_TAGS; exports.buildEffectiveTagSet = buildEffectiveTagSet; exports.buildSanitizeSchema = buildSanitizeSchema; exports.rehypeStripUnsafe = rehypeStripUnsafe; exports.escapeUnknownHtmlTags = escapeUnknownHtmlTags; exports.cardAwareUrlTransform = cardAwareUrlTransform; exports.splitStreamingBlocks = splitStreamingBlocks; exports.completeStreamingTail = completeStreamingTail; exports.TEXT_SIZE_PRESETS = TEXT_SIZE_PRESETS; exports.resolveTextSizeConfig = resolveTextSizeConfig; exports.NO_BROKEN_LINKS = NO_BROKEN_LINKS; exports.MarkdownEngine = MarkdownEngine; exports.SimpleMarkdownRenderer = SimpleMarkdownRenderer; exports.fetchPriorityProp = fetchPriorityProp; exports.MUX_STREAM_ORIGIN = MUX_STREAM_ORIGIN; exports.MUX_IMAGE_ORIGIN = MUX_IMAGE_ORIGIN; exports.saveDataEnabled = saveDataEnabled; exports.useVideoOriginPreconnect = useVideoOriginPreconnect; exports.useVideoWarmup = useVideoWarmup; exports.VideoPlayBadge = VideoPlayBadge; exports.VideoUnmuteGlyph = VideoUnmuteGlyph; exports.extractYouTubeId = extractYouTubeId; exports.VIDEO_PLAYBACK_FAILED_EVENT = VIDEO_PLAYBACK_FAILED_EVENT; exports.Video = Video2; exports.HoverDropdown = HoverDropdown; exports.ExpandChevron = ExpandChevron; exports.useCollapsible = useCollapsible; exports.getCommandText = getCommandText; exports.ArgRow = ArgRow; exports.ResultBlock = ResultBlock; exports.CommandBlock = CommandBlock; exports.ApprovalStatusTag = ApprovalStatusTag; exports.ApprovalBatchMessage = ApprovalBatchMessage; exports.ApprovalRequestMessage = ApprovalRequestMessage; exports.EscalationOfferMessage = EscalationOfferMessage; exports.formatTime = formatTime; exports.AiAssistantInfo = AiAssistantInfo; exports.TicketEscalatedMessage = TicketEscalatedMessage; exports.MESSAGE_TYPE = MESSAGE_TYPE; exports.SCROLL_ANCHOR = SCROLL_ANCHOR; exports.TICKET_EVENT_KIND = TICKET_EVENT_KIND; exports.TicketEventMessage = TicketEventMessage; exports.ContextCompactionDisplay = ContextCompactionDisplay; exports.ThinkingDisplay = ThinkingDisplay; exports.AskDisplay = AskDisplay; exports.ErrorMessageDisplay = ErrorMessageDisplay; exports.MspOrganizationCard = MspOrganizationCard; exports.MspOrganizationCardSkeleton = MspOrganizationCardSkeleton; exports.ChatContainer = ChatContainer; exports.ChatHeader = ChatHeader; exports.ChatContent = ChatContent; exports.ChatFooter = ChatFooter; exports.ChatTypingIndicator = ChatTypingIndicator; exports.MingoOnboardingCard = MingoOnboardingCard; exports.ICON_REGISTRY = ICON_REGISTRY; exports.normalizeIconKey = normalizeIconKey; exports.getIconComponent = getIconComponent; exports.getDynamicIcon = getDynamicIcon; exports.ICON_ALIASES = ICON_ALIASES; exports.resolveIcon = resolveIcon; exports.ICON_OPTIONS = ICON_OPTIONS; exports.SlashCommandSuggestions = SlashCommandSuggestions; exports.ChatInput = ChatInput; exports.CONTEXT_ROW_CLASS = CONTEXT_ROW_CLASS; exports.CONTEXT_ICON_CLASS = CONTEXT_ICON_CLASS; exports.CONTEXT_LABEL_CLASS = CONTEXT_LABEL_CLASS; exports.CONTEXT_BACK_CLASS = CONTEXT_BACK_CLASS; exports.CONTEXT_STATE_CLASS = CONTEXT_STATE_CLASS; exports.ContextMenuRow = ContextMenuRow; exports.ContextItemsSkeleton = ContextItemsSkeleton; exports.ContextItemsList = ContextItemsList; exports.ContextErrorBoundary = ContextErrorBoundary; exports.CHAT_CONTEXT_ITEMS_DEFAULT_MAX = CHAT_CONTEXT_ITEMS_DEFAULT_MAX; exports.ChatComposerPlusMenu = ChatComposerPlusMenu; exports.ChatContextPicker = ChatContextPicker; exports.ChatContextChipStrip = ChatContextChipStrip; exports.BlockCard = BlockCard; exports.remarkCardLinks = remarkCardLinks; exports.remarkMentionChips = remarkMentionChips; exports.ToolExecutionDisplay = ToolExecutionDisplay; exports.MemoizedChatMessageEnhanced = MemoizedChatMessageEnhanced; exports.ChatMessageSkeleton = ChatMessageSkeleton; exports.ChatMessageListSkeleton = ChatMessageListSkeleton; exports.ChatMessageList = ChatMessageList; exports.useProxiedImageUrl = useProxiedImageUrl; exports.ChatMessageRow = ChatMessageRow; exports.ChatMessageRowSkeleton = ChatMessageRowSkeleton; exports.FAE_AVATAR_DATA_URI = FAE_AVATAR_DATA_URI; exports.AgentMark = AgentMark; exports.EntityIcon = EntityIcon; exports.getAgentAccent = getAgentAccent; exports.accentFromIdentityIcon = accentFromIdentityIcon; exports.isQuickActionIconSpec = isQuickActionIconSpec; exports.renderQuickActionIcon = renderQuickActionIcon; exports.QuickActionChipSkeleton = QuickActionChipSkeleton; exports.QuickActionChipButton = QuickActionChipButton; exports.QuickActionChipFromData = QuickActionChipFromData; exports.useMarqueeSync = useMarqueeSync; exports.getMarqueeTrackOffset = getMarqueeTrackOffset; exports.getMarqueeAppliedOffset = getMarqueeAppliedOffset; exports.getMarqueeCloneTwin = getMarqueeCloneTwin; exports.MarqueeWallFades = MarqueeWallFades; exports.MarqueeWall = MarqueeWall; exports.WALL_SKELETON_LABEL_CH = WALL_SKELETON_LABEL_CH; exports.interleave = interleave; exports.QuickActionWall = QuickActionWall; exports.QuickActionMarquee = QuickActionMarquee; exports.ChatTicketItem = ChatTicketItem; exports.ChatTicketList = ChatTicketList; exports.MingoOnboardingCardSkeleton = MingoOnboardingCardSkeleton; exports.MingoOnboardingListSkeleton = MingoOnboardingListSkeleton; exports.MingoChatHistorySkeleton = MingoChatHistorySkeleton; exports.MingoChatHistory = MingoChatHistory; exports.MingoWelcome = MingoWelcome; exports.GuideWelcome = GuideWelcome; exports.GuideModeBanner = GuideModeBanner; exports.TabSelector = TabSelector; exports.MingoHistoryRail = MingoHistoryRail; exports.RenameChatModal = RenameChatModal; exports.ArchiveChatModal = ArchiveChatModal; exports.UnarchiveChatModal = UnarchiveChatModal; exports.ChatDialogModals = ChatDialogModals; exports.ChatHeaderIconButton = ChatHeaderIconButton; exports.ChatHeaderSearchField = ChatHeaderSearchField; exports.ChatPanelHeader = ChatPanelHeader; exports.CHAT_ATTACHMENT_VIEW_URL_PREFIX = CHAT_ATTACHMENT_VIEW_URL_PREFIX; exports.CHAT_ATTACHMENT_VIEW_TOKEN_QUERY_PARAM = CHAT_ATTACHMENT_VIEW_TOKEN_QUERY_PARAM; exports.ANTHROPIC_SUPPORTED_IMAGE_MIME = ANTHROPIC_SUPPORTED_IMAGE_MIME; exports.buildChatAttachmentViewUrl = buildChatAttachmentViewUrl; exports.escapeMarkdownInline = escapeMarkdownInline; exports.formatChatAttachmentMarkdownForBubble = formatChatAttachmentMarkdownForBubble; exports.CHAT_ATTACHMENT_VIEW_URL_PREFIX_REGEX_ESCAPED = CHAT_ATTACHMENT_VIEW_URL_PREFIX_REGEX_ESCAPED; exports.CHAT_ATTACHMENT_MARKDOWN_PATTERN = CHAT_ATTACHMENT_MARKDOWN_PATTERN; exports.stripChatAttachmentMarkdown = stripChatAttachmentMarkdown; exports.CHAT_ATTACHMENT_MIME_TYPES = CHAT_ATTACHMENT_MIME_TYPES; exports.CHAT_ATTACHMENT_CONCURRENT_UPLOADS_PER_USER = CHAT_ATTACHMENT_CONCURRENT_UPLOADS_PER_USER; exports.ChatAttachmentAddButton = ChatAttachmentAddButton; exports.ChatAttachmentChipStrip = ChatAttachmentChipStrip; exports.ChatContextMemoryBar = ChatContextMemoryBar; exports.HoverCard = HoverCard; exports.HoverCardTrigger = HoverCardTrigger; exports.HoverCardContent = HoverCardContent; exports.ModelDisplay = ModelDisplay; exports.ModelDisplaySkeleton = ModelDisplaySkeleton; exports.ChatComposer = ChatComposer; exports.ChatArchivePage = ChatArchivePage; exports.DialogListItem = DialogListItem; exports.ChatSidebar = ChatSidebar; exports.NEW_TAB_FEATURES = NEW_TAB_FEATURES; exports.isModifierClick = isModifierClick; exports.stripSameOriginToPath = stripSameOriginToPath; exports.resolveExternalNavigation = resolveExternalNavigation; exports.executeNavigation = executeNavigation; exports.executeNavigationImperative = executeNavigationImperative; exports.handleChatNavClick = handleChatNavClick; exports.NavLinkAnchorViaRuntime = NavLinkAnchorViaRuntime; exports.SourceActionButton = SourceActionButton; exports.getCaptionsUrl = getCaptionsUrl; exports.rebaseCaptionsUrl = rebaseCaptionsUrl; exports.buildCaptionsUrl = buildCaptionsUrl; exports.getEntityCaptionUrls = getEntityCaptionUrls; exports.getEntityCaptionUrlsById = getEntityCaptionUrlsById; exports.captionsEntityTypeForDocType = captionsEntityTypeForDocType; exports.PAGE_HEADING_CLASS = PAGE_HEADING_CLASS; exports.SECTION_HEADING_CLASS = SECTION_HEADING_CLASS; exports.PageHeading = PageHeading; exports.useCaptions = useCaptions; exports.UserDisplay = UserDisplay; exports.CardHitLayer = CardHitLayer; exports.STRIP_CELL_MAX_WIDTH = STRIP_CELL_MAX_WIDTH; exports.CardsStrip = CardsStrip; exports.VideoHoverPreviewSurface = VideoHoverPreviewSurface; exports.RATIO_GRID_CLASS = RATIO_GRID_CLASS; exports.RATIO_TO_CSS_ASPECT = RATIO_TO_CSS_ASPECT; exports.RatioTabs = RatioTabs; exports.detectAspectRatio = detectAspectRatio; exports.ratioToCategory = ratioToCategory; exports.groupByAspectRatio = groupByAspectRatio; exports.VideoBitesStrip = VideoBitesStrip; exports.VideoBiteCard = VideoBiteCard; exports.EntityVideoSection = EntityVideoSection; exports.ChatVideoEntityCard = ChatVideoEntityCard; exports.GitHubActivityCard = GitHubActivityCard; exports.GitHubActivityCardSkeleton = GitHubActivityCardSkeleton; exports.SlackMessageCard = SlackMessageCard; exports.SlackMessageCardSkeleton = SlackMessageCardSkeleton; exports.HubspotTicketCard = HubspotTicketCard; exports.HubspotTicketCardSkeleton = HubspotTicketCardSkeleton; exports.DataRoomDocCard = DataRoomDocCard; exports.DataRoomDocCardSkeleton = DataRoomDocCardSkeleton; exports.CampaignCardAdmin = CampaignCardAdmin; exports.CampaignCardAdminSkeleton = CampaignCardAdminSkeleton; exports.GenericEntityCard = GenericEntityCard; exports.GenericEntityCardSkeleton = GenericEntityCardSkeleton; exports.faqSectionSlug = faqSectionSlug; exports.faqItemAnchor = faqItemAnchor; exports.parseFaqHash = parseFaqHash; exports.useChatCardItem = useChatCardItem; exports.clickupTaskUrl = clickupTaskUrl; exports.readFetchedCardTitle = readFetchedCardTitle; exports.resolveFetchedCardHref = resolveFetchedCardHref; exports.SOURCE_ICON_NAMES = SOURCE_ICON_NAMES; exports.getSourceIconName = getSourceIconName; exports.SOURCE_LABELS_BY_TABLE = SOURCE_LABELS_BY_TABLE; exports.getSourceLabel = getSourceLabel; exports.DEFAULT_DOCUMENT_TYPE_TO_TABLE_ID = DEFAULT_DOCUMENT_TYPE_TO_TABLE_ID; exports.defaultTableIdForDocumentType = defaultTableIdForDocumentType; exports.resolveSourceRowCTA = resolveSourceRowCTA; exports.resolveSourceIcon = resolveSourceIcon; exports.ChatCardLoader = ChatCardLoader; exports.renderChatInlineEntityCard = renderChatInlineEntityCard; exports.CHAT_TYPE = CHAT_TYPE; exports.OWNER_TYPE = OWNER_TYPE; exports.MESSAGE_ROLE = MESSAGE_ROLE; exports.ASSISTANT_TYPE = ASSISTANT_TYPE; exports.AUTHOR_TYPE = AUTHOR_TYPE; exports.APPROVAL_STATUS = APPROVAL_STATUS; exports.APPROVAL_BLOCK_VARIANT = APPROVAL_BLOCK_VARIANT; exports.CONNECTION_STATUS = CONNECTION_STATUS; exports.isStructuredContent = isStructuredContent; exports.normalizeContent = normalizeContent2; exports.NETWORK_CONFIG = NETWORK_CONFIG; exports.EMPTY_DIALOG_CAPABILITIES = EMPTY_DIALOG_CAPABILITIES; exports.useChunkCatchup = useChunkCatchup; exports.useScriptedStream = useScriptedStream; exports.RESYNC_AFTER_HIDDEN_MS = RESYNC_AFTER_HIDDEN_MS; exports.useJetStreamDialogSubscription = useJetStreamDialogSubscription; exports.useNatsDialogSubscription = useNatsDialogSubscription; exports.buildNatsWsUrl = buildNatsWsUrl; exports.fetchSlashCommands = fetchSlashCommands; exports.useSlashCommands = useSlashCommands; exports.useSlashCommandRegistry = useSlashCommandRegistry; exports.fetchEmptyStateConfig = fetchEmptyStateConfig; exports.useEmptyStateConfig = useEmptyStateConfig; exports.useChatAttachments = useChatAttachments; exports.useChatAttachmentImageGallery = useChatAttachmentImageGallery; exports.ChatIdentityProvider = ChatIdentityProvider; exports.useChatIdentity = useChatIdentity; exports.useCloseOnNavigation = useCloseOnNavigation; exports.useSSE = useSSE; exports.useChat = useChat; exports.approvalDisplaysInline = approvalDisplaysInline; exports.appendToTrailingAssistant = appendToTrailingAssistant; exports.upsertTrailingCompaction = upsertTrailingCompaction; exports.applyToolExecutionToMessages = applyToolExecutionToMessages; exports.MessageSegmentAccumulator = MessageSegmentAccumulator; exports.createMessageSegmentAccumulator = createMessageSegmentAccumulator; exports.SCROLL_ANCHOR_WIRE_KEY = SCROLL_ANCHOR_WIRE_KEY; exports.parseScrollAnchor = parseScrollAnchor; exports.createEmptyTurnMeta = createEmptyTurnMeta; exports.createChatStreamReducer = createChatStreamReducer; exports.DEFAULT_DIALOG_SIDE = DEFAULT_DIALOG_SIDE; exports.DEFAULT_MAX_REDUCERS = DEFAULT_MAX_REDUCERS; exports.MAX_PENDING_RETAIN_KEYS = MAX_PENDING_RETAIN_KEYS; exports.createChatDialogStore = createChatDialogStore; exports.createDeltaBatcher = createDeltaBatcher; exports.useChatStreamReducer = useChatStreamReducer; exports.createChatConversationsApi = createChatConversationsApi; exports.parseWireCommandOverride = parseWireCommandOverride; exports.sanitizeTitleForChat = sanitizeTitleForChat; exports.formatSingularLookupInvocation = formatSingularLookupInvocation; exports.extractEntityIdFilter = extractEntityIdFilter; exports.buildDiscussAddendum = buildDiscussAddendum; exports.buildDiscussPrompt = buildDiscussPrompt; exports.AUTO_CONTINUATION_DIRECTIVE_PREFIX = AUTO_CONTINUATION_DIRECTIVE_PREFIX; exports.buildAutoContinuationDirective = buildAutoContinuationDirective; exports.useManagedDialogList = useManagedDialogList; exports.useSseChatAdapter = useSseChatAdapter; exports.extractIncompleteMessageState = extractIncompleteMessageState; exports.extractIncompleteTailState = extractIncompleteTailState; exports.decodeHistoricalMessageData = decodeHistoricalMessageData; exports.processHistoricalMessages = processHistoricalMessages; exports.extractErrorMessages = extractErrorMessages; exports.processHistoricalMessagesWithErrors = processHistoricalMessagesWithErrors; exports.mapProcessedToUnified = mapProcessedToUnified; exports.historicalToUnified = historicalToUnified; exports.useNatsChatAdapter = useNatsChatAdapter; exports.useStableShallow = useStableShallow; exports.useUnifiedChat = useUnifiedChat; exports.SYNTHETIC_REALTIME_ID_PREFIXES = SYNTHETIC_REALTIME_ID_PREFIXES; exports.flattenMessagePagesChronological = flattenMessagePagesChronological; exports.maxPersistedStreamSeq = maxPersistedStreamSeq; exports.mergeHistoryWithRealtime = mergeHistoryWithRealtime; exports.computeHistoryPrepend = computeHistoryPrepend; exports.CHIP_ACTION_BUTTON_CLASS = CHIP_ACTION_BUTTON_CLASS; exports.chatChipClass = chatChipClass; exports.flattenAssistantContent = flattenAssistantContent; exports.normalizeHistoricalMessageData = normalizeHistoricalMessageData; exports.isHistoricalUserTurn = isHistoricalUserTurn; exports.buildStreamFrames = buildStreamFrames; exports.EmbeddableChat = EmbeddableChat;
25544
- //# sourceMappingURL=chunk-XNDTYTVT.cjs.map
25835
+ //# sourceMappingURL=chunk-YXTAV2E3.cjs.map