seo-crawl-audit 0.10.0 → 0.10.2
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.
- package/README.md +21 -4
- package/bundle/cli.js +37 -34
- package/bundle/mcp.js +10 -7
- package/bundle/server.js +33 -28
- package/package.json +3 -3
package/bundle/cli.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import{createHash as
|
|
1
|
+
import{createHash as la}from"node:crypto";var da="https://github.com/MelnixDev/seo-crawl-audit/blob/main/docs/rules.md",Aa=[{id:"page-unreachable",severity:"error",owner:"developer",scope:"page",remediation:"Restore the page or remove references to it."},{id:"http-error",severity:"error",owner:"developer",scope:"page",remediation:"Return a successful response or a deliberate redirect."},{id:"noindex",severity:"info",owner:"seo",scope:"page",remediation:"Remove noindex when the page should appear in search."},{id:"x-robots-noindex",severity:"error",owner:"developer",scope:"page",remediation:"Remove the noindex X-Robots-Tag when indexing is intended."},{id:"robots-blocked",severity:"error",owner:"developer",scope:"page",remediation:"Allow the URL in robots.txt when it should be crawled."},{id:"missing-canonical",severity:"warning",owner:"seo",scope:"page",remediation:"Declare the preferred canonical URL when duplicate URL variants are possible."},{id:"invalid-canonical",severity:"error",owner:"developer",scope:"page",remediation:"Use an absolute or valid relative HTTP(S) canonical URL."},{id:"cross-domain-canonical",severity:"error",owner:"seo",scope:"page",remediation:"Confirm the external canonical or point it to the intended same-site URL."},{id:"canonical-target-error",severity:"error",owner:"developer",scope:"page",remediation:"Point the canonical to an accessible, indexable URL."},{id:"redirect-loop",severity:"error",owner:"developer",scope:"page",remediation:"Remove the circular redirect path."},{id:"long-redirect-chain",severity:"warning",owner:"developer",scope:"page",remediation:"Redirect directly to the final destination."},{id:"sitemap-unavailable",severity:"error",owner:"developer",scope:"site",remediation:"Restore a valid, reachable XML sitemap."},{id:"noindex-in-sitemap",severity:"error",owner:"seo",scope:"page",remediation:"Remove the URL from the sitemap or make it indexable."},{id:"redirect-in-sitemap",severity:"error",owner:"seo",scope:"page",remediation:"Replace the sitemap URL with its final canonical destination."},{id:"missing-title",severity:"error",owner:"content",scope:"page",remediation:"Add a unique, descriptive HTML title."},{id:"duplicate-title",severity:"warning",owner:"content",scope:"page",remediation:"Write a title that uniquely describes this page."},{id:"title-length",severity:"warning",owner:"content",scope:"page",remediation:"Keep the title concise and descriptive, usually 10\u201360 characters."},{id:"missing-description",severity:"warning",owner:"content",scope:"page",remediation:"Add a useful meta description."},{id:"duplicate-description",severity:"warning",owner:"content",scope:"page",remediation:"Write a unique meta description for this page."},{id:"description-length",severity:"warning",owner:"content",scope:"page",remediation:"Keep the description useful and usually between 50 and 160 characters."},{id:"missing-h1",severity:"warning",owner:"content",scope:"page",remediation:"Add one clear primary heading."},{id:"broken-internal-link",severity:"error",owner:"developer",scope:"page",remediation:"Update or remove the internal link, or restore its target."},{id:"orphan-sitemap-page",severity:"warning",owner:"seo",scope:"page",remediation:"Add meaningful internal links to the sitemap page."},{id:"crawlable-not-in-sitemap",severity:"warning",owner:"seo",scope:"page",remediation:"Add the indexable page to the sitemap or intentionally exclude it."},{id:"invalid-hreflang",severity:"warning",owner:"seo",scope:"page",remediation:"Use valid language tags and resolvable HTTP(S) alternate URLs."},{id:"malformed-json-ld",severity:"warning",owner:"developer",scope:"page",remediation:"Fix JSON syntax in the structured-data block."},{id:"http-on-https-site",severity:"warning",owner:"developer",scope:"page",remediation:"Use HTTPS for internal URLs and metadata references."},{id:"invalid-language",severity:"warning",owner:"developer",scope:"page",remediation:"Set a valid BCP 47 language tag on the html element."},{id:"duplicate-content",severity:"warning",owner:"content",scope:"page",remediation:"Consolidate duplicate pages or differentiate their main content."},{id:"multiple-h1",severity:"info",owner:"content",scope:"page",remediation:"Review whether one primary H1 would make the hierarchy clearer."},{id:"missing-open-graph",severity:"info",owner:"content",scope:"page",remediation:"Add Open Graph title, description, and image for social sharing."},{id:"missing-twitter-metadata",severity:"info",owner:"content",scope:"page",remediation:"Add Twitter card metadata when social previews matter."},{id:"image-missing-alt",severity:"info",owner:"content",scope:"page",remediation:"Add meaningful alt text, or an empty alt for decorative images."},{id:"low-word-count",severity:"info",owner:"content",scope:"page",remediation:"Review whether the page provides enough useful primary content."},{id:"robots-changed",severity:"warning",owner:"developer",scope:"site",remediation:"Review the robots.txt change and confirm that crawl access is intentional."},{id:"page-missing",severity:"error",owner:"developer",scope:"page",remediation:"Include the page in the scan or confirm that its removal is intentional."},{id:"status-regression",severity:"error",owner:"developer",scope:"page",remediation:"Restore the previous successful HTTP response."},{id:"new-noindex",severity:"error",owner:"seo",scope:"page",remediation:"Remove the newly introduced noindex unless it is intentional."},{id:"title-removed",severity:"error",owner:"content",scope:"page",remediation:"Restore a descriptive title."},{id:"title-changed",severity:"warning",owner:"content",scope:"page",remediation:"Review and approve the changed title."},{id:"description-removed",severity:"warning",owner:"content",scope:"page",remediation:"Restore a useful meta description."},{id:"canonical-removed",severity:"error",owner:"seo",scope:"page",remediation:"Restore the canonical declaration."},{id:"canonical-changed",severity:"warning",owner:"seo",scope:"page",remediation:"Confirm the new canonical target is deliberate and valid."},{id:"h1-removed",severity:"warning",owner:"content",scope:"page",remediation:"Restore a clear primary heading."},{id:"redirect-changed",severity:"warning",owner:"developer",scope:"page",remediation:"Confirm the new redirect destination is intentional."},{id:"sitemap-url-count-drop",severity:"error",owner:"seo",scope:"site",remediation:"Investigate the sitemap URL loss and restore omitted indexable pages."}],vn=Object.freeze(Aa.map(e=>Object.freeze({...e}))),ua=new Map(vn.map(e=>[e.id,e]));function Or(e){return Array.isArray(e)?`[${e.map(Or).join(",")}]`:e&&typeof e=="object"?`{${Object.entries(e).sort(([t],[r])=>t.localeCompare(r)).map(([t,r])=>`${t}:${Or(r)}`).join(",")}}`:JSON.stringify(e)}function Pn(e,t,r,n){return la("sha256").update(`${e}
|
|
2
2
|
${t}
|
|
3
3
|
${r}
|
|
4
|
-
${Or(n??null)}`).digest("hex").slice(0,24)}function L(e,t,r,n={},s){let a=da.get(e);if(!a)throw new Error(`unknown rule: ${e}`);return{fingerprint:Pn(e,a.scope,t,s),ruleId:e,rule:e,severity:a.severity,scope:a.scope,url:t,message:r,evidence:n,owner:a.owner,remediation:a.remediation,documentationUrl:`${la}#${e}`,after:n.actual}}function ze(e,t){return new RegExp(`(^|[\\s,])${t}($|[\\s,])`,"i").test(e??"")}function Mn(e){if(e.toLowerCase()==="x-default")return!0;try{return new Intl.Locale(e),!0}catch{return!1}}function Dr(e,t){let r=new Map;for(let n of e){let s=t(n)?.trim().toLowerCase();if(!s)continue;let a=r.get(s)??[];a.push(n.url),r.set(s,a)}return new Map([...r].filter(([,n])=>n.length>1))}function Fn(e){let t=[],r=o=>{t.push(o)},n=new Map(e.pages.map(o=>[o.url,o])),s=new Set(e.sitemap?.urls??[]),a=Dr(e.pages,o=>o.title),c=Dr(e.pages,o=>o.description),l=Dr(e.pages,o=>o.contentHash);e.sitemap?.error&&r(L("sitemap-unavailable",e.sitemap.url,"The configured sitemap could not be loaded",{actual:e.sitemap.error}));for(let o of e.pages){if(o.blockedByRobots){r(L("robots-blocked",o.url,"Page is blocked by robots.txt",{actual:!0}));continue}if(o.error){r(L(o.error.includes("redirect loop")?"redirect-loop":"page-unreachable",o.url,`Page request failed: ${o.error}`,{actual:o.error,redirectChain:o.redirectChain}));continue}if((o.status===null||o.status>=400)&&r(L("http-error",o.url,`Page returned HTTP ${o.status??"unknown"}`,{actual:o.status})),ze(o.robots,"noindex")&&r(L("noindex",o.url,"Page contains a noindex meta directive",{actual:o.robots})),ze(o.xRobotsTag,"noindex")&&r(L("x-robots-noindex",o.url,"Page contains a noindex X-Robots-Tag",{actual:o.xRobotsTag})),!o.canonicalRaw&&!o.canonical&&r(L("missing-canonical",o.url,"Page does not declare a canonical URL",{actual:null})),o.canonicalRaw&&!o.canonical&&r(L("invalid-canonical",o.url,"Canonical URL is invalid",{actual:o.canonicalRaw})),o.canonical&&new URL(o.canonical).origin!==new URL(e.siteUrl).origin&&r(L("cross-domain-canonical",o.url,"Canonical points to another origin",{actual:o.canonical})),o.canonical){let u=n.get(o.canonical);u&&(u.error||(u.status??500)>=400)&&r(L("canonical-target-error",o.url,"Canonical target is unavailable",{target:o.canonical,actual:u.status??u.error},o.canonical))}o.redirectChain.length>3&&r(L("long-redirect-chain",o.url,`Page uses ${o.redirectChain.length} redirects`,{actual:o.redirectChain.length,redirectChain:o.redirectChain})),s.has(o.url)&&(ze(o.robots,"noindex")||ze(o.xRobotsTag,"noindex"))&&r(L("noindex-in-sitemap",o.url,"Sitemap URL is marked noindex",{actual:o.robots??o.xRobotsTag})),s.has(o.url)&&o.redirectChain.length>0&&r(L("redirect-in-sitemap",o.url,"Sitemap URL redirects",{actual:o.finalUrl,redirectChain:o.redirectChain})),o.title?(a.get(o.title.trim().toLowerCase())&&r(L("duplicate-title",o.url,"Title is shared by multiple pages",{actual:o.title,urls:a.get(o.title.trim().toLowerCase())},o.title.trim().toLowerCase())),(o.title.length<10||o.title.length>60)&&r(L("title-length",o.url,`Title length is ${o.title.length} characters`,{actual:o.title.length,value:o.title}))):r(L("missing-title",o.url,"Page does not have a title",{actual:null})),o.description?(c.get(o.description.trim().toLowerCase())&&r(L("duplicate-description",o.url,"Meta description is shared by multiple pages",{actual:o.description,urls:c.get(o.description.trim().toLowerCase())},o.description.trim().toLowerCase())),(o.description.length<50||o.description.length>160)&&r(L("description-length",o.url,`Description length is ${o.description.length} characters`,{actual:o.description.length,value:o.description}))):r(L("missing-description",o.url,"Page does not have a meta description",{actual:null})),o.h1Count===0?r(L("missing-h1",o.url,"Page does not contain an H1 heading",{actual:0})):o.h1Count>1&&r(L("multiple-h1",o.url,`Page contains ${o.h1Count} H1 headings`,{actual:o.h1Count}));for(let u of o.internalLinks){let m=n.get(u);m&&(m.error||(m.status??500)>=400)&&r(L("broken-internal-link",o.url,"Internal link points to an unavailable page",{target:u,actual:m.status??m.error},u))}s.has(o.url)&&o.url!==e.siteUrl&&e.linkGraph.orphanUrls.includes(o.url)&&r(L("orphan-sitemap-page",o.url,"Sitemap page has no discovered internal links",{actual:!0})),e.sitemap&&!s.has(o.url)&&!ze(o.robots,"noindex")&&(o.status??500)<400&&r(L("crawlable-not-in-sitemap",o.url,"Crawlable page is absent from the sitemap",{actual:!1}));for(let u of o.hreflang)(!Mn(u.lang)||!u.url)&&r(L("invalid-hreflang",o.url,"Hreflang declaration is invalid",{actual:u},u));for(let[u,m]of o.jsonLd.entries())m.valid||r(L("malformed-json-ld",o.url,"JSON-LD block contains invalid JSON",{actual:m.error,index:u},u));e.siteUrl.startsWith("https:")&&[o.url,o.canonical,...o.internalLinks].some(u=>u?.startsWith("http:"))&&r(L("http-on-https-site",o.url,"HTTPS site references an internal HTTP URL",{actual:[o.url,o.canonical,...o.internalLinks].filter(u=>u?.startsWith("http:"))})),o.lang&&!Mn(o.lang)&&r(L("invalid-language",o.url,"HTML language declaration is invalid",{actual:o.lang})),o.contentHash&&l.get(o.contentHash)&&r(L("duplicate-content",o.url,"Main text is an exact duplicate of another page",{urls:l.get(o.contentHash)},o.contentHash)),(!o.openGraph.title||!o.openGraph.description||!o.openGraph.image)&&r(L("missing-open-graph",o.url,"Open Graph metadata is incomplete",{actual:o.openGraph})),(!o.twitter.card||!o.twitter.title||!o.twitter.description||!o.twitter.image)&&r(L("missing-twitter-metadata",o.url,"Twitter card metadata is incomplete",{actual:o.twitter}));let A=o.images.filter(u=>u.alt===null).map(u=>u.src);A.length>0&&r(L("image-missing-alt",o.url,`${A.length} image(s) do not have an alt attribute`,{actual:A})),o.wordCount<200&&r(L("low-word-count",o.url,`Page contains approximately ${o.wordCount} visible words`,{actual:o.wordCount}))}return t}var Un={error:0,warning:1,info:2};function ua(e,t){let r=(()=>{try{return new URL(e).pathname}catch{return e}})(),n=t.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replaceAll("**","\0").replaceAll("*","[^/]*").replaceAll("\0",".*"),s=new RegExp(`^${n}$`);return s.test(r)||s.test(e)}function ha(e,t,r){return t.find(n=>n.rule!==e.ruleId||!ua(e.url,n.urlPattern)?!1:n.expiresAt?new Date(`${n.expiresAt}T23:59:59.999Z`).getTime()>=r.getTime():!0)??null}function Me(e){return e.sort((t,r)=>Un[t.severity]-Un[r.severity]||t.url.localeCompare(r.url)||t.ruleId.localeCompare(r.ruleId)||t.fingerprint.localeCompare(r.fingerprint))}function et(e,t,r={}){let n=r.enabledRules??t.config.enabledRules,s=n?new Set(n):null,a={...t.config.severityOverrides,...r.severityOverrides??{}},c=r.suppressions??t.config.suppressions,l=new Date(r.now??Date.now());return Me(e.filter(o=>!s||s.has(o.ruleId)).map(o=>({...o,severity:a[o.ruleId]??o.severity})).filter(o=>!ha(o,c,l)))}import{createHash as ma}from"node:crypto";var V="0.10.0",tt="1.1.0",pa="seo-crawl-audit",ye=`${pa}/${V}`;var ga={title:null,description:null,image:null},fa={card:null,title:null,description:null,image:null};function Hn(e){if(!e||typeof e!="object"||Array.isArray(e))throw new Error("snapshot must be an object");return e}function Ea(e){if(!e||typeof e!="object"||typeof e.url!="string")throw new Error("snapshot page URL must be a string");return e}function Br(e){return Array.isArray(e)?`[${e.map(Br).join(",")}]`:e&&typeof e=="object"?`{${Object.entries(e).sort(([t],[r])=>t.localeCompare(r)).map(([t,r])=>`${JSON.stringify(t)}:${Br(r)}`).join(",")}}`:JSON.stringify(e)}function Ta(e){return ma("sha256").update(Br(e)).digest("hex")}function Ca(e){return{url:e.url,finalUrl:e.finalUrl??null,status:e.status??null,contentType:e.contentType??null,blockedByRobots:e.blockedByRobots??!1,error:e.error??null,title:e.title??null,description:e.description??null,canonical:e.canonical??null,canonicalRaw:e.canonicalRaw??e.canonical??null,robots:e.robots??null,xRobotsTag:e.xRobotsTag??null,lang:e.lang??null,h1Count:e.h1Count??0,openGraph:e.openGraph??ga,twitter:e.twitter??fa,hreflang:e.hreflang??[],jsonLd:e.jsonLd??[],images:e.images??[],links:[...e.links??[]].sort(),internalLinks:[...e.internalLinks??[]].sort(),externalLinks:[...e.externalLinks??[]].sort(),wordCount:e.wordCount??0,contentHash:e.contentHash??null,depth:e.depth??0,redirectChain:e.redirectChain??[],responseBytes:e.responseBytes??0}}function Ia(e){let t=e.source??{},r=e.options??{},n=e.pages?.[0],s=n&&typeof n=="object"?n.url:void 0,a=e.siteUrl??e.startUrl??t.startUrl??(typeof s=="string"?s:void 0);if(!a)throw new Error("snapshot site URL must be a string");return{schemaVersion:1,url:a,sitemap:r.sitemap??t.sitemap??"auto",maxPages:r.maxPages??t.maxPages??100,concurrency:r.concurrency??5,delay:r.requestDelay??t.requestDelay??100,timeout:r.timeout??1e4,respectRobots:r.respectRobots??t.respectRobots??!0,includeQuery:r.includeQuery??t.includeQuery??!1,maxRedirects:r.maxRedirects??10,maxResponseBytes:r.maxResponseBytes??5*1024*1024,enabledRules:r.enabledRules??null,severityOverrides:r.severityOverrides??{},suppressions:r.suppressions??[],regressionBudgets:r.regressionBudgets??{},report:r.report??{}}}function ba(e,t){let r=new Set(e.map(a=>a.url)),n=new Set(e.flatMap(a=>a.internalLinks)),s=new Set;for(let a of e)(a.error||a.blockedByRobots||(a.status??500)>=400)&&s.add(a.url);return{internalEdges:e.reduce((a,c)=>a+c.internalLinks.length,0),externalEdges:e.reduce((a,c)=>a+c.externalLinks.length,0),orphanUrls:t.filter(a=>r.has(a)&&!n.has(a)),brokenInternalUrls:[...s].sort()}}function ya(e,t){let r=t.filter(s=>s.blockedByRobots).length,n=t.filter(s=>s.error||(s.status??500)>=400).length;return{requested:e.requested??t.length,completed:t.length,succeeded:t.length-n-r,failed:n,blockedByRobots:r,redirected:t.filter(s=>s.redirectChain.length>0||s.url!==s.finalUrl).length,durationMs:e.durationMs??0,truncated:e.truncated??!1,partial:e.partial??!1}}function Ee(e){let t=Hn(e),r=Ia(t),n=(t.pages??[]).map(o=>Ca(Ea(o))).sort((o,A)=>o.url.localeCompare(A.url)),s=t.sitemap?.urls??[];if(t.sitemap&&!t.sitemap.url)throw new Error("snapshot sitemap URL must be a string");let a=t.sitemap?{url:t.sitemap.url,urls:[...s].sort(),sitemapCount:t.sitemap.sitemapCount??0,truncated:t.sitemap.truncated??!1,error:t.sitemap.error??null}:null,c=t.startUrl??r.url,l=t.truncated??!1;return{schemaVersion:2,engineVersion:V,ruleSetVersion:tt,generatedAt:t.generatedAt??new Date().toISOString(),siteUrl:c,configurationHash:Ta(r),config:r,robots:{url:t.robots?.url??new URL("/robots.txt",c).href,status:t.robots?.status??null,sha256:t.robots?.sha256??null,error:t.robots?.error??null,denyAll:t.robots?.denyAll??!1},sitemap:a,pages:n,linkGraph:t.linkGraph??ba(n,s),statistics:t.statistics??ya(t,n),partial:t.partial??!1,source:{startUrl:c,maxPages:r.maxPages,requestDelay:r.delay,includeQuery:r.includeQuery,respectRobots:r.respectRobots,sitemap:typeof r.sitemap=="string"&&!["auto","none"].includes(r.sitemap)?r.sitemap:null},truncated:l}}function we(e){let t=Hn(e);if(!Array.isArray(t.pages))throw new Error("snapshot pages must be an array");if(t.schemaVersion===2)return Ee({...t,startUrl:t.siteUrl,options:t.config,pages:t.pages,generatedAt:t.generatedAt,partial:t.partial,statistics:t.statistics,linkGraph:t.linkGraph});if(t.schemaVersion===1)return Ee(t);throw new Error(`unsupported snapshot schema version: ${String(t.schemaVersion)}`)}function Ne(e){if(e.schemaVersion===2)return e;let t=e,r=t.pages?.[0],n=r&&typeof r=="object"?r.url:void 0,s=typeof n=="string"?n:t.source?.startUrl??"https://invalid.local/";return Ee({...t,startUrl:t.siteUrl??t.source?.startUrl??s,robots:t.robots??{url:new URL("/robots.txt",s).href,status:null,sha256:null,error:null},options:t.config??t.options??{}})}function Se(e,t={}){let r=Ne(e);return et(Fn(r),r,t)}function Qn(e,t){return new RegExp(`(^|[\\s,])${t}($|[\\s,])`,"i").test(e??"")}function q(e,t,r,n,s){let a=L(e,t,r,{before:n,after:s,actual:s});return a.before=n,a.after=s,a}function Yn(e,t){let r=!t.partial&&!t.truncated,n=[],s=new Map(t.pages.map(o=>[o.url,o]));e.robots.sha256&&t.robots.sha256&&e.robots.sha256!==t.robots.sha256&&n.push(q("robots-changed",t.robots.url,"robots.txt content changed",e.robots.sha256,t.robots.sha256));let a=e.sitemap?.urls.length??0,c=t.sitemap?.urls.length??0,l=a-c;r&&a>0&&l>=Math.max(5,Math.ceil(a*.2))&&n.push(q("sitemap-url-count-drop",t.sitemap?.url??e.sitemap?.url??t.siteUrl,`Sitemap URL count dropped by ${l}`,a,c));for(let o of e.pages){let A=s.get(o.url);if(!A){r&&n.push(q("page-missing",o.url,"Page was not checked",o.status,null));continue}if(A.blockedByRobots&&!o.blockedByRobots){n.push(q("robots-blocked",o.url,"Page is now blocked by robots.txt",!1,!0));continue}if(A.error&&!o.error){n.push(q(A.error.includes("redirect loop")?"redirect-loop":"page-unreachable",o.url,`Page request failed: ${A.error}`,o.error,A.error));continue}o.status!==null&&o.status<400&&(A.status===null||A.status>=400)&&n.push(q("status-regression",o.url,`HTTP status regressed from ${o.status} to ${A.status??"none"}`,o.status,A.status));let u=`${o.robots??""},${o.xRobotsTag??""}`,m=`${A.robots??""},${A.xRobotsTag??""}`;if(!Qn(u,"noindex")&&Qn(m,"noindex")&&n.push(q("new-noindex",o.url,"Page now contains a noindex directive",u,m)),o.title&&!A.title?n.push(q("title-removed",o.url,"Page title was removed",o.title,A.title)):o.title&&A.title&&o.title!==A.title&&n.push(q("title-changed",o.url,"Page title changed",o.title,A.title)),o.description&&!A.description&&n.push(q("description-removed",o.url,"Meta description was removed",o.description,A.description)),o.canonical&&!A.canonical)n.push(q("canonical-removed",o.url,"Canonical URL was removed",o.canonical,A.canonical));else if(o.canonical&&A.canonical&&o.canonical!==A.canonical){let T=q("canonical-changed",o.url,"Canonical URL changed",o.canonical,A.canonical);new URL(A.canonical).origin!==new URL(o.url).origin&&(T.severity="error"),n.push(T)}if(o.h1Count>0&&A.h1Count===0&&n.push(q("h1-removed",o.url,"All H1 headings were removed",o.h1Count,A.h1Count)),o.finalUrl&&A.finalUrl&&o.finalUrl!==A.finalUrl){let T=q("redirect-changed",o.url,"Final redirect URL changed",o.finalUrl,A.finalUrl);new URL(A.finalUrl).origin!==new URL(o.url).origin&&(T.severity="error"),n.push(T)}}return n}function Na(e,t,r={}){let n=Ne(e),s=Ne(t);return et(Yn(n,s),s,r)}function rt(e,t){return{...e,lifecycle:t}}function kt(e,t,r={}){let n=Ne(e),s=Ne(t),a=!s.partial&&!s.truncated,c=new Set(s.pages.map(b=>b.url)),l=new Map(Se(n,r).map(b=>[b.fingerprint,b])),o=new Map(Se(s,r).map(b=>[b.fingerprint,b])),A=[],u=[],m=[],T=[];for(let[b,_]of o){let S=l.get(b);S?JSON.stringify(S.evidence)===JSON.stringify(_.evidence)?m.push(rt(_,"unchanged")):u.push(rt({..._,before:S.evidence,after:_.evidence},"ongoing")):A.push(rt(_,"new"))}for(let[b,_]of l)(_.scope==="page"?c.has(_.url):a)&&!o.has(b)&&T.push(rt(_,"resolved"));let f=new Set(A.map(b=>b.fingerprint));for(let b of Na(n,s,r))f.has(b.fingerprint)||A.push(rt(b,"new"));let y={...n.config.regressionBudgets,...s.config.regressionBudgets},w=Object.entries(y).flatMap(([b,_])=>{let S=A.filter(R=>R.severity===b||R.ruleId===b).length;return S>_?[{budget:b,allowed:_,actual:S}]:[]});return Me(A),Me(u),Me(m),Me(T),{complete:a,newIssues:A,ongoingIssues:u,resolvedIssues:T,unchangedIssues:m,issues:[...A,...u],budgetExceeded:w}}var kr="seo-audit.config.json",Gn=Object.freeze({schemaVersion:1,url:"",sitemap:"auto",maxPages:100,concurrency:5,delay:100,timeout:1e4,respectRobots:!0,includeQuery:!1,maxRedirects:10,maxResponseBytes:5242880,enabledRules:null,severityOverrides:{},suppressions:[],regressionBudgets:{},report:{}});function nt(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new Error(`${t} must be an object`);return e}function _e(e,t,r,n=Number.MAX_SAFE_INTEGER){if(!Number.isInteger(e)||e<r||e>n)throw new Error(`${t} must be an integer between ${r} and ${n}`);return e}function st(e,t){if(e!==void 0){if(typeof e!="string")throw new Error(`${t} must be a string`);return e}}function vr(e){let t=nt(e,"config"),r=new Set(["$schema","schemaVersion","url","sitemap","maxPages","concurrency","delay","timeout","respectRobots","includeQuery","maxRedirects","maxResponseBytes","enabledRules","severityOverrides","suppressions","regressionBudgets","report"]);for(let s of Object.keys(t))if(!r.has(s))throw new Error(`unknown config property: ${s}`);let n={};if(t.schemaVersion!==void 0&&t.schemaVersion!==1)throw new Error("schemaVersion must be 1");if(t.url!==void 0){let s=st(t.url,"url");if(!/^https?:\/\//i.test(s))throw new Error("url must be an HTTP(S) URL");n.url=s}if(t.sitemap!==void 0){let s=st(t.sitemap,"sitemap");if(!["auto","none"].includes(s)&&!/^https?:\/\//i.test(s))throw new Error("sitemap must be auto, none, or an HTTP(S) URL");n.sitemap=s}t.maxPages!==void 0&&(n.maxPages=_e(t.maxPages,"maxPages",1)),t.concurrency!==void 0&&(n.concurrency=_e(t.concurrency,"concurrency",1,50)),t.delay!==void 0&&(n.delay=_e(t.delay,"delay",0)),t.timeout!==void 0&&(n.timeout=_e(t.timeout,"timeout",1)),t.maxRedirects!==void 0&&(n.maxRedirects=_e(t.maxRedirects,"maxRedirects",0,50)),t.maxResponseBytes!==void 0&&(n.maxResponseBytes=_e(t.maxResponseBytes,"maxResponseBytes",1024));for(let s of["respectRobots","includeQuery"])if(t[s]!==void 0){if(typeof t[s]!="boolean")throw new Error(`${s} must be a boolean`);n[s]=t[s]}if(t.enabledRules!==void 0){if(t.enabledRules!==null&&(!Array.isArray(t.enabledRules)||t.enabledRules.some(s=>typeof s!="string")))throw new Error("enabledRules must be null or an array of rule IDs");n.enabledRules=t.enabledRules}if(t.severityOverrides!==void 0){let s=nt(t.severityOverrides,"severityOverrides");for(let[a,c]of Object.entries(s))if(!["error","warning","info"].includes(c))throw new Error(`severityOverrides.${a} must be error, warning, or info`);n.severityOverrides=s}if(t.suppressions!==void 0){if(!Array.isArray(t.suppressions))throw new Error("suppressions must be an array");n.suppressions=t.suppressions.map((s,a)=>{let c=nt(s,`suppressions[${a}]`);for(let l of["rule","urlPattern","reason"])if(typeof c[l]!="string"||c[l]==="")throw new Error(`suppressions[${a}].${l} must be a non-empty string`);if(c.expiresAt!==void 0&&!/^\d{4}-\d{2}-\d{2}$/.test(String(c.expiresAt)))throw new Error(`suppressions[${a}].expiresAt must use YYYY-MM-DD`);return c})}if(t.regressionBudgets!==void 0){let s=nt(t.regressionBudgets,"regressionBudgets");n.regressionBudgets=Object.fromEntries(Object.entries(s).map(([a,c])=>[a,_e(c,`regressionBudgets.${a}`,0)]))}if(t.report!==void 0){let s=nt(t.report,"report"),a={},c=st(s.agencyName,"report.agencyName"),l=st(s.logo,"report.logo"),o=st(s.primaryColor,"report.primaryColor");if(c!==void 0&&(a.agencyName=c),l!==void 0&&(a.logo=l),o!==void 0&&(a.primaryColor=o),a.primaryColor&&!/^#[0-9a-f]{6}$/i.test(a.primaryColor))throw new Error("report.primaryColor must be a six-digit hex color");n.report=Object.fromEntries(Object.entries(a).filter(([,A])=>A!==void 0))}return n}function ge(e,t={},r={}){return{...{...Gn,...r,...t,...e},schemaVersion:1,severityOverrides:{...r.severityOverrides??{},...t.severityOverrides??{},...e.severityOverrides??{}},regressionBudgets:{...r.regressionBudgets??{},...t.regressionBudgets??{},...e.regressionBudgets??{}},report:{...r.report??{},...t.report??{},...e.report??{}},suppressions:e.suppressions??t.suppressions??r.suppressions??[]}}function vt(){}var Pt=Object.freeze({debug:vt,info:vt,warn:vt,error:vt});import{setTimeout as Sa}from"node:timers/promises";function _a(e=0,{now:t=Date.now,wait:r=Sa}={}){let n=Math.max(0,e),s=0,a=Promise.resolve();return function(){if(n===0)return Promise.resolve();let l=a.then(async()=>{let o=Math.max(0,s-t());o>0&&await r(o),s=t()+n});return a=l.catch(()=>{}),l}}function Fe(e=0,t=_a){let r=new Map;return n=>{let s=new URL(n).origin,a=r.get(s);return a||(a=t(e),r.set(s,a)),a()}}import{createHash as ka}from"node:crypto";import{setTimeout as Kn}from"node:timers/promises";var pe=class extends Error{redirectChain;constructor(t,r=[],n){super(t,n),this.name="RequestFailure",this.redirectChain=r}};function xa(e){return e===429||e===500||e===502||e===503||e===504}function Ra(e,t=Date.now()){if(!e)return null;let r=Number(e);if(Number.isFinite(r)&&r>=0)return Math.min(r*1e3,3e4);let n=Date.parse(e);return Number.isNaN(n)?null:Math.min(Math.max(0,n-t),3e4)}function La(e,t){let r=AbortSignal.timeout(e);return t?AbortSignal.any([t,r]):r}async function Oa(e,t,r){let n=[],s=new Set([e]),a=e;for(;;){r.signal?.throwIfAborted(),await r.gate?.(a);let c=await r.fetch(a,{...t,redirect:"manual",signal:La(r.timeout,r.signal)}),l=c.headers.get("location");if(c.status<300||c.status>=400||!l)return{response:c,redirectChain:n};let o=new URL(l,a).href;if(n.push({url:a,status:c.status,location:o}),await c.body?.cancel(),s.has(o))throw new pe(`redirect loop detected at ${o}`,n);if(n.length>r.maxRedirects)throw new pe(`redirect limit of ${r.maxRedirects} exceeded`,n);s.add(o),a=o}}async function xe(e,t,r){let n;for(let s=0;s<=r.retries;s+=1)try{let a=await Oa(e,t,r);if(!xa(a.response.status)||s===r.retries)return a;let c=Ra(a.response.headers.get("retry-after"));await a.response.body?.cancel();let l=Math.floor((r.random??Math.random)()*100),o=c??Math.min(250*2**s+l,3e4);await r.onEvent?.({type:"retry",url:e,attempt:s+1,delayMs:o}),await Kn(o,void 0,{signal:r.signal})}catch(a){if(r.signal?.aborted)throw r.signal.reason??a;if(n=a,a instanceof pe||s===r.retries)break;let c=Math.floor((r.random??Math.random)()*100),l=Math.min(250*2**s+c,3e4);await r.onEvent?.({type:"retry",url:e,attempt:s+1,delayMs:l}),await Kn(l,void 0,{signal:r.signal})}throw n instanceof pe?n:new pe(n instanceof Error?n.message:String(n),[],{cause:n})}async function Re(e,t){if(!e.body)return{text:"",bytes:0,buffer:Buffer.alloc(0)};let r=e.body.getReader(),n=[],s=0;for(;;){let{done:c,value:l}=await r.read();if(c)break;if(s+=l.byteLength,s>t)throw await r.cancel(),new pe(`response exceeds ${t} bytes`);n.push(Buffer.from(l))}let a=Buffer.concat(n);return{text:a.toString("utf8"),bytes:s,buffer:a}}function Da(e,t){if(!t)return!1;let r=t.endsWith("$"),s=(r?t.slice(0,-1):t).replace(/[.+?^${}()|[\]\\]/g,"\\$&").replaceAll("*",".*");return new RegExp(`^${s}${r?"$":""}`).test(e)}function Ba(e,t){let r=[],n=null;for(let l of e.replace(/^\uFEFF/,"").split(/\r?\n/)){let o=l.replace(/#.*$/,"").trim(),A=o.indexOf(":");if(!o||A<0)continue;let u=o.slice(0,A).trim().toLowerCase(),m=o.slice(A+1).trim();if(u==="user-agent"){(!n||n.hasRules)&&(n={agents:[],rules:[],hasRules:!1},r.push(n)),m&&n.agents.push(m.toLowerCase());continue}n&&(u==="allow"||u==="disallow")&&m&&(n.rules.push({type:u,path:m}),n.hasRules=!0)}let s=t.toLowerCase(),a=r.filter(l=>l.agents.some(o=>o!=="*"&&s.includes(o)));return(a.length>0?a:r.filter(l=>l.agents.includes("*"))).flatMap(l=>l.rules)}function Wn(e,t){if(t.denyAll)return!1;let r=new URL(e),n=`${r.pathname}${r.search}`,s=(t.rules??[]).filter(a=>Da(n,a.path)).sort((a,c)=>c.path.length-a.path.length||(a.type==="allow"?-1:1));return s.length===0||s[0]?.type==="allow"}async function Mt(e,t){let r=new URL("/robots.txt",e).href;try{let{response:n}=await xe(r,{headers:{accept:"text/plain,*/*;q=0.1","user-agent":t.userAgent}},{fetch:t.fetch,timeout:t.timeout,maxRedirects:t.maxRedirects,retries:t.retries,signal:t.signal,gate:t.requestGate,onEvent:t.onEvent}),{text:s}=await Re(n,va);return{url:r,status:n.status,body:s,sha256:ka("sha256").update(s).digest("hex"),rules:n.ok?Ba(s,t.userAgent):[],denyAll:n.status===401||n.status===403,error:null}}catch(n){if(t.signal?.aborted)throw n;return{url:r,status:null,body:"",sha256:null,rules:[],denyAll:!1,error:n instanceof Error?n.message:String(n)}}}var va=512*1024;import{gunzipSync as zo}from"node:zlib";var Jn=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",Pa=Jn+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",Ma="["+Jn+"]["+Pa+"]*",Fa=new RegExp("^"+Ma+"$");function Ft(e,t){let r=[],n=t.exec(e);for(;n;){let s=[];s.startIndex=t.lastIndex-n[0].length;let a=n.length;for(let c=0;c<a;c++)s.push(n[c]);r.push(s),n=t.exec(e)}return r}var Pr=function(e){let t=Fa.exec(e);return!(t===null||typeof t>"u")};function jn(e){return typeof e<"u"}var it=["hasOwnProperty","toString","valueOf","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"],Ut=["__proto__","constructor","prototype"];var Ua={allowBooleanAttributes:!1,unpairedTags:[]};function Ht(e,t){t=Object.assign({},Ua,t);let r=[],n=!1,s=!1;e[0]==="\uFEFF"&&(e=e.substr(1));for(let a=0;a<e.length;a++)if(e[a]==="<"&&e[a+1]==="?"){if(a+=2,a=Xn(e,a),a.err)return a}else if(e[a]==="<"){let c=a;if(a++,e[a]==="!"){a=Zn(e,a);continue}else{let l=!1;e[a]==="/"&&(l=!0,a++);let o="";for(;a<e.length&&e[a]!==">"&&e[a]!==" "&&e[a]!==" "&&e[a]!==`
|
|
5
|
-
`&&e[a]!=="\r";a++)o+=e[a];if(o=o.trim(),o[o.length-1]==="/"&&(o=o.substring(0,o.length-1),a--),!
|
|
6
|
-
`||e==="\r"}function Xn(e,t){let r=t;for(;t<e.length;t++)if(e[t]=="?"||e[t]==" "){let n=e.substr(r,t-r);if(t>5&&n==="xml")return H("InvalidXml","XML declaration allowed only at the start of the document.",X(e,t));if(e[t]=="?"&&e[t+1]==">"){t++;break}else continue}return t}function Zn(e,t){if(e.length>t+5&&e[t+1]==="-"&&e[t+2]==="-"){for(t+=3;t<e.length;t++)if(e[t]==="-"&&e[t+1]==="-"&&e[t+2]===">"){t+=2;break}}else if(e.length>t+8&&e[t+1]==="D"&&e[t+2]==="O"&&e[t+3]==="C"&&e[t+4]==="T"&&e[t+5]==="Y"&&e[t+6]==="P"&&e[t+7]==="E"){let r=1;for(t+=8;t<e.length;t++)if(e[t]==="<")r++;else if(e[t]===">"&&(r--,r===0))break}else if(e.length>t+9&&e[t+1]==="["&&e[t+2]==="C"&&e[t+3]==="D"&&e[t+4]==="A"&&e[t+5]==="T"&&e[t+6]==="A"&&e[t+7]==="["){for(t+=8;t<e.length;t++)if(e[t]==="]"&&e[t+1]==="]"&&e[t+2]===">"){t+=2;break}}return t}var Ha='"',Qa="'";function Ya(e,t){let r="",n="",s=!1;for(;t<e.length;t++){if(e[t]===Ha||e[t]===Qa)n===""?n=e[t]:n!==e[t]||(n="");else if(e[t]===">"&&n===""){s=!0;break}r+=e[t]}return n!==""?!1:{value:r,index:t,tagClosed:s}}var Ga=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function $n(e,t){let r=Ft(e,Ga),n={};for(let s=0;s<r.length;s++){if(r[s][1].length===0)return H("InvalidAttr","Attribute '"+r[s][2]+"' has no space in starting.",at(r[s]));if(r[s][3]!==void 0&&r[s][4]===void 0)return H("InvalidAttr","Attribute '"+r[s][2]+"' is without value.",at(r[s]));if(r[s][3]===void 0&&!t.allowBooleanAttributes)return H("InvalidAttr","boolean attribute '"+r[s][2]+"' is not allowed.",at(r[s]));let a=r[s][2];if(!Ja(a))return H("InvalidAttr","Attribute '"+a+"' is an invalid name.",at(r[s]));if(!Object.prototype.hasOwnProperty.call(n,a))n[a]=1;else return H("InvalidAttr","Attribute '"+a+"' is repeated.",at(r[s]))}return!0}function Ka(e,t){let r=/\d/;for(e[t]==="x"&&(t++,r=/[\da-fA-F]/);t<e.length;t++){if(e[t]===";")return t;if(!e[t].match(r))break}return-1}function Wa(e,t){if(t++,e[t]===";")return-1;if(e[t]==="#")return t++,Ka(e,t);let r=0;for(;t<e.length;t++,r++)if(!(e[t].match(/\w/)&&r<20)){if(e[t]===";")break;return-1}return t}function H(e,t,r){return{err:{code:e,msg:t,line:r.line||r,col:r.col}}}function Ja(e){return Pr(e)}function ja(e){return Pr(e)}function X(e,t){let r=e.substring(0,t).split(/\r?\n/);return{line:r.length,col:r[r.length-1].length+1}}function at(e){return e.startIndex+e[1].length}var Mr={cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",euro:"\u20AC",dollar:"$",fnof:"\u0192",inr:"\u20B9",af:"\u060B",birr:"\u1265\u122D",peso:"\u20B1",rub:"\u20BD",won:"\u20A9",yuan:"\xA5",cedil:"\xB8"};var ot={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'},Fr={nbsp:"\xA0",copy:"\xA9",reg:"\xAE",trade:"\u2122",mdash:"\u2014",ndash:"\u2013",hellip:"\u2026",laquo:"\xAB",raquo:"\xBB",lsquo:"\u2018",rsquo:"\u2019",ldquo:"\u201C",rdquo:"\u201D",bull:"\u2022",para:"\xB6",sect:"\xA7",deg:"\xB0",frac12:"\xBD",frac14:"\xBC",frac34:"\xBE"};var Ue=Object.freeze({ALLOW:"allow",BLOCK:"block",THROW:"throw"}),Va=new Set("!?\\\\/[]$%{}^&*()<>|+");function qn(e){if(e[0]==="#")throw new Error(`[EntityReplacer] Invalid character '#' in entity name: "${e}"`);for(let t of e)if(Va.has(t))throw new Error(`[EntityReplacer] Invalid character '${t}' in entity name: "${e}"`);return e}function ct(...e){let t=Object.create(null);for(let r of e)if(r)for(let n of Object.keys(r)){let s=r[n];if(typeof s=="string")t[n]=s;else if(s&&typeof s=="object"&&s.val!==void 0){let a=s.val;typeof a=="string"&&(t[n]=a)}}return t}var Le="external",Qt="base",Ur="all";function Xa(e){return!e||e===Le?new Set([Le]):e===Ur?new Set([Ur]):e===Qt?new Set([Qt]):Array.isArray(e)?new Set(e):new Set([Le])}var z=Object.freeze({allow:0,leave:1,remove:2,throw:3}),Za=new Set([9,10,13]);function $a(e){if(!e)return{xmlVersion:1,onLevel:z.allow,nullLevel:z.remove};let t=e.xmlVersion===1.1?1.1:1,r=z[e.onNCR]??z.allow,n=z[e.nullNCR]??z.remove,s=Math.max(n,z.remove);return{xmlVersion:t,onLevel:r,nullLevel:s}}var He=class{constructor(t={}){this._limit=t.limit||{},this._maxTotalExpansions=this._limit.maxTotalExpansions||0,this._maxExpandedLength=this._limit.maxExpandedLength||0,this._postCheck=typeof t.postCheck=="function"?t.postCheck:n=>n,this._limitTiers=Xa(this._limit.applyLimitsTo??Le),this._numericAllowed=t.numericAllowed??!0,this._baseMap=ct(ot,t.namedEntities||null),this._externalMap=Object.create(null),this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this._removeSet=new Set(t.remove&&Array.isArray(t.remove)?t.remove:[]),this._leaveSet=new Set(t.leave&&Array.isArray(t.leave)?t.leave:[]);let r=$a(t.ncr);this._ncrXmlVersion=r.xmlVersion,this._ncrOnLevel=r.onLevel,this._ncrNullLevel=r.nullLevel,this._onExternalEntity=typeof t.onExternalEntity=="function"?t.onExternalEntity:null,this._onInputEntity=typeof t.onInputEntity=="function"?t.onInputEntity:null}_applyRegistrationHook(t,r,n,s){if(!t)return!0;let a=t(r,n);if(a===Ue.BLOCK)return!1;if(a===Ue.THROW)throw new Error(`[EntityDecoder] Registration of ${s} entity "&${r};" was rejected by hook`);return!0}setExternalEntities(t){if(t)for(let s of Object.keys(t))qn(s);if(!this._onExternalEntity){this._externalMap=ct(t);return}let r=ct(t),n=Object.create(null);for(let[s,a]of Object.entries(r))this._applyRegistrationHook(this._onExternalEntity,s,a,"external")&&(n[s]=a);this._externalMap=n}addExternalEntity(t,r){qn(t),typeof r=="string"&&r.indexOf("&")===-1&&this._applyRegistrationHook(this._onExternalEntity,t,r,"external")&&(this._externalMap[t]=r)}addInputEntities(t){if(this._totalExpansions=0,this._expandedLength=0,!this._onInputEntity){this._inputMap=ct(t);return}let r=ct(t),n=Object.create(null);for(let[s,a]of Object.entries(r))this._applyRegistrationHook(this._onInputEntity,s,a,"input")&&(n[s]=a);this._inputMap=n}reset(){return this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this}setXmlVersion(t){this._ncrXmlVersion=t===1.1?1.1:1}decode(t){if(typeof t!="string"||t.length===0||t.indexOf("&")===-1)return t;let r=t,n=[],s=t.length,a=0,c=0,l=this._maxTotalExpansions>0,o=this._maxExpandedLength>0,A=l||o;for(;c<s;){if(t.charCodeAt(c)!==38){c++;continue}let m=c+1;for(;m<s&&t.charCodeAt(m)!==59&&m-c<=32;)m++;if(m>=s||t.charCodeAt(m)!==59){c++;continue}let T=t.slice(c+1,m);if(T.length===0){c++;continue}let f,y;if(this._removeSet.has(T))f="",y===void 0&&(y=Le);else if(this._leaveSet.has(T)){c++;continue}else if(T.charCodeAt(0)===35){let w=this._resolveNCR(T);if(w===void 0){c++;continue}f=w,y=Qt}else{let w=this._resolveName(T);f=w?.value,y=w?.tier}if(f===void 0){c++;continue}if(c>a&&n.push(t.slice(a,c)),n.push(f),a=m+1,c=a,A&&this._tierCounts(y)){if(l&&(this._totalExpansions++,this._totalExpansions>this._maxTotalExpansions))throw new Error(`[EntityReplacer] Entity expansion count limit exceeded: ${this._totalExpansions} > ${this._maxTotalExpansions}`);if(o){let w=f.length-(T.length+2);if(w>0&&(this._expandedLength+=w,this._expandedLength>this._maxExpandedLength))throw new Error(`[EntityReplacer] Expanded content length limit exceeded: ${this._expandedLength} > ${this._maxExpandedLength}`)}}}a<s&&n.push(t.slice(a));let u=n.length===0?t:n.join("");return this._postCheck(u,r)}_tierCounts(t){return this._limitTiers.has(Ur)?!0:this._limitTiers.has(t)}_resolveName(t){if(t in this._inputMap)return{value:this._inputMap[t],tier:Le};if(t in this._externalMap)return{value:this._externalMap[t],tier:Le};if(t in this._baseMap)return{value:this._baseMap[t],tier:Qt}}_classifyNCR(t){return t===0?this._ncrNullLevel:t>=55296&&t<=57343||this._ncrXmlVersion===1&&t>=1&&t<=31&&!Za.has(t)?z.remove:-1}_applyNCRAction(t,r,n){switch(t){case z.allow:return String.fromCodePoint(n);case z.remove:return"";case z.leave:return;case z.throw:throw new Error(`[EntityDecoder] Prohibited numeric character reference &${r}; (U+${n.toString(16).toUpperCase().padStart(4,"0")})`);default:return String.fromCodePoint(n)}}_resolveNCR(t){let r=t.charCodeAt(1),n;if(r===120||r===88?n=parseInt(t.slice(2),16):n=parseInt(t.slice(1),10),Number.isNaN(n)||n<0||n>1114111)return;let s=this._classifyNCR(n);if(!this._numericAllowed&&s<z.remove)return;let a=s===-1?this._ncrOnLevel:Math.max(this._ncrOnLevel,s);return this._applyNCRAction(a,t,n)}};var zn=e=>it.includes(e)?"__"+e:e,qa={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0,unicode:!1},tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,entityDecoder:null,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,r){return e},captureMetaData:!1,maxNestedTags:100,strictReservedNames:!0,jPath:!0,onDangerousProperty:zn};function za(e,t){if(typeof e!="string")return;let r=e.toLowerCase();if(it.some(n=>r===n.toLowerCase()))throw new Error(`[SECURITY] Invalid ${t}: "${e}" is a reserved JavaScript keyword that could cause prototype pollution`);if(Ut.some(n=>r===n.toLowerCase()))throw new Error(`[SECURITY] Invalid ${t}: "${e}" is a reserved JavaScript keyword that could cause prototype pollution`)}function es(e,t){return typeof e=="boolean"?{enabled:e,maxEntitySize:1e4,maxExpansionDepth:1e4,maxTotalExpansions:1/0,maxExpandedLength:1e5,maxEntityCount:1e3,allowedTags:null,tagFilter:null,appliesTo:"all"}:typeof e=="object"&&e!==null?{enabled:e.enabled!==!1,maxEntitySize:Math.max(1,e.maxEntitySize??1e4),maxExpansionDepth:Math.max(1,e.maxExpansionDepth??1e4),maxTotalExpansions:Math.max(1,e.maxTotalExpansions??1/0),maxExpandedLength:Math.max(1,e.maxExpandedLength??1e5),maxEntityCount:Math.max(1,e.maxEntityCount??1e3),allowedTags:e.allowedTags??null,tagFilter:e.tagFilter??null,appliesTo:e.appliesTo??"all"}:es(!0)}var ts=function(e){let t=Object.assign({},qa,e),r=[{value:t.attributeNamePrefix,name:"attributeNamePrefix"},{value:t.attributesGroupName,name:"attributesGroupName"},{value:t.textNodeName,name:"textNodeName"},{value:t.cdataPropName,name:"cdataPropName"},{value:t.commentPropName,name:"commentPropName"}];for(let{value:n,name:s}of r)n&&za(n,s);return t.onDangerousProperty===null&&(t.onDangerousProperty=zn),t.processEntities=es(t.processEntities,t.htmlEntities),t.unpairedTagsSet=new Set(t.unpairedTags),t.stopNodes&&Array.isArray(t.stopNodes)&&(t.stopNodes=t.stopNodes.map(n=>typeof n=="string"&&n.startsWith("*.")?".."+n.substring(2):n)),t};var Yt;typeof Symbol!="function"?Yt="@@xmlMetadata":Yt=Symbol("XML Node Metadata");var ee=class{constructor(t){this.tagname=t,this.child=[],this[":@"]=Object.create(null)}add(t,r){t==="__proto__"&&(t="#__proto__"),this.child.push({[t]:r})}addChild(t,r){t.tagname==="__proto__"&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child}),r!==void 0&&(this.child[this.child.length-1][Yt]={startIndex:r})}static getMetaDataSymbol(){return Yt}};var rs=":A-Za-z_\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u0486\u0488-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD",eo=rs+"\\-\\.\\d\xB7\u0300-\u036F\u203F-\u2040",ns=":A-Za-z_\xC0-\u02FF\u0370-\u037D\u037F-\u0486\u0488-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}",to=ns+"\\-\\.\\d\xB7\u0300-\u036F\u0487\u203F-\u2040",Hr=(e,t,r="")=>{let n=e.replace(":",""),s=t.replace(":",""),a=`[${n}][${s}]*`;return{name:new RegExp(`^[${e}][${t}]*$`,r),ncName:new RegExp(`^${a}$`,r),qName:new RegExp(`^${a}(?::${a})?$`,r),nmToken:new RegExp(`^[${t}]+$`,r),nmTokens:new RegExp(`^[${t}]+(?:\\s+[${t}]+)*$`,r)}},ro=Hr(rs,eo),no=Hr(ns,to,"u"),ss=":A-Za-z_",so=ss+"\\-\\.\\d",io=Hr(ss,so),ao=(e="1.0",t=!1)=>t?io:e==="1.1"?no:ro;var Qr=(e,{xmlVersion:t="1.0",asciiOnly:r=!1}={})=>ao(t,r).qName.test(e);var At=class{constructor(t,r){this.suppressValidationErr=!t,this.options=t,this.xmlVersion=r||1}setXmlVersion(t=1){this.xmlVersion=t}readDocType(t,r){let n=Object.create(null),s=0;if(t[r+3]==="O"&&t[r+4]==="C"&&t[r+5]==="T"&&t[r+6]==="Y"&&t[r+7]==="P"&&t[r+8]==="E"){r=r+9;let a=1,c=!1,l=!1,o="";for(;r<t.length;r++)if(t[r]==="<"&&!l){if(c&&Oe(t,"!ENTITY",r)){r+=7;let A,u;if([A,u,r]=this.readEntityExp(t,r+1,this.suppressValidationErr),u.indexOf("&")===-1){if(this.options.enabled!==!1&&this.options.maxEntityCount!=null&&s>=this.options.maxEntityCount)throw new Error(`Entity count (${s+1}) exceeds maximum allowed (${this.options.maxEntityCount})`);n[A]=u,s++}}else if(c&&Oe(t,"!ELEMENT",r)){r+=8;let{index:A}=this.readElementExp(t,r+1);r=A}else if(c&&Oe(t,"!ATTLIST",r))r+=8;else if(c&&Oe(t,"!NOTATION",r)){r+=9;let{index:A}=this.readNotationExp(t,r+1,this.suppressValidationErr);r=A}else if(Oe(t,"!--",r))l=!0;else throw new Error("Invalid DOCTYPE");a++,o=""}else if(t[r]===">"){if(l?t[r-1]==="-"&&t[r-2]==="-"&&(l=!1,a--):a--,a===0)break}else t[r]==="["?c=!0:o+=t[r];if(a!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:n,i:r}}readEntityExp(t,r){r=te(t,r);let n=r;for(;r<t.length&&!/\s/.test(t[r])&&t[r]!=='"'&&t[r]!=="'";)r++;let s=t.substring(n,r);if(lt(s,{xmlVersion:this.xmlVersion}),r=te(t,r),!this.suppressValidationErr){if(t.substring(r,r+6).toUpperCase()==="SYSTEM")throw new Error("External entities are not supported");if(t[r]==="%")throw new Error("Parameter entities are not supported")}let a="";if([r,a]=this.readIdentifierVal(t,r,"entity"),this.options.enabled!==!1&&this.options.maxEntitySize!=null&&a.length>this.options.maxEntitySize)throw new Error(`Entity "${s}" size (${a.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`);return r--,[s,a,r]}readNotationExp(t,r){r=te(t,r);let n=r;for(;r<t.length&&!/\s/.test(t[r]);)r++;let s=t.substring(n,r);!this.suppressValidationErr&<(s,{xmlVersion:this.xmlVersion}),r=te(t,r);let a=t.substring(r,r+6).toUpperCase();if(!this.suppressValidationErr&&a!=="SYSTEM"&&a!=="PUBLIC")throw new Error(`Expected SYSTEM or PUBLIC, found "${a}"`);r+=a.length,r=te(t,r);let c=null,l=null;if(a==="PUBLIC")[r,c]=this.readIdentifierVal(t,r,"publicIdentifier"),r=te(t,r),(t[r]==='"'||t[r]==="'")&&([r,l]=this.readIdentifierVal(t,r,"systemIdentifier"));else if(a==="SYSTEM"&&([r,l]=this.readIdentifierVal(t,r,"systemIdentifier"),!this.suppressValidationErr&&!l))throw new Error("Missing mandatory system identifier for SYSTEM notation");return{notationName:s,publicIdentifier:c,systemIdentifier:l,index:--r}}readIdentifierVal(t,r,n){let s="",a=t[r];if(a!=='"'&&a!=="'")throw new Error(`Expected quoted string, found "${a}"`);r++;let c=r;for(;r<t.length&&t[r]!==a;)r++;if(s=t.substring(c,r),t[r]!==a)throw new Error(`Unterminated ${n} value`);return r++,[r,s]}readElementExp(t,r){r=te(t,r);let n=r;for(;r<t.length&&!/\s/.test(t[r]);)r++;let s=t.substring(n,r);if(!this.suppressValidationErr&&!Qr(s,{xmlVersion:this.xmlVersion}))throw new Error(`Invalid element name: "${s}"`);r=te(t,r);let a="";if(t[r]==="E"&&Oe(t,"MPTY",r))r+=4;else if(t[r]==="A"&&Oe(t,"NY",r))r+=2;else if(t[r]==="("){r++;let c=r;for(;r<t.length&&t[r]!==")";)r++;if(a=t.substring(c,r),t[r]!==")")throw new Error("Unterminated content model")}else if(!this.suppressValidationErr)throw new Error(`Invalid Element Expression, found "${t[r]}"`);return{elementName:s,contentModel:a.trim(),index:r}}readAttlistExp(t,r){r=te(t,r);let n=r;for(;r<t.length&&!/\s/.test(t[r]);)r++;let s=t.substring(n,r);for(lt(s,{xmlVersion:this.xmlVersion}),r=te(t,r),n=r;r<t.length&&!/\s/.test(t[r]);)r++;let a=t.substring(n,r);if(!lt(a,{xmlVersion:this.xmlVersion}))throw new Error(`Invalid attribute name: "${a}"`);r=te(t,r);let c="";if(t.substring(r,r+8).toUpperCase()==="NOTATION"){if(c="NOTATION",r+=8,r=te(t,r),t[r]!=="(")throw new Error(`Expected '(', found "${t[r]}"`);r++;let o=[];for(;r<t.length&&t[r]!==")";){let A=r;for(;r<t.length&&t[r]!=="|"&&t[r]!==")";)r++;let u=t.substring(A,r);if(u=u.trim(),!lt(u,{xmlVersion:this.xmlVersion}))throw new Error(`Invalid notation name: "${u}"`);o.push(u),t[r]==="|"&&(r++,r=te(t,r))}if(t[r]!==")")throw new Error("Unterminated list of notations");r++,c+=" ("+o.join("|")+")"}else{let o=r;for(;r<t.length&&!/\s/.test(t[r]);)r++;c+=t.substring(o,r);let A=["CDATA","ID","IDREF","IDREFS","ENTITY","ENTITIES","NMTOKEN","NMTOKENS"];if(!this.suppressValidationErr&&!A.includes(c.toUpperCase()))throw new Error(`Invalid attribute type: "${c}"`)}r=te(t,r);let l="";return t.substring(r,r+8).toUpperCase()==="#REQUIRED"?(l="#REQUIRED",r+=8):t.substring(r,r+7).toUpperCase()==="#IMPLIED"?(l="#IMPLIED",r+=7):[r,l]=this.readIdentifierVal(t,r,"ATTLIST"),{elementName:s,attributeName:a,attributeType:c,defaultValue:l,index:r}}},te=(e,t)=>{for(;t<e.length&&/\s/.test(e[t]);)t++;return t};function Oe(e,t,r){for(let n=0;n<t.length;n++)if(t[n]!==e[r+n+1])return!1;return!0}function lt(e,t){if(Qr(e,{xmlVersion:t}))return e;throw new Error(`Invalid entity name ${e}`)}var oo=[48,1632,1776,2406,2534,2662,2790,2918,3046,3174,3302,3430,3558,3664,3792,3872,4160,4240,6112,6160,6470,6608,6784,6800,6992,7088,7232,7248,65296,120782,120792,120802,120812,120822,66720,68912,69734,69872,69942,70096,70384,70736,70864,71248,71360,71472,71904,72016,72688,72784,73040,73120,73552,92768,92864,93008,123200,123632,124144,125264,130032],Gt=255,Kt=new Map,is=65535,as=1632,Qe=as,co=is-as+1,Wt=new Uint8Array(co).fill(Gt);for(let e of oo)for(let t=0;t<10;t++){let r=e+t;r<=is?Wt[r-Qe]=t:Kt.set(r,t)}var os=48,cs=57,ls=45,Jt=new Set([8722,65293,65123]);function lo(e){if(typeof e!="string")return e;let t=e.length;if(t===0)return e;let r=-1;for(let s=0;s<t;s++){let a=e.charCodeAt(s);if(!(a>=os&&a<=cs||a===ls)){if(a<Qe){if(Jt.has(a)){r=s;break}continue}if(a>=55296&&a<=56319){if(s+1<t){let c=e.charCodeAt(s+1);if(c>=56320&&c<=57343){let l=65536+(a-55296<<10)+(c-56320);if(Kt.has(l)){r=s;break}}}continue}if(Wt[a-Qe]!==Gt||Jt.has(a)){r=s;break}}}if(r===-1)return e;let n=[];r>0&&n.push(e.slice(0,r));for(let s=r;s<t;s++){let a=e.charCodeAt(s);if(a>=os&&a<=cs||a===ls){n.push(e[s]);continue}if(a<Qe){n.push(Jt.has(a)?"-":e[s]);continue}if(a>=55296&&a<=56319){if(s+1<t){let l=e.charCodeAt(s+1);if(l>=56320&&l<=57343){let o=65536+(a-55296<<10)+(l-56320),A=Kt.get(o);if(A!==void 0){n.push(String.fromCharCode(A+48)),s++;continue}}}n.push(e[s]);continue}if(Jt.has(a)){n.push("-");continue}let c=Wt[a-Qe];n.push(c!==Gt?String.fromCharCode(c+48):e[s])}return n.join("")}var As=lo;var Ao=/^[-+]?0x[a-fA-F0-9]+$/,uo=/^0b[01]+$/,ho=/^0o[0-7]+$/,po=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,mo={hex:!0,binary:!1,octal:!1,leadingZeros:!0,decimalPoint:".",eNotation:!0,infinity:"original",unicode:!1};function Gr(e,t={}){if(t=Object.assign({},mo,t),!e||typeof e!="string")return e;let r=e.trim();if(r.length===0)return e;if(t.skipLike!==void 0&&t.skipLike.test(r))return e;if(r==="0"||t.unicode&&(r=As(r),r==="0"))return 0;if(t.hex&&Ao.test(r))return Yr(r,16);if(t.binary&&uo.test(r))return Yr(r,2);if(t.octal&&ho.test(r))return Yr(r,8);if(isFinite(r)){if(r.includes("e")||r.includes("E"))return fo(e,r,t);{let n=po.exec(r);if(n){let s=n[1]||"",a=n[2],c=Eo(n[3]),l=s?e[a.length+1]===".":e[a.length]===".";if(!t.leadingZeros&&(a.length>1||a.length===1&&!l))return e;{let o=Number(r),A=String(o);if(o===0)return o;if(A.search(/[eE]/)!==-1)return t.eNotation?o:e;if(r.indexOf(".")!==-1)return A==="0"||A===c||A===`${s}${c}`?o:e;let u=a?c:r;return a?u===A||s+u===A?o:e:u===A||u===s+A?o:e}}else return e}}else return To(e,Number(r),t)}var go=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function fo(e,t,r){if(!r.eNotation)return e;let n=t.match(go);if(n){let s=n[1]||"",a=n[3].indexOf("e")===-1?"E":"e",c=n[2],l=s?e[c.length+1]===a:e[c.length]===a;return c.length>1&&l?e:c.length===1&&(n[3].startsWith(`.${a}`)||n[3][0]===a)?Number(t):c.length>0?r.leadingZeros&&!l?(t=(n[1]||"")+n[3],Number(t)):e:Number(t)}else return e}function Eo(e){return e&&e.indexOf(".")!==-1&&(e=e.replace(/0+$/,""),e==="."?e="0":e[0]==="."?e="0"+e:e[e.length-1]==="."&&(e=e.substring(0,e.length-1))),e}function Yr(e,t){let r=e.trim();if((t===2||t===8)&&(e=r.substring(2)),parseInt)return parseInt(e,t);if(Number.parseInt)return Number.parseInt(e,t);if(window&&window.parseInt)return window.parseInt(e,t);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}function To(e,t,r){let n=t===1/0;switch(r.infinity.toLowerCase()){case"null":return null;case"infinity":return t;case"string":return n?"Infinity":"-Infinity";case"original":default:return e}}function Kr(e){return typeof e=="function"?e:Array.isArray(e)?t=>{for(let r of e)if(typeof r=="string"&&t===r||r instanceof RegExp&&r.test(t))return!0}:()=>!1}var De=class{constructor(t,r={},n){this.pattern=t,this.separator=r.separator||".",this.segments=this._parse(t),this.data=n,this._hasDeepWildcard=this.segments.some(s=>s.type==="deep-wildcard"),this._hasAttributeCondition=this.segments.some(s=>s.attrName!==void 0),this._hasPositionSelector=this.segments.some(s=>s.position!==void 0)}_parse(t){let r=[],n=0,s="";for(;n<t.length;)t[n]===this.separator?n+1<t.length&&t[n+1]===this.separator?(s.trim()&&(r.push(this._parseSegment(s.trim())),s=""),r.push({type:"deep-wildcard"}),n+=2):(s.trim()&&r.push(this._parseSegment(s.trim())),s="",n++):(s+=t[n],n++);return s.trim()&&r.push(this._parseSegment(s.trim())),r}_parseSegment(t){let r={type:"tag"},n=null,s=t,a=t.match(/^([^\[]+)(\[[^\]]*\])(.*)$/);if(a&&(s=a[1]+a[3],a[2])){let u=a[2].slice(1,-1);u&&(n=u)}let c,l=s;if(s.includes("::")){let u=s.indexOf("::");if(c=s.substring(0,u).trim(),l=s.substring(u+2).trim(),!c)throw new Error(`Invalid namespace in pattern: ${t}`)}let o,A=null;if(l.includes(":")){let u=l.lastIndexOf(":"),m=l.substring(0,u).trim(),T=l.substring(u+1).trim();["first","last","odd","even"].includes(T)||/^nth\(\d+\)$/.test(T)?(o=m,A=T):o=l}else o=l;if(!o)throw new Error(`Invalid segment pattern: ${t}`);if(r.tag=o,c&&(r.namespace=c),n)if(n.includes("=")){let u=n.indexOf("=");r.attrName=n.substring(0,u).trim(),r.attrValue=n.substring(u+1).trim()}else r.attrName=n.trim();if(A){let u=A.match(/^nth\((\d+)\)$/);u?(r.position="nth",r.positionValue=parseInt(u[1],10)):r.position=A}return r}get length(){return this.segments.length}hasDeepWildcard(){return this._hasDeepWildcard}hasAttributeCondition(){return this._hasAttributeCondition}hasPositionSelector(){return this._hasPositionSelector}toString(){return this.pattern}};var Ye=class{constructor(){this._byDepthAndTag=new Map,this._wildcardByDepth=new Map,this._deepWildcards=[],this._deepByTerminalTag=new Map,this._patterns=new Set,this._sealed=!1}add(t){if(this._sealed)throw new TypeError("ExpressionSet is sealed. Create a new ExpressionSet to add more expressions.");if(this._patterns.has(t.pattern))return this;if(this._patterns.add(t.pattern),t.hasDeepWildcard()){let a=t.segments[t.segments.length-1];if(a&&a.type!=="deep-wildcard"&&a.tag!=="*"){let c=a.tag;this._deepByTerminalTag.has(c)||this._deepByTerminalTag.set(c,[]),this._deepByTerminalTag.get(c).push(t)}else this._deepWildcards.push(t);return this}let r=t.length,s=t.segments[t.segments.length-1]?.tag;if(!s||s==="*")this._wildcardByDepth.has(r)||this._wildcardByDepth.set(r,[]),this._wildcardByDepth.get(r).push(t);else{let a=`${r}:${s}`;this._byDepthAndTag.has(a)||this._byDepthAndTag.set(a,[]),this._byDepthAndTag.get(a).push(t)}return this}addAll(t){for(let r of t)this.add(r);return this}has(t){return this._patterns.has(t.pattern)}get size(){return this._patterns.size}seal(){return this._sealed=!0,this}get isSealed(){return this._sealed}matchesAny(t){return this.findMatch(t)!==null}findMatch(t){let r=t.getDepth(),n=t.getCurrentTag(),s=`${r}:${n}`,a=this._byDepthAndTag.get(s);if(a){for(let o=0;o<a.length;o++)if(t.matches(a[o]))return a[o]}let c=this._wildcardByDepth.get(r);if(c){for(let o=0;o<c.length;o++)if(t.matches(c[o]))return c[o]}let l=this._deepByTerminalTag.get(n);if(l){for(let o=0;o<l.length;o++)if(t.matches(l[o]))return l[o]}for(let o=0;o<this._deepWildcards.length;o++)if(t.matches(this._deepWildcards[o]))return this._deepWildcards[o];return null}};var Wr=class{constructor(t){this._matcher=t}get separator(){return this._matcher.separator}getCurrentTag(){let t=this._matcher.path;return t.length>0?t[t.length-1].tag:void 0}getCurrentNamespace(){let t=this._matcher.path;return t.length>0?t[t.length-1].namespace:void 0}getAttrValue(t){let r=this._matcher.path;if(r.length!==0)return r[r.length-1].values?.[t]}hasAttr(t){let r=this._matcher.path;if(r.length===0)return!1;let n=r[r.length-1];return n.values!==void 0&&t in n.values}getAnyParentAttr(t){return this._matcher.getAnyParentAttr(t)}hasAnyParentAttr(t){return this._matcher.hasAnyParentAttr(t)}getPosition(){let t=this._matcher.path;return t.length===0?-1:t[t.length-1].position??0}getCounter(){let t=this._matcher.path;return t.length===0?-1:t[t.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this._matcher.path.length}toString(t,r=!0){return this._matcher.toString(t,r)}toArray(){return this._matcher.path.map(t=>t.tag)}matches(t){return this._matcher.matches(t)}matchesAny(t){return t.matchesAny(this._matcher)}},Ge=class{constructor(t={}){this.separator=t.separator||".",this.path=[],this.siblingStacks=[],this._pathStringCache=null,this._view=new Wr(this),this._keptAttrs=[]}push(t,r=null,n=null,s=null){this._pathStringCache=null,this.path.length>0&&(this.path[this.path.length-1].values=void 0);let a=this.path.length,c=this.siblingStacks[a];c||(c={counts:new Map,total:0},this.siblingStacks[a]=c);let l=n?`${n}:${t}`:t,o=c.counts.get(l)||0,A=c.total;c.counts.set(l,o+1),c.total++;let u={tag:t,position:A,counter:o};n!=null&&(u.namespace=n),r!=null&&(u.values=r),this.path.push(u);let m=this.path.length,T=s!==null?s.keep:null;if(T!=null&&T.length>0&&r)for(let f=0;f<T.length;f++){let y=T[f];r[y]!==void 0&&this._keptAttrs.push({depth:m,name:y,value:r[y]})}}pop(){if(this.path.length===0)return;this._pathStringCache=null;let t=this.path.pop();this.siblingStacks.length>this.path.length+1&&(this.siblingStacks.length=this.path.length+1);let r=this.path.length+1;for(;this._keptAttrs.length>0&&this._keptAttrs[this._keptAttrs.length-1].depth>=r;)this._keptAttrs.pop();return t}updateCurrent(t){if(this.path.length>0){let r=this.path[this.path.length-1];t!=null&&(r.values=t)}}getCurrentTag(){return this.path.length>0?this.path[this.path.length-1].tag:void 0}getCurrentNamespace(){return this.path.length>0?this.path[this.path.length-1].namespace:void 0}getAttrValue(t){if(this.path.length!==0)return this.path[this.path.length-1].values?.[t]}hasAttr(t){if(this.path.length===0)return!1;let r=this.path[this.path.length-1];return r.values!==void 0&&t in r.values}getAnyParentAttr(t){let r=this._keptAttrs;for(let n=r.length-1;n>=0;n--)if(r[n].name===t)return r[n].value}hasAnyParentAttr(t){let r=this._keptAttrs;for(let n=r.length-1;n>=0;n--)if(r[n].name===t)return!0;return!1}getPosition(){return this.path.length===0?-1:this.path[this.path.length-1].position??0}getCounter(){return this.path.length===0?-1:this.path[this.path.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this.path.length}toString(t,r=!0){let n=t||this.separator;if(n===this.separator&&r===!0){if(this._pathStringCache!==null)return this._pathStringCache;let a=this.path.map(c=>c.namespace?`${c.namespace}:${c.tag}`:c.tag).join(n);return this._pathStringCache=a,a}return this.path.map(a=>r&&a.namespace?`${a.namespace}:${a.tag}`:a.tag).join(n)}toArray(){return this.path.map(t=>t.tag)}reset(){this._pathStringCache=null,this.path=[],this.siblingStacks=[],this._keptAttrs=[]}matches(t){let r=t.segments;return r.length===0?!1:t.hasDeepWildcard()?this._matchWithDeepWildcard(r):this._matchSimple(r)}_matchSimple(t){if(this.path.length!==t.length)return!1;for(let r=0;r<t.length;r++)if(!this._matchSegment(t[r],this.path[r],r===this.path.length-1))return!1;return!0}_matchWithDeepWildcard(t){let r=this.path.length-1,n=t.length-1;for(;n>=0&&r>=0;){let s=t[n];if(s.type==="deep-wildcard"){if(n--,n<0)return!0;let a=t[n],c=!1;for(let l=r;l>=0;l--)if(this._matchSegment(a,this.path[l],l===this.path.length-1)){r=l-1,n--,c=!0;break}if(!c)return!1}else{if(!this._matchSegment(s,this.path[r],r===this.path.length-1))return!1;r--,n--}}return n<0}_matchSegment(t,r,n){if(t.tag!=="*"&&t.tag!==r.tag||t.namespace!==void 0&&t.namespace!=="*"&&t.namespace!==r.namespace||t.attrName!==void 0&&(!n||!r.values||!(t.attrName in r.values)||t.attrValue!==void 0&&String(r.values[t.attrName])!==String(t.attrValue)))return!1;if(t.position!==void 0){if(!n)return!1;let s=r.counter??0;if(t.position==="first"&&s!==0)return!1;if(t.position==="odd"&&s%2!==1)return!1;if(t.position==="even"&&s%2!==0)return!1;if(t.position==="nth"&&s!==t.positionValue)return!1}return!0}matchesAny(t){return t.matchesAny(this)}snapshot(){return{path:this.path.map(t=>({...t})),siblingStacks:this.siblingStacks.map(t=>t&&{counts:new Map(t.counts),total:t.total}),keptAttrs:this._keptAttrs.map(t=>({...t}))}}restore(t){this._pathStringCache=null,this.path=t.path.map(r=>({...r})),this.siblingStacks=t.siblingStacks.map(r=>r&&{counts:new Map(r.counts),total:r.total}),this._keptAttrs=(t.keptAttrs||[]).map(r=>({...r}))}readOnly(){return this._view}};var Co=[{id:"html-script-open",description:"<script opening tag",pattern:/<script[\s>/]/i},{id:"html-script-close",description:"</script closing tag",pattern:/<\/script[\s>]/i},{id:"html-javascript-protocol",description:"javascript: URI scheme (with optional whitespace/encoding)",pattern:/j[\t\n\r ]*a[\t\n\r ]*v[\t\n\r ]*a[\t\n\r ]*s[\t\n\r ]*c[\t\n\r ]*r[\t\n\r ]*i[\t\n\r ]*p[\t\n\r ]*t[\t\n\r ]*:/i},{id:"html-vbscript-protocol",description:"vbscript: URI scheme",pattern:/vbscript[\t\n\r ]*:/i},{id:"html-data-html",description:"data:text/html URI \u2014 can execute scripts in browsers",pattern:/data[\t\n\r ]*:[\t\n\r ]*text\/html/i},{id:"html-data-xhtml",description:"data:application/xhtml+xml URI",pattern:/data[\t\n\r ]*:[\t\n\r ]*application\/xhtml/i},{id:"html-data-svg",description:"data:image/svg+xml URI \u2014 can execute scripts",pattern:/data[\t\n\r ]*:[\t\n\r ]*image\/svg\+xml/i},{id:"html-inline-event-handler",description:"Inline event handler attributes: onclick=, onerror=, onload=, etc.",pattern:/\bon\w{1,30}\s*=/i},{id:"html-entity-obfuscated-script",description:"HTML-entity-encoded <script (e.g. <script or <script)",pattern:/(?:�*3[Cc];?|�*60;?|<)\s*script/i},{id:"html-entity-obfuscated-javascript",description:'HTML-entity-encoded javascript: (partial \u2014 catches common j or j for "j")',pattern:/(?:�*6[Aa];?|�*106;?)\s*(?:�*61;?|a)[\s\S]{0,80}script\s*:/i},{id:"html-style-expression",description:"CSS expression() \u2014 IE-era code execution in style attributes",pattern:/style[\s\S]{0,20}expression\s*\(/i},{id:"html-object-embed",description:"<object or <embed tags that can load active content",pattern:/<(?:object|embed)[\s>/]/i},{id:"html-base-tag",description:"<base href= \u2014 can hijack all relative URLs on a page",pattern:/<base[\s>]/i},{id:"html-meta-refresh",description:'<meta http-equiv="refresh" \u2014 can redirect users',pattern:/<meta[\s\S]{0,40}http-equiv[\s\S]{0,20}refresh/i},{id:"html-srcdoc",description:"srcdoc= attribute on iframes \u2014 embeds HTML that can run scripts",pattern:/srcdoc\s*=/i},{id:"html-iframe",description:"<iframe tag",pattern:/<iframe[\s>/]/i},{id:"html-form",description:"<form tag \u2014 can be used for phishing / credential harvesting injection",pattern:/<form[\s>/]/i}],Ke=Co;var Io=[{id:"xml-cdata-injection",description:"CDATA section injection: <![CDATA[ breaks out of text node context",pattern:/<!\[CDATA\[/i},{id:"xml-cdata-close",description:"CDATA close sequence: ]]> can terminate an enclosing CDATA section",pattern:/\]\]>/},{id:"xml-processing-instruction",description:"XML processing instruction: <?xml-stylesheet or <?php etc.",pattern:/<\?(?:xml[\- ]|php|asp)/i},{id:"xml-doctype-injection",description:"DOCTYPE declaration embedded in content \u2014 can define entities",pattern:/<!DOCTYPE(?:[\s[]|$)/i},{id:"xml-entity-system",description:"SYSTEM keyword \u2014 used in external entity declarations (XXE)",pattern:/\bSYSTEM\s+["']/i},{id:"xml-entity-public",description:"PUBLIC keyword \u2014 used in external entity declarations (XXE)",pattern:/\bPUBLIC\s+["']/i},{id:"xml-entity-declaration",description:"<!ENTITY declaration \u2014 defines entities, potential XXE or entity expansion",pattern:/<!ENTITY[\s%]/i},{id:"xml-billion-laughs",description:"Entity reference chaining / billion laughs: repeated &eX; style references",pattern:/(?:&\w{1,20};){3,}/},{id:"xml-namespace-confusion",description:"xmlns: attribute injection \u2014 can redefine namespaces to confuse parsers",pattern:/\bxmlns\s*(?::\w{1,40})?\s*=/i},{id:"xml-comment-injection",description:"<!-- comment injection \u2014 can hide content from some parsers",pattern:/<!--/},{id:"xml-comment-close",description:"--> closes an enclosing XML comment",pattern:/-->/},{id:"xml-pi-close",description:"?> closes an enclosing processing instruction",pattern:/\?>/}],We=Io;var bo=[{id:"svg-script-element",description:"<script element inside SVG executes JavaScript",pattern:/<script[\s>/]/i},{id:"svg-xlink-href-javascript",description:"xlink:href with javascript: \u2014 classic SVG XSS via <a> or <use>",pattern:/xlink\s*:\s*href\s*=\s*["']?\s*javascript\s*:/i},{id:"svg-href-javascript",description:"href= with javascript: in SVG context (<a>, <animate>, etc.)",pattern:/href\s*=\s*["']?\s*javascript\s*:/i},{id:"svg-foreignobject",description:"<foreignObject embeds HTML inside SVG \u2014 can execute scripts",pattern:/<foreignObject[\s>/]/i},{id:"svg-use-external",description:"<use xlink:href or href pointing to external resource (non-fragment URL)",pattern:/<use[\s\S]{0,60}(?:xlink\s*:\s*)?href\s*=\s*(?:["'][^#]|[^"'#\s>])/i},{id:"svg-animate-href",description:'<animate attributeName="href" \u2014 can dynamically change href to javascript:',pattern:/<animate[\s\S]{0,80}attributeName\s*=\s*["'][\s]*href["']/i},{id:"svg-animate-xlinkhref",description:'<animate attributeName="xlink:href"',pattern:/<animate[\s\S]{0,80}attributeName\s*=\s*["'][\s]*xlink\s*:\s*href["']/i},{id:"svg-set-javascript",description:'<set to="javascript:..." \u2014 sets an attribute to a javascript: URI',pattern:/<set[\s\S]{0,80}to\s*=\s*["']?\s*javascript\s*:/i},{id:"svg-event-handler",description:"SVG-specific event handler attributes: onload=, onerror=, onactivate=, etc.",pattern:/\bon(?:load|error|activate|begin|end|repeat|focus|blur|click|mouse\w{1,20}|key\w{1,20})\s*=/i},{id:"svg-handler-generic",description:"Generic on* handler catch-all for SVG attributes",pattern:/\bon\w{1,30}\s*=/i},{id:"svg-filter-feimage",description:"<feImage href= \u2014 filter primitive that can load external resources",pattern:/<feImage[\s\S]{0,80}(?:xlink\s*:\s*)?href\s*=/i},{id:"svg-image-external",description:"<image xlink:href with http/https or javascript protocol",pattern:/<image[\s\S]{0,80}(?:xlink\s*:\s*)?href\s*=\s*["']?\s*(?:https?|javascript)\s*:/i},{id:"svg-style-javascript",description:"style= attribute containing javascript: (e.g. background:url(javascript:...))",pattern:/style\s*=[\s\S]{0,60}javascript\s*:/i}],Jr=bo;var yo=[{id:"sql-block-comment-open",description:"SQL block comment open: /* ... */ \u2014 unusual in legitimate user text",pattern:/\/\*/},{id:"sql-union-select",description:"UNION SELECT \u2014 most common SQL injection aggregation attack",pattern:/\bUNION\s{1,20}(?:ALL\s{1,20})?SELECT\b/i},{id:"sql-drop-table",description:"DROP TABLE \u2014 destructive DDL injection",pattern:/\bDROP\s{1,20}TABLE\b/i},{id:"sql-drop-database",description:"DROP DATABASE \u2014 destructive DDL injection",pattern:/\bDROP\s{1,20}DATABASE\b/i},{id:"sql-insert-into",description:"INSERT INTO \u2014 data injection",pattern:/\bINSERT\s{1,20}INTO\b/i},{id:"sql-delete-from",description:"DELETE FROM \u2014 data deletion injection",pattern:/\bDELETE\s{1,20}FROM\b/i},{id:"sql-update-set",description:"UPDATE ... SET \u2014 data modification injection",pattern:/\bUPDATE\b[\s\S]{1,60}\bSET\b/i},{id:"sql-exec-xp",description:"EXEC xp_ \u2014 MSSQL extended stored procedure execution",pattern:/\bEXEC(?:UTE)?\s{1,20}xp_/i},{id:"sql-tautology-string",description:`Classic string tautology: ' OR '1'='1 or " OR "1"="1"`,pattern:/'\s{0,10}OR\s{0,10}'[^']{0,20}'\s*=\s*'[^']{0,20}/i},{id:"sql-tautology-numeric",description:"Numeric tautology: OR 1=1",pattern:/\bOR\s{1,10}1\s*=\s*1\b/i},{id:"sql-always-true-zero",description:"Numeric tautology: OR 0=0",pattern:/\bOR\s{1,10}0\s*=\s*0\b/i},{id:"sql-sleep-benchmark",description:"Time-based blind injection: SLEEP() or BENCHMARK()",pattern:/\b(?:SLEEP|BENCHMARK)\s*\(/i},{id:"sql-waitfor-delay",description:"MSSQL time-based blind injection: WAITFOR DELAY",pattern:/\bWAITFOR\s{1,20}DELAY\b/i},{id:"sql-char-function",description:"CHAR() function \u2014 used to obfuscate injected strings",pattern:/\bCHAR\s*\(\s*\d{1,3}/i},{id:"sql-information-schema",description:"INFORMATION_SCHEMA \u2014 reconnaissance query for table/column enumeration",pattern:/\bINFORMATION_SCHEMA\b/i}],dt=yo;var wo=[{id:"shell-path-traversal-unix",description:"Unix path traversal: ../ \u2014 climbing the directory tree",pattern:/\.\.\//},{id:"shell-path-traversal-windows",description:"Windows path traversal: ..\\ \u2014 climbing the directory tree",pattern:/\.\.\\/},{id:"shell-path-traversal-encoded",description:"URL-encoded path traversal: %2e%2e or %2f variants",pattern:/%2e%2e|%2f\.\.|\.\.%2f/i},{id:"shell-null-byte",description:"Null byte injection: \\x00 or %00 \u2014 truncates strings in C-backed functions",pattern:/\x00|%00/},{id:"shell-semicolon",description:"Semicolon command separator: cmd1; cmd2",pattern:/;/},{id:"shell-pipe",description:"Pipe operator: cmd1 | cmd2",pattern:/\|/},{id:"shell-and-operator",description:"AND operator: cmd1 && cmd2",pattern:/&&/},{id:"shell-or-operator",description:"OR operator: cmd1 || cmd2",pattern:/\|\|/},{id:"shell-backtick",description:"Backtick command substitution: `cmd`",pattern:/`/},{id:"shell-dollar-paren",description:"Dollar-paren command substitution: $(cmd)",pattern:/\$\(/},{id:"shell-dollar-brace",description:"Dollar-brace variable expansion: ${var} \u2014 can be abused for injection",pattern:/\$\{/},{id:"shell-redirect-out",description:"Output redirection: cmd > file or cmd >> file",pattern:/>{1,2}/},{id:"shell-redirect-in",description:"Input redirection: cmd < file",pattern:/</},{id:"shell-newline-injection",description:"Newline injection: \\n or \\r \u2014 can inject new shell commands",pattern:/[\n\r]/},{id:"shell-glob-star",description:"Glob expansion: * or ? \u2014 can expand to unintended files",pattern:/[/\\][*?]/},{id:"shell-absolute-root",description:"Absolute root path injection: string starting with / or \\ (Windows UNC)",pattern:/^(?:\/|\\\\)/},{id:"shell-windows-drive",description:"Windows drive letter path injection: C:\\ or D:/",pattern:/^[a-zA-Z]:[/\\]/},{id:"shell-curl-wget",description:"curl/wget with URL or flags \u2014 can exfiltrate data or download payloads",pattern:/\b(?:curl|wget)\s+(?:https?:\/\/|ftp:\/\/|-)/i}],jr=wo;var No=[{id:"redos-nested-quantifier-plus",description:"Nested + quantifier inside a group with outer quantifier: (a+)+, (.+b)*, etc.",pattern:/\([^)]*\+[^)]*\)[+*]/},{id:"redos-nested-quantifier-star",description:"Nested * quantifier: (a*)* or (a*)+ \u2014 catastrophic backtracking",pattern:/\([^)]*\*[^)]*\)[*+]/},{id:"redos-nested-groups",description:"Doubly nested quantified groups: ((a+)+) \u2014 guaranteed catastrophic",pattern:/\(\([^)]{0,40}\)[+*]\)[+*]/},{id:"redos-alternation-overlap",description:"Overlapping alternation under quantifier: (a|a)+ \u2014 ambiguous NFA paths",pattern:/\(([^|()]{1,20})\|(?:\1)(?:\|[^|()]{1,20}){0,5}\)[+*?]{1,2}/},{id:"redos-star-plus-concat",description:"(x*x)+ pattern \u2014 triggers super-linear backtracking",pattern:/\([^)]{0,10}\*[^)]{0,10}\)[+*]/},{id:"redos-dot-star-greedy",description:"(.*){n,} or (.+){n,} \u2014 repeated greedy dot quantifiers",pattern:/\(\.[*+]\)\{?\d/},{id:"redos-large-repetition",description:"Very large fixed or range repetition count {1000,} or {1000,n} \u2014 denial of service via backtracking",pattern:/\{\d{4,}(?:,\d*)?\}/},{id:"redos-catastrophic-alternation",description:"Long alternation with many similar branches \u2014 polynomial backtracking risk",pattern:/\([^)]{0,200}(?:\|[^|)]{0,50}){9,}\)/}],Vr=No;var ne=`["'\\s]*:`,So=[{id:"nosql-where-operator",description:"$where \u2014 executes arbitrary JavaScript server-side in MongoDB",pattern:new RegExp(`\\$where${ne}`,"i")},{id:"nosql-ne-operator",description:'$ne \u2014 "not equal" operator used to bypass equality checks',pattern:new RegExp(`\\$ne${ne}`,"i")},{id:"nosql-gt-operator",description:'$gt \u2014 "greater than" used to bypass password/value checks',pattern:new RegExp(`\\$gte?${ne}`,"i")},{id:"nosql-lt-operator",description:'$lt / $lte \u2014 "less than" bypass variants',pattern:new RegExp(`\\$lte?${ne}`,"i")},{id:"nosql-regex-operator",description:"$regex \u2014 can be used to extract data character by character (blind injection)",pattern:new RegExp(`\\$regex${ne}`,"i")},{id:"nosql-or-operator",description:"$or \u2014 logical OR; used to create always-true conditions",pattern:new RegExp(`\\$or${ne}\\s*\\[`,"i")},{id:"nosql-and-operator",description:"$and \u2014 logical AND operator injection",pattern:new RegExp(`\\$and${ne}\\s*\\[`,"i")},{id:"nosql-nor-operator",description:"$nor \u2014 logical NOR operator injection",pattern:new RegExp(`\\$nor${ne}\\s*\\[`,"i")},{id:"nosql-exists-operator",description:"$exists \u2014 can enumerate fields to determine schema",pattern:new RegExp(`\\$exists${ne}`,"i")},{id:"nosql-in-operator",description:"$in \u2014 matches any value in a list; can enumerate values",pattern:new RegExp(`\\$in${ne}\\s*\\[`,"i")},{id:"nosql-expr-operator",description:"$expr \u2014 allows aggregation expressions in queries (MongoDB 3.6+)",pattern:new RegExp(`\\$expr${ne}`,"i")},{id:"nosql-function-operator",description:"$function \u2014 executes arbitrary JavaScript in MongoDB 4.4+",pattern:new RegExp(`\\$function${ne}`,"i")},{id:"nosql-accumulator-operator",description:"$accumulator \u2014 custom aggregation with arbitrary JS execution",pattern:new RegExp(`\\$accumulator${ne}`,"i")},{id:"nosql-proto-pollution",description:"__proto__ \u2014 prototype pollution via object key injection",pattern:/__proto__/},{id:"nosql-constructor-prototype",description:"constructor.prototype \u2014 alternative prototype pollution vector (dot notation or JSON key)",pattern:/constructor[\s"':.,{\[]*prototype/i},{id:"nosql-proto-bracket",description:'["__proto__"] \u2014 bracket-notation prototype pollution',pattern:/\[["']__proto__["']\]/}],Xr=So;var _o=[{id:"log-crlf-injection",description:"CRLF injection: literal \\r or \\n embeds fake log lines",pattern:/[\r\n]/},{id:"log-url-encoded-crlf",description:"URL-encoded CRLF: %0d, %0a, %0D, %0A \u2014 decoded by some log parsers",pattern:/%0[dDaA]/},{id:"log-unicode-newline",description:"Unicode newline variants: U+2028 (line separator), U+2029 (paragraph separator)",pattern:/[\u2028\u2029]/},{id:"log-log4shell-jndi",description:"Log4Shell: ${jndi:...} triggers remote code execution in Apache Log4j",pattern:/\$\{jndi\s*:/i},{id:"log-log4shell-obfuscated",description:"Obfuscated Log4Shell: ${::-j}... lookup-bypass prefix used to evade WAF detection",pattern:/\$\{::-/},{id:"log-log4j-lookup",description:"Log4j lookup syntax: ${env:...}, ${sys:...}, ${ctx:...} \u2014 data exfiltration",pattern:/\$\{(?:env|sys|ctx|main|map|sd|web|docker|k8s|spring)\s*:/i},{id:"log-ssti-double-brace",description:"SSTI double-brace: {{expression}} \u2014 Jinja2, Twig, Handlebars, etc.",pattern:/\{\{[\s\S]{0,80}\}\}/},{id:"log-ssti-hash-brace",description:"SSTI hash-brace: #{expression} \u2014 Thymeleaf, Velocity, Ruby ERB",pattern:/#\{[\s\S]{0,80}\}/},{id:"log-ssti-dollar-brace",description:"SSTI/EL injection: ${expression with operators or method calls} \u2014 JSP EL, Freemarker, SpEL",pattern:/\$\{[^}]*(?:\.|\(|\*|\+|\bclass\b|\bruntime\b|\bprocess\b|\bexec\b)[^}]{0,80}\}/i},{id:"log-ssti-percent-tag",description:"SSTI ERB/ASP tag: <%= expression %> \u2014 Ruby ERB, ASP",pattern:/<%=[\s\S]{0,80}%>/},{id:"log-null-byte",description:"Null byte: \\x00 or %00 \u2014 can truncate log entries in C-backed loggers",pattern:/\x00|%00/},{id:"log-ansi-escape",description:"ANSI escape sequence: ESC[ \u2014 can manipulate terminal output when logs are tailed",pattern:/\x1b\[/}],Zr=_o;var xo=[{id:"sql-line-comment",description:"SQL line comment: -- followed by whitespace or end of string",pattern:/--(?:\s|$)/},{id:"sql-stacked-query",description:"Stacked queries: semicolon immediately followed by a SQL keyword",pattern:/;\s{0,10}(?:SELECT|INSERT|UPDATE|DELETE|DROP|CREATE|ALTER|EXEC)\b/i},{id:"sql-hex-encoding",description:"Hex-encoded string injection: 0x41414141 style (MySQL)",pattern:/\b0x[0-9a-f]{4,}/i}],Ro=[...dt,...xo],$r=Ro;Ke.label="HTML";We.label="XML";Jr.label="SVG";dt.label="SQL";$r.label="SQL-STRICT";jr.label="SHELL";Vr.label="REDOS";Xr.label="NOSQL";Zr.label="LOG";var vh=Object.freeze({HTML:Ke,XML:We,SVG:Jr,SQL:dt,"SQL-STRICT":$r,SHELL:jr,REDOS:Vr,NOSQL:Xr,LOG:Zr});function Lo(e){if(typeof e!="string")throw new TypeError(`is-unsafe: first argument must be a string, got ${typeof e}`)}function Oo(e){if(!(e instanceof RegExp)){if(Array.isArray(e)){if(e.length===0)throw new TypeError("is-unsafe: context must not be an empty array");if(Array.isArray(e[0])){for(let t of e)if(!Array.isArray(t)||t.length===0)throw new TypeError("is-unsafe: each context in the array must be a non-empty pattern array (PatternList)")}return}throw new TypeError(`is-unsafe: second argument must be a PatternList (e.g. HTML), an array of PatternLists (e.g. [HTML, XML]), or a RegExp. Got: ${typeof e}`)}}function Do(e){return e instanceof RegExp?{lists:null,regex:e}:Array.isArray(e[0])?{lists:e,regex:null}:{lists:[e],regex:null}}function Bo(e,t){let r=t.label??"CUSTOM";for(let n of t)if(n.pattern.test(e))return{context:r,id:n.id,description:n.description,pattern:n.pattern};return null}function ds(e,t){Lo(e),Oo(t);let{lists:r,regex:n}=Do(t);if(n)return n.test(e);for(let s of r)if(Bo(e,s)!==null)return!0;return!1}function ko(e,t){if(!e)return{};let r=t.attributesGroupName?e[t.attributesGroupName]:e;if(!r)return{};let n={};for(let s in r)if(s.startsWith(t.attributeNamePrefix)){let a=s.substring(t.attributeNamePrefix.length);n[a]=r[s]}else n[s]=r[s];return n}function vo(e){if(!e||typeof e!="string")return;let t=e.indexOf(":");if(t!==-1&&t>0){let r=e.substring(0,t);if(r!=="xmlns")return r}}var ut=class{constructor(t,r){this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.parseXml=Ho,this.parseTextData=Po,this.resolveNameSpace=Mo,this.buildAttributesMap=Uo,this.isItStopNode=Ko,this.replaceEntitiesValue=Yo,this.readStopNodeData=jo,this.saveTextToParentTag=Go,this.addChild=Qo,this.ignoreAttributesFn=Kr(this.options.ignoreAttributes),this.entityExpansionCount=0,this.currentExpandedLength=0,this.doctypefound=!1;let n={...ot};this.options.entityDecoder?this.entityDecoder=this.options.entityDecoder:(typeof this.options.htmlEntities=="object"?n=this.options.htmlEntities:this.options.htmlEntities===!0&&(n={...Fr,...Mr}),this.entityDecoder=new He({namedEntities:{...n,...r},numericAllowed:this.options.htmlEntities,limit:{maxTotalExpansions:this.options.processEntities.maxTotalExpansions,maxExpandedLength:this.options.processEntities.maxExpandedLength,applyLimitsTo:this.options.processEntities.appliesTo},onInputEntity:(a,c)=>ds(c,[Ke,We])?Ue.BLOCK:Ue.ALLOW})),this.matcher=new Ge,this.readonlyMatcher=this.matcher.readOnly(),this.isCurrentNodeStopNode=!1,this.stopNodeExpressionsSet=new Ye;let s=this.options.stopNodes;if(s&&s.length>0){for(let a=0;a<s.length;a++){let c=s[a];typeof c=="string"?this.stopNodeExpressionsSet.add(new De(c)):c instanceof De&&this.stopNodeExpressionsSet.add(c)}this.stopNodeExpressionsSet.seal()}}};function Po(e,t,r,n,s,a,c){let l=this.options;if(e!==void 0&&(l.trimValues&&!n&&(e=e.trim()),e.length>0)){c||(e=this.replaceEntitiesValue(e,t,r));let o=l.jPath?r.toString():r,A=l.tagValueProcessor(t,e,o,s,a);return A==null?e:typeof A!=typeof e||A!==e?A:l.trimValues||e.trim()===e?en(e,l.parseTagValue,l.numberParseOptions):e}}function Mo(e){if(this.options.removeNSPrefix){let t=e.split(":"),r=e.charAt(0)==="/"?"/":"";if(t[0]==="xmlns")return"";t.length===2&&(e=r+t[1])}return e}var Fo=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function Uo(e,t,r,n=!1){let s=this.options;if(n===!0||s.ignoreAttributes!==!0&&typeof e=="string"){let a=Ft(e,Fo),c=a.length,l={},o=new Array(c),A=!1,u={};for(let f=0;f<c;f++){let y=this.resolveNameSpace(a[f][1]),w=a[f][4];if(y.length&&w!==void 0){let b=w;s.trimValues&&(b=b.trim()),b=this.replaceEntitiesValue(b,r,this.readonlyMatcher),o[f]=b,u[y]=b,A=!0}}A&&typeof t=="object"&&t.updateCurrent&&t.updateCurrent(u);let m=s.jPath?t.toString():this.readonlyMatcher,T=!1;for(let f=0;f<c;f++){let y=this.resolveNameSpace(a[f][1]);if(this.ignoreAttributesFn(y,m))continue;let w=s.attributeNamePrefix+y;if(y.length)if(s.transformAttributeName&&(w=s.transformAttributeName(w)),w=us(w,s),a[f][4]!==void 0){let b=o[f],_=s.attributeValueProcessor(y,b,m);_==null?l[w]=b:typeof _!=typeof b||_!==b?l[w]=_:l[w]=en(b,s.parseAttributeValue,s.numberParseOptions),T=!0}else s.allowBooleanAttributes&&(l[w]=!0,T=!0)}if(!T)return;if(s.attributesGroupName&&!s.preserveOrder){let f={};return f[s.attributesGroupName]=l,f}return l}}var Ho=function(e){e=e.replace(/\r\n?/g,`
|
|
7
|
-
`);let t=new ee("!xml"),r=t,n="";this.matcher.reset(),this.entityDecoder.reset(),this.entityExpansionCount=0,this.currentExpandedLength=0,this.doctypefound=!1;let s=this.options,a=new At(s.processEntities),c=e.length;for(let l=0;l<c;l++)if(e[l]==="<"){let A=e.charCodeAt(l+1);if(A===47){let u=Je(e,">",l,"Closing Tag is not closed."),m=e.substring(l+2,u).trim();if(s.removeNSPrefix){let f=m.indexOf(":");f!==-1&&(m=m.substr(f+1))}m=qr(s.transformTagName,m,"",s).tagName,r&&(n=this.saveTextToParentTag(n,r,this.readonlyMatcher));let T=this.matcher.getCurrentTag();if(m&&s.unpairedTagsSet.has(m))throw new Error(`Unpaired tag can not be used as closing tag: </${m}>`);T&&s.unpairedTagsSet.has(T)&&(this.matcher.pop(),this.tagsNodeStack.pop()),this.matcher.pop(),this.isCurrentNodeStopNode=!1,r=this.tagsNodeStack.pop(),n="",l=u}else if(A===63){let u=zr(e,l,!1,"?>");if(!u)throw new Error("Pi Tag is not closed.");n=this.saveTextToParentTag(n,r,this.readonlyMatcher);let m=this.buildAttributesMap(u.tagExp,this.matcher,u.tagName,!0);if(m){let T=m[this.options.attributeNamePrefix+"version"];this.entityDecoder.setXmlVersion(Number(T)||1),a.setXmlVersion(Number(T)||1)}if(!(s.ignoreDeclaration&&u.tagName==="?xml"||s.ignorePiTags)){let T=new ee(u.tagName);T.add(s.textNodeName,""),u.tagName!==u.tagExp&&u.attrExpPresent&&s.ignoreAttributes!==!0&&(T[":@"]=m),this.addChild(r,T,this.readonlyMatcher,l)}l=u.closeIndex+1}else if(A===33&&e.charCodeAt(l+2)===45&&e.charCodeAt(l+3)===45){let u=Je(e,"-->",l+4,"Comment is not closed.");if(s.commentPropName){let m=e.substring(l+4,u-2);n=this.saveTextToParentTag(n,r,this.readonlyMatcher),r.add(s.commentPropName,[{[s.textNodeName]:m}])}l=u}else if(A===33&&e.charCodeAt(l+2)===68){if(this.doctypefound)throw new Error("Multiple DOCTYPE declarations found.");this.doctypefound=!0;let u=a.readDocType(e,l);this.entityDecoder.addInputEntities(u.entities),l=u.i}else if(A===33&&e.charCodeAt(l+2)===91){let u=Je(e,"]]>",l,"CDATA is not closed.")-2,m=e.substring(l+9,u);n=this.saveTextToParentTag(n,r,this.readonlyMatcher);let T=this.parseTextData(m,r.tagname,this.readonlyMatcher,!0,!1,!0,!0);T==null&&(T=""),s.cdataPropName?r.add(s.cdataPropName,[{[s.textNodeName]:m}]):r.add(s.textNodeName,T),l=u+2}else{let u=zr(e,l,s.removeNSPrefix);if(!u){let k=e.substring(Math.max(0,l-50),Math.min(c,l+50));throw new Error(`readTagExp returned undefined at position ${l}. Context: "${k}"`)}let m=u.tagName,T=u.rawTagName,f=u.tagExp,y=u.attrExpPresent,w=u.closeIndex;if({tagName:m,tagExp:f}=qr(s.transformTagName,m,f,s),s.strictReservedNames&&(m===s.commentPropName||m===s.cdataPropName||m===s.textNodeName||m===s.attributesGroupName))throw new Error(`Invalid tag name: ${m}`);r&&n&&r.tagname!=="!xml"&&(n=this.saveTextToParentTag(n,r,this.readonlyMatcher,!1));let b=r;b&&s.unpairedTagsSet.has(b.tagname)&&(r=this.tagsNodeStack.pop(),this.matcher.pop());let _=!1;f.length>0&&f.lastIndexOf("/")===f.length-1&&(_=!0,m[m.length-1]==="/"?(m=m.substr(0,m.length-1),f=m):f=f.substr(0,f.length-1),y=m!==f);let S=null,R={},U;U=vo(T),m!==t.tagname&&this.matcher.push(m,{},U),m!==f&&y&&(S=this.buildAttributesMap(f,this.matcher,m),S&&(R=ko(S,s))),m!==t.tagname&&(this.isCurrentNodeStopNode=this.isItStopNode());let x=l;if(this.isCurrentNodeStopNode){let k="";if(_)l=u.closeIndex;else if(s.unpairedTagsSet.has(m))l=u.closeIndex;else{let F=this.readStopNodeData(e,T,w+1);if(!F)throw new Error(`Unexpected end of ${T}`);l=F.i,k=F.tagContent}let Y=new ee(m);S&&(Y[":@"]=S),Y.add(s.textNodeName,k),this.matcher.pop(),this.isCurrentNodeStopNode=!1,this.addChild(r,Y,this.readonlyMatcher,x)}else{if(_){({tagName:m,tagExp:f}=qr(s.transformTagName,m,f,s));let k=new ee(m);S&&(k[":@"]=S),this.addChild(r,k,this.readonlyMatcher,x),this.matcher.pop(),this.isCurrentNodeStopNode=!1}else if(s.unpairedTagsSet.has(m)){let k=new ee(m);S&&(k[":@"]=S),this.addChild(r,k,this.readonlyMatcher,x),this.matcher.pop(),this.isCurrentNodeStopNode=!1,l=u.closeIndex;continue}else{let k=new ee(m);if(this.tagsNodeStack.length>s.maxNestedTags)throw new Error("Maximum nested tags exceeded");this.tagsNodeStack.push(r),S&&(k[":@"]=S),this.addChild(r,k,this.readonlyMatcher,x),r=k}n="",l=w}}}else n+=e[l];return t.child};function Qo(e,t,r,n){this.options.captureMetaData||(n=void 0);let s=this.options.jPath?r.toString():r,a=this.options.updateTag(t.tagname,s,t[":@"]);a===!1||(typeof a=="string"&&(t.tagname=a),e.addChild(t,n))}function Yo(e,t,r){let n=this.options.processEntities;if(!n||!n.enabled)return e;if(n.allowedTags){let s=this.options.jPath?r.toString():r;if(!(Array.isArray(n.allowedTags)?n.allowedTags.includes(t):n.allowedTags(t,s)))return e}if(n.tagFilter){let s=this.options.jPath?r.toString():r;if(!n.tagFilter(t,s))return e}return this.entityDecoder.decode(e)}function Go(e,t,r,n){return e&&(n===void 0&&(n=t.child.length===0),e=this.parseTextData(e,t.tagname,r,!1,t[":@"]?Object.keys(t[":@"]).length!==0:!1,n),e!==void 0&&e!==""&&t.add(this.options.textNodeName,e),e=""),e}function Ko(){return this.stopNodeExpressionsSet.size===0?!1:this.matcher.matchesAny(this.stopNodeExpressionsSet)}function Wo(e,t,r=">"){let n=0,s=e.length,a=r.charCodeAt(0),c=r.length>1?r.charCodeAt(1):-1,l="",o=t;for(let A=t;A<s;A++){let u=e.charCodeAt(A);if(n)u===n&&(n=0);else if(u===34||u===39)n=u;else if(u===a)if(c!==-1){if(e.charCodeAt(A+1)===c)return l+=e.substring(o,A),{data:l,index:A}}else return l+=e.substring(o,A),{data:l,index:A};else u===9&&!n&&(l+=e.substring(o,A)+" ",o=A+1)}}function Je(e,t,r,n){let s=e.indexOf(t,r);if(s===-1)throw new Error(n);return s+t.length-1}function Jo(e,t,r,n){let s=e.indexOf(t,r);if(s===-1)throw new Error(n);return s}function zr(e,t,r,n=">"){let s=Wo(e,t+1,n);if(!s)return;let a=s.data,c=s.index,l=a.search(/\s/),o=a,A=!0;l!==-1&&(o=a.substring(0,l),a=a.substring(l+1).trimStart());let u=o;if(r){let m=o.indexOf(":");m!==-1&&(o=o.substr(m+1),A=o!==s.data.substr(m+1))}return{tagName:o,tagExp:a,closeIndex:c,attrExpPresent:A,rawTagName:u}}function jo(e,t,r){let n=r,s=1,a=e.length;for(;r<a;r++)if(e[r]==="<"){let c=e.charCodeAt(r+1);if(c===47){let l=Jo(e,">",r,`${t} is not closed`);if(e.substring(r+2,l).trim()===t&&(s--,s===0))return{tagContent:e.substring(n,r),i:l};r=l}else if(c===63)r=Je(e,"?>",r+1,"StopNode is not closed.");else if(c===33&&e.charCodeAt(r+2)===45&&e.charCodeAt(r+3)===45)r=Je(e,"-->",r+3,"StopNode is not closed.");else if(c===33&&e.charCodeAt(r+2)===91)r=Je(e,"]]>",r,"StopNode is not closed.")-2;else{let l=zr(e,r,!1);l&&((l&&l.tagName)===t&&l.tagExp[l.tagExp.length-1]!=="/"&&s++,r=l.closeIndex)}}}function en(e,t,r){if(t&&typeof e=="string"){let n=e.trim();return n==="true"?!0:n==="false"?!1:Gr(e,r)}else return jn(e)?e:""}function qr(e,t,r,n){if(e){let s=e(t);r===t&&(r=s),t=s}return t=us(t,n),{tagName:t,tagExp:r}}function us(e,t){if(Ut.includes(e))throw new Error(`[SECURITY] Invalid name: "${e}" is a reserved JavaScript keyword that could cause prototype pollution`);return it.includes(e)?t.onDangerousProperty(e):e}var tn=ee.getMetaDataSymbol();function Vo(e,t){if(!e||typeof e!="object")return{};if(!t)return e;let r={};for(let n in e)if(n.startsWith(t)){let s=n.substring(t.length);r[s]=e[n]}else r[n]=e[n];return r}function rn(e,t,r,n){return hs(e,t,r,n)}function hs(e,t,r,n){let s,a={};for(let c=0;c<e.length;c++){let l=e[c],o=Xo(l);if(o!==void 0&&o!==t.textNodeName){let A=Vo(l[":@"]||{},t.attributeNamePrefix);r.push(o,A)}if(o===t.textNodeName)s===void 0?s=l[o]:s+=""+l[o];else{if(o===void 0)continue;if(l[o]){let A=hs(l[o],t,r,n),u=$o(A,t);if(Object.keys(A).length===0&&t.alwaysCreateTextNode&&(A[t.textNodeName]=""),l[":@"]?Zo(A,l[":@"],n,t):Object.keys(A).length===1&&A[t.textNodeName]!==void 0&&!t.alwaysCreateTextNode?A=A[t.textNodeName]:Object.keys(A).length===0&&(t.alwaysCreateTextNode?A[t.textNodeName]="":A=""),l[tn]!==void 0&&typeof A=="object"&&A!==null&&(A[tn]=l[tn]),a[o]!==void 0&&Object.prototype.hasOwnProperty.call(a,o))Array.isArray(a[o])||(a[o]=[a[o]]),a[o].push(A);else{let m=t.jPath?n.toString():n;t.isArray(o,m,u)?a[o]=[A]:a[o]=A}o!==void 0&&o!==t.textNodeName&&r.pop()}}}return typeof s=="string"?s.length>0&&(a[t.textNodeName]=s):s!==void 0&&(a[t.textNodeName]=s),a}function Xo(e){let t=Object.keys(e);for(let r=0;r<t.length;r++){let n=t[r];if(n!==":@")return n}}function Zo(e,t,r,n){if(t){let s=Object.keys(t),a=s.length;for(let c=0;c<a;c++){let l=s[c],o=l.startsWith(n.attributeNamePrefix)?l.substring(n.attributeNamePrefix.length):l,A=n.jPath?r.toString()+"."+o:r;n.isArray(l,A,!0,!0)?e[l]=[t[l]]:e[l]=t[l]}}}function $o(e,t){let{textNodeName:r}=t,n=Object.keys(e).length;return!!(n===0||n===1&&(e[r]||typeof e[r]=="boolean"||e[r]===0))}var je=class{constructor(t){this.externalEntities={},this.options=ts(t)}parse(t,r){if(typeof t!="string"&&t.toString)t=t.toString();else if(typeof t!="string")throw new Error("XML data is accepted in String or Bytes[] form.");if(r){r===!0&&(r={});let a=Ht(t,r);if(a!==!0)throw Error(`${a.err.msg}:${a.err.line}:${a.err.col}`)}let n=new ut(this.options,this.externalEntities),s=n.parseXml(t);return this.options.preserveOrder||s===void 0?s:rn(s,this.options,n.matcher,n.readonlyMatcher)}addEntity(t,r){if(r.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(t.indexOf("&")!==-1||t.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'");if(r==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=r}static getMetaDataSymbol(){return ee.getMetaDataSymbol()}};var ps={validate:Ht};var qo=/\.(?:avif|bmp|css|csv|docx?|eot|gif|gz|ico|jpe?g|js|json|map|mp3|mp4|mov|ogg|otf|pdf|png|pptx?|rar|rss|svg|tar|tiff?|ttf|txt|wav|webm|webp|woff2?|xlsx?|xml|zip)$/i;function Q(e,t,{includeQuery:r=!1}={}){let n;try{n=t?new URL(e,t):new URL(e)}catch{return null}return n.protocol!=="http:"&&n.protocol!=="https:"?null:(n.hash="",r||(n.search=""),n.pathname.length>1&&n.pathname.endsWith("/")&&(n.pathname=n.pathname.replace(/\/+$/,"")),n.href)}function ce(e,t){try{return new URL(e).origin===t}catch{return!1}}function jt(e){try{let t=new URL(e);return!qo.test(t.pathname)}catch{return!1}}var nn=10*1024*1024,ms=100,ec=5e4,tc=new je({ignoreAttributes:!1,removeNSPrefix:!0,trimValues:!0});function Vt(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}function gs(e){return(e===void 0?[]:Array.isArray(e)?e:[e]).flatMap(r=>{let n=Vt(r)?.loc;return typeof n=="string"?[n]:[]})}function rc(e,t,r){let s=t.toLowerCase().endsWith(".gz")||r.includes("gzip")||e[0]===31&&e[1]===139?zo(e):e;if(s.byteLength>nn)throw new Error(`sitemap exceeds ${nn} bytes after decompression: ${t}`);return s.toString("utf8").replace(/^\uFEFF/,"")}function fs(e,t){let r=ps.validate(e);if(r!==!0)throw new Error(`invalid sitemap XML at ${t}: ${r.err.msg}`);let n=Vt(tc.parse(e)),s=Vt(n?.sitemapindex);if(s)return{kind:"index",locations:gs(s.sitemap)};let a=Vt(n?.urlset);if(a)return{kind:"urlset",locations:gs(a.url)};throw new Error(`XML is not a sitemap urlset or sitemapindex: ${t}`)}function Es(e){return{fetch:e.fetch??globalThis.fetch,timeout:e.timeout,maxRedirects:e.maxRedirects??10,retries:e.retries??2,signal:e.signal,gate:e.requestGate?async t=>e.requestGate?.(t):void 0,onEvent:e.onEvent}}async function Ts(e,t){let{response:r}=await xe(e,{headers:{accept:"application/xml,text/xml,application/gzip,text/plain;q=0.9,*/*;q=0.1","user-agent":t.userAgent}},Es(t));if(!r.ok)throw await r.body?.cancel(),new Error(`sitemap returned HTTP ${r.status}: ${e}`);let{buffer:n}=await Re(r,nn);return rc(n,e,r.headers.get("content-type")?.toLowerCase()??"")}async function nc(e,t){try{let r=await Ts(e,t);return fs(r,e),!0}catch{return!1}}async function Cs(e,t){let r=Q(e,void 0);if(!r)throw new Error(`invalid start URL: ${e}`);let n=new URL(r).origin,s=new URL("/robots.txt",n).href;try{if(t.robotsBody!==void 0)for(let a of t.robotsBody.matchAll(/^sitemap:\s*(\S+)\s*$/gim)){let c=a[1];if(!c)continue;let l=Q(c,s,{includeQuery:!0});if(l&&ce(l,n))return l}else{let{response:a}=await xe(s,{headers:{accept:"text/plain,*/*;q=0.1","user-agent":t.userAgent}},Es({...t,siteOrigin:n}));if(a.ok){let{text:c}=await Re(a,524288);for(let l of c.matchAll(/^sitemap:\s*(\S+)\s*$/gim)){let o=l[1];if(!o)continue;let A=Q(o,s,{includeQuery:!0});if(A&&ce(A,n))return A}}else await a.body?.cancel()}}catch{}for(let a of["/sitemap.xml","/sitemap.xml.gz","/sitemap_index.xml"]){let c=new URL(a,n).href;if(await nc(c,{...t,siteOrigin:n}))return c}return null}async function Xt(e,t){let r=Q(e,void 0,{includeQuery:!0});if(!r)throw new Error(`invalid sitemap URL: ${e}`);let n=new URL(r).origin,s=[r],a=new Set,c=[],l=new Set,o=t.maxUrls??ec,A=!1;for(;s.length>0&&a.size<ms&&c.length<o;){let u=s.shift();if(a.has(u))continue;a.add(u);let m=fs(await Ts(u,t),u);if(m.kind==="index"){for(let T of m.locations){let f=Q(T,u,{includeQuery:!0});f&&ce(f,n)&&!a.has(f)&&!s.includes(f)&&s.push(f)}s.sort();continue}for(let T of m.locations){let f=Q(T,u,{includeQuery:t.includeQuery??!1});if(!(!f||l.has(f)||!ce(f,t.siteOrigin)||!jt(f))&&(l.add(f),c.push(f),c.length>=o)){A=!0;break}}}return(s.length>0||a.size>=ms)&&(A=!0),{url:r,urls:c.sort(),sitemapCount:a.size,truncated:A,error:null}}async function sn(e,t){await e.onEvent?.(t)}async function le(e,t={}){let r=ge(e),n=Q(r.url,void 0,{includeQuery:r.includeQuery});if(!n)throw new Error(`invalid start URL: ${r.url}`);let s=new URL(n).origin,a=t.fetch??globalThis.fetch,c=Fe(r.delay),l=t.logger??Pt;await sn(t,{type:"plan-start",url:n});let o=await Mt(n,{userAgent:ye,timeout:r.timeout,maxRedirects:r.maxRedirects,retries:2,fetch:a,signal:t.signal,requestGate:c,onEvent:t.onEvent,logger:l});await sn(t,{type:"robots",robots:o});let A=null;r.sitemap==="auto"?A=await Cs(n,{timeout:r.timeout,maxRedirects:r.maxRedirects,userAgent:ye,fetch:a,signal:t.signal,requestGate:c,onEvent:t.onEvent,robotsBody:o.body}):r.sitemap!=="none"&&(A=r.sitemap);let u=null;if(A)try{u=await Xt(A,{siteOrigin:s,includeQuery:r.includeQuery,maxUrls:5e4,timeout:r.timeout,maxRedirects:r.maxRedirects,retries:2,userAgent:ye,fetch:a,signal:t.signal,requestGate:c,onEvent:t.onEvent})}catch(f){u={url:A,urls:[],sitemapCount:0,truncated:!1,error:f instanceof Error?f.message:String(f)},l.warn(`Could not load sitemap ${A}: ${u.error}`)}let m=u?[...new Set([n,...u.urls])].sort((f,y)=>f===n?-1:y===n?1:f.localeCompare(y)):[n],T=u?m.length:null;return await sn(t,{type:"sitemap",sitemap:u,candidateCount:T}),{planVersion:1,config:r,startUrl:n,origin:s,userAgent:ye,robots:o,sitemap:u,candidateUrls:m,candidateCount:T,mode:u?"sitemap":"links"}}import{createHash as ui}from"node:crypto";var sc=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),B="\uFFFD",d;(function(e){e[e.EOF=-1]="EOF",e[e.NULL=0]="NULL",e[e.TABULATION=9]="TABULATION",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.LINE_FEED=10]="LINE_FEED",e[e.FORM_FEED=12]="FORM_FEED",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_0=48]="DIGIT_0",e[e.DIGIT_9=57]="DIGIT_9",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",e[e.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_A=97]="LATIN_SMALL_A",e[e.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(d||(d={}));var Z={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function Zt(e){return e>=55296&&e<=57343}function Is(e){return e>=56320&&e<=57343}function bs(e,t){return(e-55296)*1024+9216+t}function $t(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function qt(e){return e>=64976&&e<=65007||sc.has(e)}var E;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(E||(E={}));var ac=65536,zt=class{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=ac,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,r){let{line:n,col:s,offset:a}=this,c=s+r,l=a+r;return{code:t,startLine:n,endLine:n,startCol:c,endCol:c,startOffset:l,endOffset:l}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){let r=this.html.charCodeAt(this.pos+1);if(Is(r))return this.pos++,this._addGap(),bs(t,r)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,d.EOF;return this._err(E.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,r){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=r}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,r){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(r)return this.html.startsWith(t,this.pos);for(let n=0;n<t.length;n++)if((this.html.charCodeAt(this.pos+n)|32)!==t.charCodeAt(n))return!1;return!0}peek(t){let r=this.pos+t;if(r>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,d.EOF;let n=this.html.charCodeAt(r);return n===d.CARRIAGE_RETURN?d.LINE_FEED:n}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,d.EOF;let t=this.html.charCodeAt(this.pos);return t===d.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,d.LINE_FEED):t===d.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,Zt(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===d.LINE_FEED||t===d.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){$t(t)?this._err(E.controlCharacterInInputStream):qt(t)&&this._err(E.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}};var O;(function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION"})(O||(O={}));function er(e,t){for(let r=e.attrs.length-1;r>=0;r--)if(e.attrs[r].name===t)return e.attrs[r].value;return null}var cc=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function ys(e){return e>=55296&&e<=57343||e>1114111?65533:cc.get(e)??e}function ws(e){let t=atob(e),r=t.length&-2,n=new Uint16Array(r/2);for(let s=0,a=0;s<r;s+=2){let c=t.charCodeAt(s),l=t.charCodeAt(s+1);n[a++]=c|l<<8}return n}var an=ws("QR08ALkAAgH6AYsDNQR2BO0EPgXZBQEGLAbdBxMISQrvCmQLfQurDKQNLw4fD4YPpA+6D/IPAAAAAAAAAAAAAAAAKhBMEY8TmxUWF2EYLBkxGuAa3RsJHDscWR8YIC8jSCSIJcMl6ie3Ku8rEC0CLjoupS7kLgAIRU1hYmNmZ2xtbm9wcnN0dVQAWgBeAGUAaQBzAHcAfgCBAIQAhwCSAJoAoACsALMAbABpAGcAO4DGAMZAUAA7gCYAJkBjAHUAdABlADuAwQDBQHIiZXZlAAJhAAFpeW0AcgByAGMAO4DCAMJAEGRyAADgNdgE3XIAYQB2AGUAO4DAAMBA8CFoYZFj4SFjcgBhZAAAoFMqAAFncIsAjgBvAG4ABGFmAADgNdg43fAlbHlGdW5jdGlvbgCgYSBpAG4AZwA7gMUAxUAAAWNzpACoAHIAAOA12Jzc6SFnbgCgVCJpAGwAZABlADuAwwDDQG0AbAA7gMQAxEAABGFjZWZvcnN1xQDYANoA7QDxAPYA+QD8AAABY3LJAM8AayNzbGFzaAAAoBYidgHTANUAAKDnKmUAZAAAoAYjeQARZIABY3J0AOAA5QDrAGEidXNlAACgNSLuI291bGxpcwCgLCFhAJJjcgAA4DXYBd1wAGYAAOA12Dnd5SF2ZdhiYwDyAOoAbSJwZXEAAKBOIgAHSE9hY2RlZmhpbG9yc3UXARoBHwE6AVIBVQFiAWQBZgGCAakB6QHtAfIBYwB5ACdkUABZADuAqQCpQIABY3B5ACUBKAE1AfU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KC8AoA0gagAAoAwg");var W;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.FLAG13=8192]="FLAG13",e[e.BRANCH_LENGTH=8064]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(W||(W={}));var M;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(M||(M={}));var Ns=32;function on(e){return e>=M.ZERO&&e<=M.NINE}function lc(e){return e>=M.UPPER_A&&e<=M.UPPER_F||e>=M.LOWER_A&&e<=M.LOWER_F}function Ac(e){return e>=M.UPPER_A&&e<=M.UPPER_Z||e>=M.LOWER_A&&e<=M.LOWER_Z||on(e)}function dc(e){return e===M.EQUALS||Ac(e)}var G;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(G||(G={}));var me;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(me||(me={}));var tr=class{decodeTree;emitCodePoint;errors;constructor(t,r,n){this.decodeTree=t,this.emitCodePoint=r,this.errors=n}state=G.EntityStart;consumed=1;result=0;treeIndex=0;excess=1;decodeMode=me.Strict;runConsumed=0;startEntity(t){this.decodeMode=t,this.state=G.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1,this.runConsumed=0}write(t,r){switch(this.state){case G.EntityStart:return t.charCodeAt(r)===M.NUM?(this.state=G.NumericStart,this.consumed+=1,this.stateNumericStart(t,r+1)):(this.state=G.NamedEntity,this.stateNamedEntity(t,r));case G.NumericStart:return this.stateNumericStart(t,r);case G.NumericDecimal:return this.stateNumericDecimal(t,r);case G.NumericHex:return this.stateNumericHex(t,r);case G.NamedEntity:return this.stateNamedEntity(t,r)}}stateNumericStart(t,r){return r>=t.length?-1:(t.charCodeAt(r)|Ns)===M.LOWER_X?(this.state=G.NumericHex,this.consumed+=1,this.stateNumericHex(t,r+1)):(this.state=G.NumericDecimal,this.stateNumericDecimal(t,r))}stateNumericHex(t,r){for(;r<t.length;){let n=t.charCodeAt(r);if(on(n)||lc(n)){let s=n<=M.NINE?n-M.ZERO:(n|Ns)-M.LOWER_A+10;this.result=this.result*16+s,this.consumed++,r++}else return this.emitNumericEntity(n,3)}return-1}stateNumericDecimal(t,r){for(;r<t.length;){let n=t.charCodeAt(r);if(on(n))this.result=this.result*10+(n-M.ZERO),this.consumed++,r++;else return this.emitNumericEntity(n,2)}return-1}emitNumericEntity(t,r){if(this.consumed<=r)return this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===M.SEMI)this.consumed+=1;else if(this.decodeMode===me.Strict)return 0;return this.emitCodePoint(ys(this.result),this.consumed),this.errors&&(t!==M.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,r){let{decodeTree:n}=this,s=n[this.treeIndex],a=(s&W.VALUE_LENGTH)>>14;for(;r<t.length;){if(a===0&&(s&W.FLAG13)!==0){let l=(s&W.BRANCH_LENGTH)>>7;if(this.runConsumed===0){let o=s&W.JUMP_TABLE;if(t.charCodeAt(r)!==o)return this.result===0?0:this.emitNotTerminatedNamedEntity();r++,this.excess++,this.runConsumed++}for(;this.runConsumed<l;){if(r>=t.length)return-1;let o=this.runConsumed-1,A=n[this.treeIndex+1+(o>>1)],u=o%2===0?A&255:A>>8&255;if(t.charCodeAt(r)!==u)return this.runConsumed=0,this.result===0?0:this.emitNotTerminatedNamedEntity();r++,this.excess++,this.runConsumed++}this.runConsumed=0,this.treeIndex+=1+(l>>1),s=n[this.treeIndex],a=(s&W.VALUE_LENGTH)>>14}if(r>=t.length)break;let c=t.charCodeAt(r);if(c===M.SEMI&&a!==0&&(s&W.FLAG13)!==0)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);if(this.treeIndex=uc(n,s,this.treeIndex+Math.max(1,a),c),this.treeIndex<0)return this.result===0||this.decodeMode===me.Attribute&&(a===0||dc(c))?0:this.emitNotTerminatedNamedEntity();if(s=n[this.treeIndex],a=(s&W.VALUE_LENGTH)>>14,a!==0){if(c===M.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==me.Strict&&(s&W.FLAG13)===0&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}r++,this.excess++}return-1}emitNotTerminatedNamedEntity(){let{result:t,decodeTree:r}=this,n=(r[t]&W.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,n,this.consumed),this.errors?.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,r,n){let{decodeTree:s}=this;return this.emitCodePoint(r===1?s[t]&~(W.VALUE_LENGTH|W.FLAG13):s[t+1],n),r===3&&this.emitCodePoint(s[t+2],n),n}end(){switch(this.state){case G.NamedEntity:return this.result!==0&&(this.decodeMode!==me.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case G.NumericDecimal:return this.emitNumericEntity(0,2);case G.NumericHex:return this.emitNumericEntity(0,3);case G.NumericStart:return this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case G.EntityStart:return 0}}};function uc(e,t,r,n){let s=(t&W.BRANCH_LENGTH)>>7,a=t&W.JUMP_TABLE;if(s===0)return a!==0&&n===a?r:-1;if(a){let A=n-a;return A<0||A>=s?-1:e[r+A]-1}let c=s+1>>1,l=0,o=s-1;for(;l<=o;){let A=l+o>>>1,u=A>>1,T=e[r+u]>>(A&1)*8&255;if(T<n)l=A+1;else if(T>n)o=A-1;else return e[r+c+A]}return-1}var C;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(C||(C={}));var fe;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(fe||(fe={}));var $;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})($||($={}));var g;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(g||(g={}));var i;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(i||(i={}));var hc=new Map([[g.A,i.A],[g.ADDRESS,i.ADDRESS],[g.ANNOTATION_XML,i.ANNOTATION_XML],[g.APPLET,i.APPLET],[g.AREA,i.AREA],[g.ARTICLE,i.ARTICLE],[g.ASIDE,i.ASIDE],[g.B,i.B],[g.BASE,i.BASE],[g.BASEFONT,i.BASEFONT],[g.BGSOUND,i.BGSOUND],[g.BIG,i.BIG],[g.BLOCKQUOTE,i.BLOCKQUOTE],[g.BODY,i.BODY],[g.BR,i.BR],[g.BUTTON,i.BUTTON],[g.CAPTION,i.CAPTION],[g.CENTER,i.CENTER],[g.CODE,i.CODE],[g.COL,i.COL],[g.COLGROUP,i.COLGROUP],[g.DD,i.DD],[g.DESC,i.DESC],[g.DETAILS,i.DETAILS],[g.DIALOG,i.DIALOG],[g.DIR,i.DIR],[g.DIV,i.DIV],[g.DL,i.DL],[g.DT,i.DT],[g.EM,i.EM],[g.EMBED,i.EMBED],[g.FIELDSET,i.FIELDSET],[g.FIGCAPTION,i.FIGCAPTION],[g.FIGURE,i.FIGURE],[g.FONT,i.FONT],[g.FOOTER,i.FOOTER],[g.FOREIGN_OBJECT,i.FOREIGN_OBJECT],[g.FORM,i.FORM],[g.FRAME,i.FRAME],[g.FRAMESET,i.FRAMESET],[g.H1,i.H1],[g.H2,i.H2],[g.H3,i.H3],[g.H4,i.H4],[g.H5,i.H5],[g.H6,i.H6],[g.HEAD,i.HEAD],[g.HEADER,i.HEADER],[g.HGROUP,i.HGROUP],[g.HR,i.HR],[g.HTML,i.HTML],[g.I,i.I],[g.IMG,i.IMG],[g.IMAGE,i.IMAGE],[g.INPUT,i.INPUT],[g.IFRAME,i.IFRAME],[g.KEYGEN,i.KEYGEN],[g.LABEL,i.LABEL],[g.LI,i.LI],[g.LINK,i.LINK],[g.LISTING,i.LISTING],[g.MAIN,i.MAIN],[g.MALIGNMARK,i.MALIGNMARK],[g.MARQUEE,i.MARQUEE],[g.MATH,i.MATH],[g.MENU,i.MENU],[g.META,i.META],[g.MGLYPH,i.MGLYPH],[g.MI,i.MI],[g.MO,i.MO],[g.MN,i.MN],[g.MS,i.MS],[g.MTEXT,i.MTEXT],[g.NAV,i.NAV],[g.NOBR,i.NOBR],[g.NOFRAMES,i.NOFRAMES],[g.NOEMBED,i.NOEMBED],[g.NOSCRIPT,i.NOSCRIPT],[g.OBJECT,i.OBJECT],[g.OL,i.OL],[g.OPTGROUP,i.OPTGROUP],[g.OPTION,i.OPTION],[g.P,i.P],[g.PARAM,i.PARAM],[g.PLAINTEXT,i.PLAINTEXT],[g.PRE,i.PRE],[g.RB,i.RB],[g.RP,i.RP],[g.RT,i.RT],[g.RTC,i.RTC],[g.RUBY,i.RUBY],[g.S,i.S],[g.SCRIPT,i.SCRIPT],[g.SEARCH,i.SEARCH],[g.SECTION,i.SECTION],[g.SELECT,i.SELECT],[g.SOURCE,i.SOURCE],[g.SMALL,i.SMALL],[g.SPAN,i.SPAN],[g.STRIKE,i.STRIKE],[g.STRONG,i.STRONG],[g.STYLE,i.STYLE],[g.SUB,i.SUB],[g.SUMMARY,i.SUMMARY],[g.SUP,i.SUP],[g.TABLE,i.TABLE],[g.TBODY,i.TBODY],[g.TEMPLATE,i.TEMPLATE],[g.TEXTAREA,i.TEXTAREA],[g.TFOOT,i.TFOOT],[g.TD,i.TD],[g.TH,i.TH],[g.THEAD,i.THEAD],[g.TITLE,i.TITLE],[g.TR,i.TR],[g.TRACK,i.TRACK],[g.TT,i.TT],[g.U,i.U],[g.UL,i.UL],[g.SVG,i.SVG],[g.VAR,i.VAR],[g.WBR,i.WBR],[g.XMP,i.XMP]]);function Be(e){var t;return(t=hc.get(e))!==null&&t!==void 0?t:i.UNKNOWN}var I=i,Ss={[C.HTML]:new Set([I.ADDRESS,I.APPLET,I.AREA,I.ARTICLE,I.ASIDE,I.BASE,I.BASEFONT,I.BGSOUND,I.BLOCKQUOTE,I.BODY,I.BR,I.BUTTON,I.CAPTION,I.CENTER,I.COL,I.COLGROUP,I.DD,I.DETAILS,I.DIR,I.DIV,I.DL,I.DT,I.EMBED,I.FIELDSET,I.FIGCAPTION,I.FIGURE,I.FOOTER,I.FORM,I.FRAME,I.FRAMESET,I.H1,I.H2,I.H3,I.H4,I.H5,I.H6,I.HEAD,I.HEADER,I.HGROUP,I.HR,I.HTML,I.IFRAME,I.IMG,I.INPUT,I.LI,I.LINK,I.LISTING,I.MAIN,I.MARQUEE,I.MENU,I.META,I.NAV,I.NOEMBED,I.NOFRAMES,I.NOSCRIPT,I.OBJECT,I.OL,I.P,I.PARAM,I.PLAINTEXT,I.PRE,I.SCRIPT,I.SECTION,I.SELECT,I.SOURCE,I.STYLE,I.SUMMARY,I.TABLE,I.TBODY,I.TD,I.TEMPLATE,I.TEXTAREA,I.TFOOT,I.TH,I.THEAD,I.TITLE,I.TR,I.TRACK,I.UL,I.WBR,I.XMP]),[C.MATHML]:new Set([I.MI,I.MO,I.MN,I.MS,I.MTEXT,I.ANNOTATION_XML]),[C.SVG]:new Set([I.TITLE,I.FOREIGN_OBJECT,I.DESC]),[C.XLINK]:new Set,[C.XML]:new Set,[C.XMLNS]:new Set},ht=new Set([I.H1,I.H2,I.H3,I.H4,I.H5,I.H6]),Bp=new Set([g.STYLE,g.SCRIPT,g.XMP,g.IFRAME,g.NOEMBED,g.NOFRAMES,g.PLAINTEXT]);var h;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(h||(h={}));var J={DATA:h.DATA,RCDATA:h.RCDATA,RAWTEXT:h.RAWTEXT,SCRIPT_DATA:h.SCRIPT_DATA,PLAINTEXT:h.PLAINTEXT,CDATA_SECTION:h.CDATA_SECTION};function mc(e){return e>=d.DIGIT_0&&e<=d.DIGIT_9}function pt(e){return e>=d.LATIN_CAPITAL_A&&e<=d.LATIN_CAPITAL_Z}function gc(e){return e>=d.LATIN_SMALL_A&&e<=d.LATIN_SMALL_Z}function Te(e){return gc(e)||pt(e)}function _s(e){return Te(e)||mc(e)}function rr(e){return e+32}function Rs(e){return e===d.SPACE||e===d.LINE_FEED||e===d.TABULATION||e===d.FORM_FEED}function xs(e){return Rs(e)||e===d.SOLIDUS||e===d.GREATER_THAN_SIGN}function fc(e){return e===d.NULL?E.nullCharacterReference:e>1114111?E.characterReferenceOutsideUnicodeRange:Zt(e)?E.surrogateCharacterReference:qt(e)?E.noncharacterCharacterReference:$t(e)||e===d.CARRIAGE_RETURN?E.controlCharacterReference:null}var mt=class{constructor(t,r){this.options=t,this.handler=r,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=h.DATA,this.returnState=h.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new zt(r),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new tr(an,(n,s)=>{this.preprocessor.pos=this.entityStartPos+s-1,this._flushCodePointConsumedAsCharacterReference(n)},r.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(E.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:n=>{this._err(E.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+n)},validateNumericCharacterReference:n=>{let s=fc(n);s&&this._err(s,1)}}:void 0)}_err(t,r=0){var n,s;(s=(n=this.handler).onParseError)===null||s===void 0||s.call(n,this.preprocessor.getError(t,r))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;let t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t?.())}write(t,r,n){this.active=!0,this.preprocessor.write(t,r),this._runParsingLoop(),this.paused||n?.()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let r=0;r<t;r++)this.preprocessor.advance()}_consumeSequenceIfMatch(t,r){return this.preprocessor.startsWith(t,r)?(this._advanceBy(t.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:O.START_TAG,tagName:"",tagID:i.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:O.END_TAG,tagName:"",tagID:i.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:O.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:O.DOCTYPE,name:t,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(t,r){this.currentCharacterToken={type:t,chars:r,location:this.currentLocation}}_createAttr(t){this.currentAttr={name:t,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var t,r;let n=this.currentToken;if(er(n,this.currentAttr.name)===null){if(n.attrs.push(this.currentAttr),n.location&&this.currentLocation){let s=(t=(r=n.location).attrs)!==null&&t!==void 0?t:r.attrs=Object.create(null);s[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(E.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(t){this._emitCurrentCharacterToken(t.location),this.currentToken=null,t.location&&(t.location.endLine=this.preprocessor.line,t.location.endCol=this.preprocessor.col+1,t.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){let t=this.currentToken;this.prepareToken(t),t.tagID=Be(t.tagName),t.type===O.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(E.endTagWithAttributes),t.selfClosing&&this._err(E.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case O.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case O.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case O.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){let t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:O.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,r){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=r;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,r)}_emitCodePoint(t){let r=Rs(t)?O.WHITESPACE_CHARACTER:t===d.NULL?O.NULL_CHARACTER:O.CHARACTER;this._appendCharToCurrentCharacterToken(r,t<65536?String.fromCharCode(t):String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(O.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=h.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?me.Attribute:me.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===h.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===h.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===h.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case h.DATA:{this._stateData(t);break}case h.RCDATA:{this._stateRcdata(t);break}case h.RAWTEXT:{this._stateRawtext(t);break}case h.SCRIPT_DATA:{this._stateScriptData(t);break}case h.PLAINTEXT:{this._statePlaintext(t);break}case h.TAG_OPEN:{this._stateTagOpen(t);break}case h.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case h.TAG_NAME:{this._stateTagName(t);break}case h.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case h.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case h.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case h.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case h.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case h.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case h.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case h.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case h.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case h.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case h.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case h.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case h.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case h.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case h.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case h.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case h.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case h.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case h.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case h.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case h.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case h.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case h.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case h.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case h.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case h.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case h.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case h.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case h.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case h.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case h.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case h.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case h.BOGUS_COMMENT:{this._stateBogusComment(t);break}case h.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case h.COMMENT_START:{this._stateCommentStart(t);break}case h.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case h.COMMENT:{this._stateComment(t);break}case h.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case h.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case h.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case h.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case h.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case h.COMMENT_END:{this._stateCommentEnd(t);break}case h.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case h.DOCTYPE:{this._stateDoctype(t);break}case h.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case h.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case h.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case h.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case h.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case h.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case h.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case h.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case h.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case h.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case h.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case h.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case h.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case h.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case h.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case h.CDATA_SECTION:{this._stateCdataSection(t);break}case h.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case h.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case h.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case h.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case d.LESS_THAN_SIGN:{this.state=h.TAG_OPEN;break}case d.AMPERSAND:{this._startCharacterReference();break}case d.NULL:{this._err(E.unexpectedNullCharacter),this._emitCodePoint(t);break}case d.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case d.AMPERSAND:{this._startCharacterReference();break}case d.LESS_THAN_SIGN:{this.state=h.RCDATA_LESS_THAN_SIGN;break}case d.NULL:{this._err(E.unexpectedNullCharacter),this._emitChars(B);break}case d.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case d.LESS_THAN_SIGN:{this.state=h.RAWTEXT_LESS_THAN_SIGN;break}case d.NULL:{this._err(E.unexpectedNullCharacter),this._emitChars(B);break}case d.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case d.LESS_THAN_SIGN:{this.state=h.SCRIPT_DATA_LESS_THAN_SIGN;break}case d.NULL:{this._err(E.unexpectedNullCharacter),this._emitChars(B);break}case d.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case d.NULL:{this._err(E.unexpectedNullCharacter),this._emitChars(B);break}case d.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(Te(t))this._createStartTagToken(),this.state=h.TAG_NAME,this._stateTagName(t);else switch(t){case d.EXCLAMATION_MARK:{this.state=h.MARKUP_DECLARATION_OPEN;break}case d.SOLIDUS:{this.state=h.END_TAG_OPEN;break}case d.QUESTION_MARK:{this._err(E.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=h.BOGUS_COMMENT,this._stateBogusComment(t);break}case d.EOF:{this._err(E.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(E.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=h.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(Te(t))this._createEndTagToken(),this.state=h.TAG_NAME,this._stateTagName(t);else switch(t){case d.GREATER_THAN_SIGN:{this._err(E.missingEndTagName),this.state=h.DATA;break}case d.EOF:{this._err(E.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(E.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=h.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){let r=this.currentToken;switch(t){case d.SPACE:case d.LINE_FEED:case d.TABULATION:case d.FORM_FEED:{this.state=h.BEFORE_ATTRIBUTE_NAME;break}case d.SOLIDUS:{this.state=h.SELF_CLOSING_START_TAG;break}case d.GREATER_THAN_SIGN:{this.state=h.DATA,this.emitCurrentTagToken();break}case d.NULL:{this._err(E.unexpectedNullCharacter),r.tagName+=B;break}case d.EOF:{this._err(E.eofInTag),this._emitEOFToken();break}default:r.tagName+=String.fromCodePoint(pt(t)?rr(t):t)}}_stateRcdataLessThanSign(t){t===d.SOLIDUS?this.state=h.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=h.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){Te(t)?(this.state=h.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=h.RCDATA,this._stateRcdata(t))}handleSpecialEndTag(t){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();let r=this.currentToken;switch(r.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case d.SPACE:case d.LINE_FEED:case d.TABULATION:case d.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=h.BEFORE_ATTRIBUTE_NAME,!1;case d.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=h.SELF_CLOSING_START_TAG,!1;case d.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=h.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=h.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===d.SOLIDUS?this.state=h.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=h.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){Te(t)?(this.state=h.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=h.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=h.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case d.SOLIDUS:{this.state=h.SCRIPT_DATA_END_TAG_OPEN;break}case d.EXCLAMATION_MARK:{this.state=h.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=h.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){Te(t)?(this.state=h.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=h.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=h.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===d.HYPHEN_MINUS?(this.state=h.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=h.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===d.HYPHEN_MINUS?(this.state=h.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=h.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case d.HYPHEN_MINUS:{this.state=h.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case d.LESS_THAN_SIGN:{this.state=h.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case d.NULL:{this._err(E.unexpectedNullCharacter),this._emitChars(B);break}case d.EOF:{this._err(E.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case d.HYPHEN_MINUS:{this.state=h.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case d.LESS_THAN_SIGN:{this.state=h.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case d.NULL:{this._err(E.unexpectedNullCharacter),this.state=h.SCRIPT_DATA_ESCAPED,this._emitChars(B);break}case d.EOF:{this._err(E.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=h.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case d.HYPHEN_MINUS:{this._emitChars("-");break}case d.LESS_THAN_SIGN:{this.state=h.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case d.GREATER_THAN_SIGN:{this.state=h.SCRIPT_DATA,this._emitChars(">");break}case d.NULL:{this._err(E.unexpectedNullCharacter),this.state=h.SCRIPT_DATA_ESCAPED,this._emitChars(B);break}case d.EOF:{this._err(E.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=h.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===d.SOLIDUS?this.state=h.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Te(t)?(this._emitChars("<"),this.state=h.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=h.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){Te(t)?(this.state=h.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=h.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=h.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(Z.SCRIPT,!1)&&xs(this.preprocessor.peek(Z.SCRIPT.length))){this._emitCodePoint(t);for(let r=0;r<Z.SCRIPT.length;r++)this._emitCodePoint(this._consume());this.state=h.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=h.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case d.HYPHEN_MINUS:{this.state=h.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case d.LESS_THAN_SIGN:{this.state=h.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case d.NULL:{this._err(E.unexpectedNullCharacter),this._emitChars(B);break}case d.EOF:{this._err(E.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case d.HYPHEN_MINUS:{this.state=h.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case d.LESS_THAN_SIGN:{this.state=h.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case d.NULL:{this._err(E.unexpectedNullCharacter),this.state=h.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(B);break}case d.EOF:{this._err(E.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=h.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case d.HYPHEN_MINUS:{this._emitChars("-");break}case d.LESS_THAN_SIGN:{this.state=h.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case d.GREATER_THAN_SIGN:{this.state=h.SCRIPT_DATA,this._emitChars(">");break}case d.NULL:{this._err(E.unexpectedNullCharacter),this.state=h.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(B);break}case d.EOF:{this._err(E.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=h.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===d.SOLIDUS?(this.state=h.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=h.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(Z.SCRIPT,!1)&&xs(this.preprocessor.peek(Z.SCRIPT.length))){this._emitCodePoint(t);for(let r=0;r<Z.SCRIPT.length;r++)this._emitCodePoint(this._consume());this.state=h.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=h.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case d.SPACE:case d.LINE_FEED:case d.TABULATION:case d.FORM_FEED:break;case d.SOLIDUS:case d.GREATER_THAN_SIGN:case d.EOF:{this.state=h.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case d.EQUALS_SIGN:{this._err(E.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=h.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=h.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case d.SPACE:case d.LINE_FEED:case d.TABULATION:case d.FORM_FEED:case d.SOLIDUS:case d.GREATER_THAN_SIGN:case d.EOF:{this._leaveAttrName(),this.state=h.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case d.EQUALS_SIGN:{this._leaveAttrName(),this.state=h.BEFORE_ATTRIBUTE_VALUE;break}case d.QUOTATION_MARK:case d.APOSTROPHE:case d.LESS_THAN_SIGN:{this._err(E.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case d.NULL:{this._err(E.unexpectedNullCharacter),this.currentAttr.name+=B;break}default:this.currentAttr.name+=String.fromCodePoint(pt(t)?rr(t):t)}}_stateAfterAttributeName(t){switch(t){case d.SPACE:case d.LINE_FEED:case d.TABULATION:case d.FORM_FEED:break;case d.SOLIDUS:{this.state=h.SELF_CLOSING_START_TAG;break}case d.EQUALS_SIGN:{this.state=h.BEFORE_ATTRIBUTE_VALUE;break}case d.GREATER_THAN_SIGN:{this.state=h.DATA,this.emitCurrentTagToken();break}case d.EOF:{this._err(E.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=h.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case d.SPACE:case d.LINE_FEED:case d.TABULATION:case d.FORM_FEED:break;case d.QUOTATION_MARK:{this.state=h.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case d.APOSTROPHE:{this.state=h.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case d.GREATER_THAN_SIGN:{this._err(E.missingAttributeValue),this.state=h.DATA,this.emitCurrentTagToken();break}default:this.state=h.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case d.QUOTATION_MARK:{this.state=h.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case d.AMPERSAND:{this._startCharacterReference();break}case d.NULL:{this._err(E.unexpectedNullCharacter),this.currentAttr.value+=B;break}case d.EOF:{this._err(E.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case d.APOSTROPHE:{this.state=h.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case d.AMPERSAND:{this._startCharacterReference();break}case d.NULL:{this._err(E.unexpectedNullCharacter),this.currentAttr.value+=B;break}case d.EOF:{this._err(E.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case d.SPACE:case d.LINE_FEED:case d.TABULATION:case d.FORM_FEED:{this._leaveAttrValue(),this.state=h.BEFORE_ATTRIBUTE_NAME;break}case d.AMPERSAND:{this._startCharacterReference();break}case d.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=h.DATA,this.emitCurrentTagToken();break}case d.NULL:{this._err(E.unexpectedNullCharacter),this.currentAttr.value+=B;break}case d.QUOTATION_MARK:case d.APOSTROPHE:case d.LESS_THAN_SIGN:case d.EQUALS_SIGN:case d.GRAVE_ACCENT:{this._err(E.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case d.EOF:{this._err(E.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case d.SPACE:case d.LINE_FEED:case d.TABULATION:case d.FORM_FEED:{this._leaveAttrValue(),this.state=h.BEFORE_ATTRIBUTE_NAME;break}case d.SOLIDUS:{this._leaveAttrValue(),this.state=h.SELF_CLOSING_START_TAG;break}case d.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=h.DATA,this.emitCurrentTagToken();break}case d.EOF:{this._err(E.eofInTag),this._emitEOFToken();break}default:this._err(E.missingWhitespaceBetweenAttributes),this.state=h.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case d.GREATER_THAN_SIGN:{let r=this.currentToken;r.selfClosing=!0,this.state=h.DATA,this.emitCurrentTagToken();break}case d.EOF:{this._err(E.eofInTag),this._emitEOFToken();break}default:this._err(E.unexpectedSolidusInTag),this.state=h.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){let r=this.currentToken;switch(t){case d.GREATER_THAN_SIGN:{this.state=h.DATA,this.emitCurrentComment(r);break}case d.EOF:{this.emitCurrentComment(r),this._emitEOFToken();break}case d.NULL:{this._err(E.unexpectedNullCharacter),r.data+=B;break}default:r.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(Z.DASH_DASH,!0)?(this._createCommentToken(Z.DASH_DASH.length+1),this.state=h.COMMENT_START):this._consumeSequenceIfMatch(Z.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Z.DOCTYPE.length+1),this.state=h.DOCTYPE):this._consumeSequenceIfMatch(Z.CDATA_START,!0)?this.inForeignNode?this.state=h.CDATA_SECTION:(this._err(E.cdataInHtmlContent),this._createCommentToken(Z.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=h.BOGUS_COMMENT):this._ensureHibernation()||(this._err(E.incorrectlyOpenedComment),this._createCommentToken(2),this.state=h.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case d.HYPHEN_MINUS:{this.state=h.COMMENT_START_DASH;break}case d.GREATER_THAN_SIGN:{this._err(E.abruptClosingOfEmptyComment),this.state=h.DATA;let r=this.currentToken;this.emitCurrentComment(r);break}default:this.state=h.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){let r=this.currentToken;switch(t){case d.HYPHEN_MINUS:{this.state=h.COMMENT_END;break}case d.GREATER_THAN_SIGN:{this._err(E.abruptClosingOfEmptyComment),this.state=h.DATA,this.emitCurrentComment(r);break}case d.EOF:{this._err(E.eofInComment),this.emitCurrentComment(r),this._emitEOFToken();break}default:r.data+="-",this.state=h.COMMENT,this._stateComment(t)}}_stateComment(t){let r=this.currentToken;switch(t){case d.HYPHEN_MINUS:{this.state=h.COMMENT_END_DASH;break}case d.LESS_THAN_SIGN:{r.data+="<",this.state=h.COMMENT_LESS_THAN_SIGN;break}case d.NULL:{this._err(E.unexpectedNullCharacter),r.data+=B;break}case d.EOF:{this._err(E.eofInComment),this.emitCurrentComment(r),this._emitEOFToken();break}default:r.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){let r=this.currentToken;switch(t){case d.EXCLAMATION_MARK:{r.data+="!",this.state=h.COMMENT_LESS_THAN_SIGN_BANG;break}case d.LESS_THAN_SIGN:{r.data+="<";break}default:this.state=h.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===d.HYPHEN_MINUS?this.state=h.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=h.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===d.HYPHEN_MINUS?this.state=h.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=h.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==d.GREATER_THAN_SIGN&&t!==d.EOF&&this._err(E.nestedComment),this.state=h.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){let r=this.currentToken;switch(t){case d.HYPHEN_MINUS:{this.state=h.COMMENT_END;break}case d.EOF:{this._err(E.eofInComment),this.emitCurrentComment(r),this._emitEOFToken();break}default:r.data+="-",this.state=h.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){let r=this.currentToken;switch(t){case d.GREATER_THAN_SIGN:{this.state=h.DATA,this.emitCurrentComment(r);break}case d.EXCLAMATION_MARK:{this.state=h.COMMENT_END_BANG;break}case d.HYPHEN_MINUS:{r.data+="-";break}case d.EOF:{this._err(E.eofInComment),this.emitCurrentComment(r),this._emitEOFToken();break}default:r.data+="--",this.state=h.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){let r=this.currentToken;switch(t){case d.HYPHEN_MINUS:{r.data+="--!",this.state=h.COMMENT_END_DASH;break}case d.GREATER_THAN_SIGN:{this._err(E.incorrectlyClosedComment),this.state=h.DATA,this.emitCurrentComment(r);break}case d.EOF:{this._err(E.eofInComment),this.emitCurrentComment(r),this._emitEOFToken();break}default:r.data+="--!",this.state=h.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case d.SPACE:case d.LINE_FEED:case d.TABULATION:case d.FORM_FEED:{this.state=h.BEFORE_DOCTYPE_NAME;break}case d.GREATER_THAN_SIGN:{this.state=h.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case d.EOF:{this._err(E.eofInDoctype),this._createDoctypeToken(null);let r=this.currentToken;r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:this._err(E.missingWhitespaceBeforeDoctypeName),this.state=h.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(pt(t))this._createDoctypeToken(String.fromCharCode(rr(t))),this.state=h.DOCTYPE_NAME;else switch(t){case d.SPACE:case d.LINE_FEED:case d.TABULATION:case d.FORM_FEED:break;case d.NULL:{this._err(E.unexpectedNullCharacter),this._createDoctypeToken(B),this.state=h.DOCTYPE_NAME;break}case d.GREATER_THAN_SIGN:{this._err(E.missingDoctypeName),this._createDoctypeToken(null);let r=this.currentToken;r.forceQuirks=!0,this.emitCurrentDoctype(r),this.state=h.DATA;break}case d.EOF:{this._err(E.eofInDoctype),this._createDoctypeToken(null);let r=this.currentToken;r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(t)),this.state=h.DOCTYPE_NAME}}_stateDoctypeName(t){let r=this.currentToken;switch(t){case d.SPACE:case d.LINE_FEED:case d.TABULATION:case d.FORM_FEED:{this.state=h.AFTER_DOCTYPE_NAME;break}case d.GREATER_THAN_SIGN:{this.state=h.DATA,this.emitCurrentDoctype(r);break}case d.NULL:{this._err(E.unexpectedNullCharacter),r.name+=B;break}case d.EOF:{this._err(E.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:r.name+=String.fromCodePoint(pt(t)?rr(t):t)}}_stateAfterDoctypeName(t){let r=this.currentToken;switch(t){case d.SPACE:case d.LINE_FEED:case d.TABULATION:case d.FORM_FEED:break;case d.GREATER_THAN_SIGN:{this.state=h.DATA,this.emitCurrentDoctype(r);break}case d.EOF:{this._err(E.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Z.PUBLIC,!1)?this.state=h.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Z.SYSTEM,!1)?this.state=h.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(E.invalidCharacterSequenceAfterDoctypeName),r.forceQuirks=!0,this.state=h.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){let r=this.currentToken;switch(t){case d.SPACE:case d.LINE_FEED:case d.TABULATION:case d.FORM_FEED:{this.state=h.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case d.QUOTATION_MARK:{this._err(E.missingWhitespaceAfterDoctypePublicKeyword),r.publicId="",this.state=h.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case d.APOSTROPHE:{this._err(E.missingWhitespaceAfterDoctypePublicKeyword),r.publicId="",this.state=h.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case d.GREATER_THAN_SIGN:{this._err(E.missingDoctypePublicIdentifier),r.forceQuirks=!0,this.state=h.DATA,this.emitCurrentDoctype(r);break}case d.EOF:{this._err(E.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:this._err(E.missingQuoteBeforeDoctypePublicIdentifier),r.forceQuirks=!0,this.state=h.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){let r=this.currentToken;switch(t){case d.SPACE:case d.LINE_FEED:case d.TABULATION:case d.FORM_FEED:break;case d.QUOTATION_MARK:{r.publicId="",this.state=h.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case d.APOSTROPHE:{r.publicId="",this.state=h.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case d.GREATER_THAN_SIGN:{this._err(E.missingDoctypePublicIdentifier),r.forceQuirks=!0,this.state=h.DATA,this.emitCurrentDoctype(r);break}case d.EOF:{this._err(E.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:this._err(E.missingQuoteBeforeDoctypePublicIdentifier),r.forceQuirks=!0,this.state=h.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){let r=this.currentToken;switch(t){case d.QUOTATION_MARK:{this.state=h.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case d.NULL:{this._err(E.unexpectedNullCharacter),r.publicId+=B;break}case d.GREATER_THAN_SIGN:{this._err(E.abruptDoctypePublicIdentifier),r.forceQuirks=!0,this.emitCurrentDoctype(r),this.state=h.DATA;break}case d.EOF:{this._err(E.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:r.publicId+=String.fromCodePoint(t)}}_stateDoctypePublicIdentifierSingleQuoted(t){let r=this.currentToken;switch(t){case d.APOSTROPHE:{this.state=h.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case d.NULL:{this._err(E.unexpectedNullCharacter),r.publicId+=B;break}case d.GREATER_THAN_SIGN:{this._err(E.abruptDoctypePublicIdentifier),r.forceQuirks=!0,this.emitCurrentDoctype(r),this.state=h.DATA;break}case d.EOF:{this._err(E.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:r.publicId+=String.fromCodePoint(t)}}_stateAfterDoctypePublicIdentifier(t){let r=this.currentToken;switch(t){case d.SPACE:case d.LINE_FEED:case d.TABULATION:case d.FORM_FEED:{this.state=h.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case d.GREATER_THAN_SIGN:{this.state=h.DATA,this.emitCurrentDoctype(r);break}case d.QUOTATION_MARK:{this._err(E.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),r.systemId="",this.state=h.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case d.APOSTROPHE:{this._err(E.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),r.systemId="",this.state=h.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case d.EOF:{this._err(E.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:this._err(E.missingQuoteBeforeDoctypeSystemIdentifier),r.forceQuirks=!0,this.state=h.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){let r=this.currentToken;switch(t){case d.SPACE:case d.LINE_FEED:case d.TABULATION:case d.FORM_FEED:break;case d.GREATER_THAN_SIGN:{this.emitCurrentDoctype(r),this.state=h.DATA;break}case d.QUOTATION_MARK:{r.systemId="",this.state=h.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case d.APOSTROPHE:{r.systemId="",this.state=h.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case d.EOF:{this._err(E.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:this._err(E.missingQuoteBeforeDoctypeSystemIdentifier),r.forceQuirks=!0,this.state=h.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){let r=this.currentToken;switch(t){case d.SPACE:case d.LINE_FEED:case d.TABULATION:case d.FORM_FEED:{this.state=h.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case d.QUOTATION_MARK:{this._err(E.missingWhitespaceAfterDoctypeSystemKeyword),r.systemId="",this.state=h.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case d.APOSTROPHE:{this._err(E.missingWhitespaceAfterDoctypeSystemKeyword),r.systemId="",this.state=h.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case d.GREATER_THAN_SIGN:{this._err(E.missingDoctypeSystemIdentifier),r.forceQuirks=!0,this.state=h.DATA,this.emitCurrentDoctype(r);break}case d.EOF:{this._err(E.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:this._err(E.missingQuoteBeforeDoctypeSystemIdentifier),r.forceQuirks=!0,this.state=h.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){let r=this.currentToken;switch(t){case d.SPACE:case d.LINE_FEED:case d.TABULATION:case d.FORM_FEED:break;case d.QUOTATION_MARK:{r.systemId="",this.state=h.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case d.APOSTROPHE:{r.systemId="",this.state=h.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case d.GREATER_THAN_SIGN:{this._err(E.missingDoctypeSystemIdentifier),r.forceQuirks=!0,this.state=h.DATA,this.emitCurrentDoctype(r);break}case d.EOF:{this._err(E.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:this._err(E.missingQuoteBeforeDoctypeSystemIdentifier),r.forceQuirks=!0,this.state=h.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){let r=this.currentToken;switch(t){case d.QUOTATION_MARK:{this.state=h.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case d.NULL:{this._err(E.unexpectedNullCharacter),r.systemId+=B;break}case d.GREATER_THAN_SIGN:{this._err(E.abruptDoctypeSystemIdentifier),r.forceQuirks=!0,this.emitCurrentDoctype(r),this.state=h.DATA;break}case d.EOF:{this._err(E.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:r.systemId+=String.fromCodePoint(t)}}_stateDoctypeSystemIdentifierSingleQuoted(t){let r=this.currentToken;switch(t){case d.APOSTROPHE:{this.state=h.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case d.NULL:{this._err(E.unexpectedNullCharacter),r.systemId+=B;break}case d.GREATER_THAN_SIGN:{this._err(E.abruptDoctypeSystemIdentifier),r.forceQuirks=!0,this.emitCurrentDoctype(r),this.state=h.DATA;break}case d.EOF:{this._err(E.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:r.systemId+=String.fromCodePoint(t)}}_stateAfterDoctypeSystemIdentifier(t){let r=this.currentToken;switch(t){case d.SPACE:case d.LINE_FEED:case d.TABULATION:case d.FORM_FEED:break;case d.GREATER_THAN_SIGN:{this.emitCurrentDoctype(r),this.state=h.DATA;break}case d.EOF:{this._err(E.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:this._err(E.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=h.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){let r=this.currentToken;switch(t){case d.GREATER_THAN_SIGN:{this.emitCurrentDoctype(r),this.state=h.DATA;break}case d.NULL:{this._err(E.unexpectedNullCharacter);break}case d.EOF:{this.emitCurrentDoctype(r),this._emitEOFToken();break}default:}}_stateCdataSection(t){switch(t){case d.RIGHT_SQUARE_BRACKET:{this.state=h.CDATA_SECTION_BRACKET;break}case d.EOF:{this._err(E.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===d.RIGHT_SQUARE_BRACKET?this.state=h.CDATA_SECTION_END:(this._emitChars("]"),this.state=h.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case d.GREATER_THAN_SIGN:{this.state=h.DATA;break}case d.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=h.CDATA_SECTION,this._stateCdataSection(t)}}_stateCharacterReference(){let t=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(t<0)if(this.preprocessor.lastChunkWritten)t=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}t===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(d.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&_s(this.preprocessor.peek(1))?h.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){_s(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===d.SEMICOLON&&this._err(E.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}};var Bs=new Set([i.DD,i.DT,i.LI,i.OPTGROUP,i.OPTION,i.P,i.RB,i.RP,i.RT,i.RTC]),Ls=new Set([...Bs,i.CAPTION,i.COLGROUP,i.TBODY,i.TD,i.TFOOT,i.TH,i.THEAD,i.TR]),nr=new Set([i.APPLET,i.CAPTION,i.HTML,i.MARQUEE,i.OBJECT,i.TABLE,i.TD,i.TEMPLATE,i.TH]),Ec=new Set([...nr,i.OL,i.UL]),Tc=new Set([...nr,i.BUTTON]),Os=new Set([i.ANNOTATION_XML,i.MI,i.MN,i.MO,i.MS,i.MTEXT]),Ds=new Set([i.DESC,i.FOREIGN_OBJECT,i.TITLE]),Cc=new Set([i.TR,i.TEMPLATE,i.HTML]),Ic=new Set([i.TBODY,i.TFOOT,i.THEAD,i.TEMPLATE,i.HTML]),bc=new Set([i.TABLE,i.TEMPLATE,i.HTML]),yc=new Set([i.TD,i.TH]),sr=class{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,r,n){this.treeAdapter=r,this.handler=n,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=i.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===i.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===C.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(t,r){this.stackTop++,this.items[this.stackTop]=t,this.current=t,this.tagIDs[this.stackTop]=r,this.currentTagId=r,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(t,r,!0)}pop(){let t=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,r){let n=this._indexOf(t);this.items[n]=r,n===this.stackTop&&(this.current=r)}insertAfter(t,r,n){let s=this._indexOf(t)+1;this.items.splice(s,0,r),this.tagIDs.splice(s,0,n),this.stackTop++,s===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,s===this.stackTop)}popUntilTagNamePopped(t){let r=this.stackTop+1;do r=this.tagIDs.lastIndexOf(t,r-1);while(r>0&&this.treeAdapter.getNamespaceURI(this.items[r])!==C.HTML);this.shortenToLength(Math.max(r,0))}shortenToLength(t){for(;this.stackTop>=t;){let r=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(r,this.stackTop<t)}}popUntilElementPopped(t){let r=this._indexOf(t);this.shortenToLength(Math.max(r,0))}popUntilPopped(t,r){let n=this._indexOfTagNames(t,r);this.shortenToLength(Math.max(n,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(ht,C.HTML)}popUntilTableCellPopped(){this.popUntilPopped(yc,C.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(t,r){for(let n=this.stackTop;n>=0;n--)if(t.has(this.tagIDs[n])&&this.treeAdapter.getNamespaceURI(this.items[n])===r)return n;return-1}clearBackTo(t,r){let n=this._indexOfTagNames(t,r);this.shortenToLength(n+1)}clearBackToTableContext(){this.clearBackTo(bc,C.HTML)}clearBackToTableBodyContext(){this.clearBackTo(Ic,C.HTML)}clearBackToTableRowContext(){this.clearBackTo(Cc,C.HTML)}remove(t){let r=this._indexOf(t);r>=0&&(r===this.stackTop?this.pop():(this.items.splice(r,1),this.tagIDs.splice(r,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===i.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){let r=this._indexOf(t)-1;return r>=0?this.items[r]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===i.HTML}hasInDynamicScope(t,r){for(let n=this.stackTop;n>=0;n--){let s=this.tagIDs[n];switch(this.treeAdapter.getNamespaceURI(this.items[n])){case C.HTML:{if(s===t)return!0;if(r.has(s))return!1;break}case C.SVG:{if(Ds.has(s))return!1;break}case C.MATHML:{if(Os.has(s))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,nr)}hasInListItemScope(t){return this.hasInDynamicScope(t,Ec)}hasInButtonScope(t){return this.hasInDynamicScope(t,Tc)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){let r=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case C.HTML:{if(ht.has(r))return!0;if(nr.has(r))return!1;break}case C.SVG:{if(Ds.has(r))return!1;break}case C.MATHML:{if(Os.has(r))return!1;break}}}return!0}hasInTableScope(t){for(let r=this.stackTop;r>=0;r--)if(this.treeAdapter.getNamespaceURI(this.items[r])===C.HTML)switch(this.tagIDs[r]){case t:return!0;case i.TABLE:case i.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===C.HTML)switch(this.tagIDs[t]){case i.TBODY:case i.THEAD:case i.TFOOT:return!0;case i.TABLE:case i.HTML:return!1}return!0}hasInSelectScope(t){for(let r=this.stackTop;r>=0;r--)if(this.treeAdapter.getNamespaceURI(this.items[r])===C.HTML)switch(this.tagIDs[r]){case t:return!0;case i.OPTION:case i.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&Bs.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&Ls.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&Ls.has(this.currentTagId);)this.pop()}};var Ae;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(Ae||(Ae={}));var ks={type:Ae.Marker},ir=class{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,r){let n=[],s=r.length,a=this.treeAdapter.getTagName(t),c=this.treeAdapter.getNamespaceURI(t);for(let l=0;l<this.entries.length;l++){let o=this.entries[l];if(o.type===Ae.Marker)break;let{element:A}=o;if(this.treeAdapter.getTagName(A)===a&&this.treeAdapter.getNamespaceURI(A)===c){let u=this.treeAdapter.getAttrList(A);u.length===s&&n.push({idx:l,attrs:u})}}return n}_ensureNoahArkCondition(t){if(this.entries.length<3)return;let r=this.treeAdapter.getAttrList(t),n=this._getNoahArkConditionCandidates(t,r);if(n.length<3)return;let s=new Map(r.map(c=>[c.name,c.value])),a=0;for(let c=0;c<n.length;c++){let l=n[c];l.attrs.every(o=>s.get(o.name)===o.value)&&(a+=1,a>=3&&this.entries.splice(l.idx,1))}}insertMarker(){this.entries.unshift(ks)}pushElement(t,r){this._ensureNoahArkCondition(t),this.entries.unshift({type:Ae.Element,element:t,token:r})}insertElementAfterBookmark(t,r){let n=this.entries.indexOf(this.bookmark);this.entries.splice(n,0,{type:Ae.Element,element:t,token:r})}removeEntry(t){let r=this.entries.indexOf(t);r!==-1&&this.entries.splice(r,1)}clearToLastMarker(){let t=this.entries.indexOf(ks);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){let r=this.entries.find(n=>n.type===Ae.Marker||this.treeAdapter.getTagName(n.element)===t);return r&&r.type===Ae.Element?r:null}getElementEntry(t){return this.entries.find(r=>r.type===Ae.Element&&r.element===t)}};var de={createDocument(){return{nodeName:"#document",mode:$.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,r){return{nodeName:e,tagName:e,attrs:r,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,r){let n=e.childNodes.indexOf(r);e.childNodes.splice(n,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,r,n){let s=e.childNodes.find(a=>a.nodeName==="#documentType");if(s)s.name=t,s.publicId=r,s.systemId=n;else{let a={nodeName:"#documentType",name:t,publicId:r,systemId:n,parentNode:null};de.appendChild(e,a)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){let t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){let r=e.childNodes[e.childNodes.length-1];if(de.isTextNode(r)){r.value+=t;return}}de.appendChild(e,de.createTextNode(t))},insertTextBefore(e,t,r){let n=e.childNodes[e.childNodes.indexOf(r)-1];n&&de.isTextNode(n)?n.value+=t:de.insertBefore(e,de.createTextNode(t),r)},adoptAttributes(e,t){let r=new Set(e.attrs.map(n=>n.name));for(let n=0;n<t.length;n++)r.has(t[n].name)||e.attrs.push(t[n])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName==="#text"},isCommentNode(e){return e.nodeName==="#comment"},isDocumentTypeNode(e){return e.nodeName==="#documentType"},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,"tagName")},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}};var Ps="html",wc="about:legacy-compat",Nc="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",Ms=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],Sc=[...Ms,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],_c=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),Fs=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],xc=[...Fs,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function vs(e,t){return t.some(r=>e.startsWith(r))}function Us(e){return e.name===Ps&&e.publicId===null&&(e.systemId===null||e.systemId===wc)}function Hs(e){if(e.name!==Ps)return $.QUIRKS;let{systemId:t}=e;if(t&&t.toLowerCase()===Nc)return $.QUIRKS;let{publicId:r}=e;if(r!==null){if(r=r.toLowerCase(),_c.has(r))return $.QUIRKS;let n=t===null?Sc:Ms;if(vs(r,n))return $.QUIRKS;if(n=t===null?Fs:xc,vs(r,n))return $.LIMITED_QUIRKS}return $.NO_QUIRKS}var Qs={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},Lc="definitionurl",Oc="definitionURL",Dc=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),Bc=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:C.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:C.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:C.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:C.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:C.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:C.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:C.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:C.XML}],["xml:space",{prefix:"xml",name:"space",namespace:C.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:C.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:C.XMLNS}]]),kc=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),vc=new Set([i.B,i.BIG,i.BLOCKQUOTE,i.BODY,i.BR,i.CENTER,i.CODE,i.DD,i.DIV,i.DL,i.DT,i.EM,i.EMBED,i.H1,i.H2,i.H3,i.H4,i.H5,i.H6,i.HEAD,i.HR,i.I,i.IMG,i.LI,i.LISTING,i.MENU,i.META,i.NOBR,i.OL,i.P,i.PRE,i.RUBY,i.S,i.SMALL,i.SPAN,i.STRONG,i.STRIKE,i.SUB,i.SUP,i.TABLE,i.TT,i.U,i.UL,i.VAR]);function Ys(e){let t=e.tagID;return t===i.FONT&&e.attrs.some(({name:n})=>n===fe.COLOR||n===fe.SIZE||n===fe.FACE)||vc.has(t)}function cn(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===Lc){e.attrs[t].name=Oc;break}}function ln(e){for(let t=0;t<e.attrs.length;t++){let r=Dc.get(e.attrs[t].name);r!=null&&(e.attrs[t].name=r)}}function ar(e){for(let t=0;t<e.attrs.length;t++){let r=Bc.get(e.attrs[t].name);r&&(e.attrs[t].prefix=r.prefix,e.attrs[t].name=r.name,e.attrs[t].namespace=r.namespace)}}function Gs(e){let t=kc.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=Be(e.tagName))}function Pc(e,t){return t===C.MATHML&&(e===i.MI||e===i.MO||e===i.MN||e===i.MS||e===i.MTEXT)}function Mc(e,t,r){if(t===C.MATHML&&e===i.ANNOTATION_XML){for(let n=0;n<r.length;n++)if(r[n].name===fe.ENCODING){let s=r[n].value.toLowerCase();return s===Qs.TEXT_HTML||s===Qs.APPLICATION_XML}}return t===C.SVG&&(e===i.FOREIGN_OBJECT||e===i.DESC||e===i.TITLE)}function Ks(e,t,r,n){return(!n||n===C.HTML)&&Mc(e,t,r)||(!n||n===C.MATHML)&&Pc(e,t)}var Fc="hidden",Uc=8,Hc=3,p;(function(e){e[e.INITIAL=0]="INITIAL",e[e.BEFORE_HTML=1]="BEFORE_HTML",e[e.BEFORE_HEAD=2]="BEFORE_HEAD",e[e.IN_HEAD=3]="IN_HEAD",e[e.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",e[e.AFTER_HEAD=5]="AFTER_HEAD",e[e.IN_BODY=6]="IN_BODY",e[e.TEXT=7]="TEXT",e[e.IN_TABLE=8]="IN_TABLE",e[e.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",e[e.IN_CAPTION=10]="IN_CAPTION",e[e.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",e[e.IN_TABLE_BODY=12]="IN_TABLE_BODY",e[e.IN_ROW=13]="IN_ROW",e[e.IN_CELL=14]="IN_CELL",e[e.IN_SELECT=15]="IN_SELECT",e[e.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",e[e.IN_TEMPLATE=17]="IN_TEMPLATE",e[e.AFTER_BODY=18]="AFTER_BODY",e[e.IN_FRAMESET=19]="IN_FRAMESET",e[e.AFTER_FRAMESET=20]="AFTER_FRAMESET",e[e.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",e[e.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(p||(p={}));var Qc={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},Xs=new Set([i.TABLE,i.TBODY,i.TFOOT,i.THEAD,i.TR]),Js={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:de,onParseError:null},yt=class{constructor(t,r,n=null,s=null){this.fragmentContext=n,this.scriptHandler=s,this.currentToken=null,this.stopped=!1,this.insertionMode=p.INITIAL,this.originalInsertionMode=p.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...Js,...t},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=r??this.treeAdapter.createDocument(),this.tokenizer=new mt(this.options,this),this.activeFormattingElements=new ir(this.treeAdapter),this.fragmentContextID=n?Be(this.treeAdapter.getTagName(n)):i.UNKNOWN,this._setContextModes(n??this.document,this.fragmentContextID),this.openElements=new sr(this.document,this.treeAdapter,this)}static parse(t,r){let n=new this(r);return n.tokenizer.write(t,!0),n.document}static getFragmentParser(t,r){let n={...Js,...r};t??(t=n.treeAdapter.createElement(g.TEMPLATE,C.HTML,[]));let s=n.treeAdapter.createElement("documentmock",C.HTML,[]),a=new this(n,s,t);return a.fragmentContextID===i.TEMPLATE&&a.tmplInsertionModeStack.unshift(p.IN_TEMPLATE),a._initTokenizerForFragmentParsing(),a._insertFakeRootElement(),a._resetInsertionMode(),a._findFormInFragmentContext(),a}getFragment(){let t=this.treeAdapter.getFirstChild(this.document),r=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,r),r}_err(t,r,n){var s;if(!this.onParseError)return;let a=(s=t.location)!==null&&s!==void 0?s:Qc,c={code:r,startLine:a.startLine,startCol:a.startCol,startOffset:a.startOffset,endLine:n?a.startLine:a.endLine,endCol:n?a.startCol:a.endCol,endOffset:n?a.startOffset:a.endOffset};this.onParseError(c)}onItemPush(t,r,n){var s,a;(a=(s=this.treeAdapter).onItemPush)===null||a===void 0||a.call(s,t),n&&this.openElements.stackTop>0&&this._setContextModes(t,r)}onItemPop(t,r){var n,s;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(s=(n=this.treeAdapter).onItemPop)===null||s===void 0||s.call(n,t,this.openElements.current),r){let a,c;this.openElements.stackTop===0&&this.fragmentContext?(a=this.fragmentContext,c=this.fragmentContextID):{current:a,currentTagId:c}=this.openElements,this._setContextModes(a,c)}}_setContextModes(t,r){let n=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===C.HTML;this.currentNotInHTML=!n,this.tokenizer.inForeignNode=!n&&t!==void 0&&r!==void 0&&!this._isIntegrationPoint(r,t)}_switchToTextParsing(t,r){this._insertElement(t,C.HTML),this.tokenizer.state=r,this.originalInsertionMode=this.insertionMode,this.insertionMode=p.TEXT}switchToPlaintextParsing(){this.insertionMode=p.TEXT,this.originalInsertionMode=p.IN_BODY,this.tokenizer.state=J.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===g.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==C.HTML))switch(this.fragmentContextID){case i.TITLE:case i.TEXTAREA:{this.tokenizer.state=J.RCDATA;break}case i.STYLE:case i.XMP:case i.IFRAME:case i.NOEMBED:case i.NOFRAMES:case i.NOSCRIPT:{this.tokenizer.state=J.RAWTEXT;break}case i.SCRIPT:{this.tokenizer.state=J.SCRIPT_DATA;break}case i.PLAINTEXT:{this.tokenizer.state=J.PLAINTEXT;break}default:}}_setDocumentType(t){let r=t.name||"",n=t.publicId||"",s=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,r,n,s),t.location){let c=this.treeAdapter.getChildNodes(this.document).find(l=>this.treeAdapter.isDocumentTypeNode(l));c&&this.treeAdapter.setNodeSourceCodeLocation(c,t.location)}}_attachElementToTree(t,r){if(this.options.sourceCodeLocationInfo){let n=r&&{...r,startTag:r};this.treeAdapter.setNodeSourceCodeLocation(t,n)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{let n=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(n??this.document,t)}}_appendElement(t,r){let n=this.treeAdapter.createElement(t.tagName,r,t.attrs);this._attachElementToTree(n,t.location)}_insertElement(t,r){let n=this.treeAdapter.createElement(t.tagName,r,t.attrs);this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID)}_insertFakeElement(t,r){let n=this.treeAdapter.createElement(t,C.HTML,[]);this._attachElementToTree(n,null),this.openElements.push(n,r)}_insertTemplate(t){let r=this.treeAdapter.createElement(t.tagName,C.HTML,t.attrs),n=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(r,n),this._attachElementToTree(r,t.location),this.openElements.push(r,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,null)}_insertFakeRootElement(){let t=this.treeAdapter.createElement(g.HTML,C.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,i.HTML)}_appendCommentNode(t,r){let n=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(r,n),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,t.location)}_insertCharacters(t){let r,n;if(this._shouldFosterParentOnInsertion()?({parent:r,beforeElement:n}=this._findFosterParentingLocation(),n?this.treeAdapter.insertTextBefore(r,t.chars,n):this.treeAdapter.insertText(r,t.chars)):(r=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(r,t.chars)),!t.location)return;let s=this.treeAdapter.getChildNodes(r),a=n?s.lastIndexOf(n):s.length,c=s[a-1];if(this.treeAdapter.getNodeSourceCodeLocation(c)){let{endLine:o,endCol:A,endOffset:u}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(c,{endLine:o,endCol:A,endOffset:u})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(c,t.location)}_adoptNodes(t,r){for(let n=this.treeAdapter.getFirstChild(t);n;n=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(n),this.treeAdapter.appendChild(r,n)}_setEndLocation(t,r){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&r.location){let n=r.location,s=this.treeAdapter.getTagName(t),a=r.type===O.END_TAG&&s===r.tagName?{endTag:{...n},endLine:n.endLine,endCol:n.endCol,endOffset:n.endOffset}:{endLine:n.startLine,endCol:n.startCol,endOffset:n.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,a)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let r,n;return this.openElements.stackTop===0&&this.fragmentContext?(r=this.fragmentContext,n=this.fragmentContextID):{current:r,currentTagId:n}=this.openElements,t.tagID===i.SVG&&this.treeAdapter.getTagName(r)===g.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(r)===C.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===i.MGLYPH||t.tagID===i.MALIGNMARK)&&n!==void 0&&!this._isIntegrationPoint(n,r,C.HTML)}_processToken(t){switch(t.type){case O.CHARACTER:{this.onCharacter(t);break}case O.NULL_CHARACTER:{this.onNullCharacter(t);break}case O.COMMENT:{this.onComment(t);break}case O.DOCTYPE:{this.onDoctype(t);break}case O.START_TAG:{this._processStartTag(t);break}case O.END_TAG:{this.onEndTag(t);break}case O.EOF:{this.onEof(t);break}case O.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,r,n){let s=this.treeAdapter.getNamespaceURI(r),a=this.treeAdapter.getAttrList(r);return Ks(t,s,a,n)}_reconstructActiveFormattingElements(){let t=this.activeFormattingElements.entries.length;if(t){let r=this.activeFormattingElements.entries.findIndex(s=>s.type===Ae.Marker||this.openElements.contains(s.element)),n=r===-1?t-1:r-1;for(let s=n;s>=0;s--){let a=this.activeFormattingElements.entries[s];this._insertElement(a.token,this.treeAdapter.getNamespaceURI(a.element)),a.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=p.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(i.P),this.openElements.popUntilTagNamePopped(i.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case i.TR:{this.insertionMode=p.IN_ROW;return}case i.TBODY:case i.THEAD:case i.TFOOT:{this.insertionMode=p.IN_TABLE_BODY;return}case i.CAPTION:{this.insertionMode=p.IN_CAPTION;return}case i.COLGROUP:{this.insertionMode=p.IN_COLUMN_GROUP;return}case i.TABLE:{this.insertionMode=p.IN_TABLE;return}case i.BODY:{this.insertionMode=p.IN_BODY;return}case i.FRAMESET:{this.insertionMode=p.IN_FRAMESET;return}case i.SELECT:{this._resetInsertionModeForSelect(t);return}case i.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case i.HTML:{this.insertionMode=this.headElement?p.AFTER_HEAD:p.BEFORE_HEAD;return}case i.TD:case i.TH:{if(t>0){this.insertionMode=p.IN_CELL;return}break}case i.HEAD:{if(t>0){this.insertionMode=p.IN_HEAD;return}break}}this.insertionMode=p.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let r=t-1;r>0;r--){let n=this.openElements.tagIDs[r];if(n===i.TEMPLATE)break;if(n===i.TABLE){this.insertionMode=p.IN_SELECT_IN_TABLE;return}}this.insertionMode=p.IN_SELECT}_isElementCausesFosterParenting(t){return Xs.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){let r=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case i.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(r)===C.HTML)return{parent:this.treeAdapter.getTemplateContent(r),beforeElement:null};break}case i.TABLE:{let n=this.treeAdapter.getParentNode(r);return n?{parent:n,beforeElement:r}:{parent:this.openElements.items[t-1],beforeElement:null}}default:}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){let r=this._findFosterParentingLocation();r.beforeElement?this.treeAdapter.insertBefore(r.parent,t,r.beforeElement):this.treeAdapter.appendChild(r.parent,t)}_isSpecialElement(t,r){let n=this.treeAdapter.getNamespaceURI(t);return Ss[n].has(r)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){fA(this,t);return}switch(this.insertionMode){case p.INITIAL:{gt(this,t);break}case p.BEFORE_HTML:{Et(this,t);break}case p.BEFORE_HEAD:{Tt(this,t);break}case p.IN_HEAD:{Ct(this,t);break}case p.IN_HEAD_NO_SCRIPT:{It(this,t);break}case p.AFTER_HEAD:{bt(this,t);break}case p.IN_BODY:case p.IN_CAPTION:case p.IN_CELL:case p.IN_TEMPLATE:{$s(this,t);break}case p.TEXT:case p.IN_SELECT:case p.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case p.IN_TABLE:case p.IN_TABLE_BODY:case p.IN_ROW:{An(this,t);break}case p.IN_TABLE_TEXT:{ni(this,t);break}case p.IN_COLUMN_GROUP:{cr(this,t);break}case p.AFTER_BODY:{lr(this,t);break}case p.AFTER_AFTER_BODY:{or(this,t);break}default:}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){gA(this,t);return}switch(this.insertionMode){case p.INITIAL:{gt(this,t);break}case p.BEFORE_HTML:{Et(this,t);break}case p.BEFORE_HEAD:{Tt(this,t);break}case p.IN_HEAD:{Ct(this,t);break}case p.IN_HEAD_NO_SCRIPT:{It(this,t);break}case p.AFTER_HEAD:{bt(this,t);break}case p.TEXT:{this._insertCharacters(t);break}case p.IN_TABLE:case p.IN_TABLE_BODY:case p.IN_ROW:{An(this,t);break}case p.IN_COLUMN_GROUP:{cr(this,t);break}case p.AFTER_BODY:{lr(this,t);break}case p.AFTER_AFTER_BODY:{or(this,t);break}default:}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){dn(this,t);return}switch(this.insertionMode){case p.INITIAL:case p.BEFORE_HTML:case p.BEFORE_HEAD:case p.IN_HEAD:case p.IN_HEAD_NO_SCRIPT:case p.AFTER_HEAD:case p.IN_BODY:case p.IN_TABLE:case p.IN_CAPTION:case p.IN_COLUMN_GROUP:case p.IN_TABLE_BODY:case p.IN_ROW:case p.IN_CELL:case p.IN_SELECT:case p.IN_SELECT_IN_TABLE:case p.IN_TEMPLATE:case p.IN_FRAMESET:case p.AFTER_FRAMESET:{dn(this,t);break}case p.IN_TABLE_TEXT:{ft(this,t);break}case p.AFTER_BODY:{Vc(this,t);break}case p.AFTER_AFTER_BODY:case p.AFTER_AFTER_FRAMESET:{Xc(this,t);break}default:}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case p.INITIAL:{Zc(this,t);break}case p.BEFORE_HEAD:case p.IN_HEAD:case p.IN_HEAD_NO_SCRIPT:case p.AFTER_HEAD:{this._err(t,E.misplacedDoctype);break}case p.IN_TABLE_TEXT:{ft(this,t);break}default:}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,E.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?EA(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case p.INITIAL:{gt(this,t);break}case p.BEFORE_HTML:{$c(this,t);break}case p.BEFORE_HEAD:{zc(this,t);break}case p.IN_HEAD:{ue(this,t);break}case p.IN_HEAD_NO_SCRIPT:{rl(this,t);break}case p.AFTER_HEAD:{sl(this,t);break}case p.IN_BODY:{j(this,t);break}case p.IN_TABLE:{Ve(this,t);break}case p.IN_TABLE_TEXT:{ft(this,t);break}case p.IN_CAPTION:{eA(this,t);break}case p.IN_COLUMN_GROUP:{mn(this,t);break}case p.IN_TABLE_BODY:{ur(this,t);break}case p.IN_ROW:{hr(this,t);break}case p.IN_CELL:{nA(this,t);break}case p.IN_SELECT:{ai(this,t);break}case p.IN_SELECT_IN_TABLE:{iA(this,t);break}case p.IN_TEMPLATE:{oA(this,t);break}case p.AFTER_BODY:{lA(this,t);break}case p.IN_FRAMESET:{AA(this,t);break}case p.AFTER_FRAMESET:{uA(this,t);break}case p.AFTER_AFTER_BODY:{pA(this,t);break}case p.AFTER_AFTER_FRAMESET:{mA(this,t);break}default:}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?TA(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case p.INITIAL:{gt(this,t);break}case p.BEFORE_HTML:{qc(this,t);break}case p.BEFORE_HEAD:{el(this,t);break}case p.IN_HEAD:{tl(this,t);break}case p.IN_HEAD_NO_SCRIPT:{nl(this,t);break}case p.AFTER_HEAD:{il(this,t);break}case p.IN_BODY:{dr(this,t);break}case p.TEXT:{Kl(this,t);break}case p.IN_TABLE:{wt(this,t);break}case p.IN_TABLE_TEXT:{ft(this,t);break}case p.IN_CAPTION:{tA(this,t);break}case p.IN_COLUMN_GROUP:{rA(this,t);break}case p.IN_TABLE_BODY:{un(this,t);break}case p.IN_ROW:{ii(this,t);break}case p.IN_CELL:{sA(this,t);break}case p.IN_SELECT:{oi(this,t);break}case p.IN_SELECT_IN_TABLE:{aA(this,t);break}case p.IN_TEMPLATE:{cA(this,t);break}case p.AFTER_BODY:{li(this,t);break}case p.IN_FRAMESET:{dA(this,t);break}case p.AFTER_FRAMESET:{hA(this,t);break}case p.AFTER_AFTER_BODY:{or(this,t);break}default:}}onEof(t){switch(this.insertionMode){case p.INITIAL:{gt(this,t);break}case p.BEFORE_HTML:{Et(this,t);break}case p.BEFORE_HEAD:{Tt(this,t);break}case p.IN_HEAD:{Ct(this,t);break}case p.IN_HEAD_NO_SCRIPT:{It(this,t);break}case p.AFTER_HEAD:{bt(this,t);break}case p.IN_BODY:case p.IN_TABLE:case p.IN_CAPTION:case p.IN_COLUMN_GROUP:case p.IN_TABLE_BODY:case p.IN_ROW:case p.IN_CELL:case p.IN_SELECT:case p.IN_SELECT_IN_TABLE:{ti(this,t);break}case p.TEXT:{Wl(this,t);break}case p.IN_TABLE_TEXT:{ft(this,t);break}case p.IN_TEMPLATE:{ci(this,t);break}case p.AFTER_BODY:case p.IN_FRAMESET:case p.AFTER_FRAMESET:case p.AFTER_AFTER_BODY:case p.AFTER_AFTER_FRAMESET:{pn(this,t);break}default:}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===d.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case p.IN_HEAD:case p.IN_HEAD_NO_SCRIPT:case p.AFTER_HEAD:case p.TEXT:case p.IN_COLUMN_GROUP:case p.IN_SELECT:case p.IN_SELECT_IN_TABLE:case p.IN_FRAMESET:case p.AFTER_FRAMESET:{this._insertCharacters(t);break}case p.IN_BODY:case p.IN_CAPTION:case p.IN_CELL:case p.IN_TEMPLATE:case p.AFTER_BODY:case p.AFTER_AFTER_BODY:case p.AFTER_AFTER_FRAMESET:{Zs(this,t);break}case p.IN_TABLE:case p.IN_TABLE_BODY:case p.IN_ROW:{An(this,t);break}case p.IN_TABLE_TEXT:{ri(this,t);break}default:}}};function Yc(e,t){let r=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return r?e.openElements.contains(r.element)?e.openElements.hasInScope(t.tagID)||(r=null):(e.activeFormattingElements.removeEntry(r),r=null):ei(e,t),r}function Gc(e,t){let r=null,n=e.openElements.stackTop;for(;n>=0;n--){let s=e.openElements.items[n];if(s===t.element)break;e._isSpecialElement(s,e.openElements.tagIDs[n])&&(r=s)}return r||(e.openElements.shortenToLength(Math.max(n,0)),e.activeFormattingElements.removeEntry(t)),r}function Kc(e,t,r){let n=t,s=e.openElements.getCommonAncestor(t);for(let a=0,c=s;c!==r;a++,c=s){s=e.openElements.getCommonAncestor(c);let l=e.activeFormattingElements.getElementEntry(c),o=l&&a>=Hc;!l||o?(o&&e.activeFormattingElements.removeEntry(l),e.openElements.remove(c)):(c=Wc(e,l),n===t&&(e.activeFormattingElements.bookmark=l),e.treeAdapter.detachNode(n),e.treeAdapter.appendChild(c,n),n=c)}return n}function Wc(e,t){let r=e.treeAdapter.getNamespaceURI(t.element),n=e.treeAdapter.createElement(t.token.tagName,r,t.token.attrs);return e.openElements.replace(t.element,n),t.element=n,n}function Jc(e,t,r){let n=e.treeAdapter.getTagName(t),s=Be(n);if(e._isElementCausesFosterParenting(s))e._fosterParentElement(r);else{let a=e.treeAdapter.getNamespaceURI(t);s===i.TEMPLATE&&a===C.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,r)}}function jc(e,t,r){let n=e.treeAdapter.getNamespaceURI(r.element),{token:s}=r,a=e.treeAdapter.createElement(s.tagName,n,s.attrs);e._adoptNodes(t,a),e.treeAdapter.appendChild(t,a),e.activeFormattingElements.insertElementAfterBookmark(a,s),e.activeFormattingElements.removeEntry(r),e.openElements.remove(r.element),e.openElements.insertAfter(t,a,s.tagID)}function hn(e,t){for(let r=0;r<Uc;r++){let n=Yc(e,t);if(!n)break;let s=Gc(e,n);if(!s)break;e.activeFormattingElements.bookmark=n;let a=Kc(e,s,n.element),c=e.openElements.getCommonAncestor(n.element);e.treeAdapter.detachNode(a),c&&Jc(e,c,a),jc(e,s,n)}}function dn(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function Vc(e,t){e._appendCommentNode(t,e.openElements.items[0])}function Xc(e,t){e._appendCommentNode(t,e.document)}function pn(e,t){if(e.stopped=!0,t.location){let r=e.fragmentContext?0:2;for(let n=e.openElements.stackTop;n>=r;n--)e._setEndLocation(e.openElements.items[n],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){let n=e.openElements.items[0],s=e.treeAdapter.getNodeSourceCodeLocation(n);if(s&&!s.endTag&&(e._setEndLocation(n,t),e.openElements.stackTop>=1)){let a=e.openElements.items[1],c=e.treeAdapter.getNodeSourceCodeLocation(a);c&&!c.endTag&&e._setEndLocation(a,t)}}}}function Zc(e,t){e._setDocumentType(t);let r=t.forceQuirks?$.QUIRKS:Hs(t);Us(t)||e._err(t,E.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,r),e.insertionMode=p.BEFORE_HTML}function gt(e,t){e._err(t,E.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,$.QUIRKS),e.insertionMode=p.BEFORE_HTML,e._processToken(t)}function $c(e,t){t.tagID===i.HTML?(e._insertElement(t,C.HTML),e.insertionMode=p.BEFORE_HEAD):Et(e,t)}function qc(e,t){let r=t.tagID;(r===i.HTML||r===i.HEAD||r===i.BODY||r===i.BR)&&Et(e,t)}function Et(e,t){e._insertFakeRootElement(),e.insertionMode=p.BEFORE_HEAD,e._processToken(t)}function zc(e,t){switch(t.tagID){case i.HTML:{j(e,t);break}case i.HEAD:{e._insertElement(t,C.HTML),e.headElement=e.openElements.current,e.insertionMode=p.IN_HEAD;break}default:Tt(e,t)}}function el(e,t){let r=t.tagID;r===i.HEAD||r===i.BODY||r===i.HTML||r===i.BR?Tt(e,t):e._err(t,E.endTagWithoutMatchingOpenElement)}function Tt(e,t){e._insertFakeElement(g.HEAD,i.HEAD),e.headElement=e.openElements.current,e.insertionMode=p.IN_HEAD,e._processToken(t)}function ue(e,t){switch(t.tagID){case i.HTML:{j(e,t);break}case i.BASE:case i.BASEFONT:case i.BGSOUND:case i.LINK:case i.META:{e._appendElement(t,C.HTML),t.ackSelfClosing=!0;break}case i.TITLE:{e._switchToTextParsing(t,J.RCDATA);break}case i.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,J.RAWTEXT):(e._insertElement(t,C.HTML),e.insertionMode=p.IN_HEAD_NO_SCRIPT);break}case i.NOFRAMES:case i.STYLE:{e._switchToTextParsing(t,J.RAWTEXT);break}case i.SCRIPT:{e._switchToTextParsing(t,J.SCRIPT_DATA);break}case i.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=p.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(p.IN_TEMPLATE);break}case i.HEAD:{e._err(t,E.misplacedStartTagForHeadElement);break}default:Ct(e,t)}}function tl(e,t){switch(t.tagID){case i.HEAD:{e.openElements.pop(),e.insertionMode=p.AFTER_HEAD;break}case i.BODY:case i.BR:case i.HTML:{Ct(e,t);break}case i.TEMPLATE:{ke(e,t);break}default:e._err(t,E.endTagWithoutMatchingOpenElement)}}function ke(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==i.TEMPLATE&&e._err(t,E.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(i.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,E.endTagWithoutMatchingOpenElement)}function Ct(e,t){e.openElements.pop(),e.insertionMode=p.AFTER_HEAD,e._processToken(t)}function rl(e,t){switch(t.tagID){case i.HTML:{j(e,t);break}case i.BASEFONT:case i.BGSOUND:case i.HEAD:case i.LINK:case i.META:case i.NOFRAMES:case i.STYLE:{ue(e,t);break}case i.NOSCRIPT:{e._err(t,E.nestedNoscriptInHead);break}default:It(e,t)}}function nl(e,t){switch(t.tagID){case i.NOSCRIPT:{e.openElements.pop(),e.insertionMode=p.IN_HEAD;break}case i.BR:{It(e,t);break}default:e._err(t,E.endTagWithoutMatchingOpenElement)}}function It(e,t){let r=t.type===O.EOF?E.openElementsLeftAfterEof:E.disallowedContentInNoscriptInHead;e._err(t,r),e.openElements.pop(),e.insertionMode=p.IN_HEAD,e._processToken(t)}function sl(e,t){switch(t.tagID){case i.HTML:{j(e,t);break}case i.BODY:{e._insertElement(t,C.HTML),e.framesetOk=!1,e.insertionMode=p.IN_BODY;break}case i.FRAMESET:{e._insertElement(t,C.HTML),e.insertionMode=p.IN_FRAMESET;break}case i.BASE:case i.BASEFONT:case i.BGSOUND:case i.LINK:case i.META:case i.NOFRAMES:case i.SCRIPT:case i.STYLE:case i.TEMPLATE:case i.TITLE:{e._err(t,E.abandonedHeadElementChild),e.openElements.push(e.headElement,i.HEAD),ue(e,t),e.openElements.remove(e.headElement);break}case i.HEAD:{e._err(t,E.misplacedStartTagForHeadElement);break}default:bt(e,t)}}function il(e,t){switch(t.tagID){case i.BODY:case i.HTML:case i.BR:{bt(e,t);break}case i.TEMPLATE:{ke(e,t);break}default:e._err(t,E.endTagWithoutMatchingOpenElement)}}function bt(e,t){e._insertFakeElement(g.BODY,i.BODY),e.insertionMode=p.IN_BODY,Ar(e,t)}function Ar(e,t){switch(t.type){case O.CHARACTER:{$s(e,t);break}case O.WHITESPACE_CHARACTER:{Zs(e,t);break}case O.COMMENT:{dn(e,t);break}case O.START_TAG:{j(e,t);break}case O.END_TAG:{dr(e,t);break}case O.EOF:{ti(e,t);break}default:}}function Zs(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function $s(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function al(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function ol(e,t){let r=e.openElements.tryPeekProperlyNestedBodyElement();r&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(r,t.attrs))}function cl(e,t){let r=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&r&&(e.treeAdapter.detachNode(r),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,C.HTML),e.insertionMode=p.IN_FRAMESET)}function ll(e,t){e.openElements.hasInButtonScope(i.P)&&e._closePElement(),e._insertElement(t,C.HTML)}function Al(e,t){e.openElements.hasInButtonScope(i.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&ht.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,C.HTML)}function dl(e,t){e.openElements.hasInButtonScope(i.P)&&e._closePElement(),e._insertElement(t,C.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function ul(e,t){let r=e.openElements.tmplCount>0;(!e.formElement||r)&&(e.openElements.hasInButtonScope(i.P)&&e._closePElement(),e._insertElement(t,C.HTML),r||(e.formElement=e.openElements.current))}function hl(e,t){e.framesetOk=!1;let r=t.tagID;for(let n=e.openElements.stackTop;n>=0;n--){let s=e.openElements.tagIDs[n];if(r===i.LI&&s===i.LI||(r===i.DD||r===i.DT)&&(s===i.DD||s===i.DT)){e.openElements.generateImpliedEndTagsWithExclusion(s),e.openElements.popUntilTagNamePopped(s);break}if(s!==i.ADDRESS&&s!==i.DIV&&s!==i.P&&e._isSpecialElement(e.openElements.items[n],s))break}e.openElements.hasInButtonScope(i.P)&&e._closePElement(),e._insertElement(t,C.HTML)}function pl(e,t){e.openElements.hasInButtonScope(i.P)&&e._closePElement(),e._insertElement(t,C.HTML),e.tokenizer.state=J.PLAINTEXT}function ml(e,t){e.openElements.hasInScope(i.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(i.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,C.HTML),e.framesetOk=!1}function gl(e,t){let r=e.activeFormattingElements.getElementEntryInScopeWithTagName(g.A);r&&(hn(e,t),e.openElements.remove(r.element),e.activeFormattingElements.removeEntry(r)),e._reconstructActiveFormattingElements(),e._insertElement(t,C.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function fl(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,C.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function El(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(i.NOBR)&&(hn(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,C.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Tl(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,C.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function Cl(e,t){e.treeAdapter.getDocumentMode(e.document)!==$.QUIRKS&&e.openElements.hasInButtonScope(i.P)&&e._closePElement(),e._insertElement(t,C.HTML),e.framesetOk=!1,e.insertionMode=p.IN_TABLE}function qs(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,C.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function zs(e){let t=er(e,fe.TYPE);return t!=null&&t.toLowerCase()===Fc}function Il(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,C.HTML),zs(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function bl(e,t){e._appendElement(t,C.HTML),t.ackSelfClosing=!0}function yl(e,t){e.openElements.hasInButtonScope(i.P)&&e._closePElement(),e._appendElement(t,C.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function wl(e,t){t.tagName=g.IMG,t.tagID=i.IMG,qs(e,t)}function Nl(e,t){e._insertElement(t,C.HTML),e.skipNextNewLine=!0,e.tokenizer.state=J.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=p.TEXT}function Sl(e,t){e.openElements.hasInButtonScope(i.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,J.RAWTEXT)}function _l(e,t){e.framesetOk=!1,e._switchToTextParsing(t,J.RAWTEXT)}function js(e,t){e._switchToTextParsing(t,J.RAWTEXT)}function xl(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,C.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===p.IN_TABLE||e.insertionMode===p.IN_CAPTION||e.insertionMode===p.IN_TABLE_BODY||e.insertionMode===p.IN_ROW||e.insertionMode===p.IN_CELL?p.IN_SELECT_IN_TABLE:p.IN_SELECT}function Rl(e,t){e.openElements.currentTagId===i.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,C.HTML)}function Ll(e,t){e.openElements.hasInScope(i.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,C.HTML)}function Ol(e,t){e.openElements.hasInScope(i.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(i.RTC),e._insertElement(t,C.HTML)}function Dl(e,t){e._reconstructActiveFormattingElements(),cn(t),ar(t),t.selfClosing?e._appendElement(t,C.MATHML):e._insertElement(t,C.MATHML),t.ackSelfClosing=!0}function Bl(e,t){e._reconstructActiveFormattingElements(),ln(t),ar(t),t.selfClosing?e._appendElement(t,C.SVG):e._insertElement(t,C.SVG),t.ackSelfClosing=!0}function Vs(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,C.HTML)}function j(e,t){switch(t.tagID){case i.I:case i.S:case i.B:case i.U:case i.EM:case i.TT:case i.BIG:case i.CODE:case i.FONT:case i.SMALL:case i.STRIKE:case i.STRONG:{fl(e,t);break}case i.A:{gl(e,t);break}case i.H1:case i.H2:case i.H3:case i.H4:case i.H5:case i.H6:{Al(e,t);break}case i.P:case i.DL:case i.OL:case i.UL:case i.DIV:case i.DIR:case i.NAV:case i.MAIN:case i.MENU:case i.ASIDE:case i.CENTER:case i.FIGURE:case i.FOOTER:case i.HEADER:case i.HGROUP:case i.DIALOG:case i.DETAILS:case i.ADDRESS:case i.ARTICLE:case i.SEARCH:case i.SECTION:case i.SUMMARY:case i.FIELDSET:case i.BLOCKQUOTE:case i.FIGCAPTION:{ll(e,t);break}case i.LI:case i.DD:case i.DT:{hl(e,t);break}case i.BR:case i.IMG:case i.WBR:case i.AREA:case i.EMBED:case i.KEYGEN:{qs(e,t);break}case i.HR:{yl(e,t);break}case i.RB:case i.RTC:{Ll(e,t);break}case i.RT:case i.RP:{Ol(e,t);break}case i.PRE:case i.LISTING:{dl(e,t);break}case i.XMP:{Sl(e,t);break}case i.SVG:{Bl(e,t);break}case i.HTML:{al(e,t);break}case i.BASE:case i.LINK:case i.META:case i.STYLE:case i.TITLE:case i.SCRIPT:case i.BGSOUND:case i.BASEFONT:case i.TEMPLATE:{ue(e,t);break}case i.BODY:{ol(e,t);break}case i.FORM:{ul(e,t);break}case i.NOBR:{El(e,t);break}case i.MATH:{Dl(e,t);break}case i.TABLE:{Cl(e,t);break}case i.INPUT:{Il(e,t);break}case i.PARAM:case i.TRACK:case i.SOURCE:{bl(e,t);break}case i.IMAGE:{wl(e,t);break}case i.BUTTON:{ml(e,t);break}case i.APPLET:case i.OBJECT:case i.MARQUEE:{Tl(e,t);break}case i.IFRAME:{_l(e,t);break}case i.SELECT:{xl(e,t);break}case i.OPTION:case i.OPTGROUP:{Rl(e,t);break}case i.NOEMBED:case i.NOFRAMES:{js(e,t);break}case i.FRAMESET:{cl(e,t);break}case i.TEXTAREA:{Nl(e,t);break}case i.NOSCRIPT:{e.options.scriptingEnabled?js(e,t):Vs(e,t);break}case i.PLAINTEXT:{pl(e,t);break}case i.COL:case i.TH:case i.TD:case i.TR:case i.HEAD:case i.FRAME:case i.TBODY:case i.TFOOT:case i.THEAD:case i.CAPTION:case i.COLGROUP:break;default:Vs(e,t)}}function kl(e,t){if(e.openElements.hasInScope(i.BODY)&&(e.insertionMode=p.AFTER_BODY,e.options.sourceCodeLocationInfo)){let r=e.openElements.tryPeekProperlyNestedBodyElement();r&&e._setEndLocation(r,t)}}function vl(e,t){e.openElements.hasInScope(i.BODY)&&(e.insertionMode=p.AFTER_BODY,li(e,t))}function Pl(e,t){let r=t.tagID;e.openElements.hasInScope(r)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(r))}function Ml(e){let t=e.openElements.tmplCount>0,{formElement:r}=e;t||(e.formElement=null),(r||t)&&e.openElements.hasInScope(i.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(i.FORM):r&&e.openElements.remove(r))}function Fl(e){e.openElements.hasInButtonScope(i.P)||e._insertFakeElement(g.P,i.P),e._closePElement()}function Ul(e){e.openElements.hasInListItemScope(i.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(i.LI),e.openElements.popUntilTagNamePopped(i.LI))}function Hl(e,t){let r=t.tagID;e.openElements.hasInScope(r)&&(e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.popUntilTagNamePopped(r))}function Ql(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function Yl(e,t){let r=t.tagID;e.openElements.hasInScope(r)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(r),e.activeFormattingElements.clearToLastMarker())}function Gl(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(g.BR,i.BR),e.openElements.pop(),e.framesetOk=!1}function ei(e,t){let r=t.tagName,n=t.tagID;for(let s=e.openElements.stackTop;s>0;s--){let a=e.openElements.items[s],c=e.openElements.tagIDs[s];if(n===c&&(n!==i.UNKNOWN||e.treeAdapter.getTagName(a)===r)){e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.stackTop>=s&&e.openElements.shortenToLength(s);break}if(e._isSpecialElement(a,c))break}}function dr(e,t){switch(t.tagID){case i.A:case i.B:case i.I:case i.S:case i.U:case i.EM:case i.TT:case i.BIG:case i.CODE:case i.FONT:case i.NOBR:case i.SMALL:case i.STRIKE:case i.STRONG:{hn(e,t);break}case i.P:{Fl(e);break}case i.DL:case i.UL:case i.OL:case i.DIR:case i.DIV:case i.NAV:case i.PRE:case i.MAIN:case i.MENU:case i.ASIDE:case i.BUTTON:case i.CENTER:case i.FIGURE:case i.FOOTER:case i.HEADER:case i.HGROUP:case i.DIALOG:case i.ADDRESS:case i.ARTICLE:case i.DETAILS:case i.SEARCH:case i.SECTION:case i.SUMMARY:case i.LISTING:case i.FIELDSET:case i.BLOCKQUOTE:case i.FIGCAPTION:{Pl(e,t);break}case i.LI:{Ul(e);break}case i.DD:case i.DT:{Hl(e,t);break}case i.H1:case i.H2:case i.H3:case i.H4:case i.H5:case i.H6:{Ql(e);break}case i.BR:{Gl(e);break}case i.BODY:{kl(e,t);break}case i.HTML:{vl(e,t);break}case i.FORM:{Ml(e);break}case i.APPLET:case i.OBJECT:case i.MARQUEE:{Yl(e,t);break}case i.TEMPLATE:{ke(e,t);break}default:ei(e,t)}}function ti(e,t){e.tmplInsertionModeStack.length>0?ci(e,t):pn(e,t)}function Kl(e,t){var r;t.tagID===i.SCRIPT&&((r=e.scriptHandler)===null||r===void 0||r.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function Wl(e,t){e._err(t,E.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function An(e,t){if(e.openElements.currentTagId!==void 0&&Xs.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=p.IN_TABLE_TEXT,t.type){case O.CHARACTER:{ni(e,t);break}case O.WHITESPACE_CHARACTER:{ri(e,t);break}}else Nt(e,t)}function Jl(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,C.HTML),e.insertionMode=p.IN_CAPTION}function jl(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,C.HTML),e.insertionMode=p.IN_COLUMN_GROUP}function Vl(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(g.COLGROUP,i.COLGROUP),e.insertionMode=p.IN_COLUMN_GROUP,mn(e,t)}function Xl(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,C.HTML),e.insertionMode=p.IN_TABLE_BODY}function Zl(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(g.TBODY,i.TBODY),e.insertionMode=p.IN_TABLE_BODY,ur(e,t)}function $l(e,t){e.openElements.hasInTableScope(i.TABLE)&&(e.openElements.popUntilTagNamePopped(i.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function ql(e,t){zs(t)?e._appendElement(t,C.HTML):Nt(e,t),t.ackSelfClosing=!0}function zl(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,C.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function Ve(e,t){switch(t.tagID){case i.TD:case i.TH:case i.TR:{Zl(e,t);break}case i.STYLE:case i.SCRIPT:case i.TEMPLATE:{ue(e,t);break}case i.COL:{Vl(e,t);break}case i.FORM:{zl(e,t);break}case i.TABLE:{$l(e,t);break}case i.TBODY:case i.TFOOT:case i.THEAD:{Xl(e,t);break}case i.INPUT:{ql(e,t);break}case i.CAPTION:{Jl(e,t);break}case i.COLGROUP:{jl(e,t);break}default:Nt(e,t)}}function wt(e,t){switch(t.tagID){case i.TABLE:{e.openElements.hasInTableScope(i.TABLE)&&(e.openElements.popUntilTagNamePopped(i.TABLE),e._resetInsertionMode());break}case i.TEMPLATE:{ke(e,t);break}case i.BODY:case i.CAPTION:case i.COL:case i.COLGROUP:case i.HTML:case i.TBODY:case i.TD:case i.TFOOT:case i.TH:case i.THEAD:case i.TR:break;default:Nt(e,t)}}function Nt(e,t){let r=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,Ar(e,t),e.fosterParentingEnabled=r}function ri(e,t){e.pendingCharacterTokens.push(t)}function ni(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function ft(e,t){let r=0;if(e.hasNonWhitespacePendingCharacterToken)for(;r<e.pendingCharacterTokens.length;r++)Nt(e,e.pendingCharacterTokens[r]);else for(;r<e.pendingCharacterTokens.length;r++)e._insertCharacters(e.pendingCharacterTokens[r]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}var si=new Set([i.CAPTION,i.COL,i.COLGROUP,i.TBODY,i.TD,i.TFOOT,i.TH,i.THEAD,i.TR]);function eA(e,t){let r=t.tagID;si.has(r)?e.openElements.hasInTableScope(i.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(i.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=p.IN_TABLE,Ve(e,t)):j(e,t)}function tA(e,t){let r=t.tagID;switch(r){case i.CAPTION:case i.TABLE:{e.openElements.hasInTableScope(i.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(i.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=p.IN_TABLE,r===i.TABLE&&wt(e,t));break}case i.BODY:case i.COL:case i.COLGROUP:case i.HTML:case i.TBODY:case i.TD:case i.TFOOT:case i.TH:case i.THEAD:case i.TR:break;default:dr(e,t)}}function mn(e,t){switch(t.tagID){case i.HTML:{j(e,t);break}case i.COL:{e._appendElement(t,C.HTML),t.ackSelfClosing=!0;break}case i.TEMPLATE:{ue(e,t);break}default:cr(e,t)}}function rA(e,t){switch(t.tagID){case i.COLGROUP:{e.openElements.currentTagId===i.COLGROUP&&(e.openElements.pop(),e.insertionMode=p.IN_TABLE);break}case i.TEMPLATE:{ke(e,t);break}case i.COL:break;default:cr(e,t)}}function cr(e,t){e.openElements.currentTagId===i.COLGROUP&&(e.openElements.pop(),e.insertionMode=p.IN_TABLE,e._processToken(t))}function ur(e,t){switch(t.tagID){case i.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,C.HTML),e.insertionMode=p.IN_ROW;break}case i.TH:case i.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(g.TR,i.TR),e.insertionMode=p.IN_ROW,hr(e,t);break}case i.CAPTION:case i.COL:case i.COLGROUP:case i.TBODY:case i.TFOOT:case i.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=p.IN_TABLE,Ve(e,t));break}default:Ve(e,t)}}function un(e,t){let r=t.tagID;switch(t.tagID){case i.TBODY:case i.TFOOT:case i.THEAD:{e.openElements.hasInTableScope(r)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=p.IN_TABLE);break}case i.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=p.IN_TABLE,wt(e,t));break}case i.BODY:case i.CAPTION:case i.COL:case i.COLGROUP:case i.HTML:case i.TD:case i.TH:case i.TR:break;default:wt(e,t)}}function hr(e,t){switch(t.tagID){case i.TH:case i.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,C.HTML),e.insertionMode=p.IN_CELL,e.activeFormattingElements.insertMarker();break}case i.CAPTION:case i.COL:case i.COLGROUP:case i.TBODY:case i.TFOOT:case i.THEAD:case i.TR:{e.openElements.hasInTableScope(i.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=p.IN_TABLE_BODY,ur(e,t));break}default:Ve(e,t)}}function ii(e,t){switch(t.tagID){case i.TR:{e.openElements.hasInTableScope(i.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=p.IN_TABLE_BODY);break}case i.TABLE:{e.openElements.hasInTableScope(i.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=p.IN_TABLE_BODY,un(e,t));break}case i.TBODY:case i.TFOOT:case i.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(i.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=p.IN_TABLE_BODY,un(e,t));break}case i.BODY:case i.CAPTION:case i.COL:case i.COLGROUP:case i.HTML:case i.TD:case i.TH:break;default:wt(e,t)}}function nA(e,t){let r=t.tagID;si.has(r)?(e.openElements.hasInTableScope(i.TD)||e.openElements.hasInTableScope(i.TH))&&(e._closeTableCell(),hr(e,t)):j(e,t)}function sA(e,t){let r=t.tagID;switch(r){case i.TD:case i.TH:{e.openElements.hasInTableScope(r)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(r),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=p.IN_ROW);break}case i.TABLE:case i.TBODY:case i.TFOOT:case i.THEAD:case i.TR:{e.openElements.hasInTableScope(r)&&(e._closeTableCell(),ii(e,t));break}case i.BODY:case i.CAPTION:case i.COL:case i.COLGROUP:case i.HTML:break;default:dr(e,t)}}function ai(e,t){switch(t.tagID){case i.HTML:{j(e,t);break}case i.OPTION:{e.openElements.currentTagId===i.OPTION&&e.openElements.pop(),e._insertElement(t,C.HTML);break}case i.OPTGROUP:{e.openElements.currentTagId===i.OPTION&&e.openElements.pop(),e.openElements.currentTagId===i.OPTGROUP&&e.openElements.pop(),e._insertElement(t,C.HTML);break}case i.HR:{e.openElements.currentTagId===i.OPTION&&e.openElements.pop(),e.openElements.currentTagId===i.OPTGROUP&&e.openElements.pop(),e._appendElement(t,C.HTML),t.ackSelfClosing=!0;break}case i.INPUT:case i.KEYGEN:case i.TEXTAREA:case i.SELECT:{e.openElements.hasInSelectScope(i.SELECT)&&(e.openElements.popUntilTagNamePopped(i.SELECT),e._resetInsertionMode(),t.tagID!==i.SELECT&&e._processStartTag(t));break}case i.SCRIPT:case i.TEMPLATE:{ue(e,t);break}default:}}function oi(e,t){switch(t.tagID){case i.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===i.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===i.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===i.OPTGROUP&&e.openElements.pop();break}case i.OPTION:{e.openElements.currentTagId===i.OPTION&&e.openElements.pop();break}case i.SELECT:{e.openElements.hasInSelectScope(i.SELECT)&&(e.openElements.popUntilTagNamePopped(i.SELECT),e._resetInsertionMode());break}case i.TEMPLATE:{ke(e,t);break}default:}}function iA(e,t){let r=t.tagID;r===i.CAPTION||r===i.TABLE||r===i.TBODY||r===i.TFOOT||r===i.THEAD||r===i.TR||r===i.TD||r===i.TH?(e.openElements.popUntilTagNamePopped(i.SELECT),e._resetInsertionMode(),e._processStartTag(t)):ai(e,t)}function aA(e,t){let r=t.tagID;r===i.CAPTION||r===i.TABLE||r===i.TBODY||r===i.TFOOT||r===i.THEAD||r===i.TR||r===i.TD||r===i.TH?e.openElements.hasInTableScope(r)&&(e.openElements.popUntilTagNamePopped(i.SELECT),e._resetInsertionMode(),e.onEndTag(t)):oi(e,t)}function oA(e,t){switch(t.tagID){case i.BASE:case i.BASEFONT:case i.BGSOUND:case i.LINK:case i.META:case i.NOFRAMES:case i.SCRIPT:case i.STYLE:case i.TEMPLATE:case i.TITLE:{ue(e,t);break}case i.CAPTION:case i.COLGROUP:case i.TBODY:case i.TFOOT:case i.THEAD:{e.tmplInsertionModeStack[0]=p.IN_TABLE,e.insertionMode=p.IN_TABLE,Ve(e,t);break}case i.COL:{e.tmplInsertionModeStack[0]=p.IN_COLUMN_GROUP,e.insertionMode=p.IN_COLUMN_GROUP,mn(e,t);break}case i.TR:{e.tmplInsertionModeStack[0]=p.IN_TABLE_BODY,e.insertionMode=p.IN_TABLE_BODY,ur(e,t);break}case i.TD:case i.TH:{e.tmplInsertionModeStack[0]=p.IN_ROW,e.insertionMode=p.IN_ROW,hr(e,t);break}default:e.tmplInsertionModeStack[0]=p.IN_BODY,e.insertionMode=p.IN_BODY,j(e,t)}}function cA(e,t){t.tagID===i.TEMPLATE&&ke(e,t)}function ci(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(i.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):pn(e,t)}function lA(e,t){t.tagID===i.HTML?j(e,t):lr(e,t)}function li(e,t){var r;if(t.tagID===i.HTML){if(e.fragmentContext||(e.insertionMode=p.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===i.HTML){e._setEndLocation(e.openElements.items[0],t);let n=e.openElements.items[1];n&&!(!((r=e.treeAdapter.getNodeSourceCodeLocation(n))===null||r===void 0)&&r.endTag)&&e._setEndLocation(n,t)}}else lr(e,t)}function lr(e,t){e.insertionMode=p.IN_BODY,Ar(e,t)}function AA(e,t){switch(t.tagID){case i.HTML:{j(e,t);break}case i.FRAMESET:{e._insertElement(t,C.HTML);break}case i.FRAME:{e._appendElement(t,C.HTML),t.ackSelfClosing=!0;break}case i.NOFRAMES:{ue(e,t);break}default:}}function dA(e,t){t.tagID===i.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==i.FRAMESET&&(e.insertionMode=p.AFTER_FRAMESET))}function uA(e,t){switch(t.tagID){case i.HTML:{j(e,t);break}case i.NOFRAMES:{ue(e,t);break}default:}}function hA(e,t){t.tagID===i.HTML&&(e.insertionMode=p.AFTER_AFTER_FRAMESET)}function pA(e,t){t.tagID===i.HTML?j(e,t):or(e,t)}function or(e,t){e.insertionMode=p.IN_BODY,Ar(e,t)}function mA(e,t){switch(t.tagID){case i.HTML:{j(e,t);break}case i.NOFRAMES:{ue(e,t);break}default:}}function gA(e,t){t.chars=B,e._insertCharacters(t)}function fA(e,t){e._insertCharacters(t),e.framesetOk=!1}function Ai(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==C.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function EA(e,t){if(Ys(t))Ai(e),e._startTagOutsideForeignContent(t);else{let r=e._getAdjustedCurrentElement(),n=e.treeAdapter.getNamespaceURI(r);n===C.MATHML?cn(t):n===C.SVG&&(Gs(t),ln(t)),ar(t),t.selfClosing?e._appendElement(t,n):e._insertElement(t,n),t.ackSelfClosing=!0}}function TA(e,t){if(t.tagID===i.P||t.tagID===i.BR){Ai(e),e._endTagOutsideForeignContent(t);return}for(let r=e.openElements.stackTop;r>0;r--){let n=e.openElements.items[r];if(e.treeAdapter.getNamespaceURI(n)===C.HTML){e._endTagOutsideForeignContent(t);break}let s=e.treeAdapter.getTagName(n);if(s.toLowerCase()===t.tagName){t.tagName=s,e.openElements.shortenToLength(r);break}}}var im=new Set([g.AREA,g.BASE,g.BASEFONT,g.BGSOUND,g.BR,g.COL,g.EMBED,g.FRAME,g.HR,g.IMG,g.INPUT,g.KEYGEN,g.LINK,g.META,g.PARAM,g.SOURCE,g.TRACK,g.WBR]);function di(e,t){return yt.parse(e,t)}function ie(e,t){return e.attrs?.find(r=>r.name.toLowerCase()===t.toLowerCase())?.value??null}function gn(e){return e.nodeName==="#text"?e.value??"":(e.childNodes??[]).map(gn).join("")}function Ce(e){return e?.replace(/\s+/g," ").trim()||null}function fn(e){let t=di(e),r={title:null,description:null,canonical:null,robots:null,lang:null,h1Count:0,openGraph:{title:null,description:null,image:null},twitter:{card:null,title:null,description:null,image:null},hreflang:[],jsonLd:[],images:[],links:[],wordCount:0,visibleText:""},n=[];function s(a,c=!1){let l=a.tagName?.toLowerCase(),o=c||l==="script"||l==="style"||l==="noscript"||l==="template";if(a.nodeName==="#text"&&!o){let A=Ce(a.value);A&&n.push(A)}if(l==="html"&&r.lang===null&&(r.lang=Ce(ie(a,"lang"))),l==="title"&&r.title===null&&(r.title=Ce(gn(a))),l==="h1"&&(r.h1Count+=1),l==="meta"){let A=ie(a,"name")?.toLowerCase(),u=ie(a,"property")?.toLowerCase(),m=Ce(ie(a,"content"));A==="description"&&r.description===null?r.description=m:A==="robots"&&r.robots===null?r.robots=m:u==="og:title"&&r.openGraph.title===null?r.openGraph.title=m:u==="og:description"&&r.openGraph.description===null?r.openGraph.description=m:u==="og:image"&&r.openGraph.image===null?r.openGraph.image=m:A==="twitter:card"&&r.twitter.card===null?r.twitter.card=m:A==="twitter:title"&&r.twitter.title===null?r.twitter.title=m:A==="twitter:description"&&r.twitter.description===null?r.twitter.description=m:A==="twitter:image"&&r.twitter.image===null&&(r.twitter.image=m)}if(l==="link"){let A=ie(a,"rel")?.toLowerCase().split(/\s+/).filter(Boolean)??[];if(A.includes("canonical")&&r.canonical===null&&(r.canonical=Ce(ie(a,"href"))),A.includes("alternate")){let u=Ce(ie(a,"hreflang")),m=Ce(ie(a,"href"));u&&m&&r.hreflang.push({lang:u,url:m})}}if(l==="a"){let A=ie(a,"href");A&&r.links.push(A)}if(l==="img"&&r.images.push({src:Ce(ie(a,"src")),alt:ie(a,"alt")}),l==="script"&&ie(a,"type")?.toLowerCase()==="application/ld+json"){let A=gn(a).trim();if(A)try{r.jsonLd.push({valid:!0,value:JSON.parse(A)})}catch(u){r.jsonLd.push({valid:!1,error:u instanceof Error?u.message:String(u)})}}for(let A of a.childNodes??[])s(A,o)}return s(t),r.visibleText=n.join(" "),r.wordCount=r.visibleText?r.visibleText.split(/\s+/u).length:0,r}function CA(e,t){return{url:e,finalUrl:null,status:null,contentType:null,blockedByRobots:!1,error:null,title:null,description:null,canonical:null,canonicalRaw:null,robots:null,xRobotsTag:null,lang:null,h1Count:0,openGraph:{title:null,description:null,image:null},twitter:{card:null,title:null,description:null,image:null},hreflang:[],jsonLd:[],images:[],links:[],internalLinks:[],externalLinks:[],wordCount:0,contentHash:null,depth:t,redirectChain:[],responseBytes:0}}async function Xe(e,t){await e.onEvent?.(t)}async function IA(e,t,r,n,s){let a=CA(e,t);if(n.respectRobots&&!Wn(e,s))return a.blockedByRobots=!0,a;try{if(n.renderer){n.signal?.throwIfAborted(),await n.requestGate(e);let S=await n.renderer.render({url:e,timeout:n.timeout,maxResponseBytes:n.maxResponseBytes,userAgent:n.userAgent,...n.signal?{signal:n.signal}:{}});return bA(a,S,e,r,n.includeQuery)}let{response:c,redirectChain:l}=await xe(e,{headers:{accept:"text/html,application/xhtml+xml;q=0.9,*/*;q=0.1","user-agent":n.userAgent}},{...n,gate:n.requestGate,onEvent:n.onEvent}),o=c.headers.get("content-type")??"",A=o.includes("text/html")||o.includes("application/xhtml+xml"),u=Q(c.url,void 0,{includeQuery:n.includeQuery});if(a.finalUrl=u,a.status=c.status,a.contentType=o||null,a.xRobotsTag=c.headers.get("x-robots-tag"),a.redirectChain=l,!A)return await c.body?.cancel(),a;let{text:m,bytes:T}=await Re(c,n.maxResponseBytes),f=fn(m),y=u??e,w=f.canonical?Q(f.canonical,y,{includeQuery:!0}):null,b=[...new Set(f.links.map(S=>Q(S,y,{includeQuery:n.includeQuery})).filter(S=>!!S))].sort(),_=f.hreflang.map(S=>({lang:S.lang,url:Q(S.url,y,{includeQuery:!0})}));return Object.assign(a,{...f,visibleText:void 0,canonical:w,canonicalRaw:f.canonical,links:b,internalLinks:b.filter(S=>ce(S,r)),externalLinks:b.filter(S=>!ce(S,r)),hreflang:_,contentHash:f.visibleText?ui("sha256").update(f.visibleText.toLowerCase()).digest("hex"):null,responseBytes:T}),a}catch(c){if(n.signal?.aborted)throw c;return a.error=c instanceof Error?c.message:String(c),c instanceof pe&&(a.redirectChain=c.redirectChain),a}}function bA(e,t,r,n,s){let a=t.headers["content-type"]??"text/html",c=Q(t.finalUrl,void 0,{includeQuery:s});if(e.finalUrl=c,e.status=t.status,e.contentType=a,e.xRobotsTag=t.headers["x-robots-tag"]??null,e.redirectChain=t.redirectChain,!a.includes("text/html")&&!a.includes("application/xhtml+xml"))return e;let l=fn(t.html),o=c??r,A=l.canonical?Q(l.canonical,o,{includeQuery:!0}):null,u=[...new Set(l.links.map(m=>Q(m,o,{includeQuery:s})).filter(m=>!!m))].sort();return Object.assign(e,{...l,visibleText:void 0,canonical:A,canonicalRaw:l.canonical,links:u,internalLinks:u.filter(m=>ce(m,n)),externalLinks:u.filter(m=>!ce(m,n)),hreflang:l.hreflang.map(m=>({lang:m.lang,url:Q(m.url,o,{includeQuery:!0})})),contentHash:l.visibleText?ui("sha256").update(l.visibleText.toLowerCase()).digest("hex"):null,responseBytes:t.responseBytes}),e}function yA(e={}){let t=e.requestDelay??e.delay??100,r=e.requestGate;return{...e,maxPages:e.maxPages??100,concurrency:Math.max(1,e.concurrency??5),timeout:e.timeout??1e4,includeQuery:e.includeQuery??!1,respectRobots:e.respectRobots??!0,sitemap:e.sitemap??null,sitemapData:e.sitemapData??null,userAgent:e.userAgent??ye,requestDelay:t,requestGate:r?async n=>r(n):Fe(t),maxRedirects:e.maxRedirects??10,maxResponseBytes:e.maxResponseBytes??5*1024*1024,retries:e.retries??2,fetch:e.fetch??globalThis.fetch,logger:e.logger??Pt}}async function wA(e,t){let r=[],n=Array.from({length:e},async()=>{for(;;){let s=await t();if(s===null)return;r.push(s)}});return await Promise.all(n),r}async function hi(e,t={}){let r=Date.now(),n=yA(t),s=Q(e,void 0,{includeQuery:n.includeQuery});if(!s)throw new Error(`invalid start URL: ${e}`);let a=new URL(s).origin;await Xe(n,{type:"scan-start",url:s,total:n.maxPages});let c=t.robots??await Mt(s,n),l=n.sitemapData;if(!l&&n.sitemap)try{l=await Xt(n.sitemap,{...n,maxUrls:t.sitemapMaxUrls??5e4,siteOrigin:a})}catch(R){l={url:n.sitemap,urls:[],sitemapCount:0,truncated:!1,error:R instanceof Error?R.message:String(R)},n.logger.warn(`Could not load sitemap ${n.sitemap}: ${l.error}`)}let A=[...new Set([s,...l?.urls??[]])].slice(0,n.maxPages).map(R=>({url:R,depth:0})),u=new Set(A.map(R=>R.url)),m=new Map((t.cachedPages??[]).map(R=>[R.url,R])),T=new Map,f=Math.max(n.maxPages*10,n.maxPages),y=!1;for(;A.length>0&&T.size<n.maxPages&&!n.signal?.aborted;){A.sort((F,v)=>F.url.localeCompare(v.url));let R=n.maxPages-T.size,U=A.slice(0,R);A.length>U.length&&(y=!0);let x=0,k=await wA(n.concurrency,async()=>{if(n.signal?.aborted||x>=U.length)return null;let F=U[x++];if(!F)return null;let v=m.get(F.url);if(!v)try{v=await IA(F.url,F.depth,a,n,c)}catch(D){if(n.signal?.aborted)return null;throw D}return T.set(F.url,v),m.has(F.url)||(await t.onBatch?.([v]),await n.storage?.saveCheckpoint?.(s,v),await Xe(n,{type:"checkpoint",page:v,completed:T.size,total:n.maxPages})),t.onProgress?.(T.size,n.maxPages),await Xe(n,{type:"page",completed:T.size,total:n.maxPages,page:v}),await Xe(n,{type:"progress",completed:T.size,total:n.maxPages,page:v}),{item:F,page:v}}),Y=new Map;for(let{item:F,page:v}of k.sort((D,N)=>D.item.url.localeCompare(N.item.url))){let D=v.internalLinks?.length?v.internalLinks:(v.links??[]).filter(N=>ce(N,a));for(let N of[...D].sort())u.size>=f||u.has(N)||!jt(N)||(u.add(N),Y.set(N,{url:N,depth:F.depth+1}))}A=[...Y.values()]}let w=[...T.values()].sort((R,U)=>R.url.localeCompare(U.url)),b=!!n.signal?.aborted,_=b||y||A.length>0||(l?l.urls.length>w.length:!1)||(l?.truncated??!1),S={startUrl:s,pages:w,robots:c,sitemap:l,truncated:_,partial:b,durationMs:Date.now()-r,options:n};return S.snapshot=Ee(S),b||await n.storage?.removeCheckpoint?.(s),b?await Xe(n,{type:"cancelled",completed:w.length,total:n.maxPages,partial:!0}):await Xe(n,{type:"complete",completed:w.length,total:n.maxPages}),S}function pi(e){return"planVersion"in e}function NA(e,t){return{schemaVersion:2,pageSchemaVersion:1,siteUrl:e.startUrl,sitemapUrl:e.sitemap?.url??null,includeQuery:e.config.includeQuery,respectRobots:e.config.respectRobots,timeout:e.config.timeout,maxRedirects:e.config.maxRedirects,maxResponseBytes:e.config.maxResponseBytes,userAgent:e.userAgent,...t?{rendererId:t}:{}}}function SA(e){return!e.error&&(e.status===null||e.status<500)}async function Ze(e,t={}){let r=null,n=null,s;try{s=pi(e)?e:await le(e,{...t,async onEvent(f){f.type==="robots"&&(r=f.robots),f.type==="sitemap"&&(n=f.sitemap),await t.onEvent?.(f)}})}catch(f){if(pi(e)||!t.signal?.aborted)throw f;let y=ge(e),w=Q(y.url,void 0,{includeQuery:y.includeQuery});if(!w)throw new Error(`invalid start URL: ${y.url}`,{cause:f});let b=r??{url:new URL("/robots.txt",w).href,status:null,sha256:null,error:"Scan cancelled before robots.txt planning completed",denyAll:!1},_=Ee({startUrl:w,pages:[],robots:b,sitemap:n,options:y,partial:!0,truncated:!0});return await t.checkpointStore?.flush?.(),await t.onEvent?.({type:"cancelled",completed:0,total:y.maxPages,partial:!0}),{snapshot:_,startUrl:w,pages:[],robots:b,sitemap:n,truncated:!0,partial:!0,durationMs:0,options:y}}if(s.planVersion!==1)throw new Error(`unsupported scan plan version: ${String(s.planVersion)}`);let a=t.limit??s.config.maxPages;if(!Number.isInteger(a)||a<=0)throw new Error("scan limit must be a positive integer");let c={...s.config,maxPages:a},l=Fe(c.delay),o=NA(s,t.renderer?.id),A=t.checkpointStore&&t.resume!==!1?await t.checkpointStore.load(o):null,u=[...t.cachedPages??[],...A?.pages.filter(SA)??[]],m=[...new Map(u.map(f=>[f.url,f])).values()];m.length>0&&await t.onEvent?.({type:"resume",completed:m.length,total:a});let T=await hi(s.startUrl,{...t,maxPages:a,concurrency:c.concurrency,requestDelay:c.delay,timeout:c.timeout,respectRobots:c.respectRobots,includeQuery:c.includeQuery,maxRedirects:c.maxRedirects,maxResponseBytes:c.maxResponseBytes,enabledRules:c.enabledRules,severityOverrides:c.severityOverrides,suppressions:c.suppressions,regressionBudgets:c.regressionBudgets,report:c.report,requestGate:l,robots:s.robots,sitemap:s.sitemap?.url??null,sitemapData:s.sitemap,userAgent:s.userAgent,cachedPages:m,async onBatch(f){for(let y of f)await t.checkpointStore?.append(o,y);await t.onBatch?.(f)}});return await t.checkpointStore?.flush?.(),!T.partial&&!t.retainCheckpoint&&await t.checkpointStore?.clear(o),T}function mi(e){return/^\d+$/.test(e)?":id":/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)?":uuid":/^\d{4}-\d{2}-\d{2}$/.test(e)?":date":/^[0-9a-f]{16,}$/i.test(e)?":hash":null}function _A(e){return e.flatMap(t=>{try{let r=new URL(t.url);return[{issue:t,url:r,segments:r.pathname.split("/").filter(Boolean)}]}catch{return[]}})}function xA(e){let t=new Map;for(let r of e)for(let n=1;n<r.segments.length;n+=1){if(mi(r.segments[n]))continue;let s=r.segments.slice(0,n).join("/"),a=`${r.url.origin}|${r.segments.length}|${n}|${s}`,c=t.get(a)??new Set;c.add(r.segments[n]),t.set(a,c)}return new Set([...t].filter(([,r])=>r.size>=2).map(([r])=>r))}function RA(e,t){let r=e.segments.map((n,s)=>{let a=mi(n);if(a)return a;let c=e.segments.slice(0,s).join("/"),l=`${e.url.origin}|${e.segments.length}|${s}|${c}`;return s>0&&t.has(l)?":slug":n});return`/${r.join("/")}${e.url.pathname.endsWith("/")&&r.length>0?"/":""}`}function En(e){let t=_A(e),r=xA(t),n=new Map;for(let s of t){let a=RA(s,r),c=`${s.url.origin}${a}`,l=n.get(c)??{origin:s.url.origin,template:a,issues:[],urls:new Set};l.issues.push(s.issue),l.urls.add(s.issue.url),n.set(c,l)}return[...n.values()].map(s=>{let a={error:0,warning:0,info:0},c={},l={};for(let A of s.issues)a[A.severity]+=1,c[A.ruleId]=(c[A.ruleId]??0)+1,l[A.owner]=(l[A.owner]??0)+1;let o=[...s.urls].sort();return{origin:s.origin,template:s.template,issueCount:s.issues.length,affectedPages:o.length,severities:a,rules:c,owners:l,urls:o,representativeUrls:o.slice(0,3)}}).sort((s,a)=>a.issueCount-s.issueCount||s.template.localeCompare(a.template)||s.origin.localeCompare(a.origin))}function gi(e){let t=e.replaceAll("-"," ");return t.charAt(0).toUpperCase()+t.slice(1)}var LA={"page-unreachable":"\u041D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0430 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0430","http-error":"HTTP-\u043F\u043E\u043C\u0438\u043B\u043A\u0430",noindex:"Noindex","x-robots-noindex":"Noindex \u0443 X-Robots-Tag","robots-blocked":"\u0417\u0430\u0431\u043B\u043E\u043A\u043E\u0432\u0430\u043D\u043E robots.txt","missing-canonical":"\u0412\u0456\u0434\u0441\u0443\u0442\u043D\u0456\u0439 canonical","invalid-canonical":"\u041D\u0435\u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0438\u0439 canonical","cross-domain-canonical":"Canonical \u043D\u0430 \u0456\u043D\u0448\u043E\u043C\u0443 \u0434\u043E\u043C\u0435\u043D\u0456","canonical-target-error":"\u041F\u043E\u043C\u0438\u043B\u043A\u0430 \u0446\u0456\u043B\u0456 canonical","redirect-loop":"\u0426\u0438\u043A\u043B \u043F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u044C","long-redirect-chain":"\u0414\u043E\u0432\u0433\u0438\u0439 \u043B\u0430\u043D\u0446\u044E\u0436\u043E\u043A \u043F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u044C","sitemap-unavailable":"Sitemap \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0438\u0439","noindex-in-sitemap":"Noindex \u0443 sitemap","redirect-in-sitemap":"\u041F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u043D\u044F \u0443 sitemap","missing-title":"\u0412\u0456\u0434\u0441\u0443\u0442\u043D\u0456\u0439 title","duplicate-title":"\u0414\u0443\u0431\u043B\u044C\u043E\u0432\u0430\u043D\u0438\u0439 title","title-length":"\u0414\u043E\u0432\u0436\u0438\u043D\u0430 title","missing-description":"\u0412\u0456\u0434\u0441\u0443\u0442\u043D\u0456\u0439 description","duplicate-description":"\u0414\u0443\u0431\u043B\u044C\u043E\u0432\u0430\u043D\u0438\u0439 description","description-length":"\u0414\u043E\u0432\u0436\u0438\u043D\u0430 description","missing-h1":"\u0412\u0456\u0434\u0441\u0443\u0442\u043D\u0456\u0439 H1","broken-internal-link":"\u041D\u0435\u0440\u043E\u0431\u043E\u0447\u0435 \u0432\u043D\u0443\u0442\u0440\u0456\u0448\u043D\u0454 \u043F\u043E\u0441\u0438\u043B\u0430\u043D\u043D\u044F","orphan-sitemap-page":"\u0406\u0437\u043E\u043B\u044C\u043E\u0432\u0430\u043D\u0430 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0430 sitemap","crawlable-not-in-sitemap":"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u0432\u0456\u0434\u0441\u0443\u0442\u043D\u044F \u0443 sitemap","invalid-hreflang":"\u041D\u0435\u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0438\u0439 hreflang","malformed-json-ld":"\u041D\u0435\u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0438\u0439 JSON-LD","http-on-https-site":"HTTP URL \u043D\u0430 HTTPS-\u0441\u0430\u0439\u0442\u0456","invalid-language":"\u041D\u0435\u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0435 \u043E\u0433\u043E\u043B\u043E\u0448\u0435\u043D\u043D\u044F \u043C\u043E\u0432\u0438","duplicate-content":"\u0414\u0443\u0431\u043B\u044C\u043E\u0432\u0430\u043D\u0438\u0439 \u043A\u043E\u043D\u0442\u0435\u043D\u0442","multiple-h1":"\u041A\u0456\u043B\u044C\u043A\u0430 H1","missing-open-graph":"\u041D\u0435\u043F\u043E\u0432\u043D\u0456 Open Graph metadata","missing-twitter-metadata":"\u041D\u0435\u043F\u043E\u0432\u043D\u0456 Twitter metadata","image-missing-alt":"\u0417\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u043D\u044F \u0431\u0435\u0437 alt","low-word-count":"\u041C\u0430\u043B\u043E \u0442\u0435\u043A\u0441\u0442\u0443","robots-changed":"robots.txt \u0437\u043C\u0456\u043D\u0435\u043D\u043E","page-missing":"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0443 \u043D\u0435 \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u0435\u043D\u043E","status-regression":"\u0420\u0435\u0433\u0440\u0435\u0441\u0456\u044F HTTP-\u0441\u0442\u0430\u0442\u0443\u0441\u0443","new-noindex":"\u041D\u043E\u0432\u0438\u0439 noindex","title-removed":"Title \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u043E","title-changed":"Title \u0437\u043C\u0456\u043D\u0435\u043D\u043E","description-removed":"Description \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u043E","canonical-removed":"Canonical \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u043E","canonical-changed":"Canonical \u0437\u043C\u0456\u043D\u0435\u043D\u043E","h1-removed":"H1 \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u043E","redirect-changed":"\u041F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u043D\u044F \u0437\u043C\u0456\u043D\u0435\u043D\u043E","sitemap-url-count-drop":"\u0417\u043C\u0435\u043D\u0448\u0435\u043D\u043D\u044F URL \u0443 sitemap"},OA={"page-unreachable":"\u0412\u0456\u0434\u043D\u043E\u0432\u0456\u0442\u044C \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443 \u0430\u0431\u043E \u043F\u0440\u0438\u0431\u0435\u0440\u0456\u0442\u044C \u043F\u043E\u0441\u0438\u043B\u0430\u043D\u043D\u044F \u043D\u0430 \u043D\u0435\u0457.","http-error":"\u041F\u043E\u0432\u0435\u0440\u043D\u0456\u0442\u044C \u0443\u0441\u043F\u0456\u0448\u043D\u0443 \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u044C \u0430\u0431\u043E \u0441\u0432\u0456\u0434\u043E\u043C\u0435 \u043F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u043D\u044F.",noindex:"\u041F\u0440\u0438\u0431\u0435\u0440\u0456\u0442\u044C noindex, \u044F\u043A\u0449\u043E \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043C\u0430\u0454 \u0437\u2019\u044F\u0432\u043B\u044F\u0442\u0438\u0441\u044F \u0432 \u043F\u043E\u0448\u0443\u043A\u0443.","x-robots-noindex":"\u041F\u0440\u0438\u0431\u0435\u0440\u0456\u0442\u044C noindex \u0456\u0437 X-Robots-Tag, \u044F\u043A\u0449\u043E \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043C\u0430\u0454 \u0456\u043D\u0434\u0435\u043A\u0441\u0443\u0432\u0430\u0442\u0438\u0441\u044F.","robots-blocked":"\u0414\u043E\u0437\u0432\u043E\u043B\u044C\u0442\u0435 URL \u0443 robots.txt, \u044F\u043A\u0449\u043E \u0439\u043E\u0433\u043E \u043F\u043E\u0442\u0440\u0456\u0431\u043D\u043E \u0441\u043A\u0430\u043D\u0443\u0432\u0430\u0442\u0438.","missing-canonical":"\u0412\u043A\u0430\u0436\u0456\u0442\u044C \u0431\u0430\u0436\u0430\u043D\u0438\u0439 canonical URL, \u044F\u043A\u0449\u043E \u043C\u043E\u0436\u043B\u0438\u0432\u0456 \u0434\u0443\u0431\u043B\u0456\u043A\u0430\u0442\u0438 \u0430\u0434\u0440\u0435\u0441\u0438.","invalid-canonical":"\u0412\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u0430\u0439\u0442\u0435 \u0430\u0431\u0441\u043E\u043B\u044E\u0442\u043D\u0438\u0439 \u0430\u0431\u043E \u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0438\u0439 \u0432\u0456\u0434\u043D\u043E\u0441\u043D\u0438\u0439 HTTP(S) canonical URL.","cross-domain-canonical":"\u041F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u044C\u0442\u0435 \u0437\u043E\u0432\u043D\u0456\u0448\u043D\u0456\u0439 canonical \u0430\u0431\u043E \u0432\u043A\u0430\u0436\u0456\u0442\u044C \u043F\u043E\u0442\u0440\u0456\u0431\u043D\u0438\u0439 URL \u0446\u044C\u043E\u0433\u043E \u0441\u0430\u0439\u0442\u0443.","canonical-target-error":"\u0421\u043F\u0440\u044F\u043C\u0443\u0439\u0442\u0435 canonical \u043D\u0430 \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0438\u0439 URL, \u0434\u043E\u0437\u0432\u043E\u043B\u0435\u043D\u0438\u0439 \u0434\u043B\u044F \u0456\u043D\u0434\u0435\u043A\u0441\u0430\u0446\u0456\u0457.","redirect-loop":"\u041F\u0440\u0438\u0431\u0435\u0440\u0456\u0442\u044C \u0446\u0438\u043A\u043B\u0456\u0447\u043D\u0438\u0439 \u043C\u0430\u0440\u0448\u0440\u0443\u0442 \u043F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u044C.","long-redirect-chain":"\u041F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u044F\u0439\u0442\u0435 \u043E\u0434\u0440\u0430\u0437\u0443 \u043D\u0430 \u043A\u0456\u043D\u0446\u0435\u0432\u0443 \u0430\u0434\u0440\u0435\u0441\u0443.","sitemap-unavailable":"\u0412\u0456\u0434\u043D\u043E\u0432\u0456\u0442\u044C \u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0438\u0439 \u0456 \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0438\u0439 XML sitemap.","noindex-in-sitemap":"\u041F\u0440\u0438\u0431\u0435\u0440\u0456\u0442\u044C URL \u0456\u0437 sitemap \u0430\u0431\u043E \u0434\u043E\u0437\u0432\u043E\u043B\u044C\u0442\u0435 \u0439\u043E\u0433\u043E \u0456\u043D\u0434\u0435\u043A\u0441\u0430\u0446\u0456\u044E.","redirect-in-sitemap":"\u0417\u0430\u043C\u0456\u043D\u0456\u0442\u044C URL \u0443 sitemap \u043D\u0430 \u0439\u043E\u0433\u043E \u043A\u0456\u043D\u0446\u0435\u0432\u0443 canonical-\u0430\u0434\u0440\u0435\u0441\u0443.","missing-title":"\u0414\u043E\u0434\u0430\u0439\u0442\u0435 \u0443\u043D\u0456\u043A\u0430\u043B\u044C\u043D\u0438\u0439 \u043E\u043F\u0438\u0441\u043E\u0432\u0438\u0439 HTML title.","duplicate-title":"\u041D\u0430\u043F\u0438\u0448\u0456\u0442\u044C title, \u044F\u043A\u0438\u0439 \u0443\u043D\u0456\u043A\u0430\u043B\u044C\u043D\u043E \u043E\u043F\u0438\u0441\u0443\u0454 \u0446\u044E \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443.","title-length":"\u0417\u0440\u043E\u0431\u0456\u0442\u044C title \u0441\u0442\u0438\u0441\u043B\u0438\u043C \u0456 \u0437\u043C\u0456\u0441\u0442\u043E\u0432\u043D\u0438\u043C, \u0437\u0430\u0437\u0432\u0438\u0447\u0430\u0439 10\u201360 \u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432.","missing-description":"\u0414\u043E\u0434\u0430\u0439\u0442\u0435 \u043A\u043E\u0440\u0438\u0441\u043D\u0438\u0439 meta description.","duplicate-description":"\u041D\u0430\u043F\u0438\u0448\u0456\u0442\u044C \u0443\u043D\u0456\u043A\u0430\u043B\u044C\u043D\u0438\u0439 meta description \u0434\u043B\u044F \u0446\u0456\u0454\u0457 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438.","description-length":"\u0417\u0440\u043E\u0431\u0456\u0442\u044C description \u043A\u043E\u0440\u0438\u0441\u043D\u0438\u043C \u0456 \u0437\u0430\u0437\u0432\u0438\u0447\u0430\u0439 \u0434\u043E\u0432\u0436\u0438\u043D\u043E\u044E 50\u2013160 \u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432.","missing-h1":"\u0414\u043E\u0434\u0430\u0439\u0442\u0435 \u043E\u0434\u0438\u043D \u0437\u0440\u043E\u0437\u0443\u043C\u0456\u043B\u0438\u0439 \u043E\u0441\u043D\u043E\u0432\u043D\u0438\u0439 \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A.","broken-internal-link":"\u041E\u043D\u043E\u0432\u0456\u0442\u044C \u0430\u0431\u043E \u043F\u0440\u0438\u0431\u0435\u0440\u0456\u0442\u044C \u0432\u043D\u0443\u0442\u0440\u0456\u0448\u043D\u0454 \u043F\u043E\u0441\u0438\u043B\u0430\u043D\u043D\u044F \u0447\u0438 \u0432\u0456\u0434\u043D\u043E\u0432\u0456\u0442\u044C \u0439\u043E\u0433\u043E \u0446\u0456\u043B\u044C.","orphan-sitemap-page":"\u0414\u043E\u0434\u0430\u0439\u0442\u0435 \u0437\u043C\u0456\u0441\u0442\u043E\u0432\u043D\u0456 \u0432\u043D\u0443\u0442\u0440\u0456\u0448\u043D\u0456 \u043F\u043E\u0441\u0438\u043B\u0430\u043D\u043D\u044F \u043D\u0430 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443 \u0456\u0437 sitemap.","crawlable-not-in-sitemap":"\u0414\u043E\u0434\u0430\u0439\u0442\u0435 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443 \u0434\u043E sitemap \u0430\u0431\u043E \u0441\u0432\u0456\u0434\u043E\u043C\u043E \u0432\u0438\u043A\u043B\u044E\u0447\u0456\u0442\u044C \u0457\u0457.","invalid-hreflang":"\u0412\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u0430\u0439\u0442\u0435 \u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0456 \u043C\u043E\u0432\u043D\u0456 \u0442\u0435\u0433\u0438 \u0442\u0430 \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0456 HTTP(S) alternate URL.","malformed-json-ld":"\u0412\u0438\u043F\u0440\u0430\u0432\u0442\u0435 JSON-\u0441\u0438\u043D\u0442\u0430\u043A\u0441\u0438\u0441 \u0443 \u0431\u043B\u043E\u0446\u0456 \u0441\u0442\u0440\u0443\u043A\u0442\u0443\u0440\u043E\u0432\u0430\u043D\u0438\u0445 \u0434\u0430\u043D\u0438\u0445.","http-on-https-site":"\u0412\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u043E\u0432\u0443\u0439\u0442\u0435 HTTPS \u0434\u043B\u044F \u0432\u043D\u0443\u0442\u0440\u0456\u0448\u043D\u0456\u0445 URL \u0456 metadata.","invalid-language":"\u0412\u043A\u0430\u0436\u0456\u0442\u044C \u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0438\u0439 \u043C\u043E\u0432\u043D\u0438\u0439 \u0442\u0435\u0433 BCP 47 \u0432 \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456 html.","duplicate-content":"\u041E\u0431\u2019\u0454\u0434\u043D\u0430\u0439\u0442\u0435 \u0434\u0443\u0431\u043B\u044C\u043E\u0432\u0430\u043D\u0456 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438 \u0430\u0431\u043E \u0437\u0440\u043E\u0431\u0456\u0442\u044C \u0457\u0445\u043D\u0456\u0439 \u043E\u0441\u043D\u043E\u0432\u043D\u0438\u0439 \u043A\u043E\u043D\u0442\u0435\u043D\u0442 \u0432\u0456\u0434\u043C\u0456\u043D\u043D\u0438\u043C.","multiple-h1":"\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u0442\u0435, \u0447\u0438 \u043E\u0434\u0438\u043D \u043E\u0441\u043D\u043E\u0432\u043D\u0438\u0439 H1 \u043D\u0435 \u0437\u0440\u043E\u0431\u0438\u0442\u044C \u0456\u0454\u0440\u0430\u0440\u0445\u0456\u044E \u0437\u0440\u043E\u0437\u0443\u043C\u0456\u043B\u0456\u0448\u043E\u044E.","missing-open-graph":"\u0414\u043E\u0434\u0430\u0439\u0442\u0435 Open Graph title, description \u0442\u0430 image \u0434\u043B\u044F \u043F\u043E\u0448\u0438\u0440\u0435\u043D\u043D\u044F \u0432 \u0441\u043E\u0446\u043C\u0435\u0440\u0435\u0436\u0430\u0445.","missing-twitter-metadata":"\u0414\u043E\u0434\u0430\u0439\u0442\u0435 Twitter card metadata, \u044F\u043A\u0449\u043E \u0432\u0430\u0436\u043B\u0438\u0432\u0456 \u0441\u043E\u0446\u0456\u0430\u043B\u044C\u043D\u0456 \u043F\u0440\u0435\u0432\u2019\u044E.","image-missing-alt":"\u0414\u043E\u0434\u0430\u0439\u0442\u0435 \u0437\u043C\u0456\u0441\u0442\u043E\u0432\u043D\u0438\u0439 alt \u0430\u0431\u043E \u043F\u043E\u0440\u043E\u0436\u043D\u0456\u0439 alt \u0434\u043B\u044F \u0434\u0435\u043A\u043E\u0440\u0430\u0442\u0438\u0432\u043D\u0438\u0445 \u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u044C.","low-word-count":"\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u0442\u0435, \u0447\u0438 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043C\u0456\u0441\u0442\u0438\u0442\u044C \u0434\u043E\u0441\u0442\u0430\u0442\u043D\u044C\u043E \u043A\u043E\u0440\u0438\u0441\u043D\u043E\u0433\u043E \u043E\u0441\u043D\u043E\u0432\u043D\u043E\u0433\u043E \u043A\u043E\u043D\u0442\u0435\u043D\u0442\u0443.","robots-changed":"\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u0442\u0435 \u0437\u043C\u0456\u043D\u0443 robots.txt \u0456 \u043F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u044C\u0442\u0435, \u0449\u043E \u0434\u043E\u0441\u0442\u0443\u043F \u0434\u043B\u044F \u0441\u043A\u0430\u043D\u0443\u0432\u0430\u043D\u043D\u044F \u0437\u043C\u0456\u043D\u0435\u043D\u043E \u0441\u0432\u0456\u0434\u043E\u043C\u043E.","page-missing":"\u0414\u043E\u0434\u0430\u0439\u0442\u0435 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443 \u0434\u043E \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u043A\u0438 \u0430\u0431\u043E \u043F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u044C\u0442\u0435, \u0449\u043E \u0457\u0457 \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u043E \u0441\u0432\u0456\u0434\u043E\u043C\u043E.","status-regression":"\u0412\u0456\u0434\u043D\u043E\u0432\u0456\u0442\u044C \u043F\u043E\u043F\u0435\u0440\u0435\u0434\u043D\u044E \u0443\u0441\u043F\u0456\u0448\u043D\u0443 HTTP-\u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u044C.","new-noindex":"\u041F\u0440\u0438\u0431\u0435\u0440\u0456\u0442\u044C \u043D\u043E\u0432\u0438\u0439 noindex, \u044F\u043A\u0449\u043E \u0439\u043E\u0433\u043E \u043D\u0435 \u0434\u043E\u0434\u0430\u043D\u043E \u043D\u0430\u0432\u043C\u0438\u0441\u043D\u043E.","title-removed":"\u0412\u0456\u0434\u043D\u043E\u0432\u0456\u0442\u044C \u0437\u043C\u0456\u0441\u0442\u043E\u0432\u043D\u0438\u0439 title.","title-changed":"\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u0442\u0435 \u0442\u0430 \u043F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u044C\u0442\u0435 \u0437\u043C\u0456\u043D\u0435\u043D\u0438\u0439 title.","description-removed":"\u0412\u0456\u0434\u043D\u043E\u0432\u0456\u0442\u044C \u043A\u043E\u0440\u0438\u0441\u043D\u0438\u0439 meta description.","canonical-removed":"\u0412\u0456\u0434\u043D\u043E\u0432\u0456\u0442\u044C canonical.","canonical-changed":"\u041F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u044C\u0442\u0435, \u0449\u043E \u043D\u043E\u0432\u0430 \u0446\u0456\u043B\u044C canonical \u0441\u0432\u0456\u0434\u043E\u043C\u0430 \u0439 \u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0430.","h1-removed":"\u0412\u0456\u0434\u043D\u043E\u0432\u0456\u0442\u044C \u0437\u0440\u043E\u0437\u0443\u043C\u0456\u043B\u0438\u0439 \u043E\u0441\u043D\u043E\u0432\u043D\u0438\u0439 \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A.","redirect-changed":"\u041F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u044C\u0442\u0435, \u0449\u043E \u043D\u043E\u0432\u0430 \u0446\u0456\u043B\u044C \u043F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u043D\u044F \u0441\u0432\u0456\u0434\u043E\u043C\u0430.","sitemap-url-count-drop":"\u0414\u043E\u0441\u043B\u0456\u0434\u0456\u0442\u044C \u0432\u0442\u0440\u0430\u0442\u0443 URL \u0443 sitemap \u0456 \u043F\u043E\u0432\u0435\u0440\u043D\u0456\u0442\u044C \u043F\u0440\u043E\u043F\u0443\u0449\u0435\u043D\u0456 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438 \u0434\u043B\u044F \u0456\u043D\u0434\u0435\u043A\u0441\u0430\u0446\u0456\u0457."};function DA(e){return e.evidence?.actual??e.after}function BA(e,t){let r=DA(e);switch(t){case"page-unreachable":case"redirect-loop":return`\u0417\u0430\u043F\u0438\u0442 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0432\u0441\u044F \u043F\u043E\u043C\u0438\u043B\u043A\u043E\u044E: ${String(r??"\u043D\u0435\u0432\u0456\u0434\u043E\u043C\u0430 \u043F\u043E\u043C\u0438\u043B\u043A\u0430")}`;case"http-error":return`\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043F\u043E\u0432\u0435\u0440\u043D\u0443\u043B\u0430 HTTP ${String(r??"\u043D\u0435\u0432\u0456\u0434\u043E\u043C\u043E")}`;case"noindex":return"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043C\u0456\u0441\u0442\u0438\u0442\u044C \u0434\u0438\u0440\u0435\u043A\u0442\u0438\u0432\u0443 noindex \u0443 meta";case"x-robots-noindex":return"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043C\u0456\u0441\u0442\u0438\u0442\u044C noindex \u0443 X-Robots-Tag";case"robots-blocked":return e.before===!1?"\u0422\u0435\u043F\u0435\u0440 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443 \u0437\u0430\u0431\u043B\u043E\u043A\u043E\u0432\u0430\u043D\u043E \u0447\u0435\u0440\u0435\u0437 robots.txt":"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0443 \u0437\u0430\u0431\u043B\u043E\u043A\u043E\u0432\u0430\u043D\u043E \u0447\u0435\u0440\u0435\u0437 robots.txt";case"missing-canonical":return"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043D\u0435 \u043C\u0456\u0441\u0442\u0438\u0442\u044C canonical URL";case"invalid-canonical":return"Canonical URL \u043D\u0435\u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0438\u0439";case"cross-domain-canonical":return"Canonical \u0432\u043A\u0430\u0437\u0443\u0454 \u043D\u0430 \u0456\u043D\u0448\u0438\u0439 \u0434\u043E\u043C\u0435\u043D";case"canonical-target-error":return"\u0426\u0456\u043B\u044C canonical \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0430";case"long-redirect-chain":return`\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u0432\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u043E\u0432\u0443\u0454 ${String(r??0)} \u043F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u044C`;case"sitemap-unavailable":return"\u041D\u0435 \u0432\u0434\u0430\u043B\u043E\u0441\u044F \u0437\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0438\u0442\u0438 \u043D\u0430\u043B\u0430\u0448\u0442\u043E\u0432\u0430\u043D\u0438\u0439 sitemap";case"noindex-in-sitemap":return"URL \u0456\u0437 sitemap \u043F\u043E\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0439 noindex";case"redirect-in-sitemap":return"URL \u0456\u0437 sitemap \u043F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u044F\u0454\u0442\u044C\u0441\u044F";case"missing-title":return"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043D\u0435 \u043C\u0430\u0454 title";case"duplicate-title":return"\u041A\u0456\u043B\u044C\u043A\u0430 \u0441\u0442\u043E\u0440\u0456\u043D\u043E\u043A \u043C\u0430\u044E\u0442\u044C \u043E\u0434\u043D\u0430\u043A\u043E\u0432\u0438\u0439 title";case"title-length":return`\u0414\u043E\u0432\u0436\u0438\u043D\u0430 title \u2014 ${String(r??0)} \u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432`;case"missing-description":return"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043D\u0435 \u043C\u0430\u0454 meta description";case"duplicate-description":return"\u041A\u0456\u043B\u044C\u043A\u0430 \u0441\u0442\u043E\u0440\u0456\u043D\u043E\u043A \u043C\u0430\u044E\u0442\u044C \u043E\u0434\u043D\u0430\u043A\u043E\u0432\u0438\u0439 meta description";case"description-length":return`\u0414\u043E\u0432\u0436\u0438\u043D\u0430 description \u2014 ${String(r??0)} \u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432`;case"missing-h1":return"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043D\u0435 \u043C\u0456\u0441\u0442\u0438\u0442\u044C \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u0430 H1";case"multiple-h1":return`\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043C\u0456\u0441\u0442\u0438\u0442\u044C H1 \u0443 \u043A\u0456\u043B\u044C\u043A\u043E\u0441\u0442\u0456: ${String(r??0)}`;case"broken-internal-link":return"\u0412\u043D\u0443\u0442\u0440\u0456\u0448\u043D\u0454 \u043F\u043E\u0441\u0438\u043B\u0430\u043D\u043D\u044F \u0432\u0435\u0434\u0435 \u043D\u0430 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0443 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443";case"orphan-sitemap-page":return"\u041D\u0430 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443 \u0456\u0437 sitemap \u043D\u0435 \u0437\u043D\u0430\u0439\u0434\u0435\u043D\u043E \u0432\u043D\u0443\u0442\u0440\u0456\u0448\u043D\u0456\u0445 \u043F\u043E\u0441\u0438\u043B\u0430\u043D\u044C";case"crawlable-not-in-sitemap":return"\u0414\u043E\u0441\u0442\u0443\u043F\u043D\u0430 \u0434\u043B\u044F \u0441\u043A\u0430\u043D\u0443\u0432\u0430\u043D\u043D\u044F \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u0432\u0456\u0434\u0441\u0443\u0442\u043D\u044F \u0443 sitemap";case"invalid-hreflang":return"\u041E\u0433\u043E\u043B\u043E\u0448\u0435\u043D\u043D\u044F hreflang \u043D\u0435\u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0435";case"malformed-json-ld":return"\u0411\u043B\u043E\u043A JSON-LD \u043C\u0456\u0441\u0442\u0438\u0442\u044C \u043D\u0435\u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0438\u0439 JSON";case"http-on-https-site":return"HTTPS-\u0441\u0430\u0439\u0442 \u043F\u043E\u0441\u0438\u043B\u0430\u0454\u0442\u044C\u0441\u044F \u043D\u0430 \u0432\u043D\u0443\u0442\u0440\u0456\u0448\u043D\u0456\u0439 HTTP URL";case"invalid-language":return"\u041E\u0433\u043E\u043B\u043E\u0448\u0435\u043D\u043D\u044F \u043C\u043E\u0432\u0438 HTML \u043D\u0435\u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0435";case"duplicate-content":return"\u041E\u0441\u043D\u043E\u0432\u043D\u0438\u0439 \u0442\u0435\u043A\u0441\u0442 \u0454 \u0442\u043E\u0447\u043D\u0438\u043C \u0434\u0443\u0431\u043B\u0435\u043C \u0456\u043D\u0448\u043E\u0457 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438";case"missing-open-graph":return"Open Graph metadata \u043D\u0435\u043F\u043E\u0432\u043D\u0456";case"missing-twitter-metadata":return"Twitter card metadata \u043D\u0435\u043F\u043E\u0432\u043D\u0456";case"image-missing-alt":return`${Array.isArray(r)?r.length:String(r??0)} \u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u044C \u043D\u0435 \u043C\u0430\u044E\u0442\u044C \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 alt`;case"low-word-count":return`\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043C\u0456\u0441\u0442\u0438\u0442\u044C \u043F\u0440\u0438\u0431\u043B\u0438\u0437\u043D\u043E ${String(r??0)} \u0432\u0438\u0434\u0438\u043C\u0438\u0445 \u0441\u043B\u0456\u0432`;case"robots-changed":return"\u0412\u043C\u0456\u0441\u0442 robots.txt \u0437\u043C\u0456\u043D\u0438\u0432\u0441\u044F";case"page-missing":return"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0443 \u043D\u0435 \u0431\u0443\u043B\u043E \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u0435\u043D\u043E";case"status-regression":return`HTTP-\u0441\u0442\u0430\u0442\u0443\u0441 \u043F\u043E\u0433\u0456\u0440\u0448\u0438\u0432\u0441\u044F \u0437 ${String(e.before??"\u043D\u0435\u0432\u0456\u0434\u043E\u043C\u043E")} \u0434\u043E ${String(e.after??"\u0432\u0456\u0434\u0441\u0443\u0442\u043D\u0456\u0439")}`;case"new-noindex":return"\u0422\u0435\u043F\u0435\u0440 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043C\u0456\u0441\u0442\u0438\u0442\u044C \u0434\u0438\u0440\u0435\u043A\u0442\u0438\u0432\u0443 noindex";case"title-removed":return"Title \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438 \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u043E";case"title-changed":return"Title \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438 \u0437\u043C\u0456\u043D\u0435\u043D\u043E";case"description-removed":return"Meta description \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u043E";case"canonical-removed":return"Canonical URL \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u043E";case"canonical-changed":return"Canonical URL \u0437\u043C\u0456\u043D\u0435\u043D\u043E";case"h1-removed":return"\u0423\u0441\u0456 \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u0438 H1 \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u043E";case"redirect-changed":return"\u041A\u0456\u043D\u0446\u0435\u0432\u0438\u0439 URL \u043F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u043D\u044F \u0437\u043C\u0456\u043D\u0435\u043D\u043E";case"sitemap-url-count-drop":return`\u041A\u0456\u043B\u044C\u043A\u0456\u0441\u0442\u044C URL \u0443 sitemap \u0437\u043C\u0435\u043D\u0448\u0438\u043B\u0430\u0441\u044F \u043D\u0430 ${String((Number(e.before)||0)-(Number(e.after)||0))}`;default:return e.message??"\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u0442\u0435 \u043F\u0440\u043E\u0431\u043B\u0435\u043C\u0443 \u0442\u0430 \u043F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u044C\u0442\u0435 \u043E\u0447\u0456\u043A\u0443\u0432\u0430\u043D\u0443 \u043F\u043E\u0432\u0435\u0434\u0456\u043D\u043A\u0443."}}function fi(e,t){let r=e.remediation??"Review the finding and confirm the intended behavior.";return{en:{rule:gi(t),message:e.message??"",remediation:r},uk:{rule:LA[t]??gi(t),message:BA(e,t),remediation:OA[t]??"\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u0442\u0435 \u043F\u0440\u043E\u0431\u043B\u0435\u043C\u0443 \u0442\u0430 \u043F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u044C\u0442\u0435 \u043E\u0447\u0456\u043A\u0443\u0432\u0430\u043D\u0443 \u043F\u043E\u0432\u0435\u0434\u0456\u043D\u043A\u0443."}}}var Ei={en:{language:"Language",titles:{partial:"Partial SEO scan report",check:"SEO regression report",scan:"SEO baseline audit"},generated:"Generated",engine:"Engine",rules:"Rules",issueLifecycle:"Issue lifecycle",partialTitle:"Partial results.",partialMessage:"This report contains the pages saved so far. Run the same scan command again to resume without requesting them twice.",incompleteTitle:"Incomplete comparison.",incompleteMessage:"Regressions found on checked pages are shown, but unchecked pages are not marked missing or resolved.",previewTitle:"Preview deployment comparison.",production:"Production",preview:"Preview",cards:{pages:"Pages checked",error:"Errors",warning:"Warnings",info:"Info",affected:"Affected pages"},analytics:{title:"Issue statistics",hint:"Select a chart item to filter the issue table.",severity:"By severity",topRules:"Most frequent checks",owners:"By owner",lifecycle:"By lifecycle",templates:"Affected page templates",total:"Total issues",noData:"No issues to chart.",filterBy:"Filter by"},history:{title:"Local scan history",hint:"Issue trends from snapshots stored on this device.",chartLabel:"Issue trend across runs.",runs:"Runs",pages:"Latest pages",newIssues:"New issues",resolvedIssues:"Resolved issues",sitemapUrls:"Sitemap URLs",maxDepth:"Maximum crawl depth"},tabs:{current:"Current / all",new:"New",ongoing:"Ongoing",resolved:"Resolved",unchanged:"Unchanged"},filters:{search:"URL or text",searchPlaceholder:"URL, check, or message",severity:"Severity",rule:"Check",template:"Page template",owner:"Owner",rows:"Rows"},all:{severity:"All severities",rule:"All checks",template:"All templates",owner:"All owners"},severities:{error:"Error",warning:"Warning",info:"Info"},owners:{seo:"SEO",content:"Content",developer:"Developer"},rows:{100:"100 per page",250:"250 per page",500:"500 per page"},guide:{error:"Errors",errorText:"need attention first.",warning:"Warnings",warningText:"are important improvements.",info:"Info",infoText:"is useful context.",score:"No opaque SEO score is used."},exportCsv:"Export CSV",previous:"Previous",next:"Next",table:{severity:"Severity",lifecycle:"Lifecycle",ruleOwner:"Check / owner",page:"Page",finding:"What was found",change:"Change",before:"Before",evidence:"Evidence / after",remediation:"Remediation",fingerprint:"Fingerprint"},empty:{cleanTitle:"No SEO issues found",cleanMessage:"The scanned pages passed all current checks.",filteredTitle:"No matching issues",filteredMessage:"Try a different lifecycle tab or clear the selected filters.",clear:"Clear filters"},lifecycle:{current:"Current",new:"New",ongoing:"Ongoing",resolved:"Resolved",unchanged:"Unchanged"},notPresent:"Not present",page:"Page",of:"of",issue:"issue",issues:"issues",docs:"docs",footer:"Generated locally. No report data was uploaded."},uk:{language:"\u041C\u043E\u0432\u0430",titles:{partial:"\u0417\u0432\u0456\u0442 \u0447\u0430\u0441\u0442\u043A\u043E\u0432\u043E\u0433\u043E SEO-\u0441\u043A\u0430\u043D\u0443\u0432\u0430\u043D\u043D\u044F",check:"\u0417\u0432\u0456\u0442 \u043F\u0440\u043E SEO-\u0440\u0435\u0433\u0440\u0435\u0441\u0456\u0457",scan:"\u0411\u0430\u0437\u043E\u0432\u0438\u0439 SEO-\u0430\u0443\u0434\u0438\u0442"},generated:"\u0421\u0442\u0432\u043E\u0440\u0435\u043D\u043E",engine:"\u0420\u0443\u0448\u0456\u0439",rules:"\u041F\u0440\u0430\u0432\u0438\u043B\u0430",issueLifecycle:"\u0421\u0442\u0430\u043D\u0438 \u043F\u0440\u043E\u0431\u043B\u0435\u043C",partialTitle:"\u0427\u0430\u0441\u0442\u043A\u043E\u0432\u0456 \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u0438.",partialMessage:"\u0417\u0432\u0456\u0442 \u043C\u0456\u0441\u0442\u0438\u0442\u044C \u0443\u0436\u0435 \u0437\u0431\u0435\u0440\u0435\u0436\u0435\u043D\u0456 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438. \u0417\u0430\u043F\u0443\u0441\u0442\u0456\u0442\u044C \u0442\u0443 \u0441\u0430\u043C\u0443 \u043A\u043E\u043C\u0430\u043D\u0434\u0443 \u0449\u0435 \u0440\u0430\u0437, \u0449\u043E\u0431 \u043F\u0440\u043E\u0434\u043E\u0432\u0436\u0438\u0442\u0438 \u0431\u0435\u0437 \u043F\u043E\u0432\u0442\u043E\u0440\u043D\u0438\u0445 \u0437\u0430\u043F\u0438\u0442\u0456\u0432.",incompleteTitle:"\u041D\u0435\u043F\u043E\u0432\u043D\u0435 \u043F\u043E\u0440\u0456\u0432\u043D\u044F\u043D\u043D\u044F.",incompleteMessage:"\u041F\u043E\u043A\u0430\u0437\u0430\u043D\u043E \u0440\u0435\u0433\u0440\u0435\u0441\u0456\u0457 \u043D\u0430 \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u0435\u043D\u0438\u0445 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0430\u0445, \u0430\u043B\u0435 \u043D\u0435\u043F\u0435\u0440\u0435\u0432\u0456\u0440\u0435\u043D\u0456 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438 \u043D\u0435 \u043F\u043E\u0437\u043D\u0430\u0447\u0435\u043D\u043E \u044F\u043A \u0432\u0456\u0434\u0441\u0443\u0442\u043D\u0456 \u0447\u0438 \u0432\u0438\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0456.",previewTitle:"\u041F\u043E\u0440\u0456\u0432\u043D\u044F\u043D\u043D\u044F production \u0456 preview.",production:"Production",preview:"Preview",cards:{pages:"\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u0435\u043D\u043E \u0441\u0442\u043E\u0440\u0456\u043D\u043E\u043A",error:"\u041F\u043E\u043C\u0438\u043B\u043A\u0438",warning:"\u041F\u043E\u043F\u0435\u0440\u0435\u0434\u0436\u0435\u043D\u043D\u044F",info:"\u0406\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0456\u044F",affected:"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0438 \u0437 \u043F\u0440\u043E\u0431\u043B\u0435\u043C\u0430\u043C\u0438"},analytics:{title:"\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043A\u0430 \u043F\u0440\u043E\u0431\u043B\u0435\u043C",hint:"\u041E\u0431\u0435\u0440\u0456\u0442\u044C \u0435\u043B\u0435\u043C\u0435\u043D\u0442 \u0433\u0440\u0430\u0444\u0456\u043A\u0430, \u0449\u043E\u0431 \u0432\u0456\u0434\u0444\u0456\u043B\u044C\u0442\u0440\u0443\u0432\u0430\u0442\u0438 \u0442\u0430\u0431\u043B\u0438\u0446\u044E \u043F\u0440\u043E\u0431\u043B\u0435\u043C.",severity:"\u0417\u0430 \u0432\u0430\u0436\u043B\u0438\u0432\u0456\u0441\u0442\u044E",topRules:"\u041D\u0430\u0439\u0447\u0430\u0441\u0442\u0456\u0448\u0456 \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u043A\u0438",owners:"\u0417\u0430 \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u043B\u044C\u043D\u0438\u043C\u0438",lifecycle:"\u0417\u0430 \u0441\u0442\u0430\u043D\u043E\u043C",templates:"\u0428\u0430\u0431\u043B\u043E\u043D\u0438 \u0441\u0442\u043E\u0440\u0456\u043D\u043E\u043A \u0456\u0437 \u043F\u0440\u043E\u0431\u043B\u0435\u043C\u0430\u043C\u0438",total:"\u0423\u0441\u044C\u043E\u0433\u043E \u043F\u0440\u043E\u0431\u043B\u0435\u043C",noData:"\u041D\u0435\u043C\u0430\u0454 \u043F\u0440\u043E\u0431\u043B\u0435\u043C \u0434\u043B\u044F \u0432\u0456\u0434\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u043D\u044F.",filterBy:"\u0424\u0456\u043B\u044C\u0442\u0440\u0443\u0432\u0430\u0442\u0438 \u0437\u0430"},history:{title:"\u041B\u043E\u043A\u0430\u043B\u044C\u043D\u0430 \u0456\u0441\u0442\u043E\u0440\u0456\u044F \u0441\u043A\u0430\u043D\u0443\u0432\u0430\u043D\u044C",hint:"\u0414\u0438\u043D\u0430\u043C\u0456\u043A\u0430 \u043F\u0440\u043E\u0431\u043B\u0435\u043C \u0437\u0456 snapshot-\u0444\u0430\u0439\u043B\u0456\u0432, \u0437\u0431\u0435\u0440\u0435\u0436\u0435\u043D\u0438\u0445 \u043D\u0430 \u0446\u044C\u043E\u043C\u0443 \u043F\u0440\u0438\u0441\u0442\u0440\u043E\u0457.",chartLabel:"\u0414\u0438\u043D\u0430\u043C\u0456\u043A\u0430 \u043F\u0440\u043E\u0431\u043B\u0435\u043C \u0437\u0430 \u0437\u0430\u043F\u0443\u0441\u043A\u0430\u043C\u0438.",runs:"\u0417\u0430\u043F\u0443\u0441\u043A\u0438",pages:"\u0421\u0442\u043E\u0440\u0456\u043D\u043E\u043A \u0432\u043E\u0441\u0442\u0430\u043D\u043D\u0454",newIssues:"\u041D\u043E\u0432\u0456 \u043F\u0440\u043E\u0431\u043B\u0435\u043C\u0438",resolvedIssues:"\u0412\u0438\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0456 \u043F\u0440\u043E\u0431\u043B\u0435\u043C\u0438",sitemapUrls:"URL \u0443 sitemap",maxDepth:"\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0430 \u0433\u043B\u0438\u0431\u0438\u043D\u0430"},tabs:{current:"\u041F\u043E\u0442\u043E\u0447\u043D\u0456 / \u0443\u0441\u0456",new:"\u041D\u043E\u0432\u0456",ongoing:"\u0422\u0440\u0438\u0432\u0430\u044E\u0442\u044C",resolved:"\u0412\u0438\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0456",unchanged:"\u0411\u0435\u0437 \u0437\u043C\u0456\u043D"},filters:{search:"URL \u0430\u0431\u043E \u0442\u0435\u043A\u0441\u0442",searchPlaceholder:"URL, \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u043A\u0430 \u0430\u0431\u043E \u043F\u043E\u0432\u0456\u0434\u043E\u043C\u043B\u0435\u043D\u043D\u044F",severity:"\u0412\u0430\u0436\u043B\u0438\u0432\u0456\u0441\u0442\u044C",rule:"\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u043A\u0430",template:"\u0428\u0430\u0431\u043B\u043E\u043D \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438",owner:"\u0412\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u043B\u044C\u043D\u0438\u0439",rows:"\u0420\u044F\u0434\u043A\u0438"},all:{severity:"\u0423\u0441\u0456 \u0440\u0456\u0432\u043D\u0456",rule:"\u0423\u0441\u0456 \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u043A\u0438",template:"\u0423\u0441\u0456 \u0448\u0430\u0431\u043B\u043E\u043D\u0438",owner:"\u0423\u0441\u0456 \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u043B\u044C\u043D\u0456"},severities:{error:"\u041F\u043E\u043C\u0438\u043B\u043A\u0430",warning:"\u041F\u043E\u043F\u0435\u0440\u0435\u0434\u0436\u0435\u043D\u043D\u044F",info:"\u0406\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0456\u044F"},owners:{seo:"SEO",content:"\u041A\u043E\u043D\u0442\u0435\u043D\u0442",developer:"\u0420\u043E\u0437\u0440\u043E\u0431\u043D\u0438\u043A"},rows:{100:"100 \u043D\u0430 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443",250:"250 \u043D\u0430 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443",500:"500 \u043D\u0430 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443"},guide:{error:"\u041F\u043E\u043C\u0438\u043B\u043A\u0438",errorText:"\u043F\u043E\u0442\u0440\u0435\u0431\u0443\u044E\u0442\u044C \u043F\u0435\u0440\u0448\u043E\u0447\u0435\u0440\u0433\u043E\u0432\u043E\u0457 \u0443\u0432\u0430\u0433\u0438.",warning:"\u041F\u043E\u043F\u0435\u0440\u0435\u0434\u0436\u0435\u043D\u043D\u044F",warningText:"\u043F\u043E\u0437\u043D\u0430\u0447\u0430\u044E\u0442\u044C \u0432\u0430\u0436\u043B\u0438\u0432\u0456 \u043F\u043E\u043A\u0440\u0430\u0449\u0435\u043D\u043D\u044F.",info:"\u0406\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0456\u044F",infoText:"\u0434\u0430\u0454 \u043A\u043E\u0440\u0438\u0441\u043D\u0438\u0439 \u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442.",score:"\u041D\u0435\u043F\u0440\u043E\u0437\u043E\u0440\u0430 SEO-\u043E\u0446\u0456\u043D\u043A\u0430 \u043D\u0435 \u0432\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u043E\u0432\u0443\u0454\u0442\u044C\u0441\u044F."},exportCsv:"\u0415\u043A\u0441\u043F\u043E\u0440\u0442 CSV",previous:"\u041D\u0430\u0437\u0430\u0434",next:"\u0414\u0430\u043B\u0456",table:{severity:"\u0412\u0430\u0436\u043B\u0438\u0432\u0456\u0441\u0442\u044C",lifecycle:"\u0421\u0442\u0430\u043D",ruleOwner:"\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u043A\u0430 / \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u043B\u044C\u043D\u0438\u0439",page:"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430",finding:"\u0429\u043E \u0437\u043D\u0430\u0439\u0434\u0435\u043D\u043E",change:"\u0417\u043C\u0456\u043D\u0430",before:"\u0411\u0443\u043B\u043E",evidence:"\u0414\u043E\u043A\u0430\u0437 / \u0441\u0442\u0430\u043B\u043E",remediation:"\u042F\u043A \u0432\u0438\u043F\u0440\u0430\u0432\u0438\u0442\u0438",fingerprint:"\u0412\u0456\u0434\u0431\u0438\u0442\u043E\u043A"},empty:{cleanTitle:"SEO-\u043F\u0440\u043E\u0431\u043B\u0435\u043C \u043D\u0435 \u0437\u043D\u0430\u0439\u0434\u0435\u043D\u043E",cleanMessage:"\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u0435\u043D\u0456 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438 \u043F\u0440\u043E\u0439\u0448\u043B\u0438 \u0432\u0441\u0456 \u0430\u043A\u0442\u0438\u0432\u043D\u0456 \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u043A\u0438.",filteredTitle:"\u0417\u0431\u0456\u0433\u0456\u0432 \u043D\u0435 \u0437\u043D\u0430\u0439\u0434\u0435\u043D\u043E",filteredMessage:"\u041E\u0431\u0435\u0440\u0456\u0442\u044C \u0456\u043D\u0448\u0438\u0439 \u0441\u0442\u0430\u043D \u0430\u0431\u043E \u043E\u0447\u0438\u0441\u0442\u044C\u0442\u0435 \u0444\u0456\u043B\u044C\u0442\u0440\u0438.",clear:"\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u0438 \u0444\u0456\u043B\u044C\u0442\u0440\u0438"},lifecycle:{current:"\u041F\u043E\u0442\u043E\u0447\u043D\u0430",new:"\u041D\u043E\u0432\u0430",ongoing:"\u0422\u0440\u0438\u0432\u0430\u0454",resolved:"\u0412\u0438\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0430",unchanged:"\u0411\u0435\u0437 \u0437\u043C\u0456\u043D"},notPresent:"\u0412\u0456\u0434\u0441\u0443\u0442\u043D\u0454",page:"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430",of:"\u0437",issue:"\u043F\u0440\u043E\u0431\u043B\u0435\u043C\u0430",issues:"\u043F\u0440\u043E\u0431\u043B\u0435\u043C",docs:"\u0434\u043E\u0432\u0456\u0434\u043A\u0430",footer:"\u0421\u0442\u0432\u043E\u0440\u0435\u043D\u043E \u043B\u043E\u043A\u0430\u043B\u044C\u043D\u043E. \u0414\u0430\u043D\u0456 \u0437\u0432\u0456\u0442\u0443 \u043D\u0456\u043A\u0443\u0434\u0438 \u043D\u0435 \u0437\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0443\u0432\u0430\u043B\u0438\u0441\u044F."}};var kA="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' rx='16' fill='%233157d5'/%3E%3Ccircle cx='27' cy='27' r='13' fill='none' stroke='white' stroke-width='6'/%3E%3Cpath d='m37 37 12 12' fill='none' stroke='white' stroke-linecap='round' stroke-width='6'/%3E%3Cpath d='m21 27 5 5 9-11' fill='none' stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='4'/%3E%3C/svg%3E";function re(e){return String(e??"").replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function vA(e){return JSON.stringify(e).replaceAll("<","\\u003c").replaceAll(">","\\u003e").replaceAll("&","\\u0026")}function PA(){return'<svg class="logo product-mark" viewBox="0 0 64 64" role="img" aria-label="SEO Crawl Audit logo"><rect width="64" height="64" rx="16" fill="var(--accent)"/><circle cx="27" cy="27" r="13" fill="none" stroke="#fff" stroke-width="6"/><path d="m37 37 12 12" fill="none" stroke="#fff" stroke-linecap="round" stroke-width="6"/><path d="m21 27 5 5 9-11" fill="none" stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="4"/></svg>'}function St(e,t="current"){let r=e.ruleId??e.rule??"unknown";return{fingerprint:e.fingerprint??"legacy",ruleId:r,rule:e.rule??e.ruleId??"unknown",severity:e.severity??"info",scope:e.scope??"page",url:e.url??"",message:e.message??"",evidence:e.evidence??{actual:e.after},owner:e.owner??"seo",remediation:e.remediation??"Review the finding and confirm the intended behavior.",documentationUrl:e.documentationUrl??"https://github.com/MelnixDev/seo-crawl-audit/blob/main/docs/rules.md",before:e.before,after:e.after,lifecycle:e.lifecycle??t,template:"",localized:fi(e,r)}}function Tn(e,t){return e.reduce((r,n)=>{let s=String(n[t]);return r[s]=(r[s]??0)+1,r},{})}function Ti(e,t={}){let r=e.mode??"scan",n=e.pages??[],s=(e.issues??[]).map(N=>St(N)),a=[...(e.newIssues??[]).map(N=>St(N,"new")),...(e.ongoingIssues??[]).map(N=>St(N,"ongoing")),...(e.resolvedIssues??[]).map(N=>St(N,"resolved")),...(e.unchangedIssues??[]).map(N=>St(N,"unchanged"))],c=a.length>0?a:s,l=En(c),o=new Map(l.flatMap(N=>N.urls.map(P=>[P,N.template])));for(let N of c)N.template=o.get(N.url)??"";let A=c.reduce((N,P)=>(N[P.severity]+=1,N),{error:0,warning:0,info:0}),u=new Set(c.map(N=>N.url)).size,m=Tn(c,"rule"),T={error:0,warning:1,info:2},f=new Map;for(let N of c.filter(P=>P.lifecycle!=="resolved")){let P=f.get(N.rule);P?(P.count+=1,P.urls.add(N.url),T[N.severity]<T[P.severity]&&(P.severity=N.severity)):f.set(N.rule,{rule:N.rule,severity:N.severity,owner:N.owner,count:1,urls:new Set([N.url])})}let y=[...f.values()].map(N=>({rule:N.rule,severity:N.severity,owner:N.owner,count:N.count,affectedPages:N.urls.size})).sort((N,P)=>T[N.severity]-T[P.severity]||P.affectedPages-N.affectedPages||P.count-N.count||N.rule.localeCompare(P.rule)).slice(0,5),w={total:c.length,pagesChecked:n.length,targetPages:e.targetPages??null,affectedPages:u,severity:A,rules:Object.entries(m).map(([N,P])=>({id:N,count:P})).sort((N,P)=>P.count-N.count||N.id.localeCompare(P.id)),owners:Tn(c,"owner"),lifecycle:Tn(c,"lifecycle"),templates:l.map(({template:N,issueCount:P,affectedPages:oa})=>({template:N,issueCount:P,affectedPages:oa})),priorities:y},b=e.partial??!1,_=r==="check"&&e.complete===!1,S=b?"Partial SEO scan report":r==="check"?"SEO regression report":"SEO baseline audit",R={...e.branding??{},...t.branding??{}},U=/^#[0-9a-f]{6}$/i.test(R.primaryColor??"")?R.primaryColor:"#3157d5",x=R.logo&&(/^data:image\//.test(R.logo)||/^https:\/\//.test(R.logo))?`<img class="logo" src="${re(R.logo)}" alt="${re(R.agencyName??"Report logo")}">`:PA(),k=vA({mode:r,issues:c,statistics:w,copy:Ei,partial:b,incompleteComparison:_,comparison:e.comparison??null,history:e.history??null,siteMetrics:e.siteMetrics??null}),Y=e.generatedAt??new Date().toISOString(),F=e.startUrl??"",v=e.targetPages??null,D=r==="check";return`<!doctype html>
|
|
4
|
+
${Or(n??null)}`).digest("hex").slice(0,24)}function L(e,t,r,n={},s){let a=ua.get(e);if(!a)throw new Error(`unknown rule: ${e}`);return{fingerprint:Pn(e,a.scope,t,s),ruleId:e,rule:e,severity:a.severity,scope:a.scope,url:t,message:r,evidence:n,owner:a.owner,remediation:a.remediation,documentationUrl:`${da}#${e}`,after:n.actual}}function ze(e,t){return new RegExp(`(^|[\\s,])${t}($|[\\s,])`,"i").test(e??"")}function Mn(e){if(e.toLowerCase()==="x-default")return!0;try{return new Intl.Locale(e),!0}catch{return!1}}function Dr(e,t){let r=new Map;for(let n of e){let s=t(n)?.trim().toLowerCase();if(!s)continue;let a=r.get(s)??[];a.push(n.url),r.set(s,a)}return new Map([...r].filter(([,n])=>n.length>1))}function Fn(e){let t=[],r=o=>{t.push(o)},n=new Map(e.pages.map(o=>[o.url,o])),s=new Set(e.sitemap?.urls??[]),a=Dr(e.pages,o=>o.title),c=Dr(e.pages,o=>o.description),l=Dr(e.pages,o=>o.contentHash);e.sitemap?.error&&r(L("sitemap-unavailable",e.sitemap.url,"The configured sitemap could not be loaded",{actual:e.sitemap.error}));for(let o of e.pages){if(o.blockedByRobots){r(L("robots-blocked",o.url,"Page is blocked by robots.txt",{actual:!0}));continue}if(o.error){r(L(o.error.includes("redirect loop")?"redirect-loop":"page-unreachable",o.url,`Page request failed: ${o.error}`,{actual:o.error,redirectChain:o.redirectChain}));continue}if((o.status===null||o.status>=400)&&r(L("http-error",o.url,`Page returned HTTP ${o.status??"unknown"}`,{actual:o.status})),ze(o.robots,"noindex")&&r(L("noindex",o.url,"Page contains a noindex meta directive",{actual:o.robots})),ze(o.xRobotsTag,"noindex")&&r(L("x-robots-noindex",o.url,"Page contains a noindex X-Robots-Tag",{actual:o.xRobotsTag})),!o.canonicalRaw&&!o.canonical&&r(L("missing-canonical",o.url,"Page does not declare a canonical URL",{actual:null})),o.canonicalRaw&&!o.canonical&&r(L("invalid-canonical",o.url,"Canonical URL is invalid",{actual:o.canonicalRaw})),o.canonical&&new URL(o.canonical).origin!==new URL(e.siteUrl).origin&&r(L("cross-domain-canonical",o.url,"Canonical points to another origin",{actual:o.canonical})),o.canonical){let h=n.get(o.canonical);h&&(h.error||(h.status??500)>=400)&&r(L("canonical-target-error",o.url,"Canonical target is unavailable",{target:o.canonical,actual:h.status??h.error},o.canonical))}o.redirectChain.length>3&&r(L("long-redirect-chain",o.url,`Page uses ${o.redirectChain.length} redirects`,{actual:o.redirectChain.length,redirectChain:o.redirectChain})),s.has(o.url)&&(ze(o.robots,"noindex")||ze(o.xRobotsTag,"noindex"))&&r(L("noindex-in-sitemap",o.url,"Sitemap URL is marked noindex",{actual:o.robots??o.xRobotsTag})),s.has(o.url)&&o.redirectChain.length>0&&r(L("redirect-in-sitemap",o.url,"Sitemap URL redirects",{actual:o.finalUrl,redirectChain:o.redirectChain})),o.title?(a.get(o.title.trim().toLowerCase())&&r(L("duplicate-title",o.url,"Title is shared by multiple pages",{actual:o.title,urls:a.get(o.title.trim().toLowerCase())},o.title.trim().toLowerCase())),(o.title.length<10||o.title.length>60)&&r(L("title-length",o.url,`Title length is ${o.title.length} characters`,{actual:o.title.length,value:o.title}))):r(L("missing-title",o.url,"Page does not have a title",{actual:null})),o.description?(c.get(o.description.trim().toLowerCase())&&r(L("duplicate-description",o.url,"Meta description is shared by multiple pages",{actual:o.description,urls:c.get(o.description.trim().toLowerCase())},o.description.trim().toLowerCase())),(o.description.length<50||o.description.length>160)&&r(L("description-length",o.url,`Description length is ${o.description.length} characters`,{actual:o.description.length,value:o.description}))):r(L("missing-description",o.url,"Page does not have a meta description",{actual:null})),o.h1Count===0?r(L("missing-h1",o.url,"Page does not contain an H1 heading",{actual:0})):o.h1Count>1&&r(L("multiple-h1",o.url,`Page contains ${o.h1Count} H1 headings`,{actual:o.h1Count}));for(let h of o.internalLinks){let m=n.get(h);m&&(m.error||(m.status??500)>=400)&&r(L("broken-internal-link",o.url,"Internal link points to an unavailable page",{target:h,actual:m.status??m.error},h))}s.has(o.url)&&o.url!==e.siteUrl&&e.linkGraph.orphanUrls.includes(o.url)&&r(L("orphan-sitemap-page",o.url,"Sitemap page has no discovered internal links",{actual:!0})),e.sitemap&&!s.has(o.url)&&!ze(o.robots,"noindex")&&(o.status??500)<400&&r(L("crawlable-not-in-sitemap",o.url,"Crawlable page is absent from the sitemap",{actual:!1}));for(let h of o.hreflang)(!Mn(h.lang)||!h.url)&&r(L("invalid-hreflang",o.url,"Hreflang declaration is invalid",{actual:h},h));for(let[h,m]of o.jsonLd.entries())m.valid||r(L("malformed-json-ld",o.url,"JSON-LD block contains invalid JSON",{actual:m.error,index:h},h));e.siteUrl.startsWith("https:")&&[o.url,o.canonical,...o.internalLinks].some(h=>h?.startsWith("http:"))&&r(L("http-on-https-site",o.url,"HTTPS site references an internal HTTP URL",{actual:[o.url,o.canonical,...o.internalLinks].filter(h=>h?.startsWith("http:"))})),o.lang&&!Mn(o.lang)&&r(L("invalid-language",o.url,"HTML language declaration is invalid",{actual:o.lang})),o.contentHash&&l.get(o.contentHash)&&r(L("duplicate-content",o.url,"Main text is an exact duplicate of another page",{urls:l.get(o.contentHash)},o.contentHash)),(!o.openGraph.title||!o.openGraph.description||!o.openGraph.image)&&r(L("missing-open-graph",o.url,"Open Graph metadata is incomplete",{actual:o.openGraph})),(!o.twitter.card||!o.twitter.title||!o.twitter.description||!o.twitter.image)&&r(L("missing-twitter-metadata",o.url,"Twitter card metadata is incomplete",{actual:o.twitter}));let d=o.images.filter(h=>h.alt===null).map(h=>h.src);d.length>0&&r(L("image-missing-alt",o.url,`${d.length} image(s) do not have an alt attribute`,{actual:d})),o.wordCount<200&&r(L("low-word-count",o.url,`Page contains approximately ${o.wordCount} visible words`,{actual:o.wordCount}))}return t}var Un={error:0,warning:1,info:2};function ha(e,t){let r=(()=>{try{return new URL(e).pathname}catch{return e}})(),n=t.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replaceAll("**","\0").replaceAll("*","[^/]*").replaceAll("\0",".*"),s=new RegExp(`^${n}$`);return s.test(r)||s.test(e)}function pa(e,t,r){return t.find(n=>n.rule!==e.ruleId||!ha(e.url,n.urlPattern)?!1:n.expiresAt?new Date(`${n.expiresAt}T23:59:59.999Z`).getTime()>=r.getTime():!0)??null}function Me(e){return e.sort((t,r)=>Un[t.severity]-Un[r.severity]||t.url.localeCompare(r.url)||t.ruleId.localeCompare(r.ruleId)||t.fingerprint.localeCompare(r.fingerprint))}function et(e,t,r={}){let n=r.enabledRules??t.config.enabledRules,s=n?new Set(n):null,a={...t.config.severityOverrides,...r.severityOverrides??{}},c=r.suppressions??t.config.suppressions,l=new Date(r.now??Date.now());return Me(e.filter(o=>!s||s.has(o.ruleId)).map(o=>({...o,severity:a[o.ruleId]??o.severity})).filter(o=>!pa(o,c,l)))}import{createHash as ga}from"node:crypto";var V="0.10.2",tt="1.1.0",ma="seo-crawl-audit",ye=`${ma}/${V}`;var fa={title:null,description:null,image:null},Ea={card:null,title:null,description:null,image:null};function Hn(e){if(!e||typeof e!="object"||Array.isArray(e))throw new Error("snapshot must be an object");return e}function Ta(e){if(!e||typeof e!="object"||typeof e.url!="string")throw new Error("snapshot page URL must be a string");return e}function Br(e){return Array.isArray(e)?`[${e.map(Br).join(",")}]`:e&&typeof e=="object"?`{${Object.entries(e).sort(([t],[r])=>t.localeCompare(r)).map(([t,r])=>`${JSON.stringify(t)}:${Br(r)}`).join(",")}}`:JSON.stringify(e)}function Ca(e){return ga("sha256").update(Br(e)).digest("hex")}function ba(e){return{url:e.url,finalUrl:e.finalUrl??null,status:e.status??null,contentType:e.contentType??null,blockedByRobots:e.blockedByRobots??!1,error:e.error??null,title:e.title??null,description:e.description??null,canonical:e.canonical??null,canonicalRaw:e.canonicalRaw??e.canonical??null,robots:e.robots??null,xRobotsTag:e.xRobotsTag??null,lang:e.lang??null,h1Count:e.h1Count??0,openGraph:e.openGraph??fa,twitter:e.twitter??Ea,hreflang:e.hreflang??[],jsonLd:e.jsonLd??[],images:e.images??[],links:[...e.links??[]].sort(),internalLinks:[...e.internalLinks??[]].sort(),externalLinks:[...e.externalLinks??[]].sort(),wordCount:e.wordCount??0,contentHash:e.contentHash??null,depth:e.depth??0,redirectChain:e.redirectChain??[],responseBytes:e.responseBytes??0}}function Ia(e){let t=e.source??{},r=e.options??{},n=e.pages?.[0],s=n&&typeof n=="object"?n.url:void 0,a=e.siteUrl??e.startUrl??t.startUrl??(typeof s=="string"?s:void 0);if(!a)throw new Error("snapshot site URL must be a string");return{schemaVersion:1,url:a,sitemap:r.sitemap??t.sitemap??"auto",maxPages:r.maxPages??t.maxPages??100,concurrency:r.concurrency??5,delay:r.requestDelay??t.requestDelay??100,timeout:r.timeout??1e4,respectRobots:r.respectRobots??t.respectRobots??!0,includeQuery:r.includeQuery??t.includeQuery??!1,maxRedirects:r.maxRedirects??10,maxResponseBytes:r.maxResponseBytes??5*1024*1024,enabledRules:r.enabledRules??null,severityOverrides:r.severityOverrides??{},suppressions:r.suppressions??[],regressionBudgets:r.regressionBudgets??{},report:r.report??{}}}function ya(e,t){let r=new Set(e.map(a=>a.url)),n=new Set(e.flatMap(a=>a.internalLinks)),s=new Set;for(let a of e)(a.error||a.blockedByRobots||(a.status??500)>=400)&&s.add(a.url);return{internalEdges:e.reduce((a,c)=>a+c.internalLinks.length,0),externalEdges:e.reduce((a,c)=>a+c.externalLinks.length,0),orphanUrls:t.filter(a=>r.has(a)&&!n.has(a)),brokenInternalUrls:[...s].sort()}}function wa(e,t){let r=t.filter(s=>s.blockedByRobots).length,n=t.filter(s=>s.error||(s.status??500)>=400).length;return{requested:e.requested??t.length,completed:t.length,succeeded:t.length-n-r,failed:n,blockedByRobots:r,redirected:t.filter(s=>s.redirectChain.length>0||s.url!==s.finalUrl).length,durationMs:e.durationMs??0,truncated:e.truncated??!1,partial:e.partial??!1}}function Ee(e){let t=Hn(e),r=Ia(t),n=(t.pages??[]).map(o=>ba(Ta(o))).sort((o,d)=>o.url.localeCompare(d.url)),s=t.sitemap?.urls??[];if(t.sitemap&&!t.sitemap.url)throw new Error("snapshot sitemap URL must be a string");let a=t.sitemap?{url:t.sitemap.url,urls:[...s].sort(),sitemapCount:t.sitemap.sitemapCount??0,truncated:t.sitemap.truncated??!1,error:t.sitemap.error??null}:null,c=t.startUrl??r.url,l=t.truncated??!1;return{schemaVersion:2,engineVersion:V,ruleSetVersion:tt,generatedAt:t.generatedAt??new Date().toISOString(),siteUrl:c,configurationHash:Ca(r),config:r,robots:{url:t.robots?.url??new URL("/robots.txt",c).href,status:t.robots?.status??null,sha256:t.robots?.sha256??null,error:t.robots?.error??null,denyAll:t.robots?.denyAll??!1},sitemap:a,pages:n,linkGraph:t.linkGraph??ya(n,s),statistics:t.statistics??wa(t,n),partial:t.partial??!1,source:{startUrl:c,maxPages:r.maxPages,requestDelay:r.delay,includeQuery:r.includeQuery,respectRobots:r.respectRobots,sitemap:typeof r.sitemap=="string"&&!["auto","none"].includes(r.sitemap)?r.sitemap:null},truncated:l}}function we(e){let t=Hn(e);if(!Array.isArray(t.pages))throw new Error("snapshot pages must be an array");if(t.schemaVersion===2)return Ee({...t,startUrl:t.siteUrl,options:t.config,pages:t.pages,generatedAt:t.generatedAt,partial:t.partial,statistics:t.statistics,linkGraph:t.linkGraph});if(t.schemaVersion===1)return Ee(t);throw new Error(`unsupported snapshot schema version: ${String(t.schemaVersion)}`)}function Ne(e){if(e.schemaVersion===2)return e;let t=e,r=t.pages?.[0],n=r&&typeof r=="object"?r.url:void 0,s=typeof n=="string"?n:t.source?.startUrl??"https://invalid.local/";return Ee({...t,startUrl:t.siteUrl??t.source?.startUrl??s,robots:t.robots??{url:new URL("/robots.txt",s).href,status:null,sha256:null,error:null},options:t.config??t.options??{}})}function Se(e,t={}){let r=Ne(e);return et(Fn(r),r,t)}function Qn(e,t){return new RegExp(`(^|[\\s,])${t}($|[\\s,])`,"i").test(e??"")}function q(e,t,r,n,s){let a=L(e,t,r,{before:n,after:s,actual:s});return a.before=n,a.after=s,a}function Yn(e,t){let r=!t.partial&&!t.truncated,n=[],s=new Map(t.pages.map(o=>[o.url,o]));e.robots.sha256&&t.robots.sha256&&e.robots.sha256!==t.robots.sha256&&n.push(q("robots-changed",t.robots.url,"robots.txt content changed",e.robots.sha256,t.robots.sha256));let a=e.sitemap?.urls.length??0,c=t.sitemap?.urls.length??0,l=a-c;r&&a>0&&l>=Math.max(5,Math.ceil(a*.2))&&n.push(q("sitemap-url-count-drop",t.sitemap?.url??e.sitemap?.url??t.siteUrl,`Sitemap URL count dropped by ${l}`,a,c));for(let o of e.pages){let d=s.get(o.url);if(!d){r&&n.push(q("page-missing",o.url,"Page was not checked",o.status,null));continue}if(d.blockedByRobots&&!o.blockedByRobots){n.push(q("robots-blocked",o.url,"Page is now blocked by robots.txt",!1,!0));continue}if(d.error&&!o.error){n.push(q(d.error.includes("redirect loop")?"redirect-loop":"page-unreachable",o.url,`Page request failed: ${d.error}`,o.error,d.error));continue}o.status!==null&&o.status<400&&(d.status===null||d.status>=400)&&n.push(q("status-regression",o.url,`HTTP status regressed from ${o.status} to ${d.status??"none"}`,o.status,d.status));let h=`${o.robots??""},${o.xRobotsTag??""}`,m=`${d.robots??""},${d.xRobotsTag??""}`;if(!Qn(h,"noindex")&&Qn(m,"noindex")&&n.push(q("new-noindex",o.url,"Page now contains a noindex directive",h,m)),o.title&&!d.title?n.push(q("title-removed",o.url,"Page title was removed",o.title,d.title)):o.title&&d.title&&o.title!==d.title&&n.push(q("title-changed",o.url,"Page title changed",o.title,d.title)),o.description&&!d.description&&n.push(q("description-removed",o.url,"Meta description was removed",o.description,d.description)),o.canonical&&!d.canonical)n.push(q("canonical-removed",o.url,"Canonical URL was removed",o.canonical,d.canonical));else if(o.canonical&&d.canonical&&o.canonical!==d.canonical){let E=q("canonical-changed",o.url,"Canonical URL changed",o.canonical,d.canonical);new URL(d.canonical).origin!==new URL(o.url).origin&&(E.severity="error"),n.push(E)}if(o.h1Count>0&&d.h1Count===0&&n.push(q("h1-removed",o.url,"All H1 headings were removed",o.h1Count,d.h1Count)),o.finalUrl&&d.finalUrl&&o.finalUrl!==d.finalUrl){let E=q("redirect-changed",o.url,"Final redirect URL changed",o.finalUrl,d.finalUrl);new URL(d.finalUrl).origin!==new URL(o.url).origin&&(E.severity="error"),n.push(E)}}return n}function Sa(e,t,r={}){let n=Ne(e),s=Ne(t);return et(Yn(n,s),s,r)}function rt(e,t){return{...e,lifecycle:t}}function kt(e,t,r={}){let n=Ne(e),s=Ne(t),a=!s.partial&&!s.truncated,c=new Set(s.pages.map(I=>I.url)),l=new Map(Se(n,r).map(I=>[I.fingerprint,I])),o=new Map(Se(s,r).map(I=>[I.fingerprint,I])),d=[],h=[],m=[],E=[];for(let[I,_]of o){let S=l.get(I);S?JSON.stringify(S.evidence)===JSON.stringify(_.evidence)?m.push(rt(_,"unchanged")):h.push(rt({..._,before:S.evidence,after:_.evidence},"ongoing")):d.push(rt(_,"new"))}for(let[I,_]of l)(_.scope==="page"?c.has(_.url):a)&&!o.has(I)&&E.push(rt(_,"resolved"));let f=new Set(d.map(I=>I.fingerprint));for(let I of Sa(n,s,r))f.has(I.fingerprint)||d.push(rt(I,"new"));let y={...n.config.regressionBudgets,...s.config.regressionBudgets},w=Object.entries(y).flatMap(([I,_])=>{let S=d.filter(R=>R.severity===I||R.ruleId===I).length;return S>_?[{budget:I,allowed:_,actual:S}]:[]});return Me(d),Me(h),Me(m),Me(E),{complete:a,newIssues:d,ongoingIssues:h,resolvedIssues:E,unchangedIssues:m,issues:[...d,...h],budgetExceeded:w}}var kr="seo-audit.config.json",Gn=Object.freeze({schemaVersion:1,url:"",sitemap:"auto",maxPages:100,concurrency:5,delay:100,timeout:1e4,respectRobots:!0,includeQuery:!1,maxRedirects:10,maxResponseBytes:5242880,enabledRules:null,severityOverrides:{},suppressions:[],regressionBudgets:{},report:{}});function nt(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new Error(`${t} must be an object`);return e}function _e(e,t,r,n=Number.MAX_SAFE_INTEGER){if(!Number.isInteger(e)||e<r||e>n)throw new Error(`${t} must be an integer between ${r} and ${n}`);return e}function st(e,t){if(e!==void 0){if(typeof e!="string")throw new Error(`${t} must be a string`);return e}}function vr(e){let t=nt(e,"config"),r=new Set(["$schema","schemaVersion","url","sitemap","maxPages","concurrency","delay","timeout","respectRobots","includeQuery","maxRedirects","maxResponseBytes","enabledRules","severityOverrides","suppressions","regressionBudgets","report"]);for(let s of Object.keys(t))if(!r.has(s))throw new Error(`unknown config property: ${s}`);let n={};if(t.schemaVersion!==void 0&&t.schemaVersion!==1)throw new Error("schemaVersion must be 1");if(t.url!==void 0){let s=st(t.url,"url");if(!/^https?:\/\//i.test(s))throw new Error("url must be an HTTP(S) URL");n.url=s}if(t.sitemap!==void 0){let s=st(t.sitemap,"sitemap");if(!["auto","none"].includes(s)&&!/^https?:\/\//i.test(s))throw new Error("sitemap must be auto, none, or an HTTP(S) URL");n.sitemap=s}t.maxPages!==void 0&&(n.maxPages=_e(t.maxPages,"maxPages",1)),t.concurrency!==void 0&&(n.concurrency=_e(t.concurrency,"concurrency",1,50)),t.delay!==void 0&&(n.delay=_e(t.delay,"delay",0)),t.timeout!==void 0&&(n.timeout=_e(t.timeout,"timeout",1)),t.maxRedirects!==void 0&&(n.maxRedirects=_e(t.maxRedirects,"maxRedirects",0,50)),t.maxResponseBytes!==void 0&&(n.maxResponseBytes=_e(t.maxResponseBytes,"maxResponseBytes",1024));for(let s of["respectRobots","includeQuery"])if(t[s]!==void 0){if(typeof t[s]!="boolean")throw new Error(`${s} must be a boolean`);n[s]=t[s]}if(t.enabledRules!==void 0){if(t.enabledRules!==null&&(!Array.isArray(t.enabledRules)||t.enabledRules.some(s=>typeof s!="string")))throw new Error("enabledRules must be null or an array of rule IDs");n.enabledRules=t.enabledRules}if(t.severityOverrides!==void 0){let s=nt(t.severityOverrides,"severityOverrides");for(let[a,c]of Object.entries(s))if(!["error","warning","info"].includes(c))throw new Error(`severityOverrides.${a} must be error, warning, or info`);n.severityOverrides=s}if(t.suppressions!==void 0){if(!Array.isArray(t.suppressions))throw new Error("suppressions must be an array");n.suppressions=t.suppressions.map((s,a)=>{let c=nt(s,`suppressions[${a}]`);for(let l of["rule","urlPattern","reason"])if(typeof c[l]!="string"||c[l]==="")throw new Error(`suppressions[${a}].${l} must be a non-empty string`);if(c.expiresAt!==void 0&&!/^\d{4}-\d{2}-\d{2}$/.test(String(c.expiresAt)))throw new Error(`suppressions[${a}].expiresAt must use YYYY-MM-DD`);return c})}if(t.regressionBudgets!==void 0){let s=nt(t.regressionBudgets,"regressionBudgets");n.regressionBudgets=Object.fromEntries(Object.entries(s).map(([a,c])=>[a,_e(c,`regressionBudgets.${a}`,0)]))}if(t.report!==void 0){let s=nt(t.report,"report"),a={},c=st(s.agencyName,"report.agencyName"),l=st(s.logo,"report.logo"),o=st(s.primaryColor,"report.primaryColor");if(c!==void 0&&(a.agencyName=c),l!==void 0&&(a.logo=l),o!==void 0&&(a.primaryColor=o),a.primaryColor&&!/^#[0-9a-f]{6}$/i.test(a.primaryColor))throw new Error("report.primaryColor must be a six-digit hex color");n.report=Object.fromEntries(Object.entries(a).filter(([,d])=>d!==void 0))}return n}function ge(e,t={},r={}){return{...{...Gn,...r,...t,...e},schemaVersion:1,severityOverrides:{...r.severityOverrides??{},...t.severityOverrides??{},...e.severityOverrides??{}},regressionBudgets:{...r.regressionBudgets??{},...t.regressionBudgets??{},...e.regressionBudgets??{}},report:{...r.report??{},...t.report??{},...e.report??{}},suppressions:e.suppressions??t.suppressions??r.suppressions??[]}}function vt(){}var Pt=Object.freeze({debug:vt,info:vt,warn:vt,error:vt});import{setTimeout as _a}from"node:timers/promises";function xa(e=0,{now:t=Date.now,wait:r=_a}={}){let n=Math.max(0,e),s=0,a=Promise.resolve();return function(){if(n===0)return Promise.resolve();let l=a.then(async()=>{let o=Math.max(0,s-t());o>0&&await r(o),s=t()+n});return a=l.catch(()=>{}),l}}function Fe(e=0,t=xa){let r=new Map;return n=>{let s=new URL(n).origin,a=r.get(s);return a||(a=t(e),r.set(s,a)),a()}}import{createHash as va}from"node:crypto";import{setTimeout as Kn}from"node:timers/promises";var pe=class extends Error{redirectChain;constructor(t,r=[],n){super(t,n),this.name="RequestFailure",this.redirectChain=r}};function Ra(e){return e===429||e===500||e===502||e===503||e===504}function La(e,t=Date.now()){if(!e)return null;let r=Number(e);if(Number.isFinite(r)&&r>=0)return Math.min(r*1e3,3e4);let n=Date.parse(e);return Number.isNaN(n)?null:Math.min(Math.max(0,n-t),3e4)}function Oa(e,t){let r=AbortSignal.timeout(e);return t?AbortSignal.any([t,r]):r}async function Da(e,t,r){let n=[],s=new Set([e]),a=e;for(;;){r.signal?.throwIfAborted(),await r.gate?.(a);let c=await r.fetch(a,{...t,redirect:"manual",signal:Oa(r.timeout,r.signal)}),l=c.headers.get("location");if(c.status<300||c.status>=400||!l)return{response:c,redirectChain:n};let o=new URL(l,a).href;if(n.push({url:a,status:c.status,location:o}),await c.body?.cancel(),s.has(o))throw new pe(`redirect loop detected at ${o}`,n);if(n.length>r.maxRedirects)throw new pe(`redirect limit of ${r.maxRedirects} exceeded`,n);s.add(o),a=o}}async function xe(e,t,r){let n;for(let s=0;s<=r.retries;s+=1)try{let a=await Da(e,t,r);if(!Ra(a.response.status)||s===r.retries)return a;let c=La(a.response.headers.get("retry-after"));await a.response.body?.cancel();let l=Math.floor((r.random??Math.random)()*100),o=c??Math.min(250*2**s+l,3e4);await r.onEvent?.({type:"retry",url:e,attempt:s+1,delayMs:o}),await Kn(o,void 0,{signal:r.signal})}catch(a){if(r.signal?.aborted)throw r.signal.reason??a;if(n=a,a instanceof pe||s===r.retries)break;let c=Math.floor((r.random??Math.random)()*100),l=Math.min(250*2**s+c,3e4);await r.onEvent?.({type:"retry",url:e,attempt:s+1,delayMs:l}),await Kn(l,void 0,{signal:r.signal})}throw n instanceof pe?n:new pe(n instanceof Error?n.message:String(n),[],{cause:n})}async function Re(e,t){if(!e.body)return{text:"",bytes:0,buffer:Buffer.alloc(0)};let r=e.body.getReader(),n=[],s=0;for(;;){let{done:c,value:l}=await r.read();if(c)break;if(s+=l.byteLength,s>t)throw await r.cancel(),new pe(`response exceeds ${t} bytes`);n.push(Buffer.from(l))}let a=Buffer.concat(n);return{text:a.toString("utf8"),bytes:s,buffer:a}}function Ba(e,t){if(!t)return!1;let r=t.endsWith("$"),s=(r?t.slice(0,-1):t).replace(/[.+?^${}()|[\]\\]/g,"\\$&").replaceAll("*",".*");return new RegExp(`^${s}${r?"$":""}`).test(e)}function ka(e,t){let r=[],n=null;for(let l of e.replace(/^\uFEFF/,"").split(/\r?\n/)){let o=l.replace(/#.*$/,"").trim(),d=o.indexOf(":");if(!o||d<0)continue;let h=o.slice(0,d).trim().toLowerCase(),m=o.slice(d+1).trim();if(h==="user-agent"){(!n||n.hasRules)&&(n={agents:[],rules:[],hasRules:!1},r.push(n)),m&&n.agents.push(m.toLowerCase());continue}n&&(h==="allow"||h==="disallow")&&m&&(n.rules.push({type:h,path:m}),n.hasRules=!0)}let s=t.toLowerCase(),a=r.filter(l=>l.agents.some(o=>o!=="*"&&s.includes(o)));return(a.length>0?a:r.filter(l=>l.agents.includes("*"))).flatMap(l=>l.rules)}function Wn(e,t){if(t.denyAll)return!1;let r=new URL(e),n=`${r.pathname}${r.search}`,s=(t.rules??[]).filter(a=>Ba(n,a.path)).sort((a,c)=>c.path.length-a.path.length||(a.type==="allow"?-1:1));return s.length===0||s[0]?.type==="allow"}async function Mt(e,t){let r=new URL("/robots.txt",e).href;try{let{response:n}=await xe(r,{headers:{accept:"text/plain,*/*;q=0.1","user-agent":t.userAgent}},{fetch:t.fetch,timeout:t.timeout,maxRedirects:t.maxRedirects,retries:t.retries,signal:t.signal,gate:t.requestGate,onEvent:t.onEvent}),{text:s}=await Re(n,Pa);return{url:r,status:n.status,body:s,sha256:va("sha256").update(s).digest("hex"),rules:n.ok?ka(s,t.userAgent):[],denyAll:n.status===401||n.status===403,error:null}}catch(n){if(t.signal?.aborted)throw n;return{url:r,status:null,body:"",sha256:null,rules:[],denyAll:!1,error:n instanceof Error?n.message:String(n)}}}var Pa=512*1024;import{gunzipSync as ec}from"node:zlib";var Jn=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",Ma=Jn+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",Fa="["+Jn+"]["+Ma+"]*",Ua=new RegExp("^"+Fa+"$");function Ft(e,t){let r=[],n=t.exec(e);for(;n;){let s=[];s.startIndex=t.lastIndex-n[0].length;let a=n.length;for(let c=0;c<a;c++)s.push(n[c]);r.push(s),n=t.exec(e)}return r}var Pr=function(e){let t=Ua.exec(e);return!(t===null||typeof t>"u")};function jn(e){return typeof e<"u"}var it=["hasOwnProperty","toString","valueOf","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"],Ut=["__proto__","constructor","prototype"];var Ha={allowBooleanAttributes:!1,unpairedTags:[]};function Ht(e,t){t=Object.assign({},Ha,t);let r=[],n=!1,s=!1;e[0]==="\uFEFF"&&(e=e.substr(1));for(let a=0;a<e.length;a++)if(e[a]==="<"&&e[a+1]==="?"){if(a+=2,a=Xn(e,a),a.err)return a}else if(e[a]==="<"){let c=a;if(a++,e[a]==="!"){a=Zn(e,a);continue}else{let l=!1;e[a]==="/"&&(l=!0,a++);let o="";for(;a<e.length&&e[a]!==">"&&e[a]!==" "&&e[a]!==" "&&e[a]!==`
|
|
5
|
+
`&&e[a]!=="\r";a++)o+=e[a];if(o=o.trim(),o[o.length-1]==="/"&&(o=o.substring(0,o.length-1),a--),!Va(o)){let m;return o.trim().length===0?m="Invalid space after '<'.":m="Tag '"+o+"' is an invalid name.",H("InvalidTag",m,X(e,a))}let d=Ga(e,a);if(d===!1)return H("InvalidAttr","Attributes for '"+o+"' have open quote.",X(e,a));let h=d.value;if(a=d.index,h[h.length-1]==="/"){let m=a-h.length;h=h.substring(0,h.length-1);let E=$n(h,t);if(E===!0)n=!0;else return H(E.err.code,E.err.msg,X(e,m+E.err.line))}else if(l)if(d.tagClosed){if(h.trim().length>0)return H("InvalidTag","Closing tag '"+o+"' can't have attributes or invalid starting.",X(e,c));if(r.length===0)return H("InvalidTag","Closing tag '"+o+"' has not been opened.",X(e,c));{let m=r.pop();if(o!==m.tagName){let E=X(e,m.tagStartPos);return H("InvalidTag","Expected closing tag '"+m.tagName+"' (opened in line "+E.line+", col "+E.col+") instead of closing tag '"+o+"'.",X(e,c))}r.length==0&&(s=!0)}}else return H("InvalidTag","Closing tag '"+o+"' doesn't have proper closing.",X(e,a));else{let m=$n(h,t);if(m!==!0)return H(m.err.code,m.err.msg,X(e,a-h.length+m.err.line));if(s===!0)return H("InvalidXml","Multiple possible root nodes found.",X(e,a));t.unpairedTags.indexOf(o)!==-1||r.push({tagName:o,tagStartPos:c}),n=!0}for(a++;a<e.length;a++)if(e[a]==="<")if(e[a+1]==="!"){a++,a=Zn(e,a);continue}else if(e[a+1]==="?"){if(a=Xn(e,++a),a.err)return a}else break;else if(e[a]==="&"){let m=Ja(e,a);if(m==-1)return H("InvalidChar","char '&' is not expected.",X(e,a));a=m}else if(s===!0&&!Vn(e[a]))return H("InvalidXml","Extra text at the end",X(e,a));e[a]==="<"&&a--}}else{if(Vn(e[a]))continue;return H("InvalidChar","char '"+e[a]+"' is not expected.",X(e,a))}if(n){if(r.length==1)return H("InvalidTag","Unclosed tag '"+r[0].tagName+"'.",X(e,r[0].tagStartPos));if(r.length>0)return H("InvalidXml","Invalid '"+JSON.stringify(r.map(a=>a.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return H("InvalidXml","Start tag expected.",1);return!0}function Vn(e){return e===" "||e===" "||e===`
|
|
6
|
+
`||e==="\r"}function Xn(e,t){let r=t;for(;t<e.length;t++)if(e[t]=="?"||e[t]==" "){let n=e.substr(r,t-r);if(t>5&&n==="xml")return H("InvalidXml","XML declaration allowed only at the start of the document.",X(e,t));if(e[t]=="?"&&e[t+1]==">"){t++;break}else continue}return t}function Zn(e,t){if(e.length>t+5&&e[t+1]==="-"&&e[t+2]==="-"){for(t+=3;t<e.length;t++)if(e[t]==="-"&&e[t+1]==="-"&&e[t+2]===">"){t+=2;break}}else if(e.length>t+8&&e[t+1]==="D"&&e[t+2]==="O"&&e[t+3]==="C"&&e[t+4]==="T"&&e[t+5]==="Y"&&e[t+6]==="P"&&e[t+7]==="E"){let r=1;for(t+=8;t<e.length;t++)if(e[t]==="<")r++;else if(e[t]===">"&&(r--,r===0))break}else if(e.length>t+9&&e[t+1]==="["&&e[t+2]==="C"&&e[t+3]==="D"&&e[t+4]==="A"&&e[t+5]==="T"&&e[t+6]==="A"&&e[t+7]==="["){for(t+=8;t<e.length;t++)if(e[t]==="]"&&e[t+1]==="]"&&e[t+2]===">"){t+=2;break}}return t}var Qa='"',Ya="'";function Ga(e,t){let r="",n="",s=!1;for(;t<e.length;t++){if(e[t]===Qa||e[t]===Ya)n===""?n=e[t]:n!==e[t]||(n="");else if(e[t]===">"&&n===""){s=!0;break}r+=e[t]}return n!==""?!1:{value:r,index:t,tagClosed:s}}var Ka=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function $n(e,t){let r=Ft(e,Ka),n={};for(let s=0;s<r.length;s++){if(r[s][1].length===0)return H("InvalidAttr","Attribute '"+r[s][2]+"' has no space in starting.",at(r[s]));if(r[s][3]!==void 0&&r[s][4]===void 0)return H("InvalidAttr","Attribute '"+r[s][2]+"' is without value.",at(r[s]));if(r[s][3]===void 0&&!t.allowBooleanAttributes)return H("InvalidAttr","boolean attribute '"+r[s][2]+"' is not allowed.",at(r[s]));let a=r[s][2];if(!ja(a))return H("InvalidAttr","Attribute '"+a+"' is an invalid name.",at(r[s]));if(!Object.prototype.hasOwnProperty.call(n,a))n[a]=1;else return H("InvalidAttr","Attribute '"+a+"' is repeated.",at(r[s]))}return!0}function Wa(e,t){let r=/\d/;for(e[t]==="x"&&(t++,r=/[\da-fA-F]/);t<e.length;t++){if(e[t]===";")return t;if(!e[t].match(r))break}return-1}function Ja(e,t){if(t++,e[t]===";")return-1;if(e[t]==="#")return t++,Wa(e,t);let r=0;for(;t<e.length;t++,r++)if(!(e[t].match(/\w/)&&r<20)){if(e[t]===";")break;return-1}return t}function H(e,t,r){return{err:{code:e,msg:t,line:r.line||r,col:r.col}}}function ja(e){return Pr(e)}function Va(e){return Pr(e)}function X(e,t){let r=e.substring(0,t).split(/\r?\n/);return{line:r.length,col:r[r.length-1].length+1}}function at(e){return e.startIndex+e[1].length}var Mr={cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",euro:"\u20AC",dollar:"$",fnof:"\u0192",inr:"\u20B9",af:"\u060B",birr:"\u1265\u122D",peso:"\u20B1",rub:"\u20BD",won:"\u20A9",yuan:"\xA5",cedil:"\xB8"};var ot={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'},Fr={nbsp:"\xA0",copy:"\xA9",reg:"\xAE",trade:"\u2122",mdash:"\u2014",ndash:"\u2013",hellip:"\u2026",laquo:"\xAB",raquo:"\xBB",lsquo:"\u2018",rsquo:"\u2019",ldquo:"\u201C",rdquo:"\u201D",bull:"\u2022",para:"\xB6",sect:"\xA7",deg:"\xB0",frac12:"\xBD",frac14:"\xBC",frac34:"\xBE"};var Ue=Object.freeze({ALLOW:"allow",BLOCK:"block",THROW:"throw"}),Xa=new Set("!?\\\\/[]$%{}^&*()<>|+");function qn(e){if(e[0]==="#")throw new Error(`[EntityReplacer] Invalid character '#' in entity name: "${e}"`);for(let t of e)if(Xa.has(t))throw new Error(`[EntityReplacer] Invalid character '${t}' in entity name: "${e}"`);return e}function ct(...e){let t=Object.create(null);for(let r of e)if(r)for(let n of Object.keys(r)){let s=r[n];if(typeof s=="string")t[n]=s;else if(s&&typeof s=="object"&&s.val!==void 0){let a=s.val;typeof a=="string"&&(t[n]=a)}}return t}var Le="external",Qt="base",Ur="all";function Za(e){return!e||e===Le?new Set([Le]):e===Ur?new Set([Ur]):e===Qt?new Set([Qt]):Array.isArray(e)?new Set(e):new Set([Le])}var z=Object.freeze({allow:0,leave:1,remove:2,throw:3}),$a=new Set([9,10,13]);function qa(e){if(!e)return{xmlVersion:1,onLevel:z.allow,nullLevel:z.remove};let t=e.xmlVersion===1.1?1.1:1,r=z[e.onNCR]??z.allow,n=z[e.nullNCR]??z.remove,s=Math.max(n,z.remove);return{xmlVersion:t,onLevel:r,nullLevel:s}}var He=class{constructor(t={}){this._limit=t.limit||{},this._maxTotalExpansions=this._limit.maxTotalExpansions||0,this._maxExpandedLength=this._limit.maxExpandedLength||0,this._postCheck=typeof t.postCheck=="function"?t.postCheck:n=>n,this._limitTiers=Za(this._limit.applyLimitsTo??Le),this._numericAllowed=t.numericAllowed??!0,this._baseMap=ct(ot,t.namedEntities||null),this._externalMap=Object.create(null),this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this._removeSet=new Set(t.remove&&Array.isArray(t.remove)?t.remove:[]),this._leaveSet=new Set(t.leave&&Array.isArray(t.leave)?t.leave:[]);let r=qa(t.ncr);this._ncrXmlVersion=r.xmlVersion,this._ncrOnLevel=r.onLevel,this._ncrNullLevel=r.nullLevel,this._onExternalEntity=typeof t.onExternalEntity=="function"?t.onExternalEntity:null,this._onInputEntity=typeof t.onInputEntity=="function"?t.onInputEntity:null}_applyRegistrationHook(t,r,n,s){if(!t)return!0;let a=t(r,n);if(a===Ue.BLOCK)return!1;if(a===Ue.THROW)throw new Error(`[EntityDecoder] Registration of ${s} entity "&${r};" was rejected by hook`);return!0}setExternalEntities(t){if(t)for(let s of Object.keys(t))qn(s);if(!this._onExternalEntity){this._externalMap=ct(t);return}let r=ct(t),n=Object.create(null);for(let[s,a]of Object.entries(r))this._applyRegistrationHook(this._onExternalEntity,s,a,"external")&&(n[s]=a);this._externalMap=n}addExternalEntity(t,r){qn(t),typeof r=="string"&&r.indexOf("&")===-1&&this._applyRegistrationHook(this._onExternalEntity,t,r,"external")&&(this._externalMap[t]=r)}addInputEntities(t){if(this._totalExpansions=0,this._expandedLength=0,!this._onInputEntity){this._inputMap=ct(t);return}let r=ct(t),n=Object.create(null);for(let[s,a]of Object.entries(r))this._applyRegistrationHook(this._onInputEntity,s,a,"input")&&(n[s]=a);this._inputMap=n}reset(){return this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this}setXmlVersion(t){this._ncrXmlVersion=t===1.1?1.1:1}decode(t){if(typeof t!="string"||t.length===0||t.indexOf("&")===-1)return t;let r=t,n=[],s=t.length,a=0,c=0,l=this._maxTotalExpansions>0,o=this._maxExpandedLength>0,d=l||o;for(;c<s;){if(t.charCodeAt(c)!==38){c++;continue}let m=c+1;for(;m<s&&t.charCodeAt(m)!==59&&m-c<=32;)m++;if(m>=s||t.charCodeAt(m)!==59){c++;continue}let E=t.slice(c+1,m);if(E.length===0){c++;continue}let f,y;if(this._removeSet.has(E))f="",y===void 0&&(y=Le);else if(this._leaveSet.has(E)){c++;continue}else if(E.charCodeAt(0)===35){let w=this._resolveNCR(E);if(w===void 0){c++;continue}f=w,y=Qt}else{let w=this._resolveName(E);f=w?.value,y=w?.tier}if(f===void 0){c++;continue}if(c>a&&n.push(t.slice(a,c)),n.push(f),a=m+1,c=a,d&&this._tierCounts(y)){if(l&&(this._totalExpansions++,this._totalExpansions>this._maxTotalExpansions))throw new Error(`[EntityReplacer] Entity expansion count limit exceeded: ${this._totalExpansions} > ${this._maxTotalExpansions}`);if(o){let w=f.length-(E.length+2);if(w>0&&(this._expandedLength+=w,this._expandedLength>this._maxExpandedLength))throw new Error(`[EntityReplacer] Expanded content length limit exceeded: ${this._expandedLength} > ${this._maxExpandedLength}`)}}}a<s&&n.push(t.slice(a));let h=n.length===0?t:n.join("");return this._postCheck(h,r)}_tierCounts(t){return this._limitTiers.has(Ur)?!0:this._limitTiers.has(t)}_resolveName(t){if(t in this._inputMap)return{value:this._inputMap[t],tier:Le};if(t in this._externalMap)return{value:this._externalMap[t],tier:Le};if(t in this._baseMap)return{value:this._baseMap[t],tier:Qt}}_classifyNCR(t){return t===0?this._ncrNullLevel:t>=55296&&t<=57343||this._ncrXmlVersion===1&&t>=1&&t<=31&&!$a.has(t)?z.remove:-1}_applyNCRAction(t,r,n){switch(t){case z.allow:return String.fromCodePoint(n);case z.remove:return"";case z.leave:return;case z.throw:throw new Error(`[EntityDecoder] Prohibited numeric character reference &${r}; (U+${n.toString(16).toUpperCase().padStart(4,"0")})`);default:return String.fromCodePoint(n)}}_resolveNCR(t){let r=t.charCodeAt(1),n;if(r===120||r===88?n=parseInt(t.slice(2),16):n=parseInt(t.slice(1),10),Number.isNaN(n)||n<0||n>1114111)return;let s=this._classifyNCR(n);if(!this._numericAllowed&&s<z.remove)return;let a=s===-1?this._ncrOnLevel:Math.max(this._ncrOnLevel,s);return this._applyNCRAction(a,t,n)}};var zn=e=>it.includes(e)?"__"+e:e,za={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0,unicode:!1},tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,entityDecoder:null,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,r){return e},captureMetaData:!1,maxNestedTags:100,strictReservedNames:!0,jPath:!0,onDangerousProperty:zn};function eo(e,t){if(typeof e!="string")return;let r=e.toLowerCase();if(it.some(n=>r===n.toLowerCase()))throw new Error(`[SECURITY] Invalid ${t}: "${e}" is a reserved JavaScript keyword that could cause prototype pollution`);if(Ut.some(n=>r===n.toLowerCase()))throw new Error(`[SECURITY] Invalid ${t}: "${e}" is a reserved JavaScript keyword that could cause prototype pollution`)}function es(e,t){return typeof e=="boolean"?{enabled:e,maxEntitySize:1e4,maxExpansionDepth:1e4,maxTotalExpansions:1/0,maxExpandedLength:1e5,maxEntityCount:1e3,allowedTags:null,tagFilter:null,appliesTo:"all"}:typeof e=="object"&&e!==null?{enabled:e.enabled!==!1,maxEntitySize:Math.max(1,e.maxEntitySize??1e4),maxExpansionDepth:Math.max(1,e.maxExpansionDepth??1e4),maxTotalExpansions:Math.max(1,e.maxTotalExpansions??1/0),maxExpandedLength:Math.max(1,e.maxExpandedLength??1e5),maxEntityCount:Math.max(1,e.maxEntityCount??1e3),allowedTags:e.allowedTags??null,tagFilter:e.tagFilter??null,appliesTo:e.appliesTo??"all"}:es(!0)}var ts=function(e){let t=Object.assign({},za,e),r=[{value:t.attributeNamePrefix,name:"attributeNamePrefix"},{value:t.attributesGroupName,name:"attributesGroupName"},{value:t.textNodeName,name:"textNodeName"},{value:t.cdataPropName,name:"cdataPropName"},{value:t.commentPropName,name:"commentPropName"}];for(let{value:n,name:s}of r)n&&eo(n,s);return t.onDangerousProperty===null&&(t.onDangerousProperty=zn),t.processEntities=es(t.processEntities,t.htmlEntities),t.unpairedTagsSet=new Set(t.unpairedTags),t.stopNodes&&Array.isArray(t.stopNodes)&&(t.stopNodes=t.stopNodes.map(n=>typeof n=="string"&&n.startsWith("*.")?".."+n.substring(2):n)),t};var Yt;typeof Symbol!="function"?Yt="@@xmlMetadata":Yt=Symbol("XML Node Metadata");var ee=class{constructor(t){this.tagname=t,this.child=[],this[":@"]=Object.create(null)}add(t,r){t==="__proto__"&&(t="#__proto__"),this.child.push({[t]:r})}addChild(t,r){t.tagname==="__proto__"&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child}),r!==void 0&&(this.child[this.child.length-1][Yt]={startIndex:r})}static getMetaDataSymbol(){return Yt}};var rs=":A-Za-z_\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u0486\u0488-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD",to=rs+"\\-\\.\\d\xB7\u0300-\u036F\u203F-\u2040",ns=":A-Za-z_\xC0-\u02FF\u0370-\u037D\u037F-\u0486\u0488-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}",ro=ns+"\\-\\.\\d\xB7\u0300-\u036F\u0487\u203F-\u2040",Hr=(e,t,r="")=>{let n=e.replace(":",""),s=t.replace(":",""),a=`[${n}][${s}]*`;return{name:new RegExp(`^[${e}][${t}]*$`,r),ncName:new RegExp(`^${a}$`,r),qName:new RegExp(`^${a}(?::${a})?$`,r),nmToken:new RegExp(`^[${t}]+$`,r),nmTokens:new RegExp(`^[${t}]+(?:\\s+[${t}]+)*$`,r)}},no=Hr(rs,to),so=Hr(ns,ro,"u"),ss=":A-Za-z_",io=ss+"\\-\\.\\d",ao=Hr(ss,io),oo=(e="1.0",t=!1)=>t?ao:e==="1.1"?so:no;var Qr=(e,{xmlVersion:t="1.0",asciiOnly:r=!1}={})=>oo(t,r).qName.test(e);var dt=class{constructor(t,r){this.suppressValidationErr=!t,this.options=t,this.xmlVersion=r||1}setXmlVersion(t=1){this.xmlVersion=t}readDocType(t,r){let n=Object.create(null),s=0;if(t[r+3]==="O"&&t[r+4]==="C"&&t[r+5]==="T"&&t[r+6]==="Y"&&t[r+7]==="P"&&t[r+8]==="E"){r=r+9;let a=1,c=!1,l=!1,o="";for(;r<t.length;r++)if(t[r]==="<"&&!l){if(c&&Oe(t,"!ENTITY",r)){r+=7;let d,h;if([d,h,r]=this.readEntityExp(t,r+1,this.suppressValidationErr),h.indexOf("&")===-1){if(this.options.enabled!==!1&&this.options.maxEntityCount!=null&&s>=this.options.maxEntityCount)throw new Error(`Entity count (${s+1}) exceeds maximum allowed (${this.options.maxEntityCount})`);n[d]=h,s++}}else if(c&&Oe(t,"!ELEMENT",r)){r+=8;let{index:d}=this.readElementExp(t,r+1);r=d}else if(c&&Oe(t,"!ATTLIST",r))r+=8;else if(c&&Oe(t,"!NOTATION",r)){r+=9;let{index:d}=this.readNotationExp(t,r+1,this.suppressValidationErr);r=d}else if(Oe(t,"!--",r))l=!0;else throw new Error("Invalid DOCTYPE");a++,o=""}else if(t[r]===">"){if(l?t[r-1]==="-"&&t[r-2]==="-"&&(l=!1,a--):a--,a===0)break}else t[r]==="["?c=!0:o+=t[r];if(a!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:n,i:r}}readEntityExp(t,r){r=te(t,r);let n=r;for(;r<t.length&&!/\s/.test(t[r])&&t[r]!=='"'&&t[r]!=="'";)r++;let s=t.substring(n,r);if(lt(s,{xmlVersion:this.xmlVersion}),r=te(t,r),!this.suppressValidationErr){if(t.substring(r,r+6).toUpperCase()==="SYSTEM")throw new Error("External entities are not supported");if(t[r]==="%")throw new Error("Parameter entities are not supported")}let a="";if([r,a]=this.readIdentifierVal(t,r,"entity"),this.options.enabled!==!1&&this.options.maxEntitySize!=null&&a.length>this.options.maxEntitySize)throw new Error(`Entity "${s}" size (${a.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`);return r--,[s,a,r]}readNotationExp(t,r){r=te(t,r);let n=r;for(;r<t.length&&!/\s/.test(t[r]);)r++;let s=t.substring(n,r);!this.suppressValidationErr&<(s,{xmlVersion:this.xmlVersion}),r=te(t,r);let a=t.substring(r,r+6).toUpperCase();if(!this.suppressValidationErr&&a!=="SYSTEM"&&a!=="PUBLIC")throw new Error(`Expected SYSTEM or PUBLIC, found "${a}"`);r+=a.length,r=te(t,r);let c=null,l=null;if(a==="PUBLIC")[r,c]=this.readIdentifierVal(t,r,"publicIdentifier"),r=te(t,r),(t[r]==='"'||t[r]==="'")&&([r,l]=this.readIdentifierVal(t,r,"systemIdentifier"));else if(a==="SYSTEM"&&([r,l]=this.readIdentifierVal(t,r,"systemIdentifier"),!this.suppressValidationErr&&!l))throw new Error("Missing mandatory system identifier for SYSTEM notation");return{notationName:s,publicIdentifier:c,systemIdentifier:l,index:--r}}readIdentifierVal(t,r,n){let s="",a=t[r];if(a!=='"'&&a!=="'")throw new Error(`Expected quoted string, found "${a}"`);r++;let c=r;for(;r<t.length&&t[r]!==a;)r++;if(s=t.substring(c,r),t[r]!==a)throw new Error(`Unterminated ${n} value`);return r++,[r,s]}readElementExp(t,r){r=te(t,r);let n=r;for(;r<t.length&&!/\s/.test(t[r]);)r++;let s=t.substring(n,r);if(!this.suppressValidationErr&&!Qr(s,{xmlVersion:this.xmlVersion}))throw new Error(`Invalid element name: "${s}"`);r=te(t,r);let a="";if(t[r]==="E"&&Oe(t,"MPTY",r))r+=4;else if(t[r]==="A"&&Oe(t,"NY",r))r+=2;else if(t[r]==="("){r++;let c=r;for(;r<t.length&&t[r]!==")";)r++;if(a=t.substring(c,r),t[r]!==")")throw new Error("Unterminated content model")}else if(!this.suppressValidationErr)throw new Error(`Invalid Element Expression, found "${t[r]}"`);return{elementName:s,contentModel:a.trim(),index:r}}readAttlistExp(t,r){r=te(t,r);let n=r;for(;r<t.length&&!/\s/.test(t[r]);)r++;let s=t.substring(n,r);for(lt(s,{xmlVersion:this.xmlVersion}),r=te(t,r),n=r;r<t.length&&!/\s/.test(t[r]);)r++;let a=t.substring(n,r);if(!lt(a,{xmlVersion:this.xmlVersion}))throw new Error(`Invalid attribute name: "${a}"`);r=te(t,r);let c="";if(t.substring(r,r+8).toUpperCase()==="NOTATION"){if(c="NOTATION",r+=8,r=te(t,r),t[r]!=="(")throw new Error(`Expected '(', found "${t[r]}"`);r++;let o=[];for(;r<t.length&&t[r]!==")";){let d=r;for(;r<t.length&&t[r]!=="|"&&t[r]!==")";)r++;let h=t.substring(d,r);if(h=h.trim(),!lt(h,{xmlVersion:this.xmlVersion}))throw new Error(`Invalid notation name: "${h}"`);o.push(h),t[r]==="|"&&(r++,r=te(t,r))}if(t[r]!==")")throw new Error("Unterminated list of notations");r++,c+=" ("+o.join("|")+")"}else{let o=r;for(;r<t.length&&!/\s/.test(t[r]);)r++;c+=t.substring(o,r);let d=["CDATA","ID","IDREF","IDREFS","ENTITY","ENTITIES","NMTOKEN","NMTOKENS"];if(!this.suppressValidationErr&&!d.includes(c.toUpperCase()))throw new Error(`Invalid attribute type: "${c}"`)}r=te(t,r);let l="";return t.substring(r,r+8).toUpperCase()==="#REQUIRED"?(l="#REQUIRED",r+=8):t.substring(r,r+7).toUpperCase()==="#IMPLIED"?(l="#IMPLIED",r+=7):[r,l]=this.readIdentifierVal(t,r,"ATTLIST"),{elementName:s,attributeName:a,attributeType:c,defaultValue:l,index:r}}},te=(e,t)=>{for(;t<e.length&&/\s/.test(e[t]);)t++;return t};function Oe(e,t,r){for(let n=0;n<t.length;n++)if(t[n]!==e[r+n+1])return!1;return!0}function lt(e,t){if(Qr(e,{xmlVersion:t}))return e;throw new Error(`Invalid entity name ${e}`)}var co=[48,1632,1776,2406,2534,2662,2790,2918,3046,3174,3302,3430,3558,3664,3792,3872,4160,4240,6112,6160,6470,6608,6784,6800,6992,7088,7232,7248,65296,120782,120792,120802,120812,120822,66720,68912,69734,69872,69942,70096,70384,70736,70864,71248,71360,71472,71904,72016,72688,72784,73040,73120,73552,92768,92864,93008,123200,123632,124144,125264,130032],Gt=255,Kt=new Map,is=65535,as=1632,Qe=as,lo=is-as+1,Wt=new Uint8Array(lo).fill(Gt);for(let e of co)for(let t=0;t<10;t++){let r=e+t;r<=is?Wt[r-Qe]=t:Kt.set(r,t)}var os=48,cs=57,ls=45,Jt=new Set([8722,65293,65123]);function Ao(e){if(typeof e!="string")return e;let t=e.length;if(t===0)return e;let r=-1;for(let s=0;s<t;s++){let a=e.charCodeAt(s);if(!(a>=os&&a<=cs||a===ls)){if(a<Qe){if(Jt.has(a)){r=s;break}continue}if(a>=55296&&a<=56319){if(s+1<t){let c=e.charCodeAt(s+1);if(c>=56320&&c<=57343){let l=65536+(a-55296<<10)+(c-56320);if(Kt.has(l)){r=s;break}}}continue}if(Wt[a-Qe]!==Gt||Jt.has(a)){r=s;break}}}if(r===-1)return e;let n=[];r>0&&n.push(e.slice(0,r));for(let s=r;s<t;s++){let a=e.charCodeAt(s);if(a>=os&&a<=cs||a===ls){n.push(e[s]);continue}if(a<Qe){n.push(Jt.has(a)?"-":e[s]);continue}if(a>=55296&&a<=56319){if(s+1<t){let l=e.charCodeAt(s+1);if(l>=56320&&l<=57343){let o=65536+(a-55296<<10)+(l-56320),d=Kt.get(o);if(d!==void 0){n.push(String.fromCharCode(d+48)),s++;continue}}}n.push(e[s]);continue}if(Jt.has(a)){n.push("-");continue}let c=Wt[a-Qe];n.push(c!==Gt?String.fromCharCode(c+48):e[s])}return n.join("")}var ds=Ao;var uo=/^[-+]?0x[a-fA-F0-9]+$/,ho=/^0b[01]+$/,po=/^0o[0-7]+$/,mo=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,go={hex:!0,binary:!1,octal:!1,leadingZeros:!0,decimalPoint:".",eNotation:!0,infinity:"original",unicode:!1};function Gr(e,t={}){if(t=Object.assign({},go,t),!e||typeof e!="string")return e;let r=e.trim();if(r.length===0)return e;if(t.skipLike!==void 0&&t.skipLike.test(r))return e;if(r==="0"||t.unicode&&(r=ds(r),r==="0"))return 0;if(t.hex&&uo.test(r))return Yr(r,16);if(t.binary&&ho.test(r))return Yr(r,2);if(t.octal&&po.test(r))return Yr(r,8);if(isFinite(r)){if(r.includes("e")||r.includes("E"))return Eo(e,r,t);{let n=mo.exec(r);if(n){let s=n[1]||"",a=n[2],c=To(n[3]),l=s?e[a.length+1]===".":e[a.length]===".";if(!t.leadingZeros&&(a.length>1||a.length===1&&!l))return e;{let o=Number(r),d=String(o);if(o===0)return o;if(d.search(/[eE]/)!==-1)return t.eNotation?o:e;if(r.indexOf(".")!==-1)return d==="0"||d===c||d===`${s}${c}`?o:e;let h=a?c:r;return a?h===d||s+h===d?o:e:h===d||h===s+d?o:e}}else return e}}else return Co(e,Number(r),t)}var fo=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function Eo(e,t,r){if(!r.eNotation)return e;let n=t.match(fo);if(n){let s=n[1]||"",a=n[3].indexOf("e")===-1?"E":"e",c=n[2],l=s?e[c.length+1]===a:e[c.length]===a;return c.length>1&&l?e:c.length===1&&(n[3].startsWith(`.${a}`)||n[3][0]===a)?Number(t):c.length>0?r.leadingZeros&&!l?(t=(n[1]||"")+n[3],Number(t)):e:Number(t)}else return e}function To(e){return e&&e.indexOf(".")!==-1&&(e=e.replace(/0+$/,""),e==="."?e="0":e[0]==="."?e="0"+e:e[e.length-1]==="."&&(e=e.substring(0,e.length-1))),e}function Yr(e,t){let r=e.trim();if((t===2||t===8)&&(e=r.substring(2)),parseInt)return parseInt(e,t);if(Number.parseInt)return Number.parseInt(e,t);if(window&&window.parseInt)return window.parseInt(e,t);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}function Co(e,t,r){let n=t===1/0;switch(r.infinity.toLowerCase()){case"null":return null;case"infinity":return t;case"string":return n?"Infinity":"-Infinity";case"original":default:return e}}function Kr(e){return typeof e=="function"?e:Array.isArray(e)?t=>{for(let r of e)if(typeof r=="string"&&t===r||r instanceof RegExp&&r.test(t))return!0}:()=>!1}var De=class{constructor(t,r={},n){this.pattern=t,this.separator=r.separator||".",this.segments=this._parse(t),this.data=n,this._hasDeepWildcard=this.segments.some(s=>s.type==="deep-wildcard"),this._hasAttributeCondition=this.segments.some(s=>s.attrName!==void 0),this._hasPositionSelector=this.segments.some(s=>s.position!==void 0)}_parse(t){let r=[],n=0,s="";for(;n<t.length;)t[n]===this.separator?n+1<t.length&&t[n+1]===this.separator?(s.trim()&&(r.push(this._parseSegment(s.trim())),s=""),r.push({type:"deep-wildcard"}),n+=2):(s.trim()&&r.push(this._parseSegment(s.trim())),s="",n++):(s+=t[n],n++);return s.trim()&&r.push(this._parseSegment(s.trim())),r}_parseSegment(t){let r={type:"tag"},n=null,s=t,a=t.match(/^([^\[]+)(\[[^\]]*\])(.*)$/);if(a&&(s=a[1]+a[3],a[2])){let h=a[2].slice(1,-1);h&&(n=h)}let c,l=s;if(s.includes("::")){let h=s.indexOf("::");if(c=s.substring(0,h).trim(),l=s.substring(h+2).trim(),!c)throw new Error(`Invalid namespace in pattern: ${t}`)}let o,d=null;if(l.includes(":")){let h=l.lastIndexOf(":"),m=l.substring(0,h).trim(),E=l.substring(h+1).trim();["first","last","odd","even"].includes(E)||/^nth\(\d+\)$/.test(E)?(o=m,d=E):o=l}else o=l;if(!o)throw new Error(`Invalid segment pattern: ${t}`);if(r.tag=o,c&&(r.namespace=c),n)if(n.includes("=")){let h=n.indexOf("=");r.attrName=n.substring(0,h).trim(),r.attrValue=n.substring(h+1).trim()}else r.attrName=n.trim();if(d){let h=d.match(/^nth\((\d+)\)$/);h?(r.position="nth",r.positionValue=parseInt(h[1],10)):r.position=d}return r}get length(){return this.segments.length}hasDeepWildcard(){return this._hasDeepWildcard}hasAttributeCondition(){return this._hasAttributeCondition}hasPositionSelector(){return this._hasPositionSelector}toString(){return this.pattern}};var Ye=class{constructor(){this._byDepthAndTag=new Map,this._wildcardByDepth=new Map,this._deepWildcards=[],this._deepByTerminalTag=new Map,this._patterns=new Set,this._sealed=!1}add(t){if(this._sealed)throw new TypeError("ExpressionSet is sealed. Create a new ExpressionSet to add more expressions.");if(this._patterns.has(t.pattern))return this;if(this._patterns.add(t.pattern),t.hasDeepWildcard()){let a=t.segments[t.segments.length-1];if(a&&a.type!=="deep-wildcard"&&a.tag!=="*"){let c=a.tag;this._deepByTerminalTag.has(c)||this._deepByTerminalTag.set(c,[]),this._deepByTerminalTag.get(c).push(t)}else this._deepWildcards.push(t);return this}let r=t.length,s=t.segments[t.segments.length-1]?.tag;if(!s||s==="*")this._wildcardByDepth.has(r)||this._wildcardByDepth.set(r,[]),this._wildcardByDepth.get(r).push(t);else{let a=`${r}:${s}`;this._byDepthAndTag.has(a)||this._byDepthAndTag.set(a,[]),this._byDepthAndTag.get(a).push(t)}return this}addAll(t){for(let r of t)this.add(r);return this}has(t){return this._patterns.has(t.pattern)}get size(){return this._patterns.size}seal(){return this._sealed=!0,this}get isSealed(){return this._sealed}matchesAny(t){return this.findMatch(t)!==null}findMatch(t){let r=t.getDepth(),n=t.getCurrentTag(),s=`${r}:${n}`,a=this._byDepthAndTag.get(s);if(a){for(let o=0;o<a.length;o++)if(t.matches(a[o]))return a[o]}let c=this._wildcardByDepth.get(r);if(c){for(let o=0;o<c.length;o++)if(t.matches(c[o]))return c[o]}let l=this._deepByTerminalTag.get(n);if(l){for(let o=0;o<l.length;o++)if(t.matches(l[o]))return l[o]}for(let o=0;o<this._deepWildcards.length;o++)if(t.matches(this._deepWildcards[o]))return this._deepWildcards[o];return null}};var Wr=class{constructor(t){this._matcher=t}get separator(){return this._matcher.separator}getCurrentTag(){let t=this._matcher.path;return t.length>0?t[t.length-1].tag:void 0}getCurrentNamespace(){let t=this._matcher.path;return t.length>0?t[t.length-1].namespace:void 0}getAttrValue(t){let r=this._matcher.path;if(r.length!==0)return r[r.length-1].values?.[t]}hasAttr(t){let r=this._matcher.path;if(r.length===0)return!1;let n=r[r.length-1];return n.values!==void 0&&t in n.values}getAnyParentAttr(t){return this._matcher.getAnyParentAttr(t)}hasAnyParentAttr(t){return this._matcher.hasAnyParentAttr(t)}getPosition(){let t=this._matcher.path;return t.length===0?-1:t[t.length-1].position??0}getCounter(){let t=this._matcher.path;return t.length===0?-1:t[t.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this._matcher.path.length}toString(t,r=!0){return this._matcher.toString(t,r)}toArray(){return this._matcher.path.map(t=>t.tag)}matches(t){return this._matcher.matches(t)}matchesAny(t){return t.matchesAny(this._matcher)}},Ge=class{constructor(t={}){this.separator=t.separator||".",this.path=[],this.siblingStacks=[],this._pathStringCache=null,this._view=new Wr(this),this._keptAttrs=[]}push(t,r=null,n=null,s=null){this._pathStringCache=null,this.path.length>0&&(this.path[this.path.length-1].values=void 0);let a=this.path.length,c=this.siblingStacks[a];c||(c={counts:new Map,total:0},this.siblingStacks[a]=c);let l=n?`${n}:${t}`:t,o=c.counts.get(l)||0,d=c.total;c.counts.set(l,o+1),c.total++;let h={tag:t,position:d,counter:o};n!=null&&(h.namespace=n),r!=null&&(h.values=r),this.path.push(h);let m=this.path.length,E=s!==null?s.keep:null;if(E!=null&&E.length>0&&r)for(let f=0;f<E.length;f++){let y=E[f];r[y]!==void 0&&this._keptAttrs.push({depth:m,name:y,value:r[y]})}}pop(){if(this.path.length===0)return;this._pathStringCache=null;let t=this.path.pop();this.siblingStacks.length>this.path.length+1&&(this.siblingStacks.length=this.path.length+1);let r=this.path.length+1;for(;this._keptAttrs.length>0&&this._keptAttrs[this._keptAttrs.length-1].depth>=r;)this._keptAttrs.pop();return t}updateCurrent(t){if(this.path.length>0){let r=this.path[this.path.length-1];t!=null&&(r.values=t)}}getCurrentTag(){return this.path.length>0?this.path[this.path.length-1].tag:void 0}getCurrentNamespace(){return this.path.length>0?this.path[this.path.length-1].namespace:void 0}getAttrValue(t){if(this.path.length!==0)return this.path[this.path.length-1].values?.[t]}hasAttr(t){if(this.path.length===0)return!1;let r=this.path[this.path.length-1];return r.values!==void 0&&t in r.values}getAnyParentAttr(t){let r=this._keptAttrs;for(let n=r.length-1;n>=0;n--)if(r[n].name===t)return r[n].value}hasAnyParentAttr(t){let r=this._keptAttrs;for(let n=r.length-1;n>=0;n--)if(r[n].name===t)return!0;return!1}getPosition(){return this.path.length===0?-1:this.path[this.path.length-1].position??0}getCounter(){return this.path.length===0?-1:this.path[this.path.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this.path.length}toString(t,r=!0){let n=t||this.separator;if(n===this.separator&&r===!0){if(this._pathStringCache!==null)return this._pathStringCache;let a=this.path.map(c=>c.namespace?`${c.namespace}:${c.tag}`:c.tag).join(n);return this._pathStringCache=a,a}return this.path.map(a=>r&&a.namespace?`${a.namespace}:${a.tag}`:a.tag).join(n)}toArray(){return this.path.map(t=>t.tag)}reset(){this._pathStringCache=null,this.path=[],this.siblingStacks=[],this._keptAttrs=[]}matches(t){let r=t.segments;return r.length===0?!1:t.hasDeepWildcard()?this._matchWithDeepWildcard(r):this._matchSimple(r)}_matchSimple(t){if(this.path.length!==t.length)return!1;for(let r=0;r<t.length;r++)if(!this._matchSegment(t[r],this.path[r],r===this.path.length-1))return!1;return!0}_matchWithDeepWildcard(t){let r=this.path.length-1,n=t.length-1;for(;n>=0&&r>=0;){let s=t[n];if(s.type==="deep-wildcard"){if(n--,n<0)return!0;let a=t[n],c=!1;for(let l=r;l>=0;l--)if(this._matchSegment(a,this.path[l],l===this.path.length-1)){r=l-1,n--,c=!0;break}if(!c)return!1}else{if(!this._matchSegment(s,this.path[r],r===this.path.length-1))return!1;r--,n--}}return n<0}_matchSegment(t,r,n){if(t.tag!=="*"&&t.tag!==r.tag||t.namespace!==void 0&&t.namespace!=="*"&&t.namespace!==r.namespace||t.attrName!==void 0&&(!n||!r.values||!(t.attrName in r.values)||t.attrValue!==void 0&&String(r.values[t.attrName])!==String(t.attrValue)))return!1;if(t.position!==void 0){if(!n)return!1;let s=r.counter??0;if(t.position==="first"&&s!==0)return!1;if(t.position==="odd"&&s%2!==1)return!1;if(t.position==="even"&&s%2!==0)return!1;if(t.position==="nth"&&s!==t.positionValue)return!1}return!0}matchesAny(t){return t.matchesAny(this)}snapshot(){return{path:this.path.map(t=>({...t})),siblingStacks:this.siblingStacks.map(t=>t&&{counts:new Map(t.counts),total:t.total}),keptAttrs:this._keptAttrs.map(t=>({...t}))}}restore(t){this._pathStringCache=null,this.path=t.path.map(r=>({...r})),this.siblingStacks=t.siblingStacks.map(r=>r&&{counts:new Map(r.counts),total:r.total}),this._keptAttrs=(t.keptAttrs||[]).map(r=>({...r}))}readOnly(){return this._view}};var bo=[{id:"html-script-open",description:"<script opening tag",pattern:/<script[\s>/]/i},{id:"html-script-close",description:"</script closing tag",pattern:/<\/script[\s>]/i},{id:"html-javascript-protocol",description:"javascript: URI scheme (with optional whitespace/encoding)",pattern:/j[\t\n\r ]*a[\t\n\r ]*v[\t\n\r ]*a[\t\n\r ]*s[\t\n\r ]*c[\t\n\r ]*r[\t\n\r ]*i[\t\n\r ]*p[\t\n\r ]*t[\t\n\r ]*:/i},{id:"html-vbscript-protocol",description:"vbscript: URI scheme",pattern:/vbscript[\t\n\r ]*:/i},{id:"html-data-html",description:"data:text/html URI \u2014 can execute scripts in browsers",pattern:/data[\t\n\r ]*:[\t\n\r ]*text\/html/i},{id:"html-data-xhtml",description:"data:application/xhtml+xml URI",pattern:/data[\t\n\r ]*:[\t\n\r ]*application\/xhtml/i},{id:"html-data-svg",description:"data:image/svg+xml URI \u2014 can execute scripts",pattern:/data[\t\n\r ]*:[\t\n\r ]*image\/svg\+xml/i},{id:"html-inline-event-handler",description:"Inline event handler attributes: onclick=, onerror=, onload=, etc.",pattern:/\bon\w{1,30}\s*=/i},{id:"html-entity-obfuscated-script",description:"HTML-entity-encoded <script (e.g. <script or <script)",pattern:/(?:�*3[Cc];?|�*60;?|<)\s*script/i},{id:"html-entity-obfuscated-javascript",description:'HTML-entity-encoded javascript: (partial \u2014 catches common j or j for "j")',pattern:/(?:�*6[Aa];?|�*106;?)\s*(?:�*61;?|a)[\s\S]{0,80}script\s*:/i},{id:"html-style-expression",description:"CSS expression() \u2014 IE-era code execution in style attributes",pattern:/style[\s\S]{0,20}expression\s*\(/i},{id:"html-object-embed",description:"<object or <embed tags that can load active content",pattern:/<(?:object|embed)[\s>/]/i},{id:"html-base-tag",description:"<base href= \u2014 can hijack all relative URLs on a page",pattern:/<base[\s>]/i},{id:"html-meta-refresh",description:'<meta http-equiv="refresh" \u2014 can redirect users',pattern:/<meta[\s\S]{0,40}http-equiv[\s\S]{0,20}refresh/i},{id:"html-srcdoc",description:"srcdoc= attribute on iframes \u2014 embeds HTML that can run scripts",pattern:/srcdoc\s*=/i},{id:"html-iframe",description:"<iframe tag",pattern:/<iframe[\s>/]/i},{id:"html-form",description:"<form tag \u2014 can be used for phishing / credential harvesting injection",pattern:/<form[\s>/]/i}],Ke=bo;var Io=[{id:"xml-cdata-injection",description:"CDATA section injection: <![CDATA[ breaks out of text node context",pattern:/<!\[CDATA\[/i},{id:"xml-cdata-close",description:"CDATA close sequence: ]]> can terminate an enclosing CDATA section",pattern:/\]\]>/},{id:"xml-processing-instruction",description:"XML processing instruction: <?xml-stylesheet or <?php etc.",pattern:/<\?(?:xml[\- ]|php|asp)/i},{id:"xml-doctype-injection",description:"DOCTYPE declaration embedded in content \u2014 can define entities",pattern:/<!DOCTYPE(?:[\s[]|$)/i},{id:"xml-entity-system",description:"SYSTEM keyword \u2014 used in external entity declarations (XXE)",pattern:/\bSYSTEM\s+["']/i},{id:"xml-entity-public",description:"PUBLIC keyword \u2014 used in external entity declarations (XXE)",pattern:/\bPUBLIC\s+["']/i},{id:"xml-entity-declaration",description:"<!ENTITY declaration \u2014 defines entities, potential XXE or entity expansion",pattern:/<!ENTITY[\s%]/i},{id:"xml-billion-laughs",description:"Entity reference chaining / billion laughs: repeated &eX; style references",pattern:/(?:&\w{1,20};){3,}/},{id:"xml-namespace-confusion",description:"xmlns: attribute injection \u2014 can redefine namespaces to confuse parsers",pattern:/\bxmlns\s*(?::\w{1,40})?\s*=/i},{id:"xml-comment-injection",description:"<!-- comment injection \u2014 can hide content from some parsers",pattern:/<!--/},{id:"xml-comment-close",description:"--> closes an enclosing XML comment",pattern:/-->/},{id:"xml-pi-close",description:"?> closes an enclosing processing instruction",pattern:/\?>/}],We=Io;var yo=[{id:"svg-script-element",description:"<script element inside SVG executes JavaScript",pattern:/<script[\s>/]/i},{id:"svg-xlink-href-javascript",description:"xlink:href with javascript: \u2014 classic SVG XSS via <a> or <use>",pattern:/xlink\s*:\s*href\s*=\s*["']?\s*javascript\s*:/i},{id:"svg-href-javascript",description:"href= with javascript: in SVG context (<a>, <animate>, etc.)",pattern:/href\s*=\s*["']?\s*javascript\s*:/i},{id:"svg-foreignobject",description:"<foreignObject embeds HTML inside SVG \u2014 can execute scripts",pattern:/<foreignObject[\s>/]/i},{id:"svg-use-external",description:"<use xlink:href or href pointing to external resource (non-fragment URL)",pattern:/<use[\s\S]{0,60}(?:xlink\s*:\s*)?href\s*=\s*(?:["'][^#]|[^"'#\s>])/i},{id:"svg-animate-href",description:'<animate attributeName="href" \u2014 can dynamically change href to javascript:',pattern:/<animate[\s\S]{0,80}attributeName\s*=\s*["'][\s]*href["']/i},{id:"svg-animate-xlinkhref",description:'<animate attributeName="xlink:href"',pattern:/<animate[\s\S]{0,80}attributeName\s*=\s*["'][\s]*xlink\s*:\s*href["']/i},{id:"svg-set-javascript",description:'<set to="javascript:..." \u2014 sets an attribute to a javascript: URI',pattern:/<set[\s\S]{0,80}to\s*=\s*["']?\s*javascript\s*:/i},{id:"svg-event-handler",description:"SVG-specific event handler attributes: onload=, onerror=, onactivate=, etc.",pattern:/\bon(?:load|error|activate|begin|end|repeat|focus|blur|click|mouse\w{1,20}|key\w{1,20})\s*=/i},{id:"svg-handler-generic",description:"Generic on* handler catch-all for SVG attributes",pattern:/\bon\w{1,30}\s*=/i},{id:"svg-filter-feimage",description:"<feImage href= \u2014 filter primitive that can load external resources",pattern:/<feImage[\s\S]{0,80}(?:xlink\s*:\s*)?href\s*=/i},{id:"svg-image-external",description:"<image xlink:href with http/https or javascript protocol",pattern:/<image[\s\S]{0,80}(?:xlink\s*:\s*)?href\s*=\s*["']?\s*(?:https?|javascript)\s*:/i},{id:"svg-style-javascript",description:"style= attribute containing javascript: (e.g. background:url(javascript:...))",pattern:/style\s*=[\s\S]{0,60}javascript\s*:/i}],Jr=yo;var wo=[{id:"sql-block-comment-open",description:"SQL block comment open: /* ... */ \u2014 unusual in legitimate user text",pattern:/\/\*/},{id:"sql-union-select",description:"UNION SELECT \u2014 most common SQL injection aggregation attack",pattern:/\bUNION\s{1,20}(?:ALL\s{1,20})?SELECT\b/i},{id:"sql-drop-table",description:"DROP TABLE \u2014 destructive DDL injection",pattern:/\bDROP\s{1,20}TABLE\b/i},{id:"sql-drop-database",description:"DROP DATABASE \u2014 destructive DDL injection",pattern:/\bDROP\s{1,20}DATABASE\b/i},{id:"sql-insert-into",description:"INSERT INTO \u2014 data injection",pattern:/\bINSERT\s{1,20}INTO\b/i},{id:"sql-delete-from",description:"DELETE FROM \u2014 data deletion injection",pattern:/\bDELETE\s{1,20}FROM\b/i},{id:"sql-update-set",description:"UPDATE ... SET \u2014 data modification injection",pattern:/\bUPDATE\b[\s\S]{1,60}\bSET\b/i},{id:"sql-exec-xp",description:"EXEC xp_ \u2014 MSSQL extended stored procedure execution",pattern:/\bEXEC(?:UTE)?\s{1,20}xp_/i},{id:"sql-tautology-string",description:`Classic string tautology: ' OR '1'='1 or " OR "1"="1"`,pattern:/'\s{0,10}OR\s{0,10}'[^']{0,20}'\s*=\s*'[^']{0,20}/i},{id:"sql-tautology-numeric",description:"Numeric tautology: OR 1=1",pattern:/\bOR\s{1,10}1\s*=\s*1\b/i},{id:"sql-always-true-zero",description:"Numeric tautology: OR 0=0",pattern:/\bOR\s{1,10}0\s*=\s*0\b/i},{id:"sql-sleep-benchmark",description:"Time-based blind injection: SLEEP() or BENCHMARK()",pattern:/\b(?:SLEEP|BENCHMARK)\s*\(/i},{id:"sql-waitfor-delay",description:"MSSQL time-based blind injection: WAITFOR DELAY",pattern:/\bWAITFOR\s{1,20}DELAY\b/i},{id:"sql-char-function",description:"CHAR() function \u2014 used to obfuscate injected strings",pattern:/\bCHAR\s*\(\s*\d{1,3}/i},{id:"sql-information-schema",description:"INFORMATION_SCHEMA \u2014 reconnaissance query for table/column enumeration",pattern:/\bINFORMATION_SCHEMA\b/i}],At=wo;var No=[{id:"shell-path-traversal-unix",description:"Unix path traversal: ../ \u2014 climbing the directory tree",pattern:/\.\.\//},{id:"shell-path-traversal-windows",description:"Windows path traversal: ..\\ \u2014 climbing the directory tree",pattern:/\.\.\\/},{id:"shell-path-traversal-encoded",description:"URL-encoded path traversal: %2e%2e or %2f variants",pattern:/%2e%2e|%2f\.\.|\.\.%2f/i},{id:"shell-null-byte",description:"Null byte injection: \\x00 or %00 \u2014 truncates strings in C-backed functions",pattern:/\x00|%00/},{id:"shell-semicolon",description:"Semicolon command separator: cmd1; cmd2",pattern:/;/},{id:"shell-pipe",description:"Pipe operator: cmd1 | cmd2",pattern:/\|/},{id:"shell-and-operator",description:"AND operator: cmd1 && cmd2",pattern:/&&/},{id:"shell-or-operator",description:"OR operator: cmd1 || cmd2",pattern:/\|\|/},{id:"shell-backtick",description:"Backtick command substitution: `cmd`",pattern:/`/},{id:"shell-dollar-paren",description:"Dollar-paren command substitution: $(cmd)",pattern:/\$\(/},{id:"shell-dollar-brace",description:"Dollar-brace variable expansion: ${var} \u2014 can be abused for injection",pattern:/\$\{/},{id:"shell-redirect-out",description:"Output redirection: cmd > file or cmd >> file",pattern:/>{1,2}/},{id:"shell-redirect-in",description:"Input redirection: cmd < file",pattern:/</},{id:"shell-newline-injection",description:"Newline injection: \\n or \\r \u2014 can inject new shell commands",pattern:/[\n\r]/},{id:"shell-glob-star",description:"Glob expansion: * or ? \u2014 can expand to unintended files",pattern:/[/\\][*?]/},{id:"shell-absolute-root",description:"Absolute root path injection: string starting with / or \\ (Windows UNC)",pattern:/^(?:\/|\\\\)/},{id:"shell-windows-drive",description:"Windows drive letter path injection: C:\\ or D:/",pattern:/^[a-zA-Z]:[/\\]/},{id:"shell-curl-wget",description:"curl/wget with URL or flags \u2014 can exfiltrate data or download payloads",pattern:/\b(?:curl|wget)\s+(?:https?:\/\/|ftp:\/\/|-)/i}],jr=No;var So=[{id:"redos-nested-quantifier-plus",description:"Nested + quantifier inside a group with outer quantifier: (a+)+, (.+b)*, etc.",pattern:/\([^)]*\+[^)]*\)[+*]/},{id:"redos-nested-quantifier-star",description:"Nested * quantifier: (a*)* or (a*)+ \u2014 catastrophic backtracking",pattern:/\([^)]*\*[^)]*\)[*+]/},{id:"redos-nested-groups",description:"Doubly nested quantified groups: ((a+)+) \u2014 guaranteed catastrophic",pattern:/\(\([^)]{0,40}\)[+*]\)[+*]/},{id:"redos-alternation-overlap",description:"Overlapping alternation under quantifier: (a|a)+ \u2014 ambiguous NFA paths",pattern:/\(([^|()]{1,20})\|(?:\1)(?:\|[^|()]{1,20}){0,5}\)[+*?]{1,2}/},{id:"redos-star-plus-concat",description:"(x*x)+ pattern \u2014 triggers super-linear backtracking",pattern:/\([^)]{0,10}\*[^)]{0,10}\)[+*]/},{id:"redos-dot-star-greedy",description:"(.*){n,} or (.+){n,} \u2014 repeated greedy dot quantifiers",pattern:/\(\.[*+]\)\{?\d/},{id:"redos-large-repetition",description:"Very large fixed or range repetition count {1000,} or {1000,n} \u2014 denial of service via backtracking",pattern:/\{\d{4,}(?:,\d*)?\}/},{id:"redos-catastrophic-alternation",description:"Long alternation with many similar branches \u2014 polynomial backtracking risk",pattern:/\([^)]{0,200}(?:\|[^|)]{0,50}){9,}\)/}],Vr=So;var ne=`["'\\s]*:`,_o=[{id:"nosql-where-operator",description:"$where \u2014 executes arbitrary JavaScript server-side in MongoDB",pattern:new RegExp(`\\$where${ne}`,"i")},{id:"nosql-ne-operator",description:'$ne \u2014 "not equal" operator used to bypass equality checks',pattern:new RegExp(`\\$ne${ne}`,"i")},{id:"nosql-gt-operator",description:'$gt \u2014 "greater than" used to bypass password/value checks',pattern:new RegExp(`\\$gte?${ne}`,"i")},{id:"nosql-lt-operator",description:'$lt / $lte \u2014 "less than" bypass variants',pattern:new RegExp(`\\$lte?${ne}`,"i")},{id:"nosql-regex-operator",description:"$regex \u2014 can be used to extract data character by character (blind injection)",pattern:new RegExp(`\\$regex${ne}`,"i")},{id:"nosql-or-operator",description:"$or \u2014 logical OR; used to create always-true conditions",pattern:new RegExp(`\\$or${ne}\\s*\\[`,"i")},{id:"nosql-and-operator",description:"$and \u2014 logical AND operator injection",pattern:new RegExp(`\\$and${ne}\\s*\\[`,"i")},{id:"nosql-nor-operator",description:"$nor \u2014 logical NOR operator injection",pattern:new RegExp(`\\$nor${ne}\\s*\\[`,"i")},{id:"nosql-exists-operator",description:"$exists \u2014 can enumerate fields to determine schema",pattern:new RegExp(`\\$exists${ne}`,"i")},{id:"nosql-in-operator",description:"$in \u2014 matches any value in a list; can enumerate values",pattern:new RegExp(`\\$in${ne}\\s*\\[`,"i")},{id:"nosql-expr-operator",description:"$expr \u2014 allows aggregation expressions in queries (MongoDB 3.6+)",pattern:new RegExp(`\\$expr${ne}`,"i")},{id:"nosql-function-operator",description:"$function \u2014 executes arbitrary JavaScript in MongoDB 4.4+",pattern:new RegExp(`\\$function${ne}`,"i")},{id:"nosql-accumulator-operator",description:"$accumulator \u2014 custom aggregation with arbitrary JS execution",pattern:new RegExp(`\\$accumulator${ne}`,"i")},{id:"nosql-proto-pollution",description:"__proto__ \u2014 prototype pollution via object key injection",pattern:/__proto__/},{id:"nosql-constructor-prototype",description:"constructor.prototype \u2014 alternative prototype pollution vector (dot notation or JSON key)",pattern:/constructor[\s"':.,{\[]*prototype/i},{id:"nosql-proto-bracket",description:'["__proto__"] \u2014 bracket-notation prototype pollution',pattern:/\[["']__proto__["']\]/}],Xr=_o;var xo=[{id:"log-crlf-injection",description:"CRLF injection: literal \\r or \\n embeds fake log lines",pattern:/[\r\n]/},{id:"log-url-encoded-crlf",description:"URL-encoded CRLF: %0d, %0a, %0D, %0A \u2014 decoded by some log parsers",pattern:/%0[dDaA]/},{id:"log-unicode-newline",description:"Unicode newline variants: U+2028 (line separator), U+2029 (paragraph separator)",pattern:/[\u2028\u2029]/},{id:"log-log4shell-jndi",description:"Log4Shell: ${jndi:...} triggers remote code execution in Apache Log4j",pattern:/\$\{jndi\s*:/i},{id:"log-log4shell-obfuscated",description:"Obfuscated Log4Shell: ${::-j}... lookup-bypass prefix used to evade WAF detection",pattern:/\$\{::-/},{id:"log-log4j-lookup",description:"Log4j lookup syntax: ${env:...}, ${sys:...}, ${ctx:...} \u2014 data exfiltration",pattern:/\$\{(?:env|sys|ctx|main|map|sd|web|docker|k8s|spring)\s*:/i},{id:"log-ssti-double-brace",description:"SSTI double-brace: {{expression}} \u2014 Jinja2, Twig, Handlebars, etc.",pattern:/\{\{[\s\S]{0,80}\}\}/},{id:"log-ssti-hash-brace",description:"SSTI hash-brace: #{expression} \u2014 Thymeleaf, Velocity, Ruby ERB",pattern:/#\{[\s\S]{0,80}\}/},{id:"log-ssti-dollar-brace",description:"SSTI/EL injection: ${expression with operators or method calls} \u2014 JSP EL, Freemarker, SpEL",pattern:/\$\{[^}]*(?:\.|\(|\*|\+|\bclass\b|\bruntime\b|\bprocess\b|\bexec\b)[^}]{0,80}\}/i},{id:"log-ssti-percent-tag",description:"SSTI ERB/ASP tag: <%= expression %> \u2014 Ruby ERB, ASP",pattern:/<%=[\s\S]{0,80}%>/},{id:"log-null-byte",description:"Null byte: \\x00 or %00 \u2014 can truncate log entries in C-backed loggers",pattern:/\x00|%00/},{id:"log-ansi-escape",description:"ANSI escape sequence: ESC[ \u2014 can manipulate terminal output when logs are tailed",pattern:/\x1b\[/}],Zr=xo;var Ro=[{id:"sql-line-comment",description:"SQL line comment: -- followed by whitespace or end of string",pattern:/--(?:\s|$)/},{id:"sql-stacked-query",description:"Stacked queries: semicolon immediately followed by a SQL keyword",pattern:/;\s{0,10}(?:SELECT|INSERT|UPDATE|DELETE|DROP|CREATE|ALTER|EXEC)\b/i},{id:"sql-hex-encoding",description:"Hex-encoded string injection: 0x41414141 style (MySQL)",pattern:/\b0x[0-9a-f]{4,}/i}],Lo=[...At,...Ro],$r=Lo;Ke.label="HTML";We.label="XML";Jr.label="SVG";At.label="SQL";$r.label="SQL-STRICT";jr.label="SHELL";Vr.label="REDOS";Xr.label="NOSQL";Zr.label="LOG";var Mh=Object.freeze({HTML:Ke,XML:We,SVG:Jr,SQL:At,"SQL-STRICT":$r,SHELL:jr,REDOS:Vr,NOSQL:Xr,LOG:Zr});function Oo(e){if(typeof e!="string")throw new TypeError(`is-unsafe: first argument must be a string, got ${typeof e}`)}function Do(e){if(!(e instanceof RegExp)){if(Array.isArray(e)){if(e.length===0)throw new TypeError("is-unsafe: context must not be an empty array");if(Array.isArray(e[0])){for(let t of e)if(!Array.isArray(t)||t.length===0)throw new TypeError("is-unsafe: each context in the array must be a non-empty pattern array (PatternList)")}return}throw new TypeError(`is-unsafe: second argument must be a PatternList (e.g. HTML), an array of PatternLists (e.g. [HTML, XML]), or a RegExp. Got: ${typeof e}`)}}function Bo(e){return e instanceof RegExp?{lists:null,regex:e}:Array.isArray(e[0])?{lists:e,regex:null}:{lists:[e],regex:null}}function ko(e,t){let r=t.label??"CUSTOM";for(let n of t)if(n.pattern.test(e))return{context:r,id:n.id,description:n.description,pattern:n.pattern};return null}function As(e,t){Oo(e),Do(t);let{lists:r,regex:n}=Bo(t);if(n)return n.test(e);for(let s of r)if(ko(e,s)!==null)return!0;return!1}function vo(e,t){if(!e)return{};let r=t.attributesGroupName?e[t.attributesGroupName]:e;if(!r)return{};let n={};for(let s in r)if(s.startsWith(t.attributeNamePrefix)){let a=s.substring(t.attributeNamePrefix.length);n[a]=r[s]}else n[s]=r[s];return n}function Po(e){if(!e||typeof e!="string")return;let t=e.indexOf(":");if(t!==-1&&t>0){let r=e.substring(0,t);if(r!=="xmlns")return r}}var ut=class{constructor(t,r){this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.parseXml=Qo,this.parseTextData=Mo,this.resolveNameSpace=Fo,this.buildAttributesMap=Ho,this.isItStopNode=Wo,this.replaceEntitiesValue=Go,this.readStopNodeData=Vo,this.saveTextToParentTag=Ko,this.addChild=Yo,this.ignoreAttributesFn=Kr(this.options.ignoreAttributes),this.entityExpansionCount=0,this.currentExpandedLength=0,this.doctypefound=!1;let n={...ot};this.options.entityDecoder?this.entityDecoder=this.options.entityDecoder:(typeof this.options.htmlEntities=="object"?n=this.options.htmlEntities:this.options.htmlEntities===!0&&(n={...Fr,...Mr}),this.entityDecoder=new He({namedEntities:{...n,...r},numericAllowed:this.options.htmlEntities,limit:{maxTotalExpansions:this.options.processEntities.maxTotalExpansions,maxExpandedLength:this.options.processEntities.maxExpandedLength,applyLimitsTo:this.options.processEntities.appliesTo},onInputEntity:(a,c)=>As(c,[Ke,We])?Ue.BLOCK:Ue.ALLOW})),this.matcher=new Ge,this.readonlyMatcher=this.matcher.readOnly(),this.isCurrentNodeStopNode=!1,this.stopNodeExpressionsSet=new Ye;let s=this.options.stopNodes;if(s&&s.length>0){for(let a=0;a<s.length;a++){let c=s[a];typeof c=="string"?this.stopNodeExpressionsSet.add(new De(c)):c instanceof De&&this.stopNodeExpressionsSet.add(c)}this.stopNodeExpressionsSet.seal()}}};function Mo(e,t,r,n,s,a,c){let l=this.options;if(e!==void 0&&(l.trimValues&&!n&&(e=e.trim()),e.length>0)){c||(e=this.replaceEntitiesValue(e,t,r));let o=l.jPath?r.toString():r,d=l.tagValueProcessor(t,e,o,s,a);return d==null?e:typeof d!=typeof e||d!==e?d:l.trimValues||e.trim()===e?en(e,l.parseTagValue,l.numberParseOptions):e}}function Fo(e){if(this.options.removeNSPrefix){let t=e.split(":"),r=e.charAt(0)==="/"?"/":"";if(t[0]==="xmlns")return"";t.length===2&&(e=r+t[1])}return e}var Uo=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function Ho(e,t,r,n=!1){let s=this.options;if(n===!0||s.ignoreAttributes!==!0&&typeof e=="string"){let a=Ft(e,Uo),c=a.length,l={},o=new Array(c),d=!1,h={};for(let f=0;f<c;f++){let y=this.resolveNameSpace(a[f][1]),w=a[f][4];if(y.length&&w!==void 0){let I=w;s.trimValues&&(I=I.trim()),I=this.replaceEntitiesValue(I,r,this.readonlyMatcher),o[f]=I,h[y]=I,d=!0}}d&&typeof t=="object"&&t.updateCurrent&&t.updateCurrent(h);let m=s.jPath?t.toString():this.readonlyMatcher,E=!1;for(let f=0;f<c;f++){let y=this.resolveNameSpace(a[f][1]);if(this.ignoreAttributesFn(y,m))continue;let w=s.attributeNamePrefix+y;if(y.length)if(s.transformAttributeName&&(w=s.transformAttributeName(w)),w=us(w,s),a[f][4]!==void 0){let I=o[f],_=s.attributeValueProcessor(y,I,m);_==null?l[w]=I:typeof _!=typeof I||_!==I?l[w]=_:l[w]=en(I,s.parseAttributeValue,s.numberParseOptions),E=!0}else s.allowBooleanAttributes&&(l[w]=!0,E=!0)}if(!E)return;if(s.attributesGroupName&&!s.preserveOrder){let f={};return f[s.attributesGroupName]=l,f}return l}}var Qo=function(e){e=e.replace(/\r\n?/g,`
|
|
7
|
+
`);let t=new ee("!xml"),r=t,n="";this.matcher.reset(),this.entityDecoder.reset(),this.entityExpansionCount=0,this.currentExpandedLength=0,this.doctypefound=!1;let s=this.options,a=new dt(s.processEntities),c=e.length;for(let l=0;l<c;l++)if(e[l]==="<"){let d=e.charCodeAt(l+1);if(d===47){let h=Je(e,">",l,"Closing Tag is not closed."),m=e.substring(l+2,h).trim();if(s.removeNSPrefix){let f=m.indexOf(":");f!==-1&&(m=m.substr(f+1))}m=qr(s.transformTagName,m,"",s).tagName,r&&(n=this.saveTextToParentTag(n,r,this.readonlyMatcher));let E=this.matcher.getCurrentTag();if(m&&s.unpairedTagsSet.has(m))throw new Error(`Unpaired tag can not be used as closing tag: </${m}>`);E&&s.unpairedTagsSet.has(E)&&(this.matcher.pop(),this.tagsNodeStack.pop()),this.matcher.pop(),this.isCurrentNodeStopNode=!1,r=this.tagsNodeStack.pop(),n="",l=h}else if(d===63){let h=zr(e,l,!1,"?>");if(!h)throw new Error("Pi Tag is not closed.");n=this.saveTextToParentTag(n,r,this.readonlyMatcher);let m=this.buildAttributesMap(h.tagExp,this.matcher,h.tagName,!0);if(m){let E=m[this.options.attributeNamePrefix+"version"];this.entityDecoder.setXmlVersion(Number(E)||1),a.setXmlVersion(Number(E)||1)}if(!(s.ignoreDeclaration&&h.tagName==="?xml"||s.ignorePiTags)){let E=new ee(h.tagName);E.add(s.textNodeName,""),h.tagName!==h.tagExp&&h.attrExpPresent&&s.ignoreAttributes!==!0&&(E[":@"]=m),this.addChild(r,E,this.readonlyMatcher,l)}l=h.closeIndex+1}else if(d===33&&e.charCodeAt(l+2)===45&&e.charCodeAt(l+3)===45){let h=Je(e,"-->",l+4,"Comment is not closed.");if(s.commentPropName){let m=e.substring(l+4,h-2);n=this.saveTextToParentTag(n,r,this.readonlyMatcher),r.add(s.commentPropName,[{[s.textNodeName]:m}])}l=h}else if(d===33&&e.charCodeAt(l+2)===68){if(this.doctypefound)throw new Error("Multiple DOCTYPE declarations found.");this.doctypefound=!0;let h=a.readDocType(e,l);this.entityDecoder.addInputEntities(h.entities),l=h.i}else if(d===33&&e.charCodeAt(l+2)===91){let h=Je(e,"]]>",l,"CDATA is not closed.")-2,m=e.substring(l+9,h);n=this.saveTextToParentTag(n,r,this.readonlyMatcher);let E=this.parseTextData(m,r.tagname,this.readonlyMatcher,!0,!1,!0,!0);E==null&&(E=""),s.cdataPropName?r.add(s.cdataPropName,[{[s.textNodeName]:m}]):r.add(s.textNodeName,E),l=h+2}else{let h=zr(e,l,s.removeNSPrefix);if(!h){let k=e.substring(Math.max(0,l-50),Math.min(c,l+50));throw new Error(`readTagExp returned undefined at position ${l}. Context: "${k}"`)}let m=h.tagName,E=h.rawTagName,f=h.tagExp,y=h.attrExpPresent,w=h.closeIndex;if({tagName:m,tagExp:f}=qr(s.transformTagName,m,f,s),s.strictReservedNames&&(m===s.commentPropName||m===s.cdataPropName||m===s.textNodeName||m===s.attributesGroupName))throw new Error(`Invalid tag name: ${m}`);r&&n&&r.tagname!=="!xml"&&(n=this.saveTextToParentTag(n,r,this.readonlyMatcher,!1));let I=r;I&&s.unpairedTagsSet.has(I.tagname)&&(r=this.tagsNodeStack.pop(),this.matcher.pop());let _=!1;f.length>0&&f.lastIndexOf("/")===f.length-1&&(_=!0,m[m.length-1]==="/"?(m=m.substr(0,m.length-1),f=m):f=f.substr(0,f.length-1),y=m!==f);let S=null,R={},U;U=Po(E),m!==t.tagname&&this.matcher.push(m,{},U),m!==f&&y&&(S=this.buildAttributesMap(f,this.matcher,m),S&&(R=vo(S,s))),m!==t.tagname&&(this.isCurrentNodeStopNode=this.isItStopNode());let x=l;if(this.isCurrentNodeStopNode){let k="";if(_)l=h.closeIndex;else if(s.unpairedTagsSet.has(m))l=h.closeIndex;else{let F=this.readStopNodeData(e,E,w+1);if(!F)throw new Error(`Unexpected end of ${E}`);l=F.i,k=F.tagContent}let Y=new ee(m);S&&(Y[":@"]=S),Y.add(s.textNodeName,k),this.matcher.pop(),this.isCurrentNodeStopNode=!1,this.addChild(r,Y,this.readonlyMatcher,x)}else{if(_){({tagName:m,tagExp:f}=qr(s.transformTagName,m,f,s));let k=new ee(m);S&&(k[":@"]=S),this.addChild(r,k,this.readonlyMatcher,x),this.matcher.pop(),this.isCurrentNodeStopNode=!1}else if(s.unpairedTagsSet.has(m)){let k=new ee(m);S&&(k[":@"]=S),this.addChild(r,k,this.readonlyMatcher,x),this.matcher.pop(),this.isCurrentNodeStopNode=!1,l=h.closeIndex;continue}else{let k=new ee(m);if(this.tagsNodeStack.length>s.maxNestedTags)throw new Error("Maximum nested tags exceeded");this.tagsNodeStack.push(r),S&&(k[":@"]=S),this.addChild(r,k,this.readonlyMatcher,x),r=k}n="",l=w}}}else n+=e[l];return t.child};function Yo(e,t,r,n){this.options.captureMetaData||(n=void 0);let s=this.options.jPath?r.toString():r,a=this.options.updateTag(t.tagname,s,t[":@"]);a===!1||(typeof a=="string"&&(t.tagname=a),e.addChild(t,n))}function Go(e,t,r){let n=this.options.processEntities;if(!n||!n.enabled)return e;if(n.allowedTags){let s=this.options.jPath?r.toString():r;if(!(Array.isArray(n.allowedTags)?n.allowedTags.includes(t):n.allowedTags(t,s)))return e}if(n.tagFilter){let s=this.options.jPath?r.toString():r;if(!n.tagFilter(t,s))return e}return this.entityDecoder.decode(e)}function Ko(e,t,r,n){return e&&(n===void 0&&(n=t.child.length===0),e=this.parseTextData(e,t.tagname,r,!1,t[":@"]?Object.keys(t[":@"]).length!==0:!1,n),e!==void 0&&e!==""&&t.add(this.options.textNodeName,e),e=""),e}function Wo(){return this.stopNodeExpressionsSet.size===0?!1:this.matcher.matchesAny(this.stopNodeExpressionsSet)}function Jo(e,t,r=">"){let n=0,s=e.length,a=r.charCodeAt(0),c=r.length>1?r.charCodeAt(1):-1,l="",o=t;for(let d=t;d<s;d++){let h=e.charCodeAt(d);if(n)h===n&&(n=0);else if(h===34||h===39)n=h;else if(h===a)if(c!==-1){if(e.charCodeAt(d+1)===c)return l+=e.substring(o,d),{data:l,index:d}}else return l+=e.substring(o,d),{data:l,index:d};else h===9&&!n&&(l+=e.substring(o,d)+" ",o=d+1)}}function Je(e,t,r,n){let s=e.indexOf(t,r);if(s===-1)throw new Error(n);return s+t.length-1}function jo(e,t,r,n){let s=e.indexOf(t,r);if(s===-1)throw new Error(n);return s}function zr(e,t,r,n=">"){let s=Jo(e,t+1,n);if(!s)return;let a=s.data,c=s.index,l=a.search(/\s/),o=a,d=!0;l!==-1&&(o=a.substring(0,l),a=a.substring(l+1).trimStart());let h=o;if(r){let m=o.indexOf(":");m!==-1&&(o=o.substr(m+1),d=o!==s.data.substr(m+1))}return{tagName:o,tagExp:a,closeIndex:c,attrExpPresent:d,rawTagName:h}}function Vo(e,t,r){let n=r,s=1,a=e.length;for(;r<a;r++)if(e[r]==="<"){let c=e.charCodeAt(r+1);if(c===47){let l=jo(e,">",r,`${t} is not closed`);if(e.substring(r+2,l).trim()===t&&(s--,s===0))return{tagContent:e.substring(n,r),i:l};r=l}else if(c===63)r=Je(e,"?>",r+1,"StopNode is not closed.");else if(c===33&&e.charCodeAt(r+2)===45&&e.charCodeAt(r+3)===45)r=Je(e,"-->",r+3,"StopNode is not closed.");else if(c===33&&e.charCodeAt(r+2)===91)r=Je(e,"]]>",r,"StopNode is not closed.")-2;else{let l=zr(e,r,!1);l&&((l&&l.tagName)===t&&l.tagExp[l.tagExp.length-1]!=="/"&&s++,r=l.closeIndex)}}}function en(e,t,r){if(t&&typeof e=="string"){let n=e.trim();return n==="true"?!0:n==="false"?!1:Gr(e,r)}else return jn(e)?e:""}function qr(e,t,r,n){if(e){let s=e(t);r===t&&(r=s),t=s}return t=us(t,n),{tagName:t,tagExp:r}}function us(e,t){if(Ut.includes(e))throw new Error(`[SECURITY] Invalid name: "${e}" is a reserved JavaScript keyword that could cause prototype pollution`);return it.includes(e)?t.onDangerousProperty(e):e}var tn=ee.getMetaDataSymbol();function Xo(e,t){if(!e||typeof e!="object")return{};if(!t)return e;let r={};for(let n in e)if(n.startsWith(t)){let s=n.substring(t.length);r[s]=e[n]}else r[n]=e[n];return r}function rn(e,t,r,n){return hs(e,t,r,n)}function hs(e,t,r,n){let s,a={};for(let c=0;c<e.length;c++){let l=e[c],o=Zo(l);if(o!==void 0&&o!==t.textNodeName){let d=Xo(l[":@"]||{},t.attributeNamePrefix);r.push(o,d)}if(o===t.textNodeName)s===void 0?s=l[o]:s+=""+l[o];else{if(o===void 0)continue;if(l[o]){let d=hs(l[o],t,r,n),h=qo(d,t);if(Object.keys(d).length===0&&t.alwaysCreateTextNode&&(d[t.textNodeName]=""),l[":@"]?$o(d,l[":@"],n,t):Object.keys(d).length===1&&d[t.textNodeName]!==void 0&&!t.alwaysCreateTextNode?d=d[t.textNodeName]:Object.keys(d).length===0&&(t.alwaysCreateTextNode?d[t.textNodeName]="":d=""),l[tn]!==void 0&&typeof d=="object"&&d!==null&&(d[tn]=l[tn]),a[o]!==void 0&&Object.prototype.hasOwnProperty.call(a,o))Array.isArray(a[o])||(a[o]=[a[o]]),a[o].push(d);else{let m=t.jPath?n.toString():n;t.isArray(o,m,h)?a[o]=[d]:a[o]=d}o!==void 0&&o!==t.textNodeName&&r.pop()}}}return typeof s=="string"?s.length>0&&(a[t.textNodeName]=s):s!==void 0&&(a[t.textNodeName]=s),a}function Zo(e){let t=Object.keys(e);for(let r=0;r<t.length;r++){let n=t[r];if(n!==":@")return n}}function $o(e,t,r,n){if(t){let s=Object.keys(t),a=s.length;for(let c=0;c<a;c++){let l=s[c],o=l.startsWith(n.attributeNamePrefix)?l.substring(n.attributeNamePrefix.length):l,d=n.jPath?r.toString()+"."+o:r;n.isArray(l,d,!0,!0)?e[l]=[t[l]]:e[l]=t[l]}}}function qo(e,t){let{textNodeName:r}=t,n=Object.keys(e).length;return!!(n===0||n===1&&(e[r]||typeof e[r]=="boolean"||e[r]===0))}var je=class{constructor(t){this.externalEntities={},this.options=ts(t)}parse(t,r){if(typeof t!="string"&&t.toString)t=t.toString();else if(typeof t!="string")throw new Error("XML data is accepted in String or Bytes[] form.");if(r){r===!0&&(r={});let a=Ht(t,r);if(a!==!0)throw Error(`${a.err.msg}:${a.err.line}:${a.err.col}`)}let n=new ut(this.options,this.externalEntities),s=n.parseXml(t);return this.options.preserveOrder||s===void 0?s:rn(s,this.options,n.matcher,n.readonlyMatcher)}addEntity(t,r){if(r.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(t.indexOf("&")!==-1||t.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'");if(r==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=r}static getMetaDataSymbol(){return ee.getMetaDataSymbol()}};var ps={validate:Ht};var zo=/\.(?:avif|bmp|css|csv|docx?|eot|gif|gz|ico|jpe?g|js|json|map|mp3|mp4|mov|ogg|otf|pdf|png|pptx?|rar|rss|svg|tar|tiff?|ttf|txt|wav|webm|webp|woff2?|xlsx?|xml|zip)$/i;function Q(e,t,{includeQuery:r=!1}={}){let n;try{n=t?new URL(e,t):new URL(e)}catch{return null}return n.protocol!=="http:"&&n.protocol!=="https:"?null:(n.hash="",r||(n.search=""),n.pathname.length>1&&n.pathname.endsWith("/")&&(n.pathname=n.pathname.replace(/\/+$/,"")),n.href)}function ce(e,t){try{return new URL(e).origin===t}catch{return!1}}function jt(e){try{let t=new URL(e);return!zo.test(t.pathname)}catch{return!1}}var nn=10*1024*1024,ms=100,tc=5e4,rc=new je({ignoreAttributes:!1,removeNSPrefix:!0,trimValues:!0});function Vt(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}function gs(e){return(e===void 0?[]:Array.isArray(e)?e:[e]).flatMap(r=>{let n=Vt(r)?.loc;return typeof n=="string"?[n]:[]})}function nc(e,t,r){let s=t.toLowerCase().endsWith(".gz")||r.includes("gzip")||e[0]===31&&e[1]===139?ec(e):e;if(s.byteLength>nn)throw new Error(`sitemap exceeds ${nn} bytes after decompression: ${t}`);return s.toString("utf8").replace(/^\uFEFF/,"")}function fs(e,t){let r=ps.validate(e);if(r!==!0)throw new Error(`invalid sitemap XML at ${t}: ${r.err.msg}`);let n=Vt(rc.parse(e)),s=Vt(n?.sitemapindex);if(s)return{kind:"index",locations:gs(s.sitemap)};let a=Vt(n?.urlset);if(a)return{kind:"urlset",locations:gs(a.url)};throw new Error(`XML is not a sitemap urlset or sitemapindex: ${t}`)}function Es(e){return{fetch:e.fetch??globalThis.fetch,timeout:e.timeout,maxRedirects:e.maxRedirects??10,retries:e.retries??2,signal:e.signal,gate:e.requestGate?async t=>e.requestGate?.(t):void 0,onEvent:e.onEvent}}async function Ts(e,t){let{response:r}=await xe(e,{headers:{accept:"application/xml,text/xml,application/gzip,text/plain;q=0.9,*/*;q=0.1","user-agent":t.userAgent}},Es(t));if(!r.ok)throw await r.body?.cancel(),new Error(`sitemap returned HTTP ${r.status}: ${e}`);let{buffer:n}=await Re(r,nn);return nc(n,e,r.headers.get("content-type")?.toLowerCase()??"")}async function sc(e,t){try{let r=await Ts(e,t);return fs(r,e),!0}catch{return!1}}async function Cs(e,t){let r=Q(e,void 0);if(!r)throw new Error(`invalid start URL: ${e}`);let n=new URL(r).origin,s=new URL("/robots.txt",n).href;try{if(t.robotsBody!==void 0)for(let a of t.robotsBody.matchAll(/^sitemap:\s*(\S+)\s*$/gim)){let c=a[1];if(!c)continue;let l=Q(c,s,{includeQuery:!0});if(l&&ce(l,n))return l}else{let{response:a}=await xe(s,{headers:{accept:"text/plain,*/*;q=0.1","user-agent":t.userAgent}},Es({...t,siteOrigin:n}));if(a.ok){let{text:c}=await Re(a,524288);for(let l of c.matchAll(/^sitemap:\s*(\S+)\s*$/gim)){let o=l[1];if(!o)continue;let d=Q(o,s,{includeQuery:!0});if(d&&ce(d,n))return d}}else await a.body?.cancel()}}catch{}for(let a of["/sitemap.xml","/sitemap.xml.gz","/sitemap_index.xml"]){let c=new URL(a,n).href;if(await sc(c,{...t,siteOrigin:n}))return c}return null}async function Xt(e,t){let r=Q(e,void 0,{includeQuery:!0});if(!r)throw new Error(`invalid sitemap URL: ${e}`);let n=new URL(r).origin,s=[r],a=new Set,c=[],l=new Set,o=t.maxUrls??tc,d=!1;for(;s.length>0&&a.size<ms&&c.length<o;){let h=s.shift();if(a.has(h))continue;a.add(h);let m=fs(await Ts(h,t),h);if(m.kind==="index"){for(let E of m.locations){let f=Q(E,h,{includeQuery:!0});f&&ce(f,n)&&!a.has(f)&&!s.includes(f)&&s.push(f)}s.sort();continue}for(let E of m.locations){let f=Q(E,h,{includeQuery:t.includeQuery??!1});if(!(!f||l.has(f)||!ce(f,t.siteOrigin)||!jt(f))&&(l.add(f),c.push(f),c.length>=o)){d=!0;break}}}return(s.length>0||a.size>=ms)&&(d=!0),{url:r,urls:c.sort(),sitemapCount:a.size,truncated:d,error:null}}async function sn(e,t){await e.onEvent?.(t)}async function le(e,t={}){let r=ge(e),n=Q(r.url,void 0,{includeQuery:r.includeQuery});if(!n)throw new Error(`invalid start URL: ${r.url}`);let s=new URL(n).origin,a=t.fetch??globalThis.fetch,c=Fe(r.delay),l=t.logger??Pt;await sn(t,{type:"plan-start",url:n});let o=await Mt(n,{userAgent:ye,timeout:r.timeout,maxRedirects:r.maxRedirects,retries:2,fetch:a,signal:t.signal,requestGate:c,onEvent:t.onEvent,logger:l});await sn(t,{type:"robots",robots:o});let d=null;r.sitemap==="auto"?d=await Cs(n,{timeout:r.timeout,maxRedirects:r.maxRedirects,userAgent:ye,fetch:a,signal:t.signal,requestGate:c,onEvent:t.onEvent,robotsBody:o.body}):r.sitemap!=="none"&&(d=r.sitemap);let h=null;if(d)try{h=await Xt(d,{siteOrigin:s,includeQuery:r.includeQuery,maxUrls:5e4,timeout:r.timeout,maxRedirects:r.maxRedirects,retries:2,userAgent:ye,fetch:a,signal:t.signal,requestGate:c,onEvent:t.onEvent})}catch(f){h={url:d,urls:[],sitemapCount:0,truncated:!1,error:f instanceof Error?f.message:String(f)},l.warn(`Could not load sitemap ${d}: ${h.error}`)}let m=h?[...new Set([n,...h.urls])].sort((f,y)=>f===n?-1:y===n?1:f.localeCompare(y)):[n],E=h?m.length:null;return await sn(t,{type:"sitemap",sitemap:h,candidateCount:E}),{planVersion:1,config:r,startUrl:n,origin:s,userAgent:ye,robots:o,sitemap:h,candidateUrls:m,candidateCount:E,mode:h?"sitemap":"links"}}import{createHash as ui}from"node:crypto";var ic=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),B="\uFFFD",A;(function(e){e[e.EOF=-1]="EOF",e[e.NULL=0]="NULL",e[e.TABULATION=9]="TABULATION",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.LINE_FEED=10]="LINE_FEED",e[e.FORM_FEED=12]="FORM_FEED",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_0=48]="DIGIT_0",e[e.DIGIT_9=57]="DIGIT_9",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",e[e.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_A=97]="LATIN_SMALL_A",e[e.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(A||(A={}));var Z={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function Zt(e){return e>=55296&&e<=57343}function bs(e){return e>=56320&&e<=57343}function Is(e,t){return(e-55296)*1024+9216+t}function $t(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function qt(e){return e>=64976&&e<=65007||ic.has(e)}var T;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(T||(T={}));var oc=65536,zt=class{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=oc,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,r){let{line:n,col:s,offset:a}=this,c=s+r,l=a+r;return{code:t,startLine:n,endLine:n,startCol:c,endCol:c,startOffset:l,endOffset:l}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){let r=this.html.charCodeAt(this.pos+1);if(bs(r))return this.pos++,this._addGap(),Is(t,r)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,A.EOF;return this._err(T.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,r){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=r}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,r){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(r)return this.html.startsWith(t,this.pos);for(let n=0;n<t.length;n++)if((this.html.charCodeAt(this.pos+n)|32)!==t.charCodeAt(n))return!1;return!0}peek(t){let r=this.pos+t;if(r>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,A.EOF;let n=this.html.charCodeAt(r);return n===A.CARRIAGE_RETURN?A.LINE_FEED:n}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,A.EOF;let t=this.html.charCodeAt(this.pos);return t===A.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,A.LINE_FEED):t===A.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,Zt(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===A.LINE_FEED||t===A.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){$t(t)?this._err(T.controlCharacterInInputStream):qt(t)&&this._err(T.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}};var O;(function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION"})(O||(O={}));function er(e,t){for(let r=e.attrs.length-1;r>=0;r--)if(e.attrs[r].name===t)return e.attrs[r].value;return null}var lc=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function ys(e){return e>=55296&&e<=57343||e>1114111?65533:lc.get(e)??e}function ws(e){let t=atob(e),r=t.length&-2,n=new Uint16Array(r/2);for(let s=0,a=0;s<r;s+=2){let c=t.charCodeAt(s),l=t.charCodeAt(s+1);n[a++]=c|l<<8}return n}var an=ws("QR08ALkAAgH6AYsDNQR2BO0EPgXZBQEGLAbdBxMISQrvCmQLfQurDKQNLw4fD4YPpA+6D/IPAAAAAAAAAAAAAAAAKhBMEY8TmxUWF2EYLBkxGuAa3RsJHDscWR8YIC8jSCSIJcMl6ie3Ku8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D2MAcgAA4DXYzNzjCuQRUC4AAFQuAABYLmIuAAAAAGMubS5wLnQuAAAAAIguki4AAJouJxIqEnQAcgDpAB0ScgAA4DXYNd0AAUFhWy5eLnIA8gDnAnIA8gCTB75jAAFBYWYuaS5yAPIA4AJyAPIAjAdhAPAAeh5pAHMAAKD7IoABZHB0APgReS6DLgABZmx9LoAuAOA12GnddQDzAP8RaQBtAOUABBIAAUFhiy6OLnIA8gDuAnIA8gCaBwABY3GVLgoScgAA4DXYzdwAAXB0nS6hLmwAdQDzACUScgDpACASAARhY2VmaW9zdbEuvC7ELsguzC7PLtQu2S5jAAABdXm2LrsudABlADuA/QD9QE9kAAFpecAuwy5yAGMAd2FLZG4AO4ClAKVAcgAA4DXYNt1jAHkAV2RwAGYAAOA12GrdYwByAADgNdjO3AABY23dLt8ueQBOZGwAO4D/AP9AAAVhY2RlZmhpb3N38y73Lv8uAi8MLxAvEy8YLx0vIi9jInV0ZQB6YQABYXn7Lv4u8iFvbn5hN2RvAHQAfGEAAWV0Bi8KL3QAcgDmAB8QYQC2Y3IAAOA12DfdYwB5ADZk5yJyYXJyAKDdIXAAZgAA4DXYa91jAHIAAOA12M/cAAFqbiYvKC8AoA0gagAAoAwg");var W;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.FLAG13=8192]="FLAG13",e[e.BRANCH_LENGTH=8064]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(W||(W={}));var M;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(M||(M={}));var Ns=32;function on(e){return e>=M.ZERO&&e<=M.NINE}function dc(e){return e>=M.UPPER_A&&e<=M.UPPER_F||e>=M.LOWER_A&&e<=M.LOWER_F}function Ac(e){return e>=M.UPPER_A&&e<=M.UPPER_Z||e>=M.LOWER_A&&e<=M.LOWER_Z||on(e)}function uc(e){return e===M.EQUALS||Ac(e)}var G;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(G||(G={}));var me;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(me||(me={}));var tr=class{decodeTree;emitCodePoint;errors;constructor(t,r,n){this.decodeTree=t,this.emitCodePoint=r,this.errors=n}state=G.EntityStart;consumed=1;result=0;treeIndex=0;excess=1;decodeMode=me.Strict;runConsumed=0;startEntity(t){this.decodeMode=t,this.state=G.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1,this.runConsumed=0}write(t,r){switch(this.state){case G.EntityStart:return t.charCodeAt(r)===M.NUM?(this.state=G.NumericStart,this.consumed+=1,this.stateNumericStart(t,r+1)):(this.state=G.NamedEntity,this.stateNamedEntity(t,r));case G.NumericStart:return this.stateNumericStart(t,r);case G.NumericDecimal:return this.stateNumericDecimal(t,r);case G.NumericHex:return this.stateNumericHex(t,r);case G.NamedEntity:return this.stateNamedEntity(t,r)}}stateNumericStart(t,r){return r>=t.length?-1:(t.charCodeAt(r)|Ns)===M.LOWER_X?(this.state=G.NumericHex,this.consumed+=1,this.stateNumericHex(t,r+1)):(this.state=G.NumericDecimal,this.stateNumericDecimal(t,r))}stateNumericHex(t,r){for(;r<t.length;){let n=t.charCodeAt(r);if(on(n)||dc(n)){let s=n<=M.NINE?n-M.ZERO:(n|Ns)-M.LOWER_A+10;this.result=this.result*16+s,this.consumed++,r++}else return this.emitNumericEntity(n,3)}return-1}stateNumericDecimal(t,r){for(;r<t.length;){let n=t.charCodeAt(r);if(on(n))this.result=this.result*10+(n-M.ZERO),this.consumed++,r++;else return this.emitNumericEntity(n,2)}return-1}emitNumericEntity(t,r){if(this.consumed<=r)return this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===M.SEMI)this.consumed+=1;else if(this.decodeMode===me.Strict)return 0;return this.emitCodePoint(ys(this.result),this.consumed),this.errors&&(t!==M.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,r){let{decodeTree:n}=this,s=n[this.treeIndex],a=(s&W.VALUE_LENGTH)>>14;for(;r<t.length;){if(a===0&&(s&W.FLAG13)!==0){let l=(s&W.BRANCH_LENGTH)>>7;if(this.runConsumed===0){let o=s&W.JUMP_TABLE;if(t.charCodeAt(r)!==o)return this.result===0?0:this.emitNotTerminatedNamedEntity();r++,this.excess++,this.runConsumed++}for(;this.runConsumed<l;){if(r>=t.length)return-1;let o=this.runConsumed-1,d=n[this.treeIndex+1+(o>>1)],h=o%2===0?d&255:d>>8&255;if(t.charCodeAt(r)!==h)return this.runConsumed=0,this.result===0?0:this.emitNotTerminatedNamedEntity();r++,this.excess++,this.runConsumed++}this.runConsumed=0,this.treeIndex+=1+(l>>1),s=n[this.treeIndex],a=(s&W.VALUE_LENGTH)>>14}if(r>=t.length)break;let c=t.charCodeAt(r);if(c===M.SEMI&&a!==0&&(s&W.FLAG13)!==0)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);if(this.treeIndex=hc(n,s,this.treeIndex+Math.max(1,a),c),this.treeIndex<0)return this.result===0||this.decodeMode===me.Attribute&&(a===0||uc(c))?0:this.emitNotTerminatedNamedEntity();if(s=n[this.treeIndex],a=(s&W.VALUE_LENGTH)>>14,a!==0){if(c===M.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==me.Strict&&(s&W.FLAG13)===0&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}r++,this.excess++}return-1}emitNotTerminatedNamedEntity(){let{result:t,decodeTree:r}=this,n=(r[t]&W.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,n,this.consumed),this.errors?.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,r,n){let{decodeTree:s}=this;return this.emitCodePoint(r===1?s[t]&~(W.VALUE_LENGTH|W.FLAG13):s[t+1],n),r===3&&this.emitCodePoint(s[t+2],n),n}end(){switch(this.state){case G.NamedEntity:return this.result!==0&&(this.decodeMode!==me.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case G.NumericDecimal:return this.emitNumericEntity(0,2);case G.NumericHex:return this.emitNumericEntity(0,3);case G.NumericStart:return this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case G.EntityStart:return 0}}};function hc(e,t,r,n){let s=(t&W.BRANCH_LENGTH)>>7,a=t&W.JUMP_TABLE;if(s===0)return a!==0&&n===a?r:-1;if(a){let d=n-a;return d<0||d>=s?-1:e[r+d]-1}let c=s+1>>1,l=0,o=s-1;for(;l<=o;){let d=l+o>>>1,h=d>>1,E=e[r+h]>>(d&1)*8&255;if(E<n)l=d+1;else if(E>n)o=d-1;else return e[r+c+d]}return-1}var C;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(C||(C={}));var fe;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(fe||(fe={}));var $;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})($||($={}));var g;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(g||(g={}));var i;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(i||(i={}));var pc=new Map([[g.A,i.A],[g.ADDRESS,i.ADDRESS],[g.ANNOTATION_XML,i.ANNOTATION_XML],[g.APPLET,i.APPLET],[g.AREA,i.AREA],[g.ARTICLE,i.ARTICLE],[g.ASIDE,i.ASIDE],[g.B,i.B],[g.BASE,i.BASE],[g.BASEFONT,i.BASEFONT],[g.BGSOUND,i.BGSOUND],[g.BIG,i.BIG],[g.BLOCKQUOTE,i.BLOCKQUOTE],[g.BODY,i.BODY],[g.BR,i.BR],[g.BUTTON,i.BUTTON],[g.CAPTION,i.CAPTION],[g.CENTER,i.CENTER],[g.CODE,i.CODE],[g.COL,i.COL],[g.COLGROUP,i.COLGROUP],[g.DD,i.DD],[g.DESC,i.DESC],[g.DETAILS,i.DETAILS],[g.DIALOG,i.DIALOG],[g.DIR,i.DIR],[g.DIV,i.DIV],[g.DL,i.DL],[g.DT,i.DT],[g.EM,i.EM],[g.EMBED,i.EMBED],[g.FIELDSET,i.FIELDSET],[g.FIGCAPTION,i.FIGCAPTION],[g.FIGURE,i.FIGURE],[g.FONT,i.FONT],[g.FOOTER,i.FOOTER],[g.FOREIGN_OBJECT,i.FOREIGN_OBJECT],[g.FORM,i.FORM],[g.FRAME,i.FRAME],[g.FRAMESET,i.FRAMESET],[g.H1,i.H1],[g.H2,i.H2],[g.H3,i.H3],[g.H4,i.H4],[g.H5,i.H5],[g.H6,i.H6],[g.HEAD,i.HEAD],[g.HEADER,i.HEADER],[g.HGROUP,i.HGROUP],[g.HR,i.HR],[g.HTML,i.HTML],[g.I,i.I],[g.IMG,i.IMG],[g.IMAGE,i.IMAGE],[g.INPUT,i.INPUT],[g.IFRAME,i.IFRAME],[g.KEYGEN,i.KEYGEN],[g.LABEL,i.LABEL],[g.LI,i.LI],[g.LINK,i.LINK],[g.LISTING,i.LISTING],[g.MAIN,i.MAIN],[g.MALIGNMARK,i.MALIGNMARK],[g.MARQUEE,i.MARQUEE],[g.MATH,i.MATH],[g.MENU,i.MENU],[g.META,i.META],[g.MGLYPH,i.MGLYPH],[g.MI,i.MI],[g.MO,i.MO],[g.MN,i.MN],[g.MS,i.MS],[g.MTEXT,i.MTEXT],[g.NAV,i.NAV],[g.NOBR,i.NOBR],[g.NOFRAMES,i.NOFRAMES],[g.NOEMBED,i.NOEMBED],[g.NOSCRIPT,i.NOSCRIPT],[g.OBJECT,i.OBJECT],[g.OL,i.OL],[g.OPTGROUP,i.OPTGROUP],[g.OPTION,i.OPTION],[g.P,i.P],[g.PARAM,i.PARAM],[g.PLAINTEXT,i.PLAINTEXT],[g.PRE,i.PRE],[g.RB,i.RB],[g.RP,i.RP],[g.RT,i.RT],[g.RTC,i.RTC],[g.RUBY,i.RUBY],[g.S,i.S],[g.SCRIPT,i.SCRIPT],[g.SEARCH,i.SEARCH],[g.SECTION,i.SECTION],[g.SELECT,i.SELECT],[g.SOURCE,i.SOURCE],[g.SMALL,i.SMALL],[g.SPAN,i.SPAN],[g.STRIKE,i.STRIKE],[g.STRONG,i.STRONG],[g.STYLE,i.STYLE],[g.SUB,i.SUB],[g.SUMMARY,i.SUMMARY],[g.SUP,i.SUP],[g.TABLE,i.TABLE],[g.TBODY,i.TBODY],[g.TEMPLATE,i.TEMPLATE],[g.TEXTAREA,i.TEXTAREA],[g.TFOOT,i.TFOOT],[g.TD,i.TD],[g.TH,i.TH],[g.THEAD,i.THEAD],[g.TITLE,i.TITLE],[g.TR,i.TR],[g.TRACK,i.TRACK],[g.TT,i.TT],[g.U,i.U],[g.UL,i.UL],[g.SVG,i.SVG],[g.VAR,i.VAR],[g.WBR,i.WBR],[g.XMP,i.XMP]]);function Be(e){var t;return(t=pc.get(e))!==null&&t!==void 0?t:i.UNKNOWN}var b=i,Ss={[C.HTML]:new Set([b.ADDRESS,b.APPLET,b.AREA,b.ARTICLE,b.ASIDE,b.BASE,b.BASEFONT,b.BGSOUND,b.BLOCKQUOTE,b.BODY,b.BR,b.BUTTON,b.CAPTION,b.CENTER,b.COL,b.COLGROUP,b.DD,b.DETAILS,b.DIR,b.DIV,b.DL,b.DT,b.EMBED,b.FIELDSET,b.FIGCAPTION,b.FIGURE,b.FOOTER,b.FORM,b.FRAME,b.FRAMESET,b.H1,b.H2,b.H3,b.H4,b.H5,b.H6,b.HEAD,b.HEADER,b.HGROUP,b.HR,b.HTML,b.IFRAME,b.IMG,b.INPUT,b.LI,b.LINK,b.LISTING,b.MAIN,b.MARQUEE,b.MENU,b.META,b.NAV,b.NOEMBED,b.NOFRAMES,b.NOSCRIPT,b.OBJECT,b.OL,b.P,b.PARAM,b.PLAINTEXT,b.PRE,b.SCRIPT,b.SECTION,b.SELECT,b.SOURCE,b.STYLE,b.SUMMARY,b.TABLE,b.TBODY,b.TD,b.TEMPLATE,b.TEXTAREA,b.TFOOT,b.TH,b.THEAD,b.TITLE,b.TR,b.TRACK,b.UL,b.WBR,b.XMP]),[C.MATHML]:new Set([b.MI,b.MO,b.MN,b.MS,b.MTEXT,b.ANNOTATION_XML]),[C.SVG]:new Set([b.TITLE,b.FOREIGN_OBJECT,b.DESC]),[C.XLINK]:new Set,[C.XML]:new Set,[C.XMLNS]:new Set},ht=new Set([b.H1,b.H2,b.H3,b.H4,b.H5,b.H6]),vp=new Set([g.STYLE,g.SCRIPT,g.XMP,g.IFRAME,g.NOEMBED,g.NOFRAMES,g.PLAINTEXT]);var u;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(u||(u={}));var J={DATA:u.DATA,RCDATA:u.RCDATA,RAWTEXT:u.RAWTEXT,SCRIPT_DATA:u.SCRIPT_DATA,PLAINTEXT:u.PLAINTEXT,CDATA_SECTION:u.CDATA_SECTION};function gc(e){return e>=A.DIGIT_0&&e<=A.DIGIT_9}function pt(e){return e>=A.LATIN_CAPITAL_A&&e<=A.LATIN_CAPITAL_Z}function fc(e){return e>=A.LATIN_SMALL_A&&e<=A.LATIN_SMALL_Z}function Te(e){return fc(e)||pt(e)}function _s(e){return Te(e)||gc(e)}function rr(e){return e+32}function Rs(e){return e===A.SPACE||e===A.LINE_FEED||e===A.TABULATION||e===A.FORM_FEED}function xs(e){return Rs(e)||e===A.SOLIDUS||e===A.GREATER_THAN_SIGN}function Ec(e){return e===A.NULL?T.nullCharacterReference:e>1114111?T.characterReferenceOutsideUnicodeRange:Zt(e)?T.surrogateCharacterReference:qt(e)?T.noncharacterCharacterReference:$t(e)||e===A.CARRIAGE_RETURN?T.controlCharacterReference:null}var mt=class{constructor(t,r){this.options=t,this.handler=r,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=u.DATA,this.returnState=u.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new zt(r),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new tr(an,(n,s)=>{this.preprocessor.pos=this.entityStartPos+s-1,this._flushCodePointConsumedAsCharacterReference(n)},r.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(T.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:n=>{this._err(T.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+n)},validateNumericCharacterReference:n=>{let s=Ec(n);s&&this._err(s,1)}}:void 0)}_err(t,r=0){var n,s;(s=(n=this.handler).onParseError)===null||s===void 0||s.call(n,this.preprocessor.getError(t,r))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;let t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t?.())}write(t,r,n){this.active=!0,this.preprocessor.write(t,r),this._runParsingLoop(),this.paused||n?.()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let r=0;r<t;r++)this.preprocessor.advance()}_consumeSequenceIfMatch(t,r){return this.preprocessor.startsWith(t,r)?(this._advanceBy(t.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:O.START_TAG,tagName:"",tagID:i.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:O.END_TAG,tagName:"",tagID:i.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:O.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:O.DOCTYPE,name:t,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(t,r){this.currentCharacterToken={type:t,chars:r,location:this.currentLocation}}_createAttr(t){this.currentAttr={name:t,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var t,r;let n=this.currentToken;if(er(n,this.currentAttr.name)===null){if(n.attrs.push(this.currentAttr),n.location&&this.currentLocation){let s=(t=(r=n.location).attrs)!==null&&t!==void 0?t:r.attrs=Object.create(null);s[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(T.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(t){this._emitCurrentCharacterToken(t.location),this.currentToken=null,t.location&&(t.location.endLine=this.preprocessor.line,t.location.endCol=this.preprocessor.col+1,t.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){let t=this.currentToken;this.prepareToken(t),t.tagID=Be(t.tagName),t.type===O.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(T.endTagWithAttributes),t.selfClosing&&this._err(T.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case O.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case O.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case O.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){let t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:O.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,r){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=r;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,r)}_emitCodePoint(t){let r=Rs(t)?O.WHITESPACE_CHARACTER:t===A.NULL?O.NULL_CHARACTER:O.CHARACTER;this._appendCharToCurrentCharacterToken(r,t<65536?String.fromCharCode(t):String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(O.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=u.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?me.Attribute:me.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===u.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===u.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===u.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case u.DATA:{this._stateData(t);break}case u.RCDATA:{this._stateRcdata(t);break}case u.RAWTEXT:{this._stateRawtext(t);break}case u.SCRIPT_DATA:{this._stateScriptData(t);break}case u.PLAINTEXT:{this._statePlaintext(t);break}case u.TAG_OPEN:{this._stateTagOpen(t);break}case u.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case u.TAG_NAME:{this._stateTagName(t);break}case u.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case u.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case u.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case u.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case u.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case u.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case u.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case u.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case u.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case u.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case u.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case u.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case u.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case u.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case u.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case u.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case u.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case u.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case u.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case u.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case u.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case u.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case u.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case u.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case u.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case u.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case u.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case u.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case u.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case u.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case u.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case u.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case u.BOGUS_COMMENT:{this._stateBogusComment(t);break}case u.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case u.COMMENT_START:{this._stateCommentStart(t);break}case u.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case u.COMMENT:{this._stateComment(t);break}case u.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case u.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case u.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case u.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case u.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case u.COMMENT_END:{this._stateCommentEnd(t);break}case u.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case u.DOCTYPE:{this._stateDoctype(t);break}case u.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case u.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case u.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case u.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case u.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case u.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case u.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case u.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case u.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case u.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case u.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case u.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case u.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case u.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case u.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case u.CDATA_SECTION:{this._stateCdataSection(t);break}case u.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case u.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case u.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case u.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case A.LESS_THAN_SIGN:{this.state=u.TAG_OPEN;break}case A.AMPERSAND:{this._startCharacterReference();break}case A.NULL:{this._err(T.unexpectedNullCharacter),this._emitCodePoint(t);break}case A.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case A.AMPERSAND:{this._startCharacterReference();break}case A.LESS_THAN_SIGN:{this.state=u.RCDATA_LESS_THAN_SIGN;break}case A.NULL:{this._err(T.unexpectedNullCharacter),this._emitChars(B);break}case A.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case A.LESS_THAN_SIGN:{this.state=u.RAWTEXT_LESS_THAN_SIGN;break}case A.NULL:{this._err(T.unexpectedNullCharacter),this._emitChars(B);break}case A.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case A.LESS_THAN_SIGN:{this.state=u.SCRIPT_DATA_LESS_THAN_SIGN;break}case A.NULL:{this._err(T.unexpectedNullCharacter),this._emitChars(B);break}case A.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case A.NULL:{this._err(T.unexpectedNullCharacter),this._emitChars(B);break}case A.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(Te(t))this._createStartTagToken(),this.state=u.TAG_NAME,this._stateTagName(t);else switch(t){case A.EXCLAMATION_MARK:{this.state=u.MARKUP_DECLARATION_OPEN;break}case A.SOLIDUS:{this.state=u.END_TAG_OPEN;break}case A.QUESTION_MARK:{this._err(T.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=u.BOGUS_COMMENT,this._stateBogusComment(t);break}case A.EOF:{this._err(T.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(T.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=u.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(Te(t))this._createEndTagToken(),this.state=u.TAG_NAME,this._stateTagName(t);else switch(t){case A.GREATER_THAN_SIGN:{this._err(T.missingEndTagName),this.state=u.DATA;break}case A.EOF:{this._err(T.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(T.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=u.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){let r=this.currentToken;switch(t){case A.SPACE:case A.LINE_FEED:case A.TABULATION:case A.FORM_FEED:{this.state=u.BEFORE_ATTRIBUTE_NAME;break}case A.SOLIDUS:{this.state=u.SELF_CLOSING_START_TAG;break}case A.GREATER_THAN_SIGN:{this.state=u.DATA,this.emitCurrentTagToken();break}case A.NULL:{this._err(T.unexpectedNullCharacter),r.tagName+=B;break}case A.EOF:{this._err(T.eofInTag),this._emitEOFToken();break}default:r.tagName+=String.fromCodePoint(pt(t)?rr(t):t)}}_stateRcdataLessThanSign(t){t===A.SOLIDUS?this.state=u.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=u.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){Te(t)?(this.state=u.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=u.RCDATA,this._stateRcdata(t))}handleSpecialEndTag(t){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();let r=this.currentToken;switch(r.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case A.SPACE:case A.LINE_FEED:case A.TABULATION:case A.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=u.BEFORE_ATTRIBUTE_NAME,!1;case A.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=u.SELF_CLOSING_START_TAG,!1;case A.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=u.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=u.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===A.SOLIDUS?this.state=u.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=u.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){Te(t)?(this.state=u.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=u.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=u.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case A.SOLIDUS:{this.state=u.SCRIPT_DATA_END_TAG_OPEN;break}case A.EXCLAMATION_MARK:{this.state=u.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=u.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){Te(t)?(this.state=u.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=u.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=u.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===A.HYPHEN_MINUS?(this.state=u.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=u.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===A.HYPHEN_MINUS?(this.state=u.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=u.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case A.HYPHEN_MINUS:{this.state=u.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case A.LESS_THAN_SIGN:{this.state=u.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case A.NULL:{this._err(T.unexpectedNullCharacter),this._emitChars(B);break}case A.EOF:{this._err(T.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case A.HYPHEN_MINUS:{this.state=u.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case A.LESS_THAN_SIGN:{this.state=u.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case A.NULL:{this._err(T.unexpectedNullCharacter),this.state=u.SCRIPT_DATA_ESCAPED,this._emitChars(B);break}case A.EOF:{this._err(T.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=u.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case A.HYPHEN_MINUS:{this._emitChars("-");break}case A.LESS_THAN_SIGN:{this.state=u.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case A.GREATER_THAN_SIGN:{this.state=u.SCRIPT_DATA,this._emitChars(">");break}case A.NULL:{this._err(T.unexpectedNullCharacter),this.state=u.SCRIPT_DATA_ESCAPED,this._emitChars(B);break}case A.EOF:{this._err(T.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=u.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===A.SOLIDUS?this.state=u.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Te(t)?(this._emitChars("<"),this.state=u.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=u.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){Te(t)?(this.state=u.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=u.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=u.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(Z.SCRIPT,!1)&&xs(this.preprocessor.peek(Z.SCRIPT.length))){this._emitCodePoint(t);for(let r=0;r<Z.SCRIPT.length;r++)this._emitCodePoint(this._consume());this.state=u.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=u.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case A.HYPHEN_MINUS:{this.state=u.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case A.LESS_THAN_SIGN:{this.state=u.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case A.NULL:{this._err(T.unexpectedNullCharacter),this._emitChars(B);break}case A.EOF:{this._err(T.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case A.HYPHEN_MINUS:{this.state=u.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case A.LESS_THAN_SIGN:{this.state=u.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case A.NULL:{this._err(T.unexpectedNullCharacter),this.state=u.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(B);break}case A.EOF:{this._err(T.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=u.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case A.HYPHEN_MINUS:{this._emitChars("-");break}case A.LESS_THAN_SIGN:{this.state=u.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case A.GREATER_THAN_SIGN:{this.state=u.SCRIPT_DATA,this._emitChars(">");break}case A.NULL:{this._err(T.unexpectedNullCharacter),this.state=u.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(B);break}case A.EOF:{this._err(T.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=u.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===A.SOLIDUS?(this.state=u.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=u.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(Z.SCRIPT,!1)&&xs(this.preprocessor.peek(Z.SCRIPT.length))){this._emitCodePoint(t);for(let r=0;r<Z.SCRIPT.length;r++)this._emitCodePoint(this._consume());this.state=u.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=u.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case A.SPACE:case A.LINE_FEED:case A.TABULATION:case A.FORM_FEED:break;case A.SOLIDUS:case A.GREATER_THAN_SIGN:case A.EOF:{this.state=u.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case A.EQUALS_SIGN:{this._err(T.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=u.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=u.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case A.SPACE:case A.LINE_FEED:case A.TABULATION:case A.FORM_FEED:case A.SOLIDUS:case A.GREATER_THAN_SIGN:case A.EOF:{this._leaveAttrName(),this.state=u.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case A.EQUALS_SIGN:{this._leaveAttrName(),this.state=u.BEFORE_ATTRIBUTE_VALUE;break}case A.QUOTATION_MARK:case A.APOSTROPHE:case A.LESS_THAN_SIGN:{this._err(T.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case A.NULL:{this._err(T.unexpectedNullCharacter),this.currentAttr.name+=B;break}default:this.currentAttr.name+=String.fromCodePoint(pt(t)?rr(t):t)}}_stateAfterAttributeName(t){switch(t){case A.SPACE:case A.LINE_FEED:case A.TABULATION:case A.FORM_FEED:break;case A.SOLIDUS:{this.state=u.SELF_CLOSING_START_TAG;break}case A.EQUALS_SIGN:{this.state=u.BEFORE_ATTRIBUTE_VALUE;break}case A.GREATER_THAN_SIGN:{this.state=u.DATA,this.emitCurrentTagToken();break}case A.EOF:{this._err(T.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=u.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case A.SPACE:case A.LINE_FEED:case A.TABULATION:case A.FORM_FEED:break;case A.QUOTATION_MARK:{this.state=u.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case A.APOSTROPHE:{this.state=u.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case A.GREATER_THAN_SIGN:{this._err(T.missingAttributeValue),this.state=u.DATA,this.emitCurrentTagToken();break}default:this.state=u.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case A.QUOTATION_MARK:{this.state=u.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case A.AMPERSAND:{this._startCharacterReference();break}case A.NULL:{this._err(T.unexpectedNullCharacter),this.currentAttr.value+=B;break}case A.EOF:{this._err(T.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case A.APOSTROPHE:{this.state=u.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case A.AMPERSAND:{this._startCharacterReference();break}case A.NULL:{this._err(T.unexpectedNullCharacter),this.currentAttr.value+=B;break}case A.EOF:{this._err(T.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case A.SPACE:case A.LINE_FEED:case A.TABULATION:case A.FORM_FEED:{this._leaveAttrValue(),this.state=u.BEFORE_ATTRIBUTE_NAME;break}case A.AMPERSAND:{this._startCharacterReference();break}case A.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=u.DATA,this.emitCurrentTagToken();break}case A.NULL:{this._err(T.unexpectedNullCharacter),this.currentAttr.value+=B;break}case A.QUOTATION_MARK:case A.APOSTROPHE:case A.LESS_THAN_SIGN:case A.EQUALS_SIGN:case A.GRAVE_ACCENT:{this._err(T.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case A.EOF:{this._err(T.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case A.SPACE:case A.LINE_FEED:case A.TABULATION:case A.FORM_FEED:{this._leaveAttrValue(),this.state=u.BEFORE_ATTRIBUTE_NAME;break}case A.SOLIDUS:{this._leaveAttrValue(),this.state=u.SELF_CLOSING_START_TAG;break}case A.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=u.DATA,this.emitCurrentTagToken();break}case A.EOF:{this._err(T.eofInTag),this._emitEOFToken();break}default:this._err(T.missingWhitespaceBetweenAttributes),this.state=u.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case A.GREATER_THAN_SIGN:{let r=this.currentToken;r.selfClosing=!0,this.state=u.DATA,this.emitCurrentTagToken();break}case A.EOF:{this._err(T.eofInTag),this._emitEOFToken();break}default:this._err(T.unexpectedSolidusInTag),this.state=u.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){let r=this.currentToken;switch(t){case A.GREATER_THAN_SIGN:{this.state=u.DATA,this.emitCurrentComment(r);break}case A.EOF:{this.emitCurrentComment(r),this._emitEOFToken();break}case A.NULL:{this._err(T.unexpectedNullCharacter),r.data+=B;break}default:r.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(Z.DASH_DASH,!0)?(this._createCommentToken(Z.DASH_DASH.length+1),this.state=u.COMMENT_START):this._consumeSequenceIfMatch(Z.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Z.DOCTYPE.length+1),this.state=u.DOCTYPE):this._consumeSequenceIfMatch(Z.CDATA_START,!0)?this.inForeignNode?this.state=u.CDATA_SECTION:(this._err(T.cdataInHtmlContent),this._createCommentToken(Z.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=u.BOGUS_COMMENT):this._ensureHibernation()||(this._err(T.incorrectlyOpenedComment),this._createCommentToken(2),this.state=u.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case A.HYPHEN_MINUS:{this.state=u.COMMENT_START_DASH;break}case A.GREATER_THAN_SIGN:{this._err(T.abruptClosingOfEmptyComment),this.state=u.DATA;let r=this.currentToken;this.emitCurrentComment(r);break}default:this.state=u.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){let r=this.currentToken;switch(t){case A.HYPHEN_MINUS:{this.state=u.COMMENT_END;break}case A.GREATER_THAN_SIGN:{this._err(T.abruptClosingOfEmptyComment),this.state=u.DATA,this.emitCurrentComment(r);break}case A.EOF:{this._err(T.eofInComment),this.emitCurrentComment(r),this._emitEOFToken();break}default:r.data+="-",this.state=u.COMMENT,this._stateComment(t)}}_stateComment(t){let r=this.currentToken;switch(t){case A.HYPHEN_MINUS:{this.state=u.COMMENT_END_DASH;break}case A.LESS_THAN_SIGN:{r.data+="<",this.state=u.COMMENT_LESS_THAN_SIGN;break}case A.NULL:{this._err(T.unexpectedNullCharacter),r.data+=B;break}case A.EOF:{this._err(T.eofInComment),this.emitCurrentComment(r),this._emitEOFToken();break}default:r.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){let r=this.currentToken;switch(t){case A.EXCLAMATION_MARK:{r.data+="!",this.state=u.COMMENT_LESS_THAN_SIGN_BANG;break}case A.LESS_THAN_SIGN:{r.data+="<";break}default:this.state=u.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===A.HYPHEN_MINUS?this.state=u.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=u.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===A.HYPHEN_MINUS?this.state=u.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=u.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==A.GREATER_THAN_SIGN&&t!==A.EOF&&this._err(T.nestedComment),this.state=u.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){let r=this.currentToken;switch(t){case A.HYPHEN_MINUS:{this.state=u.COMMENT_END;break}case A.EOF:{this._err(T.eofInComment),this.emitCurrentComment(r),this._emitEOFToken();break}default:r.data+="-",this.state=u.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){let r=this.currentToken;switch(t){case A.GREATER_THAN_SIGN:{this.state=u.DATA,this.emitCurrentComment(r);break}case A.EXCLAMATION_MARK:{this.state=u.COMMENT_END_BANG;break}case A.HYPHEN_MINUS:{r.data+="-";break}case A.EOF:{this._err(T.eofInComment),this.emitCurrentComment(r),this._emitEOFToken();break}default:r.data+="--",this.state=u.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){let r=this.currentToken;switch(t){case A.HYPHEN_MINUS:{r.data+="--!",this.state=u.COMMENT_END_DASH;break}case A.GREATER_THAN_SIGN:{this._err(T.incorrectlyClosedComment),this.state=u.DATA,this.emitCurrentComment(r);break}case A.EOF:{this._err(T.eofInComment),this.emitCurrentComment(r),this._emitEOFToken();break}default:r.data+="--!",this.state=u.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case A.SPACE:case A.LINE_FEED:case A.TABULATION:case A.FORM_FEED:{this.state=u.BEFORE_DOCTYPE_NAME;break}case A.GREATER_THAN_SIGN:{this.state=u.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case A.EOF:{this._err(T.eofInDoctype),this._createDoctypeToken(null);let r=this.currentToken;r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:this._err(T.missingWhitespaceBeforeDoctypeName),this.state=u.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(pt(t))this._createDoctypeToken(String.fromCharCode(rr(t))),this.state=u.DOCTYPE_NAME;else switch(t){case A.SPACE:case A.LINE_FEED:case A.TABULATION:case A.FORM_FEED:break;case A.NULL:{this._err(T.unexpectedNullCharacter),this._createDoctypeToken(B),this.state=u.DOCTYPE_NAME;break}case A.GREATER_THAN_SIGN:{this._err(T.missingDoctypeName),this._createDoctypeToken(null);let r=this.currentToken;r.forceQuirks=!0,this.emitCurrentDoctype(r),this.state=u.DATA;break}case A.EOF:{this._err(T.eofInDoctype),this._createDoctypeToken(null);let r=this.currentToken;r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(t)),this.state=u.DOCTYPE_NAME}}_stateDoctypeName(t){let r=this.currentToken;switch(t){case A.SPACE:case A.LINE_FEED:case A.TABULATION:case A.FORM_FEED:{this.state=u.AFTER_DOCTYPE_NAME;break}case A.GREATER_THAN_SIGN:{this.state=u.DATA,this.emitCurrentDoctype(r);break}case A.NULL:{this._err(T.unexpectedNullCharacter),r.name+=B;break}case A.EOF:{this._err(T.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:r.name+=String.fromCodePoint(pt(t)?rr(t):t)}}_stateAfterDoctypeName(t){let r=this.currentToken;switch(t){case A.SPACE:case A.LINE_FEED:case A.TABULATION:case A.FORM_FEED:break;case A.GREATER_THAN_SIGN:{this.state=u.DATA,this.emitCurrentDoctype(r);break}case A.EOF:{this._err(T.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Z.PUBLIC,!1)?this.state=u.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Z.SYSTEM,!1)?this.state=u.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(T.invalidCharacterSequenceAfterDoctypeName),r.forceQuirks=!0,this.state=u.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){let r=this.currentToken;switch(t){case A.SPACE:case A.LINE_FEED:case A.TABULATION:case A.FORM_FEED:{this.state=u.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case A.QUOTATION_MARK:{this._err(T.missingWhitespaceAfterDoctypePublicKeyword),r.publicId="",this.state=u.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case A.APOSTROPHE:{this._err(T.missingWhitespaceAfterDoctypePublicKeyword),r.publicId="",this.state=u.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case A.GREATER_THAN_SIGN:{this._err(T.missingDoctypePublicIdentifier),r.forceQuirks=!0,this.state=u.DATA,this.emitCurrentDoctype(r);break}case A.EOF:{this._err(T.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:this._err(T.missingQuoteBeforeDoctypePublicIdentifier),r.forceQuirks=!0,this.state=u.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){let r=this.currentToken;switch(t){case A.SPACE:case A.LINE_FEED:case A.TABULATION:case A.FORM_FEED:break;case A.QUOTATION_MARK:{r.publicId="",this.state=u.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case A.APOSTROPHE:{r.publicId="",this.state=u.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case A.GREATER_THAN_SIGN:{this._err(T.missingDoctypePublicIdentifier),r.forceQuirks=!0,this.state=u.DATA,this.emitCurrentDoctype(r);break}case A.EOF:{this._err(T.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:this._err(T.missingQuoteBeforeDoctypePublicIdentifier),r.forceQuirks=!0,this.state=u.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){let r=this.currentToken;switch(t){case A.QUOTATION_MARK:{this.state=u.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case A.NULL:{this._err(T.unexpectedNullCharacter),r.publicId+=B;break}case A.GREATER_THAN_SIGN:{this._err(T.abruptDoctypePublicIdentifier),r.forceQuirks=!0,this.emitCurrentDoctype(r),this.state=u.DATA;break}case A.EOF:{this._err(T.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:r.publicId+=String.fromCodePoint(t)}}_stateDoctypePublicIdentifierSingleQuoted(t){let r=this.currentToken;switch(t){case A.APOSTROPHE:{this.state=u.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case A.NULL:{this._err(T.unexpectedNullCharacter),r.publicId+=B;break}case A.GREATER_THAN_SIGN:{this._err(T.abruptDoctypePublicIdentifier),r.forceQuirks=!0,this.emitCurrentDoctype(r),this.state=u.DATA;break}case A.EOF:{this._err(T.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:r.publicId+=String.fromCodePoint(t)}}_stateAfterDoctypePublicIdentifier(t){let r=this.currentToken;switch(t){case A.SPACE:case A.LINE_FEED:case A.TABULATION:case A.FORM_FEED:{this.state=u.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case A.GREATER_THAN_SIGN:{this.state=u.DATA,this.emitCurrentDoctype(r);break}case A.QUOTATION_MARK:{this._err(T.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),r.systemId="",this.state=u.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case A.APOSTROPHE:{this._err(T.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),r.systemId="",this.state=u.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case A.EOF:{this._err(T.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:this._err(T.missingQuoteBeforeDoctypeSystemIdentifier),r.forceQuirks=!0,this.state=u.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){let r=this.currentToken;switch(t){case A.SPACE:case A.LINE_FEED:case A.TABULATION:case A.FORM_FEED:break;case A.GREATER_THAN_SIGN:{this.emitCurrentDoctype(r),this.state=u.DATA;break}case A.QUOTATION_MARK:{r.systemId="",this.state=u.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case A.APOSTROPHE:{r.systemId="",this.state=u.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case A.EOF:{this._err(T.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:this._err(T.missingQuoteBeforeDoctypeSystemIdentifier),r.forceQuirks=!0,this.state=u.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){let r=this.currentToken;switch(t){case A.SPACE:case A.LINE_FEED:case A.TABULATION:case A.FORM_FEED:{this.state=u.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case A.QUOTATION_MARK:{this._err(T.missingWhitespaceAfterDoctypeSystemKeyword),r.systemId="",this.state=u.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case A.APOSTROPHE:{this._err(T.missingWhitespaceAfterDoctypeSystemKeyword),r.systemId="",this.state=u.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case A.GREATER_THAN_SIGN:{this._err(T.missingDoctypeSystemIdentifier),r.forceQuirks=!0,this.state=u.DATA,this.emitCurrentDoctype(r);break}case A.EOF:{this._err(T.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:this._err(T.missingQuoteBeforeDoctypeSystemIdentifier),r.forceQuirks=!0,this.state=u.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){let r=this.currentToken;switch(t){case A.SPACE:case A.LINE_FEED:case A.TABULATION:case A.FORM_FEED:break;case A.QUOTATION_MARK:{r.systemId="",this.state=u.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case A.APOSTROPHE:{r.systemId="",this.state=u.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case A.GREATER_THAN_SIGN:{this._err(T.missingDoctypeSystemIdentifier),r.forceQuirks=!0,this.state=u.DATA,this.emitCurrentDoctype(r);break}case A.EOF:{this._err(T.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:this._err(T.missingQuoteBeforeDoctypeSystemIdentifier),r.forceQuirks=!0,this.state=u.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){let r=this.currentToken;switch(t){case A.QUOTATION_MARK:{this.state=u.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case A.NULL:{this._err(T.unexpectedNullCharacter),r.systemId+=B;break}case A.GREATER_THAN_SIGN:{this._err(T.abruptDoctypeSystemIdentifier),r.forceQuirks=!0,this.emitCurrentDoctype(r),this.state=u.DATA;break}case A.EOF:{this._err(T.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:r.systemId+=String.fromCodePoint(t)}}_stateDoctypeSystemIdentifierSingleQuoted(t){let r=this.currentToken;switch(t){case A.APOSTROPHE:{this.state=u.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case A.NULL:{this._err(T.unexpectedNullCharacter),r.systemId+=B;break}case A.GREATER_THAN_SIGN:{this._err(T.abruptDoctypeSystemIdentifier),r.forceQuirks=!0,this.emitCurrentDoctype(r),this.state=u.DATA;break}case A.EOF:{this._err(T.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:r.systemId+=String.fromCodePoint(t)}}_stateAfterDoctypeSystemIdentifier(t){let r=this.currentToken;switch(t){case A.SPACE:case A.LINE_FEED:case A.TABULATION:case A.FORM_FEED:break;case A.GREATER_THAN_SIGN:{this.emitCurrentDoctype(r),this.state=u.DATA;break}case A.EOF:{this._err(T.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:this._err(T.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=u.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){let r=this.currentToken;switch(t){case A.GREATER_THAN_SIGN:{this.emitCurrentDoctype(r),this.state=u.DATA;break}case A.NULL:{this._err(T.unexpectedNullCharacter);break}case A.EOF:{this.emitCurrentDoctype(r),this._emitEOFToken();break}default:}}_stateCdataSection(t){switch(t){case A.RIGHT_SQUARE_BRACKET:{this.state=u.CDATA_SECTION_BRACKET;break}case A.EOF:{this._err(T.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===A.RIGHT_SQUARE_BRACKET?this.state=u.CDATA_SECTION_END:(this._emitChars("]"),this.state=u.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case A.GREATER_THAN_SIGN:{this.state=u.DATA;break}case A.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=u.CDATA_SECTION,this._stateCdataSection(t)}}_stateCharacterReference(){let t=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(t<0)if(this.preprocessor.lastChunkWritten)t=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}t===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(A.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&_s(this.preprocessor.peek(1))?u.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){_s(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===A.SEMICOLON&&this._err(T.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}};var Bs=new Set([i.DD,i.DT,i.LI,i.OPTGROUP,i.OPTION,i.P,i.RB,i.RP,i.RT,i.RTC]),Ls=new Set([...Bs,i.CAPTION,i.COLGROUP,i.TBODY,i.TD,i.TFOOT,i.TH,i.THEAD,i.TR]),nr=new Set([i.APPLET,i.CAPTION,i.HTML,i.MARQUEE,i.OBJECT,i.TABLE,i.TD,i.TEMPLATE,i.TH]),Tc=new Set([...nr,i.OL,i.UL]),Cc=new Set([...nr,i.BUTTON]),Os=new Set([i.ANNOTATION_XML,i.MI,i.MN,i.MO,i.MS,i.MTEXT]),Ds=new Set([i.DESC,i.FOREIGN_OBJECT,i.TITLE]),bc=new Set([i.TR,i.TEMPLATE,i.HTML]),Ic=new Set([i.TBODY,i.TFOOT,i.THEAD,i.TEMPLATE,i.HTML]),yc=new Set([i.TABLE,i.TEMPLATE,i.HTML]),wc=new Set([i.TD,i.TH]),sr=class{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,r,n){this.treeAdapter=r,this.handler=n,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=i.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===i.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===C.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(t,r){this.stackTop++,this.items[this.stackTop]=t,this.current=t,this.tagIDs[this.stackTop]=r,this.currentTagId=r,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(t,r,!0)}pop(){let t=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,r){let n=this._indexOf(t);this.items[n]=r,n===this.stackTop&&(this.current=r)}insertAfter(t,r,n){let s=this._indexOf(t)+1;this.items.splice(s,0,r),this.tagIDs.splice(s,0,n),this.stackTop++,s===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,s===this.stackTop)}popUntilTagNamePopped(t){let r=this.stackTop+1;do r=this.tagIDs.lastIndexOf(t,r-1);while(r>0&&this.treeAdapter.getNamespaceURI(this.items[r])!==C.HTML);this.shortenToLength(Math.max(r,0))}shortenToLength(t){for(;this.stackTop>=t;){let r=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(r,this.stackTop<t)}}popUntilElementPopped(t){let r=this._indexOf(t);this.shortenToLength(Math.max(r,0))}popUntilPopped(t,r){let n=this._indexOfTagNames(t,r);this.shortenToLength(Math.max(n,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(ht,C.HTML)}popUntilTableCellPopped(){this.popUntilPopped(wc,C.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(t,r){for(let n=this.stackTop;n>=0;n--)if(t.has(this.tagIDs[n])&&this.treeAdapter.getNamespaceURI(this.items[n])===r)return n;return-1}clearBackTo(t,r){let n=this._indexOfTagNames(t,r);this.shortenToLength(n+1)}clearBackToTableContext(){this.clearBackTo(yc,C.HTML)}clearBackToTableBodyContext(){this.clearBackTo(Ic,C.HTML)}clearBackToTableRowContext(){this.clearBackTo(bc,C.HTML)}remove(t){let r=this._indexOf(t);r>=0&&(r===this.stackTop?this.pop():(this.items.splice(r,1),this.tagIDs.splice(r,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===i.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){let r=this._indexOf(t)-1;return r>=0?this.items[r]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===i.HTML}hasInDynamicScope(t,r){for(let n=this.stackTop;n>=0;n--){let s=this.tagIDs[n];switch(this.treeAdapter.getNamespaceURI(this.items[n])){case C.HTML:{if(s===t)return!0;if(r.has(s))return!1;break}case C.SVG:{if(Ds.has(s))return!1;break}case C.MATHML:{if(Os.has(s))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,nr)}hasInListItemScope(t){return this.hasInDynamicScope(t,Tc)}hasInButtonScope(t){return this.hasInDynamicScope(t,Cc)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){let r=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case C.HTML:{if(ht.has(r))return!0;if(nr.has(r))return!1;break}case C.SVG:{if(Ds.has(r))return!1;break}case C.MATHML:{if(Os.has(r))return!1;break}}}return!0}hasInTableScope(t){for(let r=this.stackTop;r>=0;r--)if(this.treeAdapter.getNamespaceURI(this.items[r])===C.HTML)switch(this.tagIDs[r]){case t:return!0;case i.TABLE:case i.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===C.HTML)switch(this.tagIDs[t]){case i.TBODY:case i.THEAD:case i.TFOOT:return!0;case i.TABLE:case i.HTML:return!1}return!0}hasInSelectScope(t){for(let r=this.stackTop;r>=0;r--)if(this.treeAdapter.getNamespaceURI(this.items[r])===C.HTML)switch(this.tagIDs[r]){case t:return!0;case i.OPTION:case i.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&Bs.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&Ls.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&Ls.has(this.currentTagId);)this.pop()}};var de;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(de||(de={}));var ks={type:de.Marker},ir=class{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,r){let n=[],s=r.length,a=this.treeAdapter.getTagName(t),c=this.treeAdapter.getNamespaceURI(t);for(let l=0;l<this.entries.length;l++){let o=this.entries[l];if(o.type===de.Marker)break;let{element:d}=o;if(this.treeAdapter.getTagName(d)===a&&this.treeAdapter.getNamespaceURI(d)===c){let h=this.treeAdapter.getAttrList(d);h.length===s&&n.push({idx:l,attrs:h})}}return n}_ensureNoahArkCondition(t){if(this.entries.length<3)return;let r=this.treeAdapter.getAttrList(t),n=this._getNoahArkConditionCandidates(t,r);if(n.length<3)return;let s=new Map(r.map(c=>[c.name,c.value])),a=0;for(let c=0;c<n.length;c++){let l=n[c];l.attrs.every(o=>s.get(o.name)===o.value)&&(a+=1,a>=3&&this.entries.splice(l.idx,1))}}insertMarker(){this.entries.unshift(ks)}pushElement(t,r){this._ensureNoahArkCondition(t),this.entries.unshift({type:de.Element,element:t,token:r})}insertElementAfterBookmark(t,r){let n=this.entries.indexOf(this.bookmark);this.entries.splice(n,0,{type:de.Element,element:t,token:r})}removeEntry(t){let r=this.entries.indexOf(t);r!==-1&&this.entries.splice(r,1)}clearToLastMarker(){let t=this.entries.indexOf(ks);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){let r=this.entries.find(n=>n.type===de.Marker||this.treeAdapter.getTagName(n.element)===t);return r&&r.type===de.Element?r:null}getElementEntry(t){return this.entries.find(r=>r.type===de.Element&&r.element===t)}};var Ae={createDocument(){return{nodeName:"#document",mode:$.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,r){return{nodeName:e,tagName:e,attrs:r,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,r){let n=e.childNodes.indexOf(r);e.childNodes.splice(n,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,r,n){let s=e.childNodes.find(a=>a.nodeName==="#documentType");if(s)s.name=t,s.publicId=r,s.systemId=n;else{let a={nodeName:"#documentType",name:t,publicId:r,systemId:n,parentNode:null};Ae.appendChild(e,a)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){let t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){let r=e.childNodes[e.childNodes.length-1];if(Ae.isTextNode(r)){r.value+=t;return}}Ae.appendChild(e,Ae.createTextNode(t))},insertTextBefore(e,t,r){let n=e.childNodes[e.childNodes.indexOf(r)-1];n&&Ae.isTextNode(n)?n.value+=t:Ae.insertBefore(e,Ae.createTextNode(t),r)},adoptAttributes(e,t){let r=new Set(e.attrs.map(n=>n.name));for(let n=0;n<t.length;n++)r.has(t[n].name)||e.attrs.push(t[n])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName==="#text"},isCommentNode(e){return e.nodeName==="#comment"},isDocumentTypeNode(e){return e.nodeName==="#documentType"},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,"tagName")},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}};var Ps="html",Nc="about:legacy-compat",Sc="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",Ms=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],_c=[...Ms,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],xc=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),Fs=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],Rc=[...Fs,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function vs(e,t){return t.some(r=>e.startsWith(r))}function Us(e){return e.name===Ps&&e.publicId===null&&(e.systemId===null||e.systemId===Nc)}function Hs(e){if(e.name!==Ps)return $.QUIRKS;let{systemId:t}=e;if(t&&t.toLowerCase()===Sc)return $.QUIRKS;let{publicId:r}=e;if(r!==null){if(r=r.toLowerCase(),xc.has(r))return $.QUIRKS;let n=t===null?_c:Ms;if(vs(r,n))return $.QUIRKS;if(n=t===null?Fs:Rc,vs(r,n))return $.LIMITED_QUIRKS}return $.NO_QUIRKS}var Qs={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},Oc="definitionurl",Dc="definitionURL",Bc=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),kc=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:C.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:C.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:C.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:C.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:C.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:C.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:C.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:C.XML}],["xml:space",{prefix:"xml",name:"space",namespace:C.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:C.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:C.XMLNS}]]),vc=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),Pc=new Set([i.B,i.BIG,i.BLOCKQUOTE,i.BODY,i.BR,i.CENTER,i.CODE,i.DD,i.DIV,i.DL,i.DT,i.EM,i.EMBED,i.H1,i.H2,i.H3,i.H4,i.H5,i.H6,i.HEAD,i.HR,i.I,i.IMG,i.LI,i.LISTING,i.MENU,i.META,i.NOBR,i.OL,i.P,i.PRE,i.RUBY,i.S,i.SMALL,i.SPAN,i.STRONG,i.STRIKE,i.SUB,i.SUP,i.TABLE,i.TT,i.U,i.UL,i.VAR]);function Ys(e){let t=e.tagID;return t===i.FONT&&e.attrs.some(({name:n})=>n===fe.COLOR||n===fe.SIZE||n===fe.FACE)||Pc.has(t)}function cn(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===Oc){e.attrs[t].name=Dc;break}}function ln(e){for(let t=0;t<e.attrs.length;t++){let r=Bc.get(e.attrs[t].name);r!=null&&(e.attrs[t].name=r)}}function ar(e){for(let t=0;t<e.attrs.length;t++){let r=kc.get(e.attrs[t].name);r&&(e.attrs[t].prefix=r.prefix,e.attrs[t].name=r.name,e.attrs[t].namespace=r.namespace)}}function Gs(e){let t=vc.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=Be(e.tagName))}function Mc(e,t){return t===C.MATHML&&(e===i.MI||e===i.MO||e===i.MN||e===i.MS||e===i.MTEXT)}function Fc(e,t,r){if(t===C.MATHML&&e===i.ANNOTATION_XML){for(let n=0;n<r.length;n++)if(r[n].name===fe.ENCODING){let s=r[n].value.toLowerCase();return s===Qs.TEXT_HTML||s===Qs.APPLICATION_XML}}return t===C.SVG&&(e===i.FOREIGN_OBJECT||e===i.DESC||e===i.TITLE)}function Ks(e,t,r,n){return(!n||n===C.HTML)&&Fc(e,t,r)||(!n||n===C.MATHML)&&Mc(e,t)}var Uc="hidden",Hc=8,Qc=3,p;(function(e){e[e.INITIAL=0]="INITIAL",e[e.BEFORE_HTML=1]="BEFORE_HTML",e[e.BEFORE_HEAD=2]="BEFORE_HEAD",e[e.IN_HEAD=3]="IN_HEAD",e[e.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",e[e.AFTER_HEAD=5]="AFTER_HEAD",e[e.IN_BODY=6]="IN_BODY",e[e.TEXT=7]="TEXT",e[e.IN_TABLE=8]="IN_TABLE",e[e.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",e[e.IN_CAPTION=10]="IN_CAPTION",e[e.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",e[e.IN_TABLE_BODY=12]="IN_TABLE_BODY",e[e.IN_ROW=13]="IN_ROW",e[e.IN_CELL=14]="IN_CELL",e[e.IN_SELECT=15]="IN_SELECT",e[e.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",e[e.IN_TEMPLATE=17]="IN_TEMPLATE",e[e.AFTER_BODY=18]="AFTER_BODY",e[e.IN_FRAMESET=19]="IN_FRAMESET",e[e.AFTER_FRAMESET=20]="AFTER_FRAMESET",e[e.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",e[e.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(p||(p={}));var Yc={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},Xs=new Set([i.TABLE,i.TBODY,i.TFOOT,i.THEAD,i.TR]),Js={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:Ae,onParseError:null},yt=class{constructor(t,r,n=null,s=null){this.fragmentContext=n,this.scriptHandler=s,this.currentToken=null,this.stopped=!1,this.insertionMode=p.INITIAL,this.originalInsertionMode=p.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...Js,...t},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=r??this.treeAdapter.createDocument(),this.tokenizer=new mt(this.options,this),this.activeFormattingElements=new ir(this.treeAdapter),this.fragmentContextID=n?Be(this.treeAdapter.getTagName(n)):i.UNKNOWN,this._setContextModes(n??this.document,this.fragmentContextID),this.openElements=new sr(this.document,this.treeAdapter,this)}static parse(t,r){let n=new this(r);return n.tokenizer.write(t,!0),n.document}static getFragmentParser(t,r){let n={...Js,...r};t??(t=n.treeAdapter.createElement(g.TEMPLATE,C.HTML,[]));let s=n.treeAdapter.createElement("documentmock",C.HTML,[]),a=new this(n,s,t);return a.fragmentContextID===i.TEMPLATE&&a.tmplInsertionModeStack.unshift(p.IN_TEMPLATE),a._initTokenizerForFragmentParsing(),a._insertFakeRootElement(),a._resetInsertionMode(),a._findFormInFragmentContext(),a}getFragment(){let t=this.treeAdapter.getFirstChild(this.document),r=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,r),r}_err(t,r,n){var s;if(!this.onParseError)return;let a=(s=t.location)!==null&&s!==void 0?s:Yc,c={code:r,startLine:a.startLine,startCol:a.startCol,startOffset:a.startOffset,endLine:n?a.startLine:a.endLine,endCol:n?a.startCol:a.endCol,endOffset:n?a.startOffset:a.endOffset};this.onParseError(c)}onItemPush(t,r,n){var s,a;(a=(s=this.treeAdapter).onItemPush)===null||a===void 0||a.call(s,t),n&&this.openElements.stackTop>0&&this._setContextModes(t,r)}onItemPop(t,r){var n,s;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(s=(n=this.treeAdapter).onItemPop)===null||s===void 0||s.call(n,t,this.openElements.current),r){let a,c;this.openElements.stackTop===0&&this.fragmentContext?(a=this.fragmentContext,c=this.fragmentContextID):{current:a,currentTagId:c}=this.openElements,this._setContextModes(a,c)}}_setContextModes(t,r){let n=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===C.HTML;this.currentNotInHTML=!n,this.tokenizer.inForeignNode=!n&&t!==void 0&&r!==void 0&&!this._isIntegrationPoint(r,t)}_switchToTextParsing(t,r){this._insertElement(t,C.HTML),this.tokenizer.state=r,this.originalInsertionMode=this.insertionMode,this.insertionMode=p.TEXT}switchToPlaintextParsing(){this.insertionMode=p.TEXT,this.originalInsertionMode=p.IN_BODY,this.tokenizer.state=J.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===g.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==C.HTML))switch(this.fragmentContextID){case i.TITLE:case i.TEXTAREA:{this.tokenizer.state=J.RCDATA;break}case i.STYLE:case i.XMP:case i.IFRAME:case i.NOEMBED:case i.NOFRAMES:case i.NOSCRIPT:{this.tokenizer.state=J.RAWTEXT;break}case i.SCRIPT:{this.tokenizer.state=J.SCRIPT_DATA;break}case i.PLAINTEXT:{this.tokenizer.state=J.PLAINTEXT;break}default:}}_setDocumentType(t){let r=t.name||"",n=t.publicId||"",s=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,r,n,s),t.location){let c=this.treeAdapter.getChildNodes(this.document).find(l=>this.treeAdapter.isDocumentTypeNode(l));c&&this.treeAdapter.setNodeSourceCodeLocation(c,t.location)}}_attachElementToTree(t,r){if(this.options.sourceCodeLocationInfo){let n=r&&{...r,startTag:r};this.treeAdapter.setNodeSourceCodeLocation(t,n)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{let n=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(n??this.document,t)}}_appendElement(t,r){let n=this.treeAdapter.createElement(t.tagName,r,t.attrs);this._attachElementToTree(n,t.location)}_insertElement(t,r){let n=this.treeAdapter.createElement(t.tagName,r,t.attrs);this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID)}_insertFakeElement(t,r){let n=this.treeAdapter.createElement(t,C.HTML,[]);this._attachElementToTree(n,null),this.openElements.push(n,r)}_insertTemplate(t){let r=this.treeAdapter.createElement(t.tagName,C.HTML,t.attrs),n=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(r,n),this._attachElementToTree(r,t.location),this.openElements.push(r,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,null)}_insertFakeRootElement(){let t=this.treeAdapter.createElement(g.HTML,C.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,i.HTML)}_appendCommentNode(t,r){let n=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(r,n),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,t.location)}_insertCharacters(t){let r,n;if(this._shouldFosterParentOnInsertion()?({parent:r,beforeElement:n}=this._findFosterParentingLocation(),n?this.treeAdapter.insertTextBefore(r,t.chars,n):this.treeAdapter.insertText(r,t.chars)):(r=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(r,t.chars)),!t.location)return;let s=this.treeAdapter.getChildNodes(r),a=n?s.lastIndexOf(n):s.length,c=s[a-1];if(this.treeAdapter.getNodeSourceCodeLocation(c)){let{endLine:o,endCol:d,endOffset:h}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(c,{endLine:o,endCol:d,endOffset:h})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(c,t.location)}_adoptNodes(t,r){for(let n=this.treeAdapter.getFirstChild(t);n;n=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(n),this.treeAdapter.appendChild(r,n)}_setEndLocation(t,r){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&r.location){let n=r.location,s=this.treeAdapter.getTagName(t),a=r.type===O.END_TAG&&s===r.tagName?{endTag:{...n},endLine:n.endLine,endCol:n.endCol,endOffset:n.endOffset}:{endLine:n.startLine,endCol:n.startCol,endOffset:n.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,a)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let r,n;return this.openElements.stackTop===0&&this.fragmentContext?(r=this.fragmentContext,n=this.fragmentContextID):{current:r,currentTagId:n}=this.openElements,t.tagID===i.SVG&&this.treeAdapter.getTagName(r)===g.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(r)===C.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===i.MGLYPH||t.tagID===i.MALIGNMARK)&&n!==void 0&&!this._isIntegrationPoint(n,r,C.HTML)}_processToken(t){switch(t.type){case O.CHARACTER:{this.onCharacter(t);break}case O.NULL_CHARACTER:{this.onNullCharacter(t);break}case O.COMMENT:{this.onComment(t);break}case O.DOCTYPE:{this.onDoctype(t);break}case O.START_TAG:{this._processStartTag(t);break}case O.END_TAG:{this.onEndTag(t);break}case O.EOF:{this.onEof(t);break}case O.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,r,n){let s=this.treeAdapter.getNamespaceURI(r),a=this.treeAdapter.getAttrList(r);return Ks(t,s,a,n)}_reconstructActiveFormattingElements(){let t=this.activeFormattingElements.entries.length;if(t){let r=this.activeFormattingElements.entries.findIndex(s=>s.type===de.Marker||this.openElements.contains(s.element)),n=r===-1?t-1:r-1;for(let s=n;s>=0;s--){let a=this.activeFormattingElements.entries[s];this._insertElement(a.token,this.treeAdapter.getNamespaceURI(a.element)),a.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=p.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(i.P),this.openElements.popUntilTagNamePopped(i.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case i.TR:{this.insertionMode=p.IN_ROW;return}case i.TBODY:case i.THEAD:case i.TFOOT:{this.insertionMode=p.IN_TABLE_BODY;return}case i.CAPTION:{this.insertionMode=p.IN_CAPTION;return}case i.COLGROUP:{this.insertionMode=p.IN_COLUMN_GROUP;return}case i.TABLE:{this.insertionMode=p.IN_TABLE;return}case i.BODY:{this.insertionMode=p.IN_BODY;return}case i.FRAMESET:{this.insertionMode=p.IN_FRAMESET;return}case i.SELECT:{this._resetInsertionModeForSelect(t);return}case i.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case i.HTML:{this.insertionMode=this.headElement?p.AFTER_HEAD:p.BEFORE_HEAD;return}case i.TD:case i.TH:{if(t>0){this.insertionMode=p.IN_CELL;return}break}case i.HEAD:{if(t>0){this.insertionMode=p.IN_HEAD;return}break}}this.insertionMode=p.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let r=t-1;r>0;r--){let n=this.openElements.tagIDs[r];if(n===i.TEMPLATE)break;if(n===i.TABLE){this.insertionMode=p.IN_SELECT_IN_TABLE;return}}this.insertionMode=p.IN_SELECT}_isElementCausesFosterParenting(t){return Xs.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){let r=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case i.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(r)===C.HTML)return{parent:this.treeAdapter.getTemplateContent(r),beforeElement:null};break}case i.TABLE:{let n=this.treeAdapter.getParentNode(r);return n?{parent:n,beforeElement:r}:{parent:this.openElements.items[t-1],beforeElement:null}}default:}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){let r=this._findFosterParentingLocation();r.beforeElement?this.treeAdapter.insertBefore(r.parent,t,r.beforeElement):this.treeAdapter.appendChild(r.parent,t)}_isSpecialElement(t,r){let n=this.treeAdapter.getNamespaceURI(t);return Ss[n].has(r)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Ed(this,t);return}switch(this.insertionMode){case p.INITIAL:{gt(this,t);break}case p.BEFORE_HTML:{Et(this,t);break}case p.BEFORE_HEAD:{Tt(this,t);break}case p.IN_HEAD:{Ct(this,t);break}case p.IN_HEAD_NO_SCRIPT:{bt(this,t);break}case p.AFTER_HEAD:{It(this,t);break}case p.IN_BODY:case p.IN_CAPTION:case p.IN_CELL:case p.IN_TEMPLATE:{$s(this,t);break}case p.TEXT:case p.IN_SELECT:case p.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case p.IN_TABLE:case p.IN_TABLE_BODY:case p.IN_ROW:{dn(this,t);break}case p.IN_TABLE_TEXT:{ni(this,t);break}case p.IN_COLUMN_GROUP:{cr(this,t);break}case p.AFTER_BODY:{lr(this,t);break}case p.AFTER_AFTER_BODY:{or(this,t);break}default:}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){fd(this,t);return}switch(this.insertionMode){case p.INITIAL:{gt(this,t);break}case p.BEFORE_HTML:{Et(this,t);break}case p.BEFORE_HEAD:{Tt(this,t);break}case p.IN_HEAD:{Ct(this,t);break}case p.IN_HEAD_NO_SCRIPT:{bt(this,t);break}case p.AFTER_HEAD:{It(this,t);break}case p.TEXT:{this._insertCharacters(t);break}case p.IN_TABLE:case p.IN_TABLE_BODY:case p.IN_ROW:{dn(this,t);break}case p.IN_COLUMN_GROUP:{cr(this,t);break}case p.AFTER_BODY:{lr(this,t);break}case p.AFTER_AFTER_BODY:{or(this,t);break}default:}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){An(this,t);return}switch(this.insertionMode){case p.INITIAL:case p.BEFORE_HTML:case p.BEFORE_HEAD:case p.IN_HEAD:case p.IN_HEAD_NO_SCRIPT:case p.AFTER_HEAD:case p.IN_BODY:case p.IN_TABLE:case p.IN_CAPTION:case p.IN_COLUMN_GROUP:case p.IN_TABLE_BODY:case p.IN_ROW:case p.IN_CELL:case p.IN_SELECT:case p.IN_SELECT_IN_TABLE:case p.IN_TEMPLATE:case p.IN_FRAMESET:case p.AFTER_FRAMESET:{An(this,t);break}case p.IN_TABLE_TEXT:{ft(this,t);break}case p.AFTER_BODY:{Xc(this,t);break}case p.AFTER_AFTER_BODY:case p.AFTER_AFTER_FRAMESET:{Zc(this,t);break}default:}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case p.INITIAL:{$c(this,t);break}case p.BEFORE_HEAD:case p.IN_HEAD:case p.IN_HEAD_NO_SCRIPT:case p.AFTER_HEAD:{this._err(t,T.misplacedDoctype);break}case p.IN_TABLE_TEXT:{ft(this,t);break}default:}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,T.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?Td(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case p.INITIAL:{gt(this,t);break}case p.BEFORE_HTML:{qc(this,t);break}case p.BEFORE_HEAD:{el(this,t);break}case p.IN_HEAD:{ue(this,t);break}case p.IN_HEAD_NO_SCRIPT:{nl(this,t);break}case p.AFTER_HEAD:{il(this,t);break}case p.IN_BODY:{j(this,t);break}case p.IN_TABLE:{Ve(this,t);break}case p.IN_TABLE_TEXT:{ft(this,t);break}case p.IN_CAPTION:{td(this,t);break}case p.IN_COLUMN_GROUP:{mn(this,t);break}case p.IN_TABLE_BODY:{ur(this,t);break}case p.IN_ROW:{hr(this,t);break}case p.IN_CELL:{sd(this,t);break}case p.IN_SELECT:{ai(this,t);break}case p.IN_SELECT_IN_TABLE:{ad(this,t);break}case p.IN_TEMPLATE:{cd(this,t);break}case p.AFTER_BODY:{dd(this,t);break}case p.IN_FRAMESET:{Ad(this,t);break}case p.AFTER_FRAMESET:{hd(this,t);break}case p.AFTER_AFTER_BODY:{md(this,t);break}case p.AFTER_AFTER_FRAMESET:{gd(this,t);break}default:}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?Cd(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case p.INITIAL:{gt(this,t);break}case p.BEFORE_HTML:{zc(this,t);break}case p.BEFORE_HEAD:{tl(this,t);break}case p.IN_HEAD:{rl(this,t);break}case p.IN_HEAD_NO_SCRIPT:{sl(this,t);break}case p.AFTER_HEAD:{al(this,t);break}case p.IN_BODY:{Ar(this,t);break}case p.TEXT:{Wl(this,t);break}case p.IN_TABLE:{wt(this,t);break}case p.IN_TABLE_TEXT:{ft(this,t);break}case p.IN_CAPTION:{rd(this,t);break}case p.IN_COLUMN_GROUP:{nd(this,t);break}case p.IN_TABLE_BODY:{un(this,t);break}case p.IN_ROW:{ii(this,t);break}case p.IN_CELL:{id(this,t);break}case p.IN_SELECT:{oi(this,t);break}case p.IN_SELECT_IN_TABLE:{od(this,t);break}case p.IN_TEMPLATE:{ld(this,t);break}case p.AFTER_BODY:{li(this,t);break}case p.IN_FRAMESET:{ud(this,t);break}case p.AFTER_FRAMESET:{pd(this,t);break}case p.AFTER_AFTER_BODY:{or(this,t);break}default:}}onEof(t){switch(this.insertionMode){case p.INITIAL:{gt(this,t);break}case p.BEFORE_HTML:{Et(this,t);break}case p.BEFORE_HEAD:{Tt(this,t);break}case p.IN_HEAD:{Ct(this,t);break}case p.IN_HEAD_NO_SCRIPT:{bt(this,t);break}case p.AFTER_HEAD:{It(this,t);break}case p.IN_BODY:case p.IN_TABLE:case p.IN_CAPTION:case p.IN_COLUMN_GROUP:case p.IN_TABLE_BODY:case p.IN_ROW:case p.IN_CELL:case p.IN_SELECT:case p.IN_SELECT_IN_TABLE:{ti(this,t);break}case p.TEXT:{Jl(this,t);break}case p.IN_TABLE_TEXT:{ft(this,t);break}case p.IN_TEMPLATE:{ci(this,t);break}case p.AFTER_BODY:case p.IN_FRAMESET:case p.AFTER_FRAMESET:case p.AFTER_AFTER_BODY:case p.AFTER_AFTER_FRAMESET:{pn(this,t);break}default:}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===A.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case p.IN_HEAD:case p.IN_HEAD_NO_SCRIPT:case p.AFTER_HEAD:case p.TEXT:case p.IN_COLUMN_GROUP:case p.IN_SELECT:case p.IN_SELECT_IN_TABLE:case p.IN_FRAMESET:case p.AFTER_FRAMESET:{this._insertCharacters(t);break}case p.IN_BODY:case p.IN_CAPTION:case p.IN_CELL:case p.IN_TEMPLATE:case p.AFTER_BODY:case p.AFTER_AFTER_BODY:case p.AFTER_AFTER_FRAMESET:{Zs(this,t);break}case p.IN_TABLE:case p.IN_TABLE_BODY:case p.IN_ROW:{dn(this,t);break}case p.IN_TABLE_TEXT:{ri(this,t);break}default:}}};function Gc(e,t){let r=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return r?e.openElements.contains(r.element)?e.openElements.hasInScope(t.tagID)||(r=null):(e.activeFormattingElements.removeEntry(r),r=null):ei(e,t),r}function Kc(e,t){let r=null,n=e.openElements.stackTop;for(;n>=0;n--){let s=e.openElements.items[n];if(s===t.element)break;e._isSpecialElement(s,e.openElements.tagIDs[n])&&(r=s)}return r||(e.openElements.shortenToLength(Math.max(n,0)),e.activeFormattingElements.removeEntry(t)),r}function Wc(e,t,r){let n=t,s=e.openElements.getCommonAncestor(t);for(let a=0,c=s;c!==r;a++,c=s){s=e.openElements.getCommonAncestor(c);let l=e.activeFormattingElements.getElementEntry(c),o=l&&a>=Qc;!l||o?(o&&e.activeFormattingElements.removeEntry(l),e.openElements.remove(c)):(c=Jc(e,l),n===t&&(e.activeFormattingElements.bookmark=l),e.treeAdapter.detachNode(n),e.treeAdapter.appendChild(c,n),n=c)}return n}function Jc(e,t){let r=e.treeAdapter.getNamespaceURI(t.element),n=e.treeAdapter.createElement(t.token.tagName,r,t.token.attrs);return e.openElements.replace(t.element,n),t.element=n,n}function jc(e,t,r){let n=e.treeAdapter.getTagName(t),s=Be(n);if(e._isElementCausesFosterParenting(s))e._fosterParentElement(r);else{let a=e.treeAdapter.getNamespaceURI(t);s===i.TEMPLATE&&a===C.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,r)}}function Vc(e,t,r){let n=e.treeAdapter.getNamespaceURI(r.element),{token:s}=r,a=e.treeAdapter.createElement(s.tagName,n,s.attrs);e._adoptNodes(t,a),e.treeAdapter.appendChild(t,a),e.activeFormattingElements.insertElementAfterBookmark(a,s),e.activeFormattingElements.removeEntry(r),e.openElements.remove(r.element),e.openElements.insertAfter(t,a,s.tagID)}function hn(e,t){for(let r=0;r<Hc;r++){let n=Gc(e,t);if(!n)break;let s=Kc(e,n);if(!s)break;e.activeFormattingElements.bookmark=n;let a=Wc(e,s,n.element),c=e.openElements.getCommonAncestor(n.element);e.treeAdapter.detachNode(a),c&&jc(e,c,a),Vc(e,s,n)}}function An(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function Xc(e,t){e._appendCommentNode(t,e.openElements.items[0])}function Zc(e,t){e._appendCommentNode(t,e.document)}function pn(e,t){if(e.stopped=!0,t.location){let r=e.fragmentContext?0:2;for(let n=e.openElements.stackTop;n>=r;n--)e._setEndLocation(e.openElements.items[n],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){let n=e.openElements.items[0],s=e.treeAdapter.getNodeSourceCodeLocation(n);if(s&&!s.endTag&&(e._setEndLocation(n,t),e.openElements.stackTop>=1)){let a=e.openElements.items[1],c=e.treeAdapter.getNodeSourceCodeLocation(a);c&&!c.endTag&&e._setEndLocation(a,t)}}}}function $c(e,t){e._setDocumentType(t);let r=t.forceQuirks?$.QUIRKS:Hs(t);Us(t)||e._err(t,T.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,r),e.insertionMode=p.BEFORE_HTML}function gt(e,t){e._err(t,T.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,$.QUIRKS),e.insertionMode=p.BEFORE_HTML,e._processToken(t)}function qc(e,t){t.tagID===i.HTML?(e._insertElement(t,C.HTML),e.insertionMode=p.BEFORE_HEAD):Et(e,t)}function zc(e,t){let r=t.tagID;(r===i.HTML||r===i.HEAD||r===i.BODY||r===i.BR)&&Et(e,t)}function Et(e,t){e._insertFakeRootElement(),e.insertionMode=p.BEFORE_HEAD,e._processToken(t)}function el(e,t){switch(t.tagID){case i.HTML:{j(e,t);break}case i.HEAD:{e._insertElement(t,C.HTML),e.headElement=e.openElements.current,e.insertionMode=p.IN_HEAD;break}default:Tt(e,t)}}function tl(e,t){let r=t.tagID;r===i.HEAD||r===i.BODY||r===i.HTML||r===i.BR?Tt(e,t):e._err(t,T.endTagWithoutMatchingOpenElement)}function Tt(e,t){e._insertFakeElement(g.HEAD,i.HEAD),e.headElement=e.openElements.current,e.insertionMode=p.IN_HEAD,e._processToken(t)}function ue(e,t){switch(t.tagID){case i.HTML:{j(e,t);break}case i.BASE:case i.BASEFONT:case i.BGSOUND:case i.LINK:case i.META:{e._appendElement(t,C.HTML),t.ackSelfClosing=!0;break}case i.TITLE:{e._switchToTextParsing(t,J.RCDATA);break}case i.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,J.RAWTEXT):(e._insertElement(t,C.HTML),e.insertionMode=p.IN_HEAD_NO_SCRIPT);break}case i.NOFRAMES:case i.STYLE:{e._switchToTextParsing(t,J.RAWTEXT);break}case i.SCRIPT:{e._switchToTextParsing(t,J.SCRIPT_DATA);break}case i.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=p.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(p.IN_TEMPLATE);break}case i.HEAD:{e._err(t,T.misplacedStartTagForHeadElement);break}default:Ct(e,t)}}function rl(e,t){switch(t.tagID){case i.HEAD:{e.openElements.pop(),e.insertionMode=p.AFTER_HEAD;break}case i.BODY:case i.BR:case i.HTML:{Ct(e,t);break}case i.TEMPLATE:{ke(e,t);break}default:e._err(t,T.endTagWithoutMatchingOpenElement)}}function ke(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==i.TEMPLATE&&e._err(t,T.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(i.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,T.endTagWithoutMatchingOpenElement)}function Ct(e,t){e.openElements.pop(),e.insertionMode=p.AFTER_HEAD,e._processToken(t)}function nl(e,t){switch(t.tagID){case i.HTML:{j(e,t);break}case i.BASEFONT:case i.BGSOUND:case i.HEAD:case i.LINK:case i.META:case i.NOFRAMES:case i.STYLE:{ue(e,t);break}case i.NOSCRIPT:{e._err(t,T.nestedNoscriptInHead);break}default:bt(e,t)}}function sl(e,t){switch(t.tagID){case i.NOSCRIPT:{e.openElements.pop(),e.insertionMode=p.IN_HEAD;break}case i.BR:{bt(e,t);break}default:e._err(t,T.endTagWithoutMatchingOpenElement)}}function bt(e,t){let r=t.type===O.EOF?T.openElementsLeftAfterEof:T.disallowedContentInNoscriptInHead;e._err(t,r),e.openElements.pop(),e.insertionMode=p.IN_HEAD,e._processToken(t)}function il(e,t){switch(t.tagID){case i.HTML:{j(e,t);break}case i.BODY:{e._insertElement(t,C.HTML),e.framesetOk=!1,e.insertionMode=p.IN_BODY;break}case i.FRAMESET:{e._insertElement(t,C.HTML),e.insertionMode=p.IN_FRAMESET;break}case i.BASE:case i.BASEFONT:case i.BGSOUND:case i.LINK:case i.META:case i.NOFRAMES:case i.SCRIPT:case i.STYLE:case i.TEMPLATE:case i.TITLE:{e._err(t,T.abandonedHeadElementChild),e.openElements.push(e.headElement,i.HEAD),ue(e,t),e.openElements.remove(e.headElement);break}case i.HEAD:{e._err(t,T.misplacedStartTagForHeadElement);break}default:It(e,t)}}function al(e,t){switch(t.tagID){case i.BODY:case i.HTML:case i.BR:{It(e,t);break}case i.TEMPLATE:{ke(e,t);break}default:e._err(t,T.endTagWithoutMatchingOpenElement)}}function It(e,t){e._insertFakeElement(g.BODY,i.BODY),e.insertionMode=p.IN_BODY,dr(e,t)}function dr(e,t){switch(t.type){case O.CHARACTER:{$s(e,t);break}case O.WHITESPACE_CHARACTER:{Zs(e,t);break}case O.COMMENT:{An(e,t);break}case O.START_TAG:{j(e,t);break}case O.END_TAG:{Ar(e,t);break}case O.EOF:{ti(e,t);break}default:}}function Zs(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function $s(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function ol(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function cl(e,t){let r=e.openElements.tryPeekProperlyNestedBodyElement();r&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(r,t.attrs))}function ll(e,t){let r=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&r&&(e.treeAdapter.detachNode(r),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,C.HTML),e.insertionMode=p.IN_FRAMESET)}function dl(e,t){e.openElements.hasInButtonScope(i.P)&&e._closePElement(),e._insertElement(t,C.HTML)}function Al(e,t){e.openElements.hasInButtonScope(i.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&ht.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,C.HTML)}function ul(e,t){e.openElements.hasInButtonScope(i.P)&&e._closePElement(),e._insertElement(t,C.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function hl(e,t){let r=e.openElements.tmplCount>0;(!e.formElement||r)&&(e.openElements.hasInButtonScope(i.P)&&e._closePElement(),e._insertElement(t,C.HTML),r||(e.formElement=e.openElements.current))}function pl(e,t){e.framesetOk=!1;let r=t.tagID;for(let n=e.openElements.stackTop;n>=0;n--){let s=e.openElements.tagIDs[n];if(r===i.LI&&s===i.LI||(r===i.DD||r===i.DT)&&(s===i.DD||s===i.DT)){e.openElements.generateImpliedEndTagsWithExclusion(s),e.openElements.popUntilTagNamePopped(s);break}if(s!==i.ADDRESS&&s!==i.DIV&&s!==i.P&&e._isSpecialElement(e.openElements.items[n],s))break}e.openElements.hasInButtonScope(i.P)&&e._closePElement(),e._insertElement(t,C.HTML)}function ml(e,t){e.openElements.hasInButtonScope(i.P)&&e._closePElement(),e._insertElement(t,C.HTML),e.tokenizer.state=J.PLAINTEXT}function gl(e,t){e.openElements.hasInScope(i.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(i.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,C.HTML),e.framesetOk=!1}function fl(e,t){let r=e.activeFormattingElements.getElementEntryInScopeWithTagName(g.A);r&&(hn(e,t),e.openElements.remove(r.element),e.activeFormattingElements.removeEntry(r)),e._reconstructActiveFormattingElements(),e._insertElement(t,C.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function El(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,C.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Tl(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(i.NOBR)&&(hn(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,C.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Cl(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,C.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function bl(e,t){e.treeAdapter.getDocumentMode(e.document)!==$.QUIRKS&&e.openElements.hasInButtonScope(i.P)&&e._closePElement(),e._insertElement(t,C.HTML),e.framesetOk=!1,e.insertionMode=p.IN_TABLE}function qs(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,C.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function zs(e){let t=er(e,fe.TYPE);return t!=null&&t.toLowerCase()===Uc}function Il(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,C.HTML),zs(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function yl(e,t){e._appendElement(t,C.HTML),t.ackSelfClosing=!0}function wl(e,t){e.openElements.hasInButtonScope(i.P)&&e._closePElement(),e._appendElement(t,C.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Nl(e,t){t.tagName=g.IMG,t.tagID=i.IMG,qs(e,t)}function Sl(e,t){e._insertElement(t,C.HTML),e.skipNextNewLine=!0,e.tokenizer.state=J.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=p.TEXT}function _l(e,t){e.openElements.hasInButtonScope(i.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,J.RAWTEXT)}function xl(e,t){e.framesetOk=!1,e._switchToTextParsing(t,J.RAWTEXT)}function js(e,t){e._switchToTextParsing(t,J.RAWTEXT)}function Rl(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,C.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===p.IN_TABLE||e.insertionMode===p.IN_CAPTION||e.insertionMode===p.IN_TABLE_BODY||e.insertionMode===p.IN_ROW||e.insertionMode===p.IN_CELL?p.IN_SELECT_IN_TABLE:p.IN_SELECT}function Ll(e,t){e.openElements.currentTagId===i.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,C.HTML)}function Ol(e,t){e.openElements.hasInScope(i.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,C.HTML)}function Dl(e,t){e.openElements.hasInScope(i.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(i.RTC),e._insertElement(t,C.HTML)}function Bl(e,t){e._reconstructActiveFormattingElements(),cn(t),ar(t),t.selfClosing?e._appendElement(t,C.MATHML):e._insertElement(t,C.MATHML),t.ackSelfClosing=!0}function kl(e,t){e._reconstructActiveFormattingElements(),ln(t),ar(t),t.selfClosing?e._appendElement(t,C.SVG):e._insertElement(t,C.SVG),t.ackSelfClosing=!0}function Vs(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,C.HTML)}function j(e,t){switch(t.tagID){case i.I:case i.S:case i.B:case i.U:case i.EM:case i.TT:case i.BIG:case i.CODE:case i.FONT:case i.SMALL:case i.STRIKE:case i.STRONG:{El(e,t);break}case i.A:{fl(e,t);break}case i.H1:case i.H2:case i.H3:case i.H4:case i.H5:case i.H6:{Al(e,t);break}case i.P:case i.DL:case i.OL:case i.UL:case i.DIV:case i.DIR:case i.NAV:case i.MAIN:case i.MENU:case i.ASIDE:case i.CENTER:case i.FIGURE:case i.FOOTER:case i.HEADER:case i.HGROUP:case i.DIALOG:case i.DETAILS:case i.ADDRESS:case i.ARTICLE:case i.SEARCH:case i.SECTION:case i.SUMMARY:case i.FIELDSET:case i.BLOCKQUOTE:case i.FIGCAPTION:{dl(e,t);break}case i.LI:case i.DD:case i.DT:{pl(e,t);break}case i.BR:case i.IMG:case i.WBR:case i.AREA:case i.EMBED:case i.KEYGEN:{qs(e,t);break}case i.HR:{wl(e,t);break}case i.RB:case i.RTC:{Ol(e,t);break}case i.RT:case i.RP:{Dl(e,t);break}case i.PRE:case i.LISTING:{ul(e,t);break}case i.XMP:{_l(e,t);break}case i.SVG:{kl(e,t);break}case i.HTML:{ol(e,t);break}case i.BASE:case i.LINK:case i.META:case i.STYLE:case i.TITLE:case i.SCRIPT:case i.BGSOUND:case i.BASEFONT:case i.TEMPLATE:{ue(e,t);break}case i.BODY:{cl(e,t);break}case i.FORM:{hl(e,t);break}case i.NOBR:{Tl(e,t);break}case i.MATH:{Bl(e,t);break}case i.TABLE:{bl(e,t);break}case i.INPUT:{Il(e,t);break}case i.PARAM:case i.TRACK:case i.SOURCE:{yl(e,t);break}case i.IMAGE:{Nl(e,t);break}case i.BUTTON:{gl(e,t);break}case i.APPLET:case i.OBJECT:case i.MARQUEE:{Cl(e,t);break}case i.IFRAME:{xl(e,t);break}case i.SELECT:{Rl(e,t);break}case i.OPTION:case i.OPTGROUP:{Ll(e,t);break}case i.NOEMBED:case i.NOFRAMES:{js(e,t);break}case i.FRAMESET:{ll(e,t);break}case i.TEXTAREA:{Sl(e,t);break}case i.NOSCRIPT:{e.options.scriptingEnabled?js(e,t):Vs(e,t);break}case i.PLAINTEXT:{ml(e,t);break}case i.COL:case i.TH:case i.TD:case i.TR:case i.HEAD:case i.FRAME:case i.TBODY:case i.TFOOT:case i.THEAD:case i.CAPTION:case i.COLGROUP:break;default:Vs(e,t)}}function vl(e,t){if(e.openElements.hasInScope(i.BODY)&&(e.insertionMode=p.AFTER_BODY,e.options.sourceCodeLocationInfo)){let r=e.openElements.tryPeekProperlyNestedBodyElement();r&&e._setEndLocation(r,t)}}function Pl(e,t){e.openElements.hasInScope(i.BODY)&&(e.insertionMode=p.AFTER_BODY,li(e,t))}function Ml(e,t){let r=t.tagID;e.openElements.hasInScope(r)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(r))}function Fl(e){let t=e.openElements.tmplCount>0,{formElement:r}=e;t||(e.formElement=null),(r||t)&&e.openElements.hasInScope(i.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(i.FORM):r&&e.openElements.remove(r))}function Ul(e){e.openElements.hasInButtonScope(i.P)||e._insertFakeElement(g.P,i.P),e._closePElement()}function Hl(e){e.openElements.hasInListItemScope(i.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(i.LI),e.openElements.popUntilTagNamePopped(i.LI))}function Ql(e,t){let r=t.tagID;e.openElements.hasInScope(r)&&(e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.popUntilTagNamePopped(r))}function Yl(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function Gl(e,t){let r=t.tagID;e.openElements.hasInScope(r)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(r),e.activeFormattingElements.clearToLastMarker())}function Kl(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(g.BR,i.BR),e.openElements.pop(),e.framesetOk=!1}function ei(e,t){let r=t.tagName,n=t.tagID;for(let s=e.openElements.stackTop;s>0;s--){let a=e.openElements.items[s],c=e.openElements.tagIDs[s];if(n===c&&(n!==i.UNKNOWN||e.treeAdapter.getTagName(a)===r)){e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.stackTop>=s&&e.openElements.shortenToLength(s);break}if(e._isSpecialElement(a,c))break}}function Ar(e,t){switch(t.tagID){case i.A:case i.B:case i.I:case i.S:case i.U:case i.EM:case i.TT:case i.BIG:case i.CODE:case i.FONT:case i.NOBR:case i.SMALL:case i.STRIKE:case i.STRONG:{hn(e,t);break}case i.P:{Ul(e);break}case i.DL:case i.UL:case i.OL:case i.DIR:case i.DIV:case i.NAV:case i.PRE:case i.MAIN:case i.MENU:case i.ASIDE:case i.BUTTON:case i.CENTER:case i.FIGURE:case i.FOOTER:case i.HEADER:case i.HGROUP:case i.DIALOG:case i.ADDRESS:case i.ARTICLE:case i.DETAILS:case i.SEARCH:case i.SECTION:case i.SUMMARY:case i.LISTING:case i.FIELDSET:case i.BLOCKQUOTE:case i.FIGCAPTION:{Ml(e,t);break}case i.LI:{Hl(e);break}case i.DD:case i.DT:{Ql(e,t);break}case i.H1:case i.H2:case i.H3:case i.H4:case i.H5:case i.H6:{Yl(e);break}case i.BR:{Kl(e);break}case i.BODY:{vl(e,t);break}case i.HTML:{Pl(e,t);break}case i.FORM:{Fl(e);break}case i.APPLET:case i.OBJECT:case i.MARQUEE:{Gl(e,t);break}case i.TEMPLATE:{ke(e,t);break}default:ei(e,t)}}function ti(e,t){e.tmplInsertionModeStack.length>0?ci(e,t):pn(e,t)}function Wl(e,t){var r;t.tagID===i.SCRIPT&&((r=e.scriptHandler)===null||r===void 0||r.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function Jl(e,t){e._err(t,T.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function dn(e,t){if(e.openElements.currentTagId!==void 0&&Xs.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=p.IN_TABLE_TEXT,t.type){case O.CHARACTER:{ni(e,t);break}case O.WHITESPACE_CHARACTER:{ri(e,t);break}}else Nt(e,t)}function jl(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,C.HTML),e.insertionMode=p.IN_CAPTION}function Vl(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,C.HTML),e.insertionMode=p.IN_COLUMN_GROUP}function Xl(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(g.COLGROUP,i.COLGROUP),e.insertionMode=p.IN_COLUMN_GROUP,mn(e,t)}function Zl(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,C.HTML),e.insertionMode=p.IN_TABLE_BODY}function $l(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(g.TBODY,i.TBODY),e.insertionMode=p.IN_TABLE_BODY,ur(e,t)}function ql(e,t){e.openElements.hasInTableScope(i.TABLE)&&(e.openElements.popUntilTagNamePopped(i.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function zl(e,t){zs(t)?e._appendElement(t,C.HTML):Nt(e,t),t.ackSelfClosing=!0}function ed(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,C.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function Ve(e,t){switch(t.tagID){case i.TD:case i.TH:case i.TR:{$l(e,t);break}case i.STYLE:case i.SCRIPT:case i.TEMPLATE:{ue(e,t);break}case i.COL:{Xl(e,t);break}case i.FORM:{ed(e,t);break}case i.TABLE:{ql(e,t);break}case i.TBODY:case i.TFOOT:case i.THEAD:{Zl(e,t);break}case i.INPUT:{zl(e,t);break}case i.CAPTION:{jl(e,t);break}case i.COLGROUP:{Vl(e,t);break}default:Nt(e,t)}}function wt(e,t){switch(t.tagID){case i.TABLE:{e.openElements.hasInTableScope(i.TABLE)&&(e.openElements.popUntilTagNamePopped(i.TABLE),e._resetInsertionMode());break}case i.TEMPLATE:{ke(e,t);break}case i.BODY:case i.CAPTION:case i.COL:case i.COLGROUP:case i.HTML:case i.TBODY:case i.TD:case i.TFOOT:case i.TH:case i.THEAD:case i.TR:break;default:Nt(e,t)}}function Nt(e,t){let r=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,dr(e,t),e.fosterParentingEnabled=r}function ri(e,t){e.pendingCharacterTokens.push(t)}function ni(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function ft(e,t){let r=0;if(e.hasNonWhitespacePendingCharacterToken)for(;r<e.pendingCharacterTokens.length;r++)Nt(e,e.pendingCharacterTokens[r]);else for(;r<e.pendingCharacterTokens.length;r++)e._insertCharacters(e.pendingCharacterTokens[r]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}var si=new Set([i.CAPTION,i.COL,i.COLGROUP,i.TBODY,i.TD,i.TFOOT,i.TH,i.THEAD,i.TR]);function td(e,t){let r=t.tagID;si.has(r)?e.openElements.hasInTableScope(i.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(i.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=p.IN_TABLE,Ve(e,t)):j(e,t)}function rd(e,t){let r=t.tagID;switch(r){case i.CAPTION:case i.TABLE:{e.openElements.hasInTableScope(i.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(i.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=p.IN_TABLE,r===i.TABLE&&wt(e,t));break}case i.BODY:case i.COL:case i.COLGROUP:case i.HTML:case i.TBODY:case i.TD:case i.TFOOT:case i.TH:case i.THEAD:case i.TR:break;default:Ar(e,t)}}function mn(e,t){switch(t.tagID){case i.HTML:{j(e,t);break}case i.COL:{e._appendElement(t,C.HTML),t.ackSelfClosing=!0;break}case i.TEMPLATE:{ue(e,t);break}default:cr(e,t)}}function nd(e,t){switch(t.tagID){case i.COLGROUP:{e.openElements.currentTagId===i.COLGROUP&&(e.openElements.pop(),e.insertionMode=p.IN_TABLE);break}case i.TEMPLATE:{ke(e,t);break}case i.COL:break;default:cr(e,t)}}function cr(e,t){e.openElements.currentTagId===i.COLGROUP&&(e.openElements.pop(),e.insertionMode=p.IN_TABLE,e._processToken(t))}function ur(e,t){switch(t.tagID){case i.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,C.HTML),e.insertionMode=p.IN_ROW;break}case i.TH:case i.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(g.TR,i.TR),e.insertionMode=p.IN_ROW,hr(e,t);break}case i.CAPTION:case i.COL:case i.COLGROUP:case i.TBODY:case i.TFOOT:case i.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=p.IN_TABLE,Ve(e,t));break}default:Ve(e,t)}}function un(e,t){let r=t.tagID;switch(t.tagID){case i.TBODY:case i.TFOOT:case i.THEAD:{e.openElements.hasInTableScope(r)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=p.IN_TABLE);break}case i.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=p.IN_TABLE,wt(e,t));break}case i.BODY:case i.CAPTION:case i.COL:case i.COLGROUP:case i.HTML:case i.TD:case i.TH:case i.TR:break;default:wt(e,t)}}function hr(e,t){switch(t.tagID){case i.TH:case i.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,C.HTML),e.insertionMode=p.IN_CELL,e.activeFormattingElements.insertMarker();break}case i.CAPTION:case i.COL:case i.COLGROUP:case i.TBODY:case i.TFOOT:case i.THEAD:case i.TR:{e.openElements.hasInTableScope(i.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=p.IN_TABLE_BODY,ur(e,t));break}default:Ve(e,t)}}function ii(e,t){switch(t.tagID){case i.TR:{e.openElements.hasInTableScope(i.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=p.IN_TABLE_BODY);break}case i.TABLE:{e.openElements.hasInTableScope(i.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=p.IN_TABLE_BODY,un(e,t));break}case i.TBODY:case i.TFOOT:case i.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(i.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=p.IN_TABLE_BODY,un(e,t));break}case i.BODY:case i.CAPTION:case i.COL:case i.COLGROUP:case i.HTML:case i.TD:case i.TH:break;default:wt(e,t)}}function sd(e,t){let r=t.tagID;si.has(r)?(e.openElements.hasInTableScope(i.TD)||e.openElements.hasInTableScope(i.TH))&&(e._closeTableCell(),hr(e,t)):j(e,t)}function id(e,t){let r=t.tagID;switch(r){case i.TD:case i.TH:{e.openElements.hasInTableScope(r)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(r),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=p.IN_ROW);break}case i.TABLE:case i.TBODY:case i.TFOOT:case i.THEAD:case i.TR:{e.openElements.hasInTableScope(r)&&(e._closeTableCell(),ii(e,t));break}case i.BODY:case i.CAPTION:case i.COL:case i.COLGROUP:case i.HTML:break;default:Ar(e,t)}}function ai(e,t){switch(t.tagID){case i.HTML:{j(e,t);break}case i.OPTION:{e.openElements.currentTagId===i.OPTION&&e.openElements.pop(),e._insertElement(t,C.HTML);break}case i.OPTGROUP:{e.openElements.currentTagId===i.OPTION&&e.openElements.pop(),e.openElements.currentTagId===i.OPTGROUP&&e.openElements.pop(),e._insertElement(t,C.HTML);break}case i.HR:{e.openElements.currentTagId===i.OPTION&&e.openElements.pop(),e.openElements.currentTagId===i.OPTGROUP&&e.openElements.pop(),e._appendElement(t,C.HTML),t.ackSelfClosing=!0;break}case i.INPUT:case i.KEYGEN:case i.TEXTAREA:case i.SELECT:{e.openElements.hasInSelectScope(i.SELECT)&&(e.openElements.popUntilTagNamePopped(i.SELECT),e._resetInsertionMode(),t.tagID!==i.SELECT&&e._processStartTag(t));break}case i.SCRIPT:case i.TEMPLATE:{ue(e,t);break}default:}}function oi(e,t){switch(t.tagID){case i.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===i.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===i.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===i.OPTGROUP&&e.openElements.pop();break}case i.OPTION:{e.openElements.currentTagId===i.OPTION&&e.openElements.pop();break}case i.SELECT:{e.openElements.hasInSelectScope(i.SELECT)&&(e.openElements.popUntilTagNamePopped(i.SELECT),e._resetInsertionMode());break}case i.TEMPLATE:{ke(e,t);break}default:}}function ad(e,t){let r=t.tagID;r===i.CAPTION||r===i.TABLE||r===i.TBODY||r===i.TFOOT||r===i.THEAD||r===i.TR||r===i.TD||r===i.TH?(e.openElements.popUntilTagNamePopped(i.SELECT),e._resetInsertionMode(),e._processStartTag(t)):ai(e,t)}function od(e,t){let r=t.tagID;r===i.CAPTION||r===i.TABLE||r===i.TBODY||r===i.TFOOT||r===i.THEAD||r===i.TR||r===i.TD||r===i.TH?e.openElements.hasInTableScope(r)&&(e.openElements.popUntilTagNamePopped(i.SELECT),e._resetInsertionMode(),e.onEndTag(t)):oi(e,t)}function cd(e,t){switch(t.tagID){case i.BASE:case i.BASEFONT:case i.BGSOUND:case i.LINK:case i.META:case i.NOFRAMES:case i.SCRIPT:case i.STYLE:case i.TEMPLATE:case i.TITLE:{ue(e,t);break}case i.CAPTION:case i.COLGROUP:case i.TBODY:case i.TFOOT:case i.THEAD:{e.tmplInsertionModeStack[0]=p.IN_TABLE,e.insertionMode=p.IN_TABLE,Ve(e,t);break}case i.COL:{e.tmplInsertionModeStack[0]=p.IN_COLUMN_GROUP,e.insertionMode=p.IN_COLUMN_GROUP,mn(e,t);break}case i.TR:{e.tmplInsertionModeStack[0]=p.IN_TABLE_BODY,e.insertionMode=p.IN_TABLE_BODY,ur(e,t);break}case i.TD:case i.TH:{e.tmplInsertionModeStack[0]=p.IN_ROW,e.insertionMode=p.IN_ROW,hr(e,t);break}default:e.tmplInsertionModeStack[0]=p.IN_BODY,e.insertionMode=p.IN_BODY,j(e,t)}}function ld(e,t){t.tagID===i.TEMPLATE&&ke(e,t)}function ci(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(i.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):pn(e,t)}function dd(e,t){t.tagID===i.HTML?j(e,t):lr(e,t)}function li(e,t){var r;if(t.tagID===i.HTML){if(e.fragmentContext||(e.insertionMode=p.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===i.HTML){e._setEndLocation(e.openElements.items[0],t);let n=e.openElements.items[1];n&&!(!((r=e.treeAdapter.getNodeSourceCodeLocation(n))===null||r===void 0)&&r.endTag)&&e._setEndLocation(n,t)}}else lr(e,t)}function lr(e,t){e.insertionMode=p.IN_BODY,dr(e,t)}function Ad(e,t){switch(t.tagID){case i.HTML:{j(e,t);break}case i.FRAMESET:{e._insertElement(t,C.HTML);break}case i.FRAME:{e._appendElement(t,C.HTML),t.ackSelfClosing=!0;break}case i.NOFRAMES:{ue(e,t);break}default:}}function ud(e,t){t.tagID===i.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==i.FRAMESET&&(e.insertionMode=p.AFTER_FRAMESET))}function hd(e,t){switch(t.tagID){case i.HTML:{j(e,t);break}case i.NOFRAMES:{ue(e,t);break}default:}}function pd(e,t){t.tagID===i.HTML&&(e.insertionMode=p.AFTER_AFTER_FRAMESET)}function md(e,t){t.tagID===i.HTML?j(e,t):or(e,t)}function or(e,t){e.insertionMode=p.IN_BODY,dr(e,t)}function gd(e,t){switch(t.tagID){case i.HTML:{j(e,t);break}case i.NOFRAMES:{ue(e,t);break}default:}}function fd(e,t){t.chars=B,e._insertCharacters(t)}function Ed(e,t){e._insertCharacters(t),e.framesetOk=!1}function di(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==C.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function Td(e,t){if(Ys(t))di(e),e._startTagOutsideForeignContent(t);else{let r=e._getAdjustedCurrentElement(),n=e.treeAdapter.getNamespaceURI(r);n===C.MATHML?cn(t):n===C.SVG&&(Gs(t),ln(t)),ar(t),t.selfClosing?e._appendElement(t,n):e._insertElement(t,n),t.ackSelfClosing=!0}}function Cd(e,t){if(t.tagID===i.P||t.tagID===i.BR){di(e),e._endTagOutsideForeignContent(t);return}for(let r=e.openElements.stackTop;r>0;r--){let n=e.openElements.items[r];if(e.treeAdapter.getNamespaceURI(n)===C.HTML){e._endTagOutsideForeignContent(t);break}let s=e.treeAdapter.getTagName(n);if(s.toLowerCase()===t.tagName){t.tagName=s,e.openElements.shortenToLength(r);break}}}var om=new Set([g.AREA,g.BASE,g.BASEFONT,g.BGSOUND,g.BR,g.COL,g.EMBED,g.FRAME,g.HR,g.IMG,g.INPUT,g.KEYGEN,g.LINK,g.META,g.PARAM,g.SOURCE,g.TRACK,g.WBR]);function Ai(e,t){return yt.parse(e,t)}function ie(e,t){return e.attrs?.find(r=>r.name.toLowerCase()===t.toLowerCase())?.value??null}function gn(e){return e.nodeName==="#text"?e.value??"":(e.childNodes??[]).map(gn).join("")}function Ce(e){return e?.replace(/\s+/g," ").trim()||null}function fn(e){let t=Ai(e),r={title:null,description:null,canonical:null,robots:null,lang:null,h1Count:0,openGraph:{title:null,description:null,image:null},twitter:{card:null,title:null,description:null,image:null},hreflang:[],jsonLd:[],images:[],links:[],wordCount:0,visibleText:""},n=[];function s(a,c=!1){let l=a.tagName?.toLowerCase(),o=c||l==="script"||l==="style"||l==="noscript"||l==="template";if(a.nodeName==="#text"&&!o){let d=Ce(a.value);d&&n.push(d)}if(l==="html"&&r.lang===null&&(r.lang=Ce(ie(a,"lang"))),l==="title"&&r.title===null&&(r.title=Ce(gn(a))),l==="h1"&&(r.h1Count+=1),l==="meta"){let d=ie(a,"name")?.toLowerCase(),h=ie(a,"property")?.toLowerCase(),m=Ce(ie(a,"content"));d==="description"&&r.description===null?r.description=m:d==="robots"&&r.robots===null?r.robots=m:h==="og:title"&&r.openGraph.title===null?r.openGraph.title=m:h==="og:description"&&r.openGraph.description===null?r.openGraph.description=m:h==="og:image"&&r.openGraph.image===null?r.openGraph.image=m:d==="twitter:card"&&r.twitter.card===null?r.twitter.card=m:d==="twitter:title"&&r.twitter.title===null?r.twitter.title=m:d==="twitter:description"&&r.twitter.description===null?r.twitter.description=m:d==="twitter:image"&&r.twitter.image===null&&(r.twitter.image=m)}if(l==="link"){let d=ie(a,"rel")?.toLowerCase().split(/\s+/).filter(Boolean)??[];if(d.includes("canonical")&&r.canonical===null&&(r.canonical=Ce(ie(a,"href"))),d.includes("alternate")){let h=Ce(ie(a,"hreflang")),m=Ce(ie(a,"href"));h&&m&&r.hreflang.push({lang:h,url:m})}}if(l==="a"){let d=ie(a,"href");d&&r.links.push(d)}if(l==="img"&&r.images.push({src:Ce(ie(a,"src")),alt:ie(a,"alt")}),l==="script"&&ie(a,"type")?.toLowerCase()==="application/ld+json"){let d=gn(a).trim();if(d)try{r.jsonLd.push({valid:!0,value:JSON.parse(d)})}catch(h){r.jsonLd.push({valid:!1,error:h instanceof Error?h.message:String(h)})}}for(let d of a.childNodes??[])s(d,o)}return s(t),r.visibleText=n.join(" "),r.wordCount=r.visibleText?r.visibleText.split(/\s+/u).length:0,r}function bd(e,t){return{url:e,finalUrl:null,status:null,contentType:null,blockedByRobots:!1,error:null,title:null,description:null,canonical:null,canonicalRaw:null,robots:null,xRobotsTag:null,lang:null,h1Count:0,openGraph:{title:null,description:null,image:null},twitter:{card:null,title:null,description:null,image:null},hreflang:[],jsonLd:[],images:[],links:[],internalLinks:[],externalLinks:[],wordCount:0,contentHash:null,depth:t,redirectChain:[],responseBytes:0}}async function Xe(e,t){await e.onEvent?.(t)}async function Id(e,t,r,n,s){let a=bd(e,t);if(n.respectRobots&&!Wn(e,s))return a.blockedByRobots=!0,a;try{if(n.renderer){n.signal?.throwIfAborted(),await n.requestGate(e);let S=await n.renderer.render({url:e,timeout:n.timeout,maxResponseBytes:n.maxResponseBytes,userAgent:n.userAgent,...n.signal?{signal:n.signal}:{}});return yd(a,S,e,r,n.includeQuery)}let{response:c,redirectChain:l}=await xe(e,{headers:{accept:"text/html,application/xhtml+xml;q=0.9,*/*;q=0.1","user-agent":n.userAgent}},{...n,gate:n.requestGate,onEvent:n.onEvent}),o=c.headers.get("content-type")??"",d=o.includes("text/html")||o.includes("application/xhtml+xml"),h=Q(c.url,void 0,{includeQuery:n.includeQuery});if(a.finalUrl=h,a.status=c.status,a.contentType=o||null,a.xRobotsTag=c.headers.get("x-robots-tag"),a.redirectChain=l,!d)return await c.body?.cancel(),a;let{text:m,bytes:E}=await Re(c,n.maxResponseBytes),f=fn(m),y=h??e,w=f.canonical?Q(f.canonical,y,{includeQuery:!0}):null,I=[...new Set(f.links.map(S=>Q(S,y,{includeQuery:n.includeQuery})).filter(S=>!!S))].sort(),_=f.hreflang.map(S=>({lang:S.lang,url:Q(S.url,y,{includeQuery:!0})}));return Object.assign(a,{...f,visibleText:void 0,canonical:w,canonicalRaw:f.canonical,links:I,internalLinks:I.filter(S=>ce(S,r)),externalLinks:I.filter(S=>!ce(S,r)),hreflang:_,contentHash:f.visibleText?ui("sha256").update(f.visibleText.toLowerCase()).digest("hex"):null,responseBytes:E}),a}catch(c){if(n.signal?.aborted)throw c;return a.error=c instanceof Error?c.message:String(c),c instanceof pe&&(a.redirectChain=c.redirectChain),a}}function yd(e,t,r,n,s){let a=t.headers["content-type"]??"text/html",c=Q(t.finalUrl,void 0,{includeQuery:s});if(e.finalUrl=c,e.status=t.status,e.contentType=a,e.xRobotsTag=t.headers["x-robots-tag"]??null,e.redirectChain=t.redirectChain,!a.includes("text/html")&&!a.includes("application/xhtml+xml"))return e;let l=fn(t.html),o=c??r,d=l.canonical?Q(l.canonical,o,{includeQuery:!0}):null,h=[...new Set(l.links.map(m=>Q(m,o,{includeQuery:s})).filter(m=>!!m))].sort();return Object.assign(e,{...l,visibleText:void 0,canonical:d,canonicalRaw:l.canonical,links:h,internalLinks:h.filter(m=>ce(m,n)),externalLinks:h.filter(m=>!ce(m,n)),hreflang:l.hreflang.map(m=>({lang:m.lang,url:Q(m.url,o,{includeQuery:!0})})),contentHash:l.visibleText?ui("sha256").update(l.visibleText.toLowerCase()).digest("hex"):null,responseBytes:t.responseBytes}),e}function wd(e={}){let t=e.requestDelay??e.delay??100,r=e.requestGate;return{...e,maxPages:e.maxPages??100,concurrency:Math.max(1,e.concurrency??5),timeout:e.timeout??1e4,includeQuery:e.includeQuery??!1,respectRobots:e.respectRobots??!0,sitemap:e.sitemap??null,sitemapData:e.sitemapData??null,userAgent:e.userAgent??ye,requestDelay:t,requestGate:r?async n=>r(n):Fe(t),maxRedirects:e.maxRedirects??10,maxResponseBytes:e.maxResponseBytes??5*1024*1024,retries:e.retries??2,fetch:e.fetch??globalThis.fetch,logger:e.logger??Pt}}async function Nd(e,t){let r=[],n=Array.from({length:e},async()=>{for(;;){let s=await t();if(s===null)return;r.push(s)}});return await Promise.all(n),r}async function hi(e,t={}){let r=Date.now(),n=wd(t),s=Q(e,void 0,{includeQuery:n.includeQuery});if(!s)throw new Error(`invalid start URL: ${e}`);let a=new URL(s).origin;await Xe(n,{type:"scan-start",url:s,total:n.maxPages});let c=t.robots??await Mt(s,n),l=n.sitemapData;if(!l&&n.sitemap)try{l=await Xt(n.sitemap,{...n,maxUrls:t.sitemapMaxUrls??5e4,siteOrigin:a})}catch(R){l={url:n.sitemap,urls:[],sitemapCount:0,truncated:!1,error:R instanceof Error?R.message:String(R)},n.logger.warn(`Could not load sitemap ${n.sitemap}: ${l.error}`)}let d=[...new Set([s,...l?.urls??[]])].slice(0,n.maxPages).map(R=>({url:R,depth:0})),h=new Set(d.map(R=>R.url)),m=new Map((t.cachedPages??[]).map(R=>[R.url,R])),E=new Map,f=Math.max(n.maxPages*10,n.maxPages),y=!1;for(;d.length>0&&E.size<n.maxPages&&!n.signal?.aborted;){d.sort((F,v)=>F.url.localeCompare(v.url));let R=n.maxPages-E.size,U=d.slice(0,R);d.length>U.length&&(y=!0);let x=0,k=await Nd(n.concurrency,async()=>{if(n.signal?.aborted||x>=U.length)return null;let F=U[x++];if(!F)return null;let v=m.get(F.url);if(!v)try{v=await Id(F.url,F.depth,a,n,c)}catch(D){if(n.signal?.aborted)return null;throw D}return E.set(F.url,v),m.has(F.url)||(await t.onBatch?.([v]),await n.storage?.saveCheckpoint?.(s,v),await Xe(n,{type:"checkpoint",page:v,completed:E.size,total:n.maxPages})),t.onProgress?.(E.size,n.maxPages),await Xe(n,{type:"page",completed:E.size,total:n.maxPages,page:v}),await Xe(n,{type:"progress",completed:E.size,total:n.maxPages,page:v}),{item:F,page:v}}),Y=new Map;for(let{item:F,page:v}of k.sort((D,N)=>D.item.url.localeCompare(N.item.url))){let D=v.internalLinks?.length?v.internalLinks:(v.links??[]).filter(N=>ce(N,a));for(let N of[...D].sort())h.size>=f||h.has(N)||!jt(N)||(h.add(N),Y.set(N,{url:N,depth:F.depth+1}))}d=[...Y.values()]}let w=[...E.values()].sort((R,U)=>R.url.localeCompare(U.url)),I=!!n.signal?.aborted,_=I||y||d.length>0||(l?l.urls.length>w.length:!1)||(l?.truncated??!1),S={startUrl:s,pages:w,robots:c,sitemap:l,truncated:_,partial:I,durationMs:Date.now()-r,options:n};return S.snapshot=Ee(S),I||await n.storage?.removeCheckpoint?.(s),I?await Xe(n,{type:"cancelled",completed:w.length,total:n.maxPages,partial:!0}):await Xe(n,{type:"complete",completed:w.length,total:n.maxPages}),S}function pi(e){return"planVersion"in e}function Sd(e,t){return{schemaVersion:2,pageSchemaVersion:1,siteUrl:e.startUrl,sitemapUrl:e.sitemap?.url??null,includeQuery:e.config.includeQuery,respectRobots:e.config.respectRobots,timeout:e.config.timeout,maxRedirects:e.config.maxRedirects,maxResponseBytes:e.config.maxResponseBytes,userAgent:e.userAgent,...t?{rendererId:t}:{}}}function _d(e){return!e.error&&(e.status===null||e.status<500)}async function Ze(e,t={}){let r=null,n=null,s;try{s=pi(e)?e:await le(e,{...t,async onEvent(f){f.type==="robots"&&(r=f.robots),f.type==="sitemap"&&(n=f.sitemap),await t.onEvent?.(f)}})}catch(f){if(pi(e)||!t.signal?.aborted)throw f;let y=ge(e),w=Q(y.url,void 0,{includeQuery:y.includeQuery});if(!w)throw new Error(`invalid start URL: ${y.url}`,{cause:f});let I=r??{url:new URL("/robots.txt",w).href,status:null,sha256:null,error:"Scan cancelled before robots.txt planning completed",denyAll:!1},_=Ee({startUrl:w,pages:[],robots:I,sitemap:n,options:y,partial:!0,truncated:!0});return await t.checkpointStore?.flush?.(),await t.onEvent?.({type:"cancelled",completed:0,total:y.maxPages,partial:!0}),{snapshot:_,startUrl:w,pages:[],robots:I,sitemap:n,truncated:!0,partial:!0,durationMs:0,options:y}}if(s.planVersion!==1)throw new Error(`unsupported scan plan version: ${String(s.planVersion)}`);let a=t.limit??s.config.maxPages;if(!Number.isInteger(a)||a<=0)throw new Error("scan limit must be a positive integer");let c={...s.config,maxPages:a},l=Fe(c.delay),o=Sd(s,t.renderer?.id),d=t.checkpointStore&&t.resume!==!1?await t.checkpointStore.load(o):null,h=[...t.cachedPages??[],...d?.pages.filter(_d)??[]],m=[...new Map(h.map(f=>[f.url,f])).values()];m.length>0&&await t.onEvent?.({type:"resume",completed:m.length,total:a});let E=await hi(s.startUrl,{...t,maxPages:a,concurrency:c.concurrency,requestDelay:c.delay,timeout:c.timeout,respectRobots:c.respectRobots,includeQuery:c.includeQuery,maxRedirects:c.maxRedirects,maxResponseBytes:c.maxResponseBytes,enabledRules:c.enabledRules,severityOverrides:c.severityOverrides,suppressions:c.suppressions,regressionBudgets:c.regressionBudgets,report:c.report,requestGate:l,robots:s.robots,sitemap:s.sitemap?.url??null,sitemapData:s.sitemap,userAgent:s.userAgent,cachedPages:m,async onBatch(f){for(let y of f)await t.checkpointStore?.append(o,y);await t.onBatch?.(f)}});return await t.checkpointStore?.flush?.(),!E.partial&&!t.retainCheckpoint&&await t.checkpointStore?.clear(o),E}function mi(e){return/^\d+$/.test(e)?":id":/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)?":uuid":/^\d{4}-\d{2}-\d{2}$/.test(e)?":date":/^[0-9a-f]{16,}$/i.test(e)?":hash":null}function xd(e){return e.flatMap(t=>{try{let r=new URL(t.url);return[{issue:t,url:r,segments:r.pathname.split("/").filter(Boolean)}]}catch{return[]}})}function Rd(e){let t=new Map;for(let r of e)for(let n=1;n<r.segments.length;n+=1){if(mi(r.segments[n]))continue;let s=r.segments.slice(0,n).join("/"),a=`${r.url.origin}|${r.segments.length}|${n}|${s}`,c=t.get(a)??new Set;c.add(r.segments[n]),t.set(a,c)}return new Set([...t].filter(([,r])=>r.size>=2).map(([r])=>r))}function Ld(e,t){let r=e.segments.map((n,s)=>{let a=mi(n);if(a)return a;let c=e.segments.slice(0,s).join("/"),l=`${e.url.origin}|${e.segments.length}|${s}|${c}`;return s>0&&t.has(l)?":slug":n});return`/${r.join("/")}${e.url.pathname.endsWith("/")&&r.length>0?"/":""}`}function En(e){let t=xd(e),r=Rd(t),n=new Map;for(let s of t){let a=Ld(s,r),c=`${s.url.origin}${a}`,l=n.get(c)??{origin:s.url.origin,template:a,issues:[],urls:new Set};l.issues.push(s.issue),l.urls.add(s.issue.url),n.set(c,l)}return[...n.values()].map(s=>{let a={error:0,warning:0,info:0},c={},l={};for(let d of s.issues)a[d.severity]+=1,c[d.ruleId]=(c[d.ruleId]??0)+1,l[d.owner]=(l[d.owner]??0)+1;let o=[...s.urls].sort();return{origin:s.origin,template:s.template,issueCount:s.issues.length,affectedPages:o.length,severities:a,rules:c,owners:l,urls:o,representativeUrls:o.slice(0,3)}}).sort((s,a)=>a.issueCount-s.issueCount||s.template.localeCompare(a.template)||s.origin.localeCompare(a.origin))}function gi(e){let t=e.replaceAll("-"," ");return t.charAt(0).toUpperCase()+t.slice(1)}var Od={"page-unreachable":"\u041D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0430 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0430","http-error":"HTTP-\u043F\u043E\u043C\u0438\u043B\u043A\u0430",noindex:"Noindex","x-robots-noindex":"Noindex \u0443 X-Robots-Tag","robots-blocked":"\u0417\u0430\u0431\u043B\u043E\u043A\u043E\u0432\u0430\u043D\u043E robots.txt","missing-canonical":"\u0412\u0456\u0434\u0441\u0443\u0442\u043D\u0456\u0439 canonical","invalid-canonical":"\u041D\u0435\u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0438\u0439 canonical","cross-domain-canonical":"Canonical \u043D\u0430 \u0456\u043D\u0448\u043E\u043C\u0443 \u0434\u043E\u043C\u0435\u043D\u0456","canonical-target-error":"\u041F\u043E\u043C\u0438\u043B\u043A\u0430 \u0446\u0456\u043B\u0456 canonical","redirect-loop":"\u0426\u0438\u043A\u043B \u043F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u044C","long-redirect-chain":"\u0414\u043E\u0432\u0433\u0438\u0439 \u043B\u0430\u043D\u0446\u044E\u0436\u043E\u043A \u043F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u044C","sitemap-unavailable":"Sitemap \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0438\u0439","noindex-in-sitemap":"Noindex \u0443 sitemap","redirect-in-sitemap":"\u041F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u043D\u044F \u0443 sitemap","missing-title":"\u0412\u0456\u0434\u0441\u0443\u0442\u043D\u0456\u0439 title","duplicate-title":"\u0414\u0443\u0431\u043B\u044C\u043E\u0432\u0430\u043D\u0438\u0439 title","title-length":"\u0414\u043E\u0432\u0436\u0438\u043D\u0430 title","missing-description":"\u0412\u0456\u0434\u0441\u0443\u0442\u043D\u0456\u0439 description","duplicate-description":"\u0414\u0443\u0431\u043B\u044C\u043E\u0432\u0430\u043D\u0438\u0439 description","description-length":"\u0414\u043E\u0432\u0436\u0438\u043D\u0430 description","missing-h1":"\u0412\u0456\u0434\u0441\u0443\u0442\u043D\u0456\u0439 H1","broken-internal-link":"\u041D\u0435\u0440\u043E\u0431\u043E\u0447\u0435 \u0432\u043D\u0443\u0442\u0440\u0456\u0448\u043D\u0454 \u043F\u043E\u0441\u0438\u043B\u0430\u043D\u043D\u044F","orphan-sitemap-page":"\u0406\u0437\u043E\u043B\u044C\u043E\u0432\u0430\u043D\u0430 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0430 sitemap","crawlable-not-in-sitemap":"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u0432\u0456\u0434\u0441\u0443\u0442\u043D\u044F \u0443 sitemap","invalid-hreflang":"\u041D\u0435\u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0438\u0439 hreflang","malformed-json-ld":"\u041D\u0435\u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0438\u0439 JSON-LD","http-on-https-site":"HTTP URL \u043D\u0430 HTTPS-\u0441\u0430\u0439\u0442\u0456","invalid-language":"\u041D\u0435\u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0435 \u043E\u0433\u043E\u043B\u043E\u0448\u0435\u043D\u043D\u044F \u043C\u043E\u0432\u0438","duplicate-content":"\u0414\u0443\u0431\u043B\u044C\u043E\u0432\u0430\u043D\u0438\u0439 \u043A\u043E\u043D\u0442\u0435\u043D\u0442","multiple-h1":"\u041A\u0456\u043B\u044C\u043A\u0430 H1","missing-open-graph":"\u041D\u0435\u043F\u043E\u0432\u043D\u0456 Open Graph metadata","missing-twitter-metadata":"\u041D\u0435\u043F\u043E\u0432\u043D\u0456 Twitter metadata","image-missing-alt":"\u0417\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u043D\u044F \u0431\u0435\u0437 alt","low-word-count":"\u041C\u0430\u043B\u043E \u0442\u0435\u043A\u0441\u0442\u0443","robots-changed":"robots.txt \u0437\u043C\u0456\u043D\u0435\u043D\u043E","page-missing":"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0443 \u043D\u0435 \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u0435\u043D\u043E","status-regression":"\u0420\u0435\u0433\u0440\u0435\u0441\u0456\u044F HTTP-\u0441\u0442\u0430\u0442\u0443\u0441\u0443","new-noindex":"\u041D\u043E\u0432\u0438\u0439 noindex","title-removed":"Title \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u043E","title-changed":"Title \u0437\u043C\u0456\u043D\u0435\u043D\u043E","description-removed":"Description \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u043E","canonical-removed":"Canonical \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u043E","canonical-changed":"Canonical \u0437\u043C\u0456\u043D\u0435\u043D\u043E","h1-removed":"H1 \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u043E","redirect-changed":"\u041F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u043D\u044F \u0437\u043C\u0456\u043D\u0435\u043D\u043E","sitemap-url-count-drop":"\u0417\u043C\u0435\u043D\u0448\u0435\u043D\u043D\u044F URL \u0443 sitemap"},Dd={"page-unreachable":"\u0412\u0456\u0434\u043D\u043E\u0432\u0456\u0442\u044C \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443 \u0430\u0431\u043E \u043F\u0440\u0438\u0431\u0435\u0440\u0456\u0442\u044C \u043F\u043E\u0441\u0438\u043B\u0430\u043D\u043D\u044F \u043D\u0430 \u043D\u0435\u0457.","http-error":"\u041F\u043E\u0432\u0435\u0440\u043D\u0456\u0442\u044C \u0443\u0441\u043F\u0456\u0448\u043D\u0443 \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u044C \u0430\u0431\u043E \u0441\u0432\u0456\u0434\u043E\u043C\u0435 \u043F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u043D\u044F.",noindex:"\u041F\u0440\u0438\u0431\u0435\u0440\u0456\u0442\u044C noindex, \u044F\u043A\u0449\u043E \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043C\u0430\u0454 \u0437\u2019\u044F\u0432\u043B\u044F\u0442\u0438\u0441\u044F \u0432 \u043F\u043E\u0448\u0443\u043A\u0443.","x-robots-noindex":"\u041F\u0440\u0438\u0431\u0435\u0440\u0456\u0442\u044C noindex \u0456\u0437 X-Robots-Tag, \u044F\u043A\u0449\u043E \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043C\u0430\u0454 \u0456\u043D\u0434\u0435\u043A\u0441\u0443\u0432\u0430\u0442\u0438\u0441\u044F.","robots-blocked":"\u0414\u043E\u0437\u0432\u043E\u043B\u044C\u0442\u0435 URL \u0443 robots.txt, \u044F\u043A\u0449\u043E \u0439\u043E\u0433\u043E \u043F\u043E\u0442\u0440\u0456\u0431\u043D\u043E \u0441\u043A\u0430\u043D\u0443\u0432\u0430\u0442\u0438.","missing-canonical":"\u0412\u043A\u0430\u0436\u0456\u0442\u044C \u0431\u0430\u0436\u0430\u043D\u0438\u0439 canonical URL, \u044F\u043A\u0449\u043E \u043C\u043E\u0436\u043B\u0438\u0432\u0456 \u0434\u0443\u0431\u043B\u0456\u043A\u0430\u0442\u0438 \u0430\u0434\u0440\u0435\u0441\u0438.","invalid-canonical":"\u0412\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u0430\u0439\u0442\u0435 \u0430\u0431\u0441\u043E\u043B\u044E\u0442\u043D\u0438\u0439 \u0430\u0431\u043E \u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0438\u0439 \u0432\u0456\u0434\u043D\u043E\u0441\u043D\u0438\u0439 HTTP(S) canonical URL.","cross-domain-canonical":"\u041F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u044C\u0442\u0435 \u0437\u043E\u0432\u043D\u0456\u0448\u043D\u0456\u0439 canonical \u0430\u0431\u043E \u0432\u043A\u0430\u0436\u0456\u0442\u044C \u043F\u043E\u0442\u0440\u0456\u0431\u043D\u0438\u0439 URL \u0446\u044C\u043E\u0433\u043E \u0441\u0430\u0439\u0442\u0443.","canonical-target-error":"\u0421\u043F\u0440\u044F\u043C\u0443\u0439\u0442\u0435 canonical \u043D\u0430 \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0438\u0439 URL, \u0434\u043E\u0437\u0432\u043E\u043B\u0435\u043D\u0438\u0439 \u0434\u043B\u044F \u0456\u043D\u0434\u0435\u043A\u0441\u0430\u0446\u0456\u0457.","redirect-loop":"\u041F\u0440\u0438\u0431\u0435\u0440\u0456\u0442\u044C \u0446\u0438\u043A\u043B\u0456\u0447\u043D\u0438\u0439 \u043C\u0430\u0440\u0448\u0440\u0443\u0442 \u043F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u044C.","long-redirect-chain":"\u041F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u044F\u0439\u0442\u0435 \u043E\u0434\u0440\u0430\u0437\u0443 \u043D\u0430 \u043A\u0456\u043D\u0446\u0435\u0432\u0443 \u0430\u0434\u0440\u0435\u0441\u0443.","sitemap-unavailable":"\u0412\u0456\u0434\u043D\u043E\u0432\u0456\u0442\u044C \u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0438\u0439 \u0456 \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0438\u0439 XML sitemap.","noindex-in-sitemap":"\u041F\u0440\u0438\u0431\u0435\u0440\u0456\u0442\u044C URL \u0456\u0437 sitemap \u0430\u0431\u043E \u0434\u043E\u0437\u0432\u043E\u043B\u044C\u0442\u0435 \u0439\u043E\u0433\u043E \u0456\u043D\u0434\u0435\u043A\u0441\u0430\u0446\u0456\u044E.","redirect-in-sitemap":"\u0417\u0430\u043C\u0456\u043D\u0456\u0442\u044C URL \u0443 sitemap \u043D\u0430 \u0439\u043E\u0433\u043E \u043A\u0456\u043D\u0446\u0435\u0432\u0443 canonical-\u0430\u0434\u0440\u0435\u0441\u0443.","missing-title":"\u0414\u043E\u0434\u0430\u0439\u0442\u0435 \u0443\u043D\u0456\u043A\u0430\u043B\u044C\u043D\u0438\u0439 \u043E\u043F\u0438\u0441\u043E\u0432\u0438\u0439 HTML title.","duplicate-title":"\u041D\u0430\u043F\u0438\u0448\u0456\u0442\u044C title, \u044F\u043A\u0438\u0439 \u0443\u043D\u0456\u043A\u0430\u043B\u044C\u043D\u043E \u043E\u043F\u0438\u0441\u0443\u0454 \u0446\u044E \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443.","title-length":"\u0417\u0440\u043E\u0431\u0456\u0442\u044C title \u0441\u0442\u0438\u0441\u043B\u0438\u043C \u0456 \u0437\u043C\u0456\u0441\u0442\u043E\u0432\u043D\u0438\u043C, \u0437\u0430\u0437\u0432\u0438\u0447\u0430\u0439 10\u201360 \u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432.","missing-description":"\u0414\u043E\u0434\u0430\u0439\u0442\u0435 \u043A\u043E\u0440\u0438\u0441\u043D\u0438\u0439 meta description.","duplicate-description":"\u041D\u0430\u043F\u0438\u0448\u0456\u0442\u044C \u0443\u043D\u0456\u043A\u0430\u043B\u044C\u043D\u0438\u0439 meta description \u0434\u043B\u044F \u0446\u0456\u0454\u0457 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438.","description-length":"\u0417\u0440\u043E\u0431\u0456\u0442\u044C description \u043A\u043E\u0440\u0438\u0441\u043D\u0438\u043C \u0456 \u0437\u0430\u0437\u0432\u0438\u0447\u0430\u0439 \u0434\u043E\u0432\u0436\u0438\u043D\u043E\u044E 50\u2013160 \u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432.","missing-h1":"\u0414\u043E\u0434\u0430\u0439\u0442\u0435 \u043E\u0434\u0438\u043D \u0437\u0440\u043E\u0437\u0443\u043C\u0456\u043B\u0438\u0439 \u043E\u0441\u043D\u043E\u0432\u043D\u0438\u0439 \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A.","broken-internal-link":"\u041E\u043D\u043E\u0432\u0456\u0442\u044C \u0430\u0431\u043E \u043F\u0440\u0438\u0431\u0435\u0440\u0456\u0442\u044C \u0432\u043D\u0443\u0442\u0440\u0456\u0448\u043D\u0454 \u043F\u043E\u0441\u0438\u043B\u0430\u043D\u043D\u044F \u0447\u0438 \u0432\u0456\u0434\u043D\u043E\u0432\u0456\u0442\u044C \u0439\u043E\u0433\u043E \u0446\u0456\u043B\u044C.","orphan-sitemap-page":"\u0414\u043E\u0434\u0430\u0439\u0442\u0435 \u0437\u043C\u0456\u0441\u0442\u043E\u0432\u043D\u0456 \u0432\u043D\u0443\u0442\u0440\u0456\u0448\u043D\u0456 \u043F\u043E\u0441\u0438\u043B\u0430\u043D\u043D\u044F \u043D\u0430 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443 \u0456\u0437 sitemap.","crawlable-not-in-sitemap":"\u0414\u043E\u0434\u0430\u0439\u0442\u0435 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443 \u0434\u043E sitemap \u0430\u0431\u043E \u0441\u0432\u0456\u0434\u043E\u043C\u043E \u0432\u0438\u043A\u043B\u044E\u0447\u0456\u0442\u044C \u0457\u0457.","invalid-hreflang":"\u0412\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u0430\u0439\u0442\u0435 \u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0456 \u043C\u043E\u0432\u043D\u0456 \u0442\u0435\u0433\u0438 \u0442\u0430 \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0456 HTTP(S) alternate URL.","malformed-json-ld":"\u0412\u0438\u043F\u0440\u0430\u0432\u0442\u0435 JSON-\u0441\u0438\u043D\u0442\u0430\u043A\u0441\u0438\u0441 \u0443 \u0431\u043B\u043E\u0446\u0456 \u0441\u0442\u0440\u0443\u043A\u0442\u0443\u0440\u043E\u0432\u0430\u043D\u0438\u0445 \u0434\u0430\u043D\u0438\u0445.","http-on-https-site":"\u0412\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u043E\u0432\u0443\u0439\u0442\u0435 HTTPS \u0434\u043B\u044F \u0432\u043D\u0443\u0442\u0440\u0456\u0448\u043D\u0456\u0445 URL \u0456 metadata.","invalid-language":"\u0412\u043A\u0430\u0436\u0456\u0442\u044C \u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0438\u0439 \u043C\u043E\u0432\u043D\u0438\u0439 \u0442\u0435\u0433 BCP 47 \u0432 \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456 html.","duplicate-content":"\u041E\u0431\u2019\u0454\u0434\u043D\u0430\u0439\u0442\u0435 \u0434\u0443\u0431\u043B\u044C\u043E\u0432\u0430\u043D\u0456 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438 \u0430\u0431\u043E \u0437\u0440\u043E\u0431\u0456\u0442\u044C \u0457\u0445\u043D\u0456\u0439 \u043E\u0441\u043D\u043E\u0432\u043D\u0438\u0439 \u043A\u043E\u043D\u0442\u0435\u043D\u0442 \u0432\u0456\u0434\u043C\u0456\u043D\u043D\u0438\u043C.","multiple-h1":"\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u0442\u0435, \u0447\u0438 \u043E\u0434\u0438\u043D \u043E\u0441\u043D\u043E\u0432\u043D\u0438\u0439 H1 \u043D\u0435 \u0437\u0440\u043E\u0431\u0438\u0442\u044C \u0456\u0454\u0440\u0430\u0440\u0445\u0456\u044E \u0437\u0440\u043E\u0437\u0443\u043C\u0456\u043B\u0456\u0448\u043E\u044E.","missing-open-graph":"\u0414\u043E\u0434\u0430\u0439\u0442\u0435 Open Graph title, description \u0442\u0430 image \u0434\u043B\u044F \u043F\u043E\u0448\u0438\u0440\u0435\u043D\u043D\u044F \u0432 \u0441\u043E\u0446\u043C\u0435\u0440\u0435\u0436\u0430\u0445.","missing-twitter-metadata":"\u0414\u043E\u0434\u0430\u0439\u0442\u0435 Twitter card metadata, \u044F\u043A\u0449\u043E \u0432\u0430\u0436\u043B\u0438\u0432\u0456 \u0441\u043E\u0446\u0456\u0430\u043B\u044C\u043D\u0456 \u043F\u0440\u0435\u0432\u2019\u044E.","image-missing-alt":"\u0414\u043E\u0434\u0430\u0439\u0442\u0435 \u0437\u043C\u0456\u0441\u0442\u043E\u0432\u043D\u0438\u0439 alt \u0430\u0431\u043E \u043F\u043E\u0440\u043E\u0436\u043D\u0456\u0439 alt \u0434\u043B\u044F \u0434\u0435\u043A\u043E\u0440\u0430\u0442\u0438\u0432\u043D\u0438\u0445 \u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u044C.","low-word-count":"\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u0442\u0435, \u0447\u0438 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043C\u0456\u0441\u0442\u0438\u0442\u044C \u0434\u043E\u0441\u0442\u0430\u0442\u043D\u044C\u043E \u043A\u043E\u0440\u0438\u0441\u043D\u043E\u0433\u043E \u043E\u0441\u043D\u043E\u0432\u043D\u043E\u0433\u043E \u043A\u043E\u043D\u0442\u0435\u043D\u0442\u0443.","robots-changed":"\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u0442\u0435 \u0437\u043C\u0456\u043D\u0443 robots.txt \u0456 \u043F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u044C\u0442\u0435, \u0449\u043E \u0434\u043E\u0441\u0442\u0443\u043F \u0434\u043B\u044F \u0441\u043A\u0430\u043D\u0443\u0432\u0430\u043D\u043D\u044F \u0437\u043C\u0456\u043D\u0435\u043D\u043E \u0441\u0432\u0456\u0434\u043E\u043C\u043E.","page-missing":"\u0414\u043E\u0434\u0430\u0439\u0442\u0435 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443 \u0434\u043E \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u043A\u0438 \u0430\u0431\u043E \u043F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u044C\u0442\u0435, \u0449\u043E \u0457\u0457 \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u043E \u0441\u0432\u0456\u0434\u043E\u043C\u043E.","status-regression":"\u0412\u0456\u0434\u043D\u043E\u0432\u0456\u0442\u044C \u043F\u043E\u043F\u0435\u0440\u0435\u0434\u043D\u044E \u0443\u0441\u043F\u0456\u0448\u043D\u0443 HTTP-\u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u044C.","new-noindex":"\u041F\u0440\u0438\u0431\u0435\u0440\u0456\u0442\u044C \u043D\u043E\u0432\u0438\u0439 noindex, \u044F\u043A\u0449\u043E \u0439\u043E\u0433\u043E \u043D\u0435 \u0434\u043E\u0434\u0430\u043D\u043E \u043D\u0430\u0432\u043C\u0438\u0441\u043D\u043E.","title-removed":"\u0412\u0456\u0434\u043D\u043E\u0432\u0456\u0442\u044C \u0437\u043C\u0456\u0441\u0442\u043E\u0432\u043D\u0438\u0439 title.","title-changed":"\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u0442\u0435 \u0442\u0430 \u043F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u044C\u0442\u0435 \u0437\u043C\u0456\u043D\u0435\u043D\u0438\u0439 title.","description-removed":"\u0412\u0456\u0434\u043D\u043E\u0432\u0456\u0442\u044C \u043A\u043E\u0440\u0438\u0441\u043D\u0438\u0439 meta description.","canonical-removed":"\u0412\u0456\u0434\u043D\u043E\u0432\u0456\u0442\u044C canonical.","canonical-changed":"\u041F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u044C\u0442\u0435, \u0449\u043E \u043D\u043E\u0432\u0430 \u0446\u0456\u043B\u044C canonical \u0441\u0432\u0456\u0434\u043E\u043C\u0430 \u0439 \u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0430.","h1-removed":"\u0412\u0456\u0434\u043D\u043E\u0432\u0456\u0442\u044C \u0437\u0440\u043E\u0437\u0443\u043C\u0456\u043B\u0438\u0439 \u043E\u0441\u043D\u043E\u0432\u043D\u0438\u0439 \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A.","redirect-changed":"\u041F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u044C\u0442\u0435, \u0449\u043E \u043D\u043E\u0432\u0430 \u0446\u0456\u043B\u044C \u043F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u043D\u044F \u0441\u0432\u0456\u0434\u043E\u043C\u0430.","sitemap-url-count-drop":"\u0414\u043E\u0441\u043B\u0456\u0434\u0456\u0442\u044C \u0432\u0442\u0440\u0430\u0442\u0443 URL \u0443 sitemap \u0456 \u043F\u043E\u0432\u0435\u0440\u043D\u0456\u0442\u044C \u043F\u0440\u043E\u043F\u0443\u0449\u0435\u043D\u0456 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438 \u0434\u043B\u044F \u0456\u043D\u0434\u0435\u043A\u0441\u0430\u0446\u0456\u0457."};function Bd(e){return e.evidence?.actual??e.after}function kd(e,t){let r=Bd(e);switch(t){case"page-unreachable":case"redirect-loop":return`\u0417\u0430\u043F\u0438\u0442 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0432\u0441\u044F \u043F\u043E\u043C\u0438\u043B\u043A\u043E\u044E: ${String(r??"\u043D\u0435\u0432\u0456\u0434\u043E\u043C\u0430 \u043F\u043E\u043C\u0438\u043B\u043A\u0430")}`;case"http-error":return`\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043F\u043E\u0432\u0435\u0440\u043D\u0443\u043B\u0430 HTTP ${String(r??"\u043D\u0435\u0432\u0456\u0434\u043E\u043C\u043E")}`;case"noindex":return"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043C\u0456\u0441\u0442\u0438\u0442\u044C \u0434\u0438\u0440\u0435\u043A\u0442\u0438\u0432\u0443 noindex \u0443 meta";case"x-robots-noindex":return"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043C\u0456\u0441\u0442\u0438\u0442\u044C noindex \u0443 X-Robots-Tag";case"robots-blocked":return e.before===!1?"\u0422\u0435\u043F\u0435\u0440 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443 \u0437\u0430\u0431\u043B\u043E\u043A\u043E\u0432\u0430\u043D\u043E \u0447\u0435\u0440\u0435\u0437 robots.txt":"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0443 \u0437\u0430\u0431\u043B\u043E\u043A\u043E\u0432\u0430\u043D\u043E \u0447\u0435\u0440\u0435\u0437 robots.txt";case"missing-canonical":return"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043D\u0435 \u043C\u0456\u0441\u0442\u0438\u0442\u044C canonical URL";case"invalid-canonical":return"Canonical URL \u043D\u0435\u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0438\u0439";case"cross-domain-canonical":return"Canonical \u0432\u043A\u0430\u0437\u0443\u0454 \u043D\u0430 \u0456\u043D\u0448\u0438\u0439 \u0434\u043E\u043C\u0435\u043D";case"canonical-target-error":return"\u0426\u0456\u043B\u044C canonical \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0430";case"long-redirect-chain":return`\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u0432\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u043E\u0432\u0443\u0454 ${String(r??0)} \u043F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u044C`;case"sitemap-unavailable":return"\u041D\u0435 \u0432\u0434\u0430\u043B\u043E\u0441\u044F \u0437\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0438\u0442\u0438 \u043D\u0430\u043B\u0430\u0448\u0442\u043E\u0432\u0430\u043D\u0438\u0439 sitemap";case"noindex-in-sitemap":return"URL \u0456\u0437 sitemap \u043F\u043E\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0439 noindex";case"redirect-in-sitemap":return"URL \u0456\u0437 sitemap \u043F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u044F\u0454\u0442\u044C\u0441\u044F";case"missing-title":return"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043D\u0435 \u043C\u0430\u0454 title";case"duplicate-title":return"\u041A\u0456\u043B\u044C\u043A\u0430 \u0441\u0442\u043E\u0440\u0456\u043D\u043E\u043A \u043C\u0430\u044E\u0442\u044C \u043E\u0434\u043D\u0430\u043A\u043E\u0432\u0438\u0439 title";case"title-length":return`\u0414\u043E\u0432\u0436\u0438\u043D\u0430 title \u2014 ${String(r??0)} \u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432`;case"missing-description":return"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043D\u0435 \u043C\u0430\u0454 meta description";case"duplicate-description":return"\u041A\u0456\u043B\u044C\u043A\u0430 \u0441\u0442\u043E\u0440\u0456\u043D\u043E\u043A \u043C\u0430\u044E\u0442\u044C \u043E\u0434\u043D\u0430\u043A\u043E\u0432\u0438\u0439 meta description";case"description-length":return`\u0414\u043E\u0432\u0436\u0438\u043D\u0430 description \u2014 ${String(r??0)} \u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432`;case"missing-h1":return"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043D\u0435 \u043C\u0456\u0441\u0442\u0438\u0442\u044C \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u0430 H1";case"multiple-h1":return`\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043C\u0456\u0441\u0442\u0438\u0442\u044C H1 \u0443 \u043A\u0456\u043B\u044C\u043A\u043E\u0441\u0442\u0456: ${String(r??0)}`;case"broken-internal-link":return"\u0412\u043D\u0443\u0442\u0440\u0456\u0448\u043D\u0454 \u043F\u043E\u0441\u0438\u043B\u0430\u043D\u043D\u044F \u0432\u0435\u0434\u0435 \u043D\u0430 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0443 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443";case"orphan-sitemap-page":return"\u041D\u0430 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443 \u0456\u0437 sitemap \u043D\u0435 \u0437\u043D\u0430\u0439\u0434\u0435\u043D\u043E \u0432\u043D\u0443\u0442\u0440\u0456\u0448\u043D\u0456\u0445 \u043F\u043E\u0441\u0438\u043B\u0430\u043D\u044C";case"crawlable-not-in-sitemap":return"\u0414\u043E\u0441\u0442\u0443\u043F\u043D\u0430 \u0434\u043B\u044F \u0441\u043A\u0430\u043D\u0443\u0432\u0430\u043D\u043D\u044F \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u0432\u0456\u0434\u0441\u0443\u0442\u043D\u044F \u0443 sitemap";case"invalid-hreflang":return"\u041E\u0433\u043E\u043B\u043E\u0448\u0435\u043D\u043D\u044F hreflang \u043D\u0435\u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0435";case"malformed-json-ld":return"\u0411\u043B\u043E\u043A JSON-LD \u043C\u0456\u0441\u0442\u0438\u0442\u044C \u043D\u0435\u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0438\u0439 JSON";case"http-on-https-site":return"HTTPS-\u0441\u0430\u0439\u0442 \u043F\u043E\u0441\u0438\u043B\u0430\u0454\u0442\u044C\u0441\u044F \u043D\u0430 \u0432\u043D\u0443\u0442\u0440\u0456\u0448\u043D\u0456\u0439 HTTP URL";case"invalid-language":return"\u041E\u0433\u043E\u043B\u043E\u0448\u0435\u043D\u043D\u044F \u043C\u043E\u0432\u0438 HTML \u043D\u0435\u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0435";case"duplicate-content":return"\u041E\u0441\u043D\u043E\u0432\u043D\u0438\u0439 \u0442\u0435\u043A\u0441\u0442 \u0454 \u0442\u043E\u0447\u043D\u0438\u043C \u0434\u0443\u0431\u043B\u0435\u043C \u0456\u043D\u0448\u043E\u0457 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438";case"missing-open-graph":return"Open Graph metadata \u043D\u0435\u043F\u043E\u0432\u043D\u0456";case"missing-twitter-metadata":return"Twitter card metadata \u043D\u0435\u043F\u043E\u0432\u043D\u0456";case"image-missing-alt":return`${Array.isArray(r)?r.length:String(r??0)} \u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u044C \u043D\u0435 \u043C\u0430\u044E\u0442\u044C \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 alt`;case"low-word-count":return`\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043C\u0456\u0441\u0442\u0438\u0442\u044C \u043F\u0440\u0438\u0431\u043B\u0438\u0437\u043D\u043E ${String(r??0)} \u0432\u0438\u0434\u0438\u043C\u0438\u0445 \u0441\u043B\u0456\u0432`;case"robots-changed":return"\u0412\u043C\u0456\u0441\u0442 robots.txt \u0437\u043C\u0456\u043D\u0438\u0432\u0441\u044F";case"page-missing":return"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0443 \u043D\u0435 \u0431\u0443\u043B\u043E \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u0435\u043D\u043E";case"status-regression":return`HTTP-\u0441\u0442\u0430\u0442\u0443\u0441 \u043F\u043E\u0433\u0456\u0440\u0448\u0438\u0432\u0441\u044F \u0437 ${String(e.before??"\u043D\u0435\u0432\u0456\u0434\u043E\u043C\u043E")} \u0434\u043E ${String(e.after??"\u0432\u0456\u0434\u0441\u0443\u0442\u043D\u0456\u0439")}`;case"new-noindex":return"\u0422\u0435\u043F\u0435\u0440 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043C\u0456\u0441\u0442\u0438\u0442\u044C \u0434\u0438\u0440\u0435\u043A\u0442\u0438\u0432\u0443 noindex";case"title-removed":return"Title \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438 \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u043E";case"title-changed":return"Title \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438 \u0437\u043C\u0456\u043D\u0435\u043D\u043E";case"description-removed":return"Meta description \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u043E";case"canonical-removed":return"Canonical URL \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u043E";case"canonical-changed":return"Canonical URL \u0437\u043C\u0456\u043D\u0435\u043D\u043E";case"h1-removed":return"\u0423\u0441\u0456 \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u0438 H1 \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u043E";case"redirect-changed":return"\u041A\u0456\u043D\u0446\u0435\u0432\u0438\u0439 URL \u043F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u043D\u044F \u0437\u043C\u0456\u043D\u0435\u043D\u043E";case"sitemap-url-count-drop":return`\u041A\u0456\u043B\u044C\u043A\u0456\u0441\u0442\u044C URL \u0443 sitemap \u0437\u043C\u0435\u043D\u0448\u0438\u043B\u0430\u0441\u044F \u043D\u0430 ${String((Number(e.before)||0)-(Number(e.after)||0))}`;default:return e.message??"\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u0442\u0435 \u043F\u0440\u043E\u0431\u043B\u0435\u043C\u0443 \u0442\u0430 \u043F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u044C\u0442\u0435 \u043E\u0447\u0456\u043A\u0443\u0432\u0430\u043D\u0443 \u043F\u043E\u0432\u0435\u0434\u0456\u043D\u043A\u0443."}}function fi(e,t){let r=e.remediation??"Review the finding and confirm the intended behavior.";return{en:{rule:gi(t),message:e.message??"",remediation:r},uk:{rule:Od[t]??gi(t),message:kd(e,t),remediation:Dd[t]??"\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u0442\u0435 \u043F\u0440\u043E\u0431\u043B\u0435\u043C\u0443 \u0442\u0430 \u043F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u044C\u0442\u0435 \u043E\u0447\u0456\u043A\u0443\u0432\u0430\u043D\u0443 \u043F\u043E\u0432\u0435\u0434\u0456\u043D\u043A\u0443."}}}var Ei={en:{language:"Language",titles:{partial:"Partial SEO scan report",check:"SEO regression report",scan:"SEO baseline audit"},generated:"Generated",engine:"Engine",rules:"Rules",issueLifecycle:"Issue lifecycle",partialTitle:"Partial results.",partialMessage:"This report contains the pages saved so far. Run the same scan command again to resume without requesting them twice.",incompleteTitle:"Incomplete comparison.",incompleteMessage:"Regressions found on checked pages are shown, but unchecked pages are not marked missing or resolved.",previewTitle:"Preview deployment comparison.",production:"Production",preview:"Preview",cards:{pages:"Pages checked",error:"Errors",warning:"Warnings",info:"Info",affected:"Affected pages"},analytics:{title:"Issue statistics",hint:"Select a chart item to filter the issue table.",severity:"By severity",topRules:"Most frequent checks",owners:"By owner",lifecycle:"By lifecycle",templates:"Affected page templates",total:"Total issues",noData:"No issues to chart.",filterBy:"Filter by"},history:{title:"Local scan history",hint:"Issue trends from snapshots stored on this device.",chartLabel:"Issue trend across runs.",runs:"Runs",pages:"Latest pages",newIssues:"New issues",resolvedIssues:"Resolved issues",sitemapUrls:"Sitemap URLs",maxDepth:"Maximum crawl depth"},tabs:{current:"Current / all",new:"New",ongoing:"Ongoing",resolved:"Resolved",unchanged:"Unchanged"},filters:{search:"URL or text",searchPlaceholder:"URL, check, or message",severity:"Severity",rule:"Check",template:"Page template",owner:"Owner",rows:"Rows"},all:{severity:"All severities",rule:"All checks",template:"All templates",owner:"All owners"},severities:{error:"Error",warning:"Warning",info:"Info"},owners:{seo:"SEO",content:"Content",developer:"Developer"},rows:{100:"100 per page",250:"250 per page",500:"500 per page"},guide:{error:"Errors",errorText:"need attention first.",warning:"Warnings",warningText:"are important improvements.",info:"Info",infoText:"is useful context.",score:"No opaque SEO score is used."},exportCsv:"Export CSV",previous:"Previous",next:"Next",table:{severity:"Severity",lifecycle:"Lifecycle",ruleOwner:"Check / owner",page:"Page",finding:"What was found",change:"Change",before:"Before",evidence:"Evidence / after",remediation:"Remediation",fingerprint:"Fingerprint"},empty:{cleanTitle:"No SEO issues found",cleanMessage:"The scanned pages passed all current checks.",filteredTitle:"No matching issues",filteredMessage:"Try a different lifecycle tab or clear the selected filters.",clear:"Clear filters"},lifecycle:{current:"Current",new:"New",ongoing:"Ongoing",resolved:"Resolved",unchanged:"Unchanged"},notPresent:"Not present",page:"Page",of:"of",issue:"issue",issues:"issues",docs:"docs",footer:"Generated locally. No report data was uploaded."},uk:{language:"\u041C\u043E\u0432\u0430",titles:{partial:"\u0417\u0432\u0456\u0442 \u0447\u0430\u0441\u0442\u043A\u043E\u0432\u043E\u0433\u043E SEO-\u0441\u043A\u0430\u043D\u0443\u0432\u0430\u043D\u043D\u044F",check:"\u0417\u0432\u0456\u0442 \u043F\u0440\u043E SEO-\u0440\u0435\u0433\u0440\u0435\u0441\u0456\u0457",scan:"\u0411\u0430\u0437\u043E\u0432\u0438\u0439 SEO-\u0430\u0443\u0434\u0438\u0442"},generated:"\u0421\u0442\u0432\u043E\u0440\u0435\u043D\u043E",engine:"\u0420\u0443\u0448\u0456\u0439",rules:"\u041F\u0440\u0430\u0432\u0438\u043B\u0430",issueLifecycle:"\u0421\u0442\u0430\u043D\u0438 \u043F\u0440\u043E\u0431\u043B\u0435\u043C",partialTitle:"\u0427\u0430\u0441\u0442\u043A\u043E\u0432\u0456 \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u0438.",partialMessage:"\u0417\u0432\u0456\u0442 \u043C\u0456\u0441\u0442\u0438\u0442\u044C \u0443\u0436\u0435 \u0437\u0431\u0435\u0440\u0435\u0436\u0435\u043D\u0456 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438. \u0417\u0430\u043F\u0443\u0441\u0442\u0456\u0442\u044C \u0442\u0443 \u0441\u0430\u043C\u0443 \u043A\u043E\u043C\u0430\u043D\u0434\u0443 \u0449\u0435 \u0440\u0430\u0437, \u0449\u043E\u0431 \u043F\u0440\u043E\u0434\u043E\u0432\u0436\u0438\u0442\u0438 \u0431\u0435\u0437 \u043F\u043E\u0432\u0442\u043E\u0440\u043D\u0438\u0445 \u0437\u0430\u043F\u0438\u0442\u0456\u0432.",incompleteTitle:"\u041D\u0435\u043F\u043E\u0432\u043D\u0435 \u043F\u043E\u0440\u0456\u0432\u043D\u044F\u043D\u043D\u044F.",incompleteMessage:"\u041F\u043E\u043A\u0430\u0437\u0430\u043D\u043E \u0440\u0435\u0433\u0440\u0435\u0441\u0456\u0457 \u043D\u0430 \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u0435\u043D\u0438\u0445 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0430\u0445, \u0430\u043B\u0435 \u043D\u0435\u043F\u0435\u0440\u0435\u0432\u0456\u0440\u0435\u043D\u0456 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438 \u043D\u0435 \u043F\u043E\u0437\u043D\u0430\u0447\u0435\u043D\u043E \u044F\u043A \u0432\u0456\u0434\u0441\u0443\u0442\u043D\u0456 \u0447\u0438 \u0432\u0438\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0456.",previewTitle:"\u041F\u043E\u0440\u0456\u0432\u043D\u044F\u043D\u043D\u044F production \u0456 preview.",production:"Production",preview:"Preview",cards:{pages:"\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u0435\u043D\u043E \u0441\u0442\u043E\u0440\u0456\u043D\u043E\u043A",error:"\u041F\u043E\u043C\u0438\u043B\u043A\u0438",warning:"\u041F\u043E\u043F\u0435\u0440\u0435\u0434\u0436\u0435\u043D\u043D\u044F",info:"\u0406\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0456\u044F",affected:"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0438 \u0437 \u043F\u0440\u043E\u0431\u043B\u0435\u043C\u0430\u043C\u0438"},analytics:{title:"\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043A\u0430 \u043F\u0440\u043E\u0431\u043B\u0435\u043C",hint:"\u041E\u0431\u0435\u0440\u0456\u0442\u044C \u0435\u043B\u0435\u043C\u0435\u043D\u0442 \u0433\u0440\u0430\u0444\u0456\u043A\u0430, \u0449\u043E\u0431 \u0432\u0456\u0434\u0444\u0456\u043B\u044C\u0442\u0440\u0443\u0432\u0430\u0442\u0438 \u0442\u0430\u0431\u043B\u0438\u0446\u044E \u043F\u0440\u043E\u0431\u043B\u0435\u043C.",severity:"\u0417\u0430 \u0432\u0430\u0436\u043B\u0438\u0432\u0456\u0441\u0442\u044E",topRules:"\u041D\u0430\u0439\u0447\u0430\u0441\u0442\u0456\u0448\u0456 \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u043A\u0438",owners:"\u0417\u0430 \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u043B\u044C\u043D\u0438\u043C\u0438",lifecycle:"\u0417\u0430 \u0441\u0442\u0430\u043D\u043E\u043C",templates:"\u0428\u0430\u0431\u043B\u043E\u043D\u0438 \u0441\u0442\u043E\u0440\u0456\u043D\u043E\u043A \u0456\u0437 \u043F\u0440\u043E\u0431\u043B\u0435\u043C\u0430\u043C\u0438",total:"\u0423\u0441\u044C\u043E\u0433\u043E \u043F\u0440\u043E\u0431\u043B\u0435\u043C",noData:"\u041D\u0435\u043C\u0430\u0454 \u043F\u0440\u043E\u0431\u043B\u0435\u043C \u0434\u043B\u044F \u0432\u0456\u0434\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u043D\u044F.",filterBy:"\u0424\u0456\u043B\u044C\u0442\u0440\u0443\u0432\u0430\u0442\u0438 \u0437\u0430"},history:{title:"\u041B\u043E\u043A\u0430\u043B\u044C\u043D\u0430 \u0456\u0441\u0442\u043E\u0440\u0456\u044F \u0441\u043A\u0430\u043D\u0443\u0432\u0430\u043D\u044C",hint:"\u0414\u0438\u043D\u0430\u043C\u0456\u043A\u0430 \u043F\u0440\u043E\u0431\u043B\u0435\u043C \u0437\u0456 snapshot-\u0444\u0430\u0439\u043B\u0456\u0432, \u0437\u0431\u0435\u0440\u0435\u0436\u0435\u043D\u0438\u0445 \u043D\u0430 \u0446\u044C\u043E\u043C\u0443 \u043F\u0440\u0438\u0441\u0442\u0440\u043E\u0457.",chartLabel:"\u0414\u0438\u043D\u0430\u043C\u0456\u043A\u0430 \u043F\u0440\u043E\u0431\u043B\u0435\u043C \u0437\u0430 \u0437\u0430\u043F\u0443\u0441\u043A\u0430\u043C\u0438.",runs:"\u0417\u0430\u043F\u0443\u0441\u043A\u0438",pages:"\u0421\u0442\u043E\u0440\u0456\u043D\u043E\u043A \u0432\u043E\u0441\u0442\u0430\u043D\u043D\u0454",newIssues:"\u041D\u043E\u0432\u0456 \u043F\u0440\u043E\u0431\u043B\u0435\u043C\u0438",resolvedIssues:"\u0412\u0438\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0456 \u043F\u0440\u043E\u0431\u043B\u0435\u043C\u0438",sitemapUrls:"URL \u0443 sitemap",maxDepth:"\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0430 \u0433\u043B\u0438\u0431\u0438\u043D\u0430"},tabs:{current:"\u041F\u043E\u0442\u043E\u0447\u043D\u0456 / \u0443\u0441\u0456",new:"\u041D\u043E\u0432\u0456",ongoing:"\u0422\u0440\u0438\u0432\u0430\u044E\u0442\u044C",resolved:"\u0412\u0438\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0456",unchanged:"\u0411\u0435\u0437 \u0437\u043C\u0456\u043D"},filters:{search:"URL \u0430\u0431\u043E \u0442\u0435\u043A\u0441\u0442",searchPlaceholder:"URL, \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u043A\u0430 \u0430\u0431\u043E \u043F\u043E\u0432\u0456\u0434\u043E\u043C\u043B\u0435\u043D\u043D\u044F",severity:"\u0412\u0430\u0436\u043B\u0438\u0432\u0456\u0441\u0442\u044C",rule:"\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u043A\u0430",template:"\u0428\u0430\u0431\u043B\u043E\u043D \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438",owner:"\u0412\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u043B\u044C\u043D\u0438\u0439",rows:"\u0420\u044F\u0434\u043A\u0438"},all:{severity:"\u0423\u0441\u0456 \u0440\u0456\u0432\u043D\u0456",rule:"\u0423\u0441\u0456 \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u043A\u0438",template:"\u0423\u0441\u0456 \u0448\u0430\u0431\u043B\u043E\u043D\u0438",owner:"\u0423\u0441\u0456 \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u043B\u044C\u043D\u0456"},severities:{error:"\u041F\u043E\u043C\u0438\u043B\u043A\u0430",warning:"\u041F\u043E\u043F\u0435\u0440\u0435\u0434\u0436\u0435\u043D\u043D\u044F",info:"\u0406\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0456\u044F"},owners:{seo:"SEO",content:"\u041A\u043E\u043D\u0442\u0435\u043D\u0442",developer:"\u0420\u043E\u0437\u0440\u043E\u0431\u043D\u0438\u043A"},rows:{100:"100 \u043D\u0430 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443",250:"250 \u043D\u0430 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443",500:"500 \u043D\u0430 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443"},guide:{error:"\u041F\u043E\u043C\u0438\u043B\u043A\u0438",errorText:"\u043F\u043E\u0442\u0440\u0435\u0431\u0443\u044E\u0442\u044C \u043F\u0435\u0440\u0448\u043E\u0447\u0435\u0440\u0433\u043E\u0432\u043E\u0457 \u0443\u0432\u0430\u0433\u0438.",warning:"\u041F\u043E\u043F\u0435\u0440\u0435\u0434\u0436\u0435\u043D\u043D\u044F",warningText:"\u043F\u043E\u0437\u043D\u0430\u0447\u0430\u044E\u0442\u044C \u0432\u0430\u0436\u043B\u0438\u0432\u0456 \u043F\u043E\u043A\u0440\u0430\u0449\u0435\u043D\u043D\u044F.",info:"\u0406\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0456\u044F",infoText:"\u0434\u0430\u0454 \u043A\u043E\u0440\u0438\u0441\u043D\u0438\u0439 \u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442.",score:"\u041D\u0435\u043F\u0440\u043E\u0437\u043E\u0440\u0430 SEO-\u043E\u0446\u0456\u043D\u043A\u0430 \u043D\u0435 \u0432\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u043E\u0432\u0443\u0454\u0442\u044C\u0441\u044F."},exportCsv:"\u0415\u043A\u0441\u043F\u043E\u0440\u0442 CSV",previous:"\u041D\u0430\u0437\u0430\u0434",next:"\u0414\u0430\u043B\u0456",table:{severity:"\u0412\u0430\u0436\u043B\u0438\u0432\u0456\u0441\u0442\u044C",lifecycle:"\u0421\u0442\u0430\u043D",ruleOwner:"\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u043A\u0430 / \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u043B\u044C\u043D\u0438\u0439",page:"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430",finding:"\u0429\u043E \u0437\u043D\u0430\u0439\u0434\u0435\u043D\u043E",change:"\u0417\u043C\u0456\u043D\u0430",before:"\u0411\u0443\u043B\u043E",evidence:"\u0414\u043E\u043A\u0430\u0437 / \u0441\u0442\u0430\u043B\u043E",remediation:"\u042F\u043A \u0432\u0438\u043F\u0440\u0430\u0432\u0438\u0442\u0438",fingerprint:"\u0412\u0456\u0434\u0431\u0438\u0442\u043E\u043A"},empty:{cleanTitle:"SEO-\u043F\u0440\u043E\u0431\u043B\u0435\u043C \u043D\u0435 \u0437\u043D\u0430\u0439\u0434\u0435\u043D\u043E",cleanMessage:"\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u0435\u043D\u0456 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438 \u043F\u0440\u043E\u0439\u0448\u043B\u0438 \u0432\u0441\u0456 \u0430\u043A\u0442\u0438\u0432\u043D\u0456 \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u043A\u0438.",filteredTitle:"\u0417\u0431\u0456\u0433\u0456\u0432 \u043D\u0435 \u0437\u043D\u0430\u0439\u0434\u0435\u043D\u043E",filteredMessage:"\u041E\u0431\u0435\u0440\u0456\u0442\u044C \u0456\u043D\u0448\u0438\u0439 \u0441\u0442\u0430\u043D \u0430\u0431\u043E \u043E\u0447\u0438\u0441\u0442\u044C\u0442\u0435 \u0444\u0456\u043B\u044C\u0442\u0440\u0438.",clear:"\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u0438 \u0444\u0456\u043B\u044C\u0442\u0440\u0438"},lifecycle:{current:"\u041F\u043E\u0442\u043E\u0447\u043D\u0430",new:"\u041D\u043E\u0432\u0430",ongoing:"\u0422\u0440\u0438\u0432\u0430\u0454",resolved:"\u0412\u0438\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0430",unchanged:"\u0411\u0435\u0437 \u0437\u043C\u0456\u043D"},notPresent:"\u0412\u0456\u0434\u0441\u0443\u0442\u043D\u0454",page:"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430",of:"\u0437",issue:"\u043F\u0440\u043E\u0431\u043B\u0435\u043C\u0430",issues:"\u043F\u0440\u043E\u0431\u043B\u0435\u043C",docs:"\u0434\u043E\u0432\u0456\u0434\u043A\u0430",footer:"\u0421\u0442\u0432\u043E\u0440\u0435\u043D\u043E \u043B\u043E\u043A\u0430\u043B\u044C\u043D\u043E. \u0414\u0430\u043D\u0456 \u0437\u0432\u0456\u0442\u0443 \u043D\u0456\u043A\u0443\u0434\u0438 \u043D\u0435 \u0437\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0443\u0432\u0430\u043B\u0438\u0441\u044F."}};var vd="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' rx='16' fill='%233157d5'/%3E%3Ccircle cx='27' cy='27' r='13' fill='none' stroke='white' stroke-width='6'/%3E%3Cpath d='m37 37 12 12' fill='none' stroke='white' stroke-linecap='round' stroke-width='6'/%3E%3Cpath d='m21 27 5 5 9-11' fill='none' stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='4'/%3E%3C/svg%3E";function re(e){return String(e??"").replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function Pd(e){return JSON.stringify(e).replaceAll("<","\\u003c").replaceAll(">","\\u003e").replaceAll("&","\\u0026")}function Md(){return'<svg class="logo product-mark" viewBox="0 0 64 64" role="img" aria-label="SEO Crawl Audit logo"><rect width="64" height="64" rx="16" fill="var(--accent)"/><circle cx="27" cy="27" r="13" fill="none" stroke="#fff" stroke-width="6"/><path d="m37 37 12 12" fill="none" stroke="#fff" stroke-linecap="round" stroke-width="6"/><path d="m21 27 5 5 9-11" fill="none" stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="4"/></svg>'}function St(e,t="current"){let r=e.ruleId??e.rule??"unknown";return{fingerprint:e.fingerprint??"legacy",ruleId:r,rule:e.rule??e.ruleId??"unknown",severity:e.severity??"info",scope:e.scope??"page",url:e.url??"",message:e.message??"",evidence:e.evidence??{actual:e.after},owner:e.owner??"seo",remediation:e.remediation??"Review the finding and confirm the intended behavior.",documentationUrl:e.documentationUrl??"https://github.com/MelnixDev/seo-crawl-audit/blob/main/docs/rules.md",before:e.before,after:e.after,lifecycle:e.lifecycle??t,template:"",localized:fi(e,r)}}function Tn(e,t){return e.reduce((r,n)=>{let s=String(n[t]);return r[s]=(r[s]??0)+1,r},{})}function Ti(e,t={}){let r=e.mode??"scan",n=e.pages??[],s=(e.issues??[]).map(N=>St(N)),a=[...(e.newIssues??[]).map(N=>St(N,"new")),...(e.ongoingIssues??[]).map(N=>St(N,"ongoing")),...(e.resolvedIssues??[]).map(N=>St(N,"resolved")),...(e.unchangedIssues??[]).map(N=>St(N,"unchanged"))],c=a.length>0?a:s,l=En(c),o=new Map(l.flatMap(N=>N.urls.map(P=>[P,N.template])));for(let N of c)N.template=o.get(N.url)??"";let d=c.reduce((N,P)=>(N[P.severity]+=1,N),{error:0,warning:0,info:0}),h=new Set(c.map(N=>N.url)).size,m=Tn(c,"rule"),E={error:0,warning:1,info:2},f=new Map;for(let N of c.filter(P=>P.lifecycle!=="resolved")){let P=f.get(N.rule);P?(P.count+=1,P.urls.add(N.url),E[N.severity]<E[P.severity]&&(P.severity=N.severity)):f.set(N.rule,{rule:N.rule,severity:N.severity,owner:N.owner,count:1,urls:new Set([N.url])})}let y=[...f.values()].map(N=>({rule:N.rule,severity:N.severity,owner:N.owner,count:N.count,affectedPages:N.urls.size})).sort((N,P)=>E[N.severity]-E[P.severity]||P.affectedPages-N.affectedPages||P.count-N.count||N.rule.localeCompare(P.rule)).slice(0,5),w={total:c.length,pagesChecked:n.length,targetPages:e.targetPages??null,affectedPages:h,severity:d,rules:Object.entries(m).map(([N,P])=>({id:N,count:P})).sort((N,P)=>P.count-N.count||N.id.localeCompare(P.id)),owners:Tn(c,"owner"),lifecycle:Tn(c,"lifecycle"),templates:l.map(({template:N,issueCount:P,affectedPages:ca})=>({template:N,issueCount:P,affectedPages:ca})),priorities:y},I=e.partial??!1,_=r==="check"&&e.complete===!1,S=I?"Partial SEO scan report":r==="check"?"SEO regression report":"SEO baseline audit",R={...e.branding??{},...t.branding??{}},U=/^#[0-9a-f]{6}$/i.test(R.primaryColor??"")?R.primaryColor:"#3157d5",x=R.logo&&(/^data:image\//.test(R.logo)||/^https:\/\//.test(R.logo))?`<img class="logo" src="${re(R.logo)}" alt="${re(R.agencyName??"Report logo")}">`:Md(),k=Pd({mode:r,issues:c,statistics:w,copy:Ei,partial:I,incompleteComparison:_,comparison:e.comparison??null,history:e.history??null,siteMetrics:e.siteMetrics??null}),Y=e.generatedAt??new Date().toISOString(),F=e.startUrl??"",v=e.targetPages??null,D=r==="check";return`<!doctype html>
|
|
8
8
|
<html lang="en">
|
|
9
9
|
<head>
|
|
10
10
|
<meta charset="utf-8">
|
|
11
11
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
12
|
-
<link rel="icon" href="${
|
|
12
|
+
<link rel="icon" href="${vd}" type="image/svg+xml">
|
|
13
13
|
<title>${re(S)} \xB7 SEO Crawl Audit</title>
|
|
14
14
|
<style>
|
|
15
15
|
:root { color-scheme: light; --bg:#f5f7fb; --surface:#fff; --muted:#64748b; --text:#172033; --line:#dbe2ea; --accent:${U}; --error:#b42318; --warning:#9a6700; --info:#175cd3; --chart-error:#d92d20; --chart-warning:#f79009; --chart-info:#2e90fa; --chart-resolved:#12b76a; }
|
|
@@ -27,12 +27,12 @@ ${Or(n??null)}`).digest("hex").slice(0,24)}function L(e,t,r,n={},s){let a=da.get
|
|
|
27
27
|
</head>
|
|
28
28
|
<body><main>
|
|
29
29
|
<header><div class="brand">${x}<div><div class="eyebrow">${re(R.agencyName??"SEO Crawl Audit")}</div><h1 id="report-title">${re(S)}</h1><div class="meta">${re(F)}</div></div></div><div class="meta header-meta"><span id="generated-label">Generated</span> <time id="generated-at" datetime="${re(Y)}">${re(Y)}</time><br><span id="engine-label">Engine</span> ${re(e.engineVersion??V)} \xB7 <span id="rules-label">Rules</span> ${re(e.ruleSetVersion??tt)}<label class="language-control"><span id="language-label">Language</span><select id="language" aria-label="Language"><option value="en">English</option><option value="uk">\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430</option></select></label></div></header>
|
|
30
|
-
${
|
|
30
|
+
${I?' <div class="notice"><strong id="partial-title">Partial results.</strong> <span id="partial-message">This report contains the pages saved so far. Run the same scan command again to resume without requesting them twice.</span></div>':""}
|
|
31
31
|
${_?' <div class="notice"><strong id="incomplete-title">Incomplete comparison.</strong> <span id="incomplete-message">Regressions found on checked pages are shown, but unchecked pages are not marked missing or resolved.</span></div>':""}
|
|
32
32
|
${e.comparison?.kind==="preview"?` <div class="notice"><strong id="preview-title">Preview deployment comparison.</strong> <span id="production-label">Production</span>: <a href="${re(e.comparison.productionUrl)}">${re(e.comparison.productionUrl)}</a> \xB7 <span id="preview-label">Preview</span>: <a href="${re(e.comparison.previewUrl)}">${re(e.comparison.previewUrl)}</a></div>`:""}
|
|
33
33
|
<nav class="report-nav" aria-label="Report sections"><button type="button" data-view="overview" aria-selected="true">Overview</button><button type="button" data-view="metrics" aria-selected="false">Site Metrics</button><button type="button" data-view="issues" aria-selected="false">Issues</button></nav>
|
|
34
34
|
<div id="overview-view" data-report-view="overview">
|
|
35
|
-
<section class="cards"><div class="card"><strong id="pages-count">${n.length.toLocaleString("en-US")}${v?` / ${v.toLocaleString("en-US")}`:""}</strong><span id="pages-label">Pages checked</span></div><div class="card error"><strong id="errors-count">${
|
|
35
|
+
<section class="cards"><div class="card"><strong id="pages-count">${n.length.toLocaleString("en-US")}${v?` / ${v.toLocaleString("en-US")}`:""}</strong><span id="pages-label">Pages checked</span></div><div class="card error"><strong id="errors-count">${d.error}</strong><span id="errors-label">Errors</span></div><div class="card warning"><strong id="warnings-count">${d.warning}</strong><span id="warnings-label">Warnings</span></div><div class="card info"><strong id="info-count">${d.info}</strong><span id="info-label">Info</span></div><div class="card"><strong id="affected-count">${h.toLocaleString("en-US")}</strong><span id="affected-label">Affected pages</span></div></section>
|
|
36
36
|
<section class="analytics" aria-labelledby="priority-title"><div class="analytics-header"><div><h2 id="priority-title">What to fix first</h2><div id="priority-hint" class="meta">Ordered by risk and affected pages, without an opaque score.</div></div></div><div id="priority-list" class="priority-list"></div></section>
|
|
37
37
|
${e.history&&e.history.points.length>0?' <section id="history-panel" class="analytics" aria-labelledby="history-title"><div class="analytics-header"><div><h2 id="history-title">Local scan history</h2><div id="history-hint" class="meta">Issue trends from snapshots stored on this device.</div></div></div><div class="trend-layout"><div><svg id="history-chart" class="trend-chart" viewBox="0 0 760 240" role="img"></svg><div class="trend-legend"><span><i class="chart-key error"></i><span id="history-errors-label">Errors</span></span><span><i class="chart-key warning"></i><span id="history-warnings-label">Warnings</span></span><span><i class="chart-key info"></i><span id="history-info-label">Info</span></span></div></div><div id="history-summary" class="trend-summary"></div></div></section>':""}
|
|
38
38
|
<section id="analytics" class="analytics" aria-labelledby="analytics-title">
|
|
@@ -88,17 +88,20 @@ ${e.history&&e.history.points.length>0?' <section id="history-panel" class="ana
|
|
|
88
88
|
metricsHero.replaceChildren();metricsInsights.replaceChildren();metricsGroups.replaceChildren();
|
|
89
89
|
setText("metrics-title",locale==="uk"?"\u041F\u043E\u043A\u0430\u0437\u043D\u0438\u043A\u0438 \u0441\u0430\u0439\u0442\u0443":"Site Metrics");
|
|
90
90
|
setText("metrics-hint",locale==="uk"?"\u041A\u043B\u044E\u0447\u043E\u0432\u0456 \u0441\u0438\u0433\u043D\u0430\u043B\u0438, \u0432\u0438\u0434\u0438\u043C\u0456\u0441\u0442\u044C, \u043A\u043E\u043D\u0442\u0435\u043D\u0442 \u0456 \u0442\u0435\u0445\u043D\u0456\u0447\u043D\u0456 \u0434\u0430\u043D\u0456 \u2014 \u0437 \u0447\u0456\u0442\u043A\u0438\u043C \u0434\u0436\u0435\u0440\u0435\u043B\u043E\u043C \u043A\u043E\u0436\u043D\u043E\u0433\u043E \u0447\u0438\u0441\u043B\u0430.":"Key signals, visibility, content, and technical data \u2014 with a clear source for every value.");
|
|
91
|
-
const statusCopy={available:{en:"Available",uk:"\u0414\u043E\u0441\u0442\u0443\u043F\u043D\u043E"},unavailable:{en:"Unavailable",uk:"\u041D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u043E"},"not-connected":{en:"Not connected",uk:"\u041D\u0435 \u043F\u0456\u0434\u043A\u043B\u044E\u0447\u0435\u043D\u043E"},error:{en:"Error",uk:"\u041F\u043E\u043C\u0438\u043B\u043A\u0430"}};
|
|
91
|
+
const statusCopy={available:{en:"Available",uk:"\u0414\u043E\u0441\u0442\u0443\u043F\u043D\u043E"},estimate:{en:"Estimate",uk:"\u041E\u0440\u0456\u0454\u043D\u0442\u043E\u0432\u043D\u043E"},unavailable:{en:"Unavailable",uk:"\u041D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u043E"},"not-connected":{en:"Not connected",uk:"\u041D\u0435 \u043F\u0456\u0434\u043A\u043B\u044E\u0447\u0435\u043D\u043E"},error:{en:"Error",uk:"\u041F\u043E\u043C\u0438\u043B\u043A\u0430"}};
|
|
92
92
|
const valueText=(metric)=>{const missing=["unavailable","not-connected","error"].includes(metric.status);if(missing)return "\u2014";if(metric.unit==="bytes")return new Intl.NumberFormat(locale==="uk"?"uk-UA":"en-US",{style:"unit",unit:"megabyte",maximumFractionDigits:2}).format(Number(metric.value)/1048576);if(metric.unit==="milliseconds")return number(metric.value)+" ms";if(metric.unit==="date")return new Intl.DateTimeFormat(locale==="uk"?"uk-UA":"en-US",{dateStyle:"medium"}).format(new Date(String(metric.value)));if(metric.unit==="text")return String(metric.value??"\u2014");return number(metric.value)};
|
|
93
93
|
const metricCard=(metric,featured=false)=>{const card=document.createElement("article");card.className="metric-card"+(featured?" featured":"");card.dataset.metric=metric.id;const label=document.createElement("div");label.className="metric-label";const labelText=document.createElement("span");labelText.textContent=metric.label[locale]||metric.label.en;label.append(labelText);if(metric.status!=="available"){const status=document.createElement("span");status.className="metric-status";status.textContent=statusCopy[metric.status]?.[locale]||metric.status;label.append(status)}const value=document.createElement("strong");value.textContent=valueText(metric);const source=document.createElement("div");source.className="metric-source";const sourceLabel=document.createElement(metric.source.url?"a":"span");sourceLabel.textContent=metric.source.label;if(metric.source.url){sourceLabel.href=metric.source.url;sourceLabel.target="_blank";sourceLabel.rel="noopener noreferrer"}source.append(sourceLabel,document.createTextNode(" \xB7 "+new Intl.DateTimeFormat(locale==="uk"?"uk-UA":"en-US",{dateStyle:"medium"}).format(new Date(metric.observedAt))));card.append(label,value,source);if(metric.detail){const detail=document.createElement("div");detail.className="metric-detail";detail.textContent=metric.detail[locale]||metric.detail.en;card.append(detail)}return card};
|
|
94
|
-
const
|
|
94
|
+
const googleMetric=byMetricId.get("search.google-indexed");
|
|
95
|
+
const googleEstimate=byMetricId.get("search.google-site-estimate");
|
|
96
|
+
const primarySearchId=googleMetric?.status==="available"?"search.google-indexed":googleEstimate?.status==="estimate"?"search.google-site-estimate":"search.indexable-estimate";
|
|
97
|
+
const primaryIds=["pages.checked","pages.indexable","pages.sitemap",primarySearchId];
|
|
95
98
|
for(const id of primaryIds){const metric=byMetricId.get(id);if(metric)metricsHero.append(metricCard(metric,true))}
|
|
96
99
|
const checked=Number(byMetricId.get("pages.checked")?.value??0);const sitemap=Number(byMetricId.get("pages.sitemap")?.value??0);const coverage=sitemap>0?Math.min(100,Math.round(checked/sitemap*100)):null;
|
|
97
|
-
const coverageCard=document.createElement("article");coverageCard.className="metric-insight";coverageCard.innerHTML='<div class="metric-insight-head"><div><h3>'+(locale==="uk"?"\u041F\u043E\u043A\u0440\u0438\u0442\u0442\u044F sitemap":"Sitemap crawl coverage")+'</h3><span class="metric-detail">'+(locale==="uk"?"\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u0435\u043D\u043E URL \u0456\u0437 \u043F\u043E\u0442\u043E\u0447\u043D\u043E\u0457 sitemap":"Checked URLs from the current sitemap")+'</span></div><strong>'+(coverage===null?"\u2014":number(coverage)+"%")+'</strong></div><div class="coverage-track" role="img" aria-label="'+(coverage===null?"Unavailable":String(coverage)+"%")+'"><span style="width:'+(coverage??0)+'%"></span></div><div class="metric-legend"><span>'+number(checked)+' '+(locale==="uk"?"\u043F\u0435\u0440\u0435\u0432\u0456\u0440\u0435\u043D\u043E":"checked")+'</span><span>'+number(sitemap)+' '+(locale==="uk"?"\u0443 sitemap":"in sitemap")+'</span></div>';
|
|
100
|
+
const coverageCard=document.createElement("article");coverageCard.className="metric-insight";coverageCard.innerHTML='<div class="metric-insight-head"><div><h3>'+(locale==="uk"?"\u041F\u043E\u043A\u0440\u0438\u0442\u0442\u044F sitemap":"Sitemap crawl coverage")+'</h3><span class="metric-detail">'+(locale==="uk"?"\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u0435\u043D\u043E URL \u0456\u0437 \u043F\u043E\u0442\u043E\u0447\u043D\u043E\u0457 sitemap":"Checked URLs from the current sitemap")+'</span></div><strong>'+(coverage===null?"\u2014":number(coverage)+"%")+'</strong></div><div class="coverage-track" role="img" aria-label="'+(coverage===null?(locale==="uk"?"\u041D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u043E":"Unavailable"):String(coverage)+"%")+'"><span style="width:'+(coverage??0)+'%"></span></div><div class="metric-legend"><span>'+number(checked)+' '+(locale==="uk"?"\u043F\u0435\u0440\u0435\u0432\u0456\u0440\u0435\u043D\u043E":"checked")+'</span><span>'+number(sitemap)+' '+(locale==="uk"?"\u0443 sitemap":"in sitemap")+'</span></div>';
|
|
98
101
|
metricsInsights.append(coverageCard);
|
|
99
102
|
const httpIds=[["status.2xx","http-2xx"],["status.3xx","http-3xx"],["status.4xx","http-4xx"],["status.5xx","http-5xx"]];const httpValues=httpIds.map(([id])=>Number(byMetricId.get(id)?.value??0));const httpTotal=httpValues.reduce((sum,value)=>sum+value,0);const httpCard=document.createElement("article");httpCard.className="metric-insight";const httpHead=document.createElement("div");httpHead.className="metric-insight-head";httpHead.innerHTML='<div><h3>'+(locale==="uk"?"HTTP-\u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0456":"HTTP responses")+'</h3><span class="metric-detail">'+(locale==="uk"?"\u0420\u043E\u0437\u043F\u043E\u0434\u0456\u043B \u0441\u0442\u0430\u0442\u0443\u0441\u0456\u0432 \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u0435\u043D\u0438\u0445 \u0441\u0442\u043E\u0440\u0456\u043D\u043E\u043A":"Status distribution across checked pages")+'</span></div><strong>'+number(httpTotal)+'</strong>';const httpTrack=document.createElement("div");httpTrack.className="http-track";for(const [index,[,className]] of httpIds.entries()){if(httpValues[index]===0)continue;const segment=document.createElement("span");segment.className=className;segment.style.width=(httpValues[index]/Math.max(1,httpTotal)*100)+"%";httpTrack.append(segment)}const httpLegend=document.createElement("div");httpLegend.className="metric-legend";for(const [index,[id,className]] of httpIds.entries()){const item=document.createElement("span");item.innerHTML='<i class="'+className+'"></i>'+id.slice(7)+" "+number(httpValues[index]);httpLegend.append(item)}httpCard.append(httpHead,httpTrack,httpLegend);metricsInsights.append(httpCard);
|
|
100
103
|
const groups=[
|
|
101
|
-
{title:{en:"Search visibility",uk:"\u0412\u0438\u0434\u0438\u043C\u0456\u0441\u0442\u044C \u0443 \u043F\u043E\u0448\u0443\u043A\u0443"},description:{en:"Indexing connections and signals that can prevent discovery.",uk:"\u041F\u0456\u0434\u043A\u043B\u044E\u0447\u0435\u043D\u043D\u044F \u0434\u043E \u043F\u043E\u0448\u0443\u043A\u043E\u0432\u0438\u043A\u0456\u0432 \u0456 \u0441\u0438\u0433\u043D\u0430\u043B\u0438, \u0449\u043E \u043C\u043E\u0436\u0443\u0442\u044C \u0437\u0430\u0432\u0430\u0436\u0430\u0442\u0438 \u0456\u043D\u0434\u0435\u043A\u0441\u0430\u0446\u0456\u0457."},ids:["search.bing-indexed","pages.noindex","pages.robots-blocked"]},
|
|
104
|
+
{title:{en:"Search visibility",uk:"\u0412\u0438\u0434\u0438\u043C\u0456\u0441\u0442\u044C \u0443 \u043F\u043E\u0448\u0443\u043A\u0443"},description:{en:"Indexing connections and signals that can prevent discovery.",uk:"\u041F\u0456\u0434\u043A\u043B\u044E\u0447\u0435\u043D\u043D\u044F \u0434\u043E \u043F\u043E\u0448\u0443\u043A\u043E\u0432\u0438\u043A\u0456\u0432 \u0456 \u0441\u0438\u0433\u043D\u0430\u043B\u0438, \u0449\u043E \u043C\u043E\u0436\u0443\u0442\u044C \u0437\u0430\u0432\u0430\u0436\u0430\u0442\u0438 \u0456\u043D\u0434\u0435\u043A\u0441\u0430\u0446\u0456\u0457."},ids:["search.google-indexed","search.google-site-estimate","search.bing-indexed","pages.noindex","pages.robots-blocked"]},
|
|
102
105
|
{title:{en:"Content and assets",uk:"\u041A\u043E\u043D\u0442\u0435\u043D\u0442 \u0456 \u0440\u0435\u0441\u0443\u0440\u0441\u0438"},description:{en:"What the crawler found in page content and structured data.",uk:"\u0429\u043E crawler \u0437\u043D\u0430\u0439\u0448\u043E\u0432 \u0443 \u043A\u043E\u043D\u0442\u0435\u043D\u0442\u0456 \u0441\u0442\u043E\u0440\u0456\u043D\u043E\u043A \u0456 \u0441\u0442\u0440\u0443\u043A\u0442\u0443\u0440\u043E\u0432\u0430\u043D\u0438\u0445 \u0434\u0430\u043D\u0438\u0445."},ids:["pages.html","assets.images","commerce.products"]},
|
|
103
106
|
{title:{en:"Crawl performance",uk:"\u041F\u0440\u043E\u0434\u0443\u043A\u0442\u0438\u0432\u043D\u0456\u0441\u0442\u044C crawl"},description:{en:"Transfer volume, response timing, and HTTP status totals.",uk:"\u041E\u0431\u0441\u044F\u0433 \u043F\u0435\u0440\u0435\u0434\u0430\u043D\u0438\u0445 \u0434\u0430\u043D\u0438\u0445, \u0447\u0430\u0441 \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0456 \u0442\u0430 \u043A\u0456\u043B\u044C\u043A\u0456\u0441\u0442\u044C HTTP-\u0441\u0442\u0430\u0442\u0443\u0441\u0456\u0432."},ids:["crawl.average-time","crawl.transfer","status.2xx","status.3xx","status.4xx","status.5xx"]},
|
|
104
107
|
{title:{en:"Site architecture",uk:"\u0410\u0440\u0445\u0456\u0442\u0435\u043A\u0442\u0443\u0440\u0430 \u0441\u0430\u0439\u0442\u0443"},description:{en:"Internal structure, outbound references, and crawl depth.",uk:"\u0412\u043D\u0443\u0442\u0440\u0456\u0448\u043D\u044F \u0441\u0442\u0440\u0443\u043A\u0442\u0443\u0440\u0430, \u0437\u043E\u0432\u043D\u0456\u0448\u043D\u0456 \u043F\u043E\u0441\u0438\u043B\u0430\u043D\u043D\u044F \u0442\u0430 \u0433\u043B\u0438\u0431\u0438\u043D\u0430 crawl."},ids:["links.internal","links.external","crawl.max-depth"]},
|
|
@@ -126,17 +129,17 @@ ${e.history&&e.history.points.length>0?' <section id="history-panel" class="ana
|
|
|
126
129
|
}
|
|
127
130
|
for(const element of [search,severity,rule,template,owner,pageSize]){const update=()=>{currentPage=1;render()};element.addEventListener("input",update);element.addEventListener("change",update)}for(const tab of document.querySelectorAll("[data-tab]")){tab.addEventListener("click",()=>{setActiveTab(tab.dataset.tab);currentPage=1;render()})}for(const button of document.querySelectorAll("[data-view]")){button.addEventListener("click",()=>{for(const view of document.querySelectorAll("[data-report-view]"))view.hidden=view.dataset.reportView!==button.dataset.view;for(const candidate of document.querySelectorAll("[data-view]"))candidate.setAttribute("aria-selected",String(candidate===button))})}previous.addEventListener("click",()=>{currentPage-=1;render()});next.addEventListener("click",()=>{currentPage+=1;render()});clearFilters.addEventListener("click",()=>{search.value="";severity.value="";rule.value="";template.value="";owner.value="";setActiveTab("");currentPage=1;render()});language.addEventListener("change",()=>{locale=language.value;applyLocale()});
|
|
128
131
|
byId("export-csv").addEventListener("click",()=>{const text=copy();const quote=(value)=>'"'+String(value??"").replaceAll('"','""')+'"';const headers=[text.table.severity,text.table.lifecycle,text.table.ruleOwner,text.table.page,report.mode==="check"?text.table.change:text.table.finding,text.table.before,text.table.evidence,text.table.remediation,text.table.fingerprint];const rows=lastFiltered.map((item)=>{const localized=issueText(item);return [text.severities[item.severity],text.lifecycle[item.lifecycle]||item.lifecycle,localized.rule+" \xB7 "+text.owners[item.owner],item.url,localized.message,valueText(item.before),valueText(item.after!==undefined?item.after:item.evidence),localized.remediation,item.fingerprint]});const csv=[headers,...rows].map((row)=>row.map((value)=>quote(typeof value==="object"?JSON.stringify(value):value)).join(",")).join("\\n");const link=document.createElement("a");link.href=URL.createObjectURL(new Blob(["\\uFEFF",csv],{type:"text/csv;charset=utf-8"}));link.download="seo-crawl-audit-"+locale+".csv";link.click();URL.revokeObjectURL(link.href)});applyLocale();
|
|
129
|
-
</script></body></html>`}function
|
|
130
|
-
`,"utf8"),await yi(r,e)}async function
|
|
131
|
-
`,"utf8"),await
|
|
132
|
-
`),s;try{s=JSON.parse(n[0]??"")}catch{return await this.#r(t),null}if(!
|
|
133
|
-
`,"utf8")}),this.#t}async clear(t){if(await this.flush(),!(this.#e&&JSON.stringify(this.#e)!==JSON.stringify(t))){try{await
|
|
134
|
-
`),s;try{s=JSON.parse(n[0]??"")}catch{return{path:e,status:"corrupt",schemaVersion:null,siteUrl:null,completedPages:0,updatedAt:r,resumable:!1,message:"checkpoint header is not valid JSON"}}if(!s||typeof s!="object"||s.type!=="seo-audit-checkpoint")return{path:e,status:"incompatible",schemaVersion:null,siteUrl:null,completedPages:0,updatedAt:r,resumable:!1,message:"file is not an SEO Crawl Audit checkpoint"};let a=s,c=a.schemaVersion===1||a.schemaVersion===2?a.schemaVersion:null;if(c===null)return{path:e,status:"incompatible",schemaVersion:null,siteUrl:null,completedPages:0,updatedAt:r,resumable:!1,message:"checkpoint schema is not supported"};let l=c===2?a.identity?.siteUrl??null:a.source?.startUrl??null,o=new Set,
|
|
135
|
-
${t.error} error(s), ${t.warning} warning(s) detected.`)}import{createHash as
|
|
136
|
-
Sitemap contains ${e.toLocaleString("en-US")} page(s).`),console.log("How many pages should be scanned?"),console.log(" 1) First 100"),console.log(` 2) All ${e.toLocaleString("en-US")}`),console.log(" 3) 100 at a time with confirmation"),console.log(" Or enter an exact number, for example 500.");let t=
|
|
137
|
-
`)):(n.isTTY||e>=t||e%1e3===0)&&c(a)}function
|
|
138
|
-
`),n)}function
|
|
139
|
-
`),Nr(_),U&&console.log(`HTML report saved to ${U}`)),
|
|
132
|
+
</script></body></html>`}function Fd(e){return e.reduce((t,r)=>(t[r.severity]+=1,t),{error:0,warning:0,info:0})}function _t(e){if(e.length===0)return null;let r=[...new Map(e.map(c=>[`${c.generatedAt}|${c.configurationHash}|${c.pages.length}`,c])).values()].sort((c,l)=>c.generatedAt.localeCompare(l.generatedAt)),n=r.at(-1).siteUrl,s=r.filter(c=>c.siteUrl===n),a=s.map((c,l)=>{let o=Se(c),d=Fd(o),h=l>0?s[l-1]:void 0,m=h?kt(h,c):null;return{generatedAt:c.generatedAt,siteUrl:c.siteUrl,pages:c.pages.length,affectedPages:new Set(o.map(E=>E.url)).size,errors:d.error,warnings:d.warning,info:d.info,newIssues:m?.newIssues.length??0,resolvedIssues:m?.resolvedIssues.length??0,sitemapUrls:c.sitemap?.urls.length??0,maxDepth:c.pages.reduce((E,f)=>Math.max(E,f.depth),0),partial:c.partial||c.truncated}});return{siteUrl:n,points:a}}function K(e,t,r,n,s="count",a){return{id:e,label:t,value:r,unit:s,source:{id:"crawl",label:"SEO Crawl Audit"},observedAt:n,confidence:"high",status:"available",...a?{detail:a}:{}}}function Ci(e,t,r,n,s){return{id:e,label:t,value:null,unit:"count",source:r,observedAt:n,confidence:"high",status:"not-connected",...s?{detail:s}:{}}}function Ud(e,t,r,n,s){return{id:e,label:t,value:r,unit:"count",source:{id:"crawl-estimate",label:"SEO Crawl Audit"},observedAt:n,confidence:"low",status:"estimate",...s?{detail:s}:{}}}function bi(e){return[e.robots,e.xRobotsTag].some(t=>/(^|[\s,])noindex($|[\s,])/i.test(t??""))}function Cn(e,t){if(Array.isArray(e))return e.reduce((a,c)=>a+Cn(c,t),0);if(!e||typeof e!="object")return 0;let r=e,n=r["@type"];return(Array.isArray(n)?n.filter(a=>a===t).length:n===t?1:0)+Object.entries(r).filter(([a])=>a!=="@type").reduce((a,[,c])=>a+Cn(c,t),0)}function pr(e,t,r){return e.filter(n=>n.status!==null&&n.status>=t&&n.status<=r).length}function mr(e){let t=e.pages,r=e.generatedAt,n=t.filter(E=>/(?:text\/html|application\/xhtml\+xml)/i.test(E.contentType??"")),s=t.filter(bi),a=n.filter(E=>!E.error&&!E.blockedByRobots&&E.status!==null&&E.status>=200&&E.status<300&&!bi(E)),c=e.sitemap?.urls.length??0,l=c>t.length&&t.length>0?Math.min(c,Math.round(a.length/t.length*c)):a.length,o=new Set(t.flatMap(E=>E.images.map(f=>f.src).filter(f=>!!f))),d=t.reduce((E,f)=>E+f.jsonLd.reduce((y,w)=>y+(w.valid?Cn(w.value,"Product"):0),0),0),h=t.reduce((E,f)=>E+f.responseBytes,0),m=t.length>0?Math.round(e.statistics.durationMs/t.length):0;return{schemaVersion:1,siteUrl:e.siteUrl,observedAt:r,metrics:[K("pages.sitemap",{en:"Sitemap URLs",uk:"URL \u0443 sitemap"},c,r),K("pages.checked",{en:"Pages checked",uk:"\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u0435\u043D\u043E \u0441\u0442\u043E\u0440\u0456\u043D\u043E\u043A"},t.length,r),K("pages.html",{en:"HTML pages",uk:"HTML-\u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438"},n.length,r),K("pages.indexable",{en:"Crawlable HTML pages",uk:"\u0414\u043E\u0441\u0442\u0443\u043F\u043D\u0456 HTML-\u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438"},a.length,r,"count",{en:"Successful HTML pages without a detected noindex directive. This is not the Google index count.",uk:"\u0423\u0441\u043F\u0456\u0448\u043D\u0456 HTML-\u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438 \u0431\u0435\u0437 \u0432\u0438\u044F\u0432\u043B\u0435\u043D\u043E\u0457 \u0434\u0438\u0440\u0435\u043A\u0442\u0438\u0432\u0438 noindex. \u0426\u0435 \u043D\u0435 \u043A\u0456\u043B\u044C\u043A\u0456\u0441\u0442\u044C \u0441\u0442\u043E\u0440\u0456\u043D\u043E\u043A \u0432 \u0456\u043D\u0434\u0435\u043A\u0441\u0456 Google."}),Ud("search.indexable-estimate",{en:"Estimated indexable pages",uk:"\u041E\u0440\u0456\u0454\u043D\u0442\u043E\u0432\u043D\u0430 \u043A\u0456\u043B\u044C\u043A\u0456\u0441\u0442\u044C \u0456\u043D\u0434\u0435\u043A\u0441\u043E\u0432\u0430\u043D\u0438\u0445 \u0441\u0442\u043E\u0440\u0456\u043D\u043E\u043A"},l,r,{en:"Estimated from the crawlable-page ratio and sitemap size. This is not the number indexed by Google.",uk:"\u041E\u0446\u0456\u043D\u043A\u0430 \u0437\u0430 \u0447\u0430\u0441\u0442\u043A\u043E\u044E \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0438\u0445 \u0434\u043B\u044F \u0456\u043D\u0434\u0435\u043A\u0441\u0430\u0446\u0456\u0457 \u0441\u0442\u043E\u0440\u0456\u043D\u043E\u043A \u0456 \u0440\u043E\u0437\u043C\u0456\u0440\u043E\u043C sitemap. \u0426\u0435 \u043D\u0435 \u043A\u0456\u043B\u044C\u043A\u0456\u0441\u0442\u044C \u0441\u0442\u043E\u0440\u0456\u043D\u043E\u043A \u0432 \u0456\u043D\u0434\u0435\u043A\u0441\u0456 Google."}),Ci("search.google-indexed",{en:"Indexed by Google",uk:"\u041F\u0440\u043E\u0456\u043D\u0434\u0435\u043A\u0441\u043E\u0432\u0430\u043D\u043E Google"},{id:"google-search-console",label:"Google Search Console"},r,{en:"Connect an authoritative provider to confirm this value; crawlability is not proof of indexing.",uk:"\u041F\u0456\u0434\u043A\u043B\u044E\u0447\u0456\u0442\u044C \u0430\u0432\u0442\u043E\u0440\u0438\u0442\u0435\u0442\u043D\u0435 \u0434\u0436\u0435\u0440\u0435\u043B\u043E \u0434\u043B\u044F \u043F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0436\u0435\u043D\u043D\u044F; \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0456\u0441\u0442\u044C \u0434\u043B\u044F crawl \u043D\u0435 \u0434\u043E\u0432\u043E\u0434\u0438\u0442\u044C \u0456\u043D\u0434\u0435\u043A\u0441\u0430\u0446\u0456\u044E."}),Ci("search.bing-indexed",{en:"Indexed by Bing",uk:"\u041F\u0440\u043E\u0456\u043D\u0434\u0435\u043A\u0441\u043E\u0432\u0430\u043D\u043E Bing"},{id:"bing-webmaster",label:"Bing Webmaster Tools"},r,{en:"Connect an authoritative provider to confirm this value.",uk:"\u041F\u0456\u0434\u043A\u043B\u044E\u0447\u0456\u0442\u044C \u0430\u0432\u0442\u043E\u0440\u0438\u0442\u0435\u0442\u043D\u0435 \u0434\u0436\u0435\u0440\u0435\u043B\u043E \u0434\u043B\u044F \u043F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0436\u0435\u043D\u043D\u044F \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F."}),K("pages.noindex",{en:"Noindex pages",uk:"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0438 noindex"},s.length,r),K("pages.robots-blocked",{en:"Blocked by robots.txt",uk:"\u0417\u0430\u0431\u043B\u043E\u043A\u043E\u0432\u0430\u043D\u043E robots.txt"},t.filter(E=>E.blockedByRobots).length,r),K("assets.images",{en:"Unique images",uk:"\u0423\u043D\u0456\u043A\u0430\u043B\u044C\u043D\u0456 \u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u043D\u044F"},o.size,r),K("commerce.products",{en:"Product entities",uk:"\u0422\u043E\u0432\u0430\u0440\u0438 Product"},d,r),K("links.internal",{en:"Internal links",uk:"\u0412\u043D\u0443\u0442\u0440\u0456\u0448\u043D\u0456 \u043F\u043E\u0441\u0438\u043B\u0430\u043D\u043D\u044F"},e.linkGraph.internalEdges,r),K("links.external",{en:"External links",uk:"\u0417\u043E\u0432\u043D\u0456\u0448\u043D\u0456 \u043F\u043E\u0441\u0438\u043B\u0430\u043D\u043D\u044F"},e.linkGraph.externalEdges,r),K("crawl.max-depth",{en:"Maximum crawl depth",uk:"\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0430 \u0433\u043B\u0438\u0431\u0438\u043D\u0430"},Math.max(0,...t.map(E=>E.depth)),r),K("crawl.transfer",{en:"HTML transferred",uk:"\u041F\u0435\u0440\u0435\u0434\u0430\u043D\u043E HTML"},h,r,"bytes"),K("crawl.average-time",{en:"Average crawl time per page",uk:"\u0421\u0435\u0440\u0435\u0434\u043D\u0456\u0439 \u0447\u0430\u0441 \u043D\u0430 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443"},m,r,"milliseconds"),K("status.2xx",{en:"HTTP 2xx",uk:"HTTP 2xx"},pr(t,200,299),r),K("status.3xx",{en:"HTTP 3xx",uk:"HTTP 3xx"},pr(t,300,399),r),K("status.4xx",{en:"HTTP 4xx",uk:"HTTP 4xx"},pr(t,400,499),r),K("status.5xx",{en:"HTTP 5xx",uk:"HTTP 5xx"},pr(t,500,599),r)]}}function $e(e,t={}){return Se(e,t)}function gr(e,t,r={}){return kt(e,t,r)}import{access as Hd,mkdir as Qd,readFile as Ii,readdir as Yd,rename as yi,writeFile as wi}from"node:fs/promises";import{randomUUID as Ni}from"node:crypto";import{join as Si,resolve as fr}from"node:path";async function Er(e=process.cwd()){let t=fr(e,kr);try{return await Hd(t),t}catch{return null}}async function xt(e){let t=e?fr(e):await Er();if(!t)return{};try{return vr(JSON.parse(await Ii(t,"utf8")))}catch(r){throw new Error(`invalid config ${t}: ${r instanceof Error?r.message:String(r)}`,{cause:r})}}async function Tr(e,t){let r=`${e}.${process.pid}.${Ni()}.tmp`;await wi(r,`${JSON.stringify(t,null,2)}
|
|
133
|
+
`,"utf8"),await yi(r,e)}async function be(e){try{return we(JSON.parse(await Ii(e,"utf8")))}catch(t){throw t instanceof SyntaxError?new Error(`invalid snapshot JSON: ${e}`,{cause:t}):t instanceof Error&&t.message.startsWith("unsupported")?new Error(`unsupported or invalid baseline: ${e}`,{cause:t}):t}}async function Cr(e,t,r={}){let n=`${e}.${process.pid}.${Ni()}.tmp`;await wi(n,Ti(t,r),"utf8"),await yi(n,e)}function Gd(e){return`${e.generatedAt.replaceAll(":","-").replaceAll(".","-")}-${e.configurationHash.slice(0,8)}.snapshot.json`}async function bn(e,t){let r=fr(e);await Qd(r,{recursive:!0});let n=Si(r,Gd(t));return await Tr(n,t),n}async function Rt(e,t){let r=fr(e),n;try{n=await Yd(r)}catch(a){if(a&&typeof a=="object"&&"code"in a&&a.code==="ENOENT")return[];throw a}let s=[];for(let a of n.filter(c=>c.endsWith(".snapshot.json")).sort()){let c=Si(r,a),l=await be(c);(!t||l.siteUrl===t)&&s.push({path:c,snapshot:l})}return s.sort((a,c)=>a.snapshot.generatedAt.localeCompare(c.snapshot.generatedAt)||a.path.localeCompare(c.path))}import{appendFile as Kd,readFile as _i,rename as Wd,stat as Jd,unlink as jd,writeFile as Vd}from"node:fs/promises";function Xd(e){return{type:"seo-audit-checkpoint",schemaVersion:2,identity:e}}function Zd(e,t){if(!e||typeof e!="object")return!1;let r=e;if(r.type!=="seo-audit-checkpoint")return!1;if(r.schemaVersion===2)return JSON.stringify(r.identity)===JSON.stringify(t);if(r.schemaVersion!==1)return!1;let n=r.source;return n?.startUrl===t.siteUrl&&(n.sitemap??null)===t.sitemapUrl&&(n.includeQuery??!1)===t.includeQuery&&(n.respectRobots??!0)===t.respectRobots}var br=class{path;#e=null;#t=Promise.resolve();constructor(t){this.path=t}async#r(t){let r=`${this.path}.${process.pid}.${Date.now()}.tmp`;await Vd(r,`${JSON.stringify(Xd(t))}
|
|
134
|
+
`,"utf8"),await Wd(r,this.path),this.#e=t}async load(t){await this.flush();let r;try{r=await _i(this.path,"utf8")}catch(o){if(o.code!=="ENOENT")throw o;return await this.#r(t),null}let n=r.split(`
|
|
135
|
+
`),s;try{s=JSON.parse(n[0]??"")}catch{return await this.#r(t),null}if(!Zd(s,t))return await this.#r(t),null;this.#e=t;let a=new Map,c=n.slice(1),l=c.length-1;for(;l>=0&&!c[l]?.trim();)l-=1;for(let[o,d]of c.entries())if(d.trim())try{let h=JSON.parse(d);h.type==="page"&&typeof h.page?.url=="string"&&a.set(h.page.url,h.page)}catch(h){if(o!==l)throw new Error(`corrupt checkpoint record ${o+2} in ${this.path}`,{cause:h})}return{identity:t,pages:[...a.values()]}}append(t,r){return this.#t=this.#t.then(async()=>{(!this.#e||JSON.stringify(this.#e)!==JSON.stringify(t))&&await this.#r(t),await Kd(this.path,`${JSON.stringify({type:"page",page:r})}
|
|
136
|
+
`,"utf8")}),this.#t}async clear(t){if(await this.flush(),!(this.#e&&JSON.stringify(this.#e)!==JSON.stringify(t))){try{await jd(this.path)}catch(r){if(r.code!=="ENOENT")throw r}this.#e=null}}async flush(){await this.#t}};function In(e){return new br(e)}async function yn(e){let t,r;try{let[m,E]=await Promise.all([_i(e,"utf8"),Jd(e)]);t=m,r=E.mtime.toISOString()}catch(m){if(m.code==="ENOENT")return{path:e,status:"missing",schemaVersion:null,siteUrl:null,completedPages:0,updatedAt:null,resumable:!1,message:null};throw m}let n=t.split(`
|
|
137
|
+
`),s;try{s=JSON.parse(n[0]??"")}catch{return{path:e,status:"corrupt",schemaVersion:null,siteUrl:null,completedPages:0,updatedAt:r,resumable:!1,message:"checkpoint header is not valid JSON"}}if(!s||typeof s!="object"||s.type!=="seo-audit-checkpoint")return{path:e,status:"incompatible",schemaVersion:null,siteUrl:null,completedPages:0,updatedAt:r,resumable:!1,message:"file is not an SEO Crawl Audit checkpoint"};let a=s,c=a.schemaVersion===1||a.schemaVersion===2?a.schemaVersion:null;if(c===null)return{path:e,status:"incompatible",schemaVersion:null,siteUrl:null,completedPages:0,updatedAt:r,resumable:!1,message:"checkpoint schema is not supported"};let l=c===2?a.identity?.siteUrl??null:a.source?.startUrl??null,o=new Set,d=n.slice(1),h=d.length-1;for(;h>=0&&!d[h]?.trim();)h-=1;for(let[m,E]of d.entries())if(E.trim())try{let f=JSON.parse(E);f.type==="page"&&typeof f.page?.url=="string"&&o.add(f.page.url)}catch{if(m!==h)return{path:e,status:"corrupt",schemaVersion:c,siteUrl:l,completedPages:o.size,updatedAt:r,resumable:!1,message:`checkpoint record ${m+2} is corrupt`}}return{path:e,status:"ready",schemaVersion:c,siteUrl:l,completedPages:o.size,updatedAt:r,resumable:o.size>0,message:null}}import{extname as $d}from"node:path";function Ir(e){let t=$d(e);return t?`${e.slice(0,-t.length)}.checkpoint.ndjson`:`${e}.checkpoint.ndjson`}import{parseArgs as qd}from"node:util";function xi(e){return qd({args:e,allowPositionals:!0,strict:!0,options:{baseline:{type:"string"},config:{type:"string"},output:{type:"string"},report:{type:"string"},"no-report":{type:"boolean"},"no-cache":{type:"boolean"},pages:{type:"string"},all:{type:"boolean"},"max-pages":{type:"string"},concurrency:{type:"string"},delay:{type:"string"},timeout:{type:"string"},sitemap:{type:"string"},"no-sitemap":{type:"boolean"},"include-query":{type:"boolean"},"ignore-robots":{type:"boolean"},strict:{type:"boolean"},json:{type:"boolean"},help:{type:"boolean"},version:{type:"boolean"},production:{type:"string"},preview:{type:"string"},"headers-env":{type:"string"},"production-headers-env":{type:"string"},"preview-headers-env":{type:"string"},"history-dir":{type:"string"},"no-history":{type:"boolean"},from:{type:"string"},to:{type:"string"},directory:{type:"string"},workflow:{type:"string"},yes:{type:"boolean"},force:{type:"boolean"},offline:{type:"boolean"},platform:{type:"string"},port:{type:"string"},"no-open":{type:"boolean"},render:{type:"string"}}})}function Ri(e,t){return{...e,__config:t}}function yr(e,t,r,n=!1){if(e===void 0)return r;let s=Number.parseInt(e,10);if(!Number.isInteger(s)||s<(n?0:1))throw new Error(`${t} must be a ${n?"non-negative":"positive"} integer`);return s}function Lt(e,t,r){if(t.sitemap&&t["no-sitemap"])throw new Error("--sitemap and --no-sitemap cannot be used together");let n=r?.config??{},s=t.__config??{},a={url:e,schemaVersion:1,maxPages:yr(t.pages??t["max-pages"],t.pages!==void 0?"--pages":"--max-pages",s.maxPages??n.maxPages??100),concurrency:yr(t.concurrency,"--concurrency",s.concurrency??n.concurrency??5),delay:yr(t.delay,"--delay",s.delay??n.delay??100,!0),timeout:yr(t.timeout,"--timeout",s.timeout??n.timeout??1e4)};return t["no-sitemap"]?a.sitemap="none":t.sitemap&&(a.sitemap=t.sitemap),t["include-query"]!==void 0&&(a.includeQuery=t["include-query"]),t["ignore-robots"]!==void 0&&(a.respectRobots=!t["ignore-robots"]),ge(a,s,n)}import{dirname as oA,join as cA,resolve as oe}from"node:path";import{Buffer as zd}from"node:buffer";async function eA(e){if(e)return e;try{return await import("playwright")}catch(t){throw new Error("Playwright is not installed. Run: npm install --save-dev playwright && npx playwright install chromium",{cause:t})}}function tA(e){let t=0,r=[];return async function(){return t>=e&&await new Promise(s=>r.push(s)),t+=1,()=>{t-=1,r.shift()?.()}}}async function rA(e){let t=[],r=e.request().redirectedFrom();for(;r;){let n=await r.response(),s=await n?.headers();t.unshift({url:r.url(),status:n?.status()??0,location:s?.location??null}),r=r.redirectedFrom()}return t}async function Li(e={}){let t=e.concurrency??2;if(!Number.isInteger(t)||t<1)throw new Error("Playwright renderer concurrency must be a positive integer");let r=await eA(e.playwright),n;try{n=await r.chromium.launch({headless:e.headless??!0})}catch(o){throw new Error("Chromium could not start. Run: npx playwright install chromium",{cause:o})}let s=null,a=null,c=tA(t),l=!1;return{id:"playwright-chromium-v1",async render(o){if(l)throw new Error("Playwright renderer is closed");let d=await c(),h=null;try{if(o.signal?.throwIfAborted(),!s)s=await n.newContext({userAgent:o.userAgent,acceptDownloads:!1}),a=o.userAgent;else if(a!==o.userAgent)throw new Error("A Playwright renderer cannot mix user agents in one browser context");h=await s.newPage(),await h.route("**/*",async E=>{E.request().resourceType()==="media"?await E.abort():await E.continue()}),h.on("download",E=>{E.cancel()});let m=()=>{h?.close()};o.signal?.addEventListener("abort",m,{once:!0});try{let E=await h.goto(o.url,{waitUntil:"domcontentloaded",timeout:o.timeout});if(!E)throw new Error(`Playwright did not receive a document response for ${o.url}`);if((e.networkIdleTimeout??2e3)>0)try{await h.waitForLoadState("networkidle",{timeout:Math.min(o.timeout,e.networkIdleTimeout??2e3)})}catch(I){if(o.signal?.aborted)throw I}o.signal?.throwIfAborted();let f=await h.content(),y=zd.byteLength(f);if(y>o.maxResponseBytes)throw new Error(`rendered HTML exceeds ${o.maxResponseBytes} bytes`);let w=await E.headers();return{finalUrl:h.url(),status:E.status(),headers:w,html:f,responseBytes:y,redirectChain:await rA(E)}}finally{o.signal?.removeEventListener("abort",m)}}finally{await h?.close().catch(()=>{}),d()}},async close(){l||(l=!0,await s?.close(),await n.close())}}}var nA=process.stdout.isTTY&&!process.env.NO_COLOR;function wr(e,t){return nA?`\x1B[${e}m${t}\x1B[0m`:t}function Ot(e){return e.reduce((t,r)=>(t[r.severity]+=1,t),{error:0,warning:0,info:0})}function Nr(e){if(e.length===0){console.log(wr("32","\u2713 No SEO regressions detected."));return}for(let r of e){let n=r.severity==="error"?wr("31","\u2716 error"):r.severity==="warning"?wr("33","\u26A0 warning"):wr("34","\u2139 info");console.log(`${n} ${r.rule} ${r.url}`),console.log(` ${r.message}`),(r.before!==void 0||r.after!==void 0)&&(console.log(` before: ${JSON.stringify(r.before)}`),console.log(` after: ${JSON.stringify(r.after)}`))}let t=Ot(e);console.log(`
|
|
138
|
+
${t.error} error(s), ${t.warning} warning(s) detected.`)}import{createHash as sA}from"node:crypto";function Sr(e){if(!e)return{};let t=process.env[e];if(!t)throw new Error(`environment variable ${e} is empty or missing`);let r;try{r=JSON.parse(t)}catch(s){throw new Error(`environment variable ${e} must contain a JSON object`,{cause:s})}if(!r||typeof r!="object"||Array.isArray(r))throw new Error(`environment variable ${e} must contain a JSON object`);let n={};for(let[s,a]of Object.entries(r)){if(typeof a!="string")throw new Error(`header ${s} in ${e} must be a string`);try{new Headers({[s]:a})}catch(c){throw new Error(`header ${s} in ${e} is invalid`,{cause:c})}n[s]=a}return n}function wn(e,t,r=globalThis.fetch){if(Object.keys(e).length===0)return r;let n=new URL(t).origin;return(s,a)=>{let c=s instanceof Request?s.url:String(s);if(new URL(c).origin!==n)return r(s,a);let l=new Headers(s instanceof Request?s.headers:void 0);new Headers(a?.headers).forEach((o,d)=>l.set(d,o));for(let[o,d]of Object.entries(e))l.set(o,d);return r(s,{...a,headers:l})}}function Dt(e,t,r=globalThis.fetch){return wn(Sr(e),t,r)}function Nn(e,t){if(!t)return e;let r=sA("sha256").update(t).digest("hex").slice(0,12);return e.endsWith(".ndjson")?`${e.slice(0,-7)}.auth-${r}.ndjson`:`${e}.auth-${r}`}import{createInterface as iA}from"node:readline/promises";function Di(e,t){let r=e.trim().toLowerCase();if(r===""||r==="1")return{mode:"fixed",target:Math.min(100,t)};if(r==="2"||r==="all")return{mode:"all",target:t};if(r==="3"||r==="step")return{mode:"step",target:t};let n=Number.parseInt(r,10);return/^\d+$/.test(r)&&n>0?{mode:"fixed",target:Math.min(n,t)}:null}async function ve(e){let t=iA({input:process.stdin,output:process.stdout});try{return(await t.question(e)).trim()}finally{t.close()}}async function Bi(e){for(;;){console.log(`
|
|
139
|
+
Sitemap contains ${e.toLocaleString("en-US")} page(s).`),console.log("How many pages should be scanned?"),console.log(" 1) First 100"),console.log(` 2) All ${e.toLocaleString("en-US")}`),console.log(" 3) 100 at a time with confirmation"),console.log(" Or enter an exact number, for example 500.");let t=Di(await ve("Choose [1]: "),e);if(!t){console.log("Enter 1, 2, 3, all, step, or a positive number.");continue}if(t.mode==="all"){let r=await ve(`This will request ${e.toLocaleString("en-US")} pages. Continue? [y/N] `);if(!["y","yes"].includes(r.toLowerCase()))continue}return t}}function Oi(e){let t=Math.max(0,Math.round(e/1e3));if(t<60)return`${t}s`;let r=Math.floor(t/60),n=t%60;return`${r}m ${n}s`}function aA(e,t,r){let n=t===0?1:Math.min(e/t,1),s=(n*100).toFixed(n<.1?1:0),a=Math.round(n*20),c=`[${"\u2588".repeat(a)}${"\u2591".repeat(20-a)}] ${s}% \xB7 ${e.toLocaleString("en-US")} / ${t.toLocaleString("en-US")} pages`;if(!r)return c;let l=r.elapsedMs/6e4,o=l>0?e/l:0,d=Math.max(0,t-e),h=o>0?d/o*6e4:null,m=[`elapsed ${Oi(r.elapsedMs)}`,`${o.toFixed(o<10?1:0)} pages/min`,`ETA ${h===null?"\u2014":Oi(h)}`,`retries ${r.retries}`,`errors ${r.errors}`];if(r.currentUrl){let E=r.currentUrl.length>60?`${r.currentUrl.slice(0,57)}\u2026`:r.currentUrl;m.push(E)}return`${c} \xB7 ${m.join(" \xB7 ")}`}function Bt(e,t,r=!1,n=process.stdout,s){let a=aA(e,t,s),c=n===process.stderr?console.error:console.log;n.isTTY&&!r?(n.write(`\r${a}`),e>=t&&n.write(`
|
|
140
|
+
`)):(n.isTTY||e>=t||e%1e3===0)&&c(a)}function ki(e,t,r,n=process.stdout){let s=e.sitemap?`found, ${(e.candidateCount??e.sitemap.urls.length).toLocaleString("en-US")} URL(s)`:"not found; internal links",a=["Scan plan",` Target: ${e.startUrl}`,` Sitemap: ${s}`,` Robots: ${e.config.respectRobots?"respected":"ignored"}`,` Limit: ${t.target.toLocaleString("en-US")} page(s)`,` Concurrency: ${e.config.concurrency}`,` Delay: ${e.config.delay} ms`,` Checkpoint: ${r?"enabled":"disabled"}`];t.target>1e3&&a.push(" Notice: this is a large scan and may take a long time."),ae(a.join(`
|
|
141
|
+
`),n)}function vi(e,t,r=process.stdout,n=Date.now){let s=n(),a=0,c=0,l=new Set;return{retry(){a+=1},progress(o,d){(o.error||o.status!==null&&o.status>=400)&&!l.has(o.url)&&(l.add(o.url),c+=1);let h=(()=>{try{return new URL(o.url).pathname||"/"}catch{return o.url}})();Bt(d,e,t,r,{elapsedMs:n()-s,retries:a,errors:c,currentUrl:h})}}}function ae(e,t=process.stdout){t.isTTY&&t.write("\r\x1B[2K"),t===process.stderr?console.error(e):console.log(e)}function Sn(e){return e.reduce((t,r)=>((r.error||r.blockedByRobots||(r.status??500)>=400)&&(t.unavailable+=1),r.title||(t.missingTitle+=1),r.description||(t.missingDescription+=1),r.canonical||(t.missingCanonical+=1),r.h1Count===0&&(t.missingH1+=1),/(^|[\s,])noindex($|[\s,])/i.test(r.robots??"")&&(t.noindex+=1),t),{unavailable:0,missingTitle:0,missingDescription:0,missingCanonical:0,missingH1:0,noindex:0})}function _n(e){console.log(`Current health: ${e.unavailable} unavailable, ${e.missingTitle} missing title, ${e.missingDescription} missing description, ${e.missingCanonical} missing canonical, ${e.missingH1} missing H1, ${e.noindex} noindex.`)}var xr=".seo-audit.json",Mi="seo-audit-report.html",Pi=".seo-audit/history";function Rr(e){if(e.render!==void 0&&e.render!=="http"&&e.render!=="playwright")throw new Error("--render must be http or playwright")}async function _r(e){if(Rr(e),(e.render??"http")!=="http")return Li()}async function Fi(e,t){let r=oe(e??t.output??xr),n=Nn(Ir(r),t["headers-env"]),s=await yn(n),a=null;try{a=await be(r)}catch(l){if(l.code!=="ENOENT")throw l}let c={command:"status",snapshot:a?{path:r,siteUrl:a.siteUrl,pages:a.pages.length,generatedAt:a.generatedAt,partial:a.partial,truncated:a.truncated}:null,checkpoint:s};return t.json?(console.log(JSON.stringify(c,null,2)),0):(console.log("SEO Crawl Audit status"),a?(console.log(` Snapshot: ${r}`),console.log(` Site: ${a.siteUrl}`),console.log(` Last completed result: ${a.pages.length.toLocaleString("en-US")} page(s) at ${a.generatedAt}`)):console.log(` Snapshot: not found (${r})`),s.status==="missing"?console.log(` Checkpoint: not found (${n})`):(console.log(` Checkpoint: ${s.status} (${n})`),s.siteUrl&&console.log(` Checkpoint site: ${s.siteUrl}`),console.log(` Saved pages: ${s.completedPages.toLocaleString("en-US")}`),s.updatedAt&&console.log(` Updated: ${s.updatedAt}`),s.message&&console.log(` Detail: ${s.message}`),s.resumable&&console.log(" Resume: run the same scan command again to reuse saved pages.")),0)}function Ui(e,t=!1){return t||!e["no-report"]&&(e.report!==void 0||process.stdin.isTTY&&process.stdout.isTTY&&!e.json)}async function qe(e,t,r=!1){if(!Ui(e,r))return null;let n=oe(e.report??Mi);return await Cr(n,t),n}function se(e,t,r){if(!e)return e;try{let n=new URL(t),s=new URL(r),a=new URL(e);if(a.origin!==n.origin)return e;a.protocol=s.protocol,a.host=s.host;let c=n.pathname.replace(/\/$/,""),l=s.pathname.replace(/\/$/,"");return c&&a.pathname.startsWith(c)&&(a.pathname=`${l}${a.pathname.slice(c.length)}`||"/"),a.href}catch{return e}}function lA(e,t,r){let n=s=>s.map(a=>se(a,t,r)??a).sort();return{...e,url:se(e.url,t,r)??e.url,finalUrl:se(e.finalUrl,t,r),canonical:se(e.canonical,t,r),canonicalRaw:se(e.canonicalRaw,t,r),links:n(e.links),internalLinks:n(e.internalLinks),externalLinks:n(e.externalLinks),images:e.images.map(s=>({...s,src:se(s.src,t,r)})),hreflang:e.hreflang.map(s=>({...s,url:se(s.url,t,r)})),redirectChain:e.redirectChain.map(s=>({...s,url:se(s.url,t,r)??s.url,location:se(s.location,t,r)}))}}function Pe(e,t,r=$e(e),n={}){return{mode:t,startUrl:e.siteUrl,generatedAt:e.generatedAt,pages:e.pages,issues:r,partial:e.partial,engineVersion:e.engineVersion,ruleSetVersion:e.ruleSetVersion,branding:e.config.report,siteMetrics:mr(e),...n}}function Hi(e,t){return e["history-dir"]?oe(e["history-dir"]):t?cA(oA(t),Pi):oe(Pi)}async function xn(e,t,r,n){if(e["no-history"])return;let s=Hi(e,r);n&&!t.partial&&await bn(s,t);let a=await Rt(s,t.siteUrl);return _t(a.map(c=>c.snapshot))??void 0}async function dA(e,t,r,n,s){let a=Lt(e,t,r),c=t.json?process.stderr:process.stdout,l=d=>{d.type==="plan-start"&&ae(`Preparing crawl plan for ${d.url}`,c),d.type==="robots"&&ae(d.robots.error?`robots.txt check failed: ${d.robots.error}`:`robots.txt checked (${d.robots.status??"unknown status"})`,c),d.type==="sitemap"&&ae(d.sitemap?`Sitemap loaded: ${d.candidateCount??d.sitemap.urls.length} candidate URL(s)`:"No sitemap found; internal-link discovery will be used",c)},o=await le(a,{signal:s,fetch:n,onEvent:l});if(o.mode==="links"&&a.sitemap==="auto"&&process.stdin.isTTY&&process.stdout.isTTY&&!t.json){let d=await ve("Sitemap was not found. Enter its full URL, or press Enter to crawl internal links: ");d&&(a={...a,sitemap:d},o=await le(a,{signal:s,fetch:n,onEvent:l}))}return o}function Qi(e,t){if(e.candidateCount===null){if(t.all)throw new Error("--all requires a sitemap");return{mode:"fixed",target:e.config.maxPages}}return t.all?{mode:"all",target:e.candidateCount}:t.pages!==void 0||t["max-pages"]!==void 0?{mode:"fixed",target:Math.min(e.config.maxPages,e.candidateCount)}:process.stdin.isTTY&&process.stdout.isTTY&&!t.json?Bi(e.candidateCount):{mode:"fixed",target:Math.min(100,e.candidateCount)}}async function Yi(e,t,r){if(!e)throw new Error("scan requires a URL");Rr(t);let n=oe(t.output??xr),s=Dt(t["headers-env"],e),a=await dA(e,t,void 0,s,r),c=await Qi(a,t),l=Nn(Ir(n),t["headers-env"]),o=t["no-cache"]?void 0:In(l),d=t.json?process.stderr:process.stdout;ki(a,c,!!o,d);let h=new Map,m=Ui(t)?oe(t.report??Mi):null,E=0,f=-1,y=async(Y=!1)=>{if(!m||h.size===0)return;let F=Date.now();if(!Y&&h.size-f<100&&F-E<5e3)return;let v=we({schemaVersion:1,startUrl:a.startUrl,robots:a.robots,sitemap:a.sitemap,options:{...a.config,maxPages:c.target},pages:[...h.values()],partial:!0,truncated:!0});await Cr(m,Pe(v,"scan",$e(v),{partial:!0,targetPages:c.target})),E=F,f=h.size},w=c.mode==="step"?Math.min(100,c.target):c.target,I=null,_=!1,S=await _r(t);try{for(;w>0;){let Y=vi(w,c.mode==="step",d);I=await Ze(a,{signal:r,fetch:s,renderer:S,limit:w,checkpointStore:o,retainCheckpoint:c.mode==="step"&&w<c.target,async onBatch(D){for(let N of D)h.set(N.url,N);await y()},onEvent(D){D.type==="scan-start"&&ae(`Starting crawl: up to ${D.total.toLocaleString("en-US")} page(s)`,t.json?process.stderr:process.stdout),D.type==="resume"&&ae(`Resuming from checkpoint: ${D.completed.toLocaleString("en-US")} page(s) already available`,t.json?process.stderr:process.stdout),D.type==="retry"&&(Y.retry(),ae(`Retrying request (attempt ${D.attempt}) after ${D.delayMs} ms`,d)),D.type==="progress"&&Y.progress(D.page,D.completed),D.type==="cancelled"&&ae(`Scan interrupted after ${D.completed.toLocaleString("en-US")} page(s)`,t.json?process.stderr:process.stdout)}});for(let D of I.pages)h.set(D.url,D);if(await y(!0),I.partial||c.mode!=="step"||w>=c.target)break;_n(Sn(I.pages));let F=Math.min(100,c.target-w),v=await ve(`Check the next ${F} page(s)? [y/N] `);if(!["y","yes"].includes(v.toLowerCase())){_=!0;break}w=Math.min(c.target,w+100)}}finally{await S?.close?.()}if(!I)throw new Error("scan did not produce a result");await Tr(n,I.snapshot);let R=I.partial||_,U=await xn(t,I.snapshot,n,!R),x=R?m:await qe(t,Pe(I.snapshot,"scan",$e(I.snapshot),U?{history:U}:{})),k=Sn(I.snapshot.pages);return t.json?console.log(JSON.stringify({command:"scan",pages:I.snapshot.pages.length,truncated:I.snapshot.truncated,health:k,output:n,report:x,checkpoint:R&&o?l:null},null,2)):(console.log(`Crawled ${I.snapshot.pages.length} page(s)${I.snapshot.truncated?" (limit reached)":""}.`),I.snapshot.sitemap&&console.log(`Loaded ${I.snapshot.sitemap.sitemapCount} sitemap file(s) from ${I.snapshot.sitemap.url}.`),_n(k),console.log(`Baseline saved to ${n}`),x&&console.log(`HTML report saved to ${x}`),R&&o&&console.log(`Resume checkpoint saved to ${l}`)),I.partial?130:0}async function Gi(e,t,r){Rr(t);let n=oe(t.baseline??xr),s=await be(n),a=e??s.siteUrl,c=Dt(t["headers-env"],a),l=await le({...Lt(a,t,s),sitemap:"none"},{signal:r,fetch:c}),o=s.pages.map(x=>({baselineUrl:x.url,targetUrl:se(x.url,s.siteUrl,l.startUrl)??x.url})),d=[...new Set(o.map(({targetUrl:x})=>x))],h={...l,mode:"sitemap",candidateUrls:d,candidateCount:d.length,sitemap:{url:`${l.origin}/.seo-audit-targets`,urls:d,sitemapCount:0,truncated:!1,error:null}},m=await _r(t),E;try{E=await Ze(h,{signal:r,fetch:c,renderer:m,limit:d.length,onEvent(x){x.type==="scan-start"&&ae(`Starting regression check: ${x.total.toLocaleString("en-US")} page(s)`,t.json?process.stderr:process.stdout),x.type==="progress"&&Bt(x.completed,d.length,!1,t.json?process.stderr:process.stdout)}})}finally{await m?.close?.()}let f=new Map(E.pages.map(x=>[x.url,x])),y=o.flatMap(({baselineUrl:x,targetUrl:k})=>{let Y=f.get(k);return Y?[{...Y,url:x,finalUrl:se(Y.finalUrl,l.startUrl,s.siteUrl)}]:[]}),w=we({...E.snapshot,siteUrl:s.siteUrl,config:{...E.snapshot.config,url:s.siteUrl},sitemap:s.sitemap,pages:y}),I=gr(s,w,{enabledRules:w.config.enabledRules,severityOverrides:w.config.severityOverrides,suppressions:w.config.suppressions}),_=I.newIssues,S=Ot(_),R=await xn(t,w,n,!E.partial),U=await qe(t,Pe(w,"check",_,{...I,...R?{history:R}:{}}));return t.json?console.log(JSON.stringify({command:"check",baseline:n,pages:w.pages.length,summary:S,issues:_,lifecycle:I,report:U},null,2)):(console.log(`Checked ${w.pages.length} page(s).
|
|
142
|
+
`),Nr(_),U&&console.log(`HTML report saved to ${U}`)),E.partial?130:S.error>0||I.budgetExceeded.length>0||t.strict&&S.warning>0?1:0}async function Ki(e,t){Rr(e);let r=e.production,n=e.preview;if(!r||!n)throw new Error("compare requires --production and --preview URLs");let s=Dt(e["production-headers-env"],r),a=Dt(e["preview-headers-env"],n),c=await le(Lt(r,e),{signal:t,fetch:s}),l=await Qi(c,e),o=await _r(e),d;try{d=await Ze(c,{signal:t,fetch:s,renderer:o,limit:l.target,onEvent(x){x.type==="scan-start"&&ae(`Starting production crawl: up to ${x.total.toLocaleString("en-US")} page(s)`,e.json?process.stderr:process.stdout),x.type==="progress"&&Bt(x.completed,l.target,!1,e.json?process.stderr:process.stdout)}})}finally{await o?.close?.()}if(d.partial)return 130;let h=await le({...Lt(n,e),sitemap:"none"},{signal:t,fetch:a}),m=d.snapshot.pages.map(x=>se(x.url,r,n)??x.url),E={...h,mode:"sitemap",candidateUrls:[...new Set(m)].sort(),candidateCount:m.length,sitemap:{url:`${h.origin}/.seo-audit-preview-targets`,urls:[...new Set(m)].sort(),sitemapCount:0,truncated:!1,error:null}},f=await _r(e),y;try{y=await Ze(E,{signal:t,fetch:a,renderer:f,limit:m.length,onEvent(x){x.type==="scan-start"&&ae(`Starting preview crawl: ${x.total.toLocaleString("en-US")} page(s)`,e.json?process.stderr:process.stdout),x.type==="progress"&&Bt(x.completed,m.length,!1,e.json?process.stderr:process.stdout)}})}finally{await f?.close?.()}let w=y.snapshot.pages.map(x=>lA(x,n,r)),I=we({...y.snapshot,siteUrl:d.snapshot.siteUrl,startUrl:d.snapshot.siteUrl,config:{...y.snapshot.config,url:d.snapshot.siteUrl},robots:{...y.snapshot.robots,url:se(y.snapshot.robots.url,n,r)??y.snapshot.robots.url},sitemap:d.snapshot.sitemap,pages:w,partial:y.snapshot.partial}),_=gr(d.snapshot,I,{enabledRules:I.config.enabledRules,severityOverrides:I.config.severityOverrides,suppressions:I.config.suppressions}),S=_.newIssues,R=Ot(S),U=await qe(e,Pe(I,"check",S,{..._,comparison:{kind:"preview",productionUrl:r,previewUrl:n}}),!0);return e.json?console.log(JSON.stringify({command:"compare",production:r,preview:n,pages:I.pages.length,summary:R,issues:S,lifecycle:_,report:U},null,2)):(console.log(`Compared ${I.pages.length} production page(s) with preview.`),Nr(S),U&&console.log(`HTML report saved to ${U}`)),y.partial?130:R.error>0||_.budgetExceeded.length>0||e.strict&&R.warning>0?1:0}async function Wi(e,t){let r=oe(e??t.baseline??xr),n=await be(r),s=await xn(t,n,r,!1),a=await qe(t,Pe(n,"scan",$e(n),s?{history:s}:{}),!0);return t.json?console.log(JSON.stringify({command:"report",baseline:r,pages:n.pages.length,report:a},null,2)):console.log(`HTML report saved to ${a}`),0}async function Ji(e,t){if(!!t.from!=!!t.to)throw new Error("history comparison requires both --from and --to");let r=Hi(t);if(t.from&&t.to){let d=await be(oe(t.from)),h=await be(oe(t.to));if(d.siteUrl!==h.siteUrl)throw new Error("history snapshots must belong to the same site URL");let m=await Rt(r,h.siteUrl),E=_t([...m.map(I=>I.snapshot),d,h]),f=gr(d,h,{enabledRules:h.config.enabledRules,severityOverrides:h.config.severityOverrides,suppressions:h.config.suppressions}),y=await qe(t,Pe(h,"check",f.newIssues,{...f,...E?{history:E}:{}}),!0),w=Ot(f.newIssues);return t.json?console.log(JSON.stringify({command:"history",from:oe(t.from),to:oe(t.to),summary:w,lifecycle:f,report:y},null,2)):(console.log(`Compared local snapshots from ${d.generatedAt} to ${h.generatedAt}.`),Nr(f.newIssues),y&&console.log(`HTML report saved to ${y}`)),0}let n;if(e)try{n=new URL(e).href}catch{throw new Error("history URL must be an HTTP(S) URL")}let s=await Rt(r,n);if(s.length===0)throw new Error(`no local history snapshots found in ${r}`);if(!n){let d=s.at(-1).snapshot.siteUrl;s=s.filter(h=>h.snapshot.siteUrl===d)}let a=s.at(-1),c=_t(s.map(d=>d.snapshot)),l=await qe(t,Pe(a.snapshot,"scan",$e(a.snapshot),c?{history:c}:{}),!0),o=c?.points??[];if(t.json)console.log(JSON.stringify({command:"history",directory:r,snapshots:s.map((d,h)=>({path:d.path,...o[h]})),report:l},null,2));else{console.log(`Local history for ${a.snapshot.siteUrl}:`);for(let[d,h]of s.entries()){let m=o[d];console.log(` ${h.snapshot.generatedAt} ${m?.pages??h.snapshot.pages.length} pages ${m?.errors??0} errors ${m?.warnings??0} warnings ${h.path}`)}l&&console.log(`HTML report saved to ${l}`)}return 0}import{mkdir as Xi,readFile as AA,writeFile as Zi}from"node:fs/promises";import{dirname as $i,isAbsolute as uA,join as Rn,resolve as ji}from"node:path";var hA="https://raw.githubusercontent.com/MelnixDev/seo-crawl-audit/v0/packages/core/config.schema.json",pA="seo-audit.config.json",mA=".github/workflows/seo-audit.yml",gA=[".seo-audit.checkpoint.ndjson",".seo-audit/history/","seo-audit-report.html","seo-audit-report.html.json"];function fA(e){let t;try{t=new URL(e)}catch(r){throw new Error("init URL must be a full HTTP(S) URL",{cause:r})}if(!["http:","https:"].includes(t.protocol))throw new Error("init URL must be a full HTTP(S) URL");return t.hash="",t.href}function EA(e){let t=(e??"none").trim().toLowerCase(),n={"":"none",none:"none",manual:"manual",scheduled:"scheduled",schedule:"scheduled","pull-request":"pull-request",pull_request:"pull-request",pr:"pull-request"}[t];if(!n)throw new Error("--workflow must be none, manual, scheduled, or pull-request");return n}function TA(e){return`${JSON.stringify({$schema:hA,url:e,sitemap:"auto",maxPages:100,concurrency:5,delay:100,timeout:1e4,respectRobots:!0,includeQuery:!1,maxRedirects:10,maxResponseBytes:5*1024*1024,enabledRules:null,severityOverrides:{},suppressions:[],regressionBudgets:{error:0},report:{}},null,2)}
|
|
140
143
|
`}function Ln(e="",t=""){return` - uses: actions/checkout@v6${t}
|
|
141
144
|
- name: Run SEO Crawl Audit
|
|
142
145
|
id: seo
|
|
@@ -154,7 +157,7 @@ Sitemap contains ${e.toLocaleString("en-US")} page(s).`),console.log("How many p
|
|
|
154
157
|
\${{ steps.seo.outputs.report }}
|
|
155
158
|
\${{ steps.seo.outputs.summary }}
|
|
156
159
|
if-no-files-found: warn
|
|
157
|
-
`}function
|
|
160
|
+
`}function CA(e){return e==="manual"?`name: SEO audit
|
|
158
161
|
|
|
159
162
|
on:
|
|
160
163
|
workflow_dispatch:
|
|
@@ -206,20 +209,20 @@ ${Ln(`
|
|
|
206
209
|
if [ ! -f .seo-audit.json ]; then
|
|
207
210
|
echo "Commit .seo-audit.json as the production baseline." >&2
|
|
208
211
|
exit 1
|
|
209
|
-
fi`)}`}function
|
|
212
|
+
fi`)}`}function qi(e){return e&&typeof e=="object"&&"code"in e&&typeof e.code=="string"?e.code:void 0}async function zi(e){try{return await AA(e,"utf8")}catch(t){if(qi(t)==="ENOENT")return null;throw t}}async function bA(e,t){if(t.force)return!0;if(!t.interactive||!t.ask)return!1;let r=await t.ask(`${e} already exists. Replace it? [y/N] `);return["y","yes"].includes(r.trim().toLowerCase())}async function Vi(e,t,r){let n=await zi(e);if(n===t)return{path:e,status:"unchanged"};if(n!==null&&!await bA(e,r))return{path:e,status:"skipped"};await Xi($i(e),{recursive:!0});try{await Zi(e,t,n===null?{encoding:"utf8",flag:"wx"}:{encoding:"utf8"})}catch(s){if(n===null&&qi(s)==="EEXIST")return{path:e,status:"skipped"};throw s}return{path:e,status:n===null?"created":"updated"}}async function IA(e,t){let r=await zi(e),n=new Set((r??"").split(/\r?\n/u)),s=gA.filter(o=>!n.has(o));if(s.length===0)return{path:e,status:"unchanged"};if(r!==null&&!t.force&&!t.yes){if(!t.interactive||!t.ask)return{path:e,status:"skipped"};let o=await t.ask(`Add SEO Crawl Audit recommendations to ${e}? [Y/n] `);if(["n","no"].includes(o.trim().toLowerCase()))return{path:e,status:"skipped"}}let a=r&&!r.endsWith(`
|
|
210
213
|
`)?`
|
|
211
214
|
`:"",c=r===null||!r.includes("# SEO Crawl Audit")?`# SEO Crawl Audit
|
|
212
215
|
`:"",l=`${a}${c}${s.join(`
|
|
213
216
|
`)}
|
|
214
|
-
`;return await Vi(Zi(e),{recursive:!0}),await Xi(e,`${r??""}${l}`,"utf8"),{path:e,status:r===null?"created":"updated"}}async function Id(e={}){let t=Ji(e.directory??process.cwd()),r=e.interactive??!!(process.stdin.isTTY&&process.stdout.isTTY),n=e.ask??ve,s=e.url?.trim()??"";if(!s&&r&&!e.yes&&(s=await n("Full site URL: ")),!s)throw new Error("init requires a full site URL");let a=md(s),c=e.workflow;c===void 0&&r&&!e.yes&&(c=await n("GitHub workflow [none/manual/scheduled/pull-request] (none): "));let l=gd(c),o=e.configPath?Ad(e.configPath)?e.configPath:Ji(t,e.configPath):Rn(t,ud),A={force:e.force??!1,yes:e.yes??!1,interactive:r,ask:n},u=[await ji(o,fd(a),A),await Cd(Rn(t,".gitignore"),A)];return l!=="none"&&u.push(await ji(Rn(t,hd),Ed(l),A)),{directory:t,url:a,workflow:l,files:u}}async function zi(e,t){let r=await Id({...t.directory!==void 0?{directory:t.directory}:{},...e!==void 0?{url:e}:{},...t.config!==void 0?{configPath:t.config}:{},...t.workflow!==void 0?{workflow:t.workflow}:{},...t.yes!==void 0?{yes:t.yes}:{},...t.force!==void 0?{force:t.force}:{}});if(t.json)return console.log(JSON.stringify({command:"init",...r},null,2)),0;console.log(`Initialized SEO Crawl Audit for ${r.url}`);for(let n of r.files)console.log(` ${n.status.padEnd(9)} ${n.path}`);return r.workflow==="pull-request"&&console.log("Set the SEO_AUDIT_PREVIEW_URL repository variable and commit .seo-audit.json before enabling the PR check."),console.log("Review seo-audit.config.json, then run: seo-audit scan"),0}import{access as bd,stat as yd}from"node:fs/promises";import{constants as wd}from"node:fs";import{dirname as On,isAbsolute as Nd,resolve as Dn}from"node:path";var ea=[20,19,0],Sd=".seo-audit.json",_d="seo-audit-report.html",xd=".seo-audit/history";function Rd(e){let t=/^(\d+)\.(\d+)\.(\d+)/u.exec(e);return t?[Number(t[1]),Number(t[2]),Number(t[3])]:[0,0,0]}function Ld(e){let t=Rd(e);for(let r=0;r<ea.length;r+=1){let n=t[r]??0,s=ea[r]??0;if(n>s)return!0;if(n<s)return!1}return!0}function Od(e){try{let t=new URL(e);return["http:","https:"].includes(t.protocol)?(t.hash="",t.href):null}catch{return null}}function Lr(e,t){return Nd(t)?t:Dn(e,t)}async function Dd(e){let t=Dn(e);for(;;){try{if((await yd(t)).isDirectory())return t}catch(n){if(!n||typeof n!="object"||!("code"in n)||n.code!=="ENOENT")throw n}let r=On(t);if(r===t)throw new Error(`no existing parent directory for ${e}`);t=r}}async function Bd(e,t){let r=[On(Lr(e,t.outputPath??Sd)),...t.reportEnabled===!1?[]:[On(Lr(e,t.reportPath??_d))],...t.historyEnabled===!1?[]:[Lr(e,t.historyPath??xd)]];try{let n=[...new Set(await Promise.all(r.map(Dd)))];return await Promise.all(n.map(s=>bd(s,wd.W_OK))),{id:"storage",status:"pass",message:`Output locations are writable through ${n.join(", ")}`,evidence:{directories:n}}}catch(n){return{id:"storage",status:"fail",message:n instanceof Error?n.message:String(n),remediation:"Create the output directory or grant the current user write access."}}}function kd(e,t){let r=AbortSignal.timeout(e);return t?AbortSignal.any([t,r]):r}async function vd(e,t,r,n){try{let s=await r(e,{headers:{accept:"text/html,application/xhtml+xml;q=0.9,*/*;q=0.1","user-agent":`SEO-Crawl-Audit-Doctor/${V}`},redirect:"follow",signal:kd(t.timeout,n)}),a=s.headers.get("content-type")??"";return await s.body?.cancel(),s.status>=400?{id:"homepage",status:"fail",message:`Start URL returned HTTP ${s.status}`,remediation:s.status===401||s.status===403?"Configure authenticated request headers before auditing this site.":"Confirm that the URL is correct and publicly reachable.",evidence:{status:s.status,contentType:a}}:a.toLowerCase().includes("html")?{id:"homepage",status:"pass",message:`Start URL returned HTTP ${s.status} HTML`,evidence:{status:s.status,contentType:a}}:{id:"homepage",status:"warning",message:`Start URL returned ${a||"an unknown content type"}`,remediation:"Use a URL that returns server-rendered HTML.",evidence:{status:s.status,contentType:a}}}catch(s){return n?.throwIfAborted(),{id:"homepage",status:"fail",message:`Could not request the start URL: ${s instanceof Error?s.message:String(s)}`,remediation:"Check DNS, TLS, firewall access, and the configured timeout."}}}function Pd(e){return e.reduce((t,r)=>(t[r.status]+=1,t),{pass:0,warning:0,fail:0,skipped:0})}async function Md(e={}){let t=Dn(e.directory??process.cwd()),r=[],n=e.runtimeVersion??process.versions.node;r.push(Ld(n)?{id:"runtime",status:"pass",message:`Node.js ${n} satisfies >=20.19`}:{id:"runtime",status:"fail",message:`Node.js ${n} is older than 20.19`,remediation:"Install Node.js 20.19 or newer on the machine running SEO Crawl Audit."});let a=(e.configPath?Lr(t,e.configPath):null)??await Er(t),c={};if(!a)r.push({id:"config",status:"warning",message:"seo-audit.config.json was not found",remediation:"Run seo-audit init <url> to create a safe project configuration."});else try{c=await xt(a),r.push({id:"config",status:"pass",message:`Configuration is valid: ${a}`,evidence:{path:a}})}catch(m){r.push({id:"config",status:"fail",message:m instanceof Error?m.message:String(m),remediation:"Fix the reported property or regenerate the file with seo-audit init --force."})}let l=e.url??c.url??"",o=Od(l);o?r.push({id:"target",status:"pass",message:`Target URL is ${o}`,evidence:{url:o}}):r.push({id:"target",status:"fail",message:l?"Target is not a full HTTP(S) URL":"No target URL was provided",remediation:"Pass seo-audit doctor https://example.com/ or set url in seo-audit.config.json."}),r.push(await Bd(t,e));let A=e.offline??!1;if(A||!o){let m=A?"Skipped by --offline":"Skipped because the target URL is invalid";for(let T of["homepage","robots","sitemap"])r.push({id:T,status:"skipped",message:m})}else{let m=ge({url:o},c),T=wn(e.requestHeaders??{},o,e.fetch??globalThis.fetch);r.push(await vd(o,m,T,e.signal));try{let f=await le(m,{fetch:T,signal:e.signal});f.robots.denyAll&&m.respectRobots?r.push({id:"robots",status:"fail",message:`robots.txt returned HTTP ${f.robots.status??"unknown"} and blocks crawling`,remediation:"Allow the audit user agent or explicitly choose --ignore-robots when authorized.",evidence:{url:f.robots.url,status:f.robots.status,denyAll:!0}}):f.robots.error||f.robots.status===null||(f.robots.status??500)>=400?r.push({id:"robots",status:"warning",message:f.robots.error??`robots.txt returned HTTP ${f.robots.status??"unknown"}`,remediation:"Publish a readable robots.txt when crawler policy needs to be explicit.",evidence:{url:f.robots.url,status:f.robots.status}}):r.push({id:"robots",status:"pass",message:`robots.txt returned HTTP ${f.robots.status}`,evidence:{url:f.robots.url,status:f.robots.status,denyAll:f.robots.denyAll??!1}}),m.sitemap==="none"?r.push({id:"sitemap",status:"skipped",message:"Sitemap discovery is disabled by configuration"}):f.sitemap?f.sitemap.error?r.push({id:"sitemap",status:m.sitemap==="auto"?"warning":"fail",message:f.sitemap.error,remediation:"Check the sitemap URL, XML syntax, response size, and HTTP status.",evidence:{url:f.sitemap.url}}):f.sitemap.urls.length===0?r.push({id:"sitemap",status:"warning",message:`Sitemap contains no crawlable same-origin URLs: ${f.sitemap.url}`,remediation:"Add canonical site URLs to the sitemap or verify the configured site origin."}):r.push({id:"sitemap",status:"pass",message:`Loaded ${f.sitemap.urls.length} URL(s) from ${f.sitemap.sitemapCount} sitemap file(s)`,evidence:{url:f.sitemap.url,urls:f.sitemap.urls.length,sitemapCount:f.sitemap.sitemapCount,truncated:f.sitemap.truncated}}):r.push({id:"sitemap",status:"warning",message:"No sitemap was discovered",remediation:"Publish a sitemap or set sitemap to none when link-only crawling is intentional."})}catch(f){e.signal?.throwIfAborted(),r.push({id:"robots",status:"fail",message:`Planning failed: ${f instanceof Error?f.message:String(f)}`,remediation:"Check network access, robots.txt redirects, sitemap responses, and timeout settings."}),r.push({id:"sitemap",status:"skipped",message:"Skipped because scan planning failed"})}}let u=Pd(r);return{healthy:u.fail===0,offline:A,url:o,checks:r,summary:u}}function Fd(e){console.log("SEO Crawl Audit doctor");let t={pass:"PASS",warning:"WARN",fail:"FAIL",skipped:"SKIP"};for(let r of e.checks)console.log(`[${t[r.status]}] ${r.id}: ${r.message}`),r.remediation&&console.log(` Fix: ${r.remediation}`);console.log(e.healthy?`Ready with ${e.summary.warning} warning(s) and ${e.summary.skipped} skipped check(s).`:`Not ready: ${e.summary.fail} check(s) failed.`)}async function ta(e,t,r){let n=await Md({...t.directory!==void 0?{directory:t.directory}:{},...e!==void 0?{url:e}:{},...t.config!==void 0?{configPath:t.config}:{},...t.output!==void 0?{outputPath:t.output}:{},...t.report!==void 0?{reportPath:t.report}:{},...t["history-dir"]!==void 0?{historyPath:t["history-dir"]}:{},reportEnabled:t["no-report"]!==!0,historyEnabled:t["no-history"]!==!0,offline:t.offline===!0,requestHeaders:Sr(t["headers-env"]),...r!==void 0?{signal:r}:{}});return t.json?console.log(JSON.stringify({command:"doctor",...n},null,2)):Fd(n),n.healthy?0:1}import{lstat as Ud,mkdir as na,readFile as Bn,realpath as ra,writeFile as sa}from"node:fs/promises";import{dirname as kn,join as he,relative as Hd,resolve as ia}from"node:path";import{fileURLToPath as Qd}from"node:url";var Yd=ia(Qd(new URL("../agent-skill/seo-crawl-audit",import.meta.url)));async function Gd(e,t){let r=await ra(e),n=t;for(;;)try{let s=await ra(n),a=Hd(r,s);if(a===".."||a.startsWith(`..${process.platform==="win32"?"\\":"/"}`))throw new Error(`generated agent path escapes the project through a symlink: ${t}`);return}catch(s){if(s.code!=="ENOENT")throw s;try{if((await Ud(n)).isSymbolicLink())throw new Error(`generated agent path escapes the project through an unresolved symlink: ${t}`)}catch(c){if(c.code!=="ENOENT")throw c}let a=kn(n);if(a===n)throw s;n=a}}function Kd(e){let t=(e??"all").toLowerCase();if(t==="all")return["codex","claude","opencode"];if(["codex","claude","opencode"].includes(t))return[t];throw new Error("--platform must be codex, claude, opencode, or all")}async function Wd(e,t,r){let n=null;try{n=await Bn(t,"utf8")}catch(a){if(a.code!=="ENOENT")throw a}let s=await Bn(e,"utf8");return n===s?{path:t,status:"unchanged"}:n!==null&&!r?{path:t,status:"skipped"}:(await na(kn(t),{recursive:!0}),await sa(t,s,"utf8"),{path:t,status:n===null?"created":"updated"})}async function Jd(e,t,r){let n=null;try{n=await Bn(e,"utf8")}catch(s){if(s.code!=="ENOENT")throw s}return n===t?{path:e,status:"unchanged"}:n!==null&&!r?{path:e,status:"skipped"}:(await na(kn(e),{recursive:!0}),await sa(e,t,"utf8"),{path:e,status:n===null?"created":"updated"})}function jd(){return`[mcp_servers.seo-crawl-audit]
|
|
217
|
+
`;return await Xi($i(e),{recursive:!0}),await Zi(e,`${r??""}${l}`,"utf8"),{path:e,status:r===null?"created":"updated"}}async function yA(e={}){let t=ji(e.directory??process.cwd()),r=e.interactive??!!(process.stdin.isTTY&&process.stdout.isTTY),n=e.ask??ve,s=e.url?.trim()??"";if(!s&&r&&!e.yes&&(s=await n("Full site URL: ")),!s)throw new Error("init requires a full site URL");let a=fA(s),c=e.workflow;c===void 0&&r&&!e.yes&&(c=await n("GitHub workflow [none/manual/scheduled/pull-request] (none): "));let l=EA(c),o=e.configPath?uA(e.configPath)?e.configPath:ji(t,e.configPath):Rn(t,pA),d={force:e.force??!1,yes:e.yes??!1,interactive:r,ask:n},h=[await Vi(o,TA(a),d),await IA(Rn(t,".gitignore"),d)];return l!=="none"&&h.push(await Vi(Rn(t,mA),CA(l),d)),{directory:t,url:a,workflow:l,files:h}}async function ea(e,t){let r=await yA({...t.directory!==void 0?{directory:t.directory}:{},...e!==void 0?{url:e}:{},...t.config!==void 0?{configPath:t.config}:{},...t.workflow!==void 0?{workflow:t.workflow}:{},...t.yes!==void 0?{yes:t.yes}:{},...t.force!==void 0?{force:t.force}:{}});if(t.json)return console.log(JSON.stringify({command:"init",...r},null,2)),0;console.log(`Initialized SEO Crawl Audit for ${r.url}`);for(let n of r.files)console.log(` ${n.status.padEnd(9)} ${n.path}`);return r.workflow==="pull-request"&&console.log("Set the SEO_AUDIT_PREVIEW_URL repository variable and commit .seo-audit.json before enabling the PR check."),console.log("Review seo-audit.config.json, then run: seo-audit scan"),0}import{access as wA,stat as NA}from"node:fs/promises";import{constants as SA}from"node:fs";import{dirname as On,isAbsolute as _A,resolve as Dn}from"node:path";var ta=[20,19,0],xA=".seo-audit.json",RA="seo-audit-report.html",LA=".seo-audit/history";function OA(e){let t=/^(\d+)\.(\d+)\.(\d+)/u.exec(e);return t?[Number(t[1]),Number(t[2]),Number(t[3])]:[0,0,0]}function DA(e){let t=OA(e);for(let r=0;r<ta.length;r+=1){let n=t[r]??0,s=ta[r]??0;if(n>s)return!0;if(n<s)return!1}return!0}function BA(e){try{let t=new URL(e);return["http:","https:"].includes(t.protocol)?(t.hash="",t.href):null}catch{return null}}function Lr(e,t){return _A(t)?t:Dn(e,t)}async function kA(e){let t=Dn(e);for(;;){try{if((await NA(t)).isDirectory())return t}catch(n){if(!n||typeof n!="object"||!("code"in n)||n.code!=="ENOENT")throw n}let r=On(t);if(r===t)throw new Error(`no existing parent directory for ${e}`);t=r}}async function vA(e,t){let r=[On(Lr(e,t.outputPath??xA)),...t.reportEnabled===!1?[]:[On(Lr(e,t.reportPath??RA))],...t.historyEnabled===!1?[]:[Lr(e,t.historyPath??LA)]];try{let n=[...new Set(await Promise.all(r.map(kA)))];return await Promise.all(n.map(s=>wA(s,SA.W_OK))),{id:"storage",status:"pass",message:`Output locations are writable through ${n.join(", ")}`,evidence:{directories:n}}}catch(n){return{id:"storage",status:"fail",message:n instanceof Error?n.message:String(n),remediation:"Create the output directory or grant the current user write access."}}}function PA(e,t){let r=AbortSignal.timeout(e);return t?AbortSignal.any([t,r]):r}async function MA(e,t,r,n){try{let s=await r(e,{headers:{accept:"text/html,application/xhtml+xml;q=0.9,*/*;q=0.1","user-agent":`SEO-Crawl-Audit-Doctor/${V}`},redirect:"follow",signal:PA(t.timeout,n)}),a=s.headers.get("content-type")??"";return await s.body?.cancel(),s.status>=400?{id:"homepage",status:"fail",message:`Start URL returned HTTP ${s.status}`,remediation:s.status===401||s.status===403?"Configure authenticated request headers before auditing this site.":"Confirm that the URL is correct and publicly reachable.",evidence:{status:s.status,contentType:a}}:a.toLowerCase().includes("html")?{id:"homepage",status:"pass",message:`Start URL returned HTTP ${s.status} HTML`,evidence:{status:s.status,contentType:a}}:{id:"homepage",status:"warning",message:`Start URL returned ${a||"an unknown content type"}`,remediation:"Use a URL that returns server-rendered HTML.",evidence:{status:s.status,contentType:a}}}catch(s){return n?.throwIfAborted(),{id:"homepage",status:"fail",message:`Could not request the start URL: ${s instanceof Error?s.message:String(s)}`,remediation:"Check DNS, TLS, firewall access, and the configured timeout."}}}function FA(e){return e.reduce((t,r)=>(t[r.status]+=1,t),{pass:0,warning:0,fail:0,skipped:0})}async function UA(e={}){let t=Dn(e.directory??process.cwd()),r=[],n=e.runtimeVersion??process.versions.node;r.push(DA(n)?{id:"runtime",status:"pass",message:`Node.js ${n} satisfies >=20.19`}:{id:"runtime",status:"fail",message:`Node.js ${n} is older than 20.19`,remediation:"Install Node.js 20.19 or newer on the machine running SEO Crawl Audit."});let a=(e.configPath?Lr(t,e.configPath):null)??await Er(t),c={};if(!a)r.push({id:"config",status:"warning",message:"seo-audit.config.json was not found",remediation:"Run seo-audit init <url> to create a safe project configuration."});else try{c=await xt(a),r.push({id:"config",status:"pass",message:`Configuration is valid: ${a}`,evidence:{path:a}})}catch(m){r.push({id:"config",status:"fail",message:m instanceof Error?m.message:String(m),remediation:"Fix the reported property or regenerate the file with seo-audit init --force."})}let l=e.url??c.url??"",o=BA(l);o?r.push({id:"target",status:"pass",message:`Target URL is ${o}`,evidence:{url:o}}):r.push({id:"target",status:"fail",message:l?"Target is not a full HTTP(S) URL":"No target URL was provided",remediation:"Pass seo-audit doctor https://example.com/ or set url in seo-audit.config.json."}),r.push(await vA(t,e));let d=e.offline??!1;if(d||!o){let m=d?"Skipped by --offline":"Skipped because the target URL is invalid";for(let E of["homepage","robots","sitemap"])r.push({id:E,status:"skipped",message:m})}else{let m=ge({url:o},c),E=wn(e.requestHeaders??{},o,e.fetch??globalThis.fetch);r.push(await MA(o,m,E,e.signal));try{let f=await le(m,{fetch:E,signal:e.signal});f.robots.denyAll&&m.respectRobots?r.push({id:"robots",status:"fail",message:`robots.txt returned HTTP ${f.robots.status??"unknown"} and blocks crawling`,remediation:"Allow the audit user agent or explicitly choose --ignore-robots when authorized.",evidence:{url:f.robots.url,status:f.robots.status,denyAll:!0}}):f.robots.error||f.robots.status===null||(f.robots.status??500)>=400?r.push({id:"robots",status:"warning",message:f.robots.error??`robots.txt returned HTTP ${f.robots.status??"unknown"}`,remediation:"Publish a readable robots.txt when crawler policy needs to be explicit.",evidence:{url:f.robots.url,status:f.robots.status}}):r.push({id:"robots",status:"pass",message:`robots.txt returned HTTP ${f.robots.status}`,evidence:{url:f.robots.url,status:f.robots.status,denyAll:f.robots.denyAll??!1}}),m.sitemap==="none"?r.push({id:"sitemap",status:"skipped",message:"Sitemap discovery is disabled by configuration"}):f.sitemap?f.sitemap.error?r.push({id:"sitemap",status:m.sitemap==="auto"?"warning":"fail",message:f.sitemap.error,remediation:"Check the sitemap URL, XML syntax, response size, and HTTP status.",evidence:{url:f.sitemap.url}}):f.sitemap.urls.length===0?r.push({id:"sitemap",status:"warning",message:`Sitemap contains no crawlable same-origin URLs: ${f.sitemap.url}`,remediation:"Add canonical site URLs to the sitemap or verify the configured site origin."}):r.push({id:"sitemap",status:"pass",message:`Loaded ${f.sitemap.urls.length} URL(s) from ${f.sitemap.sitemapCount} sitemap file(s)`,evidence:{url:f.sitemap.url,urls:f.sitemap.urls.length,sitemapCount:f.sitemap.sitemapCount,truncated:f.sitemap.truncated}}):r.push({id:"sitemap",status:"warning",message:"No sitemap was discovered",remediation:"Publish a sitemap or set sitemap to none when link-only crawling is intentional."})}catch(f){e.signal?.throwIfAborted(),r.push({id:"robots",status:"fail",message:`Planning failed: ${f instanceof Error?f.message:String(f)}`,remediation:"Check network access, robots.txt redirects, sitemap responses, and timeout settings."}),r.push({id:"sitemap",status:"skipped",message:"Skipped because scan planning failed"})}}let h=FA(r);return{healthy:h.fail===0,offline:d,url:o,checks:r,summary:h}}function HA(e){console.log("SEO Crawl Audit doctor");let t={pass:"PASS",warning:"WARN",fail:"FAIL",skipped:"SKIP"};for(let r of e.checks)console.log(`[${t[r.status]}] ${r.id}: ${r.message}`),r.remediation&&console.log(` Fix: ${r.remediation}`);console.log(e.healthy?`Ready with ${e.summary.warning} warning(s) and ${e.summary.skipped} skipped check(s).`:`Not ready: ${e.summary.fail} check(s) failed.`)}async function ra(e,t,r){let n=await UA({...t.directory!==void 0?{directory:t.directory}:{},...e!==void 0?{url:e}:{},...t.config!==void 0?{configPath:t.config}:{},...t.output!==void 0?{outputPath:t.output}:{},...t.report!==void 0?{reportPath:t.report}:{},...t["history-dir"]!==void 0?{historyPath:t["history-dir"]}:{},reportEnabled:t["no-report"]!==!0,historyEnabled:t["no-history"]!==!0,offline:t.offline===!0,requestHeaders:Sr(t["headers-env"]),...r!==void 0?{signal:r}:{}});return t.json?console.log(JSON.stringify({command:"doctor",...n},null,2)):HA(n),n.healthy?0:1}import{lstat as QA,mkdir as sa,readFile as Bn,realpath as na,writeFile as ia}from"node:fs/promises";import{dirname as kn,join as he,relative as YA,resolve as aa}from"node:path";import{fileURLToPath as GA}from"node:url";var KA=aa(GA(new URL("../agent-skill/seo-crawl-audit",import.meta.url)));async function WA(e,t){let r=await na(e),n=t;for(;;)try{let s=await na(n),a=YA(r,s);if(a===".."||a.startsWith(`..${process.platform==="win32"?"\\":"/"}`))throw new Error(`generated agent path escapes the project through a symlink: ${t}`);return}catch(s){if(s.code!=="ENOENT")throw s;try{if((await QA(n)).isSymbolicLink())throw new Error(`generated agent path escapes the project through an unresolved symlink: ${t}`)}catch(c){if(c.code!=="ENOENT")throw c}let a=kn(n);if(a===n)throw s;n=a}}function JA(e){let t=(e??"all").toLowerCase();if(t==="all")return["codex","claude","opencode"];if(["codex","claude","opencode"].includes(t))return[t];throw new Error("--platform must be codex, claude, opencode, or all")}async function jA(e,t,r){let n=null;try{n=await Bn(t,"utf8")}catch(a){if(a.code!=="ENOENT")throw a}let s=await Bn(e,"utf8");return n===s?{path:t,status:"unchanged"}:n!==null&&!r?{path:t,status:"skipped"}:(await sa(kn(t),{recursive:!0}),await ia(t,s,"utf8"),{path:t,status:n===null?"created":"updated"})}async function VA(e,t,r){let n=null;try{n=await Bn(e,"utf8")}catch(s){if(s.code!=="ENOENT")throw s}return n===t?{path:e,status:"unchanged"}:n!==null&&!r?{path:e,status:"skipped"}:(await sa(kn(e),{recursive:!0}),await ia(e,t,"utf8"),{path:e,status:n===null?"created":"updated"})}function XA(){return`[mcp_servers.seo-crawl-audit]
|
|
215
218
|
command = "npx"
|
|
216
219
|
args = ["-y", "seo-crawl-audit@0.9", "mcp"]
|
|
217
220
|
tool_timeout_sec = 600
|
|
218
|
-
`}function
|
|
219
|
-
`}function
|
|
220
|
-
`}async function
|
|
221
|
-
${
|
|
222
|
-
${r}`);return console.log("Restart the agent client after enabling its project MCP configuration."),0}var
|
|
221
|
+
`}function ZA(){return`${JSON.stringify({mcpServers:{"seo-crawl-audit":{command:"npx",args:["-y","seo-crawl-audit@0.9","mcp"]}}},null,2)}
|
|
222
|
+
`}function $A(){return`${JSON.stringify({$schema:"https://opencode.ai/config.json",mcp:{"seo-crawl-audit":{type:"local",command:["npx","-y","seo-crawl-audit@0.9","mcp"],enabled:!0,timeout:6e5}}},null,2)}
|
|
223
|
+
`}async function qA(e={}){let t=aa(e.directory??process.cwd()),r=JA(e.platform),n=[],s=[],a=new Set,c=new Set;for(let l of r)c.add(l==="claude"?he(t,".claude/skills/seo-crawl-audit/SKILL.md"):he(t,".agents/skills/seo-crawl-audit/SKILL.md")),c.add(l==="codex"?he(t,".codex/config.toml"):l==="claude"?he(t,".mcp.json"):he(t,"opencode.json"));await Promise.all([...c].map(l=>WA(t,l)));for(let l of r){let o=l==="claude"?he(t,".claude/skills/seo-crawl-audit/SKILL.md"):he(t,".agents/skills/seo-crawl-audit/SKILL.md");a.has(o)||(n.push(await jA(he(KA,"SKILL.md"),o,e.force??!1)),a.add(o));let d=l==="codex"?he(t,".codex/config.toml"):l==="claude"?he(t,".mcp.json"):he(t,"opencode.json"),h=l==="codex"?XA():l==="claude"?ZA():$A(),m=await VA(d,h,e.force??!1);n.push(m),m.status==="skipped"&&s.push(`${l} config snippet:
|
|
224
|
+
${h}`)}return{directory:t,platform:e.platform==="all"||!e.platform?"all":r[0],files:n,snippets:s}}async function oa(e){let t=await qA({directory:e.directory,platform:e.platform,force:e.force});if(e.json)return console.log(JSON.stringify({command:"agent-init",...t},null,2)),0;console.log(`Prepared SEO Crawl Audit agent integration in ${t.directory}`);for(let r of t.files)console.log(` ${r.status.padEnd(7)} ${r.path}`);for(let r of t.snippets)console.log(`
|
|
225
|
+
${r}`);return console.log("Restart the agent client after enabling its project MCP configuration."),0}var Ie=`seo-audit ${V}
|
|
223
226
|
|
|
224
227
|
Local-first SEO crawler, audit, and regression checker.
|
|
225
228
|
|
|
@@ -298,8 +301,8 @@ Exit codes:
|
|
|
298
301
|
1 SEO regressions detected
|
|
299
302
|
2 Invalid input or crawler failure
|
|
300
303
|
130 Scan interrupted after saving partial results
|
|
301
|
-
`;async function
|
|
304
|
+
`;async function bf(e=process.argv.slice(2),t={}){let r;try{r=xi(e)}catch(o){return console.error(`${o instanceof Error?o.message:String(o)}
|
|
302
305
|
|
|
303
|
-
${
|
|
306
|
+
${Ie}`),2}let{values:n}=r,{positionals:s}=r;if(s[0]==="init"){if(n.help)return console.log(Ie),0;if(n.version)return console.log(V),0;if(s.length>2)return console.error(`Unexpected argument: ${s[2]}`),2;try{return await ea(s[1],n)}catch(o){return console.error(`seo-audit: ${o instanceof Error?o.message:String(o)}`),2}}if(s[0]==="doctor"){if(s.length>2)return console.error(`Unexpected argument: ${s[2]}`),2;if(n.help)return console.log(Ie),0;if(n.version)return console.log(V),0;try{return await ra(s[1],n,t.signal)}catch(o){return console.error(`seo-audit: ${o instanceof Error?o.message:String(o)}`),t.signal?.aborted?130:2}}if(s[0]==="agent-init"){if(s.length>1)return console.error(`Unexpected argument: ${s[1]}`),2;if(n.help)return console.log(Ie),0;if(n.version)return console.log(V),0;try{return await oa(n)}catch(o){return console.error(`seo-audit: ${o instanceof Error?o.message:String(o)}`),2}}if(s[0]==="status"){if(s.length>2)return console.error(`Unexpected argument: ${s[2]}`),2;if(n.help)return console.log(Ie),0;if(n.version)return console.log(V),0;try{return await Fi(s[1],n)}catch(o){return console.error(`seo-audit: ${o instanceof Error?o.message:String(o)}`),2}}if(s[0]==="serve"){if(s.length>2)return console.error(`Unexpected argument: ${s[2]}`),2;if(n.help)return console.log(Ie),0;let o=n.port===void 0?4179:Number.parseInt(n.port,10);if(!Number.isInteger(o)||o<0||o>65535)return console.error("seo-audit: --port must be an integer between 0 and 65535"),2;let d=s[1];if(d)try{let h=new URL(d);if(h.protocol!=="http:"&&h.protocol!=="https:")throw new Error("unsupported protocol")}catch{return console.error("seo-audit: serve URL must be a complete http:// or https:// URL"),2}try{let{serveCommand:h}=await import("./server.js");return await h(o,t.signal,{openBrowser:!n["no-open"],...d?{initialUrl:d}:{}})}catch(h){return console.error(`seo-audit: ${h instanceof Error?h.message:String(h)}`),2}}try{n=Ri(n,await xt(n.config))}catch(o){return console.error(`seo-audit: ${o instanceof Error?o.message:String(o)}`),2}if(n.version)return console.log(V),0;if(n.help||s.length===0)return console.log(Ie),0;let[a,c,...l]=s;if(a&&/^https?:\/\//i.test(a)&&(l=s.slice(1),c=a,a="scan"),(a==="scan"||a==="check")&&!c&&n.__config?.url&&(c=n.__config.url),l.length>0)return console.error(`Unexpected argument: ${l[0]}`),2;try{return a==="scan"?await Yi(c,n,t.signal):a==="check"?await Gi(c,n,t.signal):a==="compare"?await Ki(n,t.signal):a==="history"?await Ji(c,n):a==="report"?await Wi(c,n):(console.error(`Unknown command: ${String(a)}
|
|
304
307
|
|
|
305
|
-
${
|
|
308
|
+
${Ie}`),2)}catch(o){return console.error(`seo-audit: ${o instanceof Error?o.message:String(o)}`),t.signal?.aborted?130:2}}export{bf as main,Di as parseScanMenuSelection};
|