/**
* cleanWebPageSourceForAI
*
* Strips non-UI noise from raw HTML so an AI agent can read page structure
* and generate XPaths without drowning in scripts, styles, hidden subtrees,
* inline base64, or analytics chatter.
*
* Aggressive trims (NEW-3):
* 1. Removes non-UI tags entirely (script, style, link, meta, noscript,
* template, svg, canvas).
* 2. Removes HTML comments.
* 3. Removes hidden subtrees outright (was: marked with special-remark).
* 4. Strips `on*` event-handler attributes.
* 5. Strips inline `style` attributes after hidden detection.
* 6. Strips analytics `data-*` attributes (gtm, ga, segment, track,
* analytics).
* 7. Replaces base64 data URIs in `src`/`href` with `[base64 N bytes]`.
* 8. Truncates text nodes longer than 200 chars.
* 9. Recurses into iframe `srcdoc` content (cleans embedded HTML).
*
* Preserved (intentional, per design):
* - Everything outside `
` (``, ``, `` attrs).
* - All `class` attributes — sometimes the only stable selector.
*
* Hidden detection covers: `hidden` attr, `aria-hidden="true"`,
* `type="hidden"`, inline `display:none`/`visibility:hidden`/`opacity:0`,
* and `