From 362132581a7a8d9a876357b773dad8f9a665ac8c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 26 Nov 2025 00:56:07 +0000 Subject: [PATCH 1/3] Initial plan From 6435fffbb48abe4562964de27287c694134a11d0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 26 Nov 2025 01:20:49 +0000 Subject: [PATCH 2/3] Replace hardcoded Assert URL with data-cite mechanism - Moved algorithms.js to run before inlines.js in all profiles - Updated algorithms.js to use data-cite="INFRA#assert" for linking - Updated tests to include localBiblio for INFRA spec Co-authored-by: marcoscaceres <870154+marcoscaceres@users.noreply.github.com> --- builds/respec-w3c.js | 194 ++++++++++++++--------------- builds/respec-w3c.js.map | 2 +- profiles/aom.js | 2 +- profiles/dini.js | 2 +- profiles/geonovum.js | 2 +- profiles/w3c.js | 2 +- src/core/algorithms.js | 7 +- tests/spec/core/algorithms-spec.js | 6 +- 8 files changed, 109 insertions(+), 108 deletions(-) diff --git a/builds/respec-w3c.js b/builds/respec-w3c.js index f6c2b7df59..07aca5ac5a 100644 --- a/builds/respec-w3c.js +++ b/builds/respec-w3c.js @@ -94,7 +94,7 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em} ${Fr}
(plugin: "${e.plugin}")
`:"",n=e.hint?`\n${Nr(`How to fix: ${br(e.hint)}`,{inline:!e.hint.includes("\n")})}\n`:"",r=Array.isArray(e.elements)?`
Occurred ${e.elements.length} times at:
\n ${Nr(e.elements.map(ns).join("\n"))}`:"",s=e.details?`\n\n(plugin: "${e.plugin}")
`:"",n=e.hint?`\n${Nr(`How to fix: ${br(e.hint)}`,{inline:!e.hint.includes("\n")})}\n`:"",r=Array.isArray(e.elements)?`
Occurred ${e.elements.length} times at:
\n ${Nr(e.elements.map(ns).join("\n"))}`:"",s=e.details?`\n\n${t+(r?"?":"")}`}function Jo(e){const{identifier:t,parent:n,slotType:r,renderParent:s,args:o}=e,{identifier:i}=n||{},a="method"===r,c=a?kn`(${Vn(o,Qo)})`:null,l=a?`(${o.join(", ")})`:"";return kn`${n&&s?".":""}`}function Xo(e){const{identifier:t,parent:n,slotType:r,renderParent:s,args:o}=e,{identifier:i}=n||{},a="method"===r,c=a?kn`(${Vn(o,ei)})`:null,l=a?`(${o.join(", ")})`:"";return kn`${n&&s?".":""}[[${t}]]${c}`}function Qo(e,t,n){if(t${n}`}function ei(e){const{args:t,identifier:n,type:r,parent:s,renderParent:o}=e,{renderText:i,renderArgs:a}=e,{identifier:c}=s||{},l=Vn(a||t,Qo),u=`${n}(${t.join(", ")})`;return kn`${s&&o?".":""}`}function ni(e){const{args:t,identifier:n,type:r,parent:s,renderParent:o}=e,{renderText:i,renderArgs:a}=e,{identifier:c}=s||{},l=Vn(a||t,ei),u=`${n}(${t.join(", ")})`;return kn`${s&&o?".":""}${i||n}${!i||a?kn`(${l})`:""}`}function ti(e){const{identifier:t,enumValue:n,parent:r}=e,s=r?r.identifier:t;return kn`"${!i||a?kn`(${l})`:""}`}function ri(e){const{identifier:t,enumValue:n,parent:r}=e,s=r?r.identifier:t;return kn`"${n}"`}function ni(e){const{identifier:t}=e;return kn`""`}function si(e){const{identifier:t}=e;return kn`"${t}"`}function ri(e){const{identifier:t,nullable:n}=e;return kn`"`}function oi(e){const{identifier:t,nullable:n}=e;return kn`${t+(n?"?":"")}`}function si(e){let t;try{t=function(e){const t=Ko.test(e),n=t?Yo:Go,[r,s]=e.split(n);if(t&&r&&!s)throw new SyntaxError(`Internal slot missing "for" part. Expected \`{{ InterfaceName/${r}}}\` }.`);const o=r.split(/[./]/).concat(s).filter((e=>e&&e.trim())).map((e=>e.trim())),i=!e.includes("/"),a=[];for(;o.length;){const t=o.pop();if(Uo.test(t)){const[,e,n,r,s]=t.match(Uo),o=n.split(/,\s*/).filter((e=>e)),c=r?.trim(),l=s?.split(/,\s*/).filter((e=>e));a.push({type:"method",identifier:e,args:o,renderParent:i,renderText:c,renderArgs:l})}else if(Vo.test(t)){const[,e,n]=t.match(Vo);a.push({type:"enum",identifier:e,enumValue:n,renderParent:i})}else if(Wo.test(t)){const[,e]=t.match(Wo);i?a.push({type:"exception",identifier:e}):a.push({type:"enum",enumValue:e,renderParent:i})}else if(Fo.test(t)){const[,e,n]=t.match(Fo),r=n?"method":"attribute",s=n?.slice(1,-1).split(/,\s*/).filter((e=>e));a.push({type:"internal-slot",slotType:r,identifier:e,args:s,renderParent:i})}else if(Bo.test(t)&&o.length){const[,e]=t.match(Bo);a.push({type:"attribute",identifier:e,renderParent:i})}else if(qo.test(t)){const e=t.endsWith("?"),n=e?t.slice(0,-1):t;a.push({type:"idl-primitive",identifier:n,renderParent:i,nullable:e})}else{if(!Ho.test(t)||0!==o.length)throw new SyntaxError(`IDL micro-syntax parsing error in \`{{ ${e} }}\``);{const e=t.endsWith("?"),n=e?t.slice(0,-1):t;a.push({type:"base",identifier:n,renderParent:i,nullable:e})}}}return a.forEach(((e,t,n)=>{e.parent=n[t+1]||null})),a.reverse()}(e)}catch(t){const n=kn`{{ ${e} }}`,r="Error: Invalid inline IDL string.";return lr(t.message,"core/inlines",{title:r,elements:[n]}),n}const n=kn(document.createDocumentFragment()),r=[];for(const e of t)switch(e.type){case"base":{const t=Zo(e);t&&r.push(t);break}case"attribute":r.push(Xo(e));break;case"internal-slot":r.push(Jo(e));break;case"method":r.push(ei(e));break;case"enum":r.push(ti(e));break;case"exception":r.push(ni(e));break;case"idl-primitive":r.push(ri(e));break;default:throw new Error("Unknown type.")}return n`${r}`}const oi=new Set(["alias","reference"]),ii=async function(){const e=await $n.openDB("respec-biblio2",12,{upgrade(e){Array.from(e.objectStoreNames).map((t=>e.deleteObjectStore(t)));e.createObjectStore("alias",{keyPath:"id"}).createIndex("aliasOf","aliasOf",{unique:!1}),e.createObjectStore("reference",{keyPath:"id"})}}),t=Date.now();for(const n of[...oi]){const r=e.transaction(n,"readwrite").store,s=IDBKeyRange.lowerBound(t);let o=await r.openCursor(s);for(;o?.value;){const e=o.value;(void 0===e.expires||e.expires${e.title}`;return t=e.href?`${t}. `:`${t}. `,e.authors&&e.authors.length&&(t+=e.authors.join("; "),e.etAl&&(t+=" et al"),t.endsWith(".")||(t+=". ")),e.publisher&&(t=`${t} ${ki(e.publisher)} `),e.date&&(t+=`${e.date}. `),e.status&&(t+=`${vi.get(e.status)||e.status}. `),e.href&&(t+=`URL: ${e.href}`),t}var Ei=Object.freeze({__proto__:null,name:yi,renderInlineCitation:Ci,run:function(e){const t=Array.from(e.informativeReferences),n=Array.from(e.normativeReferences);if(!t.length&&!n.length)return;const r=document.querySelector("section#references")||kn``;if(document.querySelector("section#references > :is(h2, h1)")||r.prepend(kn`${wi.references}
`),r.classList.add("appendix"),n.length){const e=xi(n,wi.norm_references);r.appendChild(e)}if(t.length){const e=xi(t,wi.info_references);r.appendChild(e)}document.body.appendChild(r)}});const Ai="core/inlines",Li={},Ti=e=>new RegExp(e.map((e=>e.source)).join("|")),Pi=Wn({en:{rfc2119Keywords:()=>Ti([/\bMUST(?:\s+NOT)?\b/,/\bSHOULD(?:\s+NOT)?\b/,/\bSHALL(?:\s+NOT)?\b/,/\bMAY\b/,/\b(?:NOT\s+)?REQUIRED\b/,/\b(?:NOT\s+)?RECOMMENDED\b/,/\bOPTIONAL\b/])},de:{rfc2119Keywords:()=>Ti([/\bMUSS\b/,/\bMÜSSEN\b/,/\bERFORDERLICH\b/,/\b(?:NICHT\s+)?NÖTIG\b/,/\bDARF(?:\s+NICHT)?\b/,/\bDÜRFEN(?:\s+NICHT)?\b/,/\bVERBOTEN\b/,/\bSOLL(?:\s+NICHT)?\b/,/\bSOLLEN(?:\s+NICHT)?\b/,/\b(?:NICHT\s+)?EMPFOHLEN\b/,/\bKANN\b/,/\bKÖNNEN\b/,/\bOPTIONAL\b/])}}),Ii=/(?:`[^`]+`)(?!`)/,Di=/(?:{{[^}]+\?*}})/,Ni=/\B\|\w[\w\s]*(?:\s*:[\w\s&;"?<>]+\??)?\|\B/,ji=/(?:\[\[(?:!|\\|\?)?[\w.-]+(?:|[^\]]+)?\]\])/,Oi=/(?:\[\[\[(?:!|\\|\?)?#?[\w-.]+\]\]\])/,zi=/(?:\[=[^=]+=\])/,Mi=/(?:\[\^[^^]+\^\])/;function qi(e){const t=e.slice(2,-2).trim(),[n,r,s]=t.split("/",3).map((e=>e&&e.trim())).filter((e=>!!e)),[o,i,a]=t.startsWith("/")?["element-attr",null,n]:s?["attr-value",`${n}/${r}`,s]:r?["element-attr",n,r]:["element",null,n];return kn`${a}`}function Mi(e){const t=qn(e),n=kn`${t}`;return Ei[t]=!0,n}function qi(e){const t=e.slice(3,-3).trim();return t.startsWith("#")?kn``:kn``}function Wi(e,t){const n=qn(e.slice(2,-2));if(n.startsWith("\\"))return e.replace("\\","");const r=si(n);return!!t.parentElement.closest("dfn,a")?Vi(`\`${r.textContent}\``):r}function Ui(e,t,n){const r=e.slice(2,-2);if(r.startsWith("\\"))return[`[[${r.slice(1)}]]`];const[s,o]=r.split("|").map(qn),{type:i,illegal:a}=Qn(s,t.parentElement),c=xi(s,o),l=s.replace(/^(!|\?)/,"");if(a&&!n.normativeReferences.has(l)){const e=c.childNodes[1]||c;ur("Normative references in informative sections are not allowed. ",Ri,{elements:[e],hint:`Remove '!' from the start of the reference \`[[${r}]]\``})}return"informative"!==i||a?n.normativeReferences.add(l):n.informativeReferences.add(l),c.childNodes[1]?c.childNodes:[c]}function Fi(e,t,n){return"ABBR"===t.parentElement.tagName?e:kn`${e}`}function Bi(e){const t=e.slice(1,-1).split(":",2),[n,r]=t.map((e=>e.trim()));return kn`${n}`}function Hi(e){const t=function(e){const t=e=>e.replace("%%","/").split("/").map(qn).join("/"),n=e.replace("\\/","%%"),r=n.lastIndexOf("/");if(-1===r)return[t(n)];const s=n.substring(0,r),o=n.substring(r+1,n.length);return[t(s),t(o)]}(e=e.slice(2,-2)),[n,r]=2===t.length?t:[null,t[0]],[s,o]=r.includes("|")?r.split("|",2).map((e=>e.trim())):[null,r],i=Gi(o),a=n?qn(n):null;return kn``}function Wi(e){const t=qn(e),n=kn`${t}`;return Li[t]=!0,n}function Ui(e){const t=e.slice(3,-3).trim();return t.startsWith("#")?kn``:kn``}function Fi(e,t){const n=qn(e.slice(2,-2));if(n.startsWith("\\"))return e.replace("\\","");const r=ii(n);return!!t.parentElement.closest("dfn,a")?Yi(`\`${r.textContent}\``):r}function Bi(e,t,n){const r=e.slice(2,-2);if(r.startsWith("\\"))return[`[[${r.slice(1)}]]`];const[s,o]=r.split("|").map(qn),{type:i,illegal:a}=Qn(s,t.parentElement),c=Ci(s,o),l=s.replace(/^(!|\?)/,"");if(a&&!n.normativeReferences.has(l)){const e=c.childNodes[1]||c;ur("Normative references in informative sections are not allowed. ",Ai,{elements:[e],hint:`Remove '!' from the start of the reference \`[[${r}]]\``})}return"informative"!==i||a?n.normativeReferences.add(l):n.informativeReferences.add(l),c.childNodes[1]?c.childNodes:[c]}function Hi(e,t,n){return"ABBR"===t.parentElement.tagName?e:kn`${e}`}function Vi(e){const t=e.slice(1,-1).split(":",2),[n,r]=t.map((e=>e.trim()));return kn`${n}`}function Gi(e){const t=function(e){const t=e=>e.replace("%%","/").split("/").map(qn).join("/"),n=e.replace("\\/","%%"),r=n.lastIndexOf("/");if(-1===r)return[t(n)];const s=n.substring(0,r),o=n.substring(r+1,n.length);return[t(s),t(o)]}(e=e.slice(2,-2)),[n,r]=2===t.length?t:[null,t[0]],[s,o]=r.includes("|")?r.split("|",2).map((e=>e.trim())):[null,r],i=Ki(o),a=n?qn(n):null;return kn`${i}`}function Vi(e){const t=e.slice(1,-1);return kn`${t}`}function Gi(e){return Ti.test(e)?e.split(/(`[^`]+`)(?!`)/).map((e=>e.startsWith("`")?Vi(e):Gi(e))):document.createTextNode(e)}var Yi=Object.freeze({__proto__:null,name:Ri,rfc2119Usage:Ei,run:function(e){const t=new Map;document.normalize(),document.querySelector("section#conformance")||document.body.classList.add("informative"),e.normativeReferences=new rr,e.informativeReferences=new rr,e.respecRFC2119||(e.respecRFC2119=Ei);const n=document.querySelectorAll("abbr[title]:not(.exclude)");for(const{textContent:e,title:r}of n){const n=qn(e),s=qn(r);t.set(n,s)}const r=t.size?new RegExp(`(?:\\b${[...t.keys()].join("\\b)|(?:\\b")}\\b)`):null,s=function(e,t=[],n={wsNodes:!0}){const r=t.join(", "),s=document.createNodeIterator(e,NodeFilter.SHOW_TEXT,(e=>n.wsNodes||e.data.trim()?r&&e.parentElement.closest(r)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT)),o=[];let i;for(;i=s.nextNode();)o.push(i);return o}(document.body,["#respec-ui",".head","pre","svg","script","style"],{wsNodes:!1}),o=Li.rfc2119Keywords(),i=new RegExp(`(${Ai([o,Pi,Ii,Di,Ni,ji,Ti,Oi,...r?[r]:[]]).source})`);for(const n of s){const r=n.data.split(i);if(1===r.length)continue;const s=document.createDocumentFragment();let a=!0;for(const i of r)if(a=!a,a)switch(!0){case i.startsWith("{{"):s.append(Wi(i,n));break;case i.startsWith("[[["):s.append(qi(i));break;case i.startsWith("[["):s.append(...Ui(i,n,e));break;case i.startsWith("|"):s.append(Bi(i));break;case i.startsWith("[="):s.append(Hi(i));break;case i.startsWith("`"):s.append(Vi(i));break;case i.startsWith("[^"):s.append(zi(i));break;case t.has(i):s.append(Fi(i,n,t));break;case o.test(i):s.append(Mi(i))}else s.append(i);n.replaceWith(s)}}});const Ki="w3c/conformance",Zi=Wn({en:{conformance:"Conformance",normativity:"As well as sections marked as non-normative, all authoring guidelines, diagrams, examples, and notes in this specification are non-normative. Everything else in this specification is normative.",keywordInterpretation:(e,t)=>kn`
+ >`}function Yi(e){const t=e.slice(1,-1);return kn`${t}`}function Ki(e){return Ii.test(e)?e.split(/(`[^`]+`)(?!`)/).map((e=>e.startsWith("`")?Yi(e):Ki(e))):document.createTextNode(e)}var Zi=Object.freeze({__proto__:null,name:Ai,rfc2119Usage:Li,run:function(e){const t=new Map;document.normalize(),document.querySelector("section#conformance")||document.body.classList.add("informative"),e.normativeReferences=new rr,e.informativeReferences=new rr,e.respecRFC2119||(e.respecRFC2119=Li);const n=document.querySelectorAll("abbr[title]:not(.exclude)");for(const{textContent:e,title:r}of n){const n=qn(e),s=qn(r);t.set(n,s)}const r=t.size?new RegExp(`(?:\\b${[...t.keys()].join("\\b)|(?:\\b")}\\b)`):null,s=function(e,t=[],n={wsNodes:!0}){const r=t.join(", "),s=document.createNodeIterator(e,NodeFilter.SHOW_TEXT,(e=>n.wsNodes||e.data.trim()?r&&e.parentElement.closest(r)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT)),o=[];let i;for(;i=s.nextNode();)o.push(i);return o}(document.body,["#respec-ui",".head","pre","svg","script","style"],{wsNodes:!1}),o=Pi.rfc2119Keywords(),i=new RegExp(`(${Ti([o,Di,Ni,ji,Oi,zi,Ii,Mi,...r?[r]:[]]).source})`);for(const n of s){const r=n.data.split(i);if(1===r.length)continue;const s=document.createDocumentFragment();let a=!0;for(const i of r)if(a=!a,a)switch(!0){case i.startsWith("{{"):s.append(Fi(i,n));break;case i.startsWith("[[["):s.append(Ui(i));break;case i.startsWith("[["):s.append(...Bi(i,n,e));break;case i.startsWith("|"):s.append(Vi(i));break;case i.startsWith("[="):s.append(Gi(i));break;case i.startsWith("`"):s.append(Yi(i));break;case i.startsWith("[^"):s.append(qi(i));break;case t.has(i):s.append(Hi(i,n,t));break;case o.test(i):s.append(Wi(i))}else s.append(i);n.replaceWith(s)}}});const Ji="w3c/conformance",Qi=Wn({en:{conformance:"Conformance",normativity:"As well as sections marked as non-normative, all authoring guidelines, diagrams, examples, and notes in this specification are non-normative. Everything else in this specification is normative.",keywordInterpretation:(e,t)=>kn`
The key word${t?"s":""} ${e} in this document
${t?"are":"is"} to be interpreted as described in
BCP 14
- ${xi("RFC2119")} ${xi("RFC8174")}
+ ${Ci("RFC2119")} ${Ci("RFC8174")}
when, and only when, ${t?"they appear":"it appears"} in all
capitals, as shown here.
`},de:{conformance:"Anforderungen",normativity:"Neben den explizit als nicht-normativ gekennzeichneten Abschnitten sind auch alle Diagramme, Beispiele und Hinweise in diesem Dokument nicht normativ. Alle anderen Angaben sind normativ.",keywordInterpretation:(e,t)=>kn`
${t?"Die Schlüsselwörter":"Das Schlüsselwort"} ${e} in
diesem Dokument ${t?"sind":"ist"} gemäß
BCP 14
- ${xi("RFC2119")} ${xi("RFC8174")}
+ ${Ci("RFC2119")} ${Ci("RFC8174")}
und unter Berücksichtigung von
2119de
zu interpretieren, wenn und nur wenn ${t?"sie":"es"} wie hier
gezeigt durchgehend groß geschrieben wurde${t?"n":""}.
-
`}});var Ji=Object.freeze({__proto__:null,name:Ki,run:function(e){const t=document.querySelector("section#conformance");if(t&&!t.classList.contains("override")&&function(e,t){const n=[...Object.keys(Ei)];n.length&&(t.normativeReferences.add("RFC2119"),t.normativeReferences.add("RFC8174"));const r=Gn(n.sort(),(e=>kn`${e}`)),s=n.length>1,o=kn`
- ${Zi.conformance}
- ${Zi.normativity}
- ${n.length?Zi.keywordInterpretation(r,s):null}
- `;e.prepend(...o.childNodes)}(t,e),!t&&Object.keys(Ei).length){ur("Document uses RFC2119 keywords but lacks a conformance section.",Ki,{hint:'Please add a ``.'})}}});function Qi(e,t,n,r){try{switch(t){case"element-attr":return document.createAttribute(e),!0;case"element":return document.createElement(e),!0}}catch(s){lr(`Invalid ${t} name "${e}": ${s.message}`,r,{hint:`Check that the ${t} name is allowed per the XML's Name production for ${t}.`,elements:[n]})}return!1}function Xi(e,t,n,r){if(/^[a-z]+(-[a-z]+)*$/i.test(e))return!0;return lr(`Invalid ${t} name "${e}".`,r,{hint:`Check that the ${t} name is allowed per the naming rules for this type.`,elements:[n]}),!1}const ea=new ar;function ta(e,t){for(const n of t)ea.has(n)||ea.set(n,new Set),ea.get(n).add(e)}const na="core/dfn",ra=new Map([["abstract-op",{requiresFor:!1}],["attr-value",{requiresFor:!0,associateWith:"a markup attribute",validator:Xi}],["element",{requiresFor:!1,validator:Qi}],["element-attr",{requiresFor:!1,validator:Qi}],["element-state",{requiresFor:!0,associateWith:"a markup attribute",validator:Xi}],["event",{requiresFor:!1,validator:Xi}],["http-header",{requiresFor:!1}],["media-type",{requiresFor:!1,validator:function(e,t,n,r){try{const t=new _n(e);if(t.toString()!==e)throw new Error(`Input doesn't match its canonical form: "${t}".`)}catch(s){return lr(`Invalid ${t} "${e}": ${s.message}.`,r,{hint:"Check that the MIME type has both a type and a sub-type, and that it's in a canonical form (e.g., `text/plain`).",elements:[n]}),!1}return!0}}],["scheme",{requiresFor:!1,validator:Xi}],["permission",{requiresFor:!1,validator:function(e,t,n,r){return e.startsWith('"')&&e.endsWith('"')?Xi(e.slice(1,-1),t,n,r):(lr(`Invalid ${t} "${e}".`,r,{hint:`Check that the ${t} is quoted with double quotes.`,elements:[n]}),!1)}}]]),sa=[...ra.keys()];function oa(e,t){let n="";switch(!0){case sa.some((t=>e.classList.contains(t))):n=[...e.classList].find((e=>ra.has(e))),function(e,t,n){const r=ra.get(t);if(r.requiresFor&&!n.dataset.dfnFor){const e=gr`Definition of type "\`${t}\`" requires a ${"[data-dfn-for]"} attribute.`,{associateWith:s}=r,o=gr`Use a ${"[data-dfn-for]"} attribute to associate this with ${s}.`;lr(e,na,{hint:o,elements:[n]})}r.validator&&r.validator(e,t,n,na)}(t,n,e);break;case Fo.test(t):n=function(e,t){t.dataset.hasOwnProperty("idl")||(t.dataset.idl="");const n=t.closest("[data-dfn-for]");t!==n&&n?.dataset.dfnFor&&(t.dataset.dfnFor=n.dataset.dfnFor);if(!t.dataset.dfnFor){const n=gr`Use a ${"[data-dfn-for]"} attribute to associate this dfn with a WebIDL interface.`;lr(`Internal slot "${e}" must be associated with a WebIDL interface.`,na,{hint:n,elements:[t]})}t.matches(".export, [data-export]")||(t.dataset.noexport="");const r=e.endsWith(")")?"method":"attribute";if(!t.dataset.dfnType)return r;const s=["attribute","method"],{dfnType:o}=t.dataset;if(!s.includes(o)||r!==o){const n=gr`Invalid ${"[data-dfn-type]"} attribute on internal slot.`,o=`The only allowed types are: ${fr(s,{quotes:!0})}. The slot "${e}" seems to be a "${pr(r)}"?`;return lr(n,na,{hint:o,elements:[t]}),"dfn"}return o}(t,e)}if(!n&&!e.matches("[data-dfn-type]")){const t=e.closest("[data-dfn-type]");n=t?.dataset.dfnType}n&&!e.dataset.dfnType&&(e.dataset.dfnType=n)}function ia(e){switch(!0){case e.matches(".export.no-export"):lr(gr`Declares both "${"[no-export]"}" and "${"[export]"}" CSS class.`,na,{elements:[e],hint:"Please use only one."});break;case e.matches(".no-export, [data-noexport]"):if(e.matches("[data-export]")){lr(gr`Declares ${"[no-export]"} CSS class, but also has a "${"[data-export]"}" attribute.`,na,{elements:[e],hint:"Please chose only one."}),delete e.dataset.export}e.dataset.noexport="";break;case e.matches(":is(.export):not([data-noexport], .no-export)"):e.dataset.export=""}}var aa=Object.freeze({__proto__:null,name:na,run:function(){for(const e of document.querySelectorAll("dfn")){const t=Zn(e);if(ta(e,t),e.dataset.cite&&/\b#\b/.test(e.dataset.cite))continue;const[n]=t;oa(e,n),ia(e);const r=(e.dataset.localLt||"").split("|").map(qn),s=t.filter((e=>!r.includes(e)));(s.length>1||n!==qn(e.textContent))&&(e.dataset.lt=s.join("|"))}}});var ca=Object.freeze({__proto__:null,name:"core/pluralize",run:function(e){if(!e.pluralize)return;const t=function(){const e=new Set;document.querySelectorAll("a:not([href])").forEach((t=>{const n=qn(t.textContent).toLowerCase();e.add(n),t.dataset.lt&&e.add(t.dataset.lt)}));const t=new Set,n=document.querySelectorAll("dfn:not([data-lt-noDefault])");return n.forEach((e=>{const n=qn(e.textContent).toLowerCase();t.add(n),e.dataset.lt&&e.dataset.lt.split("|").forEach((e=>t.add(e))),e.dataset.localLt&&e.dataset.localLt.split("|").forEach((e=>t.add(e)))})),function(n){const r=qn(n).toLowerCase(),s=Cn.isSingular(r)?Cn.plural(r):Cn.singular(r);return e.has(s)&&!t.has(s)?s:""}}();document.querySelectorAll("dfn:not([data-lt-no-plural]):not([data-lt-noDefault])").forEach((e=>{const n=[e.textContent];e.dataset.lt&&n.push(...e.dataset.lt.split("|")),e.dataset.localLt&&n.push(...e.dataset.localLt.split("|"));const r=new Set(n.map(t).filter((e=>e)));if(r.size){const t=e.dataset.plurals?e.dataset.plurals.split("|"):[],n=[...new Set([...t,...r])];e.dataset.plurals=n.join("|"),ta(e,n)}}))}});var la=String.raw`span.example-title{text-transform:none}
+ `}});var Xi=Object.freeze({__proto__:null,name:Ji,run:function(e){const t=document.querySelector("section#conformance");if(t&&!t.classList.contains("override")&&function(e,t){const n=[...Object.keys(Li)];n.length&&(t.normativeReferences.add("RFC2119"),t.normativeReferences.add("RFC8174"));const r=Gn(n.sort(),(e=>kn`${e}`)),s=n.length>1,o=kn`
+ ${Qi.conformance}
+ ${Qi.normativity}
+ ${n.length?Qi.keywordInterpretation(r,s):null}
+ `;e.prepend(...o.childNodes)}(t,e),!t&&Object.keys(Li).length){ur("Document uses RFC2119 keywords but lacks a conformance section.",Ji,{hint:'Please add a ``.'})}}});function ea(e,t,n,r){try{switch(t){case"element-attr":return document.createAttribute(e),!0;case"element":return document.createElement(e),!0}}catch(s){lr(`Invalid ${t} name "${e}": ${s.message}`,r,{hint:`Check that the ${t} name is allowed per the XML's Name production for ${t}.`,elements:[n]})}return!1}function ta(e,t,n,r){if(/^[a-z]+(-[a-z]+)*$/i.test(e))return!0;return lr(`Invalid ${t} name "${e}".`,r,{hint:`Check that the ${t} name is allowed per the naming rules for this type.`,elements:[n]}),!1}const na=new ar;function ra(e,t){for(const n of t)na.has(n)||na.set(n,new Set),na.get(n).add(e)}const sa="core/dfn",oa=new Map([["abstract-op",{requiresFor:!1}],["attr-value",{requiresFor:!0,associateWith:"a markup attribute",validator:ta}],["element",{requiresFor:!1,validator:ea}],["element-attr",{requiresFor:!1,validator:ea}],["element-state",{requiresFor:!0,associateWith:"a markup attribute",validator:ta}],["event",{requiresFor:!1,validator:ta}],["http-header",{requiresFor:!1}],["media-type",{requiresFor:!1,validator:function(e,t,n,r){try{const t=new _n(e);if(t.toString()!==e)throw new Error(`Input doesn't match its canonical form: "${t}".`)}catch(s){return lr(`Invalid ${t} "${e}": ${s.message}.`,r,{hint:"Check that the MIME type has both a type and a sub-type, and that it's in a canonical form (e.g., `text/plain`).",elements:[n]}),!1}return!0}}],["scheme",{requiresFor:!1,validator:ta}],["permission",{requiresFor:!1,validator:function(e,t,n,r){return e.startsWith('"')&&e.endsWith('"')?ta(e.slice(1,-1),t,n,r):(lr(`Invalid ${t} "${e}".`,r,{hint:`Check that the ${t} is quoted with double quotes.`,elements:[n]}),!1)}}]]),ia=[...oa.keys()];function aa(e,t){let n="";switch(!0){case ia.some((t=>e.classList.contains(t))):n=[...e.classList].find((e=>oa.has(e))),function(e,t,n){const r=oa.get(t);if(r.requiresFor&&!n.dataset.dfnFor){const e=gr`Definition of type "\`${t}\`" requires a ${"[data-dfn-for]"} attribute.`,{associateWith:s}=r,o=gr`Use a ${"[data-dfn-for]"} attribute to associate this with ${s}.`;lr(e,sa,{hint:o,elements:[n]})}r.validator&&r.validator(e,t,n,sa)}(t,n,e);break;case Ho.test(t):n=function(e,t){t.dataset.hasOwnProperty("idl")||(t.dataset.idl="");const n=t.closest("[data-dfn-for]");t!==n&&n?.dataset.dfnFor&&(t.dataset.dfnFor=n.dataset.dfnFor);if(!t.dataset.dfnFor){const n=gr`Use a ${"[data-dfn-for]"} attribute to associate this dfn with a WebIDL interface.`;lr(`Internal slot "${e}" must be associated with a WebIDL interface.`,sa,{hint:n,elements:[t]})}t.matches(".export, [data-export]")||(t.dataset.noexport="");const r=e.endsWith(")")?"method":"attribute";if(!t.dataset.dfnType)return r;const s=["attribute","method"],{dfnType:o}=t.dataset;if(!s.includes(o)||r!==o){const n=gr`Invalid ${"[data-dfn-type]"} attribute on internal slot.`,o=`The only allowed types are: ${fr(s,{quotes:!0})}. The slot "${e}" seems to be a "${pr(r)}"?`;return lr(n,sa,{hint:o,elements:[t]}),"dfn"}return o}(t,e)}if(!n&&!e.matches("[data-dfn-type]")){const t=e.closest("[data-dfn-type]");n=t?.dataset.dfnType}n&&!e.dataset.dfnType&&(e.dataset.dfnType=n)}function ca(e){switch(!0){case e.matches(".export.no-export"):lr(gr`Declares both "${"[no-export]"}" and "${"[export]"}" CSS class.`,sa,{elements:[e],hint:"Please use only one."});break;case e.matches(".no-export, [data-noexport]"):if(e.matches("[data-export]")){lr(gr`Declares ${"[no-export]"} CSS class, but also has a "${"[data-export]"}" attribute.`,sa,{elements:[e],hint:"Please chose only one."}),delete e.dataset.export}e.dataset.noexport="";break;case e.matches(":is(.export):not([data-noexport], .no-export)"):e.dataset.export=""}}var la=Object.freeze({__proto__:null,name:sa,run:function(){for(const e of document.querySelectorAll("dfn")){const t=Zn(e);if(ra(e,t),e.dataset.cite&&/\b#\b/.test(e.dataset.cite))continue;const[n]=t;aa(e,n),ca(e);const r=(e.dataset.localLt||"").split("|").map(qn),s=t.filter((e=>!r.includes(e)));(s.length>1||n!==qn(e.textContent))&&(e.dataset.lt=s.join("|"))}}});var ua=Object.freeze({__proto__:null,name:"core/pluralize",run:function(e){if(!e.pluralize)return;const t=function(){const e=new Set;document.querySelectorAll("a:not([href])").forEach((t=>{const n=qn(t.textContent).toLowerCase();e.add(n),t.dataset.lt&&e.add(t.dataset.lt)}));const t=new Set,n=document.querySelectorAll("dfn:not([data-lt-noDefault])");return n.forEach((e=>{const n=qn(e.textContent).toLowerCase();t.add(n),e.dataset.lt&&e.dataset.lt.split("|").forEach((e=>t.add(e))),e.dataset.localLt&&e.dataset.localLt.split("|").forEach((e=>t.add(e)))})),function(n){const r=qn(n).toLowerCase(),s=Cn.isSingular(r)?Cn.plural(r):Cn.singular(r);return e.has(s)&&!t.has(s)?s:""}}();document.querySelectorAll("dfn:not([data-lt-no-plural]):not([data-lt-noDefault])").forEach((e=>{const n=[e.textContent];e.dataset.lt&&n.push(...e.dataset.lt.split("|")),e.dataset.localLt&&n.push(...e.dataset.localLt.split("|"));const r=new Set(n.map(t).filter((e=>e)));if(r.size){const t=e.dataset.plurals?e.dataset.plurals.split("|"):[],n=[...new Set([...t,...r])];e.dataset.plurals=n.join("|"),ra(e,n)}}))}});var da=String.raw`span.example-title{text-transform:none}
:is(aside,div).example,div.illegal-example{padding:.5em;margin:1em 0;position:relative;clear:both}
div.illegal-example{color:red}
div.illegal-example p{color:#000}
-aside.example div.example{border-left-width:.1em;border-color:#999;background:#fff}`;const ua=Wn({en:{example:"Example"},nl:{example:"Voorbeeld"},es:{example:"Ejemplo"},ko:{example:"예시"},ja:{example:"例"},de:{example:"Beispiel"},zh:{example:"例"},cs:{example:"Příklad"}});function da(e,t,n){n.title=e.title,n.title&&e.removeAttribute("title");const r=t>0?` ${t}`:"",s=n.title?kn`: ${n.title}`:"";return kn`
- ${ua.example}${r}0?` ${t}`:"",s=n.title?kn`: ${n.title}`:"";return kn`
+ ${pa.example}${r}${s}
- `}var pa=Object.freeze({__proto__:null,name:"core/examples",run:function(){const e=document.querySelectorAll("pre.example, pre.illegal-example, aside.example");if(!e.length)return;document.head.insertBefore(kn``,document.querySelector("link"));let t=0;e.forEach((e=>{e.classList.contains("illegal-example");const n={},{title:r}=e;if("aside"===e.localName){++t;const s=da(e,t,n);e.prepend(s);const o=Kn(e,"example",r||String(t));s.querySelector("a.self-link").href=`#${o}`}else{const s=!!e.closest("aside");s||++t,n.content=e.innerHTML,e.classList.remove("example","illegal-example");const o=e.id?e.id:null;o&&e.removeAttribute("id");const i=da(e,s?0:t,n),a=kn`
+ `}var ha=Object.freeze({__proto__:null,name:"core/examples",run:function(){const e=document.querySelectorAll("pre.example, pre.illegal-example, aside.example");if(!e.length)return;document.head.insertBefore(kn``,document.querySelector("link"));let t=0;e.forEach((e=>{e.classList.contains("illegal-example");const n={},{title:r}=e;if("aside"===e.localName){++t;const s=fa(e,t,n);e.prepend(s);const o=Kn(e,"example",r||String(t));s.querySelector("a.self-link").href=`#${o}`}else{const s=!!e.closest("aside");s||++t,n.content=e.innerHTML,e.classList.remove("example","illegal-example");const o=e.id?e.id:null;o&&e.removeAttribute("id");const i=fa(e,s?0:t,n),a=kn`
${i} ${e.cloneNode(!0)}
- `;Kn(a,"example",r||String(t));a.querySelector("a.self-link").href=`#${a.id}`,e.replaceWith(a)}}))}});var fa=String.raw`.issue-label{text-transform:initial}
+ `;Kn(a,"example",r||String(t));a.querySelector("a.self-link").href=`#${a.id}`,e.replaceWith(a)}}))}});var ma=String.raw`.issue-label{text-transform:initial}
.warning>p:first-child{margin-top:0}
.warning{padding:.5em;border-left-width:.5em;border-left-style:solid}
span.warning{padding:.1em .5em .15em}
@@ -858,31 +862,31 @@ span.warning{padding:.1em .5em .15em}
.warning-title:before{content:"⚠";font-size:1.3em;float:left;padding-right:.3em;margin-top:-.3em}
li.task-list-item{list-style:none}
input.task-list-item-checkbox{margin:0 .35em .25em -1.6em;vertical-align:middle}
-.issue a.respec-gh-label{padding:5px;margin:0 2px 0 2px;font-size:10px;text-transform:none;text-decoration:none;font-weight:700;border-radius:4px;position:relative;bottom:2px;border:none;display:inline-block}`;const ha="core/issues-notes",ma=Wn({en:{editors_note:"Editor's note",feature_at_risk:"(Feature at Risk) Issue",issue:"Issue",issue_summary:"Issue summary",no_issues_in_spec:"There are no issues listed in this specification.",note:"Note",warning:"Warning"},ja:{note:"注",editors_note:"編者注",feature_at_risk:"(変更の可能性のある機能) Issue",issue:"Issue",issue_summary:"Issue の要約",no_issues_in_spec:"この仕様には未解決の issues は含まれていません.",warning:"警告"},nl:{editors_note:"Redactionele noot",issue_summary:"Lijst met issues",no_issues_in_spec:"Er zijn geen problemen vermeld in deze specificatie.",note:"Noot",warning:"Waarschuwing"},es:{editors_note:"Nota de editor",issue:"Cuestión",issue_summary:"Resumen de la cuestión",note:"Nota",no_issues_in_spec:"No hay problemas enumerados en esta especificación.",warning:"Aviso"},de:{editors_note:"Redaktioneller Hinweis",issue:"Frage",issue_summary:"Offene Fragen",no_issues_in_spec:"Diese Spezifikation enthält keine offenen Fragen.",note:"Hinweis",warning:"Warnung"},zh:{editors_note:"编者注",feature_at_risk:"(有可能变动的特性)Issue",issue:"Issue",issue_summary:"Issue 总结",no_issues_in_spec:"本规范中未列出任何 issue。",note:"注",warning:"警告"},cs:{editors_note:"Poznámka editora",feature_at_risk:"(Funkce v ohrožení) Problém",issue:"Problém",issue_summary:"Souhrn problémů",no_issues_in_spec:"V této specifikaci nejsou uvedeny žádné problémy.",note:"Poznámka",warning:"Varování"}});function ga(e,t,n){const r=function(){if(document.querySelector(".issue[data-number]"))return e=>{if(e.dataset.number)return Number(e.dataset.number)};let e=0;return t=>{if(t.classList.contains("issue")&&"span"!==t.localName)return++e}}(),s=document.createElement("ul");e.forEach((e=>{const{type:o,displayType:i,isFeatureAtRisk:a}=function(e){const t=e.classList.contains("issue"),n=e.classList.contains("warning"),r=e.classList.contains("ednote"),s=e.classList.contains("atrisk"),o=t?"issue":n?"warning":r?"ednote":"note",i=t?s?ma.feature_at_risk:ma.issue:n?ma.warning:r?ma.editors_note:ma.note;return{type:o,displayType:i,isFeatureAtRisk:s}}(e),c="issue"===o,l="span"===e.localName,{number:u}=e.dataset,d={title:e.title,number:r(e)};if(!l){const r=kn``,l=document.createElement("span"),p=kn`${l}`;Kn(p,"h",o);let f,h=i;if(e.id?(r.id=e.id,e.removeAttribute("id")):Kn(r,"issue-container",d.number?`number-${d.number}`:""),c){if(void 0!==d.number&&(h+=` ${d.number}`),e.dataset.hasOwnProperty("number")){const e=function(e,t,{isFeatureAtRisk:n=!1}={}){if(!n&&t.issueBase)return kn``;if(n&&t.atRiskBase)return kn``}(u,n,{isFeatureAtRisk:a});if(e&&(l.before(e),e.append(l)),l.classList.add("issue-number"),f=t.get(u),!f){ur(`Failed to fetch issue number ${u}.`,ha)}f&&!d.title&&(d.title=f.title)}s.append(function(e,t,n){const r=`${e}${t.number?` ${t.number}`:""}`,s=t.title?kn`: ${t.title}`:"";return kn`${r}${s} `}(ma.issue,d,r.id))}if(l.textContent=h,d.title){e.removeAttribute("title");const{repoURL:t=""}=n.github||{},s=f?f.labels:[];f&&"CLOSED"===f.state&&r.classList.add("closed"),p.append(function(e,t,n){const r=e.map((e=>function(e,t){const{color:n,name:r}=e,s=new URL("./issues/",t);s.searchParams.set("q",`is:issue is:open label:"${e.name}"`);const o=function(e){const[t,n,r]=[e.slice(0,2),e.slice(2,4),e.slice(4,6)],[s,o,i]=[t,n,r].map((e=>parseInt(e,16)/255)).map((e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4));return.2126*s+.7152*o+.0722*i>.179?"#000":"#fff"}(n),i=`background-color: #${n}; color: ${o}`,a=`GitHub label: ${r}`;return kn` {if(e.dataset.number)return Number(e.dataset.number)};let e=0;return t=>{if(t.classList.contains("issue")&&"span"!==t.localName)return++e}}(),s=document.createElement("ul");e.forEach((e=>{const{type:o,displayType:i,isFeatureAtRisk:a}=function(e){const t=e.classList.contains("issue"),n=e.classList.contains("warning"),r=e.classList.contains("ednote"),s=e.classList.contains("atrisk"),o=t?"issue":n?"warning":r?"ednote":"note",i=t?s?ba.feature_at_risk:ba.issue:n?ba.warning:r?ba.editors_note:ba.note;return{type:o,displayType:i,isFeatureAtRisk:s}}(e),c="issue"===o,l="span"===e.localName,{number:u}=e.dataset,d={title:e.title,number:r(e)};if(!l){const r=kn``,l=document.createElement("span"),p=kn`${l}`;Kn(p,"h",o);let f,h=i;if(e.id?(r.id=e.id,e.removeAttribute("id")):Kn(r,"issue-container",d.number?`number-${d.number}`:""),c){if(void 0!==d.number&&(h+=` ${d.number}`),e.dataset.hasOwnProperty("number")){const e=function(e,t,{isFeatureAtRisk:n=!1}={}){if(!n&&t.issueBase)return kn``;if(n&&t.atRiskBase)return kn``}(u,n,{isFeatureAtRisk:a});if(e&&(l.before(e),e.append(l)),l.classList.add("issue-number"),f=t.get(u),!f){ur(`Failed to fetch issue number ${u}.`,ga)}f&&!d.title&&(d.title=f.title)}s.append(function(e,t,n){const r=`${e}${t.number?` ${t.number}`:""}`,s=t.title?kn`: ${t.title}`:"";return kn`${r}${s} `}(ba.issue,d,r.id))}if(l.textContent=h,d.title){e.removeAttribute("title");const{repoURL:t=""}=n.github||{},s=f?f.labels:[];f&&"CLOSED"===f.state&&r.classList.add("closed"),p.append(function(e,t,n){const r=e.map((e=>function(e,t){const{color:n,name:r}=e,s=new URL("./issues/",t);s.searchParams.set("q",`is:issue is:open label:"${e.name}"`);const o=function(e){const[t,n,r]=[e.slice(0,2),e.slice(2,4),e.slice(4,6)],[s,o,i]=[t,n,r].map((e=>parseInt(e,16)/255)).map((e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4));return.2126*s+.7152*o+.0722*i>.179?"#000":"#fff"}(n),i=`background-color: #${n}; color: ${o}`,a=`GitHub label: ${r}`;return kn` ${r}`}(e,n)));r.length&&r.unshift(document.createTextNode(" "));return kn`: ${t}${r}`}(s,d.title,t))}let m=e;e.replaceWith(r),m.classList.remove(o),m.removeAttribute("data-number"),f&&!m.innerHTML.trim()&&(m=document.createRange().createContextualFragment(f.bodyHTML)),r.append(p,m);const g=tr(p,"section").length+2;p.setAttribute("aria-level",g)}})),function(e){const t=document.getElementById("issue-summary");if(!t)return;const n=t.querySelector("h2, h3, h4, h5, h6");e.hasChildNodes()?t.append(e):t.append(kn`${ma.no_issues_in_spec}
`),(!n||n&&n!==t.firstElementChild)&&t.insertAdjacentHTML("afterbegin",`${ma.issue_summary}
`)}(s)}var ba=Object.freeze({__proto__:null,name:ha,run:async function(e){const t=document.querySelectorAll(".issue, .note, .warning, .ednote"),n=Array.from(t).filter((e=>e instanceof HTMLElement));if(!n.length)return;const r=await async function(e){if(!e||!e.apiBase)return new Map;const t=[...document.querySelectorAll(".issue[data-number]")].map((e=>Number.parseInt(e.dataset.number,10))).filter((e=>e));if(!t.length)return new Map;const n=new URL("issues",`${e.apiBase}/${e.fullName}/`);n.searchParams.set("issues",t.join(","));const r=await fetch(n.href);if(!r.ok)return lr(`Error fetching issues from GitHub. (HTTP Status ${r.status}).`,ha),new Map;const s=await r.json();return new Map(Object.entries(s))}(e.github),{head:s}=document;s.insertBefore(kn``,s.querySelector("link")),ga(n,r,e),document.querySelectorAll(".ednote").forEach((e=>{e.classList.remove("ednote"),e.classList.add("note")}))}});const ya="core/best-practices",wa={en:{best_practice:"Best Practice "},ja:{best_practice:"最良実施例 "},de:{best_practice:"Musterbeispiel "},zh:{best_practice:"最佳实践 "}},va=Wn(wa),ka=o in wa?o:"en";var $a=Object.freeze({__proto__:null,name:ya,run:function(){const e=document.querySelectorAll(".practicelab"),t=document.getElementById("bp-summary"),n=t?document.createElement("ul"):null;if([...e].forEach(((e,t)=>{const r=Kn(e,"bp"),s=kn`${va.best_practice}${t+1}`;if(n){const t=kn`${s}: ${sr(e)} `;n.appendChild(t)}const o=e.closest("div");if(!o)return void e.classList.add("advisement");o.classList.add("advisement");const i=kn`${s.cloneNode(!0)}: ${e}`;o.prepend(...i.childNodes)})),e.length)t&&(t.appendChild(kn`Best Practices Summary
`),t.appendChild(n));else if(t){ur("Using best practices summary (#bp-summary) but no best practices found.",ya),t.remove()}}});const xa="core/figures",_a=Wn({en:{list_of_figures:"List of Figures",fig:"Figure "},ja:{fig:"図 ",list_of_figures:"図のリスト"},ko:{fig:"그림 ",list_of_figures:"그림 목록"},nl:{fig:"Figuur ",list_of_figures:"Lijst met figuren"},es:{fig:"Figura ",list_of_figures:"Lista de Figuras"},zh:{fig:"图 ",list_of_figures:"规范中包含的图"},de:{fig:"Abbildung",list_of_figures:"Abbildungsverzeichnis"}});var Ca=Object.freeze({__proto__:null,name:xa,run:function(){const e=function(){const e=[];return document.querySelectorAll("figure").forEach(((t,n)=>{const r=t.querySelector("figcaption");if(r)!function(e,t,n){const r=t.textContent;Kn(e,"fig",r),Xn(t,kn``),t.prepend(kn`${_a.fig}${n+1}`}(e,n)));r.length&&r.unshift(document.createTextNode(" "));return kn`: ${t}${r}`}(s,d.title,t))}let m=e;e.replaceWith(r),m.classList.remove(o),m.removeAttribute("data-number"),f&&!m.innerHTML.trim()&&(m=document.createRange().createContextualFragment(f.bodyHTML)),r.append(p,m);const g=tr(p,"section").length+2;p.setAttribute("aria-level",g)}})),function(e){const t=document.getElementById("issue-summary");if(!t)return;const n=t.querySelector("h2, h3, h4, h5, h6");e.hasChildNodes()?t.append(e):t.append(kn`${ba.no_issues_in_spec}
`),(!n||n&&n!==t.firstElementChild)&&t.insertAdjacentHTML("afterbegin",`${ba.issue_summary}
`)}(s)}var wa=Object.freeze({__proto__:null,name:ga,run:async function(e){const t=document.querySelectorAll(".issue, .note, .warning, .ednote"),n=Array.from(t).filter((e=>e instanceof HTMLElement));if(!n.length)return;const r=await async function(e){if(!e||!e.apiBase)return new Map;const t=[...document.querySelectorAll(".issue[data-number]")].map((e=>Number.parseInt(e.dataset.number,10))).filter((e=>e));if(!t.length)return new Map;const n=new URL("issues",`${e.apiBase}/${e.fullName}/`);n.searchParams.set("issues",t.join(","));const r=await fetch(n.href);if(!r.ok)return lr(`Error fetching issues from GitHub. (HTTP Status ${r.status}).`,ga),new Map;const s=await r.json();return new Map(Object.entries(s))}(e.github),{head:s}=document;s.insertBefore(kn``,s.querySelector("link")),ya(n,r,e),document.querySelectorAll(".ednote").forEach((e=>{e.classList.remove("ednote"),e.classList.add("note")}))}});const va="core/best-practices",ka={en:{best_practice:"Best Practice "},ja:{best_practice:"最良実施例 "},de:{best_practice:"Musterbeispiel "},zh:{best_practice:"最佳实践 "}},$a=Wn(ka),xa=o in ka?o:"en";var _a=Object.freeze({__proto__:null,name:va,run:function(){const e=document.querySelectorAll(".practicelab"),t=document.getElementById("bp-summary"),n=t?document.createElement("ul"):null;if([...e].forEach(((e,t)=>{const r=Kn(e,"bp"),s=kn`${$a.best_practice}${t+1}`;if(n){const t=kn`${s}: ${sr(e)} `;n.appendChild(t)}const o=e.closest("div");if(!o)return void e.classList.add("advisement");o.classList.add("advisement");const i=kn`${s.cloneNode(!0)}: ${e}`;o.prepend(...i.childNodes)})),e.length)t&&(t.appendChild(kn`Best Practices Summary
`),t.appendChild(n));else if(t){ur("Using best practices summary (#bp-summary) but no best practices found.",va),t.remove()}}});const Ca="core/figures",Sa=Wn({en:{list_of_figures:"List of Figures",fig:"Figure "},ja:{fig:"図 ",list_of_figures:"図のリスト"},ko:{fig:"그림 ",list_of_figures:"그림 목록"},nl:{fig:"Figuur ",list_of_figures:"Lijst met figuren"},es:{fig:"Figura ",list_of_figures:"Lista de Figuras"},zh:{fig:"图 ",list_of_figures:"规范中包含的图"},de:{fig:"Abbildung",list_of_figures:"Abbildungsverzeichnis"}});var Ra=Object.freeze({__proto__:null,name:Ca,run:function(){const e=function(){const e=[];return document.querySelectorAll("figure").forEach(((t,n)=>{const r=t.querySelector("figcaption");if(r)!function(e,t,n){const r=t.textContent;Kn(e,"fig",r),Xn(t,kn``),t.prepend(kn`${Sa.fig}${n+1}`," ")}(t,r,n),e.push(function(e,t){const n=t.cloneNode(!0);return n.querySelectorAll("a").forEach((e=>{Jn(e,"span").removeAttribute("href")})),kn`
${n.childNodes}
- `}(t.id,r));else{ur("Found a `` without a ``.",xa,{elements:[t]})}})),e}(),t=document.getElementById("tof");e.length&&t&&(!function(e){if(e.classList.contains("appendix")||e.classList.contains("introductory")||e.closest("section"))return;const t=er(e);t.every((e=>e.classList.contains("introductory")))?e.classList.add("introductory"):t.some((e=>e.classList.contains("appendix")))&&e.classList.add("appendix")}(t),t.append(kn`${_a.list_of_figures}
`,kn`
+ `}(t.id,r));else{ur("Found a `` without a ``.",Ca,{elements:[t]})}})),e}(),t=document.getElementById("tof");e.length&&t&&(!function(e){if(e.classList.contains("appendix")||e.classList.contains("introductory")||e.closest("section"))return;const t=er(e);t.every((e=>e.classList.contains("introductory")))?e.classList.add("introductory"):t.some((e=>e.classList.contains("appendix")))&&e.classList.add("appendix")}(t),t.append(kn`${Sa.list_of_figures}
`,kn`
${e}
-
`))}});const Sa=Wn({en:{list_of_tables:"List of Tables",table:"Table "}});var Ra=Object.freeze({__proto__:null,name:"core/tables",run:function(){const e=function(){const e=[],t=document.querySelectorAll("table.numbered");return[...t].filter((e=>!!e.querySelector("caption"))).forEach(((t,n)=>{const r=t.querySelector("caption");!function(e,t,n){const r=t.textContent;Kn(e,"table",r),Xn(t,kn``),t.prepend(kn`${Sa.table}${n+1}`))}});const Ea=Wn({en:{list_of_tables:"List of Tables",table:"Table "}});var Aa=Object.freeze({__proto__:null,name:"core/tables",run:function(){const e=function(){const e=[],t=document.querySelectorAll("table.numbered");return[...t].filter((e=>!!e.querySelector("caption"))).forEach(((t,n)=>{const r=t.querySelector("caption");!function(e,t,n){const r=t.textContent;Kn(e,"table",r),Xn(t,kn``),t.prepend(kn`${Ea.table}${n+1}`," ")}(t,r,n),e.push(function(e,t){const n=t.cloneNode(!0);for(const e of n.querySelectorAll("a"))Jn(e,"span",{copyAttributes:!1});return kn`-
${n.childNodes}
-
`}(t.id,r))})),e}(),t=document.querySelector("section#list-of-tables");e.length&&t&&(!function(e){if(e.matches(".appendix, .introductory")||e.closest("section"))return;const t=er(e);t.every((e=>e.classList.contains("introductory")))?e.classList.add("introductory"):t.some((e=>e.classList.contains("appendix")))&&e.classList.add("appendix")}(t),t.append(kn`${Sa.list_of_tables}
`,kn`
+ `}(t.id,r))})),e}(),t=document.querySelector("section#list-of-tables");e.length&&t&&(!function(e){if(e.matches(".appendix, .introductory")||e.closest("section"))return;const t=er(e);t.every((e=>e.classList.contains("introductory")))?e.classList.add("introductory"):t.some((e=>e.classList.contains("appendix")))&&e.classList.add("appendix")}(t),t.append(kn`${Ea.list_of_tables}
`,kn`
${e}
-
`))}});const Ea=new Set(["callback interface","callback","dictionary","enum","interface mixin","interface","typedef"]);function Aa(e,t,{parent:n=""}={}){switch(e.type){case"constructor":case"operation":return function(e,t,n){if(n.includes("!overload"))return La(e,t,n);const r=`${n}()`;return La(e,t,r,n)}(e,n,t);default:return La(e,n,t)}}function La(e,t,...n){const{type:r}=e;for(const e of n){let n="enum-value"===r&&""===e?"the-empty-string":e,s=Pa(n,t,e,r);if(0===s.length&&""!==t){n=`${t}.${n}`;const e=ea.get(n);e&&1===e.size&&(s=[...e],ta(s[0],[n]))}else n=e;if(s.length>1){lr(`WebIDL identifier \`${e}\` ${t?`for \`${t}\``:""} is defined multiple times`,e,{title:"Duplicate definition.",elements:s})}if(s.length)return s[0]}}function Ta(e,t,n,r){if(!e.id){const t=n.toLowerCase(),s=t?`${t}-`:"";let o=r.toLowerCase().replace(/[()]/g,"").replace(/\s/g,"-");""===o&&(o="the-empty-string",e.setAttribute("aria-label","the empty string")),e.id=`dom-${s}${o}`}switch(e.dataset.idl=t.type,e.dataset.title=e.textContent,e.dataset.dfnFor=n,t.type){case"operation":case"attribute":case"field":e.dataset.type=Ia(t)}switch(e.querySelector("code")||e.closest("code")||!e.children||Xn(e,e.ownerDocument.createElement("code")),t.type){case"attribute":case"constructor":case"operation":!function(e,t){const{local:n,exportable:r}=t,s=e.dataset.lt?new Set(e.dataset.lt.split("|")):new Set;for(const e of r)s.add(e);n.filter((e=>s.has(e))).forEach((e=>s.delete(e))),e.dataset.lt=[...s].join("|"),e.dataset.localLt=n.join("|"),ta(e,[...n,...r])}(e,function(e,t,n){const{type:r}=e,s=`${t}.${n}`;switch(r){case"constructor":case"operation":{const t=`${n}()`,r=`${s}()`,o=function(e,t){const n=[];if(0===t.length)return n;const r=[],s=[];for(const{name:e,optional:n,variadic:o}of t)n||o?s.push(e):r.push(e);const o=r.join(", "),i=`${e}(${o})`;n.push(i);const a=s.map(((t,n)=>{const o=[...r,...s.slice(0,n+1)].join(", ");return`${e}(${o})`}));return n.push(...a),n}(n,e.arguments);return{local:[s,r,n],exportable:[t,...o]}}case"attribute":return{local:[s],exportable:[n]}}}(t,n,r))}return e}function Pa(e,t,n,r){const s=ea.get(e);if(!s||0===s.size)return[];const o=[...s],i=o.filter((e=>{if("dfn"===e.dataset.dfnType)return!1;const n=e.closest("[data-dfn-for]");return n&&n.dataset.dfnFor===t}));if(0===i.length&&""===t&&1===o.length)return o[0].textContent===n?o:[];if(Ea.has(r)&&o.length){const e=o.find((e=>e.textContent.trim()===n));if(e)return[e]}return i}function Ia(e={}){const{idlType:t,generic:n,union:r}=e;return void 0===t?"":"string"==typeof t?t:n||(r?t.map(Ia).join("|"):Ia(t))}const Da=function(){const e=document.createElement("button");return e.innerHTML='',e.title="Copy IDL to clipboard",e.classList.add("respec-button-copy-paste","removeOnSave"),e}();function Na(e){const t=e.closest("pre.idl").cloneNode(!0);t.querySelector(".idlHeader").remove();const{textContent:n}=t,r=Da.cloneNode(!0);r.addEventListener("click",(()=>{navigator.clipboard.writeText(n)})),e.append(r)}var ja=Object.freeze({__proto__:null,addCopyIDLButton:Na,name:"core/webidl-clipboard"});var Oa=String.raw`pre.idl{padding:1em;position:relative}
+
`))}});const La=new Set(["callback interface","callback","dictionary","enum","interface mixin","interface","typedef"]);function Ta(e,t,{parent:n=""}={}){switch(e.type){case"constructor":case"operation":return function(e,t,n){if(n.includes("!overload"))return Pa(e,t,n);const r=`${n}()`;return Pa(e,t,r,n)}(e,n,t);default:return Pa(e,n,t)}}function Pa(e,t,...n){const{type:r}=e;for(const e of n){let n="enum-value"===r&&""===e?"the-empty-string":e,s=Da(n,t,e,r);if(0===s.length&&""!==t){n=`${t}.${n}`;const e=na.get(n);e&&1===e.size&&(s=[...e],ra(s[0],[n]))}else n=e;if(s.length>1){lr(`WebIDL identifier \`${e}\` ${t?`for \`${t}\``:""} is defined multiple times`,e,{title:"Duplicate definition.",elements:s})}if(s.length)return s[0]}}function Ia(e,t,n,r){if(!e.id){const t=n.toLowerCase(),s=t?`${t}-`:"";let o=r.toLowerCase().replace(/[()]/g,"").replace(/\s/g,"-");""===o&&(o="the-empty-string",e.setAttribute("aria-label","the empty string")),e.id=`dom-${s}${o}`}switch(e.dataset.idl=t.type,e.dataset.title=e.textContent,e.dataset.dfnFor=n,t.type){case"operation":case"attribute":case"field":e.dataset.type=Na(t)}switch(e.querySelector("code")||e.closest("code")||!e.children||Xn(e,e.ownerDocument.createElement("code")),t.type){case"attribute":case"constructor":case"operation":!function(e,t){const{local:n,exportable:r}=t,s=e.dataset.lt?new Set(e.dataset.lt.split("|")):new Set;for(const e of r)s.add(e);n.filter((e=>s.has(e))).forEach((e=>s.delete(e))),e.dataset.lt=[...s].join("|"),e.dataset.localLt=n.join("|"),ra(e,[...n,...r])}(e,function(e,t,n){const{type:r}=e,s=`${t}.${n}`;switch(r){case"constructor":case"operation":{const t=`${n}()`,r=`${s}()`,o=function(e,t){const n=[];if(0===t.length)return n;const r=[],s=[];for(const{name:e,optional:n,variadic:o}of t)n||o?s.push(e):r.push(e);const o=r.join(", "),i=`${e}(${o})`;n.push(i);const a=s.map(((t,n)=>{const o=[...r,...s.slice(0,n+1)].join(", ");return`${e}(${o})`}));return n.push(...a),n}(n,e.arguments);return{local:[s,r,n],exportable:[t,...o]}}case"attribute":return{local:[s],exportable:[n]}}}(t,n,r))}return e}function Da(e,t,n,r){const s=na.get(e);if(!s||0===s.size)return[];const o=[...s],i=o.filter((e=>{if("dfn"===e.dataset.dfnType)return!1;const n=e.closest("[data-dfn-for]");return n&&n.dataset.dfnFor===t}));if(0===i.length&&""===t&&1===o.length)return o[0].textContent===n?o:[];if(La.has(r)&&o.length){const e=o.find((e=>e.textContent.trim()===n));if(e)return[e]}return i}function Na(e={}){const{idlType:t,generic:n,union:r}=e;return void 0===t?"":"string"==typeof t?t:n||(r?t.map(Na).join("|"):Na(t))}const ja=function(){const e=document.createElement("button");return e.innerHTML='',e.title="Copy IDL to clipboard",e.classList.add("respec-button-copy-paste","removeOnSave"),e}();function Oa(e){const t=e.closest("pre.idl").cloneNode(!0);t.querySelector(".idlHeader").remove();const{textContent:n}=t,r=ja.cloneNode(!0);r.addEventListener("click",(()=>{navigator.clipboard.writeText(n)})),e.append(r)}var za=Object.freeze({__proto__:null,addCopyIDLButton:Oa,name:"core/webidl-clipboard"});var Ma=String.raw`pre.idl{padding:1em;position:relative}
pre.idl>code{color:#000;color:var(--text,#000)}
@media print{
pre.idl{white-space:pre-wrap}
@@ -907,19 +911,19 @@ a.idlEnumItem{color:#000;border-bottom:1px dotted #ccc;text-decoration:none}
.respec-button-copy-paste:is(:disabled,:disabled:hover,.disabled,.disabled:hover){color:rgba(102,102,102,.5);cursor:default;background-color:rgba(229,229,229,.5);background-image:none;border-color:rgba(197,197,197,.5);box-shadow:none}
@media print{
.respec-button-copy-paste{visibility:hidden}
-}`;const za="core/webidl",Ma=za,qa={},Wa={},Ua={wrap:e=>e.flat().filter((e=>""!==e)).map((e=>"string"==typeof e?new Text(e):e)),trivia:e=>e.trim()?kn`${e}`:e,generic:e=>/^[A-Z]/.test(e)?kn`${e}`:kn`${e}`,reference(e,t,n){if("extended-attribute"===n.type)return e;let r="_IDL_",s=null;if("object"===t)r="interface",s="WEBIDL";return kn`e.flat().filter((e=>""!==e)).map((e=>"string"==typeof e?new Text(e):e)),trivia:e=>e.trim()?kn`${e}`:e,generic:e=>/^[A-Z]/.test(e)?kn`${e}`:kn`${e}`,reference(e,t,n){if("extended-attribute"===n.type)return e;let r="_IDL_",s=null;if("object"===t)r="interface",s="WEBIDL";return kn`${e}`},name(e,{data:t,parent:n}){if(t.idlType&&"argument-type"===t.idlType.type)return kn`${e}`;const r=Fa(e,t,n);if("enum-value"!==t.type){const e=n?"idlName":"idlID";r.classList.add(e)}return r},nameless(e,{data:t,parent:n}){switch(t.type){case"operation":case"constructor":return Fa(e,t,n);default:return e}},type:e=>kn`${e}`,inheritance:e=>kn`${e}`,definition(e,{data:t,parent:n}){const r=function(e){switch(e.type){case"callback interface":return"idlInterface";case"operation":return"idlMethod";case"field":return"idlMember";case"enum-value":return"idlEnumItem";case"callback function":return"idlCallback"}return`idl${e.type[0].toUpperCase()}${e.type.slice(1)}`}(t);switch(t.type){case"includes":case"enum-value":return kn`${e}`}const s=n?n.name:"",{name:o,idlId:i}=Ha(t,s);return kn``},name(e,{data:t,parent:n}){if(t.idlType&&"argument-type"===t.idlType.type)return kn`${e}`;const r=Ha(e,t,n);if("enum-value"!==t.type){const e=n?"idlName":"idlID";r.classList.add(e)}return r},nameless(e,{data:t,parent:n}){switch(t.type){case"operation":case"constructor":return Ha(e,t,n);default:return e}},type:e=>kn`${e}`,inheritance:e=>kn`${e}`,definition(e,{data:t,parent:n}){const r=function(e){switch(e.type){case"callback interface":return"idlInterface";case"operation":return"idlMethod";case"field":return"idlMember";case"enum-value":return"idlEnumItem";case"callback function":return"idlCallback"}return`idl${e.type[0].toUpperCase()}${e.type.slice(1)}`}(t);switch(t.type){case"includes":case"enum-value":return kn`${e}`}const s=n?n.name:"",{name:o,idlId:i}=Ga(t,s);return kn`${e}`},extendedAttribute:e=>kn`${e}`,extendedAttributeReference:e=>kn`${e}`};function Fa(e,t,n){const r=n?n.name:"",{name:s}=Ha(t,r),o=Aa(t,s,{parent:r}),i=function(e){switch(e){case"operation":return"method";case"field":return"dict-member";case"callback interface":case"interface mixin":return"interface";default:return e}}(t.type);if(o){t.partial||(o.matches("[data-noexport]")||(o.dataset.export=""),o.dataset.dfnType=i),Ta(o,t,r,s);const n=`#${o.id}`;return kn``},extendedAttribute:e=>kn`${e}`,extendedAttributeReference:e=>kn`${e}`};function Ha(e,t,n){const r=n?n.name:"",{name:s}=Ga(t,r),o=Ta(t,s,{parent:r}),i=function(e){switch(e){case"operation":return"method";case"field":return"dict-member";case"callback interface":case"interface mixin":return"interface";default:return e}}(t.type);if(o){t.partial||(o.matches("[data-noexport]")||(o.dataset.export=""),o.dataset.dfnType=i),Ia(o,t,r,s);const n=`#${o.id}`;return kn`${e}`;if(!t.partial){const n=kn`${e}`;return ta(n,[s]),Ta(n,t,r,s),n}const c=kn``;return ra(n,[s]),Ia(n,t,r,s),n}const c=kn`${e}`;if(s&&"typedef"!==t.type&&!(t.partial&&!o)){const e=gr`See ${"using `data-dfn-for`|#data-dfn-for"} in ReSpec's documentation.`;ur(`Missing \`\` for${r?` \`${r}\`'s`:""} \`${"operation"===t.type?`${s}()`:s}\` ${t.type}.`,Ma,{elements:[c],hint:e})}return c}const Ba=new WeakMap;function Ha(e,t=""){if(Ba.has(e))return Ba.get(e);const n=function(e,t){let n=function(e){switch(e.type){case"enum-value":return e.value;case"operation":return e.name||e.special;default:return e.name||e.type}}(e);const r=e.special&&""===e.name?"anonymous-":"";let s=function(e,t){if(!t)return`idl-def-${e.toLowerCase()}`;return`idl-def-${t.toLowerCase()}-${e.toLowerCase()}`}(r+n,t);switch(e.type){case"callback interface":case"dictionary":case"interface":case"interface mixin":s+=function(e){if(!e.partial)return"";Wa[e.name]||(Wa[e.name]=0);return Wa[e.name]+=1,`-partial-${Wa[e.name]}`}(e);break;case"constructor":case"operation":{const r=function(e,t){const n=`${t}.${e}`,r=`${n}()`;let s;qa[r]||(qa[r]=0);qa[n]?s=`!overload-${qa[n]}`:qa[n]=0;return qa[r]+=1,qa[n]+=1,s||""}(n,t);r?(n+=r,s+=r):e.arguments.length&&(s+=e.arguments.map((e=>`-${e.name.toLowerCase()}`)).join(""));break}}return{name:n,idlId:s}}(e,t);return Ba.set(e,n),n}const Va=["interface","interface mixin","dictionary","namespace","enum","typedef","callback"];function Ga(e,t){let n;try{n=Sn.parse(e.textContent,{sourceName:String(t)})}catch(t){return lr(`Failed to parse WebIDL: ${t.bareMessage}.`,Ma,{title:t.bareMessage,details:`${t.context}`,elements:[e]}),[]}e.classList.add("def","idl");const r=Sn.write(n,{templates:Ua});kn.bind(e)`${r}`,Xn(e,document.createElement("code")),e.querySelectorAll("[data-idl]").forEach((e=>{if(e.dataset.dfnFor)return;const t=e.dataset.title,n=e.dataset.dfnType,r=e.parentElement.closest("[data-idl][data-title]");r&&!Va.includes(n)&&(e.dataset.dfnFor=r.dataset.title),"dfn"===e.localName&&ta(e,[t])}));const s=e.closest("[data-cite], body"),{dataset:o}=s;if(o.cite||(o.cite="WEBIDL"),!/\bwebidl\b/i.test(o.cite)){const e=o.cite.trim().split(/\s+/);o.cite=["WEBIDL",...e].join(" ")}return Ya(e),n}function Ya(e){Yn(e,"webidl");const t=kn``;if(s&&"typedef"!==t.type&&!(t.partial&&!o)){const e=gr`See ${"using `data-dfn-for`|#data-dfn-for"} in ReSpec's documentation.`;ur(`Missing \`\` for${r?` \`${r}\`'s`:""} \`${"operation"===t.type?`${s}()`:s}\` ${t.type}.`,Wa,{elements:[c],hint:e})}return c}const Va=new WeakMap;function Ga(e,t=""){if(Va.has(e))return Va.get(e);const n=function(e,t){let n=function(e){switch(e.type){case"enum-value":return e.value;case"operation":return e.name||e.special;default:return e.name||e.type}}(e);const r=e.special&&""===e.name?"anonymous-":"";let s=function(e,t){if(!t)return`idl-def-${e.toLowerCase()}`;return`idl-def-${t.toLowerCase()}-${e.toLowerCase()}`}(r+n,t);switch(e.type){case"callback interface":case"dictionary":case"interface":case"interface mixin":s+=function(e){if(!e.partial)return"";Fa[e.name]||(Fa[e.name]=0);return Fa[e.name]+=1,`-partial-${Fa[e.name]}`}(e);break;case"constructor":case"operation":{const r=function(e,t){const n=`${t}.${e}`,r=`${n}()`;let s;Ua[r]||(Ua[r]=0);Ua[n]?s=`!overload-${Ua[n]}`:Ua[n]=0;return Ua[r]+=1,Ua[n]+=1,s||""}(n,t);r?(n+=r,s+=r):e.arguments.length&&(s+=e.arguments.map((e=>`-${e.name.toLowerCase()}`)).join(""));break}}return{name:n,idlId:s}}(e,t);return Va.set(e,n),n}const Ya=["interface","interface mixin","dictionary","namespace","enum","typedef","callback"];function Ka(e,t){let n;try{n=Sn.parse(e.textContent,{sourceName:String(t)})}catch(t){return lr(`Failed to parse WebIDL: ${t.bareMessage}.`,Wa,{title:t.bareMessage,details:`${t.context}`,elements:[e]}),[]}e.classList.add("def","idl");const r=Sn.write(n,{templates:Ba});kn.bind(e)`${r}`,Xn(e,document.createElement("code")),e.querySelectorAll("[data-idl]").forEach((e=>{if(e.dataset.dfnFor)return;const t=e.dataset.title,n=e.dataset.dfnType,r=e.parentElement.closest("[data-idl][data-title]");r&&!Ya.includes(n)&&(e.dataset.dfnFor=r.dataset.title),"dfn"===e.localName&&ra(e,[t])}));const s=e.closest("[data-cite], body"),{dataset:o}=s;if(o.cite||(o.cite="WEBIDL"),!/\bwebidl\b/i.test(o.cite)){const e=o.cite.trim().split(/\s+/);o.cite=["WEBIDL",...e].join(" ")}return Za(e),n}function Za(e){Yn(e,"webidl");const t=kn`WebIDL`;e.prepend(t),Na(t)}var Ka=Object.freeze({__proto__:null,addIDLHeader:Ya,name:za,run:async function(){const e=document.querySelectorAll("pre.idl, pre.webidl");if(!e.length)return;const t=document.createElement("style");t.textContent=Oa,document.querySelector("head link, head > *:last-child").before(t);const n=[...e].map(Ga),r=Sn.validate(n);for(const t of r){let r=`${Mn(t.context)}`;if(t.autofix){t.autofix();r+=`Try fixing as:\n ${Mn(Sn.write(n[t.sourceName]))}`}lr(`WebIDL validation error: ${t.bareMessage}`,Ma,{details:r,elements:[e[t.sourceName]],title:t.bareMessage})}document.normalize()}});const Za="core/data-cite",Ja="__SPEC__";async function Qa(e){const{key:t,frag:n,path:r,href:s}=e;let o="",i="";if(t===Ja)o=document.location.href;else{const e=await hi(t);if(!e)return null;o=e.href,i=e.title}if(s)o=s;else{if(r){const e=r.startsWith("/")?`.${r}`:r;o=new URL(e,o).href}n&&(o=new URL(n,o).href)}return{href:o,title:i}}function Xa(e,t,n){const{href:r,title:s}=t,o=!n.path&&!n.frag;switch(e.localName){case"a":{const t=e;if(""===t.textContent&&"the-empty-string"!==t.dataset.lt&&(t.textContent=s),t.href=r,o){const e=document.createElement("cite");t.replaceWith(e),e.append(t)}break}case"dfn":{const t=document.createElement("a");if(t.href=r,t.dataset.cite=n.key,t.dataset.citePath=n.path,t.dataset.citeFrag=n.frag,e.textContent?Xn(e,t):(t.textContent=s,e.append(t)),o){const n=document.createElement("cite");n.append(t),e.append(n)}if("export"in e.dataset){lr("Exporting a linked external definition is not allowed.",Za,{hint:"Please remove the `data-export` attribute.",elements:[e]}),delete e.dataset.export}e.classList.add("externalDFN"),e.dataset.noExport="";break}}}function ec(e){return t=>{const n=t.search(e);return-1!==n?t.substring(n):""}}const tc=ec("#"),nc=ec("/");function rc(e){const{dataset:t}=e,{cite:n,citeFrag:r,citePath:s,citeHref:o}=t;if(n.startsWith("#")&&!r){const r=e.parentElement.closest('[data-cite]:not([data-cite^="#"])'),{key:s,isNormative:o}=r?rc(r):{key:Ja,isNormative:!1};return t.cite=o?s:`?${s}`,t.citeFrag=n.replace("#",""),rc(e)}const i=r?`#${r}`:tc(n),a=s||nc(n).split("#")[0],{type:c}=Qn(n,e),l="normative"===c,u=/^[?|!]/.test(n);return{key:n.split(/[/|#]/)[0].substring(Number(u)),isNormative:l,frag:i,path:a,href:o}}function sc(e){const t=["data-cite","data-cite-frag","data-cite-path"];e.querySelectorAll("a[data-cite], dfn[data-cite]").forEach((e=>t.forEach((t=>e.removeAttribute(t)))))}var oc=Object.freeze({__proto__:null,THIS_SPEC:Ja,name:Za,run:async function(){const e=document.querySelectorAll("dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])");await async function(e){const t=e.map(rc).map((async e=>({entry:e,result:await hi(e.key)}))),n=(await Promise.all(t)).filter((({result:e})=>null===e)).map((({entry:{key:e}})=>e)),r=await fi(n);r&&Object.assign(ci,r)}([...e]);for(const t of e){const e=t.dataset.cite,n=rc(t),r=await Qa(n);if(r)Xa(t,r,n);else{const n=`Couldn't find a match for "${e}"`;t.dataset.matchedText&&(t.textContent=t.dataset.matchedText),ur(n,Za,{elements:[t]})}}vr("beforesave",sc)},toCiteDetails:rc});const ic="core/link-to-dfn",ac=[],cc={en:{duplicateMsg:e=>`Duplicate definition(s) of '${e}'`,duplicateTitle:"This is defined more than once in the document."},ja:{duplicateMsg:e=>`'${e}' の重複定義`,duplicateTitle:"この文書内で複数回定義されています."},de:{duplicateMsg:e=>`Mehrfache Definition von '${e}'`,duplicateTitle:"Das Dokument enthält mehrere Definitionen dieses Eintrags."},zh:{duplicateMsg:e=>`'${e}' 的重复定义`,duplicateTitle:"在文档中有重复的定义。"},cs:{duplicateMsg:e=>`Duplicitní definice '${e}'`,duplicateTitle:"Toto je v dokumentu definováno vícekrát."}},lc=Wn(cc);function uc(e){const t=new Map,n=[];for(const r of ea.get(e)){const{dfnType:s="dfn"}=r.dataset,o=r.dataset.dfnFor?.split(",").map((e=>e.trim()))??[""];for(const i of o){if(t.has(i)&&t.get(i).has(s)){const e=t.get(i).get(s),o="dfn"===e.localName,a="dfn"===r.localName,c=s===(e.dataset.dfnType||"dfn"),l=!i&&!e.dataset.dfnFor||e.dataset.dfnFor?.split(",").map((e=>e.trim())).includes(i);if(o&&a&&c&&l){n.push(r);continue}}t.has(i)||t.set(i,new Map),t.get(i).set(s,r),("idl"in r.dataset||"dfn"!==s)&&t.get(i).set("idl",r),Kn(r,"dfn",e)}}return{result:t,duplicates:n}}function dc(e,t){const n=function(e){const t=e.closest("[data-link-for]"),n=t?t.dataset.linkFor:"",r=Zn(e).reduce(((e,r)=>{const s=r.split(".");return 2===s.length&&e.push({for:s[0],title:s[1]}),e.push({for:n,title:r}),t||e.push({for:r,title:r}),""!==n&&e.push({for:"",title:r}),e}),[]);return r}(e),r=n.find((e=>t.has(e.title)&&t.get(e.title).has(e.for)));if(!r)return;const s=t.get(r.title).get(r.for),{linkType:o}=e.dataset;if(o){for(const e of o.split("|"))if(s.get(e))return s.get(e);return s.get("dfn")}{const e=r.for?"idl":"dfn";return s.get(e)||s.get("idl")}}function pc(e,t,n){let r=!1;const{linkFor:s}=e.dataset,{dfnFor:o}=t.dataset;if(t.dataset.cite)e.dataset.cite=t.dataset.cite;else if(s&&!n.get(s)&&o&&!o.split(",").map((e=>e.trim())).includes(s))r=!0;else if(t.classList.contains("externalDFN")){const n=t.dataset.lt?t.dataset.lt.split("|"):[];e.dataset.lt=n[0]||t.textContent,r=!0}else"partial"!==e.dataset.idl?(e.href=`#${t.id}`,e.classList.add("internalDFN")):r=!0;return e.hasAttribute("data-link-type")||(e.dataset.linkType="idl"in t.dataset?"idl":"dfn"),function(e){if(e.closest("code,pre"))return!0;if(1!==e.childNodes.length)return!1;const[t]=e.childNodes;return"code"===t.localName}(t)&&function(e,t){const n=e.textContent.trim(),r=t.dataset.hasOwnProperty("idl"),s=fc(e)&&fc(t,n);r&&!s||Xn(e,document.createElement("code"))}(e,t),!r}function fc(e,t=""){if("a"===e.localName){if(!e.querySelector("code"))return!0}else{const{dataset:n}=e;if(e.textContent.trim()===t)return!0;if(n.title===t)return!0;if(n.lt||n.localLt){const e=[];return n.lt&&e.push(...n.lt.split("|")),n.localLt&&e.push(...n.localLt.split("|")),e.includes(t)}}return!1}function hc(e){e.forEach((e=>{ur(`Found linkless \`\` element with text "${e.textContent}" but no matching \`\``,ic,{title:"Linking error: not matching ``",elements:[e]})}))}var mc=Object.freeze({__proto__:null,name:ic,possibleExternalLinks:ac,run:async function(e){const t=function(){const e=new ar;for(const t of ea.keys()){const{result:n,duplicates:r}=uc(t);e.set(t,n),r.length>0&&lr(lc.duplicateMsg(t),ic,{title:lc.duplicateTitle,elements:r})}return e}(),n=[],r=document.querySelectorAll("a[data-cite=''], a:not([href]):not([data-cite]):not(.logo):not(.externalDFN)");for(const e of r){if(!e.dataset?.linkType&&e.dataset?.xrefType){ac.push(e);continue}const r=dc(e,t);if(r){pc(e,r,t)||ac.push(e)}else""===e.dataset.cite?n.push(e):ac.push(e)}hc(n),function(e){const{shortName:t=""}=e,n=new RegExp(String.raw`^([?!])?${t}\b([^-])`,"i"),r=document.querySelectorAll("dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])");for(const t of r){t.dataset.cite=t.dataset.cite.replace(n,`$1${Ja}$2`);const{key:r,isNormative:s}=rc(t);r!==Ja&&(s||e.normativeReferences.has(r)?(e.normativeReferences.add(r),e.informativeReferences.delete(r)):e.informativeReferences.add(r))}}(e),e.xref||hc(ac)}});const gc="xrefs",bc=3e5;async function yc(){return await $n.openDB("xref",2,{upgrade(e){[...e.objectStoreNames].forEach((t=>e.deleteObjectStore(t)));e.createObjectStore(gc,{keyPath:"query.id"}).createIndex("byTerm","query.term",{unique:!1})}})}async function wc(e){const t=new Map;if(await async function(){const e="XREF:LAST_VERSION_CHECK",t=parseInt(localStorage.getItem(e),10),n=Date.now();if(!t)return localStorage.setItem(e,n.toString()),!1;if(n-tt}())return await async function(){try{await yc().then((e=>e.clear(gc)))}catch(e){console.error(e)}}(),t;const n=new Set(e.map((e=>e.id)));try{const e=await yc();let r=await e.transaction(gc).store.openCursor();for(;r;)n.has(r.key)&&t.set(r.key,r.value.result),r=await r.continue()}catch(e){console.error(e)}return t}const vc="core/xref",kc={"web-platform":["HTML","INFRA","URL","WEBIDL","DOM","FETCH"]},$c="https://respec.org/xref/",xc=[];if(!document.querySelector("link[rel='preconnect'][href='https://respec.org']")){const e=Pn({hint:"preconnect",href:"https://respec.org"});document.head.appendChild(e)}function _c(e){const t="xrefType"in e.dataset;let n=Cc(e);t||(n=n.toLowerCase());const r=function(e){const t=[];let n=e.closest("[data-cite]");for(;n;){const r=n.dataset.cite.toLowerCase().replace(/[!?]/g,"").split(/\s+/).filter((e=>e));if(r.length&&t.push(r),n===e)break;n=n.parentElement.closest("[data-cite]")}if(n!==e){const n=e.closest("section"),r=[...n?n.querySelectorAll("a.bibref"):[]].map((e=>e.textContent.toLowerCase()));r.length&&t.push(r)}const r=function(e){const t=[];for(const n of e){const e=t[t.length-1]||[],r=[...new Set(n)].filter((t=>!e.includes(t)));t.push(r.sort())}return t}(t);return r}(e),s=function(e,t){if(t)return e.dataset.xrefType?e.dataset.xrefType.split("|"):["_IDL_"];return["_CONCEPT_"]}(e,t),o=function(e,t){if(e.dataset.xrefFor)return qn(e.dataset.xrefFor);if(t){const t=e.closest("[data-xref-for]");if(t)return qn(t.dataset.xrefFor)}return null}(e,t);return{id:"",term:n,types:s,...r.length&&{specs:r},..."string"==typeof o&&{for:o}}}function Cc(e){const{lt:t}=e.dataset;let n=t?t.split("|",1)[0]:e.textContent;return n=qn(n),"the-empty-string"===n?"":n}function Sc(e,t,n,r){const{term:s,specs:o=[]}=t,{uri:i,shortname:a,spec:c,normative:l,type:u,for:d}=n,p=o.flat().includes(c)?c:a,f=new URL(i,"https://partial");let{pathname:h}=f;"/"===h&&(h="");const m={cite:p,citePath:h,citeFrag:f.hash.slice(1),linkType:u};d&&(m.linkFor=d[0]),f.origin&&"https://partial"!==f.origin&&(m.citeHref=f.href),Object.assign(e.dataset,m),function(e,t,n,r,s){const o=function(e){const t=e.closest(".normative"),n=e.closest(Tn);return!n||e===t||t&&n&&n.contains(t)}(e);if(!o)return void(s.normativeReferences.has(t)||s.informativeReferences.add(t));if(n){const e=s.informativeReferences.has(t)?s.informativeReferences.getCanonicalKey(t):t;return s.normativeReferences.add(e),void s.informativeReferences.delete(e)}xc.push({term:r,spec:t,element:e})}(e,p,l,s,r)}function Rc(e){const t=JSON.stringify(e,Object.keys(e).sort()),n=(new TextEncoder).encode(t);return crypto.subtle.digest("SHA-1",n).then(Ec)}function Ec(e){return[...new Uint8Array(e)].map((e=>e.toString(16).padStart(2,"0"))).join("")}function Ac(e){const t=e.querySelectorAll("a[data-xref-for], a[data-xref-type], a[data-link-for]"),n=["data-xref-for","data-xref-type","data-link-for"];t.forEach((e=>{n.forEach((t=>e.removeAttribute(t)))}))}var Lc=Object.freeze({__proto__:null,API_URL:$c,getTermFromElement:Cc,informativeRefsInNormative:xc,name:vc,run:async function(e){if(!e.xref)return;const t=function(e){const t={url:new URL("search/",$c).href,specs:null},n=Object.assign({},t);switch(Array.isArray(e)?"array":typeof e){case"boolean":break;case"string":e.toLowerCase()in kc?Object.assign(n,{specs:kc[e.toLowerCase()]}):r(e);break;case"array":Object.assign(n,{specs:e});break;case"object":if(Object.assign(n,e),e.profile){const t=e.profile.toLowerCase();if(t in kc){const r=(e.specs??[]).concat(kc[t]);Object.assign(n,{specs:r})}else r(e.profile)}break;default:lr(`Invalid value for \`xref\` configuration option. Received: "${e}".`,vc)}return n;function r(e){lr(`Invalid profile "${e}" in \`respecConfig.xref\`. Please use one of the supported profiles: ${zn(Object.keys(kc),(e=>`"${e}"`))}.`,vc)}}(e.xref);if(t.specs){const e=document.body.dataset.cite?document.body.dataset.cite.split(/\s+/):[];document.body.dataset.cite=e.concat(t.specs).join(" ")}const n=ac.concat(function(){const e=document.querySelectorAll(":is(a,dfn)[data-cite]:not([data-cite=''],[data-cite*='#'])"),t=document.querySelectorAll("dfn.externalDFN");return[...e].filter((e=>{if(""===e.textContent.trim())return!1;const t=e.closest("[data-cite]");return!t||""!==t.dataset.cite})).concat(...t)}());if(!n.length)return;const r=[];for(const e of n){const t=_c(e);t.id=await Rc(t),r.push(t)}const s=await async function(e,t){const n=new Set,r=e.filter((e=>!n.has(e.id)&&(n.add(e.id)&&!0))),s=await wc(r),o=r.filter((e=>!s.get(e.id))),i=await async function(e,t){if(!e.length)return new Map;const n={method:"POST",body:JSON.stringify({queries:e}),headers:{"Content-Type":"application/json"}},r=await fetch(t,n),s=await r.json();return new Map(s.results.map((({id:e,result:t})=>[e,t])))}(o,t);i.size&&await async function(e,t){try{const n=(await yc()).transaction(gc,"readwrite");for(const r of e){const e=t.get(r.id);n.objectStore(gc).add({query:r,result:e})}await n.done}catch(e){console.error(e)}}(r,i);return new Map([...s,...i])}(r,t.url);!function(e,t,n,r){const s={ambiguous:new Map,notFound:new Map};for(let o=0,i=e.length;o{const r=new URL($c);return r.searchParams.set("term",e),t.for&&r.searchParams.set("for",t.for),r.searchParams.set("types",t.types.join(",")),n.length&&r.searchParams.set("specs",n.join(",")),r.href},r=(e,t)=>gr`[See search matches for "${t}"](${e}) or ${"[Learn about this error|#error-term-not-found]"}.`;for(const{query:e,elems:s}of t.values()){const t=e.specs?[...new Set(e.specs.flat())].sort():[],o=Cc(s[0]),i=n(o,e),a=On(t,(e=>`**[${e}]**`)),c=r(i,o);lr(`Couldn't find "**${o}**"${e.for?`, for **"${e.for}"**, `:""} in this document or other cited documents: ${a}.`,vc,{title:"No matching definition found.",elements:s,hint:c})}for(const{query:t,elems:s,results:o}of e.values()){const e=[...new Set(o.map((e=>e.shortname)))].sort(),i=On(e,(e=>`**[${e}]**`)),a=Cc(s[0]),c=n(a,t,e),l=t.for?`, for **"${t.for}"**, `:"",u=r(c,a),d=gr`To fix, use the ${"[data-cite]"} attribute to pick the one you mean from the appropriate specification.`+String.raw` ${u}`;lr(`The term "**${a}**"${l} is ambiguous because it's defined in ${i}.`,vc,{title:"Definition is ambiguous.",elements:s,hint:d})}}(s)}(n,r,s,e),vr("beforesave",Ac)}});var Tc=String.raw`ul.index{columns:30ch;column-gap:1.5em}
+ >`;e.prepend(t),Oa(t)}var Ja=Object.freeze({__proto__:null,addIDLHeader:Za,name:qa,run:async function(){const e=document.querySelectorAll("pre.idl, pre.webidl");if(!e.length)return;const t=document.createElement("style");t.textContent=Ma,document.querySelector("head link, head > *:last-child").before(t);const n=[...e].map(Ka),r=Sn.validate(n);for(const t of r){let r=`${Mn(t.context)}`;if(t.autofix){t.autofix();r+=`Try fixing as:\n ${Mn(Sn.write(n[t.sourceName]))}`}lr(`WebIDL validation error: ${t.bareMessage}`,Wa,{details:r,elements:[e[t.sourceName]],title:t.bareMessage})}document.normalize()}});const Qa="core/data-cite",Xa="__SPEC__";async function ec(e){const{key:t,frag:n,path:r,href:s}=e;let o="",i="";if(t===Xa)o=document.location.href;else{const e=await gi(t);if(!e)return null;o=e.href,i=e.title}if(s)o=s;else{if(r){const e=r.startsWith("/")?`.${r}`:r;o=new URL(e,o).href}n&&(o=new URL(n,o).href)}return{href:o,title:i}}function tc(e,t,n){const{href:r,title:s}=t,o=!n.path&&!n.frag;switch(e.localName){case"a":{const t=e;if(""===t.textContent&&"the-empty-string"!==t.dataset.lt&&(t.textContent=s),t.href=r,o){const e=document.createElement("cite");t.replaceWith(e),e.append(t)}break}case"dfn":{const t=document.createElement("a");if(t.href=r,t.dataset.cite=n.key,t.dataset.citePath=n.path,t.dataset.citeFrag=n.frag,e.textContent?Xn(e,t):(t.textContent=s,e.append(t)),o){const n=document.createElement("cite");n.append(t),e.append(n)}if("export"in e.dataset){lr("Exporting a linked external definition is not allowed.",Qa,{hint:"Please remove the `data-export` attribute.",elements:[e]}),delete e.dataset.export}e.classList.add("externalDFN"),e.dataset.noExport="";break}}}function nc(e){return t=>{const n=t.search(e);return-1!==n?t.substring(n):""}}const rc=nc("#"),sc=nc("/");function oc(e){const{dataset:t}=e,{cite:n,citeFrag:r,citePath:s,citeHref:o}=t;if(n.startsWith("#")&&!r){const r=e.parentElement.closest('[data-cite]:not([data-cite^="#"])'),{key:s,isNormative:o}=r?oc(r):{key:Xa,isNormative:!1};return t.cite=o?s:`?${s}`,t.citeFrag=n.replace("#",""),oc(e)}const i=r?`#${r}`:rc(n),a=s||sc(n).split("#")[0],{type:c}=Qn(n,e),l="normative"===c,u=/^[?|!]/.test(n);return{key:n.split(/[/|#]/)[0].substring(Number(u)),isNormative:l,frag:i,path:a,href:o}}function ic(e){const t=["data-cite","data-cite-frag","data-cite-path"];e.querySelectorAll("a[data-cite], dfn[data-cite]").forEach((e=>t.forEach((t=>e.removeAttribute(t)))))}var ac=Object.freeze({__proto__:null,THIS_SPEC:Xa,name:Qa,run:async function(){const e=document.querySelectorAll("dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])");await async function(e){const t=e.map(oc).map((async e=>({entry:e,result:await gi(e.key)}))),n=(await Promise.all(t)).filter((({result:e})=>null===e)).map((({entry:{key:e}})=>e)),r=await mi(n);r&&Object.assign(ui,r)}([...e]);for(const t of e){const e=t.dataset.cite,n=oc(t),r=await ec(n);if(r)tc(t,r,n);else{const n=`Couldn't find a match for "${e}"`;t.dataset.matchedText&&(t.textContent=t.dataset.matchedText),ur(n,Qa,{elements:[t]})}}vr("beforesave",ic)},toCiteDetails:oc});const cc="core/link-to-dfn",lc=[],uc={en:{duplicateMsg:e=>`Duplicate definition(s) of '${e}'`,duplicateTitle:"This is defined more than once in the document."},ja:{duplicateMsg:e=>`'${e}' の重複定義`,duplicateTitle:"この文書内で複数回定義されています."},de:{duplicateMsg:e=>`Mehrfache Definition von '${e}'`,duplicateTitle:"Das Dokument enthält mehrere Definitionen dieses Eintrags."},zh:{duplicateMsg:e=>`'${e}' 的重复定义`,duplicateTitle:"在文档中有重复的定义。"},cs:{duplicateMsg:e=>`Duplicitní definice '${e}'`,duplicateTitle:"Toto je v dokumentu definováno vícekrát."}},dc=Wn(uc);function pc(e){const t=new Map,n=[];for(const r of na.get(e)){const{dfnType:s="dfn"}=r.dataset,o=r.dataset.dfnFor?.split(",").map((e=>e.trim()))??[""];for(const i of o){if(t.has(i)&&t.get(i).has(s)){const e=t.get(i).get(s),o="dfn"===e.localName,a="dfn"===r.localName,c=s===(e.dataset.dfnType||"dfn"),l=!i&&!e.dataset.dfnFor||e.dataset.dfnFor?.split(",").map((e=>e.trim())).includes(i);if(o&&a&&c&&l){n.push(r);continue}}t.has(i)||t.set(i,new Map),t.get(i).set(s,r),("idl"in r.dataset||"dfn"!==s)&&t.get(i).set("idl",r),Kn(r,"dfn",e)}}return{result:t,duplicates:n}}function fc(e,t){const n=function(e){const t=e.closest("[data-link-for]"),n=t?t.dataset.linkFor:"",r=Zn(e).reduce(((e,r)=>{const s=r.split(".");return 2===s.length&&e.push({for:s[0],title:s[1]}),e.push({for:n,title:r}),t||e.push({for:r,title:r}),""!==n&&e.push({for:"",title:r}),e}),[]);return r}(e),r=n.find((e=>t.has(e.title)&&t.get(e.title).has(e.for)));if(!r)return;const s=t.get(r.title).get(r.for),{linkType:o}=e.dataset;if(o){for(const e of o.split("|"))if(s.get(e))return s.get(e);return s.get("dfn")}{const e=r.for?"idl":"dfn";return s.get(e)||s.get("idl")}}function hc(e,t,n){let r=!1;const{linkFor:s}=e.dataset,{dfnFor:o}=t.dataset;if(t.dataset.cite)e.dataset.cite=t.dataset.cite;else if(s&&!n.get(s)&&o&&!o.split(",").map((e=>e.trim())).includes(s))r=!0;else if(t.classList.contains("externalDFN")){const n=t.dataset.lt?t.dataset.lt.split("|"):[];e.dataset.lt=n[0]||t.textContent,r=!0}else"partial"!==e.dataset.idl?(e.href=`#${t.id}`,e.classList.add("internalDFN")):r=!0;return e.hasAttribute("data-link-type")||(e.dataset.linkType="idl"in t.dataset?"idl":"dfn"),function(e){if(e.closest("code,pre"))return!0;if(1!==e.childNodes.length)return!1;const[t]=e.childNodes;return"code"===t.localName}(t)&&function(e,t){const n=e.textContent.trim(),r=t.dataset.hasOwnProperty("idl"),s=mc(e)&&mc(t,n);r&&!s||Xn(e,document.createElement("code"))}(e,t),!r}function mc(e,t=""){if("a"===e.localName){if(!e.querySelector("code"))return!0}else{const{dataset:n}=e;if(e.textContent.trim()===t)return!0;if(n.title===t)return!0;if(n.lt||n.localLt){const e=[];return n.lt&&e.push(...n.lt.split("|")),n.localLt&&e.push(...n.localLt.split("|")),e.includes(t)}}return!1}function gc(e){e.forEach((e=>{ur(`Found linkless \`\` element with text "${e.textContent}" but no matching \`\``,cc,{title:"Linking error: not matching ``",elements:[e]})}))}var bc=Object.freeze({__proto__:null,name:cc,possibleExternalLinks:lc,run:async function(e){const t=function(){const e=new ar;for(const t of na.keys()){const{result:n,duplicates:r}=pc(t);e.set(t,n),r.length>0&&lr(dc.duplicateMsg(t),cc,{title:dc.duplicateTitle,elements:r})}return e}(),n=[],r=document.querySelectorAll("a[data-cite=''], a:not([href]):not([data-cite]):not(.logo):not(.externalDFN)");for(const e of r){if(!e.dataset?.linkType&&e.dataset?.xrefType){lc.push(e);continue}const r=fc(e,t);if(r){hc(e,r,t)||lc.push(e)}else""===e.dataset.cite?n.push(e):lc.push(e)}gc(n),function(e){const{shortName:t=""}=e,n=new RegExp(String.raw`^([?!])?${t}\b([^-])`,"i"),r=document.querySelectorAll("dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])");for(const t of r){t.dataset.cite=t.dataset.cite.replace(n,`$1${Xa}$2`);const{key:r,isNormative:s}=oc(t);r!==Xa&&(s||e.normativeReferences.has(r)?(e.normativeReferences.add(r),e.informativeReferences.delete(r)):e.informativeReferences.add(r))}}(e),e.xref||gc(lc)}});const yc="xrefs",wc=3e5;async function vc(){return await $n.openDB("xref",2,{upgrade(e){[...e.objectStoreNames].forEach((t=>e.deleteObjectStore(t)));e.createObjectStore(yc,{keyPath:"query.id"}).createIndex("byTerm","query.term",{unique:!1})}})}async function kc(e){const t=new Map;if(await async function(){const e="XREF:LAST_VERSION_CHECK",t=parseInt(localStorage.getItem(e),10),n=Date.now();if(!t)return localStorage.setItem(e,n.toString()),!1;if(n-tt}())return await async function(){try{await vc().then((e=>e.clear(yc)))}catch(e){console.error(e)}}(),t;const n=new Set(e.map((e=>e.id)));try{const e=await vc();let r=await e.transaction(yc).store.openCursor();for(;r;)n.has(r.key)&&t.set(r.key,r.value.result),r=await r.continue()}catch(e){console.error(e)}return t}const $c="core/xref",xc={"web-platform":["HTML","INFRA","URL","WEBIDL","DOM","FETCH"]},_c="https://respec.org/xref/",Cc=[];if(!document.querySelector("link[rel='preconnect'][href='https://respec.org']")){const e=Pn({hint:"preconnect",href:"https://respec.org"});document.head.appendChild(e)}function Sc(e){const t="xrefType"in e.dataset;let n=Rc(e);t||(n=n.toLowerCase());const r=function(e){const t=[];let n=e.closest("[data-cite]");for(;n;){const r=n.dataset.cite.toLowerCase().replace(/[!?]/g,"").split(/\s+/).filter((e=>e));if(r.length&&t.push(r),n===e)break;n=n.parentElement.closest("[data-cite]")}if(n!==e){const n=e.closest("section"),r=[...n?n.querySelectorAll("a.bibref"):[]].map((e=>e.textContent.toLowerCase()));r.length&&t.push(r)}const r=function(e){const t=[];for(const n of e){const e=t[t.length-1]||[],r=[...new Set(n)].filter((t=>!e.includes(t)));t.push(r.sort())}return t}(t);return r}(e),s=function(e,t){if(t)return e.dataset.xrefType?e.dataset.xrefType.split("|"):["_IDL_"];return["_CONCEPT_"]}(e,t),o=function(e,t){if(e.dataset.xrefFor)return qn(e.dataset.xrefFor);if(t){const t=e.closest("[data-xref-for]");if(t)return qn(t.dataset.xrefFor)}return null}(e,t);return{id:"",term:n,types:s,...r.length&&{specs:r},..."string"==typeof o&&{for:o}}}function Rc(e){const{lt:t}=e.dataset;let n=t?t.split("|",1)[0]:e.textContent;return n=qn(n),"the-empty-string"===n?"":n}function Ec(e,t,n,r){const{term:s,specs:o=[]}=t,{uri:i,shortname:a,spec:c,normative:l,type:u,for:d}=n,p=o.flat().includes(c)?c:a,f=new URL(i,"https://partial");let{pathname:h}=f;"/"===h&&(h="");const m={cite:p,citePath:h,citeFrag:f.hash.slice(1),linkType:u};d&&(m.linkFor=d[0]),f.origin&&"https://partial"!==f.origin&&(m.citeHref=f.href),Object.assign(e.dataset,m),function(e,t,n,r,s){const o=function(e){const t=e.closest(".normative"),n=e.closest(Tn);return!n||e===t||t&&n&&n.contains(t)}(e);if(!o)return void(s.normativeReferences.has(t)||s.informativeReferences.add(t));if(n){const e=s.informativeReferences.has(t)?s.informativeReferences.getCanonicalKey(t):t;return s.normativeReferences.add(e),void s.informativeReferences.delete(e)}Cc.push({term:r,spec:t,element:e})}(e,p,l,s,r)}function Ac(e){const t=JSON.stringify(e,Object.keys(e).sort()),n=(new TextEncoder).encode(t);return crypto.subtle.digest("SHA-1",n).then(Lc)}function Lc(e){return[...new Uint8Array(e)].map((e=>e.toString(16).padStart(2,"0"))).join("")}function Tc(e){const t=e.querySelectorAll("a[data-xref-for], a[data-xref-type], a[data-link-for]"),n=["data-xref-for","data-xref-type","data-link-for"];t.forEach((e=>{n.forEach((t=>e.removeAttribute(t)))}))}var Pc=Object.freeze({__proto__:null,API_URL:_c,getTermFromElement:Rc,informativeRefsInNormative:Cc,name:$c,run:async function(e){if(!e.xref)return;const t=function(e){const t={url:new URL("search/",_c).href,specs:null},n=Object.assign({},t);switch(Array.isArray(e)?"array":typeof e){case"boolean":break;case"string":e.toLowerCase()in xc?Object.assign(n,{specs:xc[e.toLowerCase()]}):r(e);break;case"array":Object.assign(n,{specs:e});break;case"object":if(Object.assign(n,e),e.profile){const t=e.profile.toLowerCase();if(t in xc){const r=(e.specs??[]).concat(xc[t]);Object.assign(n,{specs:r})}else r(e.profile)}break;default:lr(`Invalid value for \`xref\` configuration option. Received: "${e}".`,$c)}return n;function r(e){lr(`Invalid profile "${e}" in \`respecConfig.xref\`. Please use one of the supported profiles: ${zn(Object.keys(xc),(e=>`"${e}"`))}.`,$c)}}(e.xref);if(t.specs){const e=document.body.dataset.cite?document.body.dataset.cite.split(/\s+/):[];document.body.dataset.cite=e.concat(t.specs).join(" ")}const n=lc.concat(function(){const e=document.querySelectorAll(":is(a,dfn)[data-cite]:not([data-cite=''],[data-cite*='#'])"),t=document.querySelectorAll("dfn.externalDFN");return[...e].filter((e=>{if(""===e.textContent.trim())return!1;const t=e.closest("[data-cite]");return!t||""!==t.dataset.cite})).concat(...t)}());if(!n.length)return;const r=[];for(const e of n){const t=Sc(e);t.id=await Ac(t),r.push(t)}const s=await async function(e,t){const n=new Set,r=e.filter((e=>!n.has(e.id)&&(n.add(e.id)&&!0))),s=await kc(r),o=r.filter((e=>!s.get(e.id))),i=await async function(e,t){if(!e.length)return new Map;const n={method:"POST",body:JSON.stringify({queries:e}),headers:{"Content-Type":"application/json"}},r=await fetch(t,n),s=await r.json();return new Map(s.results.map((({id:e,result:t})=>[e,t])))}(o,t);i.size&&await async function(e,t){try{const n=(await vc()).transaction(yc,"readwrite");for(const r of e){const e=t.get(r.id);n.objectStore(yc).add({query:r,result:e})}await n.done}catch(e){console.error(e)}}(r,i);return new Map([...s,...i])}(r,t.url);!function(e,t,n,r){const s={ambiguous:new Map,notFound:new Map};for(let o=0,i=e.length;o{const r=new URL(_c);return r.searchParams.set("term",e),t.for&&r.searchParams.set("for",t.for),r.searchParams.set("types",t.types.join(",")),n.length&&r.searchParams.set("specs",n.join(",")),r.href},r=(e,t)=>gr`[See search matches for "${t}"](${e}) or ${"[Learn about this error|#error-term-not-found]"}.`;for(const{query:e,elems:s}of t.values()){const t=e.specs?[...new Set(e.specs.flat())].sort():[],o=Rc(s[0]),i=n(o,e),a=On(t,(e=>`**[${e}]**`)),c=r(i,o);lr(`Couldn't find "**${o}**"${e.for?`, for **"${e.for}"**, `:""} in this document or other cited documents: ${a}.`,$c,{title:"No matching definition found.",elements:s,hint:c})}for(const{query:t,elems:s,results:o}of e.values()){const e=[...new Set(o.map((e=>e.shortname)))].sort(),i=On(e,(e=>`**[${e}]**`)),a=Rc(s[0]),c=n(a,t,e),l=t.for?`, for **"${t.for}"**, `:"",u=r(c,a),d=gr`To fix, use the ${"[data-cite]"} attribute to pick the one you mean from the appropriate specification.`+String.raw` ${u}`;lr(`The term "**${a}**"${l} is ambiguous because it's defined in ${i}.`,$c,{title:"Definition is ambiguous.",elements:s,hint:d})}}(s)}(n,r,s,e),vr("beforesave",Tc)}});var Ic=String.raw`ul.index{columns:30ch;column-gap:1.5em}
ul.index li{list-style:inherit}
ul.index li span{color:inherit;cursor:pointer;white-space:normal}
#index-defined-here ul.index li{font-size:.9rem}
@@ -945,37 +949,37 @@ ul.index code{color:inherit}
#index-defined-here .print-only{display:none}
@media print{
#index-defined-here .print-only{display:initial}
-}`;const Pc=Wn({en:{heading:"Index",headingExternal:"Terms defined by reference",headingLocal:"Terms defined by this specification",dfnOf:"definition of",definesFollowing:"defines the following:"},cs:{heading:"Glosář",headingExternal:"Termíny definované odkazem",headingLocal:"Termíny definované touto specifikací",dfnOf:"definice",definesFollowing:"definuje následující:"},de:{heading:"Index",headingExternal:"Begriffe, die durch Verweis definiert sind",headingLocal:"Begriffe, die in dieser Spezifikation definiert sind",dfnOf:"Definition von",definesFollowing:"definiert Folgendes:"},es:{heading:"Índice",headingExternal:"Términos definidos por referencia",headingLocal:"Términos definidos por esta especificación",dfnOf:"definición de",definesFollowing:"define lo siguiente:"},ja:{heading:"索引",headingExternal:"参照によって定義された用語",headingLocal:"この仕様で定義された用語",dfnOf:"の定義",definesFollowing:"以下を定義します:"},ko:{heading:"색인",headingExternal:"참조로 정의된 용어",headingLocal:"이 명세서에서 정의된 용어",dfnOf:"정의",definesFollowing:"다음을 정의합니다:"},nl:{heading:"Index",headingExternal:"Termen gedefinieerd door verwijzing",headingLocal:"Termen gedefinieerd door deze specificatie",dfnOf:"definitie van",definesFollowing:"definieert het volgende:"},zh:{heading:"索引",headingExternal:"通过引用定义的术语",headingLocal:"由本规范定义的术语",dfnOf:"的定义",definesFollowing:"定义以下内容:"}}),Ic=new Set(["attribute","callback","dict-member","dictionary","element-attr","element","enum-value","enum","exception","extended-attribute","interface","method","typedef"]);function Dc(e){const t=e.dataset,n=t.dfnType||t.idl||t.linkType||"";switch(n){case"":case"dfn":return"";default:return n}}function Nc(e){const t=e.closest("[data-dfn-for]:not([data-dfn-for=''])");return t?t.dataset.dfnFor:""}function jc(e,t,n=""){if(n.startsWith("[[")){return`internal slot for ${Nc(e)}`}switch(t){case"dict-member":case"method":case"attribute":case"enum-value":return`${"dict-member"===t?"member":t.replace("-"," ")} for ${Nc(e)}`;case"interface":case"dictionary":case"enum":return t;case"constructor":return`for ${Nc(e)}`;default:return""}}function Oc(){document.querySelectorAll("#index-defined-here li[data-id]").forEach((e=>e.append((e=>{const t=`§${document.getElementById(e).closest("section:not(.notoc)").querySelector(".secno").textContent.trim()}`;return kn`${t}`})(e.dataset.id))))}function zc(){const e=new Set,t=new Map,n=document.querySelectorAll("a[data-cite]");for(const r of n){if(!r.dataset.cite)continue;const{cite:n,citeFrag:s,xrefType:o,linkType:i}=r.dataset;if(!(o||i||n.includes("#")||s))continue;const a=r.href;if(e.has(a))continue;const{linkType:c,linkFor:l}=r.dataset,u=Cc(r);if(!u)continue;const d=rc(r).key.toUpperCase();(t.get(d)||t.set(d,[]).get(d)).push({term:u,type:c,linkFor:l,elem:r}),e.add(a)}return t}function Mc(e){const{elem:t}=e,n=function(e){const{term:t,type:n,linkFor:r}=e;let s=Mn(t);Ic.has(n)&&("extended-attribute"===n&&(s=`[${s}]`),s=`${s}`);const o=Wc.has(t)?"type":qc.get(n);o&&(s+=` ${o}`);if(r){let e=r;/\s/.test(r)||(e=`${e}`),"element-attr"===n&&(e+=" element"),s+=` (for ${e})`}return s}(e);return kn`-
+}`;const Dc=Wn({en:{heading:"Index",headingExternal:"Terms defined by reference",headingLocal:"Terms defined by this specification",dfnOf:"definition of",definesFollowing:"defines the following:"},cs:{heading:"Glosář",headingExternal:"Termíny definované odkazem",headingLocal:"Termíny definované touto specifikací",dfnOf:"definice",definesFollowing:"definuje následující:"},de:{heading:"Index",headingExternal:"Begriffe, die durch Verweis definiert sind",headingLocal:"Begriffe, die in dieser Spezifikation definiert sind",dfnOf:"Definition von",definesFollowing:"definiert Folgendes:"},es:{heading:"Índice",headingExternal:"Términos definidos por referencia",headingLocal:"Términos definidos por esta especificación",dfnOf:"definición de",definesFollowing:"define lo siguiente:"},ja:{heading:"索引",headingExternal:"参照によって定義された用語",headingLocal:"この仕様で定義された用語",dfnOf:"の定義",definesFollowing:"以下を定義します:"},ko:{heading:"색인",headingExternal:"참조로 정의된 용어",headingLocal:"이 명세서에서 정의된 용어",dfnOf:"정의",definesFollowing:"다음을 정의합니다:"},nl:{heading:"Index",headingExternal:"Termen gedefinieerd door verwijzing",headingLocal:"Termen gedefinieerd door deze specificatie",dfnOf:"definitie van",definesFollowing:"definieert het volgende:"},zh:{heading:"索引",headingExternal:"通过引用定义的术语",headingLocal:"由本规范定义的术语",dfnOf:"的定义",definesFollowing:"定义以下内容:"}}),Nc=new Set(["attribute","callback","dict-member","dictionary","element-attr","element","enum-value","enum","exception","extended-attribute","interface","method","typedef"]);function jc(e){const t=e.dataset,n=t.dfnType||t.idl||t.linkType||"";switch(n){case"":case"dfn":return"";default:return n}}function Oc(e){const t=e.closest("[data-dfn-for]:not([data-dfn-for=''])");return t?t.dataset.dfnFor:""}function zc(e,t,n=""){if(n.startsWith("[[")){return`internal slot for
${Oc(e)}`}switch(t){case"dict-member":case"method":case"attribute":case"enum-value":return`${"dict-member"===t?"member":t.replace("-"," ")} for ${Oc(e)}`;case"interface":case"dictionary":case"enum":return t;case"constructor":return`for ${Oc(e)}`;default:return""}}function Mc(){document.querySelectorAll("#index-defined-here li[data-id]").forEach((e=>e.append((e=>{const t=`§${document.getElementById(e).closest("section:not(.notoc)").querySelector(".secno").textContent.trim()}`;return kn`${t}`})(e.dataset.id))))}function qc(){const e=new Set,t=new Map,n=document.querySelectorAll("a[data-cite]");for(const r of n){if(!r.dataset.cite)continue;const{cite:n,citeFrag:s,xrefType:o,linkType:i}=r.dataset;if(!(o||i||n.includes("#")||s))continue;const a=r.href;if(e.has(a))continue;const{linkType:c,linkFor:l}=r.dataset,u=Rc(r);if(!u)continue;const d=oc(r).key.toUpperCase();(t.get(d)||t.set(d,[]).get(d)).push({term:u,type:c,linkFor:l,elem:r}),e.add(a)}return t}function Wc(e){const{elem:t}=e,n=function(e){const{term:t,type:n,linkFor:r}=e;let s=Mn(t);Nc.has(n)&&("extended-attribute"===n&&(s=`[${s}]`),s=`${s}`);const o=Fc.has(t)?"type":Uc.get(n);o&&(s+=` ${o}`);if(r){let e=r;/\s/.test(r)||(e=`${e}`),"element-attr"===n&&(e+=" element"),s+=` (for ${e})`}return s}(e);return kn` -
${{html:n}}
-
`}const qc=new Map([["attribute","attribute"],["element-attr","attribute"],["element","element"],["enum","enum"],["exception","exception"],["extended-attribute","extended attribute"],["interface","interface"]]),Wc=new Set(["boolean","byte","octet","short","unsigned short","long","unsigned long","long long","unsigned long long","float","unrestricted float","double","unrestricted double","undefined","any","object","symbol"]);function Uc(e){e.querySelectorAll("#index-defined-elsewhere li[data-spec]").forEach((e=>e.removeAttribute("data-spec"))),e.querySelectorAll("#index-defined-here li[data-id]").forEach((e=>e.removeAttribute("data-id")))}var Fc=Object.freeze({__proto__:null,name:"core/dfn-index",run:function(){const e=document.querySelector("section#index");if(!e)return void vr("toc",(()=>{}),{once:!0});const t=document.createElement("style");t.textContent=Tc,document.head.appendChild(t),e.classList.add("appendix"),e.querySelector("h2, h1")||e.prepend(kn`${Pc.heading}
`);const n=kn`
- ${Pc.headingLocal}
+ `}const Uc=new Map([["attribute","attribute"],["element-attr","attribute"],["element","element"],["enum","enum"],["exception","exception"],["extended-attribute","extended attribute"],["interface","interface"]]),Fc=new Set(["boolean","byte","octet","short","unsigned short","long","unsigned long","long long","unsigned long long","float","unrestricted float","double","unrestricted double","undefined","any","object","symbol"]);function Bc(e){e.querySelectorAll("#index-defined-elsewhere li[data-spec]").forEach((e=>e.removeAttribute("data-spec"))),e.querySelectorAll("#index-defined-here li[data-id]").forEach((e=>e.removeAttribute("data-id")))}var Hc=Object.freeze({__proto__:null,name:"core/dfn-index",run:function(){const e=document.querySelector("section#index");if(!e)return void vr("toc",(()=>{}),{once:!0});const t=document.createElement("style");t.textContent=Ic,document.head.appendChild(t),e.classList.add("appendix"),e.querySelector("h2, h1")||e.prepend(kn`${Dc.heading}
`);const n=kn`
+ ${Dc.headingLocal}
${function(){const e=function(){const e=new Map,t=document.querySelectorAll("dfn:not([data-cite])");for(const n of t){if(!n.id)continue;const t=qn(n.textContent);(e.get(t)||e.set(t,[]).get(t)).push(n)}const n=[...e].sort((([e],[t])=>e.slice(e.search(/\w/)).localeCompare(t.slice(t.search(/\w/)))));return n}();return kn`
${e.map((([e,t])=>function(e,t){const n=(e,t,n)=>{const r=`#${e.id}`;return kn`-
${{html:t}} ${n?{html:n}:""}
-
`};if(1===t.length){const r=t[0],s=Dc(r),o=function(e,t,n){let r=n;"enum-value"===t&&(r=`"${r}"`);(Ic.has(t)||e.dataset.idl||e.closest("code"))&&(r=`${r}`);return r}(r,s,e),i=jc(r,s,e);return n(r,o,i)}return kn`-
+
`};if(1===t.length){const r=t[0],s=jc(r),o=function(e,t,n){let r=n;"enum-value"===t&&(r=`"${r}"`);(Nc.has(t)||e.dataset.idl||e.closest("code"))&&(r=`${r}`);return r}(r,s,e),i=zc(r,s,e);return n(r,o,i)}return kn`-
${e}
- ${t.map((t=>{const r=jc(t,Dc(t),e)||Pc.dfnOf;return n(t,r)}))}
+ ${t.map((t=>{const r=zc(t,jc(t),e)||Dc.dfnOf;return n(t,r)}))}
`}(e,t)))}
`}()}
`;e.append(n);const r=kn`
- ${Pc.headingExternal}
- ${function(){const e=[...zc().entries()].sort((([e],[t])=>e.localeCompare(t))),t=document.querySelector("section#index"),n=!!t?.classList.contains("prefer-full-spec-title");return kn`
- ${e.map((([e,t])=>{let r;return r=n&&ci[e]?.title?xi(e,ci[e].title):xi(e),kn`-
- ${r} ${Pc.definesFollowing}
+
${Dc.headingExternal}
+ ${function(){const e=[...qc().entries()].sort((([e],[t])=>e.localeCompare(t))),t=document.querySelector("section#index"),n=!!t?.classList.contains("prefer-full-spec-title");return kn`
+ ${e.map((([e,t])=>{let r;return r=n&&ui[e]?.title?Ci(e,ui[e].title):Ci(e),kn`-
+ ${r} ${Dc.definesFollowing}
- ${t.sort(((e,t)=>e.term.localeCompare(t.term))).map(Mc)}
+ ${t.sort(((e,t)=>e.term.localeCompare(t.term))).map(Wc)}
`}))}
`}()}
-
`;e.append(r);for(const e of r.querySelectorAll(".index-term"))Kn(e,"index-term");vr("toc",Oc,{once:!0}),vr("beforesave",Uc)}});const Bc="core/contrib";var Hc=Object.freeze({__proto__:null,name:Bc,run:async function(e){if(!document.getElementById("gh-contributors"))return;if(!e.github){return void lr(gr`Requested list of contributors from GitHub, but ${"[github]"} configuration option is not set.`,Bc)}const t=e.editors.map((e=>e.name)),n=`${e.github.apiBase}/${e.github.fullName}/`;await async function(e,t){const n=document.getElementById("gh-contributors");if(!n)return;n.textContent="Fetching list of contributors...";const r=await s();null!==r?function(e,t){const n=e.sort(((e,t)=>{const n=e.name||e.login,r=t.name||t.login;return n.toLowerCase().localeCompare(r.toLowerCase())}));if("UL"===t.tagName)return void kn(t)`${n.map((({name:e,login:t})=>`- ${e||t}
`))}`;const r=n.map((e=>e.name||e.login));t.textContent=On(r)}(r,n):n.textContent="Failed to fetch contributors.";async function s(){const{href:n}=new URL("contributors",t);try{const t=await Hn(n);if(!t.ok)throw new Error(`Request to ${n} failed with status code ${t.status}`);return(await t.json()).filter((t=>!e.includes(t.name||t.login)&&!t.login.includes("[bot]")))}catch(e){return lr("Error loading contributors from GitHub.",Bc,{cause:e}),null}}}(t,n)}});var Vc=Object.freeze({__proto__:null,name:"core/fix-headers",run:function(){[...document.querySelectorAll("section:not(.introductory)")].map((e=>e.querySelector("h1, h2, h3, h4, h5, h6"))).filter((e=>e)).forEach((e=>{const t=Math.min(function(e,t){const n=[];for(;e!=e.ownerDocument.body;)e.matches(t)&&n.push(e),e=e.parentElement;return n}(e,"section").length+1,6);Jn(e,`h${t}`)}))}});var Gc=Object.freeze({__proto__:null,name:"core/webidl-index",run:function(){const e=document.querySelector("section#idl-index");if(!e)return;const t=[2,3,4,5,6].map((e=>`h${e}:first-child`)).join(",");if(!e.querySelector(t)){const t=document.createElement("h2");e.title?(t.textContent=e.title,e.removeAttribute("title")):t.textContent="IDL Index",e.prepend(t)}const n=Array.from(document.querySelectorAll("pre.idl:not(.exclude) > code")).filter((e=>!e.closest(Tn)));if(0===n.length){const t="This specification doesn't normatively declare any Web IDL.";return void e.append(t)}const r=document.createElement("pre");r.classList.add("idl","def"),r.id="actual-idl-index",n.map((e=>{const t=document.createDocumentFragment();for(const n of e.children)t.appendChild(n.cloneNode(!0));return t})).forEach((e=>{r.lastChild&&r.append("\n\n"),r.appendChild(e)})),r.querySelectorAll("*[id]").forEach((e=>e.removeAttribute("id"))),e.appendChild(r),Xn(r,document.createElement("code")),Ya(r)}});const Yc=["h2","h3","h4","h5","h6"],Kc="core/structure",Zc=Wn({en:{toc:"Table of Contents",back_to_top:"Back to Top"},zh:{toc:"内容大纲",back_to_top:"返回顶部"},ko:{toc:"목차",back_to_top:"맨 위로"},ja:{toc:"目次",back_to_top:"先頭に戻る"},nl:{toc:"Inhoudsopgave",back_to_top:"Terug naar boven"},es:{toc:"Tabla de Contenidos",back_to_top:"Volver arriba"},de:{toc:"Inhaltsverzeichnis",back_to_top:"Zurück nach oben"},cs:{toc:"Obsah",back_to_top:"Zpět na začátek"}});function Jc(e,t,{prefix:n=""}={}){let r=!1,s=0,o=1;if(n.length&&!n.endsWith(".")&&(n+="."),0===e.length)return null;const i=kn`
`;for(const a of e){!a.isAppendix||n||r||(s=o,r=!0);let e=a.isIntro?"":r?Qc(o-s+1):n+o;const c=e.split(".").length;if(1===c&&(e+=".",a.header.before(document.createComment("OddPage"))),a.isIntro||(o+=1,a.header.prepend(kn`${e} `)),c<=t){const n=a.header.id||a.element.id,r=el(a.header,n),s=Jc(a.subsections,t,{prefix:e});s&&r.append(s),i.append(r)}}return i}function Qc(e){let t="";for(;e>0;)e-=1,t=String.fromCharCode(65+e%26)+t,e=Math.floor(e/26);return t}function Xc(e){const t=e.querySelectorAll(":scope > section"),n=[];for(const e of t){const t=e.classList.contains("notoc");if(!e.children.length||t)continue;const r=e.children[0];if(!Yc.includes(r.localName))continue;const s=r.textContent;Kn(e,null,s),n.push({element:e,header:r,title:s,isIntro:Boolean(e.closest(".introductory")),isAppendix:e.classList.contains("appendix"),subsections:Xc(e)})}return n}function el(e,t){const n=kn``;var r;return n.append(...e.cloneNode(!0).childNodes),(r=n).querySelectorAll("a").forEach((e=>{const t=Jn(e,"span");t.className="formerLink",t.removeAttribute("href")})),r.querySelectorAll("dfn").forEach((e=>{Jn(e,"span").removeAttribute("id")})),kn`- ${n}
`}var tl=Object.freeze({__proto__:null,name:Kc,run:function(e){if("maxTocLevel"in e==!1&&(e.maxTocLevel=1/0),function(){const e=[...document.querySelectorAll("section:not(.introductory) :is(h1,h2,h3,h4,h5,h6):first-child")].filter((e=>!e.closest("section.introductory")));if(!e.length)return;e.forEach((e=>{const t=`h${Math.min(tr(e,"section").length+1,6)}`;e.localName!==t&&Jn(e,t)}))}(),!e.noTOC){!function(){const e=document.querySelectorAll("section[data-max-toc]");for(const t of e){const e=parseInt(t.dataset.maxToc,10);if(e<0||e>6||Number.isNaN(e)){lr("`data-max-toc` must have a value between 0-6 (inclusive).",Kc,{elements:[t]});continue}if(0===e){t.classList.add("notoc");continue}const n=t.querySelectorAll(`:scope > ${Array.from({length:e},(()=>"section")).join(" > ")}`);for(const e of n)e.classList.add("notoc")}}();const t=Jc(Xc(document.body),e.maxTocLevel);t&&function(e){if(!e)return;const t=kn``,n=kn`${Zc.toc}
`;Kn(n),t.append(n,e);const r=document.getElementById("toc")||document.getElementById("sotd")||document.getElementById("abstract");r&&("toc"===r.id?r.replaceWith(t):r.after(t));const s=kn``;document.body.append(s)}(t)}wr("toc")}});const nl=Wn({en:{informative:"This section is non-normative."},nl:{informative:"Dit onderdeel is niet normatief."},ko:{informative:"이 부분은 비규범적입니다."},ja:{informative:"この節は仕様には含まれません."},de:{informative:"Dieser Abschnitt ist nicht normativ."},zh:{informative:"本章节不包含规范性内容。"},cs:{informative:"Tato sekce není normativní."}});var rl=Object.freeze({__proto__:null,name:"core/informative",run:function(){Array.from(document.querySelectorAll("section.informative")).map((e=>e.querySelector("h2, h3, h4, h5, h6"))).filter((e=>e)).forEach((e=>{e.after(kn`${nl.informative}
`)}))}});const sl=Wn({en:{permalinkLabel(e,t){let n=`Permalink for${t?"":" this"} ${e}`;return t&&(n+=` ${qn(t.textContent)}`),n}}});var ol=Object.freeze({__proto__:null,name:"core/id-headers",run:function(e){const t=document.querySelectorAll("section:not(.head,#abstract,#sotd) h2, h3, h4, h5, h6");for(const n of t){let t=n.id;if(t||(Kn(n),t=n.parentElement.id||n.id),!e.addSectionLinks)continue;const r=sl.permalinkLabel(n.closest(".appendix")?"Appendix":"Section",n.querySelector(":scope > bdi.secno")),s=kn``;n.replaceWith(s);const o=kn``;e.append(r);for(const e of r.querySelectorAll(".index-term"))Kn(e,"index-term");vr("toc",Mc,{once:!0}),vr("beforesave",Bc)}});const Vc="core/contrib";var Gc=Object.freeze({__proto__:null,name:Vc,run:async function(e){if(!document.getElementById("gh-contributors"))return;if(!e.github){return void lr(gr`Requested list of contributors from GitHub, but ${"[github]"} configuration option is not set.`,Vc)}const t=e.editors.map((e=>e.name)),n=`${e.github.apiBase}/${e.github.fullName}/`;await async function(e,t){const n=document.getElementById("gh-contributors");if(!n)return;n.textContent="Fetching list of contributors...";const r=await s();null!==r?function(e,t){const n=e.sort(((e,t)=>{const n=e.name||e.login,r=t.name||t.login;return n.toLowerCase().localeCompare(r.toLowerCase())}));if("UL"===t.tagName)return void kn(t)`${n.map((({name:e,login:t})=>`- ${e||t}
`))}`;const r=n.map((e=>e.name||e.login));t.textContent=On(r)}(r,n):n.textContent="Failed to fetch contributors.";async function s(){const{href:n}=new URL("contributors",t);try{const t=await Hn(n);if(!t.ok)throw new Error(`Request to ${n} failed with status code ${t.status}`);return(await t.json()).filter((t=>!e.includes(t.name||t.login)&&!t.login.includes("[bot]")))}catch(e){return lr("Error loading contributors from GitHub.",Vc,{cause:e}),null}}}(t,n)}});var Yc=Object.freeze({__proto__:null,name:"core/fix-headers",run:function(){[...document.querySelectorAll("section:not(.introductory)")].map((e=>e.querySelector("h1, h2, h3, h4, h5, h6"))).filter((e=>e)).forEach((e=>{const t=Math.min(function(e,t){const n=[];for(;e!=e.ownerDocument.body;)e.matches(t)&&n.push(e),e=e.parentElement;return n}(e,"section").length+1,6);Jn(e,`h${t}`)}))}});var Kc=Object.freeze({__proto__:null,name:"core/webidl-index",run:function(){const e=document.querySelector("section#idl-index");if(!e)return;const t=[2,3,4,5,6].map((e=>`h${e}:first-child`)).join(",");if(!e.querySelector(t)){const t=document.createElement("h2");e.title?(t.textContent=e.title,e.removeAttribute("title")):t.textContent="IDL Index",e.prepend(t)}const n=Array.from(document.querySelectorAll("pre.idl:not(.exclude) > code")).filter((e=>!e.closest(Tn)));if(0===n.length){const t="This specification doesn't normatively declare any Web IDL.";return void e.append(t)}const r=document.createElement("pre");r.classList.add("idl","def"),r.id="actual-idl-index",n.map((e=>{const t=document.createDocumentFragment();for(const n of e.children)t.appendChild(n.cloneNode(!0));return t})).forEach((e=>{r.lastChild&&r.append("\n\n"),r.appendChild(e)})),r.querySelectorAll("*[id]").forEach((e=>e.removeAttribute("id"))),e.appendChild(r),Xn(r,document.createElement("code")),Za(r)}});const Zc=["h2","h3","h4","h5","h6"],Jc="core/structure",Qc=Wn({en:{toc:"Table of Contents",back_to_top:"Back to Top"},zh:{toc:"内容大纲",back_to_top:"返回顶部"},ko:{toc:"목차",back_to_top:"맨 위로"},ja:{toc:"目次",back_to_top:"先頭に戻る"},nl:{toc:"Inhoudsopgave",back_to_top:"Terug naar boven"},es:{toc:"Tabla de Contenidos",back_to_top:"Volver arriba"},de:{toc:"Inhaltsverzeichnis",back_to_top:"Zurück nach oben"},cs:{toc:"Obsah",back_to_top:"Zpět na začátek"}});function Xc(e,t,{prefix:n=""}={}){let r=!1,s=0,o=1;if(n.length&&!n.endsWith(".")&&(n+="."),0===e.length)return null;const i=kn`
`;for(const a of e){!a.isAppendix||n||r||(s=o,r=!0);let e=a.isIntro?"":r?el(o-s+1):n+o;const c=e.split(".").length;if(1===c&&(e+=".",a.header.before(document.createComment("OddPage"))),a.isIntro||(o+=1,a.header.prepend(kn`${e} `)),c<=t){const n=a.header.id||a.element.id,r=nl(a.header,n),s=Xc(a.subsections,t,{prefix:e});s&&r.append(s),i.append(r)}}return i}function el(e){let t="";for(;e>0;)e-=1,t=String.fromCharCode(65+e%26)+t,e=Math.floor(e/26);return t}function tl(e){const t=e.querySelectorAll(":scope > section"),n=[];for(const e of t){const t=e.classList.contains("notoc");if(!e.children.length||t)continue;const r=e.children[0];if(!Zc.includes(r.localName))continue;const s=r.textContent;Kn(e,null,s),n.push({element:e,header:r,title:s,isIntro:Boolean(e.closest(".introductory")),isAppendix:e.classList.contains("appendix"),subsections:tl(e)})}return n}function nl(e,t){const n=kn``;var r;return n.append(...e.cloneNode(!0).childNodes),(r=n).querySelectorAll("a").forEach((e=>{const t=Jn(e,"span");t.className="formerLink",t.removeAttribute("href")})),r.querySelectorAll("dfn").forEach((e=>{Jn(e,"span").removeAttribute("id")})),kn`- ${n}
`}var rl=Object.freeze({__proto__:null,name:Jc,run:function(e){if("maxTocLevel"in e==!1&&(e.maxTocLevel=1/0),function(){const e=[...document.querySelectorAll("section:not(.introductory) :is(h1,h2,h3,h4,h5,h6):first-child")].filter((e=>!e.closest("section.introductory")));if(!e.length)return;e.forEach((e=>{const t=`h${Math.min(tr(e,"section").length+1,6)}`;e.localName!==t&&Jn(e,t)}))}(),!e.noTOC){!function(){const e=document.querySelectorAll("section[data-max-toc]");for(const t of e){const e=parseInt(t.dataset.maxToc,10);if(e<0||e>6||Number.isNaN(e)){lr("`data-max-toc` must have a value between 0-6 (inclusive).",Jc,{elements:[t]});continue}if(0===e){t.classList.add("notoc");continue}const n=t.querySelectorAll(`:scope > ${Array.from({length:e},(()=>"section")).join(" > ")}`);for(const e of n)e.classList.add("notoc")}}();const t=Xc(tl(document.body),e.maxTocLevel);t&&function(e){if(!e)return;const t=kn``,n=kn`${Qc.toc}
`;Kn(n),t.append(n,e);const r=document.getElementById("toc")||document.getElementById("sotd")||document.getElementById("abstract");r&&("toc"===r.id?r.replaceWith(t):r.after(t));const s=kn``;document.body.append(s)}(t)}wr("toc")}});const sl=Wn({en:{informative:"This section is non-normative."},nl:{informative:"Dit onderdeel is niet normatief."},ko:{informative:"이 부분은 비규범적입니다."},ja:{informative:"この節は仕様には含まれません."},de:{informative:"Dieser Abschnitt ist nicht normativ."},zh:{informative:"本章节不包含规范性内容。"},cs:{informative:"Tato sekce není normativní."}});var ol=Object.freeze({__proto__:null,name:"core/informative",run:function(){Array.from(document.querySelectorAll("section.informative")).map((e=>e.querySelector("h2, h3, h4, h5, h6"))).filter((e=>e)).forEach((e=>{e.after(kn`${sl.informative}
`)}))}});const il=Wn({en:{permalinkLabel(e,t){let n=`Permalink for${t?"":" this"} ${e}`;return t&&(n+=` ${qn(t.textContent)}`),n}}});var al=Object.freeze({__proto__:null,name:"core/id-headers",run:function(e){const t=document.querySelectorAll("section:not(.head,#abstract,#sotd) h2, h3, h4, h5, h6");for(const n of t){let t=n.id;if(t||(Kn(n),t=n.parentElement.id||n.id),!e.addSectionLinks)continue;const r=il.permalinkLabel(n.closest(".appendix")?"Appendix":"Section",n.querySelector(":scope > bdi.secno")),s=kn``;n.replaceWith(s);const o=kn``;s.append(n,o)}}});var il=String.raw`.caniuse-stats{display:flex;column-gap:2em}
+ > `;s.append(n,o)}}});var cl=String.raw`.caniuse-stats{display:flex;column-gap:2em}
.caniuse-group{display:flex;flex:1;flex-direction:column;justify-content:flex-end;flex-basis:auto}
.caniuse-browsers{display:flex;align-items:baseline;justify-content:space-between;flex-wrap:wrap;margin-top:.2em;column-gap:.4em;border-bottom:1px solid #ccc;row-gap:.4em;padding-bottom:.4cm}
.caniuse-type{align-self:center;border-top:none;text-transform:capitalize;font-size:.8em;margin-top:-.8em;font-weight:700}
@@ -993,12 +997,12 @@ img.caniuse-browser{filter:drop-shadow(0 0 .1cm #666);background:0 0}
.caniuse-cell.y::before{content:"✔️";padding:.5em}
.caniuse-cell.n::before{content:"❌";padding:.5em}
.caniuse-cell:is(.a,.d,.p,.x,.u)::before{content:"⚠️";padding:.5em}
-}`;const al="core/caniuse",cl="https://respec.org/caniuse/",ll=new Map([["and_chr",{name:"Android Chrome",path:"chrome",type:"mobile"}],["and_ff",{name:"Android Firefox",path:"firefox",type:"mobile"}],["and_uc",{name:"Android UC",path:"uc",type:"mobile"}],["chrome",{name:"Chrome",type:"desktop"}],["edge",{name:"Edge",type:"desktop"}],["firefox",{name:"Firefox",type:"desktop"}],["ios_saf",{name:"iOS Safari",path:"safari-ios",type:"mobile"}],["op_mob",{name:"Opera Mobile",path:"opera",type:"mobile"}],["opera",{name:"Opera",type:"desktop"}],["safari",{name:"Safari",type:"desktop"}],["samsung",{name:"Samsung Internet",path:"samsung-internet",type:"mobile"}]]),ul=new Map([["a","almost supported (aka Partial support)"],["d","disabled by default"],["n","no support, or disabled by default"],["p","no support, but has Polyfill"],["u","unknown support"],["x","requires prefix to work"],["y","supported by default"]]);var dl=Object.freeze({__proto__:null,BROWSERS:ll,name:al,prepare:function(e){if(!e.caniuse)return;!function(e){const t=new Set(ll.keys());t.delete("op_mob"),t.delete("opera");const n={removeOnSave:!0,browsers:[...t]};if("string"==typeof e.caniuse)return void(e.caniuse={feature:e.caniuse,...n});e.caniuse={...n,...e.caniuse}}(e),function({caniuse:e}){const{browsers:t}=e,n=t.filter((e=>!ll.has(e)));if(n.length){ur(gr`Invalid browser(s): (${hr(n,{quotes:!0})}) in the \`browser\` property of ${"[caniuse]"}.`,al)}}(e);const t=e.caniuse;t.feature&&document.head.appendChild(kn``)},run:async function(e){const t=e.caniuse;if(!t?.feature)return;const n=new URL(t.feature,"https://caniuse.com/").href,r=document.querySelector(".head dl"),s=async function(e){const{feature:t,browsers:n,apiURL:r}=e,s=new URL(r||`./${t}`,cl);n.forEach((e=>s.searchParams.append("browsers",e)));const o=await fetch(s);if(!o.ok){const{status:e,statusText:t}=o;throw new Error(`Failed to get caniuse data: (${e}) ${t}`)}return o.json()}(e.caniuse).then((e=>async function(e,{feature:t}){const n=e.result,r=new Map([["desktop",[]],["mobile",[]]]),s=function(e){return(t,{browser:n,version:r,caniuse:s})=>{const{name:o,type:i}=ll.get(n),a=`${o}${r?` version ${r}`:""}`,c=ul.get(s),l=`${e} is ${c} since ${a} on ${i}.`,u=`caniuse-cell ${s}`,d=(p=`${c} since ${a}.`).charAt(0).toUpperCase()+p.slice(1);var p;const f=r||"—",h=function(e){const t=ll.get(e).path??e;return`https://www.w3.org/assets/logos/browser-logos/${t}/${t}.svg`}(n),m=kn`
+ ${cl}
+ `)},run:async function(e){const t=e.caniuse;if(!t?.feature)return;const n=new URL(t.feature,"https://caniuse.com/").href,r=document.querySelector(".head dl"),s=async function(e){const{feature:t,browsers:n,apiURL:r}=e,s=new URL(r||`./${t}`,ul);n.forEach((e=>s.searchParams.append("browsers",e)));const o=await fetch(s);if(!o.ok){const{status:e,statusText:t}=o;throw new Error(`Failed to get caniuse data: (${e}) ${t}`)}return o.json()}(e.caniuse).then((e=>async function(e,{feature:t}){const n=e.result,r=new Map([["desktop",[]],["mobile",[]]]),s=function(e){return(t,{browser:n,version:r,caniuse:s})=>{const{name:o,type:i}=dl.get(n),a=`${o}${r?` version ${r}`:""}`,c=pl.get(s),l=`${e} is ${c} since ${a} on ${i}.`,u=`caniuse-cell ${s}`,d=(p=`${c} since ${a}.`).charAt(0).toUpperCase()+p.slice(1);var p;const f=r||"—",h=function(e){const t=dl.get(e).path??e;return`https://www.w3.org/assets/logos/browser-logos/${t}/${t}.svg`}(n),m=kn`
${e}
`));return o.push(kn`More info`),o}(e,t))).catch((e=>function(e,t,n){const r=`Failed to retrieve feature "${t.feature}".`,s=gr`Please check the feature key on [caniuse.com](https://caniuse.com) and update ${"[caniuse]"}.`;return lr(r,al,{hint:s,cause:e}),kn`caniuse.com`}(e,t,n))),o=kn`- Browser support:
+ >`),o}(e,t))).catch((e=>function(e,t,n){const r=`Failed to retrieve feature "${t.feature}".`,s=gr`Please check the feature key on [caniuse.com](https://caniuse.com) and update ${"[caniuse]"}.`;return lr(r,ll,{hint:s,cause:e}),kn`caniuse.com`}(e,t,n))),o=kn`- Browser support:
-
${{any:s,placeholder:"Fetching data from caniuse.com..."}}
`;r.append(...o.childNodes),await s,wr("amend-user-config",{caniuse:t.feature}),t.removeOnSave&&(r.querySelectorAll(".caniuse-browser").forEach((e=>e.classList.add("removeOnSave"))),vr("beforesave",(e=>{kn.bind(e.querySelector(".caniuse-stats"))`
- caniuse.com`})))}});var pl=String.raw`.mdn{font-size:.75em;position:absolute;right:.3em;min-width:0;margin-top:3rem}
+ caniuse.com`})))}});var hl=String.raw`.mdn{font-size:.75em;position:absolute;right:.3em;min-width:0;margin-top:3rem}
.mdn details{width:100%;margin:1px 0;position:relative;z-index:10;box-sizing:border-box;padding:.4em;padding-top:0}
.mdn details[open]{min-width:25ch;max-width:32ch;background:#fff;background:var(--indextable-hover-bg,#fff);color:#000;color:var(--indextable-hover-text,#000);box-shadow:0 1em 3em -.4em rgba(0,0,0,.3),0 0 1px 1px rgba(0,0,0,.05);box-shadow:0 1em 3em -.4em var(--tocsidebar-shadow,rgba(0,0,0,.3)),0 0 1px 1px var(--tocsidebar-shadow,rgba(0,0,0,.05));border-radius:2px;z-index:11;margin-bottom:.4em}
.mdn summary{text-align:right;cursor:default;margin-right:-.4em}
@@ -1040,18 +1044,18 @@ img.caniuse-browser{filter:drop-shadow(0 0 .1cm #666);background:0 0}
.mdn .safari::before{background-image:url(https://www.w3.org/assets/logos/browser-logos/safari/safari.svg)}
.mdn .safari_ios::before{background-image:url(https://www.w3.org/assets/logos/browser-logos/safari-ios/safari-ios.svg)}
.mdn .samsunginternet_android::before{background-image:url(https://www.w3.org/assets/logos/browser-logos/samsung-internet/samsung-internet.svg)}
-.mdn .webview_android::before{background-image:url(https://www.w3.org/assets/logos/browser-logos/android-webview/android-webview.png)}`;const fl="core/mdn-annotation",hl="https://w3c.github.io/mdn-spec-links/",ml="https://developer.mozilla.org/en-US/docs/Web/",gl={chrome:"Chrome",chrome_android:"Chrome Android",edge:"Edge",edge_mobile:"Edge Mobile",firefox:"Firefox",firefox_android:"Firefox Android",opera:"Opera",opera_android:"Opera Android",safari:"Safari",safari_ios:"Safari iOS",samsunginternet_android:"Samsung Internet",webview_android:"WebView Android"},bl=Wn({en:{inAllEngines:"This feature is in all major engines.",inSomeEngines:"This feature has limited support."},zh:{inAllEngines:"所有主要引擎均支持此特性。",inSomeEngines:"此功能支持有限。"},cs:{inAllEngines:"Tato funkce je podporována ve všech hlavních prohlížečích.",inSomeEngines:"Tato funkce má omezenou podporu."}});function yl(e){const t=e.closest("section");if(!t)return;const{previousElementSibling:n}=t;if(n&&n.classList.contains("mdn"))return n;const r=kn``;return t.before(r),r}function wl(e){const{name:t,slug:n,summary:r,support:s,engines:o}=e,i=n.slice(n.indexOf("/")+1),a=`${ml}${n}`,c=`Expand MDN details for ${t}`,l=function(e){if(3===e.length)return kn`✅`;if(e.length<2)return kn`🚫`;return kn` `}(o);return kn`
+.mdn .webview_android::before{background-image:url(https://www.w3.org/assets/logos/browser-logos/android-webview/android-webview.png)}`;const ml="core/mdn-annotation",gl="https://w3c.github.io/mdn-spec-links/",bl="https://developer.mozilla.org/en-US/docs/Web/",yl={chrome:"Chrome",chrome_android:"Chrome Android",edge:"Edge",edge_mobile:"Edge Mobile",firefox:"Firefox",firefox_android:"Firefox Android",opera:"Opera",opera_android:"Opera Android",safari:"Safari",safari_ios:"Safari iOS",samsunginternet_android:"Samsung Internet",webview_android:"WebView Android"},wl=Wn({en:{inAllEngines:"This feature is in all major engines.",inSomeEngines:"This feature has limited support."},zh:{inAllEngines:"所有主要引擎均支持此特性。",inSomeEngines:"此功能支持有限。"},cs:{inAllEngines:"Tato funkce je podporována ve všech hlavních prohlížečích.",inSomeEngines:"Tato funkce má omezenou podporu."}});function vl(e){const t=e.closest("section");if(!t)return;const{previousElementSibling:n}=t;if(n&&n.classList.contains("mdn"))return n;const r=kn``;return t.before(r),r}function kl(e){const{name:t,slug:n,summary:r,support:s,engines:o}=e,i=n.slice(n.indexOf("/")+1),a=`${bl}${n}`,c=`Expand MDN details for ${t}`,l=function(e){if(3===e.length)return kn`✅`;if(e.length<2)return kn`🚫`;return kn` `}(o);return kn`
MDN${l}
${i}
- ${function(e){if(3===e.length)return kn`${bl.inAllEngines}
`;if(e.length<2)return kn`${bl.inSomeEngines}
`}(o)}
+ ${function(e){if(3===e.length)return kn`${wl.inAllEngines}
`;if(e.length<2)return kn`${wl.inSomeEngines}
`}(o)}
${s?function(e){function t(e,t,n){const r="Unknown"===t?"?":t,s=`${e} ${t.toLowerCase()}`;return kn`
- ${gl[e]}
+ ${yl[e]}
${n||r}
`}function n(e,n){if(n.version_removed)return t(e,"No","");const r=n.version_added;return"boolean"==typeof r?t(e,r?"Yes":"No",""):r?t(e,"Yes",`${r}+`):t(e,"Unknown","")}return kn`
- ${Object.keys(gl).map((r=>e[r]?n(r,e[r]):t(r,"Unknown","")))}
+ ${Object.keys(yl).map((r=>e[r]?n(r,e[r]):t(r,"Unknown","")))}
`}(s):kn`No support data.
`}
- `}var vl=Object.freeze({__proto__:null,name:fl,run:async function(e){const t=function(e){const{shortName:t,mdn:n}=e;if(!n)return;return"string"==typeof n?n:n.key||t}(e);if(!t)return;const n=await async function(e,t){const{baseJsonPath:n=hl,maxAge:r=864e5}=t,s=new URL(`${e}.json`,n).href,o=await Hn(s,r);if(404===o.status){return void lr(`Could not find MDN data associated with key "${e}".`,fl,{hint:"Please add a valid key to `respecConfig.mdn`"})}return await o.json()}(t,e.mdn);if(!n)return;const r=document.createElement("style");r.textContent=pl,document.head.append(r);for(const e of function(e){return[...document.body.querySelectorAll("[id]:not(script)")].filter((({id:t})=>Array.isArray(e[t])))}(n)){const t=n[e.id],r=yl(e);if(r)for(const e of t)r.append(wl(e))}}});const kl="ui/save-html",$l=Wn({en:{save_snapshot:"Export"},nl:{save_snapshot:"Bewaar Snapshot"},ja:{save_snapshot:"保存する"},de:{save_snapshot:"Exportieren"},zh:{save_snapshot:"导出"}}),xl=[{id:"respec-save-as-html",ext:"html",title:"HTML",type:"text/html",get href(){return xr(this.type)}},{id:"respec-save-as-xml",ext:"xhtml",title:"XML",type:"application/xml",get href(){return xr(this.type)}},{id:"respec-save-as-epub",ext:"epub",title:"EPUB 3",type:"application/epub+zip",get href(){const e=new URL("https://labs.w3.org/r2epub/");return e.searchParams.append("respec","true"),e.searchParams.append("url",document.location.href),e.href}}];var _l=Object.freeze({__proto__:null,exportDocument:function(e,t){return ur("Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed.",kl,{hint:"Use core/exporter `rsDocToDataURL()` instead."}),xr(t)},name:kl,run:function(e){const t={async show(t){await document.respec.ready;const n=kn``;es.freshModal(_l.save_snapshot,n,t)}},n="download"in HTMLAnchorElement.prototype;let r;n&&(r=es.addCommand(_l.save_snapshot,(function(){if(!n)return;t.show(r)}),"Ctrl+Shift+Alt+S","💾"))}});const Rl="https://respec.org/specref/",El=Wn({en:{search_specref:"Search Specref"},nl:{search_specref:"Doorzoek Specref"},ja:{search_specref:"仕様検索"},de:{search_specref:"Spezifikationen durchsuchen"},zh:{search_specref:"搜索 Specref"},cs:{search_specref:"Hledat ve Specref"}}),Al=es.addCommand(El.search_specref,(function(){const e=kn`
+
+ Open Search UI in a new tab
+ `;es.freshModal(El.search_specref,e,Al)}),"Ctrl+Shift+Alt+space","🔎");var Ll=Object.freeze({__proto__:null});const Tl="https://respec.org/xref/",Pl=Wn({en:{title:"Search definitions"},ja:{title:"定義検索"},de:{title:"Definitionen durchsuchen"},zh:{title:"搜索定义"},cs:{title:"Hledat definice"}}),Il=es.addCommand(Pl.title,(function(){const e=kn`
+
+ Open Search UI in a new tab
+ `;es.freshModal(Pl.title,e,Il)}),"Ctrl+Shift+Alt+x","📚");var Dl=Object.freeze({__proto__:null});const Nl=Wn({en:{about_respec:"About"},zh:{about_respec:"关于"},nl:{about_respec:"Over"},ja:{about_respec:"これについて"},de:{about_respec:"Über"},cs:{about_respec:"O aplikaci"}});window.respecVersion=window.respecVersion||"Developer Edition";const jl=document.createElement("div"),Ol=kn.bind(jl),zl=es.addCommand(`${Nl.about_respec} ${window.respecVersion}`,(function(){const e=[];"getEntriesByType"in performance&&performance.getEntriesByType("measure").sort(((e,t)=>t.duration-e.duration)).map((({name:e,duration:t})=>({name:e,duration:t>1e3?`${Math.round(t/1e3)} second(s)`:`${t.toFixed(2)} milliseconds`}))).map(Ml).forEach((t=>{e.push(t)}));Ol`
ReSpec is a document production toolchain, with a notable focus on W3C specifications.
@@ -1090,15 +1094,15 @@ img.caniuse-browser{filter:drop-shadow(0 0 .1cm #666);background:0 0}
${e}
-`,es.freshModal(`${Il.about_respec} - ${window.respecVersion}`,Dl,jl)}),"Ctrl+Shift+Alt+A","ℹ️");function Ol({name:e,duration:t}){return kn`
+`,es.freshModal(`${Nl.about_respec} - ${window.respecVersion}`,jl,zl)}),"Ctrl+Shift+Alt+A","ℹ️");function Ml({name:e,duration:t}){return kn`
${e}
${t}
- `}var zl=Object.freeze({__proto__:null});var Ml=Object.freeze({__proto__:null,name:"core/seo",run:function(e){if(e.gitRevision){const t=kn``;document.head.appendChild(t)}const t=document.querySelector("#abstract p:first-of-type");if(!t)return;const n=t.textContent.replace(/\s+/," ").trim(),r=document.createElement("meta");r.name="description",r.content=n,document.head.appendChild(r)}});const ql="w3c/seo",Wl={NOTE:"w3p:NOTE",WD:"w3p:WD",LC:"w3p:LastCall",CR:"w3p:CR",CRD:"w3p:CRD",PR:"w3p:PR",REC:"w3p:REC",RSCND:"w3p:RSCND"},Ul=new Set([...Os,...zs,...Ms,"BG-FINAL","CG-FINAL","CRY","DRY","draft-finding","finding"]);function Fl({name:e,url:t,mailto:n,company:r,companyURL:s}){const o={type:"Person",name:e,url:t,"foaf:mbox":n};return(r||s)&&(o.worksFor={name:r,url:s}),o}function Bl(e){const{href:t,title:n,href:r}=e,s={id:t,type:"TechArticle",name:n,url:r};return e.authors&&(s.creator=e.authors.map((e=>({name:e})))),e.rawDate&&(s.publishedDate=e.rawDate),e.isbn&&(s.identifier=e.isbn),e.publisher&&(s.publisher={name:e.publisher}),s}var Hl=Object.freeze({__proto__:null,name:ql,requiresCanonicalLink:Ul,run:async function(e){if((e.canonicalURI||Ul.has(e.specStatus))&&e.shortName){switch(e.canonicalURI){case"edDraft":if(e.edDraftURI)e.canonicalURI=new URL(e.edDraftURI,document.location.href).href;else{ur("Canonical URI set to edDraft, but no edDraftURI is set in configuration",ql),e.canonicalURI=null}break;case"TR":if(e.latestVersion)e.canonicalURI=e.latestVersion;else{ur("Canonical URI set to TR, but no shortName is set in configuration",ql),e.canonicalURI=null}break;default:e.latestVersion&&!e.canonicalURI&&(e.canonicalURI=e.latestVersion)}if(e.canonicalURI){const t=kn``;document.head.appendChild(t)}e.doJsonLd&&await async function(e,t){const n=Wl[e.specStatus],r=["TechArticle"];n&&r.push(n);const s={"@context":["http://schema.org",{"@vocab":"http://schema.org/","@language":t.documentElement.lang||"en",w3p:"http://www.w3.org/2001/02pd/rec54#",foaf:"http://xmlns.com/foaf/0.1/",datePublished:{"@type":"http://www.w3.org/2001/XMLSchema#date"},inLanguage:{"@language":null},isBasedOn:{"@type":"@id"},license:{"@type":"@id"}}],id:e.canonicalURI||e.thisVersion,type:r,name:document.title,inLanguage:t.documentElement.lang||"en",license:e.licenseInfo?.url,datePublished:e.dashDate,copyrightHolder:{name:"World Wide Web Consortium",url:"https://www.w3.org/"},discussionUrl:e.issueBase,alternativeHeadline:e.subtitle,isBasedOn:e.prevVersion};if(e.additionalCopyrightHolders){const t=Array.isArray(e.additionalCopyrightHolders)?e.additionalCopyrightHolders:[e.additionalCopyrightHolders];s.copyrightHolder=[s.copyrightHolder,...t.map((e=>({name:e})))]}const o=t.head.querySelector("meta[name=description]");o&&(s.description=o.content);e.editors&&(s.editor=e.editors.map(Fl));e.authors&&(s.contributor=e.authors.map(Fl));const i=[...e.normativeReferences,...e.informativeReferences],a=await Promise.all(i.map((e=>hi(e))));s.citation=a.filter((e=>"object"==typeof e)).map(Bl);const c=t.createElement("script");c.type="application/ld+json",c.textContent=JSON.stringify(s,null,2),t.head.appendChild(c)}(e,document)}}});var Vl=String.raw`.hljs{--base:#fafafa;--mono-1:#383a42;--mono-2:#686b77;--mono-3:#717277;--hue-1:#0b76c5;--hue-2:#336ae3;--hue-3:#a626a4;--hue-4:#42803c;--hue-5:#ca4706;--hue-5-2:#c91243;--hue-6:#986801;--hue-6-2:#9a6a01}
+ />`;document.head.appendChild(t)}const t=document.querySelector("#abstract p:first-of-type");if(!t)return;const n=t.textContent.replace(/\s+/," ").trim(),r=document.createElement("meta");r.name="description",r.content=n,document.head.appendChild(r)}});const Ul="w3c/seo",Fl={NOTE:"w3p:NOTE",WD:"w3p:WD",LC:"w3p:LastCall",CR:"w3p:CR",CRD:"w3p:CRD",PR:"w3p:PR",REC:"w3p:REC",RSCND:"w3p:RSCND"},Bl=new Set([...Os,...zs,...Ms,"BG-FINAL","CG-FINAL","CRY","DRY","draft-finding","finding"]);function Hl({name:e,url:t,mailto:n,company:r,companyURL:s}){const o={type:"Person",name:e,url:t,"foaf:mbox":n};return(r||s)&&(o.worksFor={name:r,url:s}),o}function Vl(e){const{href:t,title:n,href:r}=e,s={id:t,type:"TechArticle",name:n,url:r};return e.authors&&(s.creator=e.authors.map((e=>({name:e})))),e.rawDate&&(s.publishedDate=e.rawDate),e.isbn&&(s.identifier=e.isbn),e.publisher&&(s.publisher={name:e.publisher}),s}var Gl=Object.freeze({__proto__:null,name:Ul,requiresCanonicalLink:Bl,run:async function(e){if((e.canonicalURI||Bl.has(e.specStatus))&&e.shortName){switch(e.canonicalURI){case"edDraft":if(e.edDraftURI)e.canonicalURI=new URL(e.edDraftURI,document.location.href).href;else{ur("Canonical URI set to edDraft, but no edDraftURI is set in configuration",Ul),e.canonicalURI=null}break;case"TR":if(e.latestVersion)e.canonicalURI=e.latestVersion;else{ur("Canonical URI set to TR, but no shortName is set in configuration",Ul),e.canonicalURI=null}break;default:e.latestVersion&&!e.canonicalURI&&(e.canonicalURI=e.latestVersion)}if(e.canonicalURI){const t=kn``;document.head.appendChild(t)}e.doJsonLd&&await async function(e,t){const n=Fl[e.specStatus],r=["TechArticle"];n&&r.push(n);const s={"@context":["http://schema.org",{"@vocab":"http://schema.org/","@language":t.documentElement.lang||"en",w3p:"http://www.w3.org/2001/02pd/rec54#",foaf:"http://xmlns.com/foaf/0.1/",datePublished:{"@type":"http://www.w3.org/2001/XMLSchema#date"},inLanguage:{"@language":null},isBasedOn:{"@type":"@id"},license:{"@type":"@id"}}],id:e.canonicalURI||e.thisVersion,type:r,name:document.title,inLanguage:t.documentElement.lang||"en",license:e.licenseInfo?.url,datePublished:e.dashDate,copyrightHolder:{name:"World Wide Web Consortium",url:"https://www.w3.org/"},discussionUrl:e.issueBase,alternativeHeadline:e.subtitle,isBasedOn:e.prevVersion};if(e.additionalCopyrightHolders){const t=Array.isArray(e.additionalCopyrightHolders)?e.additionalCopyrightHolders:[e.additionalCopyrightHolders];s.copyrightHolder=[s.copyrightHolder,...t.map((e=>({name:e})))]}const o=t.head.querySelector("meta[name=description]");o&&(s.description=o.content);e.editors&&(s.editor=e.editors.map(Hl));e.authors&&(s.contributor=e.authors.map(Hl));const i=[...e.normativeReferences,...e.informativeReferences],a=await Promise.all(i.map((e=>gi(e))));s.citation=a.filter((e=>"object"==typeof e)).map(Vl);const c=t.createElement("script");c.type="application/ld+json",c.textContent=JSON.stringify(s,null,2),t.head.appendChild(c)}(e,document)}}});var Yl=String.raw`.hljs{--base:#fafafa;--mono-1:#383a42;--mono-2:#686b77;--mono-3:#717277;--hue-1:#0b76c5;--hue-2:#336ae3;--hue-3:#a626a4;--hue-4:#42803c;--hue-5:#ca4706;--hue-5-2:#c91243;--hue-6:#986801;--hue-6-2:#9a6a01}
@media (prefers-color-scheme:dark){
.hljs{--base:#282c34;--mono-1:#abb2bf;--mono-2:#818896;--mono-3:#5c6370;--hue-1:#56b6c2;--hue-2:#61aeee;--hue-3:#c678dd;--hue-4:#98c379;--hue-5:#e06c75;--hue-5-2:#be5046;--hue-6:#d19a66;--hue-6-2:#e6c07b}
}
@@ -1113,21 +1117,21 @@ img.caniuse-browser{filter:drop-shadow(0 0 .1cm #666);background:0 0}
.hljs-bullet,.hljs-link,.hljs-meta,.hljs-selector-id,.hljs-symbol,.hljs-title{color:#336ae3;color:var(--hue-2,#336ae3)}
.hljs-emphasis{font-style:italic}
.hljs-strong{font-weight:700}
-.hljs-link{text-decoration:underline}`;async function Gl(t){const n=await fetch(new URL(`../../${t}`,e&&"SCRIPT"===e.tagName.toUpperCase()&&e.src||new URL("respec-w3c.js",document.baseURI).href));return await n.text()}const Yl=Pn({hint:"preload",href:"https://www.w3.org/Tools/respec/respec-highlight",as:"script"});document.head.appendChild(Yl);const Kl=async function(){const e=await async function(){try{return(await Promise.resolve().then((function(){return Pd}))).default}catch{return Gl("worker/respec-worker.js")}}(),t=URL.createObjectURL(new Blob([e],{type:"application/javascript"}));return new Worker(t)}();n("core/worker",Kl.then((e=>({worker:e}))));const Zl=function(e,t=0){const n=function*(e,t){for(;;)yield`${e}:${t}`,t++}(e,t);return()=>n.next().value}("highlight");async function Jl(e){e.setAttribute("aria-busy","true");const t=(n=e.classList,Array.from(n).filter((e=>"highlight"!==e&&"nolinks"!==e)).map((e=>e.toLowerCase())));var n;let r;try{r=await async function(e,t){const n={action:"highlight",code:e,id:Zl(),languages:t},r=await Kl;return r.postMessage(n),new Promise(((e,t)=>{const s=setTimeout((()=>{t(new Error("Timed out waiting for highlight."))}),4e3);r.addEventListener("message",(function t(o){const{data:{id:i,language:a,value:c}}=o;i===n.id&&(r.removeEventListener("message",t),clearTimeout(s),e({language:a,value:c}))}))}))}(e.innerText,t)}catch(e){return void console.error(e)}const{language:s,value:o}=r;switch(e.localName){case"pre":e.classList.remove(s),e.innerHTML=`${o}`,e.classList.length||e.removeAttribute("class");break;case"code":e.innerHTML=o,e.classList.add("hljs"),s&&e.classList.add(s)}e.setAttribute("aria-busy","false")}var Ql=Object.freeze({__proto__:null,name:"core/highlight",run:async function(e){if(e.noHighlightCSS)return;const t=[...document.querySelectorAll("\n pre:not(.idl):not(.nohighlight) > code:not(.nohighlight),\n pre:not(.idl):not(.nohighlight),\n code.highlight\n ")].filter((e=>"pre"!==e.localName||!e.querySelector("code")));if(!t.length)return;const n=t.filter((e=>e.textContent.trim())).map(Jl);document.head.appendChild(kn``),await Promise.all(n)}});const Xl=Wn({en:{missing_test_suite_uri:gr`Found tests in your spec, but missing ${"[testSuiteURI]"} in your ReSpec config.`,tests:"tests",test:"test"},ja:{missing_test_suite_uri:gr`この仕様内にテストの項目を検出しましたが,ReSpec の設定に ${"[testSuiteURI]"} が見つかりません.`,tests:"テスト",test:"テスト"},de:{missing_test_suite_uri:gr`Die Spezifikation enthält Tests, aber in der ReSpec-Konfiguration ist keine ${"[testSuiteURI]"} angegeben.`,tests:"Tests",test:"Test"},zh:{missing_test_suite_uri:gr`本规范中包含测试,但在 ReSpec 配置中缺少 ${"[testSuiteURI]"}。`,tests:"测试",test:"测试"}}),eu="core/data-tests";function tu(e){const t=[],[n]=new URL(e).pathname.split("/").reverse(),r=n.split(".");let[s]=r;if(r.find((e=>"https"===e))){const e=document.createElement("span");e.textContent="🔒",e.setAttribute("aria-label","requires a secure connection"),e.setAttribute("title","Test requires HTTPS"),s=s.replace(".https",""),t.push(e)}if(s.split(".").join("-").split("-").find((e=>"manual"===e))){const e=document.createElement("span");e.textContent="💪",e.setAttribute("aria-label","the test must be run manually"),e.setAttribute("title","Manual test"),s=s.replace("-manual",""),t.push(e)}return kn`
+.hljs-link{text-decoration:underline}`;async function Kl(t){const n=await fetch(new URL(`../../${t}`,e&&"SCRIPT"===e.tagName.toUpperCase()&&e.src||new URL("respec-w3c.js",document.baseURI).href));return await n.text()}const Zl=Pn({hint:"preload",href:"https://www.w3.org/Tools/respec/respec-highlight",as:"script"});document.head.appendChild(Zl);const Jl=async function(){const e=await async function(){try{return(await Promise.resolve().then((function(){return Pd}))).default}catch{return Kl("worker/respec-worker.js")}}(),t=URL.createObjectURL(new Blob([e],{type:"application/javascript"}));return new Worker(t)}();n("core/worker",Jl.then((e=>({worker:e}))));const Ql=function(e,t=0){const n=function*(e,t){for(;;)yield`${e}:${t}`,t++}(e,t);return()=>n.next().value}("highlight");async function Xl(e){e.setAttribute("aria-busy","true");const t=(n=e.classList,Array.from(n).filter((e=>"highlight"!==e&&"nolinks"!==e)).map((e=>e.toLowerCase())));var n;let r;try{r=await async function(e,t){const n={action:"highlight",code:e,id:Ql(),languages:t},r=await Jl;return r.postMessage(n),new Promise(((e,t)=>{const s=setTimeout((()=>{t(new Error("Timed out waiting for highlight."))}),4e3);r.addEventListener("message",(function t(o){const{data:{id:i,language:a,value:c}}=o;i===n.id&&(r.removeEventListener("message",t),clearTimeout(s),e({language:a,value:c}))}))}))}(e.innerText,t)}catch(e){return void console.error(e)}const{language:s,value:o}=r;switch(e.localName){case"pre":e.classList.remove(s),e.innerHTML=`${o}`,e.classList.length||e.removeAttribute("class");break;case"code":e.innerHTML=o,e.classList.add("hljs"),s&&e.classList.add(s)}e.setAttribute("aria-busy","false")}var eu=Object.freeze({__proto__:null,name:"core/highlight",run:async function(e){if(e.noHighlightCSS)return;const t=[...document.querySelectorAll("\n pre:not(.idl):not(.nohighlight) > code:not(.nohighlight),\n pre:not(.idl):not(.nohighlight),\n code.highlight\n ")].filter((e=>"pre"!==e.localName||!e.querySelector("code")));if(!t.length)return;const n=t.filter((e=>e.textContent.trim())).map(Xl);document.head.appendChild(kn``),await Promise.all(n)}});const tu=Wn({en:{missing_test_suite_uri:gr`Found tests in your spec, but missing ${"[testSuiteURI]"} in your ReSpec config.`,tests:"tests",test:"test"},ja:{missing_test_suite_uri:gr`この仕様内にテストの項目を検出しましたが,ReSpec の設定に ${"[testSuiteURI]"} が見つかりません.`,tests:"テスト",test:"テスト"},de:{missing_test_suite_uri:gr`Die Spezifikation enthält Tests, aber in der ReSpec-Konfiguration ist keine ${"[testSuiteURI]"} angegeben.`,tests:"Tests",test:"Test"},zh:{missing_test_suite_uri:gr`本规范中包含测试,但在 ReSpec 配置中缺少 ${"[testSuiteURI]"}。`,tests:"测试",test:"测试"}}),nu="core/data-tests";function ru(e){const t=[],[n]=new URL(e).pathname.split("/").reverse(),r=n.split(".");let[s]=r;if(r.find((e=>"https"===e))){const e=document.createElement("span");e.textContent="🔒",e.setAttribute("aria-label","requires a secure connection"),e.setAttribute("title","Test requires HTTPS"),s=s.replace(".https",""),t.push(e)}if(s.split(".").join("-").split("-").find((e=>"manual"===e))){const e=document.createElement("span");e.textContent="💪",e.setAttribute("aria-label","the test must be run manually"),e.setAttribute("title","Manual test"),s=s.replace("-manual",""),t.push(e)}return kn`
-
${s}
${t}
- `}function nu(e,t,n){return e.map((e=>{try{return new URL(e,t).href}catch{ur(gr`Invalid URL in ${"[data-tests]"} attribute: ${e}.`,eu,{elements:[n]})}})).filter((e=>e))}function ru(e,t){const n=e.filter(((e,t,n)=>n.indexOf(e)!==t));if(n.length){const e=gr`Duplicate tests found in the ${"[data-tests]"} attribute.`,r=gr`To fix, remove duplicates from ${"[data-tests]"}: ${hr(n,{quotes:!0})}.`;ur(e,eu,{hint:r,elements:[t]})}}function su(e){const t=[...new Set(e)];return kn`
+ `}function su(e,t,n){return e.map((e=>{try{return new URL(e,t).href}catch{ur(gr`Invalid URL in ${"[data-tests]"} attribute: ${e}.`,nu,{elements:[n]})}})).filter((e=>e))}function ou(e,t){const n=e.filter(((e,t,n)=>n.indexOf(e)!==t));if(n.length){const e=gr`Duplicate tests found in the ${"[data-tests]"} attribute.`,r=gr`To fix, remove duplicates from ${"[data-tests]"}: ${hr(n,{quotes:!0})}.`;ur(e,nu,{hint:r,elements:[t]})}}function iu(e){const t=[...new Set(e)];return kn`
tests: ${t.length}
- ${t.map(tu)}
+ ${t.map(ru)}
- `}var ou=Object.freeze({__proto__:null,name:eu,run:function(e){const t=[...document.querySelectorAll("[data-tests]")].filter((e=>e.dataset.tests));if(t.length)if(e.testSuiteURI)for(const n of t){const t=nu(n.dataset.tests.split(/,/gm).map((e=>e.trim())),e.testSuiteURI,n);ru(t,n);const r=su(t);n.append(r)}else lr(Xl.missing_test_suite_uri,eu)}});const iu="core/list-sorter";function au(e){const t="ascending"===e?1:-1;return({textContent:e},{textContent:n})=>t*e.trim().localeCompare(n.trim())}function cu(e,t){return[...e.querySelectorAll(":scope > li")].sort(au(t)).reduce(((e,t)=>(e.appendChild(t),e)),document.createDocumentFragment())}function lu(e,t){return[...e.querySelectorAll(":scope > dt")].sort(au(t)).reduce(((e,t)=>{const{nodeType:n,nodeName:r}=t,s=document.createDocumentFragment();let{nextSibling:o}=t;for(;o&&o.nextSibling;){s.appendChild(o.cloneNode(!0));const{nodeType:e,nodeName:t}=o.nextSibling;if(e===n&&t===r)break;o=o.nextSibling}return s.prepend(t.cloneNode(!0)),e.appendChild(s),e}),document.createDocumentFragment())}var uu=Object.freeze({__proto__:null,name:iu,run:function(){const e=document.querySelectorAll("[data-sort]");for(const t of e){let e;const n=t.dataset.sort||"ascending";switch(t.localName){case"dl":e=lu(t,n);break;case"ol":case"ul":e=cu(t,n);break;default:ur(`ReSpec can't sort ${t.localName} elements.`,iu,{elements:[t]})}if(e){const n=document.createRange();n.selectNodeContents(t),n.deleteContents(),t.appendChild(e)}}},sortDefinitionTerms:lu,sortListItems:cu});var du=String.raw`var:hover{text-decoration:underline;cursor:pointer}
+ `}var au=Object.freeze({__proto__:null,name:nu,run:function(e){const t=[...document.querySelectorAll("[data-tests]")].filter((e=>e.dataset.tests));if(t.length)if(e.testSuiteURI)for(const n of t){const t=su(n.dataset.tests.split(/,/gm).map((e=>e.trim())),e.testSuiteURI,n);ou(t,n);const r=iu(t);n.append(r)}else lr(tu.missing_test_suite_uri,nu)}});const cu="core/list-sorter";function lu(e){const t="ascending"===e?1:-1;return({textContent:e},{textContent:n})=>t*e.trim().localeCompare(n.trim())}function uu(e,t){return[...e.querySelectorAll(":scope > li")].sort(lu(t)).reduce(((e,t)=>(e.appendChild(t),e)),document.createDocumentFragment())}function du(e,t){return[...e.querySelectorAll(":scope > dt")].sort(lu(t)).reduce(((e,t)=>{const{nodeType:n,nodeName:r}=t,s=document.createDocumentFragment();let{nextSibling:o}=t;for(;o&&o.nextSibling;){s.appendChild(o.cloneNode(!0));const{nodeType:e,nodeName:t}=o.nextSibling;if(e===n&&t===r)break;o=o.nextSibling}return s.prepend(t.cloneNode(!0)),e.appendChild(s),e}),document.createDocumentFragment())}var pu=Object.freeze({__proto__:null,name:cu,run:function(){const e=document.querySelectorAll("[data-sort]");for(const t of e){let e;const n=t.dataset.sort||"ascending";switch(t.localName){case"dl":e=du(t,n);break;case"ol":case"ul":e=uu(t,n);break;default:ur(`ReSpec can't sort ${t.localName} elements.`,cu,{elements:[t]})}if(e){const n=document.createRange();n.selectNodeContents(t),n.deleteContents(),t.appendChild(e)}}},sortDefinitionTerms:du,sortListItems:uu});var fu=String.raw`var:hover{text-decoration:underline;cursor:pointer}
var.respec-hl{color:var(--color,#000);background-color:var(--bg-color);box-shadow:0 0 0 2px var(--bg-color)}
@media (prefers-color-scheme:dark){
var.respec-hl{filter:saturate(.9) brightness(.9)}
@@ -1141,15 +1145,11 @@ var.respec-hl-c6{--bg-color:#82ddff}
var.respec-hl-c7{--bg-color:#ffbcf2}
@media print{
var.respec-hl{background:0 0;color:#000;box-shadow:unset}
-}`;var pu=Object.freeze({__proto__:null,name:"core/highlight-vars",run:async function(e){if(!e.highlightVars)return;const t=document.createElement("style");t.textContent=du,document.head.appendChild(t);const n=document.createElement("script");n.id="respec-highlight-vars",n.textContent=await async function(){try{return(await Promise.resolve().then((function(){return Id}))).default}catch{return Gl("./src/core/highlight-vars.runtime.js")}}(),document.body.append(n),vr("beforesave",(e=>{e.querySelectorAll("var.respec-hl").forEach((e=>{const t=[...e.classList.values()].filter((e=>e.startsWith("respec-hl")));e.classList.remove(...t),e.classList.length||e.removeAttribute("class")}))}))}});var fu=String.raw`var{position:relative;cursor:pointer}
+}`;var hu=Object.freeze({__proto__:null,name:"core/highlight-vars",run:async function(e){if(!e.highlightVars)return;const t=document.createElement("style");t.textContent=fu,document.head.appendChild(t);const n=document.createElement("script");n.id="respec-highlight-vars",n.textContent=await async function(){try{return(await Promise.resolve().then((function(){return Id}))).default}catch{return Kl("./src/core/highlight-vars.runtime.js")}}(),document.body.append(n),vr("beforesave",(e=>{e.querySelectorAll("var.respec-hl").forEach((e=>{const t=[...e.classList.values()].filter((e=>e.startsWith("respec-hl")));e.classList.remove(...t),e.classList.length||e.removeAttribute("class")}))}))}});var mu=String.raw`var{position:relative;cursor:pointer}
var[data-type]::after,var[data-type]::before{position:absolute;left:50%;top:-6px;opacity:0;transition:opacity .4s;pointer-events:none}
var[data-type]::before{content:"";transform:translateX(-50%);border-width:4px 6px 0 6px;border-style:solid;border-color:transparent;border-top-color:#222}
var[data-type]::after{content:attr(data-type);transform:translateX(-50%) translateY(-100%);background:#222;text-align:center;font-family:"Dank Mono","Fira Code",monospace;font-style:normal;padding:6px;border-radius:3px;color:#daca88;text-indent:0;font-weight:400}
-var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var hu=Object.freeze({__proto__:null,name:"core/data-type",run:function(e){if(!e.highlightVars)return;const t=document.createElement("style");t.textContent=fu,document.head.appendChild(t);let n=null;const r=new Map,s=document.querySelectorAll("section var");for(const e of s){const t=e.closest("section");if(n!==t&&(n=t,r.clear()),e.dataset.type){r.set(e.textContent.trim(),e.dataset.type);continue}const s=r.get(e.textContent.trim());s&&(e.dataset.type=s)}}});var mu=String.raw`:root{--assertion-border:#aaa;--assertion-bg:#eee;--assertion-text:black}
-.assert{border-left:.5em solid #aaa;padding:.3em;border-color:#aaa;border-color:var(--assertion-border);background:#eee;background:var(--assertion-bg);color:#000;color:var(--assertion-text)}
-@media (prefers-color-scheme:dark){
-:root{--assertion-border:#444;--assertion-bg:var(--borderedblock-bg);--assertion-text:var(--text)}
-}`;var gu=Object.freeze({__proto__:null,name:"core/algorithms",run:function(){const e=Array.from(document.querySelectorAll("ol.algorithm li")).filter((e=>e.textContent.trim().startsWith("Assert: ")));if(!e.length)return;for(const t of e){t.classList.add("assert");const e=t.firstChild;e instanceof Text&&e.textContent.startsWith("Assert: ")&&(e.textContent=e.textContent.replace("Assert: ",""),t.prepend(kn`Assert`,": "))}const t=document.createElement("style");t.textContent=mu,document.head.appendChild(t)}});const bu="core/anchor-expander";function yu(e,t,n){const r=e.querySelector(".marker .self-link");if(!r){n.textContent=n.getAttribute("href");return void lr(`Found matching element "${t}", but it has no title or marker.`,bu,{title:"Missing title.",elements:[n]})}const s=sr(r);n.append(...s.childNodes),n.classList.add("box-ref")}function wu(e,t,n){const r=e.querySelector("figcaption");if(!r){n.textContent=n.getAttribute("href");return void lr(`Found matching figure "${t}", but figure is lacking a \`\`.`,bu,{title:"Missing figcaption in referenced figure.",elements:[n]})}const s=[...sr(r.querySelector(".self-link")).childNodes].map((e=>(e.classList?.remove("figno"),e)));n.append(...s),n.classList.add("fig-ref");const o=r.querySelector(".fig-title");!n.hasAttribute("title")&&o&&(n.title=qn(o.textContent))}function vu(e,t,n){if(!e.classList.contains("numbered"))return;const r=e.querySelector("caption");if(!r){n.textContent=n.getAttribute("href");return void lr(`Found matching table "${t}", but table is lacking a \`\`.`,bu,{title:"Missing caption in referenced table.",elements:[n]})}const s=[...sr(r.querySelector(".self-link")).childNodes].map((e=>(e.classList?.remove("tableno"),e)));n.append(...s),n.classList.add("table-ref");const o=r.querySelector(".table-title");!n.hasAttribute("title")&&o&&(n.title=qn(o.textContent))}function ku(e,t,n){const r=e.querySelector("h6, h5, h4, h3, h2");if(r)$u(r,n),xu(r,n);else{n.textContent=n.getAttribute("href");lr("Found matching section, but the section was lacking a heading element.",bu,{title:`No matching id in document: "${t}".`,elements:[n]})}}function $u(e,t){const n=e.querySelector(".self-link"),r=[...sr(e).childNodes].filter((e=>!e.classList||!e.classList.contains("self-link")));t.append(...r),n&&t.prepend("§ "),t.classList.add("sec-ref"),t.lastChild.nodeType===Node.TEXT_NODE&&(t.lastChild.textContent=t.lastChild.textContent.trimEnd()),t.querySelectorAll("a").forEach((e=>{const t=Jn(e,"span");for(const e of[...t.attributes])t.removeAttributeNode(e)}))}function xu(e,t){for(const n of["dir","lang"]){if(t.hasAttribute(n))continue;const r=e.closest(`[${n}]`);if(!r)continue;const s=t.closest(`[${n}]`);s&&s.getAttribute(n)===r.getAttribute(n)||t.setAttribute(n,r.getAttribute(n))}}var _u=Object.freeze({__proto__:null,name:bu,run:function(){const e=[...document.querySelectorAll("a[href^='#']:not(.self-link):not([href$='the-empty-string'])")].filter((e=>""===e.textContent.trim()));for(const t of e){const e=t.getAttribute("href").slice(1),n=document.getElementById(e);if(n){switch(n.localName){case"h6":case"h5":case"h4":case"h3":case"h2":$u(n,t);break;case"section":ku(n,e,t);break;case"figure":wu(n,e,t);break;case"table":vu(n,e,t);break;case"aside":case"div":yu(n,e,t);break;default:t.textContent=t.getAttribute("href");lr("ReSpec doesn't support expanding this kind of reference.",bu,{title:`Can't expand "#${e}".`,elements:[t]})}xu(n,t),t.normalize()}else{t.textContent=t.getAttribute("href");lr(`Couldn't expand inline reference. The id "${e}" is not in the document.`,bu,{title:`No matching id in document: ${e}.`,elements:[t]})}}}});var Cu=String.raw`dfn{cursor:pointer}
+var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var gu=Object.freeze({__proto__:null,name:"core/data-type",run:function(e){if(!e.highlightVars)return;const t=document.createElement("style");t.textContent=mu,document.head.appendChild(t);let n=null;const r=new Map,s=document.querySelectorAll("section var");for(const e of s){const t=e.closest("section");if(n!==t&&(n=t,r.clear()),e.dataset.type){r.set(e.textContent.trim(),e.dataset.type);continue}const s=r.get(e.textContent.trim());s&&(e.dataset.type=s)}}});const bu="core/anchor-expander";function yu(e,t,n){const r=e.querySelector(".marker .self-link");if(!r){n.textContent=n.getAttribute("href");return void lr(`Found matching element "${t}", but it has no title or marker.`,bu,{title:"Missing title.",elements:[n]})}const s=sr(r);n.append(...s.childNodes),n.classList.add("box-ref")}function wu(e,t,n){const r=e.querySelector("figcaption");if(!r){n.textContent=n.getAttribute("href");return void lr(`Found matching figure "${t}", but figure is lacking a \`\`.`,bu,{title:"Missing figcaption in referenced figure.",elements:[n]})}const s=[...sr(r.querySelector(".self-link")).childNodes].map((e=>(e.classList?.remove("figno"),e)));n.append(...s),n.classList.add("fig-ref");const o=r.querySelector(".fig-title");!n.hasAttribute("title")&&o&&(n.title=qn(o.textContent))}function vu(e,t,n){if(!e.classList.contains("numbered"))return;const r=e.querySelector("caption");if(!r){n.textContent=n.getAttribute("href");return void lr(`Found matching table "${t}", but table is lacking a \`\`.`,bu,{title:"Missing caption in referenced table.",elements:[n]})}const s=[...sr(r.querySelector(".self-link")).childNodes].map((e=>(e.classList?.remove("tableno"),e)));n.append(...s),n.classList.add("table-ref");const o=r.querySelector(".table-title");!n.hasAttribute("title")&&o&&(n.title=qn(o.textContent))}function ku(e,t,n){const r=e.querySelector("h6, h5, h4, h3, h2");if(r)$u(r,n),xu(r,n);else{n.textContent=n.getAttribute("href");lr("Found matching section, but the section was lacking a heading element.",bu,{title:`No matching id in document: "${t}".`,elements:[n]})}}function $u(e,t){const n=e.querySelector(".self-link"),r=[...sr(e).childNodes].filter((e=>!e.classList||!e.classList.contains("self-link")));t.append(...r),n&&t.prepend("§ "),t.classList.add("sec-ref"),t.lastChild.nodeType===Node.TEXT_NODE&&(t.lastChild.textContent=t.lastChild.textContent.trimEnd()),t.querySelectorAll("a").forEach((e=>{const t=Jn(e,"span");for(const e of[...t.attributes])t.removeAttributeNode(e)}))}function xu(e,t){for(const n of["dir","lang"]){if(t.hasAttribute(n))continue;const r=e.closest(`[${n}]`);if(!r)continue;const s=t.closest(`[${n}]`);s&&s.getAttribute(n)===r.getAttribute(n)||t.setAttribute(n,r.getAttribute(n))}}var _u=Object.freeze({__proto__:null,name:bu,run:function(){const e=[...document.querySelectorAll("a[href^='#']:not(.self-link):not([href$='the-empty-string'])")].filter((e=>""===e.textContent.trim()));for(const t of e){const e=t.getAttribute("href").slice(1),n=document.getElementById(e);if(n){switch(n.localName){case"h6":case"h5":case"h4":case"h3":case"h2":$u(n,t);break;case"section":ku(n,e,t);break;case"figure":wu(n,e,t);break;case"table":vu(n,e,t);break;case"aside":case"div":yu(n,e,t);break;default:t.textContent=t.getAttribute("href");lr("ReSpec doesn't support expanding this kind of reference.",bu,{title:`Can't expand "#${e}".`,elements:[t]})}xu(n,t),t.normalize()}else{t.textContent=t.getAttribute("href");lr(`Couldn't expand inline reference. The id "${e}" is not in the document.`,bu,{title:`No matching id in document: ${e}.`,elements:[t]})}}}});var Cu=String.raw`dfn{cursor:pointer}
.dfn-panel{position:absolute;z-index:35;min-width:300px;max-width:500px;padding:.5em .75em;margin-top:.6em;font-family:"Helvetica Neue",sans-serif;font-size:small;background:#fff;background:var(--indextable-hover-bg,#fff);color:#000;color:var(--text,#000);box-shadow:0 1em 3em -.4em rgba(0,0,0,.3),0 0 1px 1px rgba(0,0,0,.05);box-shadow:0 1em 3em -.4em var(--tocsidebar-shadow,rgba(0,0,0,.3)),0 0 1px 1px var(--tocsidebar-shadow,rgba(0,0,0,.05));border-radius:2px}
.dfn-panel:not(.docked)>.caret{position:absolute;top:-9px}
.dfn-panel:not(.docked)>.caret::after,.dfn-panel:not(.docked)>.caret::before{content:"";position:absolute;border:10px solid transparent;border-top:0;border-bottom:10px solid #fff;border-bottom-color:var(--indextable-hover-bg,#fff);top:0}
@@ -1206,7 +1206,7 @@ var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var hu=Obje
`;return i}var Ru=Object.freeze({__proto__:null,name:"core/dfn-panel",run:async function(){document.head.insertBefore(kn``,document.querySelector("link"));const e=document.querySelectorAll("dfn[id]:not([data-cite]), #index-defined-elsewhere .index-term"),t=document.createDocumentFragment();for(const n of e)t.append(Su(n)),n.tabIndex=0,n.setAttribute("aria-haspopup","dialog");document.body.querySelector("script")?document.body.querySelector("script").before(t):document.body.append(t);const n=document.createElement("script");n.id="respec-dfn-panel",n.textContent=await async function(){try{return(await Promise.resolve().then((function(){return Dd}))).default}catch{return Gl("./src/core/dfn-panel.runtime.js")}}(),document.body.append(n)}});const Eu="rs-changelog",Au=class extends HTMLElement{constructor(){super(),this.props={from:this.getAttribute("from"),to:this.getAttribute("to")||"HEAD",filter:"function"==typeof window[this.getAttribute("filter")]?window[this.getAttribute("filter")]:()=>!0}}connectedCallback(){const{from:e,to:t,filter:n}=this.props;kn.bind(this)`
+ `,document.querySelector("link"));const e=document.querySelectorAll("dfn[id]:not([data-cite]), #index-defined-elsewhere .index-term"),t=document.createDocumentFragment();for(const n of e)t.append(Su(n)),n.tabIndex=0,n.setAttribute("aria-haspopup","dialog");document.body.querySelector("script")?document.body.querySelector("script").before(t):document.body.append(t);const n=document.createElement("script");n.id="respec-dfn-panel",n.textContent=await async function(){try{return(await Promise.resolve().then((function(){return Dd}))).default}catch{return Kl("./src/core/dfn-panel.runtime.js")}}(),document.body.append(n)}});const Eu="rs-changelog",Au=class extends HTMLElement{constructor(){super(),this.props={from:this.getAttribute("from"),to:this.getAttribute("to")||"HEAD",filter:"function"==typeof window[this.getAttribute("filter")]?window[this.getAttribute("filter")]:()=>!0}}connectedCallback(){const{from:e,to:t,filter:n}=this.props;kn.bind(this)`
${{any:Lu(e,t,n).then((e=>async function(e){const{repoURL:t}=await mo;return e.map((e=>{const[n,r=null]=e.message.split(/\(#(\d+)\)/,2),s=`${t}commit/${e.hash}`,o=r&&kn` (#${r})`;return kn`- ${n.trim()}${o}
`}))}(e))).catch((e=>lr(e.message,Eu,{elements:[this],cause:e}))).finally((()=>{this.dispatchEvent(new CustomEvent("done"))})),placeholder:"Loading list of commits..."}}
@@ -1249,5 +1249,5 @@ var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var hu=Obje
* Přidejte atribut \`class=\"lint-ignore\"\` k odkazu.
* Použijte lokální normativní proxy pro definici, např. \`term\`
- Pro úplné potlačení tohoto varování nastavte \`lint: { \"${Ed}\": false }\` ve vaší \`respecConfig\`.`}}});var Td=Object.freeze({__proto__:null,name:Ad,run:function(e){if(!e.lint?.[Ed])return;const t="error"===e.lint[Ed]?lr:ur;xc.forEach((({term:e,spec:n,element:r})=>{r.classList.contains("lint-ignore")||t(Ld.msg(e,n),Ad,{title:"Normative reference to non-normative term.",elements:[r],hint:Ld.hint})}))}}),Pd=Object.freeze({__proto__:null,default:'// ReSpec Worker v1.0.0\n"use strict";\ntry {\n importScripts("https://www.w3.org/Tools/respec/respec-highlight");\n} catch (err) {\n console.error("Network error loading highlighter", err);\n}\n\nself.addEventListener("message", ({ data: originalData }) => {\n const data = Object.assign({}, originalData);\n switch (data.action) {\n case "highlight-load-lang": {\n const { langURL, propName, lang } = data;\n importScripts(langURL);\n self.hljs.registerLanguage(lang, self[propName]);\n break;\n }\n case "highlight": {\n const { code } = data;\n const langs = data.languages.length ? data.languages : undefined;\n try {\n const { value, language } = self.hljs.highlightAuto(code, langs);\n Object.assign(data, { value, language });\n } catch (err) {\n console.error("Could not transform some code?", err);\n // Post back the original code\n Object.assign(data, { value: code, language: "" });\n }\n break;\n }\n }\n self.postMessage(data);\n});\n'}),Id=Object.freeze({__proto__:null,default:'(() => {\n// @ts-check\n\nif (document.respec) {\n document.respec.ready.then(setupVarHighlighter);\n} else {\n setupVarHighlighter();\n}\n\nfunction setupVarHighlighter() {\n document\n .querySelectorAll("var")\n .forEach(varElem => varElem.addEventListener("click", highlightListener));\n}\n\nfunction highlightListener(ev) {\n ev.stopPropagation();\n const { target: varElem } = ev;\n const hightligtedElems = highlightVars(varElem);\n const resetListener = () => {\n const hlColor = getHighlightColor(varElem);\n hightligtedElems.forEach(el => removeHighlight(el, hlColor));\n [...HL_COLORS.keys()].forEach(key => HL_COLORS.set(key, true));\n };\n if (hightligtedElems.length) {\n document.body.addEventListener("click", resetListener, { once: true });\n }\n}\n\n// availability of highlight colors. colors from var.css\nconst HL_COLORS = new Map([\n ["respec-hl-c1", true],\n ["respec-hl-c2", true],\n ["respec-hl-c3", true],\n ["respec-hl-c4", true],\n ["respec-hl-c5", true],\n ["respec-hl-c6", true],\n ["respec-hl-c7", true],\n]);\n\nfunction getHighlightColor(target) {\n // return current colors if applicable\n const { value } = target.classList;\n const re = /respec-hl-\\w+/;\n const activeClass = re.test(value) && value.match(re);\n if (activeClass) return activeClass[0];\n\n // first color preference\n if (HL_COLORS.get("respec-hl-c1") === true) return "respec-hl-c1";\n\n // otherwise get some other available color\n return [...HL_COLORS.keys()].find(c => HL_COLORS.get(c)) || "respec-hl-c1";\n}\n\nfunction highlightVars(varElem) {\n const textContent = norm(varElem.textContent);\n const parent = varElem.closest(".algorithm, section");\n const highlightColor = getHighlightColor(varElem);\n\n const varsToHighlight = [...parent.querySelectorAll("var")].filter(\n el =>\n norm(el.textContent) === textContent &&\n el.closest(".algorithm, section") === parent\n );\n\n // update availability of highlight color\n const colorStatus = varsToHighlight[0].classList.contains("respec-hl");\n HL_COLORS.set(highlightColor, colorStatus);\n\n // highlight vars\n if (colorStatus) {\n varsToHighlight.forEach(el => removeHighlight(el, highlightColor));\n return [];\n } else {\n varsToHighlight.forEach(el => addHighlight(el, highlightColor));\n }\n return varsToHighlight;\n}\n\nfunction removeHighlight(el, highlightColor) {\n el.classList.remove("respec-hl", highlightColor);\n // clean up empty class attributes so they don\'t come in export\n if (!el.classList.length) el.removeAttribute("class");\n}\n\nfunction addHighlight(elem, highlightColor) {\n elem.classList.add("respec-hl", highlightColor);\n}\n\n/**\n * Same as `norm` from src/core/utils, but our build process doesn\'t allow\n * imports in runtime scripts, so duplicated here.\n * @param {string} str\n */\nfunction norm(str) {\n return str.trim().replace(/\\s+/g, " ");\n}\n})()'}),Dd=Object.freeze({__proto__:null,default:'(() => {\n// @ts-check\nif (document.respec) {\n document.respec.ready.then(setupPanel);\n} else {\n setupPanel();\n}\n\nfunction setupPanel() {\n const listener = panelListener();\n document.body.addEventListener("keydown", listener);\n document.body.addEventListener("click", listener);\n}\n\nfunction panelListener() {\n /** @type {HTMLElement} */\n let panel = null;\n return event => {\n const { target, type } = event;\n\n if (!(target instanceof HTMLElement)) return;\n\n // For keys, we only care about Enter key to activate the panel\n // otherwise it\'s activated via a click.\n if (type === "keydown" && event.key !== "Enter") return;\n\n const action = deriveAction(event);\n\n switch (action) {\n case "show": {\n hidePanel(panel);\n /** @type {HTMLElement} */\n const dfn = target.closest("dfn, .index-term");\n panel = document.getElementById(`dfn-panel-for-${dfn.id}`);\n const coords = deriveCoordinates(event);\n displayPanel(dfn, panel, coords);\n break;\n }\n case "dock": {\n panel.style.left = null;\n panel.style.top = null;\n panel.classList.add("docked");\n break;\n }\n case "hide": {\n hidePanel(panel);\n panel = null;\n break;\n }\n }\n };\n}\n\n/**\n * @param {MouseEvent|KeyboardEvent} event\n */\nfunction deriveCoordinates(event) {\n const target = /** @type HTMLElement */ (event.target);\n\n // We prevent synthetic AT clicks from putting\n // the dialog in a weird place. The AT events sometimes\n // lack coordinates, so they have clientX/Y = 0\n const rect = target.getBoundingClientRect();\n if (\n event instanceof MouseEvent &&\n event.clientX >= rect.left &&\n event.clientY >= rect.top\n ) {\n // The event probably happened inside the bounding rect...\n return { x: event.clientX, y: event.clientY };\n }\n\n // Offset to the middle of the element\n const x = rect.x + rect.width / 2;\n // Placed at the bottom of the element\n const y = rect.y + rect.height;\n return { x, y };\n}\n\n/**\n * @param {Event} event\n */\nfunction deriveAction(event) {\n const target = /** @type {HTMLElement} */ (event.target);\n const hitALink = !!target.closest("a");\n if (target.closest("dfn:not([data-cite]), .index-term")) {\n return hitALink ? "none" : "show";\n }\n if (target.closest(".dfn-panel")) {\n if (hitALink) {\n return target.classList.contains("self-link") ? "hide" : "dock";\n }\n const panel = target.closest(".dfn-panel");\n return panel.classList.contains("docked") ? "hide" : "none";\n }\n if (document.querySelector(".dfn-panel:not([hidden])")) {\n return "hide";\n }\n return "none";\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {HTMLElement} panel\n * @param {{ x: number, y: number }} clickPosition\n */\nfunction displayPanel(dfn, panel, { x, y }) {\n panel.hidden = false;\n // distance (px) between edge of panel and the pointing triangle (caret)\n const MARGIN = 20;\n\n const dfnRects = dfn.getClientRects();\n // Find the `top` offset when the `dfn` can be spread across multiple lines\n let closestTop = 0;\n let minDiff = Infinity;\n for (const rect of dfnRects) {\n const { top, bottom } = rect;\n const diffFromClickY = Math.abs((top + bottom) / 2 - y);\n if (diffFromClickY < minDiff) {\n minDiff = diffFromClickY;\n closestTop = top;\n }\n }\n\n const top = window.scrollY + closestTop + dfnRects[0].height;\n const left = x - MARGIN;\n panel.style.left = `${left}px`;\n panel.style.top = `${top}px`;\n\n // Find if the panel is flowing out of the window\n const panelRect = panel.getBoundingClientRect();\n const SCREEN_WIDTH = Math.min(window.innerWidth, window.screen.width);\n if (panelRect.right > SCREEN_WIDTH) {\n const newLeft = Math.max(MARGIN, x + MARGIN - panelRect.width);\n const newCaretOffset = left - newLeft;\n panel.style.left = `${newLeft}px`;\n /** @type {HTMLElement} */\n const caret = panel.querySelector(".caret");\n caret.style.left = `${newCaretOffset}px`;\n }\n\n // As it\'s a dialog, we trap focus.\n // TODO: when