function l(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function g(e,t=160){const r=e.replace(/#{1,6}\s/g,"").replace(/\*\*([^*]+)\*\*/g,"$1").replace(/\*([^*]+)\*/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/`([^`]+)`/g,"$1").replace(/```[\s\S]*?```/g,"").replace(/!\[[^\]]*\]\([^)]+\)/g,"").replace(/>\s/g,"").replace(/[-*+]\s/g,"").replace(/\n+/g," ").trim();return r.length<=t?r:r.substring(0,t).replace(/\s+\S*$/,"")+"..."}function i(e){const t=/^(#{2,3})\s+(.+)$/gm,r=[];let n;for(;(n=t.exec(e))!==null;){const a=n[1].length,c=n[2].trim(),s=l(c);r.push({id:s,text:c,level:a})}return r}function o(e){const t=e.split(/\s+/).length;return Math.max(1,Math.ceil(t/200))}function u(e){return e?new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}):""}export{o as c,i as e,u as f,g,l as s};