@sonordev/site-kit 8.6.0 → 8.7.0

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/CHANGELOG.md +11 -0
  2. package/agent-manifest.json +1 -1
  3. package/dist/{AnalyticsProvider-GVJYL6XY.js → AnalyticsProvider-3UIQMIRW.js} +6 -6
  4. package/dist/{ArticleViewTracker-AOJXEBYM.js → ArticleViewTracker-KNXP2DXL.js} +5 -5
  5. package/dist/{BlocksPopup-AJ3CKVQG.js → BlocksPopup-DFE32GPX.js} +9 -8
  6. package/dist/{ChatWidget-EYBVB5SZ.js → ChatWidget-L74L4YAD.js} +5 -5
  7. package/dist/{FileField-UEQYIFRO.js → FileField-P3PLEAON.js} +3 -3
  8. package/dist/{FormSpotlight-H73ZZ66T.js → FormSpotlight-DNBSBRIE.js} +1 -1
  9. package/dist/{FormStage-2PLWWYBW.js → FormStage-I4JGLT57.js} +1 -1
  10. package/dist/{ManagedForm-ZQOFXEWS.js → ManagedForm-GJRGBM6W.js} +6 -6
  11. package/dist/{ManagedNewsletterForm-5TE47YZD.js → ManagedNewsletterForm-AUZ6YB7G.js} +9 -9
  12. package/dist/{SignalCore-FEFNMNYN.js → SignalCore-UV7K7PT4.js} +5 -5
  13. package/dist/SiteChat-6UWE545R.js +6 -0
  14. package/dist/SiteDesignReporter-ZSU76DZJ.js +13 -0
  15. package/dist/{SitePopups-C44YTQ3Q.js → SitePopups-XHWU7GNF.js} +6 -6
  16. package/dist/SitemapSync-ELWV6W7Y.js +9 -0
  17. package/dist/_client/booking-widget.js +5 -5
  18. package/dist/affiliates/index.js +3 -3
  19. package/dist/analytics/content-text.d.ts +17 -0
  20. package/dist/analytics/index.js +6 -6
  21. package/dist/{article-styles-VASFBYA3.js → article-styles-D7VCDXMG.js} +2 -1
  22. package/dist/article-tables-W45BE353.js +3 -0
  23. package/dist/articles/index.js +7 -20
  24. package/dist/articles/server-ui.js +29 -55
  25. package/dist/articles/server.js +6 -5
  26. package/dist/chat/index.js +8 -8
  27. package/dist/{chunk-3RDJKIYO.js → chunk-2WDWQI7K.js} +1 -1
  28. package/dist/{chunk-NI6ZTP3D.js → chunk-36ZMNBXZ.js} +1 -1
  29. package/dist/chunk-3MJNBOUO.js +8 -0
  30. package/dist/{chunk-ZZSAWXWD.js → chunk-3MLWIBHX.js} +1 -1
  31. package/dist/{chunk-BF7TZYC3.js → chunk-52KO4LKD.js} +1 -1
  32. package/dist/{chunk-U34O6I7W.js → chunk-5WHBYQJ4.js} +3 -3
  33. package/dist/{chunk-5D7ZISUP.js → chunk-7DYMM6SS.js} +11 -6
  34. package/dist/{chunk-GFY3E7EQ.js → chunk-7YB3QA4P.js} +15 -7
  35. package/dist/{chunk-6AWIUO2Z.js → chunk-A2MDVP47.js} +1 -1
  36. package/dist/{chunk-E4PTMORJ.js → chunk-AL5UCWLI.js} +23 -8
  37. package/dist/{chunk-O3Z5HHFP.js → chunk-BAJUXQTH.js} +2 -2
  38. package/dist/{chunk-IGAIQ2B3.js → chunk-BJYX6SFI.js} +2 -2
  39. package/dist/{chunk-72F44HKL.js → chunk-DJIGFX33.js} +1 -1
  40. package/dist/{chunk-AJG74ZZV.js → chunk-DPYGC7WE.js} +1 -1
  41. package/dist/{chunk-XA7Q2VQA.js → chunk-EK7P62DT.js} +1 -1
  42. package/dist/chunk-FXR5PJDL.js +420 -0
  43. package/dist/{chunk-OWO3RFEX.js → chunk-G5FD7UXK.js} +1 -1
  44. package/dist/{chunk-KTMHRXDT.js → chunk-HM7CDWFK.js} +1 -1
  45. package/dist/{chunk-CMUD37WV.js → chunk-HWQPCZOX.js} +1 -1
  46. package/dist/{chunk-6KU7STM3.js → chunk-HY7ZEU2C.js} +3 -1
  47. package/dist/chunk-IBHBEUZV.js +27 -0
  48. package/dist/{chunk-NUXXFCIT.js → chunk-IXZBOOAD.js} +4 -4
  49. package/dist/chunk-JESLPEST.js +14 -0
  50. package/dist/{chunk-BC7JMY4Z.js → chunk-JG53YJLM.js} +58 -1
  51. package/dist/{chunk-VA6IJ55K.js → chunk-JWCCY72G.js} +1 -1
  52. package/dist/{chunk-RI2N2EBI.js → chunk-JYITKUUB.js} +13 -5
  53. package/dist/chunk-KIYACQW3.js +1 -0
  54. package/dist/{chunk-OFSV5TZY.js → chunk-KLIDCNML.js} +1 -1
  55. package/dist/{chunk-7R2STOVD.js → chunk-L2KSHJS2.js} +3 -3
  56. package/dist/{chunk-HMTPRBYJ.js → chunk-LGWN6KCN.js} +1 -1
  57. package/dist/{chunk-YNBRVVTX.js → chunk-MJW6YIDJ.js} +1 -1
  58. package/dist/{chunk-BUE3Z32O.js → chunk-MNORERMF.js} +1 -1
  59. package/dist/{chunk-Y35BWW2C.js → chunk-ODOV76VW.js} +1 -1
  60. package/dist/{chunk-6NXFA7HE.js → chunk-OHLCE4GC.js} +2 -2
  61. package/dist/{chunk-QQT2T6JQ.js → chunk-P5PRR2BB.js} +1 -1
  62. package/dist/{chunk-JJ4JS3LD.js → chunk-PAYCK7FC.js} +1 -1
  63. package/dist/{chunk-DLM4FFNH.js → chunk-QTBAKOCZ.js} +1 -1
  64. package/dist/{chunk-L6QTERSH.js → chunk-RHT7OZNF.js} +1 -1
  65. package/dist/{chunk-YJH6WE76.js → chunk-RWWSOYJO.js} +9 -9
  66. package/dist/{chunk-JSW42BHL.js → chunk-T6TWPKBL.js} +1 -1
  67. package/dist/{chunk-FTSEP7Q3.js → chunk-U4OQJQK6.js} +3 -3
  68. package/dist/{chunk-IYCSDFPN.js → chunk-UYOE3HA4.js} +2 -2
  69. package/dist/chunk-VEJD5EJ2.js +344 -0
  70. package/dist/chunk-XAZC2TUD.js +1119 -0
  71. package/dist/{chunk-DSD3XZQQ.js → chunk-XC2TWYDV.js} +3 -3
  72. package/dist/{chunk-URJN75ZG.js → chunk-XIDWNXZN.js} +3 -3
  73. package/dist/chunk-XLAHRN4B.js +1 -0
  74. package/dist/{chunk-V67OD7RW.js → chunk-XZFOQ2V4.js} +113 -93
  75. package/dist/{chunk-QNOJSSQT.js → chunk-YYPYLYZM.js} +1 -1
  76. package/dist/client/index.js +4 -4
  77. package/dist/contracts/campaign-normalize.d.ts +2 -0
  78. package/dist/contracts/entries.d.ts +1 -1
  79. package/dist/contracts/funnels.d.ts +576 -0
  80. package/dist/contracts/inbox.d.ts +42 -0
  81. package/dist/contracts/llms.d.ts +200 -0
  82. package/dist/contracts/portfolio.d.ts +170 -0
  83. package/dist/contracts/publication-branding.d.ts +10 -2
  84. package/dist/contracts/site-cache.d.ts +2 -0
  85. package/dist/fleet/index.js +6 -6
  86. package/dist/forms/index.js +9 -9
  87. package/dist/forms/server.js +2 -2
  88. package/dist/images/index.js +4 -4
  89. package/dist/index.js +1 -1
  90. package/dist/landing/contract.d.ts +2 -13
  91. package/dist/landing/contract.js +2 -0
  92. package/dist/landing/index.js +4 -2
  93. package/dist/landing/managed-server.d.ts +21 -0
  94. package/dist/landing/managed.d.ts +11 -0
  95. package/dist/landing/metadata.js +2 -0
  96. package/dist/landing/server.d.ts +5 -0
  97. package/dist/landing/server.js +19 -2
  98. package/dist/layout/client.js +9 -9
  99. package/dist/layout/index.js +10 -10
  100. package/dist/llms/contract.js +2 -1
  101. package/dist/llms/index.js +9 -7
  102. package/dist/llms/merge.d.ts +29 -0
  103. package/dist/maps/index.js +3 -3
  104. package/dist/mcp/sonor.js +9 -8
  105. package/dist/portfolio/contract.js +1 -1
  106. package/dist/press-kit/articles/article-body.d.ts +13 -0
  107. package/dist/press-kit/articles/article-heading-ids.d.ts +7 -0
  108. package/dist/press-kit/articles/article-headings.d.ts +61 -0
  109. package/dist/press-kit/articles/html-tags.d.ts +46 -0
  110. package/dist/press-kit/articles/types.d.ts +2 -0
  111. package/dist/revalidate/index.js +3 -3
  112. package/dist/runtime/index.js +3 -3
  113. package/dist/seo/client.js +6 -6
  114. package/dist/seo/index.js +14 -13
  115. package/dist/seo/llms/contract.js +2 -1
  116. package/dist/seo/llms.js +9 -7
  117. package/dist/seo/meta/contract.js +2 -1
  118. package/dist/seo/register-sitemap-cli.js +1 -1
  119. package/dist/seo/server.js +5 -4
  120. package/dist/seo/sitemap.js +7 -5
  121. package/dist/seo-meta/contract.js +2 -1
  122. package/dist/server/index.js +3 -3
  123. package/dist/{server-api-EGOKC7Q3.js → server-api-XIKDWSNO.js} +2 -2
  124. package/dist/shared/build-entries.d.ts +3 -1
  125. package/dist/shared/markdown.d.ts +7 -6
  126. package/dist/shared/version.d.ts +1 -1
  127. package/dist/signal/index.js +2 -2
  128. package/dist/sitemap/index.js +7 -5
  129. package/dist/slots/index.js +2 -2
  130. package/dist/sync/index.js +5 -5
  131. package/dist/website/contract.js +2 -1
  132. package/dist/website/images.js +4 -4
  133. package/dist/website/index.js +10 -9
  134. package/dist/website/landing/server.js +19 -2
  135. package/dist/website/landing.js +4 -2
  136. package/dist/website/popups.js +9 -8
  137. package/dist/website/slots.js +2 -2
  138. package/dist/{writeLLMsTxt-KHVHNSDM.js → writeLLMsTxt-QN2HIVT4.js} +6 -4
  139. package/docs.json +5 -0
  140. package/package.json +1 -1
  141. package/src/analytics/README.md +1 -1
  142. package/src/landing/README.md +64 -0
  143. package/src/llms/README.md +52 -20
  144. package/dist/SiteChat-3MKYL2XM.js +0 -6
  145. package/dist/SiteDesignReporter-AJDIBNHI.js +0 -12
  146. package/dist/SitemapSync-UJA6JVPW.js +0 -9
  147. package/dist/article-tables-6XHVULPU.js +0 -2
  148. package/dist/chunk-EKBEOXTH.js +0 -114
  149. package/dist/chunk-NZ4RXN3G.js +0 -145
  150. package/dist/chunk-OSYCOC3K.js +0 -21
  151. /package/dist/{chunk-7ZWO5HDQ.js → chunk-BTHEQDN4.js} +0 -0
  152. /package/dist/{chunk-BQR4IPBW.js → chunk-ISRBSTB7.js} +0 -0
  153. /package/dist/{chunk-IHG36STL.js → chunk-XHYE24HU.js} +0 -0
@@ -1,10 +1,10 @@
1
1
  'use client';
2
- export { ChatWidget, DEFAULT_LAUNCHER_OFFSET_BOTTOM, EchoChat, chatLauncherStyles, isChatEnabled } from '../chunk-IGAIQ2B3.js';
3
- export { SiteChat } from '../chunk-O3Z5HHFP.js';
2
+ export { ChatWidget, DEFAULT_LAUNCHER_OFFSET_BOTTOM, EchoChat, chatLauncherStyles, isChatEnabled } from '../chunk-BJYX6SFI.js';
3
+ export { SiteChat } from '../chunk-BAJUXQTH.js';
4
4
  import '../chunk-6T6CQVNL.js';
5
5
  import '../chunk-JE4A5S4F.js';
6
6
  import '../chunk-27FISYK4.js';
7
- import '../chunk-HMTPRBYJ.js';
7
+ import '../chunk-LGWN6KCN.js';
8
8
  import '../chunk-Q6E4OPGG.js';
9
9
  import '../chunk-5ROTTMBL.js';
10
10
  import '../chunk-C2FZBUSS.js';
@@ -15,12 +15,12 @@ import '../chunk-S22FSH7C.js';
15
15
  import '../chunk-L2V5PUFN.js';
16
16
  import '../chunk-GJWI74ZZ.js';
17
17
  import '../chunk-5TM3WPCI.js';
18
- import '../chunk-DLM4FFNH.js';
19
- import '../chunk-EKBEOXTH.js';
20
- import '../chunk-IYCSDFPN.js';
21
- import '../chunk-QQT2T6JQ.js';
18
+ import '../chunk-QTBAKOCZ.js';
19
+ import '../chunk-VEJD5EJ2.js';
20
+ import '../chunk-UYOE3HA4.js';
21
+ import '../chunk-P5PRR2BB.js';
22
22
  import '../chunk-W7OPEMGJ.js';
23
- import '../chunk-BUE3Z32O.js';
23
+ import '../chunk-MNORERMF.js';
24
24
  import '../chunk-PKBMQBKP.js';
25
25
 
26
26
  // src/chat/echo-config.ts
@@ -1,6 +1,6 @@
1
1
  import { SLOTS_CONTRACT_VERSION, verifySlotContent, canonicalJson } from './chunk-VCJYLYJV.js';
2
2
  import { isValidSlotId, SLOT_CONTENT_MAX_LENGTH, parseSlotRichText, normalizeSlotValue } from './chunk-LPH5FANE.js';
3
- import { SITE_CACHE_TAGS } from './chunk-6KU7STM3.js';
3
+ import { SITE_CACHE_TAGS } from './chunk-HY7ZEU2C.js';
4
4
  import { resolveServerApiConfig } from './chunk-C7TLGL3R.js';
5
5
  import 'server-only';
6
6
  import * as React from 'react';
@@ -22,7 +22,7 @@ function useFieldControls(fields) {
22
22
  });
23
23
  }
24
24
  if (needsFile) {
25
- import('./FileField-UEQYIFRO.js').then((m) => {
25
+ import('./FileField-P3PLEAON.js').then((m) => {
26
26
  if (!cancelled) setControls((prev) => ({ ...prev, File: m.FileField }));
27
27
  }).catch(() => {
28
28
  });
@@ -0,0 +1,8 @@
1
+ // src/contracts/campaign-normalize.ts
2
+ function normalizeCampaignSlug(input) {
3
+ if (!input || typeof input !== "string") return null;
4
+ const slug = input.trim().toLowerCase().replace(/[\s_]+/g, "-").replace(/[^a-z0-9-]/g, "").replace(/-{2,}/g, "-").replace(/^-+|-+$/g, "").slice(0, 80);
5
+ return slug || null;
6
+ }
7
+
8
+ export { normalizeCampaignSlug };
@@ -1,4 +1,4 @@
1
- import { writeLLMsTxtToPublic } from './chunk-V67OD7RW.js';
1
+ import { writeLLMsTxtToPublic } from './chunk-XZFOQ2V4.js';
2
2
  import { getSiteConfig } from './chunk-Z22QVHT4.js';
3
3
  import { buildFetch } from './chunk-UAYAJPEP.js';
4
4
  import { findAppDirForDiscovery } from './chunk-ZEGVKVD5.js';
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { normalizeDesignTokens, designTokenCssVars, sanitizePopupHtml, isSafePopupUrl } from './chunk-IHG36STL.js';
2
+ import { normalizeDesignTokens, designTokenCssVars, sanitizePopupHtml, isSafePopupUrl } from './chunk-XHYE24HU.js';
3
3
  import { useId, useRef, useEffect } from 'react';
4
4
  import { jsxs, jsx } from 'react/jsx-runtime';
5
5
 
@@ -1,9 +1,9 @@
1
1
  'use client';
2
2
  import { sanitizeFleetVersion, buildFleetHeartbeatPayload } from './chunk-ZTZQPYP6.js';
3
3
  import { useDeferredActivation } from './chunk-YC7ELZS3.js';
4
- import { resolveAnalyticsTarget } from './chunk-DLM4FFNH.js';
5
- import { sonorFetch } from './chunk-IYCSDFPN.js';
6
- import { SITE_KIT_VERSION } from './chunk-BUE3Z32O.js';
4
+ import { resolveAnalyticsTarget } from './chunk-QTBAKOCZ.js';
5
+ import { sonorFetch } from './chunk-UYOE3HA4.js';
6
+ import { SITE_KIT_VERSION } from './chunk-MNORERMF.js';
7
7
  import { useRef, useEffect } from 'react';
8
8
 
9
9
  // src/fleet/heartbeat.ts
@@ -1,3 +1,5 @@
1
+ import { htmlTags, isClosingTag, htmlTagName, openTagAttributes } from './chunk-IBHBEUZV.js';
2
+
1
3
  // packages/press-kit/src/articles/processArticleHtml.ts
2
4
  function linkClassificationHost(siteUrl) {
3
5
  try {
@@ -24,20 +26,23 @@ function addExternalLinkTargets(html, siteUrl) {
24
26
  if (!html || !siteUrl) return html;
25
27
  const siteHost = linkClassificationHost(siteUrl);
26
28
  if (!siteHost) return html;
27
- return html.replace(/<a\b([^>]*)>/gi, (_full, attrs) => {
29
+ return html.replace(htmlTags(), (tag) => {
30
+ if (isClosingTag(tag) || htmlTagName(tag) !== "a") return tag;
31
+ const attrs = openTagAttributes(tag);
32
+ const unchanged = `<a${attrs}>`;
28
33
  const hrefMatch = attrs.match(/\bhref\s*=\s*(["'])([^"']*)\1/i);
29
- if (!hrefMatch) return `<a${attrs}>`;
34
+ if (!hrefMatch) return unchanged;
30
35
  const href = hrefMatch[2].trim();
31
- if (!/^https?:\/\//i.test(href)) return `<a${attrs}>`;
36
+ if (!/^https?:\/\//i.test(href)) return unchanged;
32
37
  try {
33
38
  const url = new URL(href);
34
39
  const linkHost = url.hostname.replace(/^www\./i, "").toLowerCase();
35
- if (linkHost === siteHost) return `<a${attrs}>`;
36
- if (/\btarget\s*=/i.test(attrs)) return `<a${attrs}>`;
40
+ if (linkHost === siteHost) return unchanged;
41
+ if (/\btarget\s*=/i.test(attrs)) return unchanged;
37
42
  const trimmed = attrs.trim();
38
43
  return `<a ${trimmed} target="_blank" rel="noopener noreferrer">`;
39
44
  } catch {
40
- return `<a${attrs}>`;
45
+ return unchanged;
41
46
  }
42
47
  });
43
48
  }
@@ -2,8 +2,8 @@
2
2
  import { registerAnalyticsDispatcher } from './chunk-LCDVPAMR.js';
3
3
  import { getOrCreateVisitorId, getOrCreateSessionId } from './chunk-IPQKQEWI.js';
4
4
  import { onPageLeave } from './chunk-L2V5PUFN.js';
5
- import { resolveAnalyticsTarget } from './chunk-DLM4FFNH.js';
6
- import { sonorFetch, sonorBeacon } from './chunk-IYCSDFPN.js';
5
+ import { resolveAnalyticsTarget } from './chunk-QTBAKOCZ.js';
6
+ import { sonorFetch, sonorBeacon } from './chunk-UYOE3HA4.js';
7
7
  import { createContext, useRef, useEffect, useState, useMemo, useCallback, useContext } from 'react';
8
8
  import { usePathname } from 'next/navigation';
9
9
  import { jsxs, jsx } from 'react/jsx-runtime';
@@ -228,6 +228,18 @@ function WebVitals({
228
228
  }, []);
229
229
  return null;
230
230
  }
231
+
232
+ // src/analytics/content-text.ts
233
+ var BLOCK_ELEMENTS = "address, article, aside, blockquote, dd, details, div, dl, dt, fieldset, figcaption, figure, h1, h2, h3, h4, h5, h6, hr, li, ol, p, pre, section, summary, table, td, th, tr, ul";
234
+ var NOT_CONTENT = 'script, style, noscript, template, svg, nav, header, footer, label, button, input, select, textarea, option, [role="navigation"], [role="banner"], [role="contentinfo"], [role="dialog"], [role="alert"]';
235
+ var CONTENT_TEXT_MAX_LENGTH = 1e4;
236
+ function extractContentText(root) {
237
+ const clone = root.cloneNode(true);
238
+ clone.querySelectorAll(NOT_CONTENT).forEach((el) => el.remove());
239
+ clone.querySelectorAll("br").forEach((br) => br.replaceWith(" "));
240
+ clone.querySelectorAll(BLOCK_ELEMENTS).forEach((el) => el.append(" "));
241
+ return (clone.textContent || "").replace(/\s+/g, " ").trim().slice(0, CONTENT_TEXT_MAX_LENGTH);
242
+ }
231
243
  var AnalyticsContext = createContext(null);
232
244
  function scheduleIdleTask(callback, timeout = 2e3) {
233
245
  if (typeof window !== "undefined" && "requestIdleCallback" in window) {
@@ -485,11 +497,7 @@ function getContentPageMetadata() {
485
497
  };
486
498
  const getContentText = () => {
487
499
  const main = document.querySelector('main, article, [role="main"]') || document.body;
488
- const clone = main.cloneNode(true);
489
- clone.querySelectorAll('script, style, nav, header, footer, [role="navigation"], [role="banner"], [role="contentinfo"]').forEach((el) => el.remove());
490
- let text = clone.textContent || "";
491
- text = text.replace(/\s+/g, " ").trim();
492
- text = text.slice(0, 1e4);
500
+ const text = extractContentText(main);
493
501
  let hash = 0;
494
502
  for (let i = 0; i < text.length; i++) {
495
503
  const chr = text.charCodeAt(i);
@@ -1,4 +1,4 @@
1
- import { publishSiteCredential } from './chunk-VA6IJ55K.js';
1
+ import { publishSiteCredential } from './chunk-JWCCY72G.js';
2
2
 
3
3
  // src/client/SiteKitCredential.tsx
4
4
  function SiteKitCredential({
@@ -1,3 +1,5 @@
1
+ import { htmlTags, htmlTagName, isClosingTag } from './chunk-IBHBEUZV.js';
2
+
1
3
  // packages/press-kit/src/articles/article-tables.ts
2
4
  var tableScrollClass = "sk-article-table-scroll";
3
5
  var legacyTableScrollClass = "sk-blog-table-scroll";
@@ -18,9 +20,6 @@ var voidElements = /* @__PURE__ */ new Set([
18
20
  "wbr"
19
21
  ]);
20
22
  var preservedElements = /* @__PURE__ */ new Set(["pre", "code", "script", "style", "textarea", "xmp", "template"]);
21
- function htmlTags() {
22
- return /<!--[\s\S]*?(?:-->|$)|<\/?[a-z][\w:-]*(?=[\s/>])(?:[^"'<>]|"[^"]*"|'[^']*')*>/gi;
23
- }
24
23
  function hasScrollClass(tag) {
25
24
  const attributes = tag.replace(/^<[\w:-]+/, "").replace(/\/?>$/, "");
26
25
  const pattern = /([^\s=/>]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/g;
@@ -31,14 +30,30 @@ function hasScrollClass(tag) {
31
30
  return false;
32
31
  }
33
32
  function labelText(html) {
34
- return html.replace(/<!--[\s\S]*?(?:-->|$)/g, "").replace(htmlTags(), " ").replace(/\s+/g, " ").trim();
33
+ return html.replace(htmlTags(), (token) => token.startsWith("<!--") ? "" : " ").replace(/\s+/g, " ").trim();
35
34
  }
36
35
  function escapeLabel(text) {
37
36
  return text.replace(/&(?!(?:#\d+|#x[\da-f]+|[a-z][\da-z]+);)/gi, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
38
37
  }
38
+ function elementContents(table, name) {
39
+ const tags = htmlTags();
40
+ const contents = [];
41
+ let from = -1;
42
+ let token;
43
+ while (token = tags.exec(table)) {
44
+ if (htmlTagName(token[0]) !== name) continue;
45
+ if (!isClosingTag(token[0])) {
46
+ if (from < 0) from = tags.lastIndex;
47
+ } else if (from >= 0) {
48
+ contents.push(table.slice(from, token.index));
49
+ from = -1;
50
+ }
51
+ }
52
+ return contents;
53
+ }
39
54
  function tableLabel(table, number) {
40
- const caption = table.match(/<caption\b(?:[^"'<>]|"[^"]*"|'[^']*')*>([\s\S]*?)<\/caption\s*>/i)?.[1];
41
- const headers = [...table.matchAll(/<th\b(?:[^"'<>]|"[^"]*"|'[^']*')*>([\s\S]*?)<\/th\s*>/gi)].slice(0, 4).map((match) => labelText(match[1])).filter(Boolean).join(", ");
55
+ const caption = elementContents(table, "caption")[0];
56
+ const headers = elementContents(table, "th").slice(0, 4).map(labelText).filter(Boolean).join(", ");
42
57
  const summary = labelText(caption || headers).slice(0, 180);
43
58
  return escapeLabel(`Table ${number}${summary ? `: ${summary}` : ""}`);
44
59
  }
@@ -50,8 +65,8 @@ function wrapArticleTables(html) {
50
65
  let token;
51
66
  while (token = tags.exec(html)) {
52
67
  const tag = token[0];
53
- if (tag.startsWith("<!--")) continue;
54
- const tagName = /^<\/?([\w:-]+)/.exec(tag)[1].toLowerCase();
68
+ const tagName = htmlTagName(tag);
69
+ if (!tagName) continue;
55
70
  if (tag.startsWith("</")) {
56
71
  const index = stack.map((frame3) => frame3.tag).lastIndexOf(tagName);
57
72
  if (index < 0) continue;
@@ -1,13 +1,13 @@
1
1
  'use client';
2
2
  import { DEFAULT_WIDGET_Z_INDEX } from './chunk-27FISYK4.js';
3
- import { resolveAnalyticsTarget } from './chunk-DLM4FFNH.js';
3
+ import { resolveAnalyticsTarget } from './chunk-QTBAKOCZ.js';
4
4
  import { useState, useEffect } from 'react';
5
5
  import ReactDOM from 'react-dom';
6
6
  import dynamic from 'next/dynamic';
7
7
  import { jsx } from 'react/jsx-runtime';
8
8
 
9
9
  var LazyChatWidget = dynamic(
10
- () => import('./ChatWidget-EYBVB5SZ.js').then((m) => ({ default: m.ChatWidget })),
10
+ () => import('./ChatWidget-L74L4YAD.js').then((m) => ({ default: m.ChatWidget })),
11
11
  { ssr: false }
12
12
  );
13
13
  function SiteChat(props) {
@@ -2,9 +2,9 @@
2
2
  import { VISUAL_VIEWPORT_GAP_PROPERTY } from './chunk-6T6CQVNL.js';
3
3
  import { GlassStyles } from './chunk-JE4A5S4F.js';
4
4
  import { DEFAULT_WIDGET_Z_INDEX } from './chunk-27FISYK4.js';
5
- import { useForm } from './chunk-HMTPRBYJ.js';
5
+ import { useForm } from './chunk-LGWN6KCN.js';
6
6
  import { parseColor, relativeLuminance, DARK_LUMINANCE, contrastRatio } from './chunk-S22FSH7C.js';
7
- import { sonorFetch } from './chunk-IYCSDFPN.js';
7
+ import { sonorFetch } from './chunk-UYOE3HA4.js';
8
8
  import { readPublishedApiConfig } from './chunk-W7OPEMGJ.js';
9
9
  import { useState, useEffect, useRef, useLayoutEffect, useCallback, Fragment as Fragment$1 } from 'react';
10
10
  import { lexer } from 'marked';
@@ -1,5 +1,5 @@
1
1
  import { readAnalyticsIdentity } from './chunk-5ROTTMBL.js';
2
- import { sonorFetch } from './chunk-IYCSDFPN.js';
2
+ import { sonorFetch } from './chunk-UYOE3HA4.js';
3
3
  import { getClientApiConfig } from './chunk-W7OPEMGJ.js';
4
4
 
5
5
  // src/sync/api.ts
@@ -1,4 +1,4 @@
1
- import { FormEnhancer } from './chunk-OWO3RFEX.js';
1
+ import { FormEnhancer } from './chunk-G5FD7UXK.js';
2
2
  import { StaticForm } from './chunk-VPZJ7ZTL.js';
3
3
  import { serverApiFetch } from './chunk-C7TLGL3R.js';
4
4
  import { jsx } from 'react/jsx-runtime';
@@ -1,5 +1,5 @@
1
1
  import { freshFetch } from './chunk-UAYAJPEP.js';
2
- import { LLM_GEO_CONTRACT_VERSION } from './chunk-NZ4RXN3G.js';
2
+ import { LLM_GEO_CONTRACT_VERSION } from './chunk-XAZC2TUD.js';
3
3
  import { withSiteParam } from './chunk-MJP63SSS.js';
4
4
  import { getClientApiConfig } from './chunk-W7OPEMGJ.js';
5
5
  import { cache } from 'react';