@flamingo-stack/openframe-frontend-core 0.0.510 → 0.0.511

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 (208) hide show
  1. package/dist/{chunk-GE3JUTW2.js → chunk-27OKD7ZV.js} +44 -14
  2. package/dist/chunk-27OKD7ZV.js.map +1 -0
  3. package/dist/{chunk-2RLI5XVI.cjs → chunk-2CE725NN.cjs} +16 -16
  4. package/dist/{chunk-2RLI5XVI.cjs.map → chunk-2CE725NN.cjs.map} +1 -1
  5. package/dist/{chunk-Q4K3TGNP.cjs → chunk-3NECEXDF.cjs} +74 -44
  6. package/dist/chunk-3NECEXDF.cjs.map +1 -0
  7. package/dist/{chunk-RJ3D3PE2.cjs → chunk-4SG55XVA.cjs} +9 -9
  8. package/dist/{chunk-RJ3D3PE2.cjs.map → chunk-4SG55XVA.cjs.map} +1 -1
  9. package/dist/{chunk-SYZFFRVD.cjs → chunk-5BAGE7AI.cjs} +13 -13
  10. package/dist/{chunk-SYZFFRVD.cjs.map → chunk-5BAGE7AI.cjs.map} +1 -1
  11. package/dist/{chunk-6FIDTXYC.js → chunk-7AQSXQEL.js} +3 -3
  12. package/dist/{chunk-6TL5XIAW.cjs → chunk-7YV67K3I.cjs} +119 -119
  13. package/dist/{chunk-6TL5XIAW.cjs.map → chunk-7YV67K3I.cjs.map} +1 -1
  14. package/dist/{chunk-5CDPRCPS.cjs → chunk-A5YZUV6B.cjs} +23 -23
  15. package/dist/{chunk-5CDPRCPS.cjs.map → chunk-A5YZUV6B.cjs.map} +1 -1
  16. package/dist/{chunk-WSAPKKDU.cjs → chunk-C4EUXZSA.cjs} +9 -9
  17. package/dist/{chunk-WSAPKKDU.cjs.map → chunk-C4EUXZSA.cjs.map} +1 -1
  18. package/dist/{chunk-5AZZQQYS.cjs → chunk-DPLXHG7H.cjs} +40 -40
  19. package/dist/{chunk-5AZZQQYS.cjs.map → chunk-DPLXHG7H.cjs.map} +1 -1
  20. package/dist/{chunk-BTUHMCYW.js → chunk-FS3YSNSU.js} +193 -6
  21. package/dist/chunk-FS3YSNSU.js.map +1 -0
  22. package/dist/{chunk-RB2EW6IZ.cjs → chunk-GHXTF35X.cjs} +3231 -3165
  23. package/dist/chunk-GHXTF35X.cjs.map +1 -0
  24. package/dist/{chunk-7VUKIWF6.cjs → chunk-HIV2GIFP.cjs} +3 -3
  25. package/dist/{chunk-7VUKIWF6.cjs.map → chunk-HIV2GIFP.cjs.map} +1 -1
  26. package/dist/{chunk-R4HKB3YD.cjs → chunk-IIPBTWQR.cjs} +22 -22
  27. package/dist/{chunk-R4HKB3YD.cjs.map → chunk-IIPBTWQR.cjs.map} +1 -1
  28. package/dist/{chunk-JMBIGH4H.cjs → chunk-IUZMWMVX.cjs} +83 -83
  29. package/dist/{chunk-JMBIGH4H.cjs.map → chunk-IUZMWMVX.cjs.map} +1 -1
  30. package/dist/{chunk-XJVRAKEX.cjs → chunk-IXCBVJRU.cjs} +56 -33
  31. package/dist/chunk-IXCBVJRU.cjs.map +1 -0
  32. package/dist/{chunk-TBGSQTJK.js → chunk-J4VB4EHW.js} +6 -6
  33. package/dist/{chunk-UWPT23SA.js → chunk-JXMNLH7F.js} +3 -3
  34. package/dist/{chunk-A62C4C4V.cjs → chunk-KI4EGKNV.cjs} +3 -2
  35. package/dist/chunk-KI4EGKNV.cjs.map +1 -0
  36. package/dist/{chunk-RHQ7BJKK.cjs → chunk-LEWQRAZ4.cjs} +73 -73
  37. package/dist/{chunk-RHQ7BJKK.cjs.map → chunk-LEWQRAZ4.cjs.map} +1 -1
  38. package/dist/{chunk-DBR5JLX3.js → chunk-LVAJK2U2.js} +46 -23
  39. package/dist/chunk-LVAJK2U2.js.map +1 -0
  40. package/dist/{chunk-OB7YDOTK.cjs → chunk-NJADHL2G.cjs} +8 -8
  41. package/dist/{chunk-OB7YDOTK.cjs.map → chunk-NJADHL2G.cjs.map} +1 -1
  42. package/dist/{chunk-HCZJZMU7.js → chunk-NKA3O4L6.js} +3 -3
  43. package/dist/{chunk-SRYV4H3M.js → chunk-NNWSGOUP.js} +3 -3
  44. package/dist/{chunk-EYTXD62B.cjs → chunk-OGVIGAMZ.cjs} +232 -45
  45. package/dist/chunk-OGVIGAMZ.cjs.map +1 -0
  46. package/dist/{chunk-EJ3EBYNV.cjs → chunk-OMN7A6RP.cjs} +32 -32
  47. package/dist/{chunk-EJ3EBYNV.cjs.map → chunk-OMN7A6RP.cjs.map} +1 -1
  48. package/dist/{chunk-WNOGR5AA.js → chunk-PRMR6WKC.js} +3 -3
  49. package/dist/{chunk-J2JUAS4C.cjs → chunk-PXQQFRUD.cjs} +11 -11
  50. package/dist/{chunk-J2JUAS4C.cjs.map → chunk-PXQQFRUD.cjs.map} +1 -1
  51. package/dist/{chunk-VDJF4ZAU.js → chunk-RU3SCECX.js} +3 -3
  52. package/dist/{chunk-53JKCFFE.cjs → chunk-RXFBW2EJ.cjs} +12 -12
  53. package/dist/{chunk-53JKCFFE.cjs.map → chunk-RXFBW2EJ.cjs.map} +1 -1
  54. package/dist/{chunk-JOCFPAS6.js → chunk-TNZOUHHN.js} +6 -6
  55. package/dist/{chunk-HX4CJYXL.js → chunk-TR7AMHGB.js} +10 -10
  56. package/dist/{chunk-MLGGF24T.js → chunk-TYVHM67X.js} +8 -8
  57. package/dist/{chunk-Z35QWWJH.cjs → chunk-U4WPFX5K.cjs} +34 -34
  58. package/dist/{chunk-Z35QWWJH.cjs.map → chunk-U4WPFX5K.cjs.map} +1 -1
  59. package/dist/{chunk-M4MKQKFF.js → chunk-UBTOOE55.js} +2 -2
  60. package/dist/{chunk-FEGEC6FY.js → chunk-X7AJ3J42.js} +5170 -5104
  61. package/dist/chunk-X7AJ3J42.js.map +1 -0
  62. package/dist/{chunk-SZMA65OW.js → chunk-XURRAFIB.js} +2 -2
  63. package/dist/{chunk-CTMLY2GN.js → chunk-YGS7BLSN.js} +5 -5
  64. package/dist/{chunk-RG2WRBPT.js → chunk-Z3ADCYC5.js} +2 -2
  65. package/dist/{chunk-2AASLY6D.js → chunk-ZBQV7WH7.js} +3 -3
  66. package/dist/{chunk-4GPWLGKT.js → chunk-ZRILYK5U.js} +2 -1
  67. package/dist/{chunk-LBOWSKGM.js → chunk-ZSIEM7CL.js} +5 -5
  68. package/dist/components/calendar.cjs +4 -4
  69. package/dist/components/calendar.js +3 -3
  70. package/dist/components/case-studies/index.cjs +17 -17
  71. package/dist/components/case-studies/index.js +7 -7
  72. package/dist/components/chat/chat-message-enhanced.d.ts.map +1 -1
  73. package/dist/components/chat/chat-message-list.d.ts.map +1 -1
  74. package/dist/components/chat/entity-cards/dispatch.d.ts.map +1 -1
  75. package/dist/components/chat/hooks/use-nats-chat-adapter.d.ts.map +1 -1
  76. package/dist/components/chat/hooks/use-sse-chat-adapter.d.ts.map +1 -1
  77. package/dist/components/chat/index.cjs +13 -7
  78. package/dist/components/chat/index.cjs.map +1 -1
  79. package/dist/components/chat/index.js +12 -6
  80. package/dist/components/chat/remark-mention-chips.d.ts +5 -2
  81. package/dist/components/chat/remark-mention-chips.d.ts.map +1 -1
  82. package/dist/components/chat/utils/discuss-ref-prompt.d.ts +48 -0
  83. package/dist/components/chat/utils/discuss-ref-prompt.d.ts.map +1 -0
  84. package/dist/components/chat/utils/index.d.ts +2 -0
  85. package/dist/components/chat/utils/index.d.ts.map +1 -1
  86. package/dist/components/chat/utils/resolve-fetched-card-href.d.ts +63 -0
  87. package/dist/components/chat/utils/resolve-fetched-card-href.d.ts.map +1 -0
  88. package/dist/components/chat/utils/source-row-cta.d.ts.map +1 -1
  89. package/dist/components/contact/index.cjs +8 -8
  90. package/dist/components/contact/index.js +7 -7
  91. package/dist/components/docs/index.cjs +10 -10
  92. package/dist/components/docs/index.js +9 -9
  93. package/dist/components/embeds/index.cjs +8 -8
  94. package/dist/components/embeds/index.js +7 -7
  95. package/dist/components/faq/index.cjs +9 -9
  96. package/dist/components/faq/index.js +8 -8
  97. package/dist/components/features/index.cjs +7 -7
  98. package/dist/components/features/index.js +6 -6
  99. package/dist/components/help-center-pages/index.cjs +28 -28
  100. package/dist/components/help-center-pages/index.js +19 -19
  101. package/dist/components/icons/index.cjs +3 -3
  102. package/dist/components/icons/index.js +2 -2
  103. package/dist/components/index.cjs +253 -247
  104. package/dist/components/index.cjs.map +1 -1
  105. package/dist/components/index.js +23 -17
  106. package/dist/components/index.js.map +1 -1
  107. package/dist/components/meeting-scheduler/index.cjs +92 -92
  108. package/dist/components/meeting-scheduler/index.js +9 -9
  109. package/dist/components/navigation/index.cjs +7 -7
  110. package/dist/components/navigation/index.js +6 -6
  111. package/dist/components/onboarding-guides/index.cjs +11 -11
  112. package/dist/components/onboarding-guides/index.js +10 -10
  113. package/dist/components/related-content/index.cjs +9 -9
  114. package/dist/components/related-content/index.js +8 -8
  115. package/dist/components/shared/doc-search/resolve-search-result-action.d.ts +11 -3
  116. package/dist/components/shared/doc-search/resolve-search-result-action.d.ts.map +1 -1
  117. package/dist/components/shared/doc-search/use-doc-search.d.ts +7 -0
  118. package/dist/components/shared/doc-search/use-doc-search.d.ts.map +1 -1
  119. package/dist/components/tickets/index.cjs +11 -11
  120. package/dist/components/tickets/index.js +10 -10
  121. package/dist/components/ui/actions-menu.d.ts.map +1 -1
  122. package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
  123. package/dist/components/ui/file-manager/index.cjs +70 -70
  124. package/dist/components/ui/file-manager/index.js +3 -3
  125. package/dist/components/ui/index.cjs +13 -7
  126. package/dist/components/ui/index.cjs.map +1 -1
  127. package/dist/components/ui/index.js +12 -6
  128. package/dist/components/ui/markdown/base-components.d.ts.map +1 -1
  129. package/dist/components/ui/overlay-open-registry.d.ts +50 -0
  130. package/dist/components/ui/overlay-open-registry.d.ts.map +1 -0
  131. package/dist/components/ui/portal-container.d.ts +24 -0
  132. package/dist/components/ui/portal-container.d.ts.map +1 -1
  133. package/dist/hooks/index.cjs +4 -4
  134. package/dist/hooks/index.js +3 -3
  135. package/dist/index.cjs +20 -10
  136. package/dist/index.cjs.map +1 -1
  137. package/dist/index.js +24 -14
  138. package/dist/utils/anchor-id.d.ts +32 -0
  139. package/dist/utils/anchor-id.d.ts.map +1 -0
  140. package/dist/utils/content-href.d.ts +27 -6
  141. package/dist/utils/content-href.d.ts.map +1 -1
  142. package/dist/utils/index.cjs +213 -152
  143. package/dist/utils/index.cjs.map +1 -1
  144. package/dist/utils/index.d.ts +1 -0
  145. package/dist/utils/index.d.ts.map +1 -1
  146. package/dist/utils/index.js +212 -153
  147. package/dist/utils/index.js.map +1 -1
  148. package/dist/utils/list-url.d.ts.map +1 -1
  149. package/dist/utils/same-page-hash-nav.d.ts +17 -6
  150. package/dist/utils/same-page-hash-nav.d.ts.map +1 -1
  151. package/package.json +1 -1
  152. package/src/components/chat/__tests__/remark-mention-chips.test.ts +67 -0
  153. package/src/components/chat/chat-message-enhanced.tsx +3 -2
  154. package/src/components/chat/chat-message-list.tsx +49 -5
  155. package/src/components/chat/embeddable-chat.tsx +19 -2
  156. package/src/components/chat/entity-cards/dispatch.tsx +65 -4
  157. package/src/components/chat/hooks/use-nats-chat-adapter.ts +28 -4
  158. package/src/components/chat/hooks/use-sse-chat-adapter.ts +5 -3
  159. package/src/components/chat/remark-mention-chips.ts +6 -3
  160. package/src/components/chat/utils/__tests__/discuss-ref-prompt.test.ts +67 -0
  161. package/src/components/chat/utils/__tests__/resolve-fetched-card-href.test.ts +156 -0
  162. package/src/components/chat/utils/discuss-ref-prompt.ts +63 -0
  163. package/src/components/chat/utils/index.ts +16 -0
  164. package/src/components/chat/utils/resolve-fetched-card-href.ts +104 -0
  165. package/src/components/chat/utils/source-row-cta.ts +5 -1
  166. package/src/components/shared/doc-search/__tests__/resolve-search-result-action.test.ts +145 -0
  167. package/src/components/shared/doc-search/resolve-search-result-action.ts +46 -10
  168. package/src/components/shared/doc-search/use-doc-search.ts +50 -14
  169. package/src/components/ui/__tests__/overlay-open-registry.test.tsx +87 -0
  170. package/src/components/ui/actions-menu.tsx +65 -2
  171. package/src/components/ui/dropdown-menu.tsx +62 -12
  172. package/src/components/ui/markdown/base-components.tsx +26 -0
  173. package/src/components/ui/overlay-open-registry.tsx +99 -0
  174. package/src/components/ui/portal-container.tsx +31 -0
  175. package/src/utils/__tests__/anchor-id.test.ts +139 -0
  176. package/src/utils/__tests__/content-href.test.ts +74 -0
  177. package/src/utils/__tests__/list-url.test.ts +11 -1
  178. package/src/utils/anchor-id.ts +106 -0
  179. package/src/utils/content-href.ts +113 -13
  180. package/src/utils/index.ts +8 -0
  181. package/src/utils/list-url.ts +6 -1
  182. package/src/utils/same-page-hash-nav.ts +28 -9
  183. package/dist/chunk-A62C4C4V.cjs.map +0 -1
  184. package/dist/chunk-BTUHMCYW.js.map +0 -1
  185. package/dist/chunk-DBR5JLX3.js.map +0 -1
  186. package/dist/chunk-EYTXD62B.cjs.map +0 -1
  187. package/dist/chunk-FEGEC6FY.js.map +0 -1
  188. package/dist/chunk-GE3JUTW2.js.map +0 -1
  189. package/dist/chunk-Q4K3TGNP.cjs.map +0 -1
  190. package/dist/chunk-RB2EW6IZ.cjs.map +0 -1
  191. package/dist/chunk-XJVRAKEX.cjs.map +0 -1
  192. /package/dist/{chunk-6FIDTXYC.js.map → chunk-7AQSXQEL.js.map} +0 -0
  193. /package/dist/{chunk-TBGSQTJK.js.map → chunk-J4VB4EHW.js.map} +0 -0
  194. /package/dist/{chunk-UWPT23SA.js.map → chunk-JXMNLH7F.js.map} +0 -0
  195. /package/dist/{chunk-HCZJZMU7.js.map → chunk-NKA3O4L6.js.map} +0 -0
  196. /package/dist/{chunk-SRYV4H3M.js.map → chunk-NNWSGOUP.js.map} +0 -0
  197. /package/dist/{chunk-WNOGR5AA.js.map → chunk-PRMR6WKC.js.map} +0 -0
  198. /package/dist/{chunk-VDJF4ZAU.js.map → chunk-RU3SCECX.js.map} +0 -0
  199. /package/dist/{chunk-JOCFPAS6.js.map → chunk-TNZOUHHN.js.map} +0 -0
  200. /package/dist/{chunk-HX4CJYXL.js.map → chunk-TR7AMHGB.js.map} +0 -0
  201. /package/dist/{chunk-MLGGF24T.js.map → chunk-TYVHM67X.js.map} +0 -0
  202. /package/dist/{chunk-M4MKQKFF.js.map → chunk-UBTOOE55.js.map} +0 -0
  203. /package/dist/{chunk-SZMA65OW.js.map → chunk-XURRAFIB.js.map} +0 -0
  204. /package/dist/{chunk-CTMLY2GN.js.map → chunk-YGS7BLSN.js.map} +0 -0
  205. /package/dist/{chunk-RG2WRBPT.js.map → chunk-Z3ADCYC5.js.map} +0 -0
  206. /package/dist/{chunk-2AASLY6D.js.map → chunk-ZBQV7WH7.js.map} +0 -0
  207. /package/dist/{chunk-4GPWLGKT.js.map → chunk-ZRILYK5U.js.map} +0 -0
  208. /package/dist/{chunk-LBOWSKGM.js.map → chunk-ZSIEM7CL.js.map} +0 -0
@@ -9,7 +9,7 @@ import {
9
9
  MiamiCyberGangLogoFaceOnly,
10
10
  OpenFrameLogo,
11
11
  OpenmspLogo
12
- } from "./chunk-SZMA65OW.js";
12
+ } from "./chunk-XURRAFIB.js";
13
13
  import {
14
14
  AuthentikLogoGreyIcon,
15
15
  Chevron02DownIcon,
@@ -25,7 +25,7 @@ import {
25
25
  import {
26
26
  cn,
27
27
  init_cn
28
- } from "./chunk-4GPWLGKT.js";
28
+ } from "./chunk-ZRILYK5U.js";
29
29
  import {
30
30
  createNatsClient
31
31
  } from "./chunk-GSONSIWG.js";
@@ -3652,6 +3652,177 @@ function scrollElementIntoView(target, options = {}) {
3652
3652
  activeRaf = requestAnimationFrame(step);
3653
3653
  }
3654
3654
 
3655
+ // src/utils/markdown-fences.ts
3656
+ var FENCE_RE = /^ {0,3}(`{3,}|~{3,})([^\n]*?)\r?$/;
3657
+ var BLANK_LINE_RE = /^[ \t\r]*$/;
3658
+ function isBlankLine(line) {
3659
+ return BLANK_LINE_RE.test(line);
3660
+ }
3661
+ function createFenceTracker() {
3662
+ let fenceChar = null;
3663
+ let fenceLength = 0;
3664
+ return {
3665
+ push(line) {
3666
+ const fence = FENCE_RE.exec(line);
3667
+ if (fence) {
3668
+ const run = fence[1];
3669
+ if (fenceChar === null) {
3670
+ fenceChar = run[0];
3671
+ fenceLength = run.length;
3672
+ return "open";
3673
+ }
3674
+ if (run[0] === fenceChar && run.length >= fenceLength && isBlankLine(fence[2])) {
3675
+ fenceChar = null;
3676
+ fenceLength = 0;
3677
+ return "close";
3678
+ }
3679
+ return "inside";
3680
+ }
3681
+ return fenceChar === null ? "text" : "inside";
3682
+ },
3683
+ openChar: () => fenceChar,
3684
+ openLength: () => fenceLength
3685
+ };
3686
+ }
3687
+
3688
+ // src/utils/markdown-heading-id.ts
3689
+ var HEADING_EMOJI_RE = /[\u{1F300}-\u{1F9FF}]|[\u{2600}-\u{26FF}]|[\u{2700}-\u{27BF}]/gu;
3690
+ function stripHeadingEmojis(text) {
3691
+ return text.replace(HEADING_EMOJI_RE, "").trim();
3692
+ }
3693
+ function slugifyHeadingBase(text) {
3694
+ return text.trim().toLowerCase().replace(/[^\w\s-]/g, "").replace(/\s+/g, "-").replace(/^-+|-+$/g, "");
3695
+ }
3696
+ function slugifyHeadingText(text) {
3697
+ return slugifyHeadingBase(stripHeadingEmojis(text));
3698
+ }
3699
+ var ATX_HEADING_RE = /^ {0,3}(#{1,6})[ \t]+(.*?)(?:[ \t]+#+)?[ \t]*\r?$/;
3700
+ var ATX_EMPTY_RE = /^ {0,3}(#{1,6})[ \t]*#*[ \t]*\r?$/;
3701
+ var RAW_HEADING_RE = /<h([1-6])\b[^>]*>([\s\S]*?)(?:<\/h\1>|$)/gi;
3702
+ var CONTAINER_PREFIX_RE = /^ {0,3}(?:(?:>[ \t]?)+|(?:[-+*]|\d{1,9}[.)])[ \t]+)+/;
3703
+ var SETEXT_UNDERLINE_RE = /^ {0,3}(=+|-+)[ \t]*\r?$/;
3704
+ var THEMATIC_BREAK_RE = /^ {0,3}(\*|_){3,}[ \t]*\r?$/;
3705
+ var HTML_BLOCK_TAGS = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";
3706
+ var HTML_BLOCK_OPENER_RE = new RegExp(
3707
+ `^ {0,3}(?:<(?:script|pre|style|textarea)(?:[\\s>]|$)|<!--|<\\?|<![a-zA-Z]|<!\\[CDATA\\[|</?(?:${HTML_BLOCK_TAGS})(?:[\\s/>]|$)|<[a-zA-Z][a-zA-Z0-9-]*(?:\\s[^>]*)?/?>[ \\t]*\\r?$|</[a-zA-Z][a-zA-Z0-9-]*[ \\t]*>[ \\t]*\\r?$)`,
3708
+ "i"
3709
+ );
3710
+ function scanHeadings(content, options = {}) {
3711
+ const { skipFrontmatter = true, includeRawHtml = true, skipFences = true } = options;
3712
+ const out = [];
3713
+ const lines = content.split("\n");
3714
+ const fences = skipFences ? createFenceTracker() : null;
3715
+ let start = 0;
3716
+ if (skipFrontmatter && lines[0]?.trim() === "---") {
3717
+ for (let i = 1; i < lines.length; i++) {
3718
+ if (lines[i].trim() === "---" || lines[i].trim() === "...") {
3719
+ start = i + 1;
3720
+ break;
3721
+ }
3722
+ }
3723
+ }
3724
+ let setextRun = null;
3725
+ for (let i = start; i < lines.length; i++) {
3726
+ const line = lines[i];
3727
+ if (fences) {
3728
+ const role = fences.push(line);
3729
+ if (role !== "text") {
3730
+ setextRun = null;
3731
+ continue;
3732
+ }
3733
+ }
3734
+ const prefix = CONTAINER_PREFIX_RE.exec(line)?.[0] ?? "";
3735
+ const body = prefix ? line.slice(prefix.length) : line;
3736
+ const setext = SETEXT_UNDERLINE_RE.exec(body);
3737
+ if (setext) {
3738
+ if (setextRun && !setextRun.disqualified && setextRun.prefix === prefix) {
3739
+ out.push({
3740
+ line: setextRun.line,
3741
+ level: setext[1][0] === "=" ? 1 : 2,
3742
+ text: setextRun.lines.join("\n")
3743
+ });
3744
+ }
3745
+ setextRun = null;
3746
+ continue;
3747
+ }
3748
+ const atx = ATX_HEADING_RE.exec(body) ?? ATX_EMPTY_RE.exec(body);
3749
+ if (atx) {
3750
+ out.push({ line: i + 1, level: atx[1].length, text: (atx[2] ?? "").trim() });
3751
+ setextRun = null;
3752
+ continue;
3753
+ }
3754
+ if (includeRawHtml && line.indexOf("<") !== -1) {
3755
+ RAW_HEADING_RE.lastIndex = 0;
3756
+ let raw;
3757
+ let matched = false;
3758
+ while ((raw = RAW_HEADING_RE.exec(line)) !== null) {
3759
+ matched = true;
3760
+ out.push({
3761
+ line: i + 1,
3762
+ level: Number(raw[1]),
3763
+ text: raw[2].replace(/<[^>]*>/g, "").trim()
3764
+ });
3765
+ }
3766
+ if (matched) {
3767
+ setextRun = null;
3768
+ continue;
3769
+ }
3770
+ }
3771
+ if (isBlankLine(body) || THEMATIC_BREAK_RE.test(body)) {
3772
+ setextRun = null;
3773
+ continue;
3774
+ }
3775
+ if (setextRun && setextRun.prefix === prefix) {
3776
+ setextRun.lines.push(body.trim());
3777
+ } else {
3778
+ setextRun = {
3779
+ line: i + 1,
3780
+ prefix,
3781
+ lines: [body.trim()],
3782
+ disqualified: HTML_BLOCK_OPENER_RE.test(body)
3783
+ };
3784
+ }
3785
+ }
3786
+ return out;
3787
+ }
3788
+ function createHeadingIdDeduper() {
3789
+ const counts = {};
3790
+ return (cleanId) => {
3791
+ if (counts[cleanId]) {
3792
+ counts[cleanId]++;
3793
+ return `${cleanId}-${counts[cleanId]}`;
3794
+ }
3795
+ counts[cleanId] = 1;
3796
+ return cleanId;
3797
+ };
3798
+ }
3799
+
3800
+ // src/utils/anchor-id.ts
3801
+ function normalizeAnchorId(raw) {
3802
+ return slugifyHeadingText(raw).replace(/-+/g, "-").replace(/^-+|-+$/g, "");
3803
+ }
3804
+ var HEADING_SELECTOR = "h1[id], h2[id], h3[id], h4[id], h5[id], h6[id]";
3805
+ var DUPLICATE_SUFFIX_RE = /^(.+)-(\d+)$/;
3806
+ function findDuplicateShifted(normalized, doc) {
3807
+ const parts = DUPLICATE_SUFFIX_RE.exec(normalized);
3808
+ if (!parts) return null;
3809
+ const ordinal = Number(parts[2]);
3810
+ if (!Number.isSafeInteger(ordinal)) return null;
3811
+ return doc.getElementById(`${parts[1]}-${ordinal + 1}`);
3812
+ }
3813
+ function findAnchorElementByNormalizedId(rawId, doc) {
3814
+ const normalized = normalizeAnchorId(rawId);
3815
+ if (!normalized) return null;
3816
+ if (normalized !== rawId) {
3817
+ const direct = doc.getElementById(normalized);
3818
+ if (direct) return direct;
3819
+ }
3820
+ for (const heading of Array.from(doc.querySelectorAll(HEADING_SELECTOR))) {
3821
+ if (normalizeAnchorId(heading.id) === normalized) return heading;
3822
+ }
3823
+ return findDuplicateShifted(normalized, doc);
3824
+ }
3825
+
3655
3826
  // src/utils/same-page-hash-nav.ts
3656
3827
  var STICKY_HEADER_OFFSET_PX = 96;
3657
3828
  var HUB_HEADER_OFFSET_PX = 80;
@@ -3664,12 +3835,17 @@ function getHashTargetElement(id) {
3664
3835
  if (!id) return null;
3665
3836
  const direct = document.getElementById(id);
3666
3837
  if (direct) return direct;
3838
+ let decoded = id;
3667
3839
  try {
3668
- const decoded = decodeURIComponent(id);
3669
- if (decoded !== id) return document.getElementById(decoded);
3840
+ decoded = decodeURIComponent(id);
3841
+ if (decoded !== id) {
3842
+ const decodedEl = document.getElementById(decoded);
3843
+ if (decodedEl) return decodedEl;
3844
+ }
3670
3845
  } catch {
3846
+ decoded = id;
3671
3847
  }
3672
- return null;
3848
+ return findAnchorElementByNormalizedId(decoded, document);
3673
3849
  }
3674
3850
  function navigateSamePageHash(target, options = {}) {
3675
3851
  if (typeof window === "undefined") return false;
@@ -3915,9 +4091,20 @@ export {
3915
4091
  buildOgPlaceholderUrl,
3916
4092
  useOgPlaceholderUrl,
3917
4093
  scrollElementIntoView,
4094
+ isBlankLine,
4095
+ createFenceTracker,
4096
+ HEADING_EMOJI_RE,
4097
+ stripHeadingEmojis,
4098
+ slugifyHeadingBase,
4099
+ slugifyHeadingText,
4100
+ scanHeadings,
4101
+ createHeadingIdDeduper,
4102
+ normalizeAnchorId,
4103
+ findAnchorElementByNormalizedId,
3918
4104
  STICKY_HEADER_OFFSET_PX,
3919
4105
  HUB_HEADER_OFFSET_PX,
3920
4106
  normalizeHashFragment,
4107
+ getHashTargetElement,
3921
4108
  navigateSamePageHash,
3922
4109
  useScrollToHash,
3923
4110
  HONEYPOT_FIELD,
@@ -3929,4 +4116,4 @@ export {
3929
4116
  splitCsvEnv,
3930
4117
  useHumanitySignals
3931
4118
  };
3932
- //# sourceMappingURL=chunk-BTUHMCYW.js.map
4119
+ //# sourceMappingURL=chunk-FS3YSNSU.js.map