@burdenoff/website-sdk 2026.1104.2 → 2026.1104.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { fill } from './chunk-TT3MHN42.mjs';
1
+ import { fill, answerPlainText, answerSpeechText } from './chunk-JZS6FQT6.mjs';
2
2
  import { useExploreChat, useSpeechInput, stopSpeaking, serializeBakedCatalog, BAKED_CATALOG_ELEMENT_ID, bakedCatalogLocale, useProgressiveReveal, EXPLORE_FEEDBACK_REASONS, EXPLORE_FEEDBACK_COMMENT_SOFT_MAX, looksLikeDeliverableEmail, EXPLORE_ESCALATION_NOTE_SOFT_MAX, useSpeechOutput } from './chunk-SMD7MEEA.mjs';
3
3
  import { ProseStyles } from './chunk-6VJT3SM4.mjs';
4
4
  import { Markdown, MarkdownLink } from './chunk-EBZ2HGJ2.mjs';
@@ -1271,113 +1271,6 @@ function isVideoFileTarget(href) {
1271
1271
  return false;
1272
1272
  }
1273
1273
  }
1274
- var CODE_FENCE = /^\s*(?:```|~~~)/;
1275
- var TABLE_ROW_LINE = /^\s{0,3}\|/;
1276
- var TABLE_DELIMITER_ROW = /^\s{0,3}\|[\s:|-]*-[\s:|-]*$/;
1277
- var LINKED_IMAGE = /\[!\[([^[\]]*)\]\([^)\s]*(?:\s+"[^"]*")?\)\]\(([^)\s]+)(?:\s+"[^"]*")?\)/g;
1278
- var IMAGE = /!\[[^[\]]*\]\([^)\s]*(?:\s+"[^"]*")?\)/g;
1279
- var LINK = /\[([^[\]]+)\]\(([^)\s]+)(?:\s+"[^"]*")?\)/g;
1280
- function readableLine(raw, mode) {
1281
- let line = raw;
1282
- if (line.includes("](")) {
1283
- line = line.replace(LINKED_IMAGE, (_match, alt, href) => {
1284
- if (mode === "speech") return "";
1285
- return alt.trim() === "" ? href : `${alt.trim()} (${href})`;
1286
- });
1287
- line = line.replace(IMAGE, "");
1288
- line = mode === "speech" ? (
1289
- // A voice reading "h-t-t-p-s colon slash slash…" mid-sentence is noise, and the
1290
- // prompt asks for two to five links in every answer. The label IS the words.
1291
- line.replace(LINK, "$1")
1292
- ) : line.replace(LINK, "$1 ($2)");
1293
- }
1294
- line = mode === "speech" ? line.replace(/<(https?:\/\/[^>\s]+)>/g, "") : line.replace(/<(https?:\/\/[^>\s]+)>/g, "$1");
1295
- line = line.replace(/^\s{0,3}#{1,6}\s+/, "");
1296
- line = line.replace(/^\s{0,3}>\s?/, "");
1297
- if (/^\s{0,3}([-*_])[ \t]*(?:\1[ \t]*){2,}$/.test(line)) return "";
1298
- line = line.replace(/`([^`]+)`/g, "$1");
1299
- line = line.replace(/\*\*([^*]+)\*\*/g, "$1");
1300
- line = line.replace(/__([^_]+)__/g, "$1");
1301
- line = line.replace(/(^|[^*\w])\*([^*\n]+)\*(?![*\w])/g, "$1$2");
1302
- line = line.replace(/(^|[^_\w])_([^_\n]+)_(?![_\w])/g, "$1$2");
1303
- return line.replace(/[ \t]+$/, "");
1304
- }
1305
- function tableCells(row) {
1306
- const trimmed = row.trim();
1307
- const cells = [];
1308
- let cell = "";
1309
- for (let at = 0; at < trimmed.length; at += 1) {
1310
- const char = trimmed[at] ?? "";
1311
- if (char === "\\") {
1312
- cell += char + (trimmed[at + 1] ?? "");
1313
- at += 1;
1314
- continue;
1315
- }
1316
- if (char === "|") {
1317
- cells.push(cell.trim());
1318
- cell = "";
1319
- continue;
1320
- }
1321
- cell += char;
1322
- }
1323
- cells.push(cell.trim());
1324
- if (trimmed.startsWith("|") && cells[0] === "") cells.shift();
1325
- if (trimmed.endsWith("|") && cells[cells.length - 1] === "") cells.pop();
1326
- return cells;
1327
- }
1328
- function asSentence(text) {
1329
- return /[.!?]$/.test(text) ? text : `${text}.`;
1330
- }
1331
- function spokenTable(rows) {
1332
- if (rows.length < 2 || !TABLE_DELIMITER_ROW.test(rows[1] ?? "")) return rows;
1333
- const labels = tableCells(rows[0] ?? "");
1334
- const spoken = [];
1335
- for (const row of rows.slice(2)) {
1336
- const parts = [];
1337
- tableCells(row).forEach((value, column) => {
1338
- if (value === "") return;
1339
- const label = column === 0 ? "" : labels[column] ?? "";
1340
- parts.push(label === "" ? value : `${label}: ${value}`);
1341
- });
1342
- if (parts.length > 0) spoken.push(asSentence(parts.join(". ")));
1343
- }
1344
- return spoken;
1345
- }
1346
- function readableText(markdown, mode) {
1347
- const lines = [];
1348
- let inFence = false;
1349
- let table = [];
1350
- const flushTable = () => {
1351
- if (table.length === 0) return;
1352
- for (const line of spokenTable(table)) lines.push(readableLine(line, mode));
1353
- table = [];
1354
- };
1355
- for (const raw of markdown.split("\n")) {
1356
- if (CODE_FENCE.test(raw)) {
1357
- flushTable();
1358
- inFence = !inFence;
1359
- continue;
1360
- }
1361
- if (inFence) {
1362
- lines.push(raw);
1363
- continue;
1364
- }
1365
- if (mode === "speech" && TABLE_ROW_LINE.test(raw)) {
1366
- table.push(raw);
1367
- continue;
1368
- }
1369
- flushTable();
1370
- lines.push(readableLine(raw, mode));
1371
- }
1372
- flushTable();
1373
- return lines.join("\n").replace(/\n{3,}/g, "\n\n").trim();
1374
- }
1375
- function answerPlainText(markdown) {
1376
- return readableText(markdown, "clipboard");
1377
- }
1378
- function answerSpeechText(markdown) {
1379
- return readableText(markdown, "speech");
1380
- }
1381
1274
  var AnswerScopeContext = createContext(null);
1382
1275
  var InsideLinkContext = createContext(false);
1383
1276
  function AnswerLink(props) {
@@ -5156,6 +5049,6 @@ function ExploreView({
5156
5049
  );
5157
5050
  }
5158
5051
 
5159
- export { EXPLORE_LOCALES, EXPLORE_PREFILL_MAX_LENGTH, ExploreAnswerBody, ExploreAnswerStyles, ExploreCatalogProductsContext, ExploreChatProvider, ExploreConversationContext, ExploreConversationStartContext, ExplorePage, anotherProductMatcher, answerPlainText, answerSpeechText, exploreQuestionHref, exploreStrings, inlineImageOrigins, isDevelopmentBuild, isInlineImageAllowed, isInlineVideoAllowed, isRtlLocale, logoUrlOf, pinnedProductSlug, productNameFor, productNamesByOrigin, productScopedPrompts, productSlugsByOrigin, referenceKindOf, resolveExploreLocale, speechLocaleOf, summariseReferences, useExploreConversation };
5160
- //# sourceMappingURL=chunk-5JQGE3XI.mjs.map
5161
- //# sourceMappingURL=chunk-5JQGE3XI.mjs.map
5052
+ export { EXPLORE_LOCALES, EXPLORE_PREFILL_MAX_LENGTH, ExploreAnswerBody, ExploreAnswerStyles, ExploreCatalogProductsContext, ExploreChatProvider, ExploreConversationContext, ExploreConversationStartContext, ExplorePage, anotherProductMatcher, exploreQuestionHref, exploreStrings, inlineImageOrigins, isDevelopmentBuild, isInlineImageAllowed, isInlineVideoAllowed, isRtlLocale, logoUrlOf, pinnedProductSlug, productNameFor, productNamesByOrigin, productScopedPrompts, productSlugsByOrigin, referenceKindOf, resolveExploreLocale, speechLocaleOf, summariseReferences, useExploreConversation };
5053
+ //# sourceMappingURL=chunk-7HE33NBS.mjs.map
5054
+ //# sourceMappingURL=chunk-7HE33NBS.mjs.map