import{j as o,R as a}from"./index-C8amvZbx.js";import{M as u,r as f}from"./index-Do33_d1A.js";function k({text:r,searchQuery:t}){return o.jsx(u,{components:p(t),remarkPlugins:[f],children:j(r)})}function p(r){return{a({node:t,children:n,...e}){return o.jsx("a",{...e,target:"_blank",rel:"noreferrer",children:d(n,r)})},blockquote({node:t,children:n,...e}){return o.jsx("blockquote",{...e,children:d(n,r)})},code({node:t,children:n,...e}){return o.jsx("code",{...e,children:d(n,r)})},em({node:t,children:n,...e}){return o.jsx("em",{...e,children:d(n,r)})},h1({node:t,children:n,...e}){return o.jsx("h1",{...e,children:d(n,r)})},h2({node:t,children:n,...e}){return o.jsx("h2",{...e,children:d(n,r)})},h3({node:t,children:n,...e}){return o.jsx("h3",{...e,children:d(n,r)})},h4({node:t,children:n,...e}){return o.jsx("h4",{...e,children:d(n,r)})},h5({node:t,children:n,...e}){return o.jsx("h5",{...e,children:d(n,r)})},h6({node:t,children:n,...e}){return o.jsx("h6",{...e,children:d(n,r)})},li({node:t,children:n,...e}){return o.jsx("li",{...e,children:d(n,r)})},p({node:t,children:n,...e}){return o.jsx("p",{...e,children:d(n,r)})},pre({node:t,children:n,...e}){return o.jsx("pre",{...e,className:"transcript-markdown-code",children:n})},strong({node:t,children:n,...e}){return o.jsx("strong",{...e,children:d(n,r)})},td({node:t,children:n,...e}){return o.jsx("td",{...e,children:d(n,r)})},th({node:t,children:n,...e}){return o.jsx("th",{...e,children:d(n,r)})}}}function d(r,t){return a.Children.map(r,n=>typeof n=="string"?m(n,t):n)}function m(r,t){const n=t.trim();if(!n)return r||" ";const e=r.toLowerCase(),s=n.toLowerCase(),c=[];let l=0,i=e.indexOf(s);for(;i!==-1;){i>l&&c.push(r.slice(l,i));const h=i+n.length;c.push(o.jsx("mark",{className:"transcript-search-hit",children:r.slice(i,h)},`${i}-${h}`)),l=h,i=e.indexOf(s,l)}return l<r.length&&c.push(r.slice(l)),c.length>0?c:r||" "}function j(r){const t=r.split(`
`);let n=!1,e=null;return t.map((s,c)=>{const l=n,i=/^ {0,3}(```+|~~~+)/.exec(s);if(i){const h=i[1]?.startsWith("`")?"`":"~";n?e===h&&(n=!1,e=null):(n=!0,e=h)}return c===t.length-1||l||i||s.trim()===""||s.endsWith("  ")?s:`${s.replace(/[ \t]+$/,"")}  `}).join(`
`)}export{k as default};
