md2x 0.7.3 → 0.7.5

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 (141) hide show
  1. package/README.md +17 -7
  2. package/dist/chunks/chunk-54X5GPSM.js +1552 -0
  3. package/dist/chunks/chunk-US45GBOT.js +415 -0
  4. package/dist/chunks/docx-exporter-7C6T4DFB.js +1 -0
  5. package/dist/core-worker.js +1764 -0
  6. package/dist/index.js +1 -1
  7. package/dist/md2x.js +7 -5
  8. package/dist/renderer/core-worker-browser.js +1775 -0
  9. package/dist/renderer/live-runtime-canvas.js +24 -0
  10. package/dist/renderer/live-runtime-core.js +14 -0
  11. package/dist/renderer/live-runtime-dot.js +27 -0
  12. package/dist/renderer/live-runtime-html.js +14 -0
  13. package/dist/renderer/live-runtime-infographic.js +593 -0
  14. package/dist/renderer/live-runtime-md2x.js +24 -0
  15. package/dist/renderer/live-runtime-mermaid.js +14 -0
  16. package/dist/renderer/live-runtime-svg.js +14 -0
  17. package/dist/renderer/live-runtime-vega.js +218 -0
  18. package/dist/renderer/puppeteer-render.html +9 -1
  19. package/dist/renderer/puppeteer-runtime-core.js +14 -0
  20. package/dist/types/node/src/host/browser-renderer.d.ts +1 -175
  21. package/dist/types/node/src/host/core.d.ts +59 -0
  22. package/dist/types/node/src/host/index.d.ts +4 -47
  23. package/dist/types/node/src/host/node-exporter.d.ts +1 -84
  24. package/dist/types/node/src/host/node-platform.d.ts +1 -23
  25. package/dist/types/node/src/host/templates-data.d.ts +5 -0
  26. package/dist/types/node/src/host/themes-data.d.ts +2385 -0
  27. package/dist/types/node/src/host/types.d.ts +251 -0
  28. package/dist/types/node/src/index.d.ts +2 -3
  29. package/dist/types/src/types/index.d.ts +1 -1
  30. package/dist/types/src/types/render.d.ts +12 -0
  31. package/package.json +10 -2
  32. package/dist/chunks/chunk-2LPNL4GA.js +0 -1
  33. package/dist/chunks/chunk-3P5X57NT.js +0 -262
  34. package/dist/chunks/chunk-3VL755NO.js +0 -1
  35. package/dist/chunks/chunk-5DPTQTJJ.js +0 -1
  36. package/dist/chunks/chunk-AK6TXLWO.js +0 -1
  37. package/dist/chunks/chunk-CN4F5HOV.js +0 -5
  38. package/dist/chunks/chunk-CVKZIRZW.js +0 -5
  39. package/dist/chunks/chunk-DFROP2PD.js +0 -11
  40. package/dist/chunks/chunk-DJGIYXVP.js +0 -3
  41. package/dist/chunks/chunk-EFKQH5UR.js +0 -108
  42. package/dist/chunks/chunk-IENSDROB.js +0 -1
  43. package/dist/chunks/chunk-LLCWR7UA.js +0 -1
  44. package/dist/chunks/chunk-MHCTK6WW.js +0 -1
  45. package/dist/chunks/chunk-NM6J3ND7.js +0 -1
  46. package/dist/chunks/chunk-PARPCLXM.js +0 -1
  47. package/dist/chunks/chunk-PUOHPY5L.js +0 -16
  48. package/dist/chunks/chunk-R65AQGTF.js +0 -1
  49. package/dist/chunks/chunk-R6G2575A.js +0 -3
  50. package/dist/chunks/chunk-RLHZRADD.js +0 -1391
  51. package/dist/chunks/chunk-TRGQPVRY.js +0 -2
  52. package/dist/chunks/chunk-URO5RPHJ.js +0 -9
  53. package/dist/chunks/chunk-YFL3W3OS.js +0 -1
  54. package/dist/chunks/chunk-Z4LVGK7Y.js +0 -1
  55. package/dist/chunks/docx-exporter-ZZ76JXFU.js +0 -1
  56. package/dist/chunks/rehype-highlight-Y4Q4RX67.js +0 -1
  57. package/dist/chunks/rehype-katex-FXTCTSUE.js +0 -1
  58. package/dist/chunks/rehype-stringify-4CQSSRDL.js +0 -1
  59. package/dist/chunks/remark-gfm-BUZ4SLP3.js +0 -1
  60. package/dist/chunks/remark-math-HEZQAPFK.js +0 -1
  61. package/dist/chunks/remark-parse-QC7TSXTK.js +0 -1
  62. package/dist/chunks/remark-rehype-C2LX643P.js +0 -1
  63. package/dist/chunks/remark-super-sub-EP2AQS54.js +0 -1
  64. package/dist/chunks/theme-manager-AZBU2SLL.js +0 -1
  65. package/dist/chunks/theme-to-css-GLV3WYDU.js +0 -85
  66. package/dist/chunks/unified-PU53JLVJ.js +0 -1
  67. package/dist/chunks/unist-util-visit-SBSD62C6.js +0 -1
  68. package/dist/renderer/puppeteer-render-worker.js +0 -830
  69. package/dist/templates/html/example.html +0 -35
  70. package/dist/templates/svelte/example.svelte +0 -18
  71. package/dist/templates/vue/PrinterComponent.vue +0 -875
  72. package/dist/templates/vue/example.vue +0 -17
  73. package/dist/templates/vue/mapLibre.vue +0 -371
  74. package/dist/themes/code-themes/business-contrast.json +0 -31
  75. package/dist/themes/code-themes/colorful.json +0 -32
  76. package/dist/themes/code-themes/cool-modern.json +0 -31
  77. package/dist/themes/code-themes/high-contrast.json +0 -31
  78. package/dist/themes/code-themes/light-clean.json +0 -31
  79. package/dist/themes/code-themes/warm-book.json +0 -31
  80. package/dist/themes/color-schemes/candy.json +0 -34
  81. package/dist/themes/color-schemes/cool.json +0 -34
  82. package/dist/themes/color-schemes/coral.json +0 -34
  83. package/dist/themes/color-schemes/dino.json +0 -34
  84. package/dist/themes/color-schemes/forest.json +0 -34
  85. package/dist/themes/color-schemes/garden.json +0 -34
  86. package/dist/themes/color-schemes/neutral.json +0 -34
  87. package/dist/themes/color-schemes/ocean.json +0 -34
  88. package/dist/themes/color-schemes/rainbow.json +0 -43
  89. package/dist/themes/color-schemes/sakura.json +0 -34
  90. package/dist/themes/color-schemes/sepia.json +0 -34
  91. package/dist/themes/color-schemes/space.json +0 -34
  92. package/dist/themes/color-schemes/starry.json +0 -34
  93. package/dist/themes/color-schemes/sunset.json +0 -34
  94. package/dist/themes/color-schemes/warm.json +0 -34
  95. package/dist/themes/font-config.json +0 -184
  96. package/dist/themes/layout-schemes/academic.json +0 -40
  97. package/dist/themes/layout-schemes/book.json +0 -40
  98. package/dist/themes/layout-schemes/document.json +0 -40
  99. package/dist/themes/layout-schemes/magazine.json +0 -40
  100. package/dist/themes/layout-schemes/student.json +0 -40
  101. package/dist/themes/layout-schemes/technical.json +0 -40
  102. package/dist/themes/presets/academic.json +0 -24
  103. package/dist/themes/presets/business.json +0 -22
  104. package/dist/themes/presets/candy.json +0 -23
  105. package/dist/themes/presets/century.json +0 -22
  106. package/dist/themes/presets/coral.json +0 -22
  107. package/dist/themes/presets/default.json +0 -22
  108. package/dist/themes/presets/dinosaur.json +0 -23
  109. package/dist/themes/presets/elegant.json +0 -22
  110. package/dist/themes/presets/forest.json +0 -22
  111. package/dist/themes/presets/garamond.json +0 -22
  112. package/dist/themes/presets/garden.json +0 -23
  113. package/dist/themes/presets/handwritten.json +0 -23
  114. package/dist/themes/presets/heiti.json +0 -22
  115. package/dist/themes/presets/magazine.json +0 -24
  116. package/dist/themes/presets/manuscript.json +0 -22
  117. package/dist/themes/presets/minimal.json +0 -22
  118. package/dist/themes/presets/mixed.json +0 -24
  119. package/dist/themes/presets/newspaper.json +0 -24
  120. package/dist/themes/presets/ocean.json +0 -22
  121. package/dist/themes/presets/palatino.json +0 -22
  122. package/dist/themes/presets/rainbow.json +0 -23
  123. package/dist/themes/presets/space.json +0 -23
  124. package/dist/themes/presets/starry.json +0 -23
  125. package/dist/themes/presets/sunset.json +0 -22
  126. package/dist/themes/presets/swiss.json +0 -22
  127. package/dist/themes/presets/technical.json +0 -22
  128. package/dist/themes/presets/typewriter.json +0 -23
  129. package/dist/themes/presets/verdana.json +0 -22
  130. package/dist/themes/presets/water.json +0 -22
  131. package/dist/themes/registry.json +0 -270
  132. package/dist/themes/table-styles/academic.json +0 -30
  133. package/dist/themes/table-styles/borderless.json +0 -26
  134. package/dist/themes/table-styles/compact.json +0 -24
  135. package/dist/themes/table-styles/grid.json +0 -22
  136. package/dist/themes/table-styles/high-contrast.json +0 -22
  137. package/dist/themes/table-styles/minimal-gray.json +0 -26
  138. package/dist/themes/table-styles/modern-tech.json +0 -34
  139. package/dist/themes/table-styles/professional.json +0 -34
  140. package/dist/themes/table-styles/zebra.json +0 -22
  141. package/dist/types/src/utils/theme-to-css.d.ts +0 -171
@@ -1,11 +0,0 @@
1
- import{b as P}from"./chunk-IENSDROB.js";import{f as H}from"./chunk-Z4LVGK7Y.js";function V(e,t){let r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,r),e.applyData(t,r)}function _(e,t){let r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,r),[e.applyData(t,r),{type:"text",value:`
2
- `}]}function q(e,t){let r=t.value?t.value+`
3
- `:"",n={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(n.className=["language-"+i[0]]);let l={type:"element",tagName:"code",properties:n,children:[{type:"text",value:r}]};return t.meta&&(l.data={meta:t.meta}),e.patch(t,l),l=e.applyData(t,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(t,l),l}function G(e,t){let r={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function J(e,t){let r={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function y(e){let t=[],r=-1,n=0,i=0;for(;++r<e.length;){let l=e.charCodeAt(r),o="";if(l===37&&P(e.charCodeAt(r+1))&&P(e.charCodeAt(r+2)))i=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(o=String.fromCharCode(l));else if(l>55295&&l<57344){let c=e.charCodeAt(r+1);l<56320&&c>56319&&c<57344?(o=String.fromCharCode(l,c),i=1):o="\uFFFD"}else o=String.fromCharCode(l);o&&(t.push(e.slice(n,r),encodeURIComponent(o)),n=r+i+1,o=""),i&&(r+=i,i=0)}return t.join("")+e.slice(n)}function Y(e,t){let r=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=String(t.identifier).toUpperCase(),i=y(n.toLowerCase()),l=e.footnoteOrder.indexOf(n),o,c=e.footnoteCounts.get(n);c===void 0?(c=0,e.footnoteOrder.push(n),o=e.footnoteOrder.length):o=l+1,c+=1,e.footnoteCounts.set(n,c);let a={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+i,id:r+"fnref-"+i+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,a);let h={type:"element",tagName:"sup",properties:{},children:[a]};return e.patch(t,h),e.applyData(t,h)}function v(e,t){let r={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function X(e,t){if(e.options.allowDangerousHtml){let r={type:"raw",value:t.value};return e.patch(t,r),e.applyData(t,r)}}function C(e,t){let r=t.referenceType,n="]";if(r==="collapsed"?n+="[]":r==="full"&&(n+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+n}];let i=e.all(t),l=i[0];l&&l.type==="text"?l.value="["+l.value:i.unshift({type:"text",value:"["});let o=i[i.length-1];return o&&o.type==="text"?o.value+=n:i.push({type:"text",value:n}),i}function Z(e,t){let r=String(t.identifier).toUpperCase(),n=e.definitionById.get(r);if(!n)return C(e,t);let i={src:y(n.url||""),alt:t.alt};n.title!==null&&n.title!==void 0&&(i.title=n.title);let l={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,l),e.applyData(t,l)}function K(e,t){let r={src:y(t.url)};t.alt!==null&&t.alt!==void 0&&(r.alt=t.alt),t.title!==null&&t.title!==void 0&&(r.title=t.title);let n={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,n),e.applyData(t,n)}function Q(e,t){let r={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,r);let n={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(t,n),e.applyData(t,n)}function W(e,t){let r=String(t.identifier).toUpperCase(),n=e.definitionById.get(r);if(!n)return C(e,t);let i={href:y(n.url||"")};n.title!==null&&n.title!==void 0&&(i.title=n.title);let l={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function $(e,t){let r={href:y(t.url)};t.title!==null&&t.title!==void 0&&(r.title=t.title);let n={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ee(e,t,r){let n=e.all(t),i=r?Ce(r):te(t),l={},o=[];if(typeof t.checked=="boolean"){let s=n[0],p;s&&s.type==="element"&&s.tagName==="p"?p=s:(p={type:"element",tagName:"p",properties:{},children:[]},n.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let c=-1;for(;++c<n.length;){let s=n[c];(i||c!==0||s.type!=="element"||s.tagName!=="p")&&o.push({type:"text",value:`
4
- `}),s.type==="element"&&s.tagName==="p"&&!i?o.push(...s.children):o.push(s)}let a=n[n.length-1];a&&(i||a.type!=="element"||a.tagName!=="p")&&o.push({type:"text",value:`
5
- `});let h={type:"element",tagName:"li",properties:l,children:o};return e.patch(t,h),e.applyData(t,h)}function Ce(e){let t=!1;if(e.type==="list"){t=e.spread||!1;let r=e.children,n=-1;for(;!t&&++n<r.length;)t=te(r[n])}return t}function te(e){let t=e.spread;return t??e.children.length>1}function re(e,t){let r={},n=e.all(t),i=-1;for(typeof t.start=="number"&&t.start!==1&&(r.start=t.start);++i<n.length;){let o=n[i];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){r.className=["contains-task-list"];break}}let l={type:"element",tagName:t.ordered?"ol":"ul",properties:r,children:e.wrap(n,!0)};return e.patch(t,l),e.applyData(t,l)}function ne(e,t){let r={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function oe(e,t){let r={type:"root",children:e.wrap(e.all(t))};return e.patch(t,r),e.applyData(t,r)}function ie(e,t){let r={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}var D=le("end"),A=le("start");function le(e){return t;function t(r){let n=r&&r.position&&r.position[e]||{};if(typeof n.line=="number"&&n.line>0&&typeof n.column=="number"&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset=="number"&&n.offset>-1?n.offset:void 0}}}function E(e){let t=A(e),r=D(e);if(t&&r)return{start:t,end:r}}function ce(e,t){let r=e.all(t),n=r.shift(),i=[];if(n){let o={type:"element",tagName:"thead",properties:{},children:e.wrap([n],!0)};e.patch(t.children[0],o),i.push(o)}if(r.length>0){let o={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},c=A(t.children[1]),a=D(t.children[t.children.length-1]);c&&a&&(o.position={start:c,end:a}),i.push(o)}let l={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,l),e.applyData(t,l)}function se(e,t,r){let n=r?r.children:void 0,l=(n?n.indexOf(t):1)===0?"th":"td",o=r&&r.type==="table"?r.align:void 0,c=o?o.length:t.children.length,a=-1,h=[];for(;++a<c;){let p=t.children[a],f={},m=o?o[a]:void 0;m&&(f.align=m);let u={type:"element",tagName:l,properties:f,children:[]};p&&(u.children=e.all(p),e.patch(p,u),u=e.applyData(p,u)),h.push(u)}let s={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,s),e.applyData(t,s)}function ae(e,t){let r={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function fe(e){let t=String(e),r=/\r?\n|\r/g,n=r.exec(t),i=0,l=[];for(;n;)l.push(pe(t.slice(i,n.index),i>0,!0),n[0]),i=n.index+n[0].length,n=r.exec(t);return l.push(pe(t.slice(i),i>0,!1)),l.join("")}function pe(e,t,r){let n=0,i=e.length;if(t){let l=e.codePointAt(n);for(;l===9||l===32;)n++,l=e.codePointAt(n)}if(r){let l=e.codePointAt(i-1);for(;l===9||l===32;)i--,l=e.codePointAt(i-1)}return i>n?e.slice(n,i):""}function ue(e,t){let r={type:"text",value:fe(String(t.value))};return e.patch(t,r),e.applyData(t,r)}function he(e,t){let r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,r),e.applyData(t,r)}var S={blockquote:V,break:_,code:q,delete:G,emphasis:J,footnoteReference:Y,heading:v,html:X,imageReference:Z,image:K,inlineCode:Q,linkReference:W,link:$,listItem:ee,list:re,paragraph:ne,root:oe,strong:ie,table:ce,tableCell:ae,tableRow:se,text:ue,thematicBreak:he,toml:I,yaml:I,definition:I,footnoteDefinition:I};function I(){}var me=typeof self=="object"?self:globalThis,Se=(e,t)=>{let r=(i,l)=>(e.set(l,i),i),n=i=>{if(e.has(i))return e.get(i);let[l,o]=t[i];switch(l){case 0:case-1:return r(o,i);case 1:{let c=r([],i);for(let a of o)c.push(n(a));return c}case 2:{let c=r({},i);for(let[a,h]of o)c[n(a)]=n(h);return c}case 3:return r(new Date(o),i);case 4:{let{source:c,flags:a}=o;return r(new RegExp(c,a),i)}case 5:{let c=r(new Map,i);for(let[a,h]of o)c.set(n(a),n(h));return c}case 6:{let c=r(new Set,i);for(let a of o)c.add(n(a));return c}case 7:{let{name:c,message:a}=o;return r(new me[c](a),i)}case 8:return r(BigInt(o),i);case"BigInt":return r(Object(BigInt(o)),i);case"ArrayBuffer":return r(new Uint8Array(o).buffer,o);case"DataView":{let{buffer:c}=new Uint8Array(o);return r(new DataView(c),o)}}return r(new me[l](o),i)};return n},U=e=>Se(new Map,e)(0);var b="",{toString:Be}={},{keys:Re}=Object,k=e=>{let t=typeof e;if(t!=="object"||!e)return[0,t];let r=Be.call(e).slice(8,-1);switch(r){case"Array":return[1,b];case"Object":return[2,b];case"Date":return[3,b];case"RegExp":return[4,b];case"Map":return[5,b];case"Set":return[6,b];case"DataView":return[1,r]}return r.includes("Array")?[1,r]:r.includes("Error")?[7,r]:[2,r]},R=([e,t])=>e===0&&(t==="function"||t==="symbol"),Oe=(e,t,r,n)=>{let i=(o,c)=>{let a=n.push(o)-1;return r.set(c,a),a},l=o=>{if(r.has(o))return r.get(o);let[c,a]=k(o);switch(c){case 0:{let s=o;switch(a){case"bigint":c=8,s=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+a);s=null;break;case"undefined":return i([-1],o)}return i([c,s],o)}case 1:{if(a){let f=o;return a==="DataView"?f=new Uint8Array(o.buffer):a==="ArrayBuffer"&&(f=new Uint8Array(o)),i([a,[...f]],o)}let s=[],p=i([c,s],o);for(let f of o)s.push(l(f));return p}case 2:{if(a)switch(a){case"BigInt":return i([a,o.toString()],o);case"Boolean":case"Number":case"String":return i([a,o.valueOf()],o)}if(t&&"toJSON"in o)return l(o.toJSON());let s=[],p=i([c,s],o);for(let f of Re(o))(e||!R(k(o[f])))&&s.push([l(f),l(o[f])]);return p}case 3:return i([c,o.toISOString()],o);case 4:{let{source:s,flags:p}=o;return i([c,{source:s,flags:p}],o)}case 5:{let s=[],p=i([c,s],o);for(let[f,m]of o)(e||!(R(k(f))||R(k(m))))&&s.push([l(f),l(m)]);return p}case 6:{let s=[],p=i([c,s],o);for(let f of o)(e||!R(k(f)))&&s.push(l(f));return p}}let{message:h}=o;return i([c,{name:a,message:h}],o)};return l},z=(e,{json:t,lossy:r}={})=>{let n=[];return Oe(!(t||r),!!t,new Map,n)(e),n};var w=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?U(z(e,t)):structuredClone(e):(e,t)=>U(z(e,t));function M(e,t){let r=[{type:"text",value:"\u21A9"}];return t>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),r}function F(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function be(e){let t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=e.options.footnoteBackContent||M,n=e.options.footnoteBackLabel||F,i=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[],a=-1;for(;++a<e.footnoteOrder.length;){let h=e.footnoteById.get(e.footnoteOrder[a]);if(!h)continue;let s=e.all(h),p=String(h.identifier).toUpperCase(),f=y(p.toLowerCase()),m=0,u=[],x=e.footnoteCounts.get(p);for(;x!==void 0&&++m<=x;){u.length>0&&u.push({type:"text",value:" "});let d=typeof r=="string"?r:r(a,m);typeof d=="string"&&(d={type:"text",value:d}),u.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+f+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof n=="string"?n:n(a,m),className:["data-footnote-backref"]},children:Array.isArray(d)?d:[d]})}let g=s[s.length-1];if(g&&g.type==="element"&&g.tagName==="p"){let d=g.children[g.children.length-1];d&&d.type==="text"?d.value+=" ":g.children.push({type:"text",value:" "}),g.children.push(...u)}else s.push(...u);let N={type:"element",tagName:"li",properties:{id:t+"fn-"+f},children:e.wrap(s,!0)};e.patch(h,N),c.push(N)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...w(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
6
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
7
- `}]}}var j={}.hasOwnProperty,Pe={};function Ne(e,t){let r=t||Pe,n=new Map,i=new Map,l=new Map,o={...S,...r.handlers},c={all:h,applyData:Te,definitionById:n,footnoteById:i,footnoteCounts:l,footnoteOrder:[],handlers:o,one:a,options:r,patch:Ee,wrap:Ue};return H(e,function(s){if(s.type==="definition"||s.type==="footnoteDefinition"){let p=s.type==="definition"?n:i,f=String(s.identifier).toUpperCase();p.has(f)||p.set(f,s)}}),c;function a(s,p){let f=s.type,m=c.handlers[f];if(j.call(c.handlers,f)&&m)return m(c,s,p);if(c.options.passThrough&&c.options.passThrough.includes(f)){if("children"in s){let{children:x,...g}=s,N=w(g);return N.children=c.all(s),N}return w(s)}return(c.options.unknownHandler||Le)(c,s,p)}function h(s){let p=[];if("children"in s){let f=s.children,m=-1;for(;++m<f.length;){let u=c.one(f[m],s);if(u){if(m&&f[m-1].type==="break"&&(!Array.isArray(u)&&u.type==="text"&&(u.value=we(u.value)),!Array.isArray(u)&&u.type==="element")){let x=u.children[0];x&&x.type==="text"&&(x.value=we(x.value))}Array.isArray(u)?p.push(...u):p.push(u)}}}return p}}function Ee(e,t){e.position&&(t.position=E(e))}function Te(e,t){let r=t;if(e&&e.data){let n=e.data.hName,i=e.data.hChildren,l=e.data.hProperties;if(typeof n=="string")if(r.type==="element")r.tagName=n;else{let o="children"in r?r.children:[r];r={type:"element",tagName:n,properties:{},children:o}}r.type==="element"&&l&&Object.assign(r.properties,w(l)),"children"in r&&r.children&&i!==null&&i!==void 0&&(r.children=i)}return r}function Le(e,t){let r=t.data||{},n="value"in t&&!(j.call(r,"hProperties")||j.call(r,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ue(e,t){let r=[],n=-1;for(t&&r.push({type:"text",value:`
8
- `});++n<e.length;)n&&r.push({type:"text",value:`
9
- `}),r.push(e[n]);return t&&e.length>0&&r.push({type:"text",value:`
10
- `}),r}function we(e){let t=0,r=e.charCodeAt(t);for(;r===9||r===32;)t++,r=e.charCodeAt(t);return e.slice(t)}function O(e,t){let r=Ne(e,t),n=r.one(e,void 0),i=be(r),l=Array.isArray(n)?{type:"root",children:n}:n||{type:"root",children:[]};return i&&("children"in l,l.children.push({type:"text",value:`
11
- `},i)),l}function ke(e,t){return e&&"run"in e?async function(r,n){let i=O(r,{file:n,...t});await e.run(i,n)}:function(r,n){return O(r,{file:n,...e||t})}}export{S as a,M as b,F as c,ke as d};
@@ -1,3 +0,0 @@
1
- import{a as m}from"./chunk-Z4LVGK7Y.js";var h=(function(e,t,n){let r=m(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++t<e.children.length;)if(r(e.children[t],t,e))return e.children[t]});var f=(function(e){if(e==null)return T;if(typeof e=="string")return I(e);if(typeof e=="object")return A(e);if(typeof e=="function")return p(e);throw new Error("Expected function, string, or array as `test`")});function A(e){let t=[],n=-1;for(;++n<e.length;)t[n]=f(e[n]);return p(r);function r(...o){let c=-1;for(;++c<t.length;)if(t[c].apply(this,o))return!0;return!1}}function I(e){return p(t);function t(n){return n.tagName===e}}function p(e){return t;function t(n,r,o){return!!(B(n)&&e.call(this,n,typeof r=="number"?r:void 0,o||void 0))}}function T(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function B(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}var g=/\n/g,w=/[\t ]+/g,d=f("br"),b=f(P),C=f("p"),x=f("tr"),F=f(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",_,L]),y=f(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function j(e,t){let n=t||{},r="children"in e?e.children:[],o=y(e),c=N(e,{whitespace:n.whitespace||"normal",breakBefore:!1,breakAfter:!1}),i=[];(e.type==="text"||e.type==="comment")&&i.push(...k(e,{whitespace:c,breakBefore:!0,breakAfter:!0}));let l=-1;for(;++l<r.length;)i.push(...E(r[l],e,{whitespace:c,breakBefore:l?void 0:o,breakAfter:l<r.length-1?d(r[l+1]):o}));let s=[],u;for(l=-1;++l<i.length;){let a=i[l];typeof a=="number"?u!==void 0&&a>u&&(u=a):a&&(u!==void 0&&u>-1&&s.push(`
2
- `.repeat(u)||" "),u=-1,s.push(a))}return s.join("")}function E(e,t,n){return e.type==="element"?v(e,t,n):e.type==="text"?n.whitespace==="normal"?k(e,n):S(e):[]}function v(e,t,n){let r=N(e,n),o=e.children||[],c=-1,i=[];if(F(e))return i;let l,s;for(d(e)||x(e)&&h(t,e,x)?s=`
3
- `:C(e)?(l=2,s=2):y(e)&&(l=1,s=1);++c<o.length;)i=i.concat(E(o[c],e,{whitespace:r,breakBefore:c?void 0:l,breakAfter:c<o.length-1?d(o[c+1]):s}));return b(e)&&h(t,e,b)&&i.push(" "),l&&i.unshift(l),s&&i.push(s),i}function k(e,t){let n=String(e.value),r=[],o=[],c=0;for(;c<=n.length;){g.lastIndex=c;let s=g.exec(n),u=s&&"index"in s?s.index:n.length;r.push(O(n.slice(c,u).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),c===0?t.breakBefore:!0,u===n.length?t.breakAfter:!0)),c=u+1}let i=-1,l;for(;++i<r.length;)r[i].charCodeAt(r[i].length-1)===8203||i<r.length-1&&r[i+1].charCodeAt(0)===8203?(o.push(r[i]),l=void 0):r[i]?(typeof l=="number"&&o.push(l),o.push(r[i]),l=0):(i===0||i===r.length-1)&&o.push(0);return o}function S(e){return[String(e.value)]}function O(e,t,n){let r=[],o=0,c;for(;o<e.length;){w.lastIndex=o;let i=w.exec(e);c=i?i.index:e.length,!o&&!c&&i&&!t&&r.push(""),o!==c&&r.push(e.slice(o,c)),o=i?c+i[0].length:c}return o!==c&&!n&&r.push(""),r.join(" ")}function N(e,t){if(e.type==="element"){let n=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return n.wrap?"pre-wrap":"pre";case"td":case"th":return n.noWrap?"nowrap":t.whitespace;case"textarea":return"pre-wrap";default:}}return t.whitespace}function _(e){return!!(e.properties||{}).hidden}function P(e){return e.tagName==="td"||e.tagName==="th"}function L(e){return e.tagName==="dialog"&&!(e.properties||{}).open}export{j as a};