const BOILERPLATE_TEXT_EQUALITY = [
  "was this helpful?",
  "send",
  "edit this page",
  "edit on github",
  "suggest changes",
  "skip to main content",
  "on this page"
];
const BOILERPLATE_TEXT_PATTERNS = [
  /^\s*last updated on .+$/i
];
const BOILERPLATE_SELECTORS = [
  '[class*="feedback"]',
  '[class*="edit-page"]',
  '[aria-label*="Edit"]',
  'footer[class*="docs"]',
  '[class*="sticky-cta"]',
  'main [role="banner"]',
  '[role="navigation"]',
  '[class*="sidebar"]',
  '[data-collection="docs"]'
];
function stripBoilerplateMarkdown(md) {
  if (!md) return md;
  const lines = md.split("\n");
  const kept = lines.filter((line) => {
    const t = line.trim().toLowerCase();
    if (!t) return true;
    if (BOILERPLATE_TEXT_EQUALITY.includes(t)) return false;
    return !BOILERPLATE_TEXT_PATTERNS.some((re) => re.test(line));
  });
  return kept.join("\n").replace(/\n{3,}/g, "\n\n");
}
function stripBoilerplateDom(document) {
  for (const sel of BOILERPLATE_SELECTORS) {
    const nodes = document.querySelectorAll(sel);
    const list = [];
    for (let i = 0; i < nodes.length; i++) list.push(nodes[i]);
    for (const el of list) {
      el.parentNode?.removeChild(el);
    }
  }
}
export {
  BOILERPLATE_SELECTORS,
  BOILERPLATE_TEXT_EQUALITY,
  BOILERPLATE_TEXT_PATTERNS,
  stripBoilerplateDom,
  stripBoilerplateMarkdown
};
//# sourceMappingURL=boilerplate.js.map